From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#74700: [PATCH] Revert Dired buffer when clicking on last segment of directory name Date: Thu, 26 Dec 2024 17:21:15 +0530 Message-ID: <87v7v6ek7g.fsf@gmail.com> 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> <875xn8mz1d.fsf@web.de> <87r05w9xmo.fsf@gmail.com> <865xn6zusv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32578"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: michael_heerdegen@web.de, 74700@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 26 12:53:19 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 1tQmQY-0008Lp-Sk for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Dec 2024 12:53:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQmQK-0002sS-AO; Thu, 26 Dec 2024 06:53: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 1tQmQI-0002rd-UG for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 06:53: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 1tQmQI-00019x-Jh for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 06:53: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=4tRM3jrMq+FgSKxYFdWSUTk3cPTPYPZ0g3PRBmNUtKU=; b=lEBP7fvMe8RAaPytAttHhIlgKYKhE/WuqbZJqfARmw9Jf3u/fKCRzyp7qDi1yQw59XA98RXQF/tI29Z/lyv6AnyZ651C2yHdwhEgbI+WLisjZAr8N1xEcC6tn2Aaxva0Pbc3wl6cUDc22HrNJZaFXHcUPhuDGsGQuvgWVNHygnDO7NqUoX5LGXYpiom8BKOF49kGcJgad1Rubm8E7nxXd/dI5ft+XoFFdXwVMddsr83yN/Jy4bga3T65kDCTn3EI3RP2+2ihR+454ctExUZ3ySvADqXaYJgKL7yZGYohvKfiB4ozL6SLm+57fBOMrU6rWLtPD1TgbPlVuvwYc+t+0w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQmQI-0001xE-BB for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 06:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Dec 2024 11:53: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.17352139427462 (code B ref 74700); Thu, 26 Dec 2024 11:53:02 +0000 Original-Received: (at 74700) by debbugs.gnu.org; 26 Dec 2024 11:52:22 +0000 Original-Received: from localhost ([127.0.0.1]:40349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQmPd-0001wH-N4 for submit@debbugs.gnu.org; Thu, 26 Dec 2024 06:52:22 -0500 Original-Received: from mail-pl1-f194.google.com ([209.85.214.194]:42262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQmPc-0001w9-Gj for 74700@debbugs.gnu.org; Thu, 26 Dec 2024 06:52:21 -0500 Original-Received: by mail-pl1-f194.google.com with SMTP id d9443c01a7336-2167141dfa1so71396085ad.1 for <74700@debbugs.gnu.org>; Thu, 26 Dec 2024 03:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735213880; x=1735818680; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=4tRM3jrMq+FgSKxYFdWSUTk3cPTPYPZ0g3PRBmNUtKU=; b=XZp2rGIO75j214cps2u/9pWeC2ASWbDhSfeE9rpFXmPnq9C7CZnfb/7TsW1XNxIE4V yInHdkY8zYF6RuInKqKCoi9F8ylaJeEOCDTt1bpRyQFAf+nURaU+h1KOdncDQK3m81Yx bojplnNom5Rne79TeqtRDCJHWfzhTFWjJvHqg6G9K5XwtYkIrWvtz4kAQIBhprTVapUB +htOJHcqPPtgLqFd9vOWD5gKuiegyW8s/WB3Wc6c9Hc3tSMuC8k6nVh0aWX5GLNOh/m6 cu8i7dZuF5EwIT+e41lqEQm5vd3CXVra8lLsEM/Tp+gWkLm8VLpK7l6Q56s3QSC3bWea UEeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735213880; x=1735818680; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4tRM3jrMq+FgSKxYFdWSUTk3cPTPYPZ0g3PRBmNUtKU=; b=pbagBMwmvLws+fE47hSBbTk+O5i32sBWoxO+heZD6zLG4GdLlJyrfOEUuW6Y67e74d dG5dgolgLor/JknuhgrkM6dlthT3F2CcA/wavUSiUO+xiAq1f//50Qw7bCDggci3khaj aVhq9qfqfowR2n1wpCp1HfUEvRZ+jJfGUh5o5O57lbi/XD67CnPJ4xo0+jjKZga3cNAx HzC4s3CL+iOfwKmQna1+FrAX/7wVgC7w7lnGb+R+Rp6zQuFeDLkQtBuXY0hpLlcai1dF DkhB2XFOew5w7LZf3zT6Y6qmKLLL2fXn1a/U4Z21Q6kQDJLgzyhGGexAqBwFbpNbv+te 4MEg== X-Forwarded-Encrypted: i=1; AJvYcCWq81xcfR3UJmcWaQ7dLOVENinj1bCdly+0pSxt7GfaSl7Tkz9uvMWUWI57E3LGD5bSVf/oqg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyWtHQraMaOv4Hfsk/ARGDBO1NMjUm5aP5KI+XSjda82DVXM1wA UDAqmEZxdZa5YtiFQpCfeTfJd+QtiC6BNzmEgy6J/mJWnvKvROdL X-Gm-Gg: ASbGncsxu9mN0BMBmadZVsPQ6PWkGtfJujwPAwlGk0dc1Xrhm9ExhlYQFdfHVjp2b4W UqjlmG7naMPAdgJXmuvZQNZA2ApYjaR50GcCe9aDfJeYX8KIlQiWE96OrcXbejRbNQQWqtjTLBb 1slAfGyszsfRVUbGBppDLIEDT403e9/0jFRMeuHIuzBMr2GjUFp2DP3Ob4Ik4qs5qiXDnMm7vti OxtWtA0OoapqApbyBFU0PZMiFLMeVPmHVEhB8grXx0CZ3jfZJs= X-Google-Smtp-Source: AGHT+IEvJhUjgxsLcsxmtWx7F3f8pNMIoEyYc7tlGijR9CR25dJwdMyXlGTRzQBpFXYjq6muS29iAA== X-Received: by 2002:a17:902:c94b:b0:215:ae61:27ca with SMTP id d9443c01a7336-219e6d6b172mr381536035ad.26.1735213879676; Thu, 26 Dec 2024 03:51:19 -0800 (PST) Original-Received: from localhost ([49.205.85.12]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc9705c1sm118358115ad.101.2024.12.26.03.51.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2024 03:51:18 -0800 (PST) In-Reply-To: <865xn6zusv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 Dec 2024 10:56:48 +0200") 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:297765 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=B5=E0=AE=BF=E0=AE=AF=E0=AE=BE=E0=AE=B4=E0=AE=A9=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 26, 2024] E= li Zaretskii wrote: >> [...] >> >> +++ # >> >> @@ -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.) >>=20 >> Indeed, I thought @ had to go with e _always_. > > Thanks, so please post a proper patch with a commit log message, so I > could install it. Thanks, patch attached. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Ensure-Dired-window-is-selected-when-reverting-buffe.patch >From 53cf31f879811389b030d5af7a90aa823ce35bde Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Thu, 26 Dec 2024 17:19:41 +0530 Subject: [PATCH] Ensure Dired window is selected when reverting buffer * lisp/dired.el (dired--make-directory-clickable): Ensure the Dired window is selected. This prevents erroneously reverting a non-Dired buffer. (Bug#74700) --- lisp/dired.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index 9895229694a..9632858703c 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2089,8 +2089,10 @@ dired--make-directory-clickable `(mouse-face highlight help-echo "mouse-1: re-read this buffer's directory" keymap ,(define-keymap - "" #'revert-buffer - "" 'follow-link + "" (lambda () + (interactive "@") + (revert-buffer)) + "" 'mouse-face "RET" #'revert-buffer)))))))) (defun dired--get-ellipsis-length () -- 2.45.2 --=-=-=--