bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52237: 29.0.50; [PATCH] Doubled separators in context-menu-mode


From: Jim Porter
Subject: bug#52237: 29.0.50; [PATCH] Doubled separators in context-menu-mode
Date: Sat, 4 Dec 2021 12:56:09 -0800

On 12/4/2021 11:50 AM, Juri Linkov wrote:
I found another odd case, but I'm not 100% sure the best way to fix it:

   emacs -Q --eval '(context-menu-mode)'
   C-h o identity RET
   ;; Right-click somewhere in the Help buffer

There's a doubled separator after "Next Topic".
[snip]
I see no simpler way, so perhaps we need to add `context-menu-top-separator'.

Sounds good. I'll work on a patch for this and file a new bug for it once it's ready.

[1] As an aside, is there a standard naming convention to use here? Should
"separator" go at the beginning of the name or the end?

`context-menu-middle-separator' is a function, so it requires the
`context-menu-' prefix.  It adds the menu item [middle-separator].
Since "middle" is an adjective, the word order can't be "separator-middle".
But "buffers-separator" doesn't look nicer than `separator-buffers'.

I think `FOO-separator' is the best choice here for the separators themselves. `FOO' acts as a noun adjunct[1], modifying the underlying object: a separator. For functions that just make a separator, they'd be named `MODULE-[FOO-]-separator', with `FOO-' being optional if it would be redundant with the module name. So then `context-menu-middle-separator' is the right function name, and it adds a separator named `middle-separator'.

`buffers-separator' is a bit of an odd phrasing since, as the Wikipedia article mentions, "Noun adjuncts were traditionally mostly singular". However, I think it's still a bit easier to read that correctly as "the separator used to mark the buffers", whereas `separator-buffers' reads more like "buffers used to separate things" to me.

Since this should just be a trivial renaming, hopefully we can merge that into Emacs 28 so we're not locked into the current names.

[1] https://en.wikipedia.org/wiki/Noun_adjunct





reply via email to

[Prev in Thread] Current Thread [Next in Thread]