chillaranand / real-auto-save Goto Github PK
View Code? Open in Web Editor NEWAutomatically save your all your buffers/files at regular intervals in Emacs!
License: GNU General Public License v3.0
Automatically save your all your buffers/files at regular intervals in Emacs!
License: GNU General Public License v3.0
When the buffer name changes the timers can no longer find the buffers and keep giving errors. E.g. if you open: ~/foo/name
, enable real-auto-save, open ~/bar/name
now the original buffer name changed from name
to foo/name
and you get errors like: Error running timer ‘real-auto-save-buffers’: (error "No buffer named name")
each time the timer expires.
how to i disable this minor mode automatically in TRAMP?
Every time, timer time out, following is executed and a dialogue pops up.
(yes-or-no-p "%s has changed since visited or saved. Save anyway? ")
It is very anoying and sometimes it is very dangerous to loose modified contents by overwriting current buffer contents.
Rather than acting globally on all files all the time, can I conditionally enable it by calling a function?
Thanks!
Right now I have an issue with real-auto-save: I'll be typing, and in the middle of my typing, real-auto-save will kick in and save the buffer, triggering some other plugins that cause typing delays.
I would like instead for real-auto-save to save at some duration after emacs becomes idle. That is, if no text has been written into the buffer for 1 second, then do an autosave.
first of all, thanks for you work, is great. when I use helm's C-j to preview file, there will be a message of Aborting an helm session running in background
,then helm buffer will be closed,is there a way to prevent auto-real-save work when buffer opened but not modified?
either the mode is enabled or it isn't, so if the user says "always enable real-auto-save in prog-mode", that's what should happen. There are any number of mechanisms by which the user can selectively enable or disable a minor mode in certain major modes or buffers.
It can happen even when opening two files with same filename, if uniqufy package is used.
Possibly, it can be solved to keep buffer object in real-auto-save-alist instead of buffer name.
I set up auto save by enabling real-auto-save-mode
. For a while i started getting this error:
Error running timer ‘real-auto-save-buffers’: (void-variable real-auto-save-silent)
Looking at the code there is indeed no variable set with this name, only a customize group:
(defcustom real-auto-save-interval nil
"Silent save of real auto save."
:type 'convenience
:group 'real-auto-save-silent)
Other than that, this name only appears in a condition in real-auto-save-buffers
:
(if (not real-auto-save-silent)
(with-suppressed-message (save-buffer))
(let ((inhibit-message t)) (save-buffer)))
$ git show -p 46068abcd0e694556057733be11498c53cbc6e50
commit 46068abcd0e694556057733be11498c53cbc6e50
Author: conao3 <[email protected]>
Date: Wed Jul 1 12:17:46 2020 +0900
remove mentioning real-auto-save-use-idle-timer config
diff --git a/README.md b/README.md
index 55e66a6..72ccdd8 100644
--- a/README.md
+++ b/README.md
@@ -32,10 +32,7 @@ For example, to use this mode only for org files, add this to your Emacs config:
By default, real-auto-save mode uses idle timer. If your emacs is idle, after `real-auto-save-interval` seconds it will save buffers.
-If you want to save all your buffers, every `real-auto-save-interval` seconds, irrespective of idle time, use
-
- (setq real-auto-save-use-idle-timer nil)
-
+If you want to save all your buffers, every `real-auto-save-interval` seconds.
## Acknowledgments
variable name is a little confusing.
#45 removed real-auto-save-use-idle-timer
but the README still mentions it as an available option.
I have installed the latest (20150512 release) of real-auto-save and have added the following to my emacs 24.3.1 setup;
;; Automatically save the file
;;
(require 'real-auto-save)
(add-hook 'org-mode-hook 'real-auto-save-mode)
(setq real-auto-save-interval 5) ; in seconds
When I modify an org-mode file real-auto-save no longer auto saves.
need to write unit tests!
In addition to asking users to enable real-auto-save, we need to provide real-auto-save-enable
function which activates real-auto-save mode in all writable buffers.
I have a notes file in my dot emacs with which I usually start emacs. This file does not save automatically though I have this in my config:
;;REAL-AUTO-SAVE
(require 'real-auto-save)
(add-hook 'diary-mode-hook 'real-auto-save-mode)
(add-hook 'prog-mode-hook 'real-auto-save-mode)
I assume this is caused by relying only on buffer-name
to identify buffers. and/or not removing that hook when a buffer is renamed (by Emacs) when opening a second file with the same basename, even when neither the filename being visited nor the buffer contents have changed.
Reproduction:
(1) open README.md
, enable real-auto-save-mode
, autosave work.
(2) open another namesake, say ../README.md
, then real-auto-save-mode
still works, but errors from real-auto-save-mode-buffers
with "No buffer named README.md", on both files.
(3) let's say the current directory is y/
and its parent directory is x/
. then buffer-name
returns the filename qualified with as much directory necessary to disambiguate it from other file buffers. i.e. README.md<x>
for the former and README.md<x/y>
for the latter.
How to hide msg, when save file?
Consider the case when real-auto-save-interval is changed after the timer has been started.
See the reddit thread: https://www.reddit.com/r/emacs/comments/g4ojo9/emacs_freezes_on_windows_10/
Is there a way of hiding the Wrote foo.bar
message when a buffer is saved?
I found this article on emacs.stackexchange.com but I don't quite understand what the advice is.
I'm using emacs version 25.1.1.
There is very similar code in real-auto-save-mode and real-auto-save-remove-buffer-from-alist.
(Similar but not same).
To prevent fixing only one part of code by accident, it is better to merge them into one function and call from two place.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.