From unknown Sat Jun 21 03:07:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#40053 <40053@debbugs.gnu.org> To: bug#40053 <40053@debbugs.gnu.org> Subject: Status: 28.0; text-property-search-forward skips first region Reply-To: bug#40053 <40053@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:07:22 +0000 retitle 40053 28.0; text-property-search-forward skips first region reassign 40053 emacs submitter 40053 Dustin Lacewell severity 40053 normal tag 40053 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 13 13:35:42 2020 Received: (at submit) by debbugs.gnu.org; 13 Mar 2020 17:35:42 +0000 Received: from localhost ([127.0.0.1]:60208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCoDm-0001Wi-KZ for submit@debbugs.gnu.org; Fri, 13 Mar 2020 13:35:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:39286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCoDk-0001Wa-Qq for submit@debbugs.gnu.org; Fri, 13 Mar 2020 13:35:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40232) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCoDi-0000k1-P7 for bug-gnu-emacs@gnu.org; Fri, 13 Mar 2020 13:35:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_60,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCoDh-0007Kw-PS for bug-gnu-emacs@gnu.org; Fri, 13 Mar 2020 13:35:38 -0400 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:42153) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jCoDh-0007IN-IY for bug-gnu-emacs@gnu.org; Fri, 13 Mar 2020 13:35:37 -0400 Received: by mail-qk1-x732.google.com with SMTP id e11so13857796qkg.9 for ; Fri, 13 Mar 2020 10:35:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=HCNPZ1yWNGJzbwl2MBMYK3dQd5KJsj8Y0f77TKiPEyQ=; b=FAGRgj+E7MqZtkWDuqPXp8y5iLZZeOpFf82pPjQ8mcAuV7xZO5r8mTOyJYxNvbkqCU tIKPKnfnWwbNHA+O8mWBk0ujK73XYzL3ZVYtL57hiqjmkY2vdXNzFvvlRiRQgQKrpVwb PoX85+3nXtTlFWukNrSaEn41Fo/ByjLAZ6Hf4+/swS4AQYwuecoAt43jCV/mDfAGF+eo dc9vZKTS7Mrq0caBNyo4UlcbixD/9ld+PxJ/MSblq1d3RssXDzs76/ESPbIo0e8hvAal yXFYLxTAbhutkcBkwNzD0mmGlYl95ZA3jpa0AqY20mP3Czja5BGXLoHqTIYJ3LeyCe7a 9NtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=HCNPZ1yWNGJzbwl2MBMYK3dQd5KJsj8Y0f77TKiPEyQ=; b=J7+JRjQEKCVpIDwNme4Ota1oDID8NLFrdryxdw4lNO4j8ll5iHpAO+X0UyY64iSNb9 RiVGCnFiC4L8Elc5civjnUxZ2pXHUhtXTpdXXSJsJBJ9r10tPHir9b87qqRV+LYgCeOf BqECRKtoV3lxJU7ngKZIFMqbc/iYdhbLzIoxrNFtTgx3NT7S4VeEDpmLXcY88Jt1wTNB 8Bh9+t5y/erkGUPhAbBMKkDH2XSa9w/cr4llZwT4ZbAjG3+/yVT7DlZhIwMjl3rajMvh MSSztu2kRzOHF8tdgJ24pKHy4LrAR2inwam1s1mc5ekmX8/RCMBl6HlUsN+UxokHlgGU bcng== X-Gm-Message-State: ANhLgQ3O4BIsnv/i1V7XoANAD5uo3DhhFt7j2zDAlq1BfNlkJE2U4kqG GGhiKOtWWqiIqgW8C8H9AiegOojPHFcqZEpNughhBJakmhg= X-Google-Smtp-Source: ADFU+vvDxPUn4Mkk4MONPIKXinmWJESn3xImEpV10N3DEI/raCXR3wB+8PXsVyl67GJ5vu1tWsJoXwpblJFXnHRd0Lo= X-Received: by 2002:a37:496:: with SMTP id 144mr13955757qke.403.1584120936093; Fri, 13 Mar 2020 10:35:36 -0700 (PDT) MIME-Version: 1.0 From: Dustin Lacewell Date: Fri, 13 Mar 2020 12:35:25 -0500 Message-ID: Subject: 28.0; text-property-search-forward skips first region To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000ad68f305a0bfe545" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::732 X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --000000000000ad68f305a0bfe545 Content-Type: text/plain; charset="UTF-8" The following code does not do what I would expect: (with-current-buffer (get-buffer-create "*Test*") (erase-buffer) (insert " ") (insert-text-button "Button1" 'foo 'bar) (insert " ") (insert-text-button "Button2" 'foo 'bar) (beginning-of-buffer) (text-property-search-forward 'foo 'bar nil t) (display-buffer (current-buffer))) I would expect the point to land on the first button. However, it lands on the second. --000000000000ad68f305a0bfe545 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The following code does not do what I would expect:
(with-current-buffer (get-buffer-create "*Test*")=C2=A0 (erase-buffer)
=C2=A0 (insert " =C2=A0 ")
=C2=A0 (i= nsert-text-button "Button1"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'foo 'bar)
=C2=A0 (in= sert " =C2=A0 ")
=C2=A0 (insert-text-button "Button2"= ;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 'foo 'bar)
=C2=A0 (beginning-of-buffer)
=C2=A0 (text-p= roperty-search-forward 'foo 'bar nil t)
=C2=A0 (display-buffer (= current-buffer)))

I would expect the point to = land on the first button. However, it lands on the second.
--000000000000ad68f305a0bfe545-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 13 14:46:39 2020 Received: (at 40053) by debbugs.gnu.org; 13 Mar 2020 18:46:39 +0000 Received: from localhost ([127.0.0.1]:60233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCpKR-0003NP-7N for submit@debbugs.gnu.org; Fri, 13 Mar 2020 14:46:39 -0400 Received: from mout.gmx.net ([212.227.17.21]:51795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCpKP-0003NA-Bi for 40053@debbugs.gnu.org; Fri, 13 Mar 2020 14:46:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1584125190; bh=TPOMXqPbRMzlNzirZ2ja6Uf7YrpF/Ly9DpmN6Ga5XUo=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=cmWL31/wisXxu+ICPuFtyl9n5bN3bYCS3dPcOjSY9DgrPktr/kOT4cMGmeLx8hgrA /SaeswCXxB2Rznl6z0RyunbDuvr/b+cEHcWIKrYdRFTyLks5FVjZr9ovwfTNPK3GpP fLpz1SRlkJaHji3toMIT4Cp83xhyC7sHK6XO1kug= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from strobe-lfs84 ([178.6.220.14]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M2wKq-1jBjOk2YZQ-003JAn; Fri, 13 Mar 2020 19:46:30 +0100 From: Stephen Berman To: Dustin Lacewell Subject: Re: bug#40053: 28.0; text-property-search-forward skips first region References: Date: Fri, 13 Mar 2020 19:46:29 +0100 In-Reply-To: (Dustin Lacewell's message of "Fri, 13 Mar 2020 12:35:25 -0500") Message-ID: <87h7ysgkje.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Ezonxms/lCvEEu4dFhX4//rPiY8rvoemRcM2W2ylM7Zdc2XZoM4 rXFth1YcOMXMDpy0dcMp6voWdcYVNonM9kQprjOTDmovcGTfH3iWH1FbLZGSBgknHcL4Bys hOzX+8qcRr4ljoxQbLrtmBzG7xyRAF/l0iE22pW2jFJzOZv+mY1+x6dcMUnWPNqCj3x1wc3 RoIVgauZvsC0Ty726s1mQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:gz9QZp/aFh0=:sj7/Oq5KJ0J622aqQABXkn 8xO9gh7MGoyO18nTCGSgjAscqppEUiA6C38Tvu6E+7FbiF47SAjW/18/QimisIuHtOiZKRONi RjtvrALoUK/pWqNYYuYz4e62DxlNhap+ExkgF48eTZW77StD3Gp8IMKuP6+S6uch0rwQzawlW MFi8/jA3tqs4dXL40i6TfbZ6oysreHLZ6HIafGCW7IBmM3VDKDVhEfKqj+KwS+380sWteFet2 cxLaTp4rP4WYXYJd0dv+Mxu0r44Wpt2b1iiBzuwIBtWkHnDJkfAzc/zXV/m37qeBSwKBCu503 uqyRBZTw8fRx1+Z2h9J4wjxD2kNrEHkD6RuCOPl9SOfJVsKd0ASv2tfKMdni8QVDpoitK7md7 D3484C43st8QPzmoeIz9xxPUB5PlzSfAjzbId+hktmTg6SLsdi5cFffKbzJaCuWJXpq3hQa8I eLeD93dqJoPBEr8lx5T/4N1M7S+VZl98NDJuQZ+mBsm/4qcL2EyB5XKhz1lctPbEv1XDMfeZR AkXVLJv3DGm9lRMGMCDKw0SpQjr84UrIXo61GzwithPihFg9X+CTN1VT4xvpVUBr1Do6W3j+p KeVQORGAltWEwx882N+0EI7y4x9EOkcBm6lK6MESVwAibstZPAUdqquR1/wd3IdcwrnCCSKFs K6bB/gP/xlthBmKLSPmnznUycwKgdaHdvdMm4fqOzbJu6WvY1gjFms2G8PQBDvqVXyosg62eD fRfigHae0ncK4Qrmnspvt2nbmg8LSxdjCLS3FEPOInghpGbVq9xG9xS0RuZ/+Bi7TUyOjBYV6 123cEYXD34xqj6ov+llciRIR0MZPy47RJh2d89HHX2Z3bGBJEm4nxaUhaOz3eqETbLr/BZpVe SeQkcF1SN9inWkM70BAKIDVC15BsdvqFRuwHVmeWczkY6o2QoHgZoq9PKsuvDw2Ydt/YA7Ums AutpPeNcx4SRw5+9deGazmRFs23YuVsrFs3n0/X3kZWX3riuBwfNNT+W9B87+PHTnqvhB20H+ xkrIG3O/uk50jAKNL+T2xwk4NrRzeJ6G9fje7yXUMBPTXMG1jWz8xVSMJW78YyvRnHTnZk/Q4 8NJfy5NJWnV2H+YZH5jqkEHHpovIsl+t1gpVl/MHdPKzceVS5uTuuGUUpMmNzOdtEuppSShJT 2tCWOQ5kyAofclpOGbT3Z3CV3q7eDVSaI+2/DxCzwVVGVPZYu5THMoFa5zvJpJMLXjL2TnXoJ 3sWWntIneuaFUpS5c X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40053 Cc: 40053@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Fri, 13 Mar 2020 12:35:25 -0500 Dustin Lacewell wrote: > The following code does not do what I would expect: > > (with-current-buffer (get-buffer-create "*Test*") > (erase-buffer) > (insert " ") > (insert-text-button "Button1" > 'foo 'bar) > (insert " ") > (insert-text-button "Button2" > 'foo 'bar) > (beginning-of-buffer) > (text-property-search-forward 'foo 'bar nil t) > (display-buffer (current-buffer))) > > I would expect the point to land on the first button. However, it > lands on the second. Actually, if text-property-search-forward succeeds it moves to the end of the propertized region, so in this case, just after the first button. And that's what happens with this sexp: (text-property-search-forward 'foo 'bar t t) But you've called it with the argument PREDICATE nil, which means the search succeeds if the value of the propertized text does not match the VALUE argument, i.e. in this case if 'bar does not match 'bar. Since this is false, the search stops, leaving point at the last position where the value of 'foo changed, which is the beginning of the second button. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 14 07:38:02 2020 Received: (at 40053) by debbugs.gnu.org; 14 Mar 2020 11:38:02 +0000 Received: from localhost ([127.0.0.1]:60656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jD57C-0008Cl-Dv for submit@debbugs.gnu.org; Sat, 14 Mar 2020 07:38:02 -0400 Received: from quimby.gnus.org ([95.216.78.240]:56158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jD57A-0008CD-Ke for 40053@debbugs.gnu.org; Sat, 14 Mar 2020 07:38:01 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jD572-0001Jm-0h; Sat, 14 Mar 2020 12:37:54 +0100 From: Lars Ingebrigtsen To: Stephen Berman Subject: Re: bug#40053: 28.0; text-property-search-forward skips first region References: <87h7ysgkje.fsf@gmx.net> Date: Sat, 14 Mar 2020 12:37:51 +0100 In-Reply-To: <87h7ysgkje.fsf@gmx.net> (Stephen Berman's message of "Fri, 13 Mar 2020 19:46:29 +0100") Message-ID: <87v9n7181c.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stephen Berman writes: > But you've called it with the argument PREDICATE nil, which means the > search succeeds if the value of the propertized text does not match the > VALUE argument, i.e. in this case if 'bar does not m [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: ingebrigtsen.no] -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40053 Cc: Dustin Lacewell , 40053@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stephen Berman writes: > But you've called it with the argument PREDICATE nil, which means the > search succeeds if the value of the propertized text does not match the > VALUE argument, i.e. in this case if 'bar does not match 'bar. Since > this is false, the search stops, leaving point at the last position > where the value of 'foo changed, which is the beginning of the second > button. Yup. So I don't think there's any bug here, and I'm closing this bug report. If there's still something to fix here, respond, and the bug report will be reopened. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 14 07:38:08 2020 Received: (at control) by debbugs.gnu.org; 14 Mar 2020 11:38:08 +0000 Received: from localhost ([127.0.0.1]:60659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jD57H-0008D2-Ni for submit@debbugs.gnu.org; Sat, 14 Mar 2020 07:38:07 -0400 Received: from quimby.gnus.org ([95.216.78.240]:56174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jD57G-0008CN-AR for control@debbugs.gnu.org; Sat, 14 Mar 2020 07:38:06 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jD578-0001Jy-P8 for control@debbugs.gnu.org; Sat, 14 Mar 2020 12:38:00 +0100 Date: Sat, 14 Mar 2020 12:37:57 +0100 Message-Id: <87tv2r1816.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #40053 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 40053 notabug close 40053 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 40053 notabug close 40053 quit From unknown Sat Jun 21 03:07:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 12 Apr 2020 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator