emacs-devel
[Top][All Lists]
Advanced

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

Re: Non-descriptive error-message


From: Richard Stallman
Subject: Re: Non-descriptive error-message
Date: Wed, 7 Nov 2001 21:53:09 -0700 (MST)

    The problem is that in lisp-mode.el:465 read is trying to read from
    narrowed-region which does not contain an expression:

          (setq expr (read (current-buffer)))

    How do I properly catch an error here and report it to user in the same way
    read signals "End of file during parsing" error?

You can use `condition-case' around the call to `read':

    (condition-case error-data
        (read)
      (error ...))

See the Emacs Lisp Manual for details.  Note that there is currently
no way to distinguish end of file from other read errors except to
look at error-data.  Maybe it is better to check explicitly for the
just-whitespace case before calling read.



reply via email to

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