summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Julien Danjou <julien@danjou.info>2010-09-12 22:18:33 +0200
committerGravatar Julien Danjou <julien@danjou.info>2010-09-12 22:18:33 +0200
commitf88e8b93080f40de1c4683ff550239ecd632505c (patch)
tree12fc5a99dda940eedc677dab68490d28226954c2
parent45de3307b81884aed752ce75af7e1a26ec2012a4 (diff)
Put buffer read-only without undo list
-rw-r--r--offlineimap.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/offlineimap.el b/offlineimap.el
index 9952351..04efe53 100644
--- a/offlineimap.el
+++ b/offlineimap.el
@@ -181,17 +181,18 @@ This is used when `offlineimap-mode-line-style' is set to 'symbol.")
(let ((buffer (process-buffer process)))
(when (buffer-live-p buffer)
(with-current-buffer buffer
- ;; If the cursor is at the end, append text like we would be in
- ;; "tail".
- (if (eq (point) (point-max))
- (progn
+ (let ((inhibit-read-only t))
+ ;; If the cursor is at the end, append text like we would be in
+ ;; "tail".
+ (if (eq (point) (point-max))
+ (progn
+ (insert text)
+ (set-marker (process-mark process) (point)))
+ ;; But if not, let the cursor where it is, so `save-excursion'.
+ (save-excursion
+ (goto-char (point-max))
(insert text)
- (set-marker (process-mark process) (point)))
- ;; But if not, let the cursor where it is, so `save-excursion'.
- (save-excursion
- (goto-char (point-max))
- (insert text)
- (set-marker (process-mark process) (point))))))))
+ (set-marker (process-mark process) (point)))))))))
(defun offlineimap-process-filter (process msg)
"Filter PROCESS output MSG."
@@ -249,6 +250,8 @@ This is used when `offlineimap-mode-line-style' is set to 'symbol.")
(define-derived-mode offlineimap-mode fundamental-mode "OfflineIMAP"
"A major mode for OfflineIMAP interaction."
- :group 'comm)
+ :group 'comm
+ (setq buffer-read-only t)
+ (setq buffer-undo-list t))
(provide 'offlineimap)