From 0f03b076e780c9f786eff0828783a3176223e985 Mon Sep 17 00:00:00 2001 From: oscar Date: Sun, 16 May 2010 02:11:17 +0200 Subject: [PATCH] Show two menu entries per line --- magit.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/magit.el b/magit.el index 0d7e988b..0b1a99da 100644 --- a/magit.el +++ b/magit.el @@ -3528,13 +3528,18 @@ With a non numeric prefix ARG, show all entries" (magit-submenu "Log" arg)) (defun magit-menu-for-group (group) - (let ((magit-group-menu (concat group " commands\n"))) + (let ((text (concat group " variants\n")) + (s "") (line "")) (dolist (item magit-menu) (when (string= (car item) group) - (setq magit-group-menu - (concat magit-group-menu - (format "\n%s %s" (string (nth 1 item)) (nth 2 item)))))) - magit-group-menu)) + (setq s + (format "%-35s" (concat (string (nth 1 item)) " " (nth 2 item)))) + (when (< 35 (length line)) + (setq text (concat text "\n" line)) + (setq line "")) + (setq line (concat line s)))) + (setq text (concat text "\n" line)) + text)) (defun magit-submenu (group &optional prefix-arg) (let ((magit-buf (current-buffer))