unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How make function to run a shell command ON BUFFER??
@ 2003-12-01 23:43 Christian Seberino
  2003-12-02  0:42 ` Kevin Rodgers
  2003-12-02  0:56 ` Dan Anderson
  0 siblings, 2 replies; 4+ messages in thread
From: Christian Seberino @ 2003-12-01 23:43 UTC (permalink / raw)


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.

Chris

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How make function to run a shell command ON BUFFER??
  2003-12-01 23:43 How make function to run a shell command ON BUFFER?? Christian Seberino
@ 2003-12-02  0:42 ` Kevin Rodgers
  2003-12-02  0:56 ` Dan Anderson
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2003-12-02  0:42 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How make function to run a shell command ON BUFFER??
  2003-12-01 23:43 How make function to run a shell command ON BUFFER?? Christian Seberino
  2003-12-02  0:42 ` Kevin Rodgers
@ 2003-12-02  0:56 ` Dan Anderson
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Anderson @ 2003-12-02  0:56 UTC (permalink / raw)


seberino@spawar.navy.mil (Christian Seberino) writes:

> pychecker is a function that checks Python code..
> 
> e.g.
> 
> pychecker myprogram.py
> 
> 
> How make an Emacs function to run pychecker on buffer???

        C-x  h marks  the entire  buffer.  M-|  lets you  run  a shell
command on the marked region.  So C-x h M-| pychecker RET should do it
for you.

        I'd suggest  creating a macro  or lisp function but  I've been
having problems  myself with doing  something similar in  Perl.  Emacs
hides  the output from  the shell  command --  which makes  running my
buffer through Perl to check for syntax errors problematic.

-Dan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* How make function to run a shell command ON BUFFER??
@ 2003-12-02 13:57 Yehudah Rubinsky
  0 siblings, 0 replies; 4+ messages in thread
From: Yehudah Rubinsky @ 2003-12-02 13:57 UTC (permalink / raw)


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

Pyhton mode's Ctl-c Ctl-c runs the python interpreter against the buffer. 
The good new is this will check the syntax of the python code, including 
the use of C-x` to step to each error in turn. The bad news is that it will 
actually  run the python code, which may have undesirable side effects.

Best,
Yehudah Rubinsky

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-12-02 13:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-01 23:43 How make function to run a shell command ON BUFFER?? Christian Seberino
2003-12-02  0:42 ` Kevin Rodgers
2003-12-02  0:56 ` Dan Anderson
  -- strict thread matches above, loose matches on Subject: below --
2003-12-02 13:57 Yehudah Rubinsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).