Mercurial > emacs
diff lisp/eshell/esh-cmd.el @ 97442:5be4c494e1d5
(eshell/which): Handle the case where no description is found.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Wed, 13 Aug 2008 03:12:36 +0000 |
parents | b0ac9927a5c0 |
children | 3c44de892298 |
line wrap: on
line diff
--- a/lisp/eshell/esh-cmd.el Tue Aug 12 20:00:18 2008 +0000 +++ b/lisp/eshell/esh-cmd.el Wed Aug 13 03:12:36 2008 +0000 @@ -1252,9 +1252,12 @@ (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))))))