GNU bug report logs - #79998
31.0.50; cond*: cdr-safe seems not work but cdr-ignore can.

Previous Next

Package: emacs;

Reported by: "Yue Yi" <include_yy <at> qq.com>

Date: Sat, 13 Dec 2025 11:53:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Sean Whitton <spwhitton <at> spwhitton.name>

To reply to this bug, email your comments to 79998 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79998; Package emacs. (Sat, 13 Dec 2025 11:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Yue Yi" <include_yy <at> qq.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 13 Dec 2025 11:53:02 GMT) Full text and rfc822 format available.

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

From: "Yue Yi" <include_yy <at> qq.com>
To: "Spencer Baugh via Bug reports for GNU Emacs,the Swiss army knife of text editors"
 <bug-gnu-emacs <at> gnu.org>
Subject: 31.0.50; cond*: cdr-safe seems not work but cdr-ignore can.
Date: Sat, 13 Dec 2025 19:51:08 +0800
Hello, Emacs maintainers,

In the docstring of match*, it says:

(cdr-safe PATTERN) matches PATTERN with lax checking of cdrs. That means
that ‘list' patterns do not examine the final cdr.

Based on my understanding, cdr-safe should match improper lists or
similar structures. For example:

(cond* ((match* (cdr-safe (list x y)) '(1 2 . 3)))) => nil

However, running this triggers a warning: Warning: Complex pattern
nested in constrained variable pattern

I found that using cdr-ignore, which appears in the implementation
source code, works as expected:

(cond* ((match* (cdr-ignore (list x y)) '(1 2 . 3)))) ;;=> t

I would like to ask: Is this a documentation error? Should the docstring
and other references (like the Info manual) be updated to replace
cdr-safe with cdr-ignore?

Regards.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79998; Package emacs. (Mon, 15 Dec 2025 12:03:01 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: 79998 <at> debbugs.gnu.org, rms <at> gnu.org
Cc: Yue Yi <include_yy <at> qq.com>
Subject: Re: bug#79998: 31.0.50; cond*: cdr-safe seems not work but
 cdr-ignore can.
Date: Mon, 15 Dec 2025 12:02:11 +0000
Hello,

On Sat 13 Dec 2025 at 07:51pm +08, Yue Yi wrote:

> In the docstring of match*, it says:
>
> (cdr-safe PATTERN) matches PATTERN with lax checking of cdrs. That means
> that ‘list' patterns do not examine the final cdr.
>
> Based on my understanding, cdr-safe should match improper lists or
> similar structures. For example:
>
> (cond* ((match* (cdr-safe (list x y)) '(1 2 . 3)))) => nil
>
> However, running this triggers a warning: Warning: Complex pattern
> nested in constrained variable pattern
>
> I found that using cdr-ignore, which appears in the implementation
> source code, works as expected:
>
> (cond* ((match* (cdr-ignore (list x y)) '(1 2 . 3)))) ;;=> t
>
> I would like to ask: Is this a documentation error? Should the docstring
> and other references (like the Info manual) be updated to replace
> cdr-safe with cdr-ignore?

Yes, it looks like Richard decided to rename cdr-safe to cdr-ignore but
missed updating the docstring.  I've looked in the mailing list archives
and didn't see anything to suggest otherwise.

Richard, would you mind confirming?  "cdr-safe" was a work-in-progress
name, and "cdr-ignore" was the name for this match* operator that you
went for in the end?

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79998; Package emacs. (Thu, 18 Dec 2025 04:13:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 79998 <at> debbugs.gnu.org, include_yy <at> qq.com
Subject: Re: bug#79998: 31.0.50; cond*: cdr-safe seems not work but
 cdr-ignore can.
Date: Wed, 17 Dec 2025 23:12:39 -0500
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > I would like to ask: Is this a documentation error? Should the docstring
  > > and other references (like the Info manual) be updated to replace
  > > cdr-safe with cdr-ignore?

  > Yes, it looks like Richard decided to rename cdr-safe to cdr-ignore

Yes.

                                                                        but
  > missed updating the docstring.

Oops!

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Reply sent to Sean Whitton <spwhitton <at> spwhitton.name>:
You have taken responsibility. (Thu, 18 Dec 2025 10:50:02 GMT) Full text and rfc822 format available.

Notification sent to "Yue Yi" <include_yy <at> qq.com>:
bug acknowledged by developer. (Thu, 18 Dec 2025 10:50:02 GMT) Full text and rfc822 format available.

Message #16 received at 79998-done <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Richard Stallman <rms <at> gnu.org>, 79998-done <at> debbugs.gnu.org,
 include_yy <at> qq.com
Subject: Re: bug#79998: 31.0.50; cond*: cdr-safe seems not work but
 cdr-ignore can.
Date: Thu, 18 Dec 2025 10:49:42 +0000
Version: 31.1

Hello,

On Wed 17 Dec 2025 at 11:12pm -05, Richard Stallman wrote:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
>   > > I would like to ask: Is this a documentation error? Should the docstring
>   > > and other references (like the Info manual) be updated to replace
>   > > cdr-safe with cdr-ignore?
>
>   > Yes, it looks like Richard decided to rename cdr-safe to cdr-ignore
>
> Yes.
>
>                                                                         but
>   > missed updating the docstring.
>
> Oops!

Thanks both.  Now fixed on the master branch, and closing the bug.

-- 
Sean Whitton




This bug report was last modified 22 days ago.

Previous Next


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