From 48e4a665d400660e74cbd2c31a1fae4fa81b957d Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 10 Jul 2020 20:41:17 +0100 Subject: [PATCH] el/dot-emacs.el: Indent `funcall' properly in Emacs Lisp too. Fortunately, not much hacking is required. --- el/dot-emacs.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/el/dot-emacs.el b/el/dot-emacs.el index fc3c13f..5ccce36 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -4313,11 +4313,12 @@ that character only to be normal punctuation.") lisp-loop-forms-indentation 2 lisp-lambda-list-keyword-parameter-alignment t) -(defun mdw-indent-funcall (path state indent-point sexp-column normal-indent) +(defun mdw-indent-funcall + (path state &optional indent-point sexp-column normal-indent) "Indent `funcall' more usefully. Essentially, treat `funcall foo' as a function name, and align the arguments to `foo'." - (and (null (cdr path)) + (and (or (not (consp path)) (null (cadr path))) (save-excursion (goto-char (cadr state)) (forward-char 1) @@ -4328,7 +4329,9 @@ to `foo'." (forward-sexp -1) (and (= start-line (line-number-at-pos)) (current-column)))))))) -(put 'funcall 'common-lisp-indent-function 'mdw-indent-funcall) +(progn + (put 'funcall 'common-lisp-indent-function 'mdw-indent-funcall) + (put 'funcall 'lisp-indent-function 'mdw-indent-funcall)) (defadvice common-lisp-loop-part-indentation (around mdw-fix-loop-indentation (indent-point state) activate compile) -- 2.11.0