From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: TheFlyingDutchman Newsgroups: gmane.emacs.help Subject: Re: variable's documentation string Date: Tue, 30 Jun 2009 13:33:12 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <67ca21fb-4953-4699-b190-df74a1035228@r36g2000vbn.googlegroups.com> <2c6889fe-6935-41d6-8a8e-2b6a07761cd7@j19g2000vbp.googlegroups.com> <7cws6vjsug.fsf@pbourguignon.informatimago.com> <0a97f5cb-d434-4014-ba0b-dd5126095fbf@f10g2000vbf.googlegroups.com> <7ctz1yhzvp.fsf@pbourguignon.anevia.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1246421470 16895 80.91.229.12 (1 Jul 2009 04:11:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jul 2009 04:11:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 01 06:11:03 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MLr9y-0006sE-WD for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Jul 2009 06:11:03 +0200 Original-Received: from localhost ([127.0.0.1]:46798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLr9y-0002MG-EJ for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Jul 2009 00:11:02 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!postnews.google.com!l32g2000vbp.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 23 Original-NNTP-Posting-Host: 192.91.172.42 Original-X-Trace: posting.google.com 1246393992 5906 127.0.0.1 (30 Jun 2009 20:33:12 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 30 Jun 2009 20:33:12 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l32g2000vbp.googlegroups.com; posting-host=192.91.172.42; posting-account=9bWHAAoAAAAxSFC_2O_ssTETNW9NhMbW User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.1,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:170476 X-Mailman-Approved-At: Tue, 30 Jun 2009 23:55:50 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65699 Archived-At: > > So if you want an error instead of nil, you have to ask it yourself: > > (defun variable-documentation (var) > =A0 =A0(or (documentation-property var 'variable-documentation) > =A0 =A0 =A0 =A0(error "Variable %S has no documentation" var))) > > (variable-documentation 'xyz) > =3D=3D> Debugger entered--Lisp error: (error "Variable xyz has no documen= tation") > > (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.