From: Juri Linkov <juri@linkov.net>
To: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
Cc: "Mattias Engdegård" <mattiase@acm.org>,
"Tak Kunihiro" <homeros.misasa@gmail.com>,
50067@debbugs.gnu.org, "Lars Ingebrigtsen" <larsi@gnus.org>,
"Alan Third" <alan@idiocy.org>
Subject: bug#50067: Context menus
Date: Sun, 22 Aug 2021 11:28:02 +0300 [thread overview]
Message-ID: <87lf4tews5.fsf@mail.linkov.net> (raw)
In-Reply-To: <060413B6-E0EF-491D-986F-3988C255729F@misasa.okayama-u.ac.jp> (Tak Kunihiro's message of "Sat, 21 Aug 2021 13:43:53 +0900")
> I’m new to 28 and it will take a while to adopt to it.
> I’m sending comments so far.
Thanks for the comments.
> * Binding
>
> I suggest to assign [drag-mouse-3] as well, as shown below.
>
> (define-key map [mouse-3] context-menu-entry)
> (define-key map [drag-mouse-3] context-menu-entry)
There is no need to bind [drag-mouse-3] because [down-mouse-3] is bound.
> On Mac, I suggest to assign [C-double-mouse-1] as well as shown below.
>
> (define-key map [C-down-mouse-1] #'ignore)
> (define-key map [C-mouse-1] context-menu-entry)
> (define-key map [C-double-mouse-1] context-menu-entry)
> (define-key map [C-triple-mouse-1] context-menu-entry)
> (define-key map [C-drag-mouse-1] context-menu-entry)
I leave this for the users of Mac to decide what would be better on Mac.
> * Error detection system
>
> It is good if the context-menu system is ready for
> an error that occurs on one of context-menu-functions.
> For now, when there is error, Emacs only tells
> `<mouse-3> is undefined'.
I agree, a better error reporting would be nice. Patches welcome.
> * Long click system
>
> It’s time to discuss long-left-click also as trigger to
> show context menu.
>
> https://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00267.html
> https://lists.gnu.org/archive/html/emacs-devel/2020-09/msg01277.html
I tried to implement this, but soon found that long-left-click is unusable,
because such artificial delay is a hassle - no one would have
patience to wait even half a second until the menu finally appears.
But this could be implemented anyway when users will demand this.
> * Open by other frame
>
> File would be opened by this window. Sometimes I want to open it by
> other frame. It is good if which window to open, is selectable after
> showing context-menu. I do not know how to do so.
Sorry, I don't understand what menu do you mean, maybe in Dired mode?
> * Details
>
> It is handy to have buffer menu when right click mode bar.
I don't see where buffer-menu-open currently is used on the mode-line.
> (define-key map [remap buffer-menu-open] context-menu-entry)
This gives the error "void-variable map".
> Also it is handy to have frame menu when right click title bar.
I think this is a good idea.
> I do not know how to do so.
I do not know how to do this for the frame title bar.
But currently I'm doing this for the tab bar.
> Also it is nice to show word candidates by ispell when click a word.
Maybe like flyspell-mode?
> ** context-menu-region
>
> All commands belong to `Edit' in menu bar.
> I think `context-menu-edit' sounds better.
I already tried to use your idea to name it `context-menu-edit'.
But the problem is that other functions like context-menu-undo are also
related to editing. OTOH, some items in context-menu-region don't do
editing such as "Select All" is not editing, "Copy" is not editing, etc.
> Isn't it better to use `menu-bar-edit-menu' as a source rather than
> create a menu from scratch?
I already tried this idea but this menu is already available
in the global menu that already can be enabled by adding
context-menu-global to context-menu-functions.
But maybe `context-menu-edit' could be added as well
from `menu-bar-edit-menu'.
> On paste when there is a region and delete-selection-mode is t, the
> region should be replaced by the text.
Please explain how the region should be replaced by the text,
when mouse-yank-at-click or mouse-yank-primary is used
to paste where the mouse is clicked. Should it delete the region
and paste where mouse is clicked on another part of the buffer?
What if the mouse is clicked in another window?
> ** no multiple horizontal lines
>
> Sometimes I see double lines on the context menu. I think that there is
> no useful case to have double lines. To allow only one horizontal line
> would look cool.
Right, double separators should be removed.
> ** reuse existing menu
>
> I cannot figure out how to include pre-existing menu such for
> (mouse-buffer-menu-map). To lean how to manipulate menu is not easy.
> It's nice to have an example something like below (does not work).
>
> (defun context-menu-buffer (menu)
> "Add a buffer menu entry to MENU."
> (let ((map (mouse-buffer-menu-map)))
> (define-key-after menu [buffer] map))
> menu)
Adding the existing menu is not easy. There are some examples in
context-menu-global, context-menu-local, context-menu-minor.
next prev parent reply other threads:[~2021-08-22 8:28 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <74BC00E9-2509-47DA-9428-1523FF7F3B33@acm.org>
2021-08-18 16:42 ` bug#50067: Context menus Juri Linkov
2021-08-18 17:46 ` Mattias Engdegård
2021-08-18 17:53 ` Eli Zaretskii
2021-08-19 14:22 ` Mattias Engdegård
2021-08-20 7:31 ` Juri Linkov
2021-08-20 17:06 ` Mattias Engdegård
2021-08-20 23:31 ` Dmitry Gutov
2021-08-21 4:43 ` Tak Kunihiro
2021-08-21 6:33 ` Tak Kunihiro
2021-08-22 8:28 ` Juri Linkov [this message]
2021-08-23 3:11 ` Tak Kunihiro
2021-08-23 7:24 ` Juri Linkov
2021-08-24 10:12 ` Tak Kunihiro
2021-08-24 17:23 ` Juri Linkov
2021-08-24 23:43 ` Tak Kunihiro
2021-08-25 17:45 ` Juri Linkov
2021-08-26 6:13 ` Juri Linkov
2021-08-27 6:24 ` Juri Linkov
2021-08-28 5:18 ` Tak Kunihiro
2021-08-31 17:37 ` Juri Linkov
2021-08-31 17:43 ` Juri Linkov
2021-08-31 18:58 ` Eli Zaretskii
2021-09-01 7:12 ` Juri Linkov
2021-08-18 17:46 ` Eli Zaretskii
2021-08-18 18:01 ` Mattias Engdegård
2021-08-18 18:11 ` Eli Zaretskii
2021-08-18 18:06 ` Juri Linkov
2021-08-18 18:12 ` Eli Zaretskii
2021-08-18 18:39 ` Eli Zaretskii
2021-08-19 1:31 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-19 6:44 ` Eli Zaretskii
2021-08-18 18:40 ` Juri Linkov
2021-08-18 18:59 ` Eli Zaretskii
2021-08-19 7:12 ` Juri Linkov
2021-08-19 7:57 ` Eli Zaretskii
2021-08-20 7:29 ` Juri Linkov
2021-08-20 10:29 ` Mattias Engdegård
2021-08-20 10:53 ` Eli Zaretskii
2021-08-20 11:32 ` Mattias Engdegård
2021-08-20 16:50 ` Juri Linkov
2021-08-20 17:11 ` Mattias Engdegård
2021-08-20 11:32 ` Eli Zaretskii
2021-08-20 16:36 ` Juri Linkov
2021-08-20 17:59 ` Eli Zaretskii
2021-08-20 19:29 ` Mattias Engdegård
2021-08-21 9:42 ` Alan Third
2021-08-21 10:57 ` Mattias Engdegård
2021-08-21 11:17 ` Eli Zaretskii
2021-08-21 11:45 ` Mattias Engdegård
2021-08-21 12:16 ` Eli Zaretskii
2021-08-22 19:11 ` Dmitry Gutov
2021-08-22 19:22 ` Eli Zaretskii
2021-08-22 19:54 ` Dmitry Gutov
2021-08-23 2:21 ` Eli Zaretskii
2021-08-23 11:18 ` Dmitry Gutov
2021-08-23 11:40 ` Eli Zaretskii
2021-08-23 16:02 ` Juri Linkov
2021-08-24 17:59 ` Dmitry Gutov
2021-08-25 14:15 ` Dmitry Gutov
2021-08-25 15:59 ` Eli Zaretskii
2021-08-26 13:01 ` Eli Zaretskii
2021-08-26 21:05 ` Dmitry Gutov
2021-08-26 21:07 ` Dmitry Gutov
2021-08-27 6:13 ` Juri Linkov
2021-08-27 6:26 ` Eli Zaretskii
2021-08-30 2:45 ` Dmitry Gutov
2021-08-30 11:57 ` Eli Zaretskii
2021-08-31 7:05 ` Juri Linkov
2021-08-31 12:24 ` Dmitry Gutov
2021-08-31 16:56 ` Juri Linkov
2021-08-31 20:23 ` Dmitry Gutov
2021-09-01 7:08 ` Juri Linkov
2021-09-01 19:03 ` Dmitry Gutov
2021-09-05 0:55 ` Dmitry Gutov
2021-09-05 8:37 ` Juri Linkov
2021-09-05 19:25 ` Dmitry Gutov
2021-08-22 8:46 ` Juri Linkov
2021-08-15 8:48 Juri Linkov
2021-08-15 11:56 ` Lars Ingebrigtsen
2021-08-15 16:12 ` Juri Linkov
2021-08-16 11:31 ` Lars Ingebrigtsen
2021-08-17 8:12 ` Juri Linkov
2021-08-18 4:38 ` Tak Kunihiro
2021-08-18 7:47 ` Juri Linkov
2021-08-28 9:08 ` Naoya Yamashita
2021-08-28 18:50 ` Juri Linkov
2021-09-27 15:30 ` Juri Linkov
2021-09-27 15:50 ` Lars Ingebrigtsen
2021-09-28 18:49 ` Juri Linkov
2021-09-29 7:00 ` Juri Linkov
2021-09-27 18:41 ` Eli Zaretskii
2021-09-28 18:54 ` Juri Linkov
2021-09-28 19:31 ` Eli Zaretskii
2021-09-27 15:33 ` Juri Linkov
2021-10-20 16:59 ` Juri Linkov
2021-11-08 20:05 ` Juri Linkov
2021-11-18 18:38 ` Juri Linkov
2021-11-25 7:50 ` Juri Linkov
2021-11-25 8:38 ` Eli Zaretskii
2021-11-25 19:28 ` Juri Linkov
2021-11-30 18:12 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lf4tews5.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=50067@debbugs.gnu.org \
--cc=alan@idiocy.org \
--cc=homeros.misasa@gmail.com \
--cc=larsi@gnus.org \
--cc=mattiase@acm.org \
--cc=tkk@misasa.okayama-u.ac.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).