From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: New Context Menu Date: Fri, 20 Aug 2021 19:41:08 +0300 Organization: LINKOV.NET Message-ID: <87h7fkdq6z.fsf@mail.linkov.net> References: <20210818120834.i3orh535tb2enpos.ref@Ergus> <20210818120834.i3orh535tb2enpos@Ergus> <87r1epzznt.fsf@mail.linkov.net> <20210819135701.ygypxl7asl4edwbp@Ergus> <87eeaoio3v.fsf@mail.linkov.net> <20210820122126.tp6zna2ei2n5wrbw@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12940"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Stefan Monnier , emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 20 18:52:59 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mH7lJ-00034k-Na for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Aug 2021 18:52:57 +0200 Original-Received: from localhost ([::1]:45180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mH7lI-0005RO-9X for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Aug 2021 12:52:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH7ka-0003gS-9f for emacs-devel@gnu.org; Fri, 20 Aug 2021 12:52:12 -0400 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:41859) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH7kW-0002d7-Nd for emacs-devel@gnu.org; Fri, 20 Aug 2021 12:52:11 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 07F7E100008; Fri, 20 Aug 2021 16:52:04 +0000 (UTC) In-Reply-To: <20210820122126.tp6zna2ei2n5wrbw@Ergus> (Ergus's message of "Fri, 20 Aug 2021 14:21:26 +0200") Received-SPF: pass client-ip=217.70.178.231; envelope-from=juri@linkov.net; helo=relay11.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272733 Archived-At: > 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- (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." #)(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." #) (SECONDARY nil)) #f(compiled-function (&rest args) #)(SECONDARY nil) apply(#f(compiled-function (&rest args) #) (SECONDARY nil)) gui-backend-set-selection(SECONDARY nil) gui-set-selection(SECONDARY nil) mouse-drag-secondary((M-down-mouse-1 (# 153 (42 . 10) 16176 nil 153 (41 . 3) nil (35 . 7) (1 . 0)))) funcall-interactively(mouse-drag-secondary (M-down-mouse-1 (# 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.