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

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

Re: How make function to run a shell command ON BUFFER??


From: Kevin Rodgers
Subject: Re: How make function to run a shell command ON BUFFER??
Date: Mon, 01 Dec 2003 17:42:19 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Christian Seberino wrote:

pychecker is a function that checks Python code..

e.g.

pychecker myprogram.py


How make an Emacs function to run pychecker on buffer???

I guess function will have to run a shell command with the 1 and only
argument being the name of buffer.

(defun pychecker (file)
  "*Run the external \"pychecker\" program on FILE.
The output is displayed in the *compilation* buffer, which `\\[next-error]'
and `M-x compile-goto-error' parse to find each line of matched text."
  (interactive (let* ((default-file (and buffer-file-name
                                         (file-name-nondirectory
                                          buffer-file-name)))
                      (prompt (if default-file
                                  (format "File (default: %s): " default-file)
                                "File: ")))
                 (list (read-file-name prompt nil default-file))))
  (compile (format "pychecker %s" file)))

--
Kevin Rodgers



reply via email to

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