Jim Breton <[EMAIL PROTECTED]> wrote on Sat, 29 Jan 2000:
> As some of you may remember I just "discovered" Mutt only a few days
> ago.  Well, those few days have been awesome, Mutt is unbelievable!

I'm glad you think so.  And I wholeheartedly agree! :-)

> I do have a few questions though.  :)

Well, you've come to the right place. :-)

> For one, I'm always wondering if anyone has any patches for matching on
> something other than the beginning of a Subject line....  ;-)

Matching in which situation..?  Sorry, I don't understand the question.

> Also: is it possible to change header settings without changing folders
> (where I am using folder-hooks to change headers)?

Anything you can specify in the .muttrc can also be changed at "run
time", interactively from within Mutt.  The method for this is the
"enter-command" function, bound to the : by default -- when you press
the : key, you get a command line where you can type any Mutt command
like it appeared in .muttrc, and it'll take effect immediately.  (Some
settings affect the ways how Mutt parses folder and message contents,
so for those settings it may take a folder change/reload to see the
effects -- but this is getting a bit too technical and detailed for a
brief general answer...)

> Something like a
> macro.  I haven't tried any run-time reconfiguration yet, I've been
> doing everything in my .muttrc with hooks so far.

It's really easy. :-)  Also, even if you change your .muttrc, you can
reload it by doing ":source .muttrc" so you don't really need to restart
Mutt even in that case.

About macros: anything you can give as a command sequence to Mutt (type
with the keyboard) you can also make into a macro.  You can create
macros that execute configuration commands via the : command-line.
For example:

  macro index <f2> ":source ~/.muttrc\n"

... would make F2 reload your .muttrc when in the message index.
(Assuming your termcap settings are correct so that F2 gets interpreted
properly.)

> But let's say I
> wanted to send a msg from this address (jamesb-mutt) but I was in a
> folder which ran a hook that changed my address to something different.
> There must be some way for me to re-config without changing folders and
> without editing the headers by hand?

Well, let me answer you by describing how most (?) Mutt users do this.
In addition to having header configuration based on the current folder
(via folder-hooks), Mutt lets you also change things based on the
message _recipient_.  These are called send-hooks.  So instead of
specifying "I want to use From: header X for my emails when I'm in
folder A", the usual method is "I want to use From: header X for emails 
sent to recipient B".  That way, it doesn't matter in which folder you
are when you decide to send a message somewhere; the headers are
dependent on the recipient.

This approach is not entirely without its problems, but overall it works
very well (better than the folder-centered thinking, IMHO).

To get you started, let me give a brief example:

  send-hook . my_hdr From: Myself <[EMAIL PROTECTED]>
  send-hook mutt-users From: Myself <[EMAIL PROTECTED]>
  send-hook another-list From: Myself <[EMAIL PROTECTED]>
  send-hook @some.domain$ From: Myself <[EMAIL PROTECTED]>

Especially note the default case, listed first, which is very important
to have, because hook settings remain in place indefinitely after being
set.  So you need to have a default setting with the . hook, or
otherwise if there is no matching hook, whatever was specified last gets
used.

Whew!  That became slightly longer than I intended. :-)

> Lastly, is there an address-book-ish feature where I can type a
> common-name like "Jim" and it will expand the address to
> "[EMAIL PROTECTED]"?  Would aliases in my .muttrc do this?

Yes. :-)  There's no addressbook as such, only a list of aliases, but
you can browse the list by pressing TAB at any prompt where you're
expected to give an address.  If you prefer not to clutter up your
.muttrc with aliases, wou can also have a separate alias file, and then
have a

  source ~/.mutt_aliases

command in your .muttrc (for example).  You might also want to set
$alias_file appropriately, but note that this doesn't get automatically
sourced.  Read the manual for more details on that.


> P.S. If I have my spoolfile in /var/spool/mail/$USER but I don't want to
> have to browse to it constantly in the folder list, is it safe to make a
> symlink in my ~/mail/ directory which points to the file in /v/s/m/?

If you have the $spool setting specified correctly (it probably will be,
by default), you can just use the ! shortcut to get to that folder.  Ie.
c for change folder, ! for the spool folder, and enter.

But a symlink should be fine too, AFAIK.


Hope these help, and happy Mutt-ing,
Mikko
-- 
// Mikko Hänninen, aka. Wizzu  //  [EMAIL PROTECTED]  //  http://www.iki.fi/wiz/
// The Corrs list maintainer  //   net.freak  //   DALnet IRC operator /
// Interests: roleplaying, Linux, the Net, fantasy & scifi, the Corrs /
If you have to run heating in winter, you don't own enough computers.

Reply via email to