emacs-erc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: erc-ircfmt.el: Transient-based formatting for Erc (Emacs 29+)


From: Alcor
Subject: Re: erc-ircfmt.el: Transient-based formatting for Erc (Emacs 29+)
Date: Sat, 16 Mar 2024 12:04:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

(Resending Cc'd to to the mailing list, since I forgot that when
replying – sorry about the noise).

"J.P." <jp@neverwas.me> writes:

> I haven't looked into the history of `erc-toggle-flood-control', but I
> do know that until recently the codebase suffered from a general
> confusion between some related concerns, like multiline prompt input,
> accidental yanking/terminal pasting, and actual flooding (overly
> frequent outgoing messages). Really, the only use case that comes to
> mind for disabling flood control is long multiline prompt submissions
> (not necessarily in conjunction with the `draft/multiline' extension).
> But with this you'd likely run the risk of servers you don't control
> penalizing you. Regardless, if your plan is to add this feature to ERC
> and you really want the C-c C-f binding, we could just hijack it. Or you
> could shadow it in a minor-mode map by couching the feature in a local
> module. But then users would have to add `ircfmt' to `erc-modules' or
> enable the module's minor mode before they could use it.

Ideally, I imagine C-c C-f would be preferable in order to align with
other clients, if that's what's rcirc & others use.

I agree with your point re: flood control. To add another data point:
I've never disabled flood control (except when testing) and I can live
with it being shadowed if it ever comes to that. Toggling flood control
over M-x is still acceptable, since it does not seem to me like
something that is frequently used.

>> Comments/feedback are appreciated.
>
> 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?

>> 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?

Cheers,
-A



reply via email to

[Prev in Thread] Current Thread [Next in Thread]