From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex =?UTF-8?Q?Benn=C3=A9e?= Newsgroups: gmane.emacs.bugs Subject: bug#30749: 26.0.91; (cl-)case is confused when a nil atom is used instead of a keylist Date: Thu, 08 Mar 2018 11:34:59 +0000 Message-ID: <87efkuztp8.fsf@linaro.org> References: <87fu5azwsk.fsf@linaro.org> <87o9jy2557.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1520508857 656 195.159.176.226 (8 Mar 2018 11:34:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Mar 2018 11:34:17 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 26.0.91 Cc: 30749@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 08 12:34:12 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ettoH-0008Qj-VR for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Mar 2018 12:34:10 +0100 Original-Received: from localhost ([::1]:38189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ettqK-0007op-JY for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Mar 2018 06:36:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ettqA-0007nZ-Ul for bug-gnu-emacs@gnu.org; Thu, 08 Mar 2018 06:36:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ettq6-0001lH-0g for bug-gnu-emacs@gnu.org; Thu, 08 Mar 2018 06:36:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ettq5-0001l2-Rx for bug-gnu-emacs@gnu.org; Thu, 08 Mar 2018 06:36:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ettq5-0006sl-Ir for bug-gnu-emacs@gnu.org; Thu, 08 Mar 2018 06:36:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alex =?UTF-8?Q?Benn=C3=A9e?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Mar 2018 11:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30749 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30749-submit@debbugs.gnu.org id=B30749.152050890926383 (code B ref 30749); Thu, 08 Mar 2018 11:36:01 +0000 Original-Received: (at 30749) by debbugs.gnu.org; 8 Mar 2018 11:35:09 +0000 Original-Received: from localhost ([127.0.0.1]:50243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ettpF-0006rS-4D for submit@debbugs.gnu.org; Thu, 08 Mar 2018 06:35:09 -0500 Original-Received: from mail-wm0-f43.google.com ([74.125.82.43]:35739) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ettpD-0006qu-5J for 30749@debbugs.gnu.org; Thu, 08 Mar 2018 06:35:07 -0500 Original-Received: by mail-wm0-f43.google.com with SMTP id x7so10411319wmc.0 for <30749@debbugs.gnu.org>; Thu, 08 Mar 2018 03:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=NUCP2RozkaxWJEmYN0QDBPPkvPRPonsC0r6B2pzIYbg=; b=R1FK49akVaLDqKnCw2qqYHTUqUnpi0E1TxxKbn8kHv0BOnEq+jp1Eo8j0/0qqXxt6z wq0jjexf6HL9nWvcqeKFtON2NqIH/eRcZybhTh6byrx22fucAXbxq95qVDsv/NfbIPIB IvxHRJCR0FW72EKdXQiZmoZ63ZWIIO2UII3zc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=NUCP2RozkaxWJEmYN0QDBPPkvPRPonsC0r6B2pzIYbg=; b=qArQdZ94XCaRNcc4rTkrvGMNYtmyHoJ5EoyHqyXlQfv2THIOZrJ9Y7os+zN/6h5aFR QAiSCgPrI3ex5j9Fnjxown2w5qDQZui/R0S4BKgBSwWACjL77+mODDgMwpAePdC4hjpg LtxhwWtqyHi+253O8YWT7pmG+okJ6NMFl2njj5WL5MddrTMFZy7NFjo8XNnByCtC2+1k EWbGo/OBNUgNWglex3WEEnRYHPbZGyMqJR0Vf0U6y42MBytUIHE3MnwjYN4b6ybeBU0F vCp34na/09/fDT/6lNRze/4kqBtWM2Fxga30QHQHn5T2p74DwA5ZXF1rVYjjJ9zwvPLJ ewoQ== X-Gm-Message-State: AElRT7G4JPA3DuiMa1ALQbf6ydtWjxQbIcK7PPJ9PxtgaIj7NjtO7KEQ RCw5o+Qiz7TmqiIQNr+U7G6VcmqE9AE= X-Google-Smtp-Source: AG47ELsUVLoIYP7+dESLjnDXso8WbEsd4uliflx89kLlc9MJYOUOqtUlbPfO2Z02aO747tz7q6gFdQ== X-Received: by 10.28.113.205 with SMTP id d74mr19006091wmi.3.1520508901139; Thu, 08 Mar 2018 03:35:01 -0800 (PST) Original-Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id p199sm4432574wmb.42.2018.03.08.03.35.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 03:35:00 -0800 (PST) Original-Received: from zen (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTPS id 0080C3E034A; Thu, 8 Mar 2018 11:34:59 +0000 (GMT) In-reply-to: <87o9jy2557.fsf@gmail.com> 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: 208.118.235.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:144040 Archived-At: Noam Postavsky writes: > Alex Benn=C3=A9e writes: > >> I got confused why my case statement was failing as I'd used the second >> form assuming that having nil as an atom would work. I'm not sure why >> the quoting fixed it but it's certainly a confusing inconsistency. > > 'nil is the same as (quote nil) Ahh so ends up as a list containing nil? > >> I think this is probably fixable with just making the docstring clearer >> as the results of handling the duel atom/list of nil might have >> unexpected results. > > So just add a "non-nil" perhaps? > > --- i/lisp/emacs-lisp/cl-macs.el > +++ w/lisp/emacs-lisp/cl-macs.el > @@ -763,7 +763,7 @@ cl-case > "Eval EXPR and choose among clauses on that value. > Each clause looks like (KEYLIST BODY...). EXPR is evaluated and compared > against each key in each KEYLIST; the corresponding BODY is evaluated. > -If no clause succeeds, cl-case returns nil. A single atom may be used in > +If no clause succeeds, cl-case returns nil. A single non-nil atom may b= e used in > place of a KEYLIST of one atom. A KEYLIST of t or `otherwise' is > allowed only in the final clause, and matches if no other keys match. > Key values are compared by `eql'. Works for me. -- Alex Benn=C3=A9e