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))))))