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

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

Re: copy-word-from-line-above


From: Greg Bognar
Subject: Re: copy-word-from-line-above
Date: Sun, 21 Jan 2007 00:36:12 -0500
User-agent: Pan/0.14.2.91 (As She Crawled Across the Table (Debian GNU/Linux))

> I use this because its a bit more flexable. It allows you to copy exactly
> the parts you want even if not full words.
> 
> (global-set-key [?\C-\M-z] 'insert-prior-line-char)
> 
> (defun insert-prior-line-char ()
>   "Insert the same character as in the prior line. Space if none."
>   (interactive)
>   (let* ((cur (current-column))
>          (char (save-excursion
>                  (if (or (not (eq 0 (forward-line -1)))
>                          (not (eq cur (move-to-column cur)) ))
>                      32
>                    (char-after)))))
>     (insert char)))

This is great, but wouldn't it be nicer if you could give it an argument? 
Then you could do, say, C-8 C-M-z and the next 8 characters would be
inserted.



reply via email to

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