comparison .dir-locals.el @ 26681:df203b20cfc6

eliminate eval in Emacs .dir-locals file With Emacs 26, setting c++ mode inside the .dir-locals file can cause trouble for some .h files.
author John W. Eaton <jwe@octave.org>
date Wed, 06 Feb 2019 17:34:16 +0000
parents 9ff04de067ce
children
comparison
equal deleted inserted replaced
26679:2b6aa96a5c82 26681:df203b20cfc6
1 ((nil . 1 ((nil .
2 ((c-file-style . "gnu") 2 ((c-file-style . "gnu")
3 (indent-tabs-mode . nil) 3 (indent-tabs-mode . nil)
4 (fill-column . 72) 4 (fill-column . 72)))
5 (eval . (when (and (buffer-file-name)
6 (string-match-p "\\.h\\'" (buffer-file-name))
7 (not (string-match-p "/gnulib/" (buffer-file-name))))
8 (c++-mode)
9 (c-set-style "gnu")))))
10 (change-log-mode . ((indent-tabs-mode . t))) 5 (change-log-mode . ((indent-tabs-mode . t)))
11 (makefile-mode . ((indent-tabs-mode . t)))) 6 (makefile-mode . ((indent-tabs-mode . t))))