Commit 181c830f authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(find-buffer-visiting): Don't compare NUMBER if it is nil.

parent d7846e08
...@@ -592,17 +592,18 @@ If there is no such live buffer, return nil." ...@@ -592,17 +592,18 @@ If there is no such live buffer, return nil."
found) found)
(let ((number (nthcdr 10 (file-attributes truename))) (let ((number (nthcdr 10 (file-attributes truename)))
(list (buffer-list)) found) (list (buffer-list)) found)
(while (and (not found) list) (and number
(save-excursion (while (and (not found) list)
(set-buffer (car list)) (save-excursion
(if (and (equal buffer-file-number number) (set-buffer (car list))
;; Verify this buffer's file number (if (and (equal buffer-file-number number)
;; still belongs to its file. ;; Verify this buffer's file number
(file-exists-p buffer-file-name) ;; still belongs to its file.
(equal (nthcdr 10 (file-attributes buffer-file-name)) (file-exists-p buffer-file-name)
number)) (equal (nthcdr 10 (file-attributes buffer-file-name))
(setq found (car list)))) number))
(setq list (cdr list))) (setq found (car list))))
(setq list (cdr list))))
found)))) found))))
(defun find-file-noselect (filename &optional nowarn) (defun find-file-noselect (filename &optional nowarn)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment