Mercurial > emacs
comparison lisp/emacs-lisp/cl-indent.el @ 40952:2ca1b56f3bb1
Indent properly `generic-flet', `generic-labels', `with-accessors',
`with-condition-restarts'.
author | Sam Steingold <sds@gnu.org> |
---|---|
date | Mon, 12 Nov 2001 19:58:33 +0000 |
parents | f2ff22369238 |
children | 4a78098c3bd7 |
comparison
equal
deleted
inserted
replaced
40951:7375c885a612 | 40952:2ca1b56f3bb1 |
---|---|
353 ;;(&whole 1 1 2 nil) | 353 ;;(&whole 1 1 2 nil) |
354 ) | 354 ) |
355 (&whole nil &rest 1)) | 355 (&whole nil &rest 1)) |
356 path state indent-point sexp-column normal-indent))) | 356 path state indent-point sexp-column normal-indent))) |
357 | 357 |
358 (defun lisp-indent-defmethod (path state indent-point sexp-column | 358 (defun lisp-indent-defmethod (path state indent-point sexp-column |
359 normal-indent) | 359 normal-indent) |
360 "Indentation function defmethod." | 360 "Indentation function defmethod." |
361 (lisp-indent-259 (if (save-excursion (goto-char (elt state 1)) | 361 (lisp-indent-259 (if (save-excursion (goto-char (elt state 1)) |
362 (forward-char 1) | 362 (forward-char 1) |
363 (forward-sexp 2) | 363 (forward-sexp 2) |
417 (dotimes . dolist) | 417 (dotimes . dolist) |
418 (eval-when 1) | 418 (eval-when 1) |
419 (flet ((&whole 4 &rest (&whole 1 &lambda &body)) &body)) | 419 (flet ((&whole 4 &rest (&whole 1 &lambda &body)) &body)) |
420 (labels . flet) | 420 (labels . flet) |
421 (macrolet . flet) | 421 (macrolet . flet) |
422 (generic-flet . flet) (generic-labels . flet) | |
422 (handler-case (4 &rest (&whole 2 &lambda &body))) | 423 (handler-case (4 &rest (&whole 2 &lambda &body))) |
423 (restart-case . handler-case) | 424 (restart-case . handler-case) |
424 ;; `else-body' style | 425 ;; `else-body' style |
425 (if (nil nil &body)) | 426 (if (nil nil &body)) |
426 ;; single-else style (then and else equally indented) | 427 ;; single-else style (then and else equally indented) |
453 (tagbody lisp-indent-tagbody) | 454 (tagbody lisp-indent-tagbody) |
454 (throw 1) | 455 (throw 1) |
455 (unless 1) | 456 (unless 1) |
456 (unwind-protect (5 &body)) | 457 (unwind-protect (5 &body)) |
457 (when 1) | 458 (when 1) |
459 (with-accessors . multiple-value-bind) | |
460 (with-condition-restarts . multiple-value-bind) | |
458 (with-output-to-string (4 2)) | 461 (with-output-to-string (4 2)) |
459 (with-slots . multiple-value-bind) | 462 (with-slots . multiple-value-bind) |
460 (with-standard-io-syntax (2))))) | 463 (with-standard-io-syntax (2))))) |
461 (while l | 464 (dolist (el l) |
462 (put (caar l) 'common-lisp-indent-function | 465 (put (car el) 'common-lisp-indent-function |
463 (if (symbolp (cdar l)) | 466 (if (symbolp (cdr el)) |
464 (get (cdar l) 'common-lisp-indent-function) | 467 (get (cdr el) 'common-lisp-indent-function) |
465 (car (cdar l)))) | 468 (car (cdr el)))))) |
466 (setq l (cdr l)))) | |
467 | 469 |
468 | 470 |
469 ;(defun foo (x) | 471 ;(defun foo (x) |
470 ; (tagbody | 472 ; (tagbody |
471 ; foo | 473 ; foo |