[slime-cvs] CVS slime/contrib
CVS User nsiivola
nsiivola at common-lisp.net
Sat Dec 3 15:38:19 UTC 2011
Update of /project/slime/cvsroot/slime/contrib
In directory tiger.common-lisp.net:/tmp/cvs-serv6338/contrib
Modified Files:
ChangeLog slime-cl-indent-test.txt slime-cl-indent.el
Log Message:
slime-indentation: recognize :foo and #:foo style loop keywords
Patch from Didier Verna.
--- /project/slime/cvsroot/slime/contrib/ChangeLog 2011/12/03 15:33:36 1.518
+++ /project/slime/cvsroot/slime/contrib/ChangeLog 2011/12/03 15:38:19 1.519
@@ -1,5 +1,18 @@
2011-12-03 Didier Verna <didier at xemacs.org>
+ * slime-cl-indent.el (common-lisp-loop-type)
+ (common-lisp-loop-part-indentation)
+ (common-lisp-indent-body-introducing-loop-macro-keyword)
+ (common-lisp-indent-prefix-loop-macro-keyword)
+ (common-lisp-indent-clause-joining-loop-macro-keyword)
+ (common-lisp-indent-indented-loop-macro-keyword)
+ (common-lisp-indent-indenting-loop-macro-keyword)
+ (common-lisp-indent-loop-macro-else-keyword)
+ (common-lisp-indent-loop-macro-1): Match not only KEYWORD but also
+ :KEYWORD and #:KEYWORD in the LOOP macro.
+
+2011-12-03 Didier Verna <didier at xemacs.org>
+
* slime-cl-indent.el (lisp-indent-lambda-list-keywords-regexp):
Match empty string after a word consitituent (\>) instead of a
symbol constituent (\_>) because XEmacs doesn't have that syntax,
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent-test.txt 2011/11/28 18:38:34 1.15
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent-test.txt 2011/12/03 15:38:19 1.16
@@ -736,3 +736,30 @@
;; is a beginning
do (foo)))
+;;; Test: 70
+;;
+;; lisp-loop-indent-subclauses: nil
+
+(progn
+ (loop
+ :repeat 1000
+ #:do ;; This is the
+ ;; beginning
+ (foo))
+ (loop #:repeat 100 ;; This too
+ ;; is a beginning
+ :do (foo)))
+
+;;; Test: 71
+;;
+;; lisp-loop-indent-subclauses: t
+
+(progn
+ (loop
+ #:repeat 1000
+ #:do ;; This is the
+ ;; beginning
+ (foo))
+ (loop :repeat 100 ;; This too
+ ;; is a beginning
+ #:do (foo)))
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent.el 2011/12/03 15:33:36 1.58
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent.el 2011/12/03 15:38:19 1.59
@@ -599,13 +599,13 @@
(setq comment-split t))))
(forward-sexp 1)
(backward-sexp 1)
- (if (looking-at "\\sw")
- (if (or (not maybe-split) (= line (line-number-at-pos)))
- 'extended
- 'extended/split)
+ (if (eql (char-after) ?\()
+ (if (or (not maybe-split) (= line (line-number-at-pos)))
+ 'simple
+ 'simple/split)
(if (or (not maybe-split) (= line (line-number-at-pos)))
- 'simple
- 'simple/split))))
+ 'extended
+ 'extended/split))))
(error
(if comment-split
'simple/split
@@ -630,7 +630,7 @@
(- (current-column) 4)
(current-column))))
(indent nil)
- (re "\\(:?\\sw+\\|)\\|\n\\)"))
+ (re "\\(\\(#?:\\)?\\sw+\\|)\\|\n\\)"))
(goto-char indent-point)
(back-to-indentation)
(cond ((eq type 'simple/split)
@@ -1265,32 +1265,32 @@
;; Regexps matching various varieties of loop macro keyword ...
(defvar common-lisp-indent-body-introducing-loop-macro-keyword
- "do\\|finally\\|initially"
+ "\\(#?:\\)?\\(do\\|finally\\|initially\\)"
"Regexp matching loop macro keywords which introduce body-forms.")
;; This is so "and when" and "else when" get handled right
;; (not to mention "else do" !!!)
(defvar common-lisp-indent-prefix-loop-macro-keyword
- "and\\|else"
+ "\\(#?:\\)?\\(and\\|else\\)"
"Regexp matching loop macro keywords which are prefixes.")
(defvar common-lisp-indent-clause-joining-loop-macro-keyword
- "and"
+ "\\(#?:\\)?and"
"Regexp matching 'and', and anything else there ever comes to be like it.")
;; This is handled right, but it's incomplete ...
;; (It could probably get arbitrarily long if I did *every* iteration-path)
(defvar common-lisp-indent-indented-loop-macro-keyword
- "into\\|by\\|upto\\|downto\\|above\\|below\\|on\\|being\\|=\\|first\\|then\\|from\\|to"
+ "\\(#?:\\)?\\(into\\|by\\|upto\\|downto\\|above\\|below\\|on\\|being\\|=\\|first\\|then\\|from\\|to\\)"
"Regexp matching keywords introducing loop subclauses.
Always indented two.")
(defvar common-lisp-indent-indenting-loop-macro-keyword
- "when\\|unless\\|if"
+ "\\(#?:\\)?\\(when\\|unless\\|if\\)"
"Regexp matching keywords introducing conditional clauses.
Cause subsequent clauses to be indented.")
-(defvar common-lisp-indent-loop-macro-else-keyword "else")
+(defvar common-lisp-indent-loop-macro-else-keyword "\\(#?:\\)?else")
;;; Attempt to indent the loop macro ...
@@ -1404,7 +1404,7 @@
(> (point) loop-macro-first-clause))
(back-to-indentation)
(if (and (< (current-column) loop-body-indentation)
- (looking-at "\\sw"))
+ (looking-at "\\(#?:\\)?\\sw"))
(progn
(if (looking-at common-lisp-indent-loop-macro-else-keyword)
(common-lisp-indent-loop-advance-past-keyword-on-line))
@@ -1697,6 +1697,6 @@
;;; (common-lisp-run-indentation-tests t)
;;;
;;; Run specific test:
-;;; (common-lisp-run-indentation-tests 69)
+;;; (common-lisp-run-indentation-tests 70)
;;; cl-indent.el ends here
More information about the slime-cvs
mailing list