12

Is there a way to let emacs automatically search and replace strings/regex in all files that are part of a multifile document? With C-s or M-% only the current buffer is included in the search, even if TeX-master variable is set.

I'm using GNU Emacs 24.3.1

6
  • 1
    classic way is to use tags-query-replace (with etags) Commented Oct 25, 2014 at 11:54
  • What version of Emacs are you using?
    – user65002
    Commented Oct 25, 2014 at 12:24
  • 3
    Enable reftex, it contains features to search and replace (I think it is based on David's answer). Always pair auctex with reftex. Makes your life easier
    – daleif
    Commented Oct 25, 2014 at 13:28
  • 1
    @daleif That's it: reftex-query-replace-document and reftex-search-document. Please add it as solution so I can accept it. Commented Oct 25, 2014 at 14:31
  • @S1lentSt0rm. Done
    – daleif
    Commented Oct 25, 2014 at 17:07

1 Answer 1

13

When ever you use emacs and auctex always remember to enable reftex as well or you will miss out on all sorts of useful goodies. In this case reftex-query-replace-document and reftex-search-document. Another one I like is the label rename feature, really nice.

2
  • 5
    In addition, reftex-isearch-minor-mode lets you use normal C-s key stroke to search the whole multifile document. thanks! Commented Oct 25, 2014 at 17:12
  • @S1lentSt0rm Wow, I never knew I missed this!
    – Eike
    Commented Mar 12, 2021 at 19:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .