Katipo
Search  
Site Blog
  About  
  Home
About Portfolio Solutions Client Area Contact Us
: : About Us
Awards
Jobs
Our People
What Is A ... ?
Working From Home
News
Photo Gallery
Katipo Blog


ERC (emacs IRC client) Set Up in Aquamacs

I’m going to outline how to set up Aquamacs for my IRC requirements with the built in ERC emacs IRC client so that it automates joining the server and channels I want, with some other bells and whistles (the bell part, literally!). All of these steps have .emacs file equivalent, so you could use it as a starting pointing point for figuring out how to set them, even if you don’t use Aquamacs (Mac OS X GUI emacs).

Here are the steps:

First select Aquamacs -> Preferences from the menu bar. You’ll get a “*Customize Group: Emacs*”, click on “Goto Group” link next to Applications section. Do the same next to the Erc section of the next buffer. Now we are in “*Customize Group: Erc*” buffer this is where we’ll do most of our work.

If you want a server other than the default irc.freenode.net, next to “Erc Server” click “Value Menu:” and select “Server” from the pop-up menu. Type in your server into the field. We’ll save this when we save all the options for this buffer later.

I use the default, so I didn’t need to change the Erc Port settings, but if do, repeat the same process that you did for the server with the Erc Port settings.

My nick is the same as my unix login user, i.e. the default. So again, set if you need to, I didn’t.

You get the idea for the standard fields. So I will only go into detail about things that have a different process. For example, you may want to experiment with the Erc Modules options, in which case, click “Show Values” and check or uncheck the options you want (note that some may hose your settings, if not properly supported by your set up, the *Messages* buffer is a good place to get the rundown if things go wrong).

I like my name highlighted and to receive a bell, so that I know when someone is trying to get a hold of me if I’m working in another window. To do this, click “Goto Group” next to Erc Match. Then select “keyword” from the menu you that pops up from “Value Menu” next to “Erc Current Nick Highlight Type” section.

The default Erc Beep Match Types is set to current-nick. So nothing to do there, but you need to click on “Show Value” for Erc Text Matched Hook and check “erc-beep-on-match”.

We’re done in Erc Match group. To save our settings, scroll back to the top of the buffer, click “Save for Future Sessions”, answer prompt with “yes”, then click “Finish” to dismiss that set of settings. Do this again for each group we go into, when we are done with it.

Time to set the channels to autojoin. Back in the “*Customize Group: Erc*” buffer, click “Goto Group” next to “Erc Autojoin”.

Autojoin should already be on, i.e. display “on (non-nil)”. So we only have to add to “Erc Autojoin Channels Alist”. Click “Show Value” next to that section. Use the “INS” and “DEL” buttons and the corresponding fields to insert and delete the server and channels.

Note that erc-autojoin-mode didn’t actually work for me which maybe related to my irc server’s set up. Make sure your server name is the same as where you actually get logged into, not a DNS redirect or something. Also private channels that require invites take more work. I just use an emacs for them. See below.

When you are done, do the save and finish steps for that group buffer.

We’re almost done with the Customization interface for Erc. Lastly, turn on sound in Erc so that we can hear our alerts. Click “Goto Group” next to Erc Sound, then toggle the value for Erc Sounds Mode to “on (non nil)”. Save that group and finish.

Do this again for the parent group’s buffer, too, “*Customize Group: Erc*”. Hit “Finish” for all the other parent groups, then restart Aquamacs.

Out of the box Aquamacs doesn’t support beeping (sound isn’t properly set up). To get beeping when your nick is used, you need to the additional steps outlined here:

Playing with Sound on Mac OS X

Now we’ll record a couple macro for joining channels and setting up buffers split into various “windows” within the frame. You can find background on this step:

http://www.lepp.cornell.edu/~bxin/computer/emacs/emacs24/emacs110.htm
and
http://www.lepp.cornell.edu/~bxin/computer/emacs/emacs24/emacs112.htm

Basically it boils down to this; figure out what steps you want to automate, record the macro, name the macro, save the macro to ~/Library/Preferences/Aquamacs Emacs/Preferences.el (or ~/.emacs), and you’re done.

Let’s go through the steps with some details, starting after you have figured out what you want to automate (in my case starting erc and then joining channels while putting them in different areas of the frame) are:

  • Start the recording process by typing “Control-x (”
  • Do the steps you are automating
  • End the recording process by typing “Control-x )”
  • Name the macro with “Meta-x name-last-kbd-macro” (make sure to be smart about not using a name that is already used by emacs)
  • Open ~/Library/Preferences/Aquamacs Emacs/Preferences.el for editing, go to someplace suitable in the file and do “Meta-x insert-kbd-macro”, save the file
  • restart Aquamacs and test

Because some of the steps needed to wait until the IRC server connection was established before they could be run, I had to split the steps into two macros, one for connecting to the server and joining the first public channel which triggers and invite to a private channel, and lastly the other for all others steps after that.

Macros can take a few tries to get right, but are immensely handy timesaver for things like this.

Cheers,
Walter

Leave a Reply

You must be logged in to post a comment.


Katipo
Rachel Snowboarding