# HG changeset patch # User Kim F. Storm # Date 1113899659 0 # Node ID e4fc95d95925f5eb594abaa2ef340ae0763554d0 # Parent aff89865e27c8ed9aa9edac6dab43426dbc29f34 (Fsafe_get): New function. (syms_of_fns): Defsubr it. diff -r aff89865e27c -r e4fc95d95925 src/fns.c --- a/src/fns.c Tue Apr 19 06:53:24 2005 +0000 +++ b/src/fns.c Tue Apr 19 08:34:19 2005 +0000 @@ -2051,6 +2051,18 @@ return Fplist_get (XSYMBOL (symbol)->plist, propname); } +DEFUN ("safe-get", Fsafe_get, Ssafe_get, 2, 2, 0, + doc: /* Return the value of SYMBOL's PROPNAME property. +This is the last value stored with `(put SYMBOL PROPNAME VALUE)'. +This function never signals an error. */) + (symbol, propname) + Lisp_Object symbol, propname; +{ + if (!SYMBOLP (symbol)) + return Qnil; + return Fsafe_plist_get (XSYMBOL (symbol)->plist, propname); +} + DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, doc: /* Change value in PLIST of PROP to VAL. PLIST is a property list, which is a list of the form @@ -5792,6 +5804,7 @@ defsubr (&Splist_get); defsubr (&Ssafe_plist_get); defsubr (&Sget); + defsubr (&Ssafe_get); defsubr (&Splist_put); defsubr (&Sput); defsubr (&Slax_plist_get);