Open nordlow opened 8 months ago
(By now) I'm not sure how much counsel-locate
can do about this by default.
We could change the default way of formatting the command line from locate -i --regex %s
to locate -i --regex -- %s
, but I don't know how portable this is.
Without more insight into that, my best suggestion is to set the user option counsel-locate-cmd
to a custom function such as:
(defun my-counsel-locate-cmd (input)
"Return a `locate' command to search for an INPUT string."
(list locate-command "-i" "--regex" "--" input))
Of course I find it quite unfortunate that counsel-locate
did not integrate from the beginning with user options like locate-make-command-line
which have been with us since Emacs 20.
Solution: If first character is a minus sign it needs to be prefixed with a backslash.