unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* defining functions in emacs
@ 2006-01-24 21:40 Matt Brown
  2006-01-24 23:13 ` Edward O'Connor
  2006-01-25 16:02 ` Kevin Rodgers
  0 siblings, 2 replies; 5+ messages in thread
From: Matt Brown @ 2006-01-24 21:40 UTC (permalink / raw)


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

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

end of thread, other threads:[~2006-01-26  6:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.11.1138142928.2878.help-gnu-emacs@gnu.org>
2006-01-25  8:09 ` defining functions in emacs Tim X
2006-01-26  6:17 ` Barry Margolin
2006-01-24 21:40 Matt Brown
2006-01-24 23:13 ` Edward O'Connor
2006-01-25 16:02 ` Kevin Rodgers

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