jueves, 7 de junio de 2012

erc-button fun

Erc is one of multiple irc clients bundled with emacs.  It's probably the most complex one, in fact, in #emacs you read that quite a few people left it in favour of simpler clients like rcirc. But I kind of like its complexity :)

One nice thing about erc that's not very known is erc-button.  Yeah, the thing that allows you to click on nicknames and kick them :).

At work, we use github issues to manage our stuff, and we wrote a super simple extension for our bot that whenever it sees #number it just pastes the url of the issue. I tried to use a more silent approach using erc-button, and here's the result.

It just highlights #123 like strings and make them clickable, linking to the appropiate issue in the appropiate repo.

Neat, no?

Well, if you happen to use other sites for your issues, you can work around that github-centric approach with something else, I just hacked an ugly solution on top of the previous one. Not very clean maybe, but working.

Probably, the most sensitive solution would be writing the whole urls for each one, but well... :D

The nice point here is the tight relation between emacs and all other tools and use case. In really few lines of code we solved a problem, and we did it flexibly enough to be used in multiple scenarios.

Btw, hi to all planet emacsers, that's my first post here since I signed in. I hope to contribute here some of my emacs tricks. Don't hesitate giving feedback and commenting.

Update: There are gists inlined in the post that aren't visible in planet emacsen.  Will try to change approach for the next one.

No hay comentarios: