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

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

bug#46621: Copy line


From: Stephen Berman
Subject: bug#46621: Copy line
Date: Mon, 22 Feb 2021 21:51:40 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On Mon, 22 Feb 2021 17:43:28 +0200 Eli Zaretskii <eliz@gnu.org> wrote:

> Bottom line, if we want to consider this command, we should somehow
> come up with the relevant use cases, and then weigh them against the
> added complexity and maintenance costs.  I therefore urge people who
> think they know these details to please speak up and contribute to
> this discussion.

I frequently use the following command (bound to `C-c l'), which suits
my needs better than the proposed command would or dabbrev-expand does:

(defun srb-select-line ()
  "Select line at point and copy to kill ring."
  (interactive)
  (copy-region-as-kill (line-beginning-position) (line-end-position)))

A common use case for me is copying somewhat complex shell commands I
keep stored in a file; they are stored as one liners to be easy to copy.
I don't want them to be immediately yanked into the file and for these
cases I don't need the feature of multiple copies via a prefix argument
(though in some documents I often do want multiple copies of a single
line, but usually at different parts of the document, so then just
yanking at the different locations is better than moving the copies).

Steve Berman





reply via email to

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