From 73a3f15b469af96b9c6ec6e49b101212a97b766c Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 27 May 2021 17:16:30 -0400 Subject: km/magit-patch-create-series: Visit single patch If km/magit-patch-create-series, then I want to edit the file. --- lisp/km-magit.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lisp/km-magit.el b/lisp/km-magit.el index f204944..39e3b64 100644 --- a/lisp/km-magit.el +++ b/lisp/km-magit.el @@ -916,17 +916,19 @@ appending [M/N] to each entry." (km/magit-tweak-patch-series-summary) (write-region nil nil cover)) (magit-call-git "commit" "-mtweak cover" "--" cover)) - (when cover - (find-file-other-window cover) - (goto-char (point-min)) - (re-search-forward (rx "Subject: [" - (zero-or-more (not (any "]" "\n"))) - "PATCH" - (zero-or-more (not (any "]" "\n"))) - "]" (one-or-more space))) - (setq buffer-read-only nil) - (auto-fill-mode 1) - (flyspell-mode 1))))) + (find-file-other-window (or cover (car patches))) + (goto-char (point-min)) + (re-search-forward + (if cover + (rx "Subject: [" + (zero-or-more (not (any "]" "\n"))) + "PATCH" + (zero-or-more (not (any "]" "\n"))) + "]" (one-or-more space)) + "^---$")) + (setq buffer-read-only nil) + (auto-fill-mode 1) + (flyspell-mode 1)))) ;;; Copy functions -- cgit v1.2.3