GNU bug report logs -
#14710
add-file-local-variable vs. unquoted string
Previous Next
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
Message #31 received at 14710 <at> debbugs.gnu.org (full text, mbox):
> 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 20 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.