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


View this message in rfc822 format

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 9820 <at> debbugs.gnu.org
Subject: bug#9820: 24.0.90; Behaviour of add-file-local-variable
Date: Sat, 22 Oct 2011 10:27:53 +0530
>> 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.

Would you like to give me a new patch with the warning message pushed to
modify-* routines (as Stefan suggested).

This way a (message ...) can be issued as soon as any modifications -
add-or-replace or delete - happen on the buffer.  I think the extra
intelligence of checking for new value against the old value could be
dropped altogether. The message is merely meant as a warning, so being
paranoid and issuing a warning ALWAYS will also serve the purpose well.

> === 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.