chiark / gitweb /
el/dot-emacs.el: Fix `loop' indentation for older Emacsen.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 20 May 2021 18:03:53 +0000 (19:03 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 20 May 2021 18:03:53 +0000 (19:03 +0100)
el/dot-emacs.el

index c1beb947de9f414598c6ddf130e39073d6691b63..61578ce58f1f6bb3f7c4998cbd279234a787a691 100644 (file)
@@ -4623,7 +4623,8 @@ (defadvice common-lisp-loop-part-indentation
                             (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 @@ (defadvice common-lisp-loop-part-indentation
 
       (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))