I almost never manually save files; I rely on auto-save.
In the past few months I have noticed some of my edits mysteriously disappearing. The disappearances seem to be related to Linux crashes (about 2/month) or Emacs crashes (about 10/month). Today I found that my Emacs auto-save sometimes fails, but I don't know how to reproduce the auto-save failure.
Here is the time line of the last edit disappearance:
4/29/18 7:20:33 My login screen suddenly appeared. When I logged back in, all applications that where open on desktop are now closed. Messages say that Xorg and Emacs crashed. 4/29/18 About 20:00, edited tasks.org file: archived tasks and added new tasks. 5/01/18 6:13:14 My login screen suddenly appeared. When I logged back in, all applications that where open on desktop are now closed. Messages say that Xorg and Emacs crashed. 5/01/18 6:16:47 I rebooted. I opened tasks.org and saw edits from 4/29/18 20:00 are missing (tasks.org is old version modified on 29 Apr 2018 09∶33). From terminal: $ ls -l -A ~/Documents/tasks -rw-r--r--. 1 wolfv wolfv 35148 Apr 29 09:33 tasks.org -rw-rw-r--. 1 wolfv wolfv 39936 Apr 29 09:40 tasks.org_archive In my hourly backup folder, the last backup of tasks.org is tasks.org_2018-04-29_10:00:01.
So apparently the tasks.org buffer was not auto-saved for at least 10 hours.
This time I know the edit disappearance is not my imagination because both tasks.org and tasks.org_archive contain the archived tasks.
All other emacs files during this time span where auto-saved and in my hourly backup folder. The tasks.org file size is only 35 kB. The computer is always on. I am the only one with access to this computer.
- OS: gnu/linux - Emacs: 25.3.1 - Spacemacs: 0.200.10 - Spacemacs branch: master (rev. 4bb4cb46) - Graphic display: t - Distribution: spacemacs - Editing style: vim - Completion: ivy - Layers: elisp (c-c++ emacs-lisp evil-snipe git ivy org shell spell-checking) - System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES XWIDGETS
On my Spacemacs, auto-save saves to 'original, not the default 'cache. And create-lockfiles is turned off.
From my .spacemacs file:
(defun dotspacemacs/init () "Initialization function. This function is called at the very startup of Spacemacs initialization before layers configuration. You should not put any user code in there besides modifying the variable values." ;; This setq-default sexp is an exhaustive list of all the supported ;; spacemacs settings. (setq-default ... ;; Location where to auto-save files. Possible values are `original' to ;; auto-save the file in-place, `cache' to auto-save the file to another ;; file stored in the cache directory and `nil' to disable auto-saving. ;; (default 'cache) dotspacemacs-auto-save-file-location 'original ... )) ... (defun dotspacemacs/user-config () "Configuration function for user code. This function is called at the very end of Spacemacs initialization after layers configuration. This is the place where most of your configurations should be done. Unless it is explicitly specified that a variable should be set before a package is loaded, you should place your code here." ) ... (setq create-lockfiles nil) ...
There is no #tasks.org# auto-save file as expected.
There is no .#tasks.org lock file as expected.
~/.emacs.d/.cache/auto-save/site/ is empty as expected.
Can disabling lock mess up auto-save after a crash?
Any ideas on how to troubleshoot or reproduce the auto-save failure?