Re: erc-ircfmt.el: Transient-based formatting for Erc (Emacs 29+)
Alcor <[email protected]> Sun, 17 Mar 2024 21:13:08 +0100
| Newsgroups | gmane.emacs.erc.general |
|---|---|
| Message-ID | <[email protected]> |
"J.P." <[email protected]> writes: > FWIW, when `fill-wrap' is active, it's supposed to remove select > properties via `erc-stamp--display-margin-mode': > > (add-function :filter-return (local 'filter-buffer-substring-function) > #'erc--remove-text-properties) > > Perhaps we could promote that to baseline `erc-mode' copying behavior, > and then allow various modules to extend it somehow, e.g., by overriding > `erc--own-property-names' locally. For stripping face props when yanking > into the prompt area, maybe see `yank-transform-functions' (29+). Thanks for the idea with `yank-transform-functions'. It's pretty neat, and I managed to write exactly what I wanted with it (See attachments). It's a bit rough around the edges, but it works. >> It's possible to have it fallback onto a normal prefixed command tree if >> transient.el is not available. But I'm wondering what's the support >> matrix for Erc vis-a-vis Emacs releases. Does Erc target the last 3 >> major releases? (i.e. 27.x, 28.x, 29.x), or is >=27 a fixed constraint? > > Last three, AFAIK. But when it comes to 27 in particular there's a sunk > cost component at play in terms of attention paid, at least in 5.6. But > I don't think a fallback is really necessary for new features, in > general: users on older Emacsen should probably expect a somewhat > degraded experience. In that case, I'll just add a simple feature gate that will only enable the transient prefix if transient.el is available. Probably will do the same for the yanking extension with `yank-transform-functions' as well. It would probably make sense to merge the two extensions into a single Erc module. I will consider doing that after some more hands-on usage/testing. I'm now close to a point where Erc can be customized to behave exactly as I want - many thanks for keeping the client so customizable/hackable :) Cheers, -A.
erc-normalize.el
(application/emacs-lisp, 3.3 KB) - not displayed
erc-normalize-yanked-draft.png
(image/png, 25.2 KB) - not displayed