[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 671d7aa 147/357: [gnugo frolic] Sync column heade
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 671d7aa 147/357: [gnugo frolic] Sync column headers w/ buffer text; handle offsets. |
Date: |
Sun, 29 Nov 2020 14:51:09 -0500 (EST) |
branch: externals/gnugo
commit 671d7aac7279111fa72d70748757826032194f96
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo frolic] Sync column headers w/ buffer text; handle offsets.
* packages/gnugo/gnugo.el (gnugo-frolic-in-the-leaves):
For ‘header-line-format’, replace constant string
with ‘(:eval ...)’ form that handles left scroll bar,
left fringe, and horizontal scrolling margin, if any.
---
gnugo.el | 33 ++++++++++++++++++++++++++++-----
1 file changed, 28 insertions(+), 5 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index f042e7a..d19a195 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -829,11 +829,34 @@ are dimmed. Type \\[describe-mode] in that buffer for
details."
(gnugo-frolic-mode)
(erase-buffer)
(setq header-line-format
- (concat (make-string 11 ?\s)
- (mapconcat (lambda (n)
- (format "%-5s" n))
- lanes
- " ")))
+ (lexical-let ((full (concat
+ (make-string 11 ?\s)
+ (mapconcat (lambda (n)
+ (format "%-5s" n))
+ lanes
+ " "))))
+ `((:eval
+ (funcall
+ ,(lambda ()
+ (cl-flet
+ ((sp (w) (propertize
+ " " 'display
+ `(space :width ,w))))
+ (concat
+ (when (eq 'left scroll-bar-mode)
+ (let ((w (or scroll-bar-width
+ (frame-parameter
+ nil 'scroll-bar-width)))
+ (cw (frame-char-width)))
+ (sp (if w
+ (/ w cw)
+ 2))))
+ (let ((fc (fringe-columns 'left t)))
+ (unless (zerop fc)
+ (sp fc)))
+ (condition-case nil
+ (substring full (window-hscroll))
+ (error ""))))))))))
(set (make-local-variable 'gnugo-frolic-parent-buffer) from)
(set (make-local-variable 'gnugo-state)
(buffer-local-value 'gnugo-state from))
- [elpa] externals/gnugo abb12ef 345/357: [gnugo] Include seki groups in game-over data., (continued)
- [elpa] externals/gnugo abb12ef 345/357: [gnugo] Include seki groups in game-over data., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 82c5b64 351/357: [gnugo imgen] New fit func to ignore bottom grid line, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 152c53c 354/357: [gnugo] Move two funcs internal., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5566285 026/357: [gnugo] Give names and docstrings to ‘lambda’ commands., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 62a7c8d 052/357: [gnugo slog] Specify second arg to ‘unintern’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo eae8444 113/357: [gnugo int] Specify STREAM to ‘pp’ directly., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 00ae088 120/357: [gnugo int] Use ‘gnugo--tree-ends’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo fa99b79 134/357: [gnugo int] Make ‘gnugo-board-buffer-p’ precise., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8f99c83 151/357: [gnugo frolic int] Don't bother to awake w/ ‘col’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 283534a 157/357: [gnugo sgf int] Consolidate loops., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 671d7aa 147/357: [gnugo frolic] Sync column headers w/ buffer text; handle offsets.,
Stefan Monnier <=
- [elpa] externals/gnugo 45fe672 169/357: [gnugo int] Move :SZ access into ‘gnugo--as-pos-func’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5e24ee5 182/357: [gnugo int] Use GTP ‘reg_genmove’ instead of ‘genmove’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e387d96 193/357: [gnugo int] Accept color for ‘gnugo-push-move’ 1st arg., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 876e0d3 195/357: [gnugo] New command: ‘C-c C-a’ (gnugo-toggle-abdication), Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1fa7d59 204/357: [gnugo int] Add abstraction: gnugo--plant-and-climb, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d96223f 209/357: [gnugo] Move most of ‘gnugo-board-mode’ to ‘gnugo’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo eb77485 215/357: [gnugo int] Don't make ‘font-lock-defaults’ buffer-local., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4d5f998 217/357: [gnugo int] Decruft: Drop unused local var., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e6c0a07 229/357: [gnugo int] Fix bug: On -l/--infile, don't set :last-mover., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 11543e5 232/357: [gnugo] Reduce modifier key bouncing for "quick peek" frolics., Stefan Monnier, 2020/11/29