diff options
| author | Gerd Moellmann | 2000-03-07 14:19:23 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-03-07 14:19:23 +0000 |
| commit | f6ee1260dd77f78131492db51f2c170a54db0218 (patch) | |
| tree | 10f4387b0da8cdf63c8b9c3548ce29a500909183 /src | |
| parent | f7daf1e10fd42e462f168315bb9fc3f26076da61 (diff) | |
| download | emacs-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.c | 19 |
1 files changed, 13 insertions, 6 deletions
| @@ -379,12 +379,15 @@ string is passed through `substitute-command-keys'.") | |||
| 379 | return doc; | 379 | return doc; |
| 380 | } | 380 | } |
| 381 | 381 | ||
| 382 | DEFUN ("documentation-property", Fdocumentation_property, Sdocumentation_property, 2, 3, 0, | 382 | DEFUN ("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\ |
| 384 | This is like `get', but it can refer to strings stored in the\n\ | 385 | Third 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\ |
| 387 | translation.") | 388 | This 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\ | ||
| 390 | aren'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; |