summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-03-10 17:23:56 +0000
committerRichard M. Stallman <rms@gnu.org>1994-03-10 17:23:56 +0000
commit181c830f75417889c64060b46adc26af633874d9 (patch)
treeca0289d6b3a9fbbae42b83a6b235b92e46be01d4 /lisp
parentd7846e08916ee27de2dabec62015cd4c7b34d1b1 (diff)
downloademacs-181c830f75417889c64060b46adc26af633874d9.tar.gz
(find-buffer-visiting): Don't compare NUMBER if it is nil.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el23
1 files changed, 12 insertions, 11 deletions
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)