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

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

Re: Testing validity of a word


From: Emanuel Berg
Subject: Re: Testing validity of a word
Date: Wed, 26 Jul 2023 14:06:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

uzibalqa wrote:

> I want to test whether a word is valid. Is there a package
> in Emacs for dictionary word lookup ?

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

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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