Skip to content

Doesn't work with multi-occur #7

Closed
weissjeffm opened this Issue Jun 27, 2012 · 6 comments

2 participants

@weissjeffm

To reproduce:
1) M-x multi-occur-in-matching-buffers, select some buffers, select some matching text that occurs in more than 1 buffer
2) In the Occur buffer, press e for edit mode
3) move to one of the matches, press C-; to activate iedit
4) change the matches

result: only one of the buffers is actually updated, the rest are not.

I think it is because of this:
https://github.com/victorhge/iedit/blob/master/iedit.el#L828

the modification hooks are disabled, and multi-occur depends on them to update the files.

@victorhge
Owner

I did a quick fix for this problem. Please check it out:
1d32922

But please exclude the first occurrence in the occur buffer first.

BR/
Victor Ren

@weissjeffm

I tried this (by saving the iedit.el and running eval-buffer on it).

When in Occur edit mode, i hit C-; to select a candidate, as soon as I start editing it, I get

let: Symbol's value as variable is void: beginning

I'm not quite sure how that happens, by looking at the code seems like it should work. But then again I'm an elisp newb.

@victorhge
Owner

It was a typo and was fixed in the later commit.

Try the branch header please:
https://github.com/victorhge/iedit/blob/master/iedit.el

@weissjeffm

That works! Thanks!

One minor issue I noticed. In the Occur buffer, I accidentally activated iedit while the buffer was still read-only (before i pressed e to start Occur edit mode). Then I switched to edit mode, and activated iedit again, and every character I inserted actually inserted two chars into both the Occur buffer and the original buffers.

I suspect the fix is probably for iedit to detect that the buffer is read-only and refuse to activate (printing a message to the status line, I suppose).

@victorhge
Owner
@victorhge
Owner

It is fixed now.
(add-hook 'change-major-mode-hook 'iedit-done nil t)

@victorhge victorhge closed this Jul 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.