Subject: Re: bug#52286: 28.0.90; [PATCH] Be consistent in naming of separators in context menu

From: Juri Linkov <[email-masked]>
Date: Sun, 05 Dec 2021 19:52:41 +0200

> This is spun off from bug#52237[1]. There's a minor issue with
> `context-menu-mode' where some of the separators are named `FOO-separator'
> and others are named `separator-FOO'. Since these separators are partially
> useful for context menu functions to find the right place to insert their
> items, this inconsistency could be pretty confusing for authors of those
> functions (e.g. in third-party packages).

While I agree that it would be nice to release Emacs 28 with consistent
menu separator names, the following list explains the current inconsistency
where part of separator names were based on one naming convention,
and part on another:

  lisp/cmuscheme.el
    (define-key map [separator-eval] '("--"))
  lisp/help-mode.el
    (define-key-after map [separator-1] menu-bar-separator)
  lisp/info.el
    (define-key-after map [separator-1] menu-bar-separator)
    (define-key-after map [separator-2] menu-bar-separator)
    (define-key-after map [separator-3] menu-bar-separator)
  lisp/international/mule-cmds.el
    (bindings--define-key map [separator-3] menu-bar-separator)
    (bindings--define-key map [separator-2] menu-bar-separator)
    (bindings--define-key map [separator-1] menu-bar-separator)
    (bindings--define-key map [separator-coding-system] menu-bar-separator)
    (bindings--define-key map [separator-input-method] menu-bar-separator)
    (bindings--define-key map [separator-mule] menu-bar-separator)
  lisp/menu-bar.el
    (bindings--define-key menu [separator-exit]
    (bindings--define-key menu [separator-print]
    (bindings--define-key menu [separator-tab]
    (bindings--define-key menu [separator-frame]
    (bindings--define-key menu [separator-window]
    (bindings--define-key menu [separator-save]
    (bindings--define-key menu [separator-tag-isearch]
    (bindings--define-key menu [separator-tag-search] menu-bar-separator)
    (bindings--define-key menu [separator-repeat-search]
    (bindings--define-key menu [separator-replace-tags]
    (bindings--define-key menu [separator-tag-file]
    (bindings--define-key menu [separator-xref]
    (bindings--define-key menu [separator-bookmark]
    (bindings--define-key menu [separator-search]
    (bindings--define-key menu [separator-undo] menu-bar-separator))
    (bindings--define-key menu [separator-1]
    (bindings--define-key menu [separator-2]
    (bindings--define-key menu [separator-3]
    (bindings--define-key menu [separator-keys]
    (bindings--define-key menu [separator-file]
    (bindings--define-key menu [separator-games]
    (bindings--define-key menu [separator-encryption-decryption]
    (bindings--define-key menu [separator-net]
    (bindings--define-key menu [separator-vc]
    (bindings--define-key menu [separator-compare]
    (bindings--define-key menu [separator-spell]
    (bindings--define-key menu [separator-prog]
    (bindings--define-key menu [separator-desc-mule]
  lisp/net/eudc.el
    (define-key map [separator-eudc-email] menu-bar-separator)
    (define-key map [separator-eudc-query] menu-bar-separator)
  lisp/progmodes/compile.el
    (define-key map [separator-2] nil)
    (define-key-after map [separator-compile] menu-bar-separator)
  lisp/tool-bar.el
    (define-key-after (default-value 'tool-bar-map) [separator-1] menu-bar-separator)
    (define-key-after (default-value 'tool-bar-map) [separator-2] menu-bar-separator)
    (define-key-after (default-value 'tool-bar-map) [separator-3] menu-bar-separator)
  lisp/vc/ediff-hook.el
    (define-key menu-bar-ediff-menu [separator-ediff-misc] menu-bar-separator)
    (define-key menu-bar-ediff-menu [separator-ediff-windows] menu-bar-separator)
    (define-key menu-bar-ediff-menu [separator-ediff-regions] menu-bar-separator)
    (define-key menu-bar-ediff-menu [separator-ediff-directories] menu-bar-separator)
    (define-key menu-bar-ediff-menu [separator-ediff-files] menu-bar-separator)
    (define-key menu-bar-ediff-merge-menu [separator-ediff-merge] menu-bar-separator)
    menu-bar-ediff-merge-menu [separator-ediff-merge-dirs] menu-bar-separator)
  lisp/vc/vc-dir.el
    (define-key-after map [separator-1] menu-bar-separator)
    (define-key-after map [separator-2] menu-bar-separator)
    (define-key-after map [separator-3] menu-bar-separator)

And another naming convention:

  lisp/cedet/cedet.el
    (define-key map [semantic-options-separator] #'undefined)
    (define-key map [cedet-menu-separator] #'undefined)
  lisp/cedet/ede.el
    (define-key cedet-menu-map [cedet-menu-separator] '("--")))
    (define-key cedet-menu-map [cedet-menu-separator] nil)
  lisp/cedet/semantic.el
    (define-key edit-menu [semantic-completion-separator]
    (define-key edit-menu [semantic-edit-separator]
    (define-key navigate-menu [semantic-narrow-to-defun-separator]
    (define-key navigate-menu [semantic-navigation-separator]
    (define-key cedet-menu-map [semantic-options-separator]
    (define-key cedet-menu-map [cedet-menu-separator] '("--")))
    (define-key cedet-menu-map [cedet-menu-separator] nil)
    (define-key cedet-menu-map [semantic-options-separator] nil)
  lisp/international/iso-cvt.el
    (define-key menu [load-as-separator] '("--"))
    (define-key menu [translate-separator] '("--"))
  lisp/menu-bar.el
    (bindings--define-key menu [scrollbar-separator]
    (bindings--define-key menu [linecolumn-separator]
    (bindings--define-key menu [datetime-separator]
    (bindings--define-key menu [custom-separator]
    (bindings--define-key menu [custom-separator]
    (bindings--define-key menu [showhide-separator]
    (bindings--define-key menu [mule-separator]
    (bindings--define-key menu [debugger-separator]
    (bindings--define-key menu [cursor-separator]
    (bindings--define-key menu [edit-options-separator]
    (bindings--define-key menu [highlight-separator]
  lisp/net/newst-plainview.el
    (define-key map [newsticker-separator-1]
    (define-key map [newsticker-separator-2]
    (define-key map [newsticker-separator-3]
    (define-key map [newsticker-separator-4]
  lisp/so-long.el
    (define-key-after map [so-long-actions-separator]
    (define-key-after map [so-long-help-separator]