From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: JayBingham Newsgroups: gmane.emacs.help Subject: RE: How to PICK the CTRL-u argument from the file or some other method, with EXAMPLE Date: Thu, 23 Sep 2004 12:01:58 -0500 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <1095958918.41530186776c8@www.bluebottle.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1095958961 24821 80.91.229.6 (23 Sep 2004 17:02:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 23 Sep 2004 17:02:41 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 23 19:02:28 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CAWzD-0007Z3-00 for ; Thu, 23 Sep 2004 19:02:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CAX5F-0002Vy-Uz for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Sep 2004 13:08:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CAX56-0002TT-7F for help-gnu-emacs@gnu.org; Thu, 23 Sep 2004 13:08:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CAX54-0002T7-59 for help-gnu-emacs@gnu.org; Thu, 23 Sep 2004 13:08:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CAX54-0002Sx-1O for help-gnu-emacs@gnu.org; Thu, 23 Sep 2004 13:08:30 -0400 Original-Received: from [67.107.78.242] (helo=bluebottle-fe0.bluebottle.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CAWyn-0006sn-L6 for help-gnu-emacs@gnu.org; Thu, 23 Sep 2004 13:02:01 -0400 Original-Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by bluebottle-fe0.bluebottle.com (8.12.11/8.12.11) with ESMTP id i8NH1wHF005986 for ; Thu, 23 Sep 2004 12:01:58 -0500 Original-Received: from inecce-pxy03.zcce.compaq.com (inecce-pxy03.zcce.compaq.com [161.114.1.183]) by www.bluebottle.com (IMP) with HTTP for ; Thu, 23 Sep 2004 12:01:58 -0500 Original-To: help-gnu-emacs@gnu.org User-Agent: Internet Messaging Program (IMP) 3.2.2 X-MIME-Autoconverted: from 8bit to quoted-printable by bluebottle-fe0.bluebottle.com id i8NH1wHF005986 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20833 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20833 On Wednesday, September 22, 2004 8:06 PM Jose Cuthberto wrote: > Suppose you want to paste a single killed line=20 > (in kill buffer using two C-k's) > you can trivially do it like this: >=20 > C-u 2 C-y >=20 > In this case you had to enter the numbers. >=20 > I have a file like this: >=20 > 5 > line1 > 6 > line2 >=20 > Now I must convert it to a file with 5 line1's and 6 line2's and so on. > It is a long file. >=20 > How do I pick 5 and put it into C-u so that it is done 5 times. >=20 > I can write macros. and I can also write single line lisp functions. > Unfortunately there is no yank cammand that can take the argument 5. > nor do i know the lisp function that can take the count and pass it to=20 > lisp function yank. I would want to avoid writing a loops, and vars etc. I don't know which version of emacs you are using or if you are even using emacs, but in emacs 21.2 what it appears that you describe as occurring when you type C-u 2 C-y is not what happens when I type the same. What does happen is that the second most recent item in the kill ring is inserted into the buffer, not two copies of the most recent item in the kill ring. So assuming that you are using emacs, I don't think that you can do what you think you want to do in the way you think you want to do it. IMHO it looks to me like you just need overcome your fear of loops and to learn how to write elisp functions. It is all that painful. ;) If you need help learning how to program emacs lisp there are tutorials on the web. I did a quick search for "emacs lisp"+tutorial and found at least 33 sites that matched, including the one on the GNU site at: http://www.gnu.org/software/emacs/emacs-lisp-intro/html_mono/emacs-lisp-i= ntro.html. You should have access to the Emacs Lisp Reference Manual. Some sites put it in the info directory so it is available when you type C-h i, if yours does not it is available on the web at: http://www.gnu.org/software/emacs/elisp-manual/ -_ J_) C_)ingham . Hewlett-Packard . Austin, TX . =93Language is the apparel in which your thoughts parade in public. . Never clothe them in vulgar and shoddy attire.=94 -Dr. George W. Crane-