From ca70fd7a859b31ac603fac0bcea4d48180bcb6b9 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 22 Nov 2012 08:33:33 +0900 Subject: [PATCH] accept 0 as arg or autosave-buffer --- emacs.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/emacs.el b/emacs.el index 46d0819..df1261f 100644 --- a/emacs.el +++ b/emacs.el @@ -1803,9 +1803,11 @@ not happen.") (defvar autosave-buffer nil "Autosave timer object.") (defun autosave-buffer (secs) "Register timer so that the buffer will be saved automatically each time -when emacs is idle for SECS. When SECS is nil, stop the timer and disable +when emacs is idle for SECS. When SECS is 0 or nil, stop the timer and disable auto-saving." - (if sec + (if (and secs + (not (eq secs + 0))) (progn (when autosave-buffer (cancel-timer autosave-buffer) (setq autosave-buffer nil))