From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: paren-close-dwim: elisp function of a newbie; feedback welcome Date: Sun, 29 Sep 2013 12:11:25 +0200 Message-ID: <878uyglyya.fsf@wanadoo.es> References: <20130925114643.GA7187@csr-pc9.zib.de> <52431E25.3030603@lanl.gov> <87txh7gxyt.fsf@newsguy.com> <52449B36.4080009@lanl.gov> <20130926204416.GA25292@csr-pc9.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1380449516 22745 80.91.229.3 (29 Sep 2013 10:11:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Sep 2013 10:11:56 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 29 12:11:59 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VQDyo-0001Dc-T3 for ged-emacs-devel@m.gmane.org; Sun, 29 Sep 2013 12:11:59 +0200 Original-Received: from localhost ([::1]:44096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQDyo-0004XY-84 for ged-emacs-devel@m.gmane.org; Sun, 29 Sep 2013 06:11:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQDye-0004XR-4e for emacs-devel@gnu.org; Sun, 29 Sep 2013 06:11:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQDyW-0003e4-Qe for emacs-devel@gnu.org; Sun, 29 Sep 2013 06:11:48 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQDyW-0003dz-K7 for emacs-devel@gnu.org; Sun, 29 Sep 2013 06:11:40 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VQDyQ-0000sb-Qp for emacs-devel@gnu.org; Sun, 29 Sep 2013 12:11:34 +0200 Original-Received: from 224.red-79-152-157.dynamicip.rima-tde.net ([79.152.157.224]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 Sep 2013 12:11:34 +0200 Original-Received: from ofv by 224.red-79-152-157.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 Sep 2013 12:11:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 24 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 224.red-79-152-157.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:ba5dvYpAioEhM0ugkpe8fHi3ayc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163711 Archived-At: Florian writes: [snip] > If you are writing a nested expression, like the following, and '_' is > your cursor, > > { (a * [(b) - (c) _ > > and you have bound ')' to paren-close-dwim (dwim = do what I mean), > three succeeding presses of ')' will produce the sequence: ])}. Or in > other words: ')' will produce the correct next matching closing > bracket regarding the position of your cursor. I'll like to match the space separators too. With your example, pressing `)' thrice would result in: { (a * [(b) - (c)]) }_ Note how the space between `(c) _' disappeared and how an space was inserted before `}'. Without this sub-feature, the user would be forced to edit after pressing `)'.