From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 55ec674: * lisp/multifile.el: New file, extracted from etags.el Date: Thu, 7 Feb 2019 15:23:37 +0300 Message-ID: References: <20180922154639.23195.66360@vcs0.savannah.gnu.org> <20180922154640.9D58220310@vcs0.savannah.gnu.org> <54108dbc-9d12-06ff-3f1d-151118e9b234@yandex.ru> <87sgyi69iw.fsf@mail.linkov.net> <87efa00y92.fsf@mail.linkov.net> <87bm4y7lbm.fsf@mail.linkov.net> <11f31384-3f91-f28f-cae6-285aadffbe40@yandex.ru> <875zv6blh3.fsf@mail.linkov.net> <9ebcadbf-bc6f-0306-a4f9-a5073569edff@yandex.ru> <47bf9b71-57a4-97d1-47cd-f76c08078c62@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------E94E0577AE1F0F8954E7CB57" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="94865"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Thunderbird/65.0 To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 07 13:24:00 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1griim-000OXq-BC for ged-emacs-devel@m.gmane.org; Thu, 07 Feb 2019 13:24:00 +0100 Original-Received: from localhost ([127.0.0.1]:38855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1griil-0001S3-4Z for ged-emacs-devel@m.gmane.org; Thu, 07 Feb 2019 07:23:59 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1griid-0001Ru-Nj for emacs-devel@gnu.org; Thu, 07 Feb 2019 07:23:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1griic-0002UK-Qi for emacs-devel@gnu.org; Thu, 07 Feb 2019 07:23:51 -0500 Original-Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]:45160) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1griiY-0002OB-QK for emacs-devel@gnu.org; Thu, 07 Feb 2019 07:23:50 -0500 Original-Received: by mail-lf1-x142.google.com with SMTP id b20so7964052lfa.12 for ; Thu, 07 Feb 2019 04:23:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:references:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=v/7dWXrFOY3dyIUshFzol2uzUmzLvaSRLOkoBVFvKtY=; b=Ctup64/n/rmzd91fciaQhE4vw0UrQ/u3dxZ06FlsKdOk/xsIVDZizb/DSiRU+LiAIr pjn5980Vu6/F25ICarDPvzVVamjHO1BQSi4IfX4iuTD4zmw2bt9EpzZPHoWkl9S5blTZ hRaH3zFCWF29X526akorUi+5UOLf/QdvwksbUk1y8CsGVJRmWna+TJ6h38JhfR/UT6Jn NJ1k5GeBzMhPXe0YF/ZtEGhLtOxIHWfCXBTs+CHM9dQqMwU5mKVuoL/ECW/u/m+sfKcS MN2eM4J41Hq2HhR7Eb2UFX7+wfKYmqQPjgIt6RoitXYr49KaB8hDUIUqpgQtu2LLtAdm JyOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:references:message-id :date:user-agent:mime-version:in-reply-to:content-language; bh=v/7dWXrFOY3dyIUshFzol2uzUmzLvaSRLOkoBVFvKtY=; b=MMPtbh+Fg4XWzrT9odNCdfPZtxZovZrKgt94ZOS5OZcIG1Vw03g3cUN5hh/PpGYziQ 4H65e+9KqbVh1f/5Ul4DsK720KkDdE/gJt3Qq5hJOPJbu0ihLd01tUBZinHcXqQI7l5w 4y9+AtQhoKLysXwprrOjvtE0Fsm72oHUpOOVnWagz+f4K5Er3ufxC2F7pATdVkINIVax jGy62Jd4qrDiRN61WnSWz/wlYya83pB1l+4e8hPXJuy1qA7Y5y2BGBF+C5kTUgG3eGjQ zbIGNyclM+MVhIfHOMuMLTSGyBOr2WBGNxQvH0Kd2UMt+dT1YjdffmDr1HQJkvKG5c7T rBgQ== X-Gm-Message-State: AHQUAuaZiyzpsVMGEvMVFxVYJ7RN4/8pGxjYMsfK9sHrHXJrzIGFJUdT etW8Rs9DWHEWClBGXAeYXsa15mUq X-Google-Smtp-Source: AHgI3IYre+wrljXgbOYijB3rd74VSo4Y/W3e/JXeFk8HC1ZgjiomDUYeKuMwuyucj9lbEA8FU2yisA== X-Received: by 2002:a19:4f15:: with SMTP id d21mr5129216lfb.86.1549542220747; Thu, 07 Feb 2019 04:23:40 -0800 (PST) Original-Received: from [192.168.43.247] ([217.118.78.120]) by smtp.googlemail.com with ESMTPSA id q26sm588989lfc.79.2019.02.07.04.23.38 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 04:23:39 -0800 (PST) In-Reply-To: <47bf9b71-57a4-97d1-47cd-f76c08078c62@yandex.ru> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::142 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233078 Archived-At: This is a multi-part message in MIME format. --------------E94E0577AE1F0F8954E7CB57 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 04.01.2019 02:06, Dmitry Gutov wrote: > On 03.01.2019 18:35, Stefan Monnier wrote: > >> Indeed.  My conclusion from this discussion is that multifile.el should >> not accrue commands like those of project.el: it's a library that can be >> used by things like tags.el or project.el, with a limited scope. > > I agree with that. But still, I'm very tempted to rename project-search > to fileloop-find-regexp-in-project and project-query-replace to > fileloop-query-replace-regexp-in-project. So... which of these changes do you prefer? Inserting -fileloop- to the names of he commands, or moving them to the fileloop package altogether? Two diffs attached. --------------E94E0577AE1F0F8954E7CB57 Content-Type: text/x-patch; name="project-fileloop.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="project-fileloop.diff" diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index fbf761c60c..dea2cd30d6 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -522,7 +522,7 @@ project--completing-read-strict (declare-function fileloop-continue "fileloop" ()) ;;;###autoload -(defun project-search (regexp) +(defun project-fileloop-search (regexp) "Search for REGEXP in all the files of the project. Stops when a match is found. To continue searching for next match, use command \\[fileloop-continue]." @@ -532,7 +532,7 @@ project-search (fileloop-continue)) ;;;###autoload -(defun project-query-replace (from to) +(defun project-fileloop-query-replace (from to) "Search for REGEXP in all the files of the project. Stops when a match is found. To continue searching for next match, use command \\[fileloop-continue]." --------------E94E0577AE1F0F8954E7CB57 Content-Type: text/x-patch; name="fileloop-project.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fileloop-project.diff" diff --git a/lisp/fileloop.el b/lisp/fileloop.el index 2e77811a57..b07b81bc1e 100644 --- a/lisp/fileloop.el +++ b/lisp/fileloop.el @@ -213,5 +213,28 @@ fileloop-initialize-replace (lambda () (perform-replace from to t t delimited nil multi-query-replace-map)))) +;;;###autoload +(defun fileloop-search-in-project (regexp) + "Search for REGEXP in all the files of the project. +Stops when a match is found. +To continue searching for next match, use command \\[fileloop-continue]." + (interactive "sSearch (regexp): ") + (fileloop-initialize-search + regexp (project-files (project-current t)) 'default) + (fileloop-continue)) + +;;;###autoload +(defun fileloop-query-replace-in-project (from to) + "Search for REGEXP in all the files of the project. +Stops when a match is found. +To continue searching for next match, use command \\[fileloop-continue]." + (interactive + (pcase-let ((`(,from ,to) + (query-replace-read-args "Query replace (regexp)" t t))) + (list from to))) + (fileloop-initialize-replace + from to (project-files (project-current t)) 'default) + (fileloop-continue)) + (provide 'fileloop) ;;; fileloop.el ends here diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index fbf761c60c..e526249d48 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -519,30 +519,5 @@ project--completing-read-strict inherit-input-method))) (concat common-parent-directory res))) -(declare-function fileloop-continue "fileloop" ()) - -;;;###autoload -(defun project-search (regexp) - "Search for REGEXP in all the files of the project. -Stops when a match is found. -To continue searching for next match, use command \\[fileloop-continue]." - (interactive "sSearch (regexp): ") - (fileloop-initialize-search - regexp (project-files (project-current t)) 'default) - (fileloop-continue)) - -;;;###autoload -(defun project-query-replace (from to) - "Search for REGEXP in all the files of the project. -Stops when a match is found. -To continue searching for next match, use command \\[fileloop-continue]." - (interactive - (pcase-let ((`(,from ,to) - (query-replace-read-args "Query replace (regexp)" t t))) - (list from to))) - (fileloop-initialize-replace - from to (project-files (project-current t)) 'default) - (fileloop-continue)) - (provide 'project) ;;; project.el ends here --------------E94E0577AE1F0F8954E7CB57--