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

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

Re: Compilation warnings of ELisp seem wrong and misleading


From: Emanuel Berg
Subject: Re: Compilation warnings of ELisp seem wrong and misleading
Date: Thu, 02 Apr 2015 01:08:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

"Ludwig, Mark" <ludwig.mark@siemens.com> writes:

>> As for "should you compile your code?": one of the
>> reasons to do that apart from the supposed but
>> seldom noticed gains is that you can improve the
>> quality of your code and become a better lisper.
>> It is automatized feedback. And, because of that,
>> it is even more important that the error/warning
>> messages are understandable.
>
> In spite of pointing to the wrong source lines, the
> warnings were basically correct.
>
> Is there a way to get the warnings without writing
> a .elc file?

Interesting idea, if you are only concerned with
having the compiler tell you how to improve your code
it can be an alternative.

I don't know if there is a built-in way to do such
dry-runs, but if there is not, you can do a Makefile
which simply removes the .elc files immediately when
compilation is done.

However, there might be a better idea if the problem
is just the warning that the .emacs is newer than the
.elc, and that is to make a shell function that starts
Emacs and instead of just starting it, it will first
compile, only then start it. If there has been no
changes, with a Makefile, there will be no
recompilation, and if there have been changes, those
will be compiled first which is what you want.

So the shell function can look like this, if the
Makefile is in ~/.emacs.d/emacs-init:

    make -C ~/.emacs.d/emacs-init
    emacs

Here is the Makefile I use [1]. It has grown a bit
complicated by now, which is mostly a consequence of
me using separate files in a directory structure, not
just the ~/.emacs file. If you only have that file, it
should be ten times the more simple a Makefile, but it
should solve this issue nonetheless.

[1] http://user.it.uu.se/~embe8573/emacs-init/Makefile

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

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