From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#4341: 23.1; M-x locate runs synchronously Date: Sun, 15 Nov 2020 22:20:05 +0200 Organization: LINKOV.NET Message-ID: <87wnymv3yq.fsf@mail.linkov.net> References: <87y6onr35h.fsf@mail.jurta.org> <87d00u2wyo.fsf@web.de> <87a6vyz0k9.fsf@mail.linkov.net> <87pn4tv0fz.fsf@web.de> <87v9efwuqw.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12725"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Michael Heerdegen , Tom Tromey , 4341@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 15 21:30:07 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1keOf1-0003BQ-0Q for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Nov 2020 21:30:07 +0100 Original-Received: from localhost ([::1]:44814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1keOf0-0001g6-2C for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Nov 2020 15:30:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keOdy-0008ON-Fu for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 15:29:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1keOdy-0005Nl-5r for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 15:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1keOdy-0004jU-0E for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 15:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Nov 2020 20:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 4341 X-GNU-PR-Package: emacs Original-Received: via spool by 4341-submit@debbugs.gnu.org id=B4341.160547213718175 (code B ref 4341); Sun, 15 Nov 2020 20:29:01 +0000 Original-Received: (at 4341) by debbugs.gnu.org; 15 Nov 2020 20:28:57 +0000 Original-Received: from localhost ([127.0.0.1]:54250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keOds-0004j5-TE for submit@debbugs.gnu.org; Sun, 15 Nov 2020 15:28:57 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:37437) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keOdr-0004iq-Ap for 4341@debbugs.gnu.org; Sun, 15 Nov 2020 15:28:55 -0500 X-Originating-IP: 91.129.97.46 Original-Received: from mail.gandi.net (m91-129-97-46.cust.tele2.ee [91.129.97.46]) (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 348C81C0003; Sun, 15 Nov 2020 20:28:46 +0000 (UTC) In-Reply-To: (Stefan Kangas's message of "Sun, 8 Nov 2020 12:23:53 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193379 Archived-At: --=-=-= Content-Type: text/plain >> 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: --=-=-= Content-Type: text/x-org; charset=utf-8 Content-Disposition: inline; filename=locate.org Content-Transfer-Encoding: 8bit * 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 --=-=-= Content-Type: text/plain 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? --=-=-=--