emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dired-compare-directories


From: Juri Linkov
Subject: Re: dired-compare-directories
Date: Thu, 24 Mar 2005 22:17:27 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux)

> In dired-aux.el, the new command dired-compare-directories is not marked
> with ";;;###autoload".  It should be.

Thanks.  I've added an autoload cookie, and a new menu item to the
menu bar, and also replaced `read-file-name' with `read-directory-name'.

After replacing I noticed one problem in `read-directory-name':
it requires to duplicate its second and third argument to return
the correct directory name for the default input specified by the
second argument.  For example, after typing RET in the minibuffer
in the default directory "~/dir1/" after calling:

(read-directory-name "Directory: " "~/dir2/")

it returns "~/dir1/" instead of "~/dir2/" as would be more correct.

I propose the following fix for `read-directory-name'.  It uses the
same directory name DIR for DEFAULT-DIRNAME.

Index: lisp/files.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/files.el,v
retrieving revision 1.750
diff -u -r1.750 files.el
--- lisp/files.el       19 Mar 2005 19:58:34 -0000      1.750
+++ lisp/files.el       24 Mar 2005 19:53:16 -0000
@@ -537,7 +537,9 @@
     (setq dir default-directory))
   (unless default-dirname
     (setq default-dirname
-         (if initial (concat dir initial) default-directory)))
+         (or (if initial (concat dir initial))
+             dir
+             default-directory)))
   (read-file-name prompt dir default-dirname mustmatch initial
                  'file-directory-p))

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]