From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: scan-sexps throws an error - are there any substitutes? Date: Fri, 27 Mar 2015 00:02:49 +0100 Message-ID: <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 1427411010 23548 80.91.229.3 (26 Mar 2015 23:03:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Mar 2015 23:03:30 +0000 (UTC) To: 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:03:20 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 1YbGo1-0007Tn-FN for geh-help-gnu-emacs@m.gmane.org; Fri, 27 Mar 2015 00:03:17 +0100 Original-Received: from localhost ([::1]:46898 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbGo0-0001Ga-FR for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Mar 2015 19:03:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbGnp-0001GV-Rf for help-gnu-emacs@gnu.org; Thu, 26 Mar 2015 19:03:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbGnk-0005De-Po for help-gnu-emacs@gnu.org; Thu, 26 Mar 2015 19:03:05 -0400 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:51755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbGnk-0005DO-J0 for help-gnu-emacs@gnu.org; Thu, 26 Mar 2015 19:03:00 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 373915B5C2 for ; Fri, 27 Mar 2015 00:02:57 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jzWYvps8qsKt for ; Fri, 27 Mar 2015 00:02:57 +0100 (CET) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id F21FC5B5C0 for ; Fri, 27 Mar 2015 00:02:56 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 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:103371 Archived-At: Hi all, 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. 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. TIA, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University