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
4a9308b8
Commit
4a9308b8
authored
Jun 14, 2005
by
Juanma Barranquero
Browse files
(Fdefvaralias): Rename arguments SYMBOL and ALIASED to NEW-ALIAS and
BASE-VARIABLE, respectively.
parent
922a9de3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
19 deletions
+25
-19
src/ChangeLog
src/ChangeLog
+5
-0
src/eval.c
src/eval.c
+20
-19
No files found.
src/ChangeLog
View file @
4a9308b8
2005-06-14 Juanma Barranquero <lekktu@gmail.com>
* eval.c (Fdefvaralias): Rename arguments SYMBOL and ALIASED to
NEW-ALIAS and BASE-VARIABLE, respectively.
2005-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
* xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup.
...
...
src/eval.c
View file @
4a9308b8
...
...
@@ -722,35 +722,36 @@ usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...) */)
DEFUN
(
"defvaralias"
,
Fdefvaralias
,
Sdefvaralias
,
2
,
3
,
0
,
doc
:
/* Make SYMBOL a variable alias for symbol ALIASED.
Setting the value of SYMBOL will subsequently set the value of ALIASED,
and getting the value of SYMBOL will return the value ALIASED has.
Third arg DOCSTRING, if non-nil, is documentation for SYMBOL. If it is
omitted or nil, SYMBOL gets the documentation string of ALIASED, or of the
variable at the end of the chain of aliases, if ALIASED is itself an alias.
The return value is ALIASED. */
)
(
symbol
,
aliased
,
docstring
)
Lisp_Object
symbol
,
aliased
,
docstring
;
doc
:
/* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE.
Setting the value of NEW-ALIAS will subsequently set the value of BASE-VARIABLE,
and getting the value of NEW-ALIAS will return the value BASE-VARIABLE has.
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.
The return value is BASE-VARIABLE. */
)
(
new_alias
,
base_variable
,
docstring
)
Lisp_Object
new_alias
,
base_variable
,
docstring
;
{
struct
Lisp_Symbol
*
sym
;
CHECK_SYMBOL
(
symbol
);
CHECK_SYMBOL
(
aliased
);
CHECK_SYMBOL
(
new_alias
);
CHECK_SYMBOL
(
base_variable
);
if
(
SYMBOL_CONSTANT_P
(
symbol
))
if
(
SYMBOL_CONSTANT_P
(
new_alias
))
error
(
"Cannot make a constant an alias"
);
sym
=
XSYMBOL
(
symbol
);
sym
=
XSYMBOL
(
new_alias
);
sym
->
indirect_variable
=
1
;
sym
->
value
=
aliased
;
sym
->
constant
=
SYMBOL_CONSTANT_P
(
aliased
);
LOADHIST_ATTACH
(
symbol
);
sym
->
value
=
base_variable
;
sym
->
constant
=
SYMBOL_CONSTANT_P
(
base_variable
);
LOADHIST_ATTACH
(
new_alias
);
if
(
!
NILP
(
docstring
))
Fput
(
symbol
,
Qvariable_documentation
,
docstring
);
Fput
(
new_alias
,
Qvariable_documentation
,
docstring
);
else
Fput
(
symbol
,
Qvariable_documentation
,
Qnil
);
Fput
(
new_alias
,
Qvariable_documentation
,
Qnil
);
return
aliased
;
return
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