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

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

[nongnu] elpa/rust-mode c8217a3 425/486: Fix rust-insert-dbg for emacs-v


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode c8217a3 425/486: Fix rust-insert-dbg for emacs-version < 25. (#339)
Date: Sat, 7 Aug 2021 09:26:07 -0400 (EDT)

branch: elpa/rust-mode
commit c8217a3a7b3f1ef0c101f040d182c08833d0f38e
Author: Nathan Moreau <nathan.moreau@m4x.org>
Commit: GitHub <noreply@github.com>

    Fix rust-insert-dbg for emacs-version < 25. (#339)
---
 rust-mode.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/rust-mode.el b/rust-mode.el
index 42b8d82..b381893 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1805,8 +1805,11 @@ visit the new file."
 (defun rust-insert-dbg ()
   "Insert the dbg! macro."
   (cond ((region-active-p)
-         (insert-parentheses)
-         (backward-char 1))
+         (when (< (mark) (point))
+           (exchange-point-and-mark))
+         (let ((old-point (point)))
+           (insert-parentheses)
+           (goto-char old-point)))
         (t
          (insert "(")
          (forward-sexp)



reply via email to

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