bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#4136: 23.1; delete-pair


From: Juri Linkov
Subject: bug#4136: 23.1; delete-pair
Date: Fri, 14 Aug 2009 02:28:21 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)

> `delete-pair' is deleting what it documents -- instead of removing the
> open paren of the following sexp, it deletes the current one.  So, if
> the cursor is on some whitespace that precedes an expression, the
> whitespace is deleted, and the open paren is left intact.

This should be fixed with the following patch:

Index: lisp/emacs-lisp/lisp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/lisp.el,v
retrieving revision 1.102
diff -u -r1.102 lisp.el
--- lisp/emacs-lisp/lisp.el     22 Jul 2009 02:45:37 -0000      1.102
+++ lisp/emacs-lisp/lisp.el     13 Aug 2009 23:27:42 -0000
@@ -530,8 +530,12 @@
 (defun delete-pair ()
   "Delete a pair of characters enclosing the sexp that follows point."
   (interactive)
-  (save-excursion (forward-sexp 1) (delete-char -1))
-  (delete-char 1))
+  (save-excursion
+    (forward-sexp 1)
+    (save-excursion
+      (backward-sexp 1)
+      (delete-char 1))
+    (delete-char -1)))
 
 (defun raise-sexp (&optional arg)
   "Raise ARG sexps higher up the tree."

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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