have been saved."
(interactive
(list
- (read-file-name (format-prompt "Write abbrev file" abbrev-file-name)
+ (read-file-name "Write abbrev file: "
(file-name-directory (expand-file-name abbrev-file-name))
abbrev-file-name)))
(or (and file (> (length file) 0))
(defun abbrev-edit-save-to-file (file)
"Save all user-level abbrev definitions in current buffer to FILE."
(interactive
- (list (read-file-name (format-prompt "Save abbrevs to file" abbrev-file-name)
+ (list (read-file-name "Save abbrevs to file: "
(file-name-directory
(expand-file-name abbrev-file-name))
abbrev-file-name)))
bookmark-default-file)))
(if parg
;; This should be part of the `interactive' spec.
- (read-file-name (format-prompt "File to save bookmarks in"
- default)
+ (read-file-name (format "File to save bookmarks in: (%s) "
+ default)
(file-name-directory default) default)
default))))
(bookmark-write-file file)
(or (car bookmark-bookmarks-timestamp)
(expand-file-name bookmark-default-file))))
(prefix current-prefix-arg))
- (list (read-file-name (format-prompt "Load bookmarks from" default)
+ (list (read-file-name (format "Load bookmarks from: (%s) " default)
(file-name-directory default) default 'confirm)
prefix nil prefix)))
(let* ((file (expand-file-name file))
(if (next-read-file-uses-dialog-p)
(read-directory-name (format "Dired %s(directory): " str)
nil default-directory nil)
- (read-file-name (format-prompt "Dired %s(directory)"
- default-directory str)
- nil default-directory)))))
+ (read-file-name (format "Dired %s(directory): " str)
+ nil default-directory nil)))))
;; We want to switch to a more sophisticated version of
;; dired-read-dir-and-switches like the following, if there is a way
;; (interactive "FWrite file: ")
(interactive
(list (if buffer-file-name
- (read-file-name "Write file: ")
- (read-file-name
- (format-prompt "Write file" (file-name-nondirectory (buffer-name)))
- default-directory
- (expand-file-name (file-name-nondirectory (buffer-name))
- default-directory)))
+ (read-file-name "Write file: "
+ nil nil nil nil)
+ (read-file-name "Write file: " default-directory
+ (expand-file-name
+ (file-name-nondirectory (buffer-name))
+ default-directory)
+ nil nil))
(not current-prefix-arg)))
(or (null filename) (string-equal filename "")
(progn
(unless (run-hook-with-args-until-success 'write-contents-functions)
;; If buffer has no file name, ask user for one.
(or buffer-file-name
- (let* ((default (expand-file-name (buffer-name)))
- (filename
- (expand-file-name
- (read-file-name
- (format-prompt "File to save in"
- (file-name-nondirectory default))
- nil default))))
+ (let ((filename
+ (expand-file-name
+ (read-file-name "File to save in: "
+ nil (expand-file-name (buffer-name))))))
(if (file-exists-p filename)
(if (file-directory-p filename)
;; Signal an error if the user specified the name of an
"Load Gnus bookmarks from FILE (which must be in bookmark format)."
(interactive
(list (read-file-name
- (format-prompt "Load Gnus bookmarks from" gnus-bookmark-default-file)
+ (format "Load Gnus bookmarks from: (%s) "
+ gnus-bookmark-default-file)
"~/" gnus-bookmark-default-file 'confirm)))
(setq file (expand-file-name file))
(if (file-readable-p file)
;;;###autoload
(defun doc-file-to-man (file)
"Produce an nroff buffer containing the doc-strings from the DOC file."
- (interactive (list (read-file-name (format-prompt "Name of DOC file"
- internal-doc-file-name)
- doc-directory internal-doc-file-name t)))
+ (interactive (list (read-file-name "Name of DOC file: " doc-directory
+ internal-doc-file-name t)))
(or (file-readable-p file)
(error "Cannot read file `%s'" file))
(pop-to-buffer (generate-new-buffer "*man-doc*"))
;;;###autoload
(defun doc-file-to-info (file)
"Produce a texinfo buffer with sorted doc-strings from the DOC file."
- (interactive (list (read-file-name (format-prompt "Name of DOC file"
- internal-doc-file-name)
- doc-directory internal-doc-file-name t)))
+ (interactive (list (read-file-name "Name of DOC file: " doc-directory
+ internal-doc-file-name t)))
(or (file-readable-p file)
(error "Cannot read file `%s'" file))
(let ((i 0) type name doc alist)
(unless (y-or-n-p "This entity is truncated; save anyway? ")
(error "Aborted")))
(setq filename (expand-file-name
- (read-file-name (format-prompt "Save as" filename)
+ (read-file-name (format "Save as (default: %s): " filename)
directory
(expand-file-name filename directory))
directory))
(defun multi-isearch-read-files ()
"Return a list of files specified interactively, one by one."
;; Most code from `multi-occur'.
- (let* ((files (list (read-file-name
- (format-prompt "First file to search"
- (file-name-nondirectory buffer-file-name))
- default-directory buffer-file-name)))
+ (let* ((files (list (read-file-name "First file to search: "
+ default-directory
+ buffer-file-name)))
(file nil))
(while (not (string-equal
(setq file (read-file-name
(or (locate-dominating-file default-directory "TAGS")
default-directory)))
(list (read-file-name
- (format-prompt "Visit tags table" "TAGS")
+ "Visit tags table (default TAGS): "
;; default to TAGS from default-directory up to root.
default-tag-dir
(expand-file-name "TAGS" default-tag-dir)
(car list))
;; Finally, prompt the user for a file name.
(expand-file-name
- (read-file-name (format-prompt "Visit tags table" "TAGS")
+ (read-file-name "Visit tags table (default TAGS): "
default-directory
"TAGS"
t))))))
If the OLD prefix arg is passed, tell the file NAME of the old file."
(interactive
(let* ((old current-prefix-arg)
- (fs (diff-hunk-file-names current-prefix-arg))
- (default (diff-find-file-name old 'noprompt)))
+ (fs (diff-hunk-file-names current-prefix-arg)))
(unless fs (error "No file name to look for"))
- (list old (read-file-name (format-prompt "File for %s" default (car fs))
- nil default t))))
+ (list old (read-file-name (format "File for %s: " (car fs))
+ nil (diff-find-file-name old 'noprompt) t))))
(let ((fs (diff-hunk-file-names old)))
(unless fs (error "No file name to look for"))
(push (cons fs name) diff-remembered-files-alist)))
patch-file-name)
(setq patch-file-name
(read-file-name
- (format-prompt "Patch is in file"
- (and buffer-file-name
+ (format "Patch is in file%s: "
+ (cond ((and buffer-file-name
(equal (expand-file-name dir)
- (file-name-directory buffer-file-name))
- (file-name-nondirectory buffer-file-name)))
+ (file-name-directory buffer-file-name)))
+ (concat
+ " (default "
+ (file-name-nondirectory buffer-file-name)
+ ")"))
+ (t "")))
dir buffer-file-name 'must-match))
(if (file-directory-p patch-file-name)
(error "Patch file cannot be a directory: %s" patch-file-name)
;; repository, make sure it's a parent of
;; file.
(read-file-name
- (format-prompt "create %s repository in" def-dir bk)
+ (format "create %s repository in: " bk)
default-directory def-dir t nil
(lambda (arg)
+ (message "arg %s" arg)
(and (file-directory-p arg)
(string-prefix-p (expand-file-name arg) def-dir)))))))
(let ((default-directory repo-dir))
"Delete file and mark it as such in the version control system.
If called interactively, read FILE, defaulting to the current
buffer's file name if it's under version control."
- (interactive (list (let ((default (when (vc-backend buffer-file-name)
- buffer-file-name)))
- (read-file-name "VC delete file" default)
- nil default t)))
+ (interactive (list (read-file-name "VC delete file: " nil
+ (when (vc-backend buffer-file-name)
+ buffer-file-name)
+ t)))
(setq file (expand-file-name file))
(let ((buf (get-file-buffer file))
(backend (vc-backend file)))
"Rename file OLD to NEW in both work area and repository.
If called interactively, read OLD and NEW, defaulting OLD to the
current buffer's file name if it's under version control."
- (interactive (list (let ((default (when (vc-backend buffer-file-name)
- buffer-file-name)))
- (read-file-name (format-prompt "VC rename file" default)
- nil default t))
+ (interactive (list (read-file-name "VC rename file: " nil
+ (when (vc-backend buffer-file-name)
+ buffer-file-name) t)
(read-file-name "Rename to: ")))
;; in CL I would have said (setq new (merge-pathnames new old))
(let ((old-base (file-name-nondirectory old)))
FILE-NAME combined with `xwidget-webkit-download-dir' is the default file name
of the prompt when reading. When the file name the user specified is a
directory, URL is saved at the specified directory as FILE-NAME."
- (let* ((default (when file-name
- (expand-file-name
- file-name
- xwidget-webkit-download-dir)))
- (save-name
- (read-file-name
- (format-prompt "Save URL `%s' of type `%s' in file/directory"
- default url mime-type)
- xwidget-webkit-download-dir default)))
+ (let ((save-name (read-file-name
+ (format "Save URL `%s' of type `%s' in file/directory: "
+ url mime-type)
+ xwidget-webkit-download-dir
+ (when file-name
+ (expand-file-name
+ file-name
+ xwidget-webkit-download-dir)))))
(if (file-directory-p save-name)
(setq save-name
(expand-file-name (file-name-nondirectory file-name) save-name)))