bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43847: ERC - prevent yanking multiple lines into IRC (feature reques


From: Noam Postavsky
Subject: bug#43847: ERC - prevent yanking multiple lines into IRC (feature request) *patch*
Date: Wed, 07 Oct 2020 12:05:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]