From: Richard M. Stallman Date: Mon, 27 Mar 1995 22:28:43 +0000 (+0000) Subject: (Fget, Fput): Fetch and store symbol's plist directly. X-Git-Tag: emacs-19.34~4720 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c07289e0a4e7ec1e5aa53250b9a3ff241d969041;p=emacs.git (Fget, Fput): Fetch and store symbol's plist directly. --- 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) DEFUN ("plist-get", Fplist_get, Splist_get, 2, 2, 0, "Extract a value from a property list.\n\ PLIST is a property list, which is a list of the form\n\ -(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value\n\ +\(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value\n\ corresponding to the given PROP, or nil if PROP is not\n\ one of the properties on the list.") (val, prop) @@ -852,17 +852,18 @@ one of the properties on the list.") DEFUN ("get", Fget, Sget, 2, 2, 0, "Return the value of SYMBOL's PROPNAME property.\n\ -This is the last VALUE stored with `(put SYMBOL PROPNAME VALUE)'.") - (sym, prop) - Lisp_Object sym, prop; +This is the last value stored with `(put SYMBOL PROPNAME VALUE)'.") + (symbol, propname) + Lisp_Object symbol, propname; { - return Fplist_get (Fsymbol_plist (sym), prop); + CHECK_SYMBOL (symbol, 0); + return Fplist_get (XSYMBOL (symbol)->plist, propname); } DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, "Change value in PLIST of PROP to VAL.\n\ PLIST is a property list, which is a list of the form\n\ -(PROP1 VALUE1 PROP2 VALUE2 ...). PROP is a symbol and VAL is any object.\n\ +\(PROP1 VALUE1 PROP2 VALUE2 ...). PROP is a symbol and VAL is any object.\n\ If PROP is already a property on the list, its value is set to VAL,\n\ otherwise the new PROP VAL pair is added. The new plist is returned; 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.") DEFUN ("put", Fput, Sput, 3, 3, 0, "Store SYMBOL's PROPNAME property with value VALUE.\n\ It can be retrieved with `(get SYMBOL PROPNAME)'.") - (sym, prop, val) - Lisp_Object sym, prop, val; + (symbol, propname, value) + Lisp_Object symbol, propname, value; { - Fsetplist (sym, Fplist_put (Fsymbol_plist (sym), prop, val)); - return val; + CHECK_SYMBOL (symbol, 0); + XSYMBOL (symbol)->plist + = Fplist_put (XSYMBOL (symbol)->plist, propname, value); + return value; } DEFUN ("equal", Fequal, Sequal, 2, 2, 0,