X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/blobdiff_plain/b557489fdb12b3c0228a10fa4412cd69d515b4c8..3a1cf8148f79dfc3734fdc427a18e12f08bb9af5:/contrib/stgit.el 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"