emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109087: Fix electric-pair-mode/delet


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109087: Fix electric-pair-mode/delete-selection-mode interaction.
Date: Sat, 14 Jul 2012 13:32:23 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109087
fixes bug: http://debbugs.gnu.org/11520
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2012-07-14 13:32:23 +0800
message:
  Fix electric-pair-mode/delete-selection-mode interaction.
  
  * lisp/electric.el (electric-pair-post-self-insert-function): Fix pair
  insertion in empty-region case.
modified:
  lisp/ChangeLog
  lisp/electric.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-07-14 02:19:07 +0000
+++ b/lisp/ChangeLog    2012-07-14 05:32:23 +0000
@@ -1,5 +1,10 @@
 2012-07-14  Chong Yidong  <address@hidden>
 
+       * electric.el (electric-pair-post-self-insert-function): Fix pair
+       insertion in empty-region case (Bug#11520).
+
+2012-07-14  Chong Yidong  <address@hidden>
+
        * bindings.el: Consolidate ctl-x-r-map bindings.  Bind
        copy-rectangle-as-kill to C-x r w.
 

=== modified file 'lisp/electric.el'
--- a/lisp/electric.el  2012-07-10 11:51:54 +0000
+++ b/lisp/electric.el  2012-07-14 05:32:23 +0000
@@ -322,12 +322,13 @@
      ((and (memq syntax '(?\( ?\" ?\$)) (use-region-p))
       (if (> (mark) (point))
           (goto-char (mark))
-        ;; We already inserted the open-paren but at the end of the region,
-        ;; so we have to remove it and start over.
-        (delete-char -1)
-        (save-excursion
+       ;; We already inserted the open-paren but at the end of the
+       ;; region, so we have to remove it and start over.
+       (delete-char -1)
+       (save-excursion
           (goto-char (mark))
-          (insert last-command-event)))
+         ;; Do not insert after `save-excursion' marker (Bug#11520).
+          (insert-before-markers last-command-event)))
       (insert closer))
      ;; Backslash-escaped: no pairing, no skipping.
      ((save-excursion


reply via email to

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