help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: variable's documentation string


From: TheFlyingDutchman
Subject: Re: variable's documentation string
Date: Tue, 30 Jun 2009 13:33:12 -0700 (PDT)
User-agent: G2/1.0

>
> So if you want an error instead of nil, you have to ask it yourself:
>
> (defun variable-documentation (var)
>    (or (documentation-property var 'variable-documentation)
>        (error "Variable %S has no documentation" var)))
>
> (variable-documentation 'xyz)
> ==> Debugger entered--Lisp error: (error "Variable xyz has no documentation")
>
> (variable-documentation 'myVar)
> --> "This is the documentation string"
>
> --
> __Pascal Bourguignon__

Thanks Pascal. What I was hoping for was not an error if documentation
is nil, but if the symbol name was invalid. But I guess in Emacs Lisp
there is no such thing as an invalid symbol name. So it would have to
be an error if the symbol was only created from a "read or use", not
from a setq or defvar, etc.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]