help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ispell single word


From: Emanuel Berg
Subject: ispell single word
Date: Fri, 15 Feb 2019 21:50:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

How do I spell a single word, from Lisp, with
ispell? (Indeed, how do ispell with ispell...)

I just wrote this. It does seem to work but the
code looks - well, like something you are not
supposed to understand!

(require 'ispell)

(defun spell-one-word (word)
  (with-temp-buffer
    (save-excursion
      (insert word) )
    (condition-case nil
        (not (ispell-word))
      (error nil)
      )))
;; (spell-one-word "length") ; t
;; (spell-one-word "lenght") ; nil

But I guess I like it fine - so far.

More on this:

    http://user.it.uu.se/~embe8573/emacs-init/spell-new.el

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]