unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: kai.grossjohann@gmx.net (Kai Großjohann)
Subject: Re: Bug in Ange-FTP with renaming files
Date: Sun, 06 Jul 2003 17:10:47 +0200	[thread overview]
Message-ID: <84wuevlmh4.fsf@lucy.is.informatik.uni-duisburg.de> (raw)
In-Reply-To: 84isqfsnz1.fsf@lucy.is.informatik.uni-duisburg.de

kai.grossjohann@gmx.net (Kai Großjohann) writes:

> Shouldn't dired-rename-subdir be conditioned on either file or newname
> being a directory?  Or perhaps both?  Or shouldn't dired-rename-subdir
> take care to do the right thing with non-directories?

I now tried this.  I enabled the following patch.

Now it is barfing in dired-add-entry :-/

I'm getting lost in a maze of twisty litte funcalls, all similar.

--- dired-aux.el.~1.110.~	Sat Mar 22 19:23:45 2003
+++ dired-aux.el	Sun Jul  6 17:02:01 2003
@@ -1020,6 +1020,7 @@
 ;;;###autoload
 (defun dired-rename-file (file newname ok-if-already-exists)
   (dired-handle-overwrite newname)
+  (let ((is-dir (file-directory-p file)))
   (rename-file file newname ok-if-already-exists) ; error is caught in -create-files
   ;; Silently rename the visited file of any buffer visiting this file.
   (and (get-file-buffer file)
@@ -1027,7 +1028,8 @@
 	 (set-visited-file-name newname nil t)))
   (dired-remove-file file)
   ;; See if it's an inserted subdir, and rename that, too.
-  (dired-rename-subdir file newname))
+  (when is-dir
+  (dired-rename-subdir file newname))))
 
 (defun dired-rename-subdir (from-dir to-dir)
   (setq from-dir (file-name-as-directory from-dir)


-- 
~/.signature

  reply	other threads:[~2003-07-06 15:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-06 14:30 Bug in Ange-FTP with renaming files Kai Großjohann
2003-07-06 14:48 ` Kai Großjohann
2003-07-06 14:56   ` Kai Großjohann
2003-07-06 15:10     ` Kai Großjohann [this message]
2003-07-06 16:00       ` Kai Großjohann
2003-07-07  3:39     ` Richard Stallman
2003-07-07  5:58       ` Kai Großjohann

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=84wuevlmh4.fsf@lucy.is.informatik.uni-duisburg.de \
    --to=kai.grossjohann@gmx.net \
    /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).