Giter VIP home page Giter VIP logo

init-loader's Introduction

init-loader.el

What is it ?

init-loader.el is a loader of configuration files. init-loader.el loads configuration files from specified directory. It enables you to categorize your configurations and separate them into multiple files.

The original code is here. The current version of init-loader.el is based on tarao's fork version, which have some issues fixed and some essential features added compared with the original one.

Sample code

You only have to call init-loader-load with a directory where your configuration files are located.

(require 'init-loader)

;; Load configuration files in '/path/to/init-directory'.
(init-loader-load "/path/to/init-directory")

;; If you omit arguments, then `init-loader-directory' is used
(init-loader-load)

Features

Files to be loaded

Note that not all files in the directory are loaded. Each file is examined that if it is a .el or .elc file and, it has a valid name specified by init-loader-default-regexp or it is a platform specific configuration file.

By default, valid names of configuration files start with two digits. For example, the following file names are all valid:

  • 00_util.el
  • 01_ik-cmd.el
  • 21_javascript.el
  • 99_global-keys.el

Files are loaded in the lexicographical order. This helps you to resolve dependency of the configurations.

A platform specific configuration file has a prefix corresponds to the platform. The following is the list of prefixes and platform specific configuration files are loaded in the listed order after non-platform specific configuration files.

Platform Subplatform Prefix Example
Windows windows- windows-fonts.el
     |  Meadow            | `meadow-`      |  meadow-commands.el

Mac OS X | Carbon Emacs | carbon-emacs-| carbon-emacs-applescript.el | Cocoa Emacs | cocoa-emacs- | cocoa-emacs-plist.el GNU/Linux| | linux- | linux-commands.el All | Non-window system | nw- | nw-key.el

Byte-compilation

If init-loader-byte-compile is non-nil, each configuration file is byte-compiled when it is loaded. If you modify the .el file, then it is recompiled next time it is loaded.

Log

Loaded files and errors during the loading process are recorded. If init-loader-show-log-after-init is non-nil, the record is shown after the overall loading process. You can do this manually by M-x init-loader-show-log.

Reference

Interfaces

init-loader-load (&optional INIT-DIR)

Function to load configuration files in INIT-DIR.

init-loader-show-log ()

Interactive command to show log messages.

Customization

init-loader-directory : directory (default: "~/.emacs.d/inits")

Default directory of configuration files.

init-loader-show-log-after-init : boolean (default: t)

Show log message after initializing if this value is non-nil.

init-loader-byte-compile : boolean (default: nil)

Byte-compile configuration files if this value is non-nil.

Hooks

init-loader-before-compile-hook

Abnormal hook run before byte-compiling a configuration file when init-loader-byte-compile is non-nil. Each function in the hook takes one argument, which is the name of the configuration file to be loaded.

init-loader's People

Contributors

syohex avatar tarao avatar zonuexe avatar

Watchers

Yuri Aisaka avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.