(store_symval_forwarding): Handle setting default-fill-column, etc.,

by changing buffers that use the default.
This commit is contained in:
Richard M. Stallman 2003-12-29 11:29:18 +00:00
parent dea7e2ba84
commit 7abd90ea98
2 changed files with 53 additions and 0 deletions

View file

@ -1,3 +1,16 @@
2003-12-29 Richard M. Stallman <rms@gnu.org>
* data.c (store_symval_forwarding): Handle setting
default-fill-column, etc., by changing the value in
buffers that use the default.
* minibuf.c (Fset_minibuffer_window): Doc fix.
* fileio.c (choose_write_coding_system): Ignore auto_saving
if using the visited file for auto saves.
(Fwrite_region): Don't update SAVE_MODIFF
if auto-saving in visited file.
2003-12-29 Kenichi Handa <handa@m17n.org>
* dispextern.h (face_font_available_p): Extern it.
@ -16,6 +29,14 @@
* xfaces.c (face_font_available_p): New function.
2003-12-28 Richard M. Stallman <rms@gnu.org>
* buffer.c (Fother_buffer): Don't crash if BUF is nil
or if its name is nil.
* buffer.c (Fkill_buffer): Don't delete auto-save file
if it's the same as the visited file.
2003-12-28 Luc Teirlinck <teirllm@auburn.edu>
* coding.c (Fcheck_coding_system): Doc fix.

View file

@ -873,6 +873,8 @@ store_symval_forwarding (symbol, valcontents, newval, buf)
register Lisp_Object valcontents, newval;
struct buffer *buf;
{
int offset;
switch (SWITCH_ENUM_CAST (XTYPE (valcontents)))
{
case Lisp_Misc:
@ -892,6 +894,36 @@ store_symval_forwarding (symbol, valcontents, newval, buf)
case Lisp_Misc_Objfwd:
*XOBJFWD (valcontents)->objvar = newval;
/* If this variable is a default for something stored
in the buffer itself, such as default-fill-column,
find the buffers that don't have local values for it
and update them. */
if (XOBJFWD (valcontents)->objvar > (Lisp_Object *) &buffer_defaults
&& XOBJFWD (valcontents)->objvar < (Lisp_Object *) (&buffer_defaults + 1))
{
int offset = ((char *) XOBJFWD (valcontents)->objvar
- (char *) &buffer_defaults);
int idx = PER_BUFFER_IDX (offset);
Lisp_Object tail, buf;
if (idx <= 0)
break;
for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object buf;
struct buffer *b;
buf = Fcdr (XCAR (tail));
if (!BUFFERP (buf)) continue;
b = XBUFFER (buf);
if (! PER_BUFFER_VALUE_P (b, idx))
PER_BUFFER_VALUE (b, offset) = newval;
}
}
break;
case Lisp_Misc_Buffer_Objfwd: