From 000f337c5e5f293f02b497fb3415f68dc56a3e8c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gustav=20H=C3=A5llberg?= Date: Fri, 31 Jul 2009 15:59:55 +0200 Subject: [PATCH] stgit.el: Fix face "spilling" in some places MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Gustav HÃ¥llberg --- contrib/stgit.el | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/contrib/stgit.el b/contrib/stgit.el index 82e9aa2..c3c8531 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -80,14 +80,11 @@ directory DIR or `default-directory'" ('unapplied "-")) (if (memq name stgit-marked-patches) "*" " ") - (propertize (format "%-30s" - (symbol-name name)) - 'face (case status - ('applied 'stgit-applied-patch-face) - ('top 'stgit-top-patch-face) - ('unapplied 'stgit-unapplied-patch-face) - ('index nil) - ('work nil))) + (format "%-30s" + (propertize + (symbol-name name) + 'face (cdr (assq status + stgit-patch-status-face-alist)))) " " (if (stgit-patch-empty patch) "(empty) " "") (propertize (or (stgit-patch-desc patch) "") @@ -362,6 +359,14 @@ flag, which reduces performance." (unknown "Unknown" stgit-unknown-file-face))) "Alist of code symbols to description strings") +(defconst stgit-patch-status-face-alist + '((applied . stgit-applied-patch-face) + (top . stgit-top-patch-face) + (unapplied . stgit-unapplied-patch-face) + (index . nil) + (work . nil)) + "Alist of face to use for a given patch status") + (defun stgit-file-status-code-as-string (file) "Return stgit status code for FILE as a string" (let* ((code (assq (stgit-file-status file) @@ -535,8 +540,11 @@ at point." (ewoc-enter-last ewoc file)) (goto-char (match-end 0)))) (unless (ewoc-nth ewoc 0) - (ewoc-set-hf ewoc "" (propertize " \n" - 'face 'stgit-description-face)))) + (ewoc-set-hf ewoc "" + (concat " " + (propertize "" + 'face 'stgit-description-face) + "\n")))) (goto-char end))) (defun stgit-select-file () -- 2.11.0