emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: better `up-list' for emacs-lisp, fundamental modes


From: Joe Corneli
Subject: Re: better `up-list' for emacs-lisp, fundamental modes
Date: Fri, 25 Mar 2005 19:08:00 -0600

Some time ago (Tue, 22 Feb 2005), I made a suggestion on how 
`up-list' could be improved.

Specifically, I said - why do I get an error here?


(concat "this-is-a-string" "--this-is-too")
             ^    ;=> up-list: Scan error: "Unbalanced parentheses", 656 771


Stephen had me pretty well convinced that this error couldn't be
gotten rid of easily with the current technology.  He said:

   Try this:

     (concat "hello (" var ") there")
                      ^
   with your suggestion of ignoring " (and hence in text-mode), in the above
   scenario, you'd jump to the paren inside the string, which is wrong.


He also said:

   Knowing whether you're inside a string can require scanning the whole buffer
   from point-min, which can be problematic.  The new function syntax-ppss can
   be used to try and make this efficient, but any such change should be
   postponed to after Emacs-22.1.

I do wonder how problematic things can be - since font lock seems to
do a pretty good job of identifying what is inside of a string and
what is outside.  (And cases where it can't do this seem to be
legitimate bugs that should be fixed.)


Thus I would like to submit the following slightly adjusted
suggestion: do not turn off strings, rather, use what we already know
about strings from font lock, when it is turned on, specifically, what
is inside quotes and what is outside quotes, to set text properties of
characters that are *inside* quotes such that these characters are
ignored by `up-list'.

Something like this would appear to deal correctly with the 

  "hello (" ") there"

example.




reply via email to

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