[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to make a lisp function use an outside executable such as a comp
Re: How to make a lisp function use an outside executable such as a compiled C program?
Wed, 24 Oct 2012 22:29:49 +0200
On Wed, Oct 24, 2012 at 8:02 PM, <address@hidden> wrote:
> I asked this question in a 2002 post in the thread describing it and
> previous response.
You have to write some emacs lisp.
As someone already said, use call-process.
This calls synchronously ls with the -l and -a options:
(call-process "ls" nil nil nil "-l" "-a")
If you want the return value to be the program output you can use
You can wrap this line in a function and put it in your .emacs like this:
(defun my-function ()
(call-process "ls" nil nil nil "-l" "-a"))
You can then bind it to a key like this (still in .emacs):
(global-set-key (kbd "<f9>") 'my-function)
> Has there been any improvements in the last 10 years?
It's really not difficult, you should read what people say in this thread.
If you have a previous experience in programming and want a short
introduction to emacs lisp I recommend you Xah Lee's tutorials :