diff options
| author | Gerd Moellmann | 2001-01-18 13:21:51 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-01-18 13:21:51 +0000 |
| commit | 06bccf8e72074e260935af63e05079c7f53ff5f3 (patch) | |
| tree | 9898e558867e60c8612bddee72018dfcc01cfab2 /src | |
| parent | 9017309fb5520a84af8e30957167af678571189c (diff) | |
| download | emacs-06bccf8e72074e260935af63e05079c7f53ff5f3.tar.gz emacs-06bccf8e72074e260935af63e05079c7f53ff5f3.zip | |
(specbind): If binding a per-buffer variable which
doesn't have a buffer-local value in the current buffer, change
the global value by changing the value of the symbol bound in all
buffers not having their own value, to make it consistent with
what happens with other buffer-local variables.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/eval.c | 15 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f30ccf975b2..affd55502de 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2001-01-18 Gerd Moellmann <gerd@gnu.org> | 1 | 2001-01-18 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * eval.c (specbind): If binding a per-buffer variable which | ||
| 4 | doesn't have a buffer-local value in the current buffer, change | ||
| 5 | the global value by changing the value of the symbol bound in all | ||
| 6 | buffers not having their own value, to make it consistent with | ||
| 7 | what happens with other buffer-local variables. | ||
| 8 | |||
| 3 | * xterm.c (x_initialize): Set char_ins_del_ok to 1. | 9 | * xterm.c (x_initialize): Set char_ins_del_ok to 1. |
| 4 | 10 | ||
| 5 | * xdisp.c (forward_to_next_line_start): Stop at end of buffer | 11 | * xdisp.c (forward_to_next_line_start): Stop at end of buffer |
diff --git a/src/eval.c b/src/eval.c index 8d8b9b14d42..41085cdef5c 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -2899,16 +2899,31 @@ specbind (symbol, value) | |||
| 2899 | || BUFFER_OBJFWDP (XSYMBOL (symbol)->value)) | 2899 | || BUFFER_OBJFWDP (XSYMBOL (symbol)->value)) |
| 2900 | { | 2900 | { |
| 2901 | Lisp_Object current_buffer, binding_buffer; | 2901 | Lisp_Object current_buffer, binding_buffer; |
| 2902 | |||
| 2902 | /* For a local variable, record both the symbol and which | 2903 | /* For a local variable, record both the symbol and which |
| 2903 | buffer's value we are saving. */ | 2904 | buffer's value we are saving. */ |
| 2904 | current_buffer = Fcurrent_buffer (); | 2905 | current_buffer = Fcurrent_buffer (); |
| 2905 | binding_buffer = current_buffer; | 2906 | binding_buffer = current_buffer; |
| 2907 | |||
| 2906 | /* If the variable is not local in this buffer, | 2908 | /* If the variable is not local in this buffer, |
| 2907 | we are saving the global value, so restore that. */ | 2909 | we are saving the global value, so restore that. */ |
| 2908 | if (NILP (Flocal_variable_p (symbol, binding_buffer))) | 2910 | if (NILP (Flocal_variable_p (symbol, binding_buffer))) |
| 2909 | binding_buffer = Qnil; | 2911 | binding_buffer = Qnil; |
| 2910 | specpdl_ptr->symbol | 2912 | specpdl_ptr->symbol |
| 2911 | = Fcons (symbol, Fcons (binding_buffer, current_buffer)); | 2913 | = Fcons (symbol, Fcons (binding_buffer, current_buffer)); |
| 2914 | |||
| 2915 | /* If SYMBOL is a per-buffer variable which doesn't have a | ||
| 2916 | buffer-local value here, make the `let' change the global | ||
| 2917 | value by changing the value of SYMBOL in all buffers not | ||
| 2918 | having their own value. This is consistent with what | ||
| 2919 | happens with other buffer-local variables. */ | ||
| 2920 | if (NILP (binding_buffer) | ||
| 2921 | && BUFFER_OBJFWDP (XSYMBOL (symbol)->value)) | ||
| 2922 | { | ||
| 2923 | ++specpdl_ptr; | ||
| 2924 | Fset_default (symbol, value); | ||
| 2925 | return; | ||
| 2926 | } | ||
| 2912 | } | 2927 | } |
| 2913 | else | 2928 | else |
| 2914 | specpdl_ptr->symbol = symbol; | 2929 | specpdl_ptr->symbol = symbol; |