---------- Forwarded message ---------- From: Eric Hanchrow Date: Sat, Jun 2, 2012 at 7:00 AM Subject: Re: bug#11592: [PATCH] prevent accidental pastes in ERC To: Chong Yidong On Sat, Jun 2, 2012 at 12:39 AM, Chong Yidong wrote: > Does this patch disable all pasting of multi-line text? By default, it has no effect. But when you enable it by setting the variable erc-accidental-paste-threshold-seconds to a numeric value, it indeed prevents pasting of multi-line text. > That might be > annoying, since people might want to do that sometimes. If people ignore the variable, everything will work as it always has. Only by deliberately setting this variable will people see a change in Emacs' behavior. > If the problem > is pasting a lot of text, maybe the better approach is to set up a > maximum amount of text that can be yanked into an erc buffer. It's not yanking we're talking about; it's "pasting". Pasting is relevant only when emacs is in console mode (I should probably have said something about that in the patch). When I say "pasting", I mean selecting some text in another application, then focusing _your console program in which Emacs is running_, and then pressing the middle mouse button (or shift+insert, or whatever). From emacs' point of view, "pasting" is indistinguishable from ordinary, albeit rapid, typing. That is why my patch is based on the time between calls to erc-send-current-line: I can't think of any other way to distinguish an accidental paste from ordinary typing.