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

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

Re: backward-up-list


From: Stefan Monnier
Subject: Re: backward-up-list
Date: Mon, 16 Oct 2006 18:19:05 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>> (while (in-string-p)
>>>   (backward-char 1))
>> 
>> That's the way a snail would do it,
>> 
>> (goto-char (or (nth 8 (syntax-ppss)) (point)))
>> 
>> would be faster and solve the same problem with comments at the same time.

> However, I'm not convinced here.

> in-string-p is very clear and short written.

> (defun in-string-p ()
>  (let ((orig (point)))
>    (save-excursion
>      (beginning-of-defun)
>      (nth 3 (parse-partial-sexp (point) orig)))))

> With syntax-ppss there are a lot of lines, hardly to
> follow.  Altogether it ends up with the same
> core-function or at least calls it:

> (setq ppss (parse-partial-sexp pt-min pos nil nil ppss))

> So I doubt it being faster.

You seem to have missed the point: my code has no loop.


        Stefan




reply via email to

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