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.
This commit is contained in:
parent
3baf7f4372
commit
8f9fb43590
1 changed files with 12 additions and 4 deletions
16
magit.el
16
magit.el
|
@ -491,12 +491,20 @@ Many Magit faces inherit from this one by default."
|
||||||
(or (get-text-property (point) 'magit-section)
|
(or (get-text-property (point) 'magit-section)
|
||||||
magit-top-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)
|
(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
|
(section
|
||||||
(magit-with-section title type
|
(magit-with-section section-title section-type
|
||||||
(if title
|
(if buffer-title
|
||||||
(insert (propertize title 'face 'magit-section-title) "\n"))
|
(insert (propertize buffer-title 'face 'magit-section-title)
|
||||||
|
"\n"))
|
||||||
(setq body-beg (point))
|
(setq body-beg (point))
|
||||||
(apply 'call-process cmd nil t nil args)
|
(apply 'call-process cmd nil t nil args)
|
||||||
(if washer
|
(if washer
|
||||||
|
|
Loading…
Add table
Reference in a new issue