From 9c63409cc113a41528bdc1453e3d7500dedf3b21 Mon Sep 17 00:00:00 2001 From: oscar Date: Mon, 17 May 2010 21:43:20 +0200 Subject: [PATCH] Filters commands and options by group --- magit.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/magit.el b/magit.el index fed65424..20ccdbb8 100644 --- a/magit.el +++ b/magit.el @@ -1412,7 +1412,7 @@ FUNC should leave point at the end of the modified region" (let ((text (concat group " variants\n")) (s "") (line "")) (dolist (item menu-items) - (unless (stringp (nth 3 item)) + (when (and (string= (car item) group) (functionp (nth 3 item))) (setq s (format "%-35s" (concat (string (nth 1 item)) " " (nth 2 item)))) (when (< 35 (length line)) @@ -1423,14 +1423,16 @@ FUNC should leave point at the end of the modified region" (setq line "") (setq text (concat text "\n\nOptions\n")) (dolist (item menu-items) - (when (stringp (nth 3 item)) + (when (and (string= (car item) group) (stringp (nth 3 item))) (setq s (format "%-35s" (concat (string (nth 1 item)) " " (nth 2 item) " (" (nth 3 item) - (if (nth 5 item) - (if (stringp (nth 5 item)) - (nth 5 item) - " ON")) + (when (nth 5 item) + (concat + " " + (if (stringp (nth 5 item)) + (nth 5 item) + "ON"))) ")"))) (when (or (< 35 (length s)) (< 35 (length line))) (setq text (concat text "\n" line))