I have an Emacs Lisp file with custom macros. I want the font and padding to be different. The code looks like this:
(defmacro* when-let ((var value) &rest body)
`(let ((,var ,value))
(when ,var ,@body)))
(defun func ()
(when-let (a 1)
a))
I want to when-letsmooth as font-lock-keywordwell as indentation, as indicated above. I know I can do this in my .emacs file, but I would prefer to make it local or local. The problem is that the local settings of local and local files are apparently limited by setting variables. In my .emacs file, I have the following.
(add-hook 'emacs-lisp-mode-hook
(lambda ()
(put 'when-let 'lisp-indent-function 1)
(font-lock-add-keywords nil
'(("(\\(when-let\\)\\>" 1
font-lock-keyword-face)))))
I want this in .dir-locals.elbecause it applies to only one file.
source
share