Commit 442f927b authored by Kim F. Storm's avatar Kim F. Storm
Browse files

(Other Plists): Note that plist-get may signal error.

Add safe-plist-get.
parent 6d073ae1
......@@ -528,11 +528,29 @@ that are stored in places other than symbols:
@defun plist-get plist property
This returns the value of the @var{property} property
stored in the property list @var{plist}. For example,
stored in the property list @var{plist}.
A @code{wrong-type-argument} error may be signaled if @var{plist} is
not a valid property list. For example,
@example
(plist-get '(foo 4) 'foo)
@result{} 4
(plist-get '(foo 4 bad) 'foo)
@result{} 4
(plist-get '(foo 4 bad) 'bar)
@result{} @code{wrong-type-argument} error
@end example
@end defun
@defun safe-plist-get plist property
This returns the value of the @var{property} property
stored in the property list @var{plist}. Unlike @code{plist-get}, it
accepts a malformed @var{plist} argument and always returns @code{nil}
if @var{property} is not found in the @var{plist}. For example,
@example
(safe-plist-get '(foo 4 bad) 'bar)
@result{} nil
@end example
@end defun
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment