aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris <[email protected]>2008-08-13 03:12:49 +0000
committerGlenn Morris <[email protected]>2008-08-13 03:12:49 +0000
commitc1043701f647fefd3975bc05191308e09edd42a4 (patch)
treee483d6f30a109a39dfc358ce58109131cc5c67a1
parent05d1da31b577a38fc30b1d879aad17899ab98c40 (diff)
(eshell/which): Handle the case where no description is found.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/eshell/esh-cmd.el9
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a4fa0a3e64..8426b30789 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-13 Glenn Morris <[email protected]>
+
+ * eshell/esh-cmd.el (eshell/which): Handle the case where no description
+ is found.
+
2008-08-12 Alan Mackenzie <[email protected]>
* progmodes/cc-defs.el (c-emacs-features):
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 82619d6079..17ae50d1f5 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))))))