branch: scratch/mheerdegen-preview commit a1b10395af79ce3ea2590ba2a5d7f26dc852d85c Author: Michael Heerdegen <michael_heerde...@web.de> Commit: Michael Heerdegen <michael_heerde...@web.de>
WIP: More colorful match count --- packages/el-search/el-search.el | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index 0e19b84..3bea82f 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -2582,17 +2582,23 @@ created.") buffer-or-file matches-<=-here total-matches - (propertize - (format (pcase (save-excursion - (goto-char (car defun-bounds)) - (el-search-read (current-buffer))) - (`(,a ,b . ,_) (format "(%s %%d/%%d)" - (truncate-string-to-width - (format "%S %S" a b) - 40 nil nil 'ellipsis))) - (_ "(%d/%d)")) - matches-<=-here-in-defun total-matches-in-defun) - 'face 'shadow)))) + (format + (pcase (save-excursion + (goto-char (car defun-bounds)) + (and (el-search-looking-at '`(,_ ,_ . ,_)) + (let ((region (list + (progn (down-list) (point)) + (min (line-end-position) + (scan-sexps (point) 2))))) + (apply #'jit-lock-fontify-now region) + (apply #'buffer-substring region)))) + ((and (pred stringp) signature) + (format "(%s %%d/%%d)" + (truncate-string-to-width + signature + 40 nil nil 'ellipsis))) + (_ "(%d/%d)")) + matches-<=-here-in-defun total-matches-in-defun)))) (list (concat (if (not just-count) "[Not at a match] " "") (if (= matches-<=-here total-matches)