Put command line file names and mouse dragging onto 'file-name-history'

* lisp/dnd.el (dnd-open-local-file): Add file to history.
* lisp/files.el (file-name-history--add): New function (bug#12915).

* lisp/startup.el (command-line-1): Add file to history.
This commit is contained in:
Lars Ingebrigtsen 2021-07-20 13:48:10 +02:00
parent 06ee8ac36c
commit e02576c7eb
4 changed files with 14 additions and 0 deletions

View file

@ -1702,6 +1702,10 @@ rather than FUN itself, to `minibuffer-setup-hook'."
(list (read-file-name prompt nil default-directory mustmatch)
t))
(defun file-name-history--add (file)
"Add FILE to `file-name-history'."
(add-to-history 'file-name-history (abbreviate-file-name file)))
(defun find-file (filename &optional wildcards)
"Edit file FILENAME.
Switch to a buffer visiting file FILENAME,