|
From: | Vinicius Jose Latorre |
Subject: | Re: Possible problem with looking-back function |
Date: | Thu, 19 Aug 2010 23:11:29 -0300 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6 |
Shouldn't it return 1?The algorithm searches backward until it finds a position from which there is a match that extends to point. Doing more would be quadratic in the value of point (at least), so is considered too slow.
Ok, so looking-back should be replaced by: (progn (goto-char 11) ; go to end of buffer ;; ---- looking-back replacement --- BEGIN (save-excursion (when (/= 0 (skip-chars-backward " \t\n" 1)) (unless (bolp) (forward-line 1)) (looking-at "^\\([ \t\n]+\\)"))) ;; ---- looking-back replacement --- END (match-beginning 1)) Now it returns 1.
[Prev in Thread] | Current Thread | [Next in Thread] |