X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/455c9f7e04b11bce7065a8e49aadee16d943719a..6fdc354699860c63cc7fbab9c25b2b6c874074a8:/contrib/stgit.el?ds=sidebyside diff --git a/contrib/stgit.el b/contrib/stgit.el index 41b457c..f08b007 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -118,8 +118,8 @@ variable is used instead." (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-toggle-patch-names]. +display can be toggled between the two formats using \ +\\\\[stgit-toggle-patch-names]. The alternate form is used when the patch name is hidden." :type 'string @@ -129,8 +129,8 @@ The alternate form is used when the patch name is hidden." (defcustom stgit-default-show-patch-names t "If non-nil, default to showing patch names in a new stgit buffer. -Use \\\\[stgit-toggle-patch-names] to toggle the -this setting in an already-started StGit buffer." +Use \\\\[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)) @@ -289,14 +289,19 @@ A newline is appended." (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 "+")