From unknown Thu Jun 19 14:30:11 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#52558 <52558@debbugs.gnu.org> To: bug#52558 <52558@debbugs.gnu.org> Subject: Status: Option for easier typing of regexps Reply-To: bug#52558 <52558@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:30:11 +0000 retitle 52558 Option for easier typing of regexps reassign 52558 emacs submitter 52558 ndame severity 52558 wishlist tag 52558 moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 16 12:41:26 2021 Received: (at submit) by debbugs.gnu.org; 16 Dec 2021 17:41:26 +0000 Received: from localhost ([127.0.0.1]:36615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxukw-0006Bp-Fs for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:41:26 -0500 Received: from lists.gnu.org ([209.51.188.17]:44756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxukv-0006Bi-0Z for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:41:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxuku-0005sU-BM for bug-gnu-emacs@gnu.org; Thu, 16 Dec 2021 12:41:24 -0500 Received: from mail-40132.protonmail.ch ([185.70.40.132]:62569) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxuks-0003G3-Dp for bug-gnu-emacs@gnu.org; Thu, 16 Dec 2021 12:41:24 -0500 Date: Thu, 16 Dec 2021 17:41:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail2; t=1639676479; bh=h+MxhCIfWxHJ8/7G9WvAefziuZ9rrAOZR/iiNIUXvtg=; h=Date:To:From:Reply-To:Subject:Message-ID:From:To:Cc; b=DNEFYu8CkonZ1rVn91DolyD2jtML2A5mcHbV5NLpRtQcFQKalsjQeb/T1IAnMcCXU Qs8Xu830wIWUGuyxy65/n4iSQ4QI9XjKrBx+P2LwGFvfff/VlU2Xg/71HSPgBiF4qy PEsqMmENPicBVi33Z29sXlRcfeCpEWpX/rylJr1FrZDFVW7YpMljEdUZ15KBWWvsdE 2f12Ai0TkyBQ4bSfdUhQmKzj+1Wbr44w6KuT7pYBuz+UU8zkxLtAk1/0tLLSYr4c+Q wePliAPQP73G0YTlm6jr4YASktCvCW9q6j6zBOU2re98hOkFE+beC/de++Fk1ZASyb WHLPmIJ7JM6/Q== To: "Bug reports for GNU Emacs, the Swiss army knife of text editors" From: ndame Subject: Option for easier typing of regexps Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Received-SPF: pass client-ip=185.70.40.132; envelope-from=laszlomail@protonmail.com; helo=mail-40132.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ndame Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) I use query replace regexp a lot, as I imagine other people do, and I always found that typing capturing groups and alternation is clumsy, because they have to be escaped, and they are the ones needed most often: \(...\) \| There could be a user option to make these easier to type by providing a variable which controls which characters need escaping in interactive mode, so the user could list those characters for which the escaping rules are reversed when typing in the regexp replace prompt. E.g. specifying "()|" means the user can do capturing and alternation without typing backslashes and match the literal characters with escaping. This is only an interactive helper feature, so it does not affect the underlying lisp implementation. The input of the interactive prompt is normalized after submission. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 17 05:07:57 2021 Received: (at 52558) by debbugs.gnu.org; 17 Dec 2021 10:07:57 +0000 Received: from localhost ([127.0.0.1]:38003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myA9d-0004Fv-C9 for submit@debbugs.gnu.org; Fri, 17 Dec 2021 05:07:57 -0500 Received: from smtp-1.orcon.net.nz ([60.234.4.34]:59989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myA9a-0004Fb-QW for 52558@debbugs.gnu.org; Fri, 17 Dec 2021 05:07:55 -0500 Received: from [10.253.37.70] (port=45256 helo=webmail.orcon.net.nz) by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1myA9X-0000Xq-5u; Fri, 17 Dec 2021 23:07:51 +1300 Received: from ip-14-137-22-223.kinect.net.nz ([14.137.22.223]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Fri, 17 Dec 2021 23:07:51 +1300 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 17 Dec 2021 23:07:51 +1300 From: Phil Sainty To: ndame Subject: Re: bug#52558: Option for easier typing of regexps In-Reply-To: References: Message-ID: <2af49892e35fa76d89fece4b2abc8a11@webmail.orcon.net.nz> X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) You can probably implement what you want by overriding `read-regexp'. In principle I'd expect anything prompting for a regexp to be using this. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 17 23:41:23 2021 Received: (at 52558) by debbugs.gnu.org; 18 Dec 2021 04:41:23 +0000 Received: from localhost ([127.0.0.1]:41051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myRX8-0004D2-PM for submit@debbugs.gnu.org; Fri, 17 Dec 2021 23:41:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myRX6-0004Cl-29 for 52558@debbugs.gnu.org; Fri, 17 Dec 2021 23:41:20 -0500 Received: from [2001:470:142:3::e] (port=34150 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myRX0-0007tg-Pu; Fri, 17 Dec 2021 23:41:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=iZly6vbX1COJp9gDd8lE/ikQeDhP7jofn2m5/psX2hA=; b=KByA5592XRD8 Yv24DqYQMkTM71U/kaNq1tyoELKFLBMDu1DAOz7FGnt2sJKMMQ/T4cErESyvbF5+mw75mVSkEDma2 f6sQVS/oRo23crPWLt6ZI4MkWlJ10OTWt3VC+cW2iv2n1s//F3e+JjMHku/XuWJfwgANHWL1wi5iC ooYCqWRC5/IgUIrzCsEJ6t5srl2cmAn5Ps6w0MrZHJDwRYhCsCT5F8eIWfWyqN8NhkiAARHOAZAtK DlUW3OD7I6oUU1JVCjpquJPsXob+wx/rE/WL9IGFaVhqkoSYkdQAvNH9YzWoNF6wB+g56ZeKVH/MD SqGz8AUehUndhmVGcwcKYQ==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1myRX0-0001h5-U4; Fri, 17 Dec 2021 23:41:14 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: ndame In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#52558: Option for easier typing of regexps References: Message-Id: Date: Fri, 17 Dec 2021 23:41:14 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] I agree that we could sure use some improvement in this area. But designing a better interface is likely to be tricky. We might want to change several aspects at once, rather than making a small incremental change. I urge people to look for various ideas for a more convenient interactive way to specify regexps. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 18 11:48:00 2021 Received: (at 52558) by debbugs.gnu.org; 18 Dec 2021 16:48:00 +0000 Received: from localhost ([127.0.0.1]:43668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mycsJ-0004ab-VY for submit@debbugs.gnu.org; Sat, 18 Dec 2021 11:48:00 -0500 Received: from mail-4318.protonmail.ch ([185.70.43.18]:47741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mycsE-0004ZT-Pe for 52558@debbugs.gnu.org; Sat, 18 Dec 2021 11:47:58 -0500 Date: Sat, 18 Dec 2021 16:47:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail2; t=1639846067; bh=k9H9ZOhkYwSaPvkLn8sJZbGVyJYJwq43aZu7M7G7MO4=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc; b=M2NIfwAcwD08cSksU/e9UGL+Wi3kcFO2yShyf2bxNeNIRgxzZMNgdDKYFOxc4OD62 QitIbGRhKmwHLodniofd4R2fzgh4YCVyGUZ/EocbnTYwbPVPWA0eqtCi0EiClq4j1r 2QSAmBwdJjZyJHljk/yX2FexAVlAz4mACBcz81avOU+yA3PlfXn9sK6FsrK4bM7QQE 3dUIZrY14npXRK6V0MgIZj0pYNBFSvfZd7VQ/u9ZBhd2FcPsx0e5jXeXMo+dJ2+aYq GTtsksppLX5/PJcoaDcsLHveun9aC+YVdELphpIhYY/YcfmJ13uIgp9sp+zXnxFr7k 1xnT+9YIH6J7A== To: Phil Sainty From: ndame Subject: Re: bug#52558: Option for easier typing of regexps Message-ID: In-Reply-To: <2af49892e35fa76d89fece4b2abc8a11@webmail.orcon.net.nz> References: <2af49892e35fa76d89fece4b2abc8a11@webmail.orcon.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ndame Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > You can probably implement what you want by overriding > `read-regexp'. In principle I'd expect anything prompting > for a regexp to be using this. That's what I thought too at first, but turns out it's not the right way, because then history contains the normalized regexp, so if the user goes back in history then he doesn't see the easy version, though the goal is that the user works with the easy variant. So read-regexp is not the right place, because the result of that goes into history. The translation has to be done only before the regexp is used. In case of query-replace-regexp it can be done before perform-replace. Here's a solution with advice: (defun my-perform-replace (origfun &rest args) (apply origfun (if (fourth args) ;; do conversion only for regexp replace (cons (let ((s (car args)) (chars '("|" "(" ")")) (placeholder (format "@placeholder%s@" (int-to-string (buffer-modified-tick))))) (dolist (char chars) (setq s (replace-regexp-in-string placeholder char (replace-regexp-in-string char (concat "\\\\" char) (replace-regexp-in-string (concat "\\\\" char) placeholder s))))) s) (cdr args)) args))) (advice-add 'perform-replace :around 'my-perform-replace) From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 06:54:46 2021 Received: (at control) by debbugs.gnu.org; 19 Dec 2021 11:54:46 +0000 Received: from localhost ([127.0.0.1]:44978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myum6-00034H-Fa for submit@debbugs.gnu.org; Sun, 19 Dec 2021 06:54:46 -0500 Received: from quimby.gnus.org ([95.216.78.240]:40588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myum5-000345-5q for control@debbugs.gnu.org; Sun, 19 Dec 2021 06:54:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4CjeoEI9ETRpoDdcbkivlFdx9RFbNnJ5QCnYRDNoziE=; b=ZiFum28oL73IuZw6ClPsbYE5FN 6K8hEAdRIsxINHqXP6MU/hjpRBjiIHdgwzS7uefWJMP/QZfUNoS2E3N9RQ510nnjONDkt6W+CqzVm sUd1ZDOWeqFI8CRCi9oLozetbVE7ZGEzHNEaFhy/nW1m3y2Ei01+BVQt8t06ARqdOYWc=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1myulx-0003Kp-8K for control@debbugs.gnu.org; Sun, 19 Dec 2021 12:54:39 +0100 Date: Sun, 19 Dec 2021 12:54:35 +0100 Message-Id: <87sfuovmh0.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #52558 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: severity 52558 wishlist quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) severity 52558 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 06:56:14 2021 Received: (at 52558) by debbugs.gnu.org; 19 Dec 2021 11:56:14 +0000 Received: from localhost ([127.0.0.1]:44987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myunW-00037I-09 for submit@debbugs.gnu.org; Sun, 19 Dec 2021 06:56:14 -0500 Received: from quimby.gnus.org ([95.216.78.240]:40624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myunU-000374-9i for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 06:56:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CeKt0slbOqD8ZI+pkEotX8jV+9IjVYfrNTiAN5k3fs8=; b=cr9xBKP9jif8WBqOofokM7kFyL aCj0QjUNudAwgr1I9nm339vzLtzJv3jdzknpWqSTk3ZmMlxLLTu2N4AvWEcnEDQUXE3KCRloaV91h VORFIzQZY0iTwncCZVgwQfqhEFYLTme60rjue1BOo7ZnPRs8gHxIQxBE02QAo4dGZASg=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1myunL-0003LH-Qm; Sun, 19 Dec 2021 12:56:06 +0100 From: Lars Ingebrigtsen To: ndame Subject: Re: bug#52558: Option for easier typing of regexps References: X-Now-Playing: John Martyn's _Bless the Weather_: "Bless the Weather (Take 4)" Date: Sun, 19 Dec 2021 12:56:03 +0100 In-Reply-To: (ndame's message of "Thu, 16 Dec 2021 17:41:17 +0000") Message-ID: <87o85cvmek.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: ndame writes: > I use query replace regexp a lot, as I imagine other people do, and I > always found that typing capturing groups and alternation is clumsy, > because they have to be escaped, and they are the ones [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) ndame writes: > I use query replace regexp a lot, as I imagine other people do, and I > always found that typing capturing groups and alternation is clumsy, > because they have to be escaped, and they are the ones needed > most often: \(...\) \| > > There could be a user option to make these easier to type by providing > a variable which controls which characters need escaping in > interactive mode, so the user could list those characters for which > the escaping rules are reversed when typing in the regexp replace > prompt. I think it would be really confusing to have a different regexp syntax when prompting interactively to when you're writing code, so I don't think this would be a good idea. Anybody else have a different opinion? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 06:56:18 2021 Received: (at control) by debbugs.gnu.org; 19 Dec 2021 11:56:18 +0000 Received: from localhost ([127.0.0.1]:44990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myuna-00037b-79 for submit@debbugs.gnu.org; Sun, 19 Dec 2021 06:56:18 -0500 Received: from quimby.gnus.org ([95.216.78.240]:40638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myunZ-00037A-3l for control@debbugs.gnu.org; Sun, 19 Dec 2021 06:56:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+YJSnSUILdeseU8G4+fGNpExLNfFhQlpkWmBJZSS09A=; b=ZZAVVcrwM7dIkLktaFwFaOXaDA iCmdT3qbqFyk5T3RebaY9JhAjqXR52ShCWE3Yt8hmKvsnICV9j40nhy2+nh50a9snLfq0PzaAsiAo HRtdwR9gFxcM65LMiInSHGlGY5C8EEs1jEk2oqpx8P1Y+JNy315eorQCU/fhAfTFLu60=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1myunR-0003LQ-3p for control@debbugs.gnu.org; Sun, 19 Dec 2021 12:56:11 +0100 Date: Sun, 19 Dec 2021 12:56:08 +0100 Message-Id: <87mtkwvmef.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #52558 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 52558 + moreinfo quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 52558 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 08:03:41 2021 Received: (at 52558) by debbugs.gnu.org; 19 Dec 2021 13:03:41 +0000 Received: from localhost ([127.0.0.1]:45188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myvqn-0007bd-2b for submit@debbugs.gnu.org; Sun, 19 Dec 2021 08:03:41 -0500 Received: from smtp-1.orcon.net.nz ([60.234.4.34]:51075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myvql-0007bU-6k for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 08:03:39 -0500 Received: from [10.253.37.70] (port=41680 helo=webmail.orcon.net.nz) by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1myvqY-0004VE-IS; Mon, 20 Dec 2021 02:03:26 +1300 Received: from ip-14-137-22-223.kinect.net.nz ([14.137.22.223]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Mon, 20 Dec 2021 02:03:26 +1300 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 20 Dec 2021 02:03:26 +1300 From: Phil Sainty To: Lars Ingebrigtsen Subject: Re: bug#52558: Option for easier typing of regexps In-Reply-To: <87o85cvmek.fsf@gnus.org> References: <87o85cvmek.fsf@gnus.org> Message-ID: <8228970e3e55e6b9f31a3cc30c6aad75@webmail.orcon.net.nz> X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 52558 Cc: ndame , 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2021-12-20 00:56, Lars Ingebrigtsen wrote: > I think it would be really confusing to have a different regexp > syntax when prompting interactively to when you're writing code I do recall discussions about allowing (via a user option) rx syntax at regexp prompts, however. I think *that* could be nice; but if we were to have an rx option, perhaps additional options could be up for consideration as well. Personally I agree with you that multiple string syntax options has potential to create confusion, but https://github.com/joddie/pcre2el shows there's some demand for such things. Perhaps that library would suffice as a solution for this particular request? -Phil From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 09:08:26 2021 Received: (at 52558) by debbugs.gnu.org; 19 Dec 2021 14:08:26 +0000 Received: from localhost ([127.0.0.1]:45285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mywrS-0005Er-Dx for submit@debbugs.gnu.org; Sun, 19 Dec 2021 09:08:26 -0500 Received: from mail-4324.protonmail.ch ([185.70.43.24]:62703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mywrQ-0005Eb-7r for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 09:08:25 -0500 Date: Sun, 19 Dec 2021 14:08:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail2; t=1639922897; bh=vOaXUAHbCaliMQR0QiZ/unAEZsSJAmRnvqbuUUrbmHk=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc; b=ik0XdOj1uN0BDP60AIW0ZRDQepcgwcpVNoCdUY+9fgU8+fEGiFulGkFv+hsdskBST GZKYUptBhAte1m0UvwVL+yqx7H3yq28UQQa72OcnQbOGNyrVqVkSKRbDdmU7M+YU0c 8/TmVgZBVTxD79YL7ytM2ZAEWyKexbIkaf2NEbpE32Pyle954bXGYeruT1XJqJ2Bxd TnAXv6Ju5C1WNGvRefXnFofOtWw5KVPsF2+Zar8RtfyGrN+uqt1uvYwYFJt2qxLtHL dVGNyAcWFcA/1rbAZ8AdNXSil3aDkwfFvR+WvqSPC5tIyQEmO7TFE3MfYDRgIqlYyn l0QgOQEP1FyNg== To: Phil Sainty From: ndame Subject: Re: bug#52558: Option for easier typing of regexps Message-ID: In-Reply-To: <8228970e3e55e6b9f31a3cc30c6aad75@webmail.orcon.net.nz> References: <87o85cvmek.fsf@gnus.org> <8228970e3e55e6b9f31a3cc30c6aad75@webmail.orcon.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 52558 Cc: Lars Ingebrigtsen , 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ndame Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On 2021-12-20 00:56, Lars Ingebrigtsen wrote: > > I agree with you that multiple string syntax options has > potential to create confusion Why would it create confusion if it's an option which the user has to enable explicitly? Anyway, I'm using the advice posted before and it's much more convenient in interactive mode than the default, and it's not hard to remember that it's different in elisp, because there one has to type two slashes anyway. Or one can use rx. That's why I thought a built in option for this could be useful, but feel free to close the bug report if you don't agree. I'm satisfied with the advice too. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 10:10:21 2021 Received: (at 52558) by debbugs.gnu.org; 19 Dec 2021 15:10:21 +0000 Received: from localhost ([127.0.0.1]:47699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myxpM-0003Nt-UV for submit@debbugs.gnu.org; Sun, 19 Dec 2021 10:10:21 -0500 Received: from mout.web.de ([217.72.192.78]:55537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myxpK-0003Nd-FT for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 10:10:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1639926610; bh=9X+L3g6wsA7DD5gyjYl1+5bIBXZCFgLV1I3opymm3/0=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=h8Cj1v8eKRhfQdZvt4kLw+ZTBqTVu2+cQdj9rBrcs8nnTDV6Zw9YNa5E4ZS8/SBZy sW9wQRHJe+kkpllW/JczSlEn0CC/5sudZxZJdnqw8pmmLJYFXYN6orlmIlxRuC0xuO ex4SPhdV+ejJm5ZzQzby2FtH0hKd4650ITq0UNR0= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([92.208.225.87]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MRF3W-1nB11i1Jw4-00NN3Z; Sun, 19 Dec 2021 16:10:10 +0100 From: Michael Heerdegen To: Lars Ingebrigtsen Subject: Re: bug#52558: Option for easier typing of regexps References: <87o85cvmek.fsf@gnus.org> Date: Sun, 19 Dec 2021 16:10:08 +0100 In-Reply-To: <87o85cvmek.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 19 Dec 2021 12:56:03 +0100") Message-ID: <871r28bpgv.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Zb3lxp1mSwhsPDhQ633N17jKWapZvY7YqE762lVNH6LOdFg2vhD m0zVDYbkUGtyGPvCJQvlr/HItPpf3cvCy8FIzVHQsf+XnnsCEZpx1uqLWLUw2jPHB7XX6Tk Lks8wsZD5m3GqFw612Fm8x35SYWKX2s8I6l2Zjpv4BtVtYP/mLFn37AL/YOqA1W9n0jWyjs pex8kaJdMUiEPq12E2FSA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:+n/7PRehev4=:t0yIX3GiB7l5oi9PmXJvb0 tnpyXxQQ0Rt72DnGXivpHsQcj0JzL/abxmy1GyOhPjMW2RMvsr817a6uziBYUZMhDia1bYw3/ hzJBAyqe6cTfGajMFn1YC60Y1YctuRHHM3JuVCa8jtjvk7ugnXvjtKsAqmvlp38IDyyNRW8Hq knHlt3LB6wR+0rYqPFJvpmmPE8dr32tt5gTsBZj8bKE/2CWmdsP4FbRc64q9sQYDYETvUMoaB U6xvI2uqu0MM9c106pWGhIiXi4e+mzatLJonb30E1MqnlL/fjk9YvZ8tOcz0ar8lab4ZbWUu9 G80Lgo0AU/MuN0Az8ll2/p6ELoIw6cITHXSsXEYoyhUguoOfLuv+dPdHyaQLK5smZh0VI1z/r 3yrCGCRb+us5415jDKEF5nxG7AcYZ21U8cxv4eFe7wOH+9smZbpGXVVEmvOS16lU/651HZya4 UjQOWCtUGT/2yTt//4yf+tafLzbTVqVdDNpzOPUqTt9Ymf7kRnQeECwmdjUkP6onCy+x/YzFU pskFeDba/f8czX7+O6CTRQJYr0lUuPp17xtMWNWxWO2jrG4yUouGFWIcq2q8haDqkHUiELXA8 o7fOD2ScbXKVoQTwR5g3F/J6dW++dLKuvwaPIyQs8cu0k9w/KIJep2l1lQzIqZ4LbTfdTrgqd 1yKuJLAw8vwhshp3J48EKiyuVSpjRm63iTGAobIxNuVYf3ms0ekHVu7r/wnnoyTYIY0JmjMt9 lEoYlrSXyCKnJR8SZxpEKpSHtnn6kgvtGebw5WWS4+gAQLelUxO2eNOmh2A9Bwth9Vs5QQE6U 968SDme5GM8DD17yX75vDdDAgs0KObh2Hun1qY2W7kzdwy5wDNqx/efYznR6SOCzBvCDUDEYH 7WovFqAlNvMlYRQCE61Z2lijVi7HkAe/nrRCijaC8yCwYTghOKjiPy/YAunevcDP+e8J1aNLL dd3oSaFM/kJDVv2XW0rULUTbOmjD40mMrrPTts+cqs3d+FxVN3OETszMI+x+2DWA6Y7VnfRD1 8AQcGSv4JmSlIq9ncLbCZBuLQPrwZqTO5stO3VrbHG9MEfOt6JBQ+1c1C6zJeSgHQ9MGg9mLu 64JcykifyX7hbM= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: ndame , 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Lars Ingebrigtsen writes: > I think it would be really confusing to have a different regexp syntax > when prompting interactively to when you're writing code, so I don't > think this would be a good idea. Anybody else have a different > opinion? I can only say that I hate to enter stringish regexps in general. So much that I hacked `read-regexp' and isearch to accept rx forms as regexps instead. Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 11:11:41 2021 Received: (at 52558) by debbugs.gnu.org; 19 Dec 2021 16:11:41 +0000 Received: from localhost ([127.0.0.1]:47799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myymi-0000wJ-Sw for submit@debbugs.gnu.org; Sun, 19 Dec 2021 11:11:41 -0500 Received: from smtp-1.orcon.net.nz ([60.234.4.34]:55633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myymh-0000w9-GI for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 11:11:40 -0500 Received: from [10.253.37.70] (port=37148 helo=webmail.orcon.net.nz) by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1myyma-0004Hw-GP; Mon, 20 Dec 2021 05:11:32 +1300 Received: from ip-14-137-22-223.kinect.net.nz ([14.137.22.223]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Mon, 20 Dec 2021 05:11:32 +1300 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 20 Dec 2021 05:11:32 +1300 From: Phil Sainty To: ndame Subject: Re: bug#52558: Option for easier typing of regexps In-Reply-To: References: <87o85cvmek.fsf@gnus.org> <8228970e3e55e6b9f31a3cc30c6aad75@webmail.orcon.net.nz> Message-ID: <0857117dcca6f1d8a617ad1fa34a3450@webmail.orcon.net.nz> X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 52558 Cc: Lars Ingebrigtsen , 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2021-12-20 03:08, ndame wrote: > Why would it create confusion if it's an option which the > user has to enable explicitly? If the user is (a) well aware of the change they've made (not blindly copying it from somewhere else), and (b) have a good understanding of regexp syntax and/or the documentation such that they won't be asking anyone questions about regexps, then it shouldn't cause them any confusion. OTOH for someone who (a) doesn't have a strong understanding of Emacs regexp syntax; (b) is more familiar with other dialects with fewer backslashes; (c) enables the hypothetical option to make things seem more familiar but still doesn't entirely know what they're doing; and (d) asks questions or searches for pre- existing Q&As to figure out how to construct their regexp... I think there's ample opportunity for crossed wires on both sides of any ensuing interactions, and pre-existing information will likely not match the syntax that they have chosen. To me it feels like the kind of option which would be more likely to be preferred by people who are less familiar with Emacs regexp syntax, in which case the likelihood of confusion probably increases. I'm just speculating, though. -Phil From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 12:20:13 2021 Received: (at 52558) by debbugs.gnu.org; 19 Dec 2021 17:20:13 +0000 Received: from localhost ([127.0.0.1]:47943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myzr2-00079T-W5 for submit@debbugs.gnu.org; Sun, 19 Dec 2021 12:20:13 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:46239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myzr0-000796-SR for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 12:20:12 -0500 Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id CBAEF1C0009; Sun, 19 Dec 2021 17:20:03 +0000 (UTC) From: Juri Linkov To: ndame Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: Date: Sun, 19 Dec 2021 19:01:40 +0200 In-Reply-To: (ndame via's message of "Thu, 16 Dec 2021 17:41:17 +0000") Message-ID: <86v8zkkgxn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I use query replace regexp a lot, as I imagine other people do, and I > always found that typing capturing groups and alternation is clumsy, > because they have to be escaped, and they are the ones needed > most often: \(...\) \| > > There could be a user option to make these easier to type by providing > a variable which controls which characters need escaping in > interactive mode, so the user could list those characters for which > the escaping rules are reversed when typing in the regexp replace > prompt. Such option already exists, and it allows using custom regexp syntax both for isearch and query-replace: (setq search-default-mode (lambda (s &optional _lax) (let ((chars '("|" "(" ")")) (placeholder (format "@placeholder%s@" (int-to-string (buffer-modified-tick))))) (dolist (char chars) (setq s (replace-regexp-in-string placeholder char (replace-regexp-in-string char (concat "\\\\" char) (replace-regexp-in-string (concat "\\\\" char) placeholder s))))) s))) The same way more choices could be added easily to this user option, such as `pcre' or `rx'. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 12:39:49 2021 Received: (at 52558) by debbugs.gnu.org; 19 Dec 2021 17:39:49 +0000 Received: from localhost ([127.0.0.1]:48007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz0A1-0007fw-8D for submit@debbugs.gnu.org; Sun, 19 Dec 2021 12:39:49 -0500 Received: from mail-40130.protonmail.ch ([185.70.40.130]:55814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz09w-0007ff-Co for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 12:39:48 -0500 Date: Sun, 19 Dec 2021 17:39:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail2; t=1639935577; bh=VUpD51fE6f9W90ggbL8hDrAGHvzOINI7aWk2HAh8Ars=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc; b=qx7OdrdMJX0xQ/gcsRqjYXZbuXPkRsmchoXKoe3WtUVBV3/lkA5/amdFmUvec6ZlB 0LHonRxqL3HyhKgpMrIhEJT8a3fCz6/WOfI+wXHp1eBEWSvTc2BbIOhpwcnbNEvETE 0axOJ8BBolWdfSgNjF9ExTTUs1/PuSA8twFwSnoxTSLJT5blrWq0U1cDMoPtZpdfX/ 9BoPY9Ddrnl7FmBcdccTNmx9zIuHa1mM43Yd33q5HjQGoeGMWtxSZ9wbVZobJojOkK Gb7NgL7Vzy9mScJWhd4HPXm39cgkHnUMLxBECKfUH53CJGRBUOEB1YSA5+fMtbnHmg quYoyQ0cjMBng== To: Juri Linkov From: ndame Subject: Re: bug#52558: Option for easier typing of regexps Message-ID: In-Reply-To: <86v8zkkgxn.fsf@mail.linkov.net> References: <86v8zkkgxn.fsf@mail.linkov.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ndame Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Such option already exists, and it allows using custom regexp syntax > both for isearch and query-replace: Interesting, though its help mentions only isearch, so if I start M-x query-replace-regexp directly, it doesn't seem affected. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 12:53:11 2021 Received: (at 52558) by debbugs.gnu.org; 19 Dec 2021 17:53:11 +0000 Received: from localhost ([127.0.0.1]:48049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz0Mx-00084L-6H for submit@debbugs.gnu.org; Sun, 19 Dec 2021 12:53:11 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:55891) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz0Mv-000844-RD for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 12:53:10 -0500 Received: (Authenticated sender: juri@linkov.net) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 67CE620003; Sun, 19 Dec 2021 17:53:01 +0000 (UTC) From: Juri Linkov To: ndame Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: <86v8zkkgxn.fsf@mail.linkov.net> Date: Sun, 19 Dec 2021 19:52:29 +0200 In-Reply-To: (ndame's message of "Sun, 19 Dec 2021 17:39:35 +0000") Message-ID: <865yrkfpnm.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Such option already exists, and it allows using custom regexp syntax >> both for isearch and query-replace: > > Interesting, though its help mentions only isearch, so if I start > M-x query-replace-regexp directly, it doesn't seem affected. It affects all commands started from isearch: isearch-query-replace, isearch-occur, isearch-highlight-regexp. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 12:58:46 2021 Received: (at 52558) by debbugs.gnu.org; 19 Dec 2021 17:58:46 +0000 Received: from localhost ([127.0.0.1]:48053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz0SL-0008Bp-Px for submit@debbugs.gnu.org; Sun, 19 Dec 2021 12:58:45 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:55917) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz0SJ-0008Bc-TH for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 12:58:44 -0500 Received: (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id A5886100002; Sun, 19 Dec 2021 17:58:36 +0000 (UTC) From: Juri Linkov To: ndame Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: <86v8zkkgxn.fsf@mail.linkov.net> <865yrkfpnm.fsf@mail.linkov.net> Date: Sun, 19 Dec 2021 19:57:38 +0200 In-Reply-To: <865yrkfpnm.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 19 Dec 2021 19:52:29 +0200") Message-ID: <86zgoweaul.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> Such option already exists, and it allows using custom regexp syntax >>> both for isearch and query-replace: >> >> Interesting, though its help mentions only isearch, so if I start >> M-x query-replace-regexp directly, it doesn't seem affected. > > It affects all commands started from isearch: isearch-query-replace, > isearch-occur, isearch-highlight-regexp. It occurred to me now that when isearch-mode is disabled, these commands could call isearch-edit-string to read a search string, then proceed with their usual flow. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 13:39:37 2021 Received: (at 52558) by debbugs.gnu.org; 19 Dec 2021 18:39:37 +0000 Received: from localhost ([127.0.0.1]:48098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz15s-0002wO-VN for submit@debbugs.gnu.org; Sun, 19 Dec 2021 13:39:37 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:45905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz15r-0002w8-Fa for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 13:39:36 -0500 Received: (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 8E078100002; Sun, 19 Dec 2021 18:39:25 +0000 (UTC) From: Juri Linkov To: ndame Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: <86v8zkkgxn.fsf@mail.linkov.net> Date: Sun, 19 Dec 2021 20:38:10 +0200 In-Reply-To: (ndame's message of "Sun, 19 Dec 2021 17:39:35 +0000") Message-ID: <8635moe8z1.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Such option already exists, and it allows using custom regexp syntax >> both for isearch and query-replace: > > Interesting, though its help mentions only isearch, so if I start > M-x query-replace-regexp directly, it doesn't seem affected. If you want to use M-x query-replace directly, then simpler would be add replace-regexp-function that you can use with: (setq replace-regexp-function (lambda (s &optional _lax) (let ((chars '("|" "(" ")")) (placeholder (format "@placeholder%s@" (int-to-string (buffer-modified-tick))))) (dolist (char chars) (setq s (replace-regexp-in-string placeholder char (replace-regexp-in-string char (concat "\\\\" char) (replace-regexp-in-string (concat "\\\\" char) placeholder s))))) s))) diff --git a/lisp/replace.el b/lisp/replace.el index 0e81b15a09..84c2d523d7 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -2621,6 +2621,8 @@ replace-re-search-function It is called with three arguments, as if it were `re-search-forward'.") +(defvar replace-regexp-function nil) + (defun replace-search (search-string limit regexp-flag delimited-flag case-fold &optional backward) "Search for the next occurrence of SEARCH-STRING to replace." @@ -2633,7 +2635,8 @@ replace-search ;; outside of this function because then another I-search ;; used after `recursive-edit' might override them. (let* ((isearch-regexp regexp-flag) - (isearch-regexp-function (or delimited-flag + (isearch-regexp-function (or replace-regexp-function + delimited-flag (and replace-char-fold (not regexp-flag) #'char-fold-to-regexp))) -- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 13:49:03 2021 Received: (at 52558) by debbugs.gnu.org; 19 Dec 2021 18:49:03 +0000 Received: from localhost ([127.0.0.1]:48102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz1F0-0003CG-T2 for submit@debbugs.gnu.org; Sun, 19 Dec 2021 13:49:03 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:65493) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz1Ey-0003Bm-RU for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 13:49:01 -0500 Received: (Authenticated sender: juri@linkov.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id C479C40004; Sun, 19 Dec 2021 18:48:53 +0000 (UTC) From: Juri Linkov To: ndame Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> Date: Sun, 19 Dec 2021 20:48:18 +0200 In-Reply-To: <8635moe8z1.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 19 Dec 2021 20:38:10 +0200") Message-ID: <86wnk0ctxp.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> Such option already exists, and it allows using custom regexp syntax >>> both for isearch and query-replace: >> >> Interesting, though its help mentions only isearch, so if I start >> M-x query-replace-regexp directly, it doesn't seem affected. > > If you want to use M-x query-replace directly, > then simpler would be add replace-regexp-function > that you can use with: > > (setq replace-regexp-function And additional change is needed for correct highlighting: diff --git a/lisp/replace.el b/lisp/replace.el index 0e81b15a09..4302868520 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -2690,7 +2693,8 @@ replace-highlight (if query-replace-lazy-highlight (let ((isearch-string search-string) (isearch-regexp regexp-flag) - (isearch-regexp-function (or delimited-flag + (isearch-regexp-function (or replace-regexp-function + delimited-flag (and replace-char-fold (not regexp-flag) #'char-fold-to-regexp))) From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 19 23:44:09 2021 Received: (at 52558) by debbugs.gnu.org; 20 Dec 2021 04:44:09 +0000 Received: from localhost ([127.0.0.1]:48667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzAWu-0003UU-GP for submit@debbugs.gnu.org; Sun, 19 Dec 2021 23:44:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzAWk-0003Tm-Mx for 52558@debbugs.gnu.org; Sun, 19 Dec 2021 23:44:07 -0500 Received: from [2001:470:142:3::e] (port=57196 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzAWf-00060M-Cb; Sun, 19 Dec 2021 23:43:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=D3rCESA6iBNqRLlpuIv4/CovOjNbFtLvurzL3kSO5so=; b=q/IwjY5NliYA HKn7L2EsOBvGCTJ0dYuGZ6bMDUORMPAU7XMmjKcOGOYQfT7D9eO22KDLBnCVaxTC/tOQg3hw1wdUI Pp4UVZUMjTzQxpmIqQGEZaXPEXhW7DZV/udH3G0q6bJ+Dgv69mgItFGY526KIqRXQLWIwyesSUnUe KSCrEXodPuh6t/XUmzqLnlViy/xvUbtOfC+UqnQRNwzyhIH19N7og3o6+mmGBvlaeDg4Z/dAYBFMQ vLRaVPlv6nHr5N0MrQ0WlhiB/8V/2KZ2Uo6NiUfnFwO69HwN7Kz/2kNXAl2o2VGGSEa2RiulrG7TM 4aU+xeZJXAx3aYSuVL3h5A==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1mzAWf-0005Xc-GU; Sun, 19 Dec 2021 23:43:53 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Lars Ingebrigtsen In-Reply-To: <87o85cvmek.fsf@gnus.org> (message from Lars Ingebrigtsen on Sun, 19 Dec 2021 12:56:03 +0100) Subject: Re: bug#52558: Option for easier typing of regexps References: <87o85cvmek.fsf@gnus.org> Message-Id: Date: Sun, 19 Dec 2021 23:43:53 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52558 Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > I think it would be really confusing to have a different regexp syntax > when prompting interactively to when you're writing code, so I don't > think this would be a good idea. Actually, the two already are different, in precisely the way that you worry will be confusing. Regexps in Lisp code are in string constants, so you have to escape each backslash with a second backslash. Regexps in the minibuffer don't do that. "\\(foo\\|bar\\)" vs `\(foo\|bar\)'. It IS confusing. But I don't see a good way to simplify it. However, if we could invent a way to specify, "Use extended regexp syntax", where there are no backslashes for many of these constructs, we could unify the two. "(foo|bar)" and `(foo|bar)'. Unfortunately, there are many \-letter constructs which this change would not simplify. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 20 14:46:44 2021 Received: (at 52558) by debbugs.gnu.org; 20 Dec 2021 19:46:44 +0000 Received: from localhost ([127.0.0.1]:51508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzOcN-0002GK-PY for submit@debbugs.gnu.org; Mon, 20 Dec 2021 14:46:43 -0500 Received: from mail-pj1-f44.google.com ([209.85.216.44]:34788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzOcJ-0002G6-Rx for 52558@debbugs.gnu.org; Mon, 20 Dec 2021 14:46:43 -0500 Received: by mail-pj1-f44.google.com with SMTP id v13-20020a17090a088d00b001b0e3a74cf7so460060pjc.1 for <52558@debbugs.gnu.org>; Mon, 20 Dec 2021 11:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=X+pdhGtAkteAebLfgndVPpUxZ06/rFZz1CmNigWLmrQ=; b=ZS4aRdmqPjLoJSCFzuGD99jIHwJnED/SYB22VzuQgcw+s6GbeMkDOzFYWQ72dWT7Pe JuyLAYvM7BiCKMiiFx5ZiaNIyStO9QIa+lG0KWju7Z2cq6emVw2wQAYBqKr8thT0/jcQ CAadbbQrAtfPort/trECKxTNPPSk0PWF9qHK3Cx/gND4CLgH9mw4cLTiXCWshfQzS9Gi fPDjgKGw/xM0u7CcIZRubcthKVpi3ZAoq9wI70Xkcuq6C+3i0OLxjL+8VHZ0x+soVzEY tBv/DE2r9T6H4vzDqgpvbO3UE51BXjBZJVMWI1sBJ2WmCHVe/QXPIapNM2uckLn3Ffld WNyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=X+pdhGtAkteAebLfgndVPpUxZ06/rFZz1CmNigWLmrQ=; b=OCe3CR3h63lE4TCLE68orJ2+6wQxgDO9c01Hn4ruoNZ1QT6CEUTGf2W4/MzME4I5ei YTNvOGJZqYm0uiO57PIRH/ihWtuKChTmbU2LP5CvT3tMXKsFen1nhK1wQxf6mESVnwwO D8+iMLx0SKDbyuTtKd2AAfeyW4mZqy4z4YJs0O6RZMwkAYX3rUNm5DDuyxSMCSxd9sC5 uKS7OBru6d2MaIHYe4/Fhq7w8jUe0u/9fmvLJTCqYSRFs2FIE8qp5MtVFd/lr2A7Er0e vvNMgmNjP92zdj4sktN4BvJX6mnmAPU8031wTkfERs/Z5YiUR+DiAhXChucM3pJ/HISz We/g== X-Gm-Message-State: AOAM533SrwxCRyp/+BIisldsbbiqt1suBmDOkfj/MSrmhM/9FSnPWYZc RyOHYQ8dsnUXAXmUUylhw6nxJ5LP/fk= X-Google-Smtp-Source: ABdhPJzq6VUWszF52pqr6r3nxRoO61YPudY0JHmuzkbJHBx9IoX9hO9hfrulUwDBmjhUm5eo0mvPuQ== X-Received: by 2002:a17:90a:4b03:: with SMTP id g3mr598168pjh.167.1640029594002; Mon, 20 Dec 2021 11:46:34 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id s19sm19963720pfu.137.2021.12.20.11.46.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Dec 2021 11:46:33 -0800 (PST) Subject: Re: bug#52558: Option for easier typing of regexps To: Lars Ingebrigtsen , ndame References: <87o85cvmek.fsf@gnus.org> From: Jim Porter Message-ID: <0cac11c8-78c2-5625-d023-cda3bd4d7c9c@gmail.com> Date: Mon, 20 Dec 2021 11:46:32 -0800 MIME-Version: 1.0 In-Reply-To: <87o85cvmek.fsf@gnus.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 12/19/2021 3:56 AM, Lars Ingebrigtsen wrote: > I think it would be really confusing to have a different regexp syntax > when prompting interactively to when you're writing code, so I don't > think this would be a good idea. Anybody else have a different opinion? I think this depends on how people use Emacs. While there's definitely some potential for confusion if you switch between entering Emacs regexps interactively or by writing Elisp, there's also potential for confusion if you often write regexps for external tools from Emacs. For example, if you use one of the "modern" recursive grep-like tools (ack, ag, ripgrep, etc), most of them use PCRE syntax (or something close to PCRE). It's easy to forget that Isearch uses BRE but your preferred rgrep-like tool uses ERE/PCRE. I've attempted to resolve this issue in the other direction in Urgrep[1], which provides a unified way of running all these recursive grep-like tools. Specifically, it defaults to accepting BRE syntax and then, if the tool only accepts ERE/PCRE, it converts the BRE input into ERE/PCRE. That's not perfect either since then you end up in a situation where to use PCRE features, you have to enter them in a BRE-like syntax, which I find pretty confusing too. (This behavior is customizable in Urgrep, so if you like ERE/PCRE, you can set those as the input syntax.) I'm not sure this makes the decision about what to do any easier though. In fact, it probably just muddies the waters further. :) [1] https://github.com/jimporter/urgrep From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 21 23:16:25 2021 Received: (at 52558) by debbugs.gnu.org; 22 Dec 2021 04:16:25 +0000 Received: from localhost ([127.0.0.1]:56410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzt3B-0003t3-0t for submit@debbugs.gnu.org; Tue, 21 Dec 2021 23:16:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzt38-0003sm-Uw for 52558@debbugs.gnu.org; Tue, 21 Dec 2021 23:16:23 -0500 Received: from [2001:470:142:3::e] (port=51920 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzt33-00069I-Lv; Tue, 21 Dec 2021 23:16:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=s1s3TbyrvJKLBRC1C1OepGJ1+D6uAgOBDlMfO28I77Q=; b=W5wfFcVqDjN9 EnBZA9RWB+u63vSrjQ5BKNbOFY+Q7/klYNm5Z0wyg3OeInvsWjev1B75y2Ri4/E029rkFg1rLQ7op 4CQx9ebFCeTl2tI4ha1fEy5dhPsTDl83MFATM3EHIs459P8UTfmO9jxESAP8ZAtjFkLiHWmbicUKx Trz8dpAijfSG+1V2qqZv/V0WuL2n+QUgOoTbTY+H3ibFwyKEEYsaXuRhvFFIdq8WBlG94makWy2rZ wIiem4aXdaWhHcGbglsuzaf/Hty9POt7gANqzpvVHTp0V8xIFo/0vIQ6buvLwpeWw06bWW4zsw/Gp 660Y5Dds51V4W5nUYsUwKA==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1mzt33-0004rr-N0; Tue, 21 Dec 2021 23:16:17 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Jim Porter In-Reply-To: <0cac11c8-78c2-5625-d023-cda3bd4d7c9c@gmail.com> (message from Jim Porter on Mon, 20 Dec 2021 11:46:32 -0800) Subject: Re: bug#52558: Option for easier typing of regexps References: <87o85cvmek.fsf@gnus.org> <0cac11c8-78c2-5625-d023-cda3bd4d7c9c@gmail.com> Message-Id: Date: Tue, 21 Dec 2021 23:16:17 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52558 Cc: laszlomail@protonmail.com, larsi@gnus.org, 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > I've attempted to resolve this issue in the other direction in > Urgrep[1], which provides a unified way of running all these recursive > grep-like tools. Specifically, it defaults to accepting BRE syntax and > then, if the tool only accepts ERE/PCRE, it converts the BRE input into > ERE/PCRE. That's not perfect either since then you end up in a situation > where to use PCRE features, you have to enter them in a BRE-like syntax, > which I find pretty confusing too. (This behavior is customizable in > Urgrep, so if you like ERE/PCRE, you can set those as the input syntax.) I think it would be a big step forward if we could do something along these lines in Emacs. The details may be tricky, though. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 28 14:16:02 2021 Received: (at 52558) by debbugs.gnu.org; 28 Dec 2021 19:16:02 +0000 Received: from localhost ([127.0.0.1]:47430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2Hx4-0008Sk-0I for submit@debbugs.gnu.org; Tue, 28 Dec 2021 14:16:02 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:52443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2Hx1-0008SE-ER for 52558@debbugs.gnu.org; Tue, 28 Dec 2021 14:16:00 -0500 Received: (Authenticated sender: juri@linkov.net) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 1469320005; Tue, 28 Dec 2021 19:15:51 +0000 (UTC) From: Juri Linkov To: ndame Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> Date: Tue, 28 Dec 2021 21:15:32 +0200 In-Reply-To: <86wnk0ctxp.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 19 Dec 2021 20:48:18 +0200") Message-ID: <868rw4pmln.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> Such option already exists, and it allows using custom regexp syntax >>>> both for isearch and query-replace: >>> >>> Interesting, though its help mentions only isearch, so if I start >>> M-x query-replace-regexp directly, it doesn't seem affected. >> >> If you want to use M-x query-replace directly, >> then simpler would be add replace-regexp-function >> that you can use with: >> >> (setq replace-regexp-function > > And additional change is needed for correct highlighting: > > @@ -2690,7 +2693,8 @@ replace-highlight > + (isearch-regexp-function (or replace-regexp-function This is pushed to master, so now it's possible to provide a custom regexp converter for search and replace using isearch-regexp-function and replace-regexp-function. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 28 15:21:15 2021 Received: (at 52558) by debbugs.gnu.org; 28 Dec 2021 20:21:15 +0000 Received: from localhost ([127.0.0.1]:47512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2IyB-0003rn-39 for submit@debbugs.gnu.org; Tue, 28 Dec 2021 15:21:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2Iy9-0003rW-P5 for 52558@debbugs.gnu.org; Tue, 28 Dec 2021 15:21:14 -0500 Received: from [2001:470:142:3::e] (port=47010 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Iy0-00017q-I1; Tue, 28 Dec 2021 15:21:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=T+A9+6VYyHQoQr8oYy9bGFICYl5QTdHAjY1PWDZpP4g=; b=CMGuOu5dJcKT c0zqda+ibKOMBuYH2XQ9HYySjxQE/8hjTVhPUSwdwe7o9FJjLOyxNlX7WyyGVfaab8H4D/WRooQgH 6uwID5EE1RfVUy9EXMAdS9iz+1IOssOXtoQZXKehRyeFvBjConFCnELozXkN0yGM6WkqJcK2S8RLk bo/hXju7dedUhHvw1gL4PO81ymExOprgoK3sPZxVf6b+PL/UuhcOjyWuua7wLRyFItJLjqYrZIQPN f/nwyTNnQUwPYu6ufogaLQ4GYUb7fIf3rr5zLtSDX9QzuK7U8k1R6oa+XAZwLVLN0LQ49v6Y85Mjp roMubYfrZFi3Y3mDl2IfRA==; Received: from [87.69.77.57] (port=4902 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Ixy-0000bt-EL; Tue, 28 Dec 2021 15:21:04 -0500 Date: Tue, 28 Dec 2021 22:21:02 +0200 Message-Id: <83ee5wlbv5.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <868rw4pmln.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 28 Dec 2021 21:15:32 +0200) Subject: Re: bug#52558: Option for easier typing of regexps References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <868rw4pmln.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52558 Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Date: Tue, 28 Dec 2021 21:15:32 +0200 > Cc: 52558@debbugs.gnu.org > > >> (setq replace-regexp-function > > > > And additional change is needed for correct highlighting: > > > > @@ -2690,7 +2693,8 @@ replace-highlight > > + (isearch-regexp-function (or replace-regexp-function > > This is pushed to master, so now it's possible to provide a custom > regexp converter for search and replace using isearch-regexp-function > and replace-regexp-function. Thanks, but the doc string of the new function is hard to understand: > +(defvar replace-regexp-function nil > + "Function to convert a search string to a regexp to replace. > +It's bound to `isearch-regexp-function' when searching > +for a string to replace.") The first sentence is unclear: what do you mean by "convert a search string to a regexp to replace"? What "search string" is being converted to regexp, and how does "replace" enter this picture? And this: It's bound to `isearch-regexp-function' when searching seems to be incorrect: it's isearch-regexp-function that's bound to replace-regexp-function, not the other way around. Can you clarify the doc string, please? From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 28 15:27:35 2021 Received: (at 52558) by debbugs.gnu.org; 28 Dec 2021 20:27:35 +0000 Received: from localhost ([127.0.0.1]:47525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2J4J-00041W-6K for submit@debbugs.gnu.org; Tue, 28 Dec 2021 15:27:35 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:47927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2J4H-00041I-BR for 52558@debbugs.gnu.org; Tue, 28 Dec 2021 15:27:33 -0500 Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 486401BF203; Tue, 28 Dec 2021 20:27:25 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <868rw4pmln.fsf@mail.linkov.net> <83ee5wlbv5.fsf@gnu.org> Date: Tue, 28 Dec 2021 22:25:56 +0200 In-Reply-To: <83ee5wlbv5.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 28 Dec 2021 22:21:02 +0200") Message-ID: <867dboo4rv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Thanks, but the doc string of the new function is hard to understand: > >> +(defvar replace-regexp-function nil >> + "Function to convert a search string to a regexp to replace. >> +It's bound to `isearch-regexp-function' when searching >> +for a string to replace.") > > The first sentence is unclear: what do you mean by "convert a search > string to a regexp to replace"? What "search string" is being > converted to regexp, and how does "replace" enter this picture? It has a reference to `isearch-regexp-function' that has a complete explanation to avoid duplication of the docstring. > And this: > > It's bound to `isearch-regexp-function' when searching > > seems to be incorrect: it's isearch-regexp-function that's bound to > replace-regexp-function, not the other way around. Maybe this is better: `isearch-regexp-function' is bound to it when searching From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 28 15:35:31 2021 Received: (at 52558) by debbugs.gnu.org; 28 Dec 2021 20:35:31 +0000 Received: from localhost ([127.0.0.1]:47554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2JBz-0004Fj-0Y for submit@debbugs.gnu.org; Tue, 28 Dec 2021 15:35:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2JBx-0004FU-8P for 52558@debbugs.gnu.org; Tue, 28 Dec 2021 15:35:29 -0500 Received: from [2001:470:142:3::e] (port=48762 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2JBr-0004Iy-RI; Tue, 28 Dec 2021 15:35:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=f4pZWwTS4eBVi9UnFFhKtH8y9NyCobfiX3vb8UnGEP0=; b=DPoKRW3EuIF2 tgrLjiA8YI0fWN18AEHD4nkomM9geYZwWfwzrGM1k0ac1MLZXtBGUUjwrS+xOfPuP0zJ05nbpFusG Lg/L7hmCalwmCrpp/USQLo3Ua+e9OEGiKavoTFETx5s+iHKUsqcd/hVf8oocFdgG+riaWSjedVOa2 yiae6Xr8klxYnMlMEe6B7TheWDKJr0K6EXfSl/24oD2ADU0xdA9TJNCY06DUadPYVGSAMalpl14xb wNe45rNhkALZUBB7M8s40qwp4+XtHBfLg+N3GER3bO2JpLP+1TlzBWMH2V5AxGLNM1P1pRFYTY48p i5QQwXnxN5fLPPzwTcoEGg==; Received: from [87.69.77.57] (port=1877 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2JBr-0000lt-QF; Tue, 28 Dec 2021 15:35:24 -0500 Date: Tue, 28 Dec 2021 22:35:19 +0200 Message-Id: <83czlglb7c.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <867dboo4rv.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 28 Dec 2021 22:25:56 +0200) Subject: Re: bug#52558: Option for easier typing of regexps References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <868rw4pmln.fsf@mail.linkov.net> <83ee5wlbv5.fsf@gnu.org> <867dboo4rv.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52558 Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org > Date: Tue, 28 Dec 2021 22:25:56 +0200 > > >> +(defvar replace-regexp-function nil > >> + "Function to convert a search string to a regexp to replace. > >> +It's bound to `isearch-regexp-function' when searching > >> +for a string to replace.") > > > > The first sentence is unclear: what do you mean by "convert a search > > string to a regexp to replace"? What "search string" is being > > converted to regexp, and how does "replace" enter this picture? > > It has a reference to `isearch-regexp-function' that has > a complete explanation to avoid duplication of the docstring. I don't think this is enough. First, the first sentence of the above doc string doesn't have any such reference, so Apropos commands, which show only the first sentence, will not have that reference. And second, the doc string of isearch-regexp-function says nothing about replacements. There's no need to repeat the whole story you have in isearch-regexp-function, just to say enough for the reader to understand what is this function about and what it is used for. > > It's bound to `isearch-regexp-function' when searching > > > > seems to be incorrect: it's isearch-regexp-function that's bound to > > replace-regexp-function, not the other way around. > > Maybe this is better: > > `isearch-regexp-function' is bound to it when searching Yes, definitely better. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 28 15:53:02 2021 Received: (at 52558) by debbugs.gnu.org; 28 Dec 2021 20:53:02 +0000 Received: from localhost ([127.0.0.1]:47565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2JSv-0004ge-Pt for submit@debbugs.gnu.org; Tue, 28 Dec 2021 15:53:02 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:36463) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2JSu-0004gO-QX for 52558@debbugs.gnu.org; Tue, 28 Dec 2021 15:53:01 -0500 Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 8F5381BF203; Tue, 28 Dec 2021 20:52:53 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <868rw4pmln.fsf@mail.linkov.net> <83ee5wlbv5.fsf@gnu.org> <867dboo4rv.fsf@mail.linkov.net> <83czlglb7c.fsf@gnu.org> Date: Tue, 28 Dec 2021 22:51:09 +0200 In-Reply-To: <83czlglb7c.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 28 Dec 2021 22:35:19 +0200") Message-ID: <86pmpgmp1e.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> >> +(defvar replace-regexp-function nil >> >> + "Function to convert a search string to a regexp to replace. >> >> +It's bound to `isearch-regexp-function' when searching >> >> +for a string to replace.") >> > >> > The first sentence is unclear: what do you mean by "convert a search >> > string to a regexp to replace"? What "search string" is being >> > converted to regexp, and how does "replace" enter this picture? >> >> It has a reference to `isearch-regexp-function' that has >> a complete explanation to avoid duplication of the docstring. > > I don't think this is enough. First, the first sentence of the above > doc string doesn't have any such reference, so Apropos commands, which > show only the first sentence, will not have that reference. But "isearch-regexp-function" is too long for the first sentence. > And second, the doc string of isearch-regexp-function says nothing > about replacements. It should say nothing about replacements. This is explained in the second sentence: `isearch-regexp-function' is bound to it when searching for a string to replace. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 29 07:32:31 2021 Received: (at 52558) by debbugs.gnu.org; 29 Dec 2021 12:32:31 +0000 Received: from localhost ([127.0.0.1]:48174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2Y86-0000Ti-SB for submit@debbugs.gnu.org; Wed, 29 Dec 2021 07:32:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2Y83-0000NM-VI for 52558@debbugs.gnu.org; Wed, 29 Dec 2021 07:32:29 -0500 Received: from [2001:470:142:3::e] (port=36920 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Y7y-0001Q5-2j; Wed, 29 Dec 2021 07:32:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=etml0HahdTy8aJNtXwf8gCU68vzy/82tfb4Ag2xm+gI=; b=ehrvTBUS7sG9 0SxNZlTbnFEGj9WxLZKqBjKMKyHIfPAaFUnZTCiKjRoFn7gdY4zEfYMFiKMl2p66HxOxcDXt7lj+s dAQKWACrrsMj8AlXm1JFD5OkPSnMrRkaUczFmzLiTyz3Sf0j7sktQysL0gJU/OYg1/xIvrN32QPyy /YbtuLrI3vCoblfUrntGknaRXLRnjF7nzsxn5TdcLnkAQc/KClNene58R2KJ9Hp89Dbm1gp/yItDI gMozo/2Vi3E7R/W64/sMWh4BxnPNK6F50zZt0bha8oESrbRPaQ7XLFaMrO3Pd3Pg+vFxInrXsXkrv 3zzHU958XMGSnjFxqrbp/A==; Received: from [87.69.77.57] (port=1033 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Y7y-00043M-1k; Wed, 29 Dec 2021 07:32:22 -0500 Date: Wed, 29 Dec 2021 14:32:24 +0200 Message-Id: <83bl0zlhgn.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <86pmpgmp1e.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 28 Dec 2021 22:51:09 +0200) Subject: Re: bug#52558: Option for easier typing of regexps References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <868rw4pmln.fsf@mail.linkov.net> <83ee5wlbv5.fsf@gnu.org> <867dboo4rv.fsf@mail.linkov.net> <83czlglb7c.fsf@gnu.org> <86pmpgmp1e.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52558 Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org > Date: Tue, 28 Dec 2021 22:51:09 +0200 > > >> >> +(defvar replace-regexp-function nil > >> >> + "Function to convert a search string to a regexp to replace. > >> >> +It's bound to `isearch-regexp-function' when searching > >> >> +for a string to replace.") > >> > > >> > The first sentence is unclear: what do you mean by "convert a search > >> > string to a regexp to replace"? What "search string" is being > >> > converted to regexp, and how does "replace" enter this picture? > >> > >> It has a reference to `isearch-regexp-function' that has > >> a complete explanation to avoid duplication of the docstring. > > > > I don't think this is enough. First, the first sentence of the above > > doc string doesn't have any such reference, so Apropos commands, which > > show only the first sentence, will not have that reference. > > But "isearch-regexp-function" is too long for the first sentence. Yes. But I didn't mean to include that name in the first sentence, I meant to say that we should say there something to better explain the purpose. > > And second, the doc string of isearch-regexp-function says nothing > > about replacements. > > It should say nothing about replacements. This is explained > in the second sentence: > > `isearch-regexp-function' is bound to it when searching > for a string to replace. So we have now made a full circle, and came back to what I said initially: "searching for a string to replace" doesn't explain itself, because the relevance of this to some search of a string and to some replacement is not clear. How about if you try to explain it to me in your own words, without paying attention to the constraints of a doc string, and I will then try to propose a more formal wording? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 29 12:18:59 2021 Received: (at 52558) by debbugs.gnu.org; 29 Dec 2021 17:18:59 +0000 Received: from localhost ([127.0.0.1]:50222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2cbK-0008Ih-QX for submit@debbugs.gnu.org; Wed, 29 Dec 2021 12:18:59 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:37879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2cbJ-0008IQ-RR for 52558@debbugs.gnu.org; Wed, 29 Dec 2021 12:18:58 -0500 Received: (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 9E2CC20000B; Wed, 29 Dec 2021 17:18:49 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <868rw4pmln.fsf@mail.linkov.net> <83ee5wlbv5.fsf@gnu.org> <867dboo4rv.fsf@mail.linkov.net> <83czlglb7c.fsf@gnu.org> <86pmpgmp1e.fsf@mail.linkov.net> <83bl0zlhgn.fsf@gnu.org> Date: Wed, 29 Dec 2021 19:17:51 +0200 In-Reply-To: <83bl0zlhgn.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 29 Dec 2021 14:32:24 +0200") Message-ID: <86v8z71gao.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> >> >> +(defvar replace-regexp-function nil >> >> >> + "Function to convert a search string to a regexp to replace. >> >> >> +It's bound to `isearch-regexp-function' when searching >> >> >> +for a string to replace.") >> >> > >> >> > The first sentence is unclear: what do you mean by "convert a search >> >> > string to a regexp to replace"? What "search string" is being >> >> > converted to regexp, and how does "replace" enter this picture? >> >> >> >> It has a reference to `isearch-regexp-function' that has >> >> a complete explanation to avoid duplication of the docstring. >> > >> > I don't think this is enough. First, the first sentence of the above >> > doc string doesn't have any such reference, so Apropos commands, which >> > show only the first sentence, will not have that reference. >> >> But "isearch-regexp-function" is too long for the first sentence. > > Yes. But I didn't mean to include that name in the first sentence, I > meant to say that we should say there something to better explain the > purpose. > >> > And second, the doc string of isearch-regexp-function says nothing >> > about replacements. >> >> It should say nothing about replacements. This is explained >> in the second sentence: >> >> `isearch-regexp-function' is bound to it when searching >> for a string to replace. > > So we have now made a full circle, and came back to what I said > initially: "searching for a string to replace" doesn't explain itself, > because the relevance of this to some search of a string and to some > replacement is not clear. > > How about if you try to explain it to me in your own words, without > paying attention to the constraints of a doc string, and I will then > try to propose a more formal wording? query-replace uses isearch functions to search the next occurrence to replace. The new variable replace-regexp-function is intended just to set the value of isearch-regexp-function that is used by isearch functions. And isearch-regexp-function already has 18 lines of its docstring that explains all details. This is why it's important to have a link to isearch-regexp-function in the docstring of replace-regexp-function. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 29 13:26:05 2021 Received: (at 52558) by debbugs.gnu.org; 29 Dec 2021 18:26:05 +0000 Received: from localhost ([127.0.0.1]:50336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2deH-00047q-Lm for submit@debbugs.gnu.org; Wed, 29 Dec 2021 13:26:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2deF-00047G-5j for 52558@debbugs.gnu.org; Wed, 29 Dec 2021 13:26:04 -0500 Received: from [2001:470:142:3::e] (port=47406 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2de9-0006WY-TE; Wed, 29 Dec 2021 13:25:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=oOrHDqQKoxjQ5/h2QgpWTnyQ+jzJjqdr1mLZ3ZFUaoo=; b=DajeYIjnZdND ypARfMO+swuI/32T7iJcdIaafO5dIsiOJvrSCJ0R+EJLIZl90BL+Hqg8be/izQeChbHrIBSgKcZ3K 6FffaEQWFJc+FzgQmBz9PEedg600wABs86GNQfDulTAnRg343OJ6pDMdLYBW9P5mMqeH7OXnF2bZv GjxyOLAqJfnISA+9PvXeq29dM95L8lpyDAQaH+IjUapV92ZTi16A2R87syBnTVrC6Ejr5fvVRmz1y vD/ghJeeM3cOWg5HnBcqABZk2UDL0xt5LhuI1+9dEyzMCSNXNQnp1TDYhlPRylYgvAq1GvFmEF0h+ oDTNvDXMj8VgMhe6/xGXUQ==; Received: from [87.69.77.57] (port=3017 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2de9-0003ye-CG; Wed, 29 Dec 2021 13:25:58 -0500 Date: Wed, 29 Dec 2021 20:25:59 +0200 Message-Id: <83a6gjjmiw.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <86v8z71gao.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 29 Dec 2021 19:17:51 +0200) Subject: Re: bug#52558: Option for easier typing of regexps References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <868rw4pmln.fsf@mail.linkov.net> <83ee5wlbv5.fsf@gnu.org> <867dboo4rv.fsf@mail.linkov.net> <83czlglb7c.fsf@gnu.org> <86pmpgmp1e.fsf@mail.linkov.net> <83bl0zlhgn.fsf@gnu.org> <86v8z71gao.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52558 Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org > Date: Wed, 29 Dec 2021 19:17:51 +0200 > > query-replace uses isearch functions to search the next occurrence to replace. > The new variable replace-regexp-function is intended just to set > the value of isearch-regexp-function that is used by isearch functions. > And isearch-regexp-function already has 18 lines of its docstring > that explains all details. This is why it's important to have a link > to isearch-regexp-function in the docstring of replace-regexp-function. Thanks, I used this to clarify the doc string. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 22 09:23:39 2022 Received: (at 52558) by debbugs.gnu.org; 22 Jan 2022 14:23:39 +0000 Received: from localhost ([127.0.0.1]:36066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBHIo-0003gK-VR for submit@debbugs.gnu.org; Sat, 22 Jan 2022 09:23:39 -0500 Received: from quimby.gnus.org ([95.216.78.240]:46438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBHIn-0003g4-4V for 52558@debbugs.gnu.org; Sat, 22 Jan 2022 09:23:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=yKloyf1raFXksh4L9k+AWbQ5y7PrsP0vWodTPKXhjG0=; b=SxqRPvDsZVJDE/Ra77uqB1xLVB QilJgwHTyDPSfL4oqmAtXzat/Q2v8rFL4CkjzAwF523tCsmKTHWmKGcxk/g7Q/yXw98a1g1FiQeR6 gkM0DBEMkmRdIb69a6SDwWeIxth7SaROX26paHMmQ3tw4Zz/XEmZxDc/xdVX7Cn5xVUQ=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nBHIe-0005z4-6x; Sat, 22 Jan 2022 15:23:31 +0100 From: Lars Ingebrigtsen To: Juri Linkov Subject: Re: bug#52558: Option for easier typing of regexps References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> X-Now-Playing: Richard Strange's _The Live Rise of Richard Strange_: "I Won't Run Away" Date: Sat, 22 Jan 2022 15:23:27 +0100 In-Reply-To: <86wnk0ctxp.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 19 Dec 2021 20:48:18 +0200") Message-ID: <87tudvj1cw.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: >> If you want to use M-x query-replace directly, >> then simpler would be add replace-regexp-function >> that you can use with: >> >> (setq replace-regexp-function > > And additional change is needed [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52558 Cc: ndame , 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: >> If you want to use M-x query-replace directly, >> then simpler would be add replace-regexp-function >> that you can use with: >> >> (setq replace-regexp-function > > And additional change is needed for correct highlighting: > > diff --git a/lisp/replace.el b/lisp/replace.el > index 0e81b15a09..4302868520 100644 > --- a/lisp/replace.el > +++ b/lisp/replace.el > @@ -2690,7 +2693,8 @@ replace-highlight > (if query-replace-lazy-highlight > (let ((isearch-string search-string) > (isearch-regexp regexp-flag) > - (isearch-regexp-function (or delimited-flag > + (isearch-regexp-function (or replace-regexp-function > + delimited-flag > (and replace-char-fold Re-skimming this thread, I think these extensions make sense, so perhaps you should just push them? (With a NEWS item, I guess.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 22 14:03:18 2022 Received: (at 52558) by debbugs.gnu.org; 22 Jan 2022 19:03:18 +0000 Received: from localhost ([127.0.0.1]:37910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBLfS-0003dD-8D for submit@debbugs.gnu.org; Sat, 22 Jan 2022 14:03:18 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:45989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBLfQ-0003cy-0X for 52558@debbugs.gnu.org; Sat, 22 Jan 2022 14:03:17 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id F06D220004; Sat, 22 Jan 2022 19:03:07 +0000 (UTC) From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <87tudvj1cw.fsf@gnus.org> Date: Sat, 22 Jan 2022 21:01:53 +0200 In-Reply-To: <87tudvj1cw.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 22 Jan 2022 15:23:27 +0100") Message-ID: <86y237zja6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: ndame , 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> If you want to use M-x query-replace directly, >>> then simpler would be add replace-regexp-function >>> that you can use with: >>> >>> (setq replace-regexp-function >> >> And additional change is needed for correct highlighting: >> >> diff --git a/lisp/replace.el b/lisp/replace.el >> index 0e81b15a09..4302868520 100644 >> --- a/lisp/replace.el >> +++ b/lisp/replace.el >> @@ -2690,7 +2693,8 @@ replace-highlight >> (if query-replace-lazy-highlight >> (let ((isearch-string search-string) >> (isearch-regexp regexp-flag) >> - (isearch-regexp-function (or delimited-flag >> + (isearch-regexp-function (or replace-regexp-function >> + delimited-flag >> (and replace-char-fold > > Re-skimming this thread, I think these extensions make sense, so perhaps > you should just push them? (With a NEWS item, I guess.) This patch was pushed, but does it really need a NEWS item? It was intended as a basis for a new user-facing feature that could be now implemented and described in NEWS. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 23 07:36:36 2022 Received: (at 52558) by debbugs.gnu.org; 23 Jan 2022 12:36:37 +0000 Received: from localhost ([127.0.0.1]:38763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBc6m-0001ZF-LF for submit@debbugs.gnu.org; Sun, 23 Jan 2022 07:36:36 -0500 Received: from quimby.gnus.org ([95.216.78.240]:37570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBc6k-0001Z1-4O for 52558@debbugs.gnu.org; Sun, 23 Jan 2022 07:36:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=K5dhODIST1AyeXthx8h7c6GmnzXl420Kj+t9k81R/7E=; b=pre0ruLc4aPwbRl4Wv6M0w2A5H GnpXjTflHF6v2YRIAHu+wY+t+uEJ5tmOvhEb17ahdbrSmk7maJbzPkdFPVFl4RE5fjYzDq8E1kq63 dB9HoOhUbftyi31AmP0FUR42ZEvYwEXw60s4MGLEGkjICM6lL5rrtfyUWWxhF3F438mk=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nBc6b-0004wy-9X; Sun, 23 Jan 2022 13:36:27 +0100 From: Lars Ingebrigtsen To: Juri Linkov Subject: Re: bug#52558: Option for easier typing of regexps References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <87tudvj1cw.fsf@gnus.org> <86y237zja6.fsf@mail.linkov.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEUtKjA6Qk5MWFwm HyO1l1x9jZtPcpL///9nLqjFAAAAAWJLR0QHFmGI6wAAAAd0SU1FB+YBFwwQAL+//5wAAAGxSURB VDjLZZM9bsMwDIVFCehscvAsctCcIDco2iPYcy2guv8RSuonkVLGQGx95nskJTvXAxBxc0CiwUyb rYXHzf4QDVdg77jgbL2xmofIhPXp8QgdALC02BrRX3eSL4tP4foYhs0dG/hm7OBhKahSFRxHHMXW 97XGBr4/oXloioVnvZoHNClVum/mzDSDYKCWZb01gM+M2wqAJm81EcEGHLg5vE6pg/fgbQJhAkNq lPvcFKYGSFbg2Tfg1wyQza99zKwFum1aDTdE6mTthFAm8ELwVGJRKVgtqB4TWjxUq5QhtQCg8/c8 s2W5tWD/e5zHka3cFVAqRznOkt9GAkVNLN7BXrDkYtcCdudLTFcqomwGHxuUa88VlAVEBR/Z9Fbg f1wqPuM/AGzuGeUJttF3BZIxleTsS2DmWEH0FUg6d1XNrwzRenW0jjI4lbu6x50SFhYbkgokJWPC KFcHzjtrZrSJdKVI9fOTmlHiMMmJvQGIdvR7CprWfhkIngxIS2Hdcdqz1/ugLYlqSU3RSRNpobEd GNRNyyVHvYmaoqOKo5JqnwEJiXEGJHU3dTZACAP8AcQ+cWvz2CwmAAAAJXRFWHRkYXRlOmNyZWF0 ZQAyMDIyLTAxLTIzVDEyOjE2OjAwKzAwOjAwORnwpQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0w MS0yM1QxMjoxNjowMCswMDowMEhESBkAAAAASUVORK5CYII= X-Now-Playing: Sade's _Promise_: "Jezebel" Date: Sun, 23 Jan 2022 13:36:24 +0100 In-Reply-To: <86y237zja6.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 22 Jan 2022 21:01:53 +0200") Message-ID: <87wniq8w8n.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: >>> - (isearch-regexp-function (or delimited-flag >>> + (isearch-regexp-function (or replace-regexp-function >>> + delimited-flag >>> (and replace-char-fold >> >> Re-skimming this thread, I think thes [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52558 Cc: ndame , 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: >>> - (isearch-regexp-function (or delimited-flag >>> + (isearch-regexp-function (or replace-regexp-function >>> + delimited-flag >>> (and replace-char-fold >> >> Re-skimming this thread, I think these extensions make sense, so perhaps >> you should just push them? (With a NEWS item, I guess.) > > This patch was pushed, but does it really need a NEWS item? > It was intended as a basis for a new user-facing feature > that could be now implemented and described in NEWS. What was the new user-facing feature? I thought the point of this was to just allow users to implement their own replace-regexp-function and have it work more consistently, which your change fixed... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 23 13:24:49 2022 Received: (at 52558) by debbugs.gnu.org; 23 Jan 2022 18:24:49 +0000 Received: from localhost ([127.0.0.1]:41219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBhXl-0003yj-GH for submit@debbugs.gnu.org; Sun, 23 Jan 2022 13:24:49 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:47277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBhXe-0003y4-P6 for 52558@debbugs.gnu.org; Sun, 23 Jan 2022 13:24:43 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id CBC321C0002; Sun, 23 Jan 2022 18:24:34 +0000 (UTC) From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <87tudvj1cw.fsf@gnus.org> <86y237zja6.fsf@mail.linkov.net> <87wniq8w8n.fsf@gnus.org> Date: Sun, 23 Jan 2022 20:09:11 +0200 In-Reply-To: <87wniq8w8n.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 23 Jan 2022 13:36:24 +0100") Message-ID: <867daquxx4.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: ndame , 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> - (isearch-regexp-function (or delimited-flag >>>> + (isearch-regexp-function (or replace-regexp-function >>>> + delimited-flag >>>> (and replace-char-fold >>> >>> Re-skimming this thread, I think these extensions make sense, so perhaps >>> you should just push them? (With a NEWS item, I guess.) >> >> This patch was pushed, but does it really need a NEWS item? >> It was intended as a basis for a new user-facing feature >> that could be now implemented and described in NEWS. > > What was the new user-facing feature? I thought the point of this was > to just allow users to implement their own replace-regexp-function and > have it work more consistently, which your change fixed... This means that after adding a NEWS item this feature request can be closed? From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 23 13:29:58 2022 Received: (at 52558) by debbugs.gnu.org; 23 Jan 2022 18:29:59 +0000 Received: from localhost ([127.0.0.1]:41233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBhck-00047S-ML for submit@debbugs.gnu.org; Sun, 23 Jan 2022 13:29:58 -0500 Received: from quimby.gnus.org ([95.216.78.240]:41042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBhci-00047F-Re for 52558@debbugs.gnu.org; Sun, 23 Jan 2022 13:29:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lhtqNQ5r2/7351oomBNhj+0JrlGEx2xxoWpFFO9X18U=; b=up6W1yOeKqUxOU8vbbYwv0vXv/ 6TxAoS4KYiJPslWokazLTzsqC8y3PZfmXZr/kTyRilZ3JHk9+cf9PB3pjNeG+oV3B8Z8BW5n3mM1N lkVdZazsFAxpio7YMXhDVaSYKrewRrFl+HfJMyeKu6LpS20Lw+Vt/lA+/Osyu7HXw+rE=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nBhca-0007O0-As; Sun, 23 Jan 2022 19:29:50 +0100 From: Lars Ingebrigtsen To: Juri Linkov Subject: Re: bug#52558: Option for easier typing of regexps References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <87tudvj1cw.fsf@gnus.org> <86y237zja6.fsf@mail.linkov.net> <87wniq8w8n.fsf@gnus.org> <867daquxx4.fsf@mail.linkov.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEXw6dX7+Omqp52D gntFR0T///9bmYzmAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+YBFxIcGWHZlioAAAGgSURBVDjLjZSB ccMgDEUF7gCQLkAFA7igCYz2n6lfgJO0ie+qy3GxniV9JCVE1+bitPkUYgzx2Q0LcJOd5H6DYW6A 8ArgThxfImYdju4FeAPJxTcRjubxt8bUFy9APEEgnzxXzsw5t1YnuHFrTZf1xvg+7xEA9I7GS3GC RMwpa+utIlXyolYdAKodnhrXzChGeUVEitHLoQflVmtj3vpDFfuu+k25tkpc9A5cqKLSkadoohOg BtMQ9eUCNHDW2atgvbMr6B4o9wewGtJFVSq5LBXp8PYC8OKTaNOe/ASz1+bWTq6oVv4YqdbYivay mzbUKiew8XPpOdHZyngCdKtte7qZ6CYGVg1PHjemDT6Tt0Bw50rKI5XJRQkewK9ZPQCn4S/mPpjl rOHHqGs2v3Rv3XUjQoZ8tVPkSOjV3MSb3HMfH6Wmra0L3u7+vH/K7n1b81gAQ08QULFYSs8RVsVj JzqANQnKij4brt5nr7CJtWE5MrYK68bYldXd91t94Q9X4E+qsPr8AmIIAX8Bb8BTqPtXjV8hV/4l Y/643bnLRD/tfnRPPiimNAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wMS0yM1QxODoyODoyNSsw MDowMJRw6OsAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDEtMjNUMTg6Mjg6MjUrMDA6MDDlLVBX AAAAAElFTkSuQmCC X-Now-Playing: David Byrne's _Music for The Knee Plays_: "The Sound of Business" Date: Sun, 23 Jan 2022 19:29:46 +0100 In-Reply-To: <867daquxx4.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 23 Jan 2022 20:09:11 +0200") Message-ID: <87ee4y71b9.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: >> What was the new user-facing feature? I thought the point of this was >> to just allow users to implement their own replace-regexp-function and >> have it work more consistently, which your change [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52558 Cc: ndame , 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: >> What was the new user-facing feature? I thought the point of this was >> to just allow users to implement their own replace-regexp-function and >> have it work more consistently, which your change fixed... > > This means that after adding a NEWS item this feature request can be closed? I think so? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 13:47:48 2022 Received: (at 52558) by debbugs.gnu.org; 24 Jan 2022 18:47:48 +0000 Received: from localhost ([127.0.0.1]:45831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC4NX-0006op-SC for submit@debbugs.gnu.org; Mon, 24 Jan 2022 13:47:48 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:50777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC4NU-0006ir-Nv; Mon, 24 Jan 2022 13:47:46 -0500 Received: (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 08717200011; Mon, 24 Jan 2022 18:47:24 +0000 (UTC) From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#52558: Option for easier typing of regexps Organization: LINKOV.NET References: <86v8zkkgxn.fsf@mail.linkov.net> <8635moe8z1.fsf@mail.linkov.net> <86wnk0ctxp.fsf@mail.linkov.net> <87tudvj1cw.fsf@gnus.org> <86y237zja6.fsf@mail.linkov.net> <87wniq8w8n.fsf@gnus.org> <867daquxx4.fsf@mail.linkov.net> <87ee4y71b9.fsf@gnus.org> Date: Mon, 24 Jan 2022 20:46:57 +0200 In-Reply-To: <87ee4y71b9.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 23 Jan 2022 19:29:46 +0100") Message-ID: <86r18xynry.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52558 Cc: ndame , 52558@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 52558 29.0.50 stop >>> What was the new user-facing feature? I thought the point of this was >>> to just allow users to implement their own replace-regexp-function and >>> have it work more consistently, which your change fixed... >> >> This means that after adding a NEWS item this feature request can be closed? > > I think so? So now this is mentioned in NEWS and closed. For further possible uses of the new variable, a new feature request could be created. From unknown Thu Jun 19 14:30:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 22 Feb 2022 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator