unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode
@ 2017-05-28  9:46 Charles A. Roelli
  2017-05-30 23:16 ` npostavs
  0 siblings, 1 reply; 11+ messages in thread
From: Charles A. Roelli @ 2017-05-28  9:46 UTC (permalink / raw)
  To: 27114

(followup from Bug#27040, where this was first mentioned)

While you click and hold the mouse in the fringe in an emacs-lisp mode
buffer in Emacs 25.2, the echo area indicates "Emacs-Lisp:".
(This does not happen in Emacs 24.5).

To reproduce:

   - emacs -q
   - M-x emacs-lisp-mode RET
   - Click and hold mouse-1 in the fringe.






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode
  2017-05-28  9:46 bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode Charles A. Roelli
@ 2017-05-30 23:16 ` npostavs
  2017-05-31  6:23   ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: npostavs @ 2017-05-30 23:16 UTC (permalink / raw)
  To: Charles A. Roelli; +Cc: 27114

severity 27114 minor
quit

"Charles A. Roelli" <charles@aurox.ch> writes:

> While you click and hold the mouse in the fringe in an emacs-lisp mode
> buffer in Emacs 25.2, the echo area indicates "Emacs-Lisp:".
> (This does not happen in Emacs 24.5).

It happens for me in 24.5 and 24.3 as well.

> To reproduce:
>
>   - emacs -q
>   - M-x emacs-lisp-mode RET
>   - Click and hold mouse-1 in the fringe.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode
  2017-05-30 23:16 ` npostavs
@ 2017-05-31  6:23   ` Eli Zaretskii
  2017-08-09 23:07     ` Alex
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2017-05-31  6:23 UTC (permalink / raw)
  To: npostavs; +Cc: charles, 27114

> From: npostavs@users.sourceforge.net
> Date: Tue, 30 May 2017 19:16:29 -0400
> Cc: 27114@debbugs.gnu.org
> 
> > While you click and hold the mouse in the fringe in an emacs-lisp mode
> > buffer in Emacs 25.2, the echo area indicates "Emacs-Lisp:".
> > (This does not happen in Emacs 24.5).
> 
> It happens for me in 24.5 and 24.3 as well.

Seems like it started happening in Emacs 23.1.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode
  2017-05-31  6:23   ` Eli Zaretskii
@ 2017-08-09 23:07     ` Alex
  2017-08-20 14:14       ` Charles A. Roelli
  0 siblings, 1 reply; 11+ messages in thread
From: Alex @ 2017-08-09 23:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: charles, 27114, npostavs

[-- Attachment #1: Type: text/plain, Size: 558 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: npostavs@users.sourceforge.net
>> Date: Tue, 30 May 2017 19:16:29 -0400
>> Cc: 27114@debbugs.gnu.org
>> 
>> > While you click and hold the mouse in the fringe in an emacs-lisp mode
>> > buffer in Emacs 25.2, the echo area indicates "Emacs-Lisp:".
>> > (This does not happen in Emacs 24.5).
>> 
>> It happens for me in 24.5 and 24.3 as well.
>
> Seems like it started happening in Emacs 23.1.

The following diff appears to fix this bug, but I'm not sure if it
should be applied. Hopefully it helps either way.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: elisp.diff --]
[-- Type: text/x-diff, Size: 503 bytes --]

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index b3f452ca5b..1d90fa94f3 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -45,7 +45,7 @@ emacs-lisp-mode-syntax-table
   "Syntax table used in `emacs-lisp-mode'.")
 
 (defvar emacs-lisp-mode-map
-  (let ((map (make-sparse-keymap "Emacs-Lisp"))
+  (let ((map (make-sparse-keymap))
 	(menu-map (make-sparse-keymap "Emacs-Lisp"))
 	(lint-map (make-sparse-keymap))
 	(prof-map (make-sparse-keymap))

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode
  2017-08-09 23:07     ` Alex
@ 2017-08-20 14:14       ` Charles A. Roelli
  2017-08-20 14:58         ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Charles A. Roelli @ 2017-08-20 14:14 UTC (permalink / raw)
  To: Alex; +Cc: 27114, npostavs

> From: Alex <agrambot@gmail.com>
> Date: Wed, 09 Aug 2017 17:07:57 -0600
> 
> The following diff appears to fix this bug, but I'm not sure if it
> should be applied. Hopefully it helps either way.
> 
> diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
> index b3f452ca5b..1d90fa94f3 100644
> --- a/lisp/progmodes/elisp-mode.el
> +++ b/lisp/progmodes/elisp-mode.el
> @@ -45,7 +45,7 @@ emacs-lisp-mode-syntax-table
>    "Syntax table used in `emacs-lisp-mode'.")
>  
>  (defvar emacs-lisp-mode-map
> -  (let ((map (make-sparse-keymap "Emacs-Lisp"))
> +  (let ((map (make-sparse-keymap))
>  	(menu-map (make-sparse-keymap "Emacs-Lisp"))
>  	(lint-map (make-sparse-keymap))
>  	(prof-map (make-sparse-keymap))

Thanks for finding this out.  The function that prints "Emacs-Lisp:"
to the echo area during the click is "read_char_minibuf_menu_prompt"
(keyboard.c), which calls Fkeymap_prompt (which in the scenario of
this bug, returns "Emacs-Lisp"), and eventually executes these lines:

      /* Prompt with that and read response.  */
      message3_nolog (apply1 (intern ("concat"), Fnreverse (menu_strings)));

Maybe it's wrong for "read_char" to call this function
("read_char_minibuf_menu_prompt") for some click events.

For reference, the backtrace is here:

#0  read_char_minibuf_menu_prompt (map=<optimized out>, commandflag=<optimized out>) at keyboard.c:8697
#1  read_char (commandflag=1, map=4342105123, prev_event=30432, used_mouse_menu=0x7fff5fbff40f, end_time=0x0) at keyboard.c:2550
#2  0x00000001000c0676 in read_key_sequence (keybuf=0x7fff5fbff4c0, bufsize=30, prompt=0, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9151
#3  0x00000001000c202c in command_loop_1 () at keyboard.c:1372
#4  0x000000010012ac53 in internal_condition_case (bfun=0x1000c1d30 <command_loop_1>, handlers=<optimized out>, hfun=0x1000ba260 <cmd_error>) at eval.c:1323
#5  0x00000001000b7c38 in command_loop_2 (ignore=<optimized out>) at keyboard.c:1114
#6  0x000000010012acd7 in internal_catch (tag=<optimized out>, func=0x1000b7c10 <command_loop_2>, arg=0) at eval.c:1088
#7  0x00000001000b73a8 in command_loop () at keyboard.c:1093
#8  0x00000001000b7489 in recursive_edit_1 () at keyboard.c:699
#9  0x00000001000ba551 in Frecursive_edit () at keyboard.c:770
#10 0x00000001000affe8 in main (argc=2, argv=0x7fff5fbff950) at emacs.c:1706





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode
  2017-08-20 14:14       ` Charles A. Roelli
@ 2017-08-20 14:58         ` Eli Zaretskii
  2017-08-21 13:20           ` Charles A. Roelli
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2017-08-20 14:58 UTC (permalink / raw)
  To: Charles A. Roelli; +Cc: agrambot, 27114, npostavs

> Date: Sun, 20 Aug 2017 16:14:40 +0200
> From: charles@aurox.ch (Charles A. Roelli)
> CC: eliz@gnu.org, npostavs@users.sourceforge.net,
> 	27114@debbugs.gnu.org
> 
> > --- a/lisp/progmodes/elisp-mode.el
> > +++ b/lisp/progmodes/elisp-mode.el
> > @@ -45,7 +45,7 @@ emacs-lisp-mode-syntax-table
> >    "Syntax table used in `emacs-lisp-mode'.")
> >  
> >  (defvar emacs-lisp-mode-map
> > -  (let ((map (make-sparse-keymap "Emacs-Lisp"))
> > +  (let ((map (make-sparse-keymap))
> >  	(menu-map (make-sparse-keymap "Emacs-Lisp"))
> >  	(lint-map (make-sparse-keymap))
> >  	(prof-map (make-sparse-keymap))
> 
> Thanks for finding this out.  The function that prints "Emacs-Lisp:"
> to the echo area during the click is "read_char_minibuf_menu_prompt"
> (keyboard.c), which calls Fkeymap_prompt (which in the scenario of
> this bug, returns "Emacs-Lisp"), and eventually executes these lines:
> 
>       /* Prompt with that and read response.  */
>       message3_nolog (apply1 (intern ("concat"), Fnreverse (menu_strings)));
> 
> Maybe it's wrong for "read_char" to call this function
> ("read_char_minibuf_menu_prompt") for some click events.

No, it's not wrong.  It's a feature: it provides visual feedback for
incomplete mouse clicks.  The ELisp manual explicitly says to provide
this string, which it calls "overall prompt", for all keymaps that can
be menus.  Which this keymap can.

(If you make the proposed change, and then visit some .el file and
click C-mouse-3, what do you see in the header of the pop-up menu?)

What I don't quite understand is why mouse-1 on the fringe invokes
lisp-mode-map.  Can you tell where's the offending binding which
causes that?

Thanks.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode
  2017-08-20 14:58         ` Eli Zaretskii
@ 2017-08-21 13:20           ` Charles A. Roelli
  2017-08-21 14:37             ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Charles A. Roelli @ 2017-08-21 13:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: agrambot, 27114, npostavs

> Date: Sun, 20 Aug 2017 17:58:31 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > Date: Sun, 20 Aug 2017 16:14:40 +0200
> > From: charles@aurox.ch (Charles A. Roelli)
> > CC: eliz@gnu.org, npostavs@users.sourceforge.net,
> > 	27114@debbugs.gnu.org
> > 
> > > --- a/lisp/progmodes/elisp-mode.el
> > > +++ b/lisp/progmodes/elisp-mode.el
> > > @@ -45,7 +45,7 @@ emacs-lisp-mode-syntax-table
> > >    "Syntax table used in `emacs-lisp-mode'.")
> > >  
> > >  (defvar emacs-lisp-mode-map
> > > -  (let ((map (make-sparse-keymap "Emacs-Lisp"))
> > > +  (let ((map (make-sparse-keymap))
> > >  	(menu-map (make-sparse-keymap "Emacs-Lisp"))
> > >  	(lint-map (make-sparse-keymap))
> > >  	(prof-map (make-sparse-keymap))
> > 
> > Thanks for finding this out.  The function that prints "Emacs-Lisp:"
> > to the echo area during the click is "read_char_minibuf_menu_prompt"
> > (keyboard.c), which calls Fkeymap_prompt (which in the scenario of
> > this bug, returns "Emacs-Lisp"), and eventually executes these lines:
> > 
> >       /* Prompt with that and read response.  */
> >       message3_nolog (apply1 (intern ("concat"), Fnreverse (menu_strings)));
> > 
> > Maybe it's wrong for "read_char" to call this function
> > ("read_char_minibuf_menu_prompt") for some click events.
> 
> No, it's not wrong.  It's a feature: it provides visual feedback for
> incomplete mouse clicks.  The ELisp manual explicitly says to provide
> this string, which it calls "overall prompt", for all keymaps that can
> be menus.  Which this keymap can.

Thanks.  But it seems this "overall prompt" should only be set for
menu keymaps, not general mode maps.

For example,

(keymap-prompt lisp-interaction-mode-map)
nil
(keymap-prompt python-mode-map)
nil
(keymap-prompt c-mode-map)
nil
(keymap-prompt emacs-lisp-mode-map)
"Emacs-Lisp"

> (If you make the proposed change, and then visit some .el file and
> click C-mouse-3, what do you see in the header of the pop-up menu?)

I still see "Emacs-Lisp Mode" (it's unchanged).  Notice that Alex's
change removes the "overall prompt" from the "main" Emacs Lisp mode
keymap, but not the menu-map.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode
  2017-08-21 13:20           ` Charles A. Roelli
@ 2017-08-21 14:37             ` Eli Zaretskii
  2017-08-24  9:38               ` Charles A. Roelli
  2017-10-01  4:25               ` Alex
  0 siblings, 2 replies; 11+ messages in thread
From: Eli Zaretskii @ 2017-08-21 14:37 UTC (permalink / raw)
  To: Charles A. Roelli; +Cc: agrambot, 27114, npostavs

> Date: Mon, 21 Aug 2017 15:20:14 +0200
> From: charles@aurox.ch (Charles A. Roelli)
> CC: agrambot@gmail.com, npostavs@users.sourceforge.net,
> 	27114@debbugs.gnu.org
> 
> > (If you make the proposed change, and then visit some .el file and
> > click C-mouse-3, what do you see in the header of the pop-up menu?)
> 
> I still see "Emacs-Lisp Mode" (it's unchanged).  Notice that Alex's
> change removes the "overall prompt" from the "main" Emacs Lisp mode
> keymap, but not the menu-map.

Then maybe I was confused, and Alex's patch is TRT.

Thanks.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode
  2017-08-21 14:37             ` Eli Zaretskii
@ 2017-08-24  9:38               ` Charles A. Roelli
  2018-07-18  1:45                 ` Noam Postavsky
  2017-10-01  4:25               ` Alex
  1 sibling, 1 reply; 11+ messages in thread
From: Charles A. Roelli @ 2017-08-24  9:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: agrambot, 27114, npostavs

> Date: Mon, 21 Aug 2017 17:37:44 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > Date: Mon, 21 Aug 2017 15:20:14 +0200
> > From: charles@aurox.ch (Charles A. Roelli)
> > CC: agrambot@gmail.com, npostavs@users.sourceforge.net,
> > 	27114@debbugs.gnu.org
> > 
> > > (If you make the proposed change, and then visit some .el file and
> > > click C-mouse-3, what do you see in the header of the pop-up menu?)
> > 
> > I still see "Emacs-Lisp Mode" (it's unchanged).  Notice that Alex's
> > change removes the "overall prompt" from the "main" Emacs Lisp mode
> > keymap, but not the menu-map.
> 
> Then maybe I was confused, and Alex's patch is TRT.

It seems correct, especially in light of the docstring of make-keymap:

(make-keymap &optional STRING)
[...]
The optional arg STRING supplies a menu name for the keymap
in case you use it as a menu with ‘x-popup-menu’.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode
  2017-08-21 14:37             ` Eli Zaretskii
  2017-08-24  9:38               ` Charles A. Roelli
@ 2017-10-01  4:25               ` Alex
  1 sibling, 0 replies; 11+ messages in thread
From: Alex @ 2017-10-01  4:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Charles A. Roelli, 27114, npostavs

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Mon, 21 Aug 2017 15:20:14 +0200
>> From: charles@aurox.ch (Charles A. Roelli)
>> CC: agrambot@gmail.com, npostavs@users.sourceforge.net,
>> 	27114@debbugs.gnu.org
>> 
>> > (If you make the proposed change, and then visit some .el file and
>> > click C-mouse-3, what do you see in the header of the pop-up menu?)
>> 
>> I still see "Emacs-Lisp Mode" (it's unchanged).  Notice that Alex's
>> change removes the "overall prompt" from the "main" Emacs Lisp mode
>> keymap, but not the menu-map.
>
> Then maybe I was confused, and Alex's patch is TRT.
>
> Thanks.

I think it should be applied. The reason I was hesitant in my original
message was because I wasn't sure if displaying menu names when clicking
in the fringe was correct behaviour.

If it is, then I believe the diff is TRT. If it isn't correct behaviour,
then the behaviour itself should be fixed, but I suppose the diff should
still be applied to simplify the definition a bit.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode
  2017-08-24  9:38               ` Charles A. Roelli
@ 2018-07-18  1:45                 ` Noam Postavsky
  0 siblings, 0 replies; 11+ messages in thread
From: Noam Postavsky @ 2018-07-18  1:45 UTC (permalink / raw)
  To: Charles A. Roelli; +Cc: 27114, agrambot

tags 27114 fixed
close 27114 27.1
quit

>> > > (If you make the proposed change, and then visit some .el file and
>> > > click C-mouse-3, what do you see in the header of the pop-up menu?)
>> > 
>> > I still see "Emacs-Lisp Mode" (it's unchanged).  Notice that Alex's
>> > change removes the "overall prompt" from the "main" Emacs Lisp mode
>> > keymap, but not the menu-map.
>> 
>> Then maybe I was confused, and Alex's patch is TRT.
>
> It seems correct, especially in light of the docstring of make-keymap:
>
> (make-keymap &optional STRING)
> [...]
> The optional arg STRING supplies a menu name for the keymap
> in case you use it as a menu with ‘x-popup-menu’.

I pushed it to master.

[1: 1c79d15863]: 2018-07-17 21:40:59 -0400
  Remove menu name from emacs-lisp-mode-map (Bug#27114)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1c79d15863b768fe3156647a54d03a90688dd361





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-07-18  1:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-28  9:46 bug#27114: 25.2: fringe click echoes "Emacs-Lisp:" in emacs-lisp mode Charles A. Roelli
2017-05-30 23:16 ` npostavs
2017-05-31  6:23   ` Eli Zaretskii
2017-08-09 23:07     ` Alex
2017-08-20 14:14       ` Charles A. Roelli
2017-08-20 14:58         ` Eli Zaretskii
2017-08-21 13:20           ` Charles A. Roelli
2017-08-21 14:37             ` Eli Zaretskii
2017-08-24  9:38               ` Charles A. Roelli
2018-07-18  1:45                 ` Noam Postavsky
2017-10-01  4:25               ` Alex

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).