oantolin / embark

Emacs Mini-Buffer Actions Rooted in Keymaps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iedit does not function in consult-line exported occur buffers, due to non-read-only header line

jdtsmith opened this issue · comments

Using embark to enter occur and then iedit works well. You can e to enter occur-edit-mode, and use iedit to rename symbols. But when instead you embark-export from consult-line, iedit no longer works, always reporting zero matches.

This is because, unlike a real occur buffer, the header line in the embark-exported consult-line occur buffer (e.g. lines from buffer: .emacs) is not marked read-only. iedit--get-scope explicitly looks for that 'read-only property on the header:

 (let ((beg (if (eq major-mode 'occur-edit-mode) ; skip the first occurrence
				 (next-single-char-property-change 1 'read-only) ...

Lacking such a read-only property, beg gets set to (point-max) and there are obviously no matches. Even leaving iedit out of it, it's not a good idea to allow header line edits since it confuses occur.

I'll make the header line read-only then.

I also made the line numbers read-only matching the occur buffer.

Thanks, this fixes it. Because of the rear-nonsticky though, you can still insert text in the headline. Regular occur doesn't include this property.

Thanks for reporting the consequence of the rear-nonsticky property, I got rid of it now. Let me know if there are further problems.