GNU bug report logs - #3430
23.0.94; cannot enable two minor modes in .dir-locals.el

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Sun, 31 May 2009 14:45:04 UTC

Severity: normal

Done: Glenn Morris <rgm <at> gnu.org>

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 3430 in the body.
You can then email your comments to 3430 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3430; Package emacs. (Sun, 31 May 2009 14:45:04 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>. (Sun, 31 May 2009 14:45:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.94; cannot enable two minor modes in .dir-locals.el
Date: Sun, 31 May 2009 15:37:59 +0100
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

My LaTeX project setting looks like this:

((latex-mode . ((auto-fill-function . nil)
                (fill-column . 90)
                (mode . outline-minor)
                (mode . longlines)
                (coding . "latin-1"))))

i.e. I want to enable two minor modes for all .TeX files among other
things.

I start with Emacs -q and open a .TeX in that project, only longlines is
enabled. Do you think this is a bug? Thank you.

This is tested on GNU Emacs 23.0.94.1 (i386-apple-darwin9.7.0, NS
apple-appkit-949.46) of 2009-05-23 on 200.sub-75-216-116.myvzw.com

Leo



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3430; Package emacs. (Tue, 02 Jun 2009 21:35: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>. (Tue, 02 Jun 2009 21:35:05 GMT) Full text and rfc822 format available.

Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: 3430 <at> debbugs.gnu.org
Cc: emacs-pretest-bug <at> gnu.org
Subject: Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
Date: Tue, 02 Jun 2009 22:29:44 +0100
On 2009-05-31 15:37 +0100, Leo wrote:
> Please describe exactly what actions triggered the bug
> and the precise symptoms of the bug:
>
> My LaTeX project setting looks like this:
>
> ((latex-mode . ((auto-fill-function . nil)
>                 (fill-column . 90)
>                 (mode . outline-minor)
>                 (mode . longlines)
>                 (coding . "latin-1"))))
>
> i.e. I want to enable two minor modes for all .TeX files among other
> things.
>
> I start with Emacs -q and open a .TeX in that project, only longlines is
> enabled. Do you think this is a bug? Thank you.
>
> This is tested on GNU Emacs 23.0.94.1 (i386-apple-darwin9.7.0, NS
> apple-appkit-949.46) of 2009-05-23 on 200.sub-75-216-116.myvzw.com
>
> Leo

Any comment on this bug? Can you reproduce it? Thank you.

Leo



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3430; Package emacs. (Tue, 02 Jun 2009 21:35:09 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, 02 Jun 2009 21:35:09 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3430; Package emacs. (Mon, 15 Jun 2009 17:35:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Teemu Likonen <tlikonen <at> iki.fi>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 15 Jun 2009 17:35:06 GMT) Full text and rfc822 format available.

Message #20 received at 3430 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Teemu Likonen <tlikonen <at> iki.fi>
To: Leo <sdl.web <at> gmail.com>
Cc: 3430 <at> debbugs.gnu.org
Subject: Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
Date: Mon, 15 Jun 2009 20:26:28 +0300
On 2009-06-02 22:29 (+0100), Leo wrote:

> On 2009-05-31 15:37 +0100, Leo wrote:
>> Please describe exactly what actions triggered the bug
>> and the precise symptoms of the bug:
>>
>> My LaTeX project setting looks like this:
>>
>> ((latex-mode . ((auto-fill-function . nil)
>>                 (fill-column . 90)
>>                 (mode . outline-minor)
>>                 (mode . longlines)
>>                 (coding . "latin-1"))))
>>
>> i.e. I want to enable two minor modes for all .TeX files among other
>> things.
>>
>> I start with Emacs -q and open a .TeX in that project, only longlines is
>> enabled. Do you think this is a bug? Thank you.
>>
>> This is tested on GNU Emacs 23.0.94.1 (i386-apple-darwin9.7.0, NS
>> apple-appkit-949.46) of 2009-05-23 on 200.sub-75-216-116.myvzw.com
>>
>> Leo
>
> Any comment on this bug? Can you reproduce it? Thank you.

I can reproduce this. Just create a file .dir-locals.el somewhere with
content like this:

    ((nil . ((mode . auto-fill)
             (mode . outline-minor))))

When files in that directory are opened only the last mode
(outline-minor) in the alist is turned on.

A side note: It seems that directory local variables feature is still in
a half-finished shape:

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1986
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3572
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3577



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3430; Package emacs. (Thu, 18 Jun 2009 00:50:04 GMT) Full text and rfc822 format available.

Message #23 received at 3430 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm+emacsbugs <at> gnu.org>
To: 3430 <at> debbugs.gnu.org
Subject: Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
Date: Wed, 17 Jun 2009 20:42:53 -0400
tags 2355
merge 2355 3430
stop

I should imagine this is the same issue as bug #2355.



Merged 2355 3430. Request was from Glenn Morris <rgm+emacsbugs <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Thu, 18 Jun 2009 00:50:06 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3430; Package emacs. (Thu, 18 Jun 2009 01:45: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>. (Thu, 18 Jun 2009 01:45:06 GMT) Full text and rfc822 format available.

Message #30 received at 3430 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: Glenn Morris <rgm+emacsbugs <at> gnu.org>
Cc: 3430 <at> debbugs.gnu.org
Subject: Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
Date: Thu, 18 Jun 2009 02:40:33 +0100
On 2009-06-18 01:42 +0100, Glenn Morris wrote:
> tags 2355
> merge 2355 3430
> stop
>
> I should imagine this is the same issue as bug #2355.

Are you sure they are the same? If you put two minor modes at the end of
a file in the local variables section, it works without any problem.

-- 
Leo's Emacs uptime: 7 days, 12 hours, 0 minutes, 36 seconds



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3430; Package emacs. (Thu, 18 Jun 2009 02:35:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Glenn Morris <rgm+emacsbugs <at> gnu.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 18 Jun 2009 02:35:05 GMT) Full text and rfc822 format available.

Message #35 received at 3430 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm+emacsbugs <at> gnu.org>
To: 3430 <at> debbugs.gnu.org
Subject: Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
Date: Wed, 17 Jun 2009 22:29:42 -0400
tags 2355 =
unmerge 3430
stop

Leo wrote (on Thu, 18 Jun 2009 at 02:40 +0100):

> Are you sure they are the same? If you put two minor modes at the end of
> a file in the local variables section, it works without any problem.

OK; unimagining, this is because dir-locals-collect-mode-variables has
the effect of filtering the dir-locals variables list so that only one
value is allowed for any given key, and the last one wins.



Tags set to: Request was from Glenn Morris <rgm+emacsbugs <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Thu, 18 Jun 2009 02:35:08 GMT) Full text and rfc822 format available.

Disconnected #3430 from all other report(s). Request was from Glenn Morris <rgm+emacsbugs <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Thu, 18 Jun 2009 02:35:08 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3430; Package emacs. (Thu, 18 Jun 2009 02:50:04 GMT) Full text and rfc822 format available.

Message #42 received at 3430 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 3430 <at> debbugs.gnu.org
Subject: Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
Date: Wed, 17 Jun 2009 22:40:26 -0400
Possible hack follows, but I don't know what the point of the
dir-locals-collect-mode-variables function is supposed to be (an
optimization to avoid settings things twice?).

***************
*** 3213,3219 ****
      (let* ((variable (car pair))
       (value (cdr pair))
       (slot (assq variable variables)))
!       (if slot
      (setcdr slot value)
    ;; Need a new cons in case we setcdr later.
    (push (cons variable value) variables)))))
--- 3214,3222 ----
      (let* ((variable (car pair))
       (value (cdr pair))
       (slot (assq variable variables)))
!       ;; If variables are specified more than once, only use the last.
!       ;; But any number of `modes' (assumed to be minor) are allowed.
!       (if (and slot (not (eq variable 'mode)))
      (setcdr slot value)
    ;; Need a new cons in case we setcdr later.
    (push (cons variable value) variables)))))



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3430; Package emacs. (Thu, 18 Jun 2009 10:45:04 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, 18 Jun 2009 10:45:04 GMT) Full text and rfc822 format available.

Message #47 received at 3430 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: Glenn Morris <rgm+emacsbugs <at> gnu.org>
Cc: 3430 <at> debbugs.gnu.org
Subject: Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
Date: Thu, 18 Jun 2009 11:38:48 +0100
On 2009-06-18 03:29 +0100, Glenn Morris wrote:
>> Are you sure they are the same? If you put two minor modes at the end of
>> a file in the local variables section, it works without any problem.
>
> OK; unimagining, this is because dir-locals-collect-mode-variables has
> the effect of filtering the dir-locals variables list so that only one
> value is allowed for any given key, and the last one wins.

Thank you for your interest and attempt in fixing this bug.

It seems to me that is done in dir-locals-collect-variables. Filtering
out the duplications is fine for variables that can only have one value
but not all variables fall into that. For example, there is 'mode' and
'eval' and possibly others.

-- 
Leo's Emacs uptime: 7 days, 20 hours, 41 minutes, 23 seconds



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3430; Package emacs. (Thu, 18 Jun 2009 10:50:04 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, 18 Jun 2009 10:50:04 GMT) Full text and rfc822 format available.

Message #52 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
Date: Thu, 18 Jun 2009 11:43:19 +0100
On 2009-06-18 03:40 +0100, Glenn Morris wrote:
> Possible hack follows, but I don't know what the point of the
> dir-locals-collect-mode-variables function is supposed to be (an
> optimization to avoid settings things twice?).

I hope a fix is reached soonish. Thank you.

-- 
Leo's Emacs uptime: 7 days, 21 hours, 0 minutes, 50 seconds





Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Mon, 22 Jun 2009 07:05:07 GMT) Full text and rfc822 format available.

Notification sent to Leo <sdl.web <at> gmail.com>:
bug acknowledged by developer. (Mon, 22 Jun 2009 07:05:07 GMT) Full text and rfc822 format available.

Message #57 received at 3430-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 3430-done <at> debbugs.gnu.org
Subject: Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
Date: Mon, 22 Jun 2009 03:02:45 -0400
Fixed in trunk for 23.2

      * files.el (dir-locals-collect-mode-variables): Allow for any
        number of `mode' and `eval' entries.  (Bug#3430)



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Mon, 20 Jul 2009 14:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 341 days ago.

Previous Next


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