Monday, June 29, 2009

My next platform

I'm not sure what it's going to be, but I know the next platform for a programming project is going to be emacs.
It has all the stuff you need to write all sorts of applications. Entire mail clients are written in it, you can ftp from it, there's stuff to organize your life like org-mode, calendars, calculators, games, I could go on until my fingers hurt.

Ofcourse Emacs Lisp isn't Common Lisp but I doubt I'll really notice that much difference. There is however the difference in scope. I'm quite curious to see how that turns out to influence my coding.

I've been trying to get all of my 'stuff' into emacs, but it's not working out exactly as I want. I'm using it for IRC, twitter and org-mode at the moment. I'm still struggling with email. I've worked with gnus for a while and while it's not that bad, it's not exactly smooth sailing either. Maybe I need to read up in the manual a bit first.

This programming project is probably going to be something for my GTD in emacs. I've been looking for a way to do the 43 folders thingy, but can't find anything really useful in emacs. Maybe I'll try my hand at creating one myself.

Emacs already is my number one tool in Linux, perhaps it'll be my number one programming platform in the future?

Edit: I'm also considering StumpWM as a platform. The nice thing is, it's real CL!

Thursday, June 11, 2009

My little Gnus and Gmail howto

I've been looking for a while to centralize all my common tasks in emacs.
So far I've been able to do these:
  • IRC with ERC
  • Twitter with twit.el
  • Email with Gnus
The ERC and twitter part are easy, but if you're interested, drop me a line and I'll make another post. (I made ERC behave just enough like irssi to make the transition painless for me)

Gnus is great because it comes with emacs. No extra installing needed.
I use a Gmail account for almost everything I do, so it's only logical I'd use that one in Gnus. There are lots of nice tutorials online on how to configure Gnus with Gmail or with IMAP. I had to read a couple and get the best parts from each to get my own config.
I made a little file that loads only when it exists. This is handy for sharing my config over multiple computers.


(if (file-exists-p "~/.emacs.d/local.el")
(load "~/.emacs.d/local.el"))


This file contains the Gnus config:


;; LOCAL FILE FOR LOADING LOCAL STUFF!

;; got this line from one of the tutorials. Seemed interesting enough
(setq gnus-invalid-group-regexp "[:`'\"]\\|^$")

;; standard way of getting imap going
(setq gnus-select-method
'(nnimap "gmail"
(nnimap-address "imap.gmail.com")
(nnimap-server-port 993)
(nnimap-stream ssl)))

;; set up smtp so we can send from gmail too:
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
smtpmail-auth-credentials '(("smtp.gmail.com" 587 "myemailaddy@gmail.com" nil))
smtpmail-default-smtp-server "smtp.gmail.com"
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-smtp-service 587)

;;http://www.emacswiki.org/cgi-bin/wiki/GnusGmail
;;http://linil.wordpress.com/2008/01/18/gnus-gmail/

(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)

;; Threads are nice!
(setq gnus-summary-thread-gathering-function
'gnus-gather-threads-by-subject)

(setq gnus-posting-styles
'((".*"
(name "Gert M")
("X-URL" "http://gertm.blogspot.com/"))))

(setq user-full-name "Gert")
(setq user-mail-address "myemailaddy@gmail.com")
(setq send-mail-function 'smtpmail-send-it)


When loading Gnus the first time, in the folder window press 'S s' and type in the names of the folders you want to see.

That's all there is to it.

Now I just need to learn how to configure this more to my liking.

Hope this helps someone.

Update:
In the folder view, checking for new mail on a group is done with M-g

If you set the level of the groups you want to check regularly, you can check them together:

In the group view, put the cursor on a group and do:

S l 1

to put it to level 1. After you've done this for a couple of groups do this:

1 g

This will check for new message on all groups with level 1.

I'll update here some more after I find new interesting stuff!