From: Juri Linkov <juri@jurta.org>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
Tom Tromey <tromey@redhat.com>,
4341@debbugs.gnu.org
Subject: bug#4341: 23.1; M-x locate runs synchronously
Date: Sun, 15 Nov 2020 22:20:05 +0200 [thread overview]
Message-ID: <87wnymv3yq.fsf@mail.linkov.net> (raw)
In-Reply-To: <CADwFkmnJfEsWRfvih6FgSCybYBtSw8WEiTGRymTWWf0Xhf-Uxg@mail.gmail.com> (Stefan Kangas's message of "Sun, 8 Nov 2020 12:23:53 -0800")
[-- Attachment #1: Type: text/plain, Size: 412 bytes --]
>> 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:
[-- Attachment #2: locate.org --]
[-- Type: text/x-org, Size: 846 bytes --]
* 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
[-- Attachment #3: Type: text/plain, Size: 599 bytes --]
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?
prev parent reply other threads:[~2020-11-15 20:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-04 19:15 bug#4341: 23.1; M-x locate runs synchronously Tom Tromey
2009-09-10 1:17 ` Juri Linkov
2020-11-03 17:04 ` Michael Heerdegen
2020-11-03 19:45 ` Juri Linkov
2020-11-04 11:14 ` Michael Heerdegen
2020-11-08 19:47 ` Juri Linkov
2020-11-08 20:23 ` Stefan Kangas
2020-11-15 20:20 ` Juri Linkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wnymv3yq.fsf@mail.linkov.net \
--to=juri@jurta.org \
--cc=4341@debbugs.gnu.org \
--cc=michael_heerdegen@web.de \
--cc=stefankangas@gmail.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.