all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Ergus <spacibba@aol.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: New Context Menu
Date: Fri, 20 Aug 2021 19:41:08 +0300	[thread overview]
Message-ID: <87h7fkdq6z.fsf@mail.linkov.net> (raw)
In-Reply-To: <20210820122126.tp6zna2ei2n5wrbw@Ergus> (Ergus's message of "Fri,  20 Aug 2021 14:21:26 +0200")

> The issue is that context menu is bound to an "unmodified" mouse
> event. If you try this on xterm:
>
> (global-set-key [down-mouse-1] 'mouse-buffer-menu)
> or
> (global-set-key [down-mouse-3] 'mouse-buffer-menu)
>
> Then you should notice the same issue.
>
> Or when I press C-<down-mouse-1> (shows the menu), then release control,
> and after that, release the mouse button: same behavior (menu disappears
> and/or selects). So emacs is receiving the "up-mouse-1" as an event in
> xterm. That's the issue.

If the menu doesn't disappear with

  (global-set-key [C-down-mouse-1] 'mouse-buffer-menu)

but disappears with

  (global-set-key [down-mouse-1] 'mouse-buffer-menu)

this means there is a bug in low-level xterm handling code.

BTW, while testing xterm for a short time, I found more bugs in xterm,
e.g. clicking [M-down-mouse-1] fails in xterm with:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  encode-coding-string(nil utf-8-unix)
  #f(compiled-function (type data) "Copy DATA to the X selection using the OSC 52 escape sequence.\n\nTYPE specifies which selection to set; it must be either\n`PRIMARY' or `CLIPBOARD'.  DATA must be a string.\n\nThis can be used as a `gui-set-selection' method for\nxterm-compatible terminal emulators.  Then your system clipboard\nwill be updated whenever you copy a region of text in Emacs.\n\nIf the resulting OSC 52 sequence would be longer than\n`xterm-max-cut-length', then the TEXT is not sent to the system\nclipboard.\n\nThis function either sends a raw OSC 52 sequence or wraps the OSC\n52 in a Device Control String sequence.  This way, it will work\non a bare terminal emulators as well as inside the screen\nprogram.  When inside the screen program, this function also\nchops long DCS s
 equences into multiple smaller ones to avoid\nhitting screen's max DCS length." #<bytecode -0x1b4ad63ac0b5ef21>)(SECONDARY nil)
  apply(#f(compiled-function (type data) "Copy DATA to the X selection using the OSC 52 escape sequence.\n\nTYPE specifies which selection to set; it must be either\n`PRIMARY' or `CLIPBOARD'.  DATA must be a string.\n\nThis can be used as a `gui-set-selection' method for\nxterm-compatible terminal emulators.  Then your system clipboard\nwill be updated whenever you copy a region of text in Emacs.\n\nIf the resulting OSC 52 sequence would be longer than\n`xterm-max-cut-length', then the TEXT is not sent to the system\nclipboard.\n\nThis function either sends a raw OSC 52 sequence or wraps the OSC\n52 in a Device Control String sequence.  This way, it will work\non a bare terminal emulators as well as inside the screen\nprogram.  When inside the screen program, this function also\nchops long
  DCS sequences into multiple smaller ones to avoid\nhitting screen's max DCS length." #<bytecode -0x1b4ad63ac0b5ef21>) (SECONDARY nil))
  #f(compiled-function (&rest args) #<bytecode 0x19ad559537b92ff3>)(SECONDARY nil)
  apply(#f(compiled-function (&rest args) #<bytecode 0x19ad559537b92ff3>) (SECONDARY nil))
  gui-backend-set-selection(SECONDARY nil)
  gui-set-selection(SECONDARY nil)
  mouse-drag-secondary((M-down-mouse-1 (#<window 1 on *scratch*> 153 (42 . 10) 16176 nil 153 (41 . 3) nil (35 . 7) (1 . 0))))
  funcall-interactively(mouse-drag-secondary (M-down-mouse-1 (#<window 1 on *scratch*> 153 (42 . 10) 16176 nil 153 (41 . 3) nil (35 . 7) (1 . 0))))
  command-execute(mouse-drag-secondary)

> Just a question:
>
> If the context-menu-mode is a minor mode. Why the bindings are not added
> in a context-menu-mode-map and avoids manually saving the -old commands?
>
> Is there an issue with that?

Thanks for the idea, this should work.



  reply	other threads:[~2021-08-20 16:41 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210818120834.i3orh535tb2enpos.ref@Ergus>
2021-08-18 12:08 ` New Context Menu Ergus
2021-08-18 12:26   ` Eli Zaretskii
2021-08-18 12:43     ` Ergus
2021-08-18 13:30       ` Eli Zaretskii
2021-08-18 17:17         ` Ergus
2021-08-18 17:21           ` Eli Zaretskii
2021-08-18 17:32             ` Ergus
2021-08-18 16:50       ` Eli Zaretskii
2021-08-18 18:10         ` Ergus
2021-08-18 18:17           ` Eli Zaretskii
2021-08-18 19:23             ` Ergus
2021-08-18 19:28               ` Eli Zaretskii
2021-08-18 19:53                 ` Ergus
2021-08-19  6:31                   ` Eli Zaretskii
2021-08-19  7:07                     ` Juri Linkov
2021-08-18 19:34               ` Eli Zaretskii
2021-08-18 18:58         ` Juri Linkov
2021-08-18 19:12           ` Eli Zaretskii
2021-08-19  7:05             ` Juri Linkov
2021-08-19  7:51               ` Eli Zaretskii
2021-08-20  7:13                 ` Juri Linkov
2021-08-20 11:26                   ` Eli Zaretskii
2021-08-20 11:41                     ` Eli Zaretskii
2021-08-20 16:44                       ` Juri Linkov
2021-08-20 12:26                     ` Ergus
2021-08-20 12:36                       ` Eli Zaretskii
2021-08-20 12:59                         ` Ergus
2021-08-20 13:03                         ` Ergus
2021-08-20 13:34                           ` Eli Zaretskii
2021-08-20 17:36                             ` Ergus
2021-08-20 18:05                               ` Eli Zaretskii
2021-08-20 18:08                                 ` Ergus
2021-08-20 19:07                                   ` Eli Zaretskii
2021-08-21  6:20                                     ` Ergus
2021-08-21  6:53                                       ` Eli Zaretskii
2021-08-21 15:04                                         ` Ergus
2021-08-20 18:15                                 ` Ergus
2021-08-20 23:15                                   ` Michael Welsh Duggan
2021-08-18 14:04   ` Jean-Christophe Helary
2021-08-18 16:38     ` Iñigo Serna
2021-08-19  0:38       ` Jean-Christophe Helary
2021-08-19  7:08         ` Juri Linkov
2021-08-19 14:22           ` Jean-Christophe Helary
2021-08-19  7:01   ` Juri Linkov
2021-08-19  8:03     ` Eli Zaretskii
2021-08-19 14:11       ` Ergus
2021-08-19 15:48         ` Eli Zaretskii
2021-08-19 16:34           ` Yuri Khan
2021-08-20  7:14       ` Juri Linkov
2021-08-20 11:29         ` Eli Zaretskii
2021-08-20 16:49           ` Juri Linkov
2021-08-20 18:01             ` Eli Zaretskii
2021-08-23  7:33               ` Juri Linkov
2021-08-23 11:36                 ` Eli Zaretskii
2021-08-23 16:04                   ` Juri Linkov
2021-08-23 16:35                     ` Eli Zaretskii
2021-08-23 17:42                       ` Juri Linkov
2021-08-23 18:02                         ` Ergus
2021-08-24  6:35                           ` Juri Linkov
2021-08-24  8:00                             ` Ergus
2021-08-24 11:44                               ` Yuri Khan
2021-08-24 16:05                                 ` Ergus
2021-08-24 19:41                                   ` Yuri Khan
2021-08-24 20:48                                     ` Ergus
2021-08-19 13:57     ` Ergus
2021-08-20  7:24       ` Juri Linkov
2021-08-20 12:21         ` Ergus
2021-08-20 16:41           ` Juri Linkov [this message]
2021-08-21  4:33             ` Ergus via Emacs development discussions.
2021-08-22  8:56               ` Juri Linkov
2021-08-27  6:21   ` New Context Menu and mouse-1 Juri Linkov
2021-08-27  6:55     ` Eli Zaretskii
2021-08-27 17:03       ` Juri Linkov
2021-08-27 22:01         ` Stefan Monnier
2021-08-28 18:52           ` Juri Linkov
2021-08-29 16:53           ` Juri Linkov
2021-08-30  7:22             ` Juri Linkov
2021-08-30 12:54               ` Stefan Monnier

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7fkdq6z.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=spacibba@aol.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.