From 2570f6e584712f2f5b133d183319f4f26b55e1fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gustav=20H=C3=A5llberg?= Date: Thu, 15 Apr 2010 16:36:16 +0200 Subject: [PATCH] stgit.el: Make stgit-reload move point more intuitively when a patch disappears MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Gustav HÃ¥llberg --- contrib/stgit.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/stgit.el b/contrib/stgit.el index dc09b1d..3e60c92 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -580,8 +580,9 @@ been advised to update the stgit status when necessary.") shows the working tree\n") 'face 'stgit-description-face))) (stgit-run-series stgit-ewoc) - (if curpatch - (stgit-goto-patch curpatch (and curfile (stgit-file->file curfile))) + (unless (and curpatch + (stgit-goto-patch curpatch + (and curfile (stgit-file->file curfile)))) (goto-line curline))) (stgit-refresh-git-status)) @@ -1482,8 +1483,8 @@ allow historical commits; if nil, also allow work tree and index." (t nil))))) (defun stgit-goto-patch (patchsym &optional file) - "Move point to the line containing patch PATCHSYM. -If that patch cannot be found, do nothing. + "Move point to the line containing patch PATCHSYM and return non-nil. +If that patch cannot be found, do nothing and return nil. If the patch was found and FILE is not nil, instead move to that file's line. If FILE cannot be found, stay on the line of -- 2.11.0