summaryrefslogtreecommitdiff
path: root/lisp/eshell
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2008-08-13 03:12:49 +0000
committerGlenn Morris <rgm@gnu.org>2008-08-13 03:12:49 +0000
commitc1043701f647fefd3975bc05191308e09edd42a4 (patch)
treee483d6f30a109a39dfc358ce58109131cc5c67a1 /lisp/eshell
parent05d1da31b577a38fc30b1d879aad17899ab98c40 (diff)
downloademacs-c1043701f647fefd3975bc05191308e09edd42a4.tar.gz
(eshell/which): Handle the case where no description is found.
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/esh-cmd.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 82619d60791..17ae50d1f50 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -1252,9 +1252,12 @@ be finished later after the completion of an asynchronous subprocess."
(prog1
(describe-function sym)
(message nil))))))
- (setq desc (substring desc 0
- (1- (or (string-match "\n" desc)
- (length desc)))))
+ (setq desc (if desc (substring desc 0
+ (1- (or (string-match "\n" desc)
+ (length desc))))
+ ;; This should not happen.
+ (format "%s is defined, \
+but no documentation was found" name)))
(if (buffer-live-p (get-buffer "*Help*"))
(kill-buffer "*Help*"))
(setq program (or desc name))))))