Best practice to prevent selected event handlers from being invoked


Hi all, I’m trying to develop a package that keeps tainted files as it is. So there shouldn’t be any prompt asking “Do you want to save the changes?”

I have figured out the chain of delegation. It starts from ipc.send("call-window-method", "close"), and the prompt window particularly is in pane class @promptToSaveItem.

Now, how should I achieve what I want to - add my cusom event handler for the window-close event, alongside other handlers. Disable not all event handlers but only the promptToSaveItem behaviour.

I can think of a few candidates that might NOT be good practices, like touching the pane class itself and replace its @promptToSaveItem method, which is a violation of

I’m new to the community. Bear with me if I asked something obvious. Thanks in advance!


Why do you want to circumvent the standard save behavior?


Hi, thanks for your reply. I came from Sublime text editor. In Sublime it never prompts for saving. It sliently saves the state and resume when reopen. I’m trying to reproduce that behaviour for those who are used to Sublime.

See details here:


Although Atom prompts for saving when explicitly closing tabs, it already autosaves the state of both buffers tied to files and in the latest beta autosaves untied buffers as well.



Hi, thanks for the info. I installed beta: 1.4.0-beta1, and indeed the hahaviour is implemented