# HG changeset patch # User Glenn Morris # Date 1218597156 0 # Node ID 5be4c494e1d506f13fb8909c4bc7fb1226ddd253 # Parent 3f5d22fa387720bd75e0a01fac4dbd2ade6e3ec3 (eshell/which): Handle the case where no description is found. diff -r 3f5d22fa3877 -r 5be4c494e1d5 lisp/eshell/esh-cmd.el --- 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))))))