PageRenderTime 1864ms CodeModel.GetById 184ms app.highlight 746ms RepoModel.GetById 77ms app.codeStats 13ms

/demos/paredit20-paredit22.html

http://github.com/yinwang0/ydiff
HTML | 4349 lines | 4174 code | 175 blank | 0 comment | 0 complexity | d6a9659e22027ebee2791801859a1238 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1<html>
  2<head>
  3<META http-equiv="Content-Type" content="text/html; charset=utf-8">
  4<LINK href="diff-s.css" rel="stylesheet" type="text/css">
  5<script type="text/javascript" src="nav-div.js"></script>
  6</head>
  7<body>
  8<div id="left" class="src">
  9<pre>
 10<a id='leftstart' tid='rightstart'></a>
 11<span class='d'>;;; -*- Mode: Emacs-Lisp; outline-regexp: &quot;\n;;;;+&quot; -*-
 12</span>
 13<span class='d'>;;;;;; Paredit: Parenthesis-Editing Minor Mode
 14</span><span class='d'>;;;;;; Version 20
 15</span>
 16<span class='d'>;;; This code is written by Taylor R. Campbell (except where explicitly
 17</span><span class='d'>;;; noted) and placed in the Public Domain.  All warranties are
 18</span><span class='d'>;;; disclaimed.
 19</span>
 20<span class='d'>;;; Add this to your .emacs after adding paredit.el to /path/to/elisp/:
 21</span><span class='d'>;;;
 22</span><span class='d'>;;;   (add-to-list &#39;load-path &quot;/path/to/elisp/&quot;)
 23</span><span class='d'>;;;   (autoload &#39;paredit-mode &quot;paredit&quot;
 24</span><span class='d'>;;;     &quot;Minor mode for pseudo-structurally editing Lisp code.&quot;
 25</span><span class='d'>;;;     t)
 26</span><span class='d'>;;;   (add-hook &#39;...-mode-hook (lambda () (paredit-mode +1)))
 27</span><span class='d'>;;;
 28</span><span class='d'>;;; Usually the ... will be lisp or scheme or both.  Alternatively, you
 29</span><span class='d'>;;; can manually toggle this mode with M-x paredit-mode.  Customization
 30</span><span class='d'>;;; of paredit can be accomplished with `eval-after-load&#39;:
 31</span><span class='d'>;;;
 32</span><span class='d'>;;;   (eval-after-load &#39;paredit
 33</span><span class='d'>;;;     &#39;(progn ...redefine keys, &c....))
 34</span><a id='4627' tid='4628' class='u'>;;;
 35</a><span class='d'>;;; This should run in GNU Emacs 21 or later and XEmacs 21.5 or later.
 36</span><span class='d'>;;; It is highly unlikely to work in earlier versions of GNU Emacs, and
 37</span><span class='d'>;;; it may have obscure problems in earlier versions of XEmacs due to
 38</span><span class='d'>;;; the way its syntax parser reports conditions, as a result of which
 39</span><span class='d'>;;; the code that uses the syntax parser must mask *all* error
 40</span><span class='d'>;;; conditions, not just those generated by the syntax parser.
 41</span>
 42<span class='d'>;;; This mode changes the keybindings for a number of simple keys,
 43</span><span class='d'>;;; notably (, ), &quot;, \, and ;.  The bracket keys (round or square) are
 44</span><span class='d'>;;; defined to insert parenthesis pairs and move past the close,
 45</span><span class='d'>;;; respectively; the double-quote key is multiplexed to do both, and
 46</span><span class='d'>;;; also insert an escape if within a string; backslashes prompt the
 47</span><span class='d'>;;; user for the next character to input, because a lone backslash can
 48</span><span class='d'>;;; break structure inadvertently; and semicolons ensure that they do
 49</span><span class='d'>;;; not accidentally comment valid structure.  (Use M-; to comment an
 50</span><span class='d'>;;; expression.)  These all have their ordinary behaviour when inside
 51</span><span class='d'>;;; comments, and, outside comments, if truly necessary, you can insert
 52</span><span class='d'>;;; them literally with C-q.
 53</span><span class='d'>;;;
 54</span><span class='d'>;;; These keybindings are set up for my preference.  One particular
 55</span><span class='d'>;;; preference which I&#39;ve seen vary greatly from person to person is
 56</span><span class='d'>;;; whether the command to move past a closing delimiter ought to
 57</span><span class='d'>;;; insert a newline.  Since I find this behaviour to be more common
 58</span><span class='d'>;;; than that which inserts no newline, I have ) bound to it, and the
 59</span><span class='d'>;;; more involved M-) to perform the less common action.  This bothers
 60</span><span class='d'>;;; some users, though, and they prefer the other way around.  This
 61</span><span class='d'>;;; code, which you can use `eval-after-load&#39; to put in your .emacs,
 62</span><span class='d'>;;; will exchange the bindings:
 63</span><span class='d'>;;;
 64</span><span class='d'>;;;   (define-key paredit-mode-map (kbd &quot;)&quot;)
 65</span><span class='d'>;;;     &#39;paredit-close-parenthesis)
 66</span><span class='d'>;;;   (define-key paredit-mode-map (kbd &quot;M-)&quot;)
 67</span><span class='d'>;;;     &#39;paredit-close-parenthesis-and-newline)
 68</span><a id='4629' tid='4630' class='u'>;;;
 69</a><span class='d'>;;; Paredit also changes the bindings of keys for deleting and killing,
 70</span><span class='d'>;;; so that they will not destroy any S-expression structure by killing
 71</span><span class='d'>;;; or deleting only one side of a bracket or quote pair.  If the point
 72</span><span class='d'>;;; is on a closing bracket, DEL will move left over it; if it is on an
 73</span><span class='d'>;;; opening bracket, C-d will move right over it.  Only if the point is
 74</span><span class='d'>;;; between a pair of brackets will C-d or DEL delete them, and in that
 75</span><span class='d'>;;; case it will delete both simultaneously.  M-d and M-DEL kill words,
 76</span><span class='d'>;;; but skip over any S-expression structure.  C-k kills from the start
 77</span><span class='d'>;;; of the line, either to the line&#39;s end, if it contains only balanced
 78</span><span class='d'>;;; expressions; to the first closing bracket, if the point is within a
 79</span><span class='d'>;;; form that ends on the line; or up to the end of the last expression
 80</span><span class='d'>;;; that starts on the line after the point.
 81</span><a id='4631' tid='4632' class='u'>;;;
 82</a><span class='d'>;;; Automatic reindentation is performed as locally as possible, to
 83</span><span class='d'>;;; ensure that Emacs does not interfere with custom indentation used
 84</span><span class='d'>;;; elsewhere in some S-expression.  It is performed only by the
 85</span><span class='d'>;;; advanced S-expression frobnication commands, and only on the forms
 86</span><span class='d'>;;; that were immediately operated upon (& their subforms).
 87</span><a id='4633' tid='4634' class='u'>;;;
 88</a><span class='d'>;;; This code is written for clarity, not efficiency.  S-expressions
 89</span><span class='d'>;;; are frequently walked over redundantly.  If you have problems with
 90</span><span class='d'>;;; some of the commands taking too long to execute, tell me, but first
 91</span><span class='d'>;;; make sure that what you&#39;re doing is reasonable: it is stylistically
 92</span><span class='d'>;;; bad to have huge, long, hideously nested code anyway.
 93</span><span class='d'>;;;
 94</span><span class='d'>;;; Questions, bug reports, comments, feature suggestions, &c., can be
 95</span><span class='d'>;;; addressed to the author via mail on the host mumble.net to campbell
 96</span><span class='d'>;;; or via IRC on irc.freenode.net in the #paredit channel under the
 97</span><span class='d'>;;; nickname Riastradh.
 98</span>
 99<span class='d'>;;; This assumes Unix-style LF line endings.
100</span>
101<span class='d'>(defconst paredit-version 20)</span>
102
103(<a id='667' tid='668' class='m'>eval-and-compile</a>
104
105  (<a id='653' tid='654' class='m'>defun</a> <a id='655' tid='656' class='m'>paredit-xemacs-p</a> ()
106    <span class='d'>;; No idea I got this definition from.  Edward O&#39;Connor (hober on
107</span>    <span class='d'>;; IRC) suggested the current definition.
108</span>    <a id='657' tid='658' class='m'>;;   (and (boundp &#39;running-xemacs)
109</a>    <a id='659' tid='660' class='m'>;;        running-xemacs)
110</a>    (<a id='661' tid='662' class='m'>featurep</a> <a id='663' tid='664' class='m'>&#39;</a><a id='665' tid='666' class='m'>xemacs</a>))
111
112  (<a id='613' tid='614' class='m'>defun</a> <a id='615' tid='616' class='m'>paredit-gnu-emacs-p</a> ()
113    (<a id='617' tid='618' class='m'>not</a> (<a id='619' tid='620' class='m'>paredit-xemacs-p</a>)))
114
115  (<a id='669' tid='670' class='m'>defmacro</a> <a id='671' tid='672' class='m'>xcond</a> (<a id='673' tid='674' class='m'>&rest</a> <a id='675' tid='676' class='m'>clauses</a>)
116    <a id='677' tid='678' class='m'>&quot;Exhaustive COND.
117Signal an error if no clause matches.&quot;</a>
118    <a id='679' tid='680' class='m'>`</a>(<a id='681' tid='682' class='m'>cond</a> <a id='683' tid='684' class='m'>,</a><a id='685' tid='686' class='m'>@clauses</a>
119           (<a id='687' tid='688' class='m'>t</a> (<a id='689' tid='690' class='m'>error</a> <a id='691' tid='692' class='m'>&quot;XCOND lost.&quot;</a>))))
120
121  (<a id='693' tid='694' class='m'>defalias</a> <a id='695' tid='696' class='m'>&#39;</a><a id='697' tid='698' class='m'>paredit-warn</a> (<a id='699' tid='700' class='m'>if</a> (<a id='701' tid='702' class='m'>fboundp</a> <a id='703' tid='704' class='m'>&#39;</a><a id='705' tid='706' class='m'>warn</a>) <a id='707' tid='708' class='m'>&#39;</a><a id='709' tid='710' class='m'>warn</a> <a id='711' tid='712' class='m'>&#39;</a><a id='713' tid='714' class='m'>message</a>))
122
123  (<a id='621' tid='622' class='m'>defvar</a> <a id='623' tid='624' class='m'>paredit-sexp-error-type</a>
124    (<a id='625' tid='626' class='m'>with-temp-buffer</a>
125      (<a id='627' tid='628' class='m'>insert</a> <a id='629' tid='630' class='m'>&quot;(&quot;</a>)
126      (<a id='631' tid='632' class='m'>condition-case</a> <a id='633' tid='634' class='m'>condition</a>
127          (<a id='635' tid='636' class='m'>backward-sexp</a>)
128        (<a id='637' tid='638' class='m'>error</a> (<span class='d'>if</span> (<a id='639' tid='640' class='m'>eq</a> (<a id='641' tid='642' class='m'>car</a> <a id='643' tid='644' class='m'>condition</a>) <a id='645' tid='646' class='m'>&#39;</a><a id='647' tid='648' class='m'>error</a>)
129                   <span class='d'>(paredit-warn &quot;%s%s%s%s&quot;
130                                 &quot;Paredit is unable to discriminate&quot;
131                                 &quot; S-expression parse errors from&quot;
132                                 &quot; other errors. &quot;
133                                 &quot; This may cause obscure problems. &quot;
134                                 &quot; Please upgrade Emacs.&quot;)</span>)
135               (<a id='649' tid='650' class='m'>car</a> <a id='651' tid='652' class='m'>condition</a>)))))
136
137  (<a id='715' tid='716' class='m'>defmacro</a> <a id='717' tid='718' class='m'>paredit-handle-sexp-errors</a> (<a id='719' tid='720' class='m'>body</a> <a id='721' tid='722' class='m'>&rest</a> <a id='723' tid='724' class='m'>handler</a>)
138    <a id='725' tid='726' class='m'>`</a>(<a id='727' tid='728' class='m'>condition-case</a> ()
139         <a id='729' tid='730' class='m'>,</a><a id='731' tid='732' class='m'>body</a>
140       (<a id='733' tid='734' class='m'>,</a><a id='735' tid='736' class='m'>paredit-sexp-error-type</a> <a id='737' tid='738' class='m'>,</a><a id='739' tid='740' class='m'>@handler</a>)))
141
142  (<a id='741' tid='742' class='m'>put</a> <a id='743' tid='744' class='m'>&#39;</a><a id='745' tid='746' class='m'>paredit-handle-sexp-errors</a> <a id='747' tid='748' class='m'>&#39;</a><a id='749' tid='750' class='m'>lisp-indent-function</a> <a id='751' tid='752' class='m'>1</a>)
143
144  (<a id='753' tid='754' class='m'>defmacro</a> <a id='755' tid='756' class='m'>paredit-ignore-sexp-errors</a> (<a id='757' tid='758' class='m'>&rest</a> <a id='759' tid='760' class='m'>body</a>)
145    <a id='761' tid='762' class='m'>`</a>(<a id='763' tid='764' class='m'>paredit-handle-sexp-errors</a> (<a id='765' tid='766' class='m'>progn</a> <a id='767' tid='768' class='m'>,</a><a id='769' tid='770' class='m'>@body</a>)
146       <a id='771' tid='772' class='m'>nil</a>))
147
148  (<a id='773' tid='774' class='m'>put</a> <a id='775' tid='776' class='m'>&#39;</a><a id='777' tid='778' class='m'>paredit-ignore-sexp-errors</a> <a id='779' tid='780' class='m'>&#39;</a><a id='781' tid='782' class='m'>lisp-indent-function</a> <a id='783' tid='784' class='m'>0</a>)
149
150  <a id='785' tid='786' class='m'>nil</a>)
151
152<span class='d'>;;;; Minor Mode Definition
153</span>
154(<a id='4189' tid='4190' class='u'>defvar</a> <a id='4191' tid='4192' class='u'>paredit-mode-map</a> (<a id='4193' tid='4194' class='u'>make-sparse-keymap</a>)
155  <a id='4195' tid='4196' class='u'>&quot;Keymap for the paredit minor mode.&quot;</a>)
156
157(<a id='4119' tid='4120' class='u'>define-minor-mode</a> <a id='4121' tid='4122' class='u'>paredit-mode</a>
158  <span class='d'>&quot;Minor mode for pseudo-structurally editing Lisp code.
159\\&lt;paredit-mode-map&gt;&quot;</span>
160  <a id='4123' tid='4124' class='u'>:lighter</a> <a id='4125' tid='4126' class='u'>&quot; Paredit&quot;</a>
161  <a id='4127' tid='4128' class='u'>;; If we&#39;re enabling paredit-mode, the prefix to this code that
162</a>  <a id='4129' tid='4130' class='u'>;; DEFINE-MINOR-MODE inserts will have already set PAREDIT-MODE to
163</a>  <a id='4131' tid='4132' class='u'>;; true.  If this is the case, then first check the parentheses, and
164</a>  <a id='4133' tid='4134' class='u'>;; if there are any imbalanced ones we must inhibit the activation of
165</a>  <a id='4135' tid='4136' class='u'>;; paredit mode.  We skip the check, though, if the user supplied a
166</a>  <a id='4137' tid='4138' class='u'>;; prefix argument interactively.
167</a>  (<a id='4139' tid='4140' class='u'>if</a> (<a id='4141' tid='4142' class='u'>and</a> <a id='4143' tid='4144' class='u'>paredit-mode</a>
168           (<a id='4145' tid='4146' class='u'>not</a> <a id='4147' tid='4148' class='u'>current-prefix-arg</a>))
169      (<a id='4149' tid='4150' class='u'>if</a> (<a id='4151' tid='4152' class='u'>not</a> (<a id='4153' tid='4154' class='u'>fboundp</a> <a id='4155' tid='4156' class='u'>&#39;</a><a id='4157' tid='4158' class='u'>check-parens</a>))
170          (<a id='4159' tid='4160' class='u'>paredit-warn</a> <a id='4161' tid='4162' class='u'>&quot;`check-parens&#39; is not defined; %s&quot;</a>
171                        <a id='4163' tid='4164' class='u'>&quot;be careful of malformed S-expressions.&quot;</a>)
172          (<a id='4165' tid='4166' class='u'>condition-case</a> <a id='4167' tid='4168' class='u'>condition</a>
173              (<a id='4169' tid='4170' class='u'>check-parens</a>)
174            (<a id='4171' tid='4172' class='u'>error</a> (<a id='4173' tid='4174' class='u'>setq</a> <a id='4175' tid='4176' class='u'>paredit-mode</a> <a id='4177' tid='4178' class='u'>nil</a>)
175                   (<a id='4179' tid='4180' class='u'>signal</a> (<a id='4181' tid='4182' class='u'>car</a> <a id='4183' tid='4184' class='u'>condition</a>) (<a id='4185' tid='4186' class='u'>cdr</a> <a id='4187' tid='4188' class='u'>condition</a>)))))))
176
177<span class='d'>;;; Old functions from when there was a different mode for emacs -nw.
178</span>
179(<a id='1527' tid='1528' class='u'>defun</a> <a id='1529' tid='1530' class='u'>enable-paredit-mode</a> ()
180  <span class='d'>&quot;Turn on pseudo-structural editing of Lisp code.
181
182Deprecated: use `paredit-mode&#39; instead.&quot;</span>
183  (<a id='1531' tid='1532' class='u'>interactive</a>)
184  (<a id='1533' tid='1534' class='u'>paredit-mode</a> <a id='1535' tid='1536' class='u'>+1</a>))
185
186(<a id='1517' tid='1518' class='u'>defun</a> <a id='1519' tid='1520' class='u'>disable-paredit-mode</a> ()
187  <span class='d'>&quot;Turn off pseudo-structural editing of Lisp code.
188
189Deprecated: use `paredit-mode&#39; instead.&quot;</span>
190  (<a id='1521' tid='1522' class='u'>interactive</a>)
191  (<a id='1523' tid='1524' class='u'>paredit-mode</a> <a id='1525' tid='1526' class='u'>-1</a>))
192
193(<a id='1957' tid='1958' class='u'>defvar</a> <a id='1959' tid='1960' class='u'>paredit-backward-delete-key</a>
194  (<a id='1961' tid='1962' class='u'>xcond</a> ((<a id='1963' tid='1964' class='u'>paredit-xemacs-p</a>)    <a id='1965' tid='1966' class='u'>&quot;BS&quot;</a>)
195         ((<a id='1967' tid='1968' class='u'>paredit-gnu-emacs-p</a>) <a id='1969' tid='1970' class='u'>&quot;DEL&quot;</a>)))
196
197(<a id='2595' tid='2596' class='u'>defvar</a> <a id='2597' tid='2598' class='u'>paredit-forward-delete-keys</a>
198  (<a id='2599' tid='2600' class='u'>xcond</a> ((<a id='2601' tid='2602' class='u'>paredit-xemacs-p</a>)    <a id='2603' tid='2604' class='u'>&#39;</a>(<a id='2605' tid='2606' class='u'>&quot;DEL&quot;</a>))
199         ((<a id='2607' tid='2608' class='u'>paredit-gnu-emacs-p</a>) <a id='2609' tid='2610' class='u'>&#39;</a>(<a id='2611' tid='2612' class='u'>&quot;&lt;delete&gt;&quot;</a> <a id='2613' tid='2614' class='u'>&quot;&lt;deletechar&gt;&quot;</a>))))
200
201<span class='d'>;;;; Paredit Keys
202</span>
203<span class='d'>;;; Separating the definition and initialization of this variable
204</span><span class='d'>;;; simplifies the development of paredit, since re-evaluating DEFVAR
205</span><span class='d'>;;; forms doesn&#39;t actually do anything.
206</span>
207(<a id='2199' tid='2200' class='u'>defvar</a> <a id='2201' tid='2202' class='u'>paredit-commands</a> <a id='2203' tid='2204' class='u'>nil</a>
208  <a id='2205' tid='2206' class='u'>&quot;List of paredit commands with their keys and examples.&quot;</a>)
209
210<span class='d'>;;; Each specifier is of the form:
211</span><span class='d'>;;;   (key[s] function (example-input example-output) ...)
212</span><span class='d'>;;; where key[s] is either a single string suitable for passing to KBD
213</span><span class='d'>;;; or a list of such strings.  Entries in this list may also just be
214</span><span class='d'>;;; strings, in which case they are headings for the next entries.
215</span>
216(<a id='787' tid='788' class='m'>progn</a> (<a id='789' tid='790' class='m'>setq</a> <a id='791' tid='792' class='m'>paredit-commands</a>
217 <a id='793' tid='794' class='m'>`</a>(
218   <span class='d'>&quot;Basic Insertion Commands&quot;</span>
219   <span class='d'>(&quot;(&quot;         paredit-open-parenthesis
220                (&quot;(a b |c d)&quot;
221                 &quot;(a b (|) c d)&quot;)
222                (&quot;(foo \&quot;bar |baz\&quot; quux)&quot;
223                 &quot;(foo \&quot;bar (|baz\&quot; quux)&quot;))</span>
224   <span class='d'>(&quot;)&quot;         paredit-close-parenthesis-and-newline
225                (&quot;(defun f (x|  ))&quot;
226                 &quot;(defun f (x)\n  |)&quot;)
227                (&quot;; (Foo.|&quot;
228                 &quot;; (Foo.)|&quot;))</span>
229   <span class='d'>(&quot;M-)&quot;       paredit-close-parenthesis
230                (&quot;(a b |c   )&quot; &quot;(a b c)|&quot;)
231                (&quot;; Hello,| world!&quot;
232                 &quot;; Hello,)| world!&quot;))</span>
233   <span class='d'>(&quot;[&quot;         paredit-open-bracket
234                (&quot;(a b |c d)&quot;
235                 &quot;(a b [|] c d)&quot;)
236                (&quot;(foo \&quot;bar |baz\&quot; quux)&quot;
237                 &quot;(foo \&quot;bar [baz\&quot; quux)&quot;))</span>
238   <span class='d'>(&quot;]&quot;         paredit-close-bracket
239                (&quot;(define-key keymap [frob|  ] &#39;frobnicate)&quot;
240                 &quot;(define-key keymap [frob]| &#39;frobnicate)&quot;)
241                (&quot;; [Bar.|&quot;
242                 &quot;; [Bar.]|&quot;))</span>
243   (<a id='795' tid='796' class='m'>&quot;\&quot;&quot;</a>        <a id='797' tid='798' class='m'>paredit-doublequote</a>
244                (<a id='799' tid='800' class='m'>&quot;(frob grovel |full lexical)&quot;</a>
245                 <a id='801' tid='802' class='m'>&quot;(frob grovel \&quot;|\&quot; full lexical)&quot;</a>)
246                (<a id='803' tid='804' class='m'>&quot;(foo \&quot;bar |baz\&quot; quux)&quot;</a>
247                 <a id='805' tid='806' class='m'>&quot;(foo \&quot;bar \\\&quot;|baz\&quot; quux)&quot;</a>))
248   (<a id='495' tid='496' class='m'>&quot;M-\&quot;&quot;</a>      <a id='497' tid='498' class='m'>paredit-meta-doublequote</a>
249                (<a id='499' tid='500' class='m'>&quot;(foo \&quot;bar |baz\&quot; quux)&quot;</a>
250                 <a id='501' tid='502' class='m'>&quot;(foo \&quot;bar baz\&quot;\n     |quux)&quot;</a>)
251                (<a id='503' tid='504' class='m'>&quot;(foo |(bar #\\x \&quot;baz \\\\ quux\&quot;) zot)&quot;</a>
252                 <a id='505' tid='506' class='m'>,</a>(<a id='507' tid='508' class='m'>concat</a> <a id='509' tid='510' class='m'>&quot;(foo \&quot;|(bar #\\\\x \\\&quot;baz \\\\&quot;</a>
253                          <a id='511' tid='512' class='m'>&quot;\\\\ quux\\\&quot;)\&quot; zot)&quot;</a>)))
254   (<a id='393' tid='394' class='m'>&quot;\\&quot;</a>        <a id='395' tid='396' class='m'>paredit-backslash</a>
255                (<a id='397' tid='398' class='m'>&quot;(string #|)\n  ; Escaping character... (x)&quot;</a>
256                 <a id='399' tid='400' class='m'>&quot;(string #\\x|)&quot;</a>)
257                (<a id='401' tid='402' class='m'>&quot;\&quot;foo|bar\&quot;\n  ; Escaping character... (\&quot;)&quot;</a>
258                 <a id='403' tid='404' class='m'>&quot;\&quot;foo\\\&quot;|bar\&quot;&quot;</a>))
259   <span class='d'>(&quot;;&quot;         paredit-semicolon
260                (&quot;|(frob grovel)&quot;
261                 &quot;;|\n(frob grovel)&quot;)
262                (&quot;(frob grovel)    |&quot;
263                 &quot;(frob grovel)    ;|&quot;))</span>
264   (<a id='305' tid='306' class='m'>&quot;M-;&quot;</a>       <a id='307' tid='308' class='m'>paredit-comment-dwim</a>
265                (<a id='309' tid='310' class='m'>&quot;(foo |bar)   ; baz&quot;</a>
266                 <a id='311' tid='312' class='m'>&quot;(foo bar)                               ; |baz&quot;</a>)
267                (<a id='313' tid='314' class='m'>&quot;(frob grovel)|&quot;</a>
268                 <a id='315' tid='316' class='m'>&quot;(frob grovel)                           ;|&quot;</a>)
269                (<a id='317' tid='318' class='m'>&quot;    (foo bar)\n|\n    (baz quux)&quot;</a>
270                 <a id='319' tid='320' class='m'>&quot;    (foo bar)\n    ;; |\n    (baz quux)&quot;</a>)
271                (<a id='321' tid='322' class='m'>&quot;    (foo bar) |(baz quux)&quot;</a>
272                 <a id='323' tid='324' class='m'>&quot;    (foo bar)\n    ;; |\n    (baz quux)&quot;</a>)
273                (<a id='325' tid='326' class='m'>&quot;|(defun hello-world ...)&quot;</a>
274                 <a id='327' tid='328' class='m'>&quot;;;; |\n(defun hello-world ...)&quot;</a>))
275
276   (<a id='261' tid='262' class='m'>&quot;C-j&quot;</a>       <a id='263' tid='264' class='m'>paredit-newline</a>
277                (<a id='265' tid='266' class='m'>&quot;(let ((n (frobbotz))) |(display (+ n 1)\nport))&quot;</a>
278                 <a id='267' tid='268' class='m'>,</a>(<a id='269' tid='270' class='m'>concat</a> <a id='271' tid='272' class='m'>&quot;(let ((n (frobbotz)))&quot;</a>
279                          <a id='273' tid='274' class='m'>&quot;\n  |(display (+ n 1)&quot;</a>
280                          <a id='275' tid='276' class='m'>&quot;\n            port))&quot;</a>)))
281
282   <span class='d'>&quot;Deleting & Killing&quot;</span>
283   ((<a id='217' tid='218' class='m'>&quot;C-d&quot;</a> <a id='219' tid='220' class='m'>,</a><a id='221' tid='222' class='m'>@paredit-forward-delete-keys</a>)
284                <a id='223' tid='224' class='m'>paredit-forward-delete</a>
285                (<a id='225' tid='226' class='m'>&quot;(quu|x \&quot;zot\&quot;)&quot;</a> <a id='227' tid='228' class='m'>&quot;(quu| \&quot;zot\&quot;)&quot;</a>)
286                (<a id='229' tid='230' class='m'>&quot;(quux |\&quot;zot\&quot;)&quot;</a>
287                 <a id='231' tid='232' class='m'>&quot;(quux \&quot;|zot\&quot;)&quot;</a>
288                 <a id='233' tid='234' class='m'>&quot;(quux \&quot;|ot\&quot;)&quot;</a>)
289                (<a id='235' tid='236' class='m'>&quot;(foo (|) bar)&quot;</a> <a id='237' tid='238' class='m'>&quot;(foo | bar)&quot;</a>)
290                (<a id='239' tid='240' class='m'>&quot;|(foo bar)&quot;</a> <a id='241' tid='242' class='m'>&quot;(|foo bar)&quot;</a>))
291   (<a id='193' tid='194' class='m'>,</a><a id='195' tid='196' class='m'>paredit-backward-delete-key</a>
292                <a id='197' tid='198' class='m'>paredit-backward-delete</a>
293                (<a id='199' tid='200' class='m'>&quot;(\&quot;zot\&quot; q|uux)&quot;</a> <a id='201' tid='202' class='m'>&quot;(\&quot;zot\&quot; |uux)&quot;</a>)
294                (<a id='203' tid='204' class='m'>&quot;(\&quot;zot\&quot;| quux)&quot;</a>
295                 <a id='205' tid='206' class='m'>&quot;(\&quot;zot|\&quot; quux)&quot;</a>
296                 <a id='207' tid='208' class='m'>&quot;(\&quot;zo|\&quot; quux)&quot;</a>)
297                (<a id='209' tid='210' class='m'>&quot;(foo (|) bar)&quot;</a> <a id='211' tid='212' class='m'>&quot;(foo | bar)&quot;</a>)
298                (<a id='213' tid='214' class='m'>&quot;(foo bar)|&quot;</a> <a id='215' tid='216' class='m'>&quot;(foo bar|)&quot;</a>))
299   (<a id='173' tid='174' class='m'>&quot;C-k&quot;</a>       <a id='175' tid='176' class='m'>paredit-kill</a>
300                (<a id='177' tid='178' class='m'>&quot;(foo bar)|     ; Useless comment!&quot;</a>
301                 <a id='179' tid='180' class='m'>&quot;(foo bar)|&quot;</a>)
302                (<a id='181' tid='182' class='m'>&quot;(|foo bar)     ; Useful comment!&quot;</a>
303                 <a id='183' tid='184' class='m'>&quot;(|)     ; Useful comment!&quot;</a>)
304                (<a id='185' tid='186' class='m'>&quot;|(foo bar)     ; Useless line!&quot;</a>
305                 <a id='187' tid='188' class='m'>&quot;|&quot;</a>)
306                (<a id='189' tid='190' class='m'>&quot;(foo \&quot;|bar baz\&quot;\n     quux)&quot;</a>
307                 <a id='191' tid='192' class='m'>&quot;(foo \&quot;|\&quot;\n     quux)&quot;</a>))
308   (<a id='155' tid='156' class='m'>&quot;M-d&quot;</a>       <a id='157' tid='158' class='m'>paredit-forward-kill-word</a>
309                (<a id='159' tid='160' class='m'>&quot;|(foo bar)    ; baz&quot;</a>
310                 <a id='161' tid='162' class='m'>&quot;(| bar)    ; baz&quot;</a>
311                 <a id='163' tid='164' class='m'>&quot;(|)    ; baz&quot;</a>
312                 <a id='165' tid='166' class='m'>&quot;()    ;|&quot;</a>)
313                (<a id='167' tid='168' class='m'>&quot;;;;| Frobnicate\n(defun frobnicate ...)&quot;</a>
314                 <a id='169' tid='170' class='m'>&quot;;;;|\n(defun frobnicate ...)&quot;</a>
315                 <a id='171' tid='172' class='m'>&quot;;;;\n(| frobnicate ...)&quot;</a>))
316   (<a id='135' tid='136' class='m'>,</a>(<a id='137' tid='138' class='m'>concat</a> <a id='139' tid='140' class='m'>&quot;M-&quot;</a> <a id='141' tid='142' class='m'>paredit-backward-delete-key</a>)
317                <a id='143' tid='144' class='m'>paredit-backward-kill-word</a>
318                (<a id='145' tid='146' class='m'>&quot;(foo bar)    ; baz\n(quux)|&quot;</a>
319                 <a id='147' tid='148' class='m'>&quot;(foo bar)    ; baz\n(|)&quot;</a>
320                 <a id='149' tid='150' class='m'>&quot;(foo bar)    ; |\n()&quot;</a>
321                 <a id='151' tid='152' class='m'>&quot;(foo |)    ; \n()&quot;</a>
322                 <a id='153' tid='154' class='m'>&quot;(|)    ; \n()&quot;</a>))
323
324   <span class='d'>&quot;Movement & Navigation&quot;</span>
325   (<a id='123' tid='124' class='m'>&quot;C-M-f&quot;</a>     <a id='125' tid='126' class='m'>paredit-forward</a>
326                (<a id='127' tid='128' class='m'>&quot;(foo |(bar baz) quux)&quot;</a>
327                 <a id='129' tid='130' class='m'>&quot;(foo (bar baz)| quux)&quot;</a>)
328                (<a id='131' tid='132' class='m'>&quot;(foo (bar)|)&quot;</a>
329                 <a id='133' tid='134' class='m'>&quot;(foo (bar))|&quot;</a>))
330   (<a id='111' tid='112' class='m'>&quot;C-M-b&quot;</a>     <a id='113' tid='114' class='m'>paredit-backward</a>
331                (<a id='115' tid='116' class='m'>&quot;(foo (bar baz)| quux)&quot;</a>
332                 <a id='117' tid='118' class='m'>&quot;(foo |(bar baz) quux)&quot;</a>)
333                (<a id='119' tid='120' class='m'>&quot;(|(foo) bar)&quot;</a>
334                 <a id='121' tid='122' class='m'>&quot;|((foo) bar)&quot;</a>))
335<span class='d'>;;;(&quot;C-M-u&quot;     backward-up-list)       ; These two are built-in.
336</span><span class='d'>;;;(&quot;C-M-d&quot;     down-list)
337</span>   <span class='d'>(&quot;C-M-p&quot;     backward-down-list)</span>     <span class='d'>; Built-in, these are FORWARD-
338</span>   <span class='d'>(&quot;C-M-n&quot;     up-list)</span>                <span class='d'>; & BACKWARD-LIST, which have
339</span>                                        <span class='d'>; no need given C-M-f & C-M-b.
340</span>
341   <span class='d'>&quot;Depth-Changing Commands&quot;</span>
342   <span class='d'>(&quot;M-(&quot;       paredit-wrap-sexp
343                (&quot;(foo |bar baz)&quot;
344                 &quot;(foo (|bar) baz)&quot;))</span>
345   <span class='d'>(&quot;M-s&quot;       paredit-splice-sexp
346                (&quot;(foo (bar| baz) quux)&quot;
347                 &quot;(foo bar| baz quux)&quot;))</span>
348   ((<a id='101' tid='102' class='m'>&quot;M-&lt;up&gt;&quot;</a> <a id='103' tid='104' class='m'>&quot;ESC &lt;up&gt;&quot;</a>)
349                <a id='105' tid='106' class='m'>paredit-splice-sexp-killing-backward</a>
350                (<a id='107' tid='108' class='m'>&quot;(foo (let ((x 5)) |(sqrt n)) bar)&quot;</a>
351                 <a id='109' tid='110' class='m'>&quot;(foo (sqrt n) bar)&quot;</a>))
352   ((<a id='91' tid='92' class='m'>&quot;M-&lt;down&gt;&quot;</a> <a id='93' tid='94' class='m'>&quot;ESC &lt;down&gt;&quot;</a>)
353                <a id='95' tid='96' class='m'>paredit-splice-sexp-killing-forward</a>
354                (<a id='97' tid='98' class='m'>&quot;(a (b c| d e) f)&quot;</a>
355                 <a id='99' tid='100' class='m'>&quot;(a b c f)&quot;</a>))
356   (<a id='81' tid='82' class='m'>&quot;M-r&quot;</a>       <a id='83' tid='84' class='m'>paredit-raise-sexp</a>
357                (<a id='85' tid='86' class='m'>&quot;(dynamic-wind in (lambda () |body) out)&quot;</a>
358                 <a id='87' tid='88' class='m'>&quot;(dynamic-wind in |body out)&quot;</a>
359                 <a id='89' tid='90' class='m'>&quot;|body&quot;</a>))
360
361   <span class='d'>&quot;Barfage & Slurpage&quot;</span>
362   ((<a id='67' tid='68' class='m'>&quot;C-)&quot;</a> <a id='69' tid='70' class='m'>&quot;C-&lt;right&gt;&quot;</a>)
363                <a id='71' tid='72' class='m'>paredit-forward-slurp-sexp</a>
364                (<a id='73' tid='74' class='m'>&quot;(foo (bar |baz) quux zot)&quot;</a>
365                 <a id='75' tid='76' class='m'>&quot;(foo (bar |baz quux) zot)&quot;</a>)
366                (<a id='77' tid='78' class='m'>&quot;(a b ((c| d)) e f)&quot;</a>
367                 <a id='79' tid='80' class='m'>&quot;(a b ((c| d) e) f)&quot;</a>))
368   ((<a id='57' tid='58' class='m'>&quot;C-}&quot;</a> <a id='59' tid='60' class='m'>&quot;C-&lt;left&gt;&quot;</a>)
369                <a id='61' tid='62' class='m'>paredit-forward-barf-sexp</a>
370                (<a id='63' tid='64' class='m'>&quot;(foo (bar |baz quux) zot)&quot;</a>
371                 <a id='65' tid='66' class='m'>&quot;(foo (bar |baz) quux zot)&quot;</a>))
372   ((<a id='41' tid='42' class='m'>&quot;C-(&quot;</a> <a id='43' tid='44' class='m'>&quot;C-M-&lt;left&gt;&quot;</a> <a id='45' tid='46' class='m'>&quot;ESC C-&lt;left&gt;&quot;</a>)
373                <a id='47' tid='48' class='m'>paredit-backward-slurp-sexp</a>
374                (<a id='49' tid='50' class='m'>&quot;(foo bar (baz| quux) zot)&quot;</a>
375                 <a id='51' tid='52' class='m'>&quot;(foo (bar baz| quux) zot)&quot;</a>)
376                (<a id='53' tid='54' class='m'>&quot;(a b ((c| d)) e f)&quot;</a>
377                 <a id='55' tid='56' class='m'>&quot;(a (b (c| d)) e f)&quot;</a>))
378   ((<a id='29' tid='30' class='m'>&quot;C-{&quot;</a> <a id='31' tid='32' class='m'>&quot;C-M-&lt;right&gt;&quot;</a> <a id='33' tid='34' class='m'>&quot;ESC C-&lt;right&gt;&quot;</a>)
379                <a id='35' tid='36' class='m'>paredit-backward-barf-sexp</a>
380                (<a id='37' tid='38' class='m'>&quot;(foo (bar baz |quux) zot)&quot;</a>
381                 <a id='39' tid='40' class='m'>&quot;(foo bar (baz |quux) zot)&quot;</a>))
382
383   <span class='d'>&quot;Miscellaneous Commands&quot;</span>
384   (<a id='17' tid='18' class='m'>&quot;M-S&quot;</a>       <a id='19' tid='20' class='m'>paredit-split-sexp</a>
385                (<a id='21' tid='22' class='m'>&quot;(hello| world)&quot;</a>
386                 <a id='23' tid='24' class='m'>&quot;(hello)| (world)&quot;</a>)
387                (<a id='25' tid='26' class='m'>&quot;\&quot;Hello, |world!\&quot;&quot;</a>
388                 <a id='27' tid='28' class='m'>&quot;\&quot;Hello, \&quot;| \&quot;world!\&quot;&quot;</a>))
389   (<a id='1' tid='2' class='m'>&quot;M-J&quot;</a>       <a id='3' tid='4' class='m'>paredit-join-sexps</a>
390                (<a id='5' tid='6' class='m'>&quot;(hello)| (world)&quot;</a>
391                 <a id='7' tid='8' class='m'>&quot;(hello| world)&quot;</a>)
392                (<a id='9' tid='10' class='m'>&quot;\&quot;Hello, \&quot;| \&quot;world!\&quot;&quot;</a>
393                 <a id='11' tid='12' class='m'>&quot;\&quot;Hello, |world!\&quot;&quot;</a>)
394                (<a id='13' tid='14' class='m'>&quot;hello-\n|  world&quot;</a>
395                 <a id='15' tid='16' class='m'>&quot;hello-|world&quot;</a>))
396   <span class='d'>(&quot;C-c C-M-l&quot; paredit-recentre-on-sexp)</span>
397   ))
398       <a id='807' tid='808' class='m'>nil</a>)                             <span class='d'>; end of PROGN
399</span>
400<span class='d'>;;;;; Command Examples
401</span>
402(<a id='4635' tid='4636' class='u'>eval-and-compile</a>
403  (<a id='4637' tid='4638' class='u'>defmacro</a> <a id='4639' tid='4640' class='u'>paredit-do-commands</a> (<a id='4641' tid='4642' class='u'>vars</a> <a id='4643' tid='4644' class='u'>string-case</a> <a id='4645' tid='4646' class='u'>&rest</a> <a id='4647' tid='4648' class='u'>body</a>)
404    (<a id='4649' tid='4650' class='u'>let</a> ((<a id='4651' tid='4652' class='u'>spec</a>     (<a id='4653' tid='4654' class='u'>nth</a> <a id='4655' tid='4656' class='u'>0</a> <a id='4657' tid='4658' class='u'>vars</a>))
405          (<a id='4659' tid='4660' class='u'>keys</a>     (<a id='4661' tid='4662' class='u'>nth</a> <a id='4663' tid='4664' class='u'>1</a> <a id='4665' tid='4666' class='u'>vars</a>))
406          (<a id='4667' tid='4668' class='u'>fn</a>       (<a id='4669' tid='4670' class='u'>nth</a> <a id='4671' tid='4672' class='u'>2</a> <a id='4673' tid='4674' class='u'>vars</a>))
407          (<a id='4675' tid='4676' class='u'>examples</a> (<a id='4677' tid='4678' class='u'>nth</a> <a id='4679' tid='4680' class='u'>3</a> <a id='4681' tid='4682' class='u'>vars</a>)))
408      <a id='4683' tid='4684' class='u'>`</a>(<a id='4685' tid='4686' class='u'>dolist</a> (<a id='4687' tid='4688' class='u'>,</a><a id='4689' tid='4690' class='u'>spec</a> <a id='4691' tid='4692' class='u'>paredit-commands</a>)
409         (<a id='4693' tid='4694' class='u'>if</a> (<a id='4695' tid='4696' class='u'>stringp</a> <a id='4697' tid='4698' class='u'>,</a><a id='4699' tid='4700' class='u'>spec</a>)
410             <a id='4701' tid='4702' class='u'>,</a><a id='4703' tid='4704' class='u'>string-case</a>
411           (<a id='4705' tid='4706' class='u'>let</a> ((<a id='4707' tid='4708' class='u'>,</a><a id='4709' tid='4710' class='u'>keys</a> (<a id='4711' tid='4712' class='u'>let</a> ((<a id='4713' tid='4714' class='u'>k</a> (<a id='4715' tid='4716' class='u'>car</a> <a id='4717' tid='4718' class='u'>,</a><a id='4719' tid='4720' class='u'>spec</a>)))
412                          (<a id='4721' tid='4722' class='u'>cond</a> ((<a id='4723' tid='4724' class='u'>stringp</a> <a id='4725' tid='4726' class='u'>k</a>) (<a id='4727' tid='4728' class='u'>list</a> <a id='4729' tid='4730' class='u'>k</a>))
413                                ((<a id='4731' tid='4732' class='u'>listp</a> <a id='4733' tid='4734' class='u'>k</a>) <a id='4735' tid='4736' class='u'>k</a>)
414                                (<a id='4737' tid='4738' class='u'>t</a> (<a id='4739' tid='4740' class='u'>error</a> <a id='4741' tid='4742' class='u'>&quot;Invalid paredit command %s.&quot;</a>
415                                          <a id='4743' tid='4744' class='u'>,</a><a id='4745' tid='4746' class='u'>spec</a>)))))
416                 (<a id='4747' tid='4748' class='u'>,</a><a id='4749' tid='4750' class='u'>fn</a> (<a id='4751' tid='4752' class='u'>cadr</a> <a id='4753' tid='4754' class='u'>,</a><a id='4755' tid='4756' class='u'>spec</a>))
417                 (<a id='4757' tid='4758' class='u'>,</a><a id='4759' tid='4760' class='u'>examples</a> (<a id='4761' tid='4762' class='u'>cddr</a> <a id='4763' tid='4764' class='u'>,</a><a id='4765' tid='4766' class='u'>spec</a>)))
418             <a id='4767' tid='4768' class='u'>,</a><a id='4769' tid='4770' class='u'>@body</a>)))))
419
420  (<a id='4771' tid='4772' class='u'>put</a> <a id='4773' tid='4774' class='u'>&#39;</a><a id='4775' tid='4776' class='u'>paredit-do-commands</a> <a id='4777' tid='4778' class='u'>&#39;</a><a id='4779' tid='4780' class='u'>lisp-indent-function</a> <a id='4781' tid='4782' class='u'>2</a>))
421
422(<a id='2247' tid='2248' class='u'>defun</a> <a id='2249' tid='2250' class='u'>paredit-define-keys</a> ()
423  (<a id='2251' tid='2252' class='u'>paredit-do-commands</a> (<a id='2253' tid='2254' class='u'>spec</a> <a id='2255' tid='2256' class='u'>keys</a> <a id='2257' tid='2258' class='u'>fn</a> <a id='2259' tid='2260' class='u'>examples</a>)
424      <a id='2261' tid='2262' class='u'>nil</a>       <a id='2263' tid='2264' class='u'>; string case
425</a>    (<a id='2265' tid='2266' class='u'>dolist</a> (<a id='2267' tid='2268' class='u'>key</a> <a id='2269' tid='2270' class='u'>keys</a>)
426      (<a id='2271' tid='2272' class='u'>define-key</a> <a id='2273' tid='2274' class='u'>paredit-mode-map</a> (<a id='2275' tid='2276' class='u'>read-kbd-macro</a> <a id='2277' tid='2278' class='u'>key</a>) <a id='2279' tid='2280' class='u'>fn</a>))))
427
428(<a id='3105' tid='3106' class='u'>defun</a> <a id='3107' tid='3108' class='u'>paredit-function-documentation</a> (<a id='3109' tid='3110' class='u'>fn</a>)
429  (<a id='3111' tid='3112' class='u'>let</a> ((<a id='3113' tid='3114' class='u'>original-doc</a> (<a id='3115' tid='3116' class='u'>get</a> <a id='3117' tid='3118' class='u'>fn</a> <a id='3119' tid='3120' class='u'>&#39;</a><a id='3121' tid='3122' class='u'>paredit-original-documentation</a>))
430        (<a id='3123' tid='3124' class='u'>doc</a> (<a id='3125' tid='3126' class='u'>documentation</a> <a id='3127' tid='3128' class='u'>fn</a> <a id='3129' tid='3130' class='u'>&#39;</a><a id='3131' tid='3132' class='u'>function-documentation</a>)))
431    (<a id='3133' tid='3134' class='u'>or</a> <a id='3135' tid='3136' class='u'>original-doc</a>
432        (<a id='3137' tid='3138' class='u'>progn</a> (<a id='3139' tid='3140' class='u'>put</a> <a id='3141' tid='3142' class='u'>fn</a> <a id='3143' tid='3144' class='u'>&#39;</a><a id='3145' tid='3146' class='u'>paredit-original-documentation</a> <a id='3147' tid='3148' class='u'>doc</a>)
433               <a id='3149' tid='3150' class='u'>doc</a>))))
434
435(<a id='1603' tid='1604' class='u'>defun</a> <a id='1605' tid='1606' class='u'>paredit-annotate-mode-with-examples</a> ()
436  (<a id='1607' tid='1608' class='u'>let</a> ((<a id='1609' tid='1610' class='u'>contents</a>
437         (<a id='1611' tid='1612' class='u'>list</a> (<a id='1613' tid='1614' class='u'>paredit-function-documentation</a> <a id='1615' tid='1616' class='u'>&#39;</a><a id='1617' tid='1618' class='u'>paredit-mode</a>))))
438    (<a id='1619' tid='1620' class='u'>paredit-do-commands</a> (<a id='1621' tid='1622' class='u'>spec</a> <a id='1623' tid='1624' class='u'>keys</a> <a id='1625' tid='1626' class='u'>fn</a> <a id='1627' tid='1628' class='u'>examples</a>)
439        (<a id='1629' tid='1630' class='u'>push</a> (<a id='1631' tid='1632' class='u'>concat</a> <a id='1633' tid='1634' class='u'>&quot;\n\n&quot;</a> <a id='1635' tid='1636' class='u'>spec</a> <a id='1637' tid='1638' class='u'>&quot;\n&quot;</a>)
440              <a id='1639' tid='1640' class='u'>contents</a>)
441      (<a id='1641' tid='1642' class='u'>let</a> ((<a id='1643' tid='1644' class='u'>name</a> (<a id='1645' tid='1646' class='u'>symbol-name</a> <a id='1647' tid='1648' class='u'>fn</a>)))
442        (<a id='1649' tid='1650' class='u'>if</a> (<a id='1651' tid='1652' class='u'>string-match</a> (<a id='1653' tid='1654' class='u'>symbol-name</a> <a id='1655' tid='1656' class='u'>&#39;</a><a id='1657' tid='1658' class='u'>paredit-</a>) <a id='1659' tid='1660' class='u'>name</a>)
443            (<a id='1661' tid='1662' class='u'>push</a> (<a id='1663' tid='1664' class='u'>concat</a> <a id='1665' tid='1666' class='u'>&quot;\n\n\\[&quot;</a> <a id='1667' tid='1668' class='u'>name</a> <a id='1669' tid='1670' class='u'>&quot;]\t&quot;</a> <a id='1671' tid='1672' class='u'>name</a>
444                          (<a id='1673' tid='1674' class='u'>if</a> <a id='1675' tid='1676' class='u'>examples</a>
445                              (<a id='1677' tid='1678' class='u'>mapconcat</a> (<a id='1679' tid='1680' class='u'>lambda</a> (<a id='1681' tid='1682' class='u'>example</a>)
446                                           (<a id='1683' tid='1684' class='u'>concat</a>
447                                            <a id='1685' tid='1686' class='u'>&quot;\n&quot;</a>
448                                            (<a id='1687' tid='1688' class='u'>mapconcat</a> <a id='1689' tid='1690' class='u'>&#39;</a><a id='1691' tid='1692' class='u'>identity</a>
449                                                       <a id='1693' tid='1694' class='u'>example</a>
450                                                       <a id='1695' tid='1696' class='u'>&quot;\n  ---&gt;\n&quot;</a>)
451                                            <a id='1697' tid='1698' class='u'>&quot;\n&quot;</a>))
452                                         <a id='1699' tid='1700' class='u'>examples</a>
453                                         <a id='1701' tid='1702' class='u'>&quot;&quot;</a>)
454                              <a id='1703' tid='1704' class='u'>&quot;\n  (no examples)\n&quot;</a>))
455                  <a id='1705' tid='1706' class='u'>contents</a>))))
456    (<a id='1707' tid='1708' class='u'>put</a> <a id='1709' tid='1710' class='u'>&#39;</a><a id='1711' tid='1712' class='u'>paredit-mode</a> <a id='1713' tid='1714' class='u'>&#39;</a><a id='1715' tid='1716' class='u'>function-documentation</a>
457         (<a id='1717' tid='1718' class='u'>apply</a> <a id='1719' tid='1720' class='u'>&#39;</a><a id='1721' tid='1722' class='u'>concat</a> (<a id='1723' tid='1724' class='u'>reverse</a> <a id='1725' tid='1726' class='u'>contents</a>))))
458  <a id='1727' tid='1728' class='u'>;; PUT returns the huge string we just constructed, which we don&#39;t
459</a>  <a id='1729' tid='1730' class='u'>;; want it to return.
460</a>  <a id='1731' tid='1732' class='u'>nil</a>)
461
462(<a id='1537' tid='1538' class='u'>defun</a> <a id='1539' tid='1540' class='u'>paredit-annotate-functions-with-examples</a> ()
463  (<a id='1541' tid='1542' class='u'>paredit-do-commands</a> (<a id='1543' tid='1544' class='u'>spec</a> <a id='1545' tid='1546' class='u'>keys</a> <a id='1547' tid='1548' class='u'>fn</a> <a id='1549' tid='1550' class='u'>examples</a>)
464      <a id='1551' tid='1552' class='u'>nil</a>       <a id='1553' tid='1554' class='u'>; string case
465</a>    (<a id='1555' tid='1556' class='u'>put</a> <a id='1557' tid='1558' class='u'>fn</a> <a id='1559' tid='1560' class='u'>&#39;</a><a id='1561' tid='1562' class='u'>function-documentation</a>
466         (<a id='1563' tid='1564' class='u'>concat</a> (<a id='1565' tid='1566' class='u'>paredit-function-documentation</a> <a id='1567' tid='1568' class='u'>fn</a>)
467                 <a id='1569' tid='1570' class='u'>&quot;\n\n\\&lt;paredit-mode-map&gt;\\[&quot;</a> (<a id='1571' tid='1572' class='u'>symbol-name</a> <a id='1573' tid='1574' class='u'>fn</a>) <a id='1575' tid='1576' class='u'>&quot;]\n&quot;</a>
468                 (<a id='1577' tid='1578' class='u'>mapconcat</a> (<a id='1579' tid='1580' class='u'>lambda</a> (<a id='1581' tid='1582' class='u'>example</a>)
469                              (<a id='1583' tid='1584' class='u'>concat</a> <a id='1585' tid='1586' class='u'>&quot;\n&quot;</a>
470                                      (<a id='1587' tid='1588' class='u'>mapconcat</a> <a id='1589' tid='1590' class='u'>&#39;</a><a id='1591' tid='1592' class='u'>identity</a>
471                                                 <a id='1593' tid='1594' class='u'>example</a>
472                                                 <a id='1595' tid='1596' class='u'>&quot;\n  -&gt;\n&quot;</a>)
473                                      <a id='1597' tid='1598' class='u'>&quot;\n&quot;</a>))
474                            <a id='1599' tid='1600' class='u'>examples</a>
475                            <a id='1601' tid='1602' class='u'>&quot;&quot;</a>)))))
476
477<a id='4783' tid='4784' class='u'>;;;;; HTML Examples
478</a>
479(<a id='3325' tid='3326' class='u'>defun</a> <a id='3327' tid='3328' class='u'>paredit-insert-html-examples</a> ()
480  <a id='3329' tid='3330' class='u'>&quot;Insert HTML for a paredit quick reference table.&quot;</a>
481  (<a id='3331' tid='3332' class='u'>interactive</a>)
482  (<a id='3333' tid='3334' class='u'>let</a> ((<a id='3335' tid='3336' class='u'>insert-lines</a> (<a id='3337' tid='3338' class='u'>lambda</a> (<a id='3339' tid='3340' class='u'>&rest</a> <a id='3341' tid='3342' class='u'>lines</a>)
483                        (<a id='3343' tid='3344' class='u'>mapc</a> (<a id='3345' tid='3346' class='u'>lambda</a> (<a id='3347' tid='3348' class='u'>line</a>) (<a id='3349' tid='3350' class='u'>insert</a> <a id='3351' tid='3352' class='u'>line</a>) (<a id='3353' tid='3354' class='u'>newline</a>))
484                              <a id='3355' tid='3356' class='u'>lines</a>)))
485        (<a id='3357' tid='3358' class='u'>html-keys</a> (<a id='3359' tid='3360' class='u'>lambda</a> (<a id='3361' tid='3362' class='u'>keys</a>)
486                     (<a id='3363' tid='3364' class='u'>mapconcat</a> <a id='3365' tid='3366' class='u'>&#39;</a><a id='3367' tid='3368' class='u'>paredit-html-quote</a> <a id='3369' tid='3370' class='u'>keys</a> <a id='3371' tid='3372' class='u'>&quot;, &quot;</a>)))
487        (<a id='3373' tid='3374' class='u'>html-example</a>
488         (<a id='3375' tid='3376' class='u'>lambda</a> (<a id='3377' tid='3378' class='u'>example</a>)
489           (<a id='3379' tid='3380' class='u'>concat</a> <a id='3381' tid='3382' class='u'>&quot;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&quot;</a>
490                   (<a id='3383' tid='3384' class='u'>mapconcat</a> <a id='3385' tid='3386' class='u'>&#39;</a><a id='3387' tid='3388' class='u'>paredit-html-quote</a>
491                              <a id='3389' tid='3390' class='u'>example</a>
492                              (<a id='3391' tid='3392' class='u'>concat</a> <a id='3393' tid='3394' class='u'>&quot;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&quot;</a>
493                                      <a id='3395' tid='3396' class='u'>&quot;&nbsp;&nbsp;&nbsp;&nbsp;---&gt;&quot;</a>
494                                      <a id='3397' tid='3398' class='u'>&quot;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&quot;</a>))
495                   <a id='3399' tid='3400' class='u'>&quot;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;</a>)))
496        (<a id='3401' tid='3402' class='u'>firstp</a> <a id='3403' tid='3404' class='u'>t</a>))
497    (<a id='3405' tid='3406' class='u'>paredit-do-commands</a> (<a id='3407' tid='3408' class='u'>spec</a> <a id='3409' tid='3410' class='u'>keys</a> <a id='3411' tid='3412' class='u'>fn</a> <a id='3413' tid='3414' class='u'>examples</a>)
498        (<a id='3415' tid='3416' class='u'>progn</a> (<a id='3417' tid='3418' class='u'>if</a> (<a id='3419' tid='3420' class='u'>not</a> <a id='3421' tid='3422' class='u'>firstp</a>)
499                   (<a id='3423' tid='3424' class='u'>insert</a> <a id='3425' tid='3426' class='u'>&quot;&lt;/table&gt;\n&quot;</a>)
500                   (<a id='3427' tid='3428' class='u'>setq</a> <a id='3429' tid='3430' class='u'>firstp</a> <a id='3431' tid='3432' class='u'>nil</a>))
501               (<a id='3433' tid='3434' class='u'>funcall</a> <a id='3435' tid='3436' class='u'>insert-lines</a>
502                        (<a id='3437' tid='3438' class='u'>concat</a> <a id='3439' tid='3440' class='u'>&quot;&lt;h3&gt;&quot;</a> <a id='3441' tid='3442' class='u'>spec</a> <a id='3443' tid='3444' class='u'>&quot;&lt;/h3&gt;&quot;</a>)
503                        <a id='3445' tid='3446' class='u'>&quot;&lt;table border=\&quot;1\&quot; cellpadding=\&quot;1\&quot;&gt;&quot;</a>
504                        <a id='3447' tid='3448' class='u'>&quot;  &lt;tr&gt;&quot;</a>
505                        <a id='3449' tid='3450' class='u'>&quot;    &lt;th&gt;Command&lt;/th&gt;&quot;</a>
506                        <a id='3451' tid='3452' class='u'>&quot;    &lt;th&gt;Keys&lt;/th&gt;&quot;</a>
507                        <a id='3453' tid='3454' class='u'>&quot;    &lt;th&gt;Examples&lt;/th&gt;&quot;</a>
508                        <a id='3455' tid='3456' class='u'>&quot;  &lt;/tr&gt;&quot;</a>))
509      (<a id='3457' tid='3458' class='u'>let</a> ((<a id='3459' tid='3460' class='u'>name</a> (<a id='3461' tid='3462' class='u'>symbol-name</a> <a id='3463' tid='3464' class='u'>fn</a>)))
510        (<a id='3465' tid='3466' class='u'>if</a> (<a id='3467' tid='3468' class='u'>string-match</a> (<a id='3469' tid='3470' class='u'>symbol-name</a> <a id='3471' tid='3472' class='u'>&#39;</a><a id='3473' tid='3474' class='u'>paredit-</a>) <a id='3475' tid='3476' class='u'>name</a>)
511            (<a id='3477' tid='3478' class='u'>funcall</a> <a id='3479' tid='3480' class='u'>insert-lines</a>
512                     <a id='3481' tid='3482' class='u'>&quot;  &lt;tr&gt;&quot;</a>
513                     (<a id='3483' tid='3484' class='u'>concat</a> <a id='3485' tid='3486' class='u'>&quot;    &lt;td&gt;&lt;tt&gt;&quot;</a> <a id='3487' tid='3488' class='u'>name</a> <a id='3489' tid='3490' class='u'>&quot;&lt;/tt&gt;&lt;/td&gt;&quot;</a>)
514                     (<a id='3491' tid='3492' class='u'>concat</a> <a id='3493' tid='3494' class='u'>&quot;

Large files files are truncated, but you can click here to view the full file