commit 63b40497fc82f35883a949eed25646a1d2bafad2 Author: Jonas Bernoulli Date: Tue May 17 18:19:00 2016 +0200 Assimilate borg v0.1.0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4c53c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/var diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3941914 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "borg"] + path = lib/borg + url = git@gitlab.com:tarsius/borg.git diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ce5540d --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +# Copyright (C) 2016 Jonas Bernoulli +# +# Author: Jonas Bernoulli +# License: GPL v3 + +.PHONY: all help build quick bootstrap +.FORCE: + +all: build + +help: + $(info ) + $(info make [all|build] = rebuild all drones) + $(info make quick = rebuild most drones) + $(info make lib/DRONE = rebuild DRONE) + $(info make bootstrap = bootstrap collective) + @printf "\n" + +build: + @rm -f init.elc + @emacs -Q --batch -L lib/borg --load borg \ + --funcall borg-initialize \ + --funcall borg-batch-rebuild + +quick: + @rm -f init.elc + @emacs -Q --batch -L lib/borg --load borg \ + --funcall borg-initialize \ + --eval '(borg-batch-rebuild t)' + +lib/%: .FORCE + @emacs -Q --batch -L lib/borg --load borg \ + --funcall borg-initialize \ + --eval '(borg-build "$(@F)")' + +bootstrap: + git submodule init + git submodule update + git submodule foreach 'git checkout master; git reset --hard $sha1' + make diff --git a/README.md b/README.md new file mode 100644 index 0000000..3e14f85 --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +Assimilate Emacs packages as Git submodules +=========================================== + +*For more information see the [announcement][init] and the [manual].* + +About `borg.el` +--------------- + +[Borg][repo] is a bare-bones package manager for Emacs packages. It +provides only a few essential features and should be combined with +other tools such as Magit, `epkg`, `use-package`, and `auto-compile`. + +Borg assimilates packages into the `~/.emacs.d` repository as Git +submodules. An assimilated package is called a drone and a borg-based +`~/.emacs.d` repository is called a collective. + +About this collective +--------------------- + +This particular collective is intended to be used to bootstrap private +configurations. Fork your own copy and then start assimilating as you +please. + +If you wish you can later merge changes from the upstream repository, +to get updates for the drones that have been assimilated in the base +configuration. Very rarely additional drones might be assimilated or +the configuration of existing drones might be tweaked. + +Or you can just update and further configure these drones as you would +update the drones you have assimilated yourself. + +If you do base your own configuration on this collective and make it +publically available as source of inspiration for others, then please +do so by forking the upstream repository, which is available from +[Github][gh-this], [Gitlab][gl-this], and [Bitbucket][bb-this]. + +You might also want to adjust this description. + +Other collectives +----------------- + +It is also possible to create collectives that can be shared between +and worked on by many Emacs users, i.e. borg-based starter-kits. +Check out alternative collectives by browsing the repositories owned +by the `emacscollective` organisation/group/team, which is available +on [Github][gh-all], [Gitlab][gl-all], and [Bitbucket][bb-all]. + +Another alternative is the `bootstrap` collective. It assimilates a +single drone, `borg` itself, and is intended for users for whom even +the `emacs.g` collective is to opinionated. + +[init]: https://emacsair.me/2016/05/17/assimilate-emacs-packages-as-git-submodules +[repo]: https://gitlab.com/tarsius/borg +[manual]: https://emacsmirror.net/manual/borg + +[gh-this]: https://github.com/emacscollective/emacs.g +[gl-this]: https://gitlab.com/emacscollective/emacs.g +[bb-this]: https://bitbucket.com/emacscollective/emacs.g +[gh-all]: https://github.com/emacscollective +[gl-all]: https://gitlab.com/emacscollective +[bb-all]: https://bitbucket.com/emacscollective diff --git a/init.el b/init.el new file mode 100644 index 0000000..9230558 --- /dev/null +++ b/init.el @@ -0,0 +1,58 @@ +;;; init.el --- user-init-file -*- lexical-binding: t -*- +;;; Early birds +(progn ; startup + (defvar before-user-init-time (current-time) + "Value of `current-time' when Emacs begins loading `user-init-file'.") + (message "Loading Emacs...done (%.3fs)" + (float-time (time-subtract before-user-init-time + before-init-time))) + (setq user-init-file (or load-file-name buffer-file-name)) + (setq user-emacs-directory (file-name-directory user-init-file)) + (message "Loading %s..." user-init-file) + (setq package-enable-at-startup nil) + (setq inhibit-startup-buffer-menu t) + (setq inhibit-startup-screen t) + (setq inhibit-startup-echo-area-message "locutus") + (setq initial-buffer-choice t) + (setq initial-scratch-message "") + (setq load-prefer-newer t)) + +(progn ; `borg' + (add-to-list 'load-path (expand-file-name "lib/borg" user-emacs-directory)) + (require 'borg) + (borg-initialize)) + +(progn ; `custom' + (setq custom-file (expand-file-name "custom.el" user-emacs-directory)) + (when (file-exists-p custom-file) + (load custom-file))) + +(progn ; startup + (message "Loading early birds...done (%.3fs)" + (float-time (time-subtract (current-time) + before-user-init-time)))) + +;;; Long tail + +(progn ; startup + (message "Loading %s...done (%.3fs)" user-init-file + (float-time (time-subtract (current-time) + before-user-init-time))) + (add-hook 'after-init-hook + (lambda () + (message + "Loading %s...done (%.3fs) [after-init]" user-init-file + (float-time (time-subtract (current-time) + before-user-init-time)))) + t)) + +(progn ; personalize + (let ((file (expand-file-name (concat (user-real-login-name) ".el") + user-emacs-directory))) + (when (file-exists-p file) + (load file)))) + +;; Local Variables: +;; indent-tabs-mode: nil +;; End: +;;; init.el ends here diff --git a/lib/borg b/lib/borg new file mode 160000 index 0000000..cc8e39c --- /dev/null +++ b/lib/borg @@ -0,0 +1 @@ +Subproject commit cc8e39ca9ccab32ec0c0b05b4db0aaf9524f07a1