From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#31953: [VanL] Re: bug#31953: feature request - `highlight-rx` interactively Date: Sun, 20 Oct 2019 18:49:39 +0300 Organization: LINKOV.NET Message-ID: <87h843ptuk.fsf@mail.linkov.net> References: <875zkqsx1c.fsf@gnus.org> <87o8yirgk4.fsf@gnus.org> <646a4a85cca29e6ca83e1b5b2004902b@webmail.orcon.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="141144"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Phil Sainty , Lars Ingebrigtsen , 31953@debbugs.gnu.org To: VanL Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 20 18:33:27 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iME8x-000aPz-R3 for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Oct 2019 18:33:24 +0200 Original-Received: from localhost ([::1]:40414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iME8w-0003dH-Eg for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Oct 2019 12:33:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33224) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iME8f-0003c6-OG for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 12:33:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iME8d-0000IZ-Mr for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 12:33:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46359) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iME8d-0000IF-HM for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 12:33:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iME8b-00073A-T4 for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 12:33:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Oct 2019 16:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31953 X-GNU-PR-Package: emacs Original-Received: via spool by 31953-submit@debbugs.gnu.org id=B31953.157158916227034 (code B ref 31953); Sun, 20 Oct 2019 16:33:01 +0000 Original-Received: (at 31953) by debbugs.gnu.org; 20 Oct 2019 16:32:42 +0000 Original-Received: from localhost ([127.0.0.1]:55171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iME8I-00071y-GG for submit@debbugs.gnu.org; Sun, 20 Oct 2019 12:32:42 -0400 Original-Received: from aye.elm.relay.mailchannels.net ([23.83.212.6]:56594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iME8H-00071q-0E for 31953@debbugs.gnu.org; Sun, 20 Oct 2019 12:32:41 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A0DA458064C; Sun, 20 Oct 2019 16:32:39 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a73.g.dreamhost.com (100-96-87-223.trex.outbound.svc.cluster.local [100.96.87.223]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 3D51D5801B5; Sun, 20 Oct 2019 16:32:39 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a73.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Sun, 20 Oct 2019 16:32:39 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Slimy-Daffy: 045cf6537da4ba15_1571589159485_1940876893 X-MC-Loop-Signature: 1571589159485:1210073538 X-MC-Ingress-Time: 1571589159485 Original-Received: from pdx1-sub0-mail-a73.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a73.g.dreamhost.com (Postfix) with ESMTP id F11EA82C0F; Sun, 20 Oct 2019 09:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=u1NnmD nv9guIHdcoowa5FxahSH0=; b=h/9YRCAODIoLuKX8aaUgIrTO4AgF5EDKHkIoHp EBKa/ozYVN3adIZP1f+w1OORGAAl5Z5JS++EoRcWz1yiuT9oIdGqVQNavU2GLSUE nxePdx0nsna6Jf6Ij+dUv4MtmKtFRSJNpD130viv4KwUY6YNuJrwVuRYyH7z7CmN 8kBwA= Original-Received: from mail.jurta.org (m91-129-98-153.cust.tele2.ee [91.129.98.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a73.g.dreamhost.com (Postfix) with ESMTPSA id 0BB2082C03; Sun, 20 Oct 2019 09:32:30 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a73 In-Reply-To: (VanL's message of "Sun, 20 Oct 2019 17:34:37 +1100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169833 Archived-At: >> I think the idea is to be able to *interactively* enter rx syntax >> and have it highlighted (as opposed to `highlight-regexp' which will >> obviously treat what you enter interactively as an actual regexp, >> rather than something to be transformed into one). >> >> i.e. These would be equivalent: >> >> M-x highlight-rx RET (or "foo" "bar") RET >> M-x highlight-regexp RET \(foo\|bar\) RET > > What I can tell from the emacs-devel list and the git log is the rx > feature is being worked on. I'd like to use rx everywhere regexp occur= s > and highlight-rx would be the first easy use case. Do you mean using rx also in all search and replace commands? But the documentation says: The =E2=80=98rx=E2=80=99 notation is mainly useful in Lisp code; it = cannot be used in most interactive situations where a regexp is requested, such as when running =E2=80=98query-replace-regexp=E2=80=99 or in variable customisa= tion. > At the limit there are things expressible in regexp that rx won't be > able to. And, in that case, I'd like to see in the rx documentation > a sign post to regexp at depth for that. And, if there are patterns > rx and/or regexp are unable to express then providing a see also for > those would be a help. There is still some shortcomings in the current rx shorthands: Such verbose constructs as =E2=80=98zero-or-more=E2=80=99 and =E2=80=98on= e-or-more=E2=80=99 are hard to remember and too long to type. But fortunately there are shorter synonyms =E2=80=98*=E2=80=99 and =E2=80=98+=E2=80=99 an= d other. But they have inconsistencies: - =E2=80=98or=E2=80=99 has a synonym =E2=80=98|=E2=80=99, but =E2=80=98an= d=E2=80=99 has no synonym =E2=80=98&=E2=80=99 - =E2=80=98A{N}=E2=80=99 is the same as =E2=80=98=3D=E2=80=99, =E2=80=98A= {N,}=E2=80=99 is =E2=80=98>=3D=E2=80=99, but =E2=80=98A{N,M}=E2=80=99 for= some reason is =E2=80=98**=E2=80=99. It would be more mnemonic something li= ke =E2=80=98=3D=3D=E2=80=99 - =E2=80=98line-start=E2=80=99 and =E2=80=98line-end=E2=80=99 have no sho= rter synonyms =E2=80=98^=E2=80=99 and =E2=80=98$=E2=80=99 maybe because adding them would also require adding =E2=80=98\`=E2=80=99= and =E2=80=98\'=E2=80=99 for =E2=80=98buffer-start=E2=80=99 and =E2=80=98buffer-end=E2=80=99, bu= t =E2=80=98\`=E2=80=99 and =E2=80=98\'=E2=80=99 are very ugly. Fortunately there are already good synonyms =E2=80=98bol=E2=80=99 and =E2= =80=98eol=E2=80=99 that are easy to remember - there is still problem with =E2=80=98buffer-start=E2=80=99 and =E2=80=98= buffer-end=E2=80=99: their shorter synonyms are =E2=80=98bot=E2=80=99 and =E2=80=98eot=E2=80= =99 that have no logic at all. Like there are already functions =E2=80=98bolp=E2=80=99, =E2=80=98eolp=E2= =80=99, =E2=80=98bobp=E2=80=99 and =E2=80=98eobp=E2=80=99 the best synonyms for buffer matches would be =E2=80=98bob=E2=80=99 and= =E2=80=98eob=E2=80=99 - following the same logic =E2=80=98word-start=E2=80=99 could have a syno= nym =E2=80=98bow=E2=80=99 and =E2=80=98word-end=E2=80=99 - =E2=80=98eow=E2=80=99. I checked the = implementation, and see there synonyms already are supported, but not documented. Why?