GNU bug report logs - #17051
Order of evaluation in .dir-locals.el

Previous Next

Packages: cc-mode, emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Thu, 20 Mar 2014 15:02:01 UTC

Severity: minor

Tags: confirmed

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: 17051 <at> debbugs.gnu.org
Cc: Reuben Thomas <rrt <at> sc3d.org>
Subject: Order of evaluation in .dir-locals.el
Date: Sat, 4 Jun 2016 18:02:07 -0400
reassign 17051 emacs,cc-mode
severity 17051 minor
tag 17051 + confirmed
quit

The reason this doesn't work is revealed in the docstring of c-before-hook:

c-before-hack-hook is a compiled Lisp function in ‘cc-mode.el’.

(c-before-hack-hook)

Set the CC Mode style and "offsets" when in the buffer’s local variables.
They are set only when, respectively, the pseudo variables
‘c-file-style’ and ‘c-file-offsets’ are present in the list.

This function is called from the hook ‘before-hack-local-variables-hook’.

Of course `before-hack-local-variables-hook' runs before any local
variables are set, so there is no "correct" order that a user can use
in .dir-locals.el to define a new style: `c-file-style' always applies
before any other variables.




This bug report was last modified 3 years and 175 days ago.

Previous Next


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