Hi Ikumi, > > The fundamental origin of the problem is that RefTeX presumes that it > always works in the buffer associated with files. In other words, RefTeX > pays no attention to non-file buffer. (I have such impression, skimming > over the RefTeX code. Please correct me if I'm wrong.) > This has also been my understanding (although I stopped using RefTeX years ago, basically for this reason). >>>>>> "Paul D. Nelson" writes: >> The attached patch addresses the issue for me. Thoughts? > > I have basically the same idea, but I think such partial treatment > inctroduces inconsistent internal state of RefTeX and can be potential > problems. Rather I propose to wrap the whole RefTeX management > part in amsmath.el by (when buffer-file-name ... ). In addition, we > should turn off RefTeX mode in `TeX-mode-cleanup' like > (unless buffer-file-truename > (if (bound-and-true-p reftex-mode) <-- addition > (reftex-mode -1)) <-- addition > (TeX-update-style)) > to avoid inconsistency. > Something like the attached, I guess? There are other uses of "reftex-" in style/, so I guess something similar should be done for all of them? Thanks, best, Paul