unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4664: 23.1.50; local variables completions
@ 2009-10-07 11:15 ` Leo
  2009-10-07 14:34   ` Stefan Monnier
  2009-10-07 21:15   ` bug#4664: marked as done (23.1.50; local variables completions) Emacs bug Tracking System
  0 siblings, 2 replies; 15+ messages in thread
From: Leo @ 2009-10-07 11:15 UTC (permalink / raw)
  To: emacs-pretest-bug

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





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-07 11:15 ` bug#4664: 23.1.50; local variables completions Leo
@ 2009-10-07 14:34   ` Stefan Monnier
       [not found]     ` <87pr8yanj1.fsf@mail.jurta.org>
  2009-10-07 21:15   ` bug#4664: marked as done (23.1.50; local variables completions) Emacs bug Tracking System
  1 sibling, 1 reply; 15+ messages in thread
From: Stefan Monnier @ 2009-10-07 14:34 UTC (permalink / raw)
  To: Leo; +Cc: emacs-pretest-bug, 4664

> 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))))








^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: marked as done (23.1.50; local variables completions)
  2009-10-07 11:15 ` bug#4664: 23.1.50; local variables completions Leo
  2009-10-07 14:34   ` Stefan Monnier
@ 2009-10-07 21:15   ` Emacs bug Tracking System
  1 sibling, 0 replies; 15+ messages in thread
From: Emacs bug Tracking System @ 2009-10-07 21:15 UTC (permalink / raw)
  To: Leo

[-- Attachment #1: Type: text/plain, Size: 866 bytes --]

Your message dated Wed, 07 Oct 2009 22:06:34 +0100
with message-id <xbaipr8yncbp.fsf@cam.ac.uk>
and subject line Re: bug#4664: 23.1.50; local variables completions
has caused the Emacs bug report #4664,
regarding 23.1.50; local variables completions
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4664: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4664
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 2410 bytes --]

From: Leo <sdl.web@gmail.com>
To: emacs-pretest-bug@gnu.org
Subject: 23.1.50; local variables completions
Date: Wed, 07 Oct 2009 12:15:27 +0100
Message-ID: <m08wfn3168.fsf@cam.ac.uk>

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


[-- Attachment #3: Type: message/rfc822, Size: 2018 bytes --]

From: Leo <sdl.web@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 4664-done@emacsbugs.donarmstrong.com
Subject: Re: bug#4664: 23.1.50; local variables completions
Date: Wed, 07 Oct 2009 22:06:34 +0100
Message-ID: <xbaipr8yncbp.fsf@cam.ac.uk>

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
       [not found]     ` <87pr8yanj1.fsf@mail.jurta.org>
@ 2009-10-08  1:10       ` Stefan Monnier
  2009-10-08  6:54         ` Leo
  0 siblings, 1 reply; 15+ messages in thread
From: Stefan Monnier @ 2009-10-08  1:10 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 4664, Leo

> Thanks, this also added usually unbound symbols
> like `generated-autoload-file'.

Is that a problem?


        Stefan





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-08  1:10       ` Stefan Monnier
@ 2009-10-08  6:54         ` Leo
  2009-10-08  9:22           ` Juri Linkov
  0 siblings, 1 reply; 15+ messages in thread
From: Leo @ 2009-10-08  6:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 4664

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





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-08  6:54         ` Leo
@ 2009-10-08  9:22           ` Juri Linkov
  2009-10-08 11:58             ` Leo
  2009-10-09 19:26             ` Stefan Monnier
  0 siblings, 2 replies; 15+ messages in thread
From: Juri Linkov @ 2009-10-08  9:22 UTC (permalink / raw)
  To: Leo; +Cc: 4664

>>> 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/





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-08  9:22           ` Juri Linkov
@ 2009-10-08 11:58             ` Leo
  2009-10-09 19:26             ` Stefan Monnier
  1 sibling, 0 replies; 15+ messages in thread
From: Leo @ 2009-10-08 11:58 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 4664

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





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-08  9:22           ` Juri Linkov
  2009-10-08 11:58             ` Leo
@ 2009-10-09 19:26             ` Stefan Monnier
  2009-10-11 23:54               ` Juri Linkov
  1 sibling, 1 reply; 15+ messages in thread
From: Stefan Monnier @ 2009-10-09 19:26 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 4664, Leo

> 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





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-09 19:26             ` Stefan Monnier
@ 2009-10-11 23:54               ` Juri Linkov
  2009-10-12 15:49                 ` Leo
  0 siblings, 1 reply; 15+ messages in thread
From: Juri Linkov @ 2009-10-11 23:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 4664, Leo

>> 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/





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-11 23:54               ` Juri Linkov
@ 2009-10-12 15:49                 ` Leo
  2009-10-12 20:31                   ` Juri Linkov
  0 siblings, 1 reply; 15+ messages in thread
From: Leo @ 2009-10-12 15:49 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 4664, Stefan Monnier

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





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-12 15:49                 ` Leo
@ 2009-10-12 20:31                   ` Juri Linkov
  2009-10-13 11:17                     ` Leo
  0 siblings, 1 reply; 15+ messages in thread
From: Juri Linkov @ 2009-10-12 20:31 UTC (permalink / raw)
  To: Leo; +Cc: 4664, Stefan Monnier

>>>> 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/





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-12 20:31                   ` Juri Linkov
@ 2009-10-13 11:17                     ` Leo
  2009-10-13 19:52                       ` Stefan Monnier
  0 siblings, 1 reply; 15+ messages in thread
From: Leo @ 2009-10-13 11:17 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 4664, Stefan Monnier

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





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-13 11:17                     ` Leo
@ 2009-10-13 19:52                       ` Stefan Monnier
  2009-10-13 22:35                         ` Juri Linkov
  0 siblings, 1 reply; 15+ messages in thread
From: Stefan Monnier @ 2009-10-13 19:52 UTC (permalink / raw)
  To: Leo; +Cc: 4664

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





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-13 19:52                       ` Stefan Monnier
@ 2009-10-13 22:35                         ` Juri Linkov
  2009-10-14  1:16                           ` Leo
  0 siblings, 1 reply; 15+ messages in thread
From: Juri Linkov @ 2009-10-13 22:35 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 4664, Leo

>>> 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/





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#4664: 23.1.50; local variables completions
  2009-10-13 22:35                         ` Juri Linkov
@ 2009-10-14  1:16                           ` Leo
  0 siblings, 0 replies; 15+ messages in thread
From: Leo @ 2009-10-14  1:16 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 4664, Stefan Monnier

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





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-10-14  1:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <xbaipr8yncbp.fsf@cam.ac.uk>
2009-10-07 11:15 ` bug#4664: 23.1.50; local variables completions Leo
2009-10-07 14:34   ` Stefan Monnier
     [not found]     ` <87pr8yanj1.fsf@mail.jurta.org>
2009-10-08  1:10       ` Stefan Monnier
2009-10-08  6:54         ` Leo
2009-10-08  9:22           ` Juri Linkov
2009-10-08 11:58             ` Leo
2009-10-09 19:26             ` Stefan Monnier
2009-10-11 23:54               ` Juri Linkov
2009-10-12 15:49                 ` Leo
2009-10-12 20:31                   ` Juri Linkov
2009-10-13 11:17                     ` Leo
2009-10-13 19:52                       ` Stefan Monnier
2009-10-13 22:35                         ` Juri Linkov
2009-10-14  1:16                           ` Leo
2009-10-07 21:15   ` bug#4664: marked as done (23.1.50; local variables completions) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).