From 564726a2471109308a2d89716ae9409ae88a7cce Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Wed, 1 Sep 2010 23:43:57 +0100 Subject: [PATCH] Use `window-width' to wrap menu items. --- magit-key-mode.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/magit-key-mode.el b/magit-key-mode.el index 85d32863..82079193 100644 --- a/magit-key-mode.el +++ b/magit-key-mode.el @@ -379,13 +379,12 @@ put it in magit-key-mode-key-maps for fast lookup." (defun magit-key-mode-draw-in-cols (strings) "Given a list of strings, print in columns (using `insert')." - (let ((longest-act (apply 'max (mapcar 'length strings))) - (max-size 70)) + (let ((longest-act (apply 'max (mapcar 'length strings)))) (while strings (let ((str (car strings))) (let ((padding (make-string (- (+ longest-act 3) (length str)) ? ))) (insert str) - (if (and (> (+ (current-column) longest-act) max-size) + (if (and (> (+ (current-column) longest-act) (window-width)) (cdr strings)) (insert "\n") (insert padding))))