> With parse-sexp-ignore-comments t and point in between "( in

> (setq foo "(;)")

> forward-sexp gets me

> forward-sexp: Scan error: "Unbalanced parentheses".

> Obviously, this is because scan-lists finds the semicolon and does not
> check whether it's inside a string.  Could someone please add the
> necessary conjunct?

It's not as trivial a change as it may seem since figuring out whether we're
inside a string (or comment for that matter) or not often requires "parsing"
the buffer from the beginning and this parsing can fail if the syntax table
doesn't match 100% the language in use.

I do think it'd be good to do it and I suggest we beginning by introducing
new commands move-forward-sexp and move-backward-sexp (which are
"user-level" sexp movement commands) which could try to DTRT like you
suggest, while keeping the behavior of forward-sexp the way it is now.

If such a thing is done maybe forward-sexp-function should be used in
move-forward-sexp rather than in forward-sexp itself.

But then transpose-sexps should also be changed to use move-forward-sexp
since it should obey forward-sexp-function.

Patches are welcome, but I really hope they won't be part of the next
release, which is already about to enter its second year of so-called
"feature freeze".


        Stefan


_______________________________________________
Emacs-pretest-bug mailing list
Emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to