From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> Newsgroups: gmane.emacs.help Subject: Re: How do i run independent commands on the same defun? Date: Sun, 22 Jun 2008 19:33:40 +0200 Message-ID: <485E8CF4.2090806@gmail.com> References: <485E75B5.5060003@aim.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1214156055 10847 80.91.229.12 (22 Jun 2008 17:34:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Jun 2008 17:34:15 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Hugo Mezarina <gnulinux0@aim.com> Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 22 19:35:00 2008 Return-path: <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org> Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KATSt-0005jd-E7 for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Jun 2008 19:34:59 +0200 Original-Received: from localhost ([127.0.0.1]:43458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KATS4-0003lt-8J for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Jun 2008 13:34:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KATRi-0003lm-P1 for help-gnu-emacs@gnu.org; Sun, 22 Jun 2008 13:33:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KATRh-0003kH-4j for help-gnu-emacs@gnu.org; Sun, 22 Jun 2008 13:33:46 -0400 Original-Received: from [199.232.76.173] (port=37308 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KATRh-0003k4-0J for help-gnu-emacs@gnu.org; Sun, 22 Jun 2008 13:33:45 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]:59113) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from <lennart.borgman@gmail.com>) id 1KATRg-00053S-Op for help-gnu-emacs@gnu.org; Sun, 22 Jun 2008 13:33:44 -0400 Original-Received: from c83-254-145-59.bredband.comhem.se ([83.254.145.59]:63951 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from <lennart.borgman@gmail.com>) id 1KATRe-0004Fu-5m; Sun, 22 Jun 2008 19:33:43 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <485E75B5.5060003@aim.com> X-Antivirus: avast! (VPS 080621-0, 2008-06-21), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.145.59 X-ACL-Warn: Too high rate of unknown addresses received from you X-Scan-Result: No virus found in message 1KATRe-0004Fu-5m. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1KATRe-0004Fu-5m e8a25cf302ba5cadc77de3f611a933b5 X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) 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 <help-gnu-emacs.gnu.org> List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/pipermail/help-gnu-emacs> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Subscribe: <http://lists.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:55037 Archived-At: <http://permalink.gmane.org/gmane.emacs.help/55037> Hugo Mezarina wrote: > See... I want to run independent commads on the same defun... > I want to write a function to do this: > > copy a region of the current buffer > generete a new buffer > paste that region in that new buffer > sort the fields of the new region > > I want to do this inside of the body of a function. I'd like to know if > there is a function like the one a propose on the next lines: > eval-next-lines > > (defun copy-and-sort-in-newbuff (original-buff field-name) > (eval-next-lines > (generate-new-buffer (concat original-buff "-" field-name)) > (set-buffer original-buff) > (copy-region-as-kill (point-min) (point-max)) > (set-buffer (concat original-buff "-" field_name)) > (yank) > (sort-fields -1 (point-min)(point-max)) > ) > ) > > If there is another way to do this... plesase let me know... I might be misunderstanding you, but I think there is no need for "eval-next-lines". That is what the defun does by default. Though there are some other small problems in your code that you have to play with a bit :-) > I know it is rookie problem...but it is my current state on this field... The interesting thing about a rocket is that it starts somewhere and goes somewhere else. > I appreciate your help on this! > > Thank you. > > Hugo > > >