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

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

How do i run independent commands on the same defun?


From: Hugo Mezarina
Subject: How do i run independent commands on the same defun?
Date: Sun, 22 Jun 2008 12:54:29 -0300
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

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 know it is rookie problem...but it is my current state on this field...

I appreciate your help on this!

Thank you.

Hugo




reply via email to

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