From: 조성빈 <pcr910303@icloud.com>
To: "Michał Nazarewicz" <mina86@mina86.com>
Cc: Alan Mackenzie <acm@muc.de>, bug-cc-mode@gnu.org, emacs-devel@gnu.org
Subject: Re: [PATCH] cc-mode: don't tread dir-local and file-local variables differently
Date: Tue, 26 May 2020 11:13:30 +0900 [thread overview]
Message-ID: <707C4631-BDDF-4938-961E-94C0E9ABC0F3@icloud.com> (raw)
In-Reply-To: <CA+pa1O2ng=Jy-UoskfhoUYcggd_w4kGxYBNdVrknjzXzpNjRyA@mail.gmail.com>
Michał Nazarewicz <mina86@mina86.com> 작성:
> To quickly recap, CC Mode treats ‘c-file-style’ differently depending on
> whether it comes from .dir-locals.el or a file-local variable. For
> example, having the following in init.el:
>
> (setq-default 'c-basic-offset 4)
>
> consider the following two scenarios:
>
> 1) /tmp/foo/.dir-locals.el exists and contains a single line:
>
> ((nil . ((c-file-style . "bsd"))))
>
> Opening an empty /tmp/foo/foo.c file results in ‘c-basic-offset’
> being four and ‘c-file-style’ being "bsd".
>
> 2) /tmp/bar/.dir-locals.el does not exist but /tmp/bar/bar.c does and
> contains a single line:
>
> /* -*- c-file-style: "bsd" -*- */
>
> Opening that file results in ‘c-basic-offset’ being eight and
> ‘c-file-style’ being "bsd". (Value of eight for the offset comes
> from "bsd" style).
>
> I maintain that in both cases ‘c-basic-offset’ should be the same.
> I further maintain that its value should be eight. Alan disagrees and
> maintains that cc-mode-hook should overwrite settings in dir-local
> variables but should be overwritten by settings in file-local variables.
As a user I think most people would expect the two results to be the same -
the biggest use case of {dir,file}-local variables (at least known to me)
is to maintain a consistent style between different Emacs customizations.
The person that added .dir-locals.el would have expected that all code
inside this directory will follow the bsd-style — one should not have to
consider various different customization scenarios and accommodate to them
to have a consistent style.
next prev parent reply other threads:[~2020-05-26 2:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200512194516.83180-1-mina86@mina86.com>
[not found] ` <20200513184745.GA8857@ACM>
[not found] ` <CA+pa1O2gKba9iHpPbQCf6PibY4gg57gj2ZjC4oTy4277i5pTzg@mail.gmail.com>
[not found] ` <20200517142327.GA12554@ACM>
[not found] ` <CA+pa1O2Yoqg9Kjy-Eh7K6RUtpDXpSfWOEW5EWduZVBgY5LK8QQ@mail.gmail.com>
[not found] ` <20200525184412.GA8662@ACM>
2020-05-25 19:47 ` [PATCH] cc-mode: don't tread dir-local and file-local variables differently Michał Nazarewicz
2020-05-26 2:13 ` 조성빈 [this message]
2020-05-26 2:28 ` Stefan Monnier
2020-05-26 17:18 ` Alan Mackenzie
2020-05-28 2:21 ` Stefan Monnier
2020-06-01 0:19 ` Michał Nazarewicz
2020-06-01 13:29 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=707C4631-BDDF-4938-961E-94C0E9ABC0F3@icloud.com \
--to=pcr910303@icloud.com \
--cc=acm@muc.de \
--cc=bug-cc-mode@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=mina86@mina86.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).