emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/tuareg 07cfa2b 4/6: Deactivate the region to avoid extendi


From: ELPA Syncer
Subject: [nongnu] elpa/tuareg 07cfa2b 4/6: Deactivate the region to avoid extending it when moving point
Date: Fri, 10 Sep 2021 15:57:49 -0400 (EDT)

branch: elpa/tuareg
commit 07cfa2b5f75931c1fdb3fef9be1ed8bb186a6085
Author: Mattias EngdegÄrd <mattiase@acm.org>
Commit: Mattias EngdegÄrd <mattiase@acm.org>

    Deactivate the region to avoid extending it when moving point
    
    The user isn't expecting the region to be modified; better deactivate
    it when moving point.
---
 tuareg.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/tuareg.el b/tuareg.el
index 49048f0..52df875 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3724,10 +3724,15 @@ If the region is active, evaluate all phrases 
intersecting the region."
         (setq start (car phrase))
         (setq end (cadr phrase)))))
     (tuareg-interactive--send-region start end)
-    (if (not tuareg-skip-after-eval-phrase)
-        (goto-char opoint)
-      (goto-char end)
-      (tuareg-skip-blank-and-comments))))
+    (if tuareg-skip-after-eval-phrase
+        (progn
+          (when (region-active-p)
+            ;; We are moving point and the user probably doesn't
+            ;; expect the region to be affected.
+            (deactivate-mark))
+          (goto-char end)
+          (tuareg-skip-blank-and-comments))
+      (goto-char opoint))))
 
 (defun tuareg-eval-buffer ()
   "Send the buffer to the Tuareg Interactive process."



reply via email to

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