changeset 59129:c5ec711f16c8

(type-break-mode): Set buffer-save-without-query. Remove code that tried to set save-some-buffers-always. (type-break-file-keystroke-count): Bind deactivate-mark.
author Richard M. Stallman <rms@gnu.org>
date Mon, 27 Dec 2004 16:37:36 +0000
parents e070d86ca060
children ba97b7508fd1
files lisp/type-break.el
diffstat 1 files changed, 14 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/type-break.el	Mon Dec 27 16:35:17 2004 +0000
+++ b/lisp/type-break.el	Mon Dec 27 16:37:36 2004 +0000
@@ -399,10 +399,6 @@
       (type-break-keystroke-reset)
       (type-break-mode-line-countdown-or-break nil)
 
-      (if (boundp 'save-some-buffers-always)
-          (add-to-list 'save-some-buffers-always
-                       (expand-file-name type-break-file-name)))
-
       (setq type-break-time-last-break (type-break-get-previous-time))
 
       ;; schedule according to break time from session file
@@ -437,13 +433,10 @@
       (do-auto-save)
       (with-current-buffer (find-file-noselect type-break-file-name
                                                'nowarn)
-        (set-buffer-modified-p nil)
+	(setq buffer-save-without-query t)
+	(set-buffer-modified-p nil)
         (unlock-buffer)
         (kill-this-buffer))
-      (if (boundp 'save-some-buffers-always)
-          (setq save-some-buffers-always
-                (remove (expand-file-name type-break-file-name)
-                        save-some-buffers-always)))
       (and (interactive-p)
            (message "Type Break mode is disabled")))))
   type-break-mode)
@@ -515,16 +508,18 @@
 (defun type-break-file-keystroke-count ()
   "File keystroke count in `type-break-file-name', unless the file is locked."
   (if (not (stringp (file-locked-p type-break-file-name)))
-      (with-current-buffer (find-file-noselect type-break-file-name
-                                               'nowarn)
-        (save-excursion
-          (let ((inhibit-read-only t))
-            (goto-char (point-min))
-            (forward-line)
-            (delete-region (point) (save-excursion (end-of-line) (point)))
-            (insert (format "%s" type-break-keystroke-count))
-            ;; file saving is left to auto-save
-            )))))
+      ;; Prevent deactivation of the mark in some other buffer.
+      (let (deactivate-mark)
+	(with-current-buffer (find-file-noselect type-break-file-name
+						 'nowarn)
+	  (save-excursion
+	    (let ((inhibit-read-only t))
+	      (goto-char (point-min))
+	      (forward-line)
+	      (delete-region (point) (save-excursion (end-of-line) (point)))
+	      (insert (format "%s" type-break-keystroke-count))
+	      ;; file saving is left to auto-save
+	      ))))))
 
 (defun timep (time)
   "If TIME is in the format returned by `current-time' then