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

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

Re: Reporting error to user...


From: Oleksandr Gavenko
Subject: Re: Reporting error to user...
Date: Tue, 05 Mar 2013 23:32:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

On 2013-03-05, Dmitry Gutov wrote:

> Oleksandr Gavenko <gavenkoa@gmail.com> 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!




reply via email to

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