unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Drew Adams <drew.adams@oracle.com>,
	"52237@debbugs.gnu.org" <52237@debbugs.gnu.org>
Subject: bug#52237: 29.0.50; [PATCH] Doubled separators in context-menu-mode
Date: Thu, 2 Dec 2021 10:09:29 -0800	[thread overview]
Message-ID: <6e042c91-802b-a7c6-8dc6-2ef5d5a6d1ab@gmail.com> (raw)
In-Reply-To: <SJ0PR10MB54883CA250CA3BA5D50AEFDDF3699@SJ0PR10MB5488.namprd10.prod.outlook.com>

On 12/2/2021 9:31 AM, Drew Adams wrote:
> Why should any repetition of separators be removed
> or ignored?
> 
> If someone codes that then they presumably want that.
> Vanilla Emacs need not code such repetition.

As far as I understand (which isn't very far; I've only just started 
tinkering with context-menu-mode), the general idea is that the context 
menu is generated dynamically by a list of functions stored in 
`context-menu-functions'. Each of these can add items to the menu. Some 
of these, like `context-menu-minor', first add a separator and then 
iterate over a list of things (minor modes in this case) to add more 
items. If that list is empty, you just get a separator, but then that 
separator might get doubled up with the separator from the *next* 
context menu function.

In some cases, these separators are used as anchors to determine where 
to put the results of *later* context menu functions too. For example, 
`context-menu-middle-separator' is one of the default entries in 
`context-menu-functions', and as the name implies, it *only* adds a 
separator. Some other context menu functions (e.g. `elisp-context-menu') 
look for that separator to know where to put new menu items, so we want 
that separator to be there during construction, even if it might result 
in duplicated separators by the end (which `context-menu-map' would then 
strip out before display). This logic could apply to separators 
generated by other functions too, such as `context-menu-minor' described 
above.





  reply	other threads:[~2021-12-02 18:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02  6:06 bug#52237: 29.0.50; [PATCH] Doubled separators in context-menu-mode Jim Porter
2021-12-02  8:24 ` Lars Ingebrigtsen
2021-12-02 17:44   ` Juri Linkov
2021-12-03  4:46     ` bug#52237: 29.0.50; [PATCH 2] " Jim Porter
2021-12-03 16:10       ` Lars Ingebrigtsen
2021-12-05  9:32       ` Juri Linkov
2021-12-05 20:20         ` Lars Ingebrigtsen
2021-12-03 16:08     ` bug#52237: 29.0.50; [PATCH] " Lars Ingebrigtsen
2021-12-04  6:44       ` Jim Porter
2021-12-04  8:26         ` Eli Zaretskii
2021-12-02 17:31 ` bug#52237: [External] : " Drew Adams
2021-12-02 18:09   ` Jim Porter [this message]
2021-12-02 18:25     ` bug#52237: [External] : " Drew Adams
2021-12-02 18:47 ` Jim Porter
2021-12-04 19:50   ` Juri Linkov
2021-12-04 20:56     ` Jim Porter
2021-12-04 22:09       ` Jim Porter

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=6e042c91-802b-a7c6-8dc6-2ef5d5a6d1ab@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=52237@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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).