From: Richard M. Stallman Date: Thu, 10 Mar 1994 17:23:56 +0000 (+0000) Subject: (find-buffer-visiting): Don't compare NUMBER if it is nil. X-Git-Tag: emacs-19.34~9558 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=181c830f75417889c64060b46adc26af633874d9;p=emacs.git (find-buffer-visiting): Don't compare NUMBER if it is nil. --- diff --git a/lisp/files.el b/lisp/files.el index 1eac656f8b7..8f33ee8d975 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -592,17 +592,18 @@ If there is no such live buffer, return nil." found) (let ((number (nthcdr 10 (file-attributes truename))) (list (buffer-list)) found) - (while (and (not found) list) - (save-excursion - (set-buffer (car list)) - (if (and (equal buffer-file-number number) - ;; Verify this buffer's file number - ;; still belongs to its file. - (file-exists-p buffer-file-name) - (equal (nthcdr 10 (file-attributes buffer-file-name)) - number)) - (setq found (car list)))) - (setq list (cdr list))) + (and number + (while (and (not found) list) + (save-excursion + (set-buffer (car list)) + (if (and (equal buffer-file-number number) + ;; Verify this buffer's file number + ;; still belongs to its file. + (file-exists-p buffer-file-name) + (equal (nthcdr 10 (file-attributes buffer-file-name)) + number)) + (setq found (car list)))) + (setq list (cdr list)))) found)))) (defun find-file-noselect (filename &optional nowarn)