[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#7503: copy-and-insert-previous-line
From: |
Mads Jensen |
Subject: |
bug#7503: copy-and-insert-previous-line |
Date: |
Sun, 28 Nov 2010 15:32:33 +0100 |
User-agent: |
Thunderbird 2.0.0.24 (X11/20101027) |
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
Description: PGP signature
signature.asc
Description: OpenPGP digital signature
- bug#7503: copy-and-insert-previous-line, Mads Jensen, 2010/11/28
- bug#7503: copy-and-insert-previous-line, Andreas Schwab, 2010/11/28
- bug#7503: copy-and-insert-previous-line, Leo, 2010/11/28
- bug#7503: copy-and-insert-previous-line, Eli Zaretskii, 2010/11/28
- bug#7503: copy-and-insert-previous-line, martin rudalics, 2010/11/28
- bug#7503: copy-and-insert-previous-line, Eli Zaretskii, 2010/11/28
- bug#7503: copy-and-insert-previous-line, martin rudalics, 2010/11/28
- bug#7503: copy-and-insert-previous-line, Eli Zaretskii, 2010/11/28
- bug#7503: copy-and-insert-previous-line, martin rudalics, 2010/11/28
bug#7503: copy-and-insert-previous-line,
Mads Jensen <=
bug#7503: copy-and-insert-previous-line, MON KEY, 2010/11/28