all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Hugo Mezarina <gnulinux0@aim.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How do i run independent commands on the same defun?
Date: Sun, 22 Jun 2008 19:33:40 +0200	[thread overview]
Message-ID: <485E8CF4.2090806@gmail.com> (raw)
In-Reply-To: <485E75B5.5060003@aim.com>

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
> 
> 
> 




      reply	other threads:[~2008-06-22 17:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-22 15:54 How do i run independent commands on the same defun? Hugo Mezarina
2008-06-22 17:33 ` Lennart Borgman (gmail) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=485E8CF4.2090806@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=gnulinux0@aim.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.