all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to retrieve doc string for a face...
@ 2005-11-20  7:53 Drew Adams
  2005-11-20 23:23 ` Richard M. Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2005-11-20  7:53 UTC (permalink / raw


Info node (elisp) Accessing Documentation says this:

 "In Emacs Lisp, a documentation string is accessible through the
  function or variable that it describes:"

And then it speaks of using functions `documentation' and
`documentation-property'.

It says nothing about retrieving the doc string supplied with `defface' or
`defgroup' or `defmacro' or ....

1. How are those doc strings retrieved? (e.g. `face-documentation')

2. Shouldn't that retrieval be documented too?

3. Info mentions the `function-documentation' property, in parallel with the
`variable-documentation' property. Is there no equivalent shortcut to
`documentation-property' for retrieving the doc string of a keyboard macro,
so that you must use `get'? Similarly, for properties `face-documentation',
`group-documentation', etc. (which are not even mentioned).

This business of retrieving doc strings doesn't seem very homogeneous - it
seems ad hoc. Shouldn't there be a simple, single way to get the doc
string(s) of an object?

If the same symbol has multiple doc strings, then that simple function would
need to let you specify which one(s) you want - by taking, for instance, a
TYPE argument, which could be a symbol such as `face' or a list of such
symbols. In the latter case, it would return the list (same order) of doc
strings. nil would be used to indicate that there is no doc string of the
given type.

I may not understand the design well, so that the above suggestion is not
appropriate, but I think that the manual, at least, should be more complete
on this matter. Even if completeness is not priority #1, node "Accessing
Documentation" should say more than it does.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to retrieve doc string for a face...
  2005-11-20  7:53 how to retrieve doc string for a face Drew Adams
@ 2005-11-20 23:23 ` Richard M. Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard M. Stallman @ 2005-11-20 23:23 UTC (permalink / raw
  Cc: emacs-devel

    It says nothing about retrieving the doc string supplied with `defface' or
    `defgroup' or `defmacro' or ....

    1. How are those doc strings retrieved? (e.g. `face-documentation')

    2. Shouldn't that retrieval be documented too?

I will doc these.

    3. Info mentions the `function-documentation' property, in parallel with the
    `variable-documentation' property. Is there no equivalent shortcut to
    `documentation-property' for retrieving the doc string of a keyboard macro,
    so that you must use `get'?

As far as I know, the only way a keyboard macro can have a doc string
is if it has a function name and that symbol has a
`function-documentation' property.  Is that correct?

*** help.texi	11 Aug 2005 08:30:32 -0400	1.25
--- help.texi	20 Nov 2005 17:28:19 -0500	
***************
*** 133,143 ****
--- 133,149 ----
  (symbol-plist 'command-line-processed)
       @result{} (variable-documentation 188902)
  @end group
+ @group
+ (documentation-property 'emacs 'group-documentation)
+      @result{} "Customization of the One True Editor."
+ @end group
  @end smallexample
  @end defun
  
  @defun documentation function &optional verbatim
  This function returns the documentation string of @var{function}.
+ @code{documentation} handles macros, named keyboard macros, and
+ special forms, as well as ordinary functions.
  
  If @var{function} is a symbol, this function first looks for the
  @code{function-documentation} property of that symbol; if that has a
***************
*** 155,160 ****
--- 161,171 ----
  if @var{function} has no function definition.  However, it is OK if
  the function definition has no documentation string.  In that case,
  @code{documentation} returns @code{nil}.
+ @end defun
+ 
+ @defun face-documentation face
+ This function returns the documentation string of @var{face} as a
+ face.
  @end defun
  
  @c Wordy to prevent overfull hboxes.  --rjc 15mar92


    This business of retrieving doc strings doesn't seem very homogeneous - it
    seems ad hoc. Shouldn't there be a simple, single way to get the doc
    string(s) of an object?

No.  I don't want to make changes in Emacs just to for the sake of
increased consistency in fairly minor areas like this one.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-20 23:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-20  7:53 how to retrieve doc string for a face Drew Adams
2005-11-20 23:23 ` Richard M. Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.