GNU bug report logs - #14957
24.3.50; Flyspell language visible in mode line

Previous Next

Package: emacs;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14957 in the body.
You can then email your comments to 14957 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Fri, 26 Jul 2013 13:01:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sebastien Vauban <sva-news <at> mygooglest.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 26 Jul 2013 13:01:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sebastien Vauban <sva-news <at> mygooglest.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Flyspell language visible in mode line
Date: Fri, 26 Jul 2013 14:59:29 +0200
Hello,

Here is a feature request. Being forced to write evenly in two different
languages (French, my mother tongue, and English), I very often am
editing a buffer not being sure of which dictionary is currently used by
Ispell/Flyspell.

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]".

Of course, it would be good to have a default mapping between the long
dictionary names, and what must go in the mode line, so that we can
write the language in a couple of letters (maybe up to "Fly[en_US]" to
cover the corner case of the "dialects").

Best regards,
Seb




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Fri, 26 Jul 2013 14:22:02 GMT) Full text and rfc822 format available.

Message #8 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Sebastien Vauban <sva-news <at> mygooglest.com>
Cc: 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Fri, 26 Jul 2013 10:21:19 -0400
> 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.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Tue, 17 Sep 2013 16:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Sebastien Vauban <sva-news <at> mygooglest.com>, 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Tue, 17 Sep 2013 18:47:50 +0200
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Fri, 08 Nov 2013 20:47:02 GMT) Full text and rfc822 format available.

Message #14 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 14957 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Fri, 08 Nov 2013 21:46:26 +0100
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Fri, 08 Nov 2013 21:31:01 GMT) Full text and rfc822 format available.

Message #17 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Sebastien Vauban <sva-news <at> mygooglest.com>
Cc: 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Fri, 08 Nov 2013 22:30:31 +0100
Hi Sebastien,

> (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)
>                               "]"))))

That's not good.  `mode-line-format' "automatically becomes buffer-local
when set" (see C-h v).  Your `add-to-list' only manipulates the
`mode-line-format' of the current buffer when your code is evaluated
(*scratch*, probably).

You have to modify the default value, like this:

--8<---------------cut here---------------start------------->8---
(setq-default mode-line-format
	      (cons
	       '(:eval
		 (let ((dict (and (featurep 'ispell)
				  (or ispell-local-dictionary
				      ispell-dictionary))))
		   (and dict
			(concat " ["
				(propertize (substring dict 0 2)
					    'face 'mode-line-highlight)
				"]"))))
	       (default-value 'mode-line-format)))
--8<---------------cut here---------------end--------------->8---

Does that help?


Regards,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Tue, 12 Nov 2013 13:31:02 GMT) Full text and rfc822 format available.

Message #20 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Tue, 12 Nov 2013 14:29:57 +0100
Hello Michael,

Michael Heerdegen wrote:
>> (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)
>>                               "]"))))
>
> That's not good.  `mode-line-format' "automatically becomes buffer-local
> when set" (see C-h v).  Your `add-to-list' only manipulates the
> `mode-line-format' of the current buffer when your code is evaluated
> (*scratch*, probably).
>
> You have to modify the default value, like this:
>
> (setq-default mode-line-format
> 	      (cons
> 	       '(:eval
> 		 (let ((dict (and (featurep 'ispell)
> 				  (or ispell-local-dictionary
> 				      ispell-dictionary))))
> 		   (and dict
> 			(concat " ["
> 				(propertize (substring dict 0 2)
> 					    'face 'mode-line-highlight)
> 				"]"))))
> 	       (default-value 'mode-line-format)))
>
> Does that help?

Yes, it does.

However, I still wonder how to put the language indicator at the *end* of the
modeline -- I tried this at first, but I'm now sure it's not a good idea.

We can't do that by inverting the two components in the above cons expression.
And it seems I'm not yet bilingual enough in Lisp...

FYI, there is one minor annoyance; I'd like to see the language indicator only
where it makes sense, that is NOT in (almost) every buffer. For example, I do
see "fr" (my default dictionary) in the Emacs manuals, which is twice wrong:

- they're in English, and
- they're read-only...

I guess the read-only feature is the way to specify (in an automatic way) the
visibility (by default) of that feature. WDYT?  In such a case, we simply have
to add a condition in the above "and" expression.

Best regards,
  Seb

-- 
Sebastien Vauban




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Thu, 14 Nov 2013 00:05:01 GMT) Full text and rfc822 format available.

Message #23 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Sebastien Vauban <public-sva-news-D0wtAvR13HarG/iDocfnWg <at> plane.gmane.org>
Cc: Michael Heerdegen <public-michael_heerdegen-S0/GAf8tV78 <at> plane.gmane.org>,
 public-14957-ubl+/3LiMTaZdePnXv/OxA <at> plane.gmane.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Thu, 14 Nov 2013 01:03:38 +0100

"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg <at> public.gmane.org>
writes:

> However, I still wonder how to put the language indicator at the *end*
> of the modeline -- I tried this at first, but I'm now sure it's not a
> good idea.

> We can't do that by inverting the two components in the above cons
> expression.  And it seems I'm not yet bilingual enough in Lisp...

Yes, cons is wrong here, better use e.g. `append'.  You should boil
yourself some tea, and then read about lists:

(info "(elisp) Lists")

> FYI, there is one minor annoyance; I'd like to see the language
> indicator only where it makes sense, that is NOT in (almost) every
> buffer. For example, I do see "fr" (my default dictionary) in the
> Emacs manuals, which is twice wrong:
>
> - they're in English, and
> - they're read-only...
>
> I guess the read-only feature is the way to specify (in an automatic
> way) the visibility (by default) of that feature. WDYT?  In such a
> case, we simply have to add a condition in the above "and" expression.

Yes, that sounds reasonable.

@Everybody: would it make sense to add a new variable
`mode-line-dictionary' that shows the abbreviated name of the current
dictionary when appropriate?  Spell checking is essential when editing
any buffer, so showing the dictionary is not less useful than showing
the input method.  People that don't want to see it anyway could just
customize the variable to nil.  We could also make it display something
only when the dictionary is not the default one.


Regards,

Michael.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Thu, 14 Nov 2013 19:07:01 GMT) Full text and rfc822 format available.

Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Sebastien Vauban" <sva-news <at> mygooglest.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Thu, 14 Nov 2013 14:05:43 -0500
>      (setq-default mode-line-format
>                    (cons
>                     '(:eval
>                       (let ((dict (and (featurep 'ispell)
>                                        (not buffer-read-only)
>                                        (or ispell-local-dictionary
>                                            ispell-dictionary))))
>                         (and dict
>                              (propertize (concat " [" (substring dict 0 2) "]")
>                                          'face 'mode-line-highlight))))
>                     (default-value 'mode-line-format)))

The "(:eval ...)" thingy should be in ispell.el (maybe in a variable
`ispell-mode-line-dictionary').  Also it should have some mouse-face
property along with a keymap property that lets the user cycle between
his usual dictionaries with a mouse click.

Of course, the question remains of where to put it on the mode-line and
whether to enable it by default.  The mode line is pretty damn crowded
already.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Tue, 14 Jan 2014 15:33:02 GMT) Full text and rfc822 format available.

Message #29 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Sebastien Vauban <public-sva-news-D0wtAvR13HarG/iDocfnWg <at> plane.gmane.org>
Cc: public-bug-gnu-emacs-mXXj517/zsQ <at> plane.gmane.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Tue, 14 Jan 2014 16:31:51 +0100

"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg <at> public.gmane.org>
writes:

>   ╭────
>   │ File mode specification error: (wrong-type-argument
> buffer-or-string-p
>   │ (:eval (let ((dict (and (featurep (quote ispell)) (not
> buffer-read-only)
>   │ (or ispell-local-dictionary ispell-dictionary)))) (and dict
> (propertize
>   │ (concat " " (substring dict 0 2)) (quote face) (quote
>   │ mode-line-highlight))))))
>   ╰────

I've no idea what happens for you.  Can you give me a backtrace or a
reproducible recipe from emacs -Q?


Regards,

Michael.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Tue, 14 Jan 2014 17:05:02 GMT) Full text and rfc822 format available.

Message #32 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 14957 <at> debbugs.gnu.org
Cc: Sebastien Vauban <sva-news <at> mygooglest.com>
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Tue, 14 Jan 2014 12:04:00 -0500
Following message was posted via usenet and so does not show up in bug
tracker. I'm not going to mention this issue again.

"Sebastien Vauban" wrote:

> Hello Michael,
>
> Michael Heerdegen wrote:
>>> (add-to-list 'mode-line-format ...)
>>
>> That's not good. `mode-line-format' "automatically becomes
>> buffer-local when set" (see C-h v). Your `add-to-list' only
>> manipulates the `mode-line-format' of the current buffer when your
>> code is evaluated (*scratch*, probably).
>>
>> You have to modify the default value, like this:
>>
>> (setq-default mode-line-format
>> 	      (cons
>> 	       '(:eval
>> 		 (let ((dict (and (featurep 'ispell)
>> 				  (or ispell-local-dictionary
>> 				      ispell-dictionary))))
>> 		   (and dict
>> 			(concat " ["
>> 				(propertize (substring dict 0 2)
>> 					    'face 'mode-line-highlight)
>> 				"]"))))
>> 	       (default-value 'mode-line-format)))
>>
>> Does that help?
>
> It does and did.
>
> Though, when opening some types of files (?) [1], I just observed that there is
> an error message generated:
>
>   ╭────
>   │ File mode specification error: (wrong-type-argument buffer-or-string-p
>   │ (:eval (let ((dict (and (featurep (quote ispell)) (not buffer-read-only)
>   │ (or ispell-local-dictionary ispell-dictionary)))) (and dict (propertize
>   │ (concat " " (substring dict 0 2)) (quote face) (quote
>   │ mode-line-highlight))))))
>   ╰────
>
> I'm not sure what to understand from that... That `mode-line-format' must be
> a string?  Hence, how do we put the `eval' stuff?
>
> Best regards,
>   Seb
>
> [1] Opening a file with a `.csv' extension.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Tue, 14 Jan 2014 18:15:02 GMT) Full text and rfc822 format available.

Message #35 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: public-bug-gnu-emacs-mXXj517/zsQ <at> plane.gmane.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Tue, 14 Jan 2014 19:12:45 +0100

Hello Michael,

(resending it the right way for the bug tracker: via mail)

Michael Heerdegen wrote:
> "Sebastien Vauban" writes:
>
>>   ╭────
>>   │ File mode specification error: (wrong-type-argument >> buffer-or-string-p
>>   │ (:eval (let ((dict (and (featurep (quote ispell)) (not >> buffer-read-only)
>>   │ (or ispell-local-dictionary ispell-dictionary)))) (and dict >> (propertize
>>   │ (concat " " (substring dict 0 2)) (quote face) (quote
>>   │ mode-line-highlight))))))
>>   ╰────
>
> I've no idea what happens for you.  Can you give me a backtrace or a
> reproducible recipe from emacs -Q?

Yes, I now have a backtrace:

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument buffer-or-string-p (:eval (let ((dict (and (featurep (quote ispell)) (not buffer-read-only) (or ispell-local-dictionary ispell-dictionary)))) (and dict (propertize (concat " " (substring dict 0 2)) (quote face) (quote mode-line-highlight))))))
  get-text-property(0 help-echo (:eval (let ((dict (and (featurep (quote ispell)) (not buffer-read-only) (or ispell-local-dictionary ispell-dictionary)))) (and dict (propertize (concat " " (substring dict 0 2)) (quote face) (quote mode-line-highlight))))))
  (defconst csv-mode-line-help-echo (get-text-property 0 (quote help-echo) (car default-mode-line-format)) "Primary default mode line help echo text.")
  eval-buffer(#<buffer  *load*> nil "d:/Users/sva/.emacs.d/site-lisp/csv-mode.el" nil t)  ; Reading at buffer position 10682
  load-with-code-conversion("d:/Users/sva/.emacs.d/site-lisp/csv-mode.el" "d:/Users/sva/.emacs.d/site-lisp/csv-mode.el" nil t)
  csv-mode()
  set-auto-mode-0(csv-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer champs.csv> "~/champs.csv" nil nil "~/champs.csv" ((3584 1 . 1088) (24647 . 36859)))
  find-file-noselect("d:/Users/sva/champs.csv" nil nil t)
  find-file("d:/Users/sva/champs.csv" t)
  call-interactively(find-file nil nil)
  command-execute(find-file)
--8<---------------cut here---------------end--------------->8---

I can reproduce the bug with the CSV file, but my configuration is not yet minimized.

Best regards,
  Seb

-- 
Sebastien Vauban





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Tue, 14 Jan 2014 21:34:01 GMT) Full text and rfc822 format available.

Message #38 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Sebastien Vauban" <sva-news <at> mygooglest.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Tue, 14 Jan 2014 16:33:05 -0500
>   (defconst csv-mode-line-help-echo (get-text-property 0 (quote help-echo)
> (car default-mode-line-format)) "Primary default mode line help echo text.")

This is clearly a bug in csv-mode.el.
Try the patch below,


        Stefan


diff --git a/packages/csv-mode/csv-mode.el b/packages/csv-mode/csv-mode.el
index dbc6182..a8ae4e4 100644
--- a/packages/csv-mode/csv-mode.el
+++ b/packages/csv-mode/csv-mode.el
@@ -1,6 +1,6 @@
 ;;; csv-mode.el --- Major mode for editing comma/char separated values  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2003, 2004, 2012, 2013  Free Software Foundation, Inc
+;; Copyright (C) 2003, 2004, 2012, 2013, 2014  Free Software Foundation, Inc
 
 ;; Author: Francis J. Wright <F.J.Wright at qmul.ac.uk>
 ;; Time-stamp: <23 August 2004>
@@ -247,10 +247,6 @@ Number of spaces used by `csv-align-fields' after separators."
 ;;;  Mode definition, key bindings and menu
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(defconst csv-mode-line-help-echo
-  ;; See bindings.el for details of `mode-line-format' construction.
-  (get-text-property 0 'help-echo (car (default-value 'mode-line-format)))
-  "Primary default mode line help echo text.")
 
 (defconst csv-mode-line-format
   ;; See bindings.el for details of `mode-line-format' construction.
@@ -260,7 +256,6 @@ Number of spaces used by `csv-align-fields' after separators."
       (setcdr x (cons
                  `(csv-field-index-string
                    ("" csv-field-index-string
-                    ;; ,(propertize "--" 'help-echo csv-mode-line-help-echo)
                     ))
                  (cdr x))))
     ml)
@@ -803,8 +798,7 @@ Called by `csv-field-index-idle-timer'."
 	  (when (not (eq field csv-field-index-old))
 	    (setq csv-field-index-old field
 		  csv-field-index-string
-		  (and field (propertize (format "F%d" field)
-					 'help-echo csv-mode-line-help-echo)))
+		  (and field (format "F%d" field)))
 	    (force-mode-line-update))))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Wed, 15 Jan 2014 10:16:02 GMT) Full text and rfc822 format available.

Message #41 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Wed, 15 Jan 2014 11:13:42 +0100
Stefan Monnier wrote:
>>   (defconst csv-mode-line-help-echo (get-text-property 0 (quote help-echo)
>> (car default-mode-line-format)) "Primary default mode line help echo text.")
>
> This is clearly a bug in csv-mode.el.
> Try the patch below,

It does work like expected. Thanks!

> diff --git a/packages/csv-mode/csv-mode.el b/packages/csv-mode/csv-mode.el
> index dbc6182..a8ae4e4 100644
> --- a/packages/csv-mode/csv-mode.el
> +++ b/packages/csv-mode/csv-mode.el
> @@ -1,6 +1,6 @@
>  ;;; csv-mode.el --- Major mode for editing comma/char separated values  -*- lexical-binding: t -*-
>  
> -;; Copyright (C) 2003, 2004, 2012, 2013  Free Software Foundation, Inc
> +;; Copyright (C) 2003, 2004, 2012, 2013, 2014  Free Software Foundation, Inc
>  
>  ;; Author: Francis J. Wright <F.J.Wright at qmul.ac.uk>
>  ;; Time-stamp: <23 August 2004>
> @@ -247,10 +247,6 @@ Number of spaces used by `csv-align-fields' after separators."
>  ;;;  Mode definition, key bindings and menu
>  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>  
> -(defconst csv-mode-line-help-echo
> -  ;; See bindings.el for details of `mode-line-format' construction.
> -  (get-text-property 0 'help-echo (car (default-value 'mode-line-format)))
> -  "Primary default mode line help echo text.")
>  
>  (defconst csv-mode-line-format
>    ;; See bindings.el for details of `mode-line-format' construction.
> @@ -260,7 +256,6 @@ Number of spaces used by `csv-align-fields' after separators."
>        (setcdr x (cons
>                   `(csv-field-index-string
>                     ("" csv-field-index-string
> -                    ;; ,(propertize "--" 'help-echo csv-mode-line-help-echo)
>                      ))
>                   (cdr x))))
>      ml)
> @@ -803,8 +798,7 @@ Called by `csv-field-index-idle-timer'."
>  	  (when (not (eq field csv-field-index-old))
>  	    (setq csv-field-index-old field
>  		  csv-field-index-string
> -		  (and field (propertize (format "F%d" field)
> -					 'help-echo csv-mode-line-help-echo)))
> +		  (and field (format "F%d" field)))
>  	    (force-mode-line-update))))))
>  
>  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Best regards,
  Seb

-- 
Sebastien Vauban




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Wed, 15 Jan 2014 10:44:01 GMT) Full text and rfc822 format available.

Message #44 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Wed, 15 Jan 2014 11:42:09 +0100
Glenn Morris wrote:
> Following message was posted via usenet and so does not show up in bug
> tracker. I'm not going to mention this issue again.

It won't happen anymore to me, thanks to the following code (adapted
from code given to me by Michael Heerdegen -- thanks a lot to him!):

--8<---------------cut here---------------start------------->8---
    (defun my/gnus-summary-followup-with-original ()
      "Force sending messages to `gnu.emacs.bug' per email."
      (interactive)
      (if (string-match (rx "gnu.emacs.bug") gnus-newsgroup-name)
                                      ; answer per email
          (call-interactively 'gnus-summary-wide-reply-with-original)
                                      ; post via news
        (call-interactively 'gnus-summary-followup-with-original)))

    (define-key gnus-summary-mode-map
      (kbd "F") 'my/gnus-summary-followup-with-original)
--8<---------------cut here---------------end--------------->8---

Best regards,
  Seb

-- 
Sebastien Vauban




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Wed, 15 Jan 2014 13:45:01 GMT) Full text and rfc822 format available.

Message #47 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Sebastien Vauban <sva-news <at> mygooglest.com>, 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Wed, 15 Jan 2014 14:44:48 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> This is clearly a bug in csv-mode.el.
> Try the patch below,

Thanks, Stefan.  Should we send it to the csv-mode maintainer (or do you
have already)?

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Wed, 15 Jan 2014 15:24:02 GMT) Full text and rfc822 format available.

Message #50 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Sebastien Vauban <sva-news <at> mygooglest.com>, 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Wed, 15 Jan 2014 10:23:54 -0500
>> This is clearly a bug in csv-mode.el.
>> Try the patch below,
> Thanks, Stefan.  Should we send it to the csv-mode maintainer (or do you
> have already)?

I installed it in `elpa/packages/csv-mode', thank you.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Fri, 18 Sep 2020 14:20:02 GMT) Full text and rfc822 format available.

Message #53 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Sebastien Vauban <sva-news <at> mygooglest.com>, 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Fri, 18 Sep 2020 16:19:00 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> You have to modify the default value, like this:
>
> (setq-default mode-line-format
> 	      (cons
> 	       '(:eval
> 		 (let ((dict (and (featurep 'ispell)
> 				  (or ispell-local-dictionary
> 				      ispell-dictionary))))
> 		   (and dict
> 			(concat " ["
> 				(propertize (substring dict 0 2)
> 					    'face 'mode-line-highlight)
> 				"]"))))
> 	       (default-value 'mode-line-format)))

Everybody seemed to be in violent agreement about making Flyspell (and
friends) display the language currently in use (and I agree, too), but
the discussion petered out when the discussion turned to where to put
this.

Perhaps putting it in the Flyspell lighter?  So it'd be

... (Text Fly[br] Fill)

or something?

I'm not sure whether that's possible with the mode line machinery,
though -- we want clicking on "Fly" to switch the mode off, but clicking
on "[br]" to allow changing the dictionary.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Fri, 18 Sep 2020 15:01:01 GMT) Full text and rfc822 format available.

Message #56 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Sebastien Vauban <sva-news <at> mygooglest.com>, 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Fri, 18 Sep 2020 17:00:19 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Perhaps putting it in the Flyspell lighter?  So it'd be
>
> ... (Text Fly[br] Fill)

Yes, I think so.  What's a reasonable alternative at all?

> I'm not sure whether that's possible with the mode line machinery,
> though -- we want clicking on "Fly" to switch the mode off, but
> clicking on "[br]" to allow changing the dictionary.

That should be possible I think.  Ideally, the part with the clickable
language would be factored as a separately usable mode-line element so
that people who don't want to have all minor modes in the mode-line
still can take advantage of something built-in.


Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Fri, 18 Sep 2020 15:12:01 GMT) Full text and rfc822 format available.

Message #59 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Sebastien Vauban <sva-news <at> mygooglest.com>, 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Fri, 18 Sep 2020 17:10:53 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Perhaps putting it in the Flyspell lighter?  So it'd be
>>
>> ... (Text Fly[br] Fill)
>
> Yes, I think so.  What's a reasonable alternative at all?

The language could be put in the mode-line-process position, which is
ahead of the modes:

  ...  [br]  (Text Fly Fill)

>> I'm not sure whether that's possible with the mode line machinery,
>> though -- we want clicking on "Fly" to switch the mode off, but
>> clicking on "[br]" to allow changing the dictionary.
>
> That should be possible I think.

I haven't looked at how minor mode lighters are constructed -- if we can
use any old mode line constructs, then it should be fine.  I.e., instead
of

(propertize "Fly" ...)

it'd be

(,(propertize "Fly" ...) ,(propertize "[br]"...))

> Ideally, the part with the clickable
> language would be factored as a separately usable mode-line element so
> that people who don't want to have all minor modes in the mode-line
> still can take advantage of something built-in.

I didn't consider that use case, but that should be easy enough to
achieve.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Fri, 18 Sep 2020 15:45:02 GMT) Full text and rfc822 format available.

Message #62 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: michael_heerdegen <at> web.de, sva-news <at> mygooglest.com, 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Fri, 18 Sep 2020 18:45:02 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Fri, 18 Sep 2020 17:10:53 +0200
> Cc: Sebastien Vauban <sva-news <at> mygooglest.com>, 14957 <at> debbugs.gnu.org
> 
> Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> 
> > Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> >
> >> Perhaps putting it in the Flyspell lighter?  So it'd be
> >>
> >> ... (Text Fly[br] Fill)
> >
> > Yes, I think so.  What's a reasonable alternative at all?
> 
> The language could be put in the mode-line-process position, which is
> ahead of the modes:
> 
>   ...  [br]  (Text Fly Fill)

That's sub-optimal IMO.  I like the "Fly[br]" variant much better.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Fri, 18 Sep 2020 16:19:02 GMT) Full text and rfc822 format available.

Message #65 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Sebastien Vauban <sva-news <at> mygooglest.com>, 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Fri, 18 Sep 2020 18:17:59 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> (propertize "Fly" ...)

Isn't it possible to use a sequence of multiple `propertize' mode-line
specs?

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Sat, 19 Sep 2020 14:03:01 GMT) Full text and rfc822 format available.

Message #68 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: michael_heerdegen <at> web.de, sva-news <at> mygooglest.com, 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Sat, 19 Sep 2020 16:01:57 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> That's sub-optimal IMO.  I like the "Fly[br]" variant much better.

Me too.  Or...  Fly/br?  That's one character less.  I did that instead;
feel free to change if "Fly[br]" is more understandable.

Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Isn't it possible to use a sequence of multiple `propertize' mode-line
> specs?

Hm...  I thought they were overwritten here:

(defvar mode-line-modes
[...]
	  `(:propertize ("" minor-mode-alist)
			mouse-face mode-line-highlight
			help-echo "Minor mode\n\
mouse-1: Display minor mode menu\n\
mouse-2: Show help for minor mode\n\
mouse-3: Toggle minor modes"
			local-map ,mode-line-minor-mode-keymap)

But the properties :propertize properties seem to survive?  Yup.

Now implemented and pushed.  I had to cheat a bit here, since the
define-minor-mode machinery doesn't allow evaluating anything at all in
the :lighter keyword, so I had to put a keymap construct directly into
it:

+              local-map (keymap
+                         (mode-line keymap
+                                    (mouse-1 . ispell-change-dictionary))))))

Which is kinda hacky, but...

There was also some suggestion about showing this data in all buffers
that have ispell-dictionary bound, but in my testing, I found that that
led to the language being displayed in some special modes, too, so I
don't think that's workable.  So it's just in Flyspell mode.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 19 Sep 2020 14:03:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 14957 <at> debbugs.gnu.org and Sebastien Vauban <sva-news <at> mygooglest.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 19 Sep 2020 14:03:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Sat, 19 Sep 2020 14:44:01 GMT) Full text and rfc822 format available.

Message #75 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: michael_heerdegen <at> web.de, sva-news <at> mygooglest.com, 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Sat, 19 Sep 2020 17:43:30 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: michael_heerdegen <at> web.de,  sva-news <at> mygooglest.com,  14957 <at> debbugs.gnu.org
> Date: Sat, 19 Sep 2020 16:01:57 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > That's sub-optimal IMO.  I like the "Fly[br]" variant much better.
> 
> Me too.  Or...  Fly/br?  That's one character less.  I did that instead;
> feel free to change if "Fly[br]" is more understandable.

Fly/xx is fine by me, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Sat, 19 Sep 2020 22:32:02 GMT) Full text and rfc822 format available.

Message #78 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: sva-news <at> mygooglest.com, Eli Zaretskii <eliz <at> gnu.org>,
 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Sun, 20 Sep 2020 00:31:10 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> +              local-map (keymap
> +                         (mode-line keymap
> +                                    (mouse-1 . ispell-change-dictionary))))))
>
> Which is kinda hacky, but...

I guess you could use a symbol alternatively - or just define the whole
lighter expression as a `defvar' instead?  That might also make further
changes easier.

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14957; Package emacs. (Sat, 19 Sep 2020 22:35:02 GMT) Full text and rfc822 format available.

Message #81 received at 14957 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 14957 <at> debbugs.gnu.org
Subject: Re: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Sun, 20 Sep 2020 00:34:02 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> +              local-map (keymap
>> +                         (mode-line keymap
>> +                                    (mouse-1 . ispell-change-dictionary))))))
>>
>> Which is kinda hacky, but...
>
> I guess you could use a symbol alternatively - or just define the whole
> lighter expression as a `defvar' instead?  That might also make further
> changes easier.

Oh, yeah, that should work -- define-minor-mode uses the form after
:lighter verbatim, but a single-symbol value is also valid (i.e., it's
used as a variable).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 Oct 2020 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.