GNU bug report logs - #51368
29.0.50; `cl-case' should error on incorrect use

Previous Next

Package: emacs;

Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>

Date: Sun, 24 Oct 2021 07:53:01 UTC

Severity: normal

Tags: moreinfo

Found in version 29.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #51 received at 51368 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 51368 <at> debbugs.gnu.org, Philipp Stephani <p.stephani2 <at> gmail.com>,
 Lars Ingebrigtsen <larsi <at> gnus.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#51368: 29.0.50; `cl-case' should error on incorrect use
Date: Sun, 3 Sep 2023 15:40:03 +0200
[Message part 1 (text/plain, inline)]
>      (cl-case EXP
>        ((a b) FOO)
>        ((a c) BAR))
> 
>  won't warn about the duplicate `a`.

I was curious how common this could be so I locally added a warning to the back-end in bytecomp that generates switches (attached), and bootstrapped Emacs. Results:

----------------
In gnus-cloud-decode-data:
lisp/gnus/gnus-cloud.el:154:6: Warning: Duplicated value in ‘cond’: base64-gzip

In netrc-parse:
lisp/obsolete/netrc.el:106:22: Warning: Duplicated value in ‘cond’: "macdef"

In org-read-date-analyze:
lisp/org/org.el:14041:15: Warning: Duplicated value in ‘cond’: ""

In org-html-latex-fragment:
lisp/org/ox-html.el:3099:8: Warning: Duplicated value in ‘cond’: t
-----------------

None of these are from `cl-case`. (`pcase` doesn't typically warn either but just drops the duplicate silently.)

I probably won't keep the warning because it's in the back-end and was very much a hack.

[bytecomp-cond-switch-dup-warn.diff (application/octet-stream, attachment)]

This bug report was last modified 1 year and 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.