Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] add flag to exclude iedit changes from undo buffer #69

Open
TLINDEN opened this issue Nov 8, 2016 · 0 comments
Open

Comments

@TLINDEN
Copy link

TLINDEN commented Nov 8, 2016

As far as I understand the docs and source, there's no such feature yet, I wrote the following work-around:

;; Keep buffer-undo-list as is while iedit is active, that is, as long
;; as I am  inside iedit I can undo/redo  current occurences. However,
;; if I leave iedit and issue  the undo command, ALL changes made with
;; iedit  are undone,  whereas the  default behaviour  would be  to go
;; through every change made iside iedit, which I hate.

;; iedit doesn't  provide a customizable  flag to configure  it's undo
;; behavior, so, I modify it myself using defadvice.

(setq my-buffer-undo-list nil)
(advice-add 'iedit-mode :before '(lambda (&rest args) ;; save current
                                   (setq my-buffer-undo-list buffer-undo-list)))

(advice-add 'iedit-mode :after '(lambda (&rest args)  ;; restore previously saved
                                  (setq buffer-undo-list my-buffer-undo-list)))

Maybe this is of use for others, therefore I'm posting it here.

Thanks for iedit anyway, I LOVE LOVE LOVE it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant