mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-27 10:54:40 +00:00
(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.
This commit is contained in:
parent
f57d50e70d
commit
cf8a2dae5d
@ -399,10 +399,6 @@ problems."
|
||||
(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 @@ problems."
|
||||
(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 @@ variable of the same name."
|
||||
(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
|
||||
|
Loading…
Reference in New Issue
Block a user