From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#36486: [PATCH] Add tests for text-property-search to check prop-match-value Date: Mon, 08 Jul 2019 01:59:22 +0300 Organization: LINKOV.NET Message-ID: <87pnmlzbzt.fsf@mail.linkov.net> References: <87pnmndyu8.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="158612"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 36486@debbugs.gnu.org, Stefan Kangas To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 08 01:03:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkGBa-000f7F-19 for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2019 01:03:10 +0200 Original-Received: from localhost ([::1]:37398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkGBY-0002n9-At for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Jul 2019 19:03:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33274) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkGBT-0002mq-C0 for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 19:03:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkGBS-0000e7-Dm for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 19:03:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48711) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkGBS-0000dx-3x for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 19:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkGBR-0004c4-W8 for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 19:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Jul 2019 23:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36486 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch fixed Original-Received: via spool by 36486-submit@debbugs.gnu.org id=B36486.156254057617715 (code B ref 36486); Sun, 07 Jul 2019 23:03:01 +0000 Original-Received: (at 36486) by debbugs.gnu.org; 7 Jul 2019 23:02:56 +0000 Original-Received: from localhost ([127.0.0.1]:57531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkGBM-0004be-5Q for submit@debbugs.gnu.org; Sun, 07 Jul 2019 19:02:56 -0400 Original-Received: from bird.elm.relay.mailchannels.net ([23.83.212.17]:18101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkGBK-0004bV-8J for 36486@debbugs.gnu.org; Sun, 07 Jul 2019 19:02:55 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id BE2C7501450; Sun, 7 Jul 2019 23:02:52 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com (100-96-8-155.trex.outbound.svc.cluster.local [100.96.8.155]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 4BCFE5012E4; Sun, 7 Jul 2019 23:02:51 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.3); Sun, 07 Jul 2019 23:02:52 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Daffy-Ski: 622e59050cdd9ce4_1562540572583_3023426718 X-MC-Loop-Signature: 1562540572583:603557842 X-MC-Ingress-Time: 1562540572582 Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a86.g.dreamhost.com (Postfix) with ESMTP id 0D07E80172; Sun, 7 Jul 2019 16:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=vAuKkecTGR7omYnsgKWgxtzg3PI=; b= VotRsi5sCjILNOThWxjenK3CpjF3lxaVikLEapkxamDWY1D7PlS6hP4OY0WdE8MC Sa1g3Y7FvVa30dAq6qnYjjK8a3OLjwNWzyLNWUPeAUXN/LpmlQoq+oC2BKxule16 TZDPffSrnce3/1BTfCDakzt9e4QBnY7rJXcqnePCr6U= Original-Received: from mail.jurta.org (m91-129-109-127.cust.tele2.ee [91.129.109.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a86.g.dreamhost.com (Postfix) with ESMTPSA id BA9BE80179; Sun, 7 Jul 2019 16:02:43 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a86 In-Reply-To: <87pnmndyu8.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Sat, 06 Jul 2019 16:25:35 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrfeelgddugecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtledruddvjeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdelrdduvdejpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheplhgrrhhsihesghhnuhhsrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd 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: 209.51.188.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:162306 Archived-At: --=-=-= Content-Type: text/plain >> Attached is a patch with additional test cases for >> text-property-search which checks the returned match object. Unlike >> older test cases, these also check the value of prop-match-value. > > Looks good; I've now applied them to the trunk. BTW, I tried to use text-property-search as a command interactively, but it lacks support for reading the second argument VALUE. Here is the patch that implements it: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=text-property-search-value.patch diff --git a/lisp/emacs-lisp/text-property-search.el b/lisp/emacs-lisp/text-property-search.el index 41ca07057e..5027bc406c 100644 --- a/lisp/emacs-lisp/text-property-search.el +++ b/lisp/emacs-lisp/text-property-search.el @@ -54,10 +54,14 @@ text-property-search-forward that's matching), and `prop-match-value' (the value of PROPERTY at the start of the region)." (interactive - (list - (let ((string (completing-read "Search for property: " obarray))) - (when (> (length string) 0) - (intern string obarray))))) + (let* ((property (completing-read "Search for property: " obarray)) + (property (when (> (length property) 0) + (intern property obarray))) + (value (when property + (completing-read "Search for property value: " obarray))) + (value (when (> (length value) 0) + (intern value obarray)))) + (list property value))) (cond ;; No matches at the end of the buffer. ((eobp) --=-=-=--