[OS X Emacs] Re: How to call "call-process"

siemsen at ucar.edu siemsen at ucar.edu
Wed May 5 11:54:54 EDT 2010


Thanks!  Here's what I'm using now:

; bind Command-Shift-7 to execute PetesLookup and feed it the highlighted string
(define-key osx-key-mode-map (kbd "A-&")
  (defun execute-PetesLookup ()
    "Execute PetesLookup, feeding it the current selected region as a command-line argument."
    (interactive)
    (call-process "/Users/siemsen/Applications/PetesLookup.app/Contents/MacOS/PetesLookup" nil nil nil
                  (buffer-substring (point) (mark)))
    )
  )

This works and is clearly better, but it smells funny to define a named function when the name is never referenced.  Is there a way to just invoke call-process, without a defun?

-- Pete


On May 5, 2010, at 7:17 AM, David Reitter wrote:

> On May 5, 2010, at 8:38 AM, Jean-Christophe Helary wrote:
>>> 
>>> (define-key osx-key-mode-map (kbd "A-&")
>>> 	(defun call-PetesLookup ()
>>> 		...))
>>> 
>>> but most people don't do that. 
>> 
>> But isn't it more lispy than other ways ?
> 
> It is!
> 
> In fact I'd prefer it if people used this style for hook functions, rather than lambda terms - because lambda terms are hard if not impossible to remove from a hook variable, while named functions can be removed easily by removing the name with `remove-hook'.
> 
> 
> --
> http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
> http://aquamacs.org/donate -- Could we help you? Return the favor and support the Aquamacs Project!_____________________________________________________________
> MacOSX-Emacs mailing list
> MacOSX-Emacs at email.esm.psu.edu
> http://email.esm.psu.edu/mailman/listinfo/macosx-emacs
> List Archives: http://dir.gmane.org/gmane.emacs.macintosh.osx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://email.esm.psu.edu/pipermail/macosx-emacs/attachments/20100505/5c0b8474/attachment.html>


More information about the MacOSX-Emacs mailing list