Emacs Mew (Snow Leopard)

Setup of Mew in Emacs for Mac OS X 10.6 (Snow Leopard)

I am using a 10.6.4 snow leopard vm in my win 7 desktop for the setup :

1. Install xcode 3.2.1 from Apple Developer Website

2. Install MacPorts-2.0.3 download . Build MacPorts in /opt/local/bin/ as default .

% sudo -s
% cd ~/Downloads
% tar xvf MacPorts-2.0.2
% configure
% make
% make install

3. Then Synchronize MacPorts software index through selfupdate , and install glib2 first as it will be used by other binaries installed through MacPorts later .

% sudo -s
% /opt/local/bin/port -v selfupdate
% /opt/local/bin/port install glib2

3.Ensure user uses binaries from /opt/local/bin and /usr/local/mew/bin (mew installed later). Edit ~/.bash_profile

export PATH=”/opt/local/bin:/usr/local/mew/bin:$PATH”

4. Install emacs ver 23.3, w3m ver 0.5.3 (w3m is a text-based web browser) and boehmgc-devel 7.2 alpha (default boehmgc installed with w3m won’t work) through MacPorts :

% sudo -s
% port install emacs
% port install w3m
% port -f deactivate boehmgc
% port install boehmgc-devel

5. Compile mew 6.3 to /usr/local . Download and extract mew 6.3 source code in /usr/local/src/mew/mew6.3 .

% sudo -s
% cd /usr/local/src/mew/mew6.3
% ./configure –prefix=/usr/local/mew-6.3
% make ; make install
% ln -s /usr/local/mew-6.3 /usr/local/mew

6. Install emacs-w3m development version in /usr/local/emacs-w3m/ . Press enter when asking for password during login :

% sudo -s
% cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot login
% cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot co emacs-w3m
% cd emacs-w3m/
% autoconf
% ./configure –prefix=/usr/local/emacs-w3m/
% make
% make install

7. Now , you should have path for /usr/local/mew/bin/mewdecode, /opt/local/bin/w3m, /opt/local/bin/emacs . Now edit ~/.emacs as follows :

(setq load-path (cons (expand-file-name “/usr/local/mew-6.3/share/emacs/site-lisp/mew”) load-path))
(autoload ‘mew “mew” nil t)
(autoload ‘mew-send “mew” nil t)

;; Optional setup (Read Mail menu):
(setq read-mail-command ‘mew)

;; Optional setup (e.g. C-xm for sending a message):
(autoload ‘mew-user-agent-compose “mew” nil t)
(if (boundp ‘mail-user-agent)
(setq mail-user-agent ‘mew-user-agent))
(if (fboundp ‘define-mail-user-agent)
(define-mail-user-agent
‘mew-user-agent
‘mew-user-agent-compose
‘mew-draft-send-message
‘mew-draft-kill
‘mew-send-hook))

(setq mew-name “USERNAME”) ;; (user-full-name)
(setq mew-mail-domain “foo.com”)
(setq mew-smtp-server “smtp.foo.com”) ;; if not localhost

(setq mew-proto “%”)
(setq mew-imap-server “imap-serv.foo.com”) ;; if not localhost
(setq mew-use-cached-passwd t)

;;
;; always add my name into cc: when I reply emails
;;
(setq mew-cc “USERNAME@foo.com”)
(setq mew-mail-address-list
‘(“USERNAME@[a-z]*.foo.com”))
;;
;; do not keep fcc (backup)
;;
(setq mew-fcc “”)

(setq load-path (cons (expand-file-name “/usr/local/emacs-w3m/share/emacs/site-lisp/w3m”) load-path))
(require ‘w3m-load)
(require ‘mew-w3m)
(setq mew-prog-text/html ‘mew-mime-text/html-w3m)
(setq mew-prog-text/html-ext ‘mew-mime-text/html-w3m)
(setq mew-use-w3m-minor-mode t)
(add-hook ‘mew-message-hook ‘mew-w3m-minor-mode-setter)

8. Testing with Mew
8.1 Invoke emacs with “/opt/local/bin/emacs” . Then load mew by “[Esc] x mew” , i.e. “M-x Mew” displayed on screen
mew1.JPG

8.2 Parsing of HTML Message with w3m by press “.”
mew21.JPG
mew31.JPG

8.3 Viewing of other attachment , e.g. pdf files in below screen shot . The attachment from the message will be displayed as below . By default , Darwin will auto-associate the Mac OS X application with corresponding file extension . To invoke the external program for viewing pdf , press [ctrl + c] [ctrl +e] , i.e. “C-c C-e” as displayed on screen :
mew41.JPG

8..4 There is a strange problem occurs on wrong encoding in message replied from mew under Mac OS X . When replying to an Email (press “a” to reply a message under mew) with citing non-unicode text messages (press “ctrl + c” “ctrl +y” to cite original message) , you can see correct encoding in Draft mode :
mew5.JPG
After sending out , when viewing back the replied message from mew , the message has wrong encoding (but this does not happen in mew under Linux or Solaris ) :
mew6.JPG
To avoid this problem, I tried out that when you see the question “Select coding system (default raw-text): ” while sending out a reply message (see below screen ) , simply don’t respond to it and instead press “Esc” 3 times to get into the editing windows , and then send out the message again from there , the encoding problem will be gone .
mew7.JPG

mew8.JPG

You may also like...