unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Matt Brown <mbrown83@ucsc.edu>
Subject: defining functions in emacs
Date: Tue, 24 Jan 2006 13:40:35 -0800	[thread overview]
Message-ID: <43D69ED3.6070005@ucsc.edu> (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

             reply	other threads:[~2006-01-24 21:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-24 21:40 Matt Brown [this message]
2006-01-24 23:13 ` defining functions in emacs Edward O'Connor
2006-01-25 16:02 ` Kevin Rodgers
     [not found] <mailman.11.1138142928.2878.help-gnu-emacs@gnu.org>
2006-01-25  8:09 ` Tim X
2006-01-26  6:17 ` Barry Margolin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43D69ED3.6070005@ucsc.edu \
    --to=mbrown83@ucsc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).