From c1043701f647fefd3975bc05191308e09edd42a4 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 13 Aug 2008 03:12:49 +0000 Subject: [PATCH] (eshell/which): Handle the case where no description is found. --- lisp/ChangeLog | 5 +++++ lisp/eshell/esh-cmd.el | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a4fa0a3e64e..8426b30789e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-08-13 Glenn Morris + + * eshell/esh-cmd.el (eshell/which): Handle the case where no description + is found. + 2008-08-12 Alan Mackenzie * progmodes/cc-defs.el (c-emacs-features): 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)))))) -- 2.39.2