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, 05 Dec 2024 11:42:08 +0530 Message-ID: <874j3iodzb.fsf@gmail.com> 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="14629"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 74700@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 05 07:13:22 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 1tJ574-0003ca-AJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Dec 2024 07:13:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJ56p-0000XL-9X; Thu, 05 Dec 2024 01:13:07 -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 1tJ56l-0000Ww-J5 for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 01:13: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 1tJ56l-0000Y6-9y for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 01:13:03 -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:From:To:Subject; bh=M9BDWz2SoCPCc7NGIsN1rk9nb7liLYQ6IWqXHYrnYj0=; b=UQxkkx3ejzkPyg1wukgxSBAxmcdm9YFnEjoGF/qbR+f4syibyCZKH9Z9PVhMAlDiSCmKbzZRMovya47axzBuw6QJysqvUQJa+TIGhu1NKw6FFmh4LdP9OS36bcfyhW9UaYShN9N2ZYl+Jxv5rFgf4EG52Qc4gh+bettaDRk9Mi3wNGeqh5b5QX+/6brQpjAQAW5Fx5siJgf7p1ULcZ90tU9k9QF8m3OEulfUGtypxXnKGqaXBPquSUIjNISNOB0XH8QXJCsyATjYiTJgBSIb6DtM56HTfVV4Co6QmLuKfwg1RwwoDeG8mlIFmU781QKrP8fdJUssvsWGSam6SDAc6Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tJ56k-00013J-5D for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 01:13: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, 05 Dec 2024 06:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74700 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17333791403978 (code B ref -1); Thu, 05 Dec 2024 06:13:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Dec 2024 06:12:20 +0000 Original-Received: from localhost ([127.0.0.1]:37813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJ564-000124-DF for submit@debbugs.gnu.org; Thu, 05 Dec 2024 01:12:20 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:41074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJ562-00011w-0s for submit@debbugs.gnu.org; Thu, 05 Dec 2024 01:12:18 -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 1tJ561-0000Lr-MH for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 01:12:17 -0500 Original-Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJ55z-0000N0-17 for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 01:12:17 -0500 Original-Received: by mail-pj1-x1043.google.com with SMTP id 98e67ed59e1d1-2ee69fc0507so537315a91.0 for ; Wed, 04 Dec 2024 22:12:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733379132; x=1733983932; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=M9BDWz2SoCPCc7NGIsN1rk9nb7liLYQ6IWqXHYrnYj0=; b=WV7WtvXr4sSR36GNhRT1GDPjTc8oHYv9gIqVR+eLYHzCmpBBdx6SNc90HolLqCR9sT rRvNgk1tyMulbJxZPGp9dvD2v0Kik7Iy7U+baV7e7YJB/trcavZhOqzmeCPajcjQDgC4 4+qKv05sSSuJhuF0twtStzWrULswgBGXJtLEEu7/fIaJDzoMdXH3qrmEGv8q5Yv9FYAx PpFJ7A7zzIZlvJxXlPpflNG9h08UtPa+lTqZnfY8Pl/qArPkm8dqlYqHwthwTUJlVFru W1q9vaQXfNkciwOyLf0RlizAZ53VSi0JgA2P+xLg4ebTR+vayAGXnnC1mRfoK5pI13mn cU3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733379132; x=1733983932; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M9BDWz2SoCPCc7NGIsN1rk9nb7liLYQ6IWqXHYrnYj0=; b=poZd0Cl0X+t/jJ9upO0urUGrX5ZG7Fd/9fTsZ2o+ILH62xLVn9B7UJVz+L8FRJFOda 4c91wqJXYlpWXe9ICEOGlza0NnPOv8i+mk1xCkFsS1VUvOi/Em4oHPLoA3xIC+TZCv5U bF93vcFbwPTWfLeTiEgw4EjnGAd3i3uh2pW3e6HOZ2HiFOO6GKjNMW/AnQVY/IzMlKPw xx2f9Shyy+NHO40EHeHjpnke4M6APdnRKPnX47Fuzeo0WrRH56pMizGEHaHS48S1fSyt vwBKodmiCLj+5dPXfKCOwfEULYwnzHPQfiFji9rrcQoh8oBF26dppzp9TtQyloMeBnli vpjg== X-Gm-Message-State: AOJu0Yz/3fpIrRzG5pmu+23St23tZah8GiTqwOyv1KGVyXvqcR300mOs HaWfCSrbr1U8k8kBI+VkX0Cxaud+qNZ8KFH6DuOF6Hy3uUkzAauOCu3/tjkL X-Gm-Gg: ASbGncvtFRKCILRdZKBzELuznD3z0BMMo1oqvoqH5SD/jI/pYg5nXmWob/tVkX9FXeA fKWHDz7PUJCiENgkQlKBq9Yu0+L3omflPmD7ahn1tUEsf95ZguSA4tb0zuuSByd7qE291qnvWBg nKb162HgVj7LCDzo4zPJ0cZ8QxNJXz1foU2CJ6ZSQ+Sv1VYVFVAiyMakY8d+JGSkSxg7J7fIYEK re2ZVOfubM0n7SYj93vI48nu1RCpED1N8KLYF2JDKCF6x5yZ5o= X-Google-Smtp-Source: AGHT+IEG06zlXwzQZ3ufQ72t3PUm5xSEx0O9WeFFy+yFNubnmf4+XcLBJAEkcuyozh6JVySC5tZr5g== X-Received: by 2002:a17:90b:3907:b0:2ee:f550:3837 with SMTP id 98e67ed59e1d1-2ef011e3692mr12771631a91.7.1733379132439; Wed, 04 Dec 2024 22:12:12 -0800 (PST) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ef45f95852sm559437a91.19.2024.12.04.22.12.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Dec 2024 22:12:11 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=visuweshm@gmail.com; helo=mail-pj1-x1043.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:296440 Archived-At: --=-=-= Content-Type: text/plain Tags: patch 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. In GNU Emacs 31.0.50 (build 25, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.2, Xaw scroll bars) of 2024-11-10 built on astatine Repository revision: 1704fa4fb4164a15c7e258b922dbba190811d92d Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101014 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure --with-sound=alsa --with-x-toolkit=lucid --without-xaw3d --without-gconf --without-libsystemd --with-cairo CFLAGS=-g3' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Revert-Dired-buffer-when-clicking-on-last-segment-of.patch >From 83da5ad8ef930ed6d093b6b5dec2322599fac763 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Thu, 5 Dec 2024 11:40:02 +0530 Subject: [PATCH] Revert Dired buffer when clicking on last segment of directory name * lisp/dired.el (dired--make-directory-clickable): Make clicking on the last segment of the directory line revert the Dired buffer. * etc/NEWS: Announce the change. --- etc/NEWS | 5 +++++ lisp/dired.el | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index e63132efeda..e35f007dbe1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -587,6 +587,11 @@ Without 'dired-hide-details-hide-absolute-location': /absolute/path/to/my/important/project: (100 GiB available) +--- +*** 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. + ** Grep +++ diff --git a/lisp/dired.el b/lisp/dired.el index f79a2220bea..4e300879f88 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2082,7 +2082,16 @@ dired--make-directory-clickable "" click "" 'mouse-face "RET" click)))) - (setq segment-start (point))))))) + (setq segment-start (point))) + (when (search-forward ":" bound t) + (add-text-properties + segment-start (1- (point)) + `( mouse-face highlight + help-echo "mouse-1: revert this buffer" + keymap ,(define-keymap + "" #'revert-buffer + "" 'follow-link + "RET" #'revert-buffer)))))))) (defun dired--get-ellipsis-length () "Return length of ellipsis." -- 2.45.2 --=-=-=--