From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "N. Raghavendra" Newsgroups: gmane.emacs.bugs Subject: bug#28428: comment-search-backward with no comments Date: Fri, 22 Sep 2017 23:18:22 +0530 Message-ID: <87poaieiah.fsf@hri.res.in> References: <87377seua8.fsf@ailuros> Reply-To: "N. Raghavendra" NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1506102558 7536 195.159.176.226 (22 Sep 2017 17:49:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 22 Sep 2017 17:49:18 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: 28428@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 22 19:49:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvS4d-0001RI-BJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Sep 2017 19:49:11 +0200 Original-Received: from localhost ([::1]:60407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvS4h-0001WF-IT for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Sep 2017 13:49:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvS4Z-0001VA-EU for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 13:49:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvS4U-0008Ki-77 for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 13:49:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44498) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dvS4U-0008KT-3C for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 13:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dvS4T-0001uO-N2 for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 13:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "N. Raghavendra" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Sep 2017 17:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28428 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28428-submit@debbugs.gnu.org id=B28428.15061025127297 (code B ref 28428); Fri, 22 Sep 2017 17:49:01 +0000 Original-Received: (at 28428) by debbugs.gnu.org; 22 Sep 2017 17:48:32 +0000 Original-Received: from localhost ([127.0.0.1]:53179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvS40-0001td-Mg for submit@debbugs.gnu.org; Fri, 22 Sep 2017 13:48:32 -0400 Original-Received: from sub5.mail.dreamhost.com ([208.113.200.129]:54161 helo=homiemail-a118.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvS3y-0001tU-D4 for 28428@debbugs.gnu.org; Fri, 22 Sep 2017 13:48:31 -0400 Original-Received: from homiemail-a118.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a118.g.dreamhost.com (Postfix) with ESMTP id CDA9A60002003; Fri, 22 Sep 2017 10:48:27 -0700 (PDT) Original-Received: from retrotexts.net (www.hri.res.in [220.227.103.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: raghu@retrotexts.net) by homiemail-a118.g.dreamhost.com (Postfix) with ESMTPSA id 7202E60002002; Fri, 22 Sep 2017 10:48:27 -0700 (PDT) Original-Received: by retrotexts.net (Postfix, from userid 1000) id 1F79024005B0; Fri, 22 Sep 2017 23:18:22 +0530 (IST) In-Reply-To: (Stefan Monnier's message of "Fri, 22 Sep 2017 12:40:58 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137248 Archived-At: 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 , http://www.retrotexts.net/ Harish-Chandra Research Institute, http://www.hri.res.in/