From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Pierre =?UTF-8?Q?T=C3=A9choueyres?= Newsgroups: gmane.emacs.bugs Subject: bug#33188: 26.1.50; [PATCH] Wishlist : Improve default mouse menu for mode from modeline Date: Sun, 28 Oct 2018 19:25:57 +0100 Message-ID: <87efcaorm2.fsf@killashandra.ballybran.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1540751109 25260 195.159.176.226 (28 Oct 2018 18:25:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 28 Oct 2018 18:25:09 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 26.1.50 To: 33188@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 28 19:25:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGpkG-0006Rz-GI for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Oct 2018 19:25:04 +0100 Original-Received: from localhost ([::1]:41543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGpmM-00024L-IH for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Oct 2018 14:27:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGpmF-000243-W7 for bug-gnu-emacs@gnu.org; Sun, 28 Oct 2018 14:27:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGpmC-0000Rs-2w for bug-gnu-emacs@gnu.org; Sun, 28 Oct 2018 14:27:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45046) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGpmA-0000RE-Gi for bug-gnu-emacs@gnu.org; Sun, 28 Oct 2018 14:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGpmA-0003LO-Bw for bug-gnu-emacs@gnu.org; Sun, 28 Oct 2018 14:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pierre =?UTF-8?Q?T=C3=A9choueyres?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Oct 2018 18:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33188 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.154075118012793 (code B ref -1); Sun, 28 Oct 2018 18:27:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Oct 2018 18:26:20 +0000 Original-Received: from localhost ([127.0.0.1]:49304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGplT-0003KH-Sn for submit@debbugs.gnu.org; Sun, 28 Oct 2018 14:26:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGplS-0003K1-Tw for submit@debbugs.gnu.org; Sun, 28 Oct 2018 14:26:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGplM-0008Uv-SM for submit@debbugs.gnu.org; Sun, 28 Oct 2018 14:26:13 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:44210) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gGplK-0008UL-RI for submit@debbugs.gnu.org; Sun, 28 Oct 2018 14:26:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGplJ-000213-Sg for bug-gnu-emacs@gnu.org; Sun, 28 Oct 2018 14:26:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGplE-0008Rw-PE for bug-gnu-emacs@gnu.org; Sun, 28 Oct 2018 14:26:09 -0400 Original-Received: from smtp3-g21.free.fr ([212.27.42.3]:46385) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gGplB-0008OQ-MZ for bug-gnu-emacs@gnu.org; Sun, 28 Oct 2018 14:26:02 -0400 Original-Received: from killashandra.ballybran.fr.free.fr (unknown [IPv6:2a01:e35:2e14:eab0:d4dc:72c5:daba:b8ca]) by smtp3-g21.free.fr (Postfix) with ESMTPS id 0690213F8AF for ; Sun, 28 Oct 2018 19:25:57 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:151750 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-minor-mode-menu-from-indicator-now-display-full-mino.patch Content-Description: [PATCH] Wishlist : Improve default mouse menu for mode from modeline >From 8ccd620d2891eee0ec1910a002adca0ab657f7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= 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 * 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 --=-=-=--