[Top][All Lists]

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

Re: jinx

From: Emanuel Berg
Subject: Re: jinx
Date: Wed, 05 Apr 2023 10:15:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Arash Esbati wrote:

>> Another idea is, text-within-code-flyspell-mode.
> ispell.el has `ispell-comments-and-strings', so I'd suggest
> `flyspell-comments-and-strings-mode'.

Can any of them spell a single word? If not, here is code
for that.

(defun spell-word (word)
      (insert word) )
    (condition-case nil
        (not (ispell-word))
      (error nil) )))
;; (spell-word "length") ; t
;; (spell-word "lenght") ; nil

(defun spell-this-word (dict)
  "`ispell-word' the word with DICT."
  (ispell-change-dictionary dict)
  (ispell-word) )

(let ((eng-dict "american-insane"))
  (defun spell-english ()
    (spell eng-dict) )

  (defun word ()
    (spell-this-word eng-dict) ))
;; test: hello / hxlle

(let ((swe-dict "svenska"))
  (defun spell-swedish ()
    (spell swe-dict) )

  (defun ord ()
    (spell-this-word swe-dict) ))
;; test: hej / hxj

Full source:

underground experts united

reply via email to

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