[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d813aae 4/7: Add "rg" as an option for ack-command
From: |
João Távora |
Subject: |
[elpa] master d813aae 4/7: Add "rg" as an option for ack-command |
Date: |
Mon, 6 Jul 2020 07:19:35 -0400 (EDT) |
branch: master
commit d813aaef5e357c67f17ea9f990774e6fe3f1a418
Author: Waah <waah@yellowfrog.io>
Commit: João Távora <joaotavora@gmail.com>
Add "rg" as an option for ack-command
Copyright-paperwork-exempt: yes
* ack.el (ack-command): Add rg.
(ack-skel-file): Consider rg.
---
ack.el | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/ack.el b/ack.el
index f44ab8f..10fb97b 100644
--- a/ack.el
+++ b/ack.el
@@ -103,10 +103,14 @@
(defcustom ack-command
;; Note: on GNU/Linux ack may be renamed to ack-grep
- (concat (file-name-nondirectory (or (executable-find "ack-grep")
- (executable-find "ack")
- (executable-find "ag")
- "ack")) " ")
+ (concat (file-name-nondirectory (or
+ (executable-find "ack-grep")
+ (executable-find "ack")
+ (executable-find "ag")
+ (concat
+ (executable-find "rg")
+ " -n -H -S --no-heading --color always -e")
+ "ack")) " ")
"The default command for \\[ack].
Note also options to ack can be specified in ACK_OPTIONS
@@ -314,9 +318,12 @@ This gets tacked on the end of the generated expressions.")
(interactive)
(delete-minibuffer-contents)
(let ((ack (or (car (split-string ack-command nil t)) "ack")))
- (if (equal ack "ag")
- (skeleton-insert `(nil ,ack " -ig '" _ "'"))
- (skeleton-insert `(nil ,ack " -g '(?i:" _ ")'")))))
+ (cond ((equal ack "ag")
+ (skeleton-insert `(nil ,ack " -ig '" _ "'")))
+ ((equal ack "rg")
+ (skeleton-insert
+ `(nil ,ack " --color always --files --iglob '*" _ "*'")))
+ (t (skeleton-insert `(nil ,ack " -g '(?i:" _ ")'"))))))
;; Work around bug http://debbugs.gnu.org/13811
(defvar ack--project-root nil) ; dynamically bound in `ack'
- [elpa] master updated (3be3486 -> 88e11d2), João Távora, 2020/07/06
- [elpa] master a53e021 1/7: * ack.el (ack-quickgrep-defaults): Auto-confirm iff symbol at point, João Távora, 2020/07/06
- [elpa] master 35c1152 2/7: Don't auto-confirm M-x ack if no symbol actually yanked, João Távora, 2020/07/06
- [elpa] master eb0217d 3/7: Add quotes around pattern of all ack commands, João Távora, 2020/07/06
- [elpa] master d813aae 4/7: Add "rg" as an option for ack-command,
João Távora <=
- [elpa] master f8cc007 5/7: README.rst: Rewrite a bit, João Távora, 2020/07/06
- [elpa] master b2c449c 6/7: Release 1.1.0 and make ack-quickgrep-defaults the default, João Távora, 2020/07/06
- [elpa] master 88e11d2 7/7: Merge commit 'b2c449c0d5aad67eeee9857e7fd7710f985084ec', João Távora, 2020/07/06