GNU bug report logs - #43847
ERC - prevent yanking multiple lines into IRC (feature request) *patch*

Previous Next

Package: emacs;

Reported by: Corwin Brust <corwin <at> bru.st>

Date: Wed, 7 Oct 2020 14:13:01 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: Corwin Brust <corwin <at> bru.st>
Cc: 43847 <at> debbugs.gnu.org
Subject: bug#43847: ERC - prevent yanking multiple lines into IRC (feature request) *patch*
Date: Wed, 07 Oct 2020 12:05:01 -0400
I hope an ERC user will follow up (I think Bandali was going over ERC
patches at some point?), but just some general comments:

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

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

> +	 (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)))))




This bug report was last modified 4 years and 251 days ago.

Previous Next


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