GNU bug report logs - #62947
30.0.50; ERC 5.6: Improve partitioning of outgoing messages

Previous Next

Package: emacs;

Reported by: "J.P." <jp <at> neverwas.me>

Date: Wed, 19 Apr 2023 14:58:01 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Done: "J.P." <jp <at> neverwas.me>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "J.P." <jp <at> neverwas.me>
To: 62947 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: bug#62947: 30.0.50; ERC 5.6: Improve partitioning of outgoing messages
Date: Mon, 01 May 2023 21:39:02 -0700
[Message part 1 (text/plain, inline)]
This bug presents an opportunity for revisiting how input handling and
pre-send hook management happen in ERC. The groundwork has already been
laid by ERC 5.5, so we might as well try inching closer to something
more responsive and intuitive. This being ERC, flexibility is also a
priority, but for now, I'm thinking we should focus on honoring existing
interfaces rather than adding new ones.

In the current envisioning (v2 attached), this imagined shift toward
smarter input handling starts by moving all line splitting and related
input preparation forward so it runs earlier, alongside the various
validation checks. Doing this alone could, for example, give us
friendlier feedback when crossing the `erc-inhibit-multiline-input'
threshold, with the rejected goods being invited to hang around in the
prompt area for successive tweaking and do-overs (instead of seeing
their mutilated pieces clutter up the kill ring, which more or less
describes the current state of affairs).

The path I'm proposing does come with one minor hiccup in terms of
corner-case breakage, but only for third-parties that expect
protocol-length line splitting to occur after the more send-focused
hooks run (chiefly, `erc-pre-send-functions'). To smooth things over,
I'm proposing an off-by-default compat switch, which would manifest as a
new "refoldp" slot for the `erc-input' object that's shared among these
hook members. Third parties can toggle this on if they'd rather not
trust other members to perform the necessary bookeeping to keep line
lengths in check.

If you'd like to try this, just

  (setq erc-inhibit-multiline-input t
        erc-send-whitespace-lines t)

and submit a long passage at the prompt.

[0000-v1-v2.diff (text/x-patch, attachment)]
[0001-5.6-Don-t-send-multiline-slash-commands-as-msgs-in-E.patch (text/x-patch, attachment)]
[0002-5.6-Redo-line-splitting-for-outgoing-messages-in-ERC.patch (text/x-patch, attachment)]
[0003-5.6-Preprocess-prompt-input-linewise-in-ERC.patch (text/x-patch, attachment)]

This bug report was last modified 1 year and 169 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.