]> git.rkrishnan.org Git - .emacs.d.git/blob - emacs/cldoc.el
9e4086f6d062bc1c618c0bf785b5b703de820ffa
[.emacs.d.git] / emacs / cldoc.el
1 ;;; cldoc.el --- show Common Lisp operators and variables information in echo area
2
3 ;; Copyright (C) 1996, 97, 98, 99, 2000 Free Software Foundation, Inc.
4 ;; Copyright (C) 2004 Yuji Minejima
5
6 ;; This program (cldoc.el) is based on eldoc.el.
7 ;; Eldoc Author: Noah Friedman <friedman@splode.com>
8 ;; Keywords: extensions
9
10 ;; $Id: cldoc.el,v 1.16 2004/12/01 02:06:43 yuji Exp $
11
12 ;; This file is not part of GNU Emacs.
13
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; any later version.
18
19 ;; GNU Emacs is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 ;; GNU General Public License for more details.
23
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
27 ;; Boston, MA 02111-1307, USA.
28
29 ;;; Commentary:
30
31 ;; cldoc.el is basically an eldoc clone for Common Lisp.
32 ;; The following comment is from eldoc.el
33 ;; > This program was inspired by the behavior of the "mouse documentation
34 ;; > window" on many Lisp Machine systems; as you type a function's symbol
35 ;; > name as part of a sexp, it will print the argument list for that
36 ;; > function.  Behavior is not identical; for example, you need not actually
37 ;; > type the function name, you need only move point around in a sexp that
38 ;; > calls it.  Also, if point is over a documented variable, it will print
39 ;; > the one-line documentation for that variable instead, to remind you of
40 ;; > that variable's meaning.
41 ;;
42 ;; cldoc.el has a database of parameters and results of Common Lisp's standard
43 ;; functions, and syntax rules of standard macros and special operators.
44 ;; cldoc.el automatically uses SLIME's autodoc facility if available to display
45 ;; parameters of user defined functions and macros, and the values of global
46 ;; variables.
47
48
49 ;; One useful way to enable this minor mode is to put the following in your
50 ;; .emacs:
51 ;;
52 ;; ;; all users
53 ;; (autoload 'turn-on-cldoc-mode "cldoc" nil t)
54 ;; (add-hook 'lisp-mode-hook 'turn-on-cldoc-mode)
55 ;;
56 ;; ;; ilisp users
57 ;; (add-hook 'ilisp-mode-hook 'turn-on-cldoc-mode)
58 ;; (setq ilisp-bindings-*bind-space-p* nil)
59 ;; 
60 ;; ;; slime users
61 ;; (add-hook 'slime-repl-mode-hook
62 ;;           #'(lambda ()
63 ;;               (turn-on-cldoc-mode)
64 ;;               (define-key slime-repl-mode-map " " nil)))
65 ;; (add-hook 'slime-mode-hook
66 ;;           #'(lambda () (define-key slime-mode-map " " nil)))
67 ;; (setq slime-use-autodoc-mode nil)
68
69 ;; todo
70 ;; * handling of operators with multiple syntax rules (e.g. file-position).
71 ;; * handling of operators which implementations are allowed to extend
72 ;;   (e.g. directory)
73
74
75 ;;; Code:
76 (require 'cl)
77
78 ;; Use idle timers if available in the version of emacs running.
79 ;; Please don't change this to use `require'; this package works
80 ;; as-is in XEmacs 19.14 and later and I am striving to maintain
81 ;; compatibility between emacs variants.
82 (or (featurep 'timer)
83     (load "timer" t))
84
85 (defgroup cldoc nil
86   "Show function arglist or variable docstring in echo area."
87   :group 'lisp
88   :group 'extensions)
89
90 ;;;###autoload
91 (defcustom cldoc-mode nil
92   "*If non-nil, show the defined parameters for the elisp function near point.
93
94 For the emacs lisp function at the beginning of the sexp which point is
95 within, show the defined parameters for the function in the echo area.
96 This information is extracted directly from the function or macro if it is
97 in pure lisp.  If the emacs function is a subr, the parameters are obtained
98 from the documentation string if possible.
99
100 If point is over a documented variable, print that variable's docstring
101 instead.
102
103 This variable is buffer-local."
104   :type 'boolean
105   :group 'cldoc)
106 (make-variable-buffer-local 'cldoc-mode)
107
108 (defcustom cldoc-idle-delay 0.50
109   "*Number of seconds of idle time to wait before printing.
110 If user input arrives before this interval of time has elapsed after the
111 last input, no documentation will be printed.
112
113 If this variable is set to 0, no idle time is required."
114   :type 'number
115   :group 'cldoc)
116
117 ;;;###autoload
118 (defcustom cldoc-minor-mode-string " Cldoc"
119   "*String to display in mode line when Cldoc Mode is enabled."
120   :type 'string
121   :group 'cldoc)
122
123 (defcustom cldoc-argument-case 'upcase
124   "Case to display argument names of functions, as a symbol.
125 This has two preferred values: `upcase' or `downcase'.
126 Actually, any name of a function which takes a string as an argument and
127 returns another string is acceptable."
128   :type '(radio (function-item upcase)
129                 (function-item downcase)
130                 function)
131   :group 'cldoc)
132
133 (defcustom cldoc-echo-area-use-multiline-p 'truncate-sym-name-if-fit
134   "*Allow long cldoc messages to resize echo area display.
135 If value is `t', never attempt to truncate messages; complete symbol name
136 and function arglist or 1-line variable documentation will be displayed
137 even if echo area must be resized to fit.
138
139 If value is any non-nil value other than `t', symbol name may be truncated
140 if it will enable the function arglist or documentation string to fit on a
141 single line without resizing window.  Otherwise, behavior is just like
142 former case.
143
144 If value is nil, messages are always truncated to fit in a single line of
145 display in the echo area.  Function or variable symbol name may be
146 truncated to make more of the arglist or documentation string visible.
147
148 Non-nil values for this variable have no effect unless
149 `cldoc-echo-area-multiline-supported-p' is non-nil."
150   :type '(radio (const :tag "Always" t)
151                 (const :tag "Never" nil)
152                 (const :tag "Yes, but truncate symbol names if it will\
153  enable argument list to fit on one line" truncate-sym-name-if-fit))
154   :group 'cldoc)
155
156 ;;; No user options below here.
157
158 ;; Non-nil if this version of emacs supports dynamically resizable echo areas.
159 (defvar cldoc-echo-area-multiline-supported-p
160   (and (string-lessp "21" emacs-version)
161        (save-match-data
162          (numberp (string-match "^GNU Emacs" (emacs-version))))))
163
164 ;; Commands after which it is appropriate to print in the echo area.
165 ;; Cldoc does not try to print function arglists, etc. after just any command,
166 ;; because some commands print their own messages in the echo area and these
167 ;; functions would instantly overwrite them.  But self-insert-command as well
168 ;; as most motion commands are good candidates.
169 ;; This variable contains an obarray of symbols; do not manipulate it
170 ;; directly.  Instead, use `cldoc-add-command' and `cldoc-remove-command'.
171 (defvar cldoc-message-commands nil)
172
173 ;; This is used by cldoc-add-command to initialize cldoc-message-commands
174 ;; as an obarray.
175 ;; It should probably never be necessary to do so, but if you
176 ;; choose to increase the number of buckets, you must do so before loading
177 ;; this file since the obarray is initialized at load time.
178 ;; Remember to keep it a prime number to improve hash performance.
179 (defvar cldoc-message-commands-table-size 31)
180
181 ;; Bookkeeping; elements are as follows:
182 ;;   0 - contains the last symbol read from the buffer.
183 ;;   1 - contains the string last displayed in the echo area for that
184 ;;       symbol, so it can be printed again if necessary without reconsing.
185 ;;   2 - 'function if function args, 'variable if variable documentation.
186 (defvar cldoc-last-data (make-vector 3 nil))
187 (defvar cldoc-last-message nil)
188
189 ;; Idle timers are supported in Emacs 19.31 and later.
190 (defvar cldoc-use-idle-timer-p (fboundp 'run-with-idle-timer))
191
192 ;; cldoc's timer object, if using idle timers
193 (defvar cldoc-timer nil)
194
195 ;; idle time delay currently in use by timer.
196 ;; This is used to determine if cldoc-idle-delay is changed by the user.
197 (defvar cldoc-current-idle-delay cldoc-idle-delay)
198
199 ;; Put minor mode string on the global minor-mode-alist.
200 ;;;###autoload
201 (cond ((fboundp 'add-minor-mode)
202        (add-minor-mode 'cldoc-mode 'cldoc-minor-mode-string))
203       ((assq 'cldoc-mode (default-value 'minor-mode-alist)))
204       (t
205        (setq-default minor-mode-alist
206                      (append (default-value 'minor-mode-alist)
207                              '((cldoc-mode cldoc-minor-mode-string))))))
208
209 \f
210 ;;;###autoload
211 (defun cldoc-mode (&optional prefix)
212   "*Enable or disable cldoc mode.
213 See documentation for the variable of the same name for more details.
214
215 If called interactively with no prefix argument, toggle current condition
216 of the mode.
217 If called with a positive or negative prefix argument, enable or disable
218 the mode, respectively."
219   (interactive "P")
220   (setq cldoc-last-message nil)
221   (cond (cldoc-use-idle-timer-p
222          (add-hook 'post-command-hook 'cldoc-schedule-timer)
223          (add-hook 'pre-command-hook 'cldoc-pre-command-refresh-echo-area))
224         (t
225          ;; Use post-command-idle-hook if defined, otherwise use
226          ;; post-command-hook.  The former is only proper to use in Emacs
227          ;; 19.30; that is the first version in which it appeared, but it
228          ;; was obsolesced by idle timers in Emacs 19.31.
229          (add-hook (if (boundp 'post-command-idle-hook)
230                        'post-command-idle-hook
231                      'post-command-hook)
232                    'cldoc-print-current-symbol-info t t)
233          ;; quick and dirty hack for seeing if this is XEmacs
234          (and (fboundp 'display-message)
235               (add-hook 'pre-command-hook
236                         'cldoc-pre-command-refresh-echo-area t t))))
237   (setq cldoc-mode (if prefix
238                        (>= (prefix-numeric-value prefix) 0)
239                      (not cldoc-mode)))
240   (and (interactive-p)
241        (if cldoc-mode
242            (message "cldoc-mode is enabled")
243          (message "cldoc-mode is disabled")))
244   (when (and cldoc-mode (and (boundp 'slime-autodoc-mode) slime-autodoc-mode))
245     (slime-autodoc-mode -1))
246   cldoc-mode)
247
248 ;;;###autoload
249 (defun turn-on-cldoc-mode ()
250   "Unequivocally turn on cldoc-mode (see variable documentation)."
251   (interactive)
252   (cldoc-mode 1))
253
254 \f
255 ;; Idle timers are part of Emacs 19.31 and later.
256 (defun cldoc-schedule-timer ()
257   (or (and cldoc-timer
258            (memq cldoc-timer timer-idle-list))
259       (setq cldoc-timer
260             (run-with-idle-timer cldoc-idle-delay t
261                                  'cldoc-print-current-symbol-info)))
262
263   ;; If user has changed the idle delay, update the timer.
264   (cond ((not (= cldoc-idle-delay cldoc-current-idle-delay))
265          (setq cldoc-current-idle-delay cldoc-idle-delay)
266          (timer-set-idle-time cldoc-timer cldoc-idle-delay t))))
267
268 (defun cldoc-message (&rest args)
269   (let ((omessage cldoc-last-message))
270     (cond ((eq (car args) cldoc-last-message))
271           ((or (null args)
272                (null (car args)))
273            (setq cldoc-last-message nil))
274           ;; If only one arg, no formatting to do so put it in
275           ;; cldoc-last-message so eq test above might succeed on
276           ;; subsequent calls.
277           ((null (cdr args))
278            (setq cldoc-last-message (car args)))
279           (t
280            (setq cldoc-last-message (apply 'format args))))
281     ;; In emacs 19.29 and later, and XEmacs 19.13 and later, all messages
282     ;; are recorded in a log.  Do not put cldoc messages in that log since
283     ;; they are Legion.
284     (cond ((fboundp 'display-message)
285            ;; XEmacs 19.13 way of preventing log messages.
286            (cond (cldoc-last-message
287                   (display-message 'no-log cldoc-last-message))
288                  (omessage
289                   (clear-message 'no-log))))
290           (t
291            ;; Emacs way of preventing log messages.
292            (let ((message-log-max nil))
293              (cond (cldoc-last-message
294                     (message "%s" cldoc-last-message))
295                    (omessage
296                     (message nil)))))))
297   cldoc-last-message)
298
299 ;; This function goes on pre-command-hook for XEmacs or when using idle
300 ;; timers in Emacs.  Motion commands clear the echo area for some reason,
301 ;; which make cldoc messages flicker or disappear just before motion
302 ;; begins.  This function reprints the last cldoc message immediately
303 ;; before the next command executes, which does away with the flicker.
304 ;; This doesn't seem to be required for Emacs 19.28 and earlier.
305 (defun cldoc-pre-command-refresh-echo-area ()
306   (and cldoc-last-message
307        (if (cldoc-display-message-no-interference-p)
308            (cldoc-message cldoc-last-message)
309          (setq cldoc-last-message nil))))
310
311 ;; Decide whether now is a good time to display a message.
312 (defun cldoc-display-message-p ()
313   (and (cldoc-display-message-no-interference-p)
314        (cond (cldoc-use-idle-timer-p
315               ;; If this-command is non-nil while running via an idle
316               ;; timer, we're still in the middle of executing a command,
317               ;; e.g. a query-replace where it would be annoying to
318               ;; overwrite the echo area.
319               (and (not this-command)
320                    (symbolp last-command)
321                    (intern-soft (symbol-name last-command)
322                                 cldoc-message-commands)))
323              (t
324               ;; If we don't have idle timers, this function is
325               ;; running on post-command-hook directly; that means the
326               ;; user's last command is still on `this-command', and we
327               ;; must wait briefly for input to see whether to do display.
328               (and (symbolp this-command)
329                    (intern-soft (symbol-name this-command)
330                                 cldoc-message-commands)
331                    (sit-for cldoc-idle-delay))))))
332
333 ;; Check various conditions about the current environment that might make
334 ;; it undesirable to print cldoc messages right this instant.
335 (defun cldoc-display-message-no-interference-p ()
336   (and cldoc-mode
337        (not executing-kbd-macro)
338        (not (and (boundp 'edebug-active) edebug-active))
339        ;; Having this mode operate in an active minibuffer/echo area causes
340        ;; interference with what's going on there.
341        (not cursor-in-echo-area)
342        (not (eq (selected-window) (minibuffer-window)))))
343
344 \f
345 (defun cldoc-print-current-symbol-info ()
346   (and (cldoc-display-message-p)
347        (let* ((current-symbol (cldoc-current-symbol))
348               (current-fnsym  (cldoc-fnsym-in-current-sexp))
349               (doc (cond ((eq current-symbol current-fnsym)
350                           (or (cldoc-get-fnsym-args-string current-fnsym)
351                               (cldoc-get-var-value current-symbol)))
352                          (t
353                           (or (cldoc-get-var-value current-symbol)
354                               (cldoc-get-fnsym-args-string current-fnsym))))))
355          (cldoc-message doc))))
356
357
358 (defun cldoc-get-fnsym-signature-from-lisp-process (sym)
359   (cond
360     ((fboundp 'slime-space)
361      ;; from slime.el
362      (when (and slime-space-information-p
363                 (slime-connected-p)
364                 (or (not (slime-busy-p))))
365        (let ((result (slime-eval
366                       `(swank:arglist-for-echo-area '(,(symbol-name sym))))))
367          (when (stringp result) (cdar (read-from-string result))))))
368     ;;((fboundp 'ilisp-arglist-message-lisp-space)
369     ;; (cldoc-ilisp-signature))
370     (t nil)))
371
372 ;; Return a string containing the function parameter list, or 1-line
373 ;; docstring if function is a subr and no arglist is obtainable from the
374 ;; docstring or elsewhere.
375 (defun cldoc-get-fnsym-args-string (sym)
376   (let* ((entry (intern-soft (downcase (symbol-name sym)) cl-operator-signatures))
377          (signature (if (and entry (boundp entry))
378                         (symbol-value entry)
379                         (cldoc-get-fnsym-signature-from-lisp-process sym))))
380     (setq doc
381           (cond
382             ((null signature) nil)
383             ((stringp signature)
384              (cldoc-docstring-format-sym-doc sym signature))
385             (t
386              (let* ((tail (member '=> signature))
387                     (result (cldoc-function-resultstring-format (cdr tail)))
388                     (args (cldoc-function-argstring-format (ldiff signature tail)))
389                     (args-and-result (if tail
390                                        (format "%s => %s" args result)
391                                        (format "%s" args))))
392                (cldoc-docstring-format-sym-doc sym args-and-result)))))))
393
394 (defun cldoc-function-resultstring-format (results)
395   (let (str)
396     (do* ((results results (cdr results))
397           result)
398          ((endp results))
399       (setq result (funcall cldoc-argument-case (symbol-name (car results))))
400       (if str
401           (setq str (format "%s, %s" str result))
402           (setq str (format "%s" result))))
403     str))
404
405
406 ;; Return a string containing a brief (one-line) documentation string for
407 ;; the variable.
408 (defun cldoc-get-var-value (sym)
409   (cond
410     ((fboundp 'slime-autodoc) ;; from slime.el
411      (let* ((name (slime-autodoc-global-at-point))
412             (value (when (and name
413                               slime-space-information-p
414                               (slime-connected-p)
415                               (or (not (slime-busy-p)))
416                               (slime-global-variable-name-p name))
417                      (slime-eval `(swank:variable-desc-for-echo-area ,name)))))
418        value))
419     (t nil)))
420
421 (defun cldoc-last-data-store (symbol doc type)
422   (aset cldoc-last-data 0 symbol)
423   (aset cldoc-last-data 1 doc)
424   (aset cldoc-last-data 2 type))
425
426 ;; Note that any leading `*' in the docstring (which indicates the variable
427 ;; is a user option) is removed.
428 (defun cldoc-docstring-first-line (doc)
429   (and (stringp doc)
430        (substitute-command-keys
431         (save-match-data
432           (let ((start (if (string-match "^\\*" doc) (match-end 0) 0)))
433             (cond ((string-match "\n" doc)
434                    (substring doc start (match-beginning 0)))
435                   ((zerop start) doc)
436                   (t (substring doc start))))))))
437
438 ;; If the entire line cannot fit in the echo area, the symbol name may be
439 ;; truncated or eliminated entirely from the output to make room for the
440 ;; description.
441 (defun cldoc-docstring-format-sym-doc (sym doc)
442   (save-match-data
443     (let* ((name (symbol-name sym))
444            (ea-multi (and cldoc-echo-area-multiline-supported-p
445                           cldoc-echo-area-use-multiline-p))
446            ;; Subtract 1 from window width since emacs will not write
447            ;; any chars to the last column, or in later versions, will
448            ;; cause a wraparound and resize of the echo area.
449            (ea-width (1- (window-width (minibuffer-window))))
450            (strip (- (+ (length name) (length ": ") (length doc)) ea-width)))
451       (cond ((or (<= strip 0)
452                  (eq ea-multi t)
453                  (and ea-multi (> (length doc) ea-width)))
454              (format "%s: %s" sym doc))
455             ((> (length doc) ea-width)
456              (substring (format "%s" doc) 0 ea-width))
457             ((>= strip (length name))
458              (format "%s" doc))
459             (t
460              ;; Show the end of the partial symbol name, rather
461              ;; than the beginning, since the former is more likely
462              ;; to be unique given package namespace conventions.
463              (setq name (substring name strip))
464              (format "%s: %s" name doc))))))
465
466 \f
467 (defun cldoc-fnsym-in-current-sexp ()
468   (let ((p (point)))
469     (cldoc-beginning-of-sexp)
470     (prog1
471         ;; Don't do anything if current word is inside a string.
472         (if (= (or (char-after (1- (point))) 0) ?\")
473             nil
474           (cldoc-current-symbol))
475       (goto-char p))))
476
477 (defun cldoc-beginning-of-sexp ()
478   (let ((parse-sexp-ignore-comments t))
479     (condition-case err
480         (while (progn
481                  (forward-sexp -1)
482                  (or (= (or (char-after (1- (point)))) ?\")
483                      (> (point) (point-min)))))
484       (error nil))))
485
486 (defun cldoc-current-symbol ()
487   (let ((c (char-after (point))))
488     (and c
489          (memq (char-syntax c) '(?w ?_))
490          (intern (current-word)))))
491
492 ;; Do indirect function resolution if possible.
493 (defun cldoc-symbol-function (fsym)
494   (let ((defn (and (fboundp fsym)
495                    (symbol-function fsym))))
496     (and (symbolp defn)
497          (condition-case err
498              (setq defn (indirect-function fsym))
499            (error (setq defn nil))))
500     defn))
501
502 (defun cldoc-function-arglist (fn)
503   (let* ((prelim-def (cldoc-symbol-function fn))
504          (def (if (eq (car-safe prelim-def) 'macro)
505                   (cdr prelim-def)
506                 prelim-def))
507          (arglist (cond ((null def) nil)
508                         ((byte-code-function-p def)
509                          (cond ((fboundp 'compiled-function-arglist)
510                                 (funcall 'compiled-function-arglist def))
511                                (t
512                                 (aref def 0))))
513                         ((eq (car-safe def) 'lambda)
514                          (nth 1 def))
515                         (t t))))
516     arglist))
517
518 (defun cldoc-function-argstring (fn)
519   (cldoc-function-argstring-format (cldoc-function-arglist fn)))
520
521 (defun cldoc-function-arg-format (arg)
522   (typecase arg
523     (symbol (if (memq arg '(&allow-other-keys &aux &body &environment &key &optional
524                             &rest &whole))
525                 (symbol-name arg)
526                 (funcall cldoc-argument-case (symbol-name arg))))
527     (string (if (member arg '("&allow-other-keys" "&aux" "&body" "&environment"
528                               "&key" "&optional" "&rest" "&whole"))
529                 arg
530                 (funcall cldoc-argument-case (symbol-name arg))))
531     (cons (cldoc-function-argstring-format arg))
532     (t (format "%s" arg))))
533
534 (defun cldoc-function-argstring-format (arglist)
535   (concat "(" (mapconcat #'cldoc-function-arg-format arglist " ") ")"))
536
537 \f
538 ;; Alist of predicate/action pairs.
539 ;; Each member of the list is a sublist consisting of a predicate function
540 ;; used to determine if the arglist for a function can be found using a
541 ;; certain pattern, and a function which returns the actual arglist from
542 ;; that docstring.
543 ;;
544 ;; The order in this table is significant, since later predicates may be
545 ;; more general than earlier ones.
546 ;;
547 ;; Compiler note for Emacs/XEmacs versions which support dynamic loading:
548 ;; these functions will be compiled to bytecode, but can't be lazy-loaded
549 ;; even if you set byte-compile-dynamic; to do that would require making
550 ;; them named top-level defuns, which is not particularly desirable either.
551 (defvar cldoc-function-argstring-from-docstring-method-table
552   (list
553    ;; Try first searching for args starting with symbol name.
554    ;; This is to avoid matching parenthetical remarks in e.g. sit-for.
555    (list (function (lambda (doc fn)
556                      (string-match (format "^(%s[^\n)]*)$" fn) doc)))
557          (function (lambda (doc)
558                      ;; end does not include trailing ")" sequence.
559                      (let ((end (- (match-end 0) 1)))
560                        (if (string-match " +" doc (match-beginning 0))
561                            (substring doc (match-end 0) end)
562                          "")))))
563
564    ;; Try again not requiring this symbol name in the docstring.
565    ;; This will be the case when looking up aliases.
566    (list (function (lambda (doc fn)
567                      ;; save-restriction has a pathological docstring in
568                      ;; Emacs/XEmacs 19.
569                      (and (not (eq fn 'save-restriction))
570                           (string-match "^([^\n)]+)$" doc))))
571          (function (lambda (doc)
572                      ;; end does not include trailing ")" sequence.
573                      (let ((end (- (match-end 0) 1)))
574                        (and (string-match " +" doc (match-beginning 0))
575                             (substring doc (match-end 0) end))))))
576
577    ;; Emacs subr docstring style:
578    ;;   (fn arg1 arg2 ...): description...
579    (list (function (lambda (doc fn)
580                      (string-match "^([^\n)]+):" doc)))
581          (function (lambda (doc)
582                      ;; end does not include trailing "):" sequence.
583                      (let ((end (- (match-end 0) 2)))
584                        (and (string-match " +" doc (match-beginning 0))
585                             (substring doc (match-end 0) end))))))
586
587    ;; XEmacs subr docstring style:
588    ;;   "arguments: (arg1 arg2 ...)
589    (list (function (lambda (doc fn)
590                      (string-match "^arguments: (\\([^\n)]+\\))" doc)))
591          (function (lambda (doc)
592                      ;; also skip leading paren, but the first word is
593                      ;; actually an argument, not the function name.
594                      (substring doc (match-beginning 1) (match-end 1)))))
595
596    ;; This finds the argstring for `condition-case'.  Any others?
597    (list (function (lambda (doc fn)
598                      (string-match
599                       (format "^Usage looks like \\((%s[^\n)]*)\\)\\.$" fn)
600                       doc)))
601          (function (lambda (doc)
602                      ;; end does not include trailing ")" sequence.
603                      (let ((end (- (match-end 1) 1)))
604                        (and (string-match " +" doc (match-beginning 1))
605                             (substring doc (match-end 0) end))))))
606
607    ;; This finds the argstring for `setq-default'.  Any others?
608    (list (function (lambda (doc fn)
609                      (string-match (format "^[ \t]+\\((%s[^\n)]*)\\)$" fn)
610                                    doc)))
611          (function (lambda (doc)
612                      ;; end does not include trailing ")" sequence.
613                      (let ((end (- (match-end 1) 1)))
614                        (and (string-match " +" doc (match-beginning 1))
615                             (substring doc (match-end 0) end))))))
616
617    ;; This finds the argstring for `start-process'.  Any others?
618    (list (function (lambda (doc fn)
619                      (string-match "^Args are +\\([^\n]+\\)$" doc)))
620          (function (lambda (doc)
621                      (substring doc (match-beginning 1) (match-end 1)))))
622
623    ;; These common subrs don't have arglists in their docstrings.  So cheat.
624    (list (function (lambda (doc fn)
625                      (memq fn '(and or list + -))))
626          (function (lambda (doc)
627                      ;; The value nil is a placeholder; otherwise, the
628                      ;; following string may be compiled as a docstring,
629                      ;; and not a return value for the function.
630                      ;; In interpreted lisp form they are
631                      ;; indistinguishable; it only matters for compiled
632                      ;; forms.
633                      nil
634                      "&rest args")))
635    ))
636
637 (defun cldoc-function-argstring-from-docstring (fn)
638   (let ((docstring (documentation fn 'raw))
639         (table cldoc-function-argstring-from-docstring-method-table)
640         (doc nil)
641         (doclist nil))
642     (save-match-data
643       (while table
644         (cond ((funcall (car (car table)) docstring fn)
645                (setq doc (funcall (car (cdr (car table))) docstring))
646                (setq table nil))
647               (t
648                (setq table (cdr table)))))
649
650       (cond ((not (stringp doc))
651              nil)
652             ((string-match "&" doc)
653              (let ((p 0)
654                    (l (length doc)))
655                (while (< p l)
656                  (cond ((string-match "[ \t\n]+" doc p)
657                         (setq doclist
658                               (cons (substring doc p (match-beginning 0))
659                                     doclist))
660                         (setq p (match-end 0)))
661                        (t
662                         (setq doclist (cons (substring doc p) doclist))
663                         (setq p l))))
664                (cldoc-function-argstring-format (nreverse doclist))))
665             (t
666              (concat "(" (funcall cldoc-argument-case doc) ")"))))))
667
668 \f
669 ;; When point is in a sexp, the function args are not reprinted in the echo
670 ;; area after every possible interactive command because some of them print
671 ;; their own messages in the echo area; the cldoc functions would instantly
672 ;; overwrite them unless it is more restrained.
673 ;; These functions do display-command table management.
674
675 (defun cldoc-add-command (&rest cmds)
676   (or cldoc-message-commands
677       (setq cldoc-message-commands
678             (make-vector cldoc-message-commands-table-size 0)))
679
680   (let (name sym)
681     (while cmds
682       (setq name (car cmds))
683       (setq cmds (cdr cmds))
684
685       (cond ((symbolp name)
686              (setq sym name)
687              (setq name (symbol-name sym)))
688             ((stringp name)
689              (setq sym (intern-soft name))))
690
691       (and (symbolp sym)
692            (fboundp sym)
693            (set (intern name cldoc-message-commands) t)))))
694
695 (defun cldoc-add-command-completions (&rest names)
696   (while names
697       (apply 'cldoc-add-command
698              (all-completions (car names) obarray 'fboundp))
699       (setq names (cdr names))))
700
701 (defun cldoc-remove-command (&rest cmds)
702   (let (name)
703     (while cmds
704       (setq name (car cmds))
705       (setq cmds (cdr cmds))
706
707       (and (symbolp name)
708            (setq name (symbol-name name)))
709
710       (if (fboundp 'unintern)
711           (unintern name cldoc-message-commands)
712         (let ((s (intern-soft name cldoc-message-commands)))
713           (and s
714                (makunbound s)))))))
715
716 (defun cldoc-remove-command-completions (&rest names)
717   (while names
718     (apply 'cldoc-remove-command
719            (all-completions (car names) cldoc-message-commands))
720     (setq names (cdr names))))
721
722 \f
723 ;; Prime the command list.
724 (cldoc-add-command-completions
725  "backward-" "beginning-of-" "delete-other-windows" "delete-window"
726  "end-of-" "forward-" "indent-for-tab-command" "goto-" "mouse-set-point"
727  "next-" "other-window" "previous-" "recenter" "scroll-"
728  "self-insert-command" "split-window-"
729  "up-list" "down-list")
730
731 \f
732 (defvar cl-operator-signatures (make-vector 67 0))
733
734 ;; note
735 ;; these symbols are used,  => =>|
736 (mapcar (lambda (entry)
737           (let ((symbol (intern (symbol-name (car entry)) cl-operator-signatures)))
738             (set symbol (cdr entry))))
739         
740         '(;; evaluation and compilation
741           (lambda . "lambda-list [[declaration* | documentation]] form* => function")
742           (compile function-name-or-nil &optional lambda-expression-or-function => function warnings-p failure-p)
743           (eval form => result*)
744           (eval-when . "(situation*) form* => result*")
745           (load-time-value . "form &optional read-only-p => object")
746           (quote object => object)
747           (compiler-macro-function name &optional (environment nil) => function)
748           (define-compiler-macro . "name lambda-list [[declaration* | documentation]] form* => name")
749           (defmacro . "name lambda-list [[declaration* | documentation]] form* => name")
750           (macro-function symbol &optional (environment nil) => macro-function-or-nil)
751           (macroexpand form &optional (environment nil) => expansion expanded-p)
752           (macroexpand-1 form &optional (environment nil) => expansion expanded-p)
753           (define-symbol-macro . "symbol expansion => symbol")
754           (symbol-macrolet . "((symbol expansion)*) declaration* form* => result*")
755           (proclaim declaration-specifier => implementation-dependent)
756           (declaim . "declaration-specifier* => implementation-dependent")
757           (locally declaration* form* => result*)
758           (the value-type form => result*)
759           (special-operator-p symbol => generalized-boolean)
760           (constantp form &optional (environment nil) => generalized-boolean)
761
762           
763           ;; types and classes
764           (coerce object result-type => result)
765           (deftype . "name lambda-list [[declaration* | documentation]] form* => name")
766           (subtypep subtype type &optional (environment nil) => subtype-p valid-p)
767           (typep object type-specifier &optional (environment nil) => generalized-boolean)
768           (type-error-datum condition => datum)
769           (type-error-expected-type condition => expected-type)
770
771
772           ;; data and control flow
773           (apply function &rest args+ => result*)
774           (defun . "function-name lambda-list [[declaration* | documentation]] form* => function-name")
775           (fdefinition function-name => definition)
776           (fboundp function-name => generalized-boolean)
777           (fmakunbound function-name => function-name)
778           (flet . "((function-name lambda-list [[local-declaration* | local-documentation]] local-form*)*) declaration* form* => result*")
779           (labels . "((function-name lambda-list [[local-declaration* | local-documentation]] local-form*)*) declaration* form* => result*")
780           (macrolet . "((name lambda-list [[local-declaration* | local-documentation]] local-form*)*) declaration* form* => result*")
781
782           (funcall function &rest args => result*)
783           (function . "function-name-or-lambda-expression => function")
784           (function-lambda-expression function => lambda-expression closure-p name)
785           (functionp object => generalized-boolean)
786           (compiled-function-p object => generalized-boolean)
787           (defconstant . "name initial-value [documentation] => name")
788           (defparameter . "name initial-value [documentation] => name")
789           (defvar . "name [initial-value [documentation]] => name")
790           (destructuring-bind . "destructuring-lambda-list expression declaration* form* => result*")
791           (let . "({var | (var [init-form])}*) declaration* form* => result*")
792           (let* . "({var | (var [init-form])}*) declaration* form* => result*")
793           (progv . "symbols values form* => result*")
794           (setq . "{pair}* => result")
795           (psetq . "{pair}* => nil")
796           (block . "name-symbol form* => result*")
797           (catch . "tag-form form* => result*")
798           (go . "tag =>|")
799           (return-from . "name [result-form] =>|")
800           (return . "[result-form] =>|")
801           (tagbody . "{tag | statement}* => nil")
802           (throw . "tag-form result-form =>|")
803           (unwind-protect . "protected-form cleanup-form* => result*")
804           (not x => boolean)
805           (eq x y => generalized-boolean)
806           (eql x y => generalized-boolean)
807           (equal x y => generalized-boolean)
808           (equalp x y => generalized-boolean)
809           (identity object => object)
810           (complement function => complement-function)
811           (constantly value => function-constantly-returning-value)
812           (every predicate &rest sequences+ => generalized-boolean)
813           (some predicate &rest sequences+ => result)
814           (notevery predicate &rest sequences+ => generalized-boolean)
815           (notany predicate &rest sequences+ => generalized-boolean)
816           (and . "form* => result*")
817           (cond . "{(test-form form*)}* => result*")
818           (if . "test-form then-form [else-form] => result*")
819           (or . "form* => results*")
820           (when . "test-form form* => result*")
821           (unless . "test-form form* => result*")
822           (case . "keyform {(keys form*)}* [({otherwise | t} form*)] => result*")
823           (ccase . "keyplace {(keys form*)}* => result*")
824           (ecase . "keyform {(keys form*)}* => result*")
825           (typecase . "keyform {(type form*)}* [({otherwise | t} form*)] => result*")
826           (ctypecase . "keyplace {(type form*)}* => result*")
827           (etypecase . "keyform {(type form*)}* => result*")
828           (multiple-value-bind . "(var*) values-form declaration* form* => result*")
829           (multiple-value-call . "function-form form* => result*")
830           (multiple-value-list . "form => list")
831           (multiple-value-prog1 . "first-form form* => first-form-results")
832           (multiple-value-setq . "vars form => result")
833           (values &rest object => object*)
834           (values-list list => element*)
835           (nth-value . "n-form form => object")
836           (prog . "({var | (var [init-form])}*) declaration* {tag | statement}* => result*")
837           (prog* . "({var | (var [init-form])}*) declaration* {tag | statement}* => result*")
838           (prog1 . "first-form form* => primary-value-of-evaluated-first-form")
839           (prog2 . "first-form second-form form* => primary-value-of-evaluated-second-form")
840           (progn . "form* => result*")
841           (define-modify-macro . "name lambda-list function [documentation] => name")
842           ;;(defsetf . "access-fn update-fn [documentation] => access-fn")
843           ;;(defsetf . " access-fn lambda-list (store-variable*) [[declaration* | documentation]] form* => access-fn")
844           (define-setf-expander . "access-fn lambda-list [[declaration* | documentation]] form* => access-fn")
845           (get-setf-expansion place &optional (environment nil) => vars vals store-vars writer-form reader-form)
846           (setf . "{place newvalue}* => result*")
847           (psetf . "{place newvalue}* => nil")
848           (shiftf . "place+ newvalue => old-value-1")
849           (rotatef . "place* => nil")
850
851           
852           ;; iteration
853           (do . "({var | (var [init-form [step-form]])}*) (end-test-form result-form*) declaration* {tag | statement}* => result*")
854           (do* . "({var | (var [init-form [step-form]])}*) (end-test-form result-form*) declaration* {tag | statement}* => result*")
855           (dotimes . "(var count-form [result-form]) declaration* {tag | statement}* => result*")
856           (dolist . "(var list-form [result-form]) declaration* {tag | statement}* => result*")
857           ;;(loop . "compound-form* => result*")
858           ;;(loop . "[name-clause] {variable-clause}* {main-clause}* => result*")
859           (loop-finish . " =>|")
860
861
862           ;; objects
863           (function-keywords method => keys allow-other-keys-p)
864           (ensure-generic-function function-name &key argument-precedence-order declare documentation environment generic-function-class lambda-list method-class method-combination => generic-function)
865           (allocate-instance class &rest initargs &key &allow-other-keys => new-instance)
866           (reinitialize-instance instance &rest initargs &key &allow-other-keys => instance)
867           (shared-initialize instance slot-names &rest initargs &key &allow-other-keys => instance)
868           (update-instance-for-different-class previous current &rest initargs &key &allow-other-keys => implementation-dependent)
869           (update-instance-for-redefined-class instance added-slots discarded-slots property-list &rest initargs &key &allow-other-keys => result*)
870           (change-class instance new-class &key &allow-other-keys => instance)
871           (slot-boundp instance slot-name => generalized-boolean)
872           (slot-exists-p object slot-name => generalized-boolean)
873           (slot-makunbound instance slot-name => instance)
874           (slot-missing class object slot-name operation &optional new-value => result*)
875           (slot-unbound class instance slot-name => result*)
876           (slot-value object slot-name => value)
877           (method-qualifiers method => qualifiers)
878           (no-applicable-method generic-function &rest function-arguments => result*)
879           (no-next-method generic-function method &rest args => result*)
880           (remove-method generic-function method => generic-function)
881           (make-instance class-designator &rest initargs &key &allow-other-keys => instance)
882           (make-instances-obsolete class-designator => class)
883           (make-load-form object &optional (environment nil) => creation-form \[initialization-form\])
884           (make-load-form-saving-slots object &key slot-names (environment nil) => creation-form initialization-form)
885           (with-accessors . "(slot-entry*) instance-form declaration* form* => result*")
886           (with-slots . "({slot-name | (variable-name slot-name)}*) instance-form declaration* form* => result*")
887           (defclass . "class-name ({superclass-name}*) ({slot-specifier}*) [[class-option]] => new-class")
888           (defgeneric . "function-name gf-lambda-list [[option | {method-description}*]] => new-generic)")
889           (defmethod . "function-name {method-qualifier}* specialized-lambda-list [[declaration* | documentation]] form* => new-method")
890           (find-class symbol &optional (errorp t) environment => class)
891           (next-method-p => generalized-boolean)
892           (call-method method &optional next-method-list => result*)
893           (make-method form => method-object)
894           (call-next-method &rest args => result*)
895           (compute-applicable-methods generic-function function-arguments => methods)
896           ;;(define-method-combination . "name [[short-form-option]] => name")
897           ;;(define-method-combination . "name lambda-list (method-group-specifier*) [(:arguments . args-lambda-list)] [(:generic-function generic-function-symbol)] [[declaration* | documentation]] form* => name")
898           (find-method generic-function method-qualifiers specializers &optional (errorp t) => method)
899           (add-method generic-function method => generic-function)
900           (initialize-instance instance &rest initargs &key &allow-other-keys => instance)
901           (class-name class => name)
902           (class-of object => class)
903           (unbound-slot-instance condition => instance)
904
905           ;; structures
906           (defstruct . "name-and-options [documentation] {slot-description}* => structure-name")
907           (copy-structure structure => copy)
908
909
910           ;; conditions
911           (cell-error-name condition => name)
912           (assert . "test-form [(place*) [datum-form argument-form*]] => nil")
913           (error datum &rest arguments =>|)
914           (cerror continue-format-control datum &rest arguments => nil)
915           (check-type . "place typespec [string] => nil")
916           (invalid-method-error method format-control &rest args => implementation-dependent)
917           (method-combination-error format-control &rest args => implementation-dependent)
918           (signal datum &rest arguments => nil)
919           (simple-condition-format-control condition => format-control)
920           (simple-condition-format-arguments condition => format-arguments)
921           (warn datum &rest arguments => nil)
922           (invoke-debugger condition =>|)
923           (break &optional (format-control *implementation-dependent-format-control*) &rest format-arguments => nil)
924           (handler-bind . "({(type handler)}*) form* => result*")
925           (handler-case . "expression [[{error-clause}* | no-error-clause]] => result*
926 clause::= error-clause | no-error-clause 
927 error-clause::= (typespec ([var]) declaration* form*) 
928 no-error-clause::= (:no-error lambda-list declaration* form*)")
929           (ignore-errors . "form* => result*")
930           (define-condition . "name (parent-type*) ({slot-spec}*) option* => name")
931           (make-condition type &rest slot-initializations => condition)
932           (compute-restarts &optional (condition nil) => restarts)
933           (find-restart identifier &optional (condition nil) => restart)
934           (invoke-restart restart-designator &rest arguments => result*)
935           (invoke-restart-interactively restart-designator => result*)
936           (restart-bind . "({(name function {key-val-pair}*)}) form* => result*")
937           (restart-case . "restartable-form {clause} => result*")
938           (restart-name restart => name)
939           (with-condition-restarts . "condition-form restarts-form form* => result*")
940           (with-simple-restart . "(name format-control format-argument*) form* => result*")
941           (abort &optional (condition nil) =>|)
942           (continue &optional (condition nil) => nil)
943           (muffle-warning &optional (condition nil) =>|)
944           (store-value value &optional (condition nil) => nil)
945           (use-value value &optional (condition nil) => nil)
946
947
948           ;; symbols
949           (symbolp object => generalized-boolean)
950           (keywordp object => generalized-boolean)
951           (make-symbol name-string => new-symbol)
952           (copy-symbol symbol &optional (copy-properties nil) => new-symbol)
953           (gensym &optional string-or-non-negative-integer => new-symbol)
954           (gentemp &optional (prefix "T") (package *package*) => new-symbol)
955           (symbol-function symbol => contents)
956           (symbol-name symbol => name)
957           (symbol-package symbol => package-or-nil)
958           (symbol-plist symbol => plist)
959           (symbol-value symbol => value)
960           (get symbol indicator &optional (default nil) => value)
961           (remprop symbol indicator => generalized-boolean)
962           (boundp symbol => generalized-boolean)
963           (makunbound symbol => symbol)
964           (set symbol value => value)
965
966
967           ;; packages
968           (export designator-for-a-list-of-symbols &optional (package *package*) => t)
969           (find-symbol string &optional (package *package*) => symbol status)
970           (find-package string-designator-or-package => package)
971           (find-all-symbols string-designator => symbols)
972           (import designator-for-a-list-of-symbols &optional (package *package*))
973           (list-all-packages => packages)
974           (rename-package package new-name &optional (new-nicknames '()) => package-object)
975           (shadow symbol-names &optional (package *package*) => t)
976           (shadowing-import designator-for-a-list-of-symbols &optional (package *package*) => t)
977           (delete-package package-designator => generalized-boolean)
978           (make-package package-name &key (nicknames '()) (use *implementation-defined-use-list*) => package)
979           (with-package-iterator . "(name package-list-form &rest symbol-types) declaration* form* => result*")
980           (unexport designator-for-a-list-of-symbols &optional (package *package*) => t)
981           (unintern symbol &optional (package *package*) => generalized-boolean)
982           (in-package . "name => package")
983           (unuse-package packages-to-unuse &optional (package *package*) => t)
984           (use-package packages-to-use &optional (package *package*) => t)
985           (defpackage . "defined-package-name [[option]] => package
986 option::= (:nicknames nickname*)* |  
987           (:documentation string) |  
988           (:use package-name*)* |  
989           (:shadow {symbol-name}*)* |  
990           (:shadowing-import-from package-name {symbol-name}*)* |  
991           (:import-from package-name {symbol-name}*)* |  
992           (:export {symbol-name}*)* |  
993           (:intern {symbol-name}*)* |  
994           (:size integer) ")
995           (do-symbols . "(var [package [result-form]]) declaration* {tag | statement}* => result*")
996           (do-external-symbols . "(var [package [result-form]]) declaration* {tag | statement}* => result*")
997           (do-all-symbols . "(var [result-form]) declaration* {tag | statement}* => result*")
998           (intern string &optional (package *package*) => symbol status)
999           (package-name package-designator => name)
1000           (package-nicknames package-designator => nicknames)
1001           (package-shadowing-symbols package-designator => symbols)
1002           (package-use-list package-designator => use-list)
1003           (package-used-by-list package-designator => used-by-list)
1004           (packagep object => generalized-boolean)
1005           (package-error-package condition => package)
1006
1007
1008           ;; numbers
1009           (= &rest numbers+ => generalized-boolean)
1010           (/= &rest numbers+ => generalized-boolean)
1011           (< &rest numbers+ => generalized-boolean)
1012           (> &rest numbers+ => generalized-boolean)
1013           (<= &rest numbers+ => generalized-boolean)
1014           (>= &rest numbers+ => generalized-boolean)
1015           (max &rest reals+ => max-real)
1016           (min &rest reals+ => min-real)
1017           (minusp real => generalized-boolean)
1018           (plusp real => generalized-boolean)
1019           (zerop number => generalized-boolean)
1020           (floor number &optional (divisor 1) => quotient remainder)
1021           (ffloor number &optional (divisor 1) => quotient remainder)
1022           (ceiling number &optional (divisor 1) => quotient remainder)
1023           (fceiling number &optional (divisor 1) => quotient remainder)
1024           (truncate number &optional (divisor 1) => quotient remainder)
1025           (ftruncate number &optional (divisor 1) => quotient remainder)
1026           (round number &optional (divisor 1) => quotient remainder)
1027           (fround number &optional (divisor 1) => quotient remainder)
1028           (sin radians => number)
1029           (cos radians => number)
1030           (tan radians => number)
1031           (asin number => radians)
1032           (acos number => radians)
1033           (atan number1 &optional number2 => radians)
1034           (sinh number => result)
1035           (cosh number => result)
1036           (tanh number => result)
1037           (asinh number => result)
1038           (acosh number => result)
1039           (atanh number => result)
1040           (* &rest numbers => product)
1041           (+ &rest numbers => sum)
1042           ;;(- number => negation)
1043           ;;(- minuend &rest subtrahends+ => difference)
1044           ;;(/ number => reciprocal)
1045           ;;(/ numerator &rest denominators+ => quotient)
1046           (1+ number => successor)
1047           (1- number => predecessor)
1048           (abs number => absolute-value)
1049           (evenp integer => generalized-boolean)
1050           (oddp integer => generalized-boolean)
1051           (exp number => result)
1052           (expt base-number power-number => result)
1053           (gcd &rest integers => greatest-common-denominator)
1054           (incf . "place [delta-form] => new-value")
1055           (decf . "place [delta-form] => new-value")
1056           (lcm &rest integers => least-common-multiple)
1057           (log number &optional (base *E-base-of-the-natural-logarithms*) => logarithm)
1058           (mod number divisor => modulus)
1059           (rem number divisor => remainder)
1060           (signum number => signed-prototype)
1061           (sqrt number => root)
1062           (isqrt natural => natural-root)
1063           (make-random-state &optional (state nil) => new-state)
1064           (random limit &optional (random-state *random-state*) => random-number)
1065           (random-state-p object => generalized-boolean)
1066           (numberp object => generalized-boolean)
1067           (cis radians => number)
1068           (complex realpart &optional (imagpart (coerce 0 (type-of realpart))) => complex)
1069           (complexp object => generalized-boolean)
1070           (conjugate number => conjugate)
1071           (phase number => phase)
1072           (realpart number => real)
1073           (imagpart number => real)
1074           (upgraded-complex-part-type typespec &optional (environment nil) => upgraded-typespec)
1075           (realp object => generalized-boolean)
1076           (numerator rational => numerator)
1077           (denominator rational => denominator)
1078           (rational number => rational)
1079           (rationalize number => rational)
1080           (rationalp object => generalized-boolean)
1081           (ash integer count => shifted-integer)
1082           (integer-length integer => number-of-bits)
1083           (integerp object => generalized-boolean)
1084           (parse-integer string &key (start 0) (end nil) (radix 10) junk-allowed => integer pos)
1085           (boole op integer-1 integer-2 => result-integer)
1086           (logand &rest integers => result-integer)
1087           (logandc1 integer-1 integer-2 => result-integer)
1088           (logandc2 integer-1 integer-2 => result-integer)
1089           (logeqv &rest integers => result-integer)
1090           (logior &rest integers => result-integer)
1091           (lognand integer-1 integer-2 => result-integer)
1092           (lognor integer-1 integer-2 => result-integer)
1093           (lognot integer => result-integer)
1094           (logorc1 integer-1 integer-2 => result-integer)
1095           (logorc2 integer-1 integer-2 => result-integer)
1096           (logxor &rest integers => result-integer)
1097           (logbitp index integer => generalized-boolean)
1098           (logcount integer => number-of-on-bits)
1099           (logtest integer-1 integer-2 => generalized-boolean)
1100           (byte size position => bytespec)
1101           (byte-size bytespec => size)
1102           (byte-position bytespec => position)
1103           (deposit-field newbyte bytespec integer => result-integer)
1104           (dpb newbyte bytespec integer => result-integer)
1105           (ldb bytespec integer => byte)
1106           (ldb-test bytespec integer => generalized-boolean)
1107           (mask-field bytespec integer => masked-integer)
1108           (decode-float float => significand exponent sign)
1109           (scale-float float integer => scaled-float)
1110           (float-radix float => float-radix)
1111           (float-sign float-1 &optional (float-2 (float 1 float-1)) => signed-float)
1112           (float-digits float => digits1)
1113           (float-precision float => digits2)
1114           (integer-decode-float float => significand exponent integer-sign)
1115           (float number &optional prototype => float)
1116           (floatp object)
1117           (arithmetic-error-operands condition => operands)
1118           (arithmetic-error-operation condition => operation)
1119
1120           ;; characters
1121           (char= &rest characters+ => generalized-boolean)
1122           (char/= &rest characters+ => generalized-boolean)
1123           (char< &rest characters+ => generalized-boolean)
1124           (char> &rest characters+ => generalized-boolean)
1125           (char<= &rest characters+ => generalized-boolean)
1126           (char>= &rest characters+ => generalized-boolean)
1127           (char-equal &rest characters+ => generalized-boolean)
1128           (char-not-equal &rest characters+ => generalized-boolean)
1129           (char-lessp &rest characters+ => generalized-boolean)
1130           (char-greaterp &rest characters+ => generalized-boolean)
1131           (char-not-greaterp &rest characters+ => generalized-boolean)
1132           (char-not-lessp &rest characters+ => generalized-boolean)
1133           (character character-designator => denoted-character)
1134           (characterp object => generalized-boolean)
1135           (alpha-char-p character => generalized-boolean)
1136           (alphanumericp character => generalized-boolean)
1137           (digit-char weight &optional (radix 10) => char)
1138           (digit-char-p char &optional (radix 10) => weight)
1139           (graphic-char-p char => generalized-boolean)
1140           (standard-char-p character => generalized-boolean)
1141           (char-upcase character => corresponding-character)
1142           (char-downcase character => corresponding-character)
1143           (upper-case-p character => generalized-boolean)
1144           (lower-case-p character => generalized-boolean)
1145           (both-case-p character => generalized-boolean)
1146           (char-code character => code)
1147           (char-int character => integer)
1148           (code-char code => char-p)
1149           (char-name character => name)
1150           (name-char name => character-or-nil)
1151
1152           
1153           ;; conses
1154           (cons car cdr => cons)
1155           (consp object => generalized-boolean)
1156           (atom object => generalized-boolean)
1157           (rplaca cons object => cons)
1158           (rplacd cons object => cons)
1159           (car list => car-of-list)
1160           (cdr list => cdr-of-list)
1161           (copy-tree tree => new-tree)
1162           (sublis alist tree &key key test test-not => new-tree)
1163           (nsublis alist tree &key key test test-not => new-tree)
1164           (subst new old tree &key key test test-not => new-tree)
1165           (subst-if new predicate tree &key key => new-tree)
1166           (subst-if-not new predicate tree &key key => new-tree)
1167           (nsubst new old tree &key key test test-not => new-tree)
1168           (nsubst-if new predicate tree &key key => new-tree)
1169           (nsubst-if-not new predicate tree &key key => new-tree)
1170           (tree-equal tree-1 tree-2 &key test test-not => generalized-boolean)
1171           (copy-list list => copy)
1172           (list &rest objects => list)
1173           (list* &rest objects+ => result)
1174           (list-length list => length)
1175           (listp object => generalized-boolean)
1176           (make-list size &key (initial-element nil) => list)
1177           (push . "item place => new-place-value")
1178           (pop . "place => element")
1179           (nth n list => object)
1180           (endp list => generalized-boolean)
1181           (null object => boolean)
1182           (nconc &rest lists => concatenated-list)
1183           (append &rest lists => result)
1184           (revappend list tail => result-list)
1185           (nreconc list tail => result-list)
1186           (butlast list &optional (n 1) => result-list)
1187           (nbutlast list &optional (n 1) => result-list)
1188           (last list &optional (n 1) => tail)
1189           (ldiff list possible-tail => result-list)
1190           (tailp possible-tail list => generalized-boolean)
1191           (nthcdr n list => tail)
1192           (rest list => tail)
1193           (member item list &key key test test-not => tail)
1194           (member-if predicate list &key key => tail)
1195           (member-if-not predicate list &key key => tail)
1196           (mapc function &rest lists+ => list-1)
1197           (mapcar function &rest lists+ => result-list)
1198           (mapcan function &rest lists+ => concatenated-results)
1199           (mapl function &rest lists+ => list-1)
1200           (maplist function &rest lists+ => result-list)
1201           (mapcon function &rest lists+ => concatenated-results)
1202           (acons key datum alist => new-alist)
1203           (assoc item alist &key key test test-not => entry)
1204           (assoc-if predicate alist &key key => entry)
1205           (assoc-if-not predicate alist &key key => entry)
1206           (copy-alist alist => new-alist)
1207           (pairlis keys data &optional (alist '()) => new-alist)
1208           (rassoc item alist &key key test test-not => entry)
1209           (rassoc-if predicate alist &key key => entry)
1210           (rassoc-if-not predicate alist &key key => entry)
1211           (get-properties plist indicator-list => indicator value tail)
1212           (getf plist indicator &optional (default nil) => value)
1213           (remf place indicator => generalized-boolean)
1214           (intersection list-1 list-2 &key key test test-not => result-list)
1215           (nintersection list-1 list-2 &key key test test-not => result-list)
1216           (adjoin item list &key key test test-not => new-list)
1217           (pushnew item place &key key test test-not => new-place-value)
1218           (set-difference list-1 list-2 &key key test test-not => result-list)
1219           (nset-difference list-1 list-2 &key key test test-not => result-list)
1220           (set-exclusive-or list-1 list-2 &key key test test-not => result-list)
1221           (nset-exclusive-or list-1 list-2 &key key test test-not => result-list)
1222           (subsetp list-1 list-2 &key key test test-not => generalized-boolean)
1223           (union list-1 list-2 &key key test test-not => result-list)
1224           (nunion list-1 list-2 &key key test test-not => result-list)
1225
1226           ;; arrays
1227           (make-array dimensions &key (element-type t) initial-element initial-contents (adjustable nil) (fill-pointer nil) (displaced-to nil) (displaced-index-offset 0) => new-array)
1228           (adjust-array array new-dimensions &key element-type initial-element initial-contents (fill-pointer nil) displaced-to displaced-index-offset => adjusted-array)
1229           (adjustable-array-p array => generalized-boolean)
1230           (aref array &rest subscripts => element)
1231           (array-dimension array axis-number => dimension)
1232           (array-dimensions array => dimensions)
1233           (array-element-type array => typespec)
1234           (array-has-fill-pointer-p array => generalized-boolean)
1235           (array-displacement array => displaced-to displaced-index-offset)
1236           (array-in-bounds-p array &rest subscripts => generalized-boolean)
1237           (array-rank array => rank)
1238           (array-row-major-index array &rest subscripts => index)
1239           (array-total-size array => size)
1240           (arrayp object => generalized-boolean)
1241           (fill-pointer vector => fill-pointer)
1242           (row-major-aref array index => element)
1243           (upgraded-array-element-type typespec &optional (environment nil) => upgraded-typespec)
1244           (simple-vector-p object => generalized-boolean)
1245           (svref simple-vector index => element)
1246           (vector &rest objects => vector)
1247           (vector-pop vector => element)
1248           (vector-push new-element vector => new-index-p)
1249           (vector-push-extend new-element vector &optional (extension *implementation-dependent-extension*) => new-index)
1250           (vectorp object => generalized-boolean)
1251           (bit bit-array &rest subscripts => bit)
1252           (sbit bit-array &rest subscripts => bit)
1253           (bit-and bit-array1 bit-array2 &optional (opt-arg nil) => resulting-bit-array)
1254           (bit-andc1 bit-array1 bit-array2 &optional (opt-arg nil) => resulting-bit-array)
1255           (bit-andc2 bit-array1 bit-array2 &optional (opt-arg nil) => resulting-bit-array)
1256           (bit-eqv bit-array1 bit-array2 &optional (opt-arg nil) => resulting-bit-array)
1257           (bit-ior bit-array1 bit-array2 &optional (opt-arg nil) => resulting-bit-array)
1258           (bit-nand bit-array1 bit-array2 &optional (opt-arg nil) => resulting-bit-array)
1259           (bit-nor bit-array1 bit-array2 &optional (opt-arg nil) => resulting-bit-array)
1260           (bit-orc1 bit-array1 bit-array2 &optional (opt-arg nil) => resulting-bit-array)
1261           (bit-orc2 bit-array1 bit-array2 &optional (opt-arg nil) => resulting-bit-array)
1262           (bit-xor bit-array1 bit-array2 &optional (opt-arg nil) => resulting-bit-array)
1263           (bit-not bit-array &optional (opt-arg nil) => resulting-bit-array)
1264           (bit-vector-p object => generalized-boolean)
1265           (simple-bit-vector-p object => generalized-boolean)
1266
1267
1268           ;; strings
1269           (simple-string-p object => generalized-boolean)
1270           (char string index => character)
1271           (schar simple-string index => character)
1272           (string string-or-symbol-or-character => string)
1273           (string-upcase string-designator &key (start 0) (end nil) => cased-string)
1274           (string-downcase string-designator &key (start 0) (end nil) => cased-string)
1275           (string-capitalize string-designator &key (start 0) (end nil) => cased-string)
1276           (nstring-upcase string &key (start 0) (end nil) => modified-string)
1277           (nstring-downcase string &key (start 0) (end nil) => modified-string)
1278           (nstring-capitalize string &key (start 0) (end nil) => modified-string)
1279
1280           (string-trim character-bag string => trimmed-string)
1281           (string-left-trim character-bag string => trimmed-string)
1282           (string-right-trim character-bag string => trimmed-string)
1283           (string= string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => generalized-boolean)
1284           (string/= string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => mismatch-index)
1285           (string< string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => mismatch-index)
1286           (string> string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => mismatch-index)
1287           (string<= string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => mismatch-index)
1288           (string>= string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => mismatch-index)
1289           (string-equal string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => generalized-boolean)
1290           (string-not-equal string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => mismatch-index)
1291           (string-lessp string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => mismatch-index)
1292           (string-greaterp string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => mismatch-index)
1293           (string-not-greaterp string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => mismatch-index)
1294           (string-not-lessp string1 string2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => mismatch-index)
1295           (stringp object => generalized-boolean)
1296           (make-string size &key (initial-element *implementation-dependent-character*) (element-type 'character) => string)
1297
1298
1299           ;; sequences
1300           (copy-seq proper-sequence => copied-sequence)
1301           (elt proper-sequence index => object)
1302           (fill proper-sequence item &key (start 0) (end nil) => sequence) ;
1303           (make-sequence result-type size &key (initial-element *implementation-dependent-element*) => sequence)
1304           (subseq sequence start &optional (end nil) => subsequence)
1305           (map result-sequence-type function &rest sequences+ => result)
1306           (map-into result-sequence function &rest sequences => result-sequence)
1307           (reduce function sequence &key key (from-end nil) (start 0) (end nil) initial-value => result)
1308           (count item sequence &key (from-end nil) (start 0) (end nil) key test test-not => n)
1309           (count-if predicate sequence &key (from-end nil) (start 0) (end nil) key => n)
1310           (count-if-not predicate sequence &key (from-end nil) (start 0) (end nil) key => n)
1311           (length sequence => n)
1312           (reverse sequence => reversed-sequence)
1313           (nreverse sequence => reversed-sequence)
1314           (sort sequence predicate &key key => destructively-sorted-sequence)
1315           (stable-sort sequence predicate &key key => destructively-sorted-sequence)
1316           (find item sequence &key (from-end nil) test test-not (start 0) (end nil) key => element)
1317           (find-if predicate sequence &key (from-end nil) (start 0) (end nil) key => element)
1318           (find-if-not predicate sequence &key (from-end nil) (start 0) (end nil) key => element)
1319           (position item sequence &key (from-end nil) test test-not (start 0) (end nil) key => position)
1320           (position-if predicate sequence &key (from-end nil) (start 0) (end nil) key => position)
1321           (position-if-not predicate sequence &key (from-end nil) (start 0) (end nil) key => position)
1322           (search subsequence sequence &key (from-end nil) test test-not key (start1 0) (start2 0) (end1 nil) (end2 nil) => position)
1323           (mismatch sequence-1 sequence-2 &key (from-end nil) test test-not key (start1 0) (start2 0) (end1 nil) (end2 nil) => position)
1324           (replace sequence-1 sequence-2 &key (start1 0) (end1 nil) (start2 0) (end2 nil) => destructively-modified-sequence-1)
1325           (substitute newitem olditem sequence &key (from-end nil) test test-not (start 0) (end nil) (count nil) key => result-sequence)
1326           (substitute-if newitem predicate sequence &key (from-end nil) (start 0) (end nil) (count nil) key => result-sequence)
1327           (substitute-if-not newitem predicate sequence &key (from-end nil) (start 0) (end nil) (count nil) key => result-sequence)
1328           (nsubstitute newitem olditem sequence &key (from-end nil) test test-not (start 0) (end nil) (count nil) key => sequence)
1329           (nsubstitute-if newitem predicate sequence &key (from-end nil) (start 0) (end nil) (count nil) key=> sequence)
1330           (nsubstitute-if-not newitem predicate sequence &key (from-end nil) (start 0) (end nil) (count nil) key => sequence)
1331           (concatenate result-type &rest sequences => result-sequence)
1332           (merge result-type sequence-1 sequence-2 predicate &key key => result-sequence)
1333           (remove item sequence &key (from-end nil) test test-not (start 0) (end nil) (count nil) key => result-sequence)
1334           (remove-if test sequence &key (from-end nil) (start 0) (end nil) (count nil) key => result-sequence)
1335           (remove-if-not test sequence &key (from-end nil) (start 0) (end nil) (count nil) key => result-sequence)
1336           (delete item sequence &key (from-end nil) test test-not (start 0) (end nil) (count nil) key => result-sequence)
1337           (delete-if test sequence &key (from-end nil) (start 0) (end nil) (count nil) key => result-sequence)
1338           (delete-if-not test sequence &key (from-end nil) (start 0) (end nil) (count nil) key => result-sequence)
1339           (remove-duplicates sequence &key (from-end nil) test test-not (start 0) (end nil) key => result-sequence)
1340           (delete-duplicates sequence &key (from-end nil) test test-not (start 0) (end nil) key => result-sequence)
1341
1342
1343           ;; hash tables
1344           (make-hash-table &key (test #'eql) (size *implementation-dependent-size*) (rehash-size *implementation-dependent-rehash-size*) (rehash-threshold *implementation-dependent-threshold) => hash-table)
1345           (hash-table-p object => generalized-boolean)
1346           (hash-table-count hash-table => count)
1347           (hash-table-rehash-size hash-table => rehash-size)
1348           (hash-table-rehash-threshold hash-table => rehash-threshold)
1349           (hash-table-size hash-table => size)
1350           (hash-table-test hash-table => test)
1351           (gethash key hash-table &optional (default nil) => value present-p)
1352           (remhash key hash-table => generalized-boolean)
1353           (maphash function hash-table => nil)
1354           (with-hash-table-iterator . "(name hash-table) declaration* form* => result*")
1355           (clrhash hash-table => hash-table)
1356           (sxhash object => hash-code)
1357
1358           ;; filenames
1359           (pathname pathspec => pathname)
1360           (make-pathname &key host device directory name type version defaults case => pathname)
1361           (pathnamep object => generalized-boolean)
1362           (pathname-host pathname-designator &key (case :local) => host)
1363           (pathname-device pathname-designator &key (case :local) => device)
1364           (pathname-directory pathname-designator &key (case :local) => directory)
1365           (pathname-name pathname-designator &key (case :local) => name)
1366           (pathname-type pathname-designator &key (case :local) => type)
1367           (pathname-version pathname-designator => version)
1368           (load-logical-pathname-translations host => just-loaded)
1369           (logical-pathname-translations host => translations)
1370           (logical-pathname pathspec => logical-pathname)
1371           (namestring pathname-designator => namestring)
1372           (file-namestring pathname-designator => namestring)
1373           (directory-namestring pathname-designator => namestring)
1374           (host-namestring pathname-designator => namestring)
1375           (enough-namestring pathname-designator &optional (defaults *default-pathname-defaults*) => namestring)
1376           (parse-namestring thing &optional host (default-pathname *default-pathname-defaults*) &key (start 0) (end nil) (junk-allowed nil) => pathname position)
1377           (wild-pathname-p pathname &optional (field-key nil) => generalized-boolean)
1378           (pathname-match-p pathname wildcard => generalized-boolean)
1379           (translate-logical-pathname pathname &key => physical-pathname)
1380           (translate-pathname source from-wildcard to-wildcard &key => translated-pathname)
1381           (merge-pathnames pathname &optional (default-pathname *default-pathname-defaults*) (default-version :newest) => merged-pathname)
1382           
1383           ;; files
1384           (directory pathspec &key => pathnames)
1385           (probe-file pathspec => truename)
1386           (ensure-directories-exist pathspec &key verbose => pathspec created)
1387           (truename filespec => truename)
1388           (file-author pathspec => author)
1389           (file-write-date pathspec => date)
1390           (rename-file filespec new-name => defaulted-new-name old-truename new-truename)
1391           (delete-file filespec => t)
1392           (file-error-pathname condition => pathspec)
1393
1394           ;; streams
1395           (input-stream-p stream => generalized-boolean)
1396           (output-stream-p stream => generalized-boolean)
1397           (interactive-stream-p stream => generalized-boolean)
1398           (open-stream-p stream => generalized-boolean)
1399           (stream-element-type stream => typespec)
1400           (streamp object => generalized-boolean)
1401           (read-byte stream &optional (eof-error-p t) (eof-value nil) => byte)
1402           (write-byte byte stream => byte)
1403           (peek-char &optional (peek-type nil) (input-stream *standard-input*) (eof-error-p t) (eof-value nil) (recursive-p nil) => char)
1404           (read-char &optional (input-stream *standard-input*) (eof-error-p t) (eof-value nil) (recursive-p nil) => char)
1405           (read-char-no-hang &optional (input-stream *standard-input*) (eof-error-p t) (eof-value nil) (recursive-p nil) => char)
1406           (terpri &optional (output-stream *standard-output*) => nil)
1407           (fresh-line &optional (output-stream *standard-output*) => generalized-boolean)
1408           (unread-char character &optional (input-stream *standard-input*) => nil)
1409           (write-char character &optional (output-stream *standard-output*) => character)
1410           (read-line &optional (input-stream *standard-input*) (eof-error-p t) (eof-value nil) (recursive-p nil) => line missing-newline-p)
1411           (write-string string &optional (output-stream *standard-output*) &key (start 0) (end nil) => string)
1412           (write-line string &optional (output-stream *standard-output*) &key (start 0) (end nil) => string)
1413           (read-sequence sequence stream &key (start 0) (end nil) => position)
1414           (write-sequence sequence stream &key (start 0) (end nil) => sequence)
1415           (file-length stream => length)
1416           ;;(file-position stream => position)
1417           ;;(file-position stream position-spec => success-p)
1418           (file-string-length stream object => length)
1419           (open filespec &key (direction :input) (element-type 'character) if-exists if-does-not-exist external-format => stream)
1420           (stream-external-format stream => format)
1421           (with-open-file . "(stream filespec options*) declaration* form* => results")
1422           (close stream &key (abort nil) => result)
1423           (with-open-stream . "(var stream) declaration* form* => result*")
1424           (listen &optional (input-stream *standard-input*) => generalized-boolean)
1425           (clear-input &optional (input-stream *standard-input*) => nil)
1426           (finish-output &optional (output-stream *standard-output*) => nil)
1427           (force-output &optional (output-stream *standard-output*) => nil)
1428           (clear-output &optional (output-stream *standard-output*) => nil)
1429           (y-or-n-p &optional control &rest arguments => generalized-boolean)
1430           (yes-or-no-p &optional control &rest arguments => generalized-boolean)
1431           (make-synonym-stream symbol => synonym-stream)
1432           (synonym-stream-symbol synonym-stream => symbol)
1433           (broadcast-stream-streams broadcast-stream => streams)
1434           (make-broadcast-stream &rest streams => broadcast-stream)
1435           (make-two-way-stream input-stream output-stream => two-way-stream)
1436           (two-way-stream-input-stream two-way-stream => input-stream)
1437           (two-way-stream-output-stream two-way-stream => output-stream)
1438           (echo-stream-input-stream echo-stream => input-stream)
1439           (echo-stream-output-stream echo-stream => output-stream)
1440           (make-echo-stream input-stream output-stream => echo-stream)
1441           (concatenated-stream-streams concatenated-stream => streams)
1442           (make-concatenated-stream &rest input-streams => concatenated-stream)
1443           (get-output-stream-string string-output-stream => string)
1444           (make-string-input-stream string &optional (start 0) (end nil) => string-stream)
1445           (make-string-output-stream &key (element-type 'character) => string-stream)
1446           (with-input-from-string . "(var string &key index start end) declaration* form* => result*")
1447           (with-output-to-string . "(var &optional string-form &key element-type) declaration* form* => result*")
1448           (stream-error-stream condition => stream)
1449
1450           ;; printer
1451           (copy-pprint-dispatch &optional (table *print-pprint-dispatch*) => new-table)
1452           (formatter control-string => function)
1453           (pprint-dispatch object &optional (table *print-pprint-dispatch*) => function found-p)
1454           (pprint-exit-if-list-exhausted => nil)
1455           (pprint-fill stream object &optional (colon-p t) (at-sign-p *implementation-dependent-at-sign-p*) => nil)
1456           (pprint-linear stream object &optional (colon-p t) (at-sign-p *implementation-dependent-at-sign-p*) => nil)
1457           (pprint-tabular stream object &optional (colon-p t) (at-sign-p *implementation-dependent-at-sign-p*) (tabsize 16) => nil)
1458           (pprint-indent relative-to n &optional (stream *standard-output*) => nil)
1459           (pprint-logical-block . "(stream-symbol object &key prefix per-line-prefix suffix) declaration* form* => nil")
1460           (pprint-newline kind &optional (stream *standard-output*) => nil)
1461           (pprint-pop => object)
1462           (pprint-tab kind colnum colinc &optional stream => nil)
1463           (print-object object stream => object)
1464           (print-unreadable-object . "(object stream &key type identity) form* => nil")
1465           (set-pprint-dispatch type-specifier function &optional (priority 0) (table *print-pprint-dispatch*) => nil)
1466           (write object &key array base case circle escape gensym length level lines miser-width pprint-dispatch pretty radix readably right-margin (stream *standard-output*) => object)
1467           (prin1 object &optional (output-stream *standard-output*) => object)
1468           (princ object &optional (output-stream *standard-output*) => object)
1469           (print object &optional (output-stream *standard-output*) => object)
1470           (pprint object &optional (output-stream *standard-output*) => <no values>)
1471           (write-to-string object &key array base case circle escape gensym length level lines miser-width pprint-dispatch pretty radix readably right-margin => string)
1472           (prin1-to-string object => string)
1473           (princ-to-string object => string)
1474           (print-not-readable-object condition => object)
1475           (format destination control-string &rest args => result)
1476
1477           ;; reader
1478           (copy-readtable &optional (from-readtable *readtable*) (to-readtable nil) => readtable)
1479           (make-dispatch-macro-character char &optional (non-terminating-p nil) (readtable *readtable*) => t)
1480           (read &optional input-stream (eof-error-p t) (eof-value nil) (recursive-p nil) => object)
1481           (read-preserving-whitespace &optional input-stream (eof-error-p t) (eof-value nil) (recursive-p nil) => object)
1482           (read-delimited-list char &optional (input-stream *standard-input*) (recursive-p nil) => list)
1483           (read-from-string string &optional (eof-error-p t) (eof-value nil) &key (start 0) (end nil) (preserve-whitespace nil) => object position)
1484           (readtable-case readtable => case-sensitivity-mode)
1485           (readtablep object => generalized-boolean)
1486           (get-dispatch-macro-character disp-char sub-char &optional (readtable *readtable*) => function)
1487           (set-dispatch-macro-character disp-char sub-char new-function &optional (readtable *readtable*) => t)
1488           (get-macro-character char &optional (readtable *readtable*) => function non-terminating-p)
1489           (set-macro-character char new-function &optional (non-terminating-p nil) (readtable *readtable*) => t)
1490           (set-syntax-from-char to-char from-char &optional (to-readtable *readtable*) (from-readtable +standard-readtable+) => t)
1491           (with-standard-io-syntax . "form* => result*")
1492
1493           ;; system construction
1494           (compile-file input-file &key (output-file *implementation-defined-output-file*) (verbose *compile-verbose*) (print *compile-print*) (external-format :default) => output-truename warnings-p failure-p)
1495           (compile-file-pathname input-file &key (output-file *implementation-defined-output-file*) &allow-other-keys => pathname)
1496           (load filespec &key (verbose *load-verbose*) (print *load-print*) (if-does-not-exist t) (external-format :default) => generalized-boolean)
1497           (with-compilation-unit . "([[:override override-form]]) form* => result*")
1498           (provide module-name => implementation-dependent)
1499           (require module-name &optional pathname-list => implementation-dependent)
1500
1501           ;; environment
1502           (decode-universal-time universal-time &optional time-zone => second minute hour date month year day daylight-p zone)
1503           (encode-universal-time second minute hour date month year &optional time-zone => universal-time)
1504           (get-universal-time => universal-time)
1505           (get-decoded-time => second minute hour date month year day daylight-p zone)
1506           (sleep seconds => nil)
1507           (apropos string &optional (package nil) => <no values>)
1508           (apropos-list string &optional (package nil) => symbols)
1509           (describe object &optional (stream *standard-output*) => <no values>)
1510           (describe-object object stream => implementation-dependent)
1511           (trace . "function-name* => trace-result")
1512           (untrace . "function-name* => untrace-result")
1513           (step . "form => result*")
1514           (time . "form => result*")
1515           (get-internal-real-time => internal-time)
1516           (get-internal-run-time => internal-time)
1517           (disassemble extended-function-designator-or-lambda-expression => nil)
1518           (documentation x doc-type => documentation)
1519           (room &optional x => implementation-dependent)
1520           (ed &optional x => implementation-dependent)
1521           (inspect object => implementation-dependent)
1522           (dribble &optional pathname => implementation-dependent)
1523           (lisp-implementation-type => description)
1524           (lisp-implementation-version => description)
1525           (short-site-name => description)
1526           (long-site-name => description)
1527           (machine-instance => description)
1528           (machine-type => description)
1529           (machine-version => description)
1530           (software-type => description)
1531           (software-version => description)
1532           (user-homedir-pathname &optional host => pathname)
1533           ))
1534
1535
1536 (provide 'cldoc)
1537
1538 ;;; cldoc.el ends here