[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 299744e: * lisp/vc/smerge-mode.el (smerge-start-session): Don't r

From: Stefan Monnier
Subject: master 299744e: * lisp/vc/smerge-mode.el (smerge-start-session): Don't re-enable
Date: Wed, 18 Mar 2020 10:20:17 -0400 (EDT)

branch: master
commit 299744e083342e43deece03bc0691feb190ccc54
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * 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 85868b9..d0a83fd 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 
     (smerge-remove-props (point-min) (point-max))))
-(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."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]