summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-05-27 17:16:30 -0400
committerKyle Meyer <kyle@kyleam.com>2021-06-12 01:10:42 -0400
commit73a3f15b469af96b9c6ec6e49b101212a97b766c (patch)
treeceb81d459d7f0e160d928321c00e7e834b6df1a6 /lisp
parent24e7011a7233913e670a00df529aa67027ef8b6a (diff)
downloademacs.d-73a3f15b469af96b9c6ec6e49b101212a97b766c.tar.gz
km/magit-patch-create-series: Visit single patch
If km/magit-patch-create-series, then I want to edit the file.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-magit.el24
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