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

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

bug#35708: [27.0.50]: thingatpt.el, thing-at-point-looking-at redundant


From: npostavs
Subject: bug#35708: [27.0.50]: thingatpt.el, thing-at-point-looking-at redundant
Date: Mon, 13 May 2019 15:25:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt)

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> Thought at something like below, which should pass the test:
>
> (defun ar-thing-at-point-looking-at (regexp)
>   "Return t if regexp matches at or before point, nil otherwise."
>   (save-excursion
>       (while (not (or (looking-at regexp)(bolp)))
>       (forward-char -1))
>       (looking-at regexp)))

I think it's an optimization to use re-search-backward instead of moving
on character at a time and calling looking-at in lisp.







reply via email to

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