Just ran into this emacs key binding. Someday I need to just read the manual and mark all the stuff I wish I knew already for later study. But since I will probably never do that here is yet another cool thing in emacs which I didn’t know about:

C-x h runs the command mark-whole-buffer
which is an interactive compiled Lisp function in `simple.el’.
It is bound to C-x h,

.
(mark-whole-buffer)

Put point at beginning and mark at end of buffer.
You probably should not use this function in Lisp programs;
it is usually a mistake for a Lisp function to use any subroutine
that uses or sets the mark.

If you didn’t know about this, enjoy.

§172 · December 6, 2007 · emacs · (No comments) ·


Not only can you edit videos in emacs now, but you can also create music. My initial response was WTF!? However, after watching the demo videos, I can see the practical uses.

§171 · December 3, 2007 · emacs · (No comments) ·


I have been avoiding these social hype sites for a while now. I have
simply failed to see the benefit. (besides sucking yet more of my time.)

Today, stpeter posted that jaiku had a jabber interface. Anything that
allows me to quickly utilize their service via emacs is very
enticing. Since I use emacs-jabber jaiku was
simple.

While I was able to setup a profile quickly and get it setup
in jabber via xmpp:jaiku@jaiku.com I
have yet to find anyone I know on there. I have 348 people in my roster
and not one of them is on jaiku. Oh well.

I suppose the price one pays when they ignore all the social crud
crusting up the edges of the web is that they don’t know anyone
there. (Also, not blogging for a while probably might have something to
do with it.)

§164 · August 30, 2007 · emacs · 1 comment ·


so I wanted to get planner working… here is a wonderful account of my adventures

cd $HOME/.emacs-lisp #or whatever your home elisp dir is
tla register-archive http://www.mwolson.org/archives/2005
tla get mwolson@gnu.org–2005/planner-muse–mwolson–1.0 planner
tla get mwolson@gnu.org–2005/muse–main–1.0 muse

You now have all the code needed, now we need to edit your ~/.emacs

(add-to-list ‘load-path “~/.emacs-lisp/muse/lisp”)
(add-to-list ‘load-path “~/.emacs-lisp/planner”)

(require ‘muse-mode)
(require ‘muse-html)
(require ‘muse-latex)
(require ‘muse-texinfo)
(require ‘muse-docbook)
(require ‘planner)

(setq planner-project “WikiPlanner”)
(setq muse-project-alist
‘((“WikiPlanner”
(“~/notebook/muse/plans” :default “index” :major-mode planner-mode :visit-link planner-visit-link)
(:base “planner-html” :path “~/notebook/muse/html”))))

I stole that from http://lists.gnu.org/archive/html/emacs-wiki-discuss/2005-11/msg00112.html

Now you can follow the PlannerModeQuickStart

§144 · November 16, 2005 · emacs · (No comments) ·


To continue with my adventures with gnusbbdb and how to use it. I am just figuring this out myself, so feel free to correct/comment on this.

I wanted an address book and gnus doesn’t have one built in. Plus, I am inherently lazy. Typing Joh[TAB] is more appealing than typing john.doe@example.com. Besides, manually typing addresses sucks. What I am currently doing is reading through bbdb’s manual, the gnus manual and the emacswiki’s gnus section.

Obligatory Init

As with everything else, you have to start it. This is simple… if the following doesn’t work for you, rtfm.

(require ‘bbdb)
(bbdb-initialize ‘gnus ‘message)
(add-hook ‘gnus-startup-hook ‘bbdb-insinuate-gnus)
(bbdb-insinuate-message)

Simply put the above in your ~/.gnus.el and bbdb will work.

Obligatory Misc

There isn’t much more to do for basic address completion.

(setq bbdb-complete-name-allow-cycling t)
(setq bbdb-use-pop-up nil)

That allows for multiple TABs on the same entry to cycle through them. And the last one stops the bbdb buffer from popping up.

Using

Once you get it setup (really simple stuff), you probably want to use it. When reading a mail and you want to put the sender in the db, simply press ‘:’ and the email address and name (if it is there) goes in.

Thats it. bbdb was pretty simple to setup and use, very few brain cells were sacrificed.

todo

I would like to figure out how to incorporate emacs-jabber into bbdb. That way if I get an email from someone whose jid is also in the db, then I can display their presence on the email. Also would allow for a “reply to mail via jabber”. Might as well throw irc into the mix too.

§118 · August 9, 2005 · emacs · (No comments) ·


rule #1 abuse the hell out of emacs, you will learn to love it.

so lets get into how to do email, the Right Way[tm]

use gnus.

I have 4 imap , 2 pop, and 3 nntp accounts. Its a mess. I hate email. Why not make the best of a bad situation and make getting email interesting and almost fun?

Setting up the imap accounts is as simple as reading http://www.lysator.liu.se/~forsberg/docs/Gnus_and_Courier.html and http://my.gnus.org/node/225. Merge the two together into some semblence of a working config. It takes lots of tinkering.

First thing is first

Setup the basics, like the default from address and your sent folder:

(setq user-mail-address “user1@example.com”)
(setq mail-host-address “example.com”)
(setq gnus-message-archive-group “nnimap+user1:INBOX.Sent”)
(setq gnus-outgoing-message-group “nnimap+user1:INBOX.Sent”)

If you notice, which might be clearer later on, is the way we reference a folder on imap, or really any group/folder. select-type+name:namespace.folder. So the sent folder is specified via: use imap with the select-method name of “user1″ and put it in the Sent folder. Each imap server has its own namespace. This is something you have to find out on your own…. I use courier-imap so my namespace is INBOX

Wait, don’t delete that

I don’t want my mail to go away just because I read it. So the magic to keep your mail, unless explicitly marked to expire is:

(setq nnmail-expiry-wait 2)
(remove-hook ‘gnus-mark-article-hook ‘gnus-summary-mark-read-and-unread-as-read)
(add-hook ‘gnus-mark-article-hook ‘gnus-summary-mark-unread-as-read)

Its magic, really. and don’t try to make sense of it, half of gnus is designed solely to confuse you.

Where things are

We probably should setup the accounts now. I set the nntp as the first select, and the imap accounts as secondary… no idea why, but it works:

(setq gnus-select-method ‘(nntp “news”
  (nntp-address “news.example.com”)
  (nnir-search-engine nntp))
 )

(setq gnus-secondary-select-methods
 ’((nnimap “user1″
  (remove-prefix “INBOX.”)
  (nnimap-address “mail.example.com”)
  (nnimap-stream ssl)
  (nnimap-nov-is-evil t)
  (nnir-search-engine imap)
  (nnimap-authinfo-file “~/.imap-user1″)
 )
 (nnimap “user2″
  (remove-prefix “INBOX.”)
  (nnimap-address “mail.example.com”)
  (nnimap-stream ssl)
  (nnimap-nov-is-evil t)
  (nnir-search-engine imap)
  (nnimap-authinfo-file “~/.imap-user2″)
 )))

The first string in the account list is just a name, which makes it easier to refer to it in other places. You can name it anything you want, I just keep it to the login name of the account. The nnimap-nov-is-evil is a cache improvement, think speed. nnimap-search-engine is a cool little thing to help you find emails, more on that later. nnimap-authinfo-file is where the authorization info is stored, it looks like:

machine mail.example.com login user1 password user1-password

I have a different authinfo file for each account because gnus can only differentiate multiple lines by machine name, not account name. So I find it simple to just keep one line in each file and have a single file for each account.

Making the Mess Messier

Splitting, this is weird and takes some getting use to, and its not really explained well anywhere. I doubt it is even possible to explain well at all. Splitting boils down to what is commonly referred to as “filters” only much much much more powerful. Here is some courier specific magic that will make things work as you ‘expect’ them to:

(setq nnimap-split-inbox ‘(“INBOX” ))
(setq nnimap-split-predicate “UNDELETED”)
(setq nnimap-split-crosspost nil)

Finally a snippet from my split:

(setq nnimap-split-rule
  ’((“user1″ (“INBOX” nnimap-split-fancy))
   (“user2″ (“INBOX” nnimap-split-fancy))
 nnimap-split-fancy
  ’(|
   (“X-Spam-Flag” “YES” “INBOX.Junk”)
;;I snipped a lot of rules out here
   (“List-Id” “.*news.jabber.org.*” “INBOX.jabber.news”)
   (“^\\(Delivered-\\)?To” “\\(.*\\)-\\(.*\\)@example.com” “INBOX.alias.\\2″)
   ”INBOX.unsorted”))

We are running the nnimap-split-fancy rules on the user1 and user2 accounts, specifically on the INBOX folder.

  • The first rule says that, if there is a header named X-Spam-Flag and its value is YES then put it in the current account’s Junk folder
  • The second rule says that, if there is a header named List-Id and its value containes news.jabber.org move it to jabber.news folder
  • The last rule is some lispy regex magic. It boils down to: if the mail was sent to word1-word2@example.com then put it in alias.word2 folder. I have an alias system in that if I send an email or subscribe to some list then I create an alias, user1-listname@example.com
  • The last is just the “it didn’t match any rules, dump it here”. The ‘here’ I call unsorted

If you want to become really confused read the manual on fancy splitting

Where fore art thou?

I have a lot of email stored away in my imap accounts. I like to find things once in a while, this is where nnir comes in. You mark groups to search via # in the group buffer, G-G and enter the query. *poof* matching emails. good stuff. M u to unmark the group.

Me, Myself and I

With all my aliases, I like to keep people guessing as to who they are talking to. Posting styles are really useful. Read the section in the manual its simple.

This is not a complete solution to what I would like to do, and I have yet to find a way to customize it like split-fancy. I would like to be able to create more complex rules to determine values for autofill.

Just get it already

Its nice to have email pulled automatically without having to press ‘g’ in the group buffer . (yes I am that lazy). This is where gnus-demon comes in. You can read the manual but it doesn’t really help. So here is the elisp to do it:

(require ‘gnus-demon)
(setq gnus-use-demon t)
(gnus-demon-add-handler ‘gnus-group-get-new-news 10 2)
(gnus-demon-init)

Once emacs is idle for two minutes, it will pull all new emails, posts, whatever every ten minutes, e.g. it presses ‘g’ for you.

The outside world

What? you want to send email too? thats just asking too much.

I had to put this in my ~/.emacs file, it wouldn’t work in ~/.gnus.el for some odd reason

(require ‘smtpmail)
(setq send-mail-function ‘smtpmail-send-it)
(setq message-send-mail-function ‘smtpmail-send-it)
(setq smtpmail-default-smtp-server “mail.example.com”)
(setq smtpmail-smtp-server “mail.example.com”)

The Fat Lady

Thats it for now. It should be enough to get gnus up and running. I didn’t bother with pop, because thats just too easy. I was having problems posting to nntp servers, I think its fixed, not sure.

Todo:

  • Figure out a better spam system. I am using spamassassin with qmail (another post?). I would liked to type ‘S’ or ‘J’ or whatever, have the mail move to INBOX.NewJunk and have a server side script periodically make spamassassin learn from the contents of that directory.
  • there is this thing called gnus-alias, which is supposedly better than posting styles, but its outside of my package system (gentoo) and there are no docs. Or at least none that I have found.
  • gnus-registry is suppose be some kind of address book. I poked it once, it yelled at me, I ran away. I would really like to get that setup.
  • I am still getting stuck with stupid simple things. How do put multiple addressess im the To header. To: user1@example.com,user2@example.com is delivered to user1 but not user2… why?

Things that suck:

  • gnus-get-new-news blocks emacs. This means that if you are chatting in erc and gnus gets mail, you are frozen until its done. side effect of using a text editor as an email client
  • gnus is a news reader first, mail read second. as such, tasks that should be simple are really mind boggling complex for mail. that and some things are not documented well at all.

There is my first attempt to document my travels through the land of gnus. Its an interesting trip…

Finally, for your reading pleasure a gnus example config file. This is just a sanitized version of mine.

§117 · August 5, 2005 · emacs · 2 comments ·


Since I am lazy look over there

§107 · May 7, 2005 · emacs · (No comments) ·


Message-ID: <98/1@blogs.openaether.org>
From: admin

§98 · April 13, 2005 · General, emacs · 3 comments ·


Due to popular demand, here is a randomly useful thing you should know about emacs.

Something you should have in your ~/.emacs

(require 'iswitchb)
(iswitchb-mode t)

This turns on the extraordinary iswitchb mode causing no end of buffer switching delight.

§92 · April 2, 2005 · emacs · (No comments) ·