summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-07-02 00:45:12 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-07-02 00:45:12 +0200
commit3f601e218df49d7e87a1f5ae559fa27c560834e0 (patch)
tree66b5d5d52f90c7144323f2aac0ce60e09984edc0
parent7d9e4da447fa54633daf75a241c6b0a603c0e662 (diff)
downloadorg-mode-3f601e218df49d7e87a1f5ae559fa27c560834e0.tar.gz
org-src: Fix auto-saving of remote editing buffers
* lisp/org-src.el (org-src--auto-save-timer): No longer buffer-local. (org-src-mode): Tiny refactoring so as to keep code under 80 columns. Reported-by: Andreas Fuchs <asf@boinkor.net> http://lists.gnu.org/archive/html/emacs-orgmode/2018-07/msg00002.html
-rw-r--r--lisp/org-src.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el
index e34e5a4..42e1225 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -240,12 +240,12 @@ issued in the language major mode buffer."
;;; Internal functions and variables
+(defvar org-src--auto-save-timer nil
+ "Idle Timer auto-saving remote editing buffers.")
+
(defvar-local org-src--allow-write-back t)
(put 'org-src--allow-write-back 'permanent-local t)
-(defvar-local org-src--auto-save-timer nil)
-(put 'org-src--auto-save-timer 'permanent-local t)
-
(defvar-local org-src--babel-info nil)
(put 'org-src--babel-info 'permanent-local t)
@@ -681,7 +681,8 @@ See also `org-src-mode-hook'."
(concat (make-temp-name "org-src-")
(format-time-string "-%Y-%d-%m")
".txt")))
- (unless (or org-src--auto-save-timer (zerop org-edit-src-auto-save-idle-delay))
+ (unless (or org-src--auto-save-timer
+ (= 0 org-edit-src-auto-save-idle-delay))
(setq org-src--auto-save-timer
(run-with-idle-timer
org-edit-src-auto-save-idle-delay t