diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 55935189af6..353afc4a803 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,21 @@ +2011-03-05 Antoine Levitt + + * files.el (delete-directory, copy-directory, list-directory): Use + read-directory-name. + + * find-file.el (ff-find-the-other-file): + * net/ange-ftp.el (ange-ftp-make-directory): + * printing.el (pr-interactive-dir): + * progmodes/ada-prj.el (ada-prj-load-directory): + * progmodes/ebnf2ps.el (ebnf-print-directory) + (ebnf-spool-directory, ebnf-eps-directory) + (ebnf-syntax-directory): + * shell.el (shell): + * speedbar.el (speedbar-create-directory): + * vc/emerge.el (emerge-merge-directories): + * vc/vc-dir.el (vc-dir): + * vc/vc.el (vc-create-tag, vc-retrieve-tag): Likewise. + 2011-03-05 Chong Yidong * help-mode.el (help-buffer): If we are to return the current diff --git a/lisp/dired.el b/lisp/dired.el index 99902d15e33..c4374503a6f 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -611,9 +611,12 @@ Don't use that together with FILTER." (if current-prefix-arg (read-string "Dired listing switches: " dired-listing-switches)) - ;; If a dialog is about to be used, call read-directory-name so - ;; the dialog code knows we want directories. Some dialogs can - ;; only select directories or files when popped up, not both. + ;; If a dialog is used, call `read-directory-name' so the + ;; dialog code knows we want directories. Some dialogs + ;; can only select directories or files when popped up, + ;; not both. If no dialog is used, call `read-file-name' + ;; because the user may want completion of file names for + ;; use in a wildcard pattern. (if (next-read-file-uses-dialog-p) (read-directory-name (format "Dired %s(directory): " str) nil default-directory nil) @@ -4083,7 +4086,7 @@ true then the type of the file linked to by FILE is printed instead. ;;;*** ;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump) -;;;;;; "dired-x" "dired-x.el" "addd55345656d18cfd5251790a655e2c") +;;;;;; "dired-x" "dired-x.el" "87fd4ae2fdade7e0f11c4a0b1cfdeda2") ;;; Generated autoloads from dired-x.el (autoload 'dired-jump "dired-x" "\ diff --git a/lisp/files.el b/lisp/files.el index 39021ac1b2d..ffc0b33119f 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4831,7 +4831,7 @@ given. With a prefix argument, TRASH is nil." (let* ((trashing (and delete-by-moving-to-trash (null current-prefix-arg))) (dir (expand-file-name - (read-file-name + (read-directory-name (if trashing "Move directory to trash: " "Delete directory: ") @@ -4899,7 +4899,7 @@ directly into NEWNAME instead." (let ((dir (read-directory-name "Copy directory: " default-directory default-directory t nil))) (list dir - (read-file-name + (read-directory-name (format "Copy directory %s to: " dir) default-directory default-directory nil nil) current-prefix-arg t nil))) @@ -5598,7 +5598,7 @@ Prefix arg (second arg if noninteractive) means supply -l switch to `ls'. Actions controlled by variables `list-directory-brief-switches' and `list-directory-verbose-switches'." (interactive (let ((pfx current-prefix-arg)) - (list (read-file-name (if pfx "List directory (verbose): " + (list (read-directory-name (if pfx "List directory (verbose): " "List directory (brief): ") nil default-directory nil) pfx))) diff --git a/lisp/find-file.el b/lisp/find-file.el index 715f01b8e17..e4285523184 100644 --- a/lisp/find-file.el +++ b/lisp/find-file.el @@ -494,7 +494,7 @@ If optional IN-OTHER-WINDOW is non-nil, find the file in another window." (setq name (expand-file-name - (read-file-name + (read-directory-name (format "Find or create %s in: " default-name) default-directory default-name nil))) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 0cf198e8b04..305e041eb78 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,15 @@ +2011-03-05 Antoine Levitt + + * gnus.el (gnus-interactive): Use read-directory-name. + + * gnus-uu.el (gnus-uu-decode-uu-and-save) + (gnus-uu-decode-unshar-and-save, gnus-uu-decode-save) + (gnus-uu-decode-binhex, gnus-uu-decode-yenc) + (gnus-uu-decode-save-view, gnus-uu-decode-postscript-and-save): + Likewise. + + * gnus-group.el (gnus-group-make-directory-group): Likewise. + 2011-03-05 Lars Magne Ingebrigtsen * gnus-sum.el (gnus-update-read-articles): Fix typo. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 832cd758b61..9ed3cf02a49 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -3102,7 +3102,7 @@ The user will be prompted for a directory. The contents of this directory will be used as a newsgroup. The directory should contain mail messages or news articles in files that have numeric names." (interactive - (list (read-file-name "Create group from directory: "))) + (list (read-directory-name "Create group from directory: "))) (unless (file-exists-p dir) (error "No such directory")) (unless (file-directory-p dir) diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index d6aad539029..7aa0e09e365 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -366,7 +366,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (interactive (list current-prefix-arg (file-name-as-directory - (read-file-name "Uudecode and save in dir: " + (read-directory-name "Uudecode and save in dir: " gnus-uu-default-dir gnus-uu-default-dir t)))) (gnus-uu-decode-with-method 'gnus-uu-uustrip-article n dir nil nil t)) @@ -381,7 +381,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (interactive (list current-prefix-arg (file-name-as-directory - (read-file-name "Unshar and save in dir: " + (read-directory-name "Unshar and save in dir: " gnus-uu-default-dir gnus-uu-default-dir t)))) (gnus-uu-decode-with-method 'gnus-uu-unshar-article n dir nil 'scan t)) @@ -390,12 +390,11 @@ didn't work, and overwrite existing files. Otherwise, ask each time." "Saves the current article." (interactive (list current-prefix-arg - (read-file-name - (if gnus-uu-save-separate-articles - "Save articles in dir: " - "Save articles in file: ") - gnus-uu-default-dir - gnus-uu-default-dir))) + (if gnus-uu-save-separate-articles + (read-directory-name + "Save articles in dir: " gnus-uu-default-dir gnus-uu-default-dir) + (read-file-name-name + "Save article in file: " gnus-uu-default-dir gnus-uu-default-dir)))) (setq gnus-uu-saved-article-name file) (gnus-uu-decode-with-method 'gnus-uu-save-article n nil t)) @@ -404,7 +403,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (interactive (list current-prefix-arg (file-name-as-directory - (read-file-name "Unbinhex and save in dir: " + (read-directory-name "Unbinhex and save in dir: " gnus-uu-default-dir gnus-uu-default-dir)))) (setq gnus-uu-binhex-article-name @@ -416,7 +415,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (interactive (list current-prefix-arg (file-name-as-directory - (read-file-name "yEnc decode and save in dir: " + (read-directory-name "yEnc decode and save in dir: " gnus-uu-default-dir gnus-uu-default-dir)))) (setq gnus-uu-yenc-article-name nil) @@ -458,10 +457,11 @@ didn't work, and overwrite existing files. Otherwise, ask each time." "Saves and views the current article." (interactive (list current-prefix-arg - (read-file-name (if gnus-uu-save-separate-articles - "Save articles is dir: " - "Save articles in file: ") - gnus-uu-default-dir gnus-uu-default-dir))) + (if gnus-uu-save-separate-articles + (read-directory-name "Save articles in dir: " + gnus-uu-default-dir gnus-uu-default-dir) + (read-file-name "Save articles in file: " + gnus-uu-default-dir gnus-uu-default-dir)))) (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) (gnus-uu-decode-save n file))) @@ -742,7 +742,7 @@ When called interactively, prompt for REGEXP." (interactive (list current-prefix-arg (file-name-as-directory - (read-file-name "Save in dir: " + (read-directory-name "Save in dir: " gnus-uu-default-dir gnus-uu-default-dir t)))) (gnus-uu-decode-with-method 'gnus-uu-decode-postscript-article diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index b3a60a82b1d..67f15a9ac7c 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -3268,7 +3268,7 @@ g -- Group name." ((= c ?d) (point)) ((= c ?D) - (read-file-name prompt nil default-directory 'lambda)) + (read-directory-name prompt nil default-directory 'lambda)) ((= c ?f) (read-file-name prompt nil nil 'lambda)) ((= c ?F) diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index f3d1682127e..4b904ed2b7a 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,8 @@ +2011-03-05 Antoine Levitt + + * mh-funcs.el (mh-store-msg, mh-store-buffer): + * mh-mime.el (mh-mime-save-parts): Use read-directory-name. + 2011-01-13 Chong Yidong * mh-comp.el (mh-user-agent-compose): New arg RETURN-ACTION. diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el index ad508416501..c3f301e649d 100644 --- a/lisp/mh-e/mh-funcs.el +++ b/lisp/mh-e/mh-funcs.el @@ -286,7 +286,7 @@ to \"Directory\", and then enter the name of the directory for storing the content of these messages." (interactive (list (let ((udir (or mh-store-default-directory default-directory))) - (read-file-name "Store message in directory: " + (read-directory-name "Store message in directory: " udir udir nil)))) (let ((msg-file-to-store (mh-msg-filename (mh-get-msg-num t)))) (with-current-buffer (get-buffer-create mh-temp-buffer) @@ -300,7 +300,7 @@ storing the content of these messages." See `mh-store-msg' for a description of DIRECTORY." (interactive (list (let ((udir (or mh-store-default-directory default-directory))) - (read-file-name "Store buffer in directory: " + (read-directory-name "Store buffer in directory: " udir udir nil)))) (let ((store-directory (expand-file-name directory)) (sh-start (save-excursion diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index de0f49e41db..ba994e73a91 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -390,11 +390,11 @@ do the work." (equal nil mh-mime-save-parts-default-directory) (equal t mh-mime-save-parts-default-directory)) (not mh-mime-save-parts-directory)) - (read-file-name "Store in directory: " nil nil t nil)) + (read-directory-name "Store in directory: " nil nil t)) ((and (or prompt (equal t mh-mime-save-parts-default-directory)) mh-mime-save-parts-directory) - (read-file-name (format + (read-directory-name (format "Store in directory (default %s): " mh-mime-save-parts-directory) "" mh-mime-save-parts-directory t "")) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index f0d36451b5c..8c9ead479e8 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -4071,7 +4071,7 @@ directory, so that Emacs will know its current contents." (ange-ftp-get-files dir t)))) (defun ange-ftp-make-directory (dir &optional parents) - (interactive (list (expand-file-name (read-file-name "Make directory: ")))) + (interactive (list (expand-file-name (read-directory-name "Make directory: ")))) (if parents (let ((parent (file-name-directory (directory-file-name dir)))) (or (file-exists-p parent) diff --git a/lisp/printing.el b/lisp/printing.el index 99ed8c04262..e66cca25933 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -5707,8 +5707,8 @@ If menu binding was not done, calls `pr-menu-bind'." (let* ((dir-name (file-name-directory (or (buffer-file-name) default-directory))) (fmt-prompt (concat "%s[" mess "] Directory to print: ")) - (dir (read-file-name (format fmt-prompt "") - "" dir-name nil dir-name)) + (dir (read-directory-name (format fmt-prompt "") + "" dir-name nil dir-name)) prompt) (while (cond ((not (file-directory-p dir)) (ding) @@ -5718,8 +5718,8 @@ If menu binding was not done, calls `pr-menu-bind'." (setq prompt "Directory is unreadable! ")) (t nil)) (setq dir-name (file-name-directory dir) - dir (read-file-name (format fmt-prompt prompt) - "" dir-name nil dir-name))) + dir (read-directory-name (format fmt-prompt prompt) + "" dir-name nil dir-name))) (file-name-as-directory dir))) diff --git a/lisp/progmodes/ada-prj.el b/lisp/progmodes/ada-prj.el index d7397144498..dd05ab8f310 100644 --- a/lisp/progmodes/ada-prj.el +++ b/lisp/progmodes/ada-prj.el @@ -227,7 +227,7 @@ If FILE-NAME is nil, ask the user for the name." ;; the user to select a directory (let ((use-dialog-box nil)) (unless file-name - (set 'file-name (read-file-name "Root directory: " nil nil t)))) + (set 'file-name (read-directory-name "Root directory: " nil nil t)))) (set 'ada-prj-current-values (plist-put ada-prj-current-values diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index 9f8dd79e0fc..f7965d2cd01 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -2229,8 +2229,8 @@ processed. See also `ebnf-print-buffer'." (interactive - (list (read-file-name "Directory containing EBNF files (print): " - nil default-directory))) + (list (read-directory-name "Directory containing EBNF files (print): " + nil default-directory))) (ebnf-log-header "(ebnf-print-directory %S)" directory) (ebnf-directory 'ebnf-print-buffer directory)) @@ -2287,8 +2287,8 @@ processed. See also `ebnf-spool-buffer'." (interactive - (list (read-file-name "Directory containing EBNF files (spool): " - nil default-directory))) + (list (read-directory-name "Directory containing EBNF files (spool): " + nil default-directory))) (ebnf-log-header "(ebnf-spool-directory %S)" directory) (ebnf-directory 'ebnf-spool-buffer directory)) @@ -2340,8 +2340,8 @@ processed. See also `ebnf-eps-buffer'." (interactive - (list (read-file-name "Directory containing EBNF files (EPS): " - nil default-directory))) + (list (read-directory-name "Directory containing EBNF files (EPS): " + nil default-directory))) (ebnf-log-header "(ebnf-eps-directory %S)" directory) (ebnf-directory 'ebnf-eps-buffer directory)) @@ -2425,8 +2425,8 @@ are processed. See also `ebnf-syntax-buffer'." (interactive - (list (read-file-name "Directory containing EBNF files (syntax): " - nil default-directory))) + (list (read-directory-name "Directory containing EBNF files (syntax): " + nil default-directory))) (ebnf-log-header "(ebnf-syntax-directory %S)" directory) (ebnf-directory 'ebnf-syntax-buffer directory)) diff --git a/lisp/shell.el b/lisp/shell.el index ea89ce765c3..2f11cc6314c 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -569,9 +569,9 @@ Otherwise, one argument `-i' is passed to the shell. ;; of the current-buffer rather than of the *shell* buffer. (setq default-directory (expand-file-name - (read-file-name + (read-directory-name "Default directory: " default-directory default-directory - t nil 'file-directory-p)))))))) + t nil)))))))) (require 'ansi-color) (setq buffer (if (or buffer (not (derived-mode-p 'shell-mode)) (comint-check-proc (current-buffer))) diff --git a/lisp/speedbar.el b/lisp/speedbar.el index dad2a4c82ac..d160a836359 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -1622,7 +1622,7 @@ Files can be renamed to new names or moved to new directories." (let ((f (speedbar-line-file))) (if f (let* ((basedir (file-name-directory f)) - (nd (read-file-name "Create directory: " + (nd (read-directory-name "Create directory: " basedir))) ;; Make the directory (make-directory nd t) diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el index ee34944e448..601b6b1e597 100644 --- a/lisp/vc/emerge.el +++ b/lisp/vc/emerge.el @@ -1271,10 +1271,10 @@ Otherwise, the A or B file present is copied to the output file." (defun emerge-merge-directories (a-dir b-dir ancestor-dir output-dir) (interactive (list - (read-file-name "A directory: " nil nil 'confirm) - (read-file-name "B directory: " nil nil 'confirm) - (read-file-name "Ancestor directory (null for none): " nil nil 'confirm) - (read-file-name "Output directory (null for none): " nil nil 'confirm))) + (read-directory-name "A directory: " nil nil 'confirm) + (read-directory-name "B directory: " nil nil 'confirm) + (read-directory-name "Ancestor directory (null for none): " nil nil 'confirm) + (read-directory-name "Output directory (null for none): " nil nil 'confirm))) ;; Check that we're not on a line (if (not (and (bolp) (eolp))) (error "There is text on this line")) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 9668d550f22..d4970207b94 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1185,9 +1185,9 @@ These are the commands available for use in the file status buffer: ;; therefore it makes sense to always do that. ;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d ;; you may get a new *vc-dir* buffer, different from the original - (file-truename (read-file-name "VC status for directory: " - default-directory default-directory t - nil #'file-directory-p)) + (file-truename (read-directory-name "VC status for directory: " + default-directory default-directory t + nil)) (if current-prefix-arg (intern (completing-read diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 02743847800..200291bd925 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1954,7 +1954,7 @@ checked out in that new branch." ;; For VC's that do not work at file level, it's pointless ;; to ask for a directory, branches are created at repository level. default-directory - (read-file-name "Directory: " default-directory default-directory t)) + (read-directory-name "Directory: " default-directory default-directory t)) (read-string (if current-prefix-arg "New branch name: " "New tag name: ")) current-prefix-arg))) (message "Making %s... " (if branchp "branch" "tag")) @@ -1980,7 +1980,7 @@ allowed and simply skipped)." ;; For VC's that do not work at file level, it's pointless ;; to ask for a directory, branches are created at repository level. default-directory - (read-file-name "Directory: " default-directory default-directory t)) + (read-directory-name "Directory: " default-directory default-directory t)) (read-string "Tag name to retrieve (default latest revisions): ")))) (let ((update (yes-or-no-p "Update any affected buffers? ")) (msg (if (or (not name) (string= name ""))