Commit e9e71564 authored by syl20bnr's avatar syl20bnr
Browse files

Merge branch 'develop' (v0.64.0)

parents 064a598b b3a1ca04
......@@ -35,8 +35,6 @@
(spacemacs/message (concat "Warning: GOPATH variable not found, "
"go-oracle configuration skipped."))
(load-gopath-file go-path "/src/code.google.com/p/go.tools/cmd/oracle/oracle.el")
(load-file (concat (file-name-as-directory go-path)
"src/code.google.com/p/go.tools/cmd/oracle/oracle.el"))
(add-hook 'go-mode-hook 'go-oracle-mode)
(spacemacs|diminish go-oracle-mode " O")
(evil-leader/set-key-for-mode 'go-mode
......
......@@ -14,6 +14,7 @@
- [Optional extras](#optional-extras)
- [GHCi-ng support](#ghci-ng-support)
- [structured-haskell-mode](#structured-haskell-mode)
- [hindent](#hindent)
- [Key bindings](#key-bindings)
- [Haskell source code:](#haskell-source-code)
- [Haskell commands:](#haskell-commands)
......@@ -88,19 +89,25 @@ Note that `emacs.app` for OS X does not pick up `$PATH` from `~/.bashrc` or
`~/.zshrc` when launched from outside a terminal.
### Optional extras
The Haskell layer supports some extra features that can be enabled through layer variables.
The Haskell layer supports some extra features that can be enabled through
layer variables.
#### GHCi-ng support
[ghci-ng][] adds some nice features to `haskell-mode`, and is supported in Spacemacs by a layer variable:
[ghci-ng][] adds some nice features to `haskell-mode`, and is supported in
Spacemacs by a layer variable:
Follow the instructions to install [ghci-ng][] (remember to add `:set +c` in `~/.ghci`,
next set the layer variable:
Follow the instructions to install [ghci-ng][] (remember to add `:set +c`
in `~/.ghci`, next set the layer variable:
```elisp
;; List of configuration layers to load.
dotspacemacs-configuration-layers '(company-mode (haskell :variables haskell-enable-ghci-ng-support t) git)
dotspacemacs-configuration-layers
'(company-mode
git
(haskell :variables haskell-enable-ghci-ng-support t))
```
Once ghci-ng is enabled, two of the old keybindings are overriden with improved versions from ghci-ng, and a new keybinding available:
Once ghci-ng is enabled, two of the old keybindings are overriden with improved
versions from ghci-ng, and a new keybinding available:
Key Binding | Description
----------------------|------------------------------------------------------------
......@@ -109,12 +116,41 @@ Once ghci-ng is enabled, two of the old keybindings are overriden with improved
<kbd>SPC m u</kbd> | finds uses of identifier
#### structured-haskell-mode
[structured-haskell-mode][], or shm, replaces hi2 and adds some nice functionality.
To enable shm, run `cabal install structured-haskell-mode` and set the layer variable:
[structured-haskell-mode][], or shm, replaces hi2 (and any other
Haskell-indentation modes) and adds some nice functionality.
To enable shm, run `cabal install structured-haskell-mode` and set the layer
variable:
```elisp
;; List of configuration layers to load.
dotspacemacs-configuration-layers '(company-mode (haskell :variables haskell-enable-shm-support t) git)
```
After shm has been enabled, some of the evil normal-mode bindings are overridden:
Key Binding | Description
----------------------|------------------------------------------------------------
<kbd>D</kbd> | `shm/kill-line`
<kbd>R</kbd> | `shm/raise`
<kbd>P</kbd> | `shm/yank`
<kbd>(</kbd> | `shm/forward-node`
<kbd>)</kbd> | `shm/backward-node`
For a nice visualization of these functions, please refer to the github page
for [structured-haskell-mode][].
#### hindent
[hindent]() is an extensible Haskell pretty printer, which let's you
reformat your code. You need to install the executable with `cabal
install hindent`; to enable it set:
```elisp
;; List of configuration layers to load.
dotspacemacs-configuration-layers
'(company-mode
git
(haskell :variables haskell-enable-hindent-support t))
```
By default it uses the style called `fundamental`, if you want to use
another, `johan-tibell`, run `M-x customize-variable
hindent-style`.
## Key bindings
......@@ -131,6 +167,7 @@ Top-level commands are prefixed by <kbd>SPC m</kbd>:
<kbd>SPC m i</kbd> | gets information for the identifier under the cursor
<kbd>SPC m g g</kbd> | go to definition or tag
<kbd>SPC m f</kbd> | format buffer using haskell-stylish
<kbd>SPC m F</kbd> | format declaration using hindent (if enabled)
#### Documentation commands:
Documentation commands are prefixed by <kbd>SPC m h</kbd>
......@@ -198,3 +235,4 @@ REPL commands are prefixed by <kbd>SPC m s</kbd>:
[hi2]: https://github.com/nilcons/hi2
[ghci-ng]: https://github.com/chrisdone/ghci-ng
[structured-haskell-mode]: https://github.com/chrisdone/structured-haskell-mode
[hindent]: https://github.com/chrisdone/hindent
......@@ -15,3 +15,6 @@
(defvar haskell-enable-shm-support nil
"If non-nil structured-haskell-mode support is enabled")
(defvar haskell-enable-hindent-support nil
"If non-nil structured-haskell-mode support is enabled")
......@@ -18,12 +18,14 @@
ghc
haskell-mode
hi2
hindent
shm
))
(defun haskell/init-flycheck ()
;;(add-hook 'haskell-mode-hook 'flycheck-mode))
(add-hook 'flycheck-mode-hook 'flycheck-haskell-setup))
(add-hook 'haskell-mode-hook 'flycheck-mode)
(add-hook 'flycheck-mode-hook 'flycheck-haskell-setup)
(setq flycheck-display-errors-delay 0))
(defun haskell/init-shm ()
(use-package shm
......@@ -33,9 +35,50 @@
(add-hook 'haskell-mode-hook 'structured-haskell-mode)
:config
(progn
(when (require 'shm-case-split nil 'noerror)
;;TODO: Find some better bindings for case-splits
(define-key shm-map (kbd "C-c S") 'shm/case-split)
(define-key shm-map (kbd "C-c C-s") 'shm/do-case-split))
(evil-define-key 'normal shm-map
(kbd "RET") nil
(kbd "C-k") nil
(kbd "C-j") nil
(kbd "D") 'shm/kill-line
(kbd "R") 'shm/raise
(kbd "P") 'shm/yank
(kbd "RET") 'shm/newline-indent
(kbd "RET") 'shm/newline-indent
(kbd "M-RET") 'evil-ret
)
(evil-define-key 'operator map
(kbd ")") 'shm/forward-node
(kbd "(") 'shm/backward-node
)
)))
(evil-define-key 'motion map
(kbd ")") 'shm/forward-node
(kbd "(") 'shm/backward-node
)
(define-key shm-map (kbd "C-j") nil)
(define-key shm-map (kbd "C-k") nil)
)
)
)
(defun haskell/init-hindent ()
(use-package hindent
:defer t
:if haskell-enable-hindent-support
:init
(add-hook 'haskell-mode-hook #'hindent-mode)
:config
(progn
(setq hindent-style "chris-done")
(evil-leader/set-key-for-mode 'haskell-mode
"mF" 'hindent/reformat-decl))))
(defun haskell/init-haskell-mode ()
(require 'haskell-yas)
......@@ -154,18 +197,7 @@
(if (not haskell-enable-shm-support)
(turn-on-haskell-indentation)
)
;; Indent the below lines on columns after the current column.
;; Might need better bindings for spacemacs and OS X
(define-key haskell-mode-map (kbd "C-<right>")
(lambda ()
(interactive)
(haskell-move-nested 1)))
;; Same as above but backwards.
(define-key haskell-mode-map (kbd "C-<left>")
(lambda ()
(interactive)
(haskell-move-nested -1))))
)
;; Useful to have these keybindings for .cabal files, too.
(defun haskell-cabal-hook ()
......
......@@ -21,6 +21,8 @@
tagedit
web-mode
yasnippet
haml-mode
slim-mode
)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")
......@@ -86,3 +88,11 @@ which require an initialization must be listed explicitly in the list.")
:defer t
:init
(add-hook 'css-mode-hook 'spacemacs/load-yasnippet)))
(defun html/init-haml-mode ()
(use-package haml-mode
:defer t))
(defun html/init-slim-mode ()
(use-package slim-mode
:defer t))
......@@ -70,12 +70,12 @@ Possible values are `rbenv` and `rvm`.
### Rails support
Rails support is available through [projectile-rails][].
To enable it, set the `ruby-on-rails-support` var in your
To enable it, set the `ruby-enable-ruby-on-rails-support` var in your
`~/.spacemacs`:
```elisp
(defun dotspacemacs/init ()
(setq-default ruby-on-rails-support t)
(setq-default ruby-enable-ruby-on-rails-support t)
)
```
......
# What is this
This is an extension to support evil-tmux-navigator. It requires a little
configuration for tmux, so check the upstream documentation.
[evil-tmux-navigator](https://github.com/Keithbsmiley/evil-tmux-navigator)
(defvar tmux-post-extensions '(tmux))
(defun tmux/init-tmux ()
"Initialize tmux"
(use-package tmux))
;;; tmux.el --- Seamlessly navigate between Emacs and tmux
;; Author: Keith Smiley <keithbsmiley@gmail.com>
;; Created: April 25 2014
;; Version: 0.1.5
;; Keywords: tmux, evil, vi, vim
;;; Commentary:
;; This package is inspired by vim-tmux-navigator.
;; It allows you to navigate splits in evil mode
;; Along with tmux splits with the same commands
;; Include with:
;;
;; (require 'navigate)
;;
;;; Code:
(require 'evil)
(defgroup navigate nil
"seamlessly navigate between Emacs and tmux"
:prefix "navigate-"
:group 'evil)
; Without unsetting C-h this is useless
(global-unset-key (kbd "C-h"))
; This requires windmove commands
(when (fboundp 'windmove-default-keybindings)
(windmove-default-keybindings))
(defun tmux-navigate (direction)
(let
((cmd (concat "windmove-" direction)))
(condition-case nil
(funcall (read cmd))
(error
(tmux-command direction)))))
(defun tmux-command (direction)
(shell-command-to-string
(concat "tmux select-pane -"
(tmux-direction direction))))
(defun tmux-direction (direction)
(upcase
(substring direction 0 1)))
(define-key evil-normal-state-map
(kbd "C-h")
(lambda ()
(interactive)
(tmux-navigate "left")))
(define-key evil-normal-state-map
(kbd "C-j")
(lambda ()
(interactive)
(tmux-navigate "down")))
(define-key evil-normal-state-map
(kbd "C-k")
(lambda ()
(interactive)
(tmux-navigate "up")))
(define-key evil-normal-state-map
(kbd "C-l")
(lambda ()
(interactive)
(tmux-navigate "right")))
(provide 'tmux)
;;; tmux.el ends here
......@@ -10,6 +10,7 @@
:init
(add-to-hooks 'vim-empty-lines-mode '(prog-mode-hook
erlang-mode-hook
text-mode-hook))
text-mode-hook
ess-mode-hook))
:config
(spacemacs|hide-lighter vim-empty-lines-mode)))
......@@ -32,7 +32,7 @@ func_tests:
@echo "-----------------------------------------------------------------"
@emacs -batch -l ert \
-l $(EMACS_DIR)core/core-load-paths.el \
-l $(TEST_DIR)core-spacemacs-mode-ftest.el \
-l $(TEST_DIR)core-spacemacs-ftest.el \
-f ert-run-tests-batch-and-exit
......
......@@ -86,8 +86,13 @@ sub-directory of the contribution directory.")
(defvar configuration-layer-excluded-packages '()
"List of all excluded packages declared at the layer level.")
(defvar configuration-layer--loaded-files '()
"List of loaded files.")
(defun configuration-layer/sync ()
"Synchronize declared layers in dotfile with spacemacs."
(dotspacemacs|call-func dotspacemacs/layers "Calling dotfile layers...")
(configuration-layer/init-layers)
(configuration-layer/load-layers)
(when dotspacemacs-delete-orphan-packages
(configuration-layer/delete-orphan-packages)))
(defun configuration-layer/create-layer (name)
"Ask the user for a configuration layer name and create a layer with this
......@@ -118,7 +123,6 @@ NAME."
(format "%s.template" template)))
(dest (concat (configuration-layer//get-private-layer-dir name)
(format "%s.el" template))))
(copy-file src dest)
(find-file dest)
(save-excursion
......@@ -162,27 +166,29 @@ for that layer."
(spacemacs/message "Looking for configuration layers in %s" dir)
(ignore-errors
(let ((files (directory-files dir nil nil 'nosort))
(filter-out (append configuration-layer-contrib-categories '("." "..")))
(filter-out configuration-layer-contrib-categories)
result '())
(dolist (f files)
(when (and (file-directory-p (concat dir f))
(not (member f filter-out)))
(not (member f filter-out))
(not (equalp ?. (aref f 0)))) ;; Remove hidden, traversal
(spacemacs/message "-> Discovered configuration layer: %s" f)
(push (cons (intern f) dir) result)))
result)))
(defun configuration-layer/declare-layers ()
(defun configuration-layer/init-layers ()
"Declare default layers and user layers from the dotfile by filling the
`configuration-layer-layers' variable."
(setq configuration-layer-paths (configuration-layer//discover-layers))
(if (eq 'all dotspacemacs-configuration-layers)
(setq dotspacemacs-configuration-layers
;; spacemacs is contained in configuration-layer-paths
(ht-keys configuration-layer-paths))
(push (configuration-layer//declare-layer 'spacemacs)
configuration-layer-layers))
(mapc (lambda (layer) (push layer configuration-layer-layers))
(configuration-layer//declare-layers
dotspacemacs-configuration-layers)))
(setq configuration-layer-layers
(list (configuration-layer//declare-layer 'spacemacs))))
(setq configuration-layer-layers
(append (configuration-layer//declare-layers
dotspacemacs-configuration-layers) configuration-layer-layers)))
(defun configuration-layer//declare-layers (layers)
"Declare the passed configuration LAYERS.
......@@ -285,7 +291,7 @@ the following keys:
(dir (plist-get (cdr layer) :dir)))
(dolist (file files)
(let ((file (concat dir file)))
(if (file-exists-p file) (configuration-layer/load-file file)))))))
(if (file-exists-p file) (load file)))))))
(defsubst configuration-layer//add-layer-to-hash (pkg layer hash)
"Add LAYER to the list value stored in HASH with key PKG."
......@@ -314,12 +320,6 @@ the following keys:
"Return a sorted list of the keys in the given hash table H."
(mapcar 'intern (sort (mapcar 'symbol-name (ht-keys h)) 'string<)))
(defun configuration-layer/load-file (file)
"Assure that FILE is loaded only once."
(unless (member file configuration-layer--loaded-files)
(load file)
(push file configuration-layer--loaded-files)))
(defun configuration-layer/get-excluded-packages (layers)
"Read `layer-excluded-packages' lists for all passed LAYERS and return a list
of all excluded packages."
......@@ -329,7 +329,7 @@ of all excluded packages."
(dir (plist-get (cdr layer) :dir))
(pkg-file (concat dir "packages.el")))
(when (file-exists-p pkg-file)
(configuration-layer/load-file pkg-file)
(load pkg-file)
(let ((excl-var (intern (format "%s-excluded-packages"
(symbol-name layer-sym)))))
(when (boundp excl-var)
......@@ -348,7 +348,7 @@ VAR is a string with value `packages', `pre-extensions' or `post-extensions'."
(dir (plist-get (cdr layer) :dir))
(pkg-file (concat dir (format "%s.el" file))))
(when (file-exists-p pkg-file)
(configuration-layer/load-file pkg-file)
(load pkg-file)
(let* ((layer-name (symbol-name layer-sym))
(packages-var (intern (format "%s-%s" layer-name var))))
(when (boundp packages-var)
......@@ -777,24 +777,4 @@ deleted safely."
(spacemacs/append-to-buffer "\n"))
(spacemacs/message "No orphan package to delete."))))
(defun configuration-layer/setup-after-init-hook ()
"Add post init processing."
(add-hook
'after-init-hook
(lambda ()
;; Ultimate configuration decisions are given to the user who can defined
;; them in his/her ~/.spacemacs file
(dotspacemacs|call-func dotspacemacs/config "Executing user config...")
(when dotspacemacs-loading-progress-bar
(spacemacs/append-to-buffer (format "%s\n" spacemacs-loading-done-text)))
;; from jwiegley
;; https://github.com/jwiegley/dot-emacs/blob/master/init.el
(let ((elapsed (float-time
(time-subtract (current-time) emacs-start-time))))
(spacemacs/append-to-buffer
(format "[%s packages loaded in %.3fs]\n"
(configuration-layer//initialized-packages-count)
elapsed)))
(spacemacs/check-for-new-version spacemacs-version-check-interval))))
(provide 'core-configuration-layer)
......@@ -67,9 +67,6 @@ with `:' and Emacs commands are executed with `<leader> :'.")
may increase the boot time on some systems and emacs builds, set it to nil
to boost the loading time.")
(defvar dotspacemacs-helm-micro-state t
"Enable micro-state for helm buffer when pressing on TAB.")
(defvar dotspacemacs-fullscreen-at-startup nil
"If non nil the frame is fullscreen when Emacs starts up (Emacs 24.4+ only).")
......@@ -118,6 +115,37 @@ NOT USED FOR NOW :-)")
(defvar dotspacemacs-excluded-packages '()
"A list of packages and/or extensions that will not be install and loaded.")
(defvar dotspacemacs-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-c C-c") 'dotspacemacs/sync-configuration-layers)
map)
"Keymap for dostpacemacs-mode.")
(define-derived-mode dotspacemacs-mode emacs-lisp-mode "dotspacemacs"
"dotspacemacs major mode for Spacemacs dotfile.
\\{dotspacemacs-mode-map}"
:group 'spacemacs
(evil-leader/set-key-for-mode 'dotspacemacs-mode
"mcc" 'dotspacemacs/sync-configuration-layers)
(run-at-time
"2 sec" nil
(lambda () (message "SPC m c c (or C-c C-c) to apply your changes."))))
(defun dotspacemacs/sync-configuration-layers (arg)
"Synchronize declared layers in dotfile with spacemacs.
If ARG is non nil then `dotspacemacs/config' is skipped."
(interactive "P")
(let ((dotspacemacs-loading-progress-bar nil))
(load-file buffer-file-name)
(dotspacemacs|call-func dotspacemacs/init "Calling dotfile init...")
(configuration-layer/sync)
(if arg
(message "Done (`dotspacemacs/config' function has been skipped).")
(dotspacemacs|call-func dotspacemacs/config "Calling dotfile config...")
(message "Done."))))
(defun dotspacemacs/location ()
"Return the absolute path to the spacemacs dotfile."
(concat user-home-directory ".spacemacs"))
......@@ -127,16 +155,17 @@ NOT USED FOR NOW :-)")
before installing the file if the destination already exists."
(interactive)
(let* ((dotfile "~/.spacemacs")
(install (if (file-exists-p dotfile)
(y-or-n-p (format "%s already exists. Do you want to overwite it ? "
dotfile))
t)))
(install
(if (file-exists-p dotfile)
(y-or-n-p
(format "%s already exists. Do you want to overwite it ? "
dotfile)) t)))
(when install
(copy-file (concat dotspacemacs-template-directory
".spacemacs.template") dotfile t)
(message "%s has been installed." dotfile))))
(defun dotspacemacs/load ()
(defun dotspacemacs/load-file ()
"Load ~/.spacemacs if it exists."
(let ((dotspacemacs (dotspacemacs/location)))
(if (file-exists-p dotspacemacs) (load dotspacemacs))))
......
......@@ -78,6 +78,7 @@ used."
(let* ((func (spacemacs//micro-state-func-name name))
(doc (spacemacs/mplist-get props :doc))
(persistent (plist-get props :persistent))
(exec-binding (plist-get props :execute-binding-on-enter))
(on-enter (spacemacs/mplist-get props :on-enter))
(on-exit (spacemacs/mplist-get props :on-exit))
(bindings (spacemacs/mplist-get props :bindings))
......@@ -91,6 +92,8 @@ used."
(when doc
(lv-message (spacemacs//micro-state-propertize-doc
(format "%S: %s" ',name doc)))))
,(when exec-binding
(spacemacs//micro-state-auto-execute bindings))
,@on-enter
(,(if (version< emacs-version "24.4")
'set-temporary-overlay-map
......@@ -104,6 +107,14 @@ used."
"Return the name of the micro-state function."
(intern (format "spacemacs/%S-micro-state" name)))
(defun spacemacs//micro-state-auto-execute (bindings)
"Auto execute the binding corresponding to `this-command-keys'."
`(let* ((key (substring (this-command-keys)
(1- (length (this-command-keys)))))
(binding (assoc key ',bindings)))
(when binding
(call-interactively (cadr binding)))))
(defun spacemacs//micro-state-create-wrappers (name doc bindings)
"Return an alist (key wrapper) for each binding in BINDINGS."
(mapcar (lambda (x) (spacemacs//micro-state-create-wrapper name doc x))
......
......@@ -108,21 +108,30 @@ of size LOADING-DOTS-CHUNK-THRESHOLD."
(insert " ")
(insert-button "[Homepage]" 'action
(lambda (b) (browse-url "https://github.com/syl20bnr/spacemacs"))
'follow-link t)
'follow-link t 'help-echo "Open the Spacemacs Github page in your browser.")
(insert " ")
(insert-button "[Documentation]" 'action
(lambda (b) (browse-url "https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.md"))
'follow-link t)
'follow-link t 'help-echo "Open the Spacemacs documentation in your browser.")
(insert " ")
(insert-button "[Gitter Chat]" 'action
(lambda (b) (browse-url "https://gitter.im/syl20bnr/spacemacs"))
'follow-link t)
'follow-link t 'help-echo "Ask questions and chat with fellow users in our chat room.")
(insert " ")
(insert-button "[Update]" 'action
(lambda (b) (configuration-layer/update-packages)) 'follow-link t)
(lambda (b) (configuration-layer/update-packages))
'follow-link t 'help-echo "Update all ELPA packages to the latest versions.")
(insert " ")
(insert-button "[Rollback]" 'action
(lambda (b) (call-interactively 'configuration-layer/rollback)) 'follow-link t)
(lambda (b) (call-interactively 'configuration-layer/rollback))
'follow-link t 'help-echo "Rollback ELPA package upgrades if something got borked.")
(insert "\n")
(let ((button-title "[Search Spacemacs]"))
; Compute the correct number of spaces to center the button.
(dotimes (i (/ (- spacemacs-title-length (string-width button-title)) 2)) (insert " "))
(insert-button button-title 'action
(lambda (b) (call-interactively 'helm-spacemacs)) 'follow-link t
'help-echo "Find Spacemacs package and layer configs using helm-spacemacs."))
(insert "\n\n")
)
......
;;; core-spacemacs-mode.el --- Spacemacs Core File
;;; core-spacemacs.el --- Spacemacs Core File
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
......@@ -17,6 +17,8 @@
(require 'core-themes-support)
(require 'core-fonts-support)
(require 'core-spacemacs-buffer)
(require 'core-toggle)
(require 'core-micro-state)
(defconst spacemacs-repository "spacemacs"
"Name of the Spacemacs remote repository.")
......@@ -59,19 +61,20 @@
(define-derived-mode spacemacs-mode special-mode "Spacemacs"
"Spacemacs major mode for startup screen."
:group 'spacemacs
:syntax-table nil
:abbrev-table nil
(setq truncate-lines t)
(setq cursor-type nil)
;; motion state since this is a special mode
(add-to-list 'evil-motion-state-modes 'spacemacs-mode))
(defun spacemacs/initialize ()
(defun spacemacs/init ()
"Create the special buffer for `spacemacs-mode' and perform startup
initialization."
(require 'core-toggle)
(require 'core-micro-state)
(dotspacemacs/load)
;; dotfile init
(dotspacemacs/load-file)
(dotspacemacs|call-func dotspacemacs/init "Calling dotfile init...")
;; spacemacs init
(switch-to-buffer (get-buffer-create spacemacs-buffer-name))
;; no welcome buffer
(setq inhibit-startup-screen t)
......@@ -195,20 +198,22 @@ found."
(message "Start checking for new version...")
(async-start
(lambda ()
(add-to-list 'load-path (concat user-emacs-directory "core/"))
(require 'core-spacemacs-mode)
(load-file (concat user-emacs-directory "core/core-load-paths.el"))
(require 'core-spacemacs)
(spacemacs/get-last-version spacemacs-repository
spacemacs-repository-owner
spacemacs-checkversion-remote
spacemacs-checkversion-branch))
(lambda (result)
(when result
(unless (or (version< result spacemacs-version)
(string= result spacemacs-version)
(if spacemacs-new-version
(string= result spacemacs-new-version)))
(message "New version of Spacemacs available: %s" result)
(setq spacemacs-new-version result)))))
(if result
(if (or (version< result spacemacs-version)
(string= result spacemacs-version)
(if spacemacs-new-version
(string= result spacemacs-new-version)))
(message "Spacemacs is up to date.")
(message "New version of Spacemacs available: %s" result)
(setq spacemacs-new-version result))
(message "Unable to check for new version."))))
(when interval
(setq spacemacs-version-check-timer
(run-at-time t (timer-duration interval)
......@@ -313,4 +318,24 @@ version and the NEW version."
((< diff 5000) 'spacemacs-mode-line-new-version-lighter-warning-face)
(t 'spacemacs-mode-line-new-version-lighter-error-face))))
(provide 'core-spacemacs-mode)
(defun spacemacs/setup-after-init-hook ()
"Add post init processing."
(add-hook
'after-init-hook
(lambda ()
;; Ultimate configuration decisions are given to the user who can defined
;; them in his/her ~/.spacemacs file
(dotspacemacs|call-func dotspacemacs/config "Calling dotfile config...")
(when dotspacemacs-loading-progress-bar
(spacemacs/append-to-buffer (format "%s\n" spacemacs-loading-done-text)))
;; from jwiegley
;; https://github.com/jwiegley/dot-emacs/blob/master/init.el
(let ((elapsed (float-time
(time-subtract (current-time) emacs-start-time))))
(spacemacs/append-to-buffer
(format "[%s packages loaded in %.3fs]\n"
(configuration-layer//initialized-packages-count)
elapsed)))
(spacemacs/check-for-new-version spacemacs-version-check-interval))))
(provide 'core-spacemacs)
;; -*- mode: emacs-lisp -*-
;; -*- mode: dotspacemacs -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
;; Configuration Layers
;; --------------------
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (ie. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
;; List of configuration layers to load. If it is the symbol `all' instead
;; of a list then all discovered layers will be installed.
dotspacemacs-configuration-layers '()
;; A list of packages and/or extensions that will not be install and loaded.
dotspacemacs-excluded-packages '()
;; If non-nil spacemacs will delete any orphan packages, i.e. packages that
;; are declared in a layer which is not a member of
;; the list `dotspacemacs-configuration-layers'
dotspacemacs-delete-orphan-packages t
)
;; Settings
;; --------
(setq-default
;; Specify the startup banner. If the value is an integer then the
;; banner with the corresponding index is used, if the value is `random'
;; then the banner is chosen randomly among the available banners, if
;; the value is nil then no banner is displayed.
dotspacemacs-startup-banner 'random
;; List of themes, the first of the list is loaded when spacemacs starts.
;; Press <SPC> T n to cycle to the next theme in the list (works great
;; with 2 themes variants, one dark and one light)
dotspacemacs-themes '(solarized-light
solarized-dark
leuven
monokai
zenburn)
;; If non nil the cursor color matches the state color.
dotspacemacs-colorize-cursor-according-to-state t
;; Default font. `powerline-scale' allows to quickly tweak the mode-line
;; size to make separators look not too crappy.
dotspacemacs-default-font '("Source Code Pro"
:size 13
:weight normal
:width normal
:powerline-scale 1.1)
;; The leader key
dotspacemacs-leader-key "SPC"
;; Major mode leader key is a shortcut key which is the equivalent of
;; pressing `<leader> m`
dotspacemacs-major-mode-leader-key ","
;; The command key used for Evil commands (ex-commands) and
;; Emacs commands (M-x).
;; By default the command key is `:' so ex-commands are executed like in Vim
;; with `:' and Emacs commands are executed with `<leader> :'.
dotspacemacs-command-key ":"
;; Guide-key delay in seconds. The Guide-key is the popup buffer listing
;; the commands bound to the current keystrokes.
dotspacemacs-guide-key-delay 0.4
;; If non nil a progress bar is displayed when spacemacs is loading. This
;; may increase the boot time on some systems and emacs builds, set it to nil
;; to boost the loading time.
dotspacemacs-loading-progress-bar t
;; Enable micro-state for helm buffer when pressing on TAB."
dotspacemacs-helm-micro-state t
;; If non nil the frame is fullscreen when Emacs starts up (Emacs 24.4+ only).
dotspacemacs-fullscreen-at-startup nil
;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
;; Use to disable fullscreen animations in OSX."
dotspacemacs-fullscreen-use-non-native nil
;; If non nil the frame is maximized when Emacs starts up (Emacs 24.4+ only).
;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
dotspacemacs-maximized-at-startup nil
;; A value from the range (0..100), in increasing opacity, which describes the
;; transparency level of a frame when it's active or selected. Transparency can
;; be toggled through `toggle-transparency'.
dotspacemacs-active-transparency 90
;; A value from the range (0..100), in increasing opacity, which describes the
;; transparency level of a frame when it's inactive or deselected. Transparency
;; can be toggled through `toggle-transparency'.
dotspacemacs-inactive-transparency 90
;; If non nil unicode symbols are displayed in the mode line (e.g. for lighters)
dotspacemacs-mode-line-unicode-symbols t
;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth scrolling
;; overrides the default behavior of Emacs which recenters the point when
;; it reaches the top or bottom of the screen
dotspacemacs-smooth-scrolling t
;; If non-nil smartparens-strict-mode will be enabled in programming modes.
dotspacemacs-smartparens-strict-mode nil
;; If non nil advises quit functions to keep server open when quitting.
dotspacemacs-persistent-server nil
;; The default package repository used if no explicit repository has been
;; specified with an installed package.
;; Not used for now.
dotspacemacs-default-package-repository nil
)
;; Initialization Hooks
;; --------------------
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (ie. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
;; List of configuration layers to load. If it is the symbol `all' instead
;; of a list then all discovered layers will be installed.
dotspacemacs-configuration-layers '()
;; A list of packages and/or extensions that will not be install and loaded.
dotspacemacs-excluded-packages '()
;; If non-nil spacemacs will delete any orphan packages, i.e. packages that
;; are declared in a layer which is not a member of
;; the list `dotspacemacs-configuration-layers'
dotspacemacs-delete-orphan-packages t))
(defun dotspacemacs/init ()
"User initialization for Spacemacs. This function is called at the very
startup."
"Initialization function.
This function is called at the very startup of Spacemacs initialization
before layers configuration."
;; This setq-default sexp is an exhaustive list of all the supported
;; spacemacs settings.
(setq-default
;; Specify the startup banner. If the value is an integer then the
;; banner with the corresponding index is used, if the value is `random'
;; then the banner is chosen randomly among the available banners, if
;; the value is nil then no banner is displayed.
dotspacemacs-startup-banner 'random
;; List of themes, the first of the list is loaded when spacemacs starts.
;; Press <SPC> T n to cycle to the next theme in the list (works great
;; with 2 themes variants, one dark and one light)
dotspacemacs-themes '(solarized-light
solarized-dark
leuven
monokai
zenburn)
;; If non nil the cursor color matches the state color.
dotspacemacs-colorize-cursor-according-to-state t
;; Default font. `powerline-scale' allows to quickly tweak the mode-line
;; size to make separators look not too crappy.
dotspacemacs-default-font '("Source Code Pro"
:size 13
:weight normal
:width normal
:powerline-scale 1.1)
;; The leader key
dotspacemacs-leader-key "SPC"
;; Major mode leader key is a shortcut key which is the equivalent of
;; pressing `<leader> m`
dotspacemacs-major-mode-leader-key ","
;; The command key used for Evil commands (ex-commands) and
;; Emacs commands (M-x).
;; By default the command key is `:' so ex-commands are executed like in Vim
;; with `:' and Emacs commands are executed with `<leader> :'.
dotspacemacs-command-key ":"
;; Guide-key delay in seconds. The Guide-key is the popup buffer listing
;; the commands bound to the current keystrokes.
dotspacemacs-guide-key-delay 0.4
;; If non nil a progress bar is displayed when spacemacs is loading. This
;; may increase the boot time on some systems and emacs builds, set it to
;; nil ;; to boost the loading time.
dotspacemacs-loading-progress-bar t
;; If non nil the frame is fullscreen when Emacs starts up.
;; (Emacs 24.4+ only)
dotspacemacs-fullscreen-at-startup nil
;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
;; Use to disable fullscreen animations in OSX."
dotspacemacs-fullscreen-use-non-native nil
;; If non nil the frame is maximized when Emacs starts up.
;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
;; (Emacs 24.4+ only)
dotspacemacs-maximized-at-startup nil
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's active or selected.
;; Transparency can be toggled through `toggle-transparency'.
dotspacemacs-active-transparency 90
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's inactive or deselected.
;; Transparency can be toggled through `toggle-transparency'.
dotspacemacs-inactive-transparency 90
;; If non nil unicode symbols are displayed in the mode line.
dotspacemacs-mode-line-unicode-symbols t
;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth
;; scrolling overrides the default behavior of Emacs which recenters the
;; point when it reaches the top or bottom of the screen.
dotspacemacs-smooth-scrolling t
;; If non-nil smartparens-strict-mode will be enabled in programming modes.
dotspacemacs-smartparens-strict-mode nil
;; If non nil advises quit functions to keep server open when quitting.
dotspacemacs-persistent-server nil
;; The default package repository used if no explicit repository has been
;; specified with an installed package.
;; Not used for now.
dotspacemacs-default-package-repository nil)
;; User initialization goes here
)
(defun dotspacemacs/config ()
"This is were you can ultimately override default Spacemacs configuration.
This function is called at the very end of Spacemacs initialization."
"Configuration function.
This function is called at the very end of Spacemacs initialization after
layers configuration."
)
;; Custom variables
;; ----------------
;; Do not write anything in this section. This is where Emacs will
;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.
......@@ -10,8 +10,8 @@
;;
;;; License: GPLv3
(require 'mocker)
(require 'core-spacemacs-mode)
(require 'core-spacemacs)
(ert-deftest assertion-library-should-work ()
"the assertion library should works"
(mocker-let ((foo (n)
......@@ -20,11 +20,11 @@
((:input '(2 2) :output 2))))
(should (equal (foo 1) 1))
(should (equal (bar 2 2) 2))))
(ert-deftest git-has-remote ()
(should (equal (spacemacs/git-has-remote "clearly-not-a-R3M0T3!") nil))
(should (numberp (spacemacs/git-has-remote "origin"))))
(ert-deftest git-fetch-tags ()
(mocker-let ((process-file (git infile buffer display action &rest args)
:ordered nil
......
......@@ -31,6 +31,7 @@
- [Using a personal branch](#using-a-personal-branch)
- [Dotfile Configuration](#dotfile-configuration)
- [Installation](#installation)
- [Synchronization of doftile changes](#synchronization-of-doftile-changes)
- [Content](#content)
- [Using configuration layers](#using-configuration-layers)
- [Setting configuration layers variables](#setting-configuration-layers-variables)
......@@ -399,7 +400,7 @@ you can find it [here][themes-megapack].
To install it, just add `themes-megapack` to your `~/.spacemacs` like so:
```elisp
dotspacemacs-configuration-layers '(themes-megapack)
(setq-default dotspacemacs-configuration-layers '(themes-megapack))
```
You have now installed around 100 themes you are free to try with <kbd>SPC T h</kbd>
......@@ -449,6 +450,20 @@ manually from the template file `~/.emacs.d/core/templates/.spacemacs.template`
$ cp ~/.emacs.d/core/templates/.spacemacs.template ~/.spacemacs
```
## Synchronization of doftile changes
To apply the modifications made in `~/.spacemacs` press <kbd>SPC m c c</kbd>.
It will re-execute the `Spacemacs` initialization process.
**Note:** A synchronization re-execute the functions `dotspacemacs/init` and
`dotspacemacs/config`. Depending on the content of this functions you may
encounter some unwanted side effects. For instance if you use a toggle in
`dotspacemac/config` to enable some behavior, this behavior will be turned off
whenever the dotfile is re-synchronize. To avoid these side-effects it is
recommended to use `setq` expressions instead of toggle functions.
It is also possible to _skip_ the execution of `dotspacemacs/config` with the
universal argument (<kbd>SPC u SPC m c c</kbd>).
## Content
### Using configuration layers
......@@ -1295,6 +1310,7 @@ Key Binding | Description
------------------------------------------|----------------------------------------------------------------
<kbd>SPC f D</kbd> | delete a file and the associated buffer (ask for confirmation)
<kbd>SPC f f</kbd> | open a file using `ido`
<kbd>SPC f F</kbd> | open a file under point using `helm`
<kbd>SPC f j</kbd> | jump to the current buffer file in dired
<kbd>SPC f o</kbd> | open a file using the default external program
<kbd>SPC f s</kbd> | save a file
......@@ -1371,9 +1387,8 @@ Key Binding | Description
`Spacemacs` provides a quick and simple way to navigate in an unknown project
file tree with [NeoTree][neotree].
To toggle the `NeoTree` buffer press:
<SPC> f t
To toggle the `NeoTree` buffer press <kbd>SPC f t</kbd> or <kbd>SPC p t</kbd>
(the latter open NeoTree with the root set to the projectile project root).
The NeoTree window always has the number `0` so it does not shift the current
number of the other windows. To select the NeoTree window you then use
......@@ -2016,9 +2031,12 @@ To search in a project see [project searching](#project-searching).
Key Binding | Description
--------------------|------------------------------------------------------------
<kbd>SPC p /</kbd> | run `ag`
<kbd>SPC p !</kbd> | run shell command in root
<kbd>SPC p &</kbd> | run async shell command in root
<kbd>SPC p a</kbd> | run `ag`
<kbd>SPC p A</kbd> | run `ack`
<kbd>SPC p b</kbd> | switch to project buffer
<kbd>SPC p c</kbd> | compile project using `projectile`
<kbd>SPC p d</kbd> | find directory
<kbd>SPC p D</kbd> | open project root in `dired`
<kbd>SPC p f</kbd> | find file
......@@ -2031,9 +2049,10 @@ To search in a project see [project searching](#project-searching).
<kbd>SPC p R</kbd> | regenerate the project's [e|g]tags
<kbd>SPC p r</kbd> | replace a string
<kbd>SPC p s</kbd> | switch project
<kbd>SPC p t</kbd> | find tags
<kbd>SPC p t</kbd> | open `NeoTree` in `projectile` root
<kbd>SPC p T</kbd> | find test files
<kbd>SPC p v</kbd> | open project root in `vc-dir` or `magit`
<kbd>SPC p y</kbd> | find tags
## Registers
......@@ -2246,6 +2265,7 @@ Achievements | Account
[400th issue (PR)][400th-issue] | [CestDiego][]
[500th issue (PR)][500th-issue] | [bjarkevad][]
[600th issue (PR)][600th-issue] | [bjarkevad][]
[700th issue (enhancement)][700th-issue] | [jcpetkovich][]
[100th pull request][100th-PR] | [bru][]
[200th pull request][200th-PR] | [smt][]
[300th pull request][300th-PR] | [BrianHicks][]
......@@ -2356,6 +2376,7 @@ developers to elisp hackers!
[400th-issue]: https://github.com/syl20bnr/spacemacs/pull/400
[500th-issue]: https://github.com/syl20bnr/spacemacs/pull/500
[600th-issue]: https://github.com/syl20bnr/spacemacs/pull/600
[700th-issue]: https://github.com/syl20bnr/spacemacs/pull/700
[100th-PR]: https://github.com/syl20bnr/spacemacs/pull/228
[200th-PR]: https://github.com/syl20bnr/spacemacs/pull/418
[300th-PR]: https://github.com/syl20bnr/spacemacs/pull/617
......@@ -2364,6 +2385,8 @@ developers to elisp hackers!
[danielwuz]:https://github.com/danielwuz
[CestDiego]:https://github.com/CestDiego
[bjarkevad]:https://github.com/bjarkevad
[jcpetkovich]:https://github.com/jcpetkovich
[BrianHicks]:https://github.com/BrianHicks
[chrisbarrett]:https://github.com/chrisbarrett
[justrajdeep]:https://github.com/justrajdeep
[dbohdan]:https://github.com/dbohdan
......
......@@ -9,7 +9,7 @@
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defconst spacemacs-version "0.63.0" "Spacemacs version.")
(defconst spacemacs-version "0.64.0" "Spacemacs version.")
(defconst spacemacs-emacs-min-version "24.3" "Minimal version of Emacs.")
(defun spacemacs/emacs-version-ok ()
......@@ -17,16 +17,10 @@
(when (spacemacs/emacs-version-ok)
(load-file (concat user-emacs-directory "core/core-load-paths.el"))
(require 'core-spacemacs-mode)
(require 'core-spacemacs)
(require 'core-configuration-layer)
(spacemacs/initialize)
;; synchronize and load configuration layers
(configuration-layer/declare-layers)
(configuration-layer/load-layers)
(when dotspacemacs-delete-orphan-packages
(configuration-layer/delete-orphan-packages))
(configuration-layer/setup-after-init-hook)
;; start a server for subsequent emacs clients
(spacemacs/init)
(configuration-layer/sync)
(spacemacs/setup-after-init-hook)
(require 'server)
(unless (server-running-p)
(server-start)))
(unless (server-running-p) (server-start)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment