All posts by Mariano Benedettini

OS X notifications for Emacs-jabber

Where I am working they have a jabber-based chat service to communicate with each other and of course I use the excellent emacs-jabber to chat from within Emacs.

The (huge) problem was that my colleagues were complaining that I weren't noticing some of their messages! And that happened when I switched, for instance, from Emacs to Firefox. That was because Emacs wasn't notifying me of the new messages. I could have switched to Adium, but I like to keep everything related with work in a single environment.

Here are some quick step-by-step instructions to get OS X notifications for every new message received in Emacs-jabber.

1. We're going to use terminal-notifier to send notifications from Emacs to OS X. Although it comes with prebuilt binaries I highly recommend Homebrew to install it and many other common packages (ack, wget, mysql, python, etc). Give it a try, you will love it. Once installed, you can test it with a simple example such as:

/usr/local/bin/terminal-notifier -sender org.gnu.Emacs -title 'Message title' -message 'This is the message content!'

It should appear a notification just like this one:

Screen Shot 2015-04-05 at 20.02.22

(Please refer to terminal-notifier itself for more details on its usage)

2. Now the only pending task is to tell Emacs to send notifications via a shell command executing terminal-notifier. Add the following lines to your .emacs :

(defun msg-via-notifier (title msg) (shell-command (format "/usr/local/bin/terminal-notifier -sender org.gnu.Emacs -title '%s' -message '%s'" title msg) ) )
(defun notify-jabber-message (from buf text proposed-alert) (msg-via-notifier from text))
(add-hook 'jabber-alert-message-hooks 'notify-jabber-message)

3. That's it!

You can also test the recently added msg-via-notifier function (after restarting Emacs) generating an example notification from Emacs:

(msg-via-notifier "Notification title" "Notification content")

True statements about agile software development management

Today in Hacker news I've seen one of the best posts about software development management, which summarizes almost all of the don'ts and burdens that all of us have to deal with at some points of our careers.

This is it: Coconut Headphones: Why Agile Has Failed

I like Scrum, I think that when correctly used is a powerful tool to help a team do their best effort in producing high-quality software. But I also think that having a ScrumMaster whose only programming experience were some Java homework from College and a few lines of VisualBasic is a waste of time for everybody.

The post reminded me of the boss I had before joining Devecoop. He strongly believed in the GitHub model: everyone should be allowed to code a feature the best way they think. However, I saw it in practice and it lead to a poor architecture mostly because of the lack of design leadership.

I believe that a minimal -and mostly technical- leadership must exist in every team, to ensure that the voice of the best and most experienced programmers is seriously taken into account -and thus, defining the architecture and other important things- but, at the same time, everybody can have opinions.

Now I have to go back to coding. I will elaborate on that last approach soon, stay tuned!