From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74700: [PATCH] Revert Dired buffer when clicking on last segment of directory name Date: Thu, 05 Dec 2024 09:02:01 +0200 Message-ID: <86ttbiy5na.fsf@gnu.org> References: <874j3iodzb.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39561"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74700@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 05 08:03:30 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 1tJ5tZ-000A3c-S6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Dec 2024 08:03:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJ5tE-0005JX-GJ; Thu, 05 Dec 2024 02:03:08 -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 1tJ5tB-0005JH-P3 for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 02:03:05 -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 1tJ5tA-0006o2-Qd for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 02:03:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=IAhZcxYcjqf8OIcmmiQTjTx3XRTkuHxRcD6HOjwDb2E=; b=r0XfcfDNrLxGymt0X56gGINiX9VilKFMEk/FSkJdxpKJ4rKK7ORMeDP/lUYOhuMUATAwI9c2GnwAYf33BJcMuxbqr6Hz83L4Qu3DvpIzEjL/tdngw8vDQpaTrVzS4JcjM9z9Bkz2sNERHE9mNlFzugw9vqDH2YX9pM3OdNUQ+c0i+1r3phVFf9MxHwJSmHrqYYjHoFtVc1HVl4rAdvB8xeMAe46tVEGgTW0kpo/whjHqel/FT2i301+QTqgLlaMGT/sVYN6nJie6Ko0snfNZwWzT8PogS5VUWPXMtfBY20zLztTv1VO/+X4N+xs20mL5v+ghhswY15067WyFXidlHQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tJ5t8-0003Ya-KH for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 02:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Dec 2024 07:03: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.173338213613599 (code B ref 74700); Thu, 05 Dec 2024 07:03:02 +0000 Original-Received: (at 74700) by debbugs.gnu.org; 5 Dec 2024 07:02:16 +0000 Original-Received: from localhost ([127.0.0.1]:37907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJ5sN-0003XH-Lv for submit@debbugs.gnu.org; Thu, 05 Dec 2024 02:02:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJ5sL-0003Wv-DJ for 74700@debbugs.gnu.org; Thu, 05 Dec 2024 02:02:14 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tJ5sF-0006jy-UJ; Thu, 05 Dec 2024 02:02:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IAhZcxYcjqf8OIcmmiQTjTx3XRTkuHxRcD6HOjwDb2E=; b=bzjtd9yfvJ7+ rxRT/MviqfQ1C4N/M2v+UlxAM5UXFq3CvSqrJ2I94+MC9b1Wt6pk7PNLMNEgwMCYeqpzX7JniZBtJ 8JUdp3iigxa8hXLC8w7i7Jr+tTvUFvDhjZnovTX5irbnrGkHZ7s1/QMdefjFMGr/8qE733+Z26e7S 44IsQuUcF39Ht4XHJtUo2Sm+6CwYG8h5cWBN6lMn3F/hSPtyobCgBMvZvkf2f7PRPvRjdoj06/H1s ofNOdaA3lvu3f8CybqlOIQnbS/ITwLB2K6ngSqYhVUEWT/Zu6x6pgK4c83mqoiee/l6rDG7nTCRxt jPowt/aG8mmmT64BhWhsTA==; In-Reply-To: <874j3iodzb.fsf@gmail.com> (message from Visuwesh on Thu, 05 Dec 2024 11:42:08 +0530) 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:296444 Archived-At: > From: Visuwesh > Date: Thu, 05 Dec 2024 11:42:08 +0530 > > Attached patch makes it possible to revert the current Dired buffer by > clicking on the last segment of the directory line. With the patch > applied, > > /home/viz/lib/ports/emacs: > > clicking on 'emacs' now reverts the buffer that shows ~/lib/ports/emacs. > Previously, it did nothing. This makes it possible to update the Dired > listing without needing to use the keyboard. Thanks, a few comments below. > +--- > +*** Clicking on last segment of directory reverts buffer > +When 'dired-make-directory-clickable' is non-nil, clicking on the last > +segment of the directory name now reverts the Dired buffer. We don't call these "segments", we call them "components". And since you are talking about the last one, you could also say "base name of the directory". > + (when (search-forward ":" bound t) > + (add-text-properties > + segment-start (1- (point)) > + `( mouse-face highlight ^^ We don't leave whitespace after the opening parenthesis. > + help-echo "mouse-1: revert this buffer" I think the help-echo should say something more similar to what we say for the other components of the directory shown in the header line. Something like "re-read this buffer's directory". > + keymap ,(define-keymap > + "" #'revert-buffer > + "" 'follow-link > + "RET" #'revert-buffer)))))))) Should we perhaps call dired-revert directly?