Re: erc-ircfmt.el: Transient-based formatting for Erc (Emacs 29+)
"J.P." <[email protected]> Sat, 16 Mar 2024 17:00:59 -0700
| Newsgroups | gmane.emacs.erc.general |
|---|---|
| Message-ID | <[email protected]> |
Alcor <[email protected]> writes: >> Not sure if this is already supported by your patch, but it might be >> nice to optionally restore control chars when copying and yanking an >> already inserted message that contains `{fg,bg}:erc-color-faceN' faces. >> Actually, long ago, ERC shipped with something attempting to provide >> such functionality. But it was removed for reasons unknown (to me). > > Agreed. Adding C-w and M-w suffixes to the transient prefix is a good > idea. Will try that out soonish, since I've found myself wanting > something similar a few times. > > Tangentially related, but: In general, copying/yanking formatted text > into the IRC prompt is sort of misleading (in a visual sense). Since > copying/yanking a region also copies all text properties as well, it may > *seem* (to a novice user) like the sent text would retain its > formatting, even though this is not the case. I wonder if it would make > more sense to strip any face properties on text inserted at the Erc prompt? 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+). >>> If desirable, it might be possible to >>> include this code (or something similar) in erc-goodies.el, so Erc can >>> provide this functionality OOTB. >> >> If this is to find a home in the ERC tree, you'll need to open a bug >> report for it and also ensure it doesn't error when compiling or loading >> on Emacs 27. This last part wouldn't be necessary if we were to add >> transient.el as a hard ELPA dependency, but I'm not sure we're ready to >> make that decision anytime soon. > > 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.