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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Eli Barzilay <eli@HIDDEN>; dated Thu, 13 Aug 2009 06:30:04 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 19 Aug 2009 02:41:50 +0000
From juri@HIDDEN Tue Aug 18 19:41:49 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.7 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx2.starman.ee (smtp-out2.starman.ee [85.253.0.4])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7J2fmWU018246
	for <4136@HIDDEN>; Tue, 18 Aug 2009 19:41:49 -0700
X-Virus-Scanned: by Amavisd-New at mx2.starman.ee
Received: from mail.starman.ee (82.131.55.87.cable.starman.ee [82.131.55.87])
	by mx2.starman.ee (Postfix) with ESMTP id 9BBC23F408A;
	Wed, 19 Aug 2009 05:41:41 +0300 (EEST)
From: Juri Linkov <juri@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Cc: Eli Barzilay <eli@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
Organization: JURTA
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>
	<4A850F6C.2080205@HIDDEN> <873a7uc8mg.fsf@HIDDEN>
	<4A8689EE.9020402@HIDDEN> <87ljlk4snf.fsf@HIDDEN>
	<87eirfs56q.fsf@HIDDEN>
	<19076.47996.128071.281272@HIDDEN>
	<87pray9ezq.fsf@HIDDEN>
	<19078.4981.525959.210519@HIDDEN>
	<87ab20znhd.fsf@HIDDEN>
	<19079.19478.357436.68768@HIDDEN>
	<87k5131d3d.fsf@HIDDEN>
	<19080.51949.798286.416193@HIDDEN>
	<87ocqezdfd.fsf@HIDDEN> <4A8A549E.20605@HIDDEN>
Date: Wed, 19 Aug 2009 03:48:09 +0300
In-Reply-To: <4A8A549E.20605@HIDDEN> (martin rudalics's message of "Tue, 18
	Aug 2009 09:13:34 +0200")
Message-ID: <871vn8r2c2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

>> We are in violent agreement.  I didn't claim that `delete-pair'
>> shouldn't check `insert-pair-alist'.  On the contrary, I think
>> `delete-pair' should verify if the character pair starting at the
>> current point is part of a pair according to `insert-pair-alist'.
>> "At the current point" - that's my point.  It shouldn't try
>> finding the opening character somewhere else.  So in your original
>> test case it should throw an error when the cursor is on some
>> whitespace that precedes an expression.
>
> Ne hlebom jedinnym.  Why can't we be generous and provide something like
> the attached?
>
> martin
> *** emacs-lisp/lisp.el.~1.102.~	2009-07-27 08:10:54.124527300 +0200
> --- emacs-lisp/lisp.el	2009-08-18 08:52:42.734375000 +0200
> ***************
> *** 527,537 ****
>     (interactive "P")
>     (insert-pair arg ?\( ?\)))
>   
> ! (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))
>   
>   (defun raise-sexp (&optional arg)
>     "Raise ARG sexps higher up the tree."
> --- 527,566 ----
>     (interactive "P")
>     (insert-pair arg ?\( ?\)))
>   
> ! (defun delete-pair (&optional arg)
> !   "Delete a pair of characters enclosing ARG sexps that follow point.
> ! A negative ARG deletes a pair around the preceding ARG sexps instead."
> !   (interactive "P")
> ! 
> !   (if arg
> !       (setq arg (prefix-numeric-value arg))
> !     (setq arg 1))
> ! 
> !   (if (< arg 0)
> !       (save-excursion
> ! 	(skip-chars-backward " \t")
> ! 	(save-excursion
> ! 	  (let ((close-char (char-before)))
> ! 	    (forward-sexp arg)
> ! 	    (unless (member (list (char-after) close-char)
> ! 			    (mapcar (lambda (p)
> ! 				      (if (= (length p) 3) (cdr p) p))
> ! 				    insert-pair-alist))
> ! 	      (error "Not after matching pair"))
> ! 	    (delete-char 1)))
> ! 	(delete-char -1))
> !     (save-excursion
> !       (skip-chars-forward " \t")
> !       (save-excursion
> ! 	(let ((open-char (char-after)))
> ! 	  (forward-sexp arg)
> ! 	  (unless (member (list open-char (char-before))
> ! 			  (mapcar (lambda (p)
> ! 				    (if (= (length p) 3) (cdr p) p))
> ! 				  insert-pair-alist))
> ! 	    (error "Not before matching pair"))
> ! 	  (delete-char -1)))
> !       (delete-char 1))))
>   
>   (defun raise-sexp (&optional arg)
>     "Raise ARG sexps higher up the tree."

Hmm, I think this makes sense.

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



Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 19 Aug 2009 02:41:50 +0000
From juri@HIDDEN Tue Aug 18 19:41:49 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.7 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx2.starman.ee (smtp-out2.starman.ee [85.253.0.4])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7J2fmDv018244
	for <4136@HIDDEN>; Tue, 18 Aug 2009 19:41:49 -0700
X-Virus-Scanned: by Amavisd-New at mx2.starman.ee
Received: from mail.starman.ee (82.131.55.87.cable.starman.ee [82.131.55.87])
	by mx2.starman.ee (Postfix) with ESMTP id 764C33F4082;
	Wed, 19 Aug 2009 05:41:40 +0300 (EEST)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Cc: Eli Barzilay <eli@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
Organization: JURTA
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>
	<4A850F6C.2080205@HIDDEN> <873a7uc8mg.fsf@HIDDEN>
	<87eirfs56q.fsf@HIDDEN>
	<19076.47996.128071.281272@HIDDEN>
	<87pray9ezq.fsf@HIDDEN>
	<19078.4981.525959.210519@HIDDEN>
	<jwvy6phu8f4.fsf-monnier+emacsbugreports@HIDDEN>
Date: Wed, 19 Aug 2009 03:47:14 +0300
In-Reply-To: <jwvy6phu8f4.fsf-monnier+emacsbugreports@HIDDEN> (Stefan
	Monnier's message of "Mon, 17 Aug 2009 23:10:47 -0400")
Message-ID: <87ab1wr2f9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

>> ...this is exactly the issue: it is much better if `delete-foo' is
>> always an operation that reverts what `insert-foo' does.
>
> I don't think we shojuld make it hard to delete (...] just because it
> may be done by mistake.  That's what `undo' is for.
>
> So, I'm in favor of making delete-pair a bit more picky, but not quite
> as much as you suggest.  I suggest we try and make sure delete-pair
> indeed only eliminates chars like ([" on the left side and )]" on the
> right side (including by moving point a little bit in order to find the
> intended pair), but let's not impose that ( can only match ).

I don't oppose strict checking for only a pair of ( and ) because
a situation with (...] is extremely rare and usually means that
there is some bug.  So in reality there is no problem with
checking against the `insert-pair-alist' list.

What I care about is simplicity.  It should be easy for the user
to understand and remember what the command `delete-pair' does.
Failing on a non-pair character would be natural for a command
that is a counterpart of `insert-pair'.

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



Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 18 Aug 2009 07:14:58 +0000
From rudalics@HIDDEN Tue Aug 18 00:14:57 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,HAS_BUG_NUMBER,MIXEDBDN
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with SMTP id n7I7Es3P016337
	for <4136@HIDDEN>; Tue, 18 Aug 2009 00:14:57 -0700
Received: (qmail invoked by alias); 18 Aug 2009 07:14:48 -0000
Received: from 62-47-51-152.adsl.highway.telekom.at (EHLO [62.47.51.152]) [62.47.51.152]
  by mail.gmx.net (mp003) with SMTP; 18 Aug 2009 09:14:48 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX1908lFj5490ZhL55kKDdN/bcOw4WwcPUBw1nyEBDy
	C/qUqOE53D5hXB
Message-ID: <4A8A549E.20605@HIDDEN>
Date: Tue, 18 Aug 2009 09:13:34 +0200
From: martin rudalics <rudalics@HIDDEN>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Juri Linkov <juri@HIDDEN>
CC: Eli Barzilay <eli@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
References: <19075.45378.67131.491453@HIDDEN>	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>	<4A850F6C.2080205@HIDDEN> <873a7uc8mg.fsf@HIDDEN>	<4A8689EE.9020402@HIDDEN> <87ljlk4snf.fsf@HIDDEN>	<87eirfs56q.fsf@HIDDEN>	<19076.47996.128071.281272@HIDDEN>	<87pray9ezq.fsf@HIDDEN>	<19078.4981.525959.210519@HIDDEN>	<87ab20znhd.fsf@HIDDEN>	<19079.19478.357436.68768@HIDDEN>	<87k5131d3d.fsf@HIDDEN>	<19080.51949.798286.416193@HIDDEN> <87ocqezdfd.fsf@HIDDEN>
In-Reply-To: <87ocqezdfd.fsf@HIDDEN>
Content-Type: multipart/mixed;
 boundary="------------010001070509010703070603"
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.77,0.63

This is a multi-part message in MIME format.
--------------010001070509010703070603
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

 > We are in violent agreement.  I didn't claim that `delete-pair'
 > shouldn't check `insert-pair-alist'.  On the contrary, I think
 > `delete-pair' should verify if the character pair starting at the
 > current point is part of a pair according to `insert-pair-alist'.
 > "At the current point" - that's my point.  It shouldn't try
 > finding the opening character somewhere else.  So in your original
 > test case it should throw an error when the cursor is on some
 > whitespace that precedes an expression.

Ne hlebom jedinnym.  Why can't we be generous and provide something like
the attached?

martin

--------------010001070509010703070603
Content-Type: text/plain;
 name="lisp.el.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="lisp.el.diff"

*** emacs-lisp/lisp.el.~1.102.~	2009-07-27 08:10:54.124527300 +0200
--- emacs-lisp/lisp.el	2009-08-18 08:52:42.734375000 +0200
***************
*** 527,537 ****
    (interactive "P")
    (insert-pair arg ?\( ?\)))
  
! (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))
  
  (defun raise-sexp (&optional arg)
    "Raise ARG sexps higher up the tree."
--- 527,566 ----
    (interactive "P")
    (insert-pair arg ?\( ?\)))
  
! (defun delete-pair (&optional arg)
!   "Delete a pair of characters enclosing ARG sexps that follow point.
! A negative ARG deletes a pair around the preceding ARG sexps instead."
!   (interactive "P")
! 
!   (if arg
!       (setq arg (prefix-numeric-value arg))
!     (setq arg 1))
! 
!   (if (< arg 0)
!       (save-excursion
! 	(skip-chars-backward " \t")
! 	(save-excursion
! 	  (let ((close-char (char-before)))
! 	    (forward-sexp arg)
! 	    (unless (member (list (char-after) close-char)
! 			    (mapcar (lambda (p)
! 				      (if (= (length p) 3) (cdr p) p))
! 				    insert-pair-alist))
! 	      (error "Not after matching pair"))
! 	    (delete-char 1)))
! 	(delete-char -1))
!     (save-excursion
!       (skip-chars-forward " \t")
!       (save-excursion
! 	(let ((open-char (char-after)))
! 	  (forward-sexp arg)
! 	  (unless (member (list open-char (char-before))
! 			  (mapcar (lambda (p)
! 				    (if (= (length p) 3) (cdr p) p))
! 				  insert-pair-alist))
! 	    (error "Not before matching pair"))
! 	  (delete-char -1)))
!       (delete-char 1))))
  
  (defun raise-sexp (&optional arg)
    "Raise ARG sexps higher up the tree."

--------------010001070509010703070603--




Acknowledgement sent to martin rudalics <rudalics@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 18 Aug 2009 03:10:56 +0000
From monnier@HIDDEN Mon Aug 17 20:10:56 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.7 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7I3AtmN003771
	for <4136@HIDDEN>; Mon, 17 Aug 2009 20:10:56 -0700
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AtgEAKO4iUpFpZNo/2dsb2JhbACBUtUPhBkFh0k
X-IronPort-AV: E=Sophos;i="4.43,400,1246852800"; 
   d="scan'208";a="43700886"
Received: from 69-165-147-104.dsl.teksavvy.com (HELO ceviche.home) ([69.165.147.104])
  by ironport2-out.teksavvy.com with ESMTP; 17 Aug 2009 23:10:15 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id 1E629B407B; Mon, 17 Aug 2009 23:10:47 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Barzilay <eli@HIDDEN>
Cc: 4136 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
Subject: Re: bug#4136: 23.1; delete-pair
Message-ID: <jwvy6phu8f4.fsf-monnier+emacsbugreports@HIDDEN>
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>
	<4A850F6C.2080205@HIDDEN> <873a7uc8mg.fsf@HIDDEN>
	<87eirfs56q.fsf@HIDDEN>
	<19076.47996.128071.281272@HIDDEN>
	<87pray9ezq.fsf@HIDDEN>
	<19078.4981.525959.210519@HIDDEN>
Date: Mon, 17 Aug 2009 23:10:47 -0400
In-Reply-To: <19078.4981.525959.210519@HIDDEN> (Eli Barzilay's
	message of "Fri, 14 Aug 2009 21:46:29 -0400")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

> ...this is exactly the issue: it is much better if `delete-foo' is
> always an operation that reverts what `insert-foo' does.

I don't think we shojuld make it hard to delete (...] just because it
may be done by mistake.  That's what `undo' is for.

So, I'm in favor of making delete-pair a bit more picky, but not quite
as much as you suggest.  I suggest we try and make sure delete-pair
indeed only eliminates chars like ([" on the left side and )]" on the
right side (including by moving point a little bit in order to find the
intended pair), but let's not impose that ( can only match ).

> The current state of `delete-pair' is so bad that my guess is that
> hardly anyone used it, so adding another command doesn't make much
> sense.

It works fine, tho it indeed does it in a "blind" way that means that
you may get surprise results which require undo.  No big deal, tho.


        Stefan



Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 17 Aug 2009 21:28:16 +0000
From juri@HIDDEN Mon Aug 17 14:28:16 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx2.starman.ee (smtp-out2.starman.ee [85.253.0.4])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7HLSEAP005565
	for <4136@HIDDEN>; Mon, 17 Aug 2009 14:28:15 -0700
X-Virus-Scanned: by Amavisd-New at mx2.starman.ee
Received: from mail.starman.ee (82.131.53.255.cable.starman.ee [82.131.53.255])
	by mx2.starman.ee (Postfix) with ESMTP id D09B83F406C;
	Tue, 18 Aug 2009 00:28:07 +0300 (EEST)
From: Juri Linkov <juri@HIDDEN>
To: Eli Barzilay <eli@HIDDEN>
Cc: martin rudalics <rudalics@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
Organization: JURTA
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>
	<4A850F6C.2080205@HIDDEN> <873a7uc8mg.fsf@HIDDEN>
	<4A8689EE.9020402@HIDDEN> <87ljlk4snf.fsf@HIDDEN>
	<87eirfs56q.fsf@HIDDEN>
	<19076.47996.128071.281272@HIDDEN>
	<87pray9ezq.fsf@HIDDEN>
	<19078.4981.525959.210519@HIDDEN>
	<87ab20znhd.fsf@HIDDEN>
	<19079.19478.357436.68768@HIDDEN>
	<87k5131d3d.fsf@HIDDEN>
	<19080.51949.798286.416193@HIDDEN>
Date: Tue, 18 Aug 2009 00:17:11 +0300
In-Reply-To: <19080.51949.798286.416193@HIDDEN> (Eli Barzilay's
	message of "Sun, 16 Aug 2009 23:13:49 -0400")
Message-ID: <87ocqezdfd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

>> `insert-pair' inserts an opening character at point.  So why
>> `delete-pair' shouldn't do the same?  Why it shouldn't delete an
>> opening character at point instead of using some additional
>> heuristics to find the position of the opening character?
>
> We're going back in circles here: "delete *pair*" shouldn't delete an
> opening character unless it is part of a *pair*.  If by the above you
> mean make it delete the character pair starting at the current point,
> then that seems fine -- as long as it verifies that there really is a
> pair.

We are in violent agreement.  I didn't claim that `delete-pair'
shouldn't check `insert-pair-alist'.  On the contrary, I think
`delete-pair' should verify if the character pair starting at the
current point is part of a pair according to `insert-pair-alist'.
"At the current point" - that's my point.  It shouldn't try
finding the opening character somewhere else.  So in your original
test case it should throw an error when the cursor is on some
whitespace that precedes an expression.

>> Why would I want to put cursor on a non-paren when I want to delete
>> a paren?
>
> You wouldn't, which is why throwing an error is the right thing.

I agree.  So I'd like to close this issue 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	17 Aug 2009 21:16:32 -0000
@@ -530,7 +530,15 @@
 (defun delete-pair ()
   "Delete a pair of characters enclosing the sexp that follows point."
   (interactive)
-  (save-excursion (forward-sexp 1) (delete-char -1))
+  (let ((open-char (char-after)))
+    (save-excursion
+      (forward-sexp 1)
+      (unless (member (list open-char (char-before))
+		      (mapcar (lambda (p)
+				(if (= (length p) 3) (cdr p) p))
+			      insert-pair-alist))
+	(error "Not a matching pair"))
+      (delete-char -1)))
   (delete-char 1))
 
 (defun raise-sexp (&optional arg)

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



Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 17 Aug 2009 03:13:54 +0000
From eli@HIDDEN Sun Aug 16 20:13:54 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.5 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER,
	SPF_HELO_PASS autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from barzilay.org (winooski.ccs.neu.edu [129.10.115.117])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7H3DqJS006177
	for <4136@HIDDEN>; Sun, 16 Aug 2009 20:13:54 -0700
Received: from eli by barzilay.org with local (Exim 4.66)
	(envelope-from <eli@HIDDEN>)
	id 1McsfN-0008Ll-Qa; Sun, 16 Aug 2009 23:13:49 -0400
From: Eli Barzilay <eli@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <19080.51949.798286.416193@HIDDEN>
Date: Sun, 16 Aug 2009 23:13:49 -0400
To: Juri Linkov <juri@HIDDEN>
Cc: martin rudalics <rudalics@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
In-Reply-To: <87k5131d3d.fsf@HIDDEN>
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN>
	<87tz0bqqhm.fsf@HIDDEN>
	<4A850F6C.2080205@HIDDEN>
	<873a7uc8mg.fsf@HIDDEN>
	<4A8689EE.9020402@HIDDEN>
	<87ljlk4snf.fsf@HIDDEN>
	<87eirfs56q.fsf@HIDDEN>
	<19076.47996.128071.281272@HIDDEN>
	<87pray9ezq.fsf@HIDDEN>
	<19078.4981.525959.210519@HIDDEN>
	<87ab20znhd.fsf@HIDDEN>
	<19079.19478.357436.68768@HIDDEN>
	<87k5131d3d.fsf@HIDDEN>
X-Mailer: VM 7.19 under Emacs 22.1.1

On Aug 17, Juri Linkov wrote:
> > Still, the first time I tried this, the cursor was at the
> > beginning of an indented line.
> 
> Where did you get this weird idea that `delete-pair' should delete a
> character far away from the current cursor position?  Look,
> `insert-char' inserts a character at point and `delete-char' deletes
> a character at point.

Only when there is a character there.


> `insert-pair' inserts an opening character at point.  So why
> `delete-pair' shouldn't do the same?  Why it shouldn't delete an
> opening character at point instead of using some additional
> heuristics to find the position of the opening character?

We're going back in circles here: "delete *pair*" shouldn't delete an
opening character unless it is part of a *pair*.  If by the above you
mean make it delete the character pair starting at the current point,
then that seems fine -- as long as it verifies that there really is a
pair.


> >> That's why even in the current state of `delete-pair' it is the
> >> useful reverse of `insert-pair' because the latter creates
> >> balanced lists and the former deletes them.
> >
> > ... unless you happen to have your cursor on a non-paren.
> 
> Why would I want to put cursor on a non-paren when I want to delete
> a paren?

You wouldn't, which is why throwing an error is the right thing.  If
you apply this exact same argument to `delete-char':

  Why would I want to put the cursor at the end of the buffer when I
  want to delete a character?

it can justify making `delete-char' delete the preceding character
when the cursor is at the eob.


> >> > This version doesn't make much sense as an operation you'd want to do
> >> > on code:
> >> >
> >> >   (foo '(x y z))
> >> >   -->
> >> >   (foo 'x y z)
> >>
> >> It makes sense when `foo' is a multi-argument function like `list',
> >> e.g.
> >>
> >>     (list 'x y z)
> >>
> >> So I see no reason to introduce more restrictions to decide what
> >> parens the user is allowed to delete in his/her code.
> >
> > You've missed my point: the difference between "y" and "'y" is *huge*,
> > changing one to the other is something that you don't want to do by
> > mistake.
> 
> 99% of time when you write a program it is in the erroneous state
> until you finish editing.  But this doesn't mean we should disallow
> the user to have an intermediate erroneous state.  So of course, in
> the above example you can add necessary quotes after deleting a pair
> of parentheses.

That makes absolutely no sense.  Yes, a file is usually at a bad state
while it's being edited -- but that's not a reason to make things
worse by an operation that hardly ever does what you (some random
hacker) want to do.  (And you don't want to do that because 'foo is
unrelated to foo.)


> >> I know, I know, after I fix this, you'll come up with another
> >> test case like
> >>
> >>          `foo bar'
> >
> > Those examples are very good IMO -- it's not being picky for
> > nothing, it's an attempt to avoid nasty surprises that make you
> > end up with erroneous code.  Emacs is usually good at being a
> > careful editor for code, `delete-pair' is very exceptional in this
> > aspect.
> 
> Emacs is good at following the KISS principle to not over-engineer
> simple functions.

Are you serious??  In v23 I'm counting about 500 lines of just elisp
code for next/previous-line.  It is the resulting behavior that should
be simple -- and that sometimes requires considerable amount of code.
Making `delete-pair' does what its name suggest *is* keeping it
simple.

The current version of the function is pretty much swapping the last
two characters in "KISS".

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!



Acknowledgement sent to Eli Barzilay <eli@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 17 Aug 2009 01:29:45 +0000
From juri@HIDDEN Sun Aug 16 18:29:45 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx1.starman.ee (smtp-out1.starman.ee [85.253.0.3])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7H1Thni019323
	for <4136@HIDDEN>; Sun, 16 Aug 2009 18:29:45 -0700
X-Virus-Scanned: by Amavisd-New at mx1.starman.ee
Received: from mail.starman.ee (82.131.54.10.cable.starman.ee [82.131.54.10])
	by mx1.starman.ee (Postfix) with ESMTP id 8E3863F4282;
	Mon, 17 Aug 2009 04:29:36 +0300 (EEST)
From: Juri Linkov <juri@HIDDEN>
To: Eli Barzilay <eli@HIDDEN>
Cc: martin rudalics <rudalics@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
Organization: JURTA
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>
	<4A850F6C.2080205@HIDDEN> <873a7uc8mg.fsf@HIDDEN>
	<4A8689EE.9020402@HIDDEN> <87ljlk4snf.fsf@HIDDEN>
	<87eirfs56q.fsf@HIDDEN>
	<19076.47996.128071.281272@HIDDEN>
	<87pray9ezq.fsf@HIDDEN>
	<19078.4981.525959.210519@HIDDEN>
	<87ab20znhd.fsf@HIDDEN>
	<19079.19478.357436.68768@HIDDEN>
Date: Mon, 17 Aug 2009 03:46:46 +0300
In-Reply-To: <19079.19478.357436.68768@HIDDEN> (Eli Barzilay's
	message of "Sat, 15 Aug 2009 20:00:22 -0400")
Message-ID: <87k5131d3d.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

> Believe me, I've written a paren or two, and I use `insert-pair'
> enough to have my own improved version of it.  (In fact, guess why I
> almost never use smileys in emails.)

You can write smileys using the closing parenthesis (but we should
improve `delete-pair' to delete smileys completely after deleting the
closing parenthesis ;-)

> Still, the first time I tried this, the cursor was at the beginning of
> an indented line.

Where did you get this weird idea that `delete-pair' should delete
a character far away from the current cursor position?  Look,
`insert-char' inserts a character at point and `delete-char' deletes
a character at point.  `insert-pair' inserts an opening character
at point.  So why `delete-pair' shouldn't do the same?  Why it shouldn't
delete an opening character at point instead of using some additional
heuristics to find the position of the opening character?

>> That's why even in the current state of `delete-pair' it is the
>> useful reverse of `insert-pair' because the latter creates balanced
>> lists and the former deletes them.
>
> ... unless you happen to have your cursor on a non-paren.

Why would I want to put cursor on a non-paren when I want to delete a paren?

>> > This version doesn't make much sense as an operation you'd want to do
>> > on code:
>> >
>> >   (foo '(x y z))
>> >   -->
>> >   (foo 'x y z)
>>
>> It makes sense when `foo' is a multi-argument function like `list',
>> e.g.
>>
>>     (list 'x y z)
>>
>> So I see no reason to introduce more restrictions to decide what
>> parens the user is allowed to delete in his/her code.
>
> You've missed my point: the difference between "y" and "'y" is *huge*,
> changing one to the other is something that you don't want to do by
> mistake.

99% of time when you write a program it is in the erroneous state until
you finish editing.  But this doesn't mean we should disallow the user
to have an intermediate erroneous state.  So of course, in the above
example you can add necessary quotes after deleting a pair of parentheses.

>> I know, I know, after I fix this, you'll come up with another
>> test case like
>>
>>          `foo bar'
>
> Those examples are very good IMO -- it's not being picky for nothing,
> it's an attempt to avoid nasty surprises that make you end up with
> erroneous code.  Emacs is usually good at being a careful editor for
> code, `delete-pair' is very exceptional in this aspect.

Emacs is good at following the KISS principle to not over-engineer
simple functions.

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



Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 16 Aug 2009 10:27:43 +0000
From rudalics@HIDDEN Sun Aug 16 03:27:43 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-4.4 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with SMTP id n7GARfYf021929
	for <4136@HIDDEN>; Sun, 16 Aug 2009 03:27:43 -0700
Received: (qmail invoked by alias); 16 Aug 2009 10:27:35 -0000
Received: from 62-47-43-46.adsl.highway.telekom.at (EHLO [62.47.43.46]) [62.47.43.46]
  by mail.gmx.net (mp011) with SMTP; 16 Aug 2009 12:27:35 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX18kY9FJIsckjzHc8He1YrZmM13htnmTPtM7WhEbIx
	3w0koT9g6RRupo
Message-ID: <4A87DF14.5000104@HIDDEN>
Date: Sun, 16 Aug 2009 12:27:32 +0200
From: martin rudalics <rudalics@HIDDEN>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Juri Linkov <juri@HIDDEN>
CC: Eli Barzilay <eli@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
References: <19075.45378.67131.491453@HIDDEN>	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>	<4A850F6C.2080205@HIDDEN> <873a7uc8mg.fsf@HIDDEN>	<87eirfs56q.fsf@HIDDEN>	<19076.47996.128071.281272@HIDDEN>	<87pray9ezq.fsf@HIDDEN>	<19078.4981.525959.210519@HIDDEN> <87ab20znhd.fsf@HIDDEN>
In-Reply-To: <87ab20znhd.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.77

 > The exact reverse is impossible.  For instance, put the cursor
 > on the letter `f' in:
 >
 >     foo "" bar
 >
 > and type `M-3 M-"' where M-" is bound to `insert-pair'.
 > The result will be:
 >
 >     "foo "" bar"

Obviously `insert-pair' would have to escape the old quotes here ;-)

martin, who couldn't resist



Acknowledgement sent to martin rudalics <rudalics@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 16 Aug 2009 10:27:25 +0000
From rudalics@HIDDEN Sun Aug 16 03:27:24 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-4.4 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with SMTP id n7GARMBh021919
	for <4136@HIDDEN>; Sun, 16 Aug 2009 03:27:24 -0700
Received: (qmail invoked by alias); 16 Aug 2009 10:27:15 -0000
Received: from 62-47-43-46.adsl.highway.telekom.at (EHLO [62.47.43.46]) [62.47.43.46]
  by mail.gmx.net (mp009) with SMTP; 16 Aug 2009 12:27:15 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX19Skf4R/ghShRXfk60G8JNKse7cRSppLFvAh1K0lx
	uP2zcgJLetWPV6
Message-ID: <4A87DF00.6060005@HIDDEN>
Date: Sun, 16 Aug 2009 12:27:12 +0200
From: martin rudalics <rudalics@HIDDEN>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Juri Linkov <juri@HIDDEN>
CC: 4136 <at> debbugs.gnu.org, Eli Barzilay <eli@HIDDEN>
Subject: Re: bug#4136: 23.1; delete-pair
References: <19075.45378.67131.491453@HIDDEN>	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>	<4A850F6C.2080205@HIDDEN> <873a7uc8mg.fsf@HIDDEN>	<4A8689EE.9020402@HIDDEN> <87ljlk4snf.fsf@HIDDEN>
In-Reply-To: <87ljlk4snf.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.75

 > I know, I know, after I fix this, you'll come up with another
 > test case like
 >
 >          `foo bar'

I wouldn't.  Doing a `forward-sexp' on `foo' wouldn't get me to the end
of `bar'.  So you could all too easily reject such a test case ;-)

If, however, `delete-pair' were called with a prefix argument of 2 ...

martin



Acknowledgement sent to martin rudalics <rudalics@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 16 Aug 2009 00:00:25 +0000
From eli@HIDDEN Sat Aug 15 17:00:25 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	SPF_HELO_PASS autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from barzilay.org (winooski.ccs.neu.edu [129.10.115.117])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7G00OQt012603
	for <4136@HIDDEN>; Sat, 15 Aug 2009 17:00:25 -0700
Received: from eli by barzilay.org with local (Exim 4.66)
	(envelope-from <eli@HIDDEN>)
	id 1McTAc-0006v2-Bv; Sat, 15 Aug 2009 20:00:22 -0400
From: Eli Barzilay <eli@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <19079.19478.357436.68768@HIDDEN>
Date: Sat, 15 Aug 2009 20:00:22 -0400
To: Juri Linkov <juri@HIDDEN>
Cc: martin rudalics <rudalics@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
In-Reply-To: <87ab20znhd.fsf@HIDDEN>
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN>
	<87tz0bqqhm.fsf@HIDDEN>
	<4A850F6C.2080205@HIDDEN>
	<873a7uc8mg.fsf@HIDDEN>
	<4A8689EE.9020402@HIDDEN>
	<87ljlk4snf.fsf@HIDDEN>
	<87eirfs56q.fsf@HIDDEN>
	<19076.47996.128071.281272@HIDDEN>
	<87pray9ezq.fsf@HIDDEN>
	<19078.4981.525959.210519@HIDDEN>
	<87ab20znhd.fsf@HIDDEN>
X-Mailer: VM 7.19 under Emacs 22.1.1

On Aug 16, Juri Linkov wrote:
> >> It seems you and Martin prefer checking against the
> >> `insert-pair-alist' because the function name `delete-pair'
> >> suggests it should be a counterpart of `insert-pair'.
> >
> > ...this is exactly the issue: it is much better if `delete-foo' is
> > always an operation that reverts what `insert-foo' does.
> 
> The exact reverse is impossible.

Of course it isn't, but the operation is one that negates in what it
"generally does" the thing that `insert-foo' does.  Just like
`scroll-down' and `scroll-up' are opposites even though they don't
always cancel out.


> > The current state of `delete-pair' is so bad that my guess is that
> > hardly anyone used it, so adding another command doesn't make much
> > sense.  How about making it do the proper thing (removing only
> > balanced pairs as specified by `insert-pair-alist'), and ignoring
> > errors with a prefix argument?
> 
> I've been using `delete-pair' for many years several times a day
> without any problem because my lists are always correctly balanced
> thanks to `insert-pair' that I exclusively use to create balanced
> lists and strings.

Believe me, I've written a paren or two, and I use `insert-pair'
enough to have my own improved version of it.  (In fact, guess why I
almost never use smileys in emails.)  Still, the first time I tried
this, the cursor was at the beginning of an indented line.  But the
point is still the same: having two nearly identical functions is
exactly what prefix arguments are for.


> That's why even in the current state of `delete-pair' it is the
> useful reverse of `insert-pair' because the latter creates balanced
> lists and the former deletes them.

... unless you happen to have your cursor on a non-paren.


> >> This is fixed in the following version:
> >> [...]
> >
> > This version doesn't make much sense as an operation you'd want to do
> > on code:
> >
> >   (foo '(x y z))
> >   -->
> >   (foo 'x y z)
> 
> It makes sense when `foo' is a multi-argument function like `list',
> e.g.
> 
>     (list 'x y z)
> 
> So I see no reason to introduce more restrictions to decide what
> parens the user is allowed to delete in his/her code.

You've missed my point: the difference between "y" and "'y" is *huge*,
changing one to the other is something that you don't want to do by
mistake.


On Aug 16, Juri Linkov wrote:
> >> This is fixed in the following version:
> >>
> >> (defun delete-pair ()
> >>   "Delete a pair of characters enclosing the sexp that follows point."
> >>   (interactive)
> >>   (save-excursion
> >>     (forward-sexp 1)
> >>     (save-excursion
> >>       (backward-sexp 1)
> >>       (skip-syntax-forward "'")
> >>       (delete-char 1))
> >>     (delete-char -1)))
> >
> > Still doesn't seem TDTRT with `point' before something like
> >
> >        `foo'
> 
> I know, I know, after I fix this, you'll come up with another
> test case like
> 
>          `foo bar'

Those examples are very good IMO -- it's not being picky for nothing,
it's an attempt to avoid nasty surprises that make you end up with
erroneous code.  Emacs is usually good at being a careful editor for
code, `delete-pair' is very exceptional in this aspect.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!



Acknowledgement sent to Eli Barzilay <eli@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 15 Aug 2009 23:23:27 +0000
From juri@HIDDEN Sat Aug 15 16:23:27 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx1.starman.ee (smtp-out1.starman.ee [85.253.0.3])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7FNNPhh006338
	for <4136@HIDDEN>; Sat, 15 Aug 2009 16:23:26 -0700
X-Virus-Scanned: by Amavisd-New at mx1.starman.ee
Received: from mail.starman.ee (82.131.53.206.cable.starman.ee [82.131.53.206])
	by mx1.starman.ee (Postfix) with ESMTP id 3E2293F434B;
	Sun, 16 Aug 2009 02:23:19 +0300 (EEST)
From: Juri Linkov <juri@HIDDEN>
To: Eli Barzilay <eli@HIDDEN>
Cc: martin rudalics <rudalics@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
Organization: JURTA
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>
	<4A850F6C.2080205@HIDDEN> <873a7uc8mg.fsf@HIDDEN>
	<87eirfs56q.fsf@HIDDEN>
	<19076.47996.128071.281272@HIDDEN>
	<87pray9ezq.fsf@HIDDEN>
	<19078.4981.525959.210519@HIDDEN>
Date: Sun, 16 Aug 2009 02:06:06 +0300
In-Reply-To: <19078.4981.525959.210519@HIDDEN> (Eli Barzilay's
	message of "Fri, 14 Aug 2009 21:46:29 -0400")
Message-ID: <87ab20znhd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

>> It seems you and Martin prefer checking against the
>> `insert-pair-alist' because the function name `delete-pair' suggests
>> it should be a counterpart of `insert-pair'.
>
> ...this is exactly the issue: it is much better if `delete-foo' is
> always an operation that reverts what `insert-foo' does.

The exact reverse is impossible.  For instance, put the cursor
on the letter `f' in:

    foo "" bar

and type `M-3 M-"' where M-" is bound to `insert-pair'.
The result will be:

    "foo "" bar"

Now what `delete-pair' should do to revert this back to the original?

> The current state of `delete-pair' is so bad that my guess is that
> hardly anyone used it, so adding another command doesn't make much
> sense.  How about making it do the proper thing (removing only
> balanced pairs as specified by `insert-pair-alist'), and ignoring
> errors with a prefix argument?

I've been using `delete-pair' for many years several times a day
without any problem because my lists are always correctly balanced
thanks to `insert-pair' that I exclusively use to create balanced
lists and strings.

That's why even in the current state of `delete-pair' it is the useful
reverse of `insert-pair' because the latter creates balanced lists
and the former deletes them.

>> This is fixed in the following version:
>> [...]
>
> This version doesn't make much sense as an operation you'd want to do
> on code:
>
>   (foo '(x y z))
>   -->
>   (foo 'x y z)

It makes sense when `foo' is a multi-argument function like `list', e.g.

    (list 'x y z)

So I see no reason to introduce more restrictions to decide what
parens the user is allowed to delete in his/her code.

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



Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 15 Aug 2009 23:23:27 +0000
From juri@HIDDEN Sat Aug 15 16:23:27 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx1.starman.ee (smtp-out1.starman.ee [85.253.0.3])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7FNNPtf006337
	for <4136@HIDDEN>; Sat, 15 Aug 2009 16:23:26 -0700
X-Virus-Scanned: by Amavisd-New at mx1.starman.ee
Received: from mail.starman.ee (82.131.53.206.cable.starman.ee [82.131.53.206])
	by mx1.starman.ee (Postfix) with ESMTP id A95D83F4348;
	Sun, 16 Aug 2009 02:23:18 +0300 (EEST)
From: Juri Linkov <juri@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Cc: 4136 <at> debbugs.gnu.org, Eli Barzilay <eli@HIDDEN>
Subject: Re: bug#4136: 23.1; delete-pair
Organization: JURTA
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>
	<4A850F6C.2080205@HIDDEN> <873a7uc8mg.fsf@HIDDEN>
	<4A8689EE.9020402@HIDDEN>
Date: Sun, 16 Aug 2009 02:03:12 +0300
In-Reply-To: <4A8689EE.9020402@HIDDEN> (martin rudalics's message of "Sat, 15
	Aug 2009 12:11:58 +0200")
Message-ID: <87ljlk4snf.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

>> This is fixed in the following version:
>>
>> (defun delete-pair ()
>>   "Delete a pair of characters enclosing the sexp that follows point."
>>   (interactive)
>>   (save-excursion
>>     (forward-sexp 1)
>>     (save-excursion
>>       (backward-sexp 1)
>>       (skip-syntax-forward "'")
>>       (delete-char 1))
>>     (delete-char -1)))
>
> Still doesn't seem TDTRT with `point' before something like
>
>        `foo'

I know, I know, after I fix this, you'll come up with another
test case like

         `foo bar'

;-)

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



Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 15 Aug 2009 10:12:09 +0000
From rudalics@HIDDEN Sat Aug 15 03:12:09 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-4.4 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with SMTP id n7FAC6hW027568
	for <4136@HIDDEN>; Sat, 15 Aug 2009 03:12:08 -0700
Received: (qmail invoked by alias); 15 Aug 2009 10:12:01 -0000
Received: from 62-47-35-223.adsl.highway.telekom.at (EHLO [62.47.35.223]) [62.47.35.223]
  by mail.gmx.net (mp029) with SMTP; 15 Aug 2009 12:12:01 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX18dHGIrRKsdAMFacXUJcRy2Np8O0C2Hza7Jagm8Gw
	vxZ8Axu6OreSYg
Message-ID: <4A8689EE.9020402@HIDDEN>
Date: Sat, 15 Aug 2009 12:11:58 +0200
From: martin rudalics <rudalics@HIDDEN>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Juri Linkov <juri@HIDDEN>
CC: 4136 <at> debbugs.gnu.org, Eli Barzilay <eli@HIDDEN>
Subject: Re: bug#4136: 23.1; delete-pair
References: <19075.45378.67131.491453@HIDDEN>	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>	<4A850F6C.2080205@HIDDEN> <873a7uc8mg.fsf@HIDDEN>
In-Reply-To: <873a7uc8mg.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.73

 > This is fixed in the following version:
 >
 > (defun delete-pair ()
 >   "Delete a pair of characters enclosing the sexp that follows point."
 >   (interactive)
 >   (save-excursion
 >     (forward-sexp 1)
 >     (save-excursion
 >       (backward-sexp 1)
 >       (skip-syntax-forward "'")
 >       (delete-char 1))
 >     (delete-char -1)))

Still doesn't seem TDTRT with `point' before something like

        `foo'

martin



Acknowledgement sent to martin rudalics <rudalics@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 15 Aug 2009 10:11:40 +0000
From rudalics@HIDDEN Sat Aug 15 03:11:40 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-4.4 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with SMTP id n7FABbNv027550
	for <4136@HIDDEN>; Sat, 15 Aug 2009 03:11:39 -0700
Received: (qmail invoked by alias); 15 Aug 2009 10:11:31 -0000
Received: from 62-47-35-223.adsl.highway.telekom.at (EHLO [62.47.35.223]) [62.47.35.223]
  by mail.gmx.net (mp025) with SMTP; 15 Aug 2009 12:11:31 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX19h5ZVXDo5h8RlP86ICcUsGlaHoot0op3I7CdedYA
	gd0tniYN3bke1U
Message-ID: <4A8689D1.3000408@HIDDEN>
Date: Sat, 15 Aug 2009 12:11:29 +0200
From: martin rudalics <rudalics@HIDDEN>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Juri Linkov <juri@HIDDEN>
CC: Eli Barzilay <eli@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
References: <19075.45378.67131.491453@HIDDEN>	<87eirfs56q.fsf@HIDDEN> <4A83E299.3060002@HIDDEN>	<87tz0bqqhm.fsf@HIDDEN>	<19076.47996.128071.281272@HIDDEN> <87pray9ezq.fsf@HIDDEN>
In-Reply-To: <87pray9ezq.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.74

 > This command is useful even if it doesn't fail on (...] because
 > forward-sexp and backward-sexp don't fail on (...].

Is this carved in stone?  The TODO file has

** (Controlled by a flag) make open and close syntax match exactly,
   i.e. `(' doesn't match `]'.

I always wondered what that entry aimed at ...

 > It seems you and Martin prefer checking against the `insert-pair-alist'
 > because the function name `delete-pair' suggests it should be
 > a counterpart of `insert-pair'.  In this case I think we sould have
 > two commands: one more strict version `delete-pair' that checks
 > `insert-pair-alist', and another loose version with the name e.g.
 > `delete-parens' with the body of the current `delete-pair'.

In any case, removing the first and last character from a name doesn't
strike me as very "pair-like" ;-)

martin



Acknowledgement sent to martin rudalics <rudalics@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 15 Aug 2009 01:46:33 +0000
From eli@HIDDEN Fri Aug 14 18:46:33 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.5 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8,SPF_HELO_PASS autolearn=ham
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from barzilay.org (winooski.ccs.neu.edu [129.10.115.117])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7F1kVxT006154
	for <4136@HIDDEN>; Fri, 14 Aug 2009 18:46:32 -0700
Received: from eli by barzilay.org with local (Exim 4.66)
	(envelope-from <eli@HIDDEN>)
	id 1Mc8Ll-0008Hs-HK; Fri, 14 Aug 2009 21:46:29 -0400
From: Eli Barzilay <eli@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <19078.4981.525959.210519@HIDDEN>
Date: Fri, 14 Aug 2009 21:46:29 -0400
To: Juri Linkov <juri@HIDDEN>
Cc: martin rudalics <rudalics@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
In-Reply-To: <87pray9ezq.fsf@HIDDEN>
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN>
	<87tz0bqqhm.fsf@HIDDEN>
	<4A850F6C.2080205@HIDDEN>
	<873a7uc8mg.fsf@HIDDEN>
	<87eirfs56q.fsf@HIDDEN>
	<19076.47996.128071.281272@HIDDEN>
	<87pray9ezq.fsf@HIDDEN>
X-Mailer: VM 7.19 under Emacs 22.1.1

On Aug 15, Juri Linkov wrote:
> > Here is a version that checks that does exactly what Martin
> > suggested.  It even fails on something like (...] -- which is very
> > useful for keyboard macros, since if you have that text in a
> > buffer, then something is probably messed up enough to require
> > your attention.
> 
> This command is useful even if it doesn't fail on (...] because
> forward-sexp and backward-sexp don't fail on (...].

Martin's example of '(blah) works better, but in general...

> It seems you and Martin prefer checking against the
> `insert-pair-alist' because the function name `delete-pair' suggests
> it should be a counterpart of `insert-pair'.

...this is exactly the issue: it is much better if `delete-foo' is
always an operation that reverts what `insert-foo' does.


> In this case I think we sould have two commands: one more strict
> version `delete-pair' that checks `insert-pair-alist', and another
> loose version with the name e.g.  `delete-parens' with the body of
> the current `delete-pair'.

The current state of `delete-pair' is so bad that my guess is that
hardly anyone used it, so adding another command doesn't make much
sense.  How about making it do the proper thing (removing only
balanced pairs as specified by `insert-pair-alist'), and ignoring
errors with a prefix argument?


On Aug 15, Juri Linkov wrote:
> >> This is rather vague semantics.  I suggest to keep the current
> >> simple semantics and just to fix it with the patch I sent.
> >
> > Before a quoted object your fixed version deletes the last
> > character of the object and the first quote character.  Handling
> > quote or prefix syntax characters via (delete-char 1) doesn't
> > strike me as very clean.
> 
> This is fixed in the following version:
> [...]

This version doesn't make much sense as an operation you'd want to do
on code:

  (foo '(x y z))
  -->
  (foo 'x y z)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!



Acknowledgement sent to Eli Barzilay <eli@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 14 Aug 2009 23:04:27 +0000
From juri@HIDDEN Fri Aug 14 16:04:27 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx1.starman.ee (smtp-out1.starman.ee [85.253.0.3])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7EN4PDc009799
	for <4136@HIDDEN>; Fri, 14 Aug 2009 16:04:26 -0700
X-Virus-Scanned: by Amavisd-New at mx1.starman.ee
Received: from mail.starman.ee (82.131.30.119.cable.starman.ee [82.131.30.119])
	by mx1.starman.ee (Postfix) with ESMTP id 1AE843F4360;
	Sat, 15 Aug 2009 02:04:20 +0300 (EEST)
From: Juri Linkov <juri@HIDDEN>
To: Eli Barzilay <eli@HIDDEN>
Cc: martin rudalics <rudalics@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
Organization: JURTA
References: <19075.45378.67131.491453@HIDDEN>
	<87eirfs56q.fsf@HIDDEN> <4A83E299.3060002@HIDDEN>
	<87tz0bqqhm.fsf@HIDDEN>
	<19076.47996.128071.281272@HIDDEN>
Date: Sat, 15 Aug 2009 01:45:45 +0300
In-Reply-To: <19076.47996.128071.281272@HIDDEN> (Eli Barzilay's
	message of "Thu, 13 Aug 2009 21:18:52 -0400")
Message-ID: <87pray9ezq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

> Here is a version that checks that does exactly what Martin suggested.
> It even fails on something like (...] -- which is very useful for
> keyboard macros, since if you have that text in a buffer, then
> something is probably messed up enough to require your attention.

This command is useful even if it doesn't fail on (...] because
forward-sexp and backward-sexp don't fail on (...].

It seems you and Martin prefer checking against the `insert-pair-alist'
because the function name `delete-pair' suggests it should be
a counterpart of `insert-pair'.  In this case I think we sould have
two commands: one more strict version `delete-pair' that checks
`insert-pair-alist', and another loose version with the name e.g.
`delete-parens' with the body of the current `delete-pair'.

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



Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 14 Aug 2009 23:04:26 +0000
From juri@HIDDEN Fri Aug 14 16:04:26 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx1.starman.ee (smtp-out1.starman.ee [85.253.0.3])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7EN4PZf009798
	for <4136@HIDDEN>; Fri, 14 Aug 2009 16:04:26 -0700
X-Virus-Scanned: by Amavisd-New at mx1.starman.ee
Received: from mail.starman.ee (82.131.30.119.cable.starman.ee [82.131.30.119])
	by mx1.starman.ee (Postfix) with ESMTP id 8EB023F435E;
	Sat, 15 Aug 2009 02:04:19 +0300 (EEST)
From: Juri Linkov <juri@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Cc: 4136 <at> debbugs.gnu.org, Eli Barzilay <eli@HIDDEN>
Subject: Re: bug#4136: 23.1; delete-pair
Organization: JURTA
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>
	<4A850F6C.2080205@HIDDEN>
Date: Sat, 15 Aug 2009 01:45:03 +0300
In-Reply-To: <4A850F6C.2080205@HIDDEN> (martin rudalics's message of "Fri, 14
	Aug 2009 09:17:00 +0200")
Message-ID: <873a7uc8mg.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

>> This is rather vague semantics.  I suggest to keep the current simple
>> semantics and just to fix it with the patch I sent.
>
> Before a quoted object your fixed version deletes the last character of
> the object and the first quote character.  Handling quote or prefix
> syntax characters via (delete-char 1) doesn't strike me as very clean.

This is fixed in the following version:

(defun delete-pair ()
  "Delete a pair of characters enclosing the sexp that follows point."
  (interactive)
  (save-excursion
    (forward-sexp 1)
    (save-excursion
      (backward-sexp 1)
      (skip-syntax-forward "'")
      (delete-char 1))
    (delete-char -1)))

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



Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 14 Aug 2009 15:50:17 +0000
From monnier@HIDDEN Fri Aug 14 08:50:16 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-4.3 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from chene.dit.umontreal.ca (chene.dit.umontreal.ca [132.204.246.20])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7EFoEu6001532
	for <4136@HIDDEN>; Fri, 14 Aug 2009 08:50:16 -0700
Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177])
	by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n7EFoCSA012612;
	Fri, 14 Aug 2009 11:50:12 -0400
Received: by faina.iro.umontreal.ca (Postfix, from userid 20848)
	id 155083A0D1; Fri, 14 Aug 2009 11:50:12 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Barzilay <eli@HIDDEN>
Cc: 4136 <at> debbugs.gnu.org, martin rudalics <rudalics@HIDDEN>,
        Juri Linkov <juri@HIDDEN>
Subject: Re: bug#4136: 23.1; delete-pair
Message-ID: <jwvbpmiz99y.fsf-monnier+emacsbugreports@HIDDEN>
References: <19075.45378.67131.491453@HIDDEN>
	<87eirfs56q.fsf@HIDDEN> <4A83E299.3060002@HIDDEN>
	<87tz0bqqhm.fsf@HIDDEN>
	<19076.47996.128071.281272@HIDDEN>
Date: Fri, 14 Aug 2009 11:50:12 -0400
In-Reply-To: <19076.47996.128071.281272@HIDDEN> (Eli Barzilay's
	message of "Thu, 13 Aug 2009 21:18:52 -0400")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV3340=0

> Here is a version that checks that does exactly what Martin suggested.
> It even fails on something like (...] -- which is very useful for
> keyboard macros, since if you have that text in a buffer, then
> something is probably messed up enough to require your attention.

There's always a tension in such cases.  E.g. for interactive use, I'd
rather we allow such (..] cases, since it may occasionally come in handy
(whereas the beep will come as a major annoyance, where Emacs will
appear to the user as being dogmatic).


        Stefan




Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 14 Aug 2009 07:17:14 +0000
From rudalics@HIDDEN Fri Aug 14 00:17:14 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-4.4 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with SMTP id n7E7HCva014730
	for <4136@HIDDEN>; Fri, 14 Aug 2009 00:17:13 -0700
Received: (qmail invoked by alias); 14 Aug 2009 07:17:02 -0000
Received: from 62-47-41-235.adsl.highway.telekom.at (EHLO [62.47.41.235]) [62.47.41.235]
  by mail.gmx.net (mp064) with SMTP; 14 Aug 2009 09:17:02 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX18iT/0mpdgil6S9PHqgvBywvyjT3r1d+Hug0c1O6q
	tCjE/pYMfhhi9i
Message-ID: <4A850F6C.2080205@HIDDEN>
Date: Fri, 14 Aug 2009 09:17:00 +0200
From: martin rudalics <rudalics@HIDDEN>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Juri Linkov <juri@HIDDEN>
CC: 4136 <at> debbugs.gnu.org, Eli Barzilay <eli@HIDDEN>
Subject: Re: bug#4136: 23.1; delete-pair
References: <19075.45378.67131.491453@HIDDEN>	<4A83E299.3060002@HIDDEN> <87tz0bqqhm.fsf@HIDDEN>
In-Reply-To: <87tz0bqqhm.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.78

 > This is rather vague semantics.  I suggest to keep the current simple
 > semantics and just to fix it with the patch I sent.

Before a quoted object your fixed version deletes the last character of
the object and the first quote character.  Handling quote or prefix
syntax characters via (delete-char 1) doesn't strike me as very clean.

martin



Acknowledgement sent to martin rudalics <rudalics@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 14 Aug 2009 01:18:57 +0000
From eli@HIDDEN Thu Aug 13 18:18:56 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.2 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8,SPF_HELO_PASS autolearn=ham
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from barzilay.org (winooski.ccs.neu.edu [129.10.115.117])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7E1ItAj021423
	for <4136@HIDDEN>; Thu, 13 Aug 2009 18:18:56 -0700
Received: from eli by barzilay.org with local (Exim 4.66)
	(envelope-from <eli@HIDDEN>)
	id 1MblRU-0008UW-4V; Thu, 13 Aug 2009 21:18:52 -0400
From: Eli Barzilay <eli@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <19076.47996.128071.281272@HIDDEN>
Date: Thu, 13 Aug 2009 21:18:52 -0400
To: martin rudalics <rudalics@HIDDEN>, Juri Linkov <juri@HIDDEN>
Cc: 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
In-Reply-To: <4A83E299.3060002@HIDDEN>
References: <19075.45378.67131.491453@HIDDEN>
	<87eirfs56q.fsf@HIDDEN>
	<4A83E299.3060002@HIDDEN>
	<87tz0bqqhm.fsf@HIDDEN>
X-Mailer: VM 7.19 under Emacs 22.1.1

On Aug 13, martin rudalics wrote:
>  > `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.
> 
> `delete-pair' shouldn't delete anything but matching elements of
> `insert-pair-alist'.

This is a very good point.


On Aug 14, Juri Linkov wrote:
> >> `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.
> >
> > `delete-pair' shouldn't delete anything but matching elements of
> > `insert-pair-alist'.
> 
> This is rather vague semantics.  I suggest to keep the current simple
> semantics and just to fix it with the patch I sent.

I disagree in two different ways: (a) it can be put into code, so it's
not vague at all; (b) it sounds like a very good feature -- as it
stands, this function is nearly useless without human supervision,
which makes it useless for keyboard macros.

Here is a version that checks that does exactly what Martin suggested.
It even fails on something like (...] -- which is very useful for
keyboard macros, since if you have that text in a buffer, then
something is probably messed up enough to require your attention.


(defun delete-pair ()
  "Delete a pair of characters enclosing the sexp that follows point."
  (interactive)
  (save-excursion
    (let* ((end      (progn (forward-sexp  1) (point)))
           (start    (progn (forward-sexp -1) (point)))
           (start-ch (char-after start))
           (end-ch   (char-before end))
           (match-p  nil))
      (let ((p insert-pair-alist))
        (while p
          (let* ((q (car p))
                 (fst (if (= (length q) 3) 1 0))
                 (snd (1+ fst)))
            (if (and (equal start-ch (nth fst q))
                     (equal end-ch   (nth snd q)))
              (setq p nil match-p t)
              (setq p (cdr p))))))
      (if match-p
        (progn (delete-region (1- end) end)
               (delete-region start (1+ start)))
        (error "not a matching pair")))))


-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!



Acknowledgement sent to Eli Barzilay <eli@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 13 Aug 2009 23:30:41 +0000
From juri@HIDDEN Thu Aug 13 16:30:41 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.5 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx1.starman.ee (smtp-out1.starman.ee [85.253.0.3])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7DNUdGu003295
	for <4136@HIDDEN>; Thu, 13 Aug 2009 16:30:41 -0700
X-Virus-Scanned: by Amavisd-New at mx1.starman.ee
Received: from mail.starman.ee (82.131.55.163.cable.starman.ee [82.131.55.163])
	by mx1.starman.ee (Postfix) with ESMTP id A85343F43F0;
	Fri, 14 Aug 2009 02:30:31 +0300 (EEST)
From: Juri Linkov <juri@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Cc: 4136 <at> debbugs.gnu.org, Eli Barzilay <eli@HIDDEN>
Subject: Re: bug#4136: 23.1; delete-pair
Organization: JURTA
References: <19075.45378.67131.491453@HIDDEN>
	<4A83E299.3060002@HIDDEN>
Date: Fri, 14 Aug 2009 02:29:09 +0300
In-Reply-To: <4A83E299.3060002@HIDDEN> (martin rudalics's message of "Thu, 13
	Aug 2009 11:53:29 +0200")
Message-ID: <87tz0bqqhm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

>> `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.
>
> `delete-pair' shouldn't delete anything but matching elements of
> `insert-pair-alist'.

This is rather vague semantics.  I suggest to keep the current simple
semantics and just to fix it with the patch I sent.

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



Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 13 Aug 2009 23:30:41 +0000
From juri@HIDDEN Thu Aug 13 16:30:41 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.5 required=4.0 tests=AWL,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mx1.starman.ee (smtp-out1.starman.ee [85.253.0.3])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7DNUd0r003292
	for <4136@HIDDEN>; Thu, 13 Aug 2009 16:30:40 -0700
X-Virus-Scanned: by Amavisd-New at mx1.starman.ee
Received: from mail.starman.ee (82.131.55.163.cable.starman.ee [82.131.55.163])
	by mx1.starman.ee (Postfix) with ESMTP id 2FC383F43EF;
	Fri, 14 Aug 2009 02:30:31 +0300 (EEST)
From: Juri Linkov <juri@HIDDEN>
To: Eli Barzilay <eli@HIDDEN>
Cc: 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
Organization: JURTA
References: <19075.45378.67131.491453@HIDDEN>
Date: Fri, 14 Aug 2009 02:28:21 +0300
In-Reply-To: <19075.45378.67131.491453@HIDDEN> (Eli Barzilay's
	message of "Thu, 13 Aug 2009 02:22:58 -0400")
Message-ID: <87eirfs56q.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

> `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/



Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at 4136@HIDDEN:


Received: (at 4136) by emacsbugs.donarmstrong.com; 13 Aug 2009 09:53:40 +0000
From rudalics@HIDDEN Thu Aug 13 02:53:40 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-4.4 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with SMTP id n7D9rcRB013556
	for <4136@HIDDEN>; Thu, 13 Aug 2009 02:53:39 -0700
Received: (qmail invoked by alias); 13 Aug 2009 09:53:31 -0000
Received: from 62-47-61-170.adsl.highway.telekom.at (EHLO [62.47.61.170]) [62.47.61.170]
  by mail.gmx.net (mp036) with SMTP; 13 Aug 2009 11:53:31 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX19cbkkBdjNcVvcI5hU/96RXNlZV9fgorPVj8Z5sN7
	jT90yYTGRZX2ot
Message-ID: <4A83E299.3060002@HIDDEN>
Date: Thu, 13 Aug 2009 11:53:29 +0200
From: martin rudalics <rudalics@HIDDEN>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Eli Barzilay <eli@HIDDEN>, 4136 <at> debbugs.gnu.org
Subject: Re: bug#4136: 23.1; delete-pair
References: <19075.45378.67131.491453@HIDDEN>
In-Reply-To: <19075.45378.67131.491453@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.85

 > `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.

`delete-pair' shouldn't delete anything but matching elements of
`insert-pair-alist'.

martin



Acknowledgement sent to martin rudalics <rudalics@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.

Message received at submit@HIDDEN:


Received: (at submit) by emacsbugs.donarmstrong.com; 13 Aug 2009 06:23:08 +0000
From eli@HIDDEN Wed Aug 12 23:23:08 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-0.8 required=4.0 tests=AWL,FOURLA autolearn=no
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from lists.gnu.org (lists.gnu.org [199.232.76.165])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7D6N6MM010881
	for <submit@HIDDEN>; Wed, 12 Aug 2009 23:23:08 -0700
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1MbTiM-00050v-DY
	for bug-gnu-emacs@HIDDEN; Thu, 13 Aug 2009 02:23:06 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1MbTiG-000505-11
	for bug-gnu-emacs@HIDDEN; Thu, 13 Aug 2009 02:23:05 -0400
Received: from [199.232.76.173] (port=48264 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1MbTiF-0004zy-OZ
	for bug-gnu-emacs@HIDDEN; Thu, 13 Aug 2009 02:22:59 -0400
Received: from winooski.ccs.neu.edu ([129.10.115.117]:57654 helo=barzilay.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60)
	(envelope-from <eli@HIDDEN>)
	id 1MbTiF-0004uO-F2
	for bug-gnu-emacs@HIDDEN; Thu, 13 Aug 2009 02:22:59 -0400
Received: from eli by barzilay.org with local (Exim 4.66)
	(envelope-from <eli@HIDDEN>)
	id 1MbTiE-0004P9-2U
	for bug-gnu-emacs@HIDDEN; Thu, 13 Aug 2009 02:22:58 -0400
From: Eli Barzilay <eli@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <19075.45378.67131.491453@HIDDEN>
Date: Thu, 13 Aug 2009 02:22:58 -0400
To: bug-gnu-emacs@HIDDEN
Subject: 23.1; delete-pair
X-Mailer: VM 7.19 under Emacs 22.1.1
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3)

`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.



In GNU Emacs 23.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.14)
 of 2009-08-01 on winooski.ccs.neu.edu
Windowing system distributor `The X.Org Foundation', version 11.0.10300000
configured using `configure  '--prefix=/home/eli/bin/local/emacs-dir''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: POSIX
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  cua-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  line-number-mode: t
  transient-mark-mode: t




Acknowledgement sent to Eli Barzilay <eli@HIDDEN>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4136; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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