[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Writing an interactive function to accept a string argument, then ca
From: |
Endless Story |
Subject: |
Re: Writing an interactive function to accept a string argument, then call a Python script? |
Date: |
10 Feb 2007 02:57:34 -0800 |
User-agent: |
G2/1.0 |
On Feb 10, 8:49 am, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
> Endless Story wrote:
> (defun trivial-but-reasonably-valuable (string-to-match)
> (interactive "sMatch: ")
> (shell-command (format "/home/me/myscript.py %s"
> (shell-quote-argument string-to-match))))
Thanks! Below is what I ended up writing (after only 90 minutes of
Googling!!) - now I'm going to try your suggestion of adding shell-
quote-argument (which I gather from the doco does nice things like
escape characters as necessary). Maybe it will obviate the need to
remind the user (me) to use double quotes around multi-word input.
Boy, lisp is SO different than anything else I'm used to ...
(defun wl-psb (searchname)
(interactive"MName to search for, double-quoted: ")
(shell-command (concat "python c:/cygwin/home/texas/name_search.py
" searchname)))