diff options
| author | Karoly Lorentey | 2005-07-05 22:12:55 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-07-05 22:12:55 +0000 |
| commit | 41be4f66fd33b17eba3e3ed4b8f8828c77f18517 (patch) | |
| tree | 23558632ba5eac56317f1df9fac514f439e7f82d /src/eval.c | |
| parent | 2f98e6e37b5870a644a178d4d6998c6c7f1f68dd (diff) | |
| parent | 41700b79db6e52aee51d9d57c453b5f6fbd61e6e (diff) | |
| download | emacs-41be4f66fd33b17eba3e3ed4b8f8828c77f18517.tar.gz emacs-41be4f66fd33b17eba3e3ed4b8f8828c77f18517.zip | |
Merged from miles@gnu.org--gnu-2005 (patch 83-87, 449-468)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-449
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-450
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-451
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-452
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-453
Update from CVS: lisp/subr.el (add-to-ordered-list): Doc fix.
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-454
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-455
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-456
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-457
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-458
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-459
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-460
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-461
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-462
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-463
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-465
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-466
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-467
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-468
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-83
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-84
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-85
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-86
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-87
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-371
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 72 |
1 files changed, 51 insertions, 21 deletions
diff --git a/src/eval.c b/src/eval.c index c33021da7b7..17e9f7f4360 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -806,6 +806,10 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | |||
| 806 | register Lisp_Object sym, tem, tail; | 806 | register Lisp_Object sym, tem, tail; |
| 807 | 807 | ||
| 808 | sym = Fcar (args); | 808 | sym = Fcar (args); |
| 809 | if (SYMBOL_CONSTANT_P (sym)) | ||
| 810 | error ("Constant symbol `%s' specified in defvar", | ||
| 811 | SDATA (SYMBOL_NAME (sym))); | ||
| 812 | |||
| 809 | tail = Fcdr (args); | 813 | tail = Fcdr (args); |
| 810 | if (!NILP (Fcdr (Fcdr (tail)))) | 814 | if (!NILP (Fcdr (Fcdr (tail)))) |
| 811 | error ("Too many arguments"); | 815 | error ("Too many arguments"); |
| @@ -885,12 +889,24 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) | |||
| 885 | return sym; | 889 | return sym; |
| 886 | } | 890 | } |
| 887 | 891 | ||
| 892 | /* Error handler used in Fuser_variable_p. */ | ||
| 893 | static Lisp_Object | ||
| 894 | user_variable_p_eh (ignore) | ||
| 895 | Lisp_Object ignore; | ||
| 896 | { | ||
| 897 | return Qnil; | ||
| 898 | } | ||
| 899 | |||
| 888 | DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0, | 900 | DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0, |
| 889 | doc: /* Returns t if VARIABLE is intended to be set and modified by users. | 901 | doc: /* Return t if VARIABLE is intended to be set and modified by users. |
| 890 | \(The alternative is a variable used internally in a Lisp program.) | 902 | \(The alternative is a variable used internally in a Lisp program.) |
| 891 | Determined by whether the first character of the documentation | 903 | A variable is a user variable if |
| 892 | for the variable is `*' or if the variable is customizable (has a non-nil | 904 | \(1) the first character of its documentation is `*', or |
| 893 | value of `standard-value' or of `custom-autoload' on its property list). */) | 905 | \(2) it is customizable (its property list contains a non-nil value |
| 906 | of `standard-value' or `custom-autoload'), or | ||
| 907 | \(3) it is an alias for another user variable. | ||
| 908 | Return nil if VARIABLE is an alias and there is a loop in the | ||
| 909 | chain of symbols. */) | ||
| 894 | (variable) | 910 | (variable) |
| 895 | Lisp_Object variable; | 911 | Lisp_Object variable; |
| 896 | { | 912 | { |
| @@ -899,23 +915,37 @@ value of `standard-value' or of `custom-autoload' on its property list). */) | |||
| 899 | if (!SYMBOLP (variable)) | 915 | if (!SYMBOLP (variable)) |
| 900 | return Qnil; | 916 | return Qnil; |
| 901 | 917 | ||
| 902 | documentation = Fget (variable, Qvariable_documentation); | 918 | /* If indirect and there's an alias loop, don't check anything else. */ |
| 903 | if (INTEGERP (documentation) && XINT (documentation) < 0) | 919 | if (XSYMBOL (variable)->indirect_variable |
| 904 | return Qt; | 920 | && NILP (internal_condition_case_1 (indirect_variable, variable, |
| 905 | if (STRINGP (documentation) | 921 | Qt, user_variable_p_eh))) |
| 906 | && ((unsigned char) SREF (documentation, 0) == '*')) | 922 | return Qnil; |
| 907 | return Qt; | 923 | |
| 908 | /* If it is (STRING . INTEGER), a negative integer means a user variable. */ | 924 | while (1) |
| 909 | if (CONSP (documentation) | 925 | { |
| 910 | && STRINGP (XCAR (documentation)) | 926 | documentation = Fget (variable, Qvariable_documentation); |
| 911 | && INTEGERP (XCDR (documentation)) | 927 | if (INTEGERP (documentation) && XINT (documentation) < 0) |
| 912 | && XINT (XCDR (documentation)) < 0) | 928 | return Qt; |
| 913 | return Qt; | 929 | if (STRINGP (documentation) |
| 914 | /* Customizable? See `custom-variable-p'. */ | 930 | && ((unsigned char) SREF (documentation, 0) == '*')) |
| 915 | if ((!NILP (Fget (variable, intern ("standard-value")))) | 931 | return Qt; |
| 916 | || (!NILP (Fget (variable, intern ("custom-autoload"))))) | 932 | /* If it is (STRING . INTEGER), a negative integer means a user variable. */ |
| 917 | return Qt; | 933 | if (CONSP (documentation) |
| 918 | return Qnil; | 934 | && STRINGP (XCAR (documentation)) |
| 935 | && INTEGERP (XCDR (documentation)) | ||
| 936 | && XINT (XCDR (documentation)) < 0) | ||
| 937 | return Qt; | ||
| 938 | /* Customizable? See `custom-variable-p'. */ | ||
| 939 | if ((!NILP (Fget (variable, intern ("standard-value")))) | ||
| 940 | || (!NILP (Fget (variable, intern ("custom-autoload"))))) | ||
| 941 | return Qt; | ||
| 942 | |||
| 943 | if (!XSYMBOL (variable)->indirect_variable) | ||
| 944 | return Qnil; | ||
| 945 | |||
| 946 | /* An indirect variable? Let's follow the chain. */ | ||
| 947 | variable = XSYMBOL (variable)->value; | ||
| 948 | } | ||
| 919 | } | 949 | } |
| 920 | 950 | ||
| 921 | DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0, | 951 | DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0, |