[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 211/255: scale column width by buffer width
From: |
Eric Schulte |
Subject: |
[elpa] 211/255: scale column width by buffer width |
Date: |
Sun, 16 Mar 2014 01:02:50 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 23cce461ff52fc04ed1dbea3f6383f4c98a38408
Author: Eric Schulte <address@hidden>
Date: Tue Aug 6 12:32:09 2013 -0600
scale column width by buffer width
---
list-buffer.el | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/list-buffer.el b/list-buffer.el
index e8d8cd6..5a98f53 100644
--- a/list-buffer.el
+++ b/list-buffer.el
@@ -38,7 +38,8 @@
(defun list-buffer-create (buffer list &optional headers)
(pop-to-buffer buffer)
(set (make-local-variable '*buffer-list*) list)
- (set (make-local-variable '*buffer-headers*) headers)
+ (set (make-local-variable '*buffer-headers*)
+ (mapcar (curry #'format "%s") headers))
;; set commands at the bottom
(list-buffer-refresh))
@@ -54,11 +55,15 @@
(defun list-buffer-refresh ()
(let* ((strings (mapcar (curry #'mapcar (curry #'format "%s"))
*buffer-list*))
(lengths (mapcar (curry #'mapcar #'length) strings))
- (widths (apply #'cl-mapcar (compose '1+ #'max) lengths)))
+ (widths (apply #'cl-mapcar (compose '1+ #'max) lengths))
+ ;; scale widths by buffer width
+ (widths (mapcar (compose #'floor (curry #'* (/ (window-total-width)
+ (float (apply #'+ widths)))))
+ widths)))
;; write headers
(when *buffer-headers*
(set (make-local-variable 'header-line-format)
- (list-format-row widths *buffer-headers*)))
+ (concat " " (list-format-row widths *buffer-headers*))))
;; write rows
(delete (point-min) (point-max))
(insert (mapconcat (curry #'list-format-row widths) strings "\n"))))
- [elpa] 203/255: adding GPL copyright file, (continued)
- [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, 2014/03/15
- [elpa] 211/255: scale column width by buffer width,
Eric Schulte <=
- [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
- [elpa] 227/255: TODO retain comments, Eric Schulte, 2014/03/15