GNU bug report logs -
#36486
[PATCH] Add tests for text-property-search to check prop-match-value
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Wed, 3 Jul 2019 09:45:01 UTC
Severity: wishlist
Tags: fixed, patch
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #15 received at 36486 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
>> 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:
[text-property-search-value.patch (text/x-diff, inline)]
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)
This bug report was last modified 6 years and 2 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.