emacs-devel
[Top][All Lists]
Advanced

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

RE: "modern" colors Re: Changes for emacs 28


From: Drew Adams
Subject: RE: "modern" colors Re: Changes for emacs 28
Date: Sat, 12 Sep 2020 16:27:29 +0000 (UTC)

> I want to clarify an important detail here. Right click is expected to
> display a *context menu* and the context menu is expected to contain
> commands that are related to the object that received the right click.
> This does not always correlate with “the most common operations”.
> 
> Right-clicking a misspelled word offers a list of possible
> corrections. Right-clicking with a highlighted region offers Cut and
> Copy. (Actually, Cut/Copy/Paste are always on the context menu for
> text editors, and get enabled/disabled depending on availability.) In
> a programming mode, right-clicking an identifier could offer
> xref-find-definitions and xref-find-references.
> 
> Applications made with greater attention to UI design also extend the
> context menu functionality to other UI elements. Right-clicking a
> toolbar offers to hide or customize it. Right-clicking a tab offers to
> save or close the document.
> 
> Implementing a context menu in Emacs is not a simple matter of binding
> <mouse-3> to any of the menus displayed by <C-mouse-1…3>. Someone™
> needs to pick things that are relevant in each context. More likely,
> each major mode needs to pick things that are appropriate in its
> buffers.

1. I agree with your characterization of a
   context menu.

2. The `C-mouse-3' is contextual, in the sense
   that it shows the major-mode menu(s), and some
   items in some of those menus may apply to the
   thing clicked on.

   For example, Dired mode's `Immediate' menu
   has items that apply to the file/dir of the
   clicked line.  (`C-mouse-3' shows you all of
   the Dired mode menus.)

   But it's true that most major-mode menu items
   don't apply specifically to the thing clicked.
   They're generally context-specific (major mode),
   but they aren't specific to what you click on.

   [We do also have a mouse-3 (and C-mouse-3)
   context menu for the scroll bar, BTW.]

> Implementing a context menu in Emacs is not a
> simple matter of binding <mouse-3> to any of
> the menus displayed by <C-mouse-1…3>. Someone™
> needs to pick things that are relevant in each
> context. More likely, each major mode needs to
> pick things that are appropriate in its buffers.

3. I agree that Emacs should provide helpful
   right-click context menus, and that picking
   what's helpful/relevant isn't a simple matter.

   And Emacs should provide a way for users and
   libraries to easily define their own such, or
   improve the default right-click context menus.

   I've done this with library `mouse3.el'.

   It provides a menu with context-specific items
   by default.  And it's easy to change what
   items are offered.  And you don't even need to
   give up the ordinary `mouse-3' behavior that
   lets you select text and optionally cut/delete
   the selection.

   https://www.emacswiki.org/emacs/Mouse3

   https://www.emacswiki.org/emacs/download/mouse3.el



reply via email to

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