From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34641: rx: (or ...) order unpredictable Date: Sat, 02 Mar 2019 14:33:05 +0200 Message-ID: <83bm2th2wu.fsf@gnu.org> References: <836B8DC2-9358-40AC-83AF-7C4D960D9A53@acm.org> <83bm31ngzp.fsf@gnu.org> <065957BB-1332-458B-8757-742A81CED4A5@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="238325"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34641@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 02 13:34:12 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h03qG-000zrF-0s for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Mar 2019 13:34:12 +0100 Original-Received: from localhost ([127.0.0.1]:53496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h03qF-0002u8-23 for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Mar 2019 07:34:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h03q7-0002tL-HV for bug-gnu-emacs@gnu.org; Sat, 02 Mar 2019 07:34:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h03q6-0006Zw-C5 for bug-gnu-emacs@gnu.org; Sat, 02 Mar 2019 07:34:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h03q6-0006Yx-7d for bug-gnu-emacs@gnu.org; Sat, 02 Mar 2019 07:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h03q6-0004Qu-0p for bug-gnu-emacs@gnu.org; Sat, 02 Mar 2019 07:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Mar 2019 12:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34641 X-GNU-PR-Package: emacs Original-Received: via spool by 34641-submit@debbugs.gnu.org id=B34641.155153000416997 (code B ref 34641); Sat, 02 Mar 2019 12:34:01 +0000 Original-Received: (at 34641) by debbugs.gnu.org; 2 Mar 2019 12:33:24 +0000 Original-Received: from localhost ([127.0.0.1]:57054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h03pU-0004Q5-0v for submit@debbugs.gnu.org; Sat, 02 Mar 2019 07:33:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h03pS-0004Pr-24 for 34641@debbugs.gnu.org; Sat, 02 Mar 2019 07:33:22 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h03pM-0002gq-L1; Sat, 02 Mar 2019 07:33:16 -0500 Original-Received: from [176.228.60.248] (port=4705 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h03pM-0006xg-8i; Sat, 02 Mar 2019 07:33:16 -0500 In-reply-to: <065957BB-1332-458B-8757-742A81CED4A5@acm.org> (message from Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= on Sun, 24 Feb 2019 22:18:28 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:155952 Archived-At: > From: Mattias EngdegÄrd > Date: Sun, 24 Feb 2019 22:18:28 +0100 > Cc: 34641@debbugs.gnu.org > > > Your preferred solution is fine with me, FWIW. > > Thank you; patch attached. Thanks, LGTM with minor comments below. > +The optional argument @var{noreorder}, if @code{nil}, allows the > +returned regexp to match the strings in any order. If non-@code{nil}, > +the regexp is equivalent to a chain of alternatives (by the @samp{\|} > +operator) of the strings in the order given. I find the text in NEWS much more clear regarding what happens when the new arg is non-nil. I think what is missing is a more explicit description you have in NEWS: If the new third argument is non-nil, the match is guaranteed to be performed in the order given, as if the strings were made into a regexp by joining them with '\|'. So I suggest to mention explicitly the "match is guaranteed to be performed in the order given" part. > +The optional argument NOREORDER, if nil, allows the returned We usually say "if nil or omitted" for optional arguments. > +(defun regexp-opt--contains-prefix (strings) > + "Whether a list of strings contains a proper prefix of one of its elements. > +STRINGS must be sorted and free from duplicates." It is usually a good idea to refer to arguments explicitly in the first sentence of a doc string. In this case, I think just up-casing STRINGS there should be enough.