all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* c-file-style in .dir-locals.el was ignored
@ 2010-11-26  8:54 Kan-Ru Chen
  0 siblings, 0 replies; only message in thread
From: Kan-Ru Chen @ 2010-11-26  8:54 UTC (permalink / raw
  To: emacs-devel


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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-26  8:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-26  8:54 c-file-style in .dir-locals.el was ignored Kan-Ru Chen

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.