GNU bug report logs -
#4664
23.1.50; local variables completions
Previous Next
Reported by: Leo <sdl.web <at> gmail.com>
Date: Wed, 7 Oct 2009 11:25:06 UTC
Severity: normal
Done: Leo <sdl.web <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4664 in the body.
You can then email your comments to 4664 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Wed, 07 Oct 2009 11:25:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Leo <sdl.web <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 07 Oct 2009 11:25:07 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
For example, completions in add-file-local-variable do not include local
variables such as auto-fill-function. Could this be improved?
Leo
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Wed, 07 Oct 2009 14:40:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 07 Oct 2009 14:40:06 GMT)
Full text and
rfc822 format available.
Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
> For example, completions in add-file-local-variable do not include local
> variables such as auto-fill-function. Could this be improved?
Thanks, I installed the patch below which should help,
Stefan
=== modified file 'lisp/files-x.el'
--- lisp/files-x.el 2009-10-04 07:44:39 +0000
+++ lisp/files-x.el 2009-10-07 14:30:53 +0000
@@ -49,6 +49,7 @@
obarray
(lambda (sym)
(or (user-variable-p sym)
+ (get sym 'safe-local-variable)
(memq sym '(mode eval coding unibyte))))
nil nil nil default nil))
(and (stringp variable) (intern variable))))
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Wed, 07 Oct 2009 14:40:08 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 07 Oct 2009 14:40:08 GMT)
Full text and
rfc822 format available.
Reply sent
to
Leo <sdl.web <at> gmail.com>
:
You have taken responsibility.
(Wed, 07 Oct 2009 21:15:07 GMT)
Full text and
rfc822 format available.
Notification sent
to
Leo <sdl.web <at> gmail.com>
:
bug acknowledged by developer.
(Wed, 07 Oct 2009 21:15:07 GMT)
Full text and
rfc822 format available.
Message #20 received at 4664-done <at> emacsbugs.donarmstrong.com (full text, mbox):
On 2009-10-07 15:34 +0100, Stefan Monnier wrote:
>> For example, completions in add-file-local-variable do not include local
>> variables such as auto-fill-function. Could this be improved?
>
> Thanks, I installed the patch below which should help,
[-patch-]
Thank you.
Leo
Message #21 received at 4664-done <at> emacsbugs.donarmstrong.com (full text, mbox):
> obarray
> (lambda (sym)
> (or (user-variable-p sym)
> + (get sym 'safe-local-variable)
> (memq sym '(mode eval coding unibyte))))
> nil nil nil default nil))
> (and (stringp variable) (intern variable))))
Thanks, this also added usually unbound symbols
like `generated-autoload-file'.
--
Juri Linkov
http://www.jurta.org/emacs/
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Thu, 08 Oct 2009 01:15:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 08 Oct 2009 01:15:05 GMT)
Full text and
rfc822 format available.
Message #26 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
> Thanks, this also added usually unbound symbols
> like `generated-autoload-file'.
Is that a problem?
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Thu, 08 Oct 2009 07:00:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Leo <sdl.web <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 08 Oct 2009 07:00:06 GMT)
Full text and
rfc822 format available.
Message #31 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
On 2009-10-08 02:10 +0100, Stefan Monnier wrote:
>> Thanks, this also added usually unbound symbols
>> like `generated-autoload-file'.
>
> Is that a problem?
>
>
> Stefan
When trying to add generated-autoload-file it produces an error. So I
wonder if the following is more suitable?
(or (user-variable-sym)
(and (boundp sym) (get sym 'safe-local-variable))
(memq sym '(mode eval coding unibyte)))
--
Leo's Emacs uptime: 3 minutes, 20 seconds
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Thu, 08 Oct 2009 11:35:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juri Linkov <juri <at> jurta.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 08 Oct 2009 11:35:05 GMT)
Full text and
rfc822 format available.
Message #36 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
>>> Thanks, this also added usually unbound symbols
>>> like `generated-autoload-file'.
>>
>> Is that a problem?
No, no. Some time ago I noticed that there are some unbound symbols
valid for inclusion to the Local Variables section but unavailable
for completion. So far I had no idea about the correct way
to add them. Your change fixed that.
> When trying to add generated-autoload-file it produces an error. So I
> wonder if the following is more suitable?
>
> (or (user-variable-sym)
> (and (boundp sym) (get sym 'safe-local-variable))
> (memq sym '(mode eval coding unibyte)))
This is a wrong fix. It again removes valid local variables like
`generated-autoload-file' from completion. The right fix would be
just to avoid trying to provide their current value as the default
value:
Index: lisp/files-x.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/files-x.el,v
retrieving revision 1.4
diff -c -r1.4 files-x.el
*** lisp/files-x.el 7 Oct 2009 14:33:37 -0000 1.4
--- lisp/files-x.el 8 Oct 2009 09:21:22 -0000
***************
*** 92,98 ****
nil 'set-variable-value-history
(format "%S"
(cond ((eq variable 'unibyte) t)
! (t (symbol-value variable))))))))))
(defun read-file-local-variable-mode ()
"Read per-directory file-local variable's mode using completion.
--- 92,99 ----
nil 'set-variable-value-history
(format "%S"
(cond ((eq variable 'unibyte) t)
! ((boundp variable)
! (symbol-value variable))))))))))
(defun read-file-local-variable-mode ()
"Read per-directory file-local variable's mode using completion.
--
Juri Linkov
http://www.jurta.org/emacs/
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Thu, 08 Oct 2009 12:05:13 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Leo <sdl.web <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 08 Oct 2009 12:05:13 GMT)
Full text and
rfc822 format available.
Message #41 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
On 2009-10-08 10:22 +0100, Juri Linkov wrote:
> This is a wrong fix. It again removes valid local variables like
> `generated-autoload-file' from completion. The right fix would be
> just to avoid trying to provide their current value as the default
> value:
[-patch-]
Thank you for the patch.
Leo
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Fri, 09 Oct 2009 19:35:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Fri, 09 Oct 2009 19:35:05 GMT)
Full text and
rfc822 format available.
Message #46 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
> This is a wrong fix. It again removes valid local variables like
> `generated-autoload-file' from completion. The right fix would be
> just to avoid trying to provide their current value as the default
> value:
Agreed. Actually even if a symbol is not known to be safe and not
completable, it should be possible for the user to use it, since it may
simply not be loaded yet.
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Mon, 12 Oct 2009 00:05:07 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juri Linkov <juri <at> jurta.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 12 Oct 2009 00:05:07 GMT)
Full text and
rfc822 format available.
Message #51 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
>> This is a wrong fix. It again removes valid local variables like
>> `generated-autoload-file' from completion. The right fix would be
>> just to avoid trying to provide their current value as the default
>> value:
>
> Agreed. Actually even if a symbol is not known to be safe and not
> completable, it should be possible for the user to use it, since it may
> simply not be loaded yet.
Yes, this is already the case: the user is free to enter any variable.
It is only completion with require-match=nil that provides a list
of known variable names.
--
Juri Linkov
http://www.jurta.org/emacs/
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Mon, 12 Oct 2009 15:55:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Leo <sdl.web <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 12 Oct 2009 15:55:07 GMT)
Full text and
rfc822 format available.
Message #56 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
On 2009-10-12 00:54 +0100, Juri Linkov wrote:
>>> This is a wrong fix. It again removes valid local variables like
>>> `generated-autoload-file' from completion. The right fix would be
>>> just to avoid trying to provide their current value as the default
>>> value:
>>
>> Agreed. Actually even if a symbol is not known to be safe and not
>> completable, it should be possible for the user to use it, since it may
>> simply not be loaded yet.
>
> Yes, this is already the case: the user is free to enter any variable.
> It is only completion with require-match=nil that provides a list
> of known variable names.
The completion of 'mode' does not include modes like outline-minor-mode.
Is this an oversight?
Leo
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Mon, 12 Oct 2009 20:45:11 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juri Linkov <juri <at> jurta.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 12 Oct 2009 20:45:11 GMT)
Full text and
rfc822 format available.
Message #61 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
>>>> This is a wrong fix. It again removes valid local variables like
>>>> `generated-autoload-file' from completion. The right fix would be
>>>> just to avoid trying to provide their current value as the default
>>>> value:
>>>
>>> Agreed. Actually even if a symbol is not known to be safe and not
>>> completable, it should be possible for the user to use it, since it may
>>> simply not be loaded yet.
>>
>> Yes, this is already the case: the user is free to enter any variable.
>> It is only completion with require-match=nil that provides a list
>> of known variable names.
>
> The completion of 'mode' does not include modes like outline-minor-mode.
> Is this an oversight?
I've excluded minor modes from completion intentionally because the manual
says in (info "(emacs) Specifying File Variables"):
You can use the `mode' "variable" to set minor modes as well as the
major modes; in fact, you can use it more than once, first to set the
major mode and then to set minor modes which are specific to particular
buffers. But most minor modes should not be specified in the file at
all, because they represent user preferences.
I'm not sure about a list of minor modes that represent user preferences.
Where can I see a complete list of their names? Since this is too vague,
perhaps we should include minor modes to the completion of 'mode'.
--
Juri Linkov
http://www.jurta.org/emacs/
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Tue, 13 Oct 2009 11:25:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Leo <sdl.web <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Tue, 13 Oct 2009 11:25:06 GMT)
Full text and
rfc822 format available.
Message #66 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
On 2009-10-12 21:31 +0100, Juri Linkov wrote:
[...]
>> The completion of 'mode' does not include modes like outline-minor-mode.
>> Is this an oversight?
>
> I've excluded minor modes from completion intentionally because the manual
> says in (info "(emacs) Specifying File Variables"):
>
> You can use the `mode' "variable" to set minor modes as well as the
> major modes; in fact, you can use it more than once, first to set the
> major mode and then to set minor modes which are specific to particular
> buffers. But most minor modes should not be specified in the file at
> all, because they represent user preferences.
I wonder if this is a bit silly. Whether it is user preferences should
be left for the users who are editing that file to decide. For example,
if Will Smith and I are editing the same file and I want to enable
outline-minor-mode in the local variables, I will consult him before
enabling it.
> I'm not sure about a list of minor modes that represent user preferences.
> Where can I see a complete list of their names? Since this is too vague,
> perhaps we should include minor modes to the completion of 'mode'.
--
Leo's Emacs uptime: 17 minutes, 0 seconds
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Tue, 13 Oct 2009 20:00:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Tue, 13 Oct 2009 20:00:06 GMT)
Full text and
rfc822 format available.
Message #71 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
>> I've excluded minor modes from completion intentionally because the manual
>> says in (info "(emacs) Specifying File Variables"):
I'm not sure it's a good idea to remove them from completions.
>> You can use the `mode' "variable" to set minor modes as well as the
>> major modes; in fact, you can use it more than once, first to set the
>> major mode and then to set minor modes which are specific to particular
>> buffers. But most minor modes should not be specified in the file at
>> all, because they represent user preferences.
> I wonder if this is a bit silly.
Which part is silly? The above text simply describes things as they
stand, without forcing any particular choice.
> Whether it is user preferences should be left for the users who are
> editing that file to decide.
Which it is. We simply added the note about minor modes (which is
actually not specific to minor modes, it also holds for many plain
variables), because it has been found to be a common misuse.
> For example, if Will Smith and I are editing the same file and I want
> to enable outline-minor-mode in the local variables, I will consult
> him before enabling it.
That's fine. A very common situation is a file that you're the sole
author, so you put any random personal setting in there without having
to worry about asking Will. And then you publish it on the web (e.g. it
could be an Elisp package), so anybody who opens it in Emacs gets your
preferences imposed on himself while viewing your file.
> Leo's Emacs uptime: 17 minutes, 0 seconds
17 minutes and counting... how's that for impressive?!
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Tue, 13 Oct 2009 22:45:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juri Linkov <juri <at> jurta.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Tue, 13 Oct 2009 22:45:03 GMT)
Full text and
rfc822 format available.
Message #76 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
>>> I've excluded minor modes from completion intentionally because the
>>> manual says in (info "(emacs) Specifying File Variables"):
>
> I'm not sure it's a good idea to remove them from completions.
Actually not a good idea. I've lifted this restriction.
--
Juri Linkov
http://www.jurta.org/emacs/
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4664
; Package
emacs
.
(Wed, 14 Oct 2009 01:25:08 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Leo <sdl.web <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 14 Oct 2009 01:25:08 GMT)
Full text and
rfc822 format available.
Message #81 received at 4664 <at> emacsbugs.donarmstrong.com (full text, mbox):
On 2009-10-13 23:35 +0100, Juri Linkov wrote:
>>>> I've excluded minor modes from completion intentionally because the
>>>> manual says in (info "(emacs) Specifying File Variables"):
>>
>> I'm not sure it's a good idea to remove them from completions.
>
> Actually not a good idea. I've lifted this restriction.
Thank you.
Leo
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> emacsbugs.donarmstrong.com
.
(Wed, 11 Nov 2009 15:24:15 GMT)
Full text and
rfc822 format available.
This bug report was last modified 15 years and 284 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.