GNU bug report logs - #8251
c-default-style vs. .dir-locals

Previous Next

Packages: cc-mode, emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Mon, 14 Mar 2011 20:52:02 UTC

Severity: normal

Merged with 7570

Found in version 24.0.50

Done: Kan-Ru Chen <kanru <at> kanru.info>

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 8251 in the body.
You can then email your comments to 8251 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 owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8251; Package emacs. (Mon, 14 Mar 2011 20:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 14 Mar 2011 20:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Bug-Gnu-Emacs <bug-gnu-emacs <at> gnu.org>
Subject: c-default-style vs. .dir-locals
Date: Mon, 14 Mar 2011 21:50:25 +0100
Package: emacs
Version: 24.0.50


The test file contains just three lines:

{
  x;
}

(there are two spaces before "x;", as per the GNU style)

and .dir-locals.el is a one-liner:

((c-mode . ((c-file-style . "GNU"))))

Cases:

1.- No .dir-locals.el, no c-default-style

    rm .dir-locals.el
    emacs -Q test.c

    then c-indentation-style == "gnu", c-basic-offset == 2 (original
value was set-from-style; local in buffer test.c; global value is
set-from-style). And indeed, C-n <TAB> does not change anything.

2.- No .dir-locals, set c-default-style

    rm .dir-locals.el
    emacs -Q --eval '(setq c-default-style '((other . "stroustrup")))' test.c

    then c-indentation-style == "stroustrup", c-basic-offset == 4, and
C-n <TAB> reindents the x; line.

3.- .dir-locals.el, set c-default-style

    echo ((c-mode . ((c-file-style . "GNU"))))> .dir-locals.el
    emacs -Q --eval '(setq c-default-style '((other . "stroustrup")))' test.c

    then c-indentation-style == "gnu", c-basic-offset == 4, and C-n
<TAB> reindents.

4.- Like 3, but manually setting the style

    echo ((c-mode . ((c-file-style . "GNU"))))> .dir-locals.el
    emacs -Q --eval '(setq c-default-style '((other . "stroustrup")))' test.c
    C-c . gnu <RET>

    then c-indentation-style == "gnu", c-basic-offset == 2, and C-n
<TAB> does nothing (as expected).


Shouldn't case 3 work as 4? Or am I misunderstanding something obvious?

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#8251; Package emacs,cc-mode. (Tue, 15 Mar 2011 06:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 8251 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 8251 <at> debbugs.gnu.org
Subject: Re: bug#8251: c-default-style vs. .dir-locals
Date: Tue, 15 Mar 2011 02:26:22 -0400
Is this the same as

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7570  ?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#8251; Package emacs,cc-mode. (Tue, 15 Mar 2011 09:28:01 GMT) Full text and rfc822 format available.

Message #11 received at 8251 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 8251 <at> debbugs.gnu.org
Subject: Re: bug#8251: c-default-style vs. .dir-locals
Date: Tue, 15 Mar 2011 10:26:47 +0100
> Is this the same as
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7570  ?

I'm not sure, but it is entirely possible. Both are about the default
style overriding the .dir-locals.el one.

Feel free to merge them.

Thanks,

    Juanma




Merged 7570 8251. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 06 Apr 2011 18:57:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 21 Aug 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 308 days ago.

Previous Next


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