GNU bug report logs -
#14957
24.3.50; Flyspell language visible in mode line
Previous Next
Reported by: Sebastien Vauban <sva-news <at> mygooglest.com>
Date: Fri, 26 Jul 2013 13:01:03 UTC
Severity: wishlist
Tags: fixed
Found in version 24.3.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 14957 <at> debbugs.gnu.org (full text, mbox):
Hi Stefan,
some comments:
> > I think it'd be great to see the language next to "Fly" in the mode
> > line. For example, something such as "Fly[FR]" or "Fly[EN]".
>
> That'd be nice, especially if we make it active so that you can right
> click on it to select another language.
> Patches very welcome.
I think this should not be restricted to flyspell, I also want to know
the current dictionary before doing M-$ (`ispell-word'), for example.
For that purpose, I just add
,----------------------------------------------------------------------
| (:eval
| (let ((dict (and (featurep 'ispell)
| (or ispell-local-dictionary
| ispell-dictionary))))
| (and dict
| (concat " "
| (propertize (substring dict 0 2)
| 'face 'mode-line-shadow)))))
`----------------------------------------------------------------------
to `mode-line-format' (`mode-line-shadow' just shows it in gray).
About right clicking to select another language: I think most people
would want a handy command to toggle between two or three dictionaries
they frequently use.
For example, I'm a native German speaker. When composing an Email, I
want to be able to switch between German and English dict with one key -
everything else is annoying. I _never_ need any other dict. Maybe
that's what most people would want to use? I use this code for that:
--8<---------------cut here---------------start------------->8---
(setq-default flyspell-default-dictionary "american")
(defun my-ispell-toggle-dictionary ()
(interactive)
"Toggle local dictionary between German and American."
(require 'ispell)
(pcase (or ispell-local-dictionary ispell-dictionary)
(`"american" (ispell-change-dictionary "deutsch-alt8"))
(_ (ispell-change-dictionary "american")))
(force-mode-line-update))
(defun my-flyspell-toggle-dictionary ()
"Toggle local dictionary.
Turn on `flyspell-mode' if off."
(interactive)
(my-ispell-toggle-dictionary)
(ignore-errors
(when flyspell-mode (flyspell-buffer))))
--8<---------------cut here---------------end--------------->8---
Regards,
Michael.
This bug report was last modified 4 years and 241 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.