branch: elpa/tuareg commit 07cfa2b5f75931c1fdb3fef9be1ed8bb186a6085 Author: Mattias EngdegÄrd <matti...@acm.org> Commit: Mattias EngdegÄrd <matti...@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."