From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#20625: 25.0.50; doc of `define-error` is incorrect Date: Sat, 23 May 2015 07:48:46 -0700 (PDT) Message-ID: <10eb5733-c84c-491d-86ca-2d6a05b80e7d@default> References: <> <<83382n38et.fsf@gnu.org>> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1432392630 3394 80.91.229.3 (23 May 2015 14:50:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 May 2015 14:50:30 +0000 (UTC) Cc: 20625@debbugs.gnu.org To: Eli Zaretskii , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 23 16:50:17 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YwAki-00075f-Np for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 May 2015 16:50:16 +0200 Original-Received: from localhost ([::1]:37837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwAkh-0003Va-Vb for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 May 2015 10:50:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwAkb-0003V9-2M for bug-gnu-emacs@gnu.org; Sat, 23 May 2015 10:50:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YwAkW-0002y2-UL for bug-gnu-emacs@gnu.org; Sat, 23 May 2015 10:50:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwAkW-0002xj-Ru for bug-gnu-emacs@gnu.org; Sat, 23 May 2015 10:50:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YwAkV-0003aV-JX for bug-gnu-emacs@gnu.org; Sat, 23 May 2015 10:50:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 May 2015 14:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20625 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20625-submit@debbugs.gnu.org id=B20625.143239254213721 (code B ref 20625); Sat, 23 May 2015 14:50:03 +0000 Original-Received: (at 20625) by debbugs.gnu.org; 23 May 2015 14:49:02 +0000 Original-Received: from localhost ([127.0.0.1]:54042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YwAjS-0003Yt-45 for submit@debbugs.gnu.org; Sat, 23 May 2015 10:49:02 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:31819) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YwAjM-0003Yc-29 for 20625@debbugs.gnu.org; Sat, 23 May 2015 10:48:56 -0400 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t4NEmjAo003609 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 23 May 2015 14:48:45 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t4NEmjNj000469 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 23 May 2015 14:48:45 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t4NEmjBk024572; Sat, 23 May 2015 14:48:45 GMT In-Reply-To: <<83382n38et.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103107 Archived-At: > > MESSAGE is not necessarily a string. It is a requiredargument, > > but the code explicitly makes use of the case where it is nil. > > And existing code delivered with Emacs (e.g. bookmark.el) makes > > use of a nil MESSAGE. That case should be documented. >=20 > AFAICS, users of this property will yield strange messages if > MESSAGE is nil. So shouldn't we at least advise that it's a string? >=20 > Also, what exactly is the purpose of bookmark.el's using nil there? I'm no expert in this, and I wasn't the one who changed bookmark.el (in 24.4) to use `define-error'. But it seems that what is meant is that `bookmark-errors' is being declared to be an error condition, but with no definition: no message and no parent (other than the default, `error'). This is the Emacs 24.3 code: (put 'bookmark-error-no-filename 'error-conditions '(error bookmark-errors bookmark-error-no-filename)) (put 'bookmark-error-no-filename 'error-message "Bookmark has no associated file (or directory)") And this is the 24.4+ code: (define-error 'bookmark-errors nil) (define-error 'bookmark-error-no-filename "Bookmark has no associated file (or directory)" 'bookmark-errors) In both cases, `bookmark-errors' is presumably being declared as an error condition, but it is not defined in any way. It is presumably there to provide a more general category than `bookmark-error-no-filename'. That makes sense to me. If my interpretation is correct, then something like that explanation should be added to the doc, I think. Before `define-error', things were clear enough with the doc for property `error-conditions'. It seems that the doc for `define-error' should cover the same cases. I believe that means that with nil MESSAGE, property `error-conditions' is applied (using MESSAGE), and property `error-message' is not (absent or nil value). In fact, I think that the right change would be not only to say what nil MESSAGE means but to make MESSAGE an &optional parameter.