> but in things like font-lock it seems slow compared to a > regexp. I have not found a reliable regexp approach though. say > I want to search back for "cite:" with point at the ^ position > below:
> some text cite:a-key > ^ > If I run (re-search-backward "cite:") at the point above, it does not go to > the point 2 characters back. > Any ideas? Given this setting: some more text cite:a-key some text cite:a-key ^ When you run (re-search-backward "cite:") at the point above, the result is as follows: some more text cite:a-key some text cite:a-key ^ This is exactly what I expected it to act. In your example above, the whole search pattern could not be found in ist entirety from the indicated point on, so it could not be found at all and point is not moved. Maybe it is a good idea to move point forward for at least count of chars in search pattern before the search executes? Greets, Jens Haustedt