GNU bug report logs -
#4341
23.1; M-x locate runs synchronously
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
>> Maybe this would be an improvement. But sorry, I can't help in testing:
>> while slow `M-x locate' used to be a problem in the past, nowadays it
>> finishes within 1 sec, so I simply won't notice the difference :-)
>
> FWIW, here it takes much longer than that. It would be very welcome if
> someone would want to work on making it asynchronous.
What I can do to help is to post my current customization:
[locate.org (text/x-org, inline)]
* Highlight all matches in the =*Locate*= buffer like in the =*Occur*= buffer:
#+begin_src emacs-lisp
(add-hook 'locate-post-command-hook
(lambda ()
(save-excursion
(goto-char (point-min))
(when (or (re-search-forward "Matches for .* using filter \\(.*\\):" nil t)
(re-search-forward "Matches for \\(.*\\):" nil t))
(highlight-regexp
(match-string-no-properties 1)
'match)))))
#+end_src
* Ignore case in locate command
#+begin_src emacs-lisp
(with-eval-after-load 'locate
;; Redefine ‘locate-default-make-command-line’.
(defun locate-make-command-line-ignore-case (search-string)
(list locate-command "-i" search-string))
(setq locate-make-command-line 'locate-make-command-line-ignore-case))
#+end_src
[Message part 3 (text/plain, inline)]
With this I see no problems with adding a new option to use ls with switches
as demonstrated by this code:
#+begin_src emacs-lisp
(defun locate-make-command-line-ls (search-string)
(list shell-file-name
shell-command-switch
(format "%s %s %s | xargs ls -ls" locate-command "-i" search-string) ))
(setq locate-make-command-line 'locate-make-command-line-ls)
#+end_src
Then it's possible to enable 'dired-virtual-mode' in the output buffer
in 'locate-post-command-hook'.
Or maybe locate.el should be obsoleted, and a new option to run 'locate'
should be added to find-dired.el?
This bug report was last modified 4 years and 210 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.