Document Custom Events


Looking through other plugins, its clear that many useful custom events are fired off that we could bind to (if we knew what they were). Are these documented somewhere that I am missing?


I’ve been greping through /Applications/ for things.

Change Listener

No, they’re not documented at the moment, but we’re well aware that they’re hella important. :smiley:


Has anyone figured out what the event for ‘save’ is? I’d like for a package to intercept the saving of a file to do some linting etc.


@subscribe buffer, 'saved', =>

That being said I haven’t got far enough to confirm this works, fighting with requiring modules.

Event to tie into buffer loading?

FYI: @buffer.on 'change' works, if @buffer points to a TextBuffer for change events.


I had the same problem, so I did a bit of grep/sed/awk magic in atom’s package and ended up with this list:


Here are some more examples of useful event bindings


Events I care about that I haven’t found:

renaming/deleting files/dirs not associated with a buffer -
presumably something in pathwatcher or perhaps project.rootDirectory will be helpful- I may monkey patch the later to see what it emits.

Ok, so thats really it…



var original = atom.project.rootDirectory.emit;
atom.project.rootDirectory.emit = function() {
  original.apply(this, _.toArray(arguments));

I see contents-changed and after-contents-changed, but only when I do stuff to a direct child. Iterating through child folders and adding listeners seems wrong…


Atom has been out for a bit of time now, how come all these events and the subscription mechanism is not documented anywhere ? It would boost the package community.



Writing a plugin right now and would really love to know the available events.