From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.devel Subject: Re: paren-close-dwim: elisp function of a newbie; feedback welcome Date: Thu, 26 Sep 2013 15:54:50 -0400 Organization: Still searching... Message-ID: <87txh7gxyt.fsf@newsguy.com> References: <20130925114643.GA7187@csr-pc9.zib.de> <52431E25.3030603@lanl.gov> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1380225319 4704 80.91.229.3 (26 Sep 2013 19:55:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Sep 2013 19:55:19 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 26 21:55:22 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 1VPHeh-0002pi-Ex for ged-emacs-devel@m.gmane.org; Thu, 26 Sep 2013 21:55:19 +0200 Original-Received: from localhost ([::1]:59715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPHeh-0001W6-1j for ged-emacs-devel@m.gmane.org; Thu, 26 Sep 2013 15:55:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPHeX-0001Vu-S4 for emacs-devel@gnu.org; Thu, 26 Sep 2013 15:55:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPHeR-0005U7-8Z for emacs-devel@gnu.org; Thu, 26 Sep 2013 15:55:09 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:48184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPHeR-0005RQ-1K for emacs-devel@gnu.org; Thu, 26 Sep 2013 15:55:03 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VPHeO-0002TS-Gb for emacs-devel@gnu.org; Thu, 26 Sep 2013 21:55:00 +0200 Original-Received: from z65-50-57-227.ips.direcpath.com ([65.50.57.227]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 26 Sep 2013 21:55:00 +0200 Original-Received: from reader by z65-50-57-227.ips.direcpath.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 26 Sep 2013 21:55:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 16 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: z65-50-57-227.ips.direcpath.com User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.0.92 (gnu/linux) Cancel-Lock: sha1:NioDgptYWhshUnGIfJPaHRe2lZo= 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:163664 Archived-At: Davis Herring writes: > (defun paren-close-dwim () > "Insert closing parenthesis from syntax table. > Use a normal parenthesis if not inside any." > (interactive "*") > (insert (or (ignore-errors > (save-excursion (backward-up-list) > (cdr (syntax-after (point))))) > ?\)))) I'm a total illiterate in elisp but the narrative so far sounds like a this code might do something really useful. Can someone describe briefly how this would work, maybe with a small example, when repairing my own perl code?