all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.