diff options
| author | Noah Friedman | 1995-11-25 03:45:25 +0000 |
|---|---|---|
| committer | Noah Friedman | 1995-11-25 03:45:25 +0000 |
| commit | 72a9f8fd72a20ae8dfbf7e4202d3191733e52f04 (patch) | |
| tree | 1b816d2cc0cbb97d7a8bd0cafa6c4a9833034852 | |
| parent | 9a166e406cd2765ee33073f35ebb8bff56435407 (diff) | |
| download | emacs-72a9f8fd72a20ae8dfbf7e4202d3191733e52f04.tar.gz emacs-72a9f8fd72a20ae8dfbf7e4202d3191733e52f04.zip | |
(eldoc-message): New macro.
(eldoc-print-var-docstring, eldoc-print-fnsym-args): Use it.
| -rw-r--r-- | lisp/emacs-lisp/eldoc.el | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 68bb9b6d4de..26f6ce751ff 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el | |||
| @@ -11,9 +11,9 @@ | |||
| 11 | ;; LCD Archive Entry: | 11 | ;; LCD Archive Entry: |
| 12 | ;; eldoc|Noah Friedman|friedman@prep.ai.mit.edu| | 12 | ;; eldoc|Noah Friedman|friedman@prep.ai.mit.edu| |
| 13 | ;; show function arglist or variable docstring in echo area| | 13 | ;; show function arglist or variable docstring in echo area| |
| 14 | ;; $Date: 1995/11/18 22:32:07 $|$Revision: 1.3 $|~/misc/eldoc.el.gz| | 14 | ;; $Date: 1995/11/21 15:21:34 $|$Revision: 1.4 $|~/misc/eldoc.el.gz| |
| 15 | 15 | ||
| 16 | ;; $Id: eldoc.el,v 1.3 1995/11/18 22:32:07 friedman Exp friedman $ | 16 | ;; $Id: eldoc.el,v 1.4 1995/11/21 15:21:34 friedman Exp friedman $ |
| 17 | 17 | ||
| 18 | ;; This program is free software; you can redistribute it and/or modify | 18 | ;; This program is free software; you can redistribute it and/or modify |
| 19 | ;; it under the terms of the GNU General Public License as published by | 19 | ;; it under the terms of the GNU General Public License as published by |
| @@ -124,6 +124,16 @@ It is probably best to manipulate this data structure with the commands | |||
| 124 | (append (default-value 'minor-mode-alist) | 124 | (append (default-value 'minor-mode-alist) |
| 125 | '((eldoc-mode eldoc-minor-mode-string))))) | 125 | '((eldoc-mode eldoc-minor-mode-string))))) |
| 126 | 126 | ||
| 127 | ;; In emacs 19.29 and later, and XEmacs 19.13 and later, all messages are | ||
| 128 | ;; recorded in a log. Do not put eldoc messages in that log since | ||
| 129 | ;; they are Legion. | ||
| 130 | (defmacro eldoc-message (&rest args) | ||
| 131 | (if (fboundp 'display-message) | ||
| 132 | ;; XEmacs 19.13 way of preventing log messages. | ||
| 133 | (list 'display-message '(quote no-log) (apply 'list 'format args)) | ||
| 134 | (list 'let (list (list 'message-log-max 'nil)) | ||
| 135 | (apply 'list 'message args)))) | ||
| 136 | |||
| 127 | 137 | ||
| 128 | ;;;###autoload | 138 | ;;;###autoload |
| 129 | (defun eldoc-mode (&optional prefix) | 139 | (defun eldoc-mode (&optional prefix) |
| @@ -229,12 +239,12 @@ option) is not printed." | |||
| 229 | (cond ((> strip 0) | 239 | (cond ((> strip 0) |
| 230 | (let* ((len (length name))) | 240 | (let* ((len (length name))) |
| 231 | (cond ((>= strip len) | 241 | (cond ((>= strip len) |
| 232 | (message "%s" doc)) | 242 | (eldoc-message "%s" doc)) |
| 233 | (t | 243 | (t |
| 234 | (setq name (substring name 0 (- len strip))) | 244 | (setq name (substring name 0 (- len strip))) |
| 235 | (message "%s: %s" name doc))))) | 245 | (eldoc-message "%s: %s" name doc))))) |
| 236 | (t | 246 | (t |
| 237 | (message "%s: %s" s doc)))) | 247 | (eldoc-message "%s: %s" s doc)))) |
| 238 | t)))) | 248 | t)))) |
| 239 | 249 | ||
| 240 | 250 | ||
| @@ -264,10 +274,7 @@ documentation string if possible." | |||
| 264 | (setcdr eldoc-last-data args))) | 274 | (setcdr eldoc-last-data args))) |
| 265 | (and args | 275 | (and args |
| 266 | printit | 276 | printit |
| 267 | ;; In emacs 19.29 and later, all messages are recorded in a log. | 277 | (eldoc-message "%s: %s" sym args)))) |
| 268 | ;; Do not put eldoc messages in the log since they are Legion. | ||
| 269 | (let ((message-log-max nil)) | ||
| 270 | (message "%s: %s" sym args))))) | ||
| 271 | 278 | ||
| 272 | (defun eldoc-fnsym-in-current-sexp () | 279 | (defun eldoc-fnsym-in-current-sexp () |
| 273 | (let* ((p (point)) | 280 | (let* ((p (point)) |