aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2004-11-15 15:19:48 +0000
committerKim F. Storm2004-11-15 15:19:48 +0000
commit442f927b424c12a78ff6f7bb876c445a2a9c24e0 (patch)
treea0b3b629e76c286dbff454fda77ed2c72e4eded8
parent6d073ae1e354b64e9dc32c20ef96094a76beae02 (diff)
downloademacs-442f927b424c12a78ff6f7bb876c445a2a9c24e0.tar.gz
emacs-442f927b424c12a78ff6f7bb876c445a2a9c24e0.zip
(Other Plists): Note that plist-get may signal error.
Add safe-plist-get.
-rw-r--r--lispref/symbols.texi20
1 files changed, 19 insertions, 1 deletions
diff --git a/lispref/symbols.texi b/lispref/symbols.texi
index d6743898d6f..858918445ff 100644
--- a/lispref/symbols.texi
+++ b/lispref/symbols.texi
@@ -528,11 +528,29 @@ that are stored in places other than symbols:
528 528
529@defun plist-get plist property 529@defun plist-get plist property
530This returns the value of the @var{property} property 530This returns the value of the @var{property} property
531stored in the property list @var{plist}. For example, 531stored in the property list @var{plist}.
532A @code{wrong-type-argument} error may be signaled if @var{plist} is
533not a valid property list. For example,
532 534
533@example 535@example
534(plist-get '(foo 4) 'foo) 536(plist-get '(foo 4) 'foo)
535 @result{} 4 537 @result{} 4
538(plist-get '(foo 4 bad) 'foo)
539 @result{} 4
540(plist-get '(foo 4 bad) 'bar)
541 @result{} @code{wrong-type-argument} error
542@end example
543@end defun
544
545@defun safe-plist-get plist property
546This returns the value of the @var{property} property
547stored in the property list @var{plist}. Unlike @code{plist-get}, it
548accepts a malformed @var{plist} argument and always returns @code{nil}
549if @var{property} is not found in the @var{plist}. For example,
550
551@example
552(safe-plist-get '(foo 4 bad) 'bar)
553 @result{} nil
536@end example 554@end example
537@end defun 555@end defun
538 556