5/24/2011

Using emacs-jabber

A couple of days back, my friend Pradeep told me how to set up gtalk inside emacs using emacs-jabber. I am going to just repeat all those instructions as well as tell some of the things that I discovered.
Note: I don't know whether the following works for windows.

STEP 1:
If you are using Ubuntu/Debian, just download the emacs-jabber package from synaptic OR you can also download the tarball from here, extract it and add the following lines in your .emacs file:
(add-to-list 'load-path "/path/to/emacs-jabber")
(require 'jabber)
If M-x eval-buffer fails, replace the last line by
(require 'jabber-autoloads)
Please note that those who are installing emacs-jabber from synaptic need not add any of the above lines.

STEP 2:
Now, add the following lines to your .emacs file irrespective of whether you have used synaptic or downloaded the tarball for the first step. These lines basically set up a jabber account for you. Don't forget to put your own gtalk ID in place of username. 
 
(setq jabber-account-list
     '(("saheel.godhane@gmail.com"
     (:network-server . "talk.google.com")
     (:connection-type . ssl)
     (:port . 443))))


You can try different port numbers like 5222 or 5223 depending on which works for you. Just replace 443 above by whatever port no. you want to try.

Also, you can add the following 2 lines if you don't want avatars to be displayed for your gtalk contacts in the roster buffer (which basically lists all your contacts and many options to use Jabber).

(setq jabber-vcard-avatars-retrieve nil
      jabber-chat-buffer-show-avatar nil) 

STEP 3:
Run M-x jabber-connect to connect to the gtalk server. It will prompt for your Jabber ID. Just put your complete gtalk ID, i.e. username@gmail.com.

Here are a few shortcuts which I use frequently.
C-x C-j C-r..............this opens the roster buffer.
C-x C-j C-$.............sets your status as away or available according as "$" equals "a" or "o".
C-x C-j C-c.............connects you to jabber, i.e. it executes M-x jabber-connect
C-x C-j C-d.............disconnects you from jabber, just like "sign out of chat".

Please post other shortcuts that you come across as comments below.

Customize jabber:
Run M-x jabber-customize to customize jabber. There are a host of options. Some of them which I customized are:
Jabber alerts------play sound when you receive message , etc. options can be set here.
Jabber Roster------here you can change the way roster buffer looks, the way colors are used to display contacts, etc.
In the Roster buffer, there are a few options given at the top. You can try some of them as well.


I am sure you can find many interesting things about Jabber if you play around. Please post your findings as comments below. Also, post any corrections in the above write-up if you find any mistakes.

No comments:

Post a Comment