[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 0469947 322/357: [gnugo slog] Prefer Cursor Intan
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 0469947 322/357: [gnugo slog] Prefer Cursor Intangible mode, if available. |
Date: |
Sun, 29 Nov 2020 14:51:49 -0500 (EST) |
branch: externals/gnugo
commit 04699470690956d4dd67b40b2eb8ec12fa8308b9
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo slog] Prefer Cursor Intangible mode, if available.
GNU Emacs 25.1 looks askance at the ‘intangible’ text preoperty
and provides Cursor Intangible mode. Suggested by Stefan Monnier,
<http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00265.html>.
* packages/gnugo/gnugo.el (gnugo--intangible): New defconst.
(gnugo-propertize-board-buffer, gnugo-merge-showboard-results):
Don't use ‘intangible’ directly; instead, use ‘gnugo--intangible’.
(gnugo-board-mode): If available, turn on Cursor Intangible mode;
otherwise, clear ‘inhibit-point-motion-hooks’ locally, as before.
---
gnugo.el | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 0c84732..e726f49 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -636,6 +636,11 @@ when you are sure the command cannot fail."
:nogrid)
(save-excursion (gnugo-refresh)))))
+(defconst gnugo--intangible (if (fboundp 'cursor-intangible-mode)
+ 'cursor-intangible
+ 'intangible)
+ "Text property that controls intangibility.")
+
(defun gnugo-propertize-board-buffer ()
(erase-buffer)
(insert (substring (gnugo--q "showboard") 3))
@@ -703,7 +708,7 @@ when you are sure the command cannot fail."
(gnugo-position gnugo-yin))))
(unless (= (1- other-edge) p)
(add-text-properties (1+ p) (+ 2 p) ispc-props)
- (put-text-property p (+ 2 p) 'intangible ival)))
+ (put-text-property p (+ 2 p) gnugo--intangible ival)))
(add-text-properties (1+ other-edge) right-empty grid-props)
(goto-char right-empty)
(when (looking-at "\\s-+\\(WH\\|BL\\).*capt.* \\([0-9]+\\).*$")
@@ -794,10 +799,13 @@ when you are sure the command cannot fail."
category
,(gnugo-yy yin yang))))
(delete-char 1)
- ;; do this last to avoid complications w/ font lock
- ;; (this also means we cannot include `intangible' in `front-sticky')
- (when (setq very-strange (get-text-property (1+ cut) 'intangible))
- (put-text-property cut (1+ cut) 'intangible very-strange))))))
+ ;; Do this last to avoid complications w/ font lock and overlays
+ ;; (this also means we cannot include `intangible' in `front-sticky').
+ ;; This is necessary even for ‘cursor-intangible’; if we omit it, the
+ ;; cursor can (incorrectly) enter the text displayed by ‘:paren-ov’.
+ ;; TODO: Revisit later to see if that still holds.
+ (when (setq very-strange (get-text-property (1+ cut)
gnugo--intangible))
+ (put-text-property cut (1+ cut) gnugo--intangible very-strange))))))
(defsubst gnugo--move-prop (node)
(or (assq :B node)
@@ -2154,8 +2162,10 @@ In this mode, keys do not self insert."
(setq font-lock-defaults '(gnugo-font-lock-keywords t)
truncate-lines t)
(add-hook 'kill-buffer-hook 'gnugo-cleanup nil t)
- ;; GNU Emacs 25.1 looks askance at ‘intangible’, sigh.
- (setq-local inhibit-point-motion-hooks nil)
+ (if (eq gnugo--intangible 'cursor-intangible)
+ (cursor-intangible-mode 1)
+ ;; Make sure ‘intangible’ DTRT in this buffer.
+ (setq-local inhibit-point-motion-hooks nil))
(setq-local gnugo-state (gnugo--mkht :size (1- 42)))
(setq-local gnugo-btw nil)
(add-to-list 'minor-mode-alist '(gnugo-btw gnugo-btw))
- [elpa] externals/gnugo 844189b 308/357: [gnugo] Release: 3.0.0, (continued)
- [elpa] externals/gnugo 844189b 308/357: [gnugo] Release: 3.0.0, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 9928736 299/357: * packages/gnugo: Add `cl-lib' as dependency; require it and use its names., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 67c82c1 309/357: Fix some quoting problems in doc strings, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6bf46ba 290/357: [gnugo maint] Add ‘Maintainer’ header per top-level README; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7dbf4d7 305/357: [gnugo int] Use idiomatic ‘re-search-forward’ BOUND., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 289e336 310/357: [gnugo int] Use ‘setq-local’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d4a4afd 289/357: [gnugo int] Add section "Tip Jar" in Commentary; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c09c26a 304/357: [gnugo int] Use "%F" and "%T"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 53fe424 306/357: [gnugo maint] Update HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 21e1d9a 303/357: [gnugo int] Expose function to byte-compiler., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0469947 322/357: [gnugo slog] Prefer Cursor Intangible mode, if available.,
Stefan Monnier <=
- [elpa] externals/gnugo 4930156 239/357: [gnugo int] Move ‘gnugo-position’ call down-chain., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 57faa71 256/357: [gnugo] Don't display "Abdication {en, dis}abled"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6edd793 252/357: [gnugo] Make undo commands silently handle overkill., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b0b18d0 254/357: [gnugo int] Decorate w/ plist instead of alist., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b07f602 248/357: [gnugo int] Move ‘gnugo--passp’ earlier in file., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5524a47 262/357: [gnugo int] Maintain current buffer in ‘gnugo--finish-move’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2b8d5aa 258/357: [gnugo int] Compute "Abd" in mode-line at time of change., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6a7af2a 274/357: [gnugo int] Decruft: Presume ‘display-images-p’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 35571e3 287/357: [gnugo int] Use private obarray for :all-yy elems, display props., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0473d72 264/357: [gnugo int] Comment munging; nfc., Stefan Monnier, 2020/11/29