chiark
/
gitweb
/
~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b958e20
)
el/dot-emacs.el: Fix `loop' indentation for older Emacsen.
author
Mark Wooding
<mdw@distorted.org.uk>
Thu, 20 May 2021 18:03:53 +0000
(19:03 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Thu, 20 May 2021 18:03:53 +0000
(19:03 +0100)
el/dot-emacs.el
patch
|
blob
|
blame
|
history
diff --git
a/el/dot-emacs.el
b/el/dot-emacs.el
index c1beb947de9f414598c6ddf130e39073d6691b63..61578ce58f1f6bb3f7c4998cbd279234a787a691 100644
(file)
--- a/
el/dot-emacs.el
+++ b/
el/dot-emacs.el
@@
-4623,7
+4623,8
@@
(defadvice common-lisp-loop-part-indentation
(current-column))))
;; Don't really care about this.
(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
(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
(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))
(+ baseline-indent lisp-simple-loop-indentation))
((looking-at "^\\s-*\\(:?\\sw+\\|;\\)")
(+ baseline-indent lisp-loop-keyword-indentation))