emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Moving my init.el to Org


From: Rainer M Krug
Subject: Re: [O] Moving my init.el to Org
Date: Wed, 03 Sep 2014 08:49:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin)

Jonathan Leech-Pepin <address@hidden> writes:

> Hello,
>
> On 2 September 2014 08:42, Rasmus <address@hidden> wrote:
>
>> Rainer M Krug <address@hidden> writes:
>>
>> > Oleh <address@hidden> 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
> )

That is what I was looking for - I'll try it out soon - step by step -
one package at a time.

>
> 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)

I think it makes sense to extract these into different files, and have
them in one org file which is then tangled.

Thanks,

Rainer

>
> Regards,
> Jon

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

Attachment: pgpGEMxBVgx_O.pgp
Description: PGP signature


reply via email to

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