From 8f9fb4359069442be222128579d3976deefe0431 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 25 Jan 2009 01:01:10 +0200 Subject: [PATCH] More flexible titles and types for magit-insert-section. * magit.el (magit-insert-section): Revert earlier change: first argument is used as the section title and the section type is usually nil. When the first argument is a pair, it specvifies both the title and the type. --- magit.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/magit.el b/magit.el index e816fea5..de8f2683 100644 --- a/magit.el +++ b/magit.el @@ -491,12 +491,20 @@ Many Magit faces inherit from this one by default." (or (get-text-property (point) 'magit-section) magit-top-section)) -(defun magit-insert-section (type title washer cmd &rest args) +(defun magit-insert-section (section-title-and-type + buffer-title washer cmd &rest args) (let* ((body-beg nil) + (section-title (if (consp section-title-and-type) + (car section-title-and-type) + section-title-and-type)) + (section-type (if (consp section-title-and-type) + (cdr section-title-and-type) + nil)) (section - (magit-with-section title type - (if title - (insert (propertize title 'face 'magit-section-title) "\n")) + (magit-with-section section-title section-type + (if buffer-title + (insert (propertize buffer-title 'face 'magit-section-title) + "\n")) (setq body-beg (point)) (apply 'call-process cmd nil t nil args) (if washer