emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/eval.c,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/src/eval.c,v
Date: Fri, 11 Apr 2008 03:41:23 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/04/11 03:41:23

Index: eval.c
===================================================================
RCS file: /sources/emacs/emacs/src/eval.c,v
retrieving revision 1.299
retrieving revision 1.300
diff -u -b -r1.299 -r1.300
--- eval.c      19 Mar 2008 17:02:31 -0000      1.299
+++ eval.c      11 Apr 2008 03:41:23 -0000      1.300
@@ -772,9 +772,10 @@
        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 @@
     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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]