[Top][All Lists]

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

bug#28428: comment-search-backward with no comments

From: N. Raghavendra
Subject: bug#28428: comment-search-backward with no comments
Date: Fri, 22 Sep 2017 23:18:22 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux)

At 2017-09-22T12:40:58-04:00, Stefan Monnier wrote:

> That looks fine, thank you.  But I think the simpler patch below works
> as well:
>     -  (if (not (re-search-backward comment-start-skip limit t))
>     +  (if (not (re-search-backward comment-start-skip limit 'move))

That's indeed nicer!  Thanks for pointing out that the NOERROR arg of
`re-search-backward' can be given a value outside {t,nil} to move point
to LIMIT.  It's a lesson to myself that I should read docstrings more

> I wonder if there's code out there that depends on this behavior, tho,
> since AFAIK it's been behaving this way "forever".

As you say, it doesn't really matter; it's just that there is a
discrepancy between the docstring specification of the effects of the
function and the said effects, which would be good to remove.

I came across it because I've been playing around with a major mode
based on AUCTeX, and was writing ERT tests for some initialisation code
I was using from AUCTeX.  Perhaps such tests are the only places where
these trivial errors matter.


N. Raghavendra <address@hidden>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/

reply via email to

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