unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "N. Raghavendra" <raghu@hri.res.in>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 28428@debbugs.gnu.org
Subject: bug#28428: comment-search-backward with no comments
Date: Fri, 22 Sep 2017 23:18:22 +0530	[thread overview]
Message-ID: <87poaieiah.fsf@hri.res.in> (raw)
In-Reply-To: <jwv1smywv0z.fsf-monnier+bug#28428@gnu.org> (Stefan Monnier's message of "Fri, 22 Sep 2017 12:40:58 -0400")

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 <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/





  reply	other threads:[~2017-09-22 17:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 22:37 bug#28428: comment-search-backward with no comments N. Raghavendra
2017-09-22 16:40 ` Stefan Monnier
2017-09-22 17:48   ` N. Raghavendra [this message]
2017-09-22 19:26     ` Stefan Monnier
2017-09-22 20:31       ` N. Raghavendra
2017-09-23 21:07         ` Stefan Monnier
2017-09-24  0:26           ` N. Raghavendra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87poaieiah.fsf@hri.res.in \
    --to=raghu@hri.res.in \
    --cc=28428@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).