29 Aug 2012 14:21
Alerts for saves to non-existent files
kj <no.email <at> please.post>
2012-08-29 12:21:12 GMT
2012-08-29 12:21:12 GMT
It often happens that I move or rename the file "underlying" some buffer in an ongoing Emacs session and (for various reasons) fail to make the appropriate change in Emacs, with the result that I end up inadvertently saving changes to the old location. This often leads to unnecessary puzzlement (e.g. changes to an input file fail to have the expected effects, etc.). Therefore, I'm looking for a way to have Emacs notice when an attempt is made to save to a file that no longer exists. (Of course, this scenario has to be distinguished somehow from the one in which the intent is to *create* a file by saving a buffer for the first time, but maybe it is enough to somehow associate a "first save" flag with the buffer.) Is there a way to tell Emacs that, from now on, it should save all changes to this buffer to the new path (and preferably without asking for any additional confirmation)? (As itches go, this one is mild indeed, but it also has a very long standing, and for this reason alone it has caused, cumulatively over 3+ decades, a huge amount of vexation.) Thanks!
RSS Feed