Subject: bug#78660: [PATCH] Add context menu for commenting in prog-mode

From: Juri Linkov <[email-masked]>
Date: Wed, 04 Jun 2025 20:41:32 +0300

>> While there are a wide range of commands, I think only the common ones
>> should be added to the context menu. I don't think stuffing context
>> menus with all possible commands is a good choice, this will cause
>> users end up finding commands in submenus.
>
> Or like there is for example 'treesit-font-lock-level' that defines
> how much fontification the user wants, we could add an option that
> defines how many menu items the user wants to add to the context menu.

Actually there are already commenting-related menu items
in many mode menus, for example, in emacs-lisp-mode:

  Emacs Lisp -> Comment Out Region

in c-mode:

  C -> Comment Out Region
       Uncomment Region
       Fill Comment Paragraph

However, they are inconsistent and vary from mode to mode.
So maybe a new option like 'context-menu-items'
could support a set of symbols, where a possible symbol for
mode-independent comment-related menu items could be 'comment'.