I'm using auto save back to the original file for my org-mode but I only want it to work for this mode and nothing else. Is that easy to do?
Here are my org-mode options
;; Org-mode options
(add-hook 'org-mode-hook
'turn-on-visual-line-mode
'auto-save-mode)
(add-hook 'org-mode-hook '(lambda()
(setq auto-save-visited-file-name t)
(setq auto-save-interval 20)))
Note: For my full config please refer to https://github.com/map7/simple_emacs
By default, Emacs automatically saves your changes to a file intermittently. If anything should happen, you can recover a file with 'M-x recover-file' . Auto-saving can be turned on globally or on a per-buffer basis with 'M-x auto-save-mode' (users of Emacs 26.1 and later may prefer 'M-x auto-save-visited-mode' ).
Emacs does not actually understand you are editing an Org document, yet. To enable Org mode on your current document, type M-x org-mode which will enable the Org mode on the current document.
Org Mode (also: org-mode; /ˈɔːrɡ moʊd/) is a document editing, formatting, and organizing mode, designed for notes, planning, and authoring within the free software text editor Emacs.
This should provide you with the customization of the auto-save file name just in org-mode.
(add-hook 'org-mode-hook 'my-org-mode-autosave-settings)
(defun my-org-mode-autosave-settings ()
;; (auto-save-mode 1) ; this is unnecessary as it is on by default
(set (make-local-variable 'auto-save-visited-file-name) t)
(setq auto-save-interval 20))
Note: Your addition of 'auto-save-mode
in the 'org-mode-hook
would turn off auto save as it is on by default (unless you've turned it off globally).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With