Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Dec 1999 19:14:48 +0000
From:      Mark Ovens <mark@ukug.uk.freebsd.org>
To:        Greg Lehey <grog@lemis.com>
Cc:        Michael Elbel <Michael.Elbel@consol.de>, questions@FreeBSD.ORG
Subject:   Re: Programmers' editor?
Message-ID:  <19991201191448.D316@marder-1>
In-Reply-To: <19991130210255.39078@mojave.sitaranetworks.com>
References:  <19991126095558.C48221@consol.de> <19991130210255.39078@mojave.sitaranetworks.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 30, 1999 at 09:02:55PM -0500, Greg Lehey wrote:
> On Friday, 26 November 1999 at  9:55:58 +0100, Michael Elbel wrote:
> > In lists.freebsd.questions you write:
> >
> >> BTW Greg, you mentioned that you use emacs for composing e-mail with
> >> mutt, which is what I'm doing now. Is there a way to make it (mutt)
> >> open another buffer in an emacs window that's already running rather
> >> than starting another instance of emacs?
> >
> > You sure it was Greg?
> 
> Well, I believe it :-)  I'm sure we're not the only two who use mutt
> and Emacs.
> 
> > I've mentioned this before:
> >
> > Set your editor to gnuclient and it will do what you want
> > (export EDITOR=gnuclient).
> > You can also do this on the commandline, of course
> >
> > $ gnuclient /etc/passwd
> >
> > You need to load gnuserv in your .emacs file. This is what I have in mine:
> >
> > (load-library "gnuserv")
> > (gnuserv-start nil)
> 
> OK, what does this buy you?  It's relatively easy to tell Emacs to
> edit something from outside, but how do you get mutt to wait until
> you've finished editing the message, and how to you tell mutt when you
> have finished?
> 

I've got it working a treat now :)

The gnu{client,serv} stuff is not correct for emacs. In ~/.emacs I
added:

(server-start nil)

Created a file, /usr/local/bin/ec, containing:


#!/bin/sh

( emacsclient $* || emacs $* ) > /dev/console 2>&1

In ~/.muttrc I added:

set editor='ec'

Now in mutt, when I create or reply to a mail, if emacs is already
running it opens a new buffer (with the original e-mail), and if not
it starts emacs. In both cases mutt just sits there displaying:

Include message in reply? ([y]/n): yes

in the message bar at the bottom, as it is doing right now. When you
save and then kill the buffer mutt comes back to life at the send
screen.

The only thing I haven't been able to do is make an existing emacs
window pop to the top of the Z-buffer automagically.

> Greg
> --
> When replying to this message, please copy the original recipients.
> For more information, see http://www.lemis.com/questions.html
> Finger grog@lemis.com for PGP public key
> See complete headers for address and phone numbers

-- 
PERL has been described as "the duct tape of the Internet"
and "the Unix Swiss Army chainsaw"
				- Computer Shopper 12/99
________________________________________________________________
      FreeBSD - The Power To Serve http://www.freebsd.org
      My Webpage http://ukug.uk.freebsd.org/~mark/
mailto:mark@ukug.uk.freebsd.org              http://www.radan.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991201191448.D316>