4.7 KiB
Mike Gerwitz's Emacs Mail Configuration
I used to be a user of irssi, which is a damn good IRC client. But now that I'm using Emacs for many other things—including e-mail—I am comfortable exploring it for other uses.
Emacs is an ideal platform for many things because of the flexibility that Elisp provides—being able to hook and modify anything at runtime. For IRC, I'm giving ERC a try, which is distributed with Emacs.
Unfortunately, I began this transition after I had already been away from IRC (and therefore irssi) for a few years, so I won't be drawing many parallels. Feel free to submit patches to this documentation.
You can find me on Freenode, user mikegerwitz
.
As always with my code, I use lexical variable binding:
;; -*- lexical-binding: t -*-
User Information
I am mikegerwitz
on any service I use.[fn:: (unless I forgot my password
and can't recover the account…e.g. Reddit, on which I'm mgerwitz
)]
(setq erc-nick "mikegerwitz"
erc-email-userid "mtg@gnu.org"
erc-user-full-name "Mike Gerwitz")
Auto-Join
The join
module distributed (and enabled by default) with Emacs can
auto-join channels on start.o
(erc-autojoin-mode t)
(setq erc-autojoin-channels-alist
'(("freenode.net" "#fsf" "#fsf-members" "#gnu" "#libreplanet")))
Interestingly, this works even though I proxy to Freenode through a
fencepost
SSH tunnel1, connecting to localhost
; it
properly detects the server name.2
Tracking
ERC can use the modeline to notify the user when channels/queries have activity. This is absolutely necessary—channel and query buffers can easily be hidden, either intentionally or accidentally.
(erc-track-mode t)
The default positioning in the modeline is before the list of modes:
(setq erc-track-position-in-mode-line 'before-modes)
I have a wide terminal, so I can also benefit from knowing how many messages I've missed, mixed into a delicious angry fruit salad:
(setq erc-track-showcount t
erc-track-use-faces t)
The rooms I participate in are generally large, so it is not useful for me
to be notified of JOIN
, PART
, etc. Below, 333
and 353
(present in
the default) represent, respectively, notice of who set the channel topic
and the user listing.
(setq erc-track-exclude-types
'("NICK" "JOIN" "PART" "QUIT" "333" "353"))
It is easy to ignore messages from the server by setting
erc-track-exclude-server-buffer
, but I would like to be notified.
Flood Protection
Flooding occurs when too much text is send to a channel. Some channels protect against this, some don't. The issue I am more concerned with is whether flooding from myself is actually intentional.
For example, I have a lot going on in my terminal (everything except graphical web browsing), and I will occasionally paste text into the wrong buffer/window, or I will simply paste when that was not the intent (fat fingers; mouse middle-click). I have also had situations in the past where my children get to the mouse or keyboard.3
ERC offers an "accidental paste threshold" that will signal an error if lines are entered within N seconds of one-another. I set this to a threshold that I think will be reasonable, and one that will definitely be reached on paste.
(setq erc-accidental-paste-threshold-seconds 1)
The fencepost
proxy (a GNU server) is for privacy
and GNU recognition—Freenode states that it spoofs the IP Address, and it
provides a cloak in the form of gateway/shell/gnu/x-*
. Other GNU hackers
on fencepost
would be able to see my real IP (unless I torify
it), but
that's okay. I used to have an FSF cloak until my Freenode account expired,
but I find this to be more appropriate.
erc-autojoin-after-ident
in er-join.el
considers
both erc-server-announced-name
and erc-session-server
, with the former
taking precedence. In my case, the former is "foo.freenode.net"
(varies),
and the latter is "localhost"
.
One incident was my son—one year old at the time—playing with the mouse that had fallen under my desk. He caused a bunch of text in the terminal to be selected, and then subsequently pasted into an IRC channel.