From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: Error-Free Navigation in Trees of Sub-Expressions (sexp) in Font-Locking Function Matchers Date: Wed, 08 Oct 2008 16:15:49 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1223475751 1452 80.91.229.12 (8 Oct 2008 14:22:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Oct 2008 14:22:31 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?utf-8?Q?Nordl=C3=B6w?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 08 16:23:27 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KnZr4-0003cm-M5 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Oct 2008 16:17:34 +0200 Original-Received: from localhost ([127.0.0.1]:50234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnZpx-00068R-DS for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Oct 2008 10:16:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KnZpU-00067Z-P8 for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 10:15:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KnZpR-000629-0R for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 10:15:56 -0400 Original-Received: from [199.232.76.173] (port=54068 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnZpQ-00061z-Rf for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 10:15:52 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:38424) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KnZpQ-0003oD-Pk for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 10:15:53 -0400 Original-Received: from thursday (BAHb8d4.bah.pppool.de [77.135.184.212]) by dd18200.kasserver.com (Postfix) with ESMTP id 59C95180291AD; Wed, 8 Oct 2008 16:15:54 +0200 (CEST) In-Reply-To: (=?utf-8?Q?=22Nordl=C3=B6w=22's?= message of "Wed\, 8 Oct 2008 05\:24\:16 -0700 \(PDT\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58538 Archived-At: Nordl=C3=B6w wrote: > What is the most clever way of checking when we are at the last sexp > (forward-sexp will fail as mentioned above)? You could use either: (condition-case err (while t (forward-sexp) ...) (scan-error . nil)) to break the loop on an error, or: (while (ignore-errors (forward-sexp) t) ...) to get a nil when forward-sexp fails. regards, Nikolaj Schumacher