From 3a1cf8148f79dfc3734fdc427a18e12f08bb9af5 Mon Sep 17 00:00:00 2001 Message-Id: <3a1cf8148f79dfc3734fdc427a18e12f08bb9af5.1746798123.git.mdw@distorted.org.uk> From: Mark Wooding Date: Mon, 12 Jan 2009 21:20:13 +0100 Subject: [PATCH] stgit.el: Add message when there are no patches in the series MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Organization: Straylight/Edgeware From: Gustav Hållberg Signed-off-by: Gustav Hållberg Signed-off-by: Karl Hasselström --- contrib/stgit.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/contrib/stgit.el b/contrib/stgit.el index a50cffd..12ae7de 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -353,13 +353,15 @@ (defun stgit-expand-patch (patchsym) (defun stgit-rescan () "Rescan the status buffer." (save-excursion - (let ((marked ())) + (let ((marked ()) + found-any) (goto-char (point-min)) (while (not (eobp)) (cond ((looking-at "Branch: \\(.*\\)") (put-text-property (match-beginning 1) (match-end 1) 'face 'bold)) ((looking-at "\\([>+-]\\)\\( \\)\\([^ ]+\\) *[|#] \\(.*\\)") + (setq found-any t) (let ((state (match-string 1)) (patchsym (intern (match-string 3)))) (put-text-property @@ -379,10 +381,15 @@ (defun stgit-rescan () )) ((or (looking-at "stg series: Branch \".*\" not initialised") (looking-at "stg series: .*: branch not initialized")) + (setq found-any t) (forward-line 1) (insert "Run M-x stgit-init to initialise"))) (forward-line 1)) - (setq stgit-marked-patches (nreverse marked))))) + (setq stgit-marked-patches (nreverse marked)) + (unless found-any + (insert "\n " + (propertize "no patches in series" + 'face 'stgit-description-face)))))) (defun stgit-select () "Expand or collapse the current entry" -- [mdw]