diff options
| author | Richard M. Stallman | 1995-03-27 22:28:43 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-03-27 22:28:43 +0000 |
| commit | c07289e0a4e7ec1e5aa53250b9a3ff241d969041 (patch) | |
| tree | fa7b12c7d78d8c1d6c0b8e3c4b7308554eaa067c /src | |
| parent | c74c521ddc5cbe93849f7d6be4c7476d69031072 (diff) | |
| download | emacs-c07289e0a4e7ec1e5aa53250b9a3ff241d969041.tar.gz emacs-c07289e0a4e7ec1e5aa53250b9a3ff241d969041.zip | |
(Fget, Fput): Fetch and store symbol's plist directly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 23 |
1 files changed, 13 insertions, 10 deletions
| @@ -832,7 +832,7 @@ merge (org_l1, org_l2, pred) | |||
| 832 | DEFUN ("plist-get", Fplist_get, Splist_get, 2, 2, 0, | 832 | DEFUN ("plist-get", Fplist_get, Splist_get, 2, 2, 0, |
| 833 | "Extract a value from a property list.\n\ | 833 | "Extract a value from a property list.\n\ |
| 834 | PLIST is a property list, which is a list of the form\n\ | 834 | PLIST is a property list, which is a list of the form\n\ |
| 835 | (PROP1 VALUE1 PROP2 VALUE2...). This function returns the value\n\ | 835 | \(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value\n\ |
| 836 | corresponding to the given PROP, or nil if PROP is not\n\ | 836 | corresponding to the given PROP, or nil if PROP is not\n\ |
| 837 | one of the properties on the list.") | 837 | one of the properties on the list.") |
| 838 | (val, prop) | 838 | (val, prop) |
| @@ -852,17 +852,18 @@ one of the properties on the list.") | |||
| 852 | 852 | ||
| 853 | DEFUN ("get", Fget, Sget, 2, 2, 0, | 853 | DEFUN ("get", Fget, Sget, 2, 2, 0, |
| 854 | "Return the value of SYMBOL's PROPNAME property.\n\ | 854 | "Return the value of SYMBOL's PROPNAME property.\n\ |
| 855 | This is the last VALUE stored with `(put SYMBOL PROPNAME VALUE)'.") | 855 | This is the last value stored with `(put SYMBOL PROPNAME VALUE)'.") |
| 856 | (sym, prop) | 856 | (symbol, propname) |
| 857 | Lisp_Object sym, prop; | 857 | Lisp_Object symbol, propname; |
| 858 | { | 858 | { |
| 859 | return Fplist_get (Fsymbol_plist (sym), prop); | 859 | CHECK_SYMBOL (symbol, 0); |
| 860 | return Fplist_get (XSYMBOL (symbol)->plist, propname); | ||
| 860 | } | 861 | } |
| 861 | 862 | ||
| 862 | DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, | 863 | DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, |
| 863 | "Change value in PLIST of PROP to VAL.\n\ | 864 | "Change value in PLIST of PROP to VAL.\n\ |
| 864 | PLIST is a property list, which is a list of the form\n\ | 865 | PLIST is a property list, which is a list of the form\n\ |
| 865 | (PROP1 VALUE1 PROP2 VALUE2 ...). PROP is a symbol and VAL is any object.\n\ | 866 | \(PROP1 VALUE1 PROP2 VALUE2 ...). PROP is a symbol and VAL is any object.\n\ |
| 866 | If PROP is already a property on the list, its value is set to VAL,\n\ | 867 | If PROP is already a property on the list, its value is set to VAL,\n\ |
| 867 | otherwise the new PROP VAL pair is added. The new plist is returned; | 868 | otherwise the new PROP VAL pair is added. The new plist is returned; |
| 868 | use `(setq x (plist-put x prop val))' to be sure to use the new value.\n\ | 869 | use `(setq x (plist-put x prop val))' to be sure to use the new value.\n\ |
| @@ -897,11 +898,13 @@ The PLIST is modified by side effects.") | |||
| 897 | DEFUN ("put", Fput, Sput, 3, 3, 0, | 898 | DEFUN ("put", Fput, Sput, 3, 3, 0, |
| 898 | "Store SYMBOL's PROPNAME property with value VALUE.\n\ | 899 | "Store SYMBOL's PROPNAME property with value VALUE.\n\ |
| 899 | It can be retrieved with `(get SYMBOL PROPNAME)'.") | 900 | It can be retrieved with `(get SYMBOL PROPNAME)'.") |
| 900 | (sym, prop, val) | 901 | (symbol, propname, value) |
| 901 | Lisp_Object sym, prop, val; | 902 | Lisp_Object symbol, propname, value; |
| 902 | { | 903 | { |
| 903 | Fsetplist (sym, Fplist_put (Fsymbol_plist (sym), prop, val)); | 904 | CHECK_SYMBOL (symbol, 0); |
| 904 | return val; | 905 | XSYMBOL (symbol)->plist |
| 906 | = Fplist_put (XSYMBOL (symbol)->plist, propname, value); | ||
| 907 | return value; | ||
| 905 | } | 908 | } |
| 906 | 909 | ||
| 907 | DEFUN ("equal", Fequal, Sequal, 2, 2, 0, | 910 | DEFUN ("equal", Fequal, Sequal, 2, 2, 0, |