CVS update by didierv packages/xemacs-packages/prog-modes ...
xemacs-cvs at xemacs.org
xemacs-cvs at xemacs.org
Tue Feb 6 10:35:08 EST 2007
User: didierv
Date: 07/02/06 16:35:08
Modified: packages/xemacs-packages/prog-modes ChangeLog cl-indent.el
Log:
Understand CLOS method combination types for indentation
Revision Changes Path
1.241 +21 -16 XEmacs/packages/xemacs-packages/prog-modes/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/prog-modes/ChangeLog,v
retrieving revision 1.240
retrieving revision 1.241
diff -u -p -r1.240 -r1.241
--- ChangeLog 2006/06/16 10:25:34 1.240
+++ ChangeLog 2007/02/06 15:35:06 1.241
@@ -1,3 +1,8 @@
+2007-02-06 Didier Verna <didier at xemacs.org>
+
+ * cl-indent.el (lisp-indent-defmethod): Understand method
+ combination types as well as specifiers.
+
2006-06-16 Norbert Koch <viteno at xemacs.org>
* Makefile (VERSION): XEmacs package 2.09 released.
@@ -143,7 +148,7 @@
* diff-mode.el (diff-font-lock-keywords-1): There is only one
level of decoration, so make it level 1.
(diff-font-lock-keywords): This shoud be a list referring to the
- actual variables for the levels.
+ actual variables for the levels.
2004-03-29 Norbert Koch <viteno at xemacs.org>
@@ -342,7 +347,7 @@
* javascript-mode.el: Add an auto-mode-alist entry and a
(speedbar-add-supported-extension) call for the *.pac files.
-
+
2003-06-08 Norbert Koch <viteno at xemacs.org>
* Makefile (VERSION): XEmacs package 1.77 released.
@@ -555,7 +560,7 @@
* cperl-mode.el: Remove, move to perl-modes package.
* perl-mode.el: Ditto.
-
+
2002-09-18 Ville Skyttä <scop at xemacs.org>
* Makefile (ELCS): Remove ruby-mode.elc and inf-ruby.elc.
@@ -566,7 +571,7 @@
* inf-ruby.el.upstream: Ditto.
* ruby-mode.el: Ditto.
* ruby-mode.el.upstream: Ditto.
-
+
2002-09-18 Ville Skyttä <scop at xemacs.org>
* Makefile (ELCS): Remove f90.elc, fortran.elc and
@@ -577,7 +582,7 @@
* f90.el: Remove, move to fortran-modes package.
* fortran.el: Ditto.
* fortran-misc.el: Ditto.
-
+
2002-09-18 Ville Skyttä <scop at xemacs.org>
* Makefile (ELCS): Remove python-mode.elc and pydoc.elc.
@@ -755,7 +760,7 @@
2002-06-03 Steve Youngs <youngs at xemacs.org>
* verilog-mode.el (verilog-mode): Add missing ';' in autoload
- cookie.
+ cookie.
(verilog-version): Add autoload cookie.
(verilog-customize): Ditto.
@@ -812,12 +817,12 @@
2002-04-20 David A. Panariti <panariti at attbi.com>
- * python-mode.el (py-execute-region):
+ * python-mode.el (py-execute-region):
Add fix to handle condition where py-which-shell is nil.
* pydoc.el: Handle new versions of python-mode.el in which
py-execute-region return t rather than a buffer[name]. The
- following changes are executed only when py-execute-region
+ following changes are executed only when py-execute-region
returns t.
(pydoc-call): Guesses the output buffer name to be the current
python process buffer or "*Python Output*".
@@ -865,7 +870,7 @@
* Makefile (REQUIRES): Add sh-script, needed by rpm-spec-mode.el.
* Makefile (ELCS): Add rpm-spec-mode.elc.
* package-info.in (provides): Add rpm-spec-mode.
-
+
* diff-mode.el.upstream: Removed.
2002-03-30 Jeff Mincy <jeff at delphioutpost.com>
@@ -972,7 +977,7 @@
2001-12-27 Steve Youngs <youngs at xemacs.org>
* php-mode.el (php-mode-abbrev-table): Revert my patch of
- 2001-12-20.
+ 2001-12-20.
2001-12-23 Vin Shelton <acs at xemacs.org>
@@ -988,7 +993,7 @@
2001-12-20 Steve Youngs <youngs at xemacs.org>
* php-mode.el (php-mode-abbrev-table): Escape a parenthesis in a
- string.
+ string.
2001-12-19 Steve Youngs <youngs at xemacs.org>
@@ -1016,7 +1021,7 @@
(EXTRA_SOURCES): Add pydoc-el-README, pydoc_lisp.py
* package-info.in (provides): Update for new files.
-
+
2001-12-05 Vaclav Barta <vbar at comp.cz>
* cperl-mode.pl: Got fill-paragraph-or-region to use
@@ -1061,7 +1066,7 @@
2001-06-21 Jeff Mincy <jeff at delphioutpost.com>
- * diff-mode.el (vc-backend-diff): Fix when default-major-mode is text-mode,
+ * diff-mode.el (vc-backend-diff): Fix when default-major-mode is text-mode,
also enabled font-lock
2001-06-18 Ben Wing <ben at xemacs.org>
@@ -1093,7 +1098,7 @@
* diff-mode.el (diff-goto-source):
* diff-mode.el (diff-mode):
Eliminate nonstandard -flag ending on variables.
-
+
Add var to control whether we begin in read-only mode; FALSE
by default (principle of least surprise; and do not assume that
people opening any file named .diff have no interest in editing
@@ -1229,7 +1234,7 @@
2001-04-08 Steve Youngs <youngs at xemacs.org>
- * Makefile (REQUIRES): Add cc-mode, ps-print-nomule, fsf-compat,
+ * Makefile (REQUIRES): Add cc-mode, ps-print-nomule, fsf-compat,
edit-utils, ediff, emerge & efs.
2001-04-07 Mike Sperber <mike at xemacs.org>
@@ -1238,7 +1243,7 @@
2001-04-05 Mike Sperber <mike at xemacs.org>
- * diff-mode.el:
+ * diff-mode.el:
* diff-mode.el.upstream: Added.
* Makefile (ELCS): Add diff-mode.elc.
1.2 +296 -293 XEmacs/packages/xemacs-packages/prog-modes/cl-indent.el
Index: cl-indent.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/prog-modes/cl-indent.el,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- cl-indent.el 1998/01/14 06:44:55 1.1
+++ cl-indent.el 2007/02/06 15:35:07 1.2
@@ -87,194 +87,194 @@ by `lisp-body-indent'."
;; Walk up list levels until we see something
;; which does special things with subforms.
(let ((depth 0)
- ;; Path describes the position of point in terms of
- ;; list-structure with respect to containing lists.
- ;; `foo' has a path of (0 4 1) in `((a b c (d foo) f) g)'
- (path ())
- ;; set non-nil when somebody works out the indentation to use
- calculated
- (last-point indent-point)
- ;; the position of the open-paren of the innermost containing list
- (containing-form-start (elt state 1))
- ;; the column of the above
- sexp-column)
+ ;; Path describes the position of point in terms of
+ ;; list-structure with respect to containing lists.
+ ;; `foo' has a path of (0 4 1) in `((a b c (d foo) f) g)'
+ (path ())
+ ;; set non-nil when somebody works out the indentation to use
+ calculated
+ (last-point indent-point)
+ ;; the position of the open-paren of the innermost containing list
+ (containing-form-start (elt state 1))
+ ;; the column of the above
+ sexp-column)
;; Move to start of innermost containing list
(goto-char containing-form-start)
(setq sexp-column (current-column))
;; Look over successively less-deep containing forms
(while (and (not calculated)
- (< depth lisp-indent-maximum-backtracking))
- (let ((containing-sexp (point)))
- (forward-char 1)
- (parse-partial-sexp (point) indent-point 1 t)
- ;; Move to the car of the relevant containing form
- (let (tem function method)
- (if (not (looking-at "\\sw\\|\\s_"))
- ;; This form doesn't seem to start with a symbol
- (setq function nil method nil)
- (setq tem (point))
- (forward-sexp 1)
- (setq function (downcase (buffer-substring tem (point))))
- (goto-char tem)
- (setq tem (intern-soft function)
- method (get tem 'common-lisp-indent-function))
- (cond ((and (null method)
- (string-match ":[^:]+" function))
- ;; The pleblisp package feature
- (setq function (substring function
- (1+ (match-beginning 0)))
- method (get (intern-soft function)
- 'common-lisp-indent-function)))
- ((and (null method))
- ;; backwards compatibility
- (setq method (get tem 'lisp-indent-function)))))
- (let ((n 0))
- ;; How far into the containing form is the current form?
- (if (< (point) indent-point)
- (while (condition-case ()
- (progn
- (forward-sexp 1)
- (if (>= (point) indent-point)
- nil
- (parse-partial-sexp (point)
- indent-point 1 t)
- (setq n (1+ n))
- t))
- (error nil))))
- (setq path (cons n path)))
-
- ;; backwards compatibility.
- (cond ((null function))
- ((null method)
- (if (null (cdr path))
- ;; (package prefix was stripped off above)
- (setq method (cond ((string-match "\\`def"
- function)
- '(4 (&whole 4 &rest 1) &body))
- ((string-match "\\`\\(with\\|do\\)-"
- function)
- '(4 &body))))))
- ;; backwards compatibility. Bletch.
- ((eq method 'defun)
- (setq method '(4 (&whole 4 &rest 1) &body))))
-
- (cond ((and (memq (char-after (1- containing-sexp)) '(?\' ?\`))
- (not (eql (char-after (- containing-sexp 2)) ?\#)))
- ;; No indentation for "'(...)" elements
- (setq calculated (1+ sexp-column)))
+ (< depth lisp-indent-maximum-backtracking))
+ (let ((containing-sexp (point)))
+ (forward-char 1)
+ (parse-partial-sexp (point) indent-point 1 t)
+ ;; Move to the car of the relevant containing form
+ (let (tem function method)
+ (if (not (looking-at "\\sw\\|\\s_"))
+ ;; This form doesn't seem to start with a symbol
+ (setq function nil method nil)
+ (setq tem (point))
+ (forward-sexp 1)
+ (setq function (downcase (buffer-substring tem (point))))
+ (goto-char tem)
+ (setq tem (intern-soft function)
+ method (get tem 'common-lisp-indent-function))
+ (cond ((and (null method)
+ (string-match ":[^:]+" function))
+ ;; The pleblisp package feature
+ (setq function (substring function
+ (1+ (match-beginning 0)))
+ method (get (intern-soft function)
+ 'common-lisp-indent-function)))
+ ((and (null method))
+ ;; backwards compatibility
+ (setq method (get tem 'lisp-indent-function)))))
+ (let ((n 0))
+ ;; How far into the containing form is the current form?
+ (if (< (point) indent-point)
+ (while (condition-case ()
+ (progn
+ (forward-sexp 1)
+ (if (>= (point) indent-point)
+ nil
+ (parse-partial-sexp (point)
+ indent-point 1 t)
+ (setq n (1+ n))
+ t))
+ (error nil))))
+ (setq path (cons n path)))
+
+ ;; backwards compatibility.
+ (cond ((null function))
+ ((null method)
+ (if (null (cdr path))
+ ;; (package prefix was stripped off above)
+ (setq method (cond ((string-match "\\`def"
+ function)
+ '(4 (&whole 4 &rest 1) &body))
+ ((string-match "\\`\\(with\\|do\\)-"
+ function)
+ '(4 &body))))))
+ ;; backwards compatibility. Bletch.
+ ((eq method 'defun)
+ (setq method '(4 (&whole 4 &rest 1) &body))))
+
+ (cond ((and (memq (char-after (1- containing-sexp)) '(?\' ?\`))
+ (not (eql (char-after (- containing-sexp 2)) ?\#)))
+ ;; No indentation for "'(...)" elements
+ (setq calculated (1+ sexp-column)))
((or (eql (char-after (1- containing-sexp)) ?\,)
(and (eql (char-after (1- containing-sexp)) ?\@)
(eql (char-after (- containing-sexp 2)) ?\,)))
;; ",(...)" or ",@(...)"
(setq calculated normal-indent))
- ((eql (char-after (1- containing-sexp)) ?\#)
- ;; "#(...)"
- (setq calculated (1+ sexp-column)))
- ((null method))
- ((integerp method)
- ;; convenient top-level hack.
- ;; (also compatible with lisp-indent-function)
- ;; The number specifies how many `distinguished'
- ;; forms there are before the body starts
- ;; Equivalent to (4 4 ... &body)
- (setq calculated (cond ((cdr path)
- normal-indent)
- ((<= (car path) method)
- ;; `distinguished' form
- (list (+ sexp-column 4)
- containing-form-start))
- ((= (car path) (1+ method))
- ;; first body form.
- (+ sexp-column lisp-body-indent))
- (t
- ;; other body form
- normal-indent))))
- ((symbolp method)
- (setq calculated (funcall method
- path state indent-point
- sexp-column normal-indent)))
- (t
- (setq calculated (lisp-indent-259
- method path state indent-point
- sexp-column normal-indent)))))
- (goto-char containing-sexp)
- (setq last-point containing-sexp)
- (if (not calculated)
- (condition-case ()
- (progn (backward-up-list 1)
- (setq depth (1+ depth)))
- (error (setq depth lisp-indent-maximum-backtracking))))))
+ ((eql (char-after (1- containing-sexp)) ?\#)
+ ;; "#(...)"
+ (setq calculated (1+ sexp-column)))
+ ((null method))
+ ((integerp method)
+ ;; convenient top-level hack.
+ ;; (also compatible with lisp-indent-function)
+ ;; The number specifies how many `distinguished'
+ ;; forms there are before the body starts
+ ;; Equivalent to (4 4 ... &body)
+ (setq calculated (cond ((cdr path)
+ normal-indent)
+ ((<= (car path) method)
+ ;; `distinguished' form
+ (list (+ sexp-column 4)
+ containing-form-start))
+ ((= (car path) (1+ method))
+ ;; first body form.
+ (+ sexp-column lisp-body-indent))
+ (t
+ ;; other body form
+ normal-indent))))
+ ((symbolp method)
+ (setq calculated (funcall method
+ path state indent-point
+ sexp-column normal-indent)))
+ (t
+ (setq calculated (lisp-indent-259
+ method path state indent-point
+ sexp-column normal-indent)))))
+ (goto-char containing-sexp)
+ (setq last-point containing-sexp)
+ (if (not calculated)
+ (condition-case ()
+ (progn (backward-up-list 1)
+ (setq depth (1+ depth)))
+ (error (setq depth lisp-indent-maximum-backtracking))))))
calculated)))
(defun lisp-indent-report-bad-format (m)
(error "%s has a badly-formed %s property: %s"
- ;; Love those free variable references!!
- function 'common-lisp-indent-function m))
+ ;; Love those free variable references!!
+ function 'common-lisp-indent-function m))
;; Blame the crufty control structure on dynamic scoping
;; -- not on me!
(defun lisp-indent-259 (method path state indent-point
- sexp-column normal-indent)
+ sexp-column normal-indent)
(catch 'exit
(let ((p path)
- (containing-form-start (elt state 1))
- n tem tail)
+ (containing-form-start (elt state 1))
+ n tem tail)
;; Isn't tail-recursion wonderful?
(while p
- ;; This while loop is for destructuring.
- ;; p is set to (cdr p) each iteration.
- (if (not (consp method)) (lisp-indent-report-bad-format method))
- (setq n (1- (car p))
- p (cdr p)
- tail nil)
- (while n
- ;; This while loop is for advancing along a method
- ;; until the relevant (possibly &rest/&body) pattern
- ;; is reached.
- ;; n is set to (1- n) and method to (cdr method)
- ;; each iteration.
- (setq tem (car method))
+ ;; This while loop is for destructuring.
+ ;; p is set to (cdr p) each iteration.
+ (if (not (consp method)) (lisp-indent-report-bad-format method))
+ (setq n (1- (car p))
+ p (cdr p)
+ tail nil)
+ (while n
+ ;; This while loop is for advancing along a method
+ ;; until the relevant (possibly &rest/&body) pattern
+ ;; is reached.
+ ;; n is set to (1- n) and method to (cdr method)
+ ;; each iteration.
+ (setq tem (car method))
- (or (eq tem 'nil) ;default indentation
+ (or (eq tem 'nil) ;default indentation
; (eq tem '&lambda) ;abbrev for (&whole 4 (&rest 1))
- (and (eq tem '&body) (null (cdr method)))
- (and (eq tem '&rest)
- (consp (cdr method)) (null (cdr (cdr method))))
- (integerp tem) ;explicit indentation specified
- (and (consp tem) ;destructuring
- (eq (car tem) '&whole)
- (or (symbolp (car (cdr tem)))
- (integerp (car (cdr tem)))))
- (and (symbolp tem) ;a function to call to do the work.
- (null (cdr method)))
- (lisp-indent-report-bad-format method))
-
- (cond ((and tail (not (consp tem)))
- ;; indent tail of &rest in same way as first elt of rest
- (throw 'exit normal-indent))
- ((eq tem '&body)
- ;; &body means (&rest <lisp-body-indent>)
- (throw 'exit
- (if (and (= n 0) ;first body form
- (null p)) ;not in subforms
- (+ sexp-column
- lisp-body-indent)
- normal-indent)))
- ((eq tem '&rest)
- ;; this pattern holds for all remaining forms
- (setq tail (> n 0)
- n 0
- method (cdr method)))
- ((> n 0)
- ;; try next element of pattern
- (setq n (1- n)
- method (cdr method))
- (if (< n 0)
- ;; Too few elements in pattern.
- (throw 'exit normal-indent)))
- ((eq tem 'nil)
- (throw 'exit (list normal-indent containing-form-start)))
+ (and (eq tem '&body) (null (cdr method)))
+ (and (eq tem '&rest)
+ (consp (cdr method)) (null (cdr (cdr method))))
+ (integerp tem) ;explicit indentation specified
+ (and (consp tem) ;destructuring
+ (eq (car tem) '&whole)
+ (or (symbolp (car (cdr tem)))
+ (integerp (car (cdr tem)))))
+ (and (symbolp tem) ;a function to call to do the work.
+ (null (cdr method)))
+ (lisp-indent-report-bad-format method))
+
+ (cond ((and tail (not (consp tem)))
+ ;; indent tail of &rest in same way as first elt of rest
+ (throw 'exit normal-indent))
+ ((eq tem '&body)
+ ;; &body means (&rest <lisp-body-indent>)
+ (throw 'exit
+ (if (and (= n 0) ;first body form
+ (null p)) ;not in subforms
+ (+ sexp-column
+ lisp-body-indent)
+ normal-indent)))
+ ((eq tem '&rest)
+ ;; this pattern holds for all remaining forms
+ (setq tail (> n 0)
+ n 0
+ method (cdr method)))
+ ((> n 0)
+ ;; try next element of pattern
+ (setq n (1- n)
+ method (cdr method))
+ (if (< n 0)
+ ;; Too few elements in pattern.
+ (throw 'exit normal-indent)))
+ ((eq tem 'nil)
+ (throw 'exit (list normal-indent containing-form-start)))
; ((eq tem '&lambda)
; ;; abbrev for (&whole 4 &rest 1)
; (throw 'exit
@@ -283,34 +283,34 @@ by `lisp-body-indent'."
; ((null (cdr p))
; (+ sexp-column 1))
; (t normal-indent))))
- ((integerp tem)
- (throw 'exit
- (if (null p) ;not in subforms
- (list (+ sexp-column tem) containing-form-start)
- normal-indent)))
- ((symbolp tem) ;a function to call
- (throw 'exit
- (funcall tem path state indent-point
- sexp-column normal-indent)))
- (t
- ;; must be a destructing frob
- (if (not (null p))
- ;; descend
- (setq method (cdr (cdr tem))
- n nil)
- (setq tem (car (cdr tem)))
- (throw 'exit
- (cond (tail
- normal-indent)
- ((eq tem 'nil)
- (list normal-indent
- containing-form-start))
- ((integerp tem)
- (list (+ sexp-column tem)
- containing-form-start))
- (t
- (funcall tem path state indent-point
- sexp-column normal-indent))))))))))))
+ ((integerp tem)
+ (throw 'exit
+ (if (null p) ;not in subforms
+ (list (+ sexp-column tem) containing-form-start)
+ normal-indent)))
+ ((symbolp tem) ;a function to call
+ (throw 'exit
+ (funcall tem path state indent-point
+ sexp-column normal-indent)))
+ (t
+ ;; must be a destructing frob
+ (if (not (null p))
+ ;; descend
+ (setq method (cdr (cdr tem))
+ n nil)
+ (setq tem (car (cdr tem)))
+ (throw 'exit
+ (cond (tail
+ normal-indent)
+ ((eq tem 'nil)
+ (list normal-indent
+ containing-form-start))
+ ((integerp tem)
+ (list (+ sexp-column tem)
+ containing-form-start))
+ (t
+ (funcall tem path state indent-point
+ sexp-column normal-indent))))))))))))
(defun lisp-indent-tagbody (path state indent-point sexp-column normal-indent)
(if (not (null (cdr path)))
@@ -320,75 +320,78 @@ by `lisp-body-indent'."
(beginning-of-line)
(skip-chars-forward " \t")
(list (cond ((looking-at "\\sw\\|\\s_")
- ;; a tagbody tag
- (+ sexp-column lisp-tag-indentation))
- ((integerp lisp-tag-body-indentation)
- (+ sexp-column lisp-tag-body-indentation))
- ((eq lisp-tag-body-indentation 't)
- (condition-case ()
- (progn (backward-sexp 1) (current-column))
- (error (1+ sexp-column))))
- (t (+ sexp-column lisp-body-indent)))
+ ;; a tagbody tag
+ (+ sexp-column lisp-tag-indentation))
+ ((integerp lisp-tag-body-indentation)
+ (+ sexp-column lisp-tag-body-indentation))
+ ((eq lisp-tag-body-indentation 't)
+ (condition-case ()
+ (progn (backward-sexp 1) (current-column))
+ (error (1+ sexp-column))))
+ (t (+ sexp-column lisp-body-indent)))
; (cond ((integerp lisp-tag-body-indentation)
; (+ sexp-column lisp-tag-body-indentation))
; ((eq lisp-tag-body-indentation 't)
; normal-indent)
; (t
; (+ sexp-column lisp-body-indent)))
- (elt state 1)
- ))))
+ (elt state 1)
+ ))))
(defun lisp-indent-do (path state indent-point sexp-column normal-indent)
(if (>= (car path) 3)
(let ((lisp-tag-body-indentation lisp-body-indent))
- (funcall (function lisp-indent-tagbody)
+ (funcall (function lisp-indent-tagbody)
path state indent-point sexp-column normal-indent))
(funcall (function lisp-indent-259)
'((&whole nil &rest
- ;; the following causes weird indentation
- ;;(&whole 1 1 2 nil)
+ ;; the following causes weird indentation
+ ;;(&whole 1 1 2 nil)
)
(&whole nil &rest 1))
path state indent-point sexp-column normal-indent)))
(defun lisp-indent-function-lambda-hack (path state indent-point
- sexp-column normal-indent)
+ sexp-column normal-indent)
;; indent (function (lambda () <newline> <body-forms>)) kludgily.
(if (or (cdr path) ; wtf?
- (> (car path) 3))
+ (> (car path) 3))
;; line up under previous body form
normal-indent
;; line up under function rather than under lambda in order to
;; conserve horizontal space. (Which is what #' is for.)
(condition-case ()
- (save-excursion
- (backward-up-list 2)
- (forward-char 1)
- (if (looking-at "\\(lisp:+\\)?function\\(\\Sw\\|\\S_\\)")
- (+ lisp-body-indent -1 (current-column))
- (+ sexp-column lisp-body-indent)))
+ (save-excursion
+ (backward-up-list 2)
+ (forward-char 1)
+ (if (looking-at "\\(lisp:+\\)?function\\(\\Sw\\|\\S_\\)")
+ (+ lisp-body-indent -1 (current-column))
+ (+ sexp-column lisp-body-indent)))
(error (+ sexp-column lisp-body-indent)))))
;; XEmacs change
(defun lisp-indent-defmethod (path state indent-point
- sexp-column normal-indent)
+ sexp-column normal-indent)
;; Look for a method combination specifier...
(let* ((combined (if (and (>= (car path) 3)
- (null (cdr path)))
- (save-excursion
- (goto-char (car (cdr state)))
- (forward-char)
- (forward-sexp)
- (forward-sexp)
- (forward-sexp)
- (backward-sexp)
- (if (looking-at ":")
- t
- nil))
- nil))
+ (null (cdr path)))
+ (save-excursion
+ (goto-char (car (cdr state)))
+ (forward-char)
+ (forward-sexp)
+ (forward-sexp)
+ (forward-sexp)
+ (backward-sexp)
+ ;; don't look only for a colon: we would catch
+ ;; before, after and around methods, but we would
+ ;; miss method combination types -- dvl
+ (if (not (looking-at "("))
+ t
+ nil))
+ nil))
(method (if combined
'(4 4 (&whole 4 &rest 1) &body)
- '(4 (&whole 4 &rest 1) &body))))
+ '(4 (&whole 4 &rest 1) &body))))
(funcall (function lisp-indent-259)
method
path state indent-point sexp-column normal-indent)))
@@ -396,76 +399,76 @@ by `lisp-body-indent'."
(let ((l '((block 1)
(catch 1)
- (case (4 &rest (&whole 2 &rest 1)))
- (ccase . case) (ecase . case)
- (typecase . case) (etypecase . case) (ctypecase . case)
- (catch 1)
- (cond (&rest (&whole 2 &rest 1)))
- (block 1)
- (defvar (4 2 2))
- (defconstant . defvar) (defparameter . defvar)
- (define-modify-macro
- (4 &body))
- (define-setf-method
- (4 (&whole 4 &rest 1) &body))
- (defsetf (4 (&whole 4 &rest 1) 4 &body))
- (defun (4 (&whole 4 &rest 1) &body))
- (defmacro . defun) (deftype . defun)
+ (case (4 &rest (&whole 2 &rest 1)))
+ (ccase . case) (ecase . case)
+ (typecase . case) (etypecase . case) (ctypecase . case)
+ (catch 1)
+ (cond (&rest (&whole 2 &rest 1)))
+ (block 1)
+ (defvar (4 2 2))
+ (defconstant . defvar) (defparameter . defvar)
+ (define-modify-macro
+ (4 &body))
+ (define-setf-method
+ (4 (&whole 4 &rest 1) &body))
+ (defsetf (4 (&whole 4 &rest 1) 4 &body))
+ (defun (4 (&whole 4 &rest 1) &body))
+ (defmacro . defun) (deftype . defun)
;; XEmacs change
- (defmethod lisp-indent-defmethod)
- (defstruct ((&whole 4 &rest (&whole 2 &rest 1))
- &rest (&whole 2 &rest 1)))
- (destructuring-bind
- ((&whole 6 &rest 1) 4 &body))
- (do lisp-indent-do)
- (do* . do)
- (dolist ((&whole 4 2 1) &body))
- (dotimes . dolist)
- (eval-when 1)
- (flet ((&whole 4 &rest (&whole 1 (&whole 4 &rest 1) &body))
- &body))
- (labels . flet)
- (macrolet . flet)
- ;; `else-body' style
- (if (nil nil &body))
- ;; single-else style (then and else equally indented)
- (if (&rest nil))
- ;(lambda ((&whole 4 &rest 1) &body))
- (lambda ((&whole 4 &rest 1)
- &rest lisp-indent-function-lambda-hack))
- (let ((&whole 4 &rest (&whole 1 1 2)) &body))
- (let* . let)
- (compiler-let . let) ;barf
- (locally 1)
- ;(loop ...)
- (multiple-value-bind
- ((&whole 6 &rest 1) 4 &body))
- (multiple-value-call
+ (defmethod lisp-indent-defmethod)
+ (defstruct ((&whole 4 &rest (&whole 2 &rest 1))
+ &rest (&whole 2 &rest 1)))
+ (destructuring-bind
+ ((&whole 6 &rest 1) 4 &body))
+ (do lisp-indent-do)
+ (do* . do)
+ (dolist ((&whole 4 2 1) &body))
+ (dotimes . dolist)
+ (eval-when 1)
+ (flet ((&whole 4 &rest (&whole 1 (&whole 4 &rest 1) &body))
+ &body))
+ (labels . flet)
+ (macrolet . flet)
+ ;; `else-body' style
+ (if (nil nil &body))
+ ;; single-else style (then and else equally indented)
+ (if (&rest nil))
+ ;(lambda ((&whole 4 &rest 1) &body))
+ (lambda ((&whole 4 &rest 1)
+ &rest lisp-indent-function-lambda-hack))
+ (let ((&whole 4 &rest (&whole 1 1 2)) &body))
+ (let* . let)
+ (compiler-let . let) ;barf
+ (locally 1)
+ ;(loop ...)
+ (multiple-value-bind
+ ((&whole 6 &rest 1) 4 &body))
+ (multiple-value-call
(4 &body))
- (multiple-value-list 1)
- (multiple-value-prog1 1)
- (multiple-value-setq
+ (multiple-value-list 1)
+ (multiple-value-prog1 1)
+ (multiple-value-setq
(4 2))
- ;; Combines the worst features of BLOCK, LET and TAGBODY
- (prog ((&whole 4 &rest 1) &rest lisp-indent-tagbody))
- (prog* . prog)
- (prog1 1)
- (prog2 2)
- (progn 0)
- (progv (4 4 &body))
- (return 0)
- (return-from (nil &body))
- (tagbody lisp-indent-tagbody)
- (throw 1)
- (unless 1)
- (unwind-protect
- (5 &body))
- (when 1))))
+ ;; Combines the worst features of BLOCK, LET and TAGBODY
+ (prog ((&whole 4 &rest 1) &rest lisp-indent-tagbody))
+ (prog* . prog)
+ (prog1 1)
+ (prog2 2)
+ (progn 0)
+ (progv (4 4 &body))
+ (return 0)
+ (return-from (nil &body))
+ (tagbody lisp-indent-tagbody)
+ (throw 1)
+ (unless 1)
+ (unwind-protect
+ (5 &body))
+ (when 1))))
(while l
(put (car (car l)) 'common-lisp-indent-function
- (if (symbolp (cdr (car l)))
- (get (cdr (car l)) 'common-lisp-indent-function)
- (car (cdr (car l)))))
+ (if (symbolp (cdr (car l)))
+ (get (cdr (car l)) 'common-lisp-indent-function)
+ (car (cdr (car l)))))
(setq l (cdr l))))
@@ -496,7 +499,7 @@ by `lisp-body-indent'."
; (t
; (lose
; 3))))))
-
+
;(put 'while 'common-lisp-indent-function 1)
;(put 'defwrapper'common-lisp-indent-function ...)
More information about the XEmacs-CVS
mailing list