From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#54017: add regexp translation option to read-regexp Date: Thu, 17 Feb 2022 10:24:14 +0200 Organization: LINKOV.NET Message-ID: <86pmnlew9d.fsf@mail.linkov.net> References: <8635kj2h7s.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5037"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 54017@debbugs.gnu.org To: emacsq Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 17 10:03:08 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nKcgu-00011p-Fi for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Feb 2022 10:03:08 +0100 Original-Received: from localhost ([::1]:56668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKcgt-0006dx-4W for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Feb 2022 04:03:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKcBu-0006KP-TP for bug-gnu-emacs@gnu.org; Thu, 17 Feb 2022 03:31:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKcBq-0002L5-6V for bug-gnu-emacs@gnu.org; Thu, 17 Feb 2022 03:31:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nKcBq-0000AZ-0e for bug-gnu-emacs@gnu.org; Thu, 17 Feb 2022 03:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Feb 2022 08:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54017 X-GNU-PR-Package: emacs Original-Received: via spool by 54017-submit@debbugs.gnu.org id=B54017.1645086618579 (code B ref 54017); Thu, 17 Feb 2022 08:31:01 +0000 Original-Received: (at 54017) by debbugs.gnu.org; 17 Feb 2022 08:30:18 +0000 Original-Received: from localhost ([127.0.0.1]:50067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKcB8-00009G-1F for submit@debbugs.gnu.org; Thu, 17 Feb 2022 03:30:18 -0500 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:48203) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKcB6-00008x-Jg for 54017@debbugs.gnu.org; Thu, 17 Feb 2022 03:30:17 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 644EC60007; Thu, 17 Feb 2022 08:30:07 +0000 (UTC) In-Reply-To: (emacsq's message of "Wed, 16 Feb 2022 19:28:14 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:227072 Archived-At: >> This user option already exists. It's name is 'search-default-mode'. > > Does that option affect every command where read regexp is used? > Because this bug is about that. > > So regexp translation for occur, flush/keep-lines, highlight-regexp, > dired-mark-files-regexp, etc., so anywhere where read-regexp is used. Sorry, I misread your feature request, I thought it's continuation of adding custom regexp types to search/replace. You are right that read-regexp misses support for custom regexp formats. It's easy to add regexp translation to the return value of read-regexp. But there is one complication: the default value returned by read-regexp-defaults-function might be a function like find-tag-default-as-regexp that returns a regexp in the default format created by regexp-quote. Do you agree that a pair of two translation functions should be provided: one to translate a custom regexp syntax to the default regexp syntax (to be used on the return value of read-regexp), and another translation from the default regexp syntax to the custom regexp syntax (to be used to translate the default regexp value added to the minibuffer)?