[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/urgrep 55b0030cf9 061/115: Improve regexes to match res
From: |
ELPA Syncer |
Subject: |
[elpa] externals/urgrep 55b0030cf9 061/115: Improve regexes to match result/context lines |
Date: |
Wed, 10 May 2023 03:00:44 -0400 (EDT) |
branch: externals/urgrep
commit 55b0030cf9668a01bb6abae6d22e27b57c41b93b
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>
Improve regexes to match result/context lines
---
urgrep.el | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/urgrep.el b/urgrep.el
index 968d125849..ee8f67b280 100644
--- a/urgrep.el
+++ b/urgrep.el
@@ -591,7 +591,7 @@ If EDIT-COMMAND is non-nil, the search can be edited."
"]"))
(defvar urgrep-mode-font-lock-keywords
- '(("^Urgrep started.*"
+ `(("^Urgrep started.*"
(0 '(face nil compilation-message nil help-echo nil mouse-face nil) t))
("^Urgrep finished with \\(?:\\(\\(?:[0-9]+ \\)?match\\(?:es\\)?
found\\)\\|\\(no matches found\\)\\).*"
(0 '(face nil compilation-message nil help-echo nil mouse-face nil) t)
@@ -602,11 +602,17 @@ If EDIT-COMMAND is non-nil, the search can be edited."
(1 'compilation-error)
(2 'compilation-error nil t))
;; Highlight context lines of various flavors.
- ("^\\(?:.+?\\([:-=\0]\\)\\)?[1-9][0-9]*\\([-=]\\).*\n"
- (0 'urgrep-context)
- (1 (if (eq (char-after (match-beginning 1)) ?\0)
- `(face nil display ,(match-string 2)))
- nil t))
+ (,(concat
+ "^\\(?:"
+ ;; Parse using a null terminator after the filename when possible.
+ "[^\0\n]+\\(\0\\)[0-9]+"
+ "\\|"
+ ;; Fallback if we can't use null terminators after the filename.
+ ;; Use [1-9][0-9]* rather than [0-9]+ to allow ":0" in filenames.
+ "\\(?:[^\n]*?[^\n/][:=-]\\)?[1-9][0-9]*"
+ "\\)\\([=-]\\).*$")
+ (0 'urgrep-context t)
+ (1 `(face nil display ,(match-string 2)) nil t))
;; Hide excessive part of rgrep command.
("^find \\(\\. -type d .*\\(?:\\\\)\\|\")\"\\)\\)"
(1 (if grep-find-abbreviate grep-find-abbreviate-properties
@@ -651,12 +657,12 @@ versions, it's half-open. Use this to adjust the value
as needed in
(,(concat
"^\\(?:"
;; Parse using a null terminator after the filename when possible.
- "\\(?1:[^\0\n]+\\)\\(?3:\0\\)\\(?2:[0-9]+\\):"
+ "\\(?1:[^\0\n]+\\)\\(?3:\0\\)\\(?2:[0-9]+\\)"
"\\|"
;; Fallback if we can't use null terminators after the filename.
- ;; Use [1-9][0-9]* rather than [0-9]+ to allow ":034:" in file names.
- "\\(?1:[^\n:]+?[^\n/:]\\):[\t ]*\\(?2:[1-9][0-9]*\\)[\t ]*:"
- "\\)")
+ ;; Use [1-9][0-9]* rather than [0-9]+ to allow ":0" in filenames.
+ "\\(?1:[^\n]+?[^\n/]\\):\\(?2:[1-9][0-9]*\\)"
+ "\\):")
1 2 (,#'urgrep--column-begin . ,#'urgrep--column-end)
nil nil
(3 '(face nil display ":")))
- [elpa] externals/urgrep 026c54d11e 012/115: Add support for setting context, (continued)
- [elpa] externals/urgrep 026c54d11e 012/115: Add support for setting context, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep ca67ad1f4d 030/115: Use isearch-like bindings in the urgrep minibuffer, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 8bb469a526 036/115: Add some details about our buffer-local variables, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 9ff22a4481 041/115: Minor fixes to defcustoms, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep c879c02558 040/115: Add some docs and clean up spacing, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 5b792fe0de 045/115: Use symbols instead of strings for `urgrep-tools' keys, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 3dde21c501 047/115: Add `urgrep-setup-hook', ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep f686c2baa3 051/115: Fix off-by-one error with matches in Emacs 28; see Emacs bug#49624, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep a9c1a98ea6 052/115: Prompt for directory first with 'C-u C-u M-x urgrep', ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 3002fdf731 054/115: Add support for specifying executable path in 'urgrep-preferred-tools', ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 55b0030cf9 061/115: Improve regexes to match result/context lines,
ELPA Syncer <=
- [elpa] externals/urgrep f354b44121 059/115: Always filter filenames in 'urgrep-filter', ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 9e1f4da53b 070/115: Reorder keyword arguments to be more logical, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 0687d9e867 073/115: Update copyright, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep ce07e97d37 088/115: Allow ANSI escapes for matches to end just after a newline, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep dbb2c2caeb 095/115: Wrap some docstring lines with "\", ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 9949a5b296 094/115: Use connection-local variables for caching the tool to use for each host, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 569c52f504 083/115: Allow overriding EMACS during tests, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep d479dc5ad6 104/115: Remove unnecessary/wrong Git grep color settings, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep d0012b9fcb 112/115: Tweak tests so they only work around Emacs bug#58265 on older versions, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 392e4bcb98 008/115: Don't inherit from compilation-minor-mode to avoid its menu, ELPA Syncer, 2023/05/10