bbatsov / super-save

Save Emacs buffers when they lose focus
313 stars 20 forks source link

Replace advises with hooks? #5

Closed swsnr closed 5 years ago

swsnr commented 8 years ago

Currently super-save advises a couple of Emacs functions to catch buffer switching, but I think we could replace these advises with two hooks:

bbatsov commented 8 years ago

Hmm, for some reason I wasn't watching my own repo and saw this message just now. :-(

Your suggestions seem good. This would simplify the code a lot... (not that it's super complex :-) ).

bbatsov commented 8 years ago

Btw, those hooks are triggered before the switch is triggered right? I played briefly with the idea but I got some strange stackoverflow errors... Maybe the save command is triggering some infinite loop using those hooks.

swsnr commented 8 years ago

@bbatsov I don't know; I must admit that I didn't actually try. I just thought it might be a good idea. :blush:

bbatsov commented 5 years ago

Now that hooks are configurable in 0.3 everyone can just remove the command triggers and try some hook triggers instead. E.g.

(add-to-list 'super-save-hook-triggers 'buffer-list-update-hook)