GNU bug report logs - #9820
24.0.90; Behaviour of add-file-local-variable

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Fri, 21 Oct 2011 05:14:02 UTC

Severity: wishlist

Found in version 24.0.90

Fixed in version 24.3.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 9820 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 9820 <at> debbugs.gnu.org
Subject: Re: bug#9820: 24.0.90; Behaviour of add-file-local-variable
Date: Fri, 21 Oct 2011 17:06:10 +0300
> Transcripts of exchanges on emacs-devel.
> http://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00850.html
> http://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00867.html

Thanks for filing the bug report based on that discussion.
As suggested, the following patch implements displaying a message.

> Additional note: All other file-local related commands may have to be
> audited for the requested behaviour.

It displays a message only in `add-file-local-variable' and
`add-file-local-variable-prop-line'.  I have no opinion
what other commands might do.

=== modified file 'lisp/files-x.el'
--- lisp/files-x.el	2011-04-19 13:44:55 +0000
+++ lisp/files-x.el	2011-10-21 14:04:22 +0000
@@ -214,7 +214,11 @@ (defun add-file-local-variable (variable
   (interactive
    (let ((variable (read-file-local-variable "Add file-local variable")))
      (list variable (read-file-local-variable-value variable))))
-  (modify-file-local-variable variable value 'add-or-replace))
+  (modify-file-local-variable variable value 'add-or-replace)
+  (when (and (called-interactively-p 'interactive)
+	     (symbolp variable) (boundp variable)
+	     (not (equal (symbol-value variable) value)))
+    (message "Revisit file to make this change take effect")))
 
 ;;;###autoload
 (defun delete-file-local-variable (variable)
@@ -335,7 +339,11 @@ (defun add-file-local-variable-prop-line
   (interactive
    (let ((variable (read-file-local-variable "Add -*- file-local variable")))
      (list variable (read-file-local-variable-value variable))))
-  (modify-file-local-variable-prop-line variable value 'add-or-replace))
+  (modify-file-local-variable-prop-line variable value 'add-or-replace)
+  (when (and (called-interactively-p 'interactive)
+	     (symbolp variable) (boundp variable)
+	     (not (equal (symbol-value variable) value)))
+    (message "Revisit file to make this change take effect")))
 
 ;;;###autoload
 (defun delete-file-local-variable-prop-line (variable)





This bug report was last modified 12 years and 61 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.