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

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

Re: yank-repeat-newline


From: Andreas Röhler
Subject: Re: yank-repeat-newline
Date: Tue, 26 Jul 2011 21:24:03 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.18) Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11

Am 26.07.2011 21:19, schrieb Teemu Likonen:
* 2011-07-26T21:12:35+02:00 * Andreas Röhler wrote:

Now when trying to combine both, get difficulties

;; not working now
(defun yank-repeat-newline (arg&optional nl)
   "With numerical ARG, repeat last yank ARG times.
With optional arg NL, also insert newlines. "
   (interactive "p\nP*")
   (let ((nl nl)
         (num arg))
     (dotimes (i num)
       (if nl
           (insert (concat (car kill-ring) "\n"))
         (insert (car kill-ring))))))

What is the recommended way writing that?

Please tell us what you want. How should the command work? How do you
want to execute it and what should it do?


It's in the docstring: repeat last yank resp. to numerical arg.
Also I want in some cases have a newline added - ie insert yanks vertically.



reply via email to

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