diff --git a/core/core-configuration-layer.el b/core/core-configuration-layer.el index 16eda985f..15a0d34de 100644 --- a/core/core-configuration-layer.el +++ b/core/core-configuration-layer.el @@ -869,8 +869,9 @@ path." layer-name)))) (setq configuration-layer--layers (reverse configuration-layer--layers)) ;; distribution and bootstrap layers are always first - (push (configuration-layer/make-layer dotspacemacs-distribution) - configuration-layer--layers) + (unless (eq 'spacemacs-bootstrap dotspacemacs-distribution) + (push (configuration-layer/make-layer dotspacemacs-distribution) + configuration-layer--layers)) (push (configuration-layer/make-layer 'spacemacs-bootstrap) configuration-layer--layers)) diff --git a/core/core-spacemacs-buffer.el b/core/core-spacemacs-buffer.el index d90e56d14..bfdc03520 100644 --- a/core/core-spacemacs-buffer.el +++ b/core/core-spacemacs-buffer.el @@ -63,7 +63,8 @@ version the release note it displayed") :abbrev-table nil (setq buffer-read-only t truncate-lines t) - (page-break-lines-mode) + (when (fboundp 'page-break-lines-mode) + (page-break-lines-mode)) ;; needed to make tab work correctly in terminal (evil-define-key 'motion spacemacs-buffer-mode-map (kbd "C-i") 'widget-forward) @@ -732,7 +733,8 @@ border." (bookmark-all-names)) (spacemacs//insert--shortcut "b" "Bookmarks:") (insert list-separator))) - ((eq el 'projects) + ((and (eq el 'projects) + (fboundp 'projectile-mode)) (projectile-mode) (when (spacemacs-buffer//insert-file-list "Projects:" diff --git a/init.el b/init.el index 0307dbf09..a06e3bf29 100644 --- a/init.el +++ b/init.el @@ -21,7 +21,7 @@ "Spacemacs requires Emacs version %d or above.") emacs-version spacemacs-emacs-min-version) (load-file (concat user-emacs-directory "core/core-load-paths.el")) - (require 'core-spacemacs) + (require 'core-spacemacs) (spacemacs/init) (spacemacs/maybe-install-dotfile) (configuration-layer/sync) diff --git a/layers/+distribution/spacemacs-base/config.el b/layers/+distribution/spacemacs-base/config.el index f93e0c235..73ec7600a 100644 --- a/layers/+distribution/spacemacs-base/config.el +++ b/layers/+distribution/spacemacs-base/config.el @@ -109,40 +109,6 @@ It runs `tabulated-list-revert-hook', then calls `tabulated-list-print'." (`all (add-hook 'before-save-hook 'whitespace-cleanup)) (`trailing (add-hook 'before-save-hook 'delete-trailing-whitespace))) -;; Thanks to `editorconfig-emacs' for many of these -(defvar spacemacs--indent-variable-alist - '(((awk-mode c-mode c++-mode java-mode groovy-mode - idl-mode java-mode objc-mode pike-mode) . c-basic-offset) - (python-mode . python-indent-offset) - (cmake-mode . cmake-tab-width) - (coffee-mode . coffee-tab-width) - (cperl-mode . cperl-indent-level) - (css-mode . css-indent-offset) - (elixir-mode . elixir-smie-indent-basic) - ((emacs-lisp-mode lisp-mode) . lisp-indent-offset) - (enh-ruby-mode . enh-ruby-indent-level) - (erlang-mode . erlang-indent-level) - ((js-mode json-mode) . js-indent-level) - (js2-mode . js2-basic-offset) - (js3-mode . js3-indent-level) - (latex-mode . (LaTeX-indent-level tex-indent-basic)) - (livescript-mode . livescript-tab-width) - (mustache-mode . mustache-basic-offset) - (nxml-mode . nxml-child-indent) - (perl-mode . perl-indent-level) - (puppet-mode . puppet-indent-level) - (ruby-mode . ruby-indent-level) - (rust-mode . rust-indent-offset) - (scala-mode . scala-indent:step) - (sgml-mode . sgml-basic-offset) - (sh-mode . sh-basic-offset) - (web-mode . web-mode-markup-indent-offset) - (yaml-mode . yaml-indent-offset)) - "An alist where each key is either a symbol corresponding -to a major mode, a list of such symbols, or the symbol t, -acting as default. The values are either integers, symbols -or lists of these.") - ;; --------------------------------------------------------------------------- ;; UI ;; --------------------------------------------------------------------------- diff --git a/layers/+distribution/spacemacs-base/funcs.el b/layers/+distribution/spacemacs-base/funcs.el index 0a5945e78..1751c13d7 100644 --- a/layers/+distribution/spacemacs-base/funcs.el +++ b/layers/+distribution/spacemacs-base/funcs.el @@ -894,25 +894,3 @@ is nonempty." (interactive) (delete-windows-on "*compilation*")) -(defun spacemacs//set-evil-shift-width () - "Set the value of `evil-shift-width' based on the indentation settings of the -current major mode." - (let ((shift-width - (catch 'break - (dolist (test spacemacs--indent-variable-alist) - (let ((mode (car test)) - (val (cdr test))) - (when (or (and (symbolp mode) (derived-mode-p mode)) - (and (listp mode) (apply 'derived-mode-p mode)) - (eq 't mode)) - (when (not (listp val)) - (setq val (list val))) - (dolist (v val) - (cond - ((integerp v) (throw 'break v)) - ((and (symbolp v) (boundp v)) - (throw 'break (symbol-value v)))))))) - (throw 'break (default-value 'evil-shift-width))))) - (when (and (integerp shift-width) - (< 0 shift-width)) - (setq-local evil-shift-width shift-width)))) diff --git a/layers/+distribution/spacemacs-bootstrap/config.el b/layers/+distribution/spacemacs-bootstrap/config.el new file mode 100644 index 000000000..7eced5990 --- /dev/null +++ b/layers/+distribution/spacemacs-bootstrap/config.el @@ -0,0 +1,44 @@ +;;; config.el --- Spacemacs Bootstrap Layer configuration File +;; +;; Copyright (c) 2012-2016 Sylvain Benner & Contributors +;; +;; Author: Sylvain Benner +;; URL: https://github.com/syl20bnr/spacemacs +;; +;; This file is not part of GNU Emacs. +;; +;;; License: GPLv3 + +;; Thanks to `editorconfig-emacs' for many of these +(defvar spacemacs--indent-variable-alist + '(((awk-mode c-mode c++-mode java-mode groovy-mode + idl-mode java-mode objc-mode pike-mode) . c-basic-offset) + (python-mode . python-indent-offset) + (cmake-mode . cmake-tab-width) + (coffee-mode . coffee-tab-width) + (cperl-mode . cperl-indent-level) + (css-mode . css-indent-offset) + (elixir-mode . elixir-smie-indent-basic) + ((emacs-lisp-mode lisp-mode) . lisp-indent-offset) + (enh-ruby-mode . enh-ruby-indent-level) + (erlang-mode . erlang-indent-level) + ((js-mode json-mode) . js-indent-level) + (js2-mode . js2-basic-offset) + (js3-mode . js3-indent-level) + (latex-mode . (LaTeX-indent-level tex-indent-basic)) + (livescript-mode . livescript-tab-width) + (mustache-mode . mustache-basic-offset) + (nxml-mode . nxml-child-indent) + (perl-mode . perl-indent-level) + (puppet-mode . puppet-indent-level) + (ruby-mode . ruby-indent-level) + (rust-mode . rust-indent-offset) + (scala-mode . scala-indent:step) + (sgml-mode . sgml-basic-offset) + (sh-mode . sh-basic-offset) + (web-mode . web-mode-markup-indent-offset) + (yaml-mode . yaml-indent-offset)) + "An alist where each key is either a symbol corresponding +to a major mode, a list of such symbols, or the symbol t, +acting as default. The values are either integers, symbols +or lists of these.") diff --git a/layers/+distribution/spacemacs-bootstrap/funcs.el b/layers/+distribution/spacemacs-bootstrap/funcs.el index faed76b84..0445420fa 100644 --- a/layers/+distribution/spacemacs-bootstrap/funcs.el +++ b/layers/+distribution/spacemacs-bootstrap/funcs.el @@ -50,6 +50,29 @@ (call-interactively binding) (evil-goto-definition)))) +(defun spacemacs//set-evil-shift-width () + "Set the value of `evil-shift-width' based on the indentation settings of the +current major mode." + (let ((shift-width + (catch 'break + (dolist (test spacemacs--indent-variable-alist) + (let ((mode (car test)) + (val (cdr test))) + (when (or (and (symbolp mode) (derived-mode-p mode)) + (and (listp mode) (apply 'derived-mode-p mode)) + (eq 't mode)) + (when (not (listp val)) + (setq val (list val))) + (dolist (v val) + (cond + ((integerp v) (throw 'break v)) + ((and (symbolp v) (boundp v)) + (throw 'break (symbol-value v)))))))) + (throw 'break (default-value 'evil-shift-width))))) + (when (and (integerp shift-width) + (< 0 shift-width)) + (setq-local evil-shift-width shift-width)))) + (defmacro spacemacs|define-text-object (key name start end) (let ((inner-name (make-symbol (concat "evil-inner-" name))) (outer-name (make-symbol (concat "evil-outer-" name)))