X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/6d5eb5b0d2e50b0dd153a988cc52492cb77fc333..e5a69fd00a424f59f2ef7be8049b47340ddaa1ca:/src/eval.c diff --git a/src/eval.c b/src/eval.c index 079c7ecb6c..4a3f5083b3 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1,5 +1,5 @@ /* Evaluator for GNU Emacs Lisp interpreter. - Copyright (C) 1985-1987, 1993-1995, 1999-2011 Free Software Foundation, Inc. + Copyright (C) 1985-1987, 1993-1995, 1999-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -124,6 +124,12 @@ Lisp_Object Vsignaling_function; int handling_signal; +/* If non-nil, Lisp code must not be run since some part of Emacs is + in an inconsistent state. Currently, x-create-frame uses this to + avoid triggering window-configuration-change-hook while the new + frame is half-initialized. */ +Lisp_Object inhibit_lisp_code; + static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *); static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN; static int interactive_p (int); @@ -780,17 +786,15 @@ The return value is BASE-VARIABLE. */) DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0, doc: /* Define SYMBOL as a variable, and return SYMBOL. -You are not required to define a variable in order to use it, -but the definition can supply documentation and an initial value -in a way that tags can recognize. - -INITVALUE is evaluated, and used to set SYMBOL, only if SYMBOL's value is void. -If SYMBOL is buffer-local, its default value is what is set; - buffer-local values are not affected. -INITVALUE and DOCSTRING are optional. -If DOCSTRING starts with *, this variable is identified as a user option. - This means that M-x set-variable recognizes it. - See also `user-variable-p'. +You are not required to define a variable in order to use it, but +defining it lets you supply an initial value and documentation, which +can be referred to by the Emacs help facilities and other programming +tools. The `defvar' form also declares the variable as \"special\", +so that it is always dynamically bound even if `lexical-binding' is t. + +The optional argument INITVALUE is evaluated, and used to set SYMBOL, +only if SYMBOL's value is void. If SYMBOL is buffer-local, its +default value is what is set; buffer-local values are not affected. If INITVALUE is missing, SYMBOL's value is not set. If SYMBOL has a local binding, then this form affects the local @@ -799,6 +803,13 @@ load a file defining variables, with this form or with `defconst' or `defcustom', you should always load that file _outside_ any bindings for these variables. \(`defconst' and `defcustom' behave similarly in this respect.) + +The optional argument DOCSTRING is a documentation string for the +variable. + +To define a user option, use `defcustom' instead of `defvar'. +The function `user-variable-p' also identifies a variable as a user +option if its DOCSTRING starts with *, but this behavior is obsolete. usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) (Lisp_Object args) { @@ -873,15 +884,19 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) DEFUN ("defconst", Fdefconst, Sdefconst, 2, UNEVALLED, 0, doc: /* Define SYMBOL as a constant variable. -The intent is that neither programs nor users should ever change this value. -Always sets the value of SYMBOL to the result of evalling INITVALUE. -If SYMBOL is buffer-local, its default value is what is set; - buffer-local values are not affected. -DOCSTRING is optional. - -If SYMBOL has a local binding, then this form sets the local binding's -value. However, you should normally not make local bindings for -variables defined with this form. +This declares that neither programs nor users should ever change the +value. This constancy is not actually enforced by Emacs Lisp, but +SYMBOL is marked as a special variable so that it is never lexically +bound. + +The `defconst' form always sets the value of SYMBOL to the result of +evalling INITVALUE. If SYMBOL is buffer-local, its default value is +what is set; buffer-local values are not affected. If SYMBOL has a +local binding, then this form sets the local binding's value. +However, you should normally not make local bindings for variables +defined with this form. + +The optional DOCSTRING specifies the variable's documentation string. usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) (Lisp_Object args) { @@ -926,13 +941,14 @@ lisp_indirect_variable (Lisp_Object sym) DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0, doc: /* Return t if VARIABLE is intended to be set and modified by users. \(The alternative is a variable used internally in a Lisp program.) -A variable is a user variable if -\(1) the first character of its documentation is `*', or -\(2) it is customizable (its property list contains a non-nil value - of `standard-value' or `custom-autoload'), or -\(3) it is an alias for another user variable. -Return nil if VARIABLE is an alias and there is a loop in the -chain of symbols. */) + +This function returns t if (i) the first character of its +documentation is `*', or (ii) it is customizable (its property list +contains a non-nil value of `standard-value' or `custom-autoload'), or +\(iii) it is an alias for a user variable. + +But condition (i) is considered obsolete, so for most purposes this is +equivalent to `custom-variable-p'. */) (Lisp_Object variable) { Lisp_Object documentation; @@ -3756,6 +3772,8 @@ alist of active lexical bindings. */); staticpro (&Vsignaling_function); Vsignaling_function = Qnil; + inhibit_lisp_code = Qnil; + defsubr (&Sor); defsubr (&Sand); defsubr (&Sif);