From 299744e083342e43deece03bc0691feb190ccc54 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 18 Mar 2020 10:20:13 -0400 Subject: [PATCH] * lisp/vc/smerge-mode.el (smerge-start-session): Don't re-enable Don't do anything if smerge-mode is already enabled. --- lisp/vc/smerge-mode.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index 85868b91ecc..d0a83fd7c49 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -1429,15 +1429,16 @@ with a \\[universal-argument] prefix, makes up a 3-way conflict." (smerge-remove-props (point-min) (point-max)))) ;;;###autoload -(defun smerge-start-session () +(defun smerge-start-session (&optional interactively) "Turn on `smerge-mode' and move point to first conflict marker. If no conflict maker is found, turn off `smerge-mode'." - (interactive) - (smerge-mode 1) - (condition-case nil - (unless (looking-at smerge-begin-re) - (smerge-next)) - (error (smerge-auto-leave)))) + (interactive "p") + (when (or (null smerge-mode) interactively) + (smerge-mode 1) + (condition-case nil + (unless (looking-at smerge-begin-re) + (smerge-next)) + (error (smerge-auto-leave))))) (defcustom smerge-change-buffer-confirm t "If non-nil, request confirmation before moving to another buffer." -- 2.39.2