comparison src/fns.c @ 61723:afe4f19c3436

(Fplist_get): Replace by Fsafe_plist_get. (Fsafe_plist_get): Rename to Fplist_get. (Fsafe_get): Remove, as Fget now uses safe Fplist_get. (defsubr): Remove defsubr for Fsafe_plist_get and Fsafe_get.
author Kim F. Storm <storm@cua.dk>
date Thu, 21 Apr 2005 23:44:59 +0000
parents fe8e91f043af
children 76a2f6423902
comparison
equal deleted inserted replaced
61722:642b9d312765 61723:afe4f19c3436
184 goto retry; 184 goto retry;
185 } 185 }
186 return val; 186 return val;
187 } 187 }
188 188
189 /* This does not check for quits. That is safe 189 /* This does not check for quits. That is safe since it must terminate. */
190 since it must terminate. */
191 190
192 DEFUN ("safe-length", Fsafe_length, Ssafe_length, 1, 1, 0, 191 DEFUN ("safe-length", Fsafe_length, Ssafe_length, 1, 1, 0,
193 doc: /* Return the length of a list, but avoid error or infinite loop. 192 doc: /* Return the length of a list, but avoid error or infinite loop.
194 This function never gets an error. If LIST is not really a list, 193 This function never gets an error. If LIST is not really a list,
195 it returns 0. If LIST is circular, it returns a finite value 194 it returns 0. If LIST is circular, it returns a finite value
1979 tail = tem; 1978 tail = tem;
1980 } 1979 }
1981 } 1980 }
1982 1981
1983 1982
1983 #if 0 /* Unsafe version. */
1984 DEFUN ("plist-get", Fplist_get, Splist_get, 2, 2, 0, 1984 DEFUN ("plist-get", Fplist_get, Splist_get, 2, 2, 0,
1985 doc: /* Extract a value from a property list. 1985 doc: /* Extract a value from a property list.
1986 PLIST is a property list, which is a list of the form 1986 PLIST is a property list, which is a list of the form
1987 \(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value 1987 \(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value
1988 corresponding to the given PROP, or nil if PROP is not 1988 corresponding to the given PROP, or nil if PROP is not
2009 if (!NILP (tail)) 2009 if (!NILP (tail))
2010 wrong_type_argument (Qlistp, prop); 2010 wrong_type_argument (Qlistp, prop);
2011 2011
2012 return Qnil; 2012 return Qnil;
2013 } 2013 }
2014 2014 #endif
2015 DEFUN ("safe-plist-get", Fsafe_plist_get, Ssafe_plist_get, 2, 2, 0, 2015
2016 /* This does not check for quits. That is safe since it must terminate. */
2017
2018 DEFUN ("plist-get", Fplist_get, Splist_get, 2, 2, 0,
2016 doc: /* Extract a value from a property list. 2019 doc: /* Extract a value from a property list.
2017 PLIST is a property list, which is a list of the form 2020 PLIST is a property list, which is a list of the form
2018 \(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value 2021 \(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value
2019 corresponding to the given PROP, or nil if PROP is not 2022 corresponding to the given PROP, or nil if PROP is not one of the
2020 one of the properties on the list. 2023 properties on the list. This function never signals an error. */)
2021 This function never signals an error. */)
2022 (plist, prop) 2024 (plist, prop)
2023 Lisp_Object plist; 2025 Lisp_Object plist;
2024 Lisp_Object prop; 2026 Lisp_Object prop;
2025 { 2027 {
2026 Lisp_Object tail, halftail; 2028 Lisp_Object tail, halftail;
2047 (symbol, propname) 2049 (symbol, propname)
2048 Lisp_Object symbol, propname; 2050 Lisp_Object symbol, propname;
2049 { 2051 {
2050 CHECK_SYMBOL (symbol); 2052 CHECK_SYMBOL (symbol);
2051 return Fplist_get (XSYMBOL (symbol)->plist, propname); 2053 return Fplist_get (XSYMBOL (symbol)->plist, propname);
2052 }
2053
2054 DEFUN ("safe-get", Fsafe_get, Ssafe_get, 2, 2, 0,
2055 doc: /* Return the value of SYMBOL's PROPNAME property.
2056 This is the last value stored with `(put SYMBOL PROPNAME VALUE)'.
2057 This function never signals an error. */)
2058 (symbol, propname)
2059 Lisp_Object symbol, propname;
2060 {
2061 if (!SYMBOLP (symbol))
2062 return Qnil;
2063 return Fsafe_plist_get (XSYMBOL (symbol)->plist, propname);
2064 } 2054 }
2065 2055
2066 DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, 2056 DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0,
2067 doc: /* Change value in PLIST of PROP to VAL. 2057 doc: /* Change value in PLIST of PROP to VAL.
2068 PLIST is a property list, which is a list of the form 2058 PLIST is a property list, which is a list of the form
5809 defsubr (&Sdelete); 5799 defsubr (&Sdelete);
5810 defsubr (&Snreverse); 5800 defsubr (&Snreverse);
5811 defsubr (&Sreverse); 5801 defsubr (&Sreverse);
5812 defsubr (&Ssort); 5802 defsubr (&Ssort);
5813 defsubr (&Splist_get); 5803 defsubr (&Splist_get);
5814 defsubr (&Ssafe_plist_get);
5815 defsubr (&Sget); 5804 defsubr (&Sget);
5816 defsubr (&Ssafe_get);
5817 defsubr (&Splist_put); 5805 defsubr (&Splist_put);
5818 defsubr (&Sput); 5806 defsubr (&Sput);
5819 defsubr (&Slax_plist_get); 5807 defsubr (&Slax_plist_get);
5820 defsubr (&Slax_plist_put); 5808 defsubr (&Slax_plist_put);
5821 defsubr (&Seql); 5809 defsubr (&Seql);