bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23179: 25.0.92; Restore `M-,' to continue etags search


From: Dmitry Gutov
Subject: bug#23179: 25.0.92; Restore `M-,' to continue etags search
Date: Sun, 14 Apr 2019 15:52:35 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 14.04.2019 0:57, Juri Linkov wrote:

I tried to run rgrep in `emacs -Q' and see that its output is unsorted
indeed.  I forgot that I customized the sorting of the output long ago:

(setq grep-find-template
"find <D> <X> -type f <F> -print0 | sort -z | xargs -0 -e grep <C> --color -inH -e 
<R>")
                                     =======

I see.

But actually, I looked at the code again, and there's little reason not to sort in the current implementation. Please try and see if doing that in project--files-in-directory gives any kind of perceptible slowdown.

Doing it in Lisp seems to be the fastest choice (benchmark still shows a bit of a difference if I do that via "| sort -z"):

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index dabc4ab6b4..b8a58ed317 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -209,7 +209,8 @@ project--files-in-directory
                                      (shell-quote-argument ")"))"")
                          )))
     (project--remote-file-names
-     (split-string (shell-command-to-string command) "\0" t))))
+     (sort (split-string (shell-command-to-string command) "\0" t)
+           #'string<))))

 (defun project--remote-file-names (local-files)
"Return LOCAL-FILES as if they were on the system of `default-directory'."





reply via email to

[Prev in Thread] Current Thread [Next in Thread]