Subject: Re: bug#36486: [PATCH] Add tests for text-property-search to check prop-match-value

From: Juri Linkov <[email-masked]>
Date: Mon, 08 Jul 2019 01:59:22 +0300

>> 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:

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)