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


View this message in rfc822 format

From: Mads Jensen <mje <at> inducks.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>, 7503 <at> debbugs.gnu.org
Subject: bug#7503: copy-and-insert-previous-line
Date: Sun, 28 Nov 2010 15:32:33 +0100
[Message part 1 (text/plain, inline)]
Andreas Schwab wrote:
>> (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.

Sorry for not remembering to attach this one, too.

(defun copy-current-line ()
  (interactive)
  (kill-ring-save (point-at-bol) (point-at-eol)))

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

There is a difference between my version, and this one, as mine doesn't
add the newline-character from the end of the previous line.

I'm using Emacs 22.2.1 as Emacs 23 is not the default in Ubuntu 9.10.
Thanks for the quick response :-)
-- 
Med Venlig Hilsen / Kind Regards,
Mads Jensen
Rubinsteinsvej 31,st.th
DK-2450 Kbh. SV
Denmark


[signature.asc (application/pgp-signature, inline)]
[signature.asc (application/pgp-signature, attachment)]

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.