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

From: "N. Raghavendra" <[email-masked]>
Date: Fri, 22 Sep 2017 23:18:22 +0530

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
carefully.

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

Regards,
Raghu.

-- 
N. Raghavendra <[email-masked]>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/