all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#30578: 26.0; Dired: moving current directory (./)
@ 2018-02-22 17:38 Drew Adams
  2019-07-14 14:40 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2018-02-22 17:38 UTC (permalink / raw)
  To: 30578

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/

It would be good to be able to perform this operation without any
glitches.  (Yes, of course you can always go to the parent directory in
Dired and then rename the child dir from there.)


In GNU Emacs 26.0.91 (build 1, x86_64-w64-mingw32)
 of 2018-01-22
Repository revision: 752fba992b793a74d202c9cfc3e1a92fd458e748
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#30578: 26.0; Dired: moving current directory (./)
  2018-02-22 17:38 bug#30578: 26.0; Dired: moving current directory (./) Drew Adams
@ 2019-07-14 14:40 ` Lars Ingebrigtsen
  2019-07-14 15:14   ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-14 14:40 UTC (permalink / raw)
  To: Drew Adams; +Cc: 30578

Drew Adams <drew.adams@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#30578: 26.0; Dired: moving current directory (./)
  2019-07-14 14:40 ` Lars Ingebrigtsen
@ 2019-07-14 15:14   ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2019-07-14 15:14 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 30578

> 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)?

Yes.  It should do (the equivalent of) a `mv`
on the current directory.  And the Dired buffer
should then be refreshed using the new location.

And yes, it should ideally keep all settings:
omitted files, markings, whether details are
hidden - everything.  The only thing that
changes is the location of the directory.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-14 15:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-22 17:38 bug#30578: 26.0; Dired: moving current directory (./) Drew Adams
2019-07-14 14:40 ` Lars Ingebrigtsen
2019-07-14 15:14   ` Drew Adams

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.