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

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> easy-emacs.de>

Date: Mon, 13 May 2019 07:19:01 UTC

Severity: wishlist

Tags: notabug, wontfix

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 35708 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 35708 <at> debbugs.gnu.org
Subject: Re: bug#35708: [27.0.50]: thingatpt.el, thing-at-point-looking-at
 redundant
Date: Mon, 13 May 2019 20:31:54 +0200
On 13.05.19 14:41, Noam Postavsky wrote:
> Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:
>
>> as result of ‘thing-at-point-looking-at’ finally is delivered by
>> ‘looking-at’,
>> don't see any sense in calling ‘re-search-forward’ first.
> The test added below fails if the re-search-forward in
> thing-at-point-looking-at is commented out.  Does that tell you what the
> "sense" is?
>

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)))






This bug report was last modified 5 years and 362 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.