Comments (6)
Yep, I'd definitely see exposing ag -g
as a worthwhile feature.
Perhaps we could add commands ag-find
and ag-find-regexp
? You might want ag-project-find
too, to save prompting for the base directory.
find-dired
is very cool, I've not seen it before, and the UI looks suitable for ag -g
too.
Anyway, I'd welcome patches.
from ag.el.
I've checked and ag
doesn't support non-regexp argument for -g
option yet, and I would not dare to escape the string manually in elisp to "not be regexp" myself since that's very easily breakable. So for now we'll only get ag-find-regexp
. The project thing is also a good idea, I'll add that too.
I have it basically done, only adding docstrings and formatting it a bit better.
from ag.el.
Hm, what about calling it ag-dired
in analogy with find-dired
(which can be interpreted as "run X and dump the output in dired")
from ag.el.
It's actually pretty easy to escape PCRE regexes. I've found the implementation in the Python standard library:
_alphanum = frozenset(
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
def escape(pattern):
"Escape all non-alphanumeric characters in pattern."
s = list(pattern)
alphanum = _alphanum
for i, c in enumerate(pattern):
if c not in alphanum:
if c == "\000":
s[i] = "\\000"
else:
s[i] = "\\" + c
return pattern[:0].join(s)
from ag.el.
Oh well that's pretty simple. I don't have time to continue hacking today, I can add this tomorrow to the same branch, then you can pull it all together.
from ag.el.
Merged, so we're done here :).
from ag.el.
Related Issues (20)
- Feature request: `ag-project-files-regexp`
- ag-dired* does not copy a file if it contains space HOT 1
- ag-match-face can not propertize matched string HOT 1
- Feature request: ag-regexp-files HOT 1
- A little tip about how to change the `ag` arguments will be appreciated.
- Feature Request: ag + ag-files
- no filenames when process-connection-type is nil
- Searching multiple paths at once HOT 4
- What is silversearcher-ag-el? HOT 1
- Incorrect cursor placement in minibuffer when prefixed
- Release 0.48 HOT 1
- Regression: master doesn't highlight results HOT 3
- (--nogroup) Prefix `File: ` breaks jumping to file
- Word wrapped lines too long
- incompatibility with xterm-color.el
- Also work with rg?
- Documentation bug
- When calling `ag` I get the errror "cond: Wrong type argument: listp, ag/run-finished-hook
- Issue with backslash-escaping regexp contet
- verilog-mode breaks ag-mode jump-to-occurrence. aka sharing compilation-mode-hook is perilous
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ag.el.