comparison .dir-locals.el @ 17588:9ff04de067ce

improve .dir-locals.el * .dir-local.el: Don't fail if buffer-file-name returns nil. Use str-match-p instead of str-match. Simplify logic.
author Rüdiger Sonderfeld <ruediger@c-plusplus.de>
date Fri, 04 Oct 2013 23:32:38 +0200
parents 7600200a54c8
children
comparison
equal deleted inserted replaced
17587:a13ff4521538 17588:9ff04de067ce
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 (string-match "\\.h\\'" (buffer-file-name)) 5 (eval . (when (and (buffer-file-name)
6 (unless (string-match "/gnulib/" (buffer-file-name)) 6 (string-match-p "\\.h\\'" (buffer-file-name))
7 (c++-mode) 7 (not (string-match-p "/gnulib/" (buffer-file-name))))
8 (c-set-style "gnu")))))) 8 (c++-mode)
9 (c-set-style "gnu")))))
9 (change-log-mode . ((indent-tabs-mode . t))) 10 (change-log-mode . ((indent-tabs-mode . t)))
10 (makefile-mode . ((indent-tabs-mode . t)))) 11 (makefile-mode . ((indent-tabs-mode . t))))