mutt FROM emacs

Matt Price matt.price-H217xnMUJC0sA/PxXw9srA at public.gmane.org
Wed Nov 12 17:39:33 UTC 2008


sorry, meant to send to list. 

On Tue, 2008-11-11 at 23:28 -0500, Dave Mason wrote: 
> The first links in 'google: ubuntu mh' give mh and mh-e (the emacs
> package to work with mh).
> 
> It would take a bit of elisp to prompt for a name and look it up in your
> evolution contact list, but I don't know what kind of user interface you
> want, so can't suggest much in the way of code.
> 
> I have only used emacs mailers for a *long* time (my inboxes go back to
> 1995, so I guess that's when), so I don't have any experience of hooking
> into other systems.
> 
> If you said exactly what you wanted, I might be able to help.
> 
hi dave,

thanks for your generous offer.  i've had a chance to think briefly
about this, and i think i understand my requirements a little bit
better. 

I want one function that searches a database of addresses and returns a
set of possibilities, of which one or more can be chosen.  I'd settle
for just choosing one, but in mutt itself i like being able to mark
multiple addresses and have mutt accept a set of addresses.  Maybe it's
easy to do this using bbdb, but i haven't used it yet so i'm not
familiar with how it works.  In any case i'm a little bit leery of
starting yet another addressbook, when one of my main issues is having
too many already.  there is supposed to be a bbdb plugin for evolution
but i can't find it anywhere in the user interface...

there are various scripts written for mutt to query external databases.
they all return a list of email addresses, one address per line.  so i
would like one function that that invokes an external query command,
then accepts the results into some kind of buffer from which one or more
addresses cna be chosen and returned as elements of the to-header.  most
of the mutt scripts are in python, so i guess one could use the pymacs
module if that makes things easier...i tried to frame this in pseudocde
but realized i don't know where to start.  do you have any ideas?  if
not there may be a way to get around this part (see below).

on top of this i want a second function that, on invocation, inserts the
contents of the current buffer into a message body, and initiates a
search within my contacts database.  i could do this two ways:
eitherwith mh-mode or somehow starting a mutt instance to do some of the
stuff directly.  so using mh-e, i'm imagining something like this:

(defun send-this-buffer (address)
	mark-whole-buffer
	mh-smail 
	;; then i don't know the real names of the commands i'm looking 
	;; for
	mh-go-to-message-body
	yank
	;; query function is the one i couldn't figure out
	;; in the previous paragrah
	mh-insert-to-address (query-address (address))
)

alternatively one could just start mutt from within emacs -- i found a
little script online that more or less does that:
http://www.vinc17.org/mutt/emacs-mutt.el .  i'm not sure exactly what's
going on there, but i imagine it could be modified into something more
like what i had above; and one would use the post-mode post.el, designed
for mutt, to insert stuff into :


(defun start-mutt-with-this-buffer-contents (address)
	(mark-whole-buffer)
	;; i'm pretty sure the syntax is wrong below
	;; final term needs to be a listp -- not sure
	;; what that means
	(set-buffer (apply 'make-term "Mutt" "mutt" nil address)) 
	(switch-to-buffer "*Mutt*")
;; at this point i would hope that a mutt process would be started in 
;; the new buffer & the address query could take place within mutt 
;; itself.  then mutt would start yet another buffer for the actual
;; message, using post.el as its mode.  the address field would already
;; be set, we would just have to insert the buffer contents
	(post-goto-body)
	(yank)
)

looks clumsy and imperfect to me

that's as much as i can come up with right now with a feverish and
somewhat whiny five-year-old on my hands.  thanks for your help!  really
appreciateit...

matt

../Dave
-- 
Matt Price
matt.price-H217xnMUJC0sA/PxXw9srA at public.gmane.org
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list