From 603a0716a8824731a689d3b5144b55eed9ee4db4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 11 Nov 2017 13:48:37 +0200 Subject: Improve the documentation of M-n for entering file names * lisp/files.el (find-file, find-file-other-window) (find-file-other-frame): Mention file-name-at-point-functions in the doc string. Reported by Florian Weimer in http://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00224.html. * doc/emacs/mini.texi (Minibuffer History): Document file-name-at-point-functions and its effect on M-n when typing file names in the minibuffer. * doc/emacs/files.texi (File Names): * doc/emacs/mini.texi (Minibuffer File): Add a cross-reference to "Minibuffer History", where special features of M-n regarding files are described. --- lisp/files.el | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index 9d46d5f85aa..b47411f206a 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1560,7 +1560,15 @@ Switch to a buffer visiting file FILENAME, creating one if none already exists. Interactively, the default if you just type RET is the current directory, but the visited file name is available through the minibuffer history: -type M-n to pull it into the minibuffer. +type \\[next-history-element] to pull it into the minibuffer. + +The first time \\[next-history-element] is used after Emacs prompts for +the file name, the result is affected by `file-name-at-point-functions', +which by default try to guess the file name by looking at point in the +current buffer. Customize the value of `file-name-at-point-functions' +or set it to nil, if you want only the visited file name and the +current directory to be available on first \\[next-history-element] +request. You can visit files on remote machines by specifying something like /ssh:SOME_REMOTE_MACHINE:FILE for the file name. You can @@ -1591,7 +1599,15 @@ an existing one. See the function `display-buffer'. Interactively, the default if you just type RET is the current directory, but the visited file name is available through the minibuffer history: -type M-n to pull it into the minibuffer. +type \\[next-history-element] to pull it into the minibuffer. + +The first time \\[next-history-element] is used after Emacs prompts for +the file name, the result is affected by `file-name-at-point-functions', +which by default try to guess the file name by looking at point in the +current buffer. Customize the value of `file-name-at-point-functions' +or set it to nil, if you want only the visited file name and the +current directory to be available on first \\[next-history-element] +request. Interactively, or if WILDCARDS is non-nil in a call from Lisp, expand wildcards (if any) and visit multiple files." @@ -1615,7 +1631,15 @@ an existing one. See the function `display-buffer'. Interactively, the default if you just type RET is the current directory, but the visited file name is available through the minibuffer history: -type M-n to pull it into the minibuffer. +type \\[next-history-element] to pull it into the minibuffer. + +The first time \\[next-history-element] is used after Emacs prompts for +the file name, the result is affected by `file-name-at-point-functions', +which by default try to guess the file name by looking at point in the +current buffer. Customize the value of `file-name-at-point-functions' +or set it to nil, if you want only the visited file name and the +current directory to be available on first \\[next-history-element] +request. Interactively, or if WILDCARDS is non-nil in a call from Lisp, expand wildcards (if any) and visit multiple files." -- cgit v1.2.3