Official website for Linux User & Developer
FOLLOW US ON:
Nov
16

Emacs in the real world – part 3

by Richard Smedley

Forget Perl’s claims, Emacs really is the Swiss Army chainsaw of the *NIX world. Join Richard Smedley for the conclusion of his three-part series, this time exploring how you can live your life online and do it faster and better with Emacs…

IMAP
IMAP is the first choice for many techies, as it allows you to keep all of your mail on the server and work with it from anywhere. Wanderlust (WL) was written especially to work with IMAP mail from Emacs, and is acclaimed for doing the best job with IMAP: caching, leaving messages on server etc. It shares keybindings with the once-popular Mew, which it has largely displaced.

WL supports Mailcrypt, for PGP or GPG encryption; integrates with BBDB for your address book (or use its built-in address manager); uses SEMI to handle MIME mail; and has virtual folders – and mail scoring to mark or hide by importance. Additionally, it integrates with SpamAssassin, Bogofilter, bsfilter or spamfilter.el to keep back the tide of spam; and offers an icon-based folder interface. Try it with:

(autoload ‘wl “wl” “Wanderlust” t)

and one of the sample ~/.wl files, modified with your settings. ~/.folders is also used for different mail accounts.

Heard the Gnus?
Good as WL is, for IMAP email, Gnus rules for POP, news and IMAP, according to its legion of fans. It’s almost as powerful and extensible as Emacs itself, so we can do little more than skim the surface here – but if you’re a high-volume email user, have followed the Emacs tutorial so far and are not totally satisfied by your GUI email client, we wholeheartedly recommend you take a very deep breath, then dive in and give Gnus a go.

GNUS was originally written (in 1988) to read Usenet, the old news system where everyone congregated in a Web 2.0 way before the web itself was invented. GNUS was designed to cope with newsgroups which received thousands of new posts a day, so adapts pretty well to heavy email use and RSS feeds. It was rewritten as Gnus in 1994 by Lars Magne Ingebrigtsen.
Let’s get started. Assuming you have Emacs and Gnus installed (it is included in recent Emacsen), you will find Gnus in the Tools menu, or you can type M-x gnus. However, you need to do a little configuration first, in ~/.gnus

(setq user-mail-address “you@somewhere.com”)
(setq user-full-name “Your Name”)

This tells Gnus who you are. Now we need to tell it where to get news and mail.

(setq gnus-select-method ‘(nntp “news.yourprovider.com”))
(add-to-list ‘gnus-secondary-select-methods ‘(nntp “localhost”))
(add-to-list ‘gnus-secondary-select-methods ‘(nntp “news.gnus.org”))
(add-to-list ‘gnus-secondary-select-methods ‘(nnml “”))
(setq mail-sources ‘((pop :server “pop.yourprovider.com”
 :user “yourusername”
 :password “yourpassword”)))

Note that this method will retrieve remote POP mail. To leave the mail on the remote server (in case this fling with Gnus is an experiment and you still want to use your primary mail client), you’ll either need to configure Fetchmail or investigate epop3.el.
And if you do have Fetchmail retrieving your mail and storing it locally already:

(eval-after-load “mail-source” ‘(add-to-list ‘mail-sources ‘(maildir :path “/path/to/Maildir/”
 :subdirs (“cur” “new”)))

To save being prompted for a news server password each time, make a ~/.authinfo file:

machine news.yourprovider.com login your_username password your_pass force yes
machine localhost login foo password bar

The ‘force yes’ is unnecessary on servers which don’t give anonymous access.
For sending mail you’ll need more in ~/.gnus

(setq send-mail-function ‘smtpmail-send-it)
(setq message-send-mail-function ‘smtpmail-send-it)
(setq smtpmail-default-smtp-server “your.smtp-server.com”)
(setq smtpmail-auth-credentials ‘((“hostname” “port” “username” “password”)))
(setq smtpmail-starttls-credentials ‘((“hostname” “port” nil nil)))

Continue to page 3

You might also like:
Emacs in the real world – part 1
Emacs in the real world – part 2
Linux User homepage

twitter follow us
Pages: 1 2 3
  • Tell a Friend
  • Follow our Twitter to find out about all the latest Linux news, reviews, previews, interviews, features and a whole more.

    3 Comments »

    • chaudhry anwar said:

      I have learned perl.. and I’ve learned how emacs works.. considering i’ll have to learn elisp to extend it, and vi allows perl to extend it.. I am going to choose perl until the time when I have enough free hours for fishing..

    • chaudhry anwar said:

      i am in love with the concepts of an emacs operating system.. a paradise for command-line geeks, and a powerhorse for the rest of us.. I just hope it was not so “CLOSED” w.r.t. the languages it supports for writing extension modules.. where is free here.. its free but its shitty hard to extend it unless one spends hours learning one particular language! it’s about time they thought about that and release a 2.0 release of emacs!

    • mirc said:

      I got what you intend, appreciate it for posting .Woh I am thankful to find this website through google…

    What's your opinion?

    Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

    Be nice. Keep it clean. Stay on topic. No spam.

    * Required fields