From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.bugs Subject: bug#20307: 25.0.50; (regexp-opt nil ...) returns "" Date: Mon, 13 Apr 2015 16:59:36 +0100 Message-ID: References: <876191vfou.fsf@fencepost.gnu.org> <87iod0xcs5.fsf@fencepost.gnu.org> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11340b1463449a05139d33d6 X-Trace: ger.gmane.org 1428940865 29064 80.91.229.3 (13 Apr 2015 16:01:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Apr 2015 16:01:05 +0000 (UTC) Cc: 20307@debbugs.gnu.org To: David Kastrup Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 13 18:00:56 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Yhgmg-0005ph-Nh for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Apr 2015 18:00:27 +0200 Original-Received: from localhost ([::1]:52525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yhgmg-0005ei-0c for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Apr 2015 12:00:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhgmP-0005PM-3f for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2015 12:00:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhgmL-00068u-TC for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2015 12:00:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhgmL-00068Z-Qi for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2015 12:00:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YhgmK-0006Ss-Jo for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2015 12:00:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Apr 2015 16:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20307 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20307-submit@debbugs.gnu.org id=B20307.142894078524798 (code B ref 20307); Mon, 13 Apr 2015 16:00:04 +0000 Original-Received: (at 20307) by debbugs.gnu.org; 13 Apr 2015 15:59:45 +0000 Original-Received: from localhost ([127.0.0.1]:55138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yhgm0-0006Rr-GZ for submit@debbugs.gnu.org; Mon, 13 Apr 2015 11:59:44 -0400 Original-Received: from mail-lb0-f170.google.com ([209.85.217.170]:33173) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yhgly-0006Re-KI for 20307@debbugs.gnu.org; Mon, 13 Apr 2015 11:59:43 -0400 Original-Received: by lbbzk7 with SMTP id zk7so63045864lbb.0 for <20307@debbugs.gnu.org>; Mon, 13 Apr 2015 08:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=RhAbDT7sakP7CsMX2eBRZETPvRaAdmk7RltXh+0sfPg=; b=CaJQI+gokq5t/cRyJHOvyNq/Nw1SpaDxnq/IyUG32VzfCcATBKikTILm/x0mcsOZqu LL877IhoSm1pRgwheVF4AbZYzIYbTzzH0WJYVvcQLZY+DX0j9dKcb2jgqC2VtD2PpyCv FLDeST6jeDcpXZxM7E+69+lGxnu0U2wbbVcjmBmrB7B55uo+F7avdIbNwhEzGygNRNTt bqGg/1CSQlZy/YjeuPlDjmUvGe1y7zVheEHD5J0FZHNv5lvqOuIl9afhtfoaAhUtAWma ecTwuamGGE9is6KVM0o75Xh9bdaiZIoU6Gd1K57nJfJQm/qgfLpz6tqAgd+Ph+e+PQ3A rG2w== X-Received: by 10.152.163.35 with SMTP id yf3mr13962276lab.86.1428940776487; Mon, 13 Apr 2015 08:59:36 -0700 (PDT) Original-Received: by 10.25.150.131 with HTTP; Mon, 13 Apr 2015 08:59:36 -0700 (PDT) Original-Received: by 10.25.150.131 with HTTP; Mon, 13 Apr 2015 08:59:36 -0700 (PDT) In-Reply-To: <87iod0xcs5.fsf@fencepost.gnu.org> X-Google-Sender-Auth: SxSucI7Ug5Jh49EnS_3AJ88jgN8 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:101483 Archived-At: --001a11340b1463449a05139d33d6 Content-Type: text/plain; charset=UTF-8 I believe you. Please ignore this babbling baboon. That's what I get for typing on the bus. On Apr 13, 2015 4:34 PM, "David Kastrup" wrote: > Artur Malabarba writes: > > > 2015-04-12 10:50 GMT+01:00 David Kastrup > >> Both > >> > >> M-: (regexp-opt nil) RET > >> > >> and > >> > >> M-: (regexp-opt nil t) RET > >> > >> return "". However, they should return a regexp matching nothing > >> rather than everything, and the second invocation should also count as > >> one () pairing. > > > > I agree there should be () on the second one, but I strongly disagree > > they should match nothing. > > > > regexp-opt is NOT meant to match only the given strings. It is meant > > to match anything containing the given strings. > > Well, and no string to match has been given. This is not > (regexp-opt '("")) > but rather > (regexp-opt '()) > > > There is a very fundamental difference in that. The less strings you > > pass to regexp-opt, the MORE things the regexp will match. > > Come again? > > > Why would we suddently flip that on its head when going from 1 to 0 > > strings? > > (regexp-opt '("a" "b" "c")) -> "[abc]" > (regexp-opt '("a" "b")) -> "[ab]" > > Quite literally (execute C-x C-e after the expressions above if you > don't believe me). So how does "[ab]" match more than "[abc]" ? > > -- > David Kastrup > --001a11340b1463449a05139d33d6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I believe you. Please ignore this babbling baboon.
That's what I get for typing on the bus.

On Apr 13, 2015 4:34 PM, "David Kastrup&quo= t; <dak@gnu.org> wrote:
Artur Malabarba <bruce.connor.am@gmail.com> writes= :

> 2015-04-12 10:50 GMT+01:00 David Kastrup
>> Both
>>
>> M-: (regexp-opt nil) RET
>>
>> and
>>
>> M-: (regexp-opt nil t) RET
>>
>> return "".=C2=A0 However, they should return a regexp ma= tching nothing
>> rather than everything, and the second invocation should also coun= t as
>> one () pairing.
>
> I agree there should be () on the second one, but I strongly disagree<= br> > they should match nothing.
>
> regexp-opt is NOT meant to match only the given strings. It is meant > to match anything containing the given strings.

Well, and no string to match has been given.=C2=A0 This is not
(regexp-opt '(""))
but rather
(regexp-opt '())

> There is a very fundamental difference in that. The less strings you > pass to regexp-opt, the MORE things the regexp will match.

Come again?

> Why would we suddently flip that on its head when going from 1 to 0 > strings?

(regexp-opt '("a" "b" "c")) -> "[= abc]"
(regexp-opt '("a" "b")) -> "[ab]"

Quite literally (execute C-x C-e after the expressions above if you
don't believe me).=C2=A0 So how does "[ab]" match more than &= quot;[abc]" ?

--
David Kastrup
--001a11340b1463449a05139d33d6--