[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#7503: copy-and-insert-previous-line
From: |
Andreas Schwab |
Subject: |
bug#7503: copy-and-insert-previous-line |
Date: |
Sun, 28 Nov 2010 12:10:25 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2.90 (gnu/linux) |
Mads Jensen <mje@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@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
- bug#7503: copy-and-insert-previous-line, Mads Jensen, 2010/11/28
- bug#7503: copy-and-insert-previous-line,
Andreas Schwab <=
- 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, 2010/11/28
bug#7503: copy-and-insert-previous-line, MON KEY, 2010/11/28