unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
@ 2009-05-31 14:37 ` Leo
  2009-06-02 21:29   ` Leo
  2009-06-22  7:05   ` bug#3430: marked as done (23.0.94; cannot enable two minor modes in .dir-locals.el) Emacs bug Tracking System
  0 siblings, 2 replies; 12+ messages in thread
From: Leo @ 2009-05-31 14:37 UTC (permalink / raw)
  To: emacs-pretest-bug

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





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

* bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
  2009-05-31 14:37 ` bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el Leo
@ 2009-06-02 21:29   ` Leo
  2009-06-15 17:26     ` Teemu Likonen
  2009-06-22  7:05   ` bug#3430: marked as done (23.0.94; cannot enable two minor modes in .dir-locals.el) Emacs bug Tracking System
  1 sibling, 1 reply; 12+ messages in thread
From: Leo @ 2009-06-02 21:29 UTC (permalink / raw)
  To: 3430; +Cc: emacs-pretest-bug

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





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

* bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
  2009-06-02 21:29   ` Leo
@ 2009-06-15 17:26     ` Teemu Likonen
  2009-06-18  0:42       ` Glenn Morris
  0 siblings, 1 reply; 12+ messages in thread
From: Teemu Likonen @ 2009-06-15 17:26 UTC (permalink / raw)
  To: Leo; +Cc: 3430

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://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1986
http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3572
http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3577





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

* bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
  2009-06-15 17:26     ` Teemu Likonen
@ 2009-06-18  0:42       ` Glenn Morris
  2009-06-18  0:50         ` Processed (with 1 errors): " Emacs bug Tracking System
  2009-06-18  1:40         ` Leo
  0 siblings, 2 replies; 12+ messages in thread
From: Glenn Morris @ 2009-06-18  0:42 UTC (permalink / raw)
  To: 3430

tags 2355
merge 2355 3430
stop

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





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

* Processed (with 1 errors): Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
  2009-06-18  0:42       ` Glenn Morris
@ 2009-06-18  0:50         ` Emacs bug Tracking System
  2009-06-18  1:40         ` Leo
  1 sibling, 0 replies; 12+ messages in thread
From: Emacs bug Tracking System @ 2009-06-18  0:50 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Emacs Bugs

Processing commands for control@emacsbugs.donarmstrong.com:

> tags 2355
Unknown command or malformed arguments to command.

> merge 2355 3430
bug#2355: 23.0.60; Enabling minor-mode disables major mode
bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
Merged 2355 3430.

> stop
Stopping processing here.

Please contact me if you need assistance.

Don Armstrong
(administrator, Emacs bugs database)




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

* bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
  2009-06-18  0:42       ` Glenn Morris
  2009-06-18  0:50         ` Processed (with 1 errors): " Emacs bug Tracking System
@ 2009-06-18  1:40         ` Leo
  2009-06-18  2:29           ` Glenn Morris
  1 sibling, 1 reply; 12+ messages in thread
From: Leo @ 2009-06-18  1:40 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 3430

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





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

* bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
  2009-06-18  1:40         ` Leo
@ 2009-06-18  2:29           ` Glenn Morris
  2009-06-18  2:35             ` Processed: " Emacs bug Tracking System
                               ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Glenn Morris @ 2009-06-18  2:29 UTC (permalink / raw)
  To: 3430

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.





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

* Processed: Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
  2009-06-18  2:29           ` Glenn Morris
@ 2009-06-18  2:35             ` Emacs bug Tracking System
  2009-06-18  2:40             ` Glenn Morris
  2009-06-18 10:38             ` Leo
  2 siblings, 0 replies; 12+ messages in thread
From: Emacs bug Tracking System @ 2009-06-18  2:35 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Emacs Bugs

Processing commands for control@emacsbugs.donarmstrong.com:

> tags 2355 =
bug#2355: 23.0.60; Enabling minor-mode disables major mode
Tags were: notabug
bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
Tags set to: 

> unmerge 3430
bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
bug#2355: 23.0.60; Enabling minor-mode disables major mode
Disconnected #3430 from all other report(s).

> stop
Stopping processing here.

Please contact me if you need assistance.

Don Armstrong
(administrator, Emacs bugs database)




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

* bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
  2009-06-18  2:29           ` Glenn Morris
  2009-06-18  2:35             ` Processed: " Emacs bug Tracking System
@ 2009-06-18  2:40             ` Glenn Morris
  2009-06-18 10:43               ` Leo
  2009-06-18 10:38             ` Leo
  2 siblings, 1 reply; 12+ messages in thread
From: Glenn Morris @ 2009-06-18  2:40 UTC (permalink / raw)
  To: 3430


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





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

* bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
  2009-06-18  2:29           ` Glenn Morris
  2009-06-18  2:35             ` Processed: " Emacs bug Tracking System
  2009-06-18  2:40             ` Glenn Morris
@ 2009-06-18 10:38             ` Leo
  2 siblings, 0 replies; 12+ messages in thread
From: Leo @ 2009-06-18 10:38 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 3430

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





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

* bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
  2009-06-18  2:40             ` Glenn Morris
@ 2009-06-18 10:43               ` Leo
  0 siblings, 0 replies; 12+ messages in thread
From: Leo @ 2009-06-18 10:43 UTC (permalink / raw)
  To: bug-gnu-emacs

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







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

* bug#3430: marked as done (23.0.94; cannot enable two minor modes in .dir-locals.el)
  2009-05-31 14:37 ` bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el Leo
  2009-06-02 21:29   ` Leo
@ 2009-06-22  7:05   ` Emacs bug Tracking System
  1 sibling, 0 replies; 12+ messages in thread
From: Emacs bug Tracking System @ 2009-06-22  7:05 UTC (permalink / raw)
  To: Glenn Morris

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


Your message dated Mon, 22 Jun 2009 03:02:45 -0400
with message-id <4k3a9s21ka.fsf@fencepost.gnu.org>
and subject line Re: bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el
has caused the Emacs bug report #3430,
regarding 23.0.94; cannot enable two minor modes in .dir-locals.el
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.)


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

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

From: Leo <sdl.web@gmail.com>
To: emacs-pretest-bug@gnu.org
Subject: 23.0.94; cannot enable two minor modes in .dir-locals.el
Date: Sun, 31 May 2009 15:37:59 +0100
Message-ID: <m063fhxrqw.fsf@cam.ac.uk>

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


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

From: Glenn Morris <rgm@gnu.org>
To: 3430-done@emacsbugs.donarmstrong.com
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
Message-ID: <4k3a9s21ka.fsf@fencepost.gnu.org>


Fixed in trunk for 23.2

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

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

end of thread, other threads:[~2009-06-22  7:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4k3a9s21ka.fsf@fencepost.gnu.org>
2009-05-31 14:37 ` bug#3430: 23.0.94; cannot enable two minor modes in .dir-locals.el Leo
2009-06-02 21:29   ` Leo
2009-06-15 17:26     ` Teemu Likonen
2009-06-18  0:42       ` Glenn Morris
2009-06-18  0:50         ` Processed (with 1 errors): " Emacs bug Tracking System
2009-06-18  1:40         ` Leo
2009-06-18  2:29           ` Glenn Morris
2009-06-18  2:35             ` Processed: " Emacs bug Tracking System
2009-06-18  2:40             ` Glenn Morris
2009-06-18 10:43               ` Leo
2009-06-18 10:38             ` Leo
2009-06-22  7:05   ` bug#3430: marked as done (23.0.94; cannot enable two minor modes in .dir-locals.el) 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).