unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33188: 26.1.50; [PATCH] Wishlist : Improve default mouse menu for mode from modeline
@ 2018-10-28 18:25 Pierre Téchoueyres
  2018-11-03  9:03 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre Téchoueyres @ 2018-10-28 18:25 UTC (permalink / raw)
  To: 33188

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

Hello,

I would submit an enhacement for when you use the mouse to display the
menu for a mode (major or minor) from the modeline.


For now, if the mode doesn't define a custom mouse menu, the menu title
simply display the mode indicator. But sometimes this indicator isn't
really obvious.

The attached patch try to improve this by appending the full mode name
after the indicator.

For example the Smartparens minor mode has 'SP' as indicator. So his
menu is look like:
---------------------
| SP
---------------------
| Turn off minor mode
| Help for minor mode
----------------------

Whit the attached patch the menu will look like:

------------------------
| SP - Smartparens Mode
------------------------
| Turn off minor mode
| Help for minor mode
------------------------

Hope this could help.

Pierre.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Wishlist : Improve default mouse menu for mode from modeline --]
[-- Type: text/x-patch, Size: 2083 bytes --]

From 8ccd620d2891eee0ec1910a002adca0ab657f7ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= <pierre.techoueyres@free.fr>
Date: Wed, 10 Oct 2018 20:08:05 +0200
Subject: [PATCH] 'minor-mode-menu-from-indicator' now display full minor mode.

When there is no menu for a mode, display the mode name after the
indicator instead of just the indicator (which is sometime cryptic).
Ex:
before : SP
now    : SP - Smartparens Mode

* etc/NEWS: Add en entry for this new feature.
* lisp/mouse.el (minor-mode-menu-from-indicator): Append the mode name
  after the indicator when there is no menu defined by the mode.
---
 etc/NEWS      | 9 ++++++++-
 lisp/mouse.el | 5 ++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index ee74e86f40..739674cf3e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -824,11 +824,18 @@ UUID at point.
 
 
 ** Interactive automatic highlighting
-
 +++
 *** 'highlight-regexp' can now highlight subexpressions.
 The now command accepts a prefix numeric argument to choose the
 subexpression.
+** Mouse display major mode menu
++++
+*** 'minor-mode-menu-from-indicator' now display full minor mode.
+When there is no menu for a mode, display the mode name after the
+indicator instead of just the indicator (which is sometime cryptic).
+Ex:
+before : SP
+now    : SP - Smartparens Mode
 
 \f
 * New Modes and Packages in Emacs 27.1
diff --git a/lisp/mouse.el b/lisp/mouse.el
index cb63ca51c5..2aba9bf458 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -169,7 +169,10 @@ minor-mode-menu-from-indicator
                 (mouse-menu-non-singleton menu)
               (if (fboundp mm-fun)      ; bug#20201
                   `(keymap
-                    ,indicator
+                    ,(format "%s - %s" indicator
+			     (capitalize
+			      (replace-regexp-in-string
+			       "-" " " (format "%S" minor-mode))))
                     (turn-off menu-item "Turn off minor mode" ,mm-fun)
                     (help menu-item "Help for minor mode"
                           (lambda () (interactive)
-- 
2.17.1


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

* bug#33188: 26.1.50; [PATCH] Wishlist : Improve default mouse menu for mode from modeline
  2018-10-28 18:25 bug#33188: 26.1.50; [PATCH] Wishlist : Improve default mouse menu for mode from modeline Pierre Téchoueyres
@ 2018-11-03  9:03 ` Eli Zaretskii
  2018-11-03 14:16   ` Pierre Téchoueyres
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2018-11-03  9:03 UTC (permalink / raw)
  To: Pierre Téchoueyres; +Cc: 33188-done

> From: Pierre Téchoueyres <pierre.techoueyres@free.fr>
> Date: Sun, 28 Oct 2018 19:25:57 +0100
> 
> For now, if the mode doesn't define a custom mouse menu, the menu title
> simply display the mode indicator. But sometimes this indicator isn't
> really obvious.
> 
> The attached patch try to improve this by appending the full mode name
> after the indicator.

Thanks, pushed to the master branch.

In the future, please mention the bug number in the commit log
message.





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

* bug#33188: 26.1.50; [PATCH] Wishlist : Improve default mouse menu for mode from modeline
  2018-11-03  9:03 ` Eli Zaretskii
@ 2018-11-03 14:16   ` Pierre Téchoueyres
  2018-11-03 16:02     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre Téchoueyres @ 2018-11-03 14:16 UTC (permalink / raw)
  To: 33188

Eli Zaretskii <eliz@gnu.org> writes:
>
> Thanks, pushed to the master branch.
>
> In the future, please mention the bug number in the commit log
> message.
>
Thanks, I'll try harder next time.

I've seen also that you've corrected the NEW's file entry. For it I
didn't know if a manual entry was necessary or not. That's for this
reason I've first posted the patch on emac-devel.

I'll try to provide a better quality patch next time.

Thanks for your work.





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

* bug#33188: 26.1.50; [PATCH] Wishlist : Improve default mouse menu for mode from modeline
  2018-11-03 14:16   ` Pierre Téchoueyres
@ 2018-11-03 16:02     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2018-11-03 16:02 UTC (permalink / raw)
  To: Pierre Téchoueyres; +Cc: 33188

> From: pierre.techoueyres@free.fr (Pierre Téchoueyres)
> Cc: eliz@gnu.org
> Date: Sat, 03 Nov 2018 15:16:57 +0100
> 
> I've seen also that you've corrected the NEW's file entry. For it I
> didn't know if a manual entry was necessary or not. That's for this
> reason I've first posted the patch on emac-devel.

The "+++" means that manuals _have_ been updated, not that there's a
need to update them.  In general, if manuals need to be updated, it is
best to provide a patch for them as part of the changeset.

Thanks.





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

end of thread, other threads:[~2018-11-03 16:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-28 18:25 bug#33188: 26.1.50; [PATCH] Wishlist : Improve default mouse menu for mode from modeline Pierre Téchoueyres
2018-11-03  9:03 ` Eli Zaretskii
2018-11-03 14:16   ` Pierre Téchoueyres
2018-11-03 16:02     ` Eli Zaretskii

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