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 21:01:19 -0500 Message-ID: References: <85mu0yxdil.fsf@gmail.com> <85k0w2xbrm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000c5055405b13353c5" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31570"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43847@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 09 04:02:12 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 1kQhjW-00085N-Lr for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Oct 2020 04:02:10 +0200 Original-Received: from localhost ([::1]:37060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQhjV-0004r0-NR for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Oct 2020 22:02:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQhjO-0004qU-22 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 22:02:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50261) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQhjN-00065Y-Of for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 22:02:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kQhjN-0001QV-MF for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 22:02: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 02:02: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.16022088985447 (code B ref 43847); Fri, 09 Oct 2020 02:02:01 +0000 Original-Received: (at 43847) by debbugs.gnu.org; 9 Oct 2020 02:01:38 +0000 Original-Received: from localhost ([127.0.0.1]:33574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQhj0-0001Pn-26 for submit@debbugs.gnu.org; Thu, 08 Oct 2020 22:01:38 -0400 Original-Received: from mail-ed1-f47.google.com ([209.85.208.47]:33941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQhiy-0001Pb-94 for 43847@debbugs.gnu.org; Thu, 08 Oct 2020 22:01:36 -0400 Original-Received: by mail-ed1-f47.google.com with SMTP id x1so7792692eds.1 for <43847@debbugs.gnu.org>; Thu, 08 Oct 2020 19:01:36 -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=4FxytFT808NbtC9UecGY1gEE7LMzR5iLwiBjLR1lMk4=; b=LIk8RXsRRZYzCgKVWZq8OhlRnJbnCAOODU5A81paY2oiM8EI6uT8WMusESff+lkWTW YHbu/aEjxdKuRFKZnRdBJy3ucqwDy3fmNvOe/fv3t6KM+xOFuY/4Ru5u0IrSZJPOiynV 0f1S4+P2YDOyw3SWtUn6Kc26kjDxo8jFMz3aPKjW59thR903ZhtN/Ptvp7I3tQoWYNt/ ZCRBQHyPN4KvGTlisH7M2ts0cOogCV9M1NWeSoHncD0Eas+QsKXVm+UfnSlrccvO+94i Fbeu0eLrIAu5+58ZPIaHbVV0f7uPG/H/ofVsZtEYKs6BNoCVXTIgzHVSddeueQKxIGjS R4NA== X-Gm-Message-State: AOAM531WRFm/C/mwEezalkPdKfCnyP+1NK1/Vlr16IZTOKUm2BRwtH4H un7V+00j9bnp64nK2KtM5OFrhBdNSVfgE65W1/g= X-Google-Smtp-Source: ABdhPJwfjDqalptHKpylitYEqjh/Qn/ICc1Ja57DJJ6/eJv8AKgj/e+CMf38qaWkuIy3L4dhfBf/76dqLaLhmOJgMFE= X-Received: by 2002:aa7:c608:: with SMTP id h8mr11907163edq.16.1602208890409; Thu, 08 Oct 2020 19:01:30 -0700 (PDT) In-Reply-To: <85k0w2xbrm.fsf@gmail.com> 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:190124 Archived-At: --000000000000c5055405b13353c5 Content-Type: text/plain; charset="UTF-8" Many thanks, Noam. On Wed, Oct 7, 2020 at 11:05 AM Noam Postavsky wrote: > > I hope an ERC user will follow up (I think Bandali was going over ERC > patches at some point?), but just some general comments: I'm hoping Bandali and other ERC users will look, also. I spoke to someone on ERC today who is using the (prior version), I believe and has agreed to mention any issues or suggestions. (They agreed with you about e-l-d-f-c being irrelevant, which seems pretty darned obvious to me now too.) > > diff -u "c:/emacs/share/emacs/27.1/lisp/erc/erc.el-27.1" "c:/emacs/share/emacs/27.1/lisp/erc/erc.el" > > > +(defun erc-yank (&optional arg) > > + "Unfill then yank. ARG is handled by `yank', which see." > > + (interactive) > > + (insert > > + (save-excursion > > I believe the save-excursion is redundant since all the movement happens > inside a temp buffer. Removed save-excursion, thank you. > > > + (with-temp-buffer > > + (yank arg) > > + (goto-char (point-min)) > > + (let ((fill-column (point-max)) > > + (emacs-lisp-docstring-fill-column t)) > > I don't think binding emacs-lisp-docstring-fill-column should be needed? *Smacking of forehead* Right you are. > > + (fill-paragraph)) > > The TAB character should be spaces instead. I recommend (setq-default > indent-tabs-mode nil), or at least > > (defun my-lisp-mode-hook () > (setq-local indent-tabs-mode nil)) > (add-hook 'emacs-lisp-mode-hook #'my-lisp-mode-hook) > > Note that if you edit the git repo, it comes with an indent-tabs-mode=nil > setting for emacs-lisp-mode in .dir-locals.el. > > > + (buffer-string))))) I'm pulling master now. This version was created after evaling your suggested one-liner in my erc.el buffer & please let me know if that's got it. Again, thanks Corwin --000000000000c5055405b13353c5 Content-Type: application/octet-stream; name="erc-yank_002_rm_save-excusrion-and-elsip-docstring-col.patch" Content-Disposition: attachment; filename="erc-yank_002_rm_save-excusrion-and-elsip-docstring-col.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kg1lsnmz0 ZGlmZiAtdSAiYzovZW1hY3Mvc2hhcmUvZW1hY3MvMjcuMS9saXNwL2VyYy9lcmMuZWwtMjcuMSIg ImM6L2VtYWNzL3NoYXJlL2VtYWNzLzI3LjEvbGlzcC9lcmMvZXJjLmVsIg0KLS0tIGM6L2VtYWNz L3NoYXJlL2VtYWNzLzI3LjEvbGlzcC9lcmMvZXJjLmVsLTI3LjEJMjAyMC0xMC0wNyAwODoxMDoz NS4wMDAwMDAwMDAgLTA1MDANCisrKyBjOi9lbWFjcy9zaGFyZS9lbWFjcy8yNy4xL2xpc3AvZXJj L2VyYy5lbAkyMDIwLTEwLTA4IDIwOjQyOjI2LjIwNzY4NDEwMCAtMDUwMA0KQEAgLTEx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