aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-03-27 22:28:43 +0000
committerRichard M. Stallman1995-03-27 22:28:43 +0000
commitc07289e0a4e7ec1e5aa53250b9a3ff241d969041 (patch)
treefa7b12c7d78d8c1d6c0b8e3c4b7308554eaa067c /src
parentc74c521ddc5cbe93849f7d6be4c7476d69031072 (diff)
downloademacs-c07289e0a4e7ec1e5aa53250b9a3ff241d969041.tar.gz
emacs-c07289e0a4e7ec1e5aa53250b9a3ff241d969041.zip
(Fget, Fput): Fetch and store symbol's plist directly.
Diffstat (limited to 'src')
-rw-r--r--src/fns.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/fns.c b/src/fns.c
index 0fcf8766751..c5f6e6cebe3 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -832,7 +832,7 @@ merge (org_l1, org_l2, pred)
832DEFUN ("plist-get", Fplist_get, Splist_get, 2, 2, 0, 832DEFUN ("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\
834PLIST is a property list, which is a list of the form\n\ 834PLIST 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\
836corresponding to the given PROP, or nil if PROP is not\n\ 836corresponding to the given PROP, or nil if PROP is not\n\
837one of the properties on the list.") 837one 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
853DEFUN ("get", Fget, Sget, 2, 2, 0, 853DEFUN ("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\
855This is the last VALUE stored with `(put SYMBOL PROPNAME VALUE)'.") 855This 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
862DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, 863DEFUN ("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\
864PLIST is a property list, which is a list of the form\n\ 865PLIST 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\
866If PROP is already a property on the list, its value is set to VAL,\n\ 867If PROP is already a property on the list, its value is set to VAL,\n\
867otherwise the new PROP VAL pair is added. The new plist is returned; 868otherwise the new PROP VAL pair is added. The new plist is returned;
868use `(setq x (plist-put x prop val))' to be sure to use the new value.\n\ 869use `(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.")
897DEFUN ("put", Fput, Sput, 3, 3, 0, 898DEFUN ("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\
899It can be retrieved with `(get SYMBOL PROPNAME)'.") 900It 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
907DEFUN ("equal", Fequal, Sequal, 2, 2, 0, 910DEFUN ("equal", Fequal, Sequal, 2, 2, 0,