From 477335a10ba6d91dc1600b2a05ea202d4b851417 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 2 Aug 2025 17:33:15 +0300 Subject: [PATCH] ; Fix documentation of 'find-file-noselect' * doc/lispref/files.texi (Visiting Functions): * lisp/files.el (find-file-noselect): Document that NOWARN non-nil also bypasses the file's last change verification. (Bug#79127) --- doc/lispref/files.texi | 10 ++++++---- lisp/files.el | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index c285cd1c683..d69bc46cd2c 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -149,9 +149,10 @@ The function returns an existing buffer if there is one; otherwise it creates a new buffer and reads the file into it. When @code{find-file-noselect} uses an existing buffer, it first verifies that the file has not changed since it was last visited or saved in -that buffer. If the file has changed, this function asks the user -whether to reread the changed file. If the user says @samp{yes}, any -edits previously made in the buffer are lost. +that buffer (unless @var{nowarn} is non-@code{nil}, see below). If the +file has changed, this function asks the user whether to reread the +changed file. If the user says @samp{yes}, any edits previously made in +the buffer are lost. Reading the file involves decoding the file's contents (@pxref{Coding Systems}), including end-of-line conversion, and format conversion @@ -163,7 +164,8 @@ This function displays warning or advisory messages in various peculiar cases, unless the optional argument @var{nowarn} is non-@code{nil}. For example, if it needs to create a buffer, and there is no file named @var{filename}, it displays the message @samp{(New file)} in the echo -area, and leaves the buffer empty. +area, and leaves the buffer empty. The verification of the file's last +change is also bypassed if @var{nowarn} is non-@code{nil}. The @code{find-file-noselect} function normally calls @code{after-find-file} after reading the file (@pxref{Subroutines of diff --git a/lisp/files.el b/lisp/files.el index c288a5a8b26..6544ee54ee4 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2502,7 +2502,9 @@ be visible in the echo area." If a buffer exists visiting FILENAME, return that one, but verify that the file has not changed since visited or saved. The buffer is not selected, just returned to the caller. -Optional second arg NOWARN non-nil means suppress any warning messages. +Optional second arg NOWARN non-nil means suppress any warning messages, +and also don't verify the that the file has not been changed since +last visited or saved. Optional third arg RAWFILE non-nil means the file is read literally. Optional fourth arg WILDCARDS non-nil means do wildcard processing and visit all the matching files. When wildcards are actually