Merge from emacs-24; up to 2014-05-29T17:16:00Z!dmantipov@yandex.ru
[bpt/emacs.git] / lisp / emacs-lisp / eldoc.el
1 ;;; eldoc.el --- show function arglist or variable docstring in echo area -*- lexical-binding: t; -*-
2
3 ;; Copyright (C) 1996-2014 Free Software Foundation, Inc.
4
5 ;; Author: Noah Friedman <friedman@splode.com>
6 ;; Maintainer: friedman@splode.com
7 ;; Keywords: extensions
8 ;; Created: 1995-10-06
9
10 ;; This file is part of GNU Emacs.
11
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
16
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25 ;;; Commentary:
26
27 ;; This program was inspired by the behavior of the "mouse documentation
28 ;; window" on many Lisp Machine systems; as you type a function's symbol
29 ;; name as part of a sexp, it will print the argument list for that
30 ;; function. Behavior is not identical; for example, you need not actually
31 ;; type the function name, you need only move point around in a sexp that
32 ;; calls it. Also, if point is over a documented variable, it will print
33 ;; the one-line documentation for that variable instead, to remind you of
34 ;; that variable's meaning.
35
36 ;; One useful way to enable this minor mode is to put the following in your
37 ;; .emacs:
38 ;;
39 ;; (add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
40 ;; (add-hook 'lisp-interaction-mode-hook 'eldoc-mode)
41 ;; (add-hook 'ielm-mode-hook 'eldoc-mode)
42 ;; (add-hook 'eval-expression-minibuffer-setup-hook 'eldoc-mode)
43
44 ;; Major modes for other languages may use ElDoc by defining an
45 ;; appropriate function as the buffer-local value of
46 ;; `eldoc-documentation-function'.
47
48 ;;; Code:
49
50 (require 'help-fns) ;For fundoc-usage handling functions.
51
52 (defgroup eldoc nil
53 "Show function arglist or variable docstring in echo area."
54 :group 'lisp
55 :group 'extensions)
56
57 (defcustom eldoc-idle-delay 0.50
58 "Number of seconds of idle time to wait before printing.
59 If user input arrives before this interval of time has elapsed after the
60 last input, no documentation will be printed.
61
62 If this variable is set to 0, no idle time is required."
63 :type 'number
64 :group 'eldoc)
65
66 (defcustom eldoc-print-after-edit nil
67 "If non-nil eldoc info is only shown when editing.
68 Changing the value requires toggling `eldoc-mode'."
69 :type 'boolean
70 :group 'eldoc)
71
72 ;;;###autoload
73 (defcustom eldoc-minor-mode-string (purecopy " ElDoc")
74 "String to display in mode line when ElDoc Mode is enabled; nil for none."
75 :type '(choice string (const :tag "None" nil))
76 :group 'eldoc)
77
78 (defcustom eldoc-argument-case 'upcase
79 "Case to display argument names of functions, as a symbol.
80 This has two preferred values: `upcase' or `downcase'.
81 Actually, any name of a function which takes a string as an argument and
82 returns another string is acceptable.
83
84 Note that if `eldoc-documentation-function' is non-nil, this variable
85 has no effect, unless the function handles it explicitly."
86 :type '(radio (function-item upcase)
87 (function-item downcase)
88 function)
89 :group 'eldoc)
90
91 (defcustom eldoc-echo-area-use-multiline-p 'truncate-sym-name-if-fit
92 "Allow long ElDoc messages to resize echo area display.
93 If value is t, never attempt to truncate messages; complete symbol name
94 and function arglist or 1-line variable documentation will be displayed
95 even if echo area must be resized to fit.
96
97 If value is any non-nil value other than t, symbol name may be truncated
98 if it will enable the function arglist or documentation string to fit on a
99 single line without resizing window. Otherwise, behavior is just like
100 former case.
101
102 If value is nil, messages are always truncated to fit in a single line of
103 display in the echo area. Function or variable symbol name may be
104 truncated to make more of the arglist or documentation string visible.
105
106 Note that if `eldoc-documentation-function' is non-nil, this variable
107 has no effect, unless the function handles it explicitly."
108 :type '(radio (const :tag "Always" t)
109 (const :tag "Never" nil)
110 (const :tag "Yes, but truncate symbol names if it will\
111 enable argument list to fit on one line" truncate-sym-name-if-fit))
112 :group 'eldoc)
113
114 (defface eldoc-highlight-function-argument
115 '((t (:inherit bold)))
116 "Face used for the argument at point in a function's argument list.
117 Note that if `eldoc-documentation-function' is non-nil, this face
118 has no effect, unless the function handles it explicitly."
119 :group 'eldoc)
120
121 ;;; No user options below here.
122
123 (defvar eldoc-message-commands-table-size 31
124 "Used by `eldoc-add-command' to initialize `eldoc-message-commands' obarray.
125 It should probably never be necessary to do so, but if you
126 choose to increase the number of buckets, you must do so before loading
127 this file since the obarray is initialized at load time.
128 Remember to keep it a prime number to improve hash performance.")
129
130 (defconst eldoc-message-commands
131 (make-vector eldoc-message-commands-table-size 0)
132 "Commands after which it is appropriate to print in the echo area.
133 ElDoc does not try to print function arglists, etc., after just any command,
134 because some commands print their own messages in the echo area and these
135 functions would instantly overwrite them. But `self-insert-command' as well
136 as most motion commands are good candidates.
137 This variable contains an obarray of symbols; do not manipulate it
138 directly. Instead, use `eldoc-add-command' and `eldoc-remove-command'.")
139
140 ;; Not a constant.
141 (defconst eldoc-last-data (make-vector 3 nil)
142 "Bookkeeping; elements are as follows:
143 0 - contains the last symbol read from the buffer.
144 1 - contains the string last displayed in the echo area for variables,
145 or argument string for functions.
146 2 - 'function if function args, 'variable if variable documentation.")
147
148 (defvar eldoc-last-message nil)
149
150 (defvar eldoc-timer nil "ElDoc's timer object.")
151
152 (defvar eldoc-current-idle-delay eldoc-idle-delay
153 "Idle time delay currently in use by timer.
154 This is used to determine if `eldoc-idle-delay' is changed by the user.")
155
156 (defvar eldoc-message-function #'eldoc-minibuffer-message
157 "The function used by `eldoc-message' to display messages.
158 It should receive the same arguments as `message'.")
159
160 (defun eldoc-edit-message-commands ()
161 (let ((cmds (make-vector 31 0))
162 (re (regexp-opt '("delete" "insert" "edit" "electric" "newline"))))
163 (mapatoms (lambda (s)
164 (and (commandp s)
165 (string-match-p re (symbol-name s))
166 (intern (symbol-name s) cmds)))
167 obarray)
168 cmds))
169
170 \f
171 ;;;###autoload
172 (define-minor-mode eldoc-mode
173 "Toggle echo area display of Lisp objects at point (ElDoc mode).
174 With a prefix argument ARG, enable ElDoc mode if ARG is positive,
175 and disable it otherwise. If called from Lisp, enable ElDoc mode
176 if ARG is omitted or nil.
177
178 ElDoc mode is a buffer-local minor mode. When enabled, the echo
179 area displays information about a function or variable in the
180 text where point is. If point is on a documented variable, it
181 displays the first line of that variable's doc string. Otherwise
182 it displays the argument list of the function called in the
183 expression point is on."
184 :group 'eldoc :lighter eldoc-minor-mode-string
185 (setq eldoc-last-message nil)
186 (if eldoc-mode
187 (progn
188 (when eldoc-print-after-edit
189 (setq-local eldoc-message-commands (eldoc-edit-message-commands)))
190 (add-hook 'post-command-hook 'eldoc-schedule-timer nil t)
191 (add-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area nil t))
192 (kill-local-variable 'eldoc-message-commands)
193 (remove-hook 'post-command-hook 'eldoc-schedule-timer t)
194 (remove-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area t)))
195
196 ;;;###autoload
197 (define-obsolete-function-alias 'turn-on-eldoc-mode 'eldoc-mode "24.4")
198
199 \f
200 (defun eldoc-schedule-timer ()
201 (or (and eldoc-timer
202 (memq eldoc-timer timer-idle-list))
203 (setq eldoc-timer
204 (run-with-idle-timer
205 eldoc-idle-delay t
206 (lambda () (and eldoc-mode (eldoc-print-current-symbol-info))))))
207
208 ;; If user has changed the idle delay, update the timer.
209 (cond ((not (= eldoc-idle-delay eldoc-current-idle-delay))
210 (setq eldoc-current-idle-delay eldoc-idle-delay)
211 (timer-set-idle-time eldoc-timer eldoc-idle-delay t))))
212
213 (defvar eldoc-mode-line-string nil)
214 (put 'eldoc-mode-line-string 'risky-local-variable t)
215
216 (defun eldoc-minibuffer-message (format-string &rest args)
217 "Display messages in the mode-line when in the minibuffer.
218 Otherwise work like `message'."
219 (if (minibufferp)
220 (progn
221 (add-hook 'minibuffer-exit-hook
222 (lambda () (setq eldoc-mode-line-string nil
223 ;; http://debbugs.gnu.org/16920
224 eldoc-last-message nil))
225 nil t)
226 (with-current-buffer
227 (window-buffer
228 (or (window-in-direction 'above (minibuffer-window))
229 (minibuffer-selected-window)
230 (get-largest-window)))
231 (unless (and (listp mode-line-format)
232 (assq 'eldoc-mode-line-string mode-line-format))
233 (setq mode-line-format
234 (list "" '(eldoc-mode-line-string
235 (" " eldoc-mode-line-string " "))
236 mode-line-format)))
237 (setq eldoc-mode-line-string
238 (when (stringp format-string)
239 (apply 'format format-string args)))
240 (force-mode-line-update)))
241 (apply 'message format-string args)))
242
243 (defun eldoc-message (&rest args)
244 (let ((omessage eldoc-last-message))
245 (setq eldoc-last-message
246 (cond ((eq (car args) eldoc-last-message) eldoc-last-message)
247 ((null (car args)) nil)
248 ;; If only one arg, no formatting to do, so put it in
249 ;; eldoc-last-message so eq test above might succeed on
250 ;; subsequent calls.
251 ((null (cdr args)) (car args))
252 (t (apply 'format args))))
253 ;; In emacs 19.29 and later, and XEmacs 19.13 and later, all messages
254 ;; are recorded in a log. Do not put eldoc messages in that log since
255 ;; they are Legion.
256 ;; Emacs way of preventing log messages.
257 (let ((message-log-max nil))
258 (cond (eldoc-last-message
259 (funcall eldoc-message-function "%s" eldoc-last-message))
260 (omessage (funcall eldoc-message-function nil)))))
261 eldoc-last-message)
262
263 (defun eldoc--message-command-p (command)
264 (and (symbolp command)
265 (intern-soft (symbol-name command) eldoc-message-commands)))
266
267 ;; This function goes on pre-command-hook for XEmacs or when using idle
268 ;; timers in Emacs. Motion commands clear the echo area for some reason,
269 ;; which make eldoc messages flicker or disappear just before motion
270 ;; begins. This function reprints the last eldoc message immediately
271 ;; before the next command executes, which does away with the flicker.
272 ;; This doesn't seem to be required for Emacs 19.28 and earlier.
273 (defun eldoc-pre-command-refresh-echo-area ()
274 (and eldoc-last-message
275 (not (minibufferp)) ;We don't use the echo area when in minibuffer.
276 (if (and (eldoc-display-message-no-interference-p)
277 (eldoc--message-command-p this-command))
278 (eldoc-message eldoc-last-message)
279 ;; No need to call eldoc-message since the echo area will be cleared
280 ;; for us, but do note that the last-message will be gone.
281 (setq eldoc-last-message nil))))
282
283 ;; Decide whether now is a good time to display a message.
284 (defun eldoc-display-message-p ()
285 (and (eldoc-display-message-no-interference-p)
286 ;; If this-command is non-nil while running via an idle
287 ;; timer, we're still in the middle of executing a command,
288 ;; e.g. a query-replace where it would be annoying to
289 ;; overwrite the echo area.
290 (not this-command)
291 (eldoc--message-command-p last-command)))
292
293
294 ;; Check various conditions about the current environment that might make
295 ;; it undesirable to print eldoc messages right this instant.
296 (defun eldoc-display-message-no-interference-p ()
297 (not (or executing-kbd-macro (bound-and-true-p edebug-active))))
298
299 \f
300 ;;;###autoload
301 (defvar eldoc-documentation-function #'eldoc-documentation-function-default
302 "Function to call to return doc string.
303 The function of no args should return a one-line string for displaying
304 doc about a function etc. appropriate to the context around point.
305 It should return nil if there's no doc appropriate for the context.
306 Typically doc is returned if point is on a function-like name or in its
307 arg list.
308
309 The result is used as is, so the function must explicitly handle
310 the variables `eldoc-argument-case' and `eldoc-echo-area-use-multiline-p',
311 and the face `eldoc-highlight-function-argument', if they are to have any
312 effect.
313
314 This variable is expected to be made buffer-local by modes (other than
315 Emacs Lisp mode) that support ElDoc.")
316
317 (defun eldoc-print-current-symbol-info ()
318 ;; This is run from post-command-hook or some idle timer thing,
319 ;; so we need to be careful that errors aren't ignored.
320 (with-demoted-errors "eldoc error: %s"
321 (and (or (eldoc-display-message-p)
322 ;; Erase the last message if we won't display a new one.
323 (when eldoc-last-message
324 (eldoc-message nil)
325 nil))
326 (eldoc-message (funcall eldoc-documentation-function)))))
327
328 (defun eldoc-documentation-function-default ()
329 "Default value for `eldoc-documentation-function' (which see)."
330 (let ((current-symbol (eldoc-current-symbol))
331 (current-fnsym (eldoc-fnsym-in-current-sexp)))
332 (cond ((null current-fnsym)
333 nil)
334 ((eq current-symbol (car current-fnsym))
335 (or (apply #'eldoc-get-fnsym-args-string current-fnsym)
336 (eldoc-get-var-docstring current-symbol)))
337 (t
338 (or (eldoc-get-var-docstring current-symbol)
339 (apply #'eldoc-get-fnsym-args-string current-fnsym))))))
340
341 (defun eldoc-get-fnsym-args-string (sym &optional index)
342 "Return a string containing the parameter list of the function SYM.
343 If SYM is a subr and no arglist is obtainable from the docstring
344 or elsewhere, return a 1-line docstring. Calls the functions
345 `eldoc-function-argstring-format' and
346 `eldoc-highlight-function-argument' to format the result. The
347 former calls `eldoc-argument-case'; the latter gives the
348 function name `font-lock-function-name-face', and optionally
349 highlights argument number INDEX."
350 (let (args doc advertised)
351 (cond ((not (and sym (symbolp sym) (fboundp sym))))
352 ((and (eq sym (aref eldoc-last-data 0))
353 (eq 'function (aref eldoc-last-data 2)))
354 (setq doc (aref eldoc-last-data 1)))
355 ((listp (setq advertised (gethash (indirect-function sym)
356 advertised-signature-table t)))
357 (setq args advertised))
358 ((setq doc (help-split-fundoc (documentation sym t) sym))
359 (setq args (car doc))
360 ;; Remove any enclosing (), since e-function-argstring adds them.
361 (string-match "\\`[^ )]* ?" args)
362 (setq args (substring args (match-end 0)))
363 (if (string-match-p ")\\'" args)
364 (setq args (substring args 0 -1))))
365 (t
366 (setq args (help-function-arglist sym))))
367 (if args
368 ;; Stringify, and store before highlighting, downcasing, etc.
369 ;; FIXME should truncate before storing.
370 (eldoc-last-data-store sym (setq args (eldoc-function-argstring args))
371 'function)
372 (setq args doc)) ; use stored value
373 ;; Change case, highlight, truncate.
374 (if args
375 (eldoc-highlight-function-argument
376 sym (eldoc-function-argstring-format args) index))))
377
378 (defun eldoc-highlight-function-argument (sym args index)
379 "Highlight argument INDEX in ARGS list for function SYM.
380 In the absence of INDEX, just call `eldoc-docstring-format-sym-doc'."
381 (let ((start nil)
382 (end 0)
383 (argument-face 'eldoc-highlight-function-argument))
384 ;; Find the current argument in the argument string. We need to
385 ;; handle `&rest' and informal `...' properly.
386 ;;
387 ;; FIXME: What to do with optional arguments, like in
388 ;; (defun NAME ARGLIST [DOCSTRING] BODY...) case?
389 ;; The problem is there is no robust way to determine if
390 ;; the current argument is indeed a docstring.
391 (while (and index (>= index 1))
392 (if (string-match "[^ ()]+" args end)
393 (progn
394 (setq start (match-beginning 0)
395 end (match-end 0))
396 (let ((argument (match-string 0 args)))
397 (cond ((string= argument "&rest")
398 ;; All the rest arguments are the same.
399 (setq index 1))
400 ((string= argument "&optional"))
401 ((string-match-p "\\.\\.\\.$" argument)
402 (setq index 0))
403 (t
404 (setq index (1- index))))))
405 (setq end (length args)
406 start (1- end)
407 argument-face 'font-lock-warning-face
408 index 0)))
409 (let ((doc args))
410 (when start
411 (setq doc (copy-sequence args))
412 (add-text-properties start end (list 'face argument-face) doc))
413 (setq doc (eldoc-docstring-format-sym-doc
414 sym doc (if (functionp sym) 'font-lock-function-name-face
415 'font-lock-keyword-face)))
416 doc)))
417
418 ;; Return a string containing a brief (one-line) documentation string for
419 ;; the variable.
420 (defun eldoc-get-var-docstring (sym)
421 (when sym
422 (cond ((and (eq sym (aref eldoc-last-data 0))
423 (eq 'variable (aref eldoc-last-data 2)))
424 (aref eldoc-last-data 1))
425 (t
426 (let ((doc (documentation-property sym 'variable-documentation t)))
427 (cond (doc
428 (setq doc (eldoc-docstring-format-sym-doc
429 sym (eldoc-docstring-first-line doc)
430 'font-lock-variable-name-face))
431 (eldoc-last-data-store sym doc 'variable)))
432 doc)))))
433
434 (defun eldoc-last-data-store (symbol doc type)
435 (aset eldoc-last-data 0 symbol)
436 (aset eldoc-last-data 1 doc)
437 (aset eldoc-last-data 2 type))
438
439 ;; Note that any leading `*' in the docstring (which indicates the variable
440 ;; is a user option) is removed.
441 (defun eldoc-docstring-first-line (doc)
442 (and (stringp doc)
443 (substitute-command-keys
444 (save-match-data
445 ;; Don't use "^" in the regexp below since it may match
446 ;; anywhere in the doc-string.
447 (let ((start (if (string-match "\\`\\*" doc) (match-end 0) 0)))
448 (cond ((string-match "\n" doc)
449 (substring doc start (match-beginning 0)))
450 ((zerop start) doc)
451 (t (substring doc start))))))))
452
453 ;; If the entire line cannot fit in the echo area, the symbol name may be
454 ;; truncated or eliminated entirely from the output to make room for the
455 ;; description.
456 (defun eldoc-docstring-format-sym-doc (sym doc face)
457 (save-match-data
458 (let* ((name (symbol-name sym))
459 (ea-multi eldoc-echo-area-use-multiline-p)
460 ;; Subtract 1 from window width since emacs will not write
461 ;; any chars to the last column, or in later versions, will
462 ;; cause a wraparound and resize of the echo area.
463 (ea-width (1- (window-width (minibuffer-window))))
464 (strip (- (+ (length name) (length ": ") (length doc)) ea-width)))
465 (cond ((or (<= strip 0)
466 (eq ea-multi t)
467 (and ea-multi (> (length doc) ea-width)))
468 (format "%s: %s" (propertize name 'face face) doc))
469 ((> (length doc) ea-width)
470 (substring (format "%s" doc) 0 ea-width))
471 ((>= strip (length name))
472 (format "%s" doc))
473 (t
474 ;; Show the end of the partial symbol name, rather
475 ;; than the beginning, since the former is more likely
476 ;; to be unique given package namespace conventions.
477 (setq name (substring name strip))
478 (format "%s: %s" (propertize name 'face face) doc))))))
479
480 \f
481 ;; Return a list of current function name and argument index.
482 (defun eldoc-fnsym-in-current-sexp ()
483 (save-excursion
484 (let ((argument-index (1- (eldoc-beginning-of-sexp))))
485 ;; If we are at the beginning of function name, this will be -1.
486 (when (< argument-index 0)
487 (setq argument-index 0))
488 ;; Don't do anything if current word is inside a string.
489 (if (= (or (char-after (1- (point))) 0) ?\")
490 nil
491 (list (eldoc-current-symbol) argument-index)))))
492
493 ;; Move to the beginning of current sexp. Return the number of nested
494 ;; sexp the point was over or after.
495 (defun eldoc-beginning-of-sexp ()
496 (let ((parse-sexp-ignore-comments t)
497 (num-skipped-sexps 0))
498 (condition-case _
499 (progn
500 ;; First account for the case the point is directly over a
501 ;; beginning of a nested sexp.
502 (condition-case _
503 (let ((p (point)))
504 (forward-sexp -1)
505 (forward-sexp 1)
506 (when (< (point) p)
507 (setq num-skipped-sexps 1)))
508 (error))
509 (while
510 (let ((p (point)))
511 (forward-sexp -1)
512 (when (< (point) p)
513 (setq num-skipped-sexps (1+ num-skipped-sexps))))))
514 (error))
515 num-skipped-sexps))
516
517 ;; returns nil unless current word is an interned symbol.
518 (defun eldoc-current-symbol ()
519 (let ((c (char-after (point))))
520 (and c
521 (memq (char-syntax c) '(?w ?_))
522 (intern-soft (current-word)))))
523
524 ;; Do indirect function resolution if possible.
525 (defun eldoc-symbol-function (fsym)
526 (let ((defn (symbol-function fsym)))
527 (and (symbolp defn)
528 (condition-case _
529 (setq defn (indirect-function fsym))
530 (error (setq defn nil))))
531 defn))
532
533 (defun eldoc-function-argstring (arglist)
534 "Return ARGLIST as a string enclosed by ().
535 ARGLIST is either a string, or a list of strings or symbols."
536 (cond ((stringp arglist))
537 ((not (listp arglist))
538 (setq arglist nil))
539 ((symbolp (car arglist))
540 (setq arglist
541 (mapconcat (lambda (s) (symbol-name s))
542 arglist " ")))
543 ((stringp (car arglist))
544 (setq arglist
545 (mapconcat (lambda (s) s)
546 arglist " "))))
547 (if arglist
548 (format "(%s)" arglist)))
549
550 (defun eldoc-function-argstring-format (argstring)
551 "Apply `eldoc-argument-case' to each word in ARGSTRING.
552 The words \"&rest\", \"&optional\" are returned unchanged."
553 (mapconcat (lambda (s)
554 (if (string-match-p "\\`(?&\\(?:optional\\|rest\\))?\\'" s)
555 s
556 (funcall eldoc-argument-case s)))
557 (split-string argstring) " "))
558
559 \f
560 ;; When point is in a sexp, the function args are not reprinted in the echo
561 ;; area after every possible interactive command because some of them print
562 ;; their own messages in the echo area; the eldoc functions would instantly
563 ;; overwrite them unless it is more restrained.
564 ;; These functions do display-command table management.
565
566 (defun eldoc-add-command (&rest cmds)
567 (dolist (name cmds)
568 (and (symbolp name)
569 (setq name (symbol-name name)))
570 (set (intern name eldoc-message-commands) t)))
571
572 (defun eldoc-add-command-completions (&rest names)
573 (dolist (name names)
574 (apply 'eldoc-add-command (all-completions name obarray 'commandp))))
575
576 (defun eldoc-remove-command (&rest cmds)
577 (dolist (name cmds)
578 (and (symbolp name)
579 (setq name (symbol-name name)))
580 (unintern name eldoc-message-commands)))
581
582 (defun eldoc-remove-command-completions (&rest names)
583 (dolist (name names)
584 (apply 'eldoc-remove-command
585 (all-completions name eldoc-message-commands))))
586
587 \f
588 ;; Prime the command list.
589 (eldoc-add-command-completions
590 "backward-" "beginning-of-" "delete-other-windows" "delete-window"
591 "down-list" "end-of-" "exchange-point-and-mark" "forward-" "goto-"
592 "handle-select-window" "indent-for-tab-command" "left-" "mark-page"
593 "mark-paragraph" "mouse-set-point" "move-" "move-beginning-of-"
594 "move-end-of-" "next-" "other-window" "pop-global-mark" "previous-"
595 "recenter" "right-" "scroll-" "self-insert-command" "split-window-"
596 "up-list")
597
598 (provide 'eldoc)
599
600 ;;; eldoc.el ends here