[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: up-list gives error inside strings
From: |
Stefan Monnier |
Subject: |
Re: up-list gives error inside strings |
Date: |
Tue, 24 Apr 2007 16:48:52 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux) |
> Calling `up-list' inside a string gives this error:
> up-list: Scan error: "Unbalanced parentheses", 14, 19
Actually, it can give all kinds of different errors as well as
desriable behaviors.
> This is obviously not the case in this example:
> (setq foo "bar")
> ^ point
> I can't tell if the failure to move out of the parentheses is by design,
> but the error message is misleading.
The problem here is how to figure out that we start from inside a string.
One of the design constraints we've imposed on ourselves is that operations
like up-list and friends should ideally work "locally" without having to
parse the buffer from the very beginning, whereas to reliably know that
we're outside of a string we have no other choice than to parse from the
very beginning.
Now you're going to say "but it's highlighted as a string, so Emacs knows
it's a string". Well, yes, kind of. But now users have found advantages to
the misfeature, and font-lock highlighting is not guaranteed to be
available and even less guaranteed to be correct, and ....
So let's call it a known misfeature. It should be improved in the future.
Stefan