aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-03-07 14:19:23 +0000
committerGerd Moellmann2000-03-07 14:19:23 +0000
commitf6ee1260dd77f78131492db51f2c170a54db0218 (patch)
tree10f4387b0da8cdf63c8b9c3548ce29a500909183 /src
parentf7daf1e10fd42e462f168315bb9fc3f26076da61 (diff)
downloademacs-f6ee1260dd77f78131492db51f2c170a54db0218.tar.gz
emacs-f6ee1260dd77f78131492db51f2c170a54db0218.zip
(Fdocumentation_property): If value is not a string,
and doesn't refer to etc/DOC, evaluate it to obtain a string.
Diffstat (limited to 'src')
-rw-r--r--src/doc.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/doc.c b/src/doc.c
index 6aa79dcb6df..7f3cea1a2db 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -379,12 +379,15 @@ string is passed through `substitute-command-keys'.")
379 return doc; 379 return doc;
380} 380}
381 381
382DEFUN ("documentation-property", Fdocumentation_property, Sdocumentation_property, 2, 3, 0, 382DEFUN ("documentation-property", Fdocumentation_property,
383 Sdocumentation_property, 2, 3, 0,
383 "Return the documentation string that is SYMBOL's PROP property.\n\ 384 "Return the documentation string that is SYMBOL's PROP property.\n\
384This is like `get', but it can refer to strings stored in the\n\ 385Third argument RAW omitted or nil means pass the result through\n\
385`etc/DOC' file; and if the value is a string, it is passed through\n\ 386`substitute-command-keys' if it is a string.\n\
386`substitute-command-keys'. A non-nil third argument RAW avoids this\n\ 387\n\
387translation.") 388This is differs from `get' in that it can refer to strings stored in the\n\
389`etc/DOC' file; and that it evaluates documentation properties that\n\
390aren't strings.")
388 (symbol, prop, raw) 391 (symbol, prop, raw)
389 Lisp_Object symbol, prop, raw; 392 Lisp_Object symbol, prop, raw;
390{ 393{
@@ -393,8 +396,12 @@ translation.")
393 tem = Fget (symbol, prop); 396 tem = Fget (symbol, prop);
394 if (INTEGERP (tem)) 397 if (INTEGERP (tem))
395 tem = get_doc_string (XINT (tem) > 0 ? tem : make_number (- XINT (tem)), 0, 0); 398 tem = get_doc_string (XINT (tem) > 0 ? tem : make_number (- XINT (tem)), 0, 0);
396 else if (CONSP (tem)) 399 else if (CONSP (tem) && INTEGERP (XCDR (tem)))
397 tem = get_doc_string (tem, 0, 0); 400 tem = get_doc_string (tem, 0, 0);
401 else if (!STRINGP (tem))
402 /* Feval protects its argument. */
403 tem = Feval (tem);
404
398 if (NILP (raw) && STRINGP (tem)) 405 if (NILP (raw) && STRINGP (tem))
399 tem = Fsubstitute_command_keys (tem); 406 tem = Fsubstitute_command_keys (tem);
400 return tem; 407 return tem;