Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
0967b4b0
Commit
0967b4b0
authored
Jul 05, 2001
by
Gerd Moellmann
Browse files
(specbind): Additionally record the buffer that was
current when a buffer-local or frame-local variable was bound.
parent
2d160521
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
src/ChangeLog
src/ChangeLog
+5
-0
src/eval.c
src/eval.c
+13
-9
No files found.
src/ChangeLog
View file @
0967b4b0
2001-07-05 Gerd Moellmann <gerd@gnu.org>
* eval.c (specbind): Additionally record the buffer that was
current when a buffer-local or frame-local variable was bound.
2001-07-04 Gerd Moellmann <gerd@gnu.org>
2001-07-04 Gerd Moellmann <gerd@gnu.org>
* xterm.c (x_produce_glyphs): Don't convert multibyte characters
* xterm.c (x_produce_glyphs): Don't convert multibyte characters
...
...
src/eval.c
View file @
0967b4b0
...
@@ -2935,12 +2935,14 @@ specbind (symbol, value)
...
@@ -2935,12 +2935,14 @@ specbind (symbol, value)
||
SOME_BUFFER_LOCAL_VALUEP
(
valcontents
)
||
SOME_BUFFER_LOCAL_VALUEP
(
valcontents
)
||
BUFFER_OBJFWDP
(
valcontents
))
||
BUFFER_OBJFWDP
(
valcontents
))
{
{
Lisp_Object
where
;
Lisp_Object
where
,
current_buffer
;
current_buffer
=
Fcurrent_buffer
();
/* For a local variable, record both the symbol and which
/* For a local variable, record both the symbol and which
buffer's or frame's value we are saving. */
buffer's or frame's value we are saving. */
if
(
!
NILP
(
Flocal_variable_p
(
symbol
,
Qnil
)))
if
(
!
NILP
(
Flocal_variable_p
(
symbol
,
Qnil
)))
where
=
F
current_buffer
()
;
where
=
current_buffer
;
else
if
(
!
BUFFER_OBJFWDP
(
valcontents
)
else
if
(
!
BUFFER_OBJFWDP
(
valcontents
)
&&
XBUFFER_LOCAL_VALUE
(
valcontents
)
->
found_for_frame
)
&&
XBUFFER_LOCAL_VALUE
(
valcontents
)
->
found_for_frame
)
where
=
XBUFFER_LOCAL_VALUE
(
valcontents
)
->
frame
;
where
=
XBUFFER_LOCAL_VALUE
(
valcontents
)
->
frame
;
...
@@ -2950,7 +2952,7 @@ specbind (symbol, value)
...
@@ -2950,7 +2952,7 @@ specbind (symbol, value)
/* We're not using the `unused' slot in the specbinding
/* We're not using the `unused' slot in the specbinding
structure because this would mean we have to do more
structure because this would mean we have to do more
work for simple variables. */
work for simple variables. */
specpdl_ptr
->
symbol
=
Fcons
(
symbol
,
where
);
specpdl_ptr
->
symbol
=
Fcons
(
symbol
,
Fcons
(
where
,
current_buffer
)
);
/* If SYMBOL is a per-buffer variable which doesn't have a
/* If SYMBOL is a per-buffer variable which doesn't have a
buffer-local value here, make the `let' change the global
buffer-local value here, make the `let' change the global
...
@@ -3010,17 +3012,19 @@ unbind_to (count, value)
...
@@ -3010,17 +3012,19 @@ unbind_to (count, value)
so in that case the "old value" is a list of forms to evaluate. */
so in that case the "old value" is a list of forms to evaluate. */
else
if
(
NILP
(
specpdl_ptr
->
symbol
))
else
if
(
NILP
(
specpdl_ptr
->
symbol
))
Fprogn
(
specpdl_ptr
->
old_value
);
Fprogn
(
specpdl_ptr
->
old_value
);
/* If the symbol is a list, it is really (SYMBOL . WHERE) where
/* If the symbol is a list, it is really (SYMBOL WHERE
WHERE is either nil, a buffer, or a frame. If WHERE is a
. CURRENT-BUFFER) where WHERE is either nil, a buffer, or a
buffer or frame, this indicates we bound a variable that had
frame. If WHERE is a buffer or frame, this indicates we
a buffer-local or frmae-local binding.. WHERE nil means that
bound a variable that had a buffer-local or frmae-local
the variable had the default value when it was bound. */
binding.. WHERE nil means that the variable had the default
value when it was bound. CURRENT-BUFFER is the buffer that
was current when the variable was bound. */
else
if
(
CONSP
(
specpdl_ptr
->
symbol
))
else
if
(
CONSP
(
specpdl_ptr
->
symbol
))
{
{
Lisp_Object
symbol
,
where
;
Lisp_Object
symbol
,
where
;
symbol
=
XCAR
(
specpdl_ptr
->
symbol
);
symbol
=
XCAR
(
specpdl_ptr
->
symbol
);
where
=
XCDR
(
specpdl_ptr
->
symbol
);
where
=
XCAR
(
XCDR
(
specpdl_ptr
->
symbol
)
)
;
if
(
NILP
(
where
))
if
(
NILP
(
where
))
Fset_default
(
symbol
,
specpdl_ptr
->
old_value
);
Fset_default
(
symbol
,
specpdl_ptr
->
old_value
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment