From: Emanuel Berg <embe8573@student.uu.se>
To: info-gnus-english@gnu.org
Subject: Re: Trigger spell checking before sending
Date: Sat, 13 Feb 2016 04:27:28 +0100 [thread overview]
Message-ID: <87wpq9qogv.fsf@debian.uxu> (raw)
In-Reply-To: <87vb5uvxbd.fsf@pietrop-debian64RfL.eng.citrite.net>
Pietro <pulsarpietro@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
next prev parent reply other threads:[~2016-02-13 3:27 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 22:47 Pietro
2016-02-11 23:34 ` Emanuel Berg
2016-02-12 14:05 ` Pietro
2016-02-13 3:27 ` Emanuel Berg [this message]
2016-02-13 4:42 ` Emanuel Berg
2016-02-18 16:11 ` Pietro
2016-02-19 0:17 ` Emanuel Berg
2016-02-19 10:20 ` Pietro
2016-03-05 17:38 ` Pietro
2016-03-05 17:43 ` Pietro
2016-03-06 5:53 ` Emanuel Berg
2016-02-19 13:53 ` B.V. Raghav
2016-02-19 20:15 ` Emanuel Berg
2016-02-20 7:12 ` B.V. Raghav
2016-02-15 11:12 ` Peter Münster
2016-02-12 0:07 ` Trigger spell checking before sending [flyspell?] Andrzej A. Filip
2016-02-12 0:21 ` Emanuel Berg
2016-02-12 8:58 ` Andrzej A. Filip
2016-02-13 4:47 ` Emanuel Berg
[not found] ` <mailman.4442.1455236524.843.info-gnus-english@gnu.org>
2016-02-12 9:41 ` Loris Bennett
2016-02-13 5:00 ` Emanuel Berg
2016-02-12 7:31 ` Trigger spell checking before sending Eric S Fraga
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wpq9qogv.fsf@debian.uxu \
--to=embe8573@student.uu.se \
--cc=info-gnus-english@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).