1

I am having trouble maintaining my current location in a document while running the re-builder command in Emacs. In a long document the buffer moves to the top of the document whenever I run the re-builder command. I would like it to remain static so I can test the regexp I am working on (wherever it may be). I have then to then switch windows, relocate myself in the buffer, and then move the cursor again to re-builder to begin typing my regexp.

1 Answer 1

1

Try this:

(define-advice reb-update-overlays
    (:around (orig-fun &rest args) save-window-excursion)
  "Advice for `reb-update-overlays' to inhibit window config changes."
  (save-window-excursion (apply orig-fun args)))

;; Remove with:
;; (advice-remove 'reb-update-overlays 'reb-update-overlays@save-window-excursion)

The reb-auto-match-limit user option may also be of note here (tangentially).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.