From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#48317: 27.1; text-property-search-forward moves point to end when not found Date: Wed, 12 May 2021 16:16:55 +0200 Message-ID: <878s4kjaug.fsf@gnus.org> References: <0ECAF0D9-7D8C-4BAA-AFFE-B76634BD0B28@gmail.com> <83o8dj7s48.fsf@gnu.org> <616F7732-ED83-40F0-A460-9298608EAD91@gmail.com> <83lf8n7q8d.fsf@gnu.org> <8877DDB9-7D2B-4DCC-8374-EB8391134EAC@gmail.com> <83fsyv7o4y.fsf@gnu.org> <87mtt3c62q.fsf@gnus.org> <4E8819BD-AA07-4870-8A90-98FB1F3D45E4@gmail.com> <87fsytpi1s.fsf@gnus.org> <53218944-7009-4BA7-AE3D-BF025EFD41AF@gmail.com> <87mtt1kz1j.fsf@gnus.org> <9D0AA29D-DE30-43D7-8109-84636A3D36F0@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7876"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 48317@debbugs.gnu.org To: Howard Melman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 12 16:30:24 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgpsW-0001kh-9z for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 May 2021 16:30:24 +0200 Original-Received: from localhost ([::1]:54988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgpsV-0000fe-Cd for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 May 2021 10:30:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgpga-00082H-22 for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:18:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgpgY-0005Kg-L9 for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgpgY-0001MY-Fc for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 May 2021 14:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48317 X-GNU-PR-Package: emacs Original-Received: via spool by 48317-submit@debbugs.gnu.org id=B48317.16208290285162 (code B ref 48317); Wed, 12 May 2021 14:18:02 +0000 Original-Received: (at 48317) by debbugs.gnu.org; 12 May 2021 14:17:08 +0000 Original-Received: from localhost ([127.0.0.1]:39988 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgpff-0001LC-NT for submit@debbugs.gnu.org; Wed, 12 May 2021 10:17:07 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:59078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgpfc-0001Kc-Q4 for 48317@debbugs.gnu.org; Wed, 12 May 2021 10:17:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OwIuDhOOsElkrJpLHBh+VGHZXKj2efj1GM1cwbgvJHM=; b=o90fWy/2R8Fem6OHyAMcx75fKP umWgtL7jFbpD/LWsdsq27N+9wDPO2VvrUf2MCSkqklxnfS37AH8DSWXQlfoVKpI6fmjyl9UdRR3dI vEBdNEx8mnnQO2I2NGRuprCfNvw66s0Sw690JMMLucdc7DYg1Kn4tQ0Q+wShEQRmLuFk=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgpfT-0005Qi-Qr; Wed, 12 May 2021 16:16:58 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEUMDR4pNFhoZ4P/ ///NGFFJAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+UFDA00AlWXEdEAAAGUSURBVCjPNVKxjtswDKUM y0A9eYgCJFvH5ivkAMnQSSlM46ApyxW1v+LQL3AB+9C7KQXsIOZX9lHXcqDwRL5nPdJEGs2FrvQ/ OKOgZ2WQdoVPl+YNyVmuFWYrkmX2G5yFoI85BqslcUrqQwUJMx6ooi9xSAKkYNe/5EldmXshS+7f V3cLyh/hoQldTzYQRIvVK3BM+4lbWRgt7QK2RLkLxNuVrEwdQNhoxSzMjDYDjueLfBdZAVpc16+f X+WhJhHJmVX7xVB4Y07JNrfeDNadEwhbb2Z7j2/pXdt6HguRyacKzVPxLuMCCd4e78OeZOnBCu1P GZ7IPkcYsuc/wj9gXyinp+K2n2bMT6oNddmNDiPA4+qow3zLm4JwosbEFxThw+p0vg4ZONZYNV4+ DgCUGwWZCNrKnBRQL3jXIfgESl3R2lRpvEd0uSvnutA0eef5pBsmk0YRj2CGOv0Jrr9gpLX7aIxj IGM7UsdN2Sh1NZ68a9+HHNT5mz2xLuUTmfNwd5zAmWz76/e2U7BeyMW6iQlI+Augmnr0p6VtjgAA ACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wNS0xMlQxMzo1MjowMiswMDowMOfAgUYAAAAldEVYdGRh dGU6bW9kaWZ5ADIwMjEtMDUtMTJUMTM6NTI6MDIrMDA6MDCWnTn6AAAAAElFTkSuQmCC X-Now-Playing: Bertine Zetlitz's _Morbid Latenight Show_: "Butcher's Son" In-Reply-To: <9D0AA29D-DE30-43D7-8109-84636A3D36F0@gmail.com> (Howard Melman's message of "Tue, 11 May 2021 15:28:48 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206328 Archived-At: Howard Melman writes: > To me, this function behaves unexpectedly different in these cases > (say in a font-locked elisp buffer just before the last defun): > > ;; a region with property face is found, > ;; point is moved to the end of it > (text-property-search-forward 'face) The doc string in Emacs 27 is misleading, because it doesn't emphasise the meaning of PREDICATE. What the form above does is look for areas where there's a text property named `face' that uses the nil predicate on a nil value. :-) That is, it finds all areas where the `face' property is not nil -- VALUE is nil, and PREDICATE is nil. > ;; a region with the specfied face is found, > ;; point is moved to the beginning of it > (text-property-search-forward 'face 'font-lock-function-name-face) No, here you're looking for regions where `face' is not `font-lock-function-name-face' -- which will indeed leave you at the start of the region where `face' is `font-lock-function-name-face', but that's not really what the function matched. But I understand your confusion now. The function searches for areas where a text property is matching something (according to PREDICATE), and leaves point at the end of the match. You, instead, expect it to leave point at the start of the match, which is the opposite of what it does. Hm... Oh! That's wrong in the doc string, too -- it says that it moves point to the start of the region, which it certainly doesn't. I've now fixed this in the two doc strings. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no