Subject: bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt

From: Richard Stallman <[email-masked]>
Date: Wed, 27 Apr 2022 23:17:20 -0400

[[[ 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. ]]]

  > > *) It happens just for alist, other maps are fine.

  > (I'm going through old bug reports that unfortunately weren't resolved
  > at the time.)

  > Various things were proposed here, but they all had problems.  So I
  > don't think there's much to be done here except documenting this, which
  > I've now done in Emacs 29.

It is a natural consequence of list structure that deleting the first element
doesn't do it destructively, so you need to do
  (setq foo (delq elt foo))

This is a general principal of deletion in Lisp, so let's teach it to
people rather than trying to help people avoid the need to learn it.

-- 
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)