Function: read-file-name--defaults
read-file-name--defaults is a byte-compiled function defined in
minibuffer.el.gz.
Signature
(read-file-name--defaults &optional DIR INITIAL)
Source Code
;; Defined in /usr/src/emacs/lisp/minibuffer.el.gz
(defun read-file-name--defaults (&optional dir initial)
(let ((default
(cond
;; With non-nil `initial', use `dir' as the first default.
;; Essentially, this mean reversing the normal order of the
;; current directory name and the current file name, i.e.
;; 1. with normal file reading:
;; 1.1. initial input is the current directory
;; 1.2. the first default is the current file name
;; 2. with non-nil `initial' (e.g. for `find-alternate-file'):
;; 2.2. initial input is the current file name
;; 2.1. the first default is the current directory
(initial (abbreviate-file-name dir))
;; In file buffers, try to get the current file name
(buffer-file-name
(abbreviate-file-name buffer-file-name))))
(file-name-at-point
(run-hook-with-args-until-success 'file-name-at-point-functions)))
(when file-name-at-point
(setq default (delete-dups
(delete "" (delq nil (list file-name-at-point default))))))
;; Append new defaults to the end of existing `minibuffer-default'.
(append
(if (listp minibuffer-default) minibuffer-default (list minibuffer-default))
(if (listp default) default (list default)))))