all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <moasen@zoho.com>
To: help-gnu-emacs@gnu.org
Subject: Re: config problems and bisecting an org-mode configuration file
Date: Wed, 07 Jun 2017 02:22:52 +0200	[thread overview]
Message-ID: <yw.86vao8sl2b.fsf@zoho.com> (raw)
In-Reply-To: 87a85ls1xm.fsf@skimble.plus.com

Sharon Kimble wrote:

> Every change to my config.org and the file is
> auto-compiled so that when I restart emacs
> I don't have to wait for config.el to be
> generated. Sometimes its a bit tiresome
> waiting for it to be generated but overall it
> works very well.

auto-compile, what exactly is that? Is is
compilation whenever you save?

It sounds a bit overkill since compilation is
mostly an optimization thing (and a way to get
suggestions how to improve the code), and
because changes to the code are most often
small, it would seem to be enough to have the
big body compiled after the change but put into
effect only upon restart, and what has changed
and needs to be changed for the session just
re-evaluated to immediate gain (e.g., the defun
that has been modified).

Use `C-x C-e' which is `eval-last-sexp' or, if
you feel the need to re-evaluate the entire
file

    (defun load-this-file ()
      (interactive)
      (load-file (buffer-file-name)) )

You can also do

    M-x load-file RET RET

to load the current file.

That said, even auto-compile on save should not
take a lot of time! Some of my Elisp files are
moderately long (the longest is 376 lines), and
when I do byte-compile in the zhell after
changing this and only this file, it takes only
2.581 seconds!

Because most of my other files are much shorter,
byte-compile is virtually instantaneous.

Even if we make room for a small overhead when
it is done with auto-compile, it should be
*fast*. So again, keep your code in different
files not exceeding say 100 lines, and it
should be fast enough. (There are exceptions of
course when the file includes tons of
documentation or if the code is of a "list"
nature, e.g. an all but endless list of keys or
faces or ...)

Try this in your config dir

   for f in *.el; do wc -l $f; done | sort -n -r

What are your top results?

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




  reply	other threads:[~2017-06-07  0:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-03 13:00 config problems and bisecting an org-mode configuration file Sharon Kimble
2017-06-03 15:46 ` Emanuel Berg
2017-06-04 19:28   ` Sharon Kimble
2017-06-05 16:21     ` Emanuel Berg
2017-06-05 18:32       ` Sharon Kimble
2017-06-05 21:04         ` Emanuel Berg
2017-06-06 13:03           ` Sharon Kimble
2017-06-07  0:22             ` Emanuel Berg [this message]
2017-06-07  1:07               ` Emanuel Berg
2017-06-07  1:26               ` Emanuel Berg
2017-06-07  1:43                 ` Emanuel Berg
2017-06-05 23:18     ` Robert Thorpe
2017-06-05 23:48       ` Emanuel Berg
2017-06-06 12:56       ` Sharon Kimble

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

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

  git send-email \
    --in-reply-to=yw.86vao8sl2b.fsf@zoho.com \
    --to=moasen@zoho.com \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.