emacs alphabetize methods

Johan Bockgård bojohan+news at dd.chalmers.se
Sun May 9 19:34:11 EDT 2004


"Peter Milliken" <peterm at resmed.com.au> writes:

> My suggestion for how to do this (off the top of my head :-)) is to write a
> support (Python) program to call from your emacs using Pymacs
> (http://pymacs.progiciels-bpi.ca/manual/The--Pymacs--buffer.html).

You can just call the program directly and use stdin/stdout:

(defun my-alphabize-region (beg end)
  "Sort methods in region alphabetically."
  (interactive "r")
  ;; run command with region as input, and replace it with the output
  (shell-command-on-region
   beg end
   "myCommand"     ;<<< Your command here
   t t "*errors*"))


(You could do this entirely inside emacs of course.)

-- 
Johan Bockgård



More information about the Python-list mailing list