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

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

defining functions in emacs


From: Matt Brown
Subject: defining functions in emacs
Date: Tue, 24 Jan 2006 13:40:35 -0800
User-agent: Debian Thunderbird 1.0.2 (X11/20050817)

Hi everyone

I wrote my first emacs function! Here's my function:


(defun read-environment ()
 (setq outbuf (generate-new-buffer "read-environment-outbuf"))
 (call-process "read-environment.sh" nil outbuf nil)
 (eval-buffer outbuf)
 (kill-buffer outbuf))

It uses read-environment.sh to generate a whole bunch of setenv lines, and then evaluates them. Basically, it sources .bashrc and sets the new variables in emacs. It works fine, but I want to be able to run it by
M-x read-environment

This doesn't work. I have to put
(read-environment)
into *scratch*, move to the ')' and do C-x C-e to evaluate it.  Pretty lame.

From the digging around I've done, it seems like it should just work. Any ideas? BTW, the defun is in my .emacs

Thanks
Matt




reply via email to

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