[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 03/03: [gnugo] Keep GNUGO Board buffer read-only.
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 03/03: [gnugo] Keep GNUGO Board buffer read-only. |
Date: |
Thu, 17 Apr 2014 15:58:24 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit f4810f975566bf1fd739267aff4be134436f1f4b
Author: Thien-Thi Nguyen <address@hidden>
Date: Thu Apr 17 17:16:22 2014 +0200
[gnugo] Keep GNUGO Board buffer read-only.
* packages/gnugo/gnugo.el (gnugo-merge-showboard-results)
(gnugo-refresh): Dynamically set ‘inhibit-read-only’.
(gnugo-board-mode): Don't clear ‘buffer-read-only’.
---
packages/gnugo/gnugo.el | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 8811142..a6fa944 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -635,7 +635,9 @@ when you are sure the command cannot fail."
(bef (buffer-substring-no-properties (point-min) (point-max)))
(bef-start 0) (bef-idx 0)
(aft-start 0) (aft-idx 0)
- aft-sync-backtrack mis inc cut new very-strange)
+ aft-sync-backtrack mis inc cut new very-strange
+
+ (inhibit-read-only t))
(while (numberp (setq mis (gnugo--compare-strings
bef bef-start
aft aft-start)))
@@ -1405,13 +1407,14 @@ be slow. (This should normally be unnecessary; specify
it only if the display
seems corrupted.) NOCACHE is silently ignored when GNU Go is thinking about
its move."
(interactive "P")
- (when (and nocache (not (gnugo-get :waiting)))
- (gnugo-propertize-board-buffer))
(let* ((last-mover (gnugo-get :last-mover))
(other (gnugo-other last-mover))
(move (gnugo-move-history 'car))
(game-over (gnugo-get :game-over))
+ (inhibit-read-only t)
window last)
+ (when (and nocache (not (gnugo-get :waiting)))
+ (gnugo-propertize-board-buffer))
;; last move
(when move
(destructuring-bind (l-ov . r-ov) (gnugo-get :paren-ov)
@@ -2385,7 +2388,6 @@ In this mode, keys do not self insert.
\\{gnugo-board-mode-map}"
(buffer-disable-undo) ; todo: undo undo undoing
- (setq buffer-read-only nil) ; todo: make everything else DTRT
(setq font-lock-defaults '(gnugo-font-lock-keywords t)
truncate-lines t)
(add-hook 'kill-buffer-hook 'gnugo-cleanup nil t)