emacs-devel
[Top][All Lists]
Advanced

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

Re: Better startup error handling


From: Stefan Monnier
Subject: Re: Better startup error handling
Date: Sat, 28 Apr 2012 11:16:00 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

>> The way I see it, we should ideally be able to load the .emacs in such
>> a way that an error doesn't prevent the rest of the file from being
>> loaded, and the error should be clearly signaled to the user with some
>> kind of line-number information.
> Yes.  This presumably means some sort of evaluator hook to execute some
> code between each toplevel form, or wrap each top-level form in a
> condition-case -- reader macros would I think handle it, but elisp
> doesn't have those.

Another way to do it is to not use `load' but to find-file .emacs and
then eval-region chunk by chunk.

>> In my wildest dreams I also imagine that we'd check for obsolete vars,
>> hooks, and functions.  Maybe even give the same kind of feedback that
>> the byte-compiler gives about the code.
> Can't you do that trivially by loading .emacs into a temporary buffer in
> default.el, then byte-compiling it and throwing the results away?
> (In default.el because that way it picks up changes to the byte-compiler
> configuration that you may have made in .emacs.)

Kind of.

> Downsides: loads the byte-compiler even in sessions that don't need it,
> and notably inefficient.

Exactly: in theory it's straightforward, but doing it well will require
more work.  IIRC there are some other issues such as the fact that
.emacs code tends to be very different from typical code in Elisp
packages, and the kinds of things we want to flag aren't all the same
(some things are acceptable/normal/unavoidable in one but not in the
other).


        Stefan



reply via email to

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