From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#36496: [PATCH] Describe the rx notation in the lisp manual Date: Mon, 8 Jul 2019 17:19:32 -0700 (PDT) Message-ID: References: <0C783D67-9502-408B-B845-5599BD596361@acm.org> <838stdbw8e.fsf@gnu.org> <83a7draccd.fsf@gnu.org> <0458803b-c701-4706-9843-174b7373cf23@default> <2a29fbfb-7e94-4022-bbde-42d8b9f90fc8@default> 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="132054"; mail-complaints-to="usenet@blaine.gmane.org" Cc: mattiase@acm.org, 36496@debbugs.gnu.org To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 09 02:20:11 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 1hkdre-000YDP-PM for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jul 2019 02:20:10 +0200 Original-Received: from localhost ([::1]:45808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkdrd-0007P0-LX for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2019 20:20:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46848) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkdrX-0007MH-Kl for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 20:20:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkdrW-0007FM-HB for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 20:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51196) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkdrW-0007FI-Dd for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 20:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkdrW-0000gS-75 for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 20:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jul 2019 00:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36496-submit@debbugs.gnu.org id=B36496.15626315902607 (code B ref 36496); Tue, 09 Jul 2019 00:20:02 +0000 Original-Received: (at 36496) by debbugs.gnu.org; 9 Jul 2019 00:19:50 +0000 Original-Received: from localhost ([127.0.0.1]:60017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkdrJ-0000fy-QP for submit@debbugs.gnu.org; Mon, 08 Jul 2019 20:19:50 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:42474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkdrH-0000fl-Df for 36496@debbugs.gnu.org; Mon, 08 Jul 2019 20:19:48 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x690JAXV075034; Tue, 9 Jul 2019 00:19:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=rBmRFgcEwgoVC29r3usw1ZJksNNKrWoYCZhO1xlT+eQ=; b=Tir83BjY/8UPAZhdOwdy0PfpNI0PXuLZr9kVvq3/tDQyQ5gj2u5kU5bln15oTbWr7bd6 HrBylhQQHb2Jg/o0Lk5uemjRQ+6+PTeRWx7jlrU9AeZe6ampqCs2GA1xv8mUd8RbqF7w SrUwAYfwiKUYoDk/8MwtbCHoTMPqINKutK4672mrY+ORyPg4vFmXb2sijLuJbWG62Qlt LfXFVLtfAFacMgNccbSUBox6QggDCBSBBUOqrMFz5Ivw7eG++Hns2Z7eizAvuVZ8+NPH CZmCWdHGfYYVVLRes2YvHwY+s3Nx3El6zLjTtopMyhLQ/t3AYnOGLPFtkkfT+U8riuH5 Tg== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2tjk2th9ak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 09 Jul 2019 00:19:35 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x690ICo3060010; Tue, 9 Jul 2019 00:19:35 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 2tjgrtskj9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 09 Jul 2019 00:19:35 +0000 Original-Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x690JXAN029427; Tue, 9 Jul 2019 00:19:33 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4861.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9312 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907090002 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9312 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907090002 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:162413 Archived-At: > > Do you mean they'd accept a quoted `rx' form (list)? > > What would a use case be - as opposed to accepting > > the result of macro-expanding such a form? Assuming > > there's good use case, maybe so. >=20 > Quoting is a little more brief than writing (rx ...). Sorry, but I don't really understand. I know little about `rx'. > > [But there may be some functions that already have a > > (different) interpretation of a list value for the > > same arg that could alternatively be a regexp string. > > (So maybe not "all" such functions.)] >=20 > Are there any? If so, it would be desirable to change them. I was responding to this from you: WHat would people think of making all the functions that want a regexp accept an rx input equivalently? If the arg is not a string, treat it as rx format. Compilation could convert a constant non-string, for such args, to a regexp string. I see now that you said "an rx input", so presumably not just a list as arg but a list with car `rx'. I was thinking you meant just a list. I'd bet there are some functions that accept an arg that can be a (nonempty) list or a string, and maybe even a regexp string. If there are then some minor adjustment could be called for; that's all. > > Even assuming such a use case, should the compiler > > assume that _every_ such list arg should be compiled > > to a regexp string? >=20 > Why not? Is there any case in which it would be better > to translate the rx to a regexp at run time? I think I misunderstood you, and might still. Still, there's a difference between passing (quote SOME-MACRO-SEXP) as arg and passing SOME-MACRO-SEXP. We have `quote' for a reason. If you want macro-expansion at compile time why wouldn't you just pass (rx...) as the arg, instead of (quote (rx...))? But you know all this better than I, so no doubt I'm just missing your point - in which case feel free to ignore. > > > The only problem is, which key would it be? >=20 > > Some non-repeatable key. Some key that can't be > > used (by default) to edit minibuffer text. Maybe > > something like `C-x x'? >=20 > Is there any reasonable one-character key? There are lots of 1-char keys that are not defined in a minibuffer keymap by default. And perhaps even some that are defined there by default but that aren't useful for reading a regexp (so could be co-opted when reading regexp input, if needed). As just one example, `M-R' is not defined (`M-r' is). `M-R' is `move-to-window-line-top-bottom', which isn't so useful in a minibuffer window. (It is a repeatable key, BTW, and its global binding is a repeatable command. But that command isn't very useful in the minibuffer.)