GNU bug report logs - #5971
23.1.95; `delete' modifies default value instead of buffer-local value

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Mon, 19 Apr 2010 02:43:02 UTC

Severity: minor

Tags: notabug, wontfix

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Andreas Schwab'" <schwab <at> linux-m68k.org>
Cc: 5971 <at> debbugs.gnu.org, tracker <at> debbugs.gnu.org, 'Stefan Monnier' <monnier <at> iro.umontreal.ca>, 'GNU bug Tracking System' <help-debbugs <at> gnu.org>
Subject: bug#5971: 23.1.95; `delete' modifies default value instead of buffer-local value
Date: Mon, 19 Apr 2010 10:03:09 -0700
> > Nothing in the doc states that they share list structure.
> 
> There is no buffer-local value before you set it.

Yes, I know that. And I noted that explicitly.
 
> The doc is pretty clear that a buffer-local value only starts to exist
> the first time it is set:
> 
> Make VARIABLE become buffer-local whenever it is set.
> At any time, the value for the current buffer is in effect,
> unless the variable has never been set in this buffer,
> in which case the default value is in effect.
>                   ^^^^^^^^^^^^^^^^^^^^^^^^^^

Yes, and I explictly said that too. Please read what I wrote.

I am not questioning the fact that the default value is used if no buffer-local
value is set. And that behavior is adequately documented.

What is _not_ documented AFAICT is that using `delete' to set the buffer-local
value in buffer X also modifies the default value. There is no reason to expect
that, from reading the doc.

Once the default value has been modified, it is clear that buffer Y will (and
should) pick it up if you have not yet set a buffer-local value in Y. What is
not clear is why the _default_ value gets modified, just by setting the
_buffer-local_ value (in X).

And as I noted, using `nconc' (which is destructive like `delete') does not have
this effect. The same code uses `nconc' to set the buffer-local value in X, and
that does not also modify the default value.





This bug report was last modified 13 years and 322 days ago.

Previous Next


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