FUEL: Error message is now shown if word can't be found.

db4
Björn Lindqvist 2013-08-14 13:21:19 +02:00
parent 63ee0de2f1
commit ec74afdd23
1 changed files with 6 additions and 6 deletions

View File

@ -126,17 +126,17 @@
t) t)
def))) def)))
(defun fuel-help--word-help (&optional see word display-only) (defun fuel-help--word-help (&optional see word display-only print-message)
(let ((def (or word (fuel-help--read-word see)))) (let ((def (or word (fuel-help--read-word see))))
(when def (when def
(let ((cmd `(:fuel* (,def ,(if see 'fuel-word-see 'fuel-word-help)) (let ((cmd `(:fuel* (,def ,(if see 'fuel-word-see 'fuel-word-help))
"fuel" t))) "fuel" t)))
(when (called-interactively-p 'any) (when print-message
(message "Looking up '%s' ..." def)) (message "Looking up '%s' ..." def))
(let* ((ret (fuel-eval--send/wait cmd)) (let* ((ret (fuel-eval--send/wait cmd))
(res (fuel-eval--retort-result ret))) (res (fuel-eval--retort-result ret)))
(if (not res) (if (not res)
(when (called-interactively-p 'any) (when print-message
(message "No help for '%s'" def)) (message "No help for '%s'" def))
(fuel-help--insert-contents (fuel-help--insert-contents
(list def def 'word) res display-only))))))) (list def def 'word) res display-only)))))))
@ -253,11 +253,11 @@
(interactive) (interactive)
(fuel-help--word-help t)) (fuel-help--word-help t))
(defun fuel-help () (defun fuel-help (&optional print-message)
"Show extended help about the symbol at point, using a help "Show extended help about the symbol at point, using a help
buffer." buffer."
(interactive) (interactive "p")
(fuel-help--word-help)) (fuel-help--word-help nil nil nil print-message))
(defun fuel-help-vocab (vocab) (defun fuel-help-vocab (vocab)
"Ask for a vocabulary name and show its help page." "Ask for a vocabulary name and show its help page."