GNU bug report logs - #7503
copy-and-insert-previous-line

Previous Next

Package: emacs;

Reported by: Mads Jensen <mje <at> inducks.org>

Date: Sun, 28 Nov 2010 10:23:01 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 7503 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Mads Jensen <mje <at> inducks.org>
Cc: 7503 <at> debbugs.gnu.org
Subject: Re: bug#7503: copy-and-insert-previous-line
Date: Sun, 28 Nov 2010 12:10:25 +0100
Mads Jensen <mje <at> inducks.org> writes:

> I couldn't find a similar macro which did the same trick, so I wrote one
> myself:
>
> (defun copy-and-insert-previous-line ()
>   (interactive)
>   (save-excursion
>     (goto-line (1- (line-number-at-pos)))
      (forward-line -1)

>     (copy-current-line))

This function is not defined.

>   (yank))

(defun duplicate-previous-line ()
  (interactive "*")
  (save-excursion
    (insert
     (buffer-substring (progn (forward-line -1) (point))
		       (progn (forward-line 1) (point))))))

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




This bug report was last modified 11 years and 110 days ago.

Previous Next


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