reddit / emacs

Prompt for action instead of filename has auto save data; consider M-x recover-this-file

JohnDoe365 · 2022-11-28 11:54
When my emacs crashes (seldom but though) and revisiting that file with autosave-data, I get the helpful message `... has auto save data; consider M-x recover-this-file`. However, sometimes I do not even see this message because eg. a minor-mode has actions attached which uses the minibuffer. The recovery-hint message then get's quickly buried. Instead I would rather have to actively take an action like use the auto-save file, ignore it, delete it, merge it ... Can I configure such a behavior?
oantolin · 2022-11-30 02:24
That message is printed by the `after-find-file` function and a quick perusal of its source code suggests the behavior is not easily configurable. I think your idea is a pretty decent feature request, and I suggest you bring it up on the mailing list to see what folks think. One simple option (which admittedly doesn't make for a great UX) would be to simply set `debug-on-message` to a regexp matching the message, so you at least can't miss it; you'd be thrown into the debugger. :) (setq debug-on-message "has auto save data; consider M-x recover-this-file")