From: Richard M. Stallman Date: Fri, 15 May 1998 04:05:56 +0000 (+0000) Subject: (Info-find-node): Use info-file-exists-p X-Git-Tag: emacs-20.3~1010 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9c7924d512a0665724387c7fad59e73e09bf624f;p=emacs.git (Info-find-node): Use info-file-exists-p (info-insert-file-contents): Use info-file-exists-p. (info-file-exists-p): New function. --- diff --git a/lisp/info.el b/lisp/info.el index 872bd830803..9fec6acdeed 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -228,6 +228,10 @@ be last in the list.") (- ext-len ext-left))) suffix)))) +(defun info-file-exists-p (filename) + (and (file-exists-p filename) + (not (file-directory-p filename)))) + (defun info-insert-file-contents (filename &optional visit) "Insert the contents of an info file in the current buffer. Do the right thing if the file has been compressed or zipped." @@ -246,8 +250,8 @@ Do the right thing if the file has been compressed or zipped." decoder (cdr (car tail)))) ;; Try adding suffixes to FILENAME and see if we can find something. (while (and tail - (not (file-exists-p (info-insert-file-contents-1 - filename (car (car tail)))))) + (not (info-file-exists-p (info-insert-file-contents-1 + filename (car (car tail)))))) (setq tail (cdr tail))) ;; If we found a file with a suffix, set DECODER according to the suffix ;; and set FULLNAME to the file's actual name. @@ -342,11 +346,11 @@ In standalone mode, \\\\[Info-exit] exits Emacs itself." ;; Try several variants of specified name. (let ((suffix-list Info-suffix-list)) (while (and suffix-list (not found)) - (cond ((file-exists-p + (cond ((info-file-exists-p (info-insert-file-contents-1 temp (car (car suffix-list)))) (setq found temp)) - ((file-exists-p + ((info-file-exists-p (info-insert-file-contents-1 temp-downcase (car (car suffix-list)))) (setq found temp-downcase)))