Subject: 30.1; Inaccurate description of find-file-noselect with NOWARN non-nil

From: richard newton <[email-masked]>
Date: Wed, 30 Jul 2025 13:02:02 +0200

Description of find-file-noselect says "If a buffer exists visiting
FILENAME, return that one, but verify that the file has not changed since
visited or saved."

The description for arg NOWARN only says
"Optional second arg NOWARN non-nil means suppress any warning messages."

But if NOWARN is non-nil then it also does not verify that the file has not
changed

Ideally, the code should be changed to match the description. If not, the
description for NOWARN could be improved.

Simple testcase - with NOWARN, buffer does not get updated with update 2

(defun testcase ()
  (interactive)
  (get-buffer-create "testing")
  (switch-to-buffer "testing")
  (shell-command-to-string (concat "echo start > /tmp/test1"))
  (set-buffer (find-file-noselect "/tmp/test1"))
  (switch-to-buffer "testing")
  (shell-command-to-string (concat "echo update 1 > /tmp/test1"))
  ;; without NOWARN - will prompt to update file
  (set-buffer (find-file-noselect "/tmp/test1"))
  (goto-char (point-min))
  (let ((beg (point)))
    (goto-char (point-max))
    (message (buffer-substring-no-properties beg (point))))
  (shell-command-to-string (concat "echo update 2 > /tmp/test1"))
  ;; with NOWARN
  (set-buffer (find-file-noselect "/tmp/test1" t))
  (goto-char (point-min))
  (let ((beg (point)))
    (goto-char (point-max))
    (message (buffer-substring-no-properties beg (point)))))