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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#14710: closed (add-file-local-variable vs. unquoted string)
Date: Tue, 25 Jun 2013 13:08:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 25 Jun 2013 09:06:52 -0400
with message-id <jwvhagmbaza.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#14710: add-file-local-variable vs. unquoted string
has caused the debbugs.gnu.org bug report #14710,
regarding add-file-local-variable vs. unquoted string
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
14710: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14710
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: jidanni <at> jidanni.org
To: bug-gnu-emacs <at> gnu.org
Subject: add-file-local-variable vs. unquoted string
Date: Tue, 25 Jun 2013 04:16:05 +0800
Try
M-x add-file-local-variable
compile-command
a b c

Note how b c are thrown away.
Yes the user should have typed "a b c",
but still some warning should be printed upon throwing them away.

Package: emacs-snapshot
Version: 2:20130618-1


[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: jidanni <at> jidanni.org
Cc: 14710-done <at> debbugs.gnu.org
Subject: Re: bug#14710: add-file-local-variable vs. unquoted string
Date: Tue, 25 Jun 2013 09:06:52 -0400
> Try
> M-x add-file-local-variable
> compile-command
> a b c

> Note how b c are thrown away.
> Yes the user should have typed "a b c",
> but still some warning should be printed upon throwing them away.

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.


        Stefan


=== modified file 'lisp/files-x.el'
--- lisp/files-x.el	2013-06-18 20:38:43 +0000
+++ lisp/files-x.el	2013-06-25 12:59:31 +0000
@@ -71,12 +69,14 @@
 	 (format "Add %s with value: " variable))
        default))
      (t
-      (read (read-string (format "Add %s with value: " variable)
-			 nil 'set-variable-value-history
-			 (format "%S"
+    (let ((default (format "%S"
 				 (cond ((eq variable 'unibyte) t)
 				       ((boundp variable)
-					(symbol-value variable))))))))))
+                                  (symbol-value variable)))))
+          (minibuffer-completing-symbol t))
+      (read-from-minibuffer (format "Add %s with value: " variable)
+                            nil read-expression-map t
+                            'set-variable-value-history)))))
 
 (defun read-file-local-variable-mode ()
   "Read per-directory file-local variable's mode using completion.



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.