[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9. Customizing Mew

Here are explained how to change default setting of Mew and make Mew your favorite. Edit "~/.emacs" to do it!

9.1 Beginner course  
9.2 Junior course  
9.3 Senior course  
9.4 Hooks  
9.5 Config  IM Config


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1 Beginner course

Here are described the following variables.

Draft mode evaluates `text-mode-hook' and `mew-draft-mode-hook' in order. If you don't set `auto-fill-mode' to `text-mode-hook', It would be useful to define `mew-draft-mode-hook' as follows:

 
(setq mew-draft-mode-hook (function (lambda () (auto-fill-mode 1))))

You may want to use another address than which your Email manager defined. An example is the case that a host name appears in your Email address since the configuration by your Email manager is imperfect. (In this case, ask him to resolve this problem first.) If From: is specified on a draft, Mew treats it as it is. You can specify From: with completion. If you want to prepare From: in drafts, set `mew-from' as follows:

 
(setq mew-from "Kazu Yamamoto <Kazu@Mew.org>")

This feature means that you cannot trust From: in all cases. I would sincerely ask all Mew users NOT to cheat others with this feature. And please note that a bad guy can set himself up as another guy very easily. For important messages, use PGP/MIME.

If you want to back up your messages every time when you write them with Fcc:, put the following line into ".emacs".

 
(setq mew-fcc "+Backup")

Define `mew-cc'(`mew-dcc') to use Cc:(Dcc:).

If you want to use Mew with full Emacs frame, set like this.

 
(setq mew-window-use-full t)

`SPC' in Summary mode decide the next action to view a message according to `mew-summary-show-direction'. Likewise, you can specify the cursor direction after putting a strong mark by `mew-summary-mark-direction'. You can select one from the following candidates.

`up'
Display the message above.
`down'
Display the message below.
`next'
Display the next message in the direction.
`stop'
Do not display the next message.

The default value for both is `next'. If you read messages from the bottom, set as follows:

 
(setq mew-summary-show-direction 'up)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.2 Junior course

Here are described the following variables.

If `mew-use-highlight-cursor-line' is `t', underline is put on the cursor line in Summary mode. The default is `t'.

If `mew-use-highlight-mouse-line' is `t' on XEmacs, the mouse line is painted in Summary mode. This is very convenient to read messages clicking the middle button of the mouse. The default value on XEmacs is `t'.

If `mew-use-highlight-mark' is `t' and you are in Summary mode on one of folders enumerated in `mew-highlight-mark-folder-list', marked lines are painted. The default of `mew-highlight-mark-folder-list' is '("+inbox") and that of `mew-use-highlight-mark'is `t'. If `mew-highlight-mark-folder-list' is set to `t', marked lines in all folders are painted.

If `mew-use-highlight-header' is `t', a header is painted in both Message mode and Draft mode. The default is `t'.

If `mew-use-highlight-body' is `t', a body is painted in both Message mode and Draft mode. The default is `nil'.

If `mew-use-highlight-url' is `t' , strings containing URL are emphasized in Message mode. The default is `t'.

If `mew-use-highlight-x-face' is `t' on XEmacs, X-Face: in a header is iconified in Message mode. The default value on XEmacs is `t'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.3 Senior course

Here are described the following variables.

Set header fields that you want to insert every time when you write messages to `mew-header-alist' as an associate list. The following is an example.

 
(setq mew-header-alist
      '(("X-fingerprint:" . "6B 63 38 88 67 5E 96 8E  CE A4 62 73 3F 11 64 94")
        ("X-URL:" . "http://www.mew.org/~kazu/")))

To customize citation label, define field to cite in `mew-cite-fields' and format in `mew-cite-format'. Define citation symbol to `mew-cite-prefix'. The default declaration is as follows:

 
(defvar mew-cite-fields '("From:" "Subject:" "Date:"))
(defvar mew-cite-format "From: %s\nSubject: %s\nDate: %s\n\n")
(defvar mew-cite-prefix "> ")

To add Message-ID: to citation label and to change the prefix with a user name, take this way.

 
(setq mew-cite-fields '("From:" "Subject:" "Date:" "Message-ID:"))
(setq mew-cite-format "From: %s\nSubject: %s\nDate: %s\nMessage-ID: %s\n\n")
(setq mew-cite-prefix-function 'mew-cite-prefix-username)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.4 Hooks

Here is a summary of hooks used in Mew.

`mew-env-hook'
Evaluated at initialize time before setting environment.
`mew-init-hook'
Evaluated when Mew starts.
`mew-summary-mode-hook'
Evaluated at the entrance of Summary mode.
`mew-virtual-mode-hook'
Evaluated at the entrance of Virtual mode.
`mew-message-mode-hook'
Evaluated at the entrance of Message mode.
`mew-message-hook'
Evaluated every time when messages are displayed in Message mode.
`mew-addrbook-mode-hook'
Evaluated at the entrance of Addrbook mode.
`mew-draft-mode-hook'
Evaluated at the entrance of Draft mode.
`mew-draft-mode-newdraft-hook'
Evaluated in Draft mode only when new draft is prepared.
`mew-draft-mode-reedit-hook'
Evaluated in Draft mode only when an existing draft is used as draft.
`mew-cite-hook'
Evaluated every time when you cite a message. It is usually used for supercite.
`mew-before-cite-hook'
Evaluated before citation.
`mew-make-message-hook'
Evaluated before making a message in Draft mode (i.e. in the begging phase of `C-cC-m'). An example: (add-hook 'mew-make-message-hook 'ispell-message)
`mew-send-hook'
Evaluated before sending a message in Draft mode. This hook is meaningless now and is remained for backward-compatibility.
`mew-real-send-hook'
Evaluated before really sending a message in Draft mode.
`mew-quit-hook'
Evaluated at exit of Mew.
`mew-suspend-hook'
Evaluated when suspended.
`mew-summary-inc-sentinel-hook'
Evaluated when "inc" is finished.
`mew-summary-scan-sentinel-hook'
Evaluated when "scan" is finished.
`mew-summary-exec-hook'
Evaluated when `x' in Summary mode is finished.
`mew-syntax-format-hook'
Evaluated when the function `mew-syntax-format', which creates the multipart format, is called.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5 Config

If you specify "case" blocks in your IM "Config" file, you can change actions of imget and imput. Suppose that the followings are specified in Config.

 
Imget.Src=pop/apop:kazu@mail.mew.org
User=kazu
FromDomain=Mew.org
case wide
Imget.Src=pop/rpop:robby@mx.wide.ad.jp
User=robby
FromDomain=wide.ad.jp
case iijlab
Imget.Src=imap:kazu@mailbox.iijlab.net
FromDomain=iijlab.net

By default, imget retrieves kazu's messages from mail.mew.org by APOP. And if the From: field doesn't exist in a message to be sent(e.g. when mew-from is set to nil), the user name "kazu" and Mew.org is concatenated with "@" then imput specifies it in the From: field.

If you specify --config=wide to imget, it retrieves robby's messages from mx.wide.ad.jp by RPOP. Also, imput chooses robby@wide.ad.jp for the From: field.

In this way, imget and imput selects valid case block according to the --config option. As you see above, with this feature, it is very convenient since you can change mailbox and your address.

When Mew boots up, it investigates case statements. If there are one or more kinds of case statements, `mew-config-list' is set. The block to be read when --config is not specified is represented as "default". In the case up above, '("default" "wide" "iijlab") is set to `mew-config-list'.

If you type `C' in Summary mode, you can complete the value to be specified with the --config option for imget, using `mew-config-list' as candidates. The default value is "default". If other value is selected, say "wide", `i' displays the following message.

 
Getting +inbox (wide)...

To specify case block to imput, you can use the Config: field in a message to be sent. In Draft mode, you can complete the Config: field itself by `TAB' as described in See section 4.1 Completions in a header. Also, you can complete its value by `TAB' using `mew-config-list' as candidates. Moreover, you can use circular completion of `mew-config-list' by `C-cTAB'.

However, you may think this is a boring job. You would want Mew to guess a value of Config: because Mew can guess refile folders. Of course, Mew supports this kind of guess feature. You can specify your guess rule to `mew-config-guess-alist'. Its syntax is exactly the same as `mew-refile-guess-alist' explained in See section 6.2 Guess by user defined rules.

Let's look at one example:

 
(setq mew-config-guess-alist
   '(("To:"
      ("wide.ad.jp" . "wide")
      ("mew.org" . "mew"))))

In this case, if To: matches wide.ad.jp, "Config: wide" is inserted. If it matches mew.org, "Config: mew" is inserted.

There are three changes that you can insert the Config: field with this feature.

  1. When a draft is prepared if `mew-config-insert-when-prepared' is `t'.
  2. When a message is composed by `C-cC-m' if `mew-config-insert-when-composed' is `t'.
  3. Anytime when you type `C-cC-o'.

This is just for your information. If you want select Config: by hostname, put the following line in your ".emacs".

 
(setq mew-config-guess-alist
   (list (cons nil (system-name))))


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by XEmacs shared group account on December, 19 2009 using texi2html 1.65.