emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] scratch/mheerdegen-preview 2ec7a9e 22/35: WIP: More colorful matc


From: Michael Heerdegen
Subject: [elpa] scratch/mheerdegen-preview 2ec7a9e 22/35: WIP: More colorful match count
Date: Mon, 29 Oct 2018 22:24:07 -0400 (EDT)

branch: scratch/mheerdegen-preview
commit 2ec7a9eb3a01251126f4c2f879be249a2090c4e0
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>

    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 4e403b3..b0af521 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -2586,17 +2586,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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]