From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#4136: 23.1; delete-pair Date: Tue, 18 Aug 2009 09:13:34 +0200 Message-ID: <4A8A549E.20605@gmx.at> References: <19075.45378.67131.491453@winooski.ccs.neu.edu> <4A83E299.3060002@gmx.at> <87tz0bqqhm.fsf@mail.jurta.org> <4A850F6C.2080205@gmx.at> <873a7uc8mg.fsf@mail.jurta.org> <4A8689EE.9020402@gmx.at> <87ljlk4snf.fsf@mail.jurta.org> <87eirfs56q.fsf@mail.jurta.org> <19076.47996.128071.281272@winooski.ccs.neu.edu> <87pray9ezq.fsf@mail.jurta.org> <19078.4981.525959.210519@winooski.ccs.neu.edu> <87ab20znhd.fsf@mail.jurta.org> <19079.19478.357436.68768@winooski.ccs.neu.edu> <87k5131d3d.fsf@mail.jurta.org> <19080.51949.798286.416193@winooski.ccs.neu.edu> <87ocqezdfd.fsf@mail.jurta.org> Reply-To: martin rudalics , 4136@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010001070509010703070603" X-Trace: ger.gmane.org 1250803104 11844 80.91.229.12 (20 Aug 2009 21:18:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Aug 2009 21:18:24 +0000 (UTC) Cc: Eli Barzilay , 4136@emacsbugs.donarmstrong.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 20 23:18:17 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MeF1U-0007Jt-3S for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Aug 2009 23:18:16 +0200 Original-Received: from localhost ([127.0.0.1]:59888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeF1T-0007FL-7z for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Aug 2009 17:18:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeF0z-0006yT-MH for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:17:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeF0u-0006tt-Jm for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:17:45 -0400 Original-Received: from [199.232.76.173] (port=58673 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeF0u-0006to-Dc for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:17:40 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:52315) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MeF0t-0007El-Ha for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:17:40 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7KKkpoc019227; Thu, 20 Aug 2009 13:48:05 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7KKJ6fR013760; Thu, 20 Aug 2009 13:19:06 -0700 Resent-Date: Thu, 20 Aug 2009 13:19:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: martin rudalics Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 20 Aug 2009 20:19:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4136 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4136-submit@emacsbugs.donarmstrong.com id=B4136.125057969816345 (code B ref 4136); Thu, 20 Aug 2009 20:19:04 +0000 Original-Received: (at 4136) by emacsbugs.donarmstrong.com; 18 Aug 2009 07:14:58 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-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@emacsbugs.donarmstrong.com>; Tue, 18 Aug 2009 00:14:57 -0700 Original-Received: (qmail invoked by alias); 18 Aug 2009 07:14:48 -0000 Original-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 User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <87ocqezdfd.fsf@mail.jurta.org> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.77,0.63 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 20 Aug 2009 17:17:45 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30372 Archived-At: 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--