Eli Zaretskii writes: >> Ehmm... I see that test/src/buffer-tests now have 5 failures that >> were not there before: >> >> 5 unexpected results: >> FAILED test-buffer-modifications >> FAILED test-kill-buffer-auto-save-default >> FAILED test-kill-buffer-auto-save-delete-no >> FAILED test-kill-buffer-auto-save-delete-yes >> FAILED test-restore-buffer-modified-p >> >> Also, 7 of the lisp/files-test fail: >> >> 7 unexpected results: >> FAILED files-tests-bug-18141 >> FAILED files-tests-file-name-non-special-make-auto-save-file-name >> FAILED files-tests-file-name-non-special-set-visited-file-modtime >> FAILED files-tests-no-file-write-contents >> FAILED files-tests-revert-buffer >> FAILED files-tests-revert-buffer-with-fine-grain >> FAILED files-tests-zzdont-rewrite-precious-files >> >> Could you please look into these? (Interestingly, those 5+7 don't >> fail for me on MS-Windows, only on GNU/Linux...) FYI, all the tests are passing on my side (GNU/Linux): cd test make src/buffer-tests Ran 406 tests, 406 results as expected, 0 unexpected (2023-12-30 11:24:04+0100, 0.464788 sec) > I think at least part of the problem is in this fragment from > find-file-noselect: > > ;; Find any buffer for a file that has same truename. > (other (and (not buf) > (find-buffer-visiting > filename > ;; We want to filter out buffers that we've > ;; visited via symlinks and the like, where > ;; the symlink no longer exists. > (lambda (buffer) > (let ((file (buffer-local-value > 'buffer-file-name buffer))) > (and file (file-exists-p file)))))))) Not this one - (and file ...) will never trigger when file is nil. > Test test-buffer-modifications backtrace: > file-exists-p(nil) > find-buffer-visiting("/tmp/emacs-test-MzitxT-buffer" #f(compiled-fun > find-file-noselect("/tmp/emacs-test-MzitxT-buffer" nil nil nil) > find-file("/tmp/emacs-test-MzitxT-buffer") > > Please attend to this as soon as you can, because I think this same > problem will break many other use cases. I think I found the problem - it is rather silly. See the attached patch.