From: Mark Wooding Date: Thu, 20 May 2021 18:03:53 +0000 (+0100) Subject: el/dot-emacs.el: Fix `loop' indentation for older Emacsen. X-Git-Url: https://git.distorted.org.uk/~mdw/profile/commitdiff_plain/dede52e3cd443d40f929ce54f6abfa1cbebba750 el/dot-emacs.el: Fix `loop' indentation for older Emacsen. --- diff --git a/el/dot-emacs.el b/el/dot-emacs.el index c1beb94..61578ce 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -4623,7 +4623,8 @@ align the other subforms beneath it. Otherwise, indent them (current-column)))) ;; Don't really care about this. - (when (and (eq lisp-indent-backquote-substitution-mode 'corrected)) + (when (and (boundp 'lisp-indent-backquote-substitution-mode) + (eq lisp-indent-backquote-substitution-mode 'corrected)) (save-excursion (goto-char (elt state 1)) (cl-incf loop-indentation @@ -4652,7 +4653,14 @@ align the other subforms beneath it. Otherwise, indent them (setq ad-return-value (list - (cond ((not (lisp-extended-loop-p (elt state 1))) + (cond ((condition-case () + (save-excursion + (goto-char (elt state 1)) + (forward-char 1) + (forward-sexp 2) + (backward-sexp 1) + (not (looking-at "\\(:\\|\\sw\\)"))) + (error nil)) (+ baseline-indent lisp-simple-loop-indentation)) ((looking-at "^\\s-*\\(:?\\sw+\\|;\\)") (+ baseline-indent lisp-loop-keyword-indentation))