[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/urgrep e9e70552db 057/115: Use 'format-prompt' if avail
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/urgrep e9e70552db 057/115: Use 'format-prompt' if available |
|
Date: |
Wed, 10 May 2023 03:00:43 -0400 (EDT) |
branch: externals/urgrep
commit e9e70552dbc9736fbec64c660d1b9ea73780231b
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>
Use 'format-prompt' if available
---
urgrep.el | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/urgrep.el b/urgrep.el
index 3a3a02558b..cc75058a7e 100644
--- a/urgrep.el
+++ b/urgrep.el
@@ -103,6 +103,17 @@ The currently-used tool can be inspected from the hook via
;; Urgrep utility functions
+;; `format-prompt' was added in Emacs 28.1.
+(defalias 'urgrep--format-prompt
+ (if (fboundp 'format-prompt)
+ #'format-prompt
+ (lambda (prompt default &rest format-args)
+ (concat
+ (apply #'format prompt format-args)
+ (when default
+ (format " (default %s)" default))
+ ": "))))
+
(defun urgrep--convert-regexp (expr from-syntax to-syntax)
"Convert the regexp EXPR from FROM-SYNTAX to TO-SYNTAX."
(cond ((and (not (eq from-syntax to-syntax))
@@ -773,16 +784,16 @@ point."
"Return the prompt to use when asking for the search query.
This depends on the current values of various urgrep options. DEFAULT
indicates the default query, if any."
- (concat "Search "
- (if urgrep-search-regexp "regexp" "string")
- (let ((block (append `(,#'pcase ',urgrep-context-lines)
- urgrep--context-arguments)))
- (mapconcat (lambda (i) (concat " " i)) (eval block t) ""))
- (when urgrep-file-wildcards
- (format " in %s" (mapconcat #'identity urgrep-file-wildcards " ")))
- (when default
- (format " (default %s)" default))
- ": "))
+ (urgrep--format-prompt
+ (concat
+ "Search "
+ (if urgrep-search-regexp "regexp" "string")
+ (let ((block (append `(,#'pcase ',urgrep-context-lines)
+ urgrep--context-arguments)))
+ (mapconcat (lambda (i) (concat " " i)) (eval block t) ""))
+ (when urgrep-file-wildcards
+ (format " in %s" (mapconcat #'identity urgrep-file-wildcards " "))))
+ default))
(defun urgrep--update-search-prompt ()
"Update the search prompt in the minibuffer."
- [elpa] externals/urgrep 7823d384e6 115/115: Add .elpaignore, (continued)
- [elpa] externals/urgrep 7823d384e6 115/115: Add .elpaignore, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep e5d485de84 034/115: Improve behavior of `urgrep' to allow passing options and add `urgrep-run-command', ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 31fe7d5e5c 022/115: Cache the default tool per-host and allow users to override the tool preferences, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 4fec944d51 016/115: Fix output of git-grep and grep on Linux, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep f2ac6d6b02 011/115: Fix getting vc backend, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 3fb6b95f21 026/115: Add support for smart case-folding, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep a405b9c459 031/115: Add ability to toggle case-sensitivity for the current search, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 74f38b1021 037/115: Add ability to filter the files to be searched, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 8065bb9f5e 039/115: Update requirements and fix failing MS Windows test, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep b0dbe7c6c1 046/115: Update heading, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep e9e70552db 057/115: Use 'format-prompt' if available,
ELPA Syncer <=
- [elpa] externals/urgrep 6f5813ba78 062/115: Add support for wgrep; resolves #2, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 69e45bad3c 069/115: Fix unit tests for git-grep, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 8c6e3d5ba2 101/115: Ensure we get exactly the colors we want, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 2523b6ed4e 108/115: Improve line wrapping slightly, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep e70773d86b 035/115: Refactor urgrep-process-setup so tools can define their own process-setup, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep fdd8dd54e6 044/115: Provide more details in the README, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 3052b8c191 049/115: Use #' read syntax for functions, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep 582896b5af 050/115: Use dotted pairs for alist for each tool, ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep c38b33878f 053/115: Autoloading 'urgrep-setup-hook' really shouldn't be necessary..., ELPA Syncer, 2023/05/10
- [elpa] externals/urgrep a12bd677f7 056/115: Fix 'mouse-face' symbol, ELPA Syncer, 2023/05/10