From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Leech-Pepin Subject: Re: Moving my init.el to Org Date: Tue, 2 Sep 2014 08:52:28 -0400 Message-ID: References: <20140831103706.549dc45b@aga-netbook> <87y4u25h2r.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11351f02c02c6905021498a4 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOnZu-0001t6-3Z for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 08:52:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOnZp-0006tA-Nq for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 08:52:54 -0400 Received: from mail-qg0-x234.google.com ([2607:f8b0:400d:c04::234]:51271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOnZp-0006t1-Hr for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 08:52:49 -0400 Received: by mail-qg0-f52.google.com with SMTP id z60so6391411qgd.39 for ; Tue, 02 Sep 2014 05:52:48 -0700 (PDT) In-Reply-To: <87y4u25h2r.fsf@gmx.us> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: Org Mode Mailing List --001a11351f02c02c6905021498a4 Content-Type: text/plain; charset=UTF-8 Hello, On 2 September 2014 08:42, Rasmus wrote: > Rainer M Krug writes: > > > Oleh writes: > > > >>> I know that I could use org-babel-load-file, or outshine. What are > >>> other possibilities? What are the caveats (and advantages) of both > >>> (other?) ways? > >> > >> I'm using a one .el file per mode approach, with around 4000 lines > >> split into 40 files. > >> > >> This approach simplifies things a lot: for instance I haven't touched > >> Javascript in ages, but all my customizations for it are sitting in > >> javascript.el without getting in the way of the stuff that I'm using > >> now. They aren't even loaded unless I open a js file. > > > > Interesting - is your configuration online, so that one could take a > > look at it? I did not find them on your github page? > > > > Or how do you do it, that the e.g. javascript.el is only loaded when a > > js file is opened? Because this is exactly what I would like to have. > > How about something like this: > > (with-eval-after-load 'js-mode (load "javascript.el")) > > Use eval-after-load if you are using an older Emacs. Note I don't > know if there's anything called js-mode. . . > I've been using use-package (https://github.com/jwiegley/use-package) for only loading the various package-specific configurations when needed. For that example it would be: (use-package js-mode :mode ("\\.js\\'" . js-mode) :config (require 'javascript) ;; or (load "javascript.el") if not provided ) In my case it's still all in my init.el (with Outshine headings for each mode that use-package manages), but could easily extract the portions into their own files (especially for larger configurations like org) Regards, Jon --001a11351f02c02c6905021498a4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello,

On 2 September 2014 08:42, Rasmus <rasmus@gmx.us> wrote:
How about something like this:

(with-eval-after-load 'js-mode (load "javascript.el"))

Use eval-after-load if you are using an older Emacs.=C2=A0 Note I don't=
know if there's anything called js-mode. . .

I've = been using use-package=20 (https://github.com/jwi= egley/use-package) for only loading the various=20 package-specific configurations when needed.

For that example = it would be:

(use-package js-mode
=C2=A0 :mode ("= ;\\.js\\'" . js-mode)
=C2=A0 :config (require 'javasc= ript) ;; or (load "javascript.el") if not provided
)

In my case it's still all in my init.el (with Outsh= ine headings for each mode that use-package manages), but could easily extr= act the portions into their own files (especially for larger configurations= like org)

Regards,
Jon
<= /div>
--001a11351f02c02c6905021498a4--