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
dd60787c
Commit
dd60787c
authored
Apr 11, 2008
by
Glenn Morris
Browse files
(Fdefvaralias): If the alias is bound and the target is not, set the
target's value to that of the alias.
parent
532a0f4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
src/ChangeLog
src/ChangeLog
+5
-0
src/eval.c
src/eval.c
+10
-3
No files found.
src/ChangeLog
View file @
dd60787c
2008-04-11 Glenn Morris <rgm@gnu.org>
* eval.c (Fdefvaralias): If the alias is bound and the target is not,
set the target's value to that of the alias.
2008-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
* term.c (set_tty_color_mode): Left over typo.
...
...
src/eval.c
View file @
dd60787c
...
...
@@ -772,9 +772,10 @@ DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0,
doc
:
/* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE.
Aliased variables always have the same value; setting one sets the other.
Third arg DOCSTRING, if non-nil, is documentation for NEW-ALIAS. If it is
omitted or nil, NEW-ALIAS gets the documentation string of BASE-VARIABLE,
or of the variable at the end of the chain of aliases, if BASE-VARIABLE is
itself an alias.
omitted or nil, NEW-ALIAS gets the documentation string of BASE-VARIABLE,
or of the variable at the end of the chain of aliases, if BASE-VARIABLE is
itself an alias. If NEW-ALIAS is bound, and BASE-VARIABLE is not,
then the value of BASE-VARIABLE is set to that of NEW-ALIAS.
The return value is BASE-VARIABLE. */
)
(
new_alias
,
base_variable
,
docstring
)
Lisp_Object
new_alias
,
base_variable
,
docstring
;
...
...
@@ -788,6 +789,12 @@ The return value is BASE-VARIABLE. */)
error
(
"Cannot make a constant an alias"
);
sym
=
XSYMBOL
(
new_alias
);
/* http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg00834.html
If n_a is bound, but b_v is not, set the value of b_v to n_a.
This is for the sake of define-obsolete-variable-alias and user
customizations. */
if
(
NILP
(
Fboundp
(
base_variable
))
&&
!
NILP
(
Fboundp
(
new_alias
)))
XSYMBOL
(
base_variable
)
->
value
=
sym
->
value
;
sym
->
indirect_variable
=
1
;
sym
->
value
=
base_variable
;
sym
->
constant
=
SYMBOL_CONSTANT_P
(
base_variable
);
...
...
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