query-replace on multifile document does not work

by davyjones   Last Updated October 10, 2019 07:23 AM

In a multifile project, I turned on reftex and I can do incremental search through all the subfiles, as is alluded to in this post quite a while back, by the following

(add-hook 'TeX-mode-hook (lambda () (reftex-isearch-minor-mode))) ; for AUCTeX

However, the query-replace (or shortkey M-%) function is not working as promised in this document as

  • RefTeX has full support for multifile documents. You can edit parts of several (multifile) documents at the same time without conflicts. RefTeX provides functions to run grep, search and query-replace on all files which are part of a multifile document.

I had expected that it would automatically work since the incremental search works, yet it still only works within the current buffer.

The function reftex-query-replace-document mentioned in another post does work for replacing regular expressions over all the subfiles, or for some very simple strings. If some complicated strings are to be replaced, the cursor will jump to the end of the last file (without doing anything), and we will get the message

user-error: All files processed

Any idea how to make it work as described in the document? Many thanks!

Tags : auctex reftex

Related Questions

Updated September 14, 2016 08:09 AM

Updated September 19, 2016 08:09 AM

Updated November 03, 2017 15:23 PM

Updated March 19, 2016 08:09 AM

Updated March 31, 2017 17:23 PM