- (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
- )))))
+ (if (and type-break-file-name
+ (not (stringp (file-locked-p type-break-file-name))))
+ ;; 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
+ ))))))