unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Compilation warnings of ELisp seem wrong and misleading
Date: Thu, 02 Apr 2015 01:08:20 +0200	[thread overview]
Message-ID: <87pp7n8n17.fsf@debian.uxu> (raw)
In-Reply-To: mailman.3123.1427888711.31049.help-gnu-emacs@gnu.org

"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


  parent reply	other threads:[~2015-04-01 23:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3018.1427724507.31049.help-gnu-emacs@gnu.org>
2015-03-30 14:39 ` Compilation warnings of ELisp seem wrong and misleading Pascal J. Bourguignon
2015-03-30 15:40   ` Ludwig, Mark
2015-03-30 16:59     ` tomas
2015-03-30 19:09       ` Ludwig, Mark
     [not found]   ` <mailman.3032.1427730039.31049.help-gnu-emacs@gnu.org>
2015-03-30 17:08     ` Pascal J. Bourguignon
2015-03-31  0:53 ` Emanuel Berg
2015-04-01 11:45   ` Ludwig, Mark
2015-04-01 12:02     ` tomas
2015-04-02 10:20     ` Philipp Stephani
     [not found]   ` <mailman.3123.1427888711.31049.help-gnu-emacs@gnu.org>
2015-04-01 23:08     ` Emanuel Berg [this message]
2015-03-30 13:47 Ludwig, Mark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pp7n8n17.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).