From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74700: [PATCH] Revert Dired buffer when clicking on last segment of directory name Date: Wed, 25 Dec 2024 00:39:10 +0100 Message-ID: <875xn8mz1d.fsf@web.de> References: <874j3iodzb.fsf@gmail.com> <86ttbiy5na.fsf@gnu.org> <87zflamt6j.fsf@gmail.com> <8634it19cc.fsf@gnu.org> <87msgmozm3.fsf@web.de> <874j2tbw9j.fsf@gmail.com> Reply-To: Michael Heerdegen Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29028"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: eliz@gnu.org, 74700@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 25 00:39:18 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tQEUf-0007RS-Mn for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Dec 2024 00:39:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQEUS-0007T0-Id; Tue, 24 Dec 2024 18:39:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQEUR-0007Sn-2i for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 18:39:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQEUQ-0007AY-R1 for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 18:39:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=+gXl1T37Aqf32PFnyRcWD9J3AR5xVhyCzbV1oZsFD3w=; b=oc0rFzvjyIKsajRquExZiJglLvzvFm8SDid1eDv/0SpvyLbmO8XCU9M6PmOWZ/6dME168mMLXzLncedB9elBai83ZgEABOUCcl4z4LqUPgyuzX2TK/PqlBKiKngDFzAcBZljGdLvjRzdQ07u5LRRB60iU2D6R3uq1Ku6IyRjkWVhD9Ji08tQxSRqcW3oEBt12M5AOONG0R6afGXDD8hgZzV3jvpSf/O8y1ihcXTOmlZerA7MCBlEu/e/R7kYfbTdKxvXwE1mzgKUrdKhhhMyDt+dLsU4ZjTCMjhfGhEYvZsQ2YML+nn5oxDULYJKWQOUTyyOVz849asYpaiFaaiWpA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQEUQ-0006Gd-LJ for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 18:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Dec 2024 23:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74700 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74700-submit@debbugs.gnu.org id=B74700.173508349224001 (code B ref 74700); Tue, 24 Dec 2024 23:39:02 +0000 Original-Received: (at 74700) by debbugs.gnu.org; 24 Dec 2024 23:38:12 +0000 Original-Received: from localhost ([127.0.0.1]:35388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQETb-0006F3-Om for submit@debbugs.gnu.org; Tue, 24 Dec 2024 18:38:12 -0500 Original-Received: from mout.web.de ([217.72.192.78]:39067) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQETZ-0006Em-99 for 74700@debbugs.gnu.org; Tue, 24 Dec 2024 18:38:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1735083482; x=1735688282; i=michael_heerdegen@web.de; bh=+gXl1T37Aqf32PFnyRcWD9J3AR5xVhyCzbV1oZsFD3w=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=r72UtDluR/EsLkAQ/FtbXxLqpSkchVA01F7aiFLMt1ua9SOOow7WCF75witAN/ba +GRJqjxNopFEpt66vaD1pcvnPS7vN7pluwZgyjEiuD3LqWhhnOKnAMKohIrUo7g4N TgENr1LcsoEB/W0VoZKvoIJ88Ez5/TCehfZbdQoc68K8LcXMR2nmpu63K/z2zNZhg kqgKYFrX17AKzI1sSumMdOlxcC81YQG4HC7otYBMrARInZrmIj7nwLUcjXd7QNVYI 5Dh455y3U77BnYg7yGTtzz9ey6UJAnOV63tv94akgoST+83g1kxgYkGEvyhhc1p/R JsJBrZqhFVZ/jVving== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([92.75.138.197]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MZjET-1t4UKk3n3H-00TwTp; Wed, 25 Dec 2024 00:38:01 +0100 In-Reply-To: <874j2tbw9j.fsf@gmail.com> (Visuwesh's message of "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WONEnxfovStI8UVyib3OHIROfrjCiT3HdDMCTTBuHv5WY4 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297708 Archived-At: Visuwesh writes: > [=E0=AE=A4=E0=AE=BF=E0=AE=99=E0=AF=8D=E0=AE=95=E0=AE=B3=E0=AF=8D =E0=AE= =9F=E0=AE=BF=E0=AE=9A=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 23, 2024= ] Michael Heerdegen wrote: > > > Hello, > > > > a user on emacs-help (Dieter, CC'd) mentioned that in contrast to > > hitting g, > > reverting with this new method loses the position of point, instead, > > point is repositioned at the beginning of the buffer. And I agree that > > this is not the optimal behavior. Can we maybe improve this? > > > > I didn't notice this, thanks for bringing this to my attention. This > also caught another bug that I would not have noticed since I have > mouse-autoselect-window set non-nil. > With the following patch, using mouse-2 on the base name reverts the > buffer without moving point. Thank you. > However, using mouse-1 still moves the point to bob. I believe we > could fix it by directly binding mouse-1 but I would like to respect > mouse-1-click-follows-link like the rest of the code in the function. > I cannot tell how to prevent mouse-1 from moving point reading the > Info nodes (info "(elisp) Clickable Text") and (info "(emacs) Mouse > References"). I tried > > (with-selected-window (posn-window (event-start e)) ...) > > to no avail. Was that code line the attempt to fix the problem that the buffer in the wrong window was being reverted, or the attempt to fix the mouse-1 problem? > This goes beyond my level of knowledge so someone else will have to > take care of this. But please install the following patch because > without it using mouse-2 on the base name tries to revert the > current-buffer instead of the dired buffer when the dired buffer is > not shown in the selected window. > +++ # > @@ -2089,8 +2089,10 @@ > `( mouse-face highlight > help-echo "mouse-1: revert this buffer" > keymap ,(define-keymap > - "" #'revert-buffer > - "" 'follow-link > + "" (lambda (_) > + (interactive "@e") > + (revert-buffer)) > + "" 'mouse-face I don't know how to fix the mouse-1 problem in a sensible way either. Does anyone? (And I think in this version the "e" code in `interactive' isn't significant - but let's first see if we can improve the behavior even more.) Thx, Michael.