(defcustom stgit-noname-patch-line-format "%s%m%e%D"
"The alternate format string used to format patch lines.
It has the same semantics as `stgit-patch-line-format', and the
-display can be toggled between the two formats using
-\\<stgit-mode-map>>\\[stgit-toggle-patch-names].
+display can be toggled between the two formats using \
+\\<stgit-mode-map>\\[stgit-toggle-patch-names].
The alternate form is used when the patch name is hidden."
:type 'string
(defcustom stgit-default-show-patch-names t
"If non-nil, default to showing patch names in a new stgit buffer.
-Use \\<stgit-mode-map>\\[stgit-toggle-patch-names] to toggle the
-this setting in an already-started StGit buffer."
+Use \\<stgit-mode-map>\\[stgit-toggle-patch-names] \
+to toggle the this setting in an already-started StGit buffer."
:type 'boolean
:group 'stgit
:link '(variable-link stgit-show-patch-names))
(error))
(insert (match-string 1 text) ?\n))
+(defun stgit-line-format ()
+ "Return the current line format; one of
+`stgit-patch-line-format' and `stgit-noname-patch-line-format'"
+ (if stgit-show-patch-names
+ stgit-patch-line-format
+ stgit-noname-patch-line-format))
+
(defun stgit-patch-pp (patch)
(let* ((status (stgit-patch->status patch))
(start (point))
(name (stgit-patch->name patch))
(face (cdr (assq status stgit-patch-status-face-alist)))
- (fmt (if stgit-show-patch-names
- stgit-patch-line-format
- stgit-noname-patch-line-format))
+ (fmt (stgit-line-format))
(spec (format-spec-make
?s (case status
('applied "+")