summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/eldoc.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-09-11 22:32:57 -0700
committerGlenn Morris <rgm@gnu.org>2013-09-11 22:32:57 -0700
commit30213927b6eebe291cd425d5863f54bffe0b8a83 (patch)
treea66f7b728c1ba3723a02d2b242cecf3660053bc4 /lisp/emacs-lisp/eldoc.el
parent170266d096bc4d0952bee907532d14503e882bf6 (diff)
Use with-demoted-errors now that it can format any error messages
* dframe.el (dframe-timer-fn): * files.el (dir-locals-read-from-file): * mpc.el (mpc--status-timer-run, mpc--status-idle-timer-run, mpc-format): * reveal.el (reveal-post-command): * saveplace.el (load-save-place-alist-from-file): * shell.el (shell-resync-dirs): * w32-common-fns.el (x-get-selection-value): * emacs-lisp/copyright.el (copyright-find-copyright): * emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): * emulation/tpu-edt.el (tpu-copy-keyfile): * play/bubbles.el (bubbles--mark-neighbourhood): * progmodes/executable.el (executable-make-buffer-file-executable-if-script-p): * term/pc-win.el (x-get-selection-value): Use with-demoted-errors.
Diffstat (limited to 'lisp/emacs-lisp/eldoc.el')
-rw-r--r--lisp/emacs-lisp/eldoc.el41
1 files changed, 20 insertions, 21 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 9b9fd32594..250f93800e 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -309,27 +309,26 @@ This variable is expected to be made buffer-local by modes (other than
Emacs Lisp mode) that support ElDoc.")
(defun eldoc-print-current-symbol-info ()
- (condition-case err
- (and (or (eldoc-display-message-p) eldoc-post-insert-mode)
- (if eldoc-documentation-function
- (eldoc-message (funcall eldoc-documentation-function))
- (let* ((current-symbol (eldoc-current-symbol))
- (current-fnsym (eldoc-fnsym-in-current-sexp))
- (doc (cond
- ((null current-fnsym)
- nil)
- ((eq current-symbol (car current-fnsym))
- (or (apply 'eldoc-get-fnsym-args-string
- current-fnsym)
- (eldoc-get-var-docstring current-symbol)))
- (t
- (or (eldoc-get-var-docstring current-symbol)
- (apply 'eldoc-get-fnsym-args-string
- current-fnsym))))))
- (eldoc-message doc))))
- ;; This is run from post-command-hook or some idle timer thing,
- ;; so we need to be careful that errors aren't ignored.
- (error (message "eldoc error: %s" err))))
+ ;; This is run from post-command-hook or some idle timer thing,
+ ;; so we need to be careful that errors aren't ignored.
+ (with-demoted-errors "eldoc error: %s"
+ (and (or (eldoc-display-message-p) eldoc-post-insert-mode)
+ (if eldoc-documentation-function
+ (eldoc-message (funcall eldoc-documentation-function))
+ (let* ((current-symbol (eldoc-current-symbol))
+ (current-fnsym (eldoc-fnsym-in-current-sexp))
+ (doc (cond
+ ((null current-fnsym)
+ nil)
+ ((eq current-symbol (car current-fnsym))
+ (or (apply 'eldoc-get-fnsym-args-string
+ current-fnsym)
+ (eldoc-get-var-docstring current-symbol)))
+ (t
+ (or (eldoc-get-var-docstring current-symbol)
+ (apply 'eldoc-get-fnsym-args-string
+ current-fnsym))))))
+ (eldoc-message doc))))))
(defun eldoc-get-fnsym-args-string (sym &optional index)
"Return a string containing the parameter list of the function SYM.