summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi R Kiran <aine.marina@gmail.com>2014-11-10 05:52:52 (GMT)
committerRavi R Kiran <aine.marina@gmail.com>2014-11-10 05:52:52 (GMT)
commitf816cb61c00317e04b756cd9e506ed6dbc377edc (patch)
tree008d5a99d2b82b83e12db3c5b508fa1bd869d395
parent0ab3bac82e50b8f1e3de0ab3f1d2510ac519dd7a (diff)
downloaddotemacs-f816cb61c00317e04b756cd9e506ed6dbc377edc.zip
dotemacs-f816cb61c00317e04b756cd9e506ed6dbc377edc.tar.gz
dotemacs-f816cb61c00317e04b756cd9e506ed6dbc377edc.tar.bz2
Easy fetching of values from dir-locals
-rw-r--r--init.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/init.el b/init.el
index ece90b3..a4d51da 100644
--- a/init.el
+++ b/init.el
@@ -109,6 +109,15 @@
:ensure t
:commands free-keys)
+(defun ravi/add-variables-from-dir-locals (varname hack-varname &optional make-it-local)
+ "Add variable from dir-locals.el to an existing variable as a buffer-local variable"
+ (let ((basic-var (symbol-value varname)))
+ (when (and (boundp hack-varname)
+ (listp (symbol-value hack-varname)))
+ (when make-it-local
+ (make-local-variable varname))
+ (set varname (append basic-var (symbol-value hack-varname))))))
+
(require 'ravi-init-ido)
(require 'ravi-init-marks)
(require 'ravi-init-appearance)