From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.help Subject: Re: Reporting error to user... Date: Tue, 05 Mar 2013 23:32:19 +0200 Organization: Oleksandr Gavenko , http://gavenkoa.users.sf.net Message-ID: <87zjyh353w.fsf@gavenkoa.example.com> References: <87fw0cmht6.fsf@gavenkoa.example.com> <87k3po1de2.fsf@gmail.com> <871ubvufz3.fsf@gavenkoa.example.com> <87hakqih3t.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362519231 29382 80.91.229.3 (5 Mar 2013 21:33:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Mar 2013 21:33:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 05 22:34:16 2013 Return-path: Envelope-to: geh-help-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 1UCzUx-0005du-QY for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Mar 2013 22:34:11 +0100 Original-Received: from localhost ([::1]:56620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCzUY-000374-VR for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Mar 2013 16:33:46 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCzU8-000336-C1 for help-gnu-emacs@gnu.org; Tue, 05 Mar 2013 16:33:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCzTd-00013L-7m for help-gnu-emacs@gnu.org; Tue, 05 Mar 2013 16:33:14 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:56834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCzTd-00011m-0F for help-gnu-emacs@gnu.org; Tue, 05 Mar 2013 16:32:49 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UCzTj-0004hs-GU for help-gnu-emacs@gnu.org; Tue, 05 Mar 2013 22:32:55 +0100 Original-Received: from 37.229.4.200 ([37.229.4.200]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Mar 2013 22:32:55 +0100 Original-Received: from gavenkoa by 37.229.4.200 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Mar 2013 22:32:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 37.229.4.200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:iey4ONA2vjT6/FAOFAlxok58puY= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89370 Archived-At: On 2013-03-05, Dmitry Gutov wrote: > Oleksandr Gavenko writes: >> How to backport 'user-error' into early Emacs versions? Do I need to write >> a wrapper: >> >> (defun my-user-error (format &rest args) >> (if (fboundp 'user-error)) >> (apply 'user-error format args) >> (apply 'error format args)) >> >> in my mode and use 'my-user-error' instead if 'user-error'? > > You can just copy the implementation, it's trivial. > While implementation is trivial (from 'emacs-bzr/trunk/lisp/subr.el'): (defun user-error (format &rest args) (while t (signal 'user-error (list (apply #'format format args))))) I eval: (symbol-plist 'user-error) and get: (error-conditions (user-error error) error-message "") But I can't find a place which put 'error-conditions' to 'user-error' symbol. Really this must be done, from 'signal' docs: The argument ERROR-SYMBOL must be an "error symbol"--a symbol bearing a property `error-conditions' whose value is a list of condition names. -- Best regards!