diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-10-15 13:32:41 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-10-15 13:32:41 -0400 |
commit | dcdf2bd8d690168eed44563651e2d8f379b9c80e (patch) | |
tree | 5de46491f3995fbf10f56c780370f6bf00815a13 /lisp/emacs-lisp | |
parent | f65b226e7abf1e746d9f6a995bf7db3da1997795 (diff) |
* lisp/emacs-lisp/eldoc.el (global-eldoc-mode): Enable by default.
Remove incorrect handling of eldoc-print-after-edit.
(eldoc-message-commands, eldoc-last-data): Use defvar.
* lisp/loadup.el (emacs-lisp/eldoc): Load it.
* src/lisp.mk (lisp): Add emacs-lisp/eldoc.elc.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/eldoc.el | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 7245989c4b..6dddf5b9a4 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -47,9 +47,6 @@ ;;; Code: -(require 'help-fns) ;For fundoc-usage handling functions. -(require 'cl-lib) - (defgroup eldoc nil "Show function arglist or variable docstring in echo area." :group 'lisp @@ -129,7 +126,8 @@ choose to increase the number of buckets, you must do so before loading this file since the obarray is initialized at load time. Remember to keep it a prime number to improve hash performance.") -(defconst eldoc-message-commands +(defvar eldoc-message-commands + ;; Don't define as `defconst' since it would then go to (read-only) purespace. (make-vector eldoc-message-commands-table-size 0) "Commands after which it is appropriate to print in the echo area. ElDoc does not try to print function arglists, etc., after just any command, @@ -140,12 +138,14 @@ This variable contains an obarray of symbols; do not manipulate it directly. Instead, use `eldoc-add-command' and `eldoc-remove-command'.") ;; Not a constant. -(defconst eldoc-last-data (make-vector 3 nil) +(defvar eldoc-last-data (make-vector 3 nil) + ;; Don't define as `defconst' since it would then go to (read-only) purespace. "Bookkeeping; elements are as follows: 0 - contains the last symbol read from the buffer. 1 - contains the string last displayed in the echo area for variables, or argument string for functions. - 2 - 'function if function args, 'variable if variable documentation.") + 2 - `function' if function args, `variable' if variable documentation.") +(make-obsolete-variable 'eldoc-last-data "use your own instead" "25.1") (defvar eldoc-last-message nil) @@ -203,14 +203,13 @@ expression point is on." (define-minor-mode global-eldoc-mode "Enable `eldoc-mode' in all buffers where it's applicable." :group 'eldoc :global t + :initialize 'custom-initialize-delay + :init-value t (setq eldoc-last-message nil) (if global-eldoc-mode (progn - (when eldoc-print-after-edit - (setq-local eldoc-message-commands (eldoc-edit-message-commands))) (add-hook 'post-command-hook #'eldoc-schedule-timer) (add-hook 'pre-command-hook #'eldoc-pre-command-refresh-echo-area)) - (kill-local-variable 'eldoc-message-commands) (remove-hook 'post-command-hook #'eldoc-schedule-timer) (remove-hook 'pre-command-hook #'eldoc-pre-command-refresh-echo-area))) |