GNU bug report logs - #4136
23.1; delete-pair

Previous Next

Package: emacs;

Reported by: Eli Barzilay <eli <at> barzilay.org>

Date: Thu, 13 Aug 2009 06:30:04 UTC

Severity: normal

Tags: fixed, moreinfo

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Eli Barzilay <eli <at> barzilay.org>
Cc: 4136 <at> debbugs.gnu.org
Subject: bug#4136: 23.1; delete-pair
Date: Fri, 14 Aug 2009 02:28:21 +0300
> `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/



This bug report was last modified 4 years and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.