Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
b0d53add
Commit
b0d53add
authored
Jun 13, 2000
by
Gerd Moellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(swap_in_global_binding): New function.
parent
64362cd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
src/data.c
src/data.c
+33
-0
No files found.
src/data.c
View file @
b0d53add
...
...
@@ -840,6 +840,36 @@ store_symval_forwarding (symbol, valcontents, newval)
}
}
/* Set up SYMBOL to refer to its global binding.
This makes it safe to alter the status of other bindings. */
void
swap_in_global_binding
(
symbol
)
Lisp_Object
symbol
;
{
Lisp_Object
valcontents
,
cdr
;
valcontents
=
XSYMBOL
(
symbol
)
->
value
;
if
(
!
BUFFER_LOCAL_VALUEP
(
valcontents
)
&&
!
SOME_BUFFER_LOCAL_VALUEP
(
valcontents
))
abort
();
cdr
=
XBUFFER_LOCAL_VALUE
(
valcontents
)
->
cdr
;
/* Unload the previously loaded binding. */
Fsetcdr
(
XCAR
(
cdr
),
do_symval_forwarding
(
XBUFFER_LOCAL_VALUE
(
valcontents
)
->
realvalue
));
/* Select the global binding in the symbol. */
XCAR
(
cdr
)
=
cdr
;
store_symval_forwarding
(
symbol
,
valcontents
,
XCDR
(
cdr
));
/* Indicate that the global binding is set up now. */
XBUFFER_LOCAL_VALUE
(
valcontents
)
->
frame
=
Qnil
;
XBUFFER_LOCAL_VALUE
(
valcontents
)
->
buffer
=
Qnil
;
XBUFFER_LOCAL_VALUE
(
valcontents
)
->
found_for_frame
=
0
;
XBUFFER_LOCAL_VALUE
(
valcontents
)
->
found_for_buffer
=
0
;
}
/* Set up the buffer-local symbol SYMBOL for validity in the current buffer.
VALCONTENTS is the contents of its value cell,
which points to a struct Lisp_Buffer_Local_Value.
...
...
@@ -1003,6 +1033,9 @@ set_internal (symbol, newval, buf, bindflag)
if
(
NILP
(
buf
->
name
))
return
newval
;
if
(
strcmp
(
XSYMBOL
(
symbol
)
->
name
->
data
,
"foo"
)
==
0
)
fprintf
(
stderr
,
"foo
\n
"
);
CHECK_SYMBOL
(
symbol
,
0
);
if
(
NILP
(
symbol
)
||
EQ
(
symbol
,
Qt
)
||
(
XSYMBOL
(
symbol
)
->
name
->
data
[
0
]
==
':'
...
...
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