From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: scan-sexps throws an error - are there any substitutes? Date: Thu, 26 Mar 2015 16:12:12 -0700 (PDT) Message-ID: <57492c9d-d615-4854-bcb3-556acf55aeaa@default> References: <87sicrgy5i.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1427411589 545 80.91.229.3 (26 Mar 2015 23:13:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Mar 2015 23:13:09 +0000 (UTC) To: Marcin Borkowski , Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 27 00:12:56 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1YbGwx-00045W-St for geh-help-gnu-emacs@m.gmane.org; Fri, 27 Mar 2015 00:12:32 +0100 Original-Received: from localhost ([::1]:46914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbGwx-0004Ow-3N for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Mar 2015 19:12:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbGwm-0004Or-5l for help-gnu-emacs@gnu.org; Thu, 26 Mar 2015 19:12:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbGwj-0008Qk-03 for help-gnu-emacs@gnu.org; Thu, 26 Mar 2015 19:12:20 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:33372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbGwi-0008QZ-QQ for help-gnu-emacs@gnu.org; Thu, 26 Mar 2015 19:12:16 -0400 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t2QNCE9R020950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Mar 2015 23:12:14 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t2QNCDW7001473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 26 Mar 2015 23:12:14 GMT Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t2QNCDKq020447; Thu, 26 Mar 2015 23:12:13 GMT In-Reply-To: <87sicrgy5i.fsf@wmi.amu.edu.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103372 Archived-At: > scan-sexps throws an error if it cannot move as many sexps as I want. > This is fine in interactive use, but not really helpful in Lisp code I=E2= =80=99m > writing. (For the curious: I=E2=80=99m trying to write a solid SLOC-coun= ting > function, and I need moving by sexps to determine whether a string is > a docstring, which I want to exclude from the count.) Any ideas what to > do? I could rewrite it in Elisp, but is it a good idea? I doubt so. >=20 > NB. I don't really use scan-sexps, I use backward-sexp, which is > seemingly a higher level function =E2=80=93 but, unlike search functions,= it > doesn't have a =E2=80=9Cnoerror=E2=80=9D argument. You can wrap any code in `ignore-errors' to, well, ignore errors. ;-) You can also use `condition-case' to ignore particular signals.