help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error-Free Navigation in Trees of Sub-Expressions (sexp) in Font-Lo


From: Nordlöw
Subject: Re: Error-Free Navigation in Trees of Sub-Expressions (sexp) in Font-Locking Function Matchers
Date: Wed, 8 Oct 2008 07:30:56 -0700 (PDT)
User-agent: G2/1.0

On 8 Okt, 16:15, Nikolaj Schumacher <m...@nschum.de> wrote:
> Nordlöw <per.nord...@gmail.com> 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

Superb!

One can do everything in elisp, if you only know how ;)

/Nordlöw


reply via email to

[Prev in Thread] Current Thread [Next in Thread]