Wilfred / ag.el

An Emacs frontend to The Silver Searcher
http://agel.readthedocs.org/en/latest/
525 stars 61 forks source link

Issue with backslash-escaping regexp contet #174

Open anon292 opened 1 year ago

anon292 commented 1 year ago

I'm writing some elisp code that relies on ag-project-regexp and ag/search functions. It includes a line like this:

(ag-project-regexp (format "fn.* %s" fn-name))

The goal is to search for strings such as fn[something] fn-name (function definitions). However, the ag command includes fn.\* fn-name. The regexp is not surrounded by quotes and/or a backslash is inserted before the * character, resulting in behavior different than expected. I'm probably doing something wrong, but what?