Vangelis Evangelou <evange...@gmail.com> writes:

> Scenario 2:
>
>    1. Load auctex and set TeX-parse-self to t
>    2. Create a scratch buffer and type in "\documentclass{amsart}". Note
>    that this is different from Scenario 1. The difference is that amsart uses
>    the amstex package. Org export to latex also uses the amstex package.
>    3. Load LaTeX-mode with M-x LaTeX-mode
>
> With Scenario 1 I don't get an error but with Scenario 2 I
> do. reftex-TeX-master-file: Wrong type argument: stringp, nil
>
> As I said in a previous email, this may also be a bug with reftex. Looking
> at the code of reftex-TeX-master-file, I can see that
>
> (let ((master
>         (cond
>          ;; AUCTeX is loaded.  Use its mechanism.
>          ((fboundp 'TeX-master-file)
>           (condition-case nil
>               (TeX-master-file t)
>             (error (buffer-file-name)))))))
>
> and then later it says
>     (cond
>      ((null master)
>       (error "Need a filename for this buffer, please save it first"))

This second part has been removed on Emacs master in
03fc0e0fd51990570759601fa7e64f1cc5b76932: Add RefTeX support for non-file 
buffers

> However, TeX-master-file returns "<none>" if the file is not saved instead
> of nil, so it seems that reftex-TeX-master-file uses TeX-master-file
> wrongly. However, even if reftex-TeX-master-file did use TeX-master-file
> correctly, org-mode would still have a problem because it would hit
> the (error "Need a filename for this buffer, please save it first").
> Because of this I believe that both reftex and org have a bug.

I added a workaround for Emacs <31.
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c4eb9b45c

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
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>

Reply via email to