From 60f09e06152cea9cd7d11360ec41576ebb359fc4 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sat, 24 Jan 2009 20:56:42 +0200 Subject: [PATCH] Clean up types and titles of sections. * magit.el (magit-with-section): Check that args is a list before accessing its car. (magit-insert-section): Set the title of the section from the real title, and the txpe from the real type. --- magit.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/magit.el b/magit.el index ff020a32..d0541dc3 100644 --- a/magit.el +++ b/magit.el @@ -412,7 +412,8 @@ Many Magit faces inherit from this one by default." (defmacro magit-with-section (title args &rest body) (declare (indent 2)) (let ((s (gensym))) - `(let* ((,s (magit-new-section ,title ,@(if (keywordp (car args)) + `(let* ((,s (magit-new-section ,title ,@(if (and (listp args) + (keywordp (car args))) args `(:type ,args)))) (magit-top-section ,s)) @@ -494,7 +495,7 @@ Many Magit faces inherit from this one by default." (defun magit-insert-section (type title washer cmd &rest args) (let* ((body-beg nil) (section - (magit-with-section type nil + (magit-with-section title type (if title (insert (propertize title 'face 'magit-section-title) "\n")) (setq body-beg (point))