From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Corwin Brust Newsgroups: gmane.emacs.bugs Subject: bug#43847: ERC - prevent yanking multiple lines into IRC (feature request) *patch* Date: Thu, 8 Oct 2020 20:32:54 -0500 Message-ID: References: <87sgaqgel9.fsf@debian> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40448"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43847@debbugs.gnu.org To: Brett Gilio Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 09 03:34:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQhIS-000AMU-W1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Oct 2020 03:34:12 +0200 Original-Received: from localhost ([::1]:55404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQhIR-0007Pe-Px for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Oct 2020 21:34:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQhII-0007PY-8e for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 21:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50219) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQhIH-0002DK-Vq for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 21:34:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kQhIH-0000hw-QZ for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 21:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Corwin Brust Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Oct 2020 01:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43847 X-GNU-PR-Package: emacs Original-Received: via spool by 43847-submit@debbugs.gnu.org id=B43847.16022071932661 (code B ref 43847); Fri, 09 Oct 2020 01:34:01 +0000 Original-Received: (at 43847) by debbugs.gnu.org; 9 Oct 2020 01:33:13 +0000 Original-Received: from localhost ([127.0.0.1]:33530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQhHV-0000gq-5E for submit@debbugs.gnu.org; Thu, 08 Oct 2020 21:33:13 -0400 Original-Received: from mail-ed1-f65.google.com ([209.85.208.65]:38430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQhHT-0000gd-88 for 43847@debbugs.gnu.org; Thu, 08 Oct 2020 21:33:12 -0400 Original-Received: by mail-ed1-f65.google.com with SMTP id i5so7746941edr.5 for <43847@debbugs.gnu.org>; Thu, 08 Oct 2020 18:33:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9uXH2uQghHOfE0w13Ym5EM4BLirknqdv8QrzrEPAOBg=; b=Z/a2+/rUFkumgHDCndXWvnRVxgaE4muGQUNyNS1OAgl5V9Zwl6NElNmbHACxa9i2Vd 315Aro1++LTnYBXw1rr/WXdPjSEe7jzbGDT3+5cwXGd5ApNVZ75UcW+5SD2Cnbk5gbrY edU+Ta/Krg5GOUubRZQ1H4ElaWhf9G4Ts8o+kNCHbJHzMZnafw7c+bxhJiPiAkkCc5np +Ow061vpKTSHhT3CtHQ1gz3+5PBd+eu6lA75D+FPSgHfY1NExKHC71RrzJiVjytKvYwz 7r/2954UrSrSGdl8fYbiDiI+c5jepALrlqZXN4MDFxw3crPYlVM2E1obSnUziUnFfp2O fibA== X-Gm-Message-State: AOAM5339qINPTYZPn4iWuJnflBBWwaRj0HpsX+lRnw+9tSVNJuQIwcMW B+7CDzDXu5sDlEpOKHPU+TroBmyEK5iIaAI6ukKE2Sfr+6vPWg== X-Google-Smtp-Source: ABdhPJyXzvZ5OhT/4tMDbJidEd9p3pOhWPh3p0RikTrGSBvwfHKRiU/cWj8kvRUH/bltO+hJrLgGY8kwXJn4egzP3BE= X-Received: by 2002:a05:6402:1446:: with SMTP id d6mr12045909edx.244.1602207185378; Thu, 08 Oct 2020 18:33:05 -0700 (PDT) In-Reply-To: <87sgaqgel9.fsf@debian> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190122 Archived-At: Hi Brett! Thanks so much for the reply! On Wed, Oct 7, 2020 at 11:56 AM Brett Gilio wrote: > > Corwin Brust writes: > > > I hate it when I accidentally paste multi-line text into ERC. I > > *never* actually intend to do this. > > > > This patch provides erc-yank and binds it to C-y for erc-mode buffers. > > This does the same as `yank'; however, the text is unfilled (collapsed > > to a single line) before it is inserted. > > > > It might make sense to have a defcustom to get back the old behavior > > but I haven't included that. This is my second attempt at sharing a > > patch for Emacs; I sent one about an hour ago. I believe, taking both > > patches together, I should be pretty close to the max for tiny-change. > > I've started the copyright assignment process. > > > > All feedback gratefully received :) > > > > A possible alternative behavior could be somewhat similar to what CIRCE > does, but may be more intensive to implement. CIRCE, when pasting > multiline content offers to send the content to a paste-service, and > then kills the URL to the buffer and sends that instead. This is a wonderful suggestion. Speaking for myself, personally, I'd like to see it as somewhat of a secondary behavior, what sending a prefix arg does, or something. In any case a very fine feature, indeed. A quick perusal of CIRCE[1] (which looks lovely), suggests the present approach there involves having various paste-services explicitly supported. Perhaps this could be implemented in terms of a def-paste-service macro, of some sort. I would expect some amount of discussion may be involved in selecting an initial service or services to support, as it were, of the the box. Maybe that conversation would be approprite to Emacs devel, in case this feature would be interesting to a more general cross-section of users vs ERC/IRC. > What if we had a paste.emacs.org that ERC could utilize here? I think that's an excellet idea in several regards. In addition to simplifying, potentially trivializing the decision of what service to support, it also leads to a bunch of links getting shared around which point into the fsfverse. It's a tiny bit of mind-share, but I'd be inclined to take it. That said, having a "branded" paste-service "baked in" to Emacs would seem to me to stengthen the argument to formalize the interface for people to setup their own; to make ours easy and others hard would be very off-brand. This is something I'd be happy to work on, but I'm not how we would approach something like requesting a http facing new service, going forward. > Just a thought. As I hope I made clear, I love it. I'm tempted tho, to suggest we might move forward with my more trival suggested change in the mean-time. It seems like having something special at C-y in `erc-mode' is probably on the road-map for any of this, and may make live easier for ERC users somewhat more quickly than some of the other ideas discussed so far can move. > > Brett Gilio Regards, Corwin