[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 228/255: refresh the game list buffer
From: |
Eric Schulte |
Subject: |
[elpa] 228/255: refresh the game list buffer |
Date: |
Sun, 16 Mar 2014 01:02:53 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 809f1c8dceba40172ce86c031898483b4a1edd4f
Author: Eric Schulte <address@hidden>
Date: Thu Aug 8 11:41:59 2013 -0600
refresh the game list buffer
---
back-ends/igs.el | 4 +++-
list-buffer.el | 23 ++++++++++++++++++++---
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/back-ends/igs.el b/back-ends/igs.el
index 2136448..619d9ab 100644
--- a/back-ends/igs.el
+++ b/back-ends/igs.el
@@ -215,7 +215,9 @@ This is used to re-send messages to keep the IGS server
from timing out.")
'("#" "white" "rk" "black" "rk" "move" "size" "H" "Komi" "by" "fr" "#")
(lambda (row col)
(let ((id (car (nth row *buffer-list*))))
- (with-igs instance (igs-observe id)))))))
+ (with-igs instance (igs-observe id))))
+ (lambda (row col)
+ (igs-get-games instance)))))
;;; Specific handlers
diff --git a/list-buffer.el b/list-buffer.el
index 2657107..ce65a31 100644
--- a/list-buffer.el
+++ b/list-buffer.el
@@ -44,7 +44,14 @@ The function should take two arguments, the current row and
column respectively and may access the current buffer list
through the `*buffer-list*' variable.")
-(defun list-buffer-create (buffer list &optional headers enter-function)
+(defvar *refresh-function* nil
+ "Function used to refresh a list element or the whole list.
+The function should take two arguments, the current row and
+column respectively and may access the current buffer list
+through the `*buffer-list*' variable.")
+
+(defun list-buffer-create
+ (buffer list &optional headers enter-function refresh-function)
(pop-to-buffer buffer)
(list-mode)
(set (make-local-variable '*buffer-width*) (window-total-width))
@@ -52,8 +59,13 @@ through the `*buffer-list*' variable.")
(set (make-local-variable '*buffer-headers*)
(mapcar (curry #'format "%s") headers))
(set (make-local-variable '*enter-function*)
- (or enter-function (lambda (row col)
- (message "%S" (nth col (nth row *buffer-list*))))))
+ (or enter-function
+ (lambda (row col)
+ (message "enter %S" (nth col (nth row *buffer-list*))))))
+ (set (make-local-variable '*refresh-function*)
+ (or refresh-function
+ (lambda (row col)
+ (message "refresh %S" (nth col (nth row *buffer-list*))))))
;; refresh every time the buffer changes size
(set (make-local-variable 'window-size-change-functions)
(cons (lambda (b)
@@ -137,6 +149,10 @@ through the `*buffer-list*' variable.")
(interactive)
(funcall *enter-function* (list-current-row) (list-current-col)))
+(defun list-refresh ()
+ (interactive)
+ (funcall *refresh-function* (list-current-row) (list-current-col)))
+
(defun list-filter ()
(interactive)
(error "not implemented."))
@@ -168,6 +184,7 @@ through the `*buffer-list*' variable.")
(define-key map (kbd "<up>") 'list-up)
(define-key map (kbd "<down>") 'list-down)
(define-key map (kbd "f") 'list-filter)
+ (define-key map (kbd "r") 'list-refresh)
(define-key map (kbd "RET") 'list-enter)
(define-key map (kbd "q") 'bury-buffer)
map)
- [elpa] 210/255: using curry, rcurry and compose helpers, (continued)
- [elpa] 210/255: using curry, rcurry and compose helpers, Eric Schulte, 2014/03/15
- [elpa] 203/255: adding GPL copyright file, Eric Schulte, 2014/03/15
- [elpa] 243/255: undo through gtp pipe, Eric Schulte, 2014/03/15
- [elpa] 246/255: customizable default gnugo options, Eric Schulte, 2014/03/15
- [elpa] 241/255: igs class definitions up front for better loading, Eric Schulte, 2014/03/15
- [elpa] 247/255: notes, Eric Schulte, 2014/03/15
- [elpa] 235/255: better line truncation, Eric Schulte, 2014/03/15
- [elpa] 250/255: mark dead stones at end of game, Eric Schulte, 2014/03/15
- [elpa] 229/255: igs TODO: consistent game un-observation, Eric Schulte, 2014/03/15
- [elpa] 242/255: need assoc for aget, Eric Schulte, 2014/03/15
- [elpa] 228/255: refresh the game list buffer,
Eric Schulte <=
- [elpa] 211/255: scale column width by buffer width, Eric Schulte, 2014/03/15
- [elpa] 233/255: igs handle adjourned and resigned games, Eric Schulte, 2014/03/15
- [elpa] 244/255: igs-pipe handles resignation and comments, Eric Schulte, 2014/03/15
- [elpa] 245/255: misc fixes, Eric Schulte, 2014/03/15
- [elpa] 169/255: igs: automatically collect a game listing, Eric Schulte, 2014/03/15
- [elpa] 248/255: try to fix gnugo Emacs crashes, Eric Schulte, 2014/03/15
- [elpa] 254/255: re-format README, Eric Schulte, 2014/03/15
- [elpa] 161/255: moving towards using images, Eric Schulte, 2014/03/15
- [elpa] 240/255: robust loading w/o load-path customization, Eric Schulte, 2014/03/15
- [elpa] 253/255: renamed el-go README, Eric Schulte, 2014/03/15