Pietro <pulsarpie...@posteo.net> writes: > I prefer to run the spell checker at a separate > stage since it takes a bit of concentration to me > when I am writing in English I couldn't cope with > external interactions/distractions of any sort very > well ...
Indeed, there is that, but there is also the problem of the incomplete wordlists. When I just now wrote in Swedish only two short paragraphs, and after that did spelling, it found the following words - Sydostpassaden Humboldtströmmen Galapagosströmmarna Sydekvatorialströmmarna Pizarro guldmakrill flygfiskbete - which are all correct what I can see. But it also found one real mistake so I'm not complaining. But to have it mark all those words as potentially trouble while I write the paragraphs - that would be equal to not writing but instead go back all the time and verify the correct-but-indicated words... > Now that I got this working my following question is > would it be possible to auto-detect the language the > spell checker should check ? It is possible but you have to find an algorithm to detect the language - go hunt. If you find one, it is easy to implement. But I don't think it is worth the effort unless you find one like instantly and really want it. > Alternatively I am thinking of writing a function > which asks the user for the language the ispell > function should check for, it does not need to > accept all the languages and for instance I would be > more than happy to have something like that : > > Mini-buffer says: [Which language ?[e : English, i: > Italian] That's better, do that, or have two shortcuts to two functions which is what I do: (defun is-code () (member major-mode '(c++-mode emacs-lisp-mode sh-mode) )) ; add more here (defun is-message () (eq major-mode 'message-mode)) (defun do-spell-dict (dict) "Spell with DICT. If there is a region, `ispell-region'. if in a code mode, `ispell-comments-and-strings'. if in `message-mode', do `ispell-message'. Otherwise, spell everything with `ispell-buffer'." (ispell-change-dictionary dict) (save-excursion (cond (mark-active (ispell-region (mark) (point))) ((is-message) (ispell-message)) ((is-code) (ispell-comments-and-strings)) (t (ispell-buffer)) ))) (defun spell-swedish () (interactive) (do-spell-dict swe-dict)) (defun spell-english () (interactive) (do-spell-dict eng-dict)) All code: http://user.it.uu.se/~embe8573/conf/emacs-init/spell-new.el Then: (define-prefix-command 'C-o-prefix) (super-global-set-key "\C-o" 'C-o-prefix) (global-set-key "\C-oe" #'spell-english) (global-set-key "\C-os" #'spell-swedish) > Am I talking completely non-sense ? Yes. The rest of the message was good tho :) -- underground experts united http://user.it.uu.se/~embe8573 _______________________________________________ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english