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 and mouse-1 Date: Fri, 27 Aug 2021 20:03:31 +0300 Organization: LINKOV.NET Message-ID: <87bl5ig6qk.fsf@mail.linkov.net> References: <20210818120834.i3orh535tb2enpos.ref@Ergus> <20210818120834.i3orh535tb2enpos@Ergus> <87tujb77vq.fsf_-_@mail.linkov.net> <83y28nqsuv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7381"; 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: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 27 19:16:41 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 1mJfT7-0001jt-52 for ged-emacs-devel@m.gmane-mx.org; Fri, 27 Aug 2021 19:16:41 +0200 Original-Received: from localhost ([::1]:49370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJfT4-0002te-RH for ged-emacs-devel@m.gmane-mx.org; Fri, 27 Aug 2021 13:16:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJfRr-0001w2-9v for emacs-devel@gnu.org; Fri, 27 Aug 2021 13:15:23 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:44443) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJfRk-0005qP-6A; Fri, 27 Aug 2021 13:15:21 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 15221FF805; Fri, 27 Aug 2021 17:15:11 +0000 (UTC) In-Reply-To: <83y28nqsuv.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 27 Aug 2021 09:55:36 +0300") Received-SPF: pass client-ip=217.70.183.199; envelope-from=juri@linkov.net; helo=relay9-d.mail.gandi.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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:273174 Archived-At: >> ;; mouse-drag-region >> ;; anonymous-command >> ;; anonymous-command >> ;; anonymous-command >> ;; kill-region >> >> I have no idea how this could be fixed. > > Why do you need mouse-set-region to be invoked? And if you do, why > cannot the command bound to down-mouse-3 do that? There should be no need to invoke mouse-set-region, because already sets the region. And indeed, the minimal change that fixes this problem is just removing these lines: diff --git a/lisp/mouse.el b/lisp/mouse.el index 7d3ed9a0e4..933ad5181e 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1578,9 +1578,7 @@ mouse-drag-track map) t (lambda () (setq track-mouse old-track-mouse) - (setq auto-hscroll-mode auto-hscroll-mode-saved) - (deactivate-mark) - (pop-mark))))) + (setq auto-hscroll-mode auto-hscroll-mode-saved))))) (defun mouse--drag-set-mark-and-point (start click click-count) (let* ((range (mouse-start-end start click click-count)) Then everything works fine: the aforementioned case and the normal using mouse-1 to select a region.