diff options
-rw-r--r-- | lisp/km-magit.el | 24 |
1 files 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 |