all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kan-Ru Chen <kanru@kanru.info>
To: emacs-devel@gnu.org
Subject: c-file-style in .dir-locals.el was ignored
Date: Fri, 26 Nov 2010 16:54:25 +0800	[thread overview]
Message-ID: <87hbf4fose.fsf@anar.kanru.info> (raw)


Sort of.  I found the commit to `c-before-hack-hook' in Jul 18, 2010
added check against `dir-local-variables-alist' and "call `c-set-style'
differently according to whether c-file-style was set in file or
directory local variables."  Which is not clear why directory local
variables should be treated differently.

The following implementation

#v+
(if (boundp 'dir-local-variables-alist)
    ;; Determine whether `c-file-style' was set in the file's local
    ;; variables or in a .dir-locals.el (a directory setting).
    (let ((cfs-in-file-and-dir-count
	   (c-count-cfss file-local-variables-alist))
	  (cfs-in-dir-count (c-count-cfss dir-local-variables-alist)))
      (c-set-style stile
		   (= cfs-in-file-and-dir-count cfs-in-dir-count)))
  (c-set-style stile)))
#v-

eventually calls (c-set-style "linux" t) if `c-file-style' was only set
in .dir-locals.el.  Since the style is set default to "gnu" and
DONT-OVERRIDE is t, most style from "linux" will not apply.

Is this intended or a bug?


Cheers,
Kanru

-- 
A badly written book is only a blunder. A bad translation of a good
book is a crime.
                -- Gilbert Highet




                 reply	other threads:[~2010-11-26  8:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hbf4fose.fsf@anar.kanru.info \
    --to=kanru@kanru.info \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.