[Top][All Lists]

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

RE: [External] : Re: Context menus and mouse-3

From: Drew Adams
Subject: RE: [External] : Re: Context menus and mouse-3
Date: Fri, 16 Jul 2021 20:05:09 +0000

> >> >> And some modes like org-mode, flyspell-mode, etc. already redefine
> >> >> down-mouse-3 to pop up context menus.
> >> >
> >> > But those modes define those context menus on special parts of
> >> > display, where pasting etc. makes less sense, no?
> >>
> >> When the buffer is not read-only, I see no reason to disallow
> >> pasting text because e.g. in flyspell-mode it makes sense
> >> to paste a correction to a misspelled word, etc.
> >
> > IMO, when mouse-3 is clocked on a misspelled word, it makes much more
> > sense to assume the user wants to fix that word than that the user
> > wants to paste.
> >
> > But here's an idea: how about merging the two menus into one in these
> > cases?  We could add a top-level menu with the two alternatives, each
> > one would then drop down one of the two possible menus.
> > Alternatively, just make a long menu by concatenating the contents of
> > the two original ones.
> >
> > WDYT?
> Tak Kunihiro had a very good idea of using a hook-like variable
> that contains a list of functions that return parts of the whole
> context-menu, then these parts will be collected into the final menu.


`mouse3.el' has these variables:



Whether the first two or the second two are used is
controlled by option `mouse3-popup-x-popup-panes-flag'.

The difference corresponds to the two possibilities
offered by `x-popup-menu'.  The default is nil, so you
can use keymaps and extended menu items to define the
`mouse-3' menu.  The alternative is easy to use but
offers fewer possibilities.

The 2 `region' vars are used when the region is active.
The 2 `noregion' vars are used otherwise.

As for the choice of whether global menus should
be included in a `mouse-3' menu: Why decide that
at design time, hard-coding the behavior?
`mouse3.el' lets users decide, with option
If non-nil then:

If the menu bar is visible then the major-mode menu
is the global menu to include on the `mouse-3' menu.
If the menu-bar is not shown then the menu-bar menus
are the menus to include on the `mouse-3' menu.

By default, the `mouse-3' menu has predefined submenus.
Users and code can modify the contents, of course.
(If the alternative panes approach is used, then the
operations are available in the single-level menu.)

These are the predefined submenus.  All except the
first are for when the region is active and nonempty.

  Miscellaneous operations on a thing at mouse pointer:
    Email, open, visit, Dired, find, describe, highlight etc.

  Change the selected text:
    Fill, indent, transpose regions, upcase, etc.

  Check, correct, or convert the selected text.

  Copy selected text: text props, kill, to register etc.

  Highlight, unhighlight, copy/yank text props.

  Miscellaneous operations on selected text:
    Count, narrow, eval, shell, write to file, etc.

  Print, PostScript print, BNF PostScript operations.

  Selected rectangle: kill, delete, open, yank, clear, etc.

  Selected text to register: copy to, delete to, etc.

  Remove/replace selected text: kill, delete, yank.

  Remove/replace selected rectangle:
    Clear, replace from last killed, string, register.

  Isearch, query replace etc.

reply via email to

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