annotate lisp/emacs-lisp/cl-indent.el @ 72343:2ae29d562915

* keyboard.c: Define in_sighandler. (input_available_signal): Set in_sighandler. (init_keyboard): Initialize in_sighandler. * keyboard.h: Declare in_sighandler. * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler to check if mutex should be locked or not.
author Jan Djärv <jan.h.d@swipnet.se>
date Thu, 10 Aug 2006 06:09:57 +0000
parents 067115a6e738
children f93751296dc3 c5406394f567
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
662
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 257
diff changeset
1 ;;; cl-indent.el --- enhanced lisp-indent mode
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 257
diff changeset
2
64751
5b1a238fcbb4 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64085
diff changeset
3 ;; Copyright (C) 1987, 2000, 2001, 2002, 2003, 2004,
68648
067115a6e738 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64751
diff changeset
4 ;; 2005, 2006 Free Software Foundation, Inc.
2307
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 845
diff changeset
5
14040
187735b53d52 Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 3591
diff changeset
6 ;; Author: Richard Mlynarik <mly@eddie.mit.edu>
2307
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 845
diff changeset
7 ;; Created: July 1987
845
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 811
diff changeset
8 ;; Maintainer: FSF
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 811
diff changeset
9 ;; Keywords: lisp, tools
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 811
diff changeset
10
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 ;; This file is part of GNU Emacs.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 ;; any later version.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 ;; GNU Emacs is distributed in the hope that it will be useful,
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 ;; GNU General Public License for more details.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 63972
diff changeset
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 63972
diff changeset
26 ;; Boston, MA 02110-1301, USA.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
28 ;;; Commentary:
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
29
2307
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 845
diff changeset
30 ;; This package supplies a single entry point, common-lisp-indent-function,
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 845
diff changeset
31 ;; which performs indentation in the preferred style for Common Lisp code.
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 845
diff changeset
32 ;; To enable it:
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 845
diff changeset
33 ;;
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 845
diff changeset
34 ;; (setq lisp-indent-function 'common-lisp-indent-function)
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 845
diff changeset
35
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 ;;>> TODO
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 ;; :foo
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 ;; bar
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 ;; :baz
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 ;; zap
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 ;; &key (like &body)??
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 ;; &rest 1 in lambda-lists doesn't work
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 ;; -- really want (foo bar
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 ;; baz)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 ;; not (foo bar
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 ;; baz)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 ;; Need something better than &rest for such cases
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
50 ;;; Code:
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51
17413
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
52 (defgroup lisp-indent nil
63972
d07b7088d847 (lisp-indent-maximum-backtracking): Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 56736
diff changeset
53 "Indentation in Lisp."
17413
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
54 :group 'lisp)
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
55
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
56
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
57 (defcustom lisp-indent-maximum-backtracking 3
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 "*Maximum depth to backtrack out from a sublist for structured indentation.
63972
d07b7088d847 (lisp-indent-maximum-backtracking): Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 56736
diff changeset
59 If this variable is 0, no backtracking will occur and forms such as `flet'
17413
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
60 may not be correctly indented."
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
61 :type 'integer
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
62 :group 'lisp-indent)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63
17413
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
64 (defcustom lisp-tag-indentation 1
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 "*Indentation of tags relative to containing list.
17413
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
66 This variable is used by the function `lisp-indent-tagbody'."
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
67 :type 'integer
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
68 :group 'lisp-indent)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69
17413
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
70 (defcustom lisp-tag-body-indentation 3
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71 "*Indentation of non-tagged lines relative to containing list.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 This variable is used by the function `lisp-indent-tagbody' to indent normal
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 lines (lines without tags).
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 The indentation is relative to the indentation of the parenthesis enclosing
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 the special form. If the value is t, the body of tags will be indented
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 as a block at the same indentation as the first s-expression following
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 the tag. In this case, any forms before the first tag are indented
17413
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
78 by `lisp-body-indent'."
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
79 :type 'integer
9fa0ed8da0b1 Add defgroup's; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
80 :group 'lisp-indent)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
82 (defcustom lisp-backquote-indentation t
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
83 "*Whether or not to indent backquoted lists as code.
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
84 If nil, indent backquoted lists as data, i.e., like quoted lists."
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
85 :type 'boolean
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
86 :group 'lisp-indent)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
87
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
88
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
89 (defcustom lisp-loop-keyword-indentation 3
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
90 "*Indentation of loop keywords in extended loop forms."
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
91 :type 'integer
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
92 :group 'lisp-indent)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
93
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
94
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
95 (defcustom lisp-loop-forms-indentation 5
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
96 "*Indentation of forms in extended loop forms."
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
97 :type 'integer
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
98 :group 'lisp-indent)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
99
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
100
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
101 (defcustom lisp-simple-loop-indentation 3
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
102 "*Indentation of forms in simple loop forms."
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
103 :type 'integer
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
104 :group 'lisp-indent)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
105
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106
22212
b95ba3830bc9 (lisp-indent-error-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22180
diff changeset
107 (defvar lisp-indent-error-function)
22858
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
108 (defvar lisp-indent-defun-method '(4 &lambda &body))
22212
b95ba3830bc9 (lisp-indent-error-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22180
diff changeset
109
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
110
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
111 (defun extended-loop-p (loop-start)
47298
c6dddb2746ee * emacs-lisp/cl-indent.el (extended-loop-p): Doc fix.
John Paul Wallington <jpw@pobox.com>
parents: 45573
diff changeset
112 "True if an extended loop form starts at LOOP-START."
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
113 (condition-case ()
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
114 (save-excursion
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
115 (goto-char loop-start)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
116 (forward-char 1)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
117 (forward-sexp 2)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
118 (backward-sexp 1)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
119 (looking-at "\\sw"))
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
120 (error t)))
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
121
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
122
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
123 (defun common-lisp-loop-part-indentation (indent-point state)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
124 "Compute the indentation of loop form constituents."
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
125 (let* ((loop-indentation (save-excursion
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
126 (goto-char (elt state 1))
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
127 (current-column))))
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
128 (goto-char indent-point)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
129 (beginning-of-line)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
130 (cond ((not (extended-loop-p (elt state 1)))
43920
af0b9648d018 (common-lisp-loop-part-indentation):
Gerd Moellmann <gerd@gnu.org>
parents: 43859
diff changeset
131 (+ loop-indentation lisp-simple-loop-indentation))
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
132 ((looking-at "^\\s-*\\(:?\\sw+\\|;\\)")
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
133 (+ loop-indentation lisp-loop-keyword-indentation))
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
134 (t
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
135 (+ loop-indentation lisp-loop-forms-indentation)))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47298
diff changeset
136
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
137
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 ;;;###autoload
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 (defun common-lisp-indent-function (indent-point state)
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
140 (if (save-excursion (goto-char (elt state 1))
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
141 (looking-at "([Ll][Oo][Oo][Pp]"))
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
142 (common-lisp-loop-part-indentation indent-point state)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
143 (common-lisp-indent-function-1 indent-point state)))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47298
diff changeset
144
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47298
diff changeset
145
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
146 (defun common-lisp-indent-function-1 (indent-point state)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 (let ((normal-indent (current-column)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 ;; Walk up list levels until we see something
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149 ;; which does special things with subforms.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150 (let ((depth 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151 ;; Path describes the position of point in terms of
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 2307
diff changeset
152 ;; list-structure with respect to containing lists.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
153 ;; `foo' has a path of (0 4 1) in `((a b c (d foo) f) g)'
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 (path ())
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 ;; set non-nil when somebody works out the indentation to use
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156 calculated
45573
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
157 ;; If non-nil, this is an indentation to use
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
158 ;; if nothing else specifies it more firmly.
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
159 tentative-calculated
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
160 (last-point indent-point)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161 ;; the position of the open-paren of the innermost containing list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162 (containing-form-start (elt state 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 ;; the column of the above
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164 sexp-column)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 ;; Move to start of innermost containing list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
166 (goto-char containing-form-start)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 (setq sexp-column (current-column))
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
168
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169 ;; Look over successively less-deep containing forms
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170 (while (and (not calculated)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
171 (< depth lisp-indent-maximum-backtracking))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
172 (let ((containing-sexp (point)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
173 (forward-char 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
174 (parse-partial-sexp (point) indent-point 1 t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175 ;; Move to the car of the relevant containing form
45573
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
176 (let (tem function method tentative-defun)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
177 (if (not (looking-at "\\sw\\|\\s_"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178 ;; This form doesn't seem to start with a symbol
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
179 (setq function nil method nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180 (setq tem (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181 (forward-sexp 1)
22858
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
182 (setq function (downcase (buffer-substring-no-properties
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
183 tem (point))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
184 (goto-char tem)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
185 (setq tem (intern-soft function)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
186 method (get tem 'common-lisp-indent-function))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
187 (cond ((and (null method)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
188 (string-match ":[^:]+" function))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 ;; The pleblisp package feature
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
190 (setq function (substring function
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191 (1+ (match-beginning 0)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192 method (get (intern-soft function)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
193 'common-lisp-indent-function)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194 ((and (null method))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
195 ;; backwards compatibility
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
196 (setq method (get tem 'lisp-indent-function)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
197 (let ((n 0))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
198 ;; How far into the containing form is the current form?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
199 (if (< (point) indent-point)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
200 (while (condition-case ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
201 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202 (forward-sexp 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
203 (if (>= (point) indent-point)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205 (parse-partial-sexp (point)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
206 indent-point 1 t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
207 (setq n (1+ n))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
208 t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209 (error nil))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
210 (setq path (cons n path)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
211
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
212 ;; backwards compatibility.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213 (cond ((null function))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
214 ((null method)
22858
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
215 (when (null (cdr path))
45573
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
216 ;; (package prefix was stripped off above)
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
217 (cond ((string-match "\\`def"
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
218 function)
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
219 (setq tentative-defun t))
55636
c2f8040b4ece (common-lisp-indent-function-1): Indent "without-" forms just
Sam Steingold <sds@gnu.org>
parents: 52401
diff changeset
220 ((string-match
c2f8040b4ece (common-lisp-indent-function-1): Indent "without-" forms just
Sam Steingold <sds@gnu.org>
parents: 52401
diff changeset
221 (eval-when-compile
c2f8040b4ece (common-lisp-indent-function-1): Indent "without-" forms just
Sam Steingold <sds@gnu.org>
parents: 52401
diff changeset
222 (concat "\\`\\("
c2f8040b4ece (common-lisp-indent-function-1): Indent "without-" forms just
Sam Steingold <sds@gnu.org>
parents: 52401
diff changeset
223 (regexp-opt '("with" "without" "do"))
c2f8040b4ece (common-lisp-indent-function-1): Indent "without-" forms just
Sam Steingold <sds@gnu.org>
parents: 52401
diff changeset
224 "\\)-"))
c2f8040b4ece (common-lisp-indent-function-1): Indent "without-" forms just
Sam Steingold <sds@gnu.org>
parents: 52401
diff changeset
225 function)
45573
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
226 (setq method '(&lambda &body))))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
227 ;; backwards compatibility. Bletch.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
228 ((eq method 'defun)
22858
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
229 (setq method lisp-indent-defun-method)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
230
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
231 (cond ((and (or (eq (char-after (1- containing-sexp)) ?\')
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
232 (and (not lisp-backquote-indentation)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
233 (eq (char-after (1- containing-sexp)) ?\`)))
26047
e6efd0ace0f3 (common-lisp-indent-function): Use `eq' instead of `eql'.
Gerd Moellmann <gerd@gnu.org>
parents: 23725
diff changeset
234 (not (eq (char-after (- containing-sexp 2)) ?\#)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
235 ;; No indentation for "'(...)" elements
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
236 (setq calculated (1+ sexp-column)))
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
237 ((or (eq (char-after (1- containing-sexp)) ?\,)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
238 (and (eq (char-after (1- containing-sexp)) ?\@)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
239 (eq (char-after (- containing-sexp 2)) ?\,)))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
240 ;; ",(...)" or ",@(...)"
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
241 (setq calculated normal-indent))
26047
e6efd0ace0f3 (common-lisp-indent-function): Use `eq' instead of `eql'.
Gerd Moellmann <gerd@gnu.org>
parents: 23725
diff changeset
242 ((eq (char-after (1- containing-sexp)) ?\#)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
243 ;; "#(...)"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
244 (setq calculated (1+ sexp-column)))
45573
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
245 ((null method)
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
246 ;; If this looks like a call to a `def...' form,
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
247 ;; think about indenting it as one, but do it
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
248 ;; tentatively for cases like
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
249 ;; (flet ((defunp ()
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
250 ;; nil)))
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
251 ;; Set both normal-indent and tentative-calculated.
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
252 ;; The latter ensures this value gets used
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
253 ;; if there are no relevant containing constructs.
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
254 ;; The former ensures this value gets used
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
255 ;; if there is a relevant containing construct
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
256 ;; but we are nested within the structure levels
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
257 ;; that it specifies indentation for.
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
258 (if tentative-defun
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
259 (setq tentative-calculated
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
260 (common-lisp-indent-call-method
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
261 function lisp-indent-defun-method
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
262 path state indent-point
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
263 sexp-column normal-indent)
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
264 normal-indent tentative-calculated)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
265 ((integerp method)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
266 ;; convenient top-level hack.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
267 ;; (also compatible with lisp-indent-function)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
268 ;; The number specifies how many `distinguished'
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
269 ;; forms there are before the body starts
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
270 ;; Equivalent to (4 4 ... &body)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
271 (setq calculated (cond ((cdr path)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272 normal-indent)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
273 ((<= (car path) method)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
274 ;; `distinguished' form
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
275 (list (+ sexp-column 4)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
276 containing-form-start))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
277 ((= (car path) (1+ method))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
278 ;; first body form.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
279 (+ sexp-column lisp-body-indent))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
280 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
281 ;; other body form
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
282 normal-indent))))
45573
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
283 (t
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
284 (setq calculated
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
285 (common-lisp-indent-call-method
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
286 function method path state indent-point
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
287 sexp-column normal-indent)))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
288 (goto-char containing-sexp)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
289 (setq last-point containing-sexp)
22858
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
290 (unless calculated
45573
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
291 (condition-case ()
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
292 (progn (backward-up-list 1)
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
293 (setq depth (1+ depth)))
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
294 (error (setq depth lisp-indent-maximum-backtracking))))))
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
295 (or calculated tentative-calculated))))
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
296
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
297
45573
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
298 (defun common-lisp-indent-call-method (function method path state indent-point
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
299 sexp-column normal-indent)
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
300 (let ((lisp-indent-error-function function))
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
301 (if (symbolp method)
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
302 (funcall method
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
303 path state indent-point
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
304 sexp-column normal-indent)
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
305 (lisp-indent-259 method path state indent-point
54fb43cbbd73 (common-lisp-indent-function-1):
Richard M. Stallman <rms@gnu.org>
parents: 43920
diff changeset
306 sexp-column normal-indent))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
307
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
308 (defun lisp-indent-report-bad-format (m)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
309 (error "%s has a badly-formed %s property: %s"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
310 ;; Love those free variable references!!
22212
b95ba3830bc9 (lisp-indent-error-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22180
diff changeset
311 lisp-indent-error-function 'common-lisp-indent-function m))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
312
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
313 ;; Blame the crufty control structure on dynamic scoping
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
314 ;; -- not on me!
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
315 (defun lisp-indent-259 (method path state indent-point
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
316 sexp-column normal-indent)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
317 (catch 'exit
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
318 (let ((p path)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
319 (containing-form-start (elt state 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
320 n tem tail)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
321 ;; Isn't tail-recursion wonderful?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
322 (while p
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
323 ;; This while loop is for destructuring.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
324 ;; p is set to (cdr p) each iteration.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
325 (if (not (consp method)) (lisp-indent-report-bad-format method))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
326 (setq n (1- (car p))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
327 p (cdr p)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
328 tail nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
329 (while n
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
330 ;; This while loop is for advancing along a method
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
331 ;; until the relevant (possibly &rest/&body) pattern
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
332 ;; is reached.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
333 ;; n is set to (1- n) and method to (cdr method)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
334 ;; each iteration.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
335 (setq tem (car method))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
336
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
337 (or (eq tem 'nil) ;default indentation
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
338 (eq tem '&lambda) ;lambda list
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
339 (and (eq tem '&body) (null (cdr method)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
340 (and (eq tem '&rest)
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
341 (consp (cdr method))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
342 (null (cddr method)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
343 (integerp tem) ;explicit indentation specified
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
344 (and (consp tem) ;destructuring
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
345 (eq (car tem) '&whole)
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
346 (or (symbolp (cadr tem))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
347 (integerp (cadr tem))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
348 (and (symbolp tem) ;a function to call to do the work.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
349 (null (cdr method)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
350 (lisp-indent-report-bad-format method))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
351
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
352 (cond ((and tail (not (consp tem)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
353 ;; indent tail of &rest in same way as first elt of rest
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
354 (throw 'exit normal-indent))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
355 ((eq tem '&body)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
356 ;; &body means (&rest <lisp-body-indent>)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
357 (throw 'exit
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
358 (if (and (= n 0) ;first body form
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
359 (null p)) ;not in subforms
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
360 (+ sexp-column
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
361 lisp-body-indent)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
362 normal-indent)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
363 ((eq tem '&rest)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
364 ;; this pattern holds for all remaining forms
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
365 (setq tail (> n 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
366 n 0
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
367 method (cdr method)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
368 ((> n 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
369 ;; try next element of pattern
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
370 (setq n (1- n)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
371 method (cdr method))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
372 (if (< n 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
373 ;; Too few elements in pattern.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
374 (throw 'exit normal-indent)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
375 ((eq tem 'nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
376 (throw 'exit (list normal-indent containing-form-start)))
22858
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
377 ((eq tem '&lambda)
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
378 (throw 'exit
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
379 (cond ((null p)
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
380 (list (+ sexp-column 4) containing-form-start))
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
381 ((null (cdr p))
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
382 (+ sexp-column 1))
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
383 (t normal-indent))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
384 ((integerp tem)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
385 (throw 'exit
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
386 (if (null p) ;not in subforms
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
387 (list (+ sexp-column tem) containing-form-start)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
388 normal-indent)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
389 ((symbolp tem) ;a function to call
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
390 (throw 'exit
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
391 (funcall tem path state indent-point
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
392 sexp-column normal-indent)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
393 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
394 ;; must be a destructing frob
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
395 (if (not (null p))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
396 ;; descend
22858
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
397 (setq method (cddr tem)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
398 n nil)
22858
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
399 (setq tem (cadr tem))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
400 (throw 'exit
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
401 (cond (tail
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
402 normal-indent)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
403 ((eq tem 'nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
404 (list normal-indent
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
405 containing-form-start))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
406 ((integerp tem)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
407 (list (+ sexp-column tem)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
408 containing-form-start))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
409 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
410 (funcall tem path state indent-point
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
411 sexp-column normal-indent))))))))))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
412
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
413 (defun lisp-indent-tagbody (path state indent-point sexp-column normal-indent)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
414 (if (not (null (cdr path)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
415 normal-indent
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
416 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
417 (goto-char indent-point)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
418 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
419 (skip-chars-forward " \t")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
420 (list (cond ((looking-at "\\sw\\|\\s_")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
421 ;; a tagbody tag
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
422 (+ sexp-column lisp-tag-indentation))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
423 ((integerp lisp-tag-body-indentation)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
424 (+ sexp-column lisp-tag-body-indentation))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
425 ((eq lisp-tag-body-indentation 't)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
426 (condition-case ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
427 (progn (backward-sexp 1) (current-column))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
428 (error (1+ sexp-column))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
429 (t (+ sexp-column lisp-body-indent)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
430 ; (cond ((integerp lisp-tag-body-indentation)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
431 ; (+ sexp-column lisp-tag-body-indentation))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
432 ; ((eq lisp-tag-body-indentation 't)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
433 ; normal-indent)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
434 ; (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
435 ; (+ sexp-column lisp-body-indent)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
436 (elt state 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
437 ))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
438
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
439 (defun lisp-indent-do (path state indent-point sexp-column normal-indent)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
440 (if (>= (car path) 3)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
441 (let ((lisp-tag-body-indentation lisp-body-indent))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
442 (funcall (function lisp-indent-tagbody)
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
443 path state indent-point sexp-column normal-indent))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
444 (funcall (function lisp-indent-259)
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
445 '((&whole nil &rest
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
446 ;; the following causes weird indentation
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
447 ;;(&whole 1 1 2 nil)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
448 )
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
449 (&whole nil &rest 1))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
450 path state indent-point sexp-column normal-indent)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
451
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
452
40952
2ca1b56f3bb1 Indent properly `generic-flet', `generic-labels', `with-accessors',
Sam Steingold <sds@gnu.org>
parents: 38826
diff changeset
453 (defun lisp-indent-defmethod (path state indent-point sexp-column
38826
f2ff22369238 (lisp-indent-defmethod): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37764
diff changeset
454 normal-indent)
f2ff22369238 (lisp-indent-defmethod): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37764
diff changeset
455 "Indentation function defmethod."
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
456 (lisp-indent-259 (if (and (>= (car path) 3)
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
457 (null (cdr path))
41256
4a78098c3bd7 (lisp-indent-defmethod): At first three elements, act like defun.
Richard M. Stallman <rms@gnu.org>
parents: 40952
diff changeset
458 (save-excursion (goto-char (elt state 1))
4a78098c3bd7 (lisp-indent-defmethod): At first three elements, act like defun.
Richard M. Stallman <rms@gnu.org>
parents: 40952
diff changeset
459 (forward-char 1)
4a78098c3bd7 (lisp-indent-defmethod): At first three elements, act like defun.
Richard M. Stallman <rms@gnu.org>
parents: 40952
diff changeset
460 (forward-sexp 3)
4a78098c3bd7 (lisp-indent-defmethod): At first three elements, act like defun.
Richard M. Stallman <rms@gnu.org>
parents: 40952
diff changeset
461 (backward-sexp)
56736
3b66605ad268 (lisp-indent-defmethod): Correct
Eli Zaretskii <eliz@gnu.org>
parents: 55636
diff changeset
462 (looking-at ":\\|\\sw+")))
38826
f2ff22369238 (lisp-indent-defmethod): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37764
diff changeset
463 '(4 4 (&whole 4 &rest 4) &body)
f2ff22369238 (lisp-indent-defmethod): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37764
diff changeset
464 (get 'defun 'common-lisp-indent-function))
f2ff22369238 (lisp-indent-defmethod): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37764
diff changeset
465 path state indent-point sexp-column normal-indent))
f2ff22369238 (lisp-indent-defmethod): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37764
diff changeset
466
f2ff22369238 (lisp-indent-defmethod): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37764
diff changeset
467
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
468 (defun lisp-indent-function-lambda-hack (path state indent-point
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
469 sexp-column normal-indent)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
470 ;; indent (function (lambda () <newline> <body-forms>)) kludgily.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
471 (if (or (cdr path) ; wtf?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
472 (> (car path) 3))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
473 ;; line up under previous body form
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
474 normal-indent
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
475 ;; line up under function rather than under lambda in order to
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
476 ;; conserve horizontal space. (Which is what #' is for.)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
477 (condition-case ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
478 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
479 (backward-up-list 2)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
480 (forward-char 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
481 (if (looking-at "\\(lisp:+\\)?function\\(\\Sw\\|\\S_\\)")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
482 (+ lisp-body-indent -1 (current-column))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
483 (+ sexp-column lisp-body-indent)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
484 (error (+ sexp-column lisp-body-indent)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
485
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
486
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
487
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
488 (let ((l '((block 1)
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
489 (case (4 &rest (&whole 2 &rest 1)))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
490 (ccase . case) (ecase . case)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
491 (typecase . case) (etypecase . case) (ctypecase . case)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
492 (catch 1)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
493 (cond (&rest (&whole 2 &rest 1)))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
494 (defvar (4 2 2))
30651
61c2f9fcb8f6 * emacs-lisp/cl-indent.el (toplevel): Indent `defclass',
Sam Steingold <sds@gnu.org>
parents: 29797
diff changeset
495 (defclass (6 4 (&whole 2 &rest 1) (&whole 2 &rest 1)))
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
496 (defconstant . defvar)
27231
e9725bb98b6e Add defclass, define-condition, defmethod, symbol-macrolet.
Dave Love <fx@gnu.org>
parents: 26047
diff changeset
497 (defcustom (4 2 2 2))
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
498 (defparameter . defvar)
30651
61c2f9fcb8f6 * emacs-lisp/cl-indent.el (toplevel): Indent `defclass',
Sam Steingold <sds@gnu.org>
parents: 29797
diff changeset
499 (defconst . defcustom)
61c2f9fcb8f6 * emacs-lisp/cl-indent.el (toplevel): Indent `defclass',
Sam Steingold <sds@gnu.org>
parents: 29797
diff changeset
500 (define-condition . defclass)
42252
63b6d0453539 (define-modify-macro): Better indent spec.
Richard M. Stallman <rms@gnu.org>
parents: 41256
diff changeset
501 (define-modify-macro (4 &lambda &body))
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
502 (defsetf (4 &lambda 4 &body))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
503 (defun (4 &lambda &body))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
504 (define-setf-method . defun)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
505 (define-setf-expander . defun)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
506 (defmacro . defun) (defsubst . defun) (deftype . defun)
38826
f2ff22369238 (lisp-indent-defmethod): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37764
diff changeset
507 (defmethod lisp-indent-defmethod)
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
508 (defpackage (4 2))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
509 (defstruct ((&whole 4 &rest (&whole 2 &rest 1))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
510 &rest (&whole 2 &rest 1)))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
511 (destructuring-bind
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
512 ((&whole 6 &rest 1) 4 &body))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
513 (do lisp-indent-do)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
514 (do* . do)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
515 (dolist ((&whole 4 2 1) &body))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
516 (dotimes . dolist)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
517 (eval-when 1)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
518 (flet ((&whole 4 &rest (&whole 1 &lambda &body)) &body))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
519 (labels . flet)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
520 (macrolet . flet)
40952
2ca1b56f3bb1 Indent properly `generic-flet', `generic-labels', `with-accessors',
Sam Steingold <sds@gnu.org>
parents: 38826
diff changeset
521 (generic-flet . flet) (generic-labels . flet)
22858
77090a500417 (lisp-indent-defun-method): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 22756
diff changeset
522 (handler-case (4 &rest (&whole 2 &lambda &body)))
22756
6103b46f200a Indent `restart-case', `handler-bind' and `restart-bind' correctly.
Richard M. Stallman <rms@gnu.org>
parents: 22731
diff changeset
523 (restart-case . handler-case)
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
524 ;; `else-body' style
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
525 (if (nil nil &body))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
526 ;; single-else style (then and else equally indented)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
527 (if (&rest nil))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
528 (lambda (&lambda &rest lisp-indent-function-lambda-hack))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
529 (let ((&whole 4 &rest (&whole 1 1 2)) &body))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
530 (let* . let)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
531 (compiler-let . let) ;barf
22756
6103b46f200a Indent `restart-case', `handler-bind' and `restart-bind' correctly.
Richard M. Stallman <rms@gnu.org>
parents: 22731
diff changeset
532 (handler-bind . let) (restart-bind . let)
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
533 (locally 1)
43859
e8da4031d520 (lisp-loop-keyword-indentation)
Gerd Moellmann <gerd@gnu.org>
parents: 42252
diff changeset
534 ;(loop lisp-indent-loop)
37764
b1fec0dc2aa1 (toplevel): indent the :method sub-form of `defgeneric' correctly.
Sam Steingold <sds@gnu.org>
parents: 37389
diff changeset
535 (:method (&lambda &body)) ; in `defgeneric'
30651
61c2f9fcb8f6 * emacs-lisp/cl-indent.el (toplevel): Indent `defclass',
Sam Steingold <sds@gnu.org>
parents: 29797
diff changeset
536 (multiple-value-bind ((&whole 6 &rest 1) 4 &body))
61c2f9fcb8f6 * emacs-lisp/cl-indent.el (toplevel): Indent `defclass',
Sam Steingold <sds@gnu.org>
parents: 29797
diff changeset
537 (multiple-value-call (4 &body))
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
538 (multiple-value-prog1 1)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
539 (multiple-value-setq (4 2))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
540 (multiple-value-setf . multiple-value-setq)
27872
277f4365f2fa Indent `pprint-logical-block' properly.
Gerd Moellmann <gerd@gnu.org>
parents: 27802
diff changeset
541 (pprint-logical-block (4 2))
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
542 (print-unreadable-object ((&whole 4 1 &rest 1) &body))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
543 ;; Combines the worst features of BLOCK, LET and TAGBODY
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
544 (prog (&lambda &rest lisp-indent-tagbody))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
545 (prog* . prog)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
546 (prog1 1)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
547 (prog2 2)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
548 (progn 0)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
549 (progv (4 4 &body))
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
550 (return 0)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
551 (return-from (nil &body))
50700
ad311d8949c4 `symbol-macrolet' is similar to `let', not `multiple-value-bind'.
Sam Steingold <sds@gnu.org>
parents: 49598
diff changeset
552 (symbol-macrolet . let)
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
553 (tagbody lisp-indent-tagbody)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
554 (throw 1)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
555 (unless 1)
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
556 (unwind-protect (5 &body))
22180
485917486caf Indent `with-standard-io-syntax' correctly.
Richard M. Stallman <rms@gnu.org>
parents: 21750
diff changeset
557 (when 1)
40952
2ca1b56f3bb1 Indent properly `generic-flet', `generic-labels', `with-accessors',
Sam Steingold <sds@gnu.org>
parents: 38826
diff changeset
558 (with-accessors . multiple-value-bind)
2ca1b56f3bb1 Indent properly `generic-flet', `generic-labels', `with-accessors',
Sam Steingold <sds@gnu.org>
parents: 38826
diff changeset
559 (with-condition-restarts . multiple-value-bind)
23725
222d58586999 indent `with-output-to-string' as a CL
Karl Heuer <kwzh@gnu.org>
parents: 22913
diff changeset
560 (with-output-to-string (4 2))
30651
61c2f9fcb8f6 * emacs-lisp/cl-indent.el (toplevel): Indent `defclass',
Sam Steingold <sds@gnu.org>
parents: 29797
diff changeset
561 (with-slots . multiple-value-bind)
22180
485917486caf Indent `with-standard-io-syntax' correctly.
Richard M. Stallman <rms@gnu.org>
parents: 21750
diff changeset
562 (with-standard-io-syntax (2)))))
40952
2ca1b56f3bb1 Indent properly `generic-flet', `generic-labels', `with-accessors',
Sam Steingold <sds@gnu.org>
parents: 38826
diff changeset
563 (dolist (el l)
2ca1b56f3bb1 Indent properly `generic-flet', `generic-labels', `with-accessors',
Sam Steingold <sds@gnu.org>
parents: 38826
diff changeset
564 (put (car el) 'common-lisp-indent-function
2ca1b56f3bb1 Indent properly `generic-flet', `generic-labels', `with-accessors',
Sam Steingold <sds@gnu.org>
parents: 38826
diff changeset
565 (if (symbolp (cdr el))
2ca1b56f3bb1 Indent properly `generic-flet', `generic-labels', `with-accessors',
Sam Steingold <sds@gnu.org>
parents: 38826
diff changeset
566 (get (cdr el) 'common-lisp-indent-function)
2ca1b56f3bb1 Indent properly `generic-flet', `generic-labels', `with-accessors',
Sam Steingold <sds@gnu.org>
parents: 38826
diff changeset
567 (car (cdr el))))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
568
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
569
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
570 ;(defun foo (x)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
571 ; (tagbody
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
572 ; foo
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
573 ; (bar)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
574 ; baz
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
575 ; (when (losing)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
576 ; (with-big-loser
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
577 ; (yow)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
578 ; ((lambda ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
579 ; foo)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
580 ; big)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
581 ; (flet ((foo (bar baz zap)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
582 ; (zip))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
583 ; (zot ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
584 ; quux))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
585 ; (do ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
586 ; ((lose)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
587 ; (foo 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
588 ; (quux)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
589 ; foo
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
590 ; (lose))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
591 ; (cond ((x)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
592 ; (win 1 2
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
593 ; (foo)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
594 ; (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
595 ; (lose
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
596 ; 3))))))
29797
3bf98b923af0 handle print-unreadable-object
Sam Steingold <sds@gnu.org>
parents: 27872
diff changeset
597
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
598
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
599 ;(put 'while 'common-lisp-indent-function 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
600 ;(put 'defwrapper'common-lisp-indent-function ...)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
601 ;(put 'def 'common-lisp-indent-function ...)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
602 ;(put 'defflavor 'common-lisp-indent-function ...)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
603 ;(put 'defsubst 'common-lisp-indent-function ...)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
604
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
605 ;(put 'with-restart 'common-lisp-indent-function '((1 4 ((* 1))) (2 &body)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
606 ;(put 'restart-case 'common-lisp-indent-function '((1 4) (* 2 ((0 1) (* 1)))))
34187
e2fb02d21aee Remove erroneous spec for condition-case.
Dave Love <fx@gnu.org>
parents: 30651
diff changeset
607 ;(put 'define-condition 'common-lisp-indent-function '((1 6) (2 6 ((&whole 1))) (3 4 ((&whole 1))) (4 &body)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
608 ;(put 'with-condition-handler 'common-lisp-indent-function '((1 4 ((* 1))) (2 &body)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
609 ;(put 'condition-case 'common-lisp-indent-function '((1 4) (* 2 ((0 1) (1 3) (2 &body)))))
34187
e2fb02d21aee Remove erroneous spec for condition-case.
Dave Love <fx@gnu.org>
parents: 30651
diff changeset
610 ;(put 'defclass 'common-lisp-indent-function '((&whole 2 &rest (&whole 2 &rest 1) &rest (&whole 2 &rest 1)))
e2fb02d21aee Remove erroneous spec for condition-case.
Dave Love <fx@gnu.org>
parents: 30651
diff changeset
611 ;(put 'defgeneric 'common-lisp-indent-function 'defun)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
612
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 50700
diff changeset
613 ;;; arch-tag: 7914d50f-92ec-4476-93fc-0f043a380e03
662
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 257
diff changeset
614 ;;; cl-indent.el ends here