Subject: bug#5971: 23.1.95; `delete' modifies default value instead of buffer-local value

From: "Drew Adams" <[email-masked]>
Date: Sun, 18 Apr 2010 22:24:42 -0700

> > This doesn't seem right to me.
>  
> Why not?  That's the whole reason for the existence of two functions:
> `delete' and `remove'.

I'm aware that `delete' modifies the list structure and `remove' uses a copy.
What I don't understand is the interaction with a default value instead of a
buffer-local value. Why would `delete' cause the behavior described?

The same code BTW uses `nconc' apparently without causing such
modify-the-default-value behavior:

(setq wide-n-restrictions
      (nconc (nthcdr arg wide-n-restrictions) latest))

What is the relation between `delete's modification of the list structure of a
cons that is a buffer-local value of a variable and its (apparent) modification
of the default value of the variable?