unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: Michael Heerdegen <michael_heerdegen-S0/GAf8tV78@public.gmane.org>
Cc: 14957-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org
Subject: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Fri, 08 Nov 2013 21:46:26 +0100	[thread overview]
Message-ID: <86a9hevcyl.fsf@somewhere.org> (raw)
In-Reply-To: <87wqmfz96x.fsf-S0/GAf8tV78@public.gmane.org> (Michael Heerdegen's message of "Tue, 17 Sep 2013 18:47:50 +0200")

Hi Michael,

Michael Heerdegen wrote:
>>> 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).

I have the following minimal Emacs configuration file:

--8<---------------cut here---------------start------------->8---
(setq ispell-dictionary "francais")

;; spelling checker program
(setq ispell-program-name "aspell")

(message "<<< Before add-to-list >>>")
(add-to-list 'mode-line-format
             '(:eval
               (let ((dict (and (featurep 'ispell)
                                (or ispell-local-dictionary
                                    ispell-dictionary))))
                 (and dict
                      (concat " ["
                              (propertize (substring dict 0 2)
                                          'face 'mode-line-highlight)
                              "]"))))
             t)
(message "<<< After add-to-list >>>")

;; enable on-the-fly spell checking
(add-hook 'text-mode-hook
          (lambda ()
            (flyspell-mode 1)))

;; prevent flyspell from finding mistakes in the code
(add-hook 'prog-mode-hook
          (lambda ()
            ;; `ispell-comments-and-strings'
            (flyspell-prog-mode)))
--8<---------------cut here---------------end--------------->8---

And I open the following Org file:

--8<---------------cut here---------------start------------->8---
#+TITLE:     ECM pour Flyspell
#+Time-stamp: <2013-11-08>
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE:  en

* Développement
  :PROPERTIES:
  :CATEGORY: Dev
  :END:

** DONE Engager firme de relations publiques 			       :mail:
   DEADLINE: <2013-02-14 Thu>
   :LOGBOOK:
   CLOCK: [2013-02-05 Tue 09:00]--[2013-02-05 Tue 10:11] =>  1:11
   - State "TODO"        ->  "STRT"       [2013-02-05 Tue 17:48]
   - State "TODO"        ->  "STRT"       [2013-08-19 Mon 15:16]
   :END:

** TODO Appeler Laura pour bug dans le code shell 		      :phone:

Le bout de code suivant a un problème.

#+begin_src sh
wher command
#+end_src
--8<---------------cut here---------------end--------------->8---

I expect to see the language indicator, but it is not displayed in the
mode-line.

Checking the value of `mode-line-format', it seems that the code to support it
has not been added to that variable!?

Though, that code has been executed, as messages before and after it are well
displayed in the *Messages* buffer.

See demo at http://screencast.com/t/86M9ZPl8lUx.

Any idea about the problem?

Best regards,
  Seb

-- 
Sebastien Vauban





  parent reply	other threads:[~2013-11-08 20:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 12:59 bug#14957: 24.3.50; Flyspell language visible in mode line Sebastien Vauban
2013-07-26 14:21 ` Stefan Monnier
2013-09-17 16:47   ` Michael Heerdegen
     [not found]     ` <87wqmfz96x.fsf-S0/GAf8tV78@public.gmane.org>
2013-11-08 20:46       ` Sebastien Vauban [this message]
2013-11-08 21:30         ` Michael Heerdegen
2020-09-18 14:19           ` Lars Ingebrigtsen
2020-09-18 15:00             ` Michael Heerdegen
2020-09-18 15:10               ` Lars Ingebrigtsen
2020-09-18 15:45                 ` Eli Zaretskii
2020-09-19 14:01                   ` Lars Ingebrigtsen
2020-09-19 14:43                     ` Eli Zaretskii
2020-09-19 22:31                     ` Michael Heerdegen
2020-09-19 22:34                       ` Lars Ingebrigtsen
2020-09-18 16:17                 ` Michael Heerdegen
     [not found]         ` <mailman.5609.1383955137.10748.bug-gnu-emacs@gnu.org>
     [not found]           ` <mailman.5609.1383955137.10748.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2013-11-12 13:29             ` Sebastien Vauban
2013-11-14  0:03               ` Michael Heerdegen
     [not found]               ` <mailman.6021.1384387520.10748.bug-gnu-emacs@gnu.org>
2013-11-14 10:41                 ` Sebastien Vauban
2013-11-14 19:05                   ` Stefan Monnier
2014-01-14  8:58           ` Sebastien Vauban
2014-01-14 15:31             ` Michael Heerdegen
2014-01-14 17:04             ` Glenn Morris
     [not found]             ` <mailman.11900.1389713605.10748.bug-gnu-emacs@gnu.org>
2014-01-14 17:32               ` Sebastien Vauban
2014-01-14 21:33                 ` Stefan Monnier
2014-01-15 13:44                   ` Michael Heerdegen
2014-01-15 15:23                     ` Stefan Monnier
     [not found]                 ` <mailman.11946.1389735261.10748.bug-gnu-emacs@gnu.org>
     [not found]                   ` <mailman.11946.1389735261.10748.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2014-01-15 10:13                     ` Sebastien Vauban
     [not found]               ` <mailman.11900.1389713605.10748.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2014-01-14 18:12                 ` Sebastien Vauban
     [not found]             ` <mailman.11912.1389719107.10748.bug-gnu-emacs@gnu.org>
     [not found]               ` <mailman.11912.1389719107.10748.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2014-01-15 10:42                 ` Sebastien Vauban

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86a9hevcyl.fsf@somewhere.org \
    --to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
    --cc=14957-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org \
    --cc=michael_heerdegen-S0/GAf8tV78@public.gmane.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).