]> granicus.if.org Git - postgresql/commitdiff
emacs.samples: Reliably override ".dir-locals.el".
authorNoah Misch <noah@leadboat.com>
Fri, 13 Jun 2014 23:57:18 +0000 (19:57 -0400)
committerNoah Misch <noah@leadboat.com>
Fri, 13 Jun 2014 23:58:58 +0000 (19:58 -0400)
Back-patch to 9.4, where .dir-locals.el was introduced.

src/tools/editors/emacs.samples

index e469d5525ebda2da299be3e9b6b6d1e39dc66a09..a510afd051b04b9ebf8e845ee9bfa2ad0572ec4b 100644 (file)
 (add-hook 'c-mode-hook
           (defun postgresql-c-mode-hook ()
             (when (string-match "/postgres\\(ql\\)?/" buffer-file-name)
-              (c-set-style "postgresql"))))
+              (c-set-style "postgresql")
+              ;; Don't override the style we just set with the style in
+              ;; `dir-locals-file'.  Emacs 23.4.1 needs this; it is obsolete,
+              ;; albeit harmless, by Emacs 24.3.1.
+              (set (make-local-variable 'ignored-local-variables)
+                   (append '(c-file-style) ignored-local-variables)))))
 
 
 ;;; Perl files