unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Visuwesh <visuweshm@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 74700@debbugs.gnu.org
Subject: bug#74700: [PATCH] Revert Dired buffer when clicking on last segment of directory name
Date: Thu, 05 Dec 2024 14:32:18 +0530	[thread overview]
Message-ID: <8734j2y02t.fsf@gmail.com> (raw)
In-Reply-To: <86frn2y10v.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 05 Dec 2024 10:41:52 +0200")

[வியாழன் டிசம்பர் 05, 2024] Eli Zaretskii wrote:

>> I removed the whitespace.  But isn't that way to make lists such as
>> 
>>     ( 1
>>       2
>>       3)
>> 
>> aligned without manual intervention?
>
> Typing something like
>
>    (setq foo (1
>               2
>               3)
>
> aligns the members for me.  So I don't think I understand what you are
> saying here.

Try to align

    (setq foo '(1 2
                3))

instead.  3 would end up aligning at 2 instead of 1.  Adding a space
after ( prevents this.

>> >> +              keymap ,(define-keymap
>> >> +                        "<mouse-2>" #'revert-buffer
>> >> +                        "<follow-link>" 'follow-link
>> >> +                        "RET" #'revert-buffer))))))))
>> >
>> > Should we perhaps call dired-revert directly?
>> 
>> revert-buffer-function is set to dired-revert by dired.  If someone has
>> changed it, for some reason, using revert-buffer would heed their
>> customisation.  So I've left it as revert-buffer.
>
> That's exactly what I wonder: should we call whatever customized value
> of revert-buffer-function?  It could be something completely
> different, not a function that refreshes the directory listing.

I was about to point out find-dired's value of revert-buffer-function
which is different than dired-revert but as the directory is inserted as

    /home/user/lib/ports/emacs/

always, the change wouldn't affect the 'emacs' part.  We could "fix"
this as

diff --git a/lisp/find-dired.el b/lisp/find-dired.el
index 13c8bf722c3..12fc64c2151 100644
--- a/lisp/find-dired.el
+++ b/lisp/find-dired.el
@@ -281,7 +281,7 @@ find-dired-with-command
     (setq buffer-read-only nil)
     ;; Subdir headlerline must come first because the first marker in
     ;; subdir-alist points there.
-    (insert "  " dir ":\n")
+    (insert "  " (directory-file-name dir) ":\n")
     (when dired-make-directory-clickable
       (dired--make-directory-clickable))
     ;; Make second line a ``find'' line in analogy to the ``total'' or

to make it insert

    /home/user/lib/ports/emacs

but I think clicking on 'emacs' to open the Dired buffer for
~/lib/ports/emacs is also a good option.





  reply	other threads:[~2024-12-05  9:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-05  6:12 bug#74700: [PATCH] Revert Dired buffer when clicking on last segment of directory name Visuwesh
2024-12-05  7:02 ` Eli Zaretskii
2024-12-05  8:26   ` Visuwesh
2024-12-05  8:41     ` Eli Zaretskii
2024-12-05  9:02       ` Visuwesh [this message]
2024-12-05  9:24         ` Eli Zaretskii
2024-12-05 10:42           ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-05 17:56         ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734j2y02t.fsf@gmail.com \
    --to=visuweshm@gmail.com \
    --cc=74700@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).