From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.devel Subject: Re: paren-close-dwim: elisp function of a newbie; feedback welcome Date: Fri, 27 Sep 2013 07:51:11 +0200 Message-ID: <52451CCF.3030806@online.de> 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; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1380260965 19112 80.91.229.3 (27 Sep 2013 05:49:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Sep 2013 05:49:25 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 27 07:49:25 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 1VPQvb-0005FU-PZ for ged-emacs-devel@m.gmane.org; Fri, 27 Sep 2013 07:49:23 +0200 Original-Received: from localhost ([::1]:33202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPQvb-00049H-FC for ged-emacs-devel@m.gmane.org; Fri, 27 Sep 2013 01:49:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPQvQ-0003xC-P4 for emacs-devel@gnu.org; Fri, 27 Sep 2013 01:49:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPQvJ-0002eW-Fp for emacs-devel@gnu.org; Fri, 27 Sep 2013 01:49:12 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.8]:49865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPQvJ-0002eD-6I for emacs-devel@gnu.org; Fri, 27 Sep 2013 01:49:05 -0400 Original-Received: from purzel.sitgens (brln-4dba2c34.pool.mediaWays.net [77.186.44.52]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Luron-1VpnZu02mv-00zlSa; Fri, 27 Sep 2013 07:49:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: <20130926204416.GA25292@csr-pc9.fritz.box> X-Provags-ID: V02:K0:a4W0xXZWmYHJ1+rlOpg1S1riCPjm8hM/qgFlD6fISmk fEKcQgtAW3mlW7/OuZ4v2Hrdl6q201DOJtewEXrtl/OIJhRvkv 22yJHufBVJMVujhYFofhcidsLngNLSWC20rkICBELxSei0T74D rQycx6fY64oglpMx1xUVKiJKONmba3tAiPb0eskQKpK4ouazfq OWmqsuJzDJj/jpPYVUWJT8hJkDUZeG9rJnvbjjCUJKZoJ16tGt nhk+FzfLxVjN+51gOh9yFmpHaU5wq7oE9xNIH36EpGLnPbLSbm wB7f12GFfLSfNRJxSTcUxxMuph/FCQKbbfm8KKLCYSNQe7QDrj 1yd4d5AH5VgF66h6TRn8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.8 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:163670 Archived-At: Am 26.09.2013 22:44, schrieb Florian: > >> I'm not sure what you mean about "repairing ... code". This command >> simply inserts ')', ']', or '}' (and perhaps '>' or so) to match the >> most recent unclosed ([{<. >> >> (If it is "really useful", know that it's not my idea; you just quoted >> my reimplementation of Florian's code.) > > But yours is much cleaner, I like it. Thanks for that. > > Here is a small example to illustrate what it does: > > 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. > > Florian > > > Really great. So we may have an electric-close, where C-j does all remaining before reaching the next line.