GNU bug report logs - #14710
add-file-local-variable vs. unquoted string

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Mon, 24 Jun 2013 21:05:03 UTC

Severity: wishlist

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: 14710 <at> debbugs.gnu.org
Cc: monnier <at> iro.umontreal.ca, jidanni <at> jidanni.org
Subject: bug#14710: add-file-local-variable vs. unquoted string
Date: Tue, 25 Jun 2013 23:18:23 +0300
> Good point.  I fixed it with the patch below, which uses
> read-from-minibuffer (with a non-nil `read' argument) instead of
> read-string, so it re-uses the check that was already used when reading
> an Elisp expression.

FWIW, when I wrote `read-file-local-variable-value' I copied its code:

      (read (read-string (format "Add %s with value (use quotes for strings): "
				 variable)
			 nil 'set-variable-value-history
			 (format "%S" ...

from `set-variable':

                   (read
                    (read-string prompt nil
                                 'set-variable-value-history
				 (format "%S" ...

So `set-variable' seems to have the same problem, although
after entering a string without quotes with e.g.
`M-x set-variable RET compile-command RET a b c RET'
it checks `custom-type' of the entered value and reports the
error "Value `a' does not match type string of compile-command".

Perhaps this is not too problematic as long as `set-variable' is used
only for customizable options, and not for ordinary variables.




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

Previous Next


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