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

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

[elpa] 288/299: Avoid duplicate marks in TeX-insert-dollar.


From: Stefan Monnier
Subject: [elpa] 288/299: Avoid duplicate marks in TeX-insert-dollar.
Date: Sun, 02 Nov 2014 03:12:01 +0000

monnier pushed a commit to branch externals/auctex
in repository elpa.

commit 45ffe1f260ca71cd474c90bace312a57d7aedfee
Author: Ikumi Keita <address@hidden>
Date:   Fri Oct 3 20:38:58 2014 +0200

    Avoid duplicate marks in TeX-insert-dollar.
    
    * tex.el (featurep): Activate mark in the GNU Emacs version of
    TeX-activate-mark instead of being a no-op.
    (TeX-insert-dollar): Use set-mark instead of push-mark in order to
    avoid duplicate marks.
    
    Signed-off-by: Tassilo Horn <address@hidden>
---
 ChangeLog |    7 +++++++
 tex.el    |   14 ++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2ce2a0c..10cc9de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2014-10-02  Ikumi Keita  <address@hidden>
 
+       * tex.el (featurep): Activate mark in the GNU Emacs version of
+       TeX-activate-mark instead of being a no-op.
+       (TeX-insert-dollar): Use set-mark instead of push-mark in order to
+       avoid duplicate marks.
+
+2014-10-02  Ikumi Keita  <address@hidden>
+
        * texmathp.el (texmathp-tex-commands-default): Move equation*
        environment to AMS-LaTeX section.
        (texmathp-why): Fix docstring.
diff --git a/tex.el b/tex.el
index 25b7dfa..48dfa5b 100644
--- a/tex.el
+++ b/tex.el
@@ -751,7 +751,8 @@ If POS is nil, use current buffer location."
     (and transient-mark-mode mark-active))
 
   (defun TeX-activate-region ()
-    nil)
+    (setq deactivate-mark nil)
+    (activate-mark))
 
   (defun TeX-overlay-prioritize (start end)
     "Calculate a priority for an overlay extending from START to END.
@@ -5540,18 +5541,18 @@ sign.  With optional ARG, insert that many dollar 
signs."
        ((and (eq last-command 'TeX-insert-dollar)
             (re-search-forward "\\=\\$\\([^$][^z-a]*[^$]\\)\\$" (mark) t))
        (replace-match "$$\\1$$")
-       (push-mark (match-beginning 0) t))
+       (set-mark (match-beginning 0)))
        ;; \(...\) to \[...\]
        ((and (eq last-command 'TeX-insert-dollar)
             (re-search-forward "\\=\\\\(\\([^z-a]*\\)\\\\)" (mark) t))
        (replace-match "\\\\[\\1\\\\]")
-       (push-mark (match-beginning 0) t))
+       (set-mark (match-beginning 0)))
        ;; Strip \[...\] or $$...$$
        ((and (eq last-command 'TeX-insert-dollar)
             (or (re-search-forward "\\=\\\\\\[\\([^z-a]*\\)\\\\\\]" (mark) t)
                 (re-search-forward "\\=\\$\\$\\([^z-a]*\\)\\$\\$" (mark) t)))
        (replace-match "\\1")
-       (push-mark (match-beginning 0) t))
+       (set-mark (match-beginning 0)))
        (t
        ;; We use `save-excursion' because point must be situated before opening
        ;; symbol.
@@ -5559,10 +5560,7 @@ sign.  With optional ARG, insert that many dollar signs."
        (exchange-point-and-mark)
        (insert (cdr TeX-electric-math))))
       ;; Keep the region active.
-      (if (featurep 'xemacs)
-         (zmacs-activate-region)
-       (setq activate-mark t
-             deactivate-mark nil)))
+      (TeX-activate-region))
      (TeX-electric-math
       (insert (car TeX-electric-math))
       (save-excursion (insert (cdr TeX-electric-math)))



reply via email to

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