emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 142007b747e: Don't suggest to revert buffer from non-existing fil


From: Eli Zaretskii
Subject: master 142007b747e: Don't suggest to revert buffer from non-existing file
Date: Tue, 25 Jul 2023 10:52:09 -0400 (EDT)

branch: master
commit 142007b747eacf81b609f98852053bc0f6e18bdf
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Don't suggest to revert buffer from non-existing file
    
    * lisp/files-x.el (modify-file-local-variable-message): Suggest to
    revert from the buffer's file only if that file exists; otherwise
    suggest 'normal-mode'.  (Bug#64844)
---
 lisp/files-x.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/files-x.el b/lisp/files-x.el
index 9b1a7a17902..3ba7632d253 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -136,7 +136,10 @@ Intended to be used in the `interactive' spec of
              (eq new-value not-value)
              (not (equal old-value new-value)))
       (message "%s" (substitute-command-keys
-                    "For this change to take effect revisit file using 
\\[revert-buffer]")))))
+                     (if (and (stringp buffer-file-name)
+                              (file-exists-p buffer-file-name))
+                        "For this change to take effect revisit file using 
\\[revert-buffer]"
+                       "For this change to take effect use 
\\[normal-mode]"))))))
 
 (defun modify-file-local-variable (variable value op &optional interactive)
   "Modify file-local VARIABLE in Local Variables depending on operation OP.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]