GNU bug report logs - #30578
26.0; Dired: moving current directory (./)

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Thu, 22 Feb 2018 17:39:01 UTC

Severity: minor

Tags: confirmed

Merged with 21537, 52004

Found in versions 24.5, 26.0

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 30578 <at> debbugs.gnu.org
Subject: bug#30578: 26.0; Dired: moving current directory (./)
Date: Sun, 14 Jul 2019 16:40:04 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> See https://emacs.stackexchange.com/a/39010/105.
>
> Putting point on the current-directory line of a Dired listing, i.e.,
> `.', and using `R' to move/rename that directory, works, but you get an
> error message, and you don't end up in a Dired listing for that
> (now-renamed) directory.
>
> This is the error message you get, where /some/dir1/dir2/ccc/ is the
> directory listed in Dired, i.e., the dir that corresponds to `.' in the
> Dired listing:
>
> Expected to find /some/dir1/dir2/ccc/./ in headerline of
> /some/dir1/dir2/ccc/

This seems to be still present on the Emacs trunk, and here's the
backtrace (which you should include in bug reports like this).

If I understand the code correctly, it simply doesn't understand that
"." is the directory itself, and treats it as any subdirectory: It
removes the line with "." from the buffer and then wants to adjust the
header line.

Instead, I guess it should...  point the current directory to the new
location?  But keep all the contents in the buffer (you may have marked
files and the like)?

Alternatively, for a really easy fix, it could just error out
immediately when you try this.  :-/

Debugger entered--Lisp error: (error "Expected to find ‘/tmp/foo1/./’ in headerline of /tmp/foo1/")
  signal(error ("Expected to find ‘/tmp/foo1/./’ in headerline of /tmp/foo1/"))
  error("Expected to find `%s' in headerline of %s" "/tmp/foo1/./" "/tmp/foo1/")
  dired-rename-subdir-2(("/tmp/foo1/" . #<marker at 1 in foo1>) "/tmp/foo1/./" "/tmp/lala1/")
  dired-rename-subdir-1("/tmp/foo1/./" "/tmp/lala1/")
  apply(dired-rename-subdir-1 ("/tmp/foo1/./" "/tmp/lala1/"))
  dired-fun-in-all-buffers("/tmp/foo1/./" nil dired-rename-subdir-1 "/tmp/foo1/./" "/tmp/lala1/")
  dired-rename-subdir("/tmp/foo1/." "/tmp/lala1")
  dired-rename-file("/tmp/foo1/." "/tmp/lala1" nil)
  dired-create-files(dired-rename-file "Move" ("/tmp/foo1/.") #f(compiled-function (from) #<bytecode 0x156ba85788fd>) t)
  dired-do-create-files(move dired-rename-file "Move" nil t "Rename")
  dired-do-rename(nil)
  
-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 2 years and 238 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.