unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: michael_heerdegen@web.de, 70593@debbugs.gnu.org
Cc: eliz@gnu.org
Subject: bug#70593: 30.0.50; Dired: buffers of renamed dirs are broken
Date: Thu, 9 May 2024 21:20:09 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488835B79853A021FBB21AEF3E62@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87ikzmg50t.fsf@web.de>

> When I call dired with a cons DIRNAME, `dired-directory' will be bound
> to that cons.  And it is consulted for reverting.
> 
> When I overwrite it with just `default-directory' and revert, the result
> will be a "normal" dired buffer showing this directory - the explicit
> listing is lost.

Right.

> In the scenario of the bug this surely makes a difference.

OK; sounds right.

> My latest patch seems to work as expected.
> Any comment about the patch btw?

I can't really judge.  Eyeballing it, it looks
reasonable.

What I see is that when `dired-directory' is a
cons you replace its car, DIRED-DIR, applying this to that car:

 (abbreviate-file-name
   (file-name-as-directory DIRED-DIR))

But the car of a cons `dired-directory' isn't
necessarily a directory name or any file name.
It's just a string used as the Dired buffer
name.  (Often it is a directory name, but it
need not be.)

If it's a directory name then what you're doing
looks right to me.  If it's not then I think
it's probably still OK - that code would
generally just append a `/' to the string.

But if the string has some particular file-name
syntax then maybe there could be some other 
resulting behavior; dunno.
 
> Subdir insertion in cons value `dired-directory' buffers 
> are not really supported currently it seems

Not sure what you mean.  Even in vanilla Emacs,
I think subdir insertion is supported.  E.g.:

M-: (dired (list "foobar" "/tata/file.txt"
                 "/toto/dir/" "/titi/"))

You get a Dired listing in buffer `foobar' with
those 3 filename entries.  Hitting `i' when on
the second entry inserts a listing of directory 
/toto/dir.  Hitting `i' on the third entry
inserts a listing of directory /titi.  That's
what I see, at least.

But maybe you meant something else?

> so I took this complication aside for now.
> The code does handle the subdir alists, though.

By "the subdir alists" I guess you mean
`dired-subdir-alist'.

___

What I think you've done seems reasonable.  It
should probably be checked in various scenarios,
however - at least a sanity check.





  reply	other threads:[~2024-05-09 21:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 11:59 bug#70593: 30.0.50; Dired: buffers of renamed dirs are broken Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-26 14:55 ` Eli Zaretskii
2024-04-29 14:42   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-09 13:46     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-09 14:05       ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-09 16:30       ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-09 19:27         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-09 21:20           ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-05-10 12:56             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 13:08               ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 16:52                 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 16:51               ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 17:02                 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 18:32                   ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-17 14:29                     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-18 20:45   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-19  5:32     ` Eli Zaretskii
2024-05-21 22:43       ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=SJ0PR10MB5488835B79853A021FBB21AEF3E62@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=70593@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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).