Subject: Re: bug#60626: 30.0.50; `buffer-live-p' sometimes returns t on killed buffers

From: Ihor Radchenko <[email-masked]>
Date: Wed, 11 Jan 2023 11:08:04 +0000

Michael Heerdegen <[email-masked]> writes:

>> > Are you sure this is the right interpretation?
>>
>> I think so.
>
> Couldn't it be that the buffer had been live when the form had been
> evaluated, but killed when the form had been printed (later)?  The
> information you posted does not necessarily imply that `buffer-live-p'
> ever returned t when called with a killed buffer.

This is likely true.

The test looks like

(unwind-protect
        (org-test-with-temp-text
	    (format "#+begin_src octave :results file graphics :file %s
sombrero;
#+end_src"
		    file)
          (org-babel-execute-src-block)
          (should (search-forward (format "[[file:%s]]" file) nil nil))
          (should (file-readable-p file))
          (should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))))
      ;; clean-up
      (delete-file file)
      (when (get-buffer "*Org-Babel Error Output*")
        (kill-buffer "*Org-Babel Error Output*")))

So, unwind fallback forms are likely executed.

Thanks for the pointer!

I think this bug report can then be closed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>