diff --git a/emacs b/emacs deleted file mode 100644 index 6df1d0c..0000000 --- a/emacs +++ /dev/null @@ -1,107 +0,0 @@ -;; -*- mode: lisp; -*- -(prefer-coding-system 'utf-8) -(menu-bar-mode 0) -(setq inhibit-startup-message t) -(setq initial-scratch-message "") -(setq vc-follow-symlinks t) - -(add-to-list 'load-path "~/.emacs.d/manual") -(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") - ("marmalade" . "https://marmalade-repo.org/packages/") - ("melpa" . "http://melpa.milkbox.net/packages/") - ("elpy" . "http://jorgenschaefer.github.io/packages/"))) -(package-initialize) -(osx-clipboard-mode +1) -(xterm-mouse-mode) - -(load-theme 'monokai t) -(require 'powerline) -(powerline-default-theme) - -(setq backup-inhibited t) -(setq auto-save-default nil) -(setq require-final-newline t) -(setq mode-require-final-newline t) -(define-key global-map (kbd "RET") 'newline-and-indent) -(add-hook 'before-save-hook 'delete-trailing-whitespace) -(setq-default indent-tabs-mode nil) - -(global-hl-line-mode 1) -(set-face-background hl-line-face "#333") -(global-linum-mode 1) -(setq linum-format "%4d |") -(set-face-attribute 'linum nil :background "#000" :foreground "#FFF") -(global-git-gutter-mode 1) - -(setq mouse-wheel-mode 0) -(setq mouse-wheel-up-event 0) -(setq mouse-wheel-down-event 0) -(require 'centered-cursor-mode) -(global-centered-cursor-mode +1) - -(define-globalized-minor-mode global-fci-mode fci-mode (lambda () (fci-mode 1))) -(global-fci-mode 1) -(setq fci-rule-column 100) -(setq fci-rule-width 1) -(setq fci-rule-color "yellow") - -(display-time-mode 1) -(display-battery-mode 1) - -(helm-mode 1) -(global-set-key (kbd "M-x") 'helm-M-x) -(global-set-key (kbd "C-x C-f") 'helm-find-files) -(projectile-global-mode 1) -(global-set-key (kbd "C-c p s a") 'helm-projectile-ack) -(global-subword-mode 1) - -(add-hook 'flymake-find-file-hook (lambda() - (flymake-cursor-mode))) -(add-hook 'markdown-mode-hook (lambda() - (require 'poly-markdown) - (poly-markdown-mode 1) - (flyspell-mode 1) - ;(setq fill-column 80) - ;(auto-fill-mode) - (setq fci-rule-column 80))) -(add-hook 'python-mode-hook (lambda() - (elpy-mode) - (elpy-enable) - (setq python-indent 4) - (setq elpy-rpc-backend "jedi") - (highlight-indentation-mode 0))) -(add-hook 'go-mode-hook (lambda() - (auto-complete-mode) - (require 'go-autocomplete) - (require 'auto-complete-config) - (ac-config-default) - (load-file "/Users/brettlangdon/go/src/golang.org/x/tools/cmd/oracle/oracle.el") - (load-file "~/go/src/github.com/golang/lint/misc/emacs/golint.el") - (require 'golint) - (setq gofmt-command "goimports") - (local-set-key (kbd "M-.") 'godef-jump) - (add-hook 'before-save-hook 'gofmt-before-save))) -(add-hook 'js-mode-hook (lambda() - (setq-default js-indent-level 2) - (setq-default js2-basic-offset 2) - (setq-default js2-tab-width 2) - (js2-minor-mode) - (auto-complete-mode) - (tern-mode t) - (require 'tern-auto-complete) - (tern-ac-setup) - (require 'flycheck) - (setq-default flycheck-disabled-checkers '(javascript-jscs javascript-jshint)) - (flycheck-mode t))) -(add-hook 'json-mode-hook (lambda() - (setq js-indent-level 2))) -(add-hook 'ruby-mode-hook (lambda() - (flyspell-prog-mode))) -(add-hook `css-mode-hook (lambda() - (set1 css-indent-offset 2))) - -(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) -(add-to-list 'auto-mode-alist '("\\.styl\\'" . css-mode)) -(add-to-list 'auto-mode-alist '("\\.scss\\'" . sass-mode)) -(add-to-list 'auto-mode-alist '("\\.pug\\'" . jade-mode)) -(add-to-list 'magic-mode-alist '("#!.*node" . js-mode)) diff --git a/emacs.d/.github/ISSUE_TEMPLATE b/emacs.d/.github/ISSUE_TEMPLATE new file mode 100644 index 0000000..fdb7479 --- /dev/null +++ b/emacs.d/.github/ISSUE_TEMPLATE @@ -0,0 +1,4 @@ +If you are posting about a *bug* please close this issue and open a new one +using [SPC h I] or [M-m h I] (I = capital i) from within Spacemacs. If the +bug makes Spacemacs unusable, you can find the bug report template [here](https://github.com/syl20bnr/spacemacs/blob/develop/core/templates/REPORTING.template) +You can delete this message to start typing. diff --git a/emacs.d/.github/PULL_REQUEST_TEMPLATE b/emacs.d/.github/PULL_REQUEST_TEMPLATE new file mode 100644 index 0000000..96c72a7 --- /dev/null +++ b/emacs.d/.github/PULL_REQUEST_TEMPLATE @@ -0,0 +1,7 @@ +Thank you for contributing to Spacemacs! + +Before you submit this pull request, please ensure it is against the develop branch and not master. + +This message should be replaced with a description of your change. + +Thank you <3 \ No newline at end of file diff --git a/emacs.d/.gitignore b/emacs.d/.gitignore new file mode 100644 index 0000000..22e8323 --- /dev/null +++ b/emacs.d/.gitignore @@ -0,0 +1,53 @@ +auto-save-list/ +elpa/ +export/ +ac-comphist.dat +eproject.lst +.smex-items +\#* +.places +.cache +/eww-bookmarks +eshell/history +.emacs.desktop +.emacs.desktop.lock +eshell/alias +eshell/lastdir +/url/cookies +my-org/ +org-files/ +semanticdb/ +edts/ +.recentf +.recentf~ +projectile.cache +projectile-bookmarks.eld +tramp +elnode/ +var/ +crown/ +*.stackdump +bookmarks +/.my-keybindings.el.swp +.DS_Store +tmp/ +/history +.python-environments/ +server/ +/network-security.data +*.elc +*.pyc +/*.zip +*.db +python-*-docs-html +/.cask/ +/session.* +/srecode-map.el +/recentf + +# Private directory +private/ +!private/README.md +!private/snippets/README.md +!private/local/README.md +/games/ diff --git a/emacs.d/.mc-lists.el b/emacs.d/.mc-lists.el deleted file mode 100644 index de293da..0000000 --- a/emacs.d/.mc-lists.el +++ /dev/null @@ -1,12 +0,0 @@ -;; This file is automatically generated by the multiple-cursors extension. -;; It keeps track of your preferences for running commands with multiple cursors. - -(setq mc/cmds-to-run-for-all - '( - helm-M-x - )) - -(setq mc/cmds-to-run-once - '( - end-of-buffer - )) diff --git a/emacs.d/.projectile b/emacs.d/.projectile new file mode 100644 index 0000000..1974e79 --- /dev/null +++ b/emacs.d/.projectile @@ -0,0 +1,10 @@ +-/semanticdb +-/url +-/edts +-/elpa +-/.cache +-ac-comphist.dat +-.emacs.desktop +-.emacs.desktop.lock +-.smex-items +-*.elc \ No newline at end of file diff --git a/emacs.d/.travis-build.sh b/emacs.d/.travis-build.sh new file mode 100755 index 0000000..0b8be23 --- /dev/null +++ b/emacs.d/.travis-build.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +## run_build.sh --- Travis CI File for Spacemacs +## +## Copyright (c) 2012-2014 Sylvain Benner +## Copyright (c) 2014-2015 Sylvain Benner & Contributors +## +## Author: Sylvain Benner +## URL: https://github.com/syl20bnr/spacemacs +## +## This file is not part of GNU Emacs. +## +## License: GPLv3 + +tests=("core") + +if [ $USER != "travis" ]; then + echo "This script is not designed to run locally." + echo "Instead, navigate to the appropriate test folder and run make there instead." + exit 1 +fi + +if [ $TRAVIS_SECURE_ENV_VARS = false ] && + [ $TRAVIS_PULL_REQUEST != false ] && + [ $TRAVIS_BRANCH = "master" ]; then + + printf '=%.0s' {1..70} + printf "\n し(*・∀・)/ Thanks for the contribution! \(・∀・*)ノ\n" + printf '=%.0s' {1..70} + printf "\n( ^◡^)っ Please submit your pull request against the develop branch.\n" + echo "You can read the contribution guidelines at:" + echo "https://github.com/syl20bnr/spacemacs/blob/develop/CONTRIBUTING.org" + exit 1 +fi + +echo "Pwd $(pwd)" +rm -rf ~/.emacs.d +ln -sf `pwd` ~/.emacs.d + +for test in "${tests[@]}"; do + rm -rf ~/.emacs.d/elpa + rm -rf ~/.emacs.d/.cache + rm -f ~/.spacemacs + + testdir=~/.emacs.d/tests/$test + echo "Running '$test' in '$testdir' folder" + if [ -f $testdir/dotspacemacs.el ]; then + cp $testdir/dotspacemacs.el ~/.spacemacs + fi + cd $testdir && echo "Now in $(pwd)" + make test || exit 2 +done diff --git a/emacs.d/.travis.yml b/emacs.d/.travis.yml new file mode 100644 index 0000000..6a8b254 --- /dev/null +++ b/emacs.d/.travis.yml @@ -0,0 +1,25 @@ +language: generic +sudo: false + +branches: + only: + - master + - develop + +before_install: + - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh + - evm install $EVM_EMACS --use --skip + +env: + - EVM_EMACS=emacs-24.4-travis + - EVM_EMACS=emacs-24.5-travis + - EVM_EMACS=emacs-git-snapshot-travis + +matrix: + fast_finish: true + allow_failures: + env: + - EVM_EMACS=emacs-git-snapshot-travis + +script: + - ./.travis-build.sh diff --git a/emacs.d/CHANGELOG.org b/emacs.d/CHANGELOG.org new file mode 100644 index 0000000..86c6465 --- /dev/null +++ b/emacs.d/CHANGELOG.org @@ -0,0 +1,3759 @@ +* Release 0.200.x +** 0.200.5 (2016/11/03) +*** Fixes +- Removed themes missing from MELPA (=colorsarenice-theme= and =stekene-theme=) +** 0.200.4 (2016/10/26) +*** Fixes +- Update go-guru package reflecting MELPA changes +** 0.200.3 (2016/10/18) +*** Fixes +- Fix broken macOS paths for homebrew service (thanks to mgiles) +*** Improvements +- Add =system-configuration-features= to system description (~SPC h d s~) + for Emacs 25 and later (thanks to JAremko) +- Add support for =doom= themes (thanks to TheBB) +- Revert back default value for =dotspacemacs-startup-lists= (was previously + changed to be nil) +- Warn if layers changed outside =dotspacemacs/layers= function + (thanks to TheBB) +- Show a list of Spacemacs warnings in home buffer (thanks to TheBB) +- Prevent =:toggle= expression from being evaluated for excluded packages + (thanks to TheBB) +- Various documentation improvements (thanks to arronmabrey, carbohydratesn, + d12frosted, d1egoaz, deb0ch, duianto, eagleflo, JAremko, jredville, lunik1, + mineo, nixmaniack, philtothetop, roryokane, swaroopch, TheBB, Tritlo, tudho, + xificurC) +*** Layer changes +**** Spacemacs distribution +- Add =golden-ratio= toggle key in window transient-state only when + =golden-ratio= package is used (thanks to bmag) +- Enable line numbers for =conf-mode= (by deriving =conf-mode= from + =text-mode=) (thanks to valentjedi) +- New key binding ~SPC c h~ to hide/show comments in a file using the package + =hide-comnt= +- Add ~q~ key binding to quit the =evil-number= transient-state (thanks to duianto) +- Activating =linum-relative= now correctly activates =linum= (thanks to deb0ch) +**** C/C++ +- Match entire path after -I when reading cc-file (function + =company-mode/load-clang-complete-file=) (thanks to jlewallen) +**** Common-lisp +- Enable fuzzy matching for auto-completion (thanks to tuhdo) +**** D +- Add support for auto-completion via =DCD= (thanks to tuhdo) +- Add new key bindings for code navigation: + - ~SPC m g g~ to go to definition + - ~SPC m g b~ to jump back (after go to definition with above command) + - ~SPC m g r~ to find references to all symbol at point + (thanks to tuhdo) +**** IPython-notebook +- Fix deprecated =axes.color_cycle= in =matplotlibrc= (thanks to Retorz) +**** Ivy +- Fix spacemacs layout transient-state to correctly exit when selecting a layout + (thanks to gilbertw1) +- Make =ivy= restrict buffers to current spacemacs layout (thanks to bmag) +**** Elixir +- Add support for =org-babel= (thanks to usharf) +- Enable =flycheck= on idle since recent changes to =flycheck-mix= make it safe + (thanks to aaronjensen) +**** ERC +- Fix connecting to default servers with TLS more than once with ERC + (thanks to Hoot215) +**** Git +- Use =fill-column-indicator= only when the package is effectively used + (thanks to bmag) +- Use =magit= 2.8 built-in fullscreen display function (update your + packages) (thanks to houli) +**** Go +- Replace deprecated =go-oracle= by =go-guru= (thanks to edrex) +- Remove check for =GOPATH= when initializing =go-guru= (thanks to goofansu) +- Fix usage of =go-rename= on symlinked projects (thanks to grncdr) +**** Helm +- Add key binding ~M-RET~ (meta-return) to open the file =packages.el= + of a layer in =helm-spacemacs-help= under ~SPC h SPC~ (thansk to CestDiego) +**** Html +- Fix hooks for CSS-mode since it now derives from =prog-mode= in Emacs 25 + (thanks to TheBB) +**** Javascript +- Add missing command prefix names (thanks to shanavas786) +**** Ocaml +- Add =cmti= extension to list of ignored completion extensions + (thanks to rgrinberg) +**** Org +- Fix location of =org-async-init.el= (thanks to fintelkai) +- Add support for =:q= and =:wq= ex commands for abort and finalize in + =org-capture= and =org-src-edit= (thanks to mwillsey) +- Add support for =Twitter Bootstrap= for export to html. + To enable the support for =bootstrap= set the new layer variable + =org-enable-bootstrap-support= to =t= (thanks to kalhauge) +**** Nim +- Add support =nimsuggest= for better completion using Nim's IDE tool + (thanks to tuhdo) +- Add support for =eldoc= via =nimsuggest= (thanks to tuhdo) +- New key bindings for code navigation: + - ~SPC m g g~ to jump to definition + - ~SPC m g b~ to jump back + (thanks to tuhdo) +**** Plantuml +- Replace deprecated =puml-mode= by =plantuml-mode= (thanks to skuro) +**** Python +- Fix start of REPL for Emacs 25.1 (thanks to bmag) +- Make =python-tab-width= configurable (thanks to TheBB) +- Add support for =wdb= debugger when inserting breakpoints using ~SPC m d b~ + (thanks to koterpillar) +- Use =semantic= for =imenu= only when =semantic-mode= is enabled + (thanks to bmag) +- Improve =spacemacs/python-execute-file= on ~SPC m c c~ to pre-fill + "python " as the compile command when using the universal prefix + argument ~SPC u SPC m c c~ (thanks to bmag) +**** Ruby +- Add support for =minitest= test runner (thanks to pawandubey) +**** Ruby on rails +- Declare prefix command for =ruby-mode= and =enh-ruby-mode= (thanks to selmanj) +**** Scala +- Remove =ensime= obsolete commands =ensime-db-start= and + =ensime-db-list-locals= (thanks to atreeyang) +**** Shell-scripts +- New key binding ~SPC i !~ to insert shebang line in script files using + package =insert-shebang= +**** Syntax checking +- Add support for new =flycheck= feature =flycheck-explain-error= on ~SPC e e~ + (thanks to fmdkdd) +**** Typescript +- Add support for auto-completion (thanks to TheBB) +**** Yaml +- Add support for syntax checking (thanks to rski) +**** Ycmd +- Improve search of nearest file in compilation database (thanks to deb0ch) +** 0.200.2 (2016/10/14) +*** Fixes +- Fix compatibility with the =xterm-color= package (thanks to bixuanzju) +** 0.200.1 (2016/10/09) +*** Fixes +- Restore missing support for custom Evil ex command key via the new + =dotspacemacs-ex-command-key= variable (thanks to Dietr1ch) +- core: Fix lazy installation of layers +- core: Fix Quelpa recipes construction (thanks to ynilu) +- core: Fix unwanted exclusion of packages when setting + =dotspacemacs-install-packages= to =all= +- core: Fix =spacemacs/ert-run-tests-buffer= to run only the tests in current + buffer (thanks to bmag) +*** Dotfile changes +- New variable =dotspacemacs-ex-command-key= to define the key to press + to enter an Evil ex command, default is ~:~ (thanks to Dietr1ch) +- Change default value of =dotspacemacs-startup-lists= to =nil= +*** Layer changes +**** Agda +- Enable auto-completion (thanks to bixuanzju) +**** Clojure +- Add support for =org-babel= (thanks to drewokane) +**** Git +- Adjust linum gutter to accomodate text-size changes (thanks to nspaeth) +**** Html +- Replace =jade-mode= by =pug-mode= (Jade is now Pug) (thanks to robbyoconnor) +**** Markdown +- Enable =orgtbl-mode=, this makes working with tables much nicer + (thanks to robbyoconnor) +**** React +- Enable =emmet-mode= (thanks to kaipr) +**** Shell +- Fix shell regular expression to add shell buffers to useful buffers + (thanks to TheBB) +**** Ycmd +- Improve performance on large projects by removing buffer parsing on newline + insertion (thanks to deb0ch) +*** Improvements +- Add support for transparency in multiple frames (thanks to TGThorax) +- Add ~J~ and ~K~ key bindings on the home buffer to navigate between widgets + (thanks to tobimensch) +- Various documentation improvements (thanks to andschwa, bmag, duianto, jazzpi, + Tritlo, vigilancer) +** 0.200.0 (2016/10/02) +*** IMPORTANT: Breaking changes +- The support for Emacs 24.3 has been dropped, Spacemacs needs at least Emacs + 24.4 to work correctly. +- =extensions= are deprecated as announced in previous release, if you still + have =extensions= directories you must rename them to =local= and move + the contents of the =extensions.el= files to the =packages.el= files adding + the keyword =:location local= to them in the package list. Refer to other + layers for examples (for instance the =python= layer) +- =-excluded-packages= variables are now deprecated as announced in + previous release, you must now use the keyword =:excluded t= of the package + list, see the =vim-empty-lines= layer for example. +- Key binding ~SPC :~ acting as =M-x= as been replaced by ~SPC SPC~. + If you want to revert to the old ~SPC :~ key binding set the new + variable =dotspacemacs-emacs-command-key= to ":". +- Key binding ~SPC f e h~ is now ~SPC h SPC~ +- Key bindings to delete things are now more consistent and use the ~d~ key. + We moved ~SPC w c~ and ~SPC w C~ to ~SPC w d~ and ~SPC w D~. +- Refactor ~SPC w~ and ~SPC b~ regarding deletion to clean redundant actions + and bring more consistency between the two prefixes (see + =Distribution layer changes= section in change log for more information) +- ~SPC j~ prefix has been modified to include =jump= commands: + - =avy= commands are now behind the prefix ~SPC j~ for =jump=: + - ~SPC j j~ to jump to a character in the buffer (works as an evil motion) + - ~SPC j l~ to jump to a line with avy (works as an evil motion) + - ~SPC j w~ to jump to a word in the current buffer (works as an evil motion) + - the following key bindings have been moved: + - ~SPC j j~ to split a line has been moved to ~SPC j n~ + - ~SPC j h~ and ~SPC j l~ have been moved to ~SPC j 0~ and ~SPC j $~ + respectively. + - ~SPC J~ to split a string or sexp has been moved to ~SPC j s~ +- All helm related key bindings under ~SPC h~ that are not about help have + been moved to different key bindings: + - ~SPC h b~ for =helm-filtered-bookmarks~is now ~SPC f b~ + - ~SPC h l~ for =helm-resume= is now ~SPC r l~ + - ~SPC h L~ for =helm-locate-library= is now ~SPC f e l~ +- Git key bindings under ~SPC g~ have been reorganised to free up some keys + and capitalize on =Magit= dispatch menu to keep things consistent (see + =git= section in change log for more information) +- Spacemacs layouts scope has been changed, now ~SPC b b~ lists the buffers of + the current layout, use ~SPC B b~ to list all the opened buffers. +- =org-indent= is now turned off by default +- Micro states are now called transient states, the macro + =spacemacs|define-micro-state= is deprecated, it is replaced by the new + =hydra= powered macro =spacemacs|define-transient-state=. +- Spacemacs layouts and workspaces transient states now exit when a layout or + workspace is selected, use ~C-0~ ... ~C-9~ to switch to a layout and keep + the transient state open. +- Remove support for the value =all= for =dotspacemacs-configuration-layers= + variable. To install all the packages supported by Spacemacs there is a new + variable =dotspacemacs-install-packages=. +- Remove layer variable =colors-enable-rainbow-identifiers= in =colors= layer, + You have to replace it by =colors-colorize-identifiers 'all=. +- The =bépo= layer has been replaced by the new layer =keyboard-layout=, see the + =README.org= of the layer for more info. +*** Hot new features +- Refactor of the layer system which should reduce startup time by 20~25%. +- New option to lazy install layers based on =auto-mode-alist= (similar to + =Prelude= lazy install of packages but for layers) via the variable + =dotspacemacs-enable-lazy-installation=. +- Add support for Ivy via the new layer =ivy=, when used it replaces =helm= + (thanks to justbur, d12frosted, goofansu, lszekeres, nixmaniack, ralesi, + TheBB, zilongshanren) +- Add support for different keyboard layouts via the new layer + =keyboard-layout=, currently supported layouts are =bépo= and =dvorak= + (thanks to StreakyCobra) +- New transient states powered by =Hydra=, they replace the deprecated + micro states (thanks to justbur) +- New =jump to definition= abstraction to handle multiple jump backends like + tags, dumb-jump etc... (thanks to TheBB) +- Global access to all available REPLs with ~SPC a '~ and `SPC m '~ (thanks to + AlejandroCatalina and TheBB) +- New debugging tools: + - press ~SPC q d~ to restart Emacs in debug mode with command line parameter + =--debug-init= + - press ~SPC q D~ to restart Emacs without Spacemacs but with a list of + selected packages to load. + (thanks to StreakyCobra) +- New way to install all the supported packages by Spacemacs via the variable + =dotspacemacs-install-packages= +- Improved =emacs= and =hybrid= editing styles to fix configuration + inconsistencies +- the =spacemacs= layer has been split into multiple layers to allow better + modularity (these layers are in =+spacemacs= sub-directory): + - spacemacs-completion + - spacemacs-editing + - spacemacs-editing-visual + - spacemacs-evil + - spacemacs-language + - spacemacs-layouts + - spacemacs-misc + - spacemacs-org + - spacemacs-ui + - spacemacs-ui-visual + (thanks to justbur) +*** New Layers +- asm in =+lang= (thanks to thudo) +- bibtex in =+lang= (thanks to JP-Ellis) +- csv in =+lang= (thanks to jb55) +- cfengine in =+tools= (thanks to nickanderson) +- helm in =completion= (moved from spacemacs-base) (thanks to justbur) +- imenu-list in =+tools= (thanks to bmag) +- ivy in =completion= (thanks to justbur) +- keyboard-layout (replaces the bépo layer) (thanks to StreakyCobra) +- nlinum in =+misc= (thanks to CodeFalling) +- pdf-tools in =+tools= (thanks to Andre0991) +- plantuml in =+lang= (thanks to robbyoconnor) +- rebox in =+tools= (thanks to choppsv1) +- shaders in =+lang= (thanks to Ell) +- slack in =+chat= (thanks to kostajh) +- systemd in =+tools= (thanks to StreakyCobra) +*** Dotfile changes +**** Changes for variable values and keywords +- Add new keyword =:packages= for the list of layers in variable + =dotspacemacs-configuration-layer=, =:packages= allow to select or exclude + packages from a layer. +- Add new keyword =:enabled-for= for the list of layers in variable + =dotspacemacs-configuration-layer=, this keyword controls the effect of a + layer on the other layers. For instance one can enable the =auto-completion= + only for the =python= layer with the value + =(auto-completion :enabled-for python)= + Note that this keyword is the opposite of the existing keyword + =:disabled-for=. (thanks to TheBB) +- The value of =dotspacemacs-editing-style= can now be a list containing the + keyword =:variables= (similar to =dotspacemacs-configuration-layers=) to + define additional variables to modify the behavior of the editing style. This + new keyword is useful for =hybrid= style which supports these variables: + - =hybrid-mode-enable-evilified-state=, if non nil then buffer are evilified, + - =hybrid-mode-enable-hjkl-bindings=, if non nil navigation on ~hjkl~ keys is + enabled (for instance in =helm= buffers), + - =hybrid-mode-default-state=, the default state when opening a new buffer, + by default it is =normal=. +- The value of =dotspacemacs-default-font= can now be a list (thanks to TheBB) +- New supported values for =dotspacemacs-startup-lists=: + - agenda + - todos + (thanks to tonyday567) +- Change default value of =dotspacemacs-startup-lists= to =nil= +- Change default value of =dotspacemacs-check-for-update= to =nil= +- Remove support for value =all= in variable =dotspacemacs-configuration-layers= +- Remove variable =dotspacemacs-startup-recent-list-size= which has been replaced + by adding support for cons cells in variable =dotspacemacs-startup-list= + (thanks to ralesi) +**** New variables +- New variable =dotspacemacs-enable-lazy-installation= to install a layer only + when a file with a supported type is opened. Possible values are =all=, + =unused= and =nil=: + - =unused= will lazy install only unused layers + - =all= will lazy install any layer that support lazy installation even the + used layers + - =nil= disable the lazy installation feature + Default value is =unused= +- New variable =dotspacemacs-frozen-packages=. It is a list of packages, these + packages cannot be updated or rollbacked. +- New variable =dotspacemacs-install-packages= which replaces the variable + =dotspacemacs-delete-orphan-packages=. This new variable defines the behavior + of Spacemacs for installed packages. + Possible values are =used-only=, =used-but-keep-unused= and =all=. + - =used-only= installs only explicitly used packages and uninstall any + unused packages as well as their unused dependencies. + - =used-but-keep-unused= installs only the used packages but won't uninstall + them if they become unused. + - =all= installs *all* packages supported by Spacemacs and never uninstall + them. + Default value is =used-only=. +- New variable =dotspacemacs-emacs-command-key= which replaces the variable + =dotspacemacs-command-key=. This variable represents the key to press after + the leader key to execute =M-x=. Default value is ~SPC~. +- New variable =dotspacemacs-folding-method= to allow choosing between + different code folding methods. Currently supported are =evil= and =origami=. + Default value is =evil=. (thanks to ralesi) +- New variable =dotspacemacs-ex-substitute-global=, if non-nil then + the behavior of the =g= flag in =:substitute= ex-command is inverted. + Default value is nil (thanks to fbergroth) +- New variable =dotspacemacs-smart-closing-parenthesis=. If non-nil pressing + the closing parenthesis ~)~ key in insert mode passes over any automatically + added closing parenthesis, bracket, quote, etc... + This can be temporary disabled by pressing ~C-q~ before ~)~. Default is nil. + (thanks to StreakyCobra) +- New variable =dotspacemacs-retain-visual-mode-on-shift=, If non nil ~>~ is + remapped to ~>gv~ and ~<~ is remapped to ~~ magit-submodule-popup + - ~SPC g A~ magit-cherry-pick-popup + - ~SPC g c~ magit-commit-popup + - ~SPC g C~ magit-checkout + - ~SPC g d~ magit-diff-popup + - ~SPC g D~ spacemacs/magit-diff-head + - ~SPC g e~ magit-ediff-compare + - ~SPC g E~ magit-ediff-show-working-tree + - ~SPC g f~ magit-fetch-popup + - ~SPC g F~ magit-pull-popup + - ~SPC g i~ magit-init + - ~SPC g l~ magit-log-popup + - ~SPC g L~ magit-log-buffer-file + - ~SPC g r~ magit-rebase-popup + - ~SPC g P~ magit-push-popup + - ~SPC g U~ magit-unstage-file + - ~SPC g x~ magit-reset-popup + - the above key bindings have been replaced by only one key binding ~SPC g m~ + displaying the =Magit= dispatch popup ++ =git-link= key bindings have been moved from ~SPC g h~ to ~SPC g l~ since + it provides support for other Git hosting services (not only GitHub) + - ~SPC g l c~ on a commit hash, browse to the current file at this commit + - ~SPC g l C~ on a commit hash, create link to the file at this commit + and copy it + - ~SPC g l l~ on a region, browse to file at current lines position + - ~SPC g l L~ on a region, create a link to the file highlighting the + selected lines ++ New key binding ~SPC g f h~ to get the commit history of the current file +**** GitHub +- Add support for =git-link= in =git-timemachine=, this allow to copy + the SHA-1 or selected lines links for the current commit (thanks to dcluna) +- Move clone commands under ~SPC g h c~: + - ~SPC g h c /~ search for a repository to clone it + - ~SPC g h c c~ clone and optionally fork repository + - ~SPC g h c r~ add a remote that is an existing fork of selected remote + - ~SPC g h c f~ fork remote in current user namespace + - ~SPC g h c u~ add upstream as remote +**** Go +- New layer variable =go-tab-width= (thanks to microamp) +- New key binding ~SPC m g c~ to open a clone of the current buffer with a + coverage info (thanks to JAremko) +- Add support for =gometalinter= via new layer variable + =go-use-gometalinter= (thanks to JAremko) +- Improve indentation (thanks to bogdanteleaga) +- Show function signatures (thanks to carlosgaldino) +**** Graphviz +- Add support for =org-babel= (thanks to choppsv1) +**** Gtags +- Refactoring of the layer to support more languages (thanks to choppsv1 and + TheBB) +- New layer variable =gtags-enable-by-default= to control whether =gtags-mode= + should be enabled by default or not (thanks to TheBB) +- New key binding ~SPC m g D~ to navigate to definition in another window + (thanks to NJBS) +- Remove =helm-gtags= lighter from mode line (thanks to NJBS) +**** Haskell +- New layer variable =haskell-completion-backend= to select the desired + completion backend (thanks to d12frosted) +- Add package =intero= (based on cydparser layer) (thanks to d12frosted) +- Add package =helm-hoogle= under ~SPC m h f~ (thanks to jb55) +- Add package =hlint-refactor= (thanks to cydparser) +- Add package =company-ghci= (thanks to dysinger) +- Add all =haskell-mode= key bindings to =literate-haskell-mode= + (thanks to jb55) +- Add support for =intero-apply-suggestions= (thanks to Tehnix) +- Swap key bindings ~SPC m F~ and ~SPC m f~ (thanks to ljli) +- Evilify =haskell-debug-mode= (thanks to d12frosted) +- Fix ~SPC m h i~ and ~SPC m h t~ key bindinds (thanks to d12frosted) +- Disable =haskell-tags-on-save= by default (thanks to bgamari) +- Remove =structured-haskell-mode= because of poor integration (thanks to + d12frosted) +- Remove =ghci-ng= support (thanks to d12frosted) +**** Helm +- Rename action =Add layer= to =Install layer= in =helm-spacemacs-help= + (thanks to CestDiego) +- Fix =helm-source-header= face not updating when changing themes + (thanks to ghoot) +- Enable fuzzy matching in all Helm sources (thanks to bling) +**** Html +- Add prefix command names (thanks to shanavas786) +- Use built-in =web-mode= pairing (disable =smartparens=) (thanks to TheBB) +- Enable =emmet-mode= in sass and scss modes (thanks to utkarshkukreti) +- Make =pug= files use =jade-mode= since Jade is now called Pug + (thanks to robbyoconnor) +- Fix =emmet= expansion if =yasnippet= isn’t turned on (thanks to TheBB) +**** Idris +- New key binding ~SPC m l~ for extracting lemma (thanks to bixuanzju) +- New key binding ~SPC m c~ for =idris-case-dwim= (thanks to bixuanzju) +- New key binding ~SPC m s q~ to quit the Idris process (thanks to bixuanzju) +- Register Idris REPL for ~SPC a '~ (thanks to bixuanzju) +- Add basic auto-completion (thanks to bixuanzju) +- Add support for =golden-ration= for *idris-holes* and *idris-info* + (thanks to houli) +- Add prefix command names (thanks to bixuanzju) +- Enhance =auto-completion= support for Idris layer, now =auto-completion= + will ask Idris process for completions (thanks to bixuanzju) +- Enable =auto-completion= in REPL (thanks to bixuanzju) +- Disable =golden-ratio= in holes buffer (thanks to houli) +**** IPython-notebook +- Move transient state key binding to ~SPC m .~ +- Evilify notebooklist buffer +- Fix loading of keymap (thanks to TheBB) +**** Jabber +- Add support for evilified key bindings (thanks to mssun) +- Don't overwrite mini-buffer when active (thanks to toshism) +**** Java +- Add support for =eclimd= with new key bindings: + - ~SPC m d s~ to start daemon + - ~SPC m d k~ to stop daemon + (thanks to elken) +**** JavaScript +- Add REPL via =skewer-mode= and =livid-mode= (thanks to dcluna) +- Fix offset detection in js2-mode (thans to TheBB) +- Diminish =tern= and =skewer= modes (thanks to cpaulik) +**** LaTeX +- Add prefix command names (thanks to NJBS) +- New key bindings for fill and uncomment: + - ~SPC m %~ to comment or uncomment a paragraph + - ~SPC m ;~ to comment or uncomment a region + - ~SPC m f e~ to fill LaTeX environment + - ~SPC m f p~ to fill LaTeX paragraph + - ~SPC m f r~ to fill LaTeX region + - ~SPC m f s~ to fill LaTeX section + (thanks to kccai) +- New key binding ~SPC m a~ for =TeX-command-run-all= (thanks to kccai) +**** Markdown +- New layer variable =markdown-live-preview-engine=, Possibe values are =eww= + (built-in browser) or =vmd= (installed with =npm=) +- Add package =vmd-mode= (thanks to bixuanzju) +- New key binding ~SPC m c P~ to live preview in Emacs' built-in browser + (thanks to lunaryorn) +**** mu4e +- Add package =mu4e-maildirs-extension= (thanks to choppsv1) +- Add package =mu4-alert= (thanks to zakkak) +- New key bindings: + - ~J~ to go to next unread thread marking other mail read on the way + - ~C-j~ to go to next header + - ~C-k~ to go to previoys header + (thanks to myrjola) +- Enable =org-mu4e= (thanks to choppsv1) +- Use =helm--completing-read-default= (thanks to jeizsm) +- Improve set account by "to" field (thanks to sorpaas) +**** OCaml +- New key binding ~SPC m = ~ to indent buffer with =ocp-indent= (thanks to NJBS) +- New key binding ~SPC m g o~ to list occurrences for identifier under point + (thanks to NJBS) +- Add support for =ocamllex= , =ocamlyacc= files (thanks to YasuharuIida) +- Remove key binding =merlin-refresh=, this function is obsolete since merlin + 2.0 (thanks to bixuanzju) +- Remove unused =flycheck= config, merlin is capable of doing it + (thanks to bixuanzju) +- Fix override of =exec-path= by =utop= configuration (thanks to bixuanzju) +**** Org +- Add package =org-reveal= (thanks to knl) +- Add local package =space-doc-mode= to improve org files readability + (thanks to JAremko) +- Add support for =org-babel= +- Replace =org-repo-todo= by =org-projectile= (thanks to TheBB) +- New layer variable =org-projectile-file= to set the filename where you want + to store project-specific TODOs. +- New key bindings for =org-agenda=: + - ~RET~ for =org-agenda-goto= + - ~M-RET~ for =org-agenda-show-and-scroll-up= + - ~SPC m a~ for =org-agenda= + - ~SPC m d~ for =org-agenda-deadline= + - ~SPC m s~ for =org-agenda-schedule= + - ~SPC m f~ for =org-agenda-set-effort= + - ~SPC m P~ for =org-agenda-set-property= + - ~SPC m :~ for =org-agenda-set-tags= + - ~SPC m I~ for =org-agenda-clock-in= + - ~SPC m O~ for =org-agenda-clock-out= + - ~SPC m q~ for =org-agenda-clock-cancel= + - ~SPC m q~ for =org-agenda-refile= +- New key bindings for =org-calendar=: + - ~M-l~ One day forward + - ~M-h~ One day backward + - ~M-j~ One week forward + - ~M-k~ One week backward + - ~M-L~ One month forward + - ~M-H~ One month backward + - ~M-J~ One year forward + - ~M-K~ One year backward +- New key binding ~SPC m h s~ for =org-insert-subheading= (thanks to jgertm) +- =org-indent= is now turned off by default because of the numerous glitches + (thanks to TheBB) +- Add code blocks support for =evil-surround= using ~:~ and ~#~ + (thanks to TheBB) +- Set =org-imenu-depth= to 8 (thanks to justbur) +- set =org-image-actual-width= to nil which allows to resize images in an org + buffer. +- Follow the confirm and abort conventions (thanks to myrjola) +**** OSX +- Add package =osx-dictionary= (thanks to nixmaniack) +- New layer variable =osx-use-dictionary-app= to use OS X dictionary app + instead of wordnet. Default value is =t=. (thanks to nixmaniack) +- Support pasting text with ~s-v~ in terminals (thanks to lyallcooper) +**** NixOS +- Add =nix-mode= to variable =spacemacs-indent-sensitive-modes= to disable + automatic indentation on pasting text (thanks to Profpatsch) +**** Pdf-tools +- New key bindings ~0~ and ~$~ to full left and right scroll + (thanks to Andre0991) +- New key binding ~zr~ to reset zoom factor (thanks to Andre0991) +**** Puppet +- Use =ruby-mode= for Puppetfile support (thanks to nwolfe) +**** Purescript +- Add package =flycheck-purescript= (thanks to diogob) +- New key binding ~SPC m g g~ (thanks to kRITZCREEK) +- Incorporate new functionality from =psc-ide=: + - New layer variable =purescript-add-import-on-completion= to add imports on + completion. Default value is =t=. + - New layer variable =purescript-enable-rebuild-on-save= to get a popup buffer + showing you your current warnings/errors one at a time. This is primarily + meant as an alternative to using flycheck. Default value is =nil=. + - New =psc-ide= key bindings: + - ~SPC m m b~ to rebuilds the current file and displays any warnings or + errors + - ~SPC m m i a~ to add an import for the identifier at the current cursor + position + - ~SPC m m i s~ to inserts a suggestion for the warning/error at the current + cursor position + - ~SPC m m t~ to add a new clause for the function signature at point + - ~SPC m m c s~ to casesplits on the identifier at the current cursor + position + - ~SPC m m q~ to quit the current psc-ide-server + - ~SPC m m L~ to load a specific module + (thanks to kRITZCREEK) +- Fix org layout if there is no agenda files and display an error message + (thanks to TheBB) +**** Python +- Add package =live-py-mode= (thanks to cpaulik) +- Add package =py-isort= to sort the imports (thanks to swaroopch) +- Add support for =org-babel= +- Replace package =py-yapf= with =yapfify=. =Yapfify= uses project settings + applicable to the file that yapf is called on. Also it shows an error if + =yapf= fails (thanks to JorisE) +- New layer variable =python-sort-imports-on-save=, if non-nil, automatically + sort imports on save. Default value is =nil= (thanks to swaroopch) +- New key binding ~SPC m r I~ to sort imports with =isort= python package + (thanks to TheBB) +- New key bindings to manage virtual environments: + - ~SPC m V a~ to activate a virtual environment in any directory + - ~SPC m V d~ to deactivate the active virtual environment + - ~SPC m V w~ to work on virtual environment in ~WORKON_HOME~ + (thanks to cpaulik) +- New key binding ~SPC m g b~ for =anaconda-mode-go-back= (thanks to jluttine) +- Add support for a lisp REPL in =hy= buffers (thanks to dannyfreeman) +- Add support for =pyenv= in =hy= buffers (thanks to dannyfreeman) +- Add support for =smartparens= in =hy= buffers (thanks to dannyfreeman) +- Fix =pylookup= key binding ~SPC m h H~ (thanks to darkfeline) +- Fix IPython 5 integration and make it work with =pyenv= (thanks to cpaulik) +- Make =pylookup= use std =completing-read= function (thanks to darkfeline) +- Make =pylookup.py= compatible with Python 2 and 3 (thanks to hemcsec) +- Enable lazy loading of =py-yapf=. +- Only disable =semantic-idle-summary= if =anaconda-mode= is used + (thanks to cpaulik) +- Set =comment-inline-offset= to 2 for =python-mode= Since python's PEP8 + recommends two spaces for inline spaces (thanks to xiaohanyu) +- Set breakpoints correctly when =pyenv= is used (thanks to cpaulik) +**** React +- Add support for =smartparens= (thanks to axyz) +- Add "^import React" to =magic-mode-alist= (thanks to axyz) +- Add =javascript-standard= as a =flycheck= checker (thanks to shahinism) +- Use node_modules version of eslint or global if not available (thanks axyz) +**** Restclient +- Add package =ob-http=. +- New key binding ~SPC m y~ to copy the query around point as a =curl= command + (thanks to d1egoaz) +**** Ruby +- Add package =rake= with key bindings: + - ~SPC m k k~ to runs rake + - ~SPC m k r~ to re-runs the last rake task + - ~SPC m k R~ to regenerates the rake cache + - ~SPC m k f~ to finds definition of a rake task + (thanks to asok) +- New =rspec= key binding ~SPC m t ~~ for + =rspec-toggle-spec-and-target-find-example= (thanks to asok) +- New =rspec= key binding ~SPC m t TAB~ for =rspec-toggle-spec-and-target= + (thanks to asok) +- New =rspec= key binding ~SPC m t d~ to run rspec in a specified directory + (thanks to dcluna) +- New key binding ~SPC b o~ to run bundle open (thanks to asok) +- Add =popwin= configuration to =*rake-compilation*= (thanks to nixmaniack) +- Add support for =Appraisals= files (thanks to jcf) +- Fix =chruby= configuration to find out the ruby version to use (thanks to asok) +- Enter automatically =inf-ruby-mode= when an =rspec= compilation hits a + breakpoint (thanks to dcluna) +**** Ruby on Rails +- Add =which-key= prefixes (thanks to ralesi) +**** Rust +- Remove layer variable =rust-enable-racer=, now =racer= is always used + (thanks to fbergroth) +- Remove package =company-racer= since =racer= works with default + =company= backends (thanks to fbergroth) +- Remove obsolete package =rustfmt= which has been integrated into =rust-mode= + (thanks to fbergroth) +- Remove =racer= lighter in the mode line (thanks to NJBS) +- New layer variable =rust-enable-rustfmt-on-save= (thanks to isphinx) +- New package =rustfmt= with new key binding ~SPC m =~ to format the buffer + (thanks to isphinx) +- New key binding ~SPC m c f~ to format all project files with =rustfmt= + (thanks to dmit) +- Add support for =Cargo.lock= and =.cargo/config= files for =toml-mode= + (thanks to Stebalien) +**** Scala +- Add support for =org-babel= (thanks to tonylotts) +- New layer variable =scala-use-unicode-arrows= to replace ASCII arrows + with unicode ones (thanks to moonranger) +- Enable lazy loading of =sbt-mode=. +- Disable Ensime autostart (thanks to d1egoaz) +- Use scala-mode instead of scala-mode-2 which is deprecated + (thanks to j-martin) +- Fix dot completion bug (thanks to gilbertw1) +**** Search-engine +- Denote all search functions as autoloadable (thanks to TheBB) +**** Shell +- New =eshell-z= package (thanks to CestDiego) +- New layer variable =shell-default-full-span=, if non-nil, the shell buffers + span full width of a window (thanks to dubnde) +- New key binding ~SPC p '~ for =projectile-shell-pop= (thanks to StreakyCobra) +- ~C-d~ is now bound to =eshell-delchar-or-maybe-eof= which checks if there is + a char after the point. If so, it performs the normal delete-char, + otherwise if quit eshell (thanks to microamp) +- Add support for the universal prefix argument to open a shell/term buffer in + the current window instead of a new window (i.e. ~SPC u SPC '~) +- Add support for =org-babel= +- Fix first =eshell= with no color (thanks to TheBB) +- Fix =projectile-multi-term-in-root= (~SPC p $ t~) (thanks to TheBB) +- Enable auto-jump to end of buffer in hybrid style (thanks to TheBB) +- Disable =global-hl-line-mode= in =shell-like= buffers (thanks to TheBB) +**** Shell-scripts +- Add package =company-shell= (thanks to joehillen) +- Enable =flycheck= in =sh-mode= (thanks to fbergroth) +- New key binding ~SPC m \~ for =sh-backslash-region= to add a backslash at + end of lines (thanks to fbergroth) +**** SML +- Improve indentation by binding ~RET~ to =reindent-then-newline-and-indent= + (thanks to cpaulik) +**** Spell-checking +- Use package =flyspell-correct= instead of =helm-flyspell= + (thanks to d12frosted) +- Add package =flyspell-popup= (thanks to usharf) +**** Spotify +- Enable lazy loading +**** Syntax-checking +- New key binding ~SPC e L~ to open the errors buffer and switch to it. +- Improve =flycheck= loading process (thanks to TheBB) +- Enable lazy loading of =flycheck=. +- Don't switch to =error-list= window if already on it (thanks to bmag) +- Fix bug where errors are not filtered correctly when setting + =flycheck-navigation-minimum-level= (thanks to maxigit) +**** Themes-megapack +- Add theme =Darkokai= (thanks to ekmecic) +**** Tmux +- Fix =golden-ratio= (thanks to TheBB) +**** Typescript +- Rewrite of the layer, see its =README.org= for more info (thanks to JAremko) +- New key binding ~SPC m s p~ to send region or buffer to the web playground + (thanks to JAremko) +- Add typescript format and make tide formatter the default (thanks to JAremko) +- Add support for =evil-shift-width= (thanks to TheBB) +- Allow =tsfmt= to use the local project's configuration (thanks to overminder) +- Swap ~C-j~ and ~C-k~ in tide reference mode (thanks to zilongshanren) +**** Version-control +- Fix git gutter toggle (thanks to ralesi) +- Fix errors with graphical elements in daemon mode (thanks to TheBB) +**** Vim-unimpaired +- Keep the point at the same location when calling + =evil-unimpaired/insert-space-above= and =evil-unimpaired/insert-space-below= + (thanks to jschaf) +- New key bindings ~] q~ and ~[ q~ for =spacemacs/next-error= and + =spacemacs/previous-error= (thanks to bling) +**** Windows-scripts +- Add support for =.cmd= and =.psm1= files (thanks to ralesi) +**** Yaml +- Fix auto-completion (thanks to perfectayush) +*** Core Changes +- Refactor layer system to allow a 20~25% performance boost on startup. +- Move bootstrap packages from =core-spacemacs.el= to a new layer called + =spacemacs-bootstrap=. +- Checking for new version on startup behavior has been tweaked to lower the + frequency on the checks and reduce the number of operations made: + - reduce number of required git commands per check from 3 to 1 + - remove recurrent version check every 6 hours, i.e. the check happens only + at startup + - rate limit the checks to once per day + - change default value of variable =dotspacemacs-check-for-update= to =nil= + - make function =spacemacs/check-for-new-version= interactive so checking + for a new version can be done on demand. +- New macro =spacemacs|define-jump-handlers= to define jump backends for a given + mode (thanks to TheBB) +- Implement an API for =local-vars-hook= which allows to read some directory + local variables before executing an hooked function (thanks to d12frosted) +- Make function =spacemacs/get-last-version= interactive +- New file in layers called =layers.el=, this file is responsible to declare + layer dependencies. +- New variable =spacemacs-start-directory=. With this new variable, user can + easily load spacemacs anywhere (thanks to exaos) +- New variable =spacemacs-default-company-backends= which allow the user to + fine tune the default company backends inherited by all the modes + (thanks to izahn) +- New command line parameters =--no-layer= and =--distribution= + - =--no-layer= deactivates all the layers except the distribution layer + - =--distribution= allows to change temporarily the distribution +- New funtion =spacemacs/report-issue= to create GitHub issues from within + Emacs based on a template (thanks to dwang20151005) +- New functions =configuration-layer/remove-layer= and + =configuration-layer/remove-layers=. +- New function =spacemacs/describe-package= giving useful information on a + package in the Spacemacs layers context (key binding ~SPC h d P~) +- New keyword =:toggle= for package lists =-packages=. Its value can be a + symbol or a list. A package is considered to be used if the toggle evaluates + to non nil. By default =:toggle= is =t=. +- New keyword =:min-version= for package lists =-packages=. Providing a + min-version allows to fetch the elpa version of a built-in package. +- New value =bootstrap= for package =:step= keyword, it is used for bootstrap + packages. +- New value =site= for package =:location= keyword, a site package is a package + installed on the host by a third party (ie. =mu4e= which is installed by =mu=) +- New documentation formatting tool =doc-fmt= (thanks to JAremko) +- New keywords for =spacemacs|add-toggle= macro: + - =:prefix= a symbol that is bound to the raw prefix argument + (as in =(interactive "P")= forms). + - =:on-message= an expression overriding the default 'on' toggle + message (useful to document a toggle's argument) + - =:mode= a minor mode, when provided, =:on=, =:off= and =:status= are + automatically defined to support the minor mode. + (thanks to dcluna and TheBB) +- Print toggles messages only when the toggle functions are used interactively + (thanks to bmag) +- Add =Quelpa= support for local packages which means that local packages can be + installed like any other ELPA package (thanks to d12frosted) +- Add footer in home buffer +- Add support for functions for =:status= in =spacemacs|add-toggle= + (thanks to TheBB) +- Add support for themes =omtose-darker= and =omtose-softer= (thanks to Cifer-Y) +- Update base16 themes to match new list (thanks to belak) +- Add emojis to issue template (thanks to CestDiego) +- Remove variable =user-dropbox-directory= +- Center spacemacs banner in window at startup (thanks to ralesi and deb0ch) +- Center ascii banners in window at startup (thanks to deb0ch) +- Display warning buffer at the bottom of the screen when installing packages. +- Display more information about the number of loaded packages in the home + buffer: + - =e= elpa + - =r= recipe + - =l= local + - =b= built-in +- Display a numerical progression in mode-line representing the number of + packages to configure. +- Display a warning message when a non-excluded package has no pre-init, init + or post-init function in a layer. +- Merge version strings into one string displayed in the left-hand side: + =spacemacs-version@emacs-version (distribution)= +- Improve =spacemacs|diminish= function (thanks to TheBB) +- Use =$SPACEMACDIR/init.el= instead of =~/.spacemacs= when both exist + (thanks to bmag) +- Fix font definition for first frame in daemon mode (thanks to StreakyCobra) +- Fix message format in =init.el= (thanks to YasuharuIida) +- Fix random banner display when closing and reopening the home buffer + (thanks to TheBB) +- Fix home buffer random banner choice (thanks to deb0ch) +- Fix =.gitignore= file to enable submodule update (thanks to jgmize) +- Optimize function =spacemacs//get-package-directory= (thanks to ivanbrennan) +- Improving performance by avoiding to visit dump files in function + =spacemacs/dump-vars-to-file= (thanks to bmag) +*** Other fixes and improvements +- Fix all documentation links on GitHub (thanks to JAremko) +- Improve Spacemacs themes readability of highlight-persist and smartparens + overlays when there is an active region (thanks to nashamri) +- Typos and documentation improvements (thanks to adrsta, Andre099, 1andreas-h, + axyz, balajisivaraman, benansell, bmag, brettcannon, cpaulik, ChuntaoLu, + d12frosted, d1egoaz, darkfeline, dathinaios, deb0ch, Dominionized, duianto, + eapolinario, eareese, jfchevrette, gilch, hasufell, hghwng, ivanbrennan, + jgertm, jkrmr, johankj, Johnstone-Tech, jonboiser, jpfairbanks, jschnurr, + kalouantonis, Karunamon, krobelus, li-xinyang, loxaxs, lzhoucs, madand, + Marlin-Na, mathcass, maxigit, microamp, nashamri, NJBS, ohspite, + pablooliveira, padi, paulyoung, rbanffy, robbyoconnor, robert-m-johnson, + roryokane, royxue, sbdchd, sebastianpoeplau, shanavas786, sooheon, splaspood, + StreakyCobra, svanburen, taheris, tchajed, TheBB, tj64, tko, tonylotts, + trenpixster, voidlily, WillianPaiva, WuTheFWasThat, xiaohanyu, xfq, zifeo, + zjyjer) +- Other contributions (thanks to hujianxin, nixmaniack) +*** Core team members +**** Current +- Sylvain Benner (syl20bnr) +- Boris (d12frosted) +- Eivind Fonn (TheBB) +**** Old +- Fabien Dubosson (StreakyCobra) +- Justin Burkett (justbur) +* Release 0.105.x +** 0.105.22 (2016/08/19) +*** Fixes +- Rename the =emacs-eclim= package to =eclim= (thanks to CestDiego) +** 0.105.21 (2016/06/08) +*** Fixes +- Fix hybrid state when escaping to normal state +- Fix installation instructions on OS X (thanks to d12frosted) +- Fix broken =vinegar= key bindings +- Fix =tmux= layer (thanks to aaronjensen) +- Fix =scala= layer + - Use =scala-mode= instead of =scala-mode2= (thanks to j-martin) + - Fix =sbt= command to generate =ensime= configuration (thanks to d1egoaz) +** 0.105.20 (2016/05/10) +*** Fixes +- Update Spaceline configuration for new version +** 0.105.19 (2016/04/20) +*** Fixes +- Fix =dired-x= autoload (thanks to darkfeline) +- Fix ~SPC f y~ in =dired= buffers (thanks to dcluna) +- Fix ~C-i~ key binding for =evil-jump-forward=. +- Fix ~SPC q r~ to restart Emacs and restore Spacemacs layouts. +- Fix go to next/previous error when a compilation buffer is opened + (thanks to dennishamester) +- Fix error when opening =spacemacs-helm= with unknown org documentation + files (thanks to kuangdash) +- Fix wrong states when exiting =evil-lisp-state= and =evil-iedit-state= + while using the =emacs= editing style. +- Fix ASCII banners first line being overwritten by the version numbers +- Use MELPA version of =persp-mode=, the package may need to be deleted + manually from the =elpa= directory and a restart of Emacs may be + required. +- Discover layers before running dotfile tests when reloading the + configuration, prevents false negatives (thanks to TheBB) +- Remove duplicated configuration for =eldoc= (thanks to zilongshanren) +*** Layer changes +**** Clojure +- Fix usage of deprecated =cider-turn-on-eldoc-mode=, using =eldoc-mode= + instead (thanks to tekacs and sooheon) +**** Elm +- Fix text copy/paste +- Fix auto-completion +**** Javascript +- Improve detection of =tern= binary, if =tern= is not found a message + is displayed in the =*Messages*= buffer (thanks to nixmaniack) +**** Go +- Fix execution of tests with function names containing underscores + (thanks to jaffee) +**** Python +- Use MELPA version of =py-yapf= package (thanks to cpaulik) +- Fix =makefile= of =pylookup= (thanks to hemcsec) +- Disable =semantic-idle-summary= which obfuscates =anaconda= information + in the minibuffer (thanks to cpaulik) +**** Scala +- Fix =ensime-typecheck-current-file=, rename it to + =ensime-typecheck-current-buffer= +- Fix =scala-enable-eldoc-mode=, rename it to =scala-enable-eldoc= + (thanks to channingwalton) +**** Shell +- Fix error when attempting to delete the last shell window + (thanks to joelmccracken) +**** Tmux +- Fix loading of package (thanks to aaronjensen) +**** Vinegar +- Correct =dired= configuration (thanks to StreakyCobra) +*** Improvements +- Various documentation improvements (thanks to d12frosted, gilch, ksrb, + nixmaniack, StreakyCobra, TheBB, The-Compiler, xiaohanyu) +** 0.105.18 (2016/04/10) +- Revert hotfix for =Yasnippet=, the bug has been fixed upstream and is now + available in MELPA (thanks to TheBB) +- Remove obsolete package =evil-jumper= which is now part of =evil= + (thanks to justbur) +** 0.105.17 (2016/04/09) +- Hotfix for Yasnippet, using stable version until resolution of + https://github.com/capitaomorte/yasnippet/issues/673 +** 0.105.16 (2016/04/01) +- Add FAQ entry about HTTPS issues (thanks to TheBB) +- Add startup list to Zemacs home buffer. +** 0.105.15 (2016/04/01) +*** Improvements +- Emacs to THE MAX! Release of Zemacs! +*** Layer changes +**** Javascript +- New layer variable =javascript-disable-tern-port-files=, when non nil + tern port files are not created. Default value is nil. (thanks to mijoharas) +**** Swift +- Fix all =swift= major-mode key bindings (thanks to xinranmsn) +** 0.105.14 (2016/03/09) +*** Fixes +- Fix bad window index for =neotree= buffer (thanks to bmag) +- Fix error when using ~SPC p l~ right after Emacs started (thanks to bixuanzju) +*** Layer changes +**** Go +- Fix bug when there is no test suite when running tests + (thanks to bogdanteleaga) +**** React +- Fix broken =helm-imenu= (thanks to huaoguo) +*** Improvements +- Various documentation improvements (thanks to triklsbg) + +** 0.105.13 (2016/03/06) +*** Fixes +- Fix smooth-scroll toggling at startup (thanks to TheBB) +- Fix auto-completion toggle ~SPC t a~ (thanks to TheBB) +*** Layer changes +**** Clojure +- Fix function name =cider-pop-back= (thanks to mlachmih) +**** Scala +- Fix various function names: + - =ensime-refactor-diff-organize-imports= + - =ensime-refactor-diff-extract-method= + - =ensime-refactor-diff-rename= + - =ensime-refactor-diff-extract-local= + (thanks to TheBB) +*** Improvements +- Reformat =README.md= title section. +- Add a GitHub pull request template (thanks to robbyoconnor) +** 0.105.12 (2016/03/02) +*** Fixes +- Fix activation of package dependencies +- Fix =smooth-scrolling= error due to recent changes in package repository +*** Layer changes +**** Distribution +- New key binding ~SPC t v~ to toggle smooth scrolling. +**** C-C++ +- Add notes on related layers (thanks to magthe) +- Remove srefactor from static package list (thanks to magthe) +- Set paths for C headers from clang (thanks to magthe) +**** Evil-snipe +- Disable =evil-snipe= in =ranger= (thanks to TheBB) +**** Haskell +- Fix bad indentation when pasting text (thanks to robbyoconnor) +**** Markdown +- Add support for =rust= code blocks (thanks to panicbit) +**** Org +- Fix custom Spacemacs layout when =org-agenda-files= isn't a list. + The org-agenda-files variable can be the name of a directory or a file. + (thanks to jmiven) +**** Osx +- Fix =osx-use-options-as-meta= for Emacs 25 (thanks to d12frosted) +**** React +- make =evil-matchit= jump between html/jsx tags (thanks to tko) +**** Racket +- Add command prefix names for =racket-mode= key bindings + (thanks to rodrigosetti) +**** Scala +- Rename =ensime-refactor-inline-local= to =ensime-refactor-diff-inline-local= + (thanks to chessman) +**** Shell +- Fix reverse key bindings for comint-previous/next (thanks to olejorgenb)) +- Scope the aliases under =eshell= so they are not defined globally + (thanks to bling) +**** Themes megapack +- Add =railscasts-theme= (thanks to olsonjeffery) +*** Improvements +- Improve =toggle-maximize-centered-buffer= (thanks to justbur) +- Add =display-graphic-p= to ~SPC h d s~ (thanks to TheBB) +- Various documentation improvements (thanks to d12frosted, davbo, marcopaga, + microamp, nixmaniack, NJBS, SShrike, TheBB, Tinche, triklsbg, xfq) +** 0.105.11 (2016/02/18) +Improve loading robustness: +- When an ELPA repository is down Spacemacs will now be able to finish loading +- Spacemacs will use the default theme (i.e. no theme) if there is any error + during the download of the starting theme. +** 0.105.10 (2016/02/18) +*** Fixes +- Fix re-toggle of fullscreen when pressing ~SPC f e R~ (thanks to MadAnd) +- Fix display of recent bookmarks without filename (thanks to lislon) +- Fix =toggle-maximize-buffer= (thanks to justbur) +- Remove files from rollback slot list (thanks to microamp) +- Don't catch errors while loading if =--debug-init= is provided. +- Don't change scratch major mode if buffer exists (thanks to TheBB) +- Restore windows layout when quitting =ediff= (thanks to fbergroth) +- Ensure that =pcache-directory= ends in a slash (thanks to rpglover64) +- Ensure new Spacemacs layouts only shows home buffer (thanks to bmag) +*** Improvements +- Add a bug report template for GitHub issues on ~SPC h I~ + (thanks to StreakyCobra) +- Add files used by =eww= to =.gitignore= (thanks to ahyatt) +- Various enhancements for themes handling (thanks to TheBB) +- Allow =default= theme (no theme) to be defined in =dotspacemacs-themes= + (thanks to izahn) +- Add support for missing =base16= themes (thanks to curtmack) +- Update recent files list when a file is renamed (thanks to lislon) +- Improve frame-fullscreen and maximize-frame toggles (thanks to MadAnd) +- Diminish relative line numbers lighter in mode-line (thanks to peterhoeg) +- Various documentation improvements (thanks to balajisivaraman, crododile, + darkfeline, ernestas, franciscoj, j4, kRITZCREEK, nixmaniack, numkem, + robbyoconnor, TheBB, tonylotts) +*** Layer changes +**** Auto-completion +- Better choice of =company= front-ends (thanks to fbergroth) +**** C-C++ +- Get =clang= args even if =flycheck= isn't installed (thanks to TheBB) +**** Clojure +- Fix renamed =cider-test-run-tests= function (thanks to AlejandroCatalina) +- Substitute =align-cljlet= with =clojure-align=. =align-cljlet= was deprecated + in favour of the vertical alignment in the clojure-mode package (thanks to + vise890) +**** Elm +- Fix =flycheck= not working on sub-directories (thanks to AlejandroCatalina) +**** ERC +- Fix initialisation of =erc-terminal-notifier= (thanks to Andre0991) +**** Gnus +- Remove =gnus-fetch-old-headers= customization which was causing slowdown + while consulting some newsgroups (thanks to StreakyCobra) +**** Haskell +- Fix broken =hoogle-lookup-from-local= (thanks to jb55) +**** Html +- Remove =.jsx= from =web-mode= auto mode alist (thanks to lunaryorn) +**** Org +- Remove ~H~ and ~L~ key bindings from =evil-org= (thanks to choppsv1) +**** Python +- Add missing =py-yapf= configuration (thanks to TheBB) +- Enable =anaconda-eldoc-mode= (thanks to TheBB) +- Only load =pyenv= if it is installed (thanks to cpaulik) +**** Racket +- Disable =company-quickhelp-mode= only when it is already enabled + (thanks to syohex) +**** React +- Disable auto-quote of attributes (thanks to TheBB) +- Fix react magic mode, it will now recognize =/** @jsx React.DOM */= in the + first line of a file (thanks to EMayej) +**** Ruby +- Use =popwin= for =rspec= compilations (thanks to joshcass) +- Do not force =rspec-mode= on ruby files (thanks to morhekil) +**** Rust +- Fix indentation setting for =evil-shift-width= (thanks to Stebalien) +**** Shell +- Set the correct shell-pop size variable (thanks to TheBB) +**** Themes-megapack +- Add =dracula= theme (thanks to MarkRedeman) +- Add =omtose-phellack= theme (thanks to duien) +- Add =majapahit= theme (thanks to kostajh) +**** Tmux +- Fix key bindings ~C-h~, ~C-j~, ~C-k~ and ~C-l~ (thanks to justbur) +**** Vagrant +- New key binding ~SPC V R~ to reload to restart VMs (thanks to kostajh) +**** Version control +- Fix bugs due to wrong mode for =diff-hl= margin (thanks to abaw) +- Fix =git-gutter= linum setup (thanks to person808) +**** Wakatime +- Fix wakatime-dashboard url (thanks to hallfox) +** 0.105.9 (2016/01/17) +*** Improvements +- Fix error on Microsoft Windows 10 OS regarding missing =printf= command + (don't call =exec-path-from-shell= function on Microsoft Windows) + (thanks to syohex) +- New key bindings ~C-e~ and ~C-y~ in evilified buffers to scroll lines + (thanks to CestDiego) +- Remove key binding hack for =evil-jumper= since the issue has been fixed + upstream (thanks to justbur) +- Remove unused =init-dired+= function (thanks to AlejandroCatalina) +- Various documentation improvements (thanks to balajisivaraman, jcppython, + jmiven, jorisE) +*** New conventions +- =use-package= code guidelines +- Key bindings documentation only need to mention ~SPC~ prefix +*** Layer changes +**** Markdown +- Add syntax highlighting for =R= code blocks (thanks to rustyplanet) +**** Org +- Fix early creation of empty =org= directory (thanks to tboby) +- Add default key binding ~C-c c~ for =org-capture= + (thanks to AlejandroCatalina) +**** Spacemacs +- Add =bracketed-paste= package to improve pasted text in terminals + (thanks to AlejandroCatalina) +** 0.105.8 (2016/01/12) +*** Fixes +- Fix the red mode-line when error occurs during loading +- Fix and improve layer templates and layer creation (thanks to chrisbarrett) +- Fix and simplify copyrights in file headers +- Fix =.gitignore= pattern for =private= directory (thanks to jballanc) +*** Improvements +- New key binding ~SPC h d l~ to describe the last key pressed, useful + when reporting a bug (thanks to StreakyCobra) +- Sort alphabetically the list of package to be update on the home buffer +- Improve =describe-system-info= function with completion engine info + (ivy completion engine will be available in 0.106) (thanks to StreakyCobra) +- Add link to =BountySource= page to =README.md= (thanks to houli) +- Move =request= storage folder to =.cache= directory +*** Layer changes +**** Markdown +- Add support for javascript code blocks syntax highlighting + (thanks to AlejandroCatalina) +** 0.105.7 (2016/01/11) +*** Fixes +- Fix missing ~q~ key binding in the home buffer introduced in =0.105.5= + (thanks to justbur) +**** ERC and RCIRC layers +- Properly add all opened buffers to custom layouts + (thanks to AlejandroCatalina) +**** Go layer +- Prevent from clobbering environment variables if already set (thanks to whilp) +**** Haskell +- Remove reference to undefined function =haskell-cabal-hook= + (thanks to chrisbarrett) +**** Python layer +- Fix errors when reading =.python-version= files (thanks to fbergroth) +*** Dotfile changes +- New variable =dotspacemacs-scratch-mode= to configure the default major-mode + for the scratch buffer, default value is =text-mode= (thanks to TheBB) +*** Improvements +- Display a list of packages to update when pressing the =[Update packages]= + in the home buffer +- Add highlight of TODOs in text mode files (thanks to StreakyCobra) +- Various documentation improvements (thanks to StreakyCobra, TheBB) +** 0.105.6 (2016/01/09) +*** Fixes +- Fix shadowed ~TAB~ (~C-i~) key in terminal (thanks to StreakyCobra) +** 0.105.5 (2016/01/08) +*** Fixes +**** Core +- Fix unavailable major mode leader keys in =evilified= buffers + (thanks to justbur) +- Fix ~b~ key binding on home buffer (thanks to justbur) +*** Layer changes +**** Spacemacs +- Bind =evil-jumper/forward= to == to make it work when + =dotspacemacs-distinguish-gui-tab= is non nil (thanks to TheBB) +**** Auto-completion +- Add =~/.spacemacs.d/snippets= directory to the snippet sources of + yasnippet. +- Don't enter =evil-insert-state= after =aya-expand= when =holy-mode= if active + (thanks to abaw) +** 0.105.4 (2016/01/07) +*** Fixes +**** Core +- Fix home buffer obfuscating opened file when Emacs starts (thanks to justbur) +**** Ruby layer +- Fix =rbenv= loading (thanks to TheBB) +**** Spacemacs layouts +- Fix jumping to last layout when the last layout is the default layout + (thanks to TheBB) +**** Yasnippet +- Fix and improve =yasnippet= loading (thanks to TheBB) +** 0.105.3 (2016/01/06) +*** Fixes +**** Emacs lisp layer +- Fix wrong hook for adding evil text objects (thanks to justbur) +**** Ledger +- Fix missing major mode key bindings (thanks to travisbhartwell) +**** Ocaml +- Fix smartparens configuration (thanks to edwintorok) +*** Layer changes +**** Spacemacs +- Improve robustness of =spacemacs/toggle-transparency= function + (thanks to justbur) +*** Other improvements +- Fix layer install section in all layers READMEs to be more explicit + and remove a source of confusion for new comers (thanks to mattbaker) +- Typos and documentation improvements (thanks to d12frosted) +** 0.105.2 (2016/01/05) +- Fix empty mode-line when a new Spacemacs version is available + (thanks to TheBB) +** 0.105.1 (2016/01/05) +*** Fixes +- Fix and improve support for GUI clients using a server started with + =emacs --daemon=: + - Fix font + - Fix graphical Spaceline separator + - Fix theme colors (most of them) + - Fix Spacemacs logo in home buffer + - Add support for graphical Nyan Cat +**** Spacemacs layer +- Fix broken =evil-escape-mode= when toggling =holy-mode= (emacs style) +**** Bépo layer +- Fix support for Magit (thanks to StreakyCobra) +**** Magit layer +- Fix ~TAB~ key bindings to expand/collapse sections (thanks to justbur) +**** Scala layer +- Fix a typo in function name =scala-auto-insert-asterisk-in-comments= + (thanks to lunaryorn) +*** Layer changes +**** Spacemacs +- New key binding ~SPC h n~ to browse the Emacs news (thanks to lunaryorn) +**** Themes megapack +- Add =monokai= theme (thanks to jonboiser) +*** Other improvements +- Typos and documentation improvements (thanks to mjs2600, person808, + robbyoconnor, StreakyCobra, TheBB and xfq) +** 0.105.0 (2016/01/04) +*** IMPORTANT - Breaking changes +- ~SPC l~ for =avy-goto-line= is now under ~SPC y~. ~SPC l~ is for + spacemacs layouts. +- ~SPC a p~ is now for =list-processes= and ~SPC a P~ for =proced=, + =paradox= is now on ~SPC a k~. +- ~SPC s l~ is now used to bring back last search buffer and ~SPC s j~ + is for jumping into a file using =imenu=. +- In home buffer, jumping to bookmark list is now on ~b~. +- Projectile: caching is now disabled by default, while it should not + break anything if you have some functions relying on caching being + enabled be sure to activate it explicitly in your dotfile with + =(setq projectile-enable-caching t)=. +- Git: new key bindings scheme using =evil-magit= package. If you want + to continue to use the old evilified bindings add =evil-magit= package + to the =dotspacemacs-excluded-packages= variable of your dotfile. +- Ruby: the default major mode is now the Emacs built-in =ruby-mode=. + If you want to continue to use =enh-ruby-mode= set the layer variable + =ruby-enable-enh-ruby-mode= to =t=. +*** Hot new features +- Spacemacs layouts under ~SPC l~ with =eyebrowse= integration + (thanks to CestDiego, bmag and TheBB) +- Revamped Magit key bindings thanks to =evil-magit= which provides + a faithful port of Magit UX using Vim key bindings (thanks to justbur) +- Brand new website on =spacemacs.org= with =readthedocs= documentation pages + (thanks to bobbyangelov, nashamri and TheBB) +- New command line parameters for =emacs=: + - =--timed-requires=, =--profile= and =--adv-timers [n]= to profile and + benchmark Emacs initialization (thanks to justbur) + - =--insecure= to disable https when fetching ELPA packages. + - =--debug-init= (built-in Emacs parameter) now enable Spacemacs verbose + messages when Emacs is loading. +*** Other important notes +- All =extensions= directories have been renamed to =local=. =extensions= + directories will be deprecated in 0.106.0. +- The =evil-leader= functions =evil-leader/set-key= and + =evil-leader/set-key-for-mode= are now obsolete and will be deprecated + in a future version. +*** New conventions +- Commit and abort commands conventions: + - ~SPC m ​,​~ and ~SPC m c~ to Valid/Confirm + - ~SPC m a~ and ~SPC m k~ to Abort/Discard + (thanks to StreakyCobra) +- Update evilified state rebinding conventions: + ~SPC~ to ~​'​~, ~/~ to ~\~ and ~:~ to ~|~ +*** New Layers +- bepo in =keyboard-layouts= (thanks to StreakyCobra) +- command-log in =tools= (thanks to bmag) +- elfeed in =tools= (thanks to d12frosted) +- evil-cleverparans (thanks to justbur) +- geolocation (thanks to Gogs) +- mu4e in =email= (thanks to darkfeline) +- octave in =lang= (thanks to izahn) +- selectric in =fun= (thanks to algernon) +- spacemacs-layouts (thanks to CestDiego) +- speed-reading (thanks to AdrieanKhisbe) +- swift in =lang= (thanks +- theming (thanks to TheBB) +- typography (thanks to lunaryorn) +- vimscript in =lang= (thanks to ralesi) +*** Dotfile changes +- New variable =dotspacemacs-elpa-https= if non nil use HTTPS otherwise + use HTTP. Default is t. +- New variable =dotspacemacs-elpa-timeout=, default is 5 seconds +- New variable =dotspacemacs-check-for-update= to toggle check for Spacemacs + updates at startup, default is =t= (thanks to tenthousandfailures) +- New variable =dotspacemacs-default-layout-name= to set the name of the + default Spacemacs layout. +- New variable =dotspacemacs-display-default-layout= to toggle display + of the name of the default layout in the mode-line, default is =nil=. +- New variable =dotspacemacs-auto-resume-layouts= to resume automatically + the last layout when Emacs starts. +- New variable =dotspacemacs-max-rollback-slots= to set the maximum number + of rollback slots to keep in the cache. +- New variable =dotspacemacs-line-numbers= to enable line numbers + globally, possible values are =relative=, =t= or =nil=. + Default is =nil= (thanks to StreakyCobra) +- New variable =dotspacemacs-distinguish-gui-tab=, if non nil then ~TAB~ + and ~C-i~ are distinct using GUI Emacs, default is =nil= (thanks to justbur) +- New variable =dotspacemacs-startup-recent-list-size= to configure the + number of recent files to display in the home buffer (thanks to bmag) +- New variable =dotspacemacs-whitespace-cleanup= to enable automatic + cleanup of whitespace on save. Possible values are =all=, =trailing=, + =changed= or =nil=. Default is =changed= (thanks to nixmaniack) +- Remove =dotspacemacs-verbose-loading=, it is now enabled automatically + with the command line parameter =--debug-init= +*** Distribution layer changes +- New key binding ~SPC *~ to search for current selection or symbol under point + in the current project. ~SPC /~ is similar but does not auto-fill the search + pattern. This new behavior mimics ~*~ and ~/~ keys of Vim + (thanks to StreakyCobra) +- New key binding ~SPC h d F~ to describe a face, by default the face under + point is selected (thanks to TheBB) +- New key binding ~SPC h k~ to display the top level of key bindings + (thanks to justbur) +- New key binding ~SPC h d K~ to describe a keymap (thanks to justbur) +- New key binding ~SPC h SPC~ for =helm-spacemacs= (~SPC f e h~ is still + available) (thanks to StreakyCobra) +- New key binding ~SPC f E~ to edit a file with =sudo= (thanks to cpaulik) +- New key binding ~SPC q r~ to restart Emacs (thanks to nixmaniack) +- New key binding ~SPC c q~ to close compilation window (thanks to joehillen) +- New key binding ~SPC c k~ to kill current compilation (thanks to jb55) +- New key binding ~SPC x o~ to open URLs with =avy= (thanks to StreakyCobra) +- New key binding ~backtab~ to go up a directory in =helm= (thanks to justbur) +- New key binding ~SPC b s~ to switch to =*sratch*= buffer (thanks to StreakyCobra) +- New key bindings in =help-mode= buffers to navigate links: + - ~g b~ or ~[~ to go back (same as clicking on =[back]= button) + - ~g f~ or ~]~ to go forward (same as clicking on =[forward]= button) + - ~g h~ to go to help for symbol under point + (thanks to AdrieanKhisbe) +- New key bindings under ~SPC i l~ to insert lorem ipsum text to a buffer + (thanks to lunaryorn) +- New key bindings for local and directory variables: + - ~SPC f v d~ to add a directory variable, + - ~SPC f v f~ to add a local variable to the current file, + - and ~SPC f v p~ to add a local variable to the first line of the current file + (thanks to lunaryorn) +- New key bindings ~C-q~ in helm buffers to jump to a candidate using =avy= + (thanks to ralesi) +- Bind ~g~ and ~G~ in helm micro-state (thanks to dsdshcym) +- ~TAB~ now correctly jump between links in help buffers with motion state + (thanks to justbur) +- ~SPC t n~ now toggle line numbers locally instead of globally + (thanks to StreakyCobra) +- ~SPC a p~ is now for =list-processes= (thanks to calebmeyer) +- ~SPC f J~ now open junk file using =helm= (thanks to nixmaniack) +- Move toggle for =vi-tilde-fringe= to ~SPC T ~~ +- Move =paradox= to ~SPC a k~ (thanks to calebmeyer) +- Move =proced= to ~SPC a P~ (thanks to calebmeyer) +- Add =space-line= package which replaces the =powerline= package + (thanks to TheBB) +- Add =help-fns+= package (thanks to justbur) +- Add =helm-flx= package (thanks to TheBB) +- Add =hl-todo= package (thanks to StreakyCobra) +- Add =lorem-ipsum= package (thanks to StreakyCobra) +- Add automatic setup of =evil-shift-width= based on the current mode settings + (thanks to TheBB) +- Add Evil text objects =slash= (/), =underscore= (_), =hyphen= (-), + =tilde= (~) and =equal= (=) (thanks to TheBB) +- Add custom helm mode-line (thanks to TheBB) +- Add custom info+ mode-line (thanks to TheBB) +- Add =bug-reference-prog-mode= to =prog-mode-hook= (thanks to lunaryorn) +- Add the ability to search with =ag=, =pt= etc... when pressing ~C-s~ in + =helm-projectile-switch-project= (~SPC p p~) (thanks to TheBB) +- Add case insensitive alphabetical sort of =which-key= buffers +- Add ~gg~ and ~G~ support in =neotree= buffers (thanks to synic) +- Set =compilation-scroll-output= to =first-error= (thanks to joehillen) +- Fix =helm= micro-state bug with numerical prefix arguments (thanks to TheBB) +- Fix =helm= freezes when using mouse to click and drag in the results list + (thanks to TheBB) +- Fix =helm-do-grep-preselect-candidate= void variable error (thanks to TheBB) +- Fix =linum-relative-mode= toggle being called twice the first time it is used + (thanks to justbur) +- Fix ~SPC j k~ unwanted auto-comment (thanks to driftcrow) +- Fix =spacemacs/write-file= being repeatable with ~.~ (thanks to StreakyCobra) +- Fix =debug-on-error= toggle (thanks to lunaryorn) +- Fix =recentf-exclude= to be customizable (thanks to duerrp) +- Fix =spacemacs/kill-other-buffers= (thanks to TheBB) +- Fix reversed mode-line toggle (thanks to TheBB) +- Fix =ahs-edit-mode= function which requires an argument (thanks to hanmoi-choi) +- Fix =spacemacs/sudo-edit= to make it work on remote ssh buffers with + multi-hops (thanks to dcluna) +- Fix transparency toggle (thanks to justbur) +- Fix toggle for =truncate-lines= (thanks to driftcrow) +- Fix visible cursor in =helm= buffers +- Enable built-in Emacs lock files by setting =create-lockfiles= to =t= + (thanks to xfq) +- Greatly simplify =holy-mode= by disabling =evil-mode= (thanks to justbur) +- Standardise zoom key bindings: ~+~ and ~=~ zoom in, ~-~ zoom out and ~0~ + reset the zoom level (thanks to StreakyCobra) +- Evilify package menu (thanks to nixmaniack) +- Evilify Neotree buffer (thanks to bmag) +- Set =dired-dwim-target= to =t= to make =dired= to guess a default target + directory (thanks to StreakyCobra) +- Set =helm-org-format-outline-path= to =t= by default (thanks to TheBB) +- Increase number of stored recent files to 1000 (thanks to duerrp) +- Allow evil operators to show commands in =which-key= (thanks to justbur) +- Allow =last-search-buffer= to resume last search even if no saved search + (thanks to nixmaniack) +- Improve =count-words-analysis= output (thanks to StreakyCobra) +- Switch between columns layout now correctly toggle golden-ratio + (thanks to geksilla) +- Do not kill the Emacs server when killing frame (thanks to drewkett) +- Do not change =custom-file= value if already set (thanks to lunaryorn) +- Use =evil-indent-plus= package to replace =evil-indent-textobject= + (thanks to TheBB) +- Use built-in evil variable =evil-want-Y-yank-to-eol= to set Y behavior + (thanks to person808) +- Use built-in =evil-set-initial-state= function to set the default evil + states (thanks to justbur) +- Use =tab-width= instead of obsolete =default-tab-width= (thanks to lunaryorn) +- Remove obsolete =evil-jumper-file= (thanks to TheBB) +- Remove key binding for deprecated =rxt-fontify-regexp-at-point= + (thanks to mineo) +- Remove custom =write-file= function and use built-in =save-buffer= function + instead (thanks to cpaulik) +- Disable projectile caching by default (thanks to cpaulik) +- Disable version control integration of =Neotree= by setting + =neo-vc-integration= to =nil= (thanks to synic) +- Make google translate language code case-insensitive (thanks to lislon) +**** Helm-spacemacs +- Add =add to dotfile= action on a layer (thanks to CestDiego) +- Add action to open =.org= files for editing (thanks to TheBB) +- Add FAQ source (thanks to StreakyCobra) +- Beautify sources (thanks to TheBB) +**** Evilified map +- Fix shadowed keys in minibuffer +- Fix bug where key bindings could be unexpectedly redefined + (thanks to darkfeline) +*** Layer changes +**** Auto-completion +- Add =helm-company= package available on ~C-/~ while company popup is active + (thanks to TheBB) +- Fix =yas-snippet-dirs= setup (thanks to TheBB) +- Fix =yasnippet= expand to select first snippet automatically + (thanks to TheBB) +- Make =auto-yasnippet= points to private directory by default + (thanks to taiansu) +**** Better defaults +- Fix =spacemacs/backward-kill-word-or-region= with rectangular selection + (thanks to bmag) +**** C/C++ +- Fix flycheck clang args loading (thanks to zhengyangfeng00) +**** Chinese +- Add =fcitx= support (thanks to zilongshanren) +- Add pinyin support for =avy-goto-char= (thanks to CodeFalling) +**** Clojure +- New key binding ~SPC m s I~ for =cider-jack-in-clojurescript= + (thanks to benalbrecht) +- New refactoring key bindings: ~SPC mred~ for =cljr-extract-def=, + ~SPC mrfu~ for =cljr-find-usages= and ~SPC mrsc~ for =cljr-show-changelog= + (thanks to mbertheau) +- Use =cljr--all-helpers= for automatic setup of refactoring key bindings + (thanks to grammati) +**** Dash +- Enable =zeal= on =Microsoft Windows= (thanks to dotneter-) +**** Elixir +- New key binding ~SPC m s c~ to compile the current buffer in the IEx process + (thanks to timbuchwaldt) +- New key binding ~SPC m s m~ to reload the module in the current buffer in + your IEx process (thanks to timbuchwaldt) +- New key binding ~SPC m t r~ to rerun the last test (thanks to djm) +- Bind ~q~ to =quit-window=in various elixir modes (thanks to utkarshkukreti) +- Enable =company-mode= in =alchemist-iex-mode= (thanks to utkarshkukreti) +- Fix =ruby-end= hook removal (thanks to TheBB) +**** Elm +- Fix incorrect command for =elm-repl-load= (thanks to holguinj) +- Fix key bindings for REPL commands updated upstream (thanks to tcallan) +**** Emacs lisp +- Add =auto-compile= package (thanks to justbur) +- New key bindings for compilation: + ~SPC m c c~ to byte compile the current file, + ~SPC m c l~ to popup compile-log buffer + (thanks to justbur) +- Add ~q~ to exit =macrostep= (thanks to ralesi) +**** Erc +- Fix notification icon (thanks to aminb) +- Fix erroneous micro-state key binding (thanks to StreakyCobra) +**** Ess +- Simplify the configuration of ESS minor modes (thanks to izahn) +- ~SPC m s i~ now automatically start the correct REPL for the current + buffer (thanks to izahn) +- Fix company activation (thanks to michelk) +**** Evil-snipe +- Update =evil-snipe= mode names (thanks to person808) +**** Eyebrowse +- Add ~h~ and ~l~ bindings to eyebrowse micro-state (thanks to TheBB) +- Fix workspace numbers, the first workspace now starts at 1 instead of 0 + (thanks to d12frosted) +- Fix call to =eyebrowse-rename= (thanks to TheBB) +**** Games +- Add =Pacmacs= game (thanks to CestDiego) +**** Git +- New key binding scheme using =evil-magit= package (thanks to justbur) +- New key binding ~SPC g i~ for =magit-init= (thanks to CestDiego) +- New key binding ~SPC g c~ for =magit-checkout= (thanks to PierreR) +- New key bindings ~SPC m ​,​~ and ~SPC m c~ to Valid/Confirm =with-editor= + buffers (thanks to justbur) +- New key bindings ~SPC m a~ and ~SPC m k~ to Abort/Discard =with-editor= + buffers (thanks to justbur) +- Add =gr= and =gR= bindings to refresh in evilified Magit buffers +- Add support for links to Magit buffer in =org= buffers + (thanks to mskorzhinskiy) +- Enable gravatars +- Redefine key bindings to user Magit popups whenever it is possible + (thanks to ralesi) +- Store =magit= gravatars in cache directory (thanks to CestDiego) +- =git-timemachine= and =git-blame= micro-states are now idempotent when + invoked. So these micro-states can be invoked again without side effects. +- Move =magit-gh-pulls= bindings from ~#g~ to ~#~ +- =magit-git-flow= prefix binding is now ~%~ instead of ~#f~ + (thanks to nixmaniack) +- Fix =git-magit-status-fullscreen= (thanks to bmag) +- Fix various bugs with evilification of maps +- Add =gr= and =gR= bindings to refresh in evilified Magit buffers +- Deactivate =evil-snipe= mode which messes with =magit= buffer (thanks to + cpaulik) +**** Github +- New key binding ~SPC g c~ to clone and optionally fork repository + (thanks to cpaulik) +**** Go +- New key binding ~SPC m x x~ to run =go run= for the current main package + (thanks to sectorzero) +- New key bindings for testing: + - ~SPC m t P~ to run =go test= for the current package and all packages under it | + - ~SPC m t t~ to run =go test= for the function you're currently in + and ~SPC m t s~ to run =go test= for the suite you're currently in + (thanks to bogdanteleaga) +- Import =GO15VENDOREXPERIMENT= from environment variables + (thanks to sectorzero) +**** Haskell +- New key binding ~SPC m h H~ to do a local (not using internet) Hoogle lookup + (thanks to jb55) +- New key binding ~SPC m g i~ to jump to imports (thanks to bennofs) +- New key bindings for =ghc-mod=: + - ~SPC m m t~ to insert template + - ~SPC m m u~ to insert template with holes + - ~SPC m m a~ to select one of possible cases + - ~SPC m m f~ to replace a hole + - ~SPC m m e~ to expand template haskell + - ~SPC m m n~ to go to next type hole + - ~SPC m m p~ to go to previous type hole + - ~SPC m m >~ to make indent deeper + - ~SPC m m <~ to make indent shallower + (thanks to Tritlo) +- Add REPL key bindings to =cabal-mode= (thanks to d12frosted) +- Add text alignment rules (thanks to PierreR) +- Fix ~SPC m s S~ key binding for switching back from REPL + (thanks to d12frosted) +- Fix typo in variable =haskell-interactive-popup-errors= (thanks to usharf) +- Fix ~SPC m h t~ and ~SPC m h i~ bindings (thanks to d12frosted) +- Fix ~SPC m s s~ according to conventions, i.e. does not switch to REPL + buffer (thanks to d12frosted) +- Fix missing key bindings when =ghc-mod= is disabled (thanks to d12frosted) +- Fix =ghci-ng= for stack projects (thanks to bjarkevad) +- Force =haskell-mode= loading in cabal files (thanks to d12frosted) +- Remove indentation guides to comply with latest haskell-mode + (thanks to PierreR) +- Remove =haskell-indentation-mode= hook (thanks to d12frosted) +**** Html +- Add =company-css= backend in =web-mode= (thanks to TheBB) +- Enable Emmet tab expansion in hybrid mode (thanks to geo7) +- Expand to className when using Emmet, for =instance div.react-class= + expands to =
= (thanks to CestDegio) +- Mark =css-indent-offset= as safe local variable (thanks to lunaryorn) +- Fix =smartparens= loading (thanks to TheBB) +- Fix erroneous micro-state key binding (thanks to StreakyCobra) +**** Idris +- Use popwin and motion state for special buffers (thanks to holguinj) +**** Javascript +- Add evil-matchit support for js files (thanks to robbyoconnor) +**** LaTeX +- New layer variable =latex-enable-folding= to enable text folding, default + value is =nil= (thanks to justbur) +- New key bindings ~SPC m ​,​~ and ~SPC m k~ for ~C-c C-c~ and ~C-c C-k~ + respectively (thanks to justbur) +- New key bindings: + - ~SPC m .~ to mark LaTeX environment + - ~SPC m *~ to mark LaTeX section + - ~SPC m k~ to kill TeX job + - ~SPC m l~ to recenter output buffer + - ~SPC m m~ to insert LaTeX macro + - ~SPC m s~ to insert LaTeX section + - ~SPC m v~ to view output + (thanks to justbur) +- New folding key bindings (available if =latex-enable-folding= is non nil): + - ~SPC m z b~ to fold TeX buffer + - ~SPC m z e~ to fold TeX environment + - ~SPC m z m~ to fold TeX macro + - ~SPC m z =~ to fold TeX math + - ~SPC m z r~ to fold TeX region + (thanks to justbur) +- New =TeX-font= key bindings: + - ~SPC m x c~ to make font monospaced (for code) + - ~SPC m x e~ to make font emphasised + - ~SPC m x i~ to make font italic + - ~SPC m x o~ to make font oblique + - ~SPC m x r~ to remove font properties + - ~SPC m x f a~ to use calligraphic font + - ~SPC m x f c~ to use small-caps font + - ~SPC m x f f~ to use sans serif font + - ~SPC m x f n~ to use normal font + - ~SPC m x f r~ to use serif font + - ~SPC m x f u~ to use upright font + (thanks to TheBB) +- New key binding ~SPC m -~ to open output buffer (thanks to benquebec) +- Configure =latexmk= as the default build command (thanks to izahn) +- Disable =typo= (thanks to TheBB) +- Fix enabling of minor modes =TeX-source-correlate-mode= and =TeX-PDF-mode= + (thanks to justbur) +**** Markdown +- New key binding ~SPC m x C~ to insert github flavored code block + (thanks to lunaryorn) +- Include missing =gh-md= package (thanks to tko) +**** Nim +- Use MELPA version of =flycheck-nim= package (thanks to Gonzih) +- Remove package =company-nim= which is now part of =nim-mode= + (thanks to robbyoconnor) +**** Ocaml +- Fix error when initializing =opam= (thanks to TheBB) +- Make OCaml generated files invisible to completion (thanks to StreakyCobra) +**** Org +- New key bindings: + - ~SPC m ~ for =org-ctrl-c-ctrl-c= + - ~SPC m *~ for =org-ctrl-c-star= + - ~SPC m RET~ for =org-ctrl-c-ret= + - ~SPC m -~ for =org-ctrl-c-minus= + - ~SPC m ^~ for =org-sort= + - ~SPC m /~ for =org-sparse-tree= + (thanks to TheBB) +- New key binding ~SPC m P~ for =org-set-property= (thanks to swaroopch) +- New key binding ~SPC m !~ for =org-time-stamp-inactive= + (thanks to channingwalton) +- New key binding ~SPC m D~ to insert drawer (thanks to cpaulik) +- Add drawer =evil-surround= pair (thanks to TheBB) +- Use ~SPC a o~ as prefix for org related applications like =org-agenda= + or =org-capture=. The ~a~ is for =application=, and ~o~ for =org= + (thanks to StreakyCobra) +- Use ~RET~ in normal state for follow links (thanks to justbur) +- Enable =flyspell= by default (thanks to robbyoconnor) +- Move =evil-org= to a local package (thanks to TheBB) +- Move =.org-id-locations= to cache directory (thanks to fandag) +**** Osx +- Fix search for =GNU ls= (thanks to lunaryorn) +- Use =osx-trash= package to handle deleted items (thanks to lunaryorn) +- Make =mdfind= the default backend for =helm-locate= (thanks to Andre0991) +- Set font =Apple Color Emoji= for emojis (thanks to myrjola) +**** Puppet +- Remove deprecated =puppetfile-mode= package (thanks to joehillen) +**** Purescript +- Add =psc-ide= support (thanks to kRITZCREEK) +**** Python +- New layer variable =python-auto-set-local-pyenv-version= to automatically + set =pyenv= version from a =.python-version= file. Possible values are + =on-visit=, =on-project-switch= or =nil=, default is =on-visit= + (thanks to fbergroth) +- Various fixes to =pylookup= to make it work again (thanks to TheBB) +- Allow user to customize fill column with the variable =python-fill-column= + (thanks to swaroopch) +- Fix =pylookup= makefile for python version 2.7.10 (thanks to hyh) +**** React +- Fix =flycheck= setup, do not disable =jshint= globally, + but only for =react= mode (thanks to lunaryorn) +- Enable =js-mode= snippet (thanks to rhalukongor) +- Open =index.android.js= and =index.ios.js= with react mode (thanks to erwan) +**** Ruby +- Enable built-in =ruby-mode= by default instead of =enh-ruby-mode= + (thanks to lunaryorn) +- New layer variable =ruby-enable-enh-ruby-mode= to enable =enh-ruby-mode= + by default instead of =ruby-mode=. +- New layer variable =ruby-test-runner= to choose between =ruby-test= or + =rspec= +- Add support for =rspec= (thanks to alexgirdler and dcluna) +- Add support for =chruby= (thanks to bjeanes and Immortalin) +- Add =rubocop= package (thanks to dcluna) +- New =rubocop= key bindings: + - ~SPC m r r f~ to run RuboCop on the currently visited file + - ~SPC m r a D~ to autocorrect current directory + - ~SPC m r r F~ to run auto-correct on the currently visited file + - ~SPC m r a P~ to autocorrect current project + - ~SPC m r r d~ to prompt from a directory on which to run RuboCop + - ~SPC m r r D~ to prompt for a directory on which to run auto-correct + - ~SPC m r r p~ to run RuboCop on the entire project + - ~SPC m r r P~ to run auto-correct on the project +**** Ruby on rails +- Move ~SPC m r r :~ to ~SPC m r :~ +**** Rust +- New key binding ~SPC m c C~ to remove build artefacts with Cargo + (thanks to SShrike) +- New key binding ~SPC m g g~ to jump to definition (thanks to isphinx) +- Use =exec-path-from-shell-copy-env= to set =RUST_SRC_PATH= for Racer + (thanks to mahinshaw) +**** Scala +- New layer variable =scala-enable-eldoc= to explicitly turn on =el-doc=, + default value is =nil= (thanks to d1egoaz) +- New layer variable =scala-auto-insert-asterisk-in-comments= to automatically + insert asterisk in multi-line comments (thanks to lunaryorn) +- New key binding ~SPC m b b~ for =sbt-command= (thanks to lunaryorn) +- Enable Ensime’s =expand-region= integration (thanks to lunaryorn) +- Only disable =flycheck= Scala syntax checker in Ensime (thanks to lunaryorn) +- Fix test key bindings (thanks lunaryorn) +- Fix automatic trigger of completion when hitting ~.~ (thanks to d1egoaz)) +**** Scheme +- New key binding ~SPC m s s~ for scheme implementation selection + (thanks to troydm) +- New key bindings to evaluate code: + - ~SPC m e b~ to evaluate the whole buffer + - ~SPC m e e~ to evaluate last sexp + - ~SPC m e f~ to evaluate current function + - ~SPC m e l~ to evaluate line + - ~SPC m e r~ to evaluate region + (thanks to CestDiego) +**** Shell +- Add =xterm-color= package (thanks to CestDiego) +- New key bindings ~C-j~ and ~C-k~ to browse history in normal state + (thanks to mijoharas and TheBB) +- New key binding ~C-l~ in =eshell= to clear buffer (thanks to CestDiego) +- New key binding ~C-c C-z~ to stop jobs (thanks to darkfeline) +- Add support to open =zsh= common files with =sh-mode= (=.zsh=, =zlogin=, + =zlogout=, =zpreztorc=, =zprofile=, =zshenv=, =zshrc=) (thanks to jcf) +- Use login shell as term shell (thanks to lunaryorn) +- Automatically scroll the buffer on new output by setting variable + =comint-move-point-for-output= to =t=. +- Deactivate scroll margin for shell buffers (thanks to darkfeline) +- Protect prompt in =comint-mode= (thanks to CestDiego) +- Set =eshell-hist-ignoredups= to =t= (thanks to CestDiego) +- Typing =clear= in an =eshell= buffer will clear the buffer + (thanks to CestDiego) +- Fix SIGQUIT bug (thanks to darkfeline) +**** Spell-checking +- New layer variable =spell-checking-enable-by-default= to enable/disable + =flyspell= by default globally (thanks to TheBB) +- Move =auto-dictionary= from spacemacs layer to =spell-checking= + and activate it (thanks to StreakyCobra) +- Disable line numbers in shell buffers (thanks to CestDiego) +- Fix =flyspell-prog-mode= activation (thanks to lunaryorn) +**** Syntax-checking +- New layer variable =syntax-checking-enable-by-default= to enable/disable + =flycheck= by default globally (thanks to TheBB) +- Evilify =flycheck= error list (thanks to TheBB and bmag) +- Enable new global minor mode =flycheck-pos-tip-mode= (thanks to StreakyCobra) +- New key bindings ~SPC e s~ and ~SPC e S~ to select =flycheck= checker + executable (thanks to nashamri) +- Fix escaping in buffer name regexp (thanks to lunaryorn) +- Remove flycheck fringe's bullet underlines (thanks to StreakyCobra) +**** Themes-megapack +- Add =jbeans= theme (thanks to synic) +- Add =farmhouse= theme (thanks to CodeFalling) +- Add =badwolf= theme (thanks to fabianhjr) +**** Vagrant +- Fix obsolete =vagrant-tramp-enable= variable (thanks to joehillen) +**** Version-control +- New key bindings ~SPC T d~ and ~SPC T C-d~ to toggle diff margin in the fringe + (thanks to ralesi) +- New micro-state on ~SPC g .~ to stage, unstage, commit, show diff, + show hunks, etc... (thanks to ralesi) +- Add support for multiple gutter backends: =diff-hl=, =git-gutter= and + =git-gutter+= (thanks to ralesi) +**** Vinegar +- Fix evilified dired (thanks to TheBB) +**** Yaml +- Enable company +*** Website +- Initial version (thanks to bobbyangelov, nashamri and TheBB) +*** Core changes +- New command line parameters =--timed-requires= and =--profile= to debug + and benchmark Emacs initialization (thanks to justbur) +- New command line parameter =--insecure= to disable https +- Add path variable =spacemacs-assets-directory= (thanks to aminb) +- Add a check to make sure that the Spacemacs git repository is not dirty before + switching the Spacemacs versions (thanks to justbur) +- Add an error message when the minimal Emacs version is not met + (thanks Immortalin) +- Add =spacemacs/recompile-elpa= interactive function (thanks to justbur) +- Add =user-emacs-directory= in =async-start= (thanks to brabalan) +- Set =ad-redefinition-action= to =accept= +- Enable distinction between ~C-i~ and ~TAB~ (thanks to justbur) +- Move =evilified-state= library to local package of =spacemacs= layer +- Replace =evil-leader= package by =bind-map= package (thanks to justbur) +- Remove special handling of =spacemacs-theme= and =solarized-theme= + (thanks to TheBB) +- Remove bootstrap packages =dash= and =f= +- Improved travis Build relying on container and EVM (thanks AdrieanKhisbe) +- Improve installation speed of themes and bootstrap packages +- Keep focus while navigating =*help*= buffers (thanks to sooheon) +- Catch errors in executed dotfile functions and signal them to the user + (thanks to justbur) +- Show errors in =*Messages*= buffer when loading .spacemacs instead of + ignoring them (thanks to dcluna) +- Fix overwrite of clipboard at startup (thanks to StreakyCobra) +- Fix error when setting =dotspacemacs-major-mode-leader-key= to nil + (thanks to justbur) +- Fix some loading warnings (thanks to syohex) +- Fix theme cycling after ~SPC T h~ is used (thanks to nixmaniack) +- Fix various usage of obsolete functions (thanks to justbur) +- Fix various free variable references (thanks to justbur) +- Hide mode-line at startup +- Generate necessary HTML for the Spacemacs docs (used for the website) + (thanks to travisbhartwell) +**** Home buffer +- ~b~ now jumps to the bookmark list (thanks to kccai) +- Set Spacemacs home buffer as initial buffer for Emacs clients + (thanks to TheBB) +- Inject Emacs version along with Spacemacs version in home buffer + (thanks to ralesi) +- Add a =Spacemacs Update= button to the spacemacs buffer, and relabel the + package update button to read =Update Packages= (thanks to justbur) +- Show quick help menu when no =.spacemacs= file is found (thanks to person808) +- Do not start spacemacs buffer in motion state when editing style is =emacs= + (thanks to justbur) +- Factor out =spacemacs-buffer= creation (thanks to justbur) +- Move =spacemacs-mode= to =core-spacemacs-buffer.el= (thanks to justbur) +- Simplify =spacemacs-buffer/goto-link-line= (thanks to justbur) +**** Configuration layer +- Limit the number of rollback slots (thanks to elemakil) +- Add a timeout when fetching ELPA archives +- Allow explicit path for package location (thanks to TheBB) +- Fix =configuration-layer/package-usedp= for excluded packages +- Fix automatic deletion of bootstrap packages (thanks to TheBB) +- Fix creation of =README.org= file in =configuration-layer/create-layer= + (thanks to StreakyCobra) +- Add package keyword =:protected= +- Set configuration layer error flag when calling user dotfile functions +**** Micro-state +- =:exit= keyword now accepts a list +- Execute =:on-enter= before =:doc= in micro-state +*** Other fixes and improvements +- =README.md= introduction rewrite (thanks to purcell) +- New badge =Built with Spacemacs= (thanks to nashamri) +- Merge files =HOWTOs.org= in =FAQ.org= (thanks to StreakyCobra) +- Merge the =CONTRIBUTING.md= and =doc/CONTRIBUTE.org= files into a new + =CONTRIBUTING.org= file (thanks to StreakyCobra) +- Delete unneeded =.gitmodules= file (thanks to robbyoconnor) +- Add =cl-= prefix to =cl-lib= functions (thanks to coldnew, robbyoconnor) +- Replace =eval-after-load= with =with-eval-after-load= (thanks to person808) +- New Spacemacs screenshot in =README.md= (thanks to nashamri) +- New text banners of the Spacemacs logo (thanks to sshbio) +- Add prefix command names (thanks to grammati, jenanwise, davoclavo, tekerson, + d12frosted, CestDiego, lunaryorn, nixmaniack, AlexCharlton) +- Typos and documentation improvements (thanks to AdrieanKhisbe, bardec, + bebound, benquebec, bmag, bogdanteleaga, CarlQLange, CestDiego, CodeFalling, + com4, cpaulik, d12frosted, d1egoaz, dotneter-, dptd, dsdshcym, dvcrn, + eagleflo, ernestas, FlashYoshi, Immortalin, jrk, justbur, masukomi, + MaxWofford, mbertheau, mineo, mijoharas, mkollaro, nashamri, pbzdyl, + person808, robbyoconnor, scloudyy, shishkin, swaroopch, TheBB, Treri, + vijaykiran, xfq, xtian, ZachLiss) +*** Core team members +- Sylvain Benner (syl20bnr) +- Eivind Fonn (TheBB) +- Fabien Dubosson (StreakyCobra) +- Justin Burkett (justbur) +* Release 0.104.x +** 0.104.8 (2015/12/16) +*** Hotfix +- Revert removal of fancy battery mode-line indicator. +** 0.104.7 (2015/12/15) +*** Distribution layer changes +**** Spacemacs +- Remove fancy battery custom mode-line (moved to spaceline) (thanks to TheBB) +*** Layers changes +**** Eyebrowse +- Eyebrowse doesn't have a lighter anymore (thanks to myrjola) +**** Haskell +- Replace obsolete function =haskell-process-load-or-reload= (thanks to + joehillen) +- Fix renamed command =hindent-reformat-decl= (thanks to lunaryorn) +**** Syntax-checking +- Add support for =flycheck-pos-tip-mode= (thanks to StreakyCobra, TheBB and + lunaryorn) +** 0.104.6 (2015/11/27) +*** Hotfix +- Fix void variable error =smartparens-strict-mode= (thanks to TheBB) +** 0.104.5 (2015/11/22) +*** Distribution layer changes +**** Spacemacs +- Use version 7.1 of =evil-lisp-state=, the version 8 is supported + in version 105 of Spacemacs only. +** 0.104.4 (2015/11/04) +*** Layer changes +**** Scala +- Fix Ensime test commands to reflect the changes in the recent versions + of the package (thanks to lunaryorn) +**** Vagrant +- Replace obsolete function =vagrant-tramp-enable= by the function + =vagrant-tramp-add-method= (thanks to joehillen) +*** Core +- Prevent bootstrap packages from being automatically uninstalled + (thanks to TheBB) +** 0.104.3 (2015/11/01) +*** Layer changes +**** Evil-snipe +- Update =evil-snipe= minor mode name to match latest release of + the package (thanks to person808) +**** Haskell +- Remove indentation guides to comply with latest =haskell-mode= + (thanks to PierreR) +** 0.104.2 (2015/09/29) +*** Hotfixes +- Fix error =void-variable warning-minimum-level= on Emacs 24.3 + (thanks to syohex) +*** Layer changes +**** Markdown +- Fix ~SPC m c r~ binding (thanks to tko) +*** Core +- Silence =ad-handle-definition= about advised functions getting redefined +- Improve evilification rules, now ~:~ is rebound to ~|~, ~/~ is rebound to ~\~ + and ~SPC~ is rebound to ~​'​~ +*** Other fixes and improvements +- Add FAQ entry on the difference between available distributions (thanks to + robbyoconnor) +- Delete obsolete =.gitmodules= file (thanks to robbyoconnor) +- Improve convention documentation for evilified buffers +- Typos and documentation improvements (thanks to CarlQLange) +** 0.104.1 (2015/09/28) +*** Dotfile changes +- New variable =dotspacemacs-remap-Y-to-y$=, when non nil ~Y~ is remapped to + ~y$~. Default value is =t=. +*** Distribution layer changes +**** Spacemacs +- Add ~SPC t h a~ to toggle automatic highlighting of symbol under point. +*** Layer changes +**** React +- Force -jsx= content type (thanks to dvcrn) +*** Other fixes and improvements +- Typos and documentation improvements (thanks to k4rtik, robbyoconnor, tko, xfq) +** 0.104.0 (2015/09/28) +*** IMPORTANT - Breaking changes +- =org-plus-contrib= is now installed from org ELPA repository, you may + encounter strange behaviours from Org. In this case delete the =org= directory + in the =elpa= directory and restart Emacs. +- =Helm= key bindings have been slightly adjusted: + - in =helm-find-files= (~SPC f f~): now ~C-h~ move up a directory and ~C-l~ + enter the selected directory. =describe-key= command is available on ~C-S-h~ + - in other =helm= buffers ~C-h~ is used to go to the next source and ~C-l~ + is the same as ~RET~. =describe-key= command is also available on ~C-S-h~. +- ~Y~ has been remapped to ~y$~ +- The =bookmark= saved file has been moved to the =.cache= directory, if + you have a bookmark file =~/.emacs.d/bookmarks= then you'll have to move it + to =~/.emacs.d/.cache/bookmarks= +- =Ruby on Rails= framework has now its own layer called =ruby-on-rails=, + be sure to add this layer to your dotfile if you use RoR. +- =Django= framework has now its own layer called =django=, + be sure to add this layer to your dotfile if you use it. +- =guide-key= has been replaced by =which-key=, you may encounter issues + if you have some =guide-key= custom configuration, remove any =guide-key= + configuration and check the options offered by =which-key=. +*** Other important notes +- All layers have been moved to =layers= directory +- Category folder prefix has been changed to =+= (was =!=) +- =spacemacs= layer has been moved to the =layers= directory in the + category =+distribution= +- All =extensions= directories have been renamed to =local=. =extensions= + directories will be deprecated in 0.105.0. +- =tromey= ELPA repository has been removed (thanks to robbyoconnor) +*** Hot new features +- Enhanced layer package lists which merge old extension lists and package + lists. Keywords can be associated with packages. The supported keywords + are =:location=, =:step= and =:excluded=. + =extensions.el= files and =-excluded-packages= variables are now + optional and will be deprecated in the next version 0.105.0. +- New =distribution= concept: you can now choose between two distributions: + =spacemacs= or =spacemacs-base=. =spacemacs-base= contains only + a minimal set of packages whereas =spacemacs= is the full Spacemacs + experience. Set the distribution with =dotspacemacs-distribution= variable. +- Add support for =Quelpa= which allows to use =Melpa= recipes to install + packages directly from source (i.e. one can now install a package directly + from a Github repository). +- New editing style: =hybrid=. This style is similar to Vim style except that + all Emacs key bindings are available in hybrid (insert) state instead of Vim + key bindings. Also in this state, the buffers are evilified like in Vim style. +- The default theme of Spacemacs is now =spacemacs-dark=. The Spacemacs themes + (=spacemacs-dark= and =spacemacs-light=) become the official themes of + Spacemacs (thanks to nashamri) +- Recovery mode when there is an error in the user dotfile. Now even when your + dotfile cannot be loaded, Spacemacs will be operational with a minimal set + of packages available (thanks to cmccloud) +- Add support for dotdirectory =~/.spacemacs.d= which behaves like the Emacs + dotdirectory (i.e. =~/.spacemacs.d/init.el= is evaluated instead of + =~/.spacemacs= if the former exists and the latter does not) (thanks to + justbur) +- Guide-key is replaced by =which-key= which provides an enhanced and better + live key bindings browsing experience. (thanks to justbur) +- New API to manage the =powerline= mode-line. It is now possible to easily + define segments and arrange them (thanks to TheBB) +- New web gallery to browse themes in =themes-megapack=, URL: [[http://themegallery.robdor.com][theme gallery + ]] (thanks to robmerrell) +- New test framework supporting layer specific tests (thanks to TheBB) +- New interactive function =dotspacemacs/test-dotfile= testing the integrity + of the =.spacemacs= file. This function will detect any unknown layers and + bad dotspacemacs variable values (thanks to justbur) +*** New conventions +- Add spacing conventions for org files (thanks to person808) +- Move ~SPC m T x~ conventions for executing tests in debug to ~SPC m t X~ +- Add conventions for toggles which are under ~SPC t~, ~SPC T~ and ~SPC C-t~. + For major mode specific toggles only ~SPC m T~ is available. +- Add ~SPC m g b~ to go back to previous location after a ~SPC m g g~. +- Reserve ~SPC m o~ for users (thanks to TheBB) +*** New Layers +- asciidoc (thanks to hijarian) +- chinese (thanks to andyque) +- cscope (thanks to bmag) +- common-lisp (old slime layer renamed) (thanks to kingcons) +- django (split from python layer) +- elm (thanks to usharf) +- idris (thanks to zmthy) +- jabber (thanks to toshism) +- java (thanks to kleewho) +- nim (thanks to Gonzih) +- nixos (thanks to CestDiego) +- ranger (thanks to ralesi) +- sml (thanks to Devagamster) +- spell-checking (split from syntax-checking) (thanks to justbur) +- terraform (thanks to BrianHicks) +- react (thanks to axyz) +- ruby-on-rails (split from ruby layer) +- scheme (thanks to kingcons) +- vinegar (thanks to ralesi) +- unimpaired (thanks to ralesi) +- wakatime (thanks to CestDiego) +- yaml (split from ruby) +*** Dotfile changes +- New variable =dospacemacs-distribution= allowing to choose the default + packages installed by Spacemacs. +- New function =dotspacemacs/user-init=. Now =dotspacemacs/init= function + is reserved for dotspacemacs variable exclusively. +- New value =any= for =dotspacemacs-highlight-delimiters=, when set to + =any=, all the delimiters are highlighted via =rainbow-mode=. +- New variable =dotspacemacs-helm-resize=. If non nil then =helm= windows + will be automatically resized depending on the number of candidates (thanks + to ralesi) +- New variable =dotspacemacs-helm-no-header=. If non nil then the helm header + is hidden when there is only one source in the helm buffer (thanks to ralesi) +- New variable =dotspacemacs-helm-position= which can be =bottom=, =top=, + =left= or =right= (thanks to ralesi) +- Add new =:disabled-for= keyword for =dotspacemacs-configuration-layer= which + allow to deactivate a layer for a set of layers. For instance + =(auto-completion :disabled-for org git)= will disable auto completion for + both org and git layers. +- Rename function =dotspacemacs/config= to =dotspacemacs/user-config=. The + old function =dotspacemacs/config= will be deprecated in 0.105.0. +*** Distribution layer changes +**** Spacemacs-base +- New navigation key bindings for =helm-find-files= (~SPC f f~), now + ~C-h~ move up a directory and ~C-l~ enter the selected directory. + =describe-key= command is available on ~C-S-h~. +- In =helm= buffers ~C-h~ is used to go to the next source and ~C-l~ + is the same as ~RET~. =describe-key= command is available on ~C-S-h~. +- Add =copy file= key binding on ~SPC f c~ (thanks to cpaulik) +- Add transparency micro-state (thanks to person808) +- Add ~SPC i u~ key binding to insert unicode symbols with helm (thanks to + robbyoconnor) +- Add ~SPC x l s~ and ~SPC x l u~ to sort and uniquify lines in a buffer + (thanks to oppenlander) +- In buffer not visiting a file ~SPC f s~ now asks for a filename (thanks to + cpaulik) +- Add ~SPC f l~ to visit a file literally which means that the file will be + opened in =fundamental mode= (thanks to sooheon) +- Add support for automatic recompilation of =.el= files on save (thanks to + ralesi) +- Add ~SPC f C d~ and ~SPC f C u~ to quickly convert Unix encoding to DOS + encoding and vice versa (thanks to ralesi) +- New key bindings to toggle editing styles: ~SPC t E e~ to toggle =emacs= + style and ~SPC t E h~ to toggle =hybrid= style +- Add support for arrow keys in windows micro-state (thanks to mbertheau) +- Fix paste micro-state undo +- Fix ~SPC i K~ (insert empty line above point) which now works + as expected when used from the first line of a buffer (thanks to + travisbhartwell) +- Fix windows micro-state by using the minibuffer (thanks to person808) +- Fix broken alignment functions on ~SPC x a~ (thanks to justbur) +- Don't jump if only one match in =helm-imenu= (thanks to tuhdo) +- Remove =wS= from prefix list in =config.el= (thanks to justbur) +- Properly close frame when running a client from terminal (thanks to drewkett) +- Add chocolate color for the =replace= state (thanks to TheBB) +- Make ~Y~ equivalent to ~y$~ (thanks to person808) +- Sync =visual-line-mode= and =evil-visual-xxx= functions. Now ~SPC t L~ + correctly enables =visual-mode-line= _and_ change Evil to visual + navigation accordingly. Use ~SPC t l~ to disable truncated lines while + keeping default Evil behavior. +- Reduce autosave interval for evil-jumper (thanks to ralesi) +- Improve evil configuration for cursors and colors (thanks to justbur) +- Fix called function name for ~SPC h b~ binding. Helm removed + =helm-pp-bookmarks= in the latest update and replaced it with + =helm-filtered-bookmarks= (thanks to sgepigon) +- Add ~SPC f L~ for =helm-locate= (thanks to ralesi) +- Add text object ~g~ for entire buffer (thanks to ralesi) +- helm-spacemacs: load layers only once. +- helm-spacemacs: show description of toggle functions (thanks to person808) +**** Spacemacs +- New API for the powerline (thanks to TheBB) +- Add package =define-word= on ~SPC x w d~ (thanks to swaroopch) +- Set =projectile-indexing-method= to =alien=. This settings will use available + tooling to speed up the build of the cache, should greatly improve the + performance on Windows (provided you have the required tools) +- Fix =projectile-generic-command= on Windows using =find= (thanks to TheBB) +- Fix =neotree= bug with window number 0 (thanks to jaypei) +- Fix search direction consistency for =auto-highlight-symbol= micro-state + (thanks to herbertjones) +- Add VCS integration to =neotree= +- Focus current file when opening Neotree in project's root with ~SPC p t~ + (thanks to StreakyCobra) +- Set =sp-show-pair-delay= to 0.2 instead of 0. Should fix some slowness in +- Set =highlight-parentheses= delay to 0.2 +- Enable =highlight-parentheses= when =dotspacemacs-highlight-delimiters= is + set to =all= (thanks to tuhdo) +- Hide lighter for =highlight-parentheses= +- Better diminished lighters for =highlight-indentation-mode= (thanks to + robbyoconnor) +- Prevent iedit from adding global key binding (thanks to justbur) +- Temporarily exclude the package =hl-anything= waiting for an overlay bug + to be fixed +- Correctly enable =powerline= only if it is used (thanks to sooheon) +- Make =golden-ratio= work after avy-word-jump (thanks to synic) +- Exclude =helm= windows from =golden-ratio= (thanks to ralesi) +- Don't automatically select *compilation* buffer (thanks to jasminpatry) +- Define explicit functions to inverse comments for =evil-nerd-commenter= + (thanks to endrebak) +- Use TheBB fork of =evil-indent-textobject= which has working text objects + based on the indentations (thanks to TheBB) +- Exclude package =evil-terminal-cursor-changer= since it is buggy in some + terminals (thanks to TheBB) +*** Layer changes +**** Agda +- Move ~SPC m o~ to ~SPC m h~ since ~SPC m o~ is now reserved for users + (thanks to TheBB) +**** Auto-completion +- Add new layer variable =auto-completion-private-snippets-directory= which + allows to specify a custom private snippet directory (thanks to justbur) +- Improve yasnippet loading robustness (thanks to myrjola) +- Fix showing snippets in company popup (thanks to person808) +**** Better-defaults +- Add =backward-kill-word-or-region= on ~C-w~ (thanks to justbur) +**** C/C++ +- Fix key bindings for cscope (thanks to bmag) +- Add =disaster= package to disassemble c/c++ code on key binding ~SPC m D~ + (thanks to jb55) +- Fix error with =company-mode/more-than-prefix-guesser= (thanks to TheBB) +**** Chinese +- Remove "symbol" from list of changed charsets, this prevents minor mode + lighters from being displayed in the Chinese font (thanks to louy2) +**** Clojure +- Add cider error buffer to popwin (thanks to cmccloud) +- Add cider-doc buffer to popwin (thanks to cmccloud) +- Add key bindings for =ein:traceback-mode= (thanks to toshism) +- Add ~SPC m s x~ key binding for =cider-refresh= (thanks to sooheon) +- Stop using deprecated =cider-jump-to-var= and use =cider-find-var= + instead (thanks to lukbock) +- Add ~SPC m T i~ to toggle indentation style in =clojure-mode= + (thanks to lukbock) +- Add ~SPC m T p~ key binding to toggle pretty printing in the REPL + (thanks to luxbock) +- Add new key bindings to evilified buffer =cider-inspector-mode= + (thanks to luxbock) +- Add ~C-j~ and ~C-k~ for browsing history in the REPL (thanks to luxbock) +- Add more =clj-refactor= key bindings (thanks to luxbock) +- Add more key bindings to =cider-stacktrace-mode= (thanks to luxbock) +- Add interactive function =spacemacs/cider-toggle-repl-font-locking= to + toggle font-locking in the REPL (thanks to luxbock) +- Activate clojure-mode for *.boot files (thanks to usharf) +- Enable =fancify-symbols= for =clojurescript-mode=, =clojurec-mode= and + =clojurex-mode= (thanks to Xcix) +- Setup indentation rules for common clojure vars (thanks to jcf) +- Evilify =cider-test-report-mode= buffers (thanks to luxbock) +- Enable =clj-refactor= key bindings in the REPL (thanks to luxbock) +- Enable clojure key bindings in the REPL (thanks to luxbock) +- Fix bug in =spacemacs//cider-eval-in-repl-no-focus=: + - Move to point-max before inserting text + - Only indent the newly inserted form instead of the whole buffer. + (thanks to luxbock) +- Fix key bindings conflict in =cider-debug-mode= (thanks to luxbock) +- Rename old function =clfr-rename-file-or-dir= to new function + =cljr-rename-file= (thanks to luxbock) +- Remove ~SPC m d b~ =cider-debug-defun-at-point= in REPL (It doesn't do + anything other than messing up the buffer) (thanks to luxbock) +- Gives faster access to display the last error buffer with ~SPC m d e~ + (thanks to luxbock) +**** CSharp +- Set =omnisharp-auto-complete-want-documentation= to =nil= to work-around + a bug in standard Omnisharp server built in Release configuration. +- Add prefix command documentation (thanks to d12frosted) +**** Dash +- Add support for =zeal= on Linux and Windows (thanks to CestDiego) +**** Deft +- Replace deprecated =deft-extension= by new =deft-extensions= + (thanks to mclearc) +**** Elixir +- Remove flycheck due to a security issue in the Elixir compiler + (thanks to gilbertkennen) +- Add support for popwin for =mix= buffers (thanks to rhalukongor) +- Re-enable =magit-gitflow= since it is now compatible with Magit 2.1 + (thanks to gilbertkennen) +**** Emacs lisp +- Make =flycheck= aware of =loadpath= (thanks to CestDiego) +- Define =emacs-lisp-mode= key bindings for =lisp-interaction-mode= + (thanks to justbur) +- Fix ~SPC m e c~ to evaluate current form (thanks to justbur) +- Add ~SPC m e s~ to evaluate symbol under point (thanks to justbur) +**** ERC +- Add =ERC-SASL= for SASL authentication (thanks to CestDiego) +- Fix check for =dbus= availability on OS X (thanks to cmccloud) +**** ESS +- Change default value of =ess-enable-smart-equals= to nil (thanks to + izahn) +- Fix =company= back-end declaration (thanks to jcpetkovich) +**** Evil-commentary +- Add ~SPC ;~ for comment operator +**** Extra-lang +- Add =Stan= modeling language (thanks to alexanderrich) +**** Eyebrowse +- Add ~s~ for =switch-to-window-config= (thanks to rphillips) +- Add ~gt~ and ~gT~ key bindings to switch between workspaces + (thanks to joehillen) +**** Fsharp +- Allow fsharp-mode to determine build path (thanks to bsermons) +**** Git +- Make sure that git-commit is initialized so that Emacs can be used as + $GITEDITOR (thanks to thrnio) +- Remove some deprecated code (thanks to tko) +- Add documentation about =magit-push-always-verify= variable (thanks to + sooheon) +- Add ~escape~ key binding to =gitmessenger= (thanks to mijoharas) +- Add ~#f~ key binding in =magit-status= for =magit-gitflow-popup= (thanks to + gilbertkennen) +- Use =MELPA= version of =magit-gh-pulls= and fix its configuration (thanks to + cmccloud) +- Evilify =magit-hunk-section-map= (thanks to ralesi) +- Evilify =magit-stash-mode= (thanks to nixmaniack) +**** Github +- Properly evilify =gist-lists= buffer (thanks to cmccloud) +**** Gnus +- Move ~SPC m o~ to ~SPC m M~ since ~SPC m o~ is now reserved for users + (thanks to TheBB) +- Movw ~SPC m H~ to ~SPC m m~ (thanks to robbyoconnor) +**** Go +- Use exec-path-from-shell-copy-env to set =GOPATH= (thanks to jenanwise) +- Fix multiple paths support in =GOPATH= on Windows (thanks to galaxian) +- Move all oracle key bindings under ~SPC m o~ to ~SPC m r~ since ~SPC m o~ + is now reserved for users (thanks to TheBB) +- Adapt key bindings to conventions, ~SPC m b~ is now ~SPC m e~ and ~SPC m d~ + is now ~SPC m h~ (thanks to bogdanteleaga) +- Move ~SPC m r~ to ~SPC m r n~ which conflicted with oracle key bindings + (thanks to bogdanteleaga) +**** Gtags +- Fix eldoc configuration (thanks to thudo) +**** Haskell +- Make =ghc-mod= optional (thanks to michelk) +- Disable line highlighting when shm is enabled (thanks to d12frosted) +**** Html +- Add for CSS files ~SPC m z c~ and ~SPC m z o~ to contract and expand CSS + blocks (thanks to ralesi) +- Add ~SPC m g h~ (helm-css-scss) to =css-mode= (thanks to TheBB) +- Add support for =jade= files (thanks to robbyoconnor) +- Add flycheck for =slim= and =haml= modes (thanks to robbyoconnor) +- Add rainbow delimiters for =haml=, =jade= and =slim= modes + (thanks to robbyoconnor) +- Add =.eex= extension to =web-mode= (thanks to gilbertkennen) +- Add =.ejs= files to =web-mode= (thanks to robbyoconnor) +- Add =.twig= files to =web-mode= (thanks to axyz) +- Add =.asp= files to =web-mode= (thanks to TheBB) +- Add ~gj~ and ~gk~ key bindings to go to siblings elements in web micro-state + (thanks to TheBB) +- Enable =smartparens= in CSS like modes (thanks to TheBB) +- Fix extra space in declared pair <%= %> (thanks to dsdshcym) +- Fix ~r~ key bindings in web micro-state (thanks to CestDiego) +- Fix smartparens configuration (thanks to TheBB) +**** Ipython-notebook +- Move ~SPC m o~ and ~SPC m O~ to ~SPC m i~ and ~SPC m I~ since + ~SPC m o~ is now reserved for users (thanks to TheBB) +**** Java +- Diminish =eclim= minor mode lighter (thanks to Devagamster) +**** Javascript +- Add =json-snatcher= on ~SPC m h p~ (thanks to CestDiego) +**** Markdown +- Fix backticks and single quotes insertion (thanks to x-ji) +- Fix =smartparens= configuration (thanks to fintelkai) +- Move ~SPC m o~ to ~SPC m f~ since ~SPC m o~ is now reserved for users + (thanks to TheBB) +**** Org ++ Install =org-plus-contrib= from org ELPA repository ++ Add table related key bindings on =SPC m t= (thanks to JP-Ellis) ++ Add defer loading for =toc-org=. ++ Add =gnuplot= package to plot data from tables (thanks to JP-Ellis) ++ Add =org-mime= (moved from =gnus= layers) ++ Add new key bindings to move whole subtrees up/down/right/left with ~SPC m S~ + prefix (thanks to katshinka) ++ Add new key bindings to move between complex TODO sets with ~SPC m C-S~ + prefix (thanks to katshinka) ++ Add more cycling options for time-stamps, headlines, items, properties with + ~SPC m L~, ~SPC m K~, etc... (thanks to katshinka) ++ Add key bindings ~SPC m .~ to insert time-stamps (thanks to katshinka) ++ Set =toc-org-max-depth= to 10. ++ Move ~SPC m o~ to ~SPC m l~ since ~SPC m o~ is now reserved for users + (thanks to TheBB) ++ Ensure that =org-directory= exists on load (thanks to ralesi) ++ Fix ~SPC m l~ by calling =org-open-at-point= instead of =evil-org-open-links= + (thanks to TheBB) ++ Fix org-repo-todo loading (thanks to TheBB) +**** Osx +- Re-factor and expand support for trash can (thanks to usharf) +- Add support for =launchctld= (thanks to usharf) +- Add new key binding to toggle fullscreen which should fix the usage + of left command key for this command (thanks to sooheon) +- Change obsolete =new-frame= function to =make-frame= (thanks to fintelkai) +**** Pandoc +- Add =ox-pandoc= package (thanks to jcf) +**** Php +- =php-extras= is not correctly installed +- Enable flycheck (thanks to rakyi) +**** Puppet +- Enable =flycheck= support (thanks to tko) +**** Python +- Apply new conventions for test key bindings +- Fix =anaconda-mode= key bindings for latest version of =anaconda-mode= + package (thanks cpaulik) +- Fix =py-yapf= for =yapf= >= 0.3.0 (=yapf= now returns 2 if source code was + changed) (thanks to a-sk) +- Use =quit-window= to close documentation popup (thanks to cpaulik) +- Enable =evil-matchit= (thanks to robbyoconnor) +- Move anaconda server cache files to =.cache= directory (thanks to person808) +**** Racket +- Enable insert state after ~SPC m s B~ accordingly to the conventions + (thanks to jmiven) +**** Ranger +- Fix =ranger-up-directory= key binding on ~-~ (thanks to ralesi) +**** Ruby +- Use =enh-ruby-mode= on interpreter-detected ruby files. This makes + ruby files that start with shebang ruby directives use =enh-ruby-mode= + (thanks to jenanwise) +- Add some =ruby-tools= key bindings (thanks to chrismcg) +- Enable =evil-matchit= (thanks to robbyoconnor) +**** Ruby-on-rails +- Activate =projectile-rails= mode for any type of files in a rails + project (thanks to liuxiang) +**** Rust +- Add =racer= package (thanks to cdlm) +**** Salt +- Add =salt-mode= package (thanks to beardedprojamz) +**** Scala +- Add binding for =ensime-pop-find-definition-stack= on ~SPC m g p~ + (thanks to alexanderkjeldaas) +- Remove key binding ~SPC m ?~ (thanks to Profpatsch) +**** Scheme +- Add support for Geiser (thanks to kingcons) +**** Search-engine +- Add Bing (thanks to Devagamster) +- Add Spacemacs Pull Requests +**** Shell +- Add =eldoc= support in eshell (thanks to ppold) +- Add a better prompt via =eshell-prompt-extras= for eshell (thanks to ppold) +- Add visual commands to eshell (thanks to ppold) +- Add support for =smart eshell= in eshell via the layer variable + =shell-enable-smart-eshell= (thanks to ppold) +- Add auto-completion support for eshell (thanks to trishume) +- Automatically jump to prompt in insert state in eshell buffers (thanks to + trishume) +- Add support for leader in =multi-term= (thanks to martinmr) +- Deactivate eshell automatic auto-completion popup for remote path since it + can be slow, the popup must be called manually in remote paths + (thanks to myrjola) +- Fix =magit-status= alias for =eshell= (thanks to myrjola) +- Protect the =eshell= prompt from deletion with evil commands. A new + layer variable =shell-protect-eshell-prompt= allows to opt-out this behavior + (thanks to myrjola). +**** Syntax-checking +- Add ~SPC e l~ to toggle error list buffer (thanks to bmag) +- Add ~SPC e v~ to verify the flycheck setup (thanks to bmag) +- Add ~SPC e h~ to describe the flycheck checkers (thanks to bmag) +**** Vinegar +- Show symlink paths (thanks to ralesi) +**** Wakatime +- Add ~SPC a W~ to open the Wakatime dashboard in the browser + (thanks to CestDiego) +*** Core changes +- Add =with-eval-after-load= backport (thanks to justbur) +- Add new key bindings to evilified buffers: ~g~, ~GG~, ~C-b~, ~C-f~, ~C-d~ + and ~C-u~ (thanks to sooheon) +- Add ~C-z~ in =evilified-state= to switch to =emacs-state= for the next + command (thanks to justbur) +- Add =:eval-after-load= keyword to =spacemacs|evilify-map= macro +- Remove ~y~ from evilified state keymap, use a visual selection instead. +- Fix visual state key bindings in evilified buffers +- Prevent auto-evilification of buffers from overwriting ~C-g~ +- Rewrite on =evilify-map= macro which is now simpler and more robust +- Add on and off functions to toggles (thanks to TheBB) +- Add new function =spacemacs/describe-system-info= which put useful + information in the clipboard, ready to be pasted in an IRC channel for + instance (thanks to swaroopch) +- Add new functions =configuration-layer/declare-layer= and + =configuration-layer/declare-layers= which can be used in =config.el= files + of a layer to add required layers. +- Add macro =dotspacemacs|symbol-value= with new special variable value + =display-graphic-p=. This variable will evaluate =(display-graphic-p)= + when called with =dotspacemacs|symbol-value=. Use this special value + to be able to have unicode symbol in GUI client but not in terminal + clients. +- Add missing =spacemacs/= function prefix (thanks to person808) +- Add choice of distribution on install (thanks to justbur) +- Add distribution name in home buffer +- Add distribution to =spacemacs/describe-system= (thanks to TheBB) +- Rewrite evil-leader keys handling to make ~M-m~ work correctly + (thanks to justbur) +- Replace =after-init-hook= with better hook =emacs-startup-hook= + (thanks to vkz) +- Fix some crashes when a package cannot be updated and warn about such + packages when updating (thanks to bmag) +- Fix ~SPC u~ not repeating universal-argument (thanks to luxbock) +- Fix Spacemacs Home Buffer to jump to bookmarks (thanks to travisbhartwell) +- Fix =ace-link= in spacemacs buffer (thanks to avoine) +- Fix an issue with Emacs 25 in =init.el= (not yet officially supported) + (thanks to justbur) +- Fix ~return~ binding in terminal in home buffer(thanks to d12frosted) +- Fix custom banner path (thanks to d12frosted) +- Fix inconsistent detection of orphaned packages to delete +- Set =gc-cons-threshold= to 100MB and define it in =init.el= +- Use =package-alist= to resolve orphans +- Better indentation for =spacemacs|add-toggle= macro (thanks to TheBB) +- Remove some dead code for =use-package= (thanks to TheBB) +- Remove =tooltip-use-echo-area= usage which is obsolete since Emacs 24.1 + (thanks to xfq) +- Remove duplicate call to =dotspacemacs/init= (thanks to sooheon) +- Display home buffer links even when no banner are displayed + (thanks to sooheon) +- Better centering of text in the home buffer +*** Other fixes and improvements +- Add contribution guidelines =CONTRIBUTE.md= (thanks to robbyoconnor) +- New documentation on layers (thanks to TheBB) +- Suppress byte compiler warnings on startup (thanks to justbur) +- Reactivate prefix command names since they are working correctly with + =which-key= (were also working with =guide-key=) (thanks to martinmr) +- Delete deprecated =!user= contrib directory. +- Removed lasts git submodules, Spacemacs is now submodule free! +- Typos and documentation improvements (thanks to agzam, alexanderkjeldaas, + andyque, benwooth, BrianHicks, catern, cgrinds, d12frosted, Devagamster, + gleber, Immortalin, jgertm, JinweiClarkChao, jmiven, JorisE, JoshTGreenwood, + justbur, luxbock, mbertheau, mortonfox, nwolfe, oneeman, person808, rakyi, + sotte, robbyoconnor, robmerrell, screamish, sooheon, srid, swaroopch, syohex, + travisbhartwell, x-ji, xfq, zmthy) +* Release 0.103.x +** 0.103.6 (2015/08/30) +*** Core +- Fix error with ~SPC h b~ (bookmarks) (thanks to sgepigon) +** 0.103.5 (2015/08/09) +*** Layer changes +**** Osx +- Fix initialization of =reveal-in-osx-finder= (thanks to fintelkai) +*** Core +- Temporarily switch to HTTP instead of HTTPS to communicate with + elpa.gnu.org (thanks to robbyoconnor) +** 0.103.4 (2015/08/07) +*** Layer changes +**** Clojure +- Fix key bindings for new Clojure major modes: =clojurec-mode=, + =clojurescript-mode= and =clojurex-mode= (thanks to benalbrecht) +** 0.103.3 (2015/08/04) +*** Layer changes +**** Osx +- Rename =reveal-in-finder= to its new name =reveal-in-osx-finder= + (thanks to syohex) +** 0.103.2 (2015/07/04) +*** Layer changes +**** Git +- Fix =magit-repository-directories= variable name (thanks to travisbhartwell) +- Fix =magit-blame= key binding (thanks to jenanwise) +- Use =magit-log-all= instead of =magit-log= on ~SPC g l~ (thanks to tuhdo) +*** Other fixes and improvements +- Typos and documentation improvements (thanks to cscorley, dstcruz, h3dkandi, + kccai, MadAnd, person808, Profpatsch, stnly, stormpat, xfq, zachlatta) +** 0.103.1 (2015/07/02) +*** Layer changes +**** Git +- Fix ~F~ in Vim style in =Magit= status buffer, now ~F~ is correctly + bound to =pull= popup menu +- Fix intermittent erroneous ~k~ key binding in =Magit= status buffer. +*** Core +- Fix mandatory dependency on =evil-escape= +- Fix evilification of =evil-escape= starter key +** 0.103.0 (2015/07/01) +*** IMPORTANT: Breaking changes +- Spacemacs is now compatible only with =Magit 2.1= and later, be + sure to update your packages. +- =auctex= layer has been renamed =latex=, be sure to update your + dotfile if you use this layer. +- =erlang/elixir= layer has been split into two layers =erlang= and + =elixir=, be sure to update your dotfile if you use these layers. +- =git= layer has been split into two layers: =git= and =github= so + the layer variable =git-enabled-github-support= is deprecated, you + have to add the layer =github= in your dotfile. +- =git-gutter= has been replaced by =diff-hl=. This package is in + the new layer =version-control=, be sure to add this new layer to + your dotfile. +- Projectile key bindings changes: + ~SPC p e~ is now ~SPC p r~ (recent files) + ~SPC p R~ is now ~SPC p G~ (regenerate tags) + ~SPC p r~ is now ~SPC p R~ (replace) +*** Hot new features +- Add support for Magit 2.1! +- Helm now uses its header to display the input pattern. +- Use Flycheck default configuration to check the current buffer in + "real time" (yes this is a hot new features :-)) +- New interactive function =spacemacs/switch-to-version=, it will ask + for a version number and warn if the current branch is not =master=. + Users on =develop= branch cannot use this function (it has no effect). +- Clicking on the up arrow in the mode-line will now update Spacemacs. + A prompt asks for confirmation before updating. +- New "tool assisted" search and replace interface supporting =ag=, =pt=, + and =ack= with a new key binding scheme. Check the documentation for + =searching with an external tool=. +*** New Layers +- elixir (split from =erlang-elixir=) +- erlang (split from =erlang-elixir=) +- github (split from =git=) +- ipython-notebook (ein) (thanks to CestDiego) +- latex (renamed from =auctex=) +- version-control +*** Dotfile changes +- New variable =dotspacemacs-auto-save-file-location= which enable or + disable auto-saving of modified files. Possible values are =original= to + auto-save the file in-place, =cache= to auto-save the file to another + file stored in the cache directory and =nil= to disable auto-saving. + Default value is =cache=. +*** Layer changes +**** Spacemacs +- Add text alignment key bindings on ~SPC x a~ prefix (thanks to justbur and + TheBB) +- Remove the kill ring from =savehist-additional-variables= to avoid an issue + with abnormal high size of =savehist= file (thanks to tuhdo) +- Add documentation files to =helm-spacemacs= (thanks to person808) +- Add support for =.org= files in =helm-spacemacs= (thanks to tuhdo) +- Add explicit titles for documentation files in =helm-spacemacs= + (thanks to tuhdo) +- Remove the dependency on =f= library in =helm-spacemacs= + (thanks to person808) +- Revert ~C-o~ in =holy-mode= since it shadows too many packages key bindings + (thanks to tuhdo) +- Evilify =helm-ag= and =helm-grep= buffers (obtained by pressing ~f3~ in + the helm buffer while searching) (thanks to cpaulik) +- Search with =ag=, =pt= and =ack= are done with the same interface based on + =helm-ag= +- Add search integration in =expand-region= and =auto-highlight-symbol= + (thanks to justbur) +- Update search with =grep= to match the new search interface + (thanks to justbur) +- Quote input when default text is used in search (thanks to justbur) +- =smart-search-project= on ~SPC /~ now fallback to searching files in current + directory when there is no project (thanks to justbur) +- Replace =dired-goto-file= with =helm-find-files= in Dired (thanks to tuhdo) +- Add support for .org files to ~SPC s l~ key binding, it allows to quickly + jump to file headers using Helm (thanks to tuhdo) +- Re-enable =auto-save= mode (thanks to tuhdo) +- Set =:defer 1= in =helm= initialization (which means that helm will be + auto-loaded automatically after 1 second of idle time) +- Fix =helm-resume= opening window in half of split screen (thanks to sooheon) +- Use =helm= header to display the input pattern (thanks to tuhdo) +- Fix =open-in-external-app= when the buffer is not visiting a file + (thanks to travisbhartwell) +- Prevent paste micro-state to be triggered by ~C-r~ in =insert state= +- Projectile key bindings changes: + ~SPC p e~ is now ~SPC p r~ (recent files) + ~SPC p R~ is now ~SPC p G~ (regenerate tags) + ~SPC p r~ is now ~SPC p R~ (replace) +- Remove =comint-delchar-or-maybe-eof= on ~C-d~, it fixes ~C-d~ scroll down + behavior in =normal state=, user has to press the stock binding ~C-c C-d~ + to send an =EOF= (thanks to kini) +**** Auto-completion +- Yasnippet: Default =helm-yas-display-key-on-candidate= to =t= (thanks to + BrianHicks) +- Yasnippet: Disable =smartparens= while expanding to fix a bug with + =hippie-expand= (thanks to tuhdo) +- New layer variable =auto-completion-enable-snippets-in-popup= to add + snippets directly to auto-completion popup (thanks to person808) +**** Autohotkey +- Fix =.ahk= file extension declaration (thanks to ralesi) +**** C/C++ +- Add package =gdb-mi= (gdb-many-windows) which enables an IDE like debugger + frontend for Emacs (thanks to tuhdo) +**** Clojure +- Add ~SPC e w~ to eval last sexp and replace it with the result (thanks to + DayoOliyide) +- Evilify Cider inspector (thanks to ppold) +**** Elixir +- List all Elixir key bindings in README +- Update configuration to support new =alchemist= 1.0 feature (thanks to tonini) +- Enable auto-completion support +**** Emacs Lisp +- Add new Spacemacs snippets =micro-state= and =new-package= (thanks to + CestDiego) +- Add (f)ielm-indent-line for =ielm= mode (thanks to BlinkD) +**** Emoji +- Remove the extension and use the MELPA package +**** ERC +- Use =erc-yank= on ~p~ in normal state if =gist= package is available + (thanks to CestDiego) +**** Evil-snipe +- Update configuration to support last upstream changes (thanks to hlissner and + MadAnd) +**** Extra-langs +- Enable =QML= mode for =.qml= files (thanks to bennofs) +**** Eyebrowse +- Add support for workspace labels (thanks to rphillips) +**** Finance +- Evilify =ledger-report-mode= (thanks to darkfeline) +**** Git +- Replace =git-gutter= by =diff-hl= (thanks to tuhdo) +- Remove =gc= prefix command as unused from guide-key (thanks to tko) +- Add =magit-diff= key binding on ~SPC g d~ (thanks to kevinushey) +- Evilify =magit-diff= buffer +- Implement fullscreen for =Magit= without advices (thanks to tarsius) +- Fix whitespace toggles for =Magit= (thanks to tarsius) +- Remove deprecated =magit-last-seen-setup-instructions= (thanks to tarsius) +- Move whitespace toggle in =Magit= to ~C-S-w~ +- Add ~SPC g L~ to display the log for the current file (thanks to tko) +**** Go +- Add ~SPC m g a~ to switch between tests and implementation (thanks to + jenanwise) +**** Gtags +- Enable =helm-gtags= for =compilation-mode= and =shell-mode= (thanks to tuhdo) +**** Haskell +- Add =company-cabal= support for auto-completion in =.cabal= files (thanks + to bjarkevad) +- Fix error with =electric-indent-local-mode= in some versions of Emacs + (thanks to jeremyjh) +**** iPython-notebook (ein) +- Add key bindings on major-specific leader (thanks to cpaulik) +- Add ~C-RET~ and ~S-RET~ key bindings to behave like the =ein= web interface + (thanks to cpaulik) +- Bind ~SPC f s~ to save the notebook (thanks to cpaulik) +**** LaTeX +- Add support for =RefTeX= (thanks to JP-Ellis) +- Add support for =LatexMk=, to enable it set the layer variable + =latex-build-command= to ="LatexMk"= (thanks to JP-Ellis) +- Use =auto-fill-mode=, with an environment-aware auto-fill function, you + can enable =auto-fill= support by setting the layer variable + =latex-enable-auto-fill= to =t=. You can also inhibit it in some environments + with the variable =latex-nofill-env= (thanks to JP-Ellis) +- Remove =build-view= in favour of just =build= as it seemed to be + broken and introduce ~SPC m v~ to view (thanks to JP-Ellis) +- General settings should now be easier to override in =dotspacemacs/config= +- Fix errors due to layer renaming (thanks to JP-Ellis and autosquid) +**** Markdown +- Add font-locking for code blocks (thanks to kennethlove) +- Add support for a bunch of languages for code blocks (thanks to dexafree) +**** Ocaml +- Don't auto-close backticks (thanks to edwintorok) +**** Org +- Fontify code blocks (thanks to tuhdo) +- Add =toc-org= package (thanks to CestDiego) +- Tweak org-pomodoro mode-line integration (Add missing leading space) +- Move =org-clock-save.el= to cache folder (thanks to BlinkD) +- Add key binding ~SPC m :~ for =org-set-tags= (thanks to cpaulik) +**** Osx +- New variable =osx-use-option-as-meta= allowing to enable or disable the + mapping of =option= key to =meta= key. This is especially useful for some + European keyboard layouts like Finish or Swedish (thanks to tko) +- Add ~⌘ +~ and ~⌘ -~ key bindings to scale text (thanks to JoshTGreenwood + and zimbatm) +- Only update =dired-use-ls-dired= if =gls= was found on path (thanks to + usharf) +- Add reveal in finder on ~C-⌘ f~ (thanks to usharf) +- Add key bindings ~⌘ a~ (select all) ~⌘ W~ (close frame) and ~⌘ n~ (new frame) + (thanks to mveytsman) +- Fix ~⌘ v~ paste behavior (thanks sooheon) +**** Powershell +- Add ~SPC a s p~ to start a =powershell= buffer (thanks to ralesi) +- Add ~SPC m r r~ for =powershell-regexp-to-regex= (thanks to ralesi) +- Add =$(= text object (thanks to ralesi) +**** Puppet +- Add Puppetfile support (thanks to nwolfe) +**** Python +- New supported test runner: =pytest= (thanks to cpaulik) +- New layer variable =python-test-runner= to choose between =nose= and + =pytest= +- Set =indent-tabs-mode= to =t= in REPLs, should fix indent errors (thanks to + tuhdo) +- Fix a loading bug due to a typo in =latex= layer (thanks to cpaulik) +**** Racket +- Fix not working =electric-pair-skip= (thanks x-ji) +**** Ruby +- Fix some annoyance with deep indentations (thanks to trishume) +**** Rust +- Add support for =flycheck= (thanks to swaroopch) +- Add support for auto-completion via =racer= (thanks to JP-Ellis) +- Use =compile= instead of the shell for =cargo=. This allow Emacs to parse the + output, including all the errors (thanks to JP-Ellis) +**** Scala +- Set classpath directory of =ensime= to =.cache/ensime= (thanks to cyrillk) +**** Slime +- Add a bunch of key bindings (thanks to spigo900) +**** Syntax-checking +- Now use the =flycheck= default configuration to trigger checks. Checks + are now performed live (thanks to tuhdo and thrnio) +**** Theme +- Add spacemacs-theme! (WIP) (thanks to nashamri) +- Add tao theme (thanks to elais) +*** Core +- New interactive function =spacemacs/switch-to-version= +- Clicking on the up arrow will now update Spacemacs +- Add a link to Vimmers guide in quick help of startup buffer (thanks to + person808) +- Enable =use-package-verbose= when =dotspacemacs-verbose-loading= + is set to =t= +- Better name for placeholders in layer templates (thanks to kini) +- Beautify change log (thanks to tuhdo) +- Layers are now auto-discovered recursively which allow arbitrary + directory hierarchy. Directory names starting with =!= are categories. + (thanks to TheBB) +- Fix regression when =dotspacemacs-startup-banner= is set to =nil= + (thanks to ptb) +- Fix home buffer keys in terminal (thanks to tuhdo) +- Fix bookmark list in home buffer (thanks to fandag) +- Add support for =material-light= theme (thanks to cpaulik) +- Use SSL to contact elpa repositories when possible (thanks to zimbatm) +- Emacs 25 required the line =(package-initialize)= in the =init.el= + file (thanks to justbur) +- Add the possibility to call =configuration-layer/update-packages= in + batch mode (thanks to travisbhartwell) +*** Other fixes and improvements +- Conversion of all layer README.md files to .org (thanks to CestDiego + and cpaulik) +- Conversion of documentation files to .org (thanks to person808) +- Add a guide for Vimmers in =doc= directory (thanks to person808) +- Typos and documentation improvements (thanks to cloudbring, duerrp, dxnn, + dvberkel, fotoetienne, JoshTGreenwood, kccai, OliverM, MadAnd, person808, + robbyoconnor, royseto, swaroopch, travisbhartwell, tuhdo, xfq) +* Release 0.102.x +** 0.102.2 (2015/06/03) +*** Layer changes +**** Org +- Fix bug with =ox-gfm= by moving it to extensions +*** Core +- Fix detection of new versions by correctly fetch latest changes +** 0.102.1 (2015/06/01) +*** Layer changes +**** Org +- Fix lazy-loading of =ox-gfm= package. +*** Core +- Catch layer variables syntax errors +** 0.102.0 (2015/05/31) +*** IMPORTANT: Breaking changes +- All Emacs Lisp related configuration has been moved to its own layer + called =emacs-lisp=, be sure to add this layer to your dotfile. +- All shell related configuration has been move to its own layer called + =shell=, be sure to add this layer to your dotfile if you use a shell + inside Emacs. +- Key binding to reload the dotfile is now ~SPC f e R~ instead of + =C-c C-c= or ~SPC m c c~. Note that ~SPC f e R~ can be triggered + anywhere (it is not restricted to the dotfile anymore). +- Key binding to switch buffer is now ~SPC b b~ instead of ~SPC b s~. +- ~SPC f f~ now uses =helm-find-files= instead of =ido=, use the new + dotfile variable =dotspacemacs-use-ido= to get the old behavior back. +- Helm ~TAB~ and ~C-z~ key bindings have been *swapped*. +- By default *single space* sentence delimiter is defined. +- Layer variable values set with =:variables= keyword need to be quoted + like in a regular =setq= expression. +*** New Layers +- Agda (thanks to ocharles) +- Chrome (thanks to beardedprojamz) +- D (thanks to trishume) +- Deft (thanks to trishume) +- Emacs-lisp +- Emoji +- Eyebrowse +- Games (thanks to nashamri) +- Gnus (thanks to cpaulik) +- Gtags (thanks to tuhdo) +- iBuffer (thanks to alex-glv) +- Pandoc (thanks to cpaulik) +- Prodigy (thanks to CestDiego) +- Purescript (thanks to kofno) +- Rust (thanks to mkaito) +- Salt (thanks to beardedprojamz) +- Search Engine (thanks to CestDiego) +- Semantic (thanks to tuhdo) +- Shell +- Spotify (thanks to BrianHicks) +- Sql (thanks to BrianHicks) +- TypeScript +- Vim-powerline +*** Dotfile changes +- New variable =dotspacemacs-search-tools= which is a list of search tool + executable names. Spacemacs uses the first installed tool of the list + with search related key bindings (~SPC /~, ~SPC s ...~). + Supported tools are =ag=, =pt=, =ack= and =grep=. +- New variable =dotspacemacs-highlight-delimiters= which selects a scope + to highlight delimiters. Possible value is =all=, =current= or =nil=. + Default is =all=. (thanks to tuhdo) +- New variable =dotspacemacs-additional-packages=. Adding packages to + this list will install them without needing them to be wrapped in a + layer. Ideal for quickly add a package. The package configuration + can be put in =dotspacemas/config=. +- New variable =dotspacemacs-use-ido=. If non nil then =ido= replaces =helm= + for some commands. For now only =find-files= (SPC f f) is replaced. +- New key binding ~SPC f e D~ to open an =ediff= buffer between the user + dotfile and the current template. +- Disable paste micro-state by default, i.e. set the variable + =dotspacemacs-enable-paste-micro-state= to =nil= in the dotfile template. +*** New conventions +- Add conventions for markup languages like =markdown= or =org= + (thanks to cpaulik) +*** Layer changes +**** Spacemacs +- Auto-indent when pasting use the universal argument to not auto-indent + (thanks to tuhdo) +- Fix =global-mode-string= for mode-line (thanks to 3marcusw) +- Display =guide-key= buffer at the bottom instead of the right so we get + more space. Also fix some issues with other popup interaction. +- Use single space sentence delimiter (thanks to roryk) +- Restore maximized frame state with =zoom-frm= (thanks to ralesi) +- Improve =golden-ratio= excluded buffers coverage (thanks to tuhdo) +- Add missing =evil-window-*= commands to =golden-ratio= managed commands + (thanks to riclima) +- Add CamelCase motion toggle to =subword-mode= (thanks to mkcode) +- Add =open-junk-file= package which allows to quickly create a junk file + in =.cache= directory. Bound to ~SPC f J~ (thanks to tuhdo) +- Add ~SPC T s~ to toggle semantic-stickyfunc (thanks to cpaulik) +- Add ~SPC b Y~ and ~SPC b P~ to copy/paste whole buffer (thanks to swaroopch) +- Add ~SPC h d b~ to =describe-bindings= (thanks to mkcode) +- Add toggle to hide/show the mode line on ~SPC t m t~ (thanks to jupl) +- Add =move-text= micro-state +- Add =highlight-parentheses= package which can activated by setting + =dotspacemacs-highlight-delimiters= to =current= (thanks to tuhdo) +- Add =clean-aindent-mode= package to cleanly delete virtual indentation + (thanks to tuhdo) +- Move =yasnippet= and =hippie-exp= to =auto-completion= layer. +- Move =multi-term= and shell packages to new =shell= layer +- Move =flyspell= and =helm-flyspell= to =syntax-checking= layer +- Move ~SPC b r~ to ~SPC f R~ (rename file) +- Move some toggles key bindings which are now: + - ~SPC t s~ for syntax checking + - ~SPC t S~ for spelling checking + - ~SPC t f~ for fill column + - ~SPC t F~ for auto-fill + - ~SPC t c~ for camelcase +- Move =sp-local-pair= to =:config= of =smartparens= so user can override + them (thanks to person808) +- Remove ~SPC b 0~ and ~SPC b $~ redundant key bindings (thanks to tuhdo) +- Remove all themes from the layer (since now themes are not + automatically uninstalled). +- Don't use the minibuffer for =scroll= micro-state +- Don't close compilation buffer after success (thanks to TheBB) +- Make =trailing-whitespace= face more subtle (thanks to tuhdo) +- Beautify whitespace highlighting (thanks to tuhdo) +- Make inactive window face of mode-line compatible with more themes + (thanks to tuhdo) +- Fix the =recentf-exclude= variable, now cache folder is correctly excluded + (thanks to rcherrueau) +- Fix global toggle for whitespace. +- Fix for new line insertions with ~SPC i~ (thanks to nashamri) +- Fix =spray= cursor issue when quitting. +- Tweak =fci-mode= face color, should be better in most themes + (thanks to tuhdo) +- Improve =smooth-scroll= configuration (thanks to sooheon) +- Refactor =spacemacs/init-evil-lisp-state= to use =use-package= + (thanks to mveytsman) +***** Helm +- Switch commands for ~Tab~ and ~C-z~ in Helm (thanks to darkfeline) +- Remove Helm header line to make it clearer (thanks to tuhdo) +- Manually manage =popwin= to improve popup window interactions (thanks to + tuhdo) +- Enable fuzzy matching in Helm (thanks to ralesi) +- Turn on colors in =helm-swoop= (thanks to danielwuz) +- Render README.md file of layers with =Open README= action of + =helm-spacemacs=, use the universal argument ~C-u~ to open + the file without rendering it (thanks to tuhdo) +- Add dotfile variables helm source to =helm-spacemacs= +- Add support for extensions in =helm-spacemacs= +- Use =helm-pp-bookmarks= instead of =helm-bookmarks= (thanks to darkfeline) +- Move ~C-SPC~ on ~M-SPC~ and ~S-M-SPC~ for =helm= and =ido= micro-states. +- Make =helm-find-files= =backspace= key behave like =ido= (thanks to tuhdo) +- Fix aggressive manipulation of =face-remapping-alist= in =helm= and =ido= +- Automatically create directories if needed when renaming a file (thanks to + env0der) +- Replace =helm-projectile-vc= (which does not exist) by =projectile-vc= + (thanks to swaroopch) +- Fix =toggle-maximize-buffer= (thanks to tuhdo) +***** Evil +- Use non-visual lines for j/k navigation (thanks to mlsteele) +- Enable =evil-execute-in-normal-state= in =holy-mode= +- Better default face for =evil-search-highlight-persist-highlight-face= + (thanks to tuhdo) +- Add visual state mapping for =<= and =>= to =gv= respectively + (allow to indent a region several times). +- Add =spacemacs/smart-goto-definition= which attempts to call + ~SPC m g g~ and falls back to =evil-goto-definition= if that fails + (thanks to luxbock) +- Replace ~C-o~ with ~M-o~ in =dired= buffer since ~C-o~ is replaced with + =evil-execute-in-normal-state= (thanks to tuhdo) +- Make =evil-smart-*= functions respect the leader key (thanks to person808) +- Advice =evil-jump-to-var= with =evil-set-jump= (thanks to luxbock) +- Temporary hack to speed up =ace-jump-line= (~SPC l~) as an evil motion. +**** Auctex +- Add =RefTeX= package (thanks to rpglover64) +- Add =flycheck= support +- =build-view= always recompile TeX (thanks to kvelicka) +**** Auto-completion +- New variables: + - =auto-completion-return-key-behavior= set the action to perform when the + ~RET~ key is pressed, the possible values are =complete= and =nil=. + - =auto-completion-tab-key-behavior= set the action to perform when the + ~TAB~ key is pressed, the possible values are =complete=, =cycle= and =nil= + - =auto-completion-complete-with-key-sequence= is a string of two characters + denoting a key sequence that will perform a =complete= action if the + sequence has been entered quickly enough. If its value is =nil= then the + feature is disabled. + - Default values are ~RET~ -> =complete=, ~TAB~ -> =cycle= and sequence is + =nil= +- Rename =auto-completion-enable-company-help-tooltip= to + =auto-completion-enable-help-tooltip= +- Add support for =company-statistics=, to activate it set the layer variable + =auto-completion-enable-sort-by-usage= to =t= (thanks to person808) +- Add =auto-yasnippet= package on ~SPC i S~ (thanks to tuhdo) +- Disable =company-tooltip-flip= (thanks to tuhdo) +- Allow a snippet to wrap around a selected region when expanded, + press ~C-x C-x~ to go to the original mark and run =yas-expand= + to wrap the selected region in expanded snippet. (thanks to tuhdo) +- Allow =hippie-expand= to expand snippets (thanks to tuhdo) +- Remove =company-yasnippet= backends use ~SPC i s~ and ~C-p~ +- Fix =company= and =fci-mode= incompatibility (thanks to tuhdo) +- Fix wrong creation location for new snippets with =yas-new-snippet= (thanks + to CestDiego) +- ~SPC t a~ now correctly toggle =company= by default. +- Remove unneeded =yasnippet-snippets= submodule (thanks mkcode) +- Better lazy-loading of =yasnippet= (thanks to tuhdo) +**** Autohotkey +- Use MELPA package (thanks to ralesi) +**** C/C++ +- New layer variable =c-c++-enable-clang-support= +- New layer variable =c-c++-default-mode-for-headers= (thanks to ceales) +- Remove unnecessary =auto-mode-alist= (thanks ceales) +- Add =clang-format= support (thanks to gnzlbg) +**** Chrome +- Add better integration with edit-server package (thanks to CestDiego) +- Added Gmail messages support with =ham= mode (thanks to CestDiego) +**** Clojure +- Add binding to connect to REPL in Cider on ~SPC m s c~ (thanks to jcsims) +- Add ~SPC m t a~ to reload test namespace before running all tests (thanks to + voxdolo) +- Add ~SPC m t r~ to reload test namespace and re-run failed tests (thanks to + voxdolo) +- Add ~SPC m t t~ to reload test namespace and run focused test (thanks to + voxdolo) +**** Colors +- Add =rainbow identifiers= color profiles for =gotham= and + =material= themes. +- Add colorization of keywords and function names for + =rainbow identifiers=. +- New variable =colors-theme-identifiers-sat&light= to set default + lightness and saturation for a given theme. +**** Emacs-lisp +- Move ~SPC m f~ bindings for code formatting to ~SPC m =~ +- Add =macrostep= package with a micro-state on ~SPC m d m~ + (thanks to person808) +**** Erc +- Add ERC channels to mode-line (thanks to swaroopch) +- Add ~SPC a i i~ key binding to switch to active ERC channels (thanks + to swaroopch) +- Highlight nicks using =erc-hl-nicks= (thanks to CestDiego) +- Image inline support using =erc-image= (thanks to CestDiego) +- Logging to ~/.emacs.d/.cache/erc-logs (thanks to CestDiego) +- =ViewLogMode= for viewing logs (thanks to CestDiego) +- YouTube videos Thumbnails inline using =erc-yt= (thanks to CestDiego) +- Social Graph for ERC messages using =erc-social-graph= (thanks to CestDiego) +**** ESS +- Fix lazy-loading of packages (thanks to jcpetkovich) +- Update to take care of the merge of =company-ess= in =ess= + (thanks to jcpetkovich) +**** Extra-langs +- Add =matlab= package (thanks to TheBB) +**** Git +- Make =git-gutter= key bindings work with or without the fringe (thanks + to person808) +- Fix =git-gutter= and =linum-mode= integration (thanks to person808) +- Fix =s= key binding to stage item in visual state. +- Replace =with-eval-after-load= by =eval-after-load= (compatible with 24.3) + (thanks to person808) +- Disable =evil-snipe= in =magit-status-mode= (thanks to person808) +- Enable =fci-mode= (fill column) in =git-commit-mode= (thanks to tuhdo) +- Add =helm-gitignore= package on ~SPC g I~ (thanks to jupl) +**** Gtags +- Add =helm-gtags-dwim-other-window= on ~SPC m g G~ (thanks to mijoharas) +**** Haskell +- ensure =haskell-indentation= is loaded before calling members (thanks + to chrisbarrett) +- fix misspelled references to keymaps (thanks to chrisbarrett) +- fix function names =identation= instead of =indentation= (thanks + to chrisbarrett) +- Fix =haskell-indentation= =eval-after-load= (thanks to chrisbarrett) +- Fix =ghci-ng= key bindings being overridden (thanks to bjarkevad) +- Use new package =haskell-snippets= +- Use =ghci-ng= for function =haskell-process-do-type-on-prev-line= (thanks to + bjarkevad) +**** Html +- Improve =web= micro-state key bindings (thanks to CestDiego) +- =emmet= key bindings fixes (thanks to louy2 and mkcode) +- Use only =smartparens= in =web-mode= (thanks to louy2 and mkcode) +- Add =eco= to =web-mode= =auto-mode-alist= (thanks to louy2 and mkcode) +- Fix buggy =T= key with =emmet= +- Add =company-web= package (thanks to CestDiego) +- Add a bunch of new pairs to =sp-local-pair= (thanks to CestDiego) +- Turn on =rainbow-delimiters= for =LESS= and =SCSS= (thanks to jupl) +**** Javascript +- Add =js-doc= package (thanks to geksilla) +- Add =web-beautify= package on ~SPC m =~ (thanks to elliotec) +- Apply key bindings conventions to some =tern= key bindings. +**** Lua +- Add support for auto-completion (thanks to mijoharas) +**** Markdown +- Add a bunch of new key bindings to improve consistency of key bindings + for markup languages, see [[https://github.com/syl20bnr/spacemacs/commit/7b6678efd6cece5bbb3419579590b843943f9e13][commit]] (thanks to cpaulik) +- Add markdown render buffer command on ~SPC m c r~ (thanks to CarlQLange) +- Add ~SPC m i k~ to insert =...= pairs (thanks to CestDiego) +**** Ocaml +- Add REPL using =utop= (thanks to edwintorok) +- Auto-indentation using =ocp-indent= (thanks to edwintorok) +- Add support for =company= auto-completion (thanks to edwintorok) +- Add support for =flycheck= syntax checking (thanks to edwintorok) +- New =merlin= key bindings (thanks to edwintorok) +**** Org +- Add a bunch of new key bindings to improve consistency of key bindings + for markup languages, see [[https://github.com/syl20bnr/spacemacs/commit/7b6678efd6cece5bbb3419579590b843943f9e13][commit]] (thanks to cpaulik) +- Use =org-startup-indented= instead of a hook so users can easily +remove =org-indent-mode= (thanks to darkfeline) +- Add support for =org-pomodoro-clock= to mode-line (thanks to swaroopch) +- Add =org-present= package (thanks to swaroopch) +- Add ~SPC m j~ for =helm-org-in-buffer-headings= (thanks to swaroopch) +- Add ~SPC m n~ for =org-narrow-to-subtree= (thanks to mattly) +- Add ~SPC m N~ for =widen= (thanks to mattly) +- Add ~SPC m i k~ to insert =...= pairs (thanks to CestDiego) +- Add =htmlize= package to enable syntax highlight in export HTML + (thanks to tetsusoh) +- Fix error with =org-async= (thanks to justbur) +**** Osx +- Make ~Command-s~ work with other modes (thanks to linktohack) +- Make =dired= use =coreutils gls= if installed (thanks to usharf) +**** Perforce +- Add a bunch of key bindings see [[https://github.com/syl20bnr/spacemacs/commit/6793eda4a90ee3a6c19c433b8676d5d9d8c3de76][commit]] (thanks to snandan) +**** Puppet +- Add =auto-completion= support (thanks to PierreR) +**** Python +- Add YAPF extension for buffer formatting (thanks to kennethlove) +- =nose.el= is now compatible with =virtualenv= (thanks to danielwuz) +- Add a function to remove unused imports =python-remove-unused-imports= + on ~SPC m c i~ (thanks to danielwuz) +- Add =pip-requirement= package (thanks to CestDiego) +- Enable =company= in Python REPL for code completion (thanks to tuhdo) +- Fix wrong extra parenthesis when inserting a breakpoint + (thanks to CestDiego) +- Don't enable Vim key bindings in REPL if =holy-mode= is active (thanks to + tuhdo) +- Fix Python and Semantic integration when no =python= executable can be + found on the system (thanks to tuhdo) +**** Rcirc +- Add =rcirc-track-minor-mode= to the =rcirc-mode-hooks= (thanks to + luxbock) +**** Ruby +- Fix =ruby-test-mode= initialization +- Fix auto-completion (thanks to trishume) +- Fix Rails mappings showing up in non rails projects (thanks to horrorvacui) +- Add =:A= ex-command which switches between implementation and test + (thanks to naliwajek) +- Remove overloading of function =erm-darken-color= +**** Rust +- Add key bindings for cargo build, run, test (thanks to swaroopch) +**** Scala +- Add ~SPC m d A~ to attach to remote debugger (thanks to siegelzero) +**** Semantic +- Create directory for =semanticdb= if it doesn't exist (thanks to CestDiego) +**** Shell +- Use =shell-pop= to toggle shell/eshell and terminals (thanks to tuhdo) +- Add binding for EOF (^D) in =term= (thanks to darkfeline) +- Bind =term-send-tab= only in insert state (thanks to darkfeline) +- =up= and =down= in shell to cycle through previous commands (thanks to + ralesi) +- Fix for =paste= command in =multi-term=. +- Add ~SPC p $ t~ to run =multi-term= at project root +**** Slime +- Disable =smartparens= in SLIME REPL (thanks to tuhdo) +**** Smex +- Fix =smex= prompt whitespace (thanks to TheBB) +**** Syntax-checking +- New variable =syntax-checking-flycheck-pos-tip= to enable or disable + documentation popup (thanks to beardedprojamz) +**** Themes +- Add =apropospriate-theme= to megapack +- Add =jazz-theme= to megapack (thanks to matDobek) +- Fix theme-to-package rules for =base16= (thanks to mkaito) +**** Tmux +- Add support for motion state (thanks to rphillips) +**** Vim-empty-lines +- Update with last patches (thanks to person808) +- Exclude terminal modes (thanks to tonylotts) +**** Ycmd +- Move C/C++ related configuration to =c-c++= layer. +*** Core +- Add support for =use-package= injected hooks (not yet documented) +- It is now possible to create a layer directly in a known configuration + layer path. A helm buffer will ask for a known path or a new path + (thanks to justbur) +- The =:variables= keyword now behaves like regular =setq=. +- Add org elpa repository +- Use =archive= instead of =package-alist= to detect orphans + (fix false orphan positives when the dependencies of a package change) +- Improve support for images in Spacemacs banner, it is now possible to use + any image format supported by Emacs (thanks to jupl) +- Prefix all category folders in =contrib= with =!= (thanks to trishume) +- Smarter buffer switching which tries to avoid special buffers, you can + customize =spacemacs-useless-buffers-regexp= to define other buffers to + avoid (thanks to person808) +- Warn about duplicated layers +- Improvements to home buffer: Quick Help, Content toggles, + link faces, better key bindings (thanks to tuhdo) +- =dotspacemacs/location= now respect =dotspacemacs-filepath= value + (thanks to coldnew) +- Avoid conflict with hydra's =lv.el= (thanks to edwintorok) +- Update layer templates to use =setq= instead of =defvar= (thanks to + person808) +*** Other fixes +- Replace =defvar= with =setq= for variable definition =-packages=, + =-pre-extensions= and =-pre-extensions=. +- Themes in =dotspacemacs-themes= are not considered orphans anymore +- Fix "Unable to check for new version." if =.emacs.d= is a symlink + (thanks to louy2) +- Fix non unicode number spacing in mode-line +- Typos (thanks to Andrea, atamis, CarlQLange, charl, ctjhoa, Devagamster, + dguilak, edwintorok, fhzerorubigd, jackwilsonv, jupl, kini, latkins, MadAnd, + mlsteel, mosic, person808, skwuent, srid, swaroopch and zimbatm) +* Release 0.101.x +** Hot new features +*** Choose your own editing style +Thanks to the new =holy-mode= Spacemacs can now be used by Vim users +or Emacs users by setting the =dotspacemacs-editing-style= variable to +='vim= or ='emacs= in the dotfile. In =Emacs= style the leader is +available on =M-m=. It is possible to dynamically switch between the +two style with ~SPC P tab~. +*** Mandatory init function and new Pre and Post init functions +A package is now considered to be used only if there is a corresponding +=/init-= function explicitly defined. +There is now two new functions to initialize a given package: +- =/pre-init-= which is called before the init function +- =/post-init-= which is called after the init function +Even if a =pre= or =post= function exist for a given package, an =init= +function is still required to consider the package to be used. +*** Auto-completion +Spacemacs now officially support auto-completion. The old layer +=company-mode= has been removed and =auto-complete= has been removed +from the spacemacs layer. +They are now part of a new layer called =auto-completion=. +You'll have to this add layer to your dotfile to enable auto-completion. +*** Syntax checking +Flycheck has been removed from the Spacemacs layer and moved to a new +layer called =syntax-checking=. +You'll have to add this layer to your dotfile to enable the fly syntax +checking. +*** Org +Org packages have been removed from Spacemacs layer and moved to a new +=org= layer. +You'll have to add this layer to your dotfile to enable the Org +configuration of Spacemacs. +*** New shortcuts in startup buffer +Recent files, project and bookmarks can be displayed on the startup +buffer. Check for the new dotfile variable =dotspacemacs-startup-lists=. +(thanks to CarlQLange) +*** New lighter in the mode line +Lighter letters have been updated, now the letter corresponds to the +key binding to toggle the associated mode. For instance auto-completion +is on ⓐ and thus can be toggled with ~SPC t a~. +*** Better package update +The package update should now prevent even more errors when upgrading +a batch of packages. +** Initial Release (2015/04/13) +*** New layers +- evil-commentary: Alternative to =evil-nerd-commenter= + (thanks to person808) +- better-defaults: layer providing better defaults for Emacs commands, + rather empty for now. (thanks to tuhdo) +- ERC: an IRC client (thanks to swaroopch) +- Racket: a lisp dialect (thanks to trishume) +- xkcd: browse for XKCD in Emacs (thanks to CestDiego) +- shell-scripts: layer containing shell specific modes like =fish-mode= +- editorconfig: add support for EditorConfig (thanks to jupl) +*** New dotfile variables: +- =dotspacemacs-editing-style= can be either =vim= or =emacs=. +- =dotspacemacs-verbose-loading= if non nil the loading prints logs in + the =*Messages*= buffer. Default value is =nil=. +- =dotspacemacs-startup-lists= is a list of symbols to display recent + items in the startup buffer, possible values are: =recents=, + =bookmarks= and =projects= (thanks to CarlQLange) +*** Auto-complete +- Move to =auto-completion= layer +*** C/C++ +- Add key bindings ~SPC m g a~ and ~SPC m g A~ for open alternate file + (thanks to mijoharas) +*** Clojure +- Add ~SPC m e f~ eval function at point +- Add =cider-eval-sexp-fu= +- Fix for =cider-send-function-to-repl= (thanks to nashamri) +- Replace =auto-complete= by =company= for auto-completion +- Move ~SPC d~ commands on ~SPC h~ to meet Spacemacs conventions (thanks to + cpaulik) +- Open =cider-doc= without asking for symbol, close it with =q= (thanks to + cpaulik) +*** Company +- Move to =auto-completion= layer +- Refactoring of =company= configuration, it is now lazy-loaded and the + =company-backends= list is now a buffer local variable. =company= is + not enabled globally anymore. +- Set =company-delay= to 0.2 instead of 0 +- Ignore =company-quickhelp= for Emacs version < 24.4 +- Add support for =company= in various languages (thanks to trishume) +*** Emacs Lisp +- Add =eval-sexp-fu= (thanks to tuhdo) +- Enable eldoc in eval-expression and IELM (thanks to tuhdo) +- New key bindings ~SPC m e b~, ~SPC m e c~ and ~SPC m e r~ to evaluate + the buffer, the current form starting by =set= or =def= and the region + respectively (thanks to ralesi) +*** Ess +- Fix loading of =ess-R-object-popup= and =ess-R-data-view= + (thanks to jcpetkovich) +*** Extra-Lang layer +- Add =Nim= language (thanks to trishume) +*** Flycheck +- Move to =syntax-checking= layer +- Add =flycheck-pos-tip= (thanks to tuhdo) +- Enable flycheck for =lua= files (thanks rphillips) +*** Git +- Add =gitconfig-mode= and =git-commit-mode= (thanks to ralesi) +- Add =gitattributes-mode= and =gitignore-mode= (thanks to r4ts0n) +- Add key bindings in rebase mode +- Add =git-link= package (thanks to CestDiego) +- Enable Magit authentication on Windows (thanks to tuhdo) +- Loads =magit-gh-pulls= only after requesting it (thanks to cpaulik) +*** Go +- Add =run-package-tests= command on ~SPC m t p~ (thanks to robmerrell) +- Fix path to =go-oracle= (thanks to Pursuit92) +*** Haskell +- Move ~SPC m t~ and ~SPC m i~ under ~SPC m h~ +- Remove =hi2= (it is now integrated in =haskell-mode=) +- Disable =eletric-indent-mode= +- Fix =flycheck-haskell= autoload (thanks to jcpetkovich) +- Fix =flycheck= loading +- Move ~SPC m t~ to ~SPC m h t~ according to Spacemacs conventions (thanks + to jeremyjh) +- Add C-- =cmm-mode= (thanks to bgamari) +*** Helm +- Add =helm-colors= key binding on ~SPC C l~ (thanks to tuhdo) +- Make =helm-ff-doted-directory= consistent (thanks to tuhdo) +- Disable popwin-mode when a Helm session is active (thanks to tuhdo) +- Fix lazy-loading of helm for describe commands +- Add support for =pt= the platinum searcher (thanks to ralesi) +- Add support for =helm-ag-edit= +- Add function =spacemacs/helm-projectile-search-dwim= which select the + first available external search tool (pt, ag, ack or grep) (thanks to + ralesi) +- Enable =helm-descbinds= globally (thanks to tuhdo) +- Add key bindings for useful Helm commands: =helm-info-at-point=, + =helm-man-woman=, =helm-locate-library= and =helm-minibuffer-history= + (thanks to tuhdo) +- Add key bindings for searching the web using =helm-suggest= (thanks to + cpaulik) +*** Holy-mode +- New package providing Emacs edition style to Spacemacs +*** IRC +- rcirc: Create rcirc logging directory during init + (thanks to jcpetkovich) +- New ERC layer (thanks to swaroopch) +- Add ERC keybindings (thans to cpaulik) +- Move startup key bindings to prefix ~SPC a i~ +*** Markdown +- Associate =.mkd= with =markdown-mode= (thanks to bgamari) +*** Org +- Move to =org= layer +- Bind evil-leader in org-agenda-map (thanks to luxbock) +- Add =org-pomodoro= on ~SPC m p~ (thanks to swaroopch) +- Add key bindings for =org-clock-cancel= on ~SPC m q~, + and =org-set-effort= on ~SPC m f~ (thanks to swaroopch) +- Fix diminish of =org-indent= +*** Perspective +- Rebind =spacemacs/persp-switch-project= to ~SPC p p~ + (thanks to CestDiego) +*** Projectile +- Move projectile switch project from ~SPC p S~ to ~SPC p p~ +*** Python +- Add helm-pydoc on ~SPC m h d~ (thanks to danielwuz) +- Fix =pylookup= configuration +*** Racket +- Add key bindings for REPL interaction +*** Ruby +- Lazy-load =projectile-rails= +- Remove mode-line lighter for =robe= +*** Scala +- Do not enable ensime in non-file buffers (thanks to chrisbarrett) +*** SLIME +- Use slime for indentation (thanks to tuhdo) +- Add extension for SBCL (thanks to tuhdo) +- Allow to create a common lisp scratch buffer with slime-scratch + (thanks to tuhdo) +- Enable fuzzy completion with score (thanks to tuhdo) +- Don't enable SLIME in Emacs Lisp (thanks to tuhdo) +*** Smartparens +- Enable smartparens in eval-expression (thanks to tuhdo) +*** Themes +- Fix =themes-megapack= layer where themes could not be browsed in Helm. +- Add =material= theme (thanks to cpaulik) +- Add =darktooth= theme (thanks to person808) +- Add =gotham= theme (thanks to person808) +*** ycmd +- Set global config only if not already set (thanks naseer) +*** Web +- Add =sass-mode= (thanks to ryanartecona) +- Ensure that less gets loaded (thanks to mijoharas) +*** Various Improvements and Changes +- New =evil= state called =evilified= which is used in _evilified_ + buffers. +- Remove the following packages from Spacemacs layer: =dired+=, + =fancy-narrow=, =string-edit=, =visual-regexp-steroids= and =wdired= +- Rename =*-declarep= functions to =*-usedp= functions +- Display block selection info in the mode line + (thanks to emmanueltouzery) +- Bind =K= in normal state to ~SPC m h h~ if it exists + (thanks to person808) +- Add key binding for balancing windows on ~SPC w =~ (thanks to kini) +- Add key binding to indent region on ~SPC j =~ (thanks to tuhdo) +- Add key binding ~SPC w SPC~ for =ace-window= (thanks to ralesi) +- Add key binding ~SPC b h~ to open the startup buffer (thanks to ralesi) +- Add key binding ~SPC t ~~ to toggle Vim tildes +- Add adaptive wrap which appropriately indents wrapped lines (thanks to + person808) +- Add mouse support to line number column (thanks to ralesi) + - single click selects line + - double click selects text block + - drag across lines selects all lines dragged across +- Add =highlight-numbers= (thanks to tuhdo) +- Add =highlight-indentation= on ~SPC t h i~ and ~SPC t h c~ (thanks to + cpaulik) +- Add ace-link package to spacemacs layer (thanks to danielwuz) +- Add =indent-guide= on ~SPC t i~ (thanks to ralesi) +- Add link to cpaulik tutorial to use the Spacemacs icons in Ubuntu Unity +- Add C-w and brackets [] to guide-key-sequence (thanks to ralesi) +- Add =info+= to improve Info reading experience (thanks to tuhdo) +- Add default layers to dotfile template: =auto-completion=, + =better-defaults=, =git=, =markdown=, =org= and =syntax-checking= + (thanks to CarlQLange) +- Move some toggles on ~SPC T~: fringe, menu bar, tool bar, + frame maximize, frame fullscreen, frame transparency +- Restore rectangle-mark-mode key binding (thanks to tuhdo) +- Make quit the isearch-mode like vim (thanks to dsdshcym) +- Enable goto-address-prog-mode which makes URL in code comments clickable + (thanks to tuhdo) +- Disable aggressive indent for ediff buffers (thanks chrisbarrett) +- Prevent cursor from moving into minibuffer prompt (thanks to tuhdo) +- Remove tildes in Spacemacs buffer and read-only buffers like Info and + help (thanks to tuhdo) +- Ask user editing style when creating .spacemacs file (thanks to tuhdo) +- Fix for persistent-server if server never got started (thanks to ralesi) +- Fix nyan cat starting rainbow on a light background +- Fix some double loading of some packages +- Fix double loading of =extensions.el= files +- Fix question for preferred coding systems on Microsoft Windows +- Properly enable saveplace (thanks to tuhdo) +- Don't bind ~C-d~ in =ido-completion-map= to =ido-delete-file-at-head= + (thanks to segv) +- Don't refer to ~/.emacs.d/ directly at various places + (thanks to jcpetkovich) +- Don't want paste-micro-state to pop up when pasting in ex command + prompt (thanks to ralesi) +- Don't cycle when press TAB in eshell (thanks to tuhdo) +- Don't insert extra quote in dotspacemacs-mode (thanks to tuhdo) +- Adapt some micro-states to the micro-state macro (thanks to ralesi) +- Improve smooth scrolling configuration (reduce some point jump) + (thanks to tuhdo) +- Improve =doge= banner grammar (thanks to mathpunk) +- New =HOTOWs.md= file in =/doc= +- Add =Buy A Drink= badge to README.md +- Typo and documentation updates (thanks to danielwuz, swaroopch, + CestDiego, IvanMalison, agevelt, nwolfe) +** Hot Fixes +*** Startup Buffer +- Don't display the release notes in the startup buffer when Emacs is restarted + after a fresh install +- Startup buffer: fix widget activation in =holy-mode= (thanks to tuhdo) +- Startup buffer: Don't fontify the startup buffer when =rainbow-identifiers= +*** Auto-completion +- Fix error when toggling auto-completion in some buffers +*** Haskell +- Add new =haskell-snippets= package (fixes error with required =haskell-yas=) +- Fix missing quote in =haskell-indentation= +*** Org +- Org layer: exclude ox-gfm since it seems problematic for some users. + package is used +*** Ruby +- Fix auto-completion activation. +*** Themes +- Fix conflict between official Spacemacs solarized theme and + =color-theme-solarized= declared in =themes-megapack= layer. +- Add rules for all base16 themes (thanks to mkaito) +*** Various Fixes +- revert back =ag= as the default search tool instead of =pt=, =pt= can + conflict with =pt= command line tool from TCL parser tools. +* Previous Releases +- See Github release page diff --git a/emacs.d/COMMUNITY.org b/emacs.d/COMMUNITY.org new file mode 100644 index 0000000..9e1f000 --- /dev/null +++ b/emacs.d/COMMUNITY.org @@ -0,0 +1,111 @@ +#+TITLE: Spacemacs Community + +* Spacemacs Community :TOC_4_gh:noexport: + - [[#philosophy][Philosophy]] + - [[#for-contributors][For Contributors]] + - [[#for-users][For Users]] + - [[#moderation][Moderation]] + - [[#guidelines][Guidelines]] + - [[#people][People]] + - [[#issues][Issues]] + - [[#pull-requests-and-commmits][Pull requests and Commmits]] + - [[#messages][Messages]] + - [[#interpretation][Interpretation]] + - [[#collaborators-privacy][Collaborators privacy]] + - [[#maintainer][Maintainer]] + - [[#log][Log]] + +* Philosophy +** For Contributors +- This community is a community of hackers based on meritocracy and + volunteering. Hackers strive for excellence to make the world a better place, + so does the Spacemacs community. +- Be good in what you bring to the project be it code, documentation, typo + fixes, art, humor, ideas, project management, web design, assurance quality, + mentorship, you name it! We like to award achievements to people making a + difference in a wide variety of domains and occasions, [[file:./doc/DOCUMENTATION.org#specials][see it for yourself]]. + Why not you? Make it happen, make history! +- Think you are not good enough? Find support and mentors by chatting on Gitter + with fellow Spacemacs users or just open an issue on GitHub, you will find + help to fulfil your desire of contribution. We welcome anyone with good + intentions. +- In a nutshell: Be good, positive and/or with good intentions and focused on + the project. +** For Users +- Any question related to the project is welcomed and encouraged, the worst + thing that can happen is that we redirect you to the documentation. +- The majority of the interactions with the community happens on GitHub via + issues and on Gitter via the official Spacemacs channel. There is also an + active official twitter account =spacemacs=. +- Any opinion on the project is valorized given it is constructive. + +* Moderation +We want the community to be judged based on its moderation actions instead of +telling people how to behave. The golden rules of the community are to have good +intentions and stay focused on the project, for anything else that requires +moderation any future user or contributor can refer to this section to know +about our past moderation actions. So readers won't find any example or +definition of what collaborators judge offending or outrageous, instead they +will find at the end of this section a log of all major moderation actions taken +by the collaborators since the beginning of the project which started officially +in August 2014. It should allow you to decide whether or not you want to be part +of this community. If you are not convinced then be assured that the only evil +part in Spacemacs is the evil mode :-) +** Guidelines +These guidelines apply to all collaborators of the project, namely @syl20bnr, +@TheBB, @d12frosted and @bmag. +*** People +- Collaborators cannot ban any GitHub user from the repository but they can ban + users from the official Gitter channel. +- A user can be banned if and only if all the collaborators agree to do so. +- The reasons of the ban are mentioned in the moderation actions log (see + below). +*** Issues +- Issues can be locked if their contents are judged _inappropriate_, _offending_ + or if they deviate _dangerously_ from the project. +*** Pull requests and Commmits +- Collaborators can push to the repository without making a PR. +- PR can be rejected. Rejected PR always go with a reason explicitly written + when closing the PR. +- Commits can be reverted if they compromise the stability of the project. The + reason is contained in the commit comments. +- Pull request are also issues, thus issue guidelines also apply to pull + requests. +*** Messages +- Only the form of a message can be edited, not its meaning, except if this + meaning is _outrageous_. +- Moderators can add information to a message to improve its accuracy without + altering its meaning, +- Any edition of a message is logged in the =edits log= located at the end of + the edited message with the following format: + #+BEGIN_EXAMPLE + EDIT: [@moderator] action (reason: xxx) + #+END_EXAMPLE +- The reason is added only when needed (for instance we won't add a reason for + formatting edits) +** Interpretation +Words used in these guidelines like _good_, _inappropriate_, _offending_, +_dangerously_ and _outrageous_ are used without any explanation, their meanings +and interpretations are left solely to the discretion of the collaborators who +are educated persons working in the interest of the community. +** Collaborators privacy +Life and actions of collaborators outside of the project (i.e. outside of the +Spacemacs GitHub repository, official Spacemacs Gitter channels and Twitter +official Spacemacs account timeline) are completely detached from their +activities and roles in the project. They are free to express any opinion on the +project or any other subjects and those opinions cannot be used to compromise +their roles in the project as long as they follow the moderation guidelines with +good intentions. +** Maintainer +- The maintainer @syl20bnr as a BDFL is free to demote a collaborator in extreme + situations. +- When there is no consensus on a subject, the BDFL can decide to impose his + view on the subject. +** Log +For transparency and future reference any major moderation actions are recorded +here. As of Sunday, April 10th 2016, 7200 issues have been opened and 2 major +moderation actions have been taken: +| Date | Moderator | Action | Issue | Reason | +|------------+-----------+--------+-------+-----------------------------------------------------------------| +| 2016/01/27 | syl20bnr | lock | #3484 | comments judged to be offending towards the Spacemacs community | +| 2016/01/27 | syl20bnr | unlock | #3484 | let's make it happen, i.e. this document | diff --git a/emacs.d/CONTRIBUTING.org b/emacs.d/CONTRIBUTING.org new file mode 100644 index 0000000..b6ee605 --- /dev/null +++ b/emacs.d/CONTRIBUTING.org @@ -0,0 +1,256 @@ +#+TITLE: Contribution guidelines +#+HTML_HEAD_EXTRA: + +Spacemacs is a volunteer effort. We encourage you to pitch in. The community +makes Spacemacs what it is. We have a few guidelines, which we ask all +contributors to follow. + +You can only consider reading the sections relevant to what you are going to do: +- [[#asking-for-help][Asking for help]] if you are about to open an issue to ask a question. +- [[#reporting-issues][Reporting issues]] if you are about to open a new issue. +- [[#contributing-code][Contributing code]] if you are about to send a Pull-Request. + +Thanks! :heart: :heart: :heart: + +* Content :TOC@2:noexport: + - [[#asking-for-help][Asking for help]] + - [[#reporting-issues][Reporting issues]] + - [[#contributing-code][Contributing code]] + - [[#general-contribution-guidelines][General contribution guidelines]] + - [[#contributing-a-layer][Contributing a layer]] + - [[#contributing-a-keybinding][Contributing a keybinding]] + - [[#contributing-a-banner][Contributing a banner]] + - [[#additional-information][Additional information]] + - [[#testing][Testing]] + - [[#credits][Credits]] + +* Asking for help +If you want to ask an usage question, be sure to look first into some places as +it may hold the answer: + +- [[doc/FAQ.org][The FAQ]]. Some of the most frequently asked questions are answered there. +- [[doc/DOCUMENTATION.org][The documentation]]. It's the general documentation of Spacemacs. +- You may also read the =README.org= of the [[layers/][relevant layer(s)]]. + +If your question is not answered there, then please come into our [[https://gitter.im/syl20bnr/spacemacs][gitter chat]] to +discuss it with us :relaxed:. We will direct you to a solution, or ask you to +open an issue if it is needed. + +* Reporting issues +Issues have to be reported on our [[https://github.com/syl20bnr/spacemacs/issues][issues tracker]]. Please: + +- Check that the issue has not already been reported. + - This can be achieved by searching keywords on the [[https://github.com/syl20bnr/spacemacs/issues][issues tracker]]. +- Check that the issue has not been fixed in the =develop= version of Spacemacs. + - This can be achieved by running Spacemacs on the =develop= branch and trying + to reproduce the bug here. You can also check at the [[https://github.com/syl20bnr/spacemacs/tree/develop][source code]] to see if + it has been changed/corrected. +- Try to use a clear title, and describe your problem with complete sentences. + See also [[https://github.com/syl20bnr/spacemacs/wiki/Debugging#how-to-make-a-great-bug-report][How to make a great bug report]] in the wiki. +- Include the following information in your issue: + - The output of =SPC h d s= (=M-m h d s= in Emacs style), which gives the + versions information about your installation. + - If relevant, include the mode in which the problem arise (e.g. javascript + files, =org-mode=, etc…). + - If possible, try to include details on how to reproduce it, like a step by + step guide. + +* Contributing code +Code contributions are welcome. Please read the following sections carefully. In +any case, feel free to join us on the [[https://gitter.im/syl20bnr/spacemacs][gitter chat]] to ask questions about +contributing! + +** General contribution guidelines + +*** License +The license is =GPLv3= for all parts specific to Spacemacs, this includes: +- The initialization and core files +- All the layer files. + +For files not belonging to Spacemacs like local packages and libraries, refer +to the header file. Those files should not have an empty header, we may not +accept code without a proper header file. + +*** Conventions +Spacemacs is based on conventions, mainly for naming functions, keybindings +definition and writing documentation. Please read the [[file:doc/CONVENTIONS.org][CONVENTIONS.org]] file +before your first contribution to get to know them. + +*** Pull-Request +Submit your contribution against the =develop= branch. You should not use +your =master= branch to modify Spacemacs, this branch is considered to be +read-only. + +You may want to [[https://github.com/syl20bnr/spacemacs/wiki/Beginner%27s-Guide-to-Contributing-a-Pull-Request-to-Spacemacs][read our beginner’s guide for Pull Requests]]. + +/PR = Pull-Request/ + +**** Ideally for /simple/ PRs (most of them): +- Branch from =develop= +- One topic per PR +- One commit per PR +- If you have several commits on different topics, close the PR and + create one PR per topic +- If you still have several commits, squash them into only one commit +- Rebase your PR branch on top of upstream =develop= before submitting + the PR + +Those PRs are usually /cherry-picked/. + +**** For complex PRs (big refactoring, etc): +- Squash only the commits with uninteresting changes like typos, syntax fixes, + etc... and keep the important and /isolated/ steps in different commits. + +Those PRs are /merged/ and explicitly /not fast-forwarded/. + +*** Commit messages +Write commit messages according to adapted [[http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html][Tim Pope's guidelines]]: + +- Use present tense and write in the imperative: “Fix bug”, not “fixed bug” or + “fixes bug”. +- Start with a capitalized, short (72 characters or less) summary, followed by a + blank line. +- If necessary, add one or more paragraphs with details, wrapped at 72 + characters. +- Separate paragraphs by blank lines. + +This is a model commit message: + +#+begin_EXAMPLE +Capitalized, short (72 chars or less) summary + +More detailed explanatory text, if necessary. Wrap it to about 72 +characters or so. In some contexts, the first line is treated as the +subject of an email and the rest of the text as the body. The blank +line separating the summary from the body is critical (unless you omit +the body entirely); tools like rebase can get confused if you run the +two together. + +Write your commit message in the imperative: "Fix bug" and not "Fixed bug" +or "Fixes bug." This convention matches up with commit messages generated +by commands like git merge and git revert. + +Further paragraphs come after blank lines. + +- Bullet points are okay, too + + - Typically a hyphen or asterisk is used for the bullet, followed by a + single space, with blank lines in between, but conventions vary here + + - Use a hanging indent +#+end_EXAMPLE + +[[https://github.com/magit/magit/][Git Commit]] and [[https://github.com/magit/magit/][Magit]] provide Emacs mode for Git commit messages, which helps you +to comply to these guidelines. + +** Contributing a layer +Please read the [[file:doc/LAYERS.org][layers documentation]] first. + +It is recommended to use the =configuration-layer/create-layer= command in order +to create a layer, as it will take care of using the files templates and will +also create the file headers correctly. + +Contributed configuration layers are stored in the =layers/= folder. The +=layers/= folder also contains categories prefixed with =+= to put your layers +in. For example a layer for a language would go in the =layers/+lang/= folder. + +Layer with no associated configuration will be rejected. For instance a layer +with just a package and a hook can be easily replaced by the usage of the +variable =dotspacemacs-additional-packages=. + +*** File header +The file header for =elisp= files should look like the following template: + +#+BEGIN_EXAMPLE + ;;; FILENAME --- NAME Layer packages File for Spacemacs + ;; + ;; Copyright (c) 2012-2016 Sylvain Benner & Contributors + ;; + ;; Author: YOUR_NAME + ;; URL: https://github.com/syl20bnr/spacemacs + ;; + ;; This file is not part of GNU Emacs. + ;; + ;;; License: GPLv3 +#+END_EXAMPLE + +You should replace =FILENAME= by the name of the file (e.g. =packages.el=) +and =NAME= by the name of the layer you are creating, don't forget to replace +=YOUR_NAME= and =YOUR_EMAIL= also. Some files already have a template inside +=core/templates/=, so look in there first. +Note that if you use =configuration-layer/create-layer=, spacemacs will prepare +files and headers for you, and for free :smile: ! + +*** Author of a new layer +In the files header, change the default author name (=Sylvain Benner=) to your +name. + +*** Contributor to an existing layer +If you are contributing to an already existing layer, you should not modify any +header file. + +** Contributing a keybinding +Keybindings are an important part of spacemacs. + +First if you want to have some personal keybindings, you can freely bind them +inside the ~SPC o~ and ~SPC m o~ prefixes which are reserved for the user. This +can be done from the =dotspacemacs/user-config= function of your =.spacemacs= +file and don't require any contribution to Spacemacs. + +If you think it worth contributing a new key bindings then be sure to read +the [[doc/CONVENTIONS.org][CONVENTIONS.org]] file to find the best key bindings, then create a +Pull-Request with your changes. + +*ALWAYS* document your new keybindings or keybindings changes inside the +relevant documentation file. It should be the layer's =README.org= file for +layer's keybindings, or =DOCUMENTATION.org= for general Spacemacs key +bindings. + +** Contributing a banner +The startup banner is by default the Spacemacs logo but there are also ASCII +banners available in the directory =core/banners/=. + +If you have some ASCII skills you can submit your artwork! + +You are free to choose a reasonable height size but the width size should be +around 75 characters. + +* Additional information +** Testing +Tests live in the =tests/= folder, with a folder structure corresponding to the +rest of the repository. + +To run tests locally, navigate to the relevant subfolder and run =make=. + +Spacemacs uses Travis CI to perform more comprehensive testing, where each +testable layer is enabled in turn. + +To add tests for a layer, do the following: + +1. Create a subfolder of =tests/= corresponding to the layer you want to test. +2. Write a file called =dotspacemacs.el= in that folder. It should be a minimal + dotfile that enables the layer in question (and other layers it may depend + on). +3. Write a number of files with tests. Please try to separate unit and + functional tests. Look at existing tests for clues. +4. Write a =Makefile= in that folder. It should define three variables. + - =LOAD_FILES= :: a list of additional files to load before testing (relative + to the root Spacemacs folder). This should typically be =init.el=. + - =UNIT_TEST_FILES= :: a list of unit test files in the current folder. + - =FUNC_TEST_FILES= :: a list of functional test files in the current folder. + See existing tests for examples. + #+begin_src makefile + TEST_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + + LOAD_FILES = ... + UNIT_TEST_FILES = ... + FUNC_TEST_FILES = ... + + include ../../spacemacs.mk + #+end_src +5. Add the new test to list of tests in =travis/run_build.sh=. + +* Credits + +This =CONTRIBUTING.org= file is partially based on the [[https://github.com/rails/rails/blob/master/CONTRIBUTING.md][Rails Contribution +guidelines]] and [[https://github.com/flycheck/flycheck/blob/master/CONTRIBUTING.md][Flycheck Contribution guidelines]]. diff --git a/emacs.d/README.md b/emacs.d/README.md new file mode 100644 index 0000000..8555d27 --- /dev/null +++ b/emacs.d/README.md @@ -0,0 +1,455 @@ + +Made with SpacemacsTwitter
+*** +

Spacemacs

+

+philosophy +| +for whom? +| +screenshots +| +documentation +| +contribute +| +achievements +| +FAQ +

+*** +

+Gitter +Build Status +PR being merged +Donate +Donate +Recommend it +

+*** + +**Quick Install:** + + git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d + + +**Table of Contents** + +- [Introduction](#introduction) +- [Features](#features) +- [Documentation](#documentation) +- [Getting Help](#getting-help) +- [Prerequisites](#prerequisites) + - [Emacs](#emacs) + - [Linux distros](#linux-distros) + - [macOS](#macos) + - [Windows](#windows) +- [Install](#install) + - [Default installation](#default-installation) + - [Alternate installations](#alternate-installations) + - [Modify HOME environment variable](#modify-home-environment-variable) + - [Modify spacemacs-start-directory variable](#modify-spacemacs-start-directory-variable) + - [Spacemacs logo](#spacemacs-logo) +- [Update](#update) + - [Automatic update (on master branch)](#automatic-update-on-master-branch) + - [Manual update (on master branch)](#manual-update-on-master-branch) + - [On develop branch](#on-develop-branch) + - [Revert to a specific version](#revert-to-a-specific-version) +- [Quotes](#quotes) +- [Contributions](#contributions) +- [Communities](#communities) +- [License](#license) +- [Supporting Spacemacs](#supporting-spacemacs) + + + +# Introduction + +Spacemacs is a new way to experience Emacs -- a sophisticated and +polished set-up focused on ergonomics, mnemonics and consistency. + +Just clone it, launch it, then press the space bar to explore the +interactive list of carefully-chosen key bindings. You can also press +the home buffer's `[?]` button for some great first key bindings to +try. + +Spacemacs can be used naturally by both Emacs and Vim users -- you can +even mix the two editing styles. Switching easily between input styles +makes Spacemacs a great tool for pair-programming. + +Spacemacs is currently in beta, and contributions are very welcome. + +![spacemacs_python](doc/img/spacemacs-python.png) + +# Features + +- **Great documentation:** access documentation in Emacs with +SPC h SPC. +- **Beautiful GUI:** you'll love the distraction free UI and its functional +mode-line. +- **Excellent ergonomics:** all the key bindings are accessible by pressing +the space bar or alt-m. +- **Mnemonic key bindings:** commands have mnemonic prefixes like +SPC b for all the buffer commands or SPC p for the +project commands. +- **Batteries included:** discover hundreds of ready-to-use packages nicely +organised in configuration layers following a set of +[conventions][CONVENTIONS.org]. + +# Documentation + +Comprehensive documentation is available for each layer by pressing +SPC h SPC. + +You can also check the [general documentation][DOCUMENTATION.org], +[quick start guide][QUICK_START.org] and the [FAQ][FAQ.org]. + +# Getting Help + +If you need help, ask your question in the [Gitter Chat][] and a member of the +community will help you out. + +If you prefer IRC, connect to the [Gitter Chat IRC server][] and join the +`#syl20bnr/spacemacs` channel. + +# Prerequisites + +## Emacs + +Spacemacs requires Emacs 24.4 or above. The development version of Emacs (at the +time of writing, this is 25.2) is not *officially* supported, but should +nevertheless be expected to work. + +Some modes require third-party tools that you'll have to install via your +favorite package manager. + +### Linux distros + +Install Emacs from the package manager of your Linux distribution. + +You should install the "emacs" package, not the "xemacs" package. +XEmacs is an old fork of Emacs. The X in its name is unrelated to X11. +Both Emacs and XEmacs have graphical support. + +**Note:** Ubuntu LTS 12.04 and 14.04 repositories have only Emacs 24.3 +available. You have to [build from source][build_source] Emacs 24.4 or greater, +as Spacemacs won't work with 24.3. The same may be true for other distributions +as well. + +### macOS + +The recommended way of installing Emacs on macOS is using [homebrew][]: + +```sh +$ brew tap d12frosted/emacs-plus +$ brew install emacs-plus +$ brew linkapps emacs-plus +``` + +*Note:* these homebrew commands will install GNU Emacs, and link it to your +`/Applications` directory. You still need to run the `git clone` mentioned at +the start of this file. That will populate your `~/.emacs.d` directory, which is +what transforms a regular GNU Emacs into Spacemacs. + +*Note:* the proposed `emacs-plus` tap is identical to the `emacs` formulae, it +just builds GNU Emacs with support of several features by default along with +providing Spacemacs icon. +See [emacs-plus](https://github.com/d12frosted/homebrew-emacs-plus) for more +information. + +*Note:* after you have completed the [install process](#install) below, it is +also recommended to add the [osx layer][] to your [dotfile][]. Install +instructions are available in the [osx layer][] documentation. + +*Note:* if the powerline separators on the spaceline are a different (less +saturated) color than the rest of the line, you can add following snippet to +`dotspacemacs/user-config` in your `.spacemacs` file. + +```elisp +(setq ns-use-srgb-colorspace nil) +``` + +Keep in mind that this is not ideal solution as it affects all colours in Emacs. +Another option is to use different powerline separator. For example, `alternate` +and `bar` diminishes the difference. And using `utf-8` separator makes it go +away completely without the need to change colour space. In order to change +powerline separator put following snippet in `dotspacemacs/user-config`. + +```eslip +(setq powerline-default-separator 'utf-8) +``` + +For more information about powerline separators, please refer to appropriate +section in [Documentation][DOCUMENTATION.org]. + +### Windows + +You can download good quality builds from the [emacs-w64 project][emacs-for-windows]. +It is recommended to install the most recent [stable build][emacs-for-windows-stable]. + +Be sure to declare a environment variable named `HOME` pointing to your user +directory `C:\Users\`. Then you can clone Spacemacs in this directory. + +Sometimes you'll get the following error when you first start Emacs: + +``` +The directory ~/.emacs.d/server is unsafe +``` + +To fix it change the owner of the directory `~/.emacs.d/server`: + - from Properties select the Tab “Security”, + - select the button “Advanced”, + - select the Tab “Owner” + - change the owner to your account name + +Source: [Stack Overflow][so-server-unsafe] + +For efficient searches we recommend to install `pt` ([the platinum searcher][]). +`pt` version 1.7.7 or higher is required. + +# Install + +## Default installation + +1. If you have an existing Emacs configuration, back it up first: + + ```sh + cd ~ + mv .emacs.d .emacs.d.bak + mv .emacs .emacs.bak + ``` + + Don't forget to backup and *remove* `~/.emacs` file otherwise Spacemacs + **WILL NOT** load since that file prevents Emacs from loading the proper + initialization file. + +2. Clone the repository: + + ```sh + git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d + ``` + + `master` is the stable branch and it is _immutable_, **DO NOT** make any + modification to it or you will break the update mechanism. If you want to + fork Spacemacs safely use the `develop` branch where you handle the update + manually. + +3. (Optional) Install the [Source Code Pro][] font. + + If you are running in terminal you'll also need to change font settings of + your terminal. + +4. Launch Emacs. Spacemacs will automatically install the packages it requires. + If you get an error regarding package downloads then you may try to disable + the HTTPS protocol by starting Emacs with + + ```sh + emacs --insecure + ``` + + Or you can set the `dotspacemacs-elpa-https` to `nil` in your dotfile to + remove the need to start Emacs with `--insecure` argument. You may wish to + clear out your `.emacs.d/elpa` directory before doing this, so that any + corrupted packages you may have downloaded will be re-installed. + +5. Restart Emacs to complete the installation. + +If the mode-line turns red then be sure to consult the [FAQ][FAQ.org]. + +## Alternate installations + +It may be useful to clone Spacemacs outside Emacs dotdirectory `~/.emacs.d` so +you can try Spacemacs without replacing completely our own configuration. +There is currently two possibilities to support alternative location for +Spacemacs configuration. + +### Modify HOME environment variable + +This solution is ideal to quickly try Spacemacs without compromising your +existing configuration. + +```sh +mkdir ~/spacemacs +git clone https://github.com/syl20bnr/spacemacs.git ~/spacemacs/.emacs.d +HOME=~/spacemacs emacs +``` + +Note: If you're on Fish shell, you will need to modify the last command to: `env +HOME=$HOME/spacemacs emacs` + +### Modify spacemacs-start-directory variable + +This solution is better suited to "embed" Spacemacs into your own configuration. +Say you cloned Spacemacs in `~/.emacs.d/spacemacs/` then drop these lines in +`~/.emacs.d/init.el`: + +```elisp +(setq spacemacs-start-directory "~/.emacs.d/spacemacs/") +(load-file (concat spacemacs-start-directory "init.el")) +``` + +## Spacemacs logo + +For Ubuntu users, follow this guide to +[change the logo in Unity][cpaulik-unity-icon]. + +For Mac users, you need to [download the .icns version of the logo][icon-repository], +then [change the logo on Dock][icon-mac-instructions]. + +# Update + +Spacemacs has a built-in notification of a new version when you are on the +`master` branch. If you are on the `develop` branch then you'll have to +update Spacemacs manually by updating your repository. + +## Automatic update (on master branch) + +When a new version is available a little arrow appears in the mode-line. + +Its color depends on the number of versions available since your last update. +Green means that your current version is recent, orange and red mean that your +current version is older. + +![powerline_update](doc/img/powerline-update.png) + +Click on the arrow to update Spacemacs to the last version. + +## Manual update (on master branch) + +(Remove the angle brackets when typing the lines below into your shell.) + +```sh +git fetch +git reset --hard +``` + +## On develop branch + +1. Update Emacs packages by clicking (press `RET`) on the `[Update Packages]` link of +the starting page. + +2. Close Emacs and update the git repository: + + ```sh + git pull --rebase + ``` + +3. Restart Emacs to complete the upgrade. + +## Revert to a specific version + +To revert to a specific version you just have to checkout the corresponding +branch, for instance to revert to the last `0.103`: + + ```sh + git checkout origin/release-0.103 + ``` + +**After you update, either manually, or automatically, you are advised to update + your packages by clicking the `[Update Packages]` button on the Spacemacs Home + Buffer.** + +# Quotes + +[Quote][quote01] by [ashnur](https://github.com/ashnur): + + «I feel that spacemacs is an aircraft carrier and I am playing table tennis on the deck as a freerider.» + +[Quote][quote02] by [deuill](https://github.com/deuill): + + «I LOVE SPACEMACS AND MAGIT + + That is all» + +# Contributions + +Spacemacs is a community-driven project, it needs _you_ to keep it up to +date and propose great and useful configuration for all the things! + +Before contributing be sure to consult the +[contribution guidelines][CONTRIBUTING.org] and [conventions][CONVENTIONS.org]. + +Here is a throughput graph of the repository for the last few weeks: + +[![Throughput Graph](https://graphs.waffle.io/syl20bnr/spacemacs/throughput.svg)](https://waffle.io/syl20bnr/spacemacs/metrics) + +# Communities + +- [Gitter Chat] +- [Stack Exchange] +- [Reddit] + +# License + +The license is GPLv3 for all parts specific to Spacemacs, this includes: +- the initialization and core files +- all the layer files +- the documentation + +For the packages shipped in this repository you can refer to the files header. + +[Spacemacs logo][] by [Nasser Alshammari][] released under a [Creative Commons Attribution-ShareAlike 4.0 International License.](http://creativecommons.org/licenses/by-sa/4.0/) + +# Supporting Spacemacs + +The best way to support Spacemacs is to contribute to it either by reporting +bugs, helping the community on the [Gitter Chat][] or sending pull requests. + +You can show your love for the project by getting cool Spacemacs t-shirts, mugs +and more in the [Spacemacs Shop][]. + +If you want to show your support financially you can contribute to [Bountysource][] or buy a drink for the +maintainer by clicking on the [Paypal badge](#top). + +If you used spacemacs in a project and you want to show that fact, you can use +the spacemacs badge: [![Built with Spacemacs](https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg)](http://spacemacs.org) + +- For Markdown: + + ``` + [![Built with Spacemacs](https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg)](http://spacemacs.org) + ``` + +- For HTML: + + ``` + + ``` + +- For Org-mode: + + ``` + [[http://spacemacs.org][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]] + ``` + +Thank you! + +[Twitter]: http://i.imgur.com/tXSoThF.png +[CONTRIBUTING.org]: CONTRIBUTING.org +[CONVENTIONS.org]: http://spacemacs.org/doc/CONVENTIONS +[DOCUMENTATION.org]: http://spacemacs.org/doc/DOCUMENTATION +[QUICK_START.org]: http://spacemacs.org/doc/QUICK_START +[FAQ.org]: http://spacemacs.org/doc/FAQ +[VIMUSERS.org]: http://spacemacs.org/doc/VIMUSERS +[dotfile]: http://spacemacs.org/doc/DOCUMENTATION#orgheadline45 +[osx layer]: http://spacemacs.org/layers/+os/osx/README.html +[Gitter Chat]: https://gitter.im/syl20bnr/spacemacs +[Gitter Chat IRC server]: https://irc.gitter.im/ +[homebrew]: http://brew.sh +[emacs-for-windows]: http://emacsbinw64.sourceforge.net/ +[emacs-for-windows-stable]: https://sourceforge.net/projects/emacsbinw64/files/release/ +[the platinum searcher]: https://github.com/monochromegane/the_platinum_searcher +[so-server-unsafe]: http://stackoverflow.com/questions/885793/emacs-error-when-calling-server-start +[Spacemacs logo]: https://github.com/nashamri/spacemacs-logo +[Nasser Alshammari]: https://github.com/nashamri +[cpaulik-unity-icon]: http://splendidabacus.com/posts/2015/03/spacemacs-unity-icon/ +[icon-mac-instructions]: http://www.idownloadblog.com/2014/07/16/how-to-change-app-icon-mac/ +[icon-repository]: https://github.com/nashamri/spacemacs-logo +[Stack Exchange]: http://emacs.stackexchange.com/questions/tagged/spacemacs +[Reddit]: https://www.reddit.com/r/spacemacs +[quote01]: https://gitter.im/syl20bnr/spacemacs?at=568e627a0cdaaa62045a7df6 +[quote02]: https://gitter.im/syl20bnr/spacemacs?at=5768456c6577f032450cfedb +[build_source]: https://www.gnu.org/software/emacs/manual/html_node/efaq/Installing-Emacs.html +[Bountysource]: https://salt.bountysource.com/teams/spacemacs +[Source Code Pro]: https://github.com/adobe-fonts/source-code-pro +[Spacemacs Shop]: https://shop.spreadshirt.com/spacemacs-shop diff --git a/emacs.d/assets/spacemacs-badge.svg b/emacs.d/assets/spacemacs-badge.svg new file mode 100644 index 0000000..055e527 --- /dev/null +++ b/emacs.d/assets/spacemacs-badge.svg @@ -0,0 +1,166 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + built with + built with + Spacemacs + Spacemacs + + + + + + + + diff --git a/emacs.d/assets/spacemacs.svg b/emacs.d/assets/spacemacs.svg new file mode 100644 index 0000000..fa8a768 --- /dev/null +++ b/emacs.d/assets/spacemacs.svg @@ -0,0 +1,405 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emacs.d/core/aprilfool/zemacs.el b/emacs.d/core/aprilfool/zemacs.el new file mode 100644 index 0000000..55bc519 --- /dev/null +++ b/emacs.d/core/aprilfool/zemacs.el @@ -0,0 +1,119 @@ +;;; zemacs.el --- Spacemacs 2016 April Fools 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 + +(setq spacemacs-buffer-name "*zemacs*") +(setq spacemacs-buffer-logo-title "[Z E M A C S]") +(setq spacemacs-buffer-version-info "af-1.01") + +(define-minor-mode zemacs-buffer-mode + "Zemacs major mode for startup screen." + :lighter "ToTheMAX" + (if zemacs-buffer-mode + (progn + (spacemacs/set-leader-keys-for-major-mode 'spacemacs-buffer-mode + (kbd "aprilfool") 'next-next-NEXT-millennium) + (zemacs//insert-links)) + ;; restore the true one + (ad-disable-advice 'configuration-layer/initialize + 'before 'zemacs/initialize) + (ad-activate 'configuration-layer/initialize) + (ad-disable-advice 'spacemacs-buffer//inject-version + 'around 'zemacs/inject-version) + (ad-activate 'spacemacs-buffer//inject-version) + (ad-disable-advice 'spacemacs-buffer/insert-banner-and-buttons + 'after 'zemacs/insert-banner-and-buttons) + (ad-activate 'spacemacs-buffer/insert-banner-and-buttons) + (load-file (concat spacemacs-start-directory "core/core-spacemacs-buffer.el")) + (setq dotspacemacs-startup-banner 'official) + (kill-buffer) + (insert " +───█──█─█▀▀█─█▀▀█─█▀▀█─█──█─── +───█▀▀█─█▄▄█─█▀▀▀─█▀▀▀─▀▀▀█─── +───█──█─█──█─█────█────█▄▄█─── +────────────────────────────── +───█▀▀█─█▀▀█─█▀▀█─▀▀█▀▀─█───── +───█▄▄█─█▀▀▀─█▀▀▄───█───█───── +───█──█─█────█──█─▄▄█▄▄─█▄▄─── +────────────────────────────── +──█▀▀▀─▄▀▀▀▄─▄▀▀▀▄─█────▄▀▀▀── +──█▀▀▀─█───█─█───█─█────▀▀▀▄── +──█────▀▄▄▄▀─▀▄▄▄▀─█▄▄▄─▄▄▄▀── +────────────────────────────── +──────────▄▄███████▄▄───────── +───────▄███████████████▄────── +────▄██████▀────────▀█████▄─── +──▄█████▀──────────────▀████▄─ +▄████▀────▄██▄────▄██▄───▀████ +██▀───────████────████─────▀██ +██────────████────████──────██ +██────────▀██▀────▀██▀──────██ +██──────────────────────────██ +██──█▄──────────────────▄█──██ +██──█▀██▄──────────────▄██──██ +██──█──▀██▄──────────▄▄█─█──██ +██──█────▀████████████▀──█──██ +██──█─────█────█────█────█──██ +██──█─────█────█────█────█──██ +██──██▄───█────█────█──▄██──██ +██──██████████████████████──██ +██──█─────█────█────█────█──██ +██──█─────█────█────█────█──██ +██──██────█────█────█───█▀──██ +██───▀██████████████████▀───██ +██▄───────────────────────▄███ +█████▄──────────────────▄█████ +─▀███████▄───────────▄██████▀─ +────▀█████████████████████▀─── ") + (spacemacs-buffer/goto-buffer) + (spacemacs-buffer//remove-existing-widget-if-exist))) + +(defun next-next-NEXT-millennium () + "Time to rock on!" + (interactive) + (zemacs-buffer-mode -1)) + +(defvar zemacs--links '(("this one" "http://neovim.io") + ("link" "http://cdn.meme.am/instances/500x/67641307.jpg") + ("Atom" "http://atom.io/") + ("implementation tricks" "http://emacshorrors.com/"))) + +(defun zemacs//insert-links () + "Replace bracketed texts by their link counterparts." + (with-current-buffer spacemacs-buffer-name + (save-excursion + (dolist (l zemacs--links) + (re-search-backward (format "\\(\\[%s\\]\\)" (car l)) nil t) + (make-text-button + (match-beginning 1) + (match-end 1) + 'type 'help-url + 'help-args (cdr l)))))) + +(defadvice configuration-layer/initialize (before zemacs/initialize activate) + (setq dotspacemacs-startup-banner "~/.emacs.d/core/banners/img/zemacs.png")) + +(defadvice spacemacs-buffer//inject-version + (around zemacs/inject-version activate) + (let ((emacs-version "99.9999999") + (dotspacemacs-distribution "zemacs") + (spacemacs-version "af-1.01")) + ad-do-it)) + +(defadvice spacemacs-buffer/insert-banner-and-buttons + (after zemacs/insert-banner-and-buttons activate) + ;; always display the release note + (spacemacs-buffer//insert-release-note-widget + (concat spacemacs-release-notes-directory + spacemacs-buffer-version-info ".txt"))) + +(add-hook 'emacs-startup-hook 'zemacs-buffer-mode t) + +(provide 'zemacs) diff --git a/emacs.d/core/banners/000-banner.txt b/emacs.d/core/banners/000-banner.txt new file mode 100644 index 0000000..ac629f1 --- /dev/null +++ b/emacs.d/core/banners/000-banner.txt @@ -0,0 +1,8 @@ + +Welcome to +███████╗██████╗**█████╗**██████╗███████╗███╗***███╗*█████╗**██████╗███████╗ B +██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝████╗*████║██╔══██╗██╔════╝██╔════╝ E +███████╗██████╔╝███████║██║*****█████╗**██╔████╔██║███████║██║*****███████╗ T +╚════██║██╔═══╝*██╔══██║██║*****██╔══╝**██║╚██╔╝██║██╔══██║██║*****╚════██║ A +███████║██║*****██║**██║╚██████╗███████╗██║*╚═╝*██║██║**██║╚██████╗███████║ +╚══════╝╚═╝*****╚═╝**╚═╝*╚═════╝╚══════╝╚═╝*****╚═╝╚═╝**╚═╝*╚═════╝╚══════╝ diff --git a/emacs.d/core/banners/001-banner.txt b/emacs.d/core/banners/001-banner.txt new file mode 100644 index 0000000..4a7db95 --- /dev/null +++ b/emacs.d/core/banners/001-banner.txt @@ -0,0 +1,9 @@ + +┏━━━┓ +┃┏━┓┃ Welcome to +┃┗━━┓╋╋╋╋┏━━┓╋╋╋╋┏━━┓╋╋╋╋┏━━┓╋╋╋╋┏━━┓╋╋╋╋┏┓┏┓╋╋╋╋┏━━┓╋╋╋╋┏━━┓╋╋╋╋┏━━┓ b +┗━━┓┃┏━━┓┃┏┓┃┏━━┓┃┏┓┃┏━━┓┃┏━┛┏━━┓┃┃━┫┏━━┓┃┗┛┃┏━━┓┃┏┓┃┏━━┓┃┏━┛┏━━┓┃━━┫ e +┃┗━┛┃┗━━┛┃┗┛┃┗━━┛┃┏┓┃┗━━┛┃┗━┓┗━━┛┃┃━┫┗━━┛┃┃┃┃┗━━┛┃┏┓┃┗━━┛┃┗━┓┗━━┛┣━━┃ t +┗━━━┛╋╋╋╋┃┏━┛╋╋╋╋┗┛┗┛╋╋╋╋┗━━┛╋╋╋╋┗━━┛╋╋╋╋┗┻┻┛╋╋╋╋┗┛┗┛╋╋╋╋┗━━┛╋╋╋╋┗━━┛ a +╋╋╋╋╋╋╋╋╋┃┃[The best editor is neither Emacs nor Vim, it's Emacs+Vim] +╋╋╋╋╋╋╋╋╋┗┛ diff --git a/emacs.d/core/banners/002-banner.txt b/emacs.d/core/banners/002-banner.txt new file mode 100644 index 0000000..0b79203 --- /dev/null +++ b/emacs.d/core/banners/002-banner.txt @@ -0,0 +1,9 @@ + +╭─┏━━━┓───────────────────────────────────────────────────────────────────╮ +│ ┃┏━┓┃ Welcome to │ +│ ┃┗━━┓ ┏━━┓ ┏━━┓ ┏━━┓ ┏━━┓ ┏┓┏┓ ┏━━┓ ┏━━┓ ┏━━┓ b │ +│ ┗━━┓┃┏━━┓┃┏┓┃┏━━┓┃┏┓┃┏━━┓┃┏━┛┏━━┓┃┃━┫┏━━┓┃┗┛┃┏━━┓┃┏┓┃┏━━┓┃┏━┛┏━━┓┃━━┫ e │ +│ ┃┗━┛┃┗━━┛┃┗┛┃┗━━┛┃┏┓┃┗━━┛┃┗━┓┗━━┛┃┃━┫┗━━┛┃┃┃┃┗━━┛┃┏┓┃┗━━┛┃┗━┓┗━━┛┣━━┃ t │ +│ ┗━━━┛ ┃┏━┛ ┗┛┗┛ ┗━━┛ ┗━━┛ ┗┻┻┛ ┗┛┗┛ ┗━━┛ ┗━━┛ a │ +│ ┃┃[The best editor is neither Emacs nor Vim, it's Emacs+Vim] │ +╰──────────┗┛─────────────────────────────────────────────────────────────╯ diff --git a/emacs.d/core/banners/003-banner.txt b/emacs.d/core/banners/003-banner.txt new file mode 100644 index 0000000..2ed2dfe --- /dev/null +++ b/emacs.d/core/banners/003-banner.txt @@ -0,0 +1,17 @@ + +⠀⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⣠⣾⣿⣿⣿⣷⣶⣤⣀⡤⣤⡒⢖⠖⢖⢒⠢⠤⢄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠠⣿⠛⠉⠁⢉⣹⢿⣿⣿⣿⣷⣼⢸⢸⢨⠢⡡⢑⡠⠀⠑⠢⢄⠀⠀⠀⠀⠀⠀ +⠨⡃⠀⢀⡴⡣⣗⢵⣣⢟⣟⣿⣿⣿⣎⡎⡎⡜⡐⢽⣾⡄⠀⠈⠑⢄⠀⠀⠀⠀ +⠀⢇⣠⢯⡪⣯⣺⢽⢾⣽⡽⣾⣺⣝⢿⣿⣼⢨⠢⡑⢿⣷⠀⠀⠀⠀⠳⡀⠀⠀ +⠀⡸⡪⡪⣿⣾⣺⡽⣿⣳⢯⡿⣵⢷⣝⢼⢻⣯⣎⠢⢹⣿⣇⠀⠀⠀⠀⠱⡀⠀ +⢰⡫⢪⢪⡘⠿⣿⣿⣿⣾⣯⣿⢽⡳⣕⢇⢗⢜⢻⣧⡡⣿⣿⡄⠀⠀⠀⠀⢣⠀ Welcome to +⣞⢨⢊⢎⢆⠀⠀⠉⢿⣿⣿⣿⣿⣿⣷⣯⣮⣮⣦⣽⣿⣿⣿⣇⠀⠀⠀⠀⠈⡆ +⡧⢑⠔⡡⢣⠂⠀⠀⠀⢓⢝⢟⡻⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀⡇ [ S p a c e m a c s ] +⡏⠄⠡⢊⢂⢅⠀⠀⠀⠀⠇⡇⠎⢎⠢⡩⠛⠻⢿⣿⣿⣿⣿⣿⡆⠀⠀⠀⢀⠇ +⢸⡀⡁⢁⠂⡂⠀⠀⠀⠀⠈⠔⡑⠡⢊⠐⡈⠌⢀⠀⠙⠻⢿⣿⣷⠀⠀⠀⡸⠀ +⠀⢣⠀⠀⠠⠈⠀⠀⠀⠀⠀⠀⠂⠌⠐⠠⠀⠀⠀⠀⠀⠀⠀⠈⠙⠀⠀⢠⠃⠀ +⠀⠀⢣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠃⠀⠀ +⠀⠀⠀⠑⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⠀⠀⠀ +⠀⠀⠀⠀⠀⠙⠤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠔⠁⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀⠀⠀⠙⠒⠤⠤⣀⣀⣀⣀⣀⡠⠤⠔⠒⠉⠀⠀⠀⠀⠀⠀⠀⠀ diff --git a/emacs.d/core/banners/004-banner.txt b/emacs.d/core/banners/004-banner.txt new file mode 100644 index 0000000..68845e1 --- /dev/null +++ b/emacs.d/core/banners/004-banner.txt @@ -0,0 +1,17 @@ + +⠀⠀⠀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⢀⠎⠁⠀⠀⠈⠉⠒⠦⢀⡀⡄⡤⡤⡤⡤⡤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⡎⡠⠒⠉⠉⢑⢲⢀⠀⠀⠈⠪⢣⢫⡺⣹⡹⣝⠾⣻⣶⣤⡀⠀⠀⠀⠀⠀⠀ +⠀⢿⡅⠀⠠⡰⡊⡎⡪⢊⠢⡠⢀⠀⠘⠜⣜⢎⡯⣳⠀⠳⣻⣿⣷⡄⠀⠀⠀⠀ +⠀⢹⣇⡠⠫⡪⡊⡢⢊⠨⠨⡂⢕⢐⠄⡀⠈⢺⢸⣝⡆⠀⢻⣷⣿⣿⣦⡀⠀⠀ +⠀⠈⣟⢪⢇⠀⠑⠌⠢⠡⡃⠢⡑⡐⢅⢇⢆⠀⠑⢕⣯⡀⠀⢿⣿⣿⣿⣷⡀⠀ +⠀⣐⢵⢣⢻⣦⣀⠀⠀⠁⠈⠌⠢⡊⡜⡔⡕⡭⢆⠈⠺⡄⠀⠸⣿⣿⣿⣿⣧⠀ Welcome to +⠀⣵⡫⡮⡣⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠈⠘⠘⠙⠑⠀⠀⠀⠀⢿⣿⣿⣿⣿⡀ +⠀⣗⡯⣞⢵⢽⣿⣿⣿⣟⡕⡕⡤⡠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣿⣿⣿⣿⡆ [ S p a c e m a c s ] +⠀⣯⢿⣺⣝⢮⣿⣿⣿⣿⣿⡪⡮⣳⢝⡽⣲⢤⣄⡀⠀⠀⠀⠀⠈⣿⣿⣿⣿⠂ +⠀⢸⣿⡽⣾⣳⣻⣿⣿⣿⣿⣾⡽⣺⢵⡯⣯⣿⣳⡿⣷⣦⣄⠀⠀⢿⣿⣿⡟⠀ +⠀⠀⢺⣿⣯⣿⣽⣿⣿⣿⣿⣿⣿⣽⣯⣟⣿⣾⣿⣿⣿⣿⣿⣿⣶⣼⣿⡿⠁⠀ +⠀⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠁⠀⠀ +⠀⠀⠀⠀⠘⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠉⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠻⠻⠿⠿⠿⠛⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀ diff --git a/emacs.d/core/banners/998-banner.txt b/emacs.d/core/banners/998-banner.txt new file mode 100644 index 0000000..82978c4 --- /dev/null +++ b/emacs.d/core/banners/998-banner.txt @@ -0,0 +1,27 @@ + + ▄▄▄▄ ▄ + ▌▄ █▄ ▄▀▄▀▄ + ▌███ ▌ ▄▄▄▄▄▄ ▐ ███ ▌ + ▄▄▀ ░░ ▐░░▐░░░▐ ▀▄ ░░░ ▌▄ + ▄▀ ░░░░ ▐░░ ▌░▌░░ ▐ ░░░░░ ▀▄ + ▐ ░░░░░ ▐░░░▐▌░░░▐ ░░░░░░░░ ▌ + ▐ ░░░ ▄▀▀▄ ░░░░░░░ ▄▀▀▄ ░░░░░░ ▌ + ▐ ░░ ▀▄▄▀ ░░░░░ ▀▄▄▀ ░░░░ ▌ + --▐---------___▄▀▀▄__----------- ▌ + _▐_________--—▀▄▄▀--__________ ▌ + ▀▌ ░░░░░ ▄▄▌▐▄▄ ░░░░░░░░ ▐▀ + ▀▌ ░░ ▐▀▀ ▀▀▌ ░░░░ ▐▀ + ▀▌░ ░▐▀▀ + ▀▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▀▀ + ▐ ▌ + ▄▄▌ ▐▄▄ + ▄▄▀ ░░░ ▀▄▄ + ▄▄▌ ░░░░░░░░ ▐▄▄ + ▌ ░░░░░░░░░░░░░ ▐ + + ▄ ▄ | ███╗ ███╗ ██████╗ ███╗ ███╗ █████╗ ██████╗███████╗ + ▄ ░░▄▄▀▀▄▄░░ ▄ | ████╗ ████║██╔═══██╗████╗ ████║██╔══██╗██╔════╝██╔════╝ + ░░ ▄▀ ░░░░ ▀▄ ░░ | ██╔████╔██║██║ ██║██╔████╔██║███████║██║ ███████╗ + ▐░░░░░░░░░░▌ | ██║╚██╔╝██║██║ ██║██║╚██╔╝██║██╔══██║██║ ╚════██║ + ▀▄▄▄▄▄▄▄▄▀ | ██║ ╚═╝ ██║╚██████╔╝██║ ╚═╝ ██║██║ ██║╚██████╗███████║ + | ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚══════╝ diff --git a/emacs.d/core/banners/999-banner.txt b/emacs.d/core/banners/999-banner.txt new file mode 100644 index 0000000..8568c06 --- /dev/null +++ b/emacs.d/core/banners/999-banner.txt @@ -0,0 +1,26 @@ + + ░░░░░░░░░▄░░░░░░░░░░░░░░▄░░░░ + ░░░░░░░░▌▒█░░░░░░░░░░░▄▀▒▌░░░ + Such powerful ░░░░░░░░▌▒▒█░░░░░░░░▄▀▒▒▒▐░░░ + ░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐░░░ + ░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐░░░ Vim and Emacs + ░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌░░░ So love + ░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌░░ Much forbidden + ░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐░░ +Very modes ░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌░ + ░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌░ + ▀▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒▐░ + ▐▒▒▐▀▐▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌ + ▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐░ + ░▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌░ + ░▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐░░ + ░░▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌░░ + ░░░░▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀░░░ Wow. + ░░░░░░▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀░░░░░ + ░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▀▀░░░░░░░░ + ██████╗ ██████╗ ██████╗ ███████╗███╗ ███╗ █████╗ ██████╗███████╗ + ██╔══██╗██╔═══██╗██╔════╝ ██╔════╝████╗ ████║██╔══██╗██╔════╝██╔════╝ + ██║ ██║██║ ██║██║ ███╗█████╗ ██╔████╔██║███████║██║ ███████╗ + ██║ ██║██║ ██║██║ ██║██╔══╝ ██║╚██╔╝██║██╔══██║██║ ╚════██║ + ██████╔╝╚██████╔╝╚██████╔╝███████╗██║ ╚═╝ ██║██║ ██║╚██████╗███████║ + ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚══════╝ diff --git a/emacs.d/core/banners/img/heart.png b/emacs.d/core/banners/img/heart.png new file mode 100644 index 0000000..64282f9 Binary files /dev/null and b/emacs.d/core/banners/img/heart.png differ diff --git a/emacs.d/core/banners/img/spacemacs-badge.png b/emacs.d/core/banners/img/spacemacs-badge.png new file mode 100644 index 0000000..4c3cc12 Binary files /dev/null and b/emacs.d/core/banners/img/spacemacs-badge.png differ diff --git a/emacs.d/core/banners/img/spacemacs.png b/emacs.d/core/banners/img/spacemacs.png new file mode 100644 index 0000000..aa8953c Binary files /dev/null and b/emacs.d/core/banners/img/spacemacs.png differ diff --git a/emacs.d/core/banners/img/zemacs.png b/emacs.d/core/banners/img/zemacs.png new file mode 100644 index 0000000..2e261af Binary files /dev/null and b/emacs.d/core/banners/img/zemacs.png differ diff --git a/emacs.d/core/core-auto-completion.el b/emacs.d/core/core-auto-completion.el new file mode 100644 index 0000000..062b253 --- /dev/null +++ b/emacs.d/core/core-auto-completion.el @@ -0,0 +1,83 @@ +;;; core-auto-completion.el --- Spacemacs Core 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 + +;; Company ------------------------------------------------------------------- + +(defvar spacemacs-default-company-backends + '((company-dabbrev-code company-gtags company-etags company-keywords) + company-files company-dabbrev) + "The list of default company backends used by spacemacs. +This variable is used to configure mode-specific company backends in spacemacs. +Backends in this list will always be active in these modes, as well as any +backends added by individual spacemacs layers.") + +(defmacro spacemacs|defvar-company-backends (mode) + "Define a MODE specific company backend variable with default backends. +The variable name format is company-backends-MODE." + `(defvar ,(intern (format "company-backends-%S" mode)) + ',spacemacs-default-company-backends + ,(format "Company backend list for %S" mode))) + +(defmacro spacemacs|add-company-hook (mode) + "Enable company for the given MODE. +MODE must match the symbol passed in `spacemacs|defvar-company-backends'. +The initialization function is hooked to `MODE-hook'." + (let ((mode-hook (intern (format "%S-hook" mode))) + (func (intern (format "spacemacs//init-company-%S" mode))) + (backend-list (intern (format "company-backends-%S" mode)))) + `(when (configuration-layer/package-usedp 'company) + (defun ,func () + ,(format "Initialize company for %S" mode) + (when auto-completion-enable-snippets-in-popup + (setq ,backend-list (mapcar 'spacemacs//show-snippets-in-company + ,backend-list))) + (set (make-variable-buffer-local 'auto-completion-front-end) + 'company) + (set (make-variable-buffer-local 'company-backends) + ,backend-list)) + (add-hook ',mode-hook ',func t) + (add-hook ',mode-hook 'company-mode t)))) + +(defmacro spacemacs|disable-company (mode) + "Disable company for the given MODE. +MODE parameter must match the parameter used in the call to +`spacemacs|add-company-hook'." + (let ((mode-hook (intern (format "%S-hook" mode))) + (func (intern (format "spacemacs//init-company-%S" mode)))) + `(progn + (remove-hook ',mode-hook ',func) + (remove-hook ',mode-hook 'company-mode)))) + +(defun spacemacs//show-snippets-in-company (backend) + (if (or (not auto-completion-enable-snippets-in-popup) + (and (listp backend) (member 'company-yasnippet backend))) + backend + (append (if (consp backend) backend (list backend)) + '(:with company-yasnippet)))) + +;; Auto-complete ------------------------------------------------------------- + +(defmacro spacemacs|enable-auto-complete (mode) + "Enable auto-complete for the given MODE. +The initialization function is hooked to `MODE-hook'." + (let ((mode-hook (intern (format "%S-hook" mode))) + (func (intern (format "spacemacs//init-auto-complete-%S" mode)))) + `(when (configuration-layer/package-usedp 'auto-complete) + (defun ,func () + ,(format "Initialize auto-complete for %S" mode) + (set (make-variable-buffer-local 'auto-completion-front-end) + 'auto-complete) + (set (make-variable-buffer-local 'company-backends) + ,(intern (format "company-backends-%S" mode)))) + (add-hook ',mode-hook ',func) + (add-hook ',mode-hook 'auto-complete-mode)))) + +(provide 'core-auto-completion) diff --git a/emacs.d/core/core-command-line.el b/emacs.d/core/core-command-line.el new file mode 100644 index 0000000..e6f6a17 --- /dev/null +++ b/emacs.d/core/core-command-line.el @@ -0,0 +1,62 @@ +;;; core-command-line.el --- Spacemacs Core 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 + +(defvar spacemacs-force-resume-layouts nil + "If non-nil force the current emacs instance to resume layouts + at start time despite the value of `dotspacemacs-auto-resume-layouts'.") + +(defvar spacemacs-insecure nil + "If non-nil force Spacemacs to operate without secured protocols.") + +(defun spacemacs//parse-command-line (args) + "Handle Spacemacs specific command line arguments. +The reason why we don't use the Emacs hooks for processing user defined +arguments is that we want to process these arguments as soon as possible." + (let ((i 0) new-args) + (while (< i (length args)) + (let ((arg (nth i args)) + (next-arg-digit + (when (< (1+ i) (length args)) + (string-to-number (nth (1+ i) args))))) + (when (or (null next-arg-digit) (= 0 next-arg-digit)) + (setq next-arg-digit nil)) + (pcase arg + ("--profile" + (setq spacemacs-debug-with-profile t) + (setq spacemacs-debugp t)) + ("--timed-requires" + (setq spacemacs-debug-with-timed-requires t) + (when next-arg-digit + (setq spacemacs-debug-timer-threshold next-arg-digit + i (1+ i))) + (setq spacemacs-debugp t)) + ("--adv-timers" + (setq spacemacs-debug-with-adv-timers t) + (when next-arg-digit + (setq spacemacs-debug-timer-threshold next-arg-digit + i (1+ 1))) + (setq spacemacs-debugp t)) + ("--insecure" + (setq spacemacs-insecure t)) + ("--no-layer" + (setq configuration-layer-exclude-all-layers t)) + ("--distribution" + (setq configuration-layer-force-distribution (intern (nth (1+ i) args)) + i (1+ i))) + ("--resume-layouts" + (setq spacemacs-force-resume-layouts t)) + (_ (push arg new-args)))) + (setq i (1+ i))) + (nreverse new-args))) + +(setq command-line-args (spacemacs//parse-command-line command-line-args)) + +(provide 'core-command-line) diff --git a/emacs.d/core/core-configuration-layer.el b/emacs.d/core/core-configuration-layer.el new file mode 100644 index 0000000..c68d6e7 --- /dev/null +++ b/emacs.d/core/core-configuration-layer.el @@ -0,0 +1,2017 @@ +;;; core-configuration-layer.el --- Spacemacs Core 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 + +(require 'cl-lib) +(require 'eieio) +(require 'subr-x) +(require 'package) +(require 'warnings) +(require 'help-mode) +(require 'ht) +(require 'core-dotspacemacs) +(require 'core-funcs) +(require 'core-spacemacs-buffer) + +(defvar configuration-layer--refresh-package-timeout dotspacemacs-elpa-timeout + "Timeout in seconds to reach a package archive page.") + +(defconst configuration-layer-template-directory + (expand-file-name (concat spacemacs-core-directory "templates/")) + "Configuration layer templates directory.") + +(defconst configuration-layer-directory + (expand-file-name (concat spacemacs-start-directory "layers/")) + "Spacemacs contribution layers base directory.") + +(defconst configuration-layer-private-directory + (expand-file-name (concat spacemacs-start-directory "private/")) + "Spacemacs private layers base directory.") + +(defconst configuration-layer-private-layer-directory + (let ((dotspacemacs-layer-dir + (when dotspacemacs-directory + (expand-file-name + (concat dotspacemacs-directory "layers/"))))) + (if (and dotspacemacs-directory + (file-exists-p dotspacemacs-layer-dir)) + dotspacemacs-layer-dir + configuration-layer-private-directory)) + "Spacemacs default directory for private layers.") + +(defun configuration-layer/elpa-directory (root) + "Evaluate the correct package subdirectory of ROOT. This is +done according to the value of `dotspacemacs-elpa-subdirectory'. +If it is nil, then ROOT is returned. Otherwise a subdirectory of +ROOT is returned." + (if (not dotspacemacs-elpa-subdirectory) + root + (let ((subdir (if (eq 'emacs-version dotspacemacs-elpa-subdirectory) + (format "%d%s%d" + emacs-major-version + version-separator + emacs-minor-version) + (eval dotspacemacs-elpa-subdirectory)))) + (file-name-as-directory (expand-file-name subdir root))))) + +(defvar configuration-layer-rollback-directory + (concat spacemacs-cache-directory ".rollback/") + "Spacemacs rollback directory.") + +(defconst configuration-layer-rollback-info "rollback-info" + "Spacemacs rollback information file.") + +(defclass cfgl-layer () + ((name :initarg :name + :type symbol + :documentation "Name of the layer.") + (dir :initarg :dir + :initform nil + :type (satisfies (lambda (x) (or (null x) (stringp x)))) + :documentation "Absolute path to the layer directory.") + (packages :initarg :packages + :initform nil + :type list + :documentation "List of package symbols declared in this layer.") + (selected-packages :initarg :selected-packages + :initform 'all + :type (satisfies (lambda (x) (or (and (symbolp x) (eq 'all x)) + (listp x)))) + :documentation "List of selected package symbols.") + (variables :initarg :variables + :initform nil + :type list + :documentation "A list of variable-value pairs.") + (lazy-install :initarg :lazy-install + :initform nil + :type boolean + :documentation + "If non-nil then the layer needs to be installed") + (disabled :initarg :disabled-for + :initform nil + :type list + :documentation "A list of layers where this layer is disabled.") + (enabled :initarg :enabled-for + :initform 'unspecified + :type (satisfies (lambda (x) (or (listp x) (eq 'unspecified x)))) + :documentation (concat "A list of layers where this layer is enabled. " + "(Takes precedence over `:disabled-for'.)"))) + "A configuration layer.") + +(defmethod cfgl-layer-owned-packages ((layer cfgl-layer)) + "Return the list of owned packages by LAYER. +LAYER has to be installed for this method to work properly." + (delq nil (mapcar + (lambda (x) + (let ((pkg (configuration-layer/get-package x))) + (when (and pkg (eq (oref layer :name) + (car (oref pkg :owners)))) + pkg))) + (oref layer :packages)))) + +(defmethod cfgl-layer-owned-packages ((layer nil)) + "Accept nil as argument and return nil." + nil) + +(defmethod cfgl-layer-get-packages ((layer cfgl-layer)) + "Return the list of packages for LAYER." + (if (eq 'all (oref layer :selected-packages)) + (oref layer :packages) + (delq nil (mapcar + (lambda (x) + (let ((pkg-name (if (listp x) (car x) x))) + (when (memq pkg-name (oref layer :selected-packages)) x))) + (oref layer :packages))))) + +(defclass cfgl-package () + ((name :initarg :name + :type symbol + :documentation "Name of the package.") + (min-version :initarg :min-version + :initform nil + :type list + :documentation "Minimum version to install as a version list.") + (owners :initarg :owners + :initform nil + :type list + :documentation "The layer defining the init function.") + (pre-layers :initarg :pre-layers + :initform '() + :type list + :documentation "List of layers with a pre-init function.") + (post-layers :initarg :post-layers + :initform '() + :type list + :documentation "List of layers with a post-init function.") + (location :initarg :location + :initform elpa + :type (satisfies (lambda (x) + (or (stringp x) + (memq x '(built-in local site elpa)) + (and (listp x) (eq 'recipe (car x)))))) + :documentation "Location of the package.") + (toggle :initarg :toggle + :initform t + :type (satisfies (lambda (x) (or (symbolp x) (listp x)))) + :documentation + "Package is enabled/installed if toggle evaluates to non-nil.") + (step :initarg :step + :initform nil + :type (satisfies (lambda (x) (member x '(nil bootstrap pre)))) + :documentation "Initialization step.") + (lazy-install :initarg :lazy-install + :initform nil + :type boolean + :documentation + "If non-nil then the package needs to be installed") + (protected :initarg :protected + :initform nil + :type boolean + :documentation + "If non-nil then this package cannot be excluded.") + (excluded :initarg :excluded + :initform nil + :type boolean + :documentation + "If non-nil this package is excluded from all layers."))) + +(defmethod cfgl-package-enabledp ((pkg cfgl-package) &optional inhibit-messages) + "Evaluate the `toggle' slot of passed PKG." + (let ((message-log-max (unless inhibit-messages message-log-max)) + (toggle (oref pkg :toggle))) + (eval toggle))) + +(defmethod cfgl-package-get-safe-owner ((pkg cfgl-package)) + "Safe method to return the name of the layer which owns PKG." + ;; The owner of a package is the first *used* layer in `:owners' slot. + ;; Note: for packages in `configuration-layer--used-packages' the owner is + ;; always the car of the `:owners' slot. + (let ((layers (oref pkg :owners))) + (while (and (consp layers) + (not (configuration-layer/layer-usedp (car layers)))) + (pop layers)) + (when (configuration-layer/layer-usedp (car layers)) + (car layers)))) + +(defmethod cfgl-package-set-property ((pkg cfgl-package) slot value) + "Set SLOT to the given VALUE for the package PKG. +If `configuration-layer--package-properties-read-onlyp' is non-nil then VALUE +is not set for the given SLOT." + (unless configuration-layer--package-properties-read-onlyp + (eval `(oset pkg ,slot value)))) + +(defvar configuration-layer--elpa-archives + '(("melpa" . "melpa.org/packages/") + ("org" . "orgmode.org/elpa/") + ("gnu" . "elpa.gnu.org/packages/")) + "List of ELPA archives required by Spacemacs.") + +(defvar configuration-layer-exclude-all-layers nil + "If non nil then only the distribution layer is loaded.") + +(defvar configuration-layer-force-distribution nil + "If set, bypass the user's choice `dotspacemacs-distribution'.") + +(defvar configuration-layer--package-archives-refreshed nil + "Non nil if package archives have already been refreshed.") + +(defvar configuration-layer--load-packages-files nil + "If non-nil force loading `packages.el' files when creating layer objects.") + +(defvar configuration-layer--used-layers '() + "A non-sorted list of used layer names.") + +(defvar configuration-layer--indexed-layers (make-hash-table :size 1024) + "Hash map to index `cfgl-layer' objects by their names.") + +(defvar configuration-layer--used-packages '() + "An alphabetically sorted list of used package names.") + +(defvar configuration-layer--indexed-packages (make-hash-table :size 2048) + "Hash map to index `cfgl-package' objects by their names.") + +(defvar configuration-layer--used-distant-packages '() + "A list of all distant packages that are effectively used.") + +(defvar configuration-layer--check-new-version-error-packages nil + "A list of all packages that were skipped during last update attempt.") + +(defvar configuration-layer--protected-packages nil + "A list of packages that will be protected from removal as orphans.") + +(defvar configuration-layer--lazy-mode-alist nil + "Association list where the key is a mode and the value a regexp.") + +(defvar configuration-layer--inhibit-warnings nil + "If non-nil then warning message emitted by the layer system are ignored.") + +(defvar configuration-layer--package-properties-read-onlyp nil + "If non-nil then package properties are read only and cannot be overriden by +`configuration-layer/make-package'.") + +(defvar configuration-layer--declared-layers-usedp nil + "If non-nil then declared layers are considered to be used.") + +(defvar configuration-layer-error-count nil + "Non nil indicates the number of errors occurred during the +installation of initialization.") + +(defvar configuration-layer-categories '() + "List of strings corresponding to category names. A category is a +directory with a name starting with `+'.") + +(defvar update-packages-alist '() + "Used to collect information about rollback packages in the +cache folder.") + +(defun configuration-layer/initialize () + "Initialize `package.el'." + (setq configuration-layer--refresh-package-timeout dotspacemacs-elpa-timeout) + (unless package--initialized + (setq configuration-layer-rollback-directory + (configuration-layer/elpa-directory configuration-layer-rollback-directory)) + (setq package-user-dir + (configuration-layer/elpa-directory package-user-dir)) + (setq package-archives (configuration-layer//resolve-package-archives + configuration-layer--elpa-archives)) + ;; optimization, no need to activate all the packages so early + (setq package-enable-at-startup nil) + (package-initialize 'noactivate))) + +(defun configuration-layer//install-quelpa () + "Install `quelpa'." + (setq quelpa-verbose init-file-debug + quelpa-dir (concat spacemacs-cache-directory "quelpa/") + quelpa-build-dir (expand-file-name "build" quelpa-dir) + quelpa-persistent-cache-file (expand-file-name "cache" quelpa-dir) + quelpa-update-melpa-p nil) + (configuration-layer/load-or-install-protected-package 'package-build) + (configuration-layer/load-or-install-protected-package 'quelpa)) + +(defun configuration-layer//resolve-package-archives (archives) + "Resolve HTTP handlers for each archive in ARCHIVES and return a list +of all reachable ones. +If the address of an archive already contains the protocol then this address is +left untouched. +The returned list has a `package-archives' compliant format." + (mapcar + (lambda (x) + (cons (car x) + (if (or (string-match-p "http" (cdr x)) + (string-prefix-p "/" (cdr x))) + (cdr x) + (concat + (if (and dotspacemacs-elpa-https + (not spacemacs-insecure) + ;; for now org ELPA repository does + ;; not support HTTPS + ;; TODO when org ELPA repo support + ;; HTTPS remove the check + ;; `(not (equal "org" (car x)))' + (not (equal "org" (car x)))) + "https://" + "http://") + (cdr x))))) + archives)) + +(defun configuration-layer/retrieve-package-archives (&optional quiet force) + "Retrieve all archives declared in current `package-archives'. + +This function first performs a simple GET request with a timeout in order to +fix very long refresh time when an archive is not reachable. + +Note that this simple GET is a heuristic to determine the availability +likelihood of an archive, so it can gives false positive if the archive +page is served but the archive is not. + +If QUIET is non nil then the function does not print message in the Spacemacs +home buffer. + +If FORCE is non nil then refresh the archives even if they have been already +refreshed during the current session." + (unless (and configuration-layer--package-archives-refreshed + (not force)) + (setq configuration-layer--package-archives-refreshed t) + (let ((count (length package-archives)) + (i 1)) + (dolist (archive package-archives) + (unless quiet + (spacemacs-buffer/replace-last-line + (format "--> refreshing package archive: %s... [%s/%s]" + (car archive) i count) t)) + (spacemacs//redisplay) + (setq i (1+ i)) + (unless (eq 'error + (with-timeout + (dotspacemacs-elpa-timeout + (progn + (display-warning + 'spacemacs + (format + "\nError connection time out for %s repository!" + (car archive)) :warning) + 'error)) + (condition-case err + (url-retrieve-synchronously (cdr archive)) + ('error + (display-warning 'spacemacs + (format + "\nError while contacting %s repository!" + (car archive)) :warning) + 'error)))) + (let ((package-archives (list archive))) + (package-refresh-contents)))) + (package-read-all-archive-contents) + (unless quiet (spacemacs-buffer/append "\n"))))) + +(defun configuration-layer/sync (&optional no-install) + "Synchronize declared layers in dotfile with spacemacs. +If NO-INSTALL is non nil then install steps are skipped." + (dotspacemacs|call-func dotspacemacs/layers "Calling dotfile layers...") + (setq dotspacemacs--configuration-layers-saved + dotspacemacs-configuration-layers) + (when (spacemacs-buffer//choose-banner) + (spacemacs-buffer//inject-version)) + ;; declare used layers then packages as soon as possible to resolve + ;; usage and ownership + (configuration-layer/discover-layers) + (configuration-layer//declare-used-layers dotspacemacs-configuration-layers) + (configuration-layer//declare-used-packages configuration-layer--used-layers) + ;; then load the functions and finally configure the layers + (configuration-layer//load-layers-files configuration-layer--used-layers + '("funcs.el")) + (configuration-layer//configure-layers configuration-layer--used-layers) + ;; pre-filter some packages to save some time later in the loading process + (setq configuration-layer--used-distant-packages + (configuration-layer//get-distant-packages + configuration-layer--used-packages t)) + ;; load layers lazy settings + (configuration-layer/load-auto-layer-file) + ;; install and/or uninstall packages + (unless no-install + (let ((packages + (append + ;; install used packages + (configuration-layer/filter-objects + configuration-layer--used-distant-packages + (lambda (x) + (let ((pkg (configuration-layer/get-package x))) + (not (oref pkg :lazy-install))))) + ;; also install all other packages if requested + (when (eq 'all dotspacemacs-install-packages) + (let (all-other-packages) + (dolist (layer (configuration-layer/get-layers-list)) + (let ((configuration-layer--declared-layers-usedp nil) + (configuration-layer--load-packages-files t)) + (configuration-layer/declare-layer layer) + (let* ((obj (configuration-layer/get-layer layer)) + (pkgs (when obj (oref obj :packages)))) + (configuration-layer/make-packages-from-layers + (list layer)) + (dolist (pkg pkgs) + (let ((pkg-name (if (listp pkg) (car pkg) pkg))) + (add-to-list 'all-other-packages pkg-name)))))) + (configuration-layer//get-distant-packages + all-other-packages nil)))))) + (configuration-layer//install-packages packages) + (when (and (or (eq 'used dotspacemacs-install-packages) + (eq 'used-only dotspacemacs-install-packages)) + (not configuration-layer-force-distribution) + (not configuration-layer-exclude-all-layers)) + (configuration-layer/delete-orphan-packages packages)))) + ;; configure used packages + (configuration-layer//configure-packages configuration-layer--used-packages) + (configuration-layer//load-layers-files configuration-layer--used-layers + '("keybindings.el"))) + +(defun configuration-layer/load-auto-layer-file () + "Load `auto-layer.el' file" + (let ((file (concat configuration-layer-directory "auto-layer.el"))) + (when (file-exists-p file) + (spacemacs-buffer/message "Loading auto-layer file...") + (load-file file)))) + +(defun configuration-layer/create-layer () + "Ask the user for a configuration layer name and the layer +directory to use. Create a layer with this name in the selected +layer directory." + (interactive) + (let* ((current-layer-paths (mapcar (lambda (dir) (expand-file-name dir)) + (cl-pushnew + configuration-layer-private-layer-directory + dotspacemacs-configuration-layer-path))) + (other-choice "Another directory...") + (helm-lp-source + `((name . "Configuration Layer Paths") + (candidates . ,(append current-layer-paths + (list other-choice))) + (action . (lambda (c) c)))) + (layer-path-sel (if (configuration-layer/layer-usedp 'ivy) + (ivy-read "Configuration layer path: " + (append current-layer-paths + (list other-choice))) + (helm :sources helm-lp-source + :prompt "Configuration layer path: "))) + (layer-path (cond + ((string-equal layer-path-sel other-choice) + (read-directory-name (concat "Other configuration " + "layer path: ") "~/" )) + ((member layer-path-sel current-layer-paths) + layer-path-sel) + (t + (error "Please select an option from the list")))) + (name (read-from-minibuffer "Configuration layer name: " )) + (layer-dir (concat layer-path "/" name))) + (cond + ((string-equal "" name) + (message "Cannot create a configuration layer without a name.")) + ((file-exists-p layer-dir) + (message (concat "Cannot create configuration layer \"%s\", " + "this layer already exists.") name)) + (t + (make-directory layer-dir t) + (configuration-layer//copy-template name "packages.el" layer-dir) + (when (y-or-n-p "Create readme?") + (configuration-layer//copy-template name "README.org" layer-dir)) + (message "Configuration layer \"%s\" successfully created." name))))) + +(defun configuration-layer//select-packages (layer-specs packages) + "Return the selected packages of LAYER-SPECS from given PACKAGES list." + (let* ((value (when (listp layer-specs) + (spacemacs/mplist-get layer-specs :packages))) + (selected-packages (if (and (not (null (car value))) + (listp (car value))) + (car value) + value))) + (cond + ;; select packages + ((and selected-packages + (not (memq (car selected-packages) '(all not)))) + selected-packages) + ;; unselect packages + ((and selected-packages + (eq 'not (car selected-packages))) + (delq nil (mapcar (lambda (x) + (let ((pkg-name (if (listp x) (car x) x))) + (unless (memq pkg-name selected-packages) + pkg-name))) + packages))) + ;; no package selections or all package selected + (t 'all)))) + +(defun configuration-layer/make-layer (layer-specs &optional obj usedp dir) + "Return a `cfgl-layer' object based on LAYER-SPECS. +If LOAD-PKGS is non-nil then load the `packages.el' file of the layer. +DIR is the directory where the layer is, if it is nil then search in the +indexed layers for the path." + (let* ((layer-name (if (listp layer-specs) (car layer-specs) layer-specs)) + (obj (if obj obj (cfgl-layer (symbol-name layer-name) + :name layer-name))) + (dir (or dir (oref obj :dir)))) + (if (or (null dir) + (and dir (not (file-exists-p dir)))) + (configuration-layer//warning + "Cannot make layer %S without a valid directory!" + layer-name) + (let* ((dir (file-name-as-directory dir)) + (disabled (when (listp layer-specs) + (spacemacs/mplist-get layer-specs :disabled-for))) + (enabled (if (and (listp layer-specs) + (memq :enabled-for layer-specs)) + (spacemacs/mplist-get layer-specs :enabled-for) + 'unspecified)) + (variables (when (listp layer-specs) + (spacemacs/mplist-get layer-specs :variables))) + (packages-file (concat dir "packages.el")) + (packages + (if (and (or usedp configuration-layer--load-packages-files) + (file-exists-p packages-file)) + (progn + (load packages-file) + (symbol-value (intern (format "%S-packages" layer-name)))) + (oref obj :packages))) + (selected-packages (if packages + (configuration-layer//select-packages + layer-specs packages) + ;; default value + 'all))) + (oset obj :dir dir) + (when usedp + (oset obj :disabled-for disabled) + (oset obj :enabled-for enabled) + (oset obj :variables variables)) + (when packages + (oset obj :packages packages) + (oset obj :selected-packages selected-packages)) + obj)))) + +(defun configuration-layer/make-package (pkg layer-name &optional obj) + "Return a `cfgl-package' object based on PKG. +If OBJ is non nil then copy PKG properties into OBJ, otherwise create +a new object. +Properties that can be copied are `:location', `:step' and `:excluded'. +If TOGGLEP is nil then `:toggle' parameter is ignored." + (let* ((pkg-name (if (listp pkg) (car pkg) pkg)) + (pkg-name-str (symbol-name pkg-name)) + (layer (unless (eq 'dotfile layer-name) + (configuration-layer/get-layer layer-name))) + (min-version (when (listp pkg) (plist-get (cdr pkg) :min-version))) + (step (when (listp pkg) (plist-get (cdr pkg) :step))) + (toggle (when (listp pkg) (plist-get (cdr pkg) :toggle))) + (excluded (when (listp pkg) (plist-get (cdr pkg) :excluded))) + (location (when (listp pkg) (plist-get (cdr pkg) :location))) + (protected (when (listp pkg) (plist-get (cdr pkg) :protected))) + (init-func (intern (format "%S/init-%S" + layer-name pkg-name))) + (pre-init-func (intern (format "%S/pre-init-%S" + layer-name pkg-name))) + (post-init-func (intern (format "%S/post-init-%S" + layer-name pkg-name))) + (copyp (not (null obj))) + (obj (if obj obj (cfgl-package pkg-name-str :name pkg-name))) + (ownerp (or (and (eq 'dotfile layer-name) + (null (oref obj :owners))) + (fboundp init-func)))) + (when min-version + (cfgl-package-set-property obj :min-version (version-to-list min-version))) + (when step (cfgl-package-set-property obj :step step)) + (when toggle (cfgl-package-set-property obj :toggle toggle)) + (cfgl-package-set-property obj :excluded + (and (configuration-layer/layer-usedp layer-name) + (or excluded (oref obj :excluded)))) + (when location + (if (and (listp location) + (eq (car location) 'recipe) + (eq (plist-get (cdr location) :fetcher) 'local)) + (cond + (layer (let ((path (expand-file-name + (format "%s%s/%s.el" + (configuration-layer/get-layer-local-dir + layer-name) + pkg-name-str pkg-name-str)))) + (cfgl-package-set-property + obj :location `(recipe :fetcher file :path ,path)))) + ((eq 'dotfile layer-name) + ;; TODO what is the local path for a packages owned by the dotfile? + nil)) + (cfgl-package-set-property obj :location location))) + ;; cannot override protected packages + (unless copyp + ;; a bootstrap package is protected + (cfgl-package-set-property + obj :protected (or protected (eq 'bootstrap step))) + (when protected + (push pkg-name configuration-layer--protected-packages))) + (when ownerp + ;; warn about mutliple owners + (when (and (oref obj :owners) + (not (memq layer-name (oref obj :owners)))) + (configuration-layer//warning + (format (concat "More than one init function found for " + "package %S. Previous owner was %S, " + "replacing it with layer %S.") + pkg-name (car (oref obj :owners)) layer-name))) + ;; last owner wins over the previous one + (object-add-to-list obj :owners layer-name)) + ;; check consistency betwween package and defined init functions + (unless (or ownerp + (eq 'dotfile layer-name) + (fboundp pre-init-func) + (fboundp post-init-func) + (oref obj :excluded)) + (configuration-layer//warning + (format (concat "package %s not initialized in layer %s, " + "you may consider removing this package from " + "the package list or use the :toggle keyword " + "instead of a `when' form.") + pkg-name layer-name))) + ;; check if toggle can be applied + (when (and (not ownerp) + (and (not (eq 'unspecified toggle)) + toggle)) + (configuration-layer//warning + (format (concat "Ignoring :toggle for package %s because " + "layer %S does not own it.") + pkg-name layer-name))) + (when (fboundp pre-init-func) + (object-add-to-list obj :pre-layers layer-name)) + (when (fboundp post-init-func) + (object-add-to-list obj :post-layers layer-name)) + obj)) + +(define-button-type 'help-dotfile-variable + :supertype 'help-xref + 'help-function + (lambda (variable) + (with-current-buffer (find-file-noselect dotspacemacs-filepath) + (pop-to-buffer (current-buffer)) + (goto-char (point-min)) + ;; try to exclude comments + (if (re-search-forward (format "^[a-z\s\\(\\-]*%s" variable) + nil 'noerror) + (beginning-of-line) + (message "Unable to find location in file")))) + 'help-echo + (purecopy (concat "mouse-2, RET: " + "visit the Spacemacs dotfile where variable is defined."))) + +(defun configuration-layer/describe-package (pkg-symbol + &optional layer-list pkg-list) + "Describe a package in the context of the configuration layer system." + (interactive + (list (intern + (completing-read "Package: " configuration-layer--used-packages)))) + (let* ((pkg (configuration-layer/get-package pkg-symbol)) + (owners (oref pkg :owners)) + (owner (car owners))) + (with-help-window (help-buffer) + ;; declaration location + (princ pkg-symbol) + (princ " is a package declared and configured ") + (cond + ((eq 'dotfile owner) + (princ "by the variable `dotspacemacs-additional-packages' ") + (with-current-buffer standard-output + (save-excursion + (re-search-backward "`\\([^`']+\\)'" nil t) + (help-xref-button 1 'help-variable + 'dotspacemacs-additional-packages + dotspacemacs-filepath))) + (princ "in your `dotfile'.\n") + (with-current-buffer standard-output + (save-excursion + (re-search-backward "`\\([^`']+\\)'" nil t) + (help-xref-button + 1 'help-dotfile-variable 'dotspacemacs-additional-packages)))) + ((not (null owner)) + (let* ((layer (configuration-layer/get-layer owner)) + (path (concat (oref layer dir) "packages.el"))) + (princ "by the layer `") + (princ owner) + (princ "'.\n") + (with-current-buffer standard-output + (save-excursion + (re-search-backward "`\\([^`']+\\)'" nil t) + (help-xref-button + 1 'help-function-def + (intern (format "%S/init-%S" owner pkg-symbol)) path))))) + (t + (princ "in an unknown place in the lisp parenthesis universe.\n"))) + ;; exclusion/protection + (if (oref pkg :protected) + (princ "\nThis package is protected and cannot be excluded.\n") + (when (oref pkg :excluded) + (princ "\nThis package is excluded and cannot be installed.\n"))) + ;; toggle + (unless (or (oref pkg :excluded) (eq t (oref pkg :toggle))) + (princ "\nA toggle is defined for this package, it is currently ") + (princ (if (cfgl-package-enabledp pkg t) "on" "off")) + (princ " because the following expression evaluates to ") + (princ (if (cfgl-package-enabledp pkg t) "t:\n" "nil:\n")) + (princ (oref pkg :toggle)) + (princ "\n")) + (unless (oref pkg :excluded) + ;; usage and installation + (if (not (configuration-layer/package-usedp pkg-symbol)) + (princ "\nYou are not using this package.\n") + (princ "\nYou are using this package") + (if (or (memq (oref pkg :location) '(built-in local site)) + (stringp (oref pkg :location))) + (princ ".\n") + (if (not (package-installed-p pkg-symbol)) + (princ " but it is not yet installed.\n") + (princ ", it is currently installed ") + (if (featurep pkg-symbol) + (princ "and loaded.\n") + (princ "but it has not been loaded yet.\n"))))) + (when (configuration-layer/package-lazy-installp pkg-symbol) + (princ + "\nThis package can be lazily installed using `auto-mode-alist'.\n") + (with-current-buffer standard-output + (save-excursion + (re-search-backward "`\\([^`']+\\)'" nil t) + (help-xref-button 1 'help-variable 'auto-mode-alist))) + (when (assq pkg-symbol configuration-layer--lazy-mode-alist) + (princ (concat "Actually it will be installed when one of the " + "following files is opened: \n")) + (princ (cdr (assq pkg-symbol + configuration-layer--lazy-mode-alist))) + (princ "\n"))) + ;; source location + (let ((location (oref pkg :location))) + (cond + ((eq 'built-in location) + (princ "\nThis is a built-in package distributed with Emacs.\n")) + ((eq 'local location) + (let* ((layer (configuration-layer/get-layer owner)) + (path (format "%slocal/%S" (oref layer dir) pkg-symbol))) + (princ (concat "\nThis is a local package whose source files " + "can be found in layer `")) + (princ owner) + (princ "'.\n") + (with-current-buffer standard-output + (save-excursion + (re-search-backward "`\\([^`']+\\)'" nil t) + (help-xref-button 1 'help-package-def path))))) + ((eq 'site location) + ;; TODO find a way to find the location on disk and detect if it is + ;; really installed + (princ "\nWhen used it must be installed by a third party.\n")) + ((eq 'elpa location) + ;; TODO find a way to find the ELPA repository + (princ "\nWhen used it is downloaded from an ELPA repository.\n")) + ((and (listp location) (eq 'recipe (car location))) + (princ (concat "\nWhen used it is downloaded using `quelpa' " + "with the following recipe:\n")) + (with-current-buffer standard-output + (save-excursion + (re-search-backward "`\\([^`']+\\)'" nil t) + (help-xref-button + 1 'help-url "https://github.com/quelpa/quelpa"))) + (princ location) + (princ "\n")))) + ;; pre/post init functions + (when (or (oref pkg pre-layers) (oref pkg post-layers)) + (princ (concat "\nAdditional configuration for this package " + "can be found in the following ")) + (if (null layer-list) + (princ "used layers:\n") + (princ "layers:\n")) + (when (oref pkg pre-layers) + (princ "(pre-init) ") + (dolist (layer-sym (sort (oref pkg pre-layers) 'string<)) + (let* ((layer (configuration-layer/get-layer layer-sym)) + (path (concat (oref layer dir) "packages.el"))) + (princ (concat "`" (symbol-name layer-sym) "'")) + (with-current-buffer standard-output + (save-excursion + (re-search-backward "`\\([^`']+\\)'" nil t) + (help-xref-button + 1 'help-function-def + (intern (format "%S/pre-init-%S" layer-sym pkg-symbol)) + path)))) + (princ " ")) + (princ "\n")) + (when (oref pkg post-layers) + (princ "(post-init) ") + (dolist (layer-sym (sort (oref pkg post-layers) 'string<)) + (let* ((layer (configuration-layer/get-layer layer-sym)) + (path (concat (oref layer dir) "packages.el"))) + (princ (concat "`" (symbol-name layer-sym) "'")) + (with-current-buffer standard-output + (save-excursion + (re-search-backward "`\\([^`']+\\)'" nil t) + (help-xref-button + 1 'help-function-def + (intern (format "%S/post-init-%S" layer-sym pkg-symbol)) + path)))) + (princ " ")) + (princ "\n")))) + (princ (concat "\nClick [here] to display an Emacs description " + "for this package.\n")) + (with-current-buffer standard-output + (save-excursion + (re-search-backward "\\(\\[.+\\]\\)" nil t) + (help-xref-button 1 'help-package pkg-symbol)))))) + +(defun configuration-layer//warning (msg &rest args) + "Display MSG as a warning message in buffer `*Messages*'. +If `configuration-layer--inhibit-warnings' is non nil then this function is a +no-op." + (unless configuration-layer--inhibit-warnings + (apply 'spacemacs-buffer/warning msg args))) + +(defun configuration-layer//add-layer (layer &optional usedp) + "Add a LAYER object to the system. +USEDP non-nil means that PKG is a used layer." + (let ((layer-name (oref layer :name))) + (puthash layer-name layer configuration-layer--indexed-layers) + (when usedp + (add-to-list 'configuration-layer--used-layers layer-name)))) + +(defun configuration-layer/remove-layers (layer-names) + "Remove layers with LAYER-NAMES from used layers." + (mapc 'configuration-layer/remove-layer layer-names)) + +(defun configuration-layer/remove-layer (layer-name) + "Remove an used layer with name LAYER-NAME." + (setq configuration-layer--used-layers + (delq layer-name configuration-layer--used-layers))) + +(defun configuration-layer/get-layer (layer-name) + "Return a layer object with name LAYER-NAME. +Return nil if layer object is not found." + (when (ht-contains? configuration-layer--indexed-layers layer-name) + (ht-get configuration-layer--indexed-layers layer-name))) + +(defun configuration-layer/get-layers-list () + "Return a list of all discovered layer symbols." + (ht-keys configuration-layer--indexed-layers)) + +(defun configuration-layer/get-layer-local-dir (layer) + "Return the value of SLOT for the given LAYER." + (let ((obj (ht-get configuration-layer--indexed-layers layer))) + (when obj (concat (oref obj :dir) "local/")))) + +(defun configuration-layer/get-layer-path (layer) + "Return the path for LAYER symbol." + (let ((obj (ht-get configuration-layer--indexed-layers layer))) + (when obj (oref obj :dir)))) + +(defun configuration-layer//add-package (pkg &optional usedp) + "Add a PKG object to the system. +USEDP non-nil means that PKG is a used package." + (let ((pkg-name (oref pkg :name))) + (puthash pkg-name pkg configuration-layer--indexed-packages) + (when usedp + (add-to-list 'configuration-layer--used-packages pkg-name)))) + +(defun configuration-layer/get-packages-list () + "Return a list of all package symbols." + (ht-keys configuration-layer--indexed-packages)) + +(defun configuration-layer/get-package (pkg-name) + "Return a package object with name PKG-NAME. +Return nil if package object is not found." + (when (ht-contains? configuration-layer--indexed-packages pkg-name) + (ht-get configuration-layer--indexed-packages pkg-name))) + +(defun configuration-layer//sort-packages (packages) + "Return a sorted list of PACKAGES objects." + (sort packages (lambda (x y) (string< (symbol-name x) (symbol-name y))))) + +(defun configuration-layer/make-all-packages (&optional usedp) + "Create objects for _all_ packages. +USEDP if non-nil indicates that made packages are used packages." + (configuration-layer/make-packages-from-layers + (configuration-layer/get-layers-list) usedp)) + +(defun configuration-layer/make-packages-from-layers + (layer-names &optional usedp) + "Read the package lists of layers with name LAYER-NAMES and create packages. +USEDP if non-nil indicates that made packages are used packages. +DOTFILE if non-nil will process the dotfile `dotspacemacs-additional-packages' +variable as well." + (dolist (layer-name layer-names) + (let ((layer (configuration-layer/get-layer layer-name))) + (dolist (pkg (cfgl-layer-get-packages layer)) + (let* ((pkg-name (if (listp pkg) (car pkg) pkg)) + (obj (configuration-layer/get-package pkg-name))) + (setq obj (configuration-layer/make-package pkg layer-name obj)) + (configuration-layer//add-package + obj (and (cfgl-package-get-safe-owner obj) usedp))))))) + +(defun configuration-layer/make-packages-from-dotfile (&optional usedp) + "Read the additonal packages declared in the dotfile and create packages. +USEDP if non-nil indicates that made packages are used packages." + (dolist (pkg dotspacemacs-additional-packages) + (let* ((pkg-name (if (listp pkg) (car pkg) pkg)) + (obj (configuration-layer/get-package pkg-name))) + (if obj + (setq obj (configuration-layer/make-package pkg 'dotfile obj)) + (setq obj (configuration-layer/make-package pkg 'dotfile))) + (configuration-layer//add-package obj usedp))) + (dolist (xpkg dotspacemacs-excluded-packages) + (let ((obj (configuration-layer/get-package xpkg))) + (unless obj + (setq obj (configuration-layer/make-package xpkg 'dotfile))) + (configuration-layer//add-package obj usedp) + (cfgl-package-set-property obj :excluded t)))) + +(defun configuration-layer/lazy-install (layer-name &rest props) + "Configure auto-installation of layer with name LAYER-NAME." + (declare (indent 1)) + (when (configuration-layer//lazy-install-p layer-name) + (let ((extensions (spacemacs/mplist-get props :extensions))) + (when (configuration-layer/layer-usedp layer-name) + (let* ((layer (configuration-layer/get-layer layer-name)) + (packages (when layer (cfgl-layer-owned-packages layer))) + (package-names (mapcar (lambda (x) (oref x :name)) packages))) + ;; set lazy install flag for a layer if and only if its owned + ;; distant packages are all not already installed + (let ((lazy (cl-reduce + (lambda (x y) (and x y)) + (mapcar + (lambda (p) + (let ((pkg (configuration-layer/get-package p))) + (or (not (eq layer-name (car (oref pkg :owners)))) + (null (package-installed-p + (oref pkg :name)))))) + (configuration-layer//get-distant-packages + package-names t)) + :initial-value t))) + (oset layer :lazy-install lazy) + (dolist (pkg packages) + (cfgl-package-set-property pkg :lazy-install lazy))))) + (dolist (x extensions) + (let ((ext (car x)) + (mode (cadr x))) + (add-to-list 'configuration-layer--lazy-mode-alist (cons mode ext)) + (add-to-list + 'auto-mode-alist + `(,ext . (lambda () + (configuration-layer//auto-mode + ',layer-name ',mode))))))))) + +(defun configuration-layer//auto-mode (layer-name mode) + "Auto mode support of lazily installed layers." + (let ((layer (configuration-layer/get-layer layer-name))) + (when (or (oref layer :lazy-install) + (not (configuration-layer/layer-usedp layer-name))) + (configuration-layer//lazy-install-packages layer-name mode))) + (when (fboundp mode) (funcall mode))) + +(defun configuration-layer/filter-objects (objects ffunc) + "Return a filtered OBJECTS list where each element satisfies FFUNC." + (reverse (cl-reduce (lambda (acc x) (if (funcall ffunc x) (push x acc) acc)) + objects + :initial-value nil))) + +(defun configuration-layer//get-distant-packages (packages usedp) + "Return the distant packages (ie to be intalled). +If USEDP is non nil then returns only the used packages; if it is nil then +return both used and unused packages." + (configuration-layer/filter-objects + packages + (lambda (x) + (let ((pkg (configuration-layer/get-package x))) + (and (not (memq (oref pkg :location) '(built-in site local))) + (not (stringp (oref pkg :location))) + (or (null usedp) + (and (not (null (oref pkg :owners))) + (not (oref pkg :excluded)) + (cfgl-package-enabledp pkg)))))))) + +(defun configuration-layer//get-private-layer-dir (name) + "Return an absolute path to the private configuration layer string NAME." + (file-name-as-directory + (concat configuration-layer-private-layer-directory name))) + +(defun configuration-layer//copy-template (name template &optional layer-dir) + "Copy and replace special values of TEMPLATE to layer string NAME. +If LAYER_DIR is nil, the private directory is used." + (cl-flet ((substitute (old new) (let ((case-fold-search nil)) + (save-excursion + (goto-char (point-min)) + (while (search-forward old nil t) + (replace-match new t)))))) + (let ((src (concat configuration-layer-template-directory + (format "%s.template" template))) + (dest (if layer-dir + (concat layer-dir "/" (format "%s" template)) + (concat (configuration-layer//get-private-layer-dir name) + (format "%s" template))))) + (copy-file src dest) + (find-file dest) + (substitute "%LAYER_NAME%" name) + (cond + (user-full-name + (substitute "%USER_FULL_NAME%" user-full-name) + (substitute "%USER_MAIL_ADDRESS%" user-mail-address)) + (t + (substitute "%USER_FULL_NAME%" "Sylvain Benner & Contributors") + (substitute "%USER_MAIL_ADDRESS%" "sylvain.benner@gmail.com"))) + (save-buffer)))) + +(defun configuration-layer//directory-type (path) + "Return the type of directory pointed by PATH. +Possible return values: + layer - the directory is a layer + category - the directory is a category + nil - the directory is a regular directory." + (when (file-directory-p path) + (if (string-match + "^+" (file-name-nondirectory + (directory-file-name + (concat configuration-layer-directory path)))) + 'category + (let ((files (directory-files path))) + ;; most frequent files encoutered in a layer are tested first + (when (or (member "packages.el" files) + (member "layers.el" files) + (member "config.el" files) + (member "keybindings.el" files) + (member "funcs.el" files)) + 'layer))))) + +(defun configuration-layer//get-category-from-path (dirpath) + "Return a category symbol from the given DIRPATH. +The directory name must start with `+'. +Returns nil if the directory is not a category." + (when (file-directory-p dirpath) + (let ((dirname (file-name-nondirectory + (directory-file-name + (concat configuration-layer-directory + dirpath))))) + (when (string-match "^+" dirname) + (intern (substring dirname 1)))))) + +(defun configuration-layer/discover-layers () + "Initialize `configuration-layer--indexed-layers' with layer directories." + ;; load private layers at the end on purpose we asume that the user layers + ;; must have the final word on configuration choices. Let + ;; `dotspacemacs-directory' override the private directory if it exists. + (setq configuration-layer--indexed-layers (make-hash-table :size 1024)) + (let ((search-paths (append (list configuration-layer-directory) + dotspacemacs-configuration-layer-path + (list configuration-layer-private-layer-directory) + (when dotspacemacs-directory + (list dotspacemacs-directory)))) + (discovered '())) + ;; depth-first search of subdirectories + (while search-paths + (let ((current-path (car search-paths))) + (setq search-paths (cdr search-paths)) + (dolist (sub (directory-files current-path t nil 'nosort)) + ;; ignore ".", ".." and non-directories + (unless (or (string-equal ".." (substring sub -2)) + (string-equal "." (substring sub -1)) + (not (file-directory-p sub))) + (let ((type (configuration-layer//directory-type sub))) + (cond + ((eq 'category type) + (let ((category (configuration-layer//get-category-from-path + sub))) + (spacemacs-buffer/message "-> Discovered category: %S" + category) + (push category configuration-layer-categories) + (setq search-paths (cons sub search-paths)))) + ((eq 'layer type) + (let* ((layer-name-str (file-name-nondirectory sub)) + (layer-name (intern layer-name-str)) + (indexed-layer (configuration-layer/get-layer + layer-name))) + (if indexed-layer + ;; the same layer may have been discovered twice, + ;; in which case we don't need a warning + (unless (string-equal (oref indexed-layer :dir) sub) + (configuration-layer//warning + (concat + "Duplicated layer %s detected in directory \"%s\", " + "replacing old directory \"%s\" with new directory.") + layer-name-str sub (oref indexed-layer :dir)) + (oset indexed-layer :dir sub)) + (spacemacs-buffer/message + "-> Discovered configuration layer: %s" layer-name-str) + (configuration-layer//add-layer + (configuration-layer/make-layer layer-name nil nil sub))))) + (t + ;; layer not found, add it to search path + (setq search-paths (cons sub search-paths))))))))))) + +(defun configuration-layer/declare-layers (layers-specs) + "Declare layers with LAYERS-SPECS." + (mapc 'configuration-layer/declare-layer layers-specs)) + +(defun configuration-layer/declare-layer (layer-specs) + "Declare a single layer with spec LAYER-SPECS. +Set the variable `configuration-layer--declared-layers-usedp' to control +wether the declared layer is an used one or not." + (let* ((layer-name (if (listp layer-specs) (car layer-specs) layer-specs)) + (layer (configuration-layer/get-layer layer-name)) + (usedp configuration-layer--declared-layers-usedp)) + (if layer + (let ((obj (configuration-layer/make-layer + layer-specs + (configuration-layer/get-layer layer-name) + usedp))) + (configuration-layer//add-layer obj usedp) + (configuration-layer//set-layer-variables obj) + (when (or usedp configuration-layer--load-packages-files) + (configuration-layer//load-layer-files layer-name '("layers.el")))) + (configuration-layer//warning "Unknown layer %s declared in dotfile." + layer-name)))) + +(defun configuration-layer//declare-used-layers (layers-specs) + "Declare used layers from LAYERS-SPECS list." + (setq configuration-layer--used-layers nil) + (let ((configuration-layer--declared-layers-usedp t)) + (unless configuration-layer-exclude-all-layers + (dolist (layer-specs layers-specs) + (let* ((layer-name (if (listp layer-specs) + (car layer-specs) + layer-specs)) + (layer (configuration-layer/get-layer layer-name))) + (if layer + (let ((layer-path (oref layer :dir))) + (unless (string-match-p "+distributions" layer-path) + (configuration-layer/declare-layer layer-specs))) + (configuration-layer//warning + "Unknown layer %s declared in dotfile." layer-name)))) + (setq configuration-layer--used-layers + (reverse configuration-layer--used-layers))) + ;; distribution and bootstrap layers are always first + (let ((distribution (if configuration-layer-force-distribution + configuration-layer-force-distribution + dotspacemacs-distribution))) + (unless (eq 'spacemacs-bootstrap distribution) + (configuration-layer/declare-layer distribution))) + (configuration-layer/declare-layer 'spacemacs-bootstrap))) + +(defun configuration-layer//set-layers-variables (layers) + "Set the configuration variables for the passed LAYERS." + (mapc 'configuration-layer//set-layer-variables layers)) + +(defun configuration-layer//set-layer-variables (layer) + "Set the configuration variables for the passed LAYER." + (let ((variables (oref layer :variables))) + (while variables + (let ((var (pop variables))) + (if (consp variables) + (condition-case-unless-debug err + (set-default var (eval (pop variables))) + ('error + (configuration-layer//increment-error-count) + (spacemacs-buffer/append + (format (concat "\nAn error occurred while setting layer " + "variable %s " + "(error: %s). Be sure to quote the value " + "if needed.\n") var err)))) + (configuration-layer//warning "Missing value for variable %s !" + var)))))) + +(defun configuration-layer/layer-usedp (layer-name) + "Return non-nil if LAYER-NAME is the name of a used layer." + (let ((obj (configuration-layer/get-layer layer-name))) + (when obj (memq layer-name configuration-layer--used-layers)))) + +(defun configuration-layer/package-usedp (name) + "Return non-nil if NAME is the name of a used package." + (let ((obj (configuration-layer/get-package name))) + (and obj (cfgl-package-get-safe-owner obj) + (not (oref obj :excluded))))) + +(defun configuration-layer/package-lazy-installp (name) + "Return non-nil if NAME is the name of a package to be lazily installed." + (let ((obj (configuration-layer/get-package name))) + (when obj (oref obj :lazy-install)))) + +(defun configuration-layer//configure-layers (layer-names) + "Configure layers with LAYER-NAMES." + (let ((warning-minimum-level :error)) + (dolist (layer-name layer-names) + (configuration-layer//load-layer-files layer-name '("config.el"))))) + +(defun configuration-layer//declare-used-packages (layers) + "Declare used packages contained in LAYERS." + (setq configuration-layer--used-packages nil) + (let* ((warning-minimum-level :error)) + (configuration-layer/make-packages-from-layers layers t) + (configuration-layer/make-packages-from-dotfile t) + (setq configuration-layer--used-packages + (configuration-layer//sort-packages + configuration-layer--used-packages)))) + +(defun configuration-layer//load-layers-files (layer-names files) + "Load the files of list FILES for all passed LAYER-NAMES." + (dolist (layer-name layer-names) + (configuration-layer//load-layer-files layer-name files))) + +(defun configuration-layer//load-layer-files (layer-name files) + "Load the files of list FILES for the layer with the given LAYER-NAME." + (let ((obj (configuration-layer/get-layer layer-name))) + (when obj + (dolist (file files) + (let ((file (concat (oref obj :dir) file))) + (if (file-exists-p file) (load file))))))) + +(defun configuration-layer/configured-packages-stats (packages) + "Return a statistics alist regarding the number of configured PACKAGES." + `((total ,(length packages)) + (elpa ,(length (configuration-layer/filter-objects + packages + (lambda (x) + (let ((pkg (configuration-layer/get-package x))) + (eq 'elpa (oref pkg :location))))))) + (recipe ,(length (configuration-layer/filter-objects + packages + (lambda (x) + (let* ((pkg (configuration-layer/get-package x)) + (location (oref pkg :location))) + (and (listp location) + (eq 'recipe (car location)))))))) + (local ,(length (configuration-layer/filter-objects + packages + (lambda (x) + (let ((pkg (configuration-layer/get-package x))) + (memq (oref pkg :location) '(local site))))))) + (built-in ,(length (configuration-layer/filter-objects + packages + (lambda (x) + (let ((pkg (configuration-layer/get-package x))) + (eq 'built-in (oref pkg :location))))))))) + +(defun configuration-layer//install-package (pkg) + "Unconditionally install the package PKG." + (let* ((layer (when pkg (car (oref pkg :owners)))) + (location (when pkg (oref pkg :location))) + (min-version (when pkg (oref pkg :min-version)))) + (spacemacs-buffer/replace-last-line + (format "--> installing %s: %s%s... [%s/%s]" + (if layer "package" "dependency") + pkg-name (if layer (format "@%S" layer) "") + installed-count not-inst-count) t) + (spacemacs//redisplay) + (unless (package-installed-p pkg-name min-version) + (condition-case-unless-debug err + (cond + ((or (null pkg) (eq 'elpa location)) + (configuration-layer//install-from-elpa pkg-name) + (when pkg (cfgl-package-set-property pkg :lazy-install nil))) + ((and (listp location) (eq 'recipe (car location))) + (configuration-layer//install-from-recipe pkg) + (cfgl-package-set-property pkg :lazy-install nil)) + (t (configuration-layer//warning "Cannot install package %S." + pkg-name))) + ('error + (configuration-layer//increment-error-count) + (spacemacs-buffer/append + (format (concat "\nAn error occurred while installing %s " + "(error: %s)\n") pkg-name err)) + (spacemacs//redisplay)))))) + +(defun configuration-layer//lazy-install-p (layer-name) + "Return non nil if the layer with LAYER-NAME should be lazy installed." + (or (eq 'all dotspacemacs-enable-lazy-installation) + (and (memq dotspacemacs-enable-lazy-installation '(unused t)) + (not (configuration-layer/layer-usedp layer-name))))) + +(defun configuration-layer//lazy-install-packages (layer-name mode) + "Install layer with LAYER-NAME to support MODE." + (when (or (not dotspacemacs-ask-for-lazy-installation) + (yes-or-no-p (format + (concat "Support for %s requires installation of " + "layer %s, do you want to install it?") + mode layer-name))) + (when (dotspacemacs/add-layer layer-name) + (configuration-layer/sync 'no-install)) + (let* ((layer (configuration-layer/get-layer layer-name)) + (inst-pkgs + (delq nil + (mapcar + (lambda (x) + (let* ((pkg-name (if (listp x) (car x) x)) + (pkg (configuration-layer/get-package pkg-name))) + (cfgl-package-set-property pkg :lazy-install nil) + (when (memq pkg-name + configuration-layer--used-distant-packages) + pkg-name))) + (oref layer :packages))))) + (let ((last-buffer (current-buffer)) + (sorted-pkg (configuration-layer//sort-packages inst-pkgs))) + (spacemacs-buffer/goto-buffer) + (goto-char (point-max)) + (configuration-layer//install-packages sorted-pkg) + (configuration-layer//configure-packages sorted-pkg) + (configuration-layer//load-layer-files layer '("keybindings.el")) + (oset layer :lazy-install nil) + (switch-to-buffer last-buffer))))) + +(defun configuration-layer//install-packages (packages) + "Install PACKAGES which are not lazy installed." + (interactive) + ;; Force the display of warning buffers at the bottom + (let ((display-buffer-alist + '(("\\(\\*Compile-Log\\*\\)\\|\\(\\*Warnings\\*\\)" + (display-buffer-in-side-window) + (inhibit-same-window . t) + (side . bottom) + (window-height . 0.2))))) + ;; ensure we have quelpa available first + (configuration-layer//install-quelpa) + (let* ((upkg-names (configuration-layer//get-uninstalled-packages packages)) + (not-inst-count (length upkg-names)) + installed-count) + ;; installation + (when upkg-names + (spacemacs-buffer/append + (format "Found %s new package(s) to install...\n" + not-inst-count)) + (configuration-layer/retrieve-package-archives) + (setq installed-count 0) + (spacemacs//redisplay) + (dolist (pkg-name upkg-names) + (setq installed-count (1+ installed-count)) + (configuration-layer//install-package + (configuration-layer/get-package pkg-name))) + (spacemacs-buffer/append "\n"))))) + +(defun configuration-layer//install-from-elpa (pkg-name) + "Install PKG from ELPA." + (if (not (assq pkg-name package-archive-contents)) + (spacemacs-buffer/append + (format (concat "\nPackage %s is unavailable. " + "Is the package name misspelled?\n") + pkg-name)) + (let ((pkg-desc (assq pkg-name package-archive-contents))) + (dolist + (dep (configuration-layer//get-package-deps-from-archive + pkg-name)) + (if (package-installed-p (car dep) (cadr dep)) + (configuration-layer//activate-package (car dep)) + (configuration-layer//install-from-elpa (car dep)))) + (if pkg-desc + (package-install (cadr pkg-desc)) + (package-install pkg-name))))) + +(defun configuration-layer//install-from-recipe (pkg) + "Install PKG from a recipe." + (let* ((pkg-name (oref pkg :name)) + (layer (car (oref pkg :owners))) + (recipe (cons pkg-name (cdr (oref pkg :location))))) + (if recipe + (quelpa recipe) + (configuration-layer//warning + (concat "Cannot find any recipe for package %S! Be sure " + "to add a recipe for it in alist %S.") + pkg-name recipes-var)))) + +(defun configuration-layer//filter-packages-with-deps + (pkg-names filter &optional use-archive) + "Return a filtered PKG-NAMES list where each elements satisfies FILTER." + (when pkg-names + (let (result) + (dolist (pkg-name pkg-names) + ;; recursively check dependencies + (let* ((deps + (if use-archive + (configuration-layer//get-package-deps-from-archive + pkg-name) + (configuration-layer//get-package-deps-from-alist pkg-name))) + (install-deps + (when deps (configuration-layer//filter-packages-with-deps + (mapcar 'car deps) filter)))) + (when install-deps + (setq result (append install-deps result)))) + (when (funcall filter pkg-name) + (add-to-list 'result pkg-name t))) + (delete-dups result)))) + +(defun configuration-layer//get-uninstalled-packages (pkg-names) + "Return a filtered list of PKG-NAMES to install." + (configuration-layer//filter-packages-with-deps + pkg-names (lambda (x) + (let* ((pkg (configuration-layer/get-package x)) + (min-version (when pkg (oref pkg :min-version)))) + (not (package-installed-p x min-version)))))) + +(defun configuration-layer//package-has-recipe-p (pkg-name) + "Return non nil if PKG-NAME is the name of a package declared with a recipe." + (when (configuration-layer/get-package pkg-name) + (let* ((pkg (configuration-layer/get-package pkg-name)) + (location (oref pkg :location))) + (and (listp location) (eq 'recipe (car location)))))) + +(defun configuration-layer//get-package-recipe (pkg-name) + "Return the recipe for PGK-NAME if it has one." + (let ((pkg (configuration-layer/get-package pkg-name))) + (when pkg + (let ((location (oref pkg :location))) + (when (and (listp location) (eq 'recipe (car location))) + (cons pkg-name (cdr location))))))) + +(defun configuration-layer//new-version-available-p (pkg-name) + "Return non nil if there is a new version available for PKG-NAME." + (let ((recipe (configuration-layer//get-package-recipe pkg-name)) + (cur-version (configuration-layer//get-package-version-string pkg-name)) + (quelpa-upgrade-p t) + new-version) + (when cur-version + (setq new-version + (if recipe + (or (quelpa-checkout recipe (expand-file-name (symbol-name pkg-name) quelpa-build-dir)) cur-version) + (configuration-layer//get-latest-package-version-string + pkg-name))) + ;; (message "%s: %s > %s ?" pkg-name cur-version new-version) + (if new-version + (version< cur-version new-version) + (cl-pushnew pkg-name + configuration-layer--check-new-version-error-packages + :test #'eq) + nil)))) + +(defun configuration-layer//get-packages-to-update (pkg-names) + "Return a filtered list of PKG-NAMES to update." + (configuration-layer//filter-packages-with-deps + pkg-names 'configuration-layer//new-version-available-p 'use-archive)) + +(defun configuration-layer//configure-packages (packages) + "Configure all passed PACKAGES honoring the steps order." + (setq spacemacs-loading-dots-chunk-threshold + (/ (length configuration-layer--used-packages) + spacemacs-loading-dots-chunk-count)) + (spacemacs-buffer/message "+ Configuring bootstrap packages...") + (configuration-layer//configure-packages-2 + (configuration-layer/filter-objects + packages (lambda (x) + (let ((pkg (configuration-layer/get-package x))) + (eq 'bootstrap (oref pkg :step)))))) + (spacemacs-buffer/message "+ Configuring pre packages...") + (configuration-layer//configure-packages-2 + (configuration-layer/filter-objects + packages (lambda (x) + (let ((pkg (configuration-layer/get-package x))) + (eq 'pre (oref pkg :step)))))) + (spacemacs-buffer/message "+ Configuring packages...") + (configuration-layer//configure-packages-2 + (configuration-layer/filter-objects + packages (lambda (x) + (let ((pkg (configuration-layer/get-package x))) + (null (oref pkg :step))))))) + +(defun configuration-layer//configure-packages-2 (packages) + "Configure all passed PACKAGES." + (dolist (pkg-name packages) + (spacemacs-buffer/loading-animation) + (let ((pkg (configuration-layer/get-package pkg-name))) + (cond + ((oref pkg :lazy-install) + (spacemacs-buffer/message + (format "%S ignored since it can be lazily installed." pkg-name))) + ((and (oref pkg :excluded) + (not (oref pkg :protected))) + (spacemacs-buffer/message + (format "%S ignored since it has been excluded." pkg-name))) + ((null (oref pkg :owners)) + (spacemacs-buffer/message + (format "%S ignored since it has no owner layer." pkg-name))) + ((not (cfgl-package-enabledp pkg t)) + (spacemacs-buffer/message (format "%S is toggled off." pkg-name))) + (t + ;; load-path + (let ((location (oref pkg :location))) + (cond + ((stringp location) + (if (file-directory-p location) + (push (file-name-as-directory location) load-path) + (configuration-layer//warning + "Location path for package %S does not exists (value: %s)." + pkg location))) + ((and (eq 'local location) + (eq 'dotfile (car (oref pkg :owners)))) + (push (file-name-as-directory + (concat configuration-layer-private-directory "local/" + (symbol-name (oref pkg :name)))) + load-path)) + ((eq 'local location) + (let* ((owner (configuration-layer/get-layer + (car (oref pkg :owners)))) + (dir (when owner (oref owner :dir)))) + (push (format "%slocal/%S/" dir pkg-name) load-path))))) + ;; configuration + (unless (memq (oref pkg :location) '(local site built-in)) + (configuration-layer//activate-package pkg-name)) + (cond + ((eq 'dotfile (car (oref pkg :owners))) + (spacemacs-buffer/message + (format "%S is configured in the dotfile." pkg-name))) + (t + (configuration-layer//configure-package pkg)))))))) + +(defun configuration-layer//package-enabled-p (pkg layer) + "Returns true if PKG should be configured for LAYER. +LAYER must not be the owner of PKG." + (let* ((owner (configuration-layer/get-layer (car (oref pkg :owners)))) + (disabled (oref owner :disabled-for)) + (enabled (oref owner :enabled-for))) + (if (not (eq 'unspecified enabled)) + (memq layer enabled) + (not (memq layer disabled))))) + +(defun configuration-layer//configure-package (pkg) + "Configure PKG object." + (let* ((pkg-name (oref pkg :name)) + (owner (car (oref pkg :owners)))) + (spacemacs-buffer/message (format "Configuring %S..." pkg-name)) + ;; pre-init + (mapc + (lambda (layer) + (when (configuration-layer/layer-usedp layer) + (if (not (configuration-layer//package-enabled-p pkg layer)) + (spacemacs-buffer/message + (format " -> ignored pre-init (%S)..." layer)) + (spacemacs-buffer/message + (format " -> pre-init (%S)..." layer)) + (condition-case-unless-debug err + (funcall (intern (format "%S/pre-init-%S" layer pkg-name))) + ('error + (configuration-layer//increment-error-count) + (spacemacs-buffer/append + (format + (concat "\nAn error occurred while pre-configuring %S " + "in layer %S (error: %s)\n") + pkg-name layer err))))))) + (oref pkg :pre-layers)) + ;; init + (spacemacs-buffer/message (format " -> init (%S)..." owner)) + (funcall (intern (format "%S/init-%S" owner pkg-name))) + ;; post-init + (mapc + (lambda (layer) + (when (configuration-layer/layer-usedp layer) + (if (not (configuration-layer//package-enabled-p pkg layer)) + (spacemacs-buffer/message + (format " -> ignored post-init (%S)..." layer)) + (spacemacs-buffer/message + (format " -> post-init (%S)..." layer)) + (condition-case-unless-debug err + (funcall (intern (format "%S/post-init-%S" layer pkg-name))) + ('error + (configuration-layer//increment-error-count) + (spacemacs-buffer/append + (format + (concat "\nAn error occurred while post-configuring %S " + "in layer %S (error: %s)\n") + pkg-name layer err))))))) + (oref pkg :post-layers)))) + +(defun configuration-layer//cleanup-rollback-directory () + "Clean up the rollback directory." + (let* ((dirattrs (delq nil + (mapcar (lambda (d) + (unless (eq t d) d)) + (directory-files-and-attributes + configuration-layer-rollback-directory + nil "\\`\\(\\.\\{0,2\\}[^.\n].*\\)\\'" t)))) + (dirs (sort dirattrs + (lambda (d e) + (time-less-p (nth 6 d) (nth 6 e)))))) + (dotimes (c (- (length dirs) dotspacemacs-max-rollback-slots)) + (delete-directory (concat configuration-layer-rollback-directory + "/" (car (pop dirs))) + t t)))) + +(defun configuration-layer/update-packages (&optional always-update) + "Update packages. + +If called with a prefix argument ALWAYS-UPDATE, assume yes to update." + (interactive "P") + (spacemacs-buffer/insert-page-break) + (spacemacs-buffer/append "\nUpdating package archives, please wait...\n") + (configuration-layer/retrieve-package-archives nil 'force) + (setq configuration-layer--check-new-version-error-packages nil) + (let* ((update-packages + (configuration-layer//get-packages-to-update + configuration-layer--used-distant-packages)) + (skipped-count (length + configuration-layer--check-new-version-error-packages)) + (date (format-time-string "%y-%m-%d_%H.%M.%S")) + (rollback-dir (expand-file-name + (concat configuration-layer-rollback-directory + (file-name-as-directory date)))) + (upgrade-count (length update-packages)) + (upgraded-count 0) + (update-packages-alist)) + (when configuration-layer--check-new-version-error-packages + (spacemacs-buffer/append + (format (concat "--> Warning: cannot update %s package(s), possibly due" + " to a temporary network problem: %s\n") + skipped-count + (mapconcat #'symbol-name + configuration-layer--check-new-version-error-packages + " ")))) + ;; (message "packages to udpate: %s" update-packages) + (when (> upgrade-count 0) + (spacemacs-buffer/append + (format (concat "--> Found %s package(s) to update" + (if (> skipped-count 0) + (format " (skipped %s):\n" skipped-count) + ":\n")) + upgrade-count) t) + (mapc (lambda (x) + (spacemacs-buffer/append + (format (if (memq (intern x) dotspacemacs-frozen-packages) + "%s (won't be updated because package is frozen)\n" + "%s\n") x) t)) + (sort (mapcar 'symbol-name update-packages) 'string<)) + (if (and (not always-update) + (not (yes-or-no-p + (format "Do you want to update %s package(s) ? " + upgrade-count)))) + (spacemacs-buffer/append "Packages update has been cancelled.\n" t) + ;; backup the package directory and construct an alist + ;; variable to be cached for easy update and rollback + (spacemacs-buffer/append + "--> performing backup of package(s) to update...\n" t) + (spacemacs//redisplay) + (dolist (pkg update-packages) + (unless (memq pkg dotspacemacs-frozen-packages) + (let* ((src-dir (configuration-layer//get-package-directory pkg)) + (dest-dir (expand-file-name + (concat rollback-dir + (file-name-as-directory + (file-name-nondirectory src-dir)))))) + (copy-directory src-dir dest-dir 'keeptime 'create 'copy-content) + (push (cons pkg (file-name-nondirectory src-dir)) + update-packages-alist)))) + (spacemacs/dump-vars-to-file + '(update-packages-alist) + (expand-file-name (concat rollback-dir + configuration-layer-rollback-info))) + (dolist (pkg update-packages) + (unless (memq pkg dotspacemacs-frozen-packages) + (setq upgraded-count (1+ upgraded-count)) + (spacemacs-buffer/replace-last-line + (format "--> preparing update of package %s... [%s/%s]" + pkg upgraded-count upgrade-count) t) + (spacemacs//redisplay) + (configuration-layer//package-delete pkg))) + (spacemacs-buffer/append + (format "\n--> %s package(s) to be updated.\n" upgraded-count)) + (spacemacs-buffer/append + (concat "\nEmacs has to be restarted to actually install the " + "new version of the packages (SPC q r).\n")) + (configuration-layer//cleanup-rollback-directory) + (spacemacs//redisplay))) + (when (eq upgrade-count 0) + (spacemacs-buffer/append "--> All packages are up to date.\n") + (spacemacs//redisplay)))) + +(defun configuration-layer//ido-candidate-rollback-slot () + "Return a list of candidates to select a rollback slot." + (let ((rolldir configuration-layer-rollback-directory)) + (when (file-exists-p rolldir) + (reverse + (delq nil (mapcar + (lambda (x) + (when (and (file-directory-p (concat rolldir x)) + (not (or (string= "." x) (string= ".." x)))) + (let ((p (length (directory-files (file-name-as-directory + (concat rolldir x)))))) + ;; -3 for . .. and rollback-info + (format "%s (%s packages)" x (- p 3))))) + (directory-files rolldir))))))) + +(defun configuration-layer/rollback (slot) + "Rollback all the packages in the given SLOT. +If called interactively and SLOT is nil then an ido buffers appears +to select one." + (interactive + (list + (if (boundp 'slot) slot + (let ((candidates (configuration-layer//ido-candidate-rollback-slot))) + (when candidates + (ido-completing-read "Rollback slots (most recent are first): " + candidates)))))) + (spacemacs-buffer/insert-page-break) + (if (not slot) + (message "No rollback slot available.") + (string-match "^\\(.+?\\)\s.*$" slot) + (let* ((slot-dir (match-string 1 slot)) + (rollback-dir (file-name-as-directory + (concat configuration-layer-rollback-directory + (file-name-as-directory slot-dir)))) + (info-file (expand-file-name + (concat rollback-dir + configuration-layer-rollback-info)))) + (spacemacs-buffer/append + (format "\nRollbacking ELPA packages from slot %s...\n" slot-dir)) + (load-file info-file) + (let ((rollback-count (length update-packages-alist)) + (rollbacked-count 0)) + (spacemacs-buffer/append + (format "Found %s package(s) to rollback...\n" rollback-count)) + (spacemacs//redisplay) + (dolist (apkg update-packages-alist) + (let* ((pkg (car apkg)) + (pkg-dir-name (cdr apkg)) + (installed-ver + (configuration-layer//get-package-version-string pkg)) + (elpa-dir (file-name-as-directory package-user-dir)) + (src-dir (expand-file-name + (concat rollback-dir (file-name-as-directory + pkg-dir-name)))) + (dest-dir (expand-file-name + (concat elpa-dir (file-name-as-directory + pkg-dir-name))))) + (unless (memq pkg dotspacemacs-frozen-packages) + (setq rollbacked-count (1+ rollbacked-count)) + (if (string-equal (format "%S-%s" pkg installed-ver) pkg-dir-name) + (spacemacs-buffer/replace-last-line + (format "--> package %s already rolled back! [%s/%s]" + pkg rollbacked-count rollback-count) t) + ;; rollback the package + (spacemacs-buffer/replace-last-line + (format "--> rolling back package %s... [%s/%s]" + pkg rollbacked-count rollback-count) t) + (configuration-layer//package-delete pkg) + (copy-directory src-dir dest-dir + 'keeptime 'create 'copy-content))) + (spacemacs//redisplay))) + (spacemacs-buffer/append + (format "\n--> %s packages rolled back.\n" rollbacked-count)) + (spacemacs-buffer/append + "\nEmacs has to be restarted for the changes to take effect.\n"))))) + +(defun configuration-layer//activate-package (pkg) + "Activate PKG." + (unless (memq pkg package-activated-list) + (package-activate pkg))) + +(defun configuration-layer//get-packages-dependencies () + "Returns dependencies hash map for all packages in `package-alist'." + (let ((result (make-hash-table :size 512))) + (dolist (pkg package-alist) + (let* ((pkg-sym (car pkg)) + (deps (configuration-layer//get-package-deps-from-alist pkg-sym))) + (dolist (dep deps) + (let* ((dep-sym (car dep)) + (value (ht-get result dep-sym))) + (puthash dep-sym + (if value (add-to-list 'value pkg-sym) (list pkg-sym)) + result))))) + result)) + +(defun configuration-layer//get-implicit-packages (packages) + "Returns packages in `packages-alist' which are not found in PACKAGES." + (let (imp-pkgs) + (dolist (pkg package-alist) + (let ((pkg-sym (car pkg))) + (unless (memq pkg-sym packages) + (add-to-list 'imp-pkgs pkg-sym)))) + imp-pkgs)) + +(defun configuration-layer//get-orphan-packages + (dist-pkgs implicit-pkgs dependencies) + "Return orphan packages." + (let (result) + (dolist (imp-pkg implicit-pkgs) + (when (configuration-layer//is-package-orphan + imp-pkg dist-pkgs dependencies) + (add-to-list 'result imp-pkg))) + result)) + +(defun configuration-layer//is-package-orphan (pkg-name dist-pkgs dependencies) + "Returns not nil if PKG-NAME is the name of an orphan package." + (unless (or (memq pkg-name dist-pkgs) + (memq pkg-name configuration-layer--protected-packages)) + (if (ht-contains? dependencies pkg-name) + (let ((parents (ht-get dependencies pkg-name))) + (cl-reduce (lambda (x y) (and x y)) + (mapcar (lambda (p) (configuration-layer//is-package-orphan + p dist-pkgs dependencies)) + parents) + :initial-value t)) + (not (memq pkg-name dist-pkgs))))) + +(defun configuration-layer//get-package-directory (pkg-name) + "Return the directory path for package with name PKG-NAME." + (let ((pkg-desc (assq pkg-name package-alist))) + (package-desc-dir (cadr pkg-desc)))) + +(defun configuration-layer//get-package-deps-from-alist (pkg-name) + "Return the dependencies alist for package with name PKG-NAME." + (let ((pkg-desc (assq pkg-name package-alist))) + (when pkg-desc (package-desc-reqs (cadr pkg-desc))))) + +(defun configuration-layer//get-package-deps-from-archive (pkg-name) + "Return the dependencies alist for a PKG-NAME from the archive data." + (let* ((pkg-arch (assq pkg-name package-archive-contents)) + (reqs (when pkg-arch (package-desc-reqs (cadr pkg-arch))))) + ;; recursively get the requirements of reqs + (dolist (req reqs) + (let* ((pkg-name2 (car req)) + (reqs2 (configuration-layer//get-package-deps-from-archive + pkg-name2))) + (when reqs2 (setq reqs (append reqs2 reqs))))) + reqs)) + +(defun configuration-layer//get-package-version-string (pkg-name) + "Return the version string for package with name PKG-NAME." + (let ((pkg-desc (assq pkg-name package-alist))) + (when pkg-desc + (package-version-join (package-desc-version (cadr pkg-desc)))))) + +(defun configuration-layer//get-package-version (pkg-name) + "Return the version list for package with name PKG-NAME." + (let ((version-string (configuration-layer//get-package-version-string + pkg-name))) + (unless (string-empty-p version-string) + (version-to-list version-string)))) + +(defun configuration-layer//get-latest-package-version-string (pkg-name) + "Return the version string for package with name PKG-NAME." + (let ((pkg-arch (assq pkg-name package-archive-contents))) + (when pkg-arch + (package-version-join (package-desc-version (cadr pkg-arch)))))) + +(defun configuration-layer//get-latest-package-version (pkg-name) + "Return the versio list for package with name PKG-NAME." + (let ((version-string + (configuration-layer//get-latest-package-version-string pkg-name))) + (unless (string-empty-p version-string) + (version-to-list version-string)))) + +(defun configuration-layer//package-delete (pkg-name) + "Delete package with name PKG-NAME." + (cond + ((version<= "25.0.50" emacs-version) + (let ((p (cadr (assq pkg-name package-alist)))) + ;; add force flag to ignore dependency checks in Emacs25 + (when p (package-delete p t t)))) + (t (let ((p (cadr (assq pkg-name package-alist)))) + (when p (package-delete p)))))) + +(defun configuration-layer/delete-orphan-packages (packages) + "Delete PACKAGES if they are orphan." + (interactive) + (let* ((dependencies (configuration-layer//get-packages-dependencies)) + (implicit-packages (configuration-layer//get-implicit-packages + packages)) + (orphans (configuration-layer//get-orphan-packages + packages + implicit-packages + dependencies)) + (orphans-count (length orphans)) + deleted-count) + ;; (message "dependencies: %s" dependencies) + ;; (message "implicit: %s" implicit-packages) + ;; (message "orphans: %s" orphans) + (if orphans + (progn + (spacemacs-buffer/append + (format "Found %s orphan package(s) to delete...\n" + orphans-count)) + (setq deleted-count 0) + (dolist (orphan orphans) + (setq deleted-count (1+ deleted-count)) + (spacemacs-buffer/replace-last-line + (format "--> deleting %s... [%s/%s]" + orphan + deleted-count + orphans-count) t) + (configuration-layer//package-delete orphan) + (spacemacs//redisplay)) + (spacemacs-buffer/append "\n")) + (spacemacs-buffer/message "No orphan package to delete.")))) + +(defun configuration-layer//gather-auto-mode-extensions (mode) + "Return a regular expression matching all the extensions associate to MODE." + (let (gather-extensions) + (dolist (x auto-mode-alist) + (let ((ext (car x)) + (auto-mode (cdr x))) + (when (and (stringp ext) + (symbolp auto-mode) + (eq auto-mode mode)) + (push (car x) gather-extensions)))) + (when gather-extensions + (concat "\\(" + (string-join gather-extensions "\\|") + "\\)")))) + +(defun configuration-layer//lazy-install-extensions-for-layer (layer-name) + "Return an alist of owned modes and extensions for the passed layer." + (let* ((layer (configuration-layer/get-layer layer-name)) + (packages (cfgl-layer-owned-packages layer)) + result) + (dolist (pkg packages) + (let ((pkg-sym (oref pkg :name))) + (dolist (mode (list pkg-sym (intern (format "%S-mode" pkg-sym)))) + (let ((ext (configuration-layer//gather-auto-mode-extensions mode))) + (when ext (push (cons mode ext) result)))))) + result)) + +(defun configuration-layer//insert-lazy-install-form (layer-name mode ext) + "Insert a configuration form for lazy installation of MODE." + (let ((str (concat "(configuration-layer/lazy-install '" + (symbol-name layer-name) + " :extensions '(" + (let ((print-quoted t)) (prin1-to-string ext)) + " " + (symbol-name mode) + "))\n"))) + (insert str))) + +(defun configuration-layer/insert-lazy-install-configuration () + "Prompt for a layer and insert the forms to configure lazy installation." + (interactive) + (let ((layer-name + (intern (completing-read + "Choose a used layer" + (sort configuration-layer--used-layers + (lambda (x y) + (string< (oref (cdr x) :name) + (oref (cdr y) :name)))))))) + (let ((mode-exts (configuration-layer//lazy-install-extensions-for-layer + layer-name))) + (dolist (x mode-exts) + (configuration-layer//insert-lazy-install-form + layer-name (car x) (cdr x)))))) + +(defvar configuration-layer--spacemacs-startup-time nil + "Spacemacs full startup duration.") + +(defun configuration-layer/display-summary (start-time) + "Display a summary of loading time." + (unless configuration-layer--spacemacs-startup-time + (setq configuration-layer--spacemacs-startup-time + (float-time (time-subtract (current-time) emacs-start-time)))) + (let ((stats (configuration-layer/configured-packages-stats + configuration-layer--used-packages))) + (spacemacs-buffer/insert-page-break) + (spacemacs-buffer/append + (format "\n%s packages loaded in %.3fs (e:%s r:%s l:%s b:%s)" + (cadr (assq 'total stats)) + configuration-layer--spacemacs-startup-time + (cadr (assq 'elpa stats)) + (cadr (assq 'recipe stats)) + (cadr (assq 'local stats)) + (cadr (assq 'built-in stats)))) + (with-current-buffer (get-buffer-create spacemacs-buffer-name) + (let ((buffer-read-only nil)) + (spacemacs-buffer//center-line) + (insert "\n"))))) + +(defun configuration-layer/load-or-install-protected-package + (pkg &optional log file-to-load) + "Load PKG package, and protect it against being deleted as an orphan. +See `configuration-layer/load-or-install-package' for more information." + (push pkg configuration-layer--protected-packages) + (configuration-layer/load-or-install-package pkg log file-to-load)) + +(defun configuration-layer/load-or-install-package + (pkg &optional log file-to-load) + "Load PKG package. PKG will be installed if it is not already installed. +Whenever the initial require fails the absolute path to the package +directory is returned. +If LOG is non-nil a message is displayed in spacemacs-buffer-mode buffer. +FILE-TO-LOAD is an explicit file to load after the installation." + (let ((warning-minimum-level :error)) + (unless (require pkg nil 'noerror) + ;; not installed, we try to initialize package.el only if required to + ;; precious seconds during boot time + (require 'cl) + (let ((pkg-elpa-dir (spacemacs//get-package-directory pkg))) + (if pkg-elpa-dir + (add-to-list 'load-path pkg-elpa-dir) + ;; install the package + (when log + (spacemacs-buffer/append + (format "(Bootstrap) Installing %s...\n" pkg)) + (spacemacs//redisplay)) + (configuration-layer/retrieve-package-archives 'quiet) + (package-install pkg) + (setq pkg-elpa-dir (spacemacs//get-package-directory pkg))) + (require pkg nil 'noerror) + (when file-to-load + (load-file (concat pkg-elpa-dir file-to-load))) + pkg-elpa-dir)))) + +(defun configuration-layer//increment-error-count () + "Increment the error counter." + (if configuration-layer-error-count + (setq configuration-layer-error-count + (1+ configuration-layer-error-count)) + (setq configuration-layer-error-count 1))) + +(provide 'core-configuration-layer) + +;;; core-configuration-layer.el ends here diff --git a/emacs.d/core/core-debug.el b/emacs.d/core/core-debug.el new file mode 100644 index 0000000..b2af85c --- /dev/null +++ b/emacs.d/core/core-debug.el @@ -0,0 +1,143 @@ +;;; core-debug.el --- Spacemacs Core File -*- lexical-binding: t; -*- +;; +;; 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 + +(require 'profiler) + +(defvar spacemacs-debug-timer-threshold 0.15 + "Generate message if file takes longer than this number of +seconds to load") + +(defvar spacemacs-debugp nil) +(defvar spacemacs-debug-with-profile nil) +(defvar spacemacs-debug-with-timed-requires nil) +(defvar spacemacs-debug-with-adv-timers nil) + +(defun spacemacs//load-timer (origfunc &rest args) + "Used to time invocation of `require' or `load'." + (let ((start (current-time)) + (required (car args)) + delta) + (prog1 + (apply origfunc args) + (setq delta (float-time (time-since start))) + (when (> delta spacemacs-debug-timer-threshold) + (with-current-buffer "*load-times*" + (goto-char (point-max)) + (insert (format "[%.3f] (%.3f) Load or require\n Feature: %s\n In file: %s\n\n" + (float-time (time-since emacs-start-time)) + delta required load-file-name))))))) + +(defmacro spacemacs||make-function-timer (func) + "Used to time call to FUNC." + `(lambda (origfunc &rest args) + (let ((start (current-time)) + delta) + (prog1 + (apply origfunc args) + (setq delta (float-time (time-since start))) + (when (> delta spacemacs-debug-timer-threshold) + (with-current-buffer "*load-times*" + (goto-char (point-max)) + (insert (format "[%.3f] (%.3f) Function call\n Function: %s\n Args: %s\n\n" + (float-time (time-since emacs-start-time)) + delta ',func args)))))))) + +(defmacro spacemacs||make-function-profiler (func) + `(lambda (origfunc &rest args) + (if (profiler-running-p) + (profiler-report) + (profiler-start 'cpu)) + (prog1 + (apply origfunc args) + (with-current-buffer "*load-times*" + (goto-char (point-max)) + (insert (format "[%.3f] Done profiling function: %s\n\n" + (float-time (time-since emacs-start-time)) ',func))) + (profiler-report)))) + +(defun spacemacs/init-debug () + "Set the debug hooks." + (when spacemacs-debug-with-profile + (profiler-start 'cpu+mem) + (add-hook 'after-init-hook + (lambda () + (run-with-idle-timer 2 nil (lambda () + (profiler-report) + (profiler-stop)))))) + + (when spacemacs-debug-with-timed-requires + (with-current-buffer (get-buffer-create "*load-times*") + (insert (format "Threshold set at %.3f seconds\n\n" + spacemacs-debug-timer-threshold))) + + (defadvice package-initialize (around spacemacs//timed-initialize activate) + (let ((start (current-time)) res delta) + (setq res ad-do-it + delta (float-time (time-since start))) + (when (> delta spacemacs-debug-timer-threshold) + (with-current-buffer "*load-times*" + (goto-char (point-max)) + (insert (format "package-initialize took %.3f sec\n" delta)))) + res)) + + (defadvice require (around spacemacs//timed-require activate) + (let ((start (current-time)) res delta) + (setq res ad-do-it + delta (float-time (time-since start))) + (when (> delta spacemacs-debug-timer-threshold) + (with-current-buffer "*load-times*" + (goto-char (point-max)) + (insert (format "File %s: Required %s: %.3f sec\n" + load-file-name (ad-get-arg 0) delta)))) + res)) + + (defadvice load (around spacemacs//timed-load activate) + (let ((start (current-time)) res delta) + (setq res ad-do-it + delta (float-time (time-since start))) + (when (> delta spacemacs-debug-timer-threshold) + (with-current-buffer "*load-times*" + (goto-char (point-max)) + (insert (format "File %s: Loaded %s: %.3f sec\n" + load-file-name (ad-get-arg 0) delta)))) + res))) + + (when spacemacs-debug-with-adv-timers + (with-current-buffer (get-buffer-create "*load-times*") + (insert (format "Measured times greater than %.3f sec:\n\n" + spacemacs-debug-timer-threshold))) + + (add-hook 'after-init-hook + (lambda () + (with-current-buffer "*load-times*" + (goto-char (point-max)) + (insert (format "[%.3f] Spacemacs finished initializing\n\n" + (float-time (time-since emacs-start-time)) ))))) + + (advice-add 'load :around #'spacemacs//load-timer) + (advice-add 'require :around #'spacemacs//load-timer) + (advice-add 'package-initialize + :around + (spacemacs||make-function-timer package-intialize)) + (advice-add 'configuration-layer/sync + :around + (spacemacs||make-function-timer configuration-layer/sync)) + ;; (advice-add 'configuration-layer/sync + ;; :around + ;; (spacemacs||make-function-profiler configuration-layer/sync)) + (advice-add 'configuration-layer//configure-package + :around + (spacemacs||make-function-timer configuration-layer//configure-package))) + + ;; Keep debug-on-error on for stuff that is lazily loaded + (add-hook 'after-init-hook (lambda () (setq debug-on-error t)))) + +(provide 'core-debug) diff --git a/emacs.d/core/core-display-init.el b/emacs.d/core/core-display-init.el new file mode 100644 index 0000000..8249b0f --- /dev/null +++ b/emacs.d/core/core-display-init.el @@ -0,0 +1,46 @@ +;;; core-display-init.el --- Spacemacs Core 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 + +(defvar spacemacs--after-display-system-init-list '() + "List of functions to be run after the display system is initialized.") + +(defadvice server-create-window-system-frame + (after spacemacs-init-display activate) + "After Emacs server creates a frame, run functions queued in +`SPACEMACS--AFTER-DISPLAY-SYSTEM-INIT-LIST' to do any setup that needs to have +the display system initialized." + (progn + (dolist (fn (reverse spacemacs--after-display-system-init-list)) + (funcall fn)) + (ad-disable-advice 'server-create-window-system-frame + 'after + 'spacemacs-init-display) + (ad-activate 'server-create-window-system-frame))) + +(defmacro spacemacs|do-after-display-system-init (&rest body) + "If the display-system is initialized, run `BODY', otherwise, +add it to a queue of actions to perform after the first graphical frame is +created." + `(let ((init (cond ((boundp 'ns-initialized) ns-initialized) + ;; w32-initialized gets set too early, so + ;; if we're on Windows, check the list of fonts + ;; instead (this is nil until the graphics system + ;; is initialized) + ((boundp 'w32-initialized) (font-family-list)) + ((boundp 'x-initialized) x-initialized) + ;; fallback to normal loading behavior only if in a GUI + (t (display-graphic-p))))) + (if init + (progn + ,@body) + (push (lambda () ,@body) spacemacs--after-display-system-init-list)))) + +(provide 'core-display-init) diff --git a/emacs.d/core/core-documentation.el b/emacs.d/core/core-documentation.el new file mode 100644 index 0000000..35b00e8 --- /dev/null +++ b/emacs.d/core/core-documentation.el @@ -0,0 +1,250 @@ +;;; core-spacemacs.el --- Spacemacs Core 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 + +(require 'org) +(require 'ox-publish) +(require 's) +(require 'dash) +(require 'f) +(require 'toc-org) +(require 'org-id) + +(defvar spacemacs--category-names + '(("config-files" . "Configuration files") + ("email" . "E-mail") + ("intl" . "International support") + ("lang" . "Programming and markup languages") + ("os" . "Operating systems") + ("spacemacs" . "Spacemacs distribution layers")) + "Special names for categories. Used to generate the layers list.") + +(defun spacemacs//generate-layers-from-path (path level) + "Add all layers found in PATH to the current buffer, at org level LEVEL." + (let* ((all-subs (directory-files path t nil nil)) + (layers (-filter (lambda (p) + (eq 'layer (configuration-layer//directory-type p))) + all-subs)) + (categories (-filter (lambda (p) + (eq 'category (configuration-layer//directory-type p))) + all-subs))) + (message "%S" layers) + (dolist (l layers) + (let ((layer-name (file-name-nondirectory l)) + (target-path (concat (file-relative-name + l (concat spacemacs-start-directory "layers")) + "/README.org"))) + (insert (format "- [[file:%s][%s]]\n" target-path layer-name)))) + (dolist (c categories) + (let* ((category-name (substring (file-name-nondirectory c) 1)) + (pretty-name (or (cdr (assoc category-name spacemacs--category-names)) + (s-capitalize (replace-regexp-in-string + "-" " " category-name))))) + (message "%S" category-name) + (unless (string= "distribution" category-name) + (insert (format "\n%s %s\n" level pretty-name)) + (spacemacs//generate-layers-from-path c (concat level "*")) + ))))) + +(defun spacemacs//generate-layers-file () + "Generate the layers list file." + (interactive) + (with-temp-buffer + (org-mode) + (insert "#+TITLE: Configuration layers\n") + (insert "#+HTML_HEAD_EXTRA: \n\n") + (insert "* Table of Contents\n") + (org-set-tags-to '("TOC_4_org" "noexport")) + ;; there is no layer at the root level for now + ;; uncomment this line if any new layer is added at the root level + ;; (insert "* General layers\n") + (spacemacs//generate-layers-from-path configuration-layer-directory "*") + (write-file (concat spacemacs-start-directory "layers/LAYERS.org")))) + +(defun spacemacs//format-toc (&rest r) + (if (not (null (car r))) + (let* ((toc (car r)) + (heading-pos (s-index-of "ContentsClose%s" beginning-of-heading rest-of-toc)) + toc)) + (car r))) + +(defun spacemacs//format-content (&rest r) + (let* ((content (car r)) + (div-string "
") + (toc-string "") + (has-toc (s-index-of "Table of Contents" content)) + (beginning-of-content-div-pos (+ (length div-string) (s-index-of div-string content))) + (beginning-of-content (substring content 0 beginning-of-content-div-pos)) + (rest-of-content (substring content beginning-of-content-div-pos))) + (if (not (null has-toc)) + (format "%s\n%s%s" beginning-of-content toc-string rest-of-content) + content))) + +(defun spacemacs//toc-org-unhrefify-toc () + "Make TOC classical org-mode TOC." + (let ((toc-org-hrefify-default "org")) + (toc-org-insert-toc))) + +(defun spacemacs//org-heading-annotate-custom-id () + "Annotate headings with the indexes that GitHub uses for linking. +`org-html-publish-to-html' will use them instead of the default #orgheadline{N}. +This way the GitHub links and the http://spacemacs.org/ links will be compatible." + (progn (goto-char (point-min)) + (goto-char (point-min)) + (while (re-search-forward "^[\\*]+\s\\(.*\\).*$" nil t) + (let ((heading (match-string 1))) + (progn (move-end-of-line nil) + (open-line 1) + (next-line 1) + (insert (format (concat " :PROPERTIES:\n" + " :CUSTOM_ID: %s\n" + " :END:\n") + (substring (toc-org-hrefify-gh + (replace-regexp-in-string + toc-org-tags-regexp + "" + heading)) + ;; Remove # prefix added by `toc-org-hrefify-gh'. + 1)))))))) + +(defun spacemacs//reroot-links () + "Find the links that start with https://github.com/syl20bnr/spacemacs/blob/ +and end with .org{#an-optional-heading-link} (i.e the links between the local org files). +Change their root to http://spacemacs.org/ so the links will point at files located on the site. +For the file to file links to work properly the exported org files should be processed with +the `spacemacs//org-heading-annotate-custom-id' function." + (let ((git-url-root-regexp + (concat "\\[\\[[\\s]*\\(https\\:\\/\\/github\\.com\\/syl20bnr" + "\\/spacemacs\\/blob\\/[^/]+\\/\\)[^]]+\\(\\.org\\).*$")) + (site-url "http://spacemacs.org/") + (site-doc-postf ".html")) + (progn (goto-char (point-min)) + (while (re-search-forward git-url-root-regexp nil t) + (progn (replace-match site-url nil t nil 1) + (replace-match site-doc-postf nil t nil 2)))))) + +(defun spacemacs//add-org-meta-readtheorg-css (filename) + (let* ((head-css-extra-readtheorg-head (concat + "#+HTML_HEAD_EXTRA:" + "\n")) + (progn (goto-char (point-min)) + (delete-matching-lines "\\+HTML_HEAD_EXTRA\\:.*\\/css\\/readtheorg\\.css") + (goto-char (point-min)) + (if (search-forward "#+TITLE:" nil t nil) + (beginning-of-line 2) + (error (format "Can't find #+TITLE: in %s" + (buffer-file-name)))) + (insert (concat head-css-extra-readtheorg-head + (f-relative spacemacs-start-directory + (file-name-directory filename)) + head-css-extra-readtheorg-tail))))) + +(defun spacemacs//pub-doc-html-advice (origfunc &rest args) + "Wrapper for `org-html-publish-to-html' use it to insert +preprocessors for the exported .org files." + (save-current-buffer + (save-excursion + (let* ((filename (car (nthcdr 1 args))) + (visitingp (find-buffer-visiting filename))) + ;; Temporary "unvisit" the visited org files. + (when visitingp (with-current-buffer visitingp (setq buffer-file-name nil))) + (with-temp-buffer + (save-match-data + (insert-file-contents filename t) + ;; ===========Add preprocessors here=============== + (spacemacs//add-org-meta-readtheorg-css filename) + (spacemacs//toc-org-unhrefify-toc) + (spacemacs//reroot-links) + (spacemacs//org-heading-annotate-custom-id) + (apply origfunc args) + (not-modified))) + ;; Restore `buffer-file-name' for the buffers that previously visited the org files. + (when visitingp (with-current-buffer visitingp (setq buffer-file-name filename))))))) + +(defun spacemacs/publish-doc () + "Publish the documentation to doc/export/." + (interactive) + (advice-add 'org-html-toc :filter-return #'spacemacs//format-toc) + (advice-add 'org-html-template :filter-return #'spacemacs//format-content) + (advice-add 'org-html-publish-to-html :around #'spacemacs//pub-doc-html-advice) + (let* ((header + " + + + + ") + (publish-target (concat spacemacs-start-directory "export/")) + (org-html-htmlize-output-type 'css) + (org-publish-project-alist + `(("spacemacs" + :components ("spacemacs-news" + "spacemacs-doc" + "spacemacs-doc-static" + "layers-doc" + "layers-doc-static")) + ("spacemacs-news" + :base-directory ,spacemacs-news-directory + :base-extension "org" + :publishing-directory ,(concat publish-target "news/") + :publishing-function org-html-publish-to-html + :headline-levels 4 + :html-head ,header) + ("spacemacs-doc" + :base-directory ,spacemacs-docs-directory + :base-extension "org" + :publishing-directory ,(concat publish-target "doc/") + :publishing-function org-html-publish-to-html + :headline-levels 4 + :html-head ,header) + ("layers-doc" + :base-directory ,(concat spacemacs-start-directory "layers/") + :base-extension "org" + :recursive t + :publishing-directory ,(concat publish-target "layers/") + :publishing-function org-html-publish-to-html + :preparation-function spacemacs//generate-layers-file + :exclude "local" + :html-head ,header) + ("spacemacs-doc-static" + :base-directory ,spacemacs-docs-directory + :base-extension "png" + :recursive t + :publishing-directory ,(concat publish-target "doc/") + :publishing-function org-publish-attachment) + ("layers-doc-static" + :base-directory ,(concat spacemacs-start-directory "layers/") + :base-extension "jpg\\|png\\|gif" + :recursive t + :publishing-directory ,(concat publish-target "layers/") + :publishing-function org-publish-attachment)))) + (org-publish-project "spacemacs")) + (advice-remove 'org-html-toc #'spacemacs//format-toc) + (advice-remove 'org-html-template #'spacemacs//format-content) + (advice-remove 'org-html-publish-to-html #'spacemacs//pub-doc-html-advice)) + +(provide 'core-documentation) diff --git a/emacs.d/core/core-dotspacemacs.el b/emacs.d/core/core-dotspacemacs.el new file mode 100644 index 0000000..cf454cb --- /dev/null +++ b/emacs.d/core/core-dotspacemacs.el @@ -0,0 +1,728 @@ +;;; core-dotspacemacs.el --- Spacemacs Core 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 +(defconst dotspacemacs-template-directory + (expand-file-name (concat spacemacs-core-directory "templates/")) + "Templates directory.") + +(defconst dotspacemacs-test-results-buffer "*dotfile-test-results*" + "Name of the buffer to display dotfile test results.") + +(let* ((env (getenv "SPACEMACSDIR")) + (env-dir (when env (expand-file-name (concat env "/")))) + (env-init (and env-dir (expand-file-name "init.el" env-dir))) + (no-env-dir-default (expand-file-name + (concat user-home-directory + ".spacemacs.d/"))) + (default-init (expand-file-name ".spacemacs" user-home-directory))) + (defconst dotspacemacs-directory + (cond + ((and env (file-exists-p env-dir)) + env-dir) + ((file-exists-p no-env-dir-default) + no-env-dir-default) + (t + nil)) + "Optional spacemacs directory, which defaults to +~/.spacemacs.d. This setting can be overridden using the +SPACEMACSDIR environment variable. If neither of these +directories exist, this variable will be nil.") + + (defvar dotspacemacs-filepath + (let ((spacemacs-dir-init (when dotspacemacs-directory + (concat dotspacemacs-directory + "init.el")))) + (cond + (env-init) + ((file-exists-p default-init) default-init) + ((and dotspacemacs-directory (file-exists-p spacemacs-dir-init)) spacemacs-dir-init) + (t default-init))) + "Filepath to the installed dotfile. If SPACEMACSDIR is given +then SPACEMACSDIR/init.el is used. Otherwise, if ~/.spacemacs +exists, then this is used. If ~/.spacemacs does not exist, then +check for init.el in dotspacemacs-directory and use this if it +exists. Otherwise, fallback to ~/.spacemacs")) + +(defvar dotspacemacs-distribution 'spacemacs + "Base distribution to use. This is a layer contained in the directory +`+distributions'. For now available distributions are `spacemacs-base' +or `spacemacs'.") + +(defvar dotspacemacs-elpa-https t + "If non nil ELPA repositories are contacted via HTTPS whenever it's +possible. Set it to nil if you have no way to use HTTPS in your +environment, otherwise it is strongly recommended to let it set to t.") + +(defvar dotspacemacs-elpa-timeout 5 + "Maximum allowed time in seconds to contact an ELPA repository.") + +(defvar dotspacemacs-elpa-subdirectory nil + "If non-nil, a form that evaluates to a package directory. For +example, to use different package directories for different Emacs +versions, set this to `emacs-version'.") + +(defvar dotspacemacs-configuration-layer-path '() + "List of additional paths where to look for configuration layers. +Paths must have a trailing slash (ie. `~/.mycontribs/')") + +(defvar dotspacemacs-install-packages 'used-only + "Defines the behaviour of Spacemacs when installing packages. +Possible values are `used-only', `used-but-keep-unused' and `all'. `used-only' +installs only explicitly used packages and uninstall any unused packages as well +as their unused dependencies. `used-but-keep-unused' installs only the used +packages but won't uninstall them if they become unused. `all' installs *all* +packages supported by Spacemacs and never uninstall them.") + +(defvar dotspacemacs-enable-lazy-installation 'unused + "Lazy installation of layers (i.e. layers are installed only when a file +with a supported type is opened). Possible values are `all', `unused' and `nil'. +`unused' will lazy install only unused layers (i.e. layers not listed in +variable `dotspacemacs-configuration-layers'), `all' will lazy install any layer +that support lazy installation even the layers listed in +`dotspacemacs-configuration-layers'. `nil' disable the lazy installation feature +and you have to explicitly list a layer in the variable +`dotspacemacs-configuration-layers' to install it.") + +(defvar dotspacemacs-ask-for-lazy-installation t + "If non-nil then Spacemacs will ask for confirmation before installing +a layer lazily.") + +(defvar dotspacemacs-additional-packages '() + "List of additional packages that will be installed wihout being +wrapped in a layer. If you need some configuration for these +packages then consider to create a layer, you can also put the +configuration in `dotspacemacs/user-config'.") + +(defvar dotspacemacs-editing-style 'vim + "One of `vim', `emacs' or `hybrid'. +`hybrid' is like `vim' except that `insert state' is replaced by the +`hybrid state' with `emacs' key bindings. The value can also be a list + with `:variables' keyword (similar to layers). Check the editing styles + section of the documentation for details on available variables.") + +(defvar dotspacemacs-startup-banner 'official + "Specify the startup banner. Default value is `official', it displays +the official spacemacs logo. An integer value is the index of text +banner, `random' chooses a random text banner in `core/banners' +directory. A string value must be a path to a .PNG file. +If the value is nil then no banner is displayed.") + +(defvar dotspacemacs-scratch-mode 'text-mode + "Default major mode of the scratch buffer.") + +(defvar dotspacemacs-check-for-update nil + "If non nil then spacemacs will check for updates at startup +when the current branch is not `develop'. Note that checking for +new versions works via git commands, thus it calls GitHub services +whenever you start Emacs.") + +(defvar dotspacemacs-configuration-layers '(emacs-lisp) + "List of configuration layers to load.") + +(defvar dotspacemacs--configuration-layers-saved nil + "Saved value of `dotspacemacs-configuration-layers' after sync.") + +(defvar dotspacemacs-themes '(spacemacs-dark + spacemacs-light) + "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") + +(defvar dotspacemacs-colorize-cursor-according-to-state t + "If non nil the cursor color matches the state color in GUI Emacs.") + +(defvar dotspacemacs-leader-key "SPC" + "The leader key.") + +(defvar dotspacemacs-emacs-leader-key "M-m" + "The leader key accessible in `emacs state' and `insert state'") + +(defvar dotspacemacs-major-mode-leader-key "," + "Major mode leader key is a shortcut key which is the equivalent of +pressing ` m`. Set it to `nil` to disable it.") + +(defvar dotspacemacs-major-mode-emacs-leader-key "C-M-m" + "Major mode leader key accessible in `emacs state' and `insert state'") + +(defvar dotspacemacs-ex-command-key ":" + "The key used for Vim Ex commands.") + +(defvar dotspacemacs-command-key "SPC" + "The key used for Emacs commands (M-x) (after pressing on the leader key).") +(defvaralias 'dotspacemacs-emacs-command-key 'dotspacemacs-command-key + "New official name for `dotspacemacs-command-key'") + +(defvar dotspacemacs-distinguish-gui-tab nil + "If non nil, distinguish C-i and tab in the GUI version of +emacs.") + +;; (defvar dotspacemacs-distinguish-gui-ret nil +;; "If non nil, distinguish C-m and return in the GUI version of +;; emacs.") + +(defvar dotspacemacs-default-font '("Source Code Pro" + :size 13 + :weight normal + :width normal + :powerline-scale 1.1) + "Default font, or prioritized list of fonts. `powerline-scale' +allows to quickly tweak the mode-line size to make separators +look not too crappy. + +Has no effect when running Emacs in terminal.") + +(defvar dotspacemacs-remap-Y-to-y$ nil + "If non nil `Y' is remapped to `y$' in Evil states.") + +(defvar dotspacemacs-retain-visual-state-on-shift t + "If non-nil, the shift mappings `<' and `>' retain visual state +if used there.") + +(defvar dotspacemacs-visual-line-move-text nil + "If non-nil, J and K move lines up and down when in visual mode.") + +(defvar dotspacemacs-ex-substitute-global nil + "If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.") + +(defvar dotspacemacs-folding-method 'evil + "Code folding method. Possible values are `evil' and `origami'.") + +(defvar dotspacemacs-default-layout-name "Default" + " Name of the default layout.") + +(defvar dotspacemacs-display-default-layout nil + "If non nil the default layout name is displayed in the mode-line.") + +(defvar dotspacemacs-auto-resume-layouts nil + "If non nil then the last auto saved layouts are resume automatically upon +start.") + +(defvar dotspacemacs-max-rollback-slots 5 + "Maximum number of rollback slots to keep in the cache.") + +(defvar dotspacemacs-helm-resize nil + "If non nil, `helm' will try to minimize the space it uses.") + +(defvar dotspacemacs-helm-no-header nil + "if non nil, the helm header is hidden when there is only one source.") + +(defvar dotspacemacs-helm-position 'bottom + "Position in which to show the `helm' mini-buffer.") + +(defvar dotspacemacs-helm-use-fuzzy 'always + "Controls fuzzy matching in helm. If set to `always', force fuzzy matching + in all non-asynchronous sources. If set to `source', preserve individual + source settings. Else, disable fuzzy matching in all sources.") + +(defvar dotspacemacs-large-file-size 1 + "Size (in MB) above which spacemacs will prompt to open the large file +literally to avoid performance issues. Opening a file literally means that +no major mode or minor modes are active.") + +(defvar dotspacemacs-auto-save-file-location 'cache + "Location where to auto-save files. Possible values are `original' to +auto-save the file in-place, `cache' to auto-save the file to another +file stored in the cache directory and `nil' to disable auto-saving. +Default value is `cache'.") + +(defvar dotspacemacs-enable-paste-transient-state t + "If non nil the paste transient-state is enabled. While enabled pressing `p` +several times cycle between the kill ring content.'") +(defvaralias + 'dotspacemacs-enable-paste-micro-state + 'dotspacemacs-enable-paste-transient-state + "Old name of `dotspacemacs-enable-paste-transient-state'.") + +(defvar dotspacemacs-which-key-delay 0.4 + "Delay in seconds starting from the last keystroke after which +the which-key buffer will be shown if you have not completed a +key sequence. Setting this variable is equivalent to setting +`which-key-idle-delay'.") + +(defvar dotspacemacs-which-key-position 'bottom + "Location of the which-key popup buffer. Possible choices are bottom, +right, and right-then-bottom. The last one will display on the +right if possible and fallback to bottom if not.") + +(defvar dotspacemacs-loading-progress-bar t + "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.") + +(defvar dotspacemacs-fullscreen-at-startup nil + "If non nil the frame is fullscreen when Emacs starts up (Emacs 24.4+ only).") + +(defvar dotspacemacs-fullscreen-use-non-native nil + "If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen. Use +to disable fullscreen animations in OSX.") + +(defvar dotspacemacs-maximized-at-startup 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.") + +(defvar 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 active or selected. Transparency +can be toggled through `toggle-transparency'.") + +(defvar dotspacemacs-inactive-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'.") + +(defvar dotspacemacs-show-transient-state-title t + "If non nil show the titles of transient states.") + +(defvar dotspacemacs-show-transient-state-color-guide t + "If non nil show the color guide hint for transient state keys.") + +(defvar dotspacemacs-mode-line-unicode-symbols t + "If non nil unicode symbols are displayed in the mode-line (eg. for lighters)") + +(defvar dotspacemacs-smooth-scrolling t + "If non nil smooth scrolling (native-scrolling) is enabled. +Smooth scrolling overrides the default behavior of Emacs which +recenters point when it reaches the top or bottom of the +screen.") + +(defvar dotspacemacs-line-numbers nil + "If non nil line numbers are turned on in all `prog-mode' and `text-mode' +derivatives. If set to `relative', also turns on relative line numbers.") + +(defvar dotspacemacs-persistent-server nil + "If non nil advises quit functions to keep server open when quitting.") + +(defvar dotspacemacs-smartparens-strict-mode nil + "If non-nil smartparens-strict-mode will be enabled in programming modes.") + +(defvar dotspacemacs-smart-closing-parenthesis nil + "If non-nil pressing the closing parenthesis `)' key in insert mode passes + over any automatically added closing parenthesis, bracket, quote, etc… + This can be temporary disabled by pressing `C-q' before `)'. (default nil)") + +(defvar dotspacemacs-highlight-delimiters 'all + "Select a scope to highlight delimiters. Possible values are `any', +`current', `all' or `nil'. Default is `all' (highlight any scope and + emphasis the current one.") + +(defvar dotspacemacs-whitespace-cleanup nil + "delete whitespace while saving buffer. possible values are `all' +to aggressively delete empty lines and long sequences of whitespace, `trailing' +to delete only the whitespace at end of lines, `changed' to delete only +whitespace for changed lines or `nil' to disable cleanup.") + +(defvar dotspacemacs-search-tools '("ag" "pt" "ack" "grep") + "List of search tool executable names. Spacemacs uses the first installed +tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.") + +(defvar dotspacemacs-default-package-repository 'melpa-stable + "The default package repository used if no explicit repository has been +specified with an installed package. +NOT USED FOR NOW :-)") + +(defvar dotspacemacs-startup-lists '((recents . 5) + (projects . 7)) + "Association list of items to show in the startup buffer of the form +`(list-type . list-size)`. If nil it is disabled. +Possible values for list-type are: +`recents' `bookmarks' `projects' `agenda' `todos'. +List sizes may be nil, in which case +`spacemacs--buffer-startup-lists-length' takes effect. +") + +(defvar dotspacemacs-startup-buffer-responsive t + "True if the home buffer should respond to resize events.") + +(defvar dotspacemacs-excluded-packages '() + "A list of packages that will not be install and loaded.") + +(defvar dotspacemacs-frozen-packages '() + "A list of packages that cannot be updated.") + +;; only for backward compatibility +(defalias 'dotspacemacs-mode 'emacs-lisp-mode) + +(defmacro dotspacemacs|call-func (func &optional msg) + "Call the function from the dotfile only if it is bound. +If MSG is not nil then display a message in `*Messages'. Errors +are caught and signalled to user in spacemacs buffer." + `(progn + (when ,msg (spacemacs-buffer/message ,msg)) + (when (fboundp ',func) + (condition-case-unless-debug err + (,func) + (error + (configuration-layer//increment-error-count) + (spacemacs-buffer/append (format "Error in %s: %s\n" + ',(symbol-name func) + (error-message-string err)) + t)))))) + +(defun dotspacemacs//check-layers-changed () + "Check if the value of `dotspacemacs-configuration-layers' +changed, and issue a warning if it did." + (unless (eq dotspacemacs-configuration-layers + dotspacemacs--configuration-layers-saved) + (spacemacs-buffer/warning + "`dotspacemacs-configuration-layers' was changed outside of `dotspacemacs/layers'."))) +(add-hook 'spacemacs-post-user-config-hook + 'dotspacemacs//check-layers-changed) + +(defun dotspacemacs//read-editing-style-config (config) + "Read editing style CONFIG: apply variables and return the editing style. +CONFIG can be the symbol of an editing style or a list where the car is +the symbol of an editing style and the cdr is a list of keyword arguments like +`:variables'." + (cond + ((symbolp config) config) + ((listp config) + (let ((variables (spacemacs/mplist-get config :variables))) + (while variables + (let ((var (pop variables))) + (if (consp variables) + (condition-case-unless-debug err + (set-default var (eval (pop variables))) + ('error + (spacemacs-buffer/append + (format (concat "\nAn error occurred while reading the " + "editing style variable %s " + "(error: %s). Be sure to quote the value " + "if needed.\n") var err)))) + (spacemacs-buffer/warning "Missing value for variable %s !" + var))))) + (car config)))) + +(defun dotspacemacs/add-layer (layer-name) + "Add LAYER_NAME to dotfile and reload the it. +Returns non nil if the layer has been effectively inserted." + (unless (configuration-layer/layer-usedp layer-name) + (with-current-buffer (find-file-noselect (dotspacemacs/location)) + (beginning-of-buffer) + (let ((insert-point (re-search-forward + "dotspacemacs-configuration-layers *\n?.*\\((\\)"))) + (insert (format "\n%S" layer-name)) + (indent-region insert-point (+ insert-point + (length (symbol-name layer-name)))) + (save-buffer))) + (load-file (dotspacemacs/location)) + t)) + +(defun dotspacemacs/sync-configuration-layers (&optional arg) + "Synchronize declared layers in dotfile with spacemacs. + +Called with `C-u' skips `dotspacemacs/user-config'. +Called with `C-u C-u' skips `dotspacemacs/user-config' _and_ preleminary tests." + (interactive "P") + (when (file-exists-p dotspacemacs-filepath) + (with-current-buffer (find-file-noselect dotspacemacs-filepath) + (let ((dotspacemacs-loading-progress-bar nil)) + (setq spacemacs-loading-string "") + (save-buffer) + (let ((tests-ok (or (equal arg '(16)) (dotspacemacs/test-dotfile t)))) + (if tests-ok + (progn + (load-file buffer-file-name) + (dotspacemacs|call-func dotspacemacs/init + "Calling dotfile init...") + (dotspacemacs|call-func dotspacemacs/user-init + "Calling dotfile user init...") + (setq dotspacemacs-editing-style + (dotspacemacs//read-editing-style-config + dotspacemacs-editing-style)) + (configuration-layer/sync) + (if (member arg '((4) (16))) + (message (concat "Done (`dotspacemacs/user-config' " + "function has been skipped).")) + (dotspacemacs|call-func dotspacemacs/user-config + "Calling dotfile user config...") + (run-hooks 'spacemacs-post-user-config-hook) + (message "Done."))) + (switch-to-buffer-other-window dotspacemacs-test-results-buffer) + (spacemacs-buffer/warning "Some tests failed, check `%s' buffer" + dotspacemacs-test-results-buffer)))))) + (when (configuration-layer/package-usedp 'spaceline) + (spacemacs//set-powerline-for-startup-buffers))) + +(defun dotspacemacs/get-variable-string-list () + "Return a list of all the dotspacemacs variables as strings." + (all-completions "" obarray + (lambda (x) + (and (boundp x) + (not (keywordp x)) + (string-prefix-p "dotspacemacs" + (symbol-name x)))))) + +(defun dotspacemacs/get-variable-list () + "Return a list of all dotspacemacs variable symbols." + (mapcar 'intern (dotspacemacs/get-variable-string-list))) + +(defmacro dotspacemacs|symbol-value (symbol) + "Return the value of SYMBOL corresponding to a dotspacemacs variable. +If SYMBOL value is `display-graphic-p' then return the result of + `(display-graphic-p)', otherwise return the value of the symbol." + `(if (eq 'display-graphic-p ,symbol) (display-graphic-p) ,symbol)) + +(defun dotspacemacs/location () + "Return the absolute path to the spacemacs dotfile." + dotspacemacs-filepath) + +(defun dotspacemacs/copy-template () + "Copy `.spacemacs.template' in home directory. Ask for confirmation +before copying the file if the destination already exists." + (interactive) + (let* ((copy? (if (file-exists-p dotspacemacs-filepath) + (y-or-n-p + (format "%s already exists. Do you want to overwrite it ? " + dotspacemacs-filepath)) t))) + (when copy? + (copy-file (concat dotspacemacs-template-directory + ".spacemacs.template") dotspacemacs-filepath t) + (message "%s has been installed." dotspacemacs-filepath)))) + +(defun dotspacemacs//ido-completing-read (prompt candidates) + "Call `ido-completing-read' with a CANDIDATES alist where the key is +a display strng and the value is the actual value to return." + (let ((ido-max-window-height (1+ (length candidates)))) + (cadr (assoc (ido-completing-read prompt (mapcar 'car candidates)) + candidates)))) + +(defun dotspacemacs/install (arg) + "Install the dotfile, return non nil if the doftile has been installed. + +If ARG is non nil then Ask questions to the user before installing the dotfile." + (interactive "P") + ;; preferences is an alist where the key is the text to replace by + ;; the value in the dotfile + (let ((preferences + (when arg + ;; editing style + `(("dotspacemacs-editing-style 'vim" + ,(format + "dotspacemacs-editing-style '%S" + (dotspacemacs//ido-completing-read + "What is your preferred editing style? " + '(("Among the stars aboard the Evil flagship (vim)" + vim) + ("On the planet Emacs in the Holy control tower (emacs)" + emacs))))) + ("dotspacemacs-distribution 'spacemacs" + ,(format + "dotspacemacs-distribution '%S" + (dotspacemacs//ido-completing-read + "What distribution of spacemacs would you like to start with? " + `(("The standard distribution, recommended (spacemacs)" + spacemacs) + (,(concat "A minimalist distribution that you can build on " + "(spacemacs-base)") + spacemacs-base))))) + ("helm" + ,(dotspacemacs//ido-completing-read + "What type of completion framework do you want? " + '(("A heavy one but full-featured (helm)" + "helm") + ("A lighter one but still very powerful (ivy)" + "ivy") + ;; For now, None works only if the user selected + ;; the spacemacs-base distribution + ("None (not recommended)" "")))))))) + (with-current-buffer (find-file-noselect + (concat dotspacemacs-template-directory + ".spacemacs.template")) + (dolist (p preferences) + (goto-char (point-min)) + (re-search-forward (car p)) + (replace-match (cadr p))) + (let ((install + (if (file-exists-p dotspacemacs-filepath) + (y-or-n-p + (format "%s already exists. Do you want to overwrite it ? " + dotspacemacs-filepath)) t))) + (when install + (write-file dotspacemacs-filepath) + (message "%s has been installed." dotspacemacs-filepath) + t)))) + (load-file dotspacemacs-filepath)) + +(defun dotspacemacs//install-and-replace (&optional values) + "Install the dotfile and replace its content according to VALUES. + +VALUES is an alist where the key is the text to replace and value is the new +value." + ) + +(defun dotspacemacs/load-file () + "Load ~/.spacemacs if it exists." + (let ((dotspacemacs (dotspacemacs/location))) + (if (file-exists-p dotspacemacs) + (unless (with-demoted-errors "Error loading .spacemacs: %S" (load dotspacemacs)) + (dotspacemacs/safe-load))))) + +(defun dotspacemacs/safe-load () + "Error recovery from malformed .spacemacs. +Loads default .spacemacs template and suspends pruning of orphan packages. +Informs users of error and prompts for default editing style for use during +error recovery." + (load (concat dotspacemacs-template-directory + ".spacemacs.template")) + (defadvice dotspacemacs/layers + (after error-recover-preserve-packages activate) + (progn + (setq-default dotspacemacs-install-packages 'used-but-keep-unused) + (ad-disable-advice 'dotspacemacs/layers 'after + 'error-recover-preserve-packages) + (ad-activate 'dotspacemacs/layers))) + (defadvice dotspacemacs/init + (after error-recover-prompt-for-style activate) + (progn + (setq-default dotspacemacs-editing-style + (intern + (ido-completing-read + (format + (concat + "Spacemacs encountered an error while " + "loading your `%s' file.\n" + "Pick your editing style for recovery " + "(use left and right arrows): ") + dotspacemacs-filepath) + '(("vim" vim) + ("emacs" emacs) + ("hybrid" hybrid)) + nil t nil nil 'vim))) + (ad-disable-advice 'dotspacemacs/init 'after + 'error-recover-prompt-for-style) + (ad-activate 'dotspacemacs/init)))) + +(defun dotspacemacs//test-dotspacemacs/layers () + "Tests for `dotspacemacs/layers'" + (insert + (format (concat "\n* Testing settings in dotspacemacs/layers " + "[[file:%s::dotspacemacs/layers][Show in File]]\n") + dotspacemacs-filepath)) + ;; protect global values of these variables + (let (dotspacemacs-configuration-layer-path dotspacemacs-configuration-layers + dotspacemacs-additional-packages dotspacemacs-excluded-packages + dotspacemacs-install-packages + (passed-tests 0) (total-tests 0)) + (load dotspacemacs-filepath) + (dotspacemacs/layers) + (spacemacs//test-list + 'stringp 'dotspacemacs-configuration-layer-path + "is a string" "path") + (spacemacs//test-list + 'file-directory-p 'dotspacemacs-configuration-layer-path + "exists in filesystem" "path") + (setq dotspacemacs-configuration-layers + (mapcar (lambda (l) (if (listp l) (car l) l)) + dotspacemacs-configuration-layers)) + (spacemacs//test-list + 'configuration-layer/get-layer-path + 'dotspacemacs-configuration-layers "can be found" "layer") + (insert (format + (concat "** RESULTS: " + "[[file:%s::dotspacemacs/layers][dotspacemacs/layers]] " + "passed %s out of %s tests\n") + dotspacemacs-filepath passed-tests total-tests)) + (equal passed-tests total-tests))) + +(defmacro dotspacemacs||let-init-test (&rest body) + "Macro to protect dotspacemacs variables" + `(let ((fpath dotspacemacs-filepath) + ,@(dotspacemacs/get-variable-list) + (passed-tests 0) (total-tests 0)) + (setq dotspacemacs-filepath fpath) + (load dotspacemacs-filepath) + ,@body)) + +(defun dotspacemacs//test-dotspacemacs/init () + "Tests for `dotspacemacs/init'" + (insert + (format (concat "\n* Testing settings in dotspacemacs/init " + "[[file:%s::dotspacemacs/init][Show in File]]\n") + dotspacemacs-filepath)) + (dotspacemacs||let-init-test + (dotspacemacs/init) + (spacemacs//test-var + (lambda (x) (or (member x '(vim emacs hybrid)) + (and (listp x) + (spacemacs/mplist-get x :variables)))) + 'dotspacemacs-editing-style + "is \'vim, \'emacs or \'hybrid or and list with `:variable' keyword") + (spacemacs//test-var + (lambda (x) (member x '(original cache nil))) + 'dotspacemacs-auto-save-file-location (concat "is one of \'original, " + "\'cache or nil")) + (spacemacs//test-var + (lambda (x) (member x '(all any current nil))) + 'dotspacemacs-highlight-delimiters "is one of \'all, \'any, \'current or nil") + (spacemacs//test-list + (lambda (x) + (let ((el (or (car-safe x) x)) + (list-size (cdr-safe x))) + (member el '(recents bookmarks projects todos agenda)))) + 'dotspacemacs-startup-lists (concat "includes \'recents, " + "\'bookmarks, \'todos, " + "\'agenda or \'projects")) + (spacemacs//test-list + (lambda (x) + (let ((el (or (car-safe x) x)) + (list-size (cdr-safe x))) + (or (null list-size)(numberp list-size)))) + 'dotspacemacs-startup-lists (concat "list size is a number")) + (spacemacs//test-var 'stringp 'dotspacemacs-leader-key "is a string") + (spacemacs//test-var 'stringp 'dotspacemacs-emacs-leader-key "is a string") + (spacemacs//test-var + (lambda (x) (or (null x) (stringp x))) + 'dotspacemacs-major-mode-leader-key "is a string or nil") + (spacemacs//test-var + (lambda (x) (or (null x) (stringp x))) + 'dotspacemacs-major-mode-emacs-leader-key "is a string or nil") + (spacemacs//test-var 'stringp 'dotspacemacs-emacs-command-key "is a string") + (insert (format + (concat "** RESULTS: " + "[[file:%s::dotspacemacs/init][dotspacemacs/init]] " + "passed %s out of %s tests\n") + dotspacemacs-filepath passed-tests total-tests)) + (equal passed-tests total-tests))) + +(defun dotspacemacs/test-dotfile (&optional hide-buffer) + "Test settings in dotfile for correctness. + Return non-nil if all the tests passed." + (interactive) + (configuration-layer/discover-layers) + (let ((min-version "0.0")) + ;; dotspacemacs-version not implemented yet + ;; (if (version< dotspacemacs-version min-version) + (if nil + (error (format (concat "error: dotspacemacs/test-dotfile requires " + "dotspacemacs-version %s") min-version)) + (with-current-buffer (get-buffer-create dotspacemacs-test-results-buffer) + (unless hide-buffer + (switch-to-buffer-other-window dotspacemacs-test-results-buffer)) + (org-mode) + (org-indent-mode) + (view-mode) + (when (bound-and-true-p flyspell-mode) + (flyspell-mode -1)) + (let (buffer-read-only) + (erase-buffer) + (insert (format "* Running tests on [[file:%s][%s]] (v%s)\n" + dotspacemacs-filepath dotspacemacs-filepath "0.0")) + ;; dotspacemacs-version not implemented yet + ;; (insert (format "* Running tests on %s (v%s)\n" dotspacemacs-filepath dotspacemacs-version)) + (prog1 + ;; execute all tests no matter what + (cl-reduce (lambda (x y) + (and (funcall y) x)) + '(dotspacemacs//test-dotspacemacs/layers + dotspacemacs//test-dotspacemacs/init) + :initial-value t) + (goto-char (point-min)))))))) + +(provide 'core-dotspacemacs) diff --git a/emacs.d/core/core-emacs-backports.el b/emacs.d/core/core-emacs-backports.el new file mode 100644 index 0000000..5c177ee --- /dev/null +++ b/emacs.d/core/core-emacs-backports.el @@ -0,0 +1,14 @@ +;;; core-emacs-backports.el --- Spacemacs Core 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 + +;; nothing for now + +(provide 'core-emacs-backports) diff --git a/emacs.d/core/core-fonts-support.el b/emacs.d/core/core-fonts-support.el new file mode 100644 index 0000000..ffeedb4 --- /dev/null +++ b/emacs.d/core/core-fonts-support.el @@ -0,0 +1,114 @@ +;;; core-fonts-support.el --- Spacemacs Core 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 +(require 'core-funcs) +(require 'core-spacemacs-buffer) + +(defvar spacemacs--diminished-minor-modes nil + "List of diminished modes to unicode or ascii values.") + +(defun spacemacs/set-default-font (plists) + "Set the font given the passed PLISTS. + +PLISTS has either the form (\"fontname\" :prop1 val1 :prop2 val2 ...) +or is a list of such. The first font that can be found will be used. + +The return value is nil if no font was found, truthy otherwise." + (unless (listp (car plists)) + (setq plists (list plists))) + (catch 'break + (dolist (plist plists) + (when (find-font (font-spec :name (car plist))) + (let* ((font (car plist)) + (props (cdr plist)) + (scale (plist-get props :powerline-scale)) + (font-props (spacemacs/mplist-remove + (spacemacs/mplist-remove props :powerline-scale) + :powerline-offset)) + (fontspec (apply 'font-spec :name font font-props))) + (spacemacs-buffer/message "Setting font \"%s\"..." font) + (set-frame-font fontspec nil t) + (push `(font . ,(frame-parameter nil 'font)) default-frame-alist) + (setq-default powerline-scale scale) + (setq-default powerline-height (spacemacs/compute-powerline-height)) + ;; fallback font for unicode characters used in spacemacs + (pcase system-type + (`gnu/linux + (setq fallback-font-name "NanumGothic") + (setq fallback-font-name2 "NanumGothic")) + (`darwin + (setq fallback-font-name "Arial Unicode MS") + (setq fallback-font-name2 "Arial Unicode MS")) + (`windows-nt + (setq fallback-font-name "MS Gothic") + (setq fallback-font-name2 "Lucida Sans Unicode")) + (`cygwin + (setq fallback-font-name "MS Gothic") + (setq fallback-font-name2 "Lucida Sans Unicode")) + (other + (setq fallback-font-name nil) + (setq fallback-font-name2 nil))) + (when (and fallback-font-name fallback-font-name2) + ;; remove any size or height properties in order to be able to + ;; scale the fallback fonts with the default one (for zoom-in/out + ;; for instance) + (let* ((fallback-props (spacemacs/mplist-remove + (spacemacs/mplist-remove font-props :size) + :height)) + (fallback-spec (apply 'font-spec + :name fallback-font-name + fallback-props)) + (fallback-spec2 (apply 'font-spec + :name fallback-font-name2 + fallback-props))) + ;; window numbers + (set-fontset-font "fontset-default" + '(#x2776 . #x2793) fallback-spec nil 'prepend) + ;; mode-line circled letters + (set-fontset-font "fontset-default" + '(#x24b6 . #x24fe) fallback-spec nil 'prepend) + ;; mode-line additional characters + (set-fontset-font "fontset-default" + '(#x2295 . #x22a1) fallback-spec nil 'prepend) + ;; new version lighter + (set-fontset-font "fontset-default" + '(#x2190 . #x2200) fallback-spec2 nil 'prepend)))) + (throw 'break t))) + nil)) + +(defun spacemacs/compute-powerline-height () + "Return an adjusted powerline height." + (let ((scale (if (and (boundp 'powerline-scale) powerline-scale) + powerline-scale 1))) + (truncate (* scale (frame-char-height))))) + +(defun spacemacs/set-font (&rest args) + "Deprecated function, display a warning message." + (spacemacs-buffer/warning (concat "spacemacs/set-font is deprecated. " + "Use the variable `dotspacemacs-default-font' " + "instead (see Font section in " + "~/.emacs.d/doc/DOCUMENTATION.org for more " + "info)."))) + +(defmacro spacemacs|diminish (mode &optional unicode ascii) + "Diminish MODE name in mode line to UNICODE or ASCII depending on the value +`dotspacemacs-mode-line-unicode-symbols'. +If ASCII is not provided then UNICODE is used instead. If neither are provided, +the mode will not show in the mode line." + `(let ((cell (assq ',mode spacemacs--diminished-minor-modes))) + (if cell + (setcdr cell '(,unicode ,ascii)) + (push '(,mode ,unicode ,ascii) spacemacs--diminished-minor-modes)))) + +(defmacro spacemacs|hide-lighter (mode) + "Diminish MODE name in mode line to LIGHTER." + `(eval-after-load 'diminish '(diminish ',mode))) + +(provide 'core-fonts-support) diff --git a/emacs.d/core/core-funcs.el b/emacs.d/core/core-funcs.el new file mode 100644 index 0000000..9f7334f --- /dev/null +++ b/emacs.d/core/core-funcs.el @@ -0,0 +1,385 @@ +;;; core-funcs.el --- Spacemacs Core 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 + +(defvar configuration-layer--protected-packages) +(defvar dotspacemacs-filepath) +(defvar spacemacs-repl-list '() + "List of all registered REPLs.") + +(defun spacemacs/system-is-mac () + (eq system-type 'darwin)) +(defun spacemacs/system-is-linux () + (eq system-type 'gnu/linux)) +(defun spacemacs/system-is-mswindows () + (eq system-type 'windows-nt)) + +(defun spacemacs/window-system-is-mac () + ;; ns is returned instead of mac on Emacs 25+ + (memq (window-system) '(mac ns))) + +(defun spacemacs/run-prog-mode-hooks () + "Runs `prog-mode-hook'. Useful for modes that don't derive from +`prog-mode' but should." + (run-hooks 'prog-mode-hook)) + +(defun spacemacs/run-text-mode-hooks () + "Runs `text-mode-hook'. Useful for modes that don't derive from +`text-mode' but should." + (run-hooks 'text-mode-hook)) + +(defun spacemacs//get-package-directory (pkg) + "Return the directory of PKG. Return nil if not found." + (let ((elpa-dir (file-name-as-directory package-user-dir))) + (when (file-exists-p elpa-dir) + (let* ((pkg-match (concat "\\`" (symbol-name pkg) "-[0-9]+")) + (dir (car (directory-files elpa-dir 'full pkg-match)))) + (when dir (file-name-as-directory dir)))))) + +(defun spacemacs/mplist-get (plist prop) + "Get the values associated to PROP in PLIST, a modified plist. + +A modified plist is one where keys are keywords and values are +all non-keywords elements that follow it. + +If there are multiple properties with the same keyword, only the first property +and its values is returned. + +Currently this function infloops when the list is circular." + (let ((tail plist) + result) + (while (and (consp tail) (not (eq prop (car tail)))) + (pop tail)) + ;; pop the found keyword + (pop tail) + (while (and (consp tail) (not (keywordp (car tail)))) + (push (pop tail) result)) + (nreverse result))) + +(defun spacemacs/mplist-remove (plist prop) + "Return a copy of a modified PLIST without PROP and its values. + +If there are multiple properties with the same keyword, only the first property +and its values are removed." + (let ((tail plist) + result) + (while (and (consp tail) (not (eq prop (car tail)))) + (push (pop tail) result)) + (when (eq prop (car tail)) + (pop tail) + (while (and (consp tail) (not (keywordp (car tail)))) + (pop tail))) + (while (consp tail) + (push (pop tail) result)) + (nreverse result))) + +;; Originally based on http://stackoverflow.com/questions/2321904/elisp-how-to-save-data-in-a-file +(defun spacemacs/dump-vars-to-file (varlist filename) + "simplistic dumping of variables in VARLIST to a file FILENAME" + (with-temp-file filename + (spacemacs/dump varlist (current-buffer)) + (make-directory (file-name-directory filename) t))) + +;; From http://stackoverflow.com/questions/2321904/elisp-how-to-save-data-in-a-file +(defun spacemacs/dump (varlist buffer) + "insert into buffer the setq statement to recreate the variables in VARLIST" + (cl-loop for var in varlist do + (print (list 'setq var (list 'quote (symbol-value var))) + buffer))) + +(defvar spacemacs--init-redisplay-count 0 + "The number of calls to `redisplay'") +(defun spacemacs//redisplay () + "`redisplay' wrapper." + (setq spacemacs--init-redisplay-count (1+ spacemacs--init-redisplay-count)) + (redisplay)) + +(defun spacemacs//create-key-binding-form (props func) + "Helper which returns a from to bind FUNC to a key according to PROPS. + +Supported properties: + +`:evil-leader STRING' + One or several key sequence strings to be set with `spacemacs/set-leader-keys . + +`:evil-leader-for-mode CONS CELL' + One or several cons cells (MODE . KEY) where MODE is a major-mode symbol + and KEY is a key sequence string to be set with + `spacemacs/set-leader-keys-for-major-mode'. + +`:global-key STRING' + One or several key sequence strings to be set with `global-set-key'. + +`:define-key CONS CELL' + One or several cons cells (MAP . KEY) where MAP is a mode map and KEY is a + key sequence string to be set with `define-key'. " + (let ((evil-leader (spacemacs/mplist-get props :evil-leader)) + (evil-leader-for-mode (spacemacs/mplist-get props :evil-leader-for-mode)) + (global-key (spacemacs/mplist-get props :global-key)) + (def-key (spacemacs/mplist-get props :define-key))) + (append + (when evil-leader + `((dolist (key ',evil-leader) + (spacemacs/set-leader-keys key ',func)))) + (when evil-leader-for-mode + `((dolist (val ',evil-leader-for-mode) + (spacemacs/set-leader-keys-for-major-mode + (car val) (cdr val) ',func)))) + (when global-key + `((dolist (key ',global-key) + (global-set-key (kbd key) ',func)))) + (when def-key + `((dolist (val ',def-key) + (define-key (eval (car val)) (kbd (cdr val)) ',func))))))) + +(defun spacemacs/prettify-org-buffer () + "Apply visual enchantments to the current buffer. +The buffer's major mode should be `org-mode'." + (interactive) + (unless (derived-mode-p 'org-mode) + (user-error "org-mode should be enabled in the current buffer.")) + + ;; Make ~SPC ,~ work, reference: + ;; http://stackoverflow.com/questions/24169333/how-can-i-emphasize-or-verbatim-quote-a-comma-in-org-mode + (setcar (nthcdr 2 org-emphasis-regexp-components) " \t\n") + (org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components) + (setq-local org-emphasis-alist '(("*" bold) + ("/" italic) + ("_" underline) + ("=" org-verbatim verbatim) + ("~" org-kbd) + ("+" + (:strike-through t)))) + (when (require 'space-doc nil t) + (space-doc-mode))) + +(defun spacemacs/view-org-file (file &optional anchor-text expand-scope) + "Open org file and apply visual enchantments. +FILE is the org file to be opened. +If ANCHOR-TEXT is `nil' then run `re-search-forward' with ^ (beginning-of-line). +If ANCHOR-TEXT is a GitHub style anchor then find a corresponding header. +If ANCHOR-TEXT isn't a GitHub style anchor then run `re-search-forward' with +ANCHOR-TEXT. +If EXPAND-SCOPE is `subtree' then run `outline-show-subtree' at the matched line. +If EXPAND-SCOPE is `all' then run `outline-show-all' at the matched line." + (interactive) + (find-file file) + (spacemacs/prettify-org-buffer) + (goto-char (point-min)) + (when anchor-text + ;; If `anchor-text' is GitHub style link. + (if (string-prefix-p "#" anchor-text) + ;; If the toc-org package is loaded. + (if (configuration-layer/package-usedp 'toc-org) + ;; For each heading. Search the heading that corresponds + ;; to `anchor-text'. + (while (and (re-search-forward "^[\\*]+\s\\(.*\\).*$" nil t) + (not (string= (toc-org-hrefify-gh (match-string 1)) + anchor-text)))) + ;; This is not a problem because without the space-doc package + ;; those links will be opened in the browser. + (message (format (concat "Can't follow the GitHub style anchor: '%s' " + "without the org layer.") anchor-text))) + (re-search-forward anchor-text))) + (beginning-of-line) + (cond + ((eq expand-scope 'subtree) + (outline-show-subtree)) + ((eq expand-scope 'all) + (outline-show-all)) + (t nil))) + +(defun spacemacs//test-var (pred var test-desc) + "Test PRED against VAR and print test result, incrementing +passed-tests and total-tests." + (let ((var-name (symbol-name var)) + (var-val (symbol-value var))) + (when (boundp 'total-tests) (setq total-tests (1+ total-tests))) + (insert (format "** TEST: [[file:%s::%s][%s]] %s\n" + dotspacemacs-filepath var-name var-name test-desc)) + (if (funcall pred var-val) + (progn + (when (boundp 'passed-tests) (setq passed-tests (1+ passed-tests))) + (insert (format "*** PASS: %s\n" var-val))) + (insert (propertize (format "*** FAIL: %s\n" var-val) + 'font-lock-face 'font-lock-warning-face))))) + +(defun spacemacs//test-list (pred varlist test-desc &optional element-desc) + "Test PRED against each element of VARLIST and print test +result, incrementing passed-tests and total-tests." + (let ((varlist-name (symbol-name varlist)) + (varlist-val (symbol-value varlist))) + (if element-desc + (insert (format "** TEST: Each %s in [[file:%s::%s][%s]] %s\n" + element-desc dotspacemacs-filepath varlist-name + varlist-name test-desc)) + (insert (format "** TEST: Each element of [[file:%s::%s][%s]] %s\n" + dotspacemacs-filepath varlist-name varlist-name + test-desc))) + (dolist (var varlist-val) + (when (boundp 'total-tests) (setq total-tests (1+ total-tests))) + (if (funcall pred var) + (progn + (when (boundp 'passed-tests) (setq passed-tests (1+ passed-tests))) + (insert (format "*** PASS: %s\n" var))) + (insert (propertize (format "*** FAIL: %s\n" var) 'font-lock-face 'font-lock-warning-face)))))) + +;; hide mode line +;; from http://bzg.fr/emacs-hide-mode-line.html +(defvar-local hidden-mode-line-mode nil) +(defvar-local hide-mode-line nil) +(define-minor-mode hidden-mode-line-mode + "Minor mode to hide the mode-line in the current buffer." + :init-value nil + :global t + :variable hidden-mode-line-mode + :group 'editing-basics + (if hidden-mode-line-mode + (setq hide-mode-line mode-line-format + mode-line-format nil) + (setq mode-line-format hide-mode-line + hide-mode-line nil)) + (force-mode-line-update) + ;; Apparently force-mode-line-update is not always enough to + ;; redisplay the mode-line + (redraw-display) + (when (and (called-interactively-p 'interactive) + hidden-mode-line-mode) + (run-with-idle-timer + 0 nil 'message + (concat "Hidden Mode Line Mode enabled. " + "Use M-x hidden-mode-line-mode to make the mode-line appear.")))) + +(defun spacemacs/recompile-elpa () + "Recompile packages in elpa directory. Useful if you switch +Emacs versions." + (interactive) + (byte-recompile-directory package-user-dir nil t)) + +(defun spacemacs/register-repl (feature repl-func &optional tag) + "Register REPL-FUNC to the global list of REPLs SPACEMACS-REPL-LIST. +FEATURE will be loaded before running the REPL, in case it is not already +loaded. If TAG is non-nil, it will be used as the string to show in the helm +buffer." + (push `(,(or tag (symbol-name repl-func)) + . (,feature . ,repl-func)) + spacemacs-repl-list)) + +;; http://stackoverflow.com/questions/11847547/emacs-regexp-count-occurrences +(defun spacemacs/how-many-str (regexp str) + (loop with start = 0 + for count from 0 + while (string-match regexp str start) + do (setq start (match-end 0)) + finally return count)) + +;; from https://github.com/cofi/dotfiles/blob/master/emacs.d/config/cofi-util.el#L38 +(defun spacemacs/add-to-hooks (fun hooks) + "Add function to hooks" + (dolist (hook hooks) + (add-hook hook fun))) + +(defun spacemacs/add-all-to-hook (hook &rest funs) + "Add functions to hook." + (spacemacs/add-to-hook hook funs)) + +(defun spacemacs/add-to-hook (hook funs) + "Add list of functions to hook." + (dolist (fun funs) + (add-hook hook fun))) + +(defun spacemacs/echo (msg &rest args) + "Display MSG in echo-area without logging it in *Messages* buffer." + (interactive) + (let ((message-log-max nil)) + (apply 'message msg args))) + +(defun spacemacs/alternate-buffer (&optional window) + "Switch back and forth between current and last buffer in the +current window." + (interactive) + (let ((current-buffer (window-buffer window)) + (buffer-predicate + (frame-parameter (window-frame window) 'buffer-predicate))) + ;; switch to first buffer previously shown in this window that matches + ;; frame-parameter `buffer-predicate' + (switch-to-buffer + (or (cl-find-if (lambda (buffer) + (and (not (eq buffer current-buffer)) + (or (null buffer-predicate) + (funcall buffer-predicate buffer)))) + (mapcar #'car (window-prev-buffers window))) + ;; `other-buffer' honors `buffer-predicate' so no need to filter + (other-buffer current-buffer t))))) + +(defun spacemacs/comint-clear-buffer () + (interactive) + (let ((comint-buffer-maximum-size 0)) + (comint-truncate-buffer))) + + +;; Generalized next-error system ("gne") + +(defun spacemacs/error-delegate () + "Decide which error API to delegate to. + +Delegates to flycheck if it is enabled and the next-error buffer +is not visible. Otherwise delegates to regular Emacs next-error." + (if (and (bound-and-true-p flycheck-mode) + (let ((buf (ignore-errors (next-error-find-buffer)))) + (not (and buf (get-buffer-window buf))))) + 'flycheck + 'emacs)) + +(defun spacemacs/next-error (&optional n reset) + "Dispatch to flycheck or standard emacs error." + (interactive "P") + (let ((sys (spacemacs/error-delegate))) + (cond + ((eq 'flycheck sys) (call-interactively 'flycheck-next-error)) + ((eq 'emacs sys) (call-interactively 'next-error))))) + +(defun spacemacs/previous-error (&optional n reset) + "Dispatch to flycheck or standard emacs error." + (interactive "P") + (let ((sys (spacemacs/error-delegate))) + (cond + ((eq 'flycheck sys) (call-interactively 'flycheck-previous-error)) + ((eq 'emacs sys) (call-interactively 'previous-error))))) + +(defvar-local spacemacs--gne-min-line nil + "The first line in the buffer that is a valid result.") +(defvar-local spacemacs--gne-max-line nil + "The last line in the buffer that is a valid result.") +(defvar-local spacemacs--gne-cur-line 0 + "The current line in the buffer. (It is problematic to use +point for this.)") +(defvar-local spacemacs--gne-line-func nil + "The function to call to visit the result on a line.") + +(defun spacemacs/gne-next (num reset) + "A generalized next-error function. This function can be used +as `next-error-function' in any buffer that conforms to the +Spacemacs generalized next-error API. + +The variables `spacemacs--gne-min-line', +`spacemacs--gne-max-line', and `spacemacs--line-func' must be +set." + (when reset (setq spacemacs--gne-cur-line + spacemacs--gne-min-line)) + (setq spacemacs--gne-cur-line + (min spacemacs--gne-max-line + (max spacemacs--gne-min-line + (+ num spacemacs--gne-cur-line)))) + (goto-line spacemacs--gne-cur-line) + (funcall spacemacs--gne-line-func + (buffer-substring (point-at-bol) (point-at-eol)))) + +(provide 'core-funcs) diff --git a/emacs.d/core/core-jump.el b/emacs.d/core/core-jump.el new file mode 100644 index 0000000..48676d2 --- /dev/null +++ b/emacs.d/core/core-jump.el @@ -0,0 +1,66 @@ +;;; core-jump.el --- Spacemacs Core 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 + +(defvar spacemacs-default-jump-handlers '() + "List of jump handlers available in every mode.") + +(defvar-local spacemacs-jump-handlers '() + "List of jump handlers local to this buffer.") + +(defmacro spacemacs|define-jump-handlers (mode &rest handlers) + "Defines jump handlers for the given MODE. +This defines a variable `spacemacs-jump-handlers-MODE' to which +handlers can be added, and a function added to MODE-hook which +sets `spacemacs-jump-handlers' in buffers of that mode." + (let ((mode-hook (intern (format "%S-hook" mode))) + (func (intern (format "spacemacs//init-jump-handlers-%S" mode))) + (handlers-list (intern (format "spacemacs-jump-handlers-%S" mode)))) + `(progn + (defvar ,handlers-list ',handlers + ,(format (concat "List of mode-specific jump handlers for %S. " + "These take priority over those in " + "`spacemacs-default-jump-handlers'.") + mode)) + (defun ,func () + (setq spacemacs-jump-handlers + (append ,handlers-list + spacemacs-default-jump-handlers))) + (add-hook ',mode-hook ',func) + (with-eval-after-load 'bind-map + (spacemacs/set-leader-keys-for-major-mode ',mode + "gg" 'spacemacs/jump-to-definition))))) + +(defun spacemacs/jump-to-definition () + (interactive) + (catch 'done + (let ((old-buffer (current-buffer)) + (old-point (point))) + (dolist (-handler spacemacs-jump-handlers) + (let ((handler (if (listp -handler) (car -handler) -handler)) + (async (when (listp -handler) + (plist-get (cdr -handler) :async)))) + (ignore-errors + (call-interactively handler)) + (when (or async + (not (eq old-point (point))) + (not (equal old-buffer (current-buffer)))) + (throw 'done t))))) + (message "No jump handler was able to find this symbol."))) + +;; Set the `:jump' property manually instead of just using `evil-define-motion' +;; in an `eval-after-load' macro invocation because doing that prevents +;; `describe-function' from correctly finding the source. +;; +;; See discussion on https://github.com/syl20bnr/spacemacs/pull/6771 +(with-eval-after-load 'evil + (evil-set-command-property 'spacemacs/jump-to-definition :jump t)) + +(provide 'core-jump) diff --git a/emacs.d/core/core-keybindings.el b/emacs.d/core/core-keybindings.el new file mode 100644 index 0000000..fc3cf6d --- /dev/null +++ b/emacs.d/core/core-keybindings.el @@ -0,0 +1,177 @@ +;;; core-keybindings.el --- Spacemacs Core 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 + +(require 'core-funcs) + +(defvar spacemacs/prefix-titles nil + "alist for mapping command prefixes to long names.") + +(defvar spacemacs-default-map (make-sparse-keymap) + "Base keymap for all spacemacs leader key commands.") + +(defun spacemacs/translate-C-i (_) + "If `dotspacemacs-distinguish-gui-tab' is non nil, the raw key +sequence does not include or , and we are in the +gui, translate to [C-i]. Otherwise, [9] (TAB)." + (interactive) + (if (and (not (cl-position 'tab (this-single-command-raw-keys))) + (not (cl-position 'kp-tab (this-single-command-raw-keys))) + dotspacemacs-distinguish-gui-tab + (display-graphic-p)) + [C-i] [?\C-i])) +(define-key key-translation-map [?\C-i] 'spacemacs/translate-C-i) + +;; (defun spacemacs/translate-C-m (_) +;; "If `dotspacemacs-distinguish-gui-ret' is non nil, the raw key +;; sequence does not include , and we are in the gui, translate +;; to [C-m]. Otherwise, [9] (TAB)." +;; (interactive) +;; (if (and +;; (not (cl-position 'return (this-single-command-raw-keys))) +;; (not (cl-position 'kp-enter (this-single-command-raw-keys))) +;; dotspacemacs-distinguish-gui-ret +;; (display-graphic-p)) +;; [C-m] [?\C-m])) +;; (define-key key-translation-map [?\C-m] 'spacemacs/translate-C-m) + +(defun spacemacs/declare-prefix (prefix name &optional long-name) + "Declare a prefix PREFIX. PREFIX is a string describing a key +sequence. NAME is a string used as the prefix command. +LONG-NAME if given is stored in `spacemacs/prefix-titles'." + (let* ((command name) + (full-prefix (concat dotspacemacs-leader-key " " prefix)) + (full-prefix-emacs (concat dotspacemacs-emacs-leader-key " " prefix)) + (full-prefix-lst (listify-key-sequence (kbd full-prefix))) + (full-prefix-emacs-lst (listify-key-sequence + (kbd full-prefix-emacs)))) + ;; define the prefix command only if it does not already exist + (unless long-name (setq long-name name)) + (which-key-declare-prefixes + full-prefix-emacs (cons name long-name) + full-prefix (cons name long-name)))) + +(defun spacemacs/declare-prefix-for-mode (mode prefix name &optional long-name) + "Declare a prefix PREFIX. MODE is the mode in which this prefix command should +be added. PREFIX is a string describing a key sequence. NAME is a symbol name +used as the prefix command." + (let ((command (intern (concat (symbol-name mode) name))) + (full-prefix (concat dotspacemacs-leader-key " " prefix)) + (full-prefix-emacs (concat dotspacemacs-emacs-leader-key " " prefix)) + (is-major-mode-prefix (string-prefix-p "m" prefix)) + (major-mode-prefix (concat dotspacemacs-major-mode-leader-key + " " (substring prefix 1))) + (major-mode-prefix-emacs + (concat dotspacemacs-major-mode-emacs-leader-key + " " (substring prefix 1)))) + (unless long-name (setq long-name name)) + (let ((prefix-name (cons name long-name))) + (which-key-declare-prefixes-for-mode mode + full-prefix-emacs prefix-name + full-prefix prefix-name) + (when (and is-major-mode-prefix dotspacemacs-major-mode-leader-key) + (which-key-declare-prefixes-for-mode mode major-mode-prefix prefix-name)) + (when (and is-major-mode-prefix dotspacemacs-major-mode-emacs-leader-key) + (which-key-declare-prefixes-for-mode + mode major-mode-prefix-emacs prefix-name))))) + +(defun spacemacs/set-leader-keys (key def &rest bindings) + "Add KEY and DEF as key bindings under +`dotspacemacs-leader-key' and `dotspacemacs-emacs-leader-key'. +KEY should be a string suitable for passing to `kbd', and it +should not include the leaders. DEF is most likely a quoted +command. See `define-key' for more information about the possible +choices for DEF. This function simply uses `define-key' to add +the bindings. + +For convenience, this function will accept additional KEY DEF +pairs. For example, + +\(spacemacs/set-leader-keys + \"a\" 'command1 + \"C-c\" 'command2 + \"bb\" 'command3\)" + (while key + (define-key spacemacs-default-map (kbd key) def) + (setq key (pop bindings) def (pop bindings)))) +(put 'spacemacs/set-leader-keys 'lisp-indent-function 'defun) + +(defalias 'evil-leader/set-key 'spacemacs/set-leader-keys) + +(defun spacemacs//acceptable-leader-p (key) + "Return t if key is a string and non-empty." + (and (stringp key) (not (string= key "")))) + +(defun spacemacs//init-leader-mode-map (mode map &optional minor) + "Check for MAP-prefix. If it doesn't exist yet, use `bind-map' +to create it and bind it to `dotspacemacs-major-mode-leader-key' +and `dotspacemacs-major-mode-emacs-leader-key'. If MODE is a +minor-mode, the third argument should be non nil." + (let* ((prefix (intern (format "%s-prefix" map))) + (leader1 (when (spacemacs//acceptable-leader-p + dotspacemacs-major-mode-leader-key) + dotspacemacs-major-mode-leader-key)) + (leader2 (when (spacemacs//acceptable-leader-p + dotspacemacs-leader-key) + (concat dotspacemacs-leader-key + (unless minor " m")))) + (emacs-leader1 (when (spacemacs//acceptable-leader-p + dotspacemacs-major-mode-emacs-leader-key) + dotspacemacs-major-mode-emacs-leader-key)) + (emacs-leader2 (when (spacemacs//acceptable-leader-p + dotspacemacs-emacs-leader-key) + (concat dotspacemacs-emacs-leader-key + (unless minor " m")))) + (leaders (delq nil (list leader1 leader2))) + (emacs-leaders (delq nil (list emacs-leader1 emacs-leader2)))) + (or (boundp prefix) + (progn + (eval + `(bind-map ,map + :prefix-cmd ,prefix + ,(if minor :minor-modes :major-modes) (,mode) + :keys ,emacs-leaders + :evil-keys ,leaders + :evil-states (normal motion visual evilified))) + (boundp prefix))))) + +(defun spacemacs/set-leader-keys-for-major-mode (mode key def &rest bindings) + "Add KEY and DEF as key bindings under +`dotspacemacs-major-mode-leader-key' and +`dotspacemacs-major-mode-emacs-leader-key' for the major-mode +MODE. MODE should be a quoted symbol corresponding to a valid +major mode. The rest of the arguments are treated exactly like +they are in `spacemacs/set-leader-keys'." + (let* ((map (intern (format "spacemacs-%s-map" mode)))) + (when (spacemacs//init-leader-mode-map mode map) + (while key + (define-key (symbol-value map) (kbd key) def) + (setq key (pop bindings) def (pop bindings)))))) +(put 'spacemacs/set-leader-keys-for-major-mode 'lisp-indent-function 'defun) + +(defalias + 'evil-leader/set-key-for-mode + 'spacemacs/set-leader-keys-for-major-mode) + +(defun spacemacs/set-leader-keys-for-minor-mode (mode key def &rest bindings) + "Add KEY and DEF as key bindings under +`dotspacemacs-major-mode-leader-key' and +`dotspacemacs-major-mode-emacs-leader-key' for the minor-mode +MODE. MODE should be a quoted symbol corresponding to a valid +minor mode. The rest of the arguments are treated exactly like +they are in `spacemacs/set-leader-keys'." + (let* ((map (intern (format "spacemacs-%s-map" mode)))) + (when (spacemacs//init-leader-mode-map mode map t) + (while key + (define-key (symbol-value map) (kbd key) def) + (setq key (pop bindings) def (pop bindings)))))) +(put 'spacemacs/set-leader-keys-for-minor-mode 'lisp-indent-function 'defun) + +(provide 'core-keybindings) diff --git a/emacs.d/core/core-load-paths.el b/emacs.d/core/core-load-paths.el new file mode 100644 index 0000000..0c752b3 --- /dev/null +++ b/emacs.d/core/core-load-paths.el @@ -0,0 +1,77 @@ +;;; core-load-paths.el --- Spacemacs Core 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 +(defun add-to-load-path (dir) (add-to-list 'load-path dir)) + +(defun add-to-load-path-if-exists (dir) + "If DIR exists in the file system, add it to `load-path'." + (when (file-exists-p dir) + (add-to-load-path dir))) + +;; paths +(defvar spacemacs-start-directory + user-emacs-directory + "Spacemacs start directory.") +(defconst spacemacs-core-directory + (expand-file-name (concat spacemacs-start-directory "core/")) + "Spacemacs core directory.") +(defconst spacemacs-info-directory + (expand-file-name (concat spacemacs-core-directory "info/")) + "Spacemacs info files directory") +(defconst spacemacs-release-notes-directory + (expand-file-name (concat spacemacs-info-directory "release-notes/")) + "Spacemacs release notes directory") +(defconst spacemacs-banner-directory + (expand-file-name (concat spacemacs-core-directory "banners/")) + "Spacemacs banners directory.") +(defconst spacemacs-banner-official-png + (expand-file-name (concat spacemacs-banner-directory "img/spacemacs.png")) + "Spacemacs official banner image.") +(defconst spacemacs-badge-official-png + (expand-file-name (concat spacemacs-banner-directory + "img/spacemacs-badge.png")) + "Spacemacs official badge image.") +(defconst spacemacs-purple-heart-png + (expand-file-name (concat spacemacs-banner-directory "img/heart.png")) + "Purple heart emoji.") +(defconst spacemacs-cache-directory + (expand-file-name (concat user-emacs-directory ".cache/")) + "Spacemacs storage area for persistent files") +(defconst spacemacs-auto-save-directory + (expand-file-name (concat spacemacs-cache-directory "auto-save/")) + "Spacemacs auto-save directory") +(defconst spacemacs-docs-directory + (expand-file-name (concat spacemacs-start-directory "doc/")) + "Spacemacs documentation directory.") +(defconst spacemacs-news-directory + (expand-file-name (concat spacemacs-start-directory "news/")) + "Spacemacs News directory.") +(defconst spacemacs-assets-directory + (expand-file-name (concat spacemacs-start-directory "assets/")) + "Spacemacs assets directory.") +(defconst spacemacs-test-directory + (expand-file-name (concat spacemacs-start-directory "tests/")) + "Spacemacs tests directory.") + +(defconst user-home-directory + (expand-file-name "~/") + "User home directory (~/).") +(defconst pcache-directory + (concat spacemacs-cache-directory "pcache/")) +(unless (file-exists-p spacemacs-cache-directory) + (make-directory spacemacs-cache-directory)) + +;; load paths +(mapc 'add-to-load-path + `( + ,spacemacs-core-directory + ,(concat spacemacs-core-directory "libs/") + ,(concat spacemacs-core-directory "aprilfool/") + )) diff --git a/emacs.d/core/core-micro-state.el b/emacs.d/core/core-micro-state.el new file mode 100644 index 0000000..98c34b8 --- /dev/null +++ b/emacs.d/core/core-micro-state.el @@ -0,0 +1,272 @@ +;;; -*- lexical-binding: t -*- +;;; core-micro-state.el --- Spacemacs Core 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 + +(defun spacemacs/defface-micro-state-faces () + "Define faces for micro-states." + (let* ((hname 'spacemacs-micro-state-header-face) + (bname 'spacemacs-micro-state-binding-face) + (box '(:line-width -1 :color (plist-get (face-attribute + 'mode-line :box) :color))) + (err (face-attribute 'error :foreground))) + (eval `(defface ,hname '((t ())) + "Face for micro-state header in echo area. +The header is the name of the micro-state." + :group 'spacemacs)) + (set-face-attribute hname nil + :background "DarkGoldenrod2" + :foreground "black" + :bold t + :box box) + (eval `(defface ,bname '((t ())) + "Face for micro-state key binding in echo area. +Characters enclosed in `[]' will have this face applied to them." + :group 'spacemacs)) + (set-face-attribute bname nil + :foreground err + :bold t))) +(spacemacs/defface-micro-state-faces) +(add-hook 'spacemacs-post-theme-change-hook + 'spacemacs/defface-micro-state-faces) + +(defun spacemacs//micro-state-set-minibuffer-height (str) + "Set the max mini windows size given a string STR." + (let ((line-count (1+ (spacemacs/how-many-str "\n" str)))) + (when (and (> line-count max-mini-window-height) + (> line-count 10)) + (setq max-mini-window-height line-count)))) + +(defmacro spacemacs|define-micro-state (name &rest props) + "Define a micro-state called NAME. + +NAME is a symbol. + +Available PROPS: + +`:on-enter SEXP' + Evaluate SEXP when the micro-state is switched on. + +`:on-exit SEXP' + Evaluate SEXP when leaving the micro-state. + +`:doc STRING or SEXP' + A STRING or a SEXP that evaluates to a string. + +`:use-minibuffer BOOLEAN' + If non nil then the minibuffer is used to display the documenation + strings. Default is nil. + +`:disable-evil-leader BOOLEAN' + If non nil then the evil leader has no effect when the micro state + is active. Default to nil. + +`:persistent BOOLEAN' + If BOOLEAN is non nil then the micro-state never exits. A binding + with an explicitly set `exit t' property is required. Default is nil. + +`:execute-binding-on-enter BOOLEAN' + If BOOLEAN is non nil then execute the micro-state command bound to + to the pressed key that started the micro-state. + +`:bindings EXPRESSIONS' + One or several EXPRESSIONS with the form + (STRING1 SYMBOL1 :doc STRING + :pre SEXP + :post SEXP + :exit SYMBOL) + where: + - STRING1 is a key to be bound to the function or key map SYMBOL1. + - :doc STRING or SEXP is a STRING or an SEXP that evalutes + to a string + - :pre is an SEXP evaluated before the bound action + - :post is an SEXP evaluated after the bound action + - :exit SYMBOL or SEXP, if non nil then pressing this key will + leave the micro-state (default is nil). + Important note: due to inner working of transient-maps in Emacs + the `:exit' keyword is evaluate *before* the actual execution + of the bound command. + +All properties supported by `spacemacs//create-key-binding-form' can be +used." + (declare (indent 1)) + (let* ((func (spacemacs//micro-state-func-name name)) + (doc (spacemacs/mplist-get props :doc)) + (persistent (plist-get props :persistent)) + (disable-leader (plist-get props :disable-evil-leader)) + (msg-func (if (plist-get props :use-minibuffer) + 'message + 'lv-message)) + (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)) + (wrappers (spacemacs//micro-state-create-wrappers + name doc msg-func disable-leader bindings)) + (keymap-body (spacemacs//micro-state-fill-map-sexps wrappers)) + (bindkeys (spacemacs//create-key-binding-form props func))) + `(progn (defun ,func () + ,(format "%S micro-state." name) + (interactive) + ,@on-enter + ,(when exec-binding + (spacemacs//micro-state-auto-execute bindings)) + (let ((doc ,@doc)) + (when doc + (spacemacs//micro-state-set-minibuffer-height doc) + (apply ',msg-func (list (spacemacs//micro-state-propertize-doc + (format "%S: %s" ',name doc)))))) + (,(if (version< emacs-version "24.4") + 'set-temporary-overlay-map + 'set-transient-map) + (let ((map (make-sparse-keymap))) + ,@keymap-body map) ',(spacemacs//micro-state-create-exit-func + name wrappers persistent on-exit))) + ,@bindkeys))) + +(defun spacemacs//micro-state-func-name (name) + "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 msg-func disable-leader bindings) + "Return an alist (key wrapper) for each binding in BINDINGS." + (mapcar (lambda (x) (spacemacs//micro-state-create-wrapper + name doc msg-func x)) + (append bindings + ;; force SPC to quit the micro-state to avoid a edge case + ;; with evil-leader + (list `(,dotspacemacs-leader-key + ,(unless disable-leader 'spacemacs-default-map) + :exit t))))) + +(defun spacemacs//micro-state-create-wrapper (name default-doc msg-func binding) + "Create a wrapper of FUNC and return a tuple (key wrapper BINDING)." + (let* ((key (car binding)) + (wrapped (cadr binding)) + (binding-doc (spacemacs/mplist-get binding :doc)) + (binding-pre (spacemacs/mplist-get binding :pre)) + (binding-post (spacemacs/mplist-get binding :post)) + (wrapper-name (intern (format "spacemacs//%S-%S-%s" name wrapped key))) + (doc-body + `((let ((bdoc ,@binding-doc) + (defdoc ,@default-doc)) + (cond + (bdoc + (apply ',msg-func + (list (spacemacs//micro-state-propertize-doc + (format "%S: %s" ',name bdoc)))) + bdoc) + ((and defdoc + ',wrapped + (not (plist-get ',binding :exit))) + (spacemacs//micro-state-set-minibuffer-height defdoc) + (apply ',msg-func + (list (spacemacs//micro-state-propertize-doc + (format "%S: %s" ',name defdoc)))) + defdoc))))) + (wrapper-func + (if (and (boundp wrapped) + (eval `(keymapp ,wrapped))) + wrapped + `(defun ,wrapper-name () + "Auto-generated function" + (interactive) + ,@binding-pre + (let ((throwp t)) + (catch 'exit + (when (fboundp ',wrapped) + (setq this-command ',wrapped) + (call-interactively ',wrapped) + (setq last-command ',wrapped)) + (setq throwp nil)) + ,@binding-post + (when throwp (throw 'exit nil))) + (when ,@doc-body + (spacemacs//micro-state-set-minibuffer-height ,@doc-body) + ,@doc-body))))) + (append (list (car binding) (eval wrapper-func)) binding))) + +(defun spacemacs//micro-state-fill-map-sexps (wrappers) + "Return a list of `define-key' sexp to fill the micro-state temporary map." + (mapcar (lambda (x) `(define-key map ,(kbd (car x)) ',(cadr x))) + wrappers)) + +(defun spacemacs//micro-state-create-exit-func + (name wrappers persistent on-exit) + "Return a function to execute when leaving the micro-state. + +The returned function returns nil if the executed command exits the +micro-state." + (let ((func (intern (format "spacemacs//%s-on-exit" name)))) + (eval `(defun ,func () + "Function executed after each micro-state command." + (let* ((cur-wrapper (spacemacs//get-current-wrapper + ',name ',wrappers)) + (exitp (if cur-wrapper (plist-get cur-wrapper :exit) + ,(not persistent)))) + (when (listp exitp) (setq exitp (eval exitp))) + (when exitp ,@on-exit (spacemacs//micro-state-close-window)) + (not exitp)))))) + +(defun spacemacs//get-current-wrapper (name wrappers) + "Return the wrapper being executed. +Return nil if no wrapper is being executed (i.e. an unbound key has been +pressed)." + (let ((micro-state-fun (spacemacs//micro-state-func-name name))) + (catch 'found + (dolist (wrapper wrappers) + (let ((key (car wrapper)) + (func (cadr wrapper))) + (if (and (or (eq this-command micro-state-fun) + (eq this-command func)) + (equal (this-command-keys) (kbd key))) + (throw 'found wrapper)))) + nil))) + +(defun spacemacs//micro-state-propertize-doc (doc) + "Return a propertized doc string from DOC." + (when (string-match "^\\(.+?\\):\\([[:ascii:]]*\\)$" doc) + (let* ((header (match-string 1 doc)) + (pheader (when header + (propertize (concat " " header " ") + 'face 'spacemacs-micro-state-header-face))) + (tail (spacemacs//micro-state-propertize-doc-rec + (match-string 2 doc)))) + (concat pheader tail)))) + +(defun spacemacs//micro-state-propertize-doc-rec (doc) + "Recursively propertize keys" + (if (string-match "^\\([[:ascii:]]*?\\)\\(\\[.+?\\]\\)\\([[:ascii:]]*\\)$" doc) + (let* ((head (match-string 1 doc)) + (key (match-string 2 doc)) + (pkey (when key + (propertize key 'face 'spacemacs-micro-state-binding-face))) + (tail (spacemacs//micro-state-propertize-doc-rec + (match-string 3 doc)))) + (concat head pkey tail)) + doc)) + +(defun spacemacs//micro-state-close-window () + "Close micro-state help window." + (when (window-live-p lv-wnd) + (let ((buf (window-buffer lv-wnd))) + (delete-window lv-wnd) + (kill-buffer buf)))) + +(provide 'core-micro-state) diff --git a/emacs.d/core/core-release-management.el b/emacs.d/core/core-release-management.el new file mode 100644 index 0000000..7967f9f --- /dev/null +++ b/emacs.d/core/core-release-management.el @@ -0,0 +1,343 @@ +;;; core-spacemacs.el --- Spacemacs Core 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 +(defconst spacemacs-repository "spacemacs" + "Name of the Spacemacs remote repository.") +(defconst spacemacs-repository-owner "syl20bnr" + "Name of the Spacemacs remote repository owner.") +(defconst spacemacs-checkversion-remote "checkversion" + "Name of the remote repository used to check for new version.") +(defconst spacemacs-checkversion-branch "master" + "Name of the branch used to check for new version.") + +(defvar dotspacemacs-check-for-update) +(defvar spacemacs-version) +;; new version variables +(defvar spacemacs-new-version nil + "If non-nil a new Spacemacs version is available.") +;; used to be "6 hours" but we now check for new versions only at startup +(defvar spacemacs-version-check-interval nil + "Time between two version checks.") +(defvar spacemacs-version-check-lighter "[+]" + "Text displayed in the mode-line when a new version is available.") +(defvar spacemacs-version--check-timer nil + "The current timer for new version check.") +(defvar spacemacs-version--last-startup-check-file + (expand-file-name (concat spacemacs-cache-directory "last-version-check")) + "File where the last startup version check time is stored.") +(defvar spacemacs-version--last-startup-check-time nil + "Time of last version check.") +(defvar spacemacs-version--startup-check-interval (* 3600 24) + "Minimum number of seconds between two version checks at startup.") + +(defun spacemacs/switch-to-version (&optional version) + "Switch spacemacs to VERSION. + +VERSION is a string with the format `x.x.x'. +IMPORTANT: The switch is performed by hard resetting the current branch. +If VERSION is nil then a prompt will ask for a version number. +If the current version is not `master' and not `develop' then +a prompt will ask for confirmation before actually switching to the +specified version. +It is not possible to switch version when you are on `develop' branch, +users on `develop' branch must manually pull last commits instead." + (interactive) + (let ((branch (spacemacs//git-get-current-branch)) + (dirty (spacemacs//git-working-directory-dirty))) + (unless version + (message "Getting version information...") + (let ((last-version (spacemacs/get-last-version))) + (setq version (read-string + (format "Version (default %s [latest]): " last-version) + nil nil last-version)))) + (cond ((string-equal "develop" branch) + (message (concat "Cannot switch version because you are on " + "develop.\n" + "You have to manually `pull --rebase' the latest " + "commits."))) + (dirty + (message (concat "Your Emacs directory is not clean.\n" + "git status:\n%s") dirty)) + ((string-equal version spacemacs-version) + (message "You are already on the latest version.")) + ((or (string-equal "master" branch) + (yes-or-no-p + (format (concat "You are not on master. " + "This command will switch branches.\n" + "Are you sure that you want to switch " + "to version %s ? ") + version))) + (let ((tag (concat "v" version))) + (if (spacemacs//git-hard-reset-to-tag tag) + (progn + (setq spacemacs-version version) + (message "Successfully switched to version %s" version)) + (message "An error occurred while switching to version %s" + version)))) + (t (message "Update aborted."))))) + +(defun spacemacs/check-for-new-version (force &optional interval) + "Periodicly check for new for new Spacemacs version. +Update `spacemacs-new-version' variable if any new version has been +found." + (interactive "P") + (cond + ((and (not force) + (not dotspacemacs-check-for-update)) + (message "Skipping check for new version (reason: dotfile)")) + ((and (not force) + (string-equal "develop" (spacemacs//git-get-current-branch))) + (message "Skipping check for new version (reason: develop branch)")) + ((and (not force) + (not (spacemacs//can-check-for-new-version-at-startup))) + (message (concat "Skipping check for new version " + "(reason: last check is too recent)"))) + ((require 'async nil t) + (message "Start checking for new version...") + (async-start + `(lambda () + ,(async-inject-variables "\\`spacemacs-start-directory\\'") + (load-file (concat spacemacs-start-directory + "core/core-load-paths.el")) + (require 'core-spacemacs) + (spacemacs/get-last-version)) + (lambda (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) + 'spacemacs/check-for-new-version)))) + (t (message "Skipping check for new version (reason: async not loaded)")))) + +(defun spacemacs/git-get-current-branch-rev () + "Returns the hash of the head commit on the current branch. +Returns nil if an error occurred." + (let ((proc-buffer "git-get-current-branch-head-hash") + (default-directory (file-truename spacemacs-start-directory))) + (when (eq 0 (process-file "git" nil proc-buffer nil + "rev-parse" "--short" "HEAD")) + (with-current-buffer proc-buffer + (prog1 + (when (buffer-string) + (goto-char (point-min)) + (replace-regexp-in-string + "\n$" "" + (buffer-substring (line-beginning-position) + (line-end-position)))) + (kill-buffer proc-buffer)))))) + +(defun spacemacs/get-new-version-lighter-face (current new) + "Return the new version lighter face given the difference between the CURRENT +version and the NEW version." + (let* ((lcur (version-to-list current)) + (lnew (version-to-list new)) + (scur (spacemacs//compute-version-score lcur)) + (snew (spacemacs//compute-version-score lnew)) + (diff (- snew scur))) + (cond + ((< diff 3000) 'spacemacs-mode-line-new-version-lighter-success-face) + ((< diff 5000) 'spacemacs-mode-line-new-version-lighter-warning-face) + (t 'spacemacs-mode-line-new-version-lighter-error-face)))) + +(defun spacemacs/get-last-version () + "Return the last tagged version." + (interactive) + (spacemacs//get-last-version spacemacs-repository + spacemacs-repository-owner + spacemacs-checkversion-remote + spacemacs-checkversion-branch)) + +(defun spacemacs//can-check-for-new-version-at-startup () + "Return non-nil if the version check at startup can be performed." + (when (file-exists-p spacemacs-version--last-startup-check-file) + (load spacemacs-version--last-startup-check-file)) + (let ((result + (or (null spacemacs-version--last-startup-check-time) + (> (- (float-time) spacemacs-version--last-startup-check-time) + spacemacs-version--startup-check-interval)))) + (when result + (setq spacemacs-version--last-startup-check-time (float-time)) + (spacemacs/dump-vars-to-file '(spacemacs-version--last-startup-check-time) + spacemacs-version--last-startup-check-file)) + result)) + +(defun spacemacs//get-last-version (repo owner remote branch) + "Return the last tagged version of BRANCH on REMOTE repository from +OWNER REPO." + (let ((url (format "https://github.com/%s/%s" owner repo))) + (spacemacs//git-remove-remote remote) + (spacemacs//git-add-remote remote url) + ;; removing this call according to issue #6692 proposal + ;; (spacemacs//git-fetch-remote remote) + (spacemacs//git-fetch-tags remote branch)) + (let ((version (spacemacs//git-latest-tag remote branch))) + (when version + (save-match-data + (string-match "^.*\\([0-9]+\\.[0-9]+\\.[0-9]+\\)$" version) + (match-string 1 version))))) + +(defun spacemacs//git-has-remote (remote) + "Return non nil if REMOTE is declared." + (let ((proc-buffer "git-has-remote") + (default-directory (file-truename spacemacs-start-directory))) + (when (eq 0 (process-file "git" nil proc-buffer nil "remote")) + (with-current-buffer proc-buffer + (prog2 + (goto-char (point-min)) + (re-search-forward (format "^%s$" remote) nil 'noerror) + (kill-buffer proc-buffer)))))) + +(defun spacemacs//git-add-remote (remote url) + "Add a REMOTE with URL, return t if no error." + (let ((proc-buffer "git-add-remote") + (default-directory (file-truename spacemacs-start-directory))) + (prog1 + (eq 0 (process-file "git" nil proc-buffer nil + "remote" "add" remote url)) + (kill-buffer proc-buffer)))) + +(defun spacemacs//git-remove-remote (remote) + "Remove a REMOTE, return t if no error." + (let ((proc-buffer "git-remove-remote") + (default-directory (file-truename spacemacs-start-directory))) + (prog1 + (eq 0 (process-file "git" nil proc-buffer nil + "remote" "remove" remote)) + (kill-buffer proc-buffer)))) + +(defun spacemacs//git-fetch-remote (remote) + "Fetch last commits from REMOTE, return t if no error." + (let ((proc-buffer "git-fetch-remote") + (default-directory (file-truename spacemacs-start-directory))) + (prog1 + (eq 0 (process-file "git" nil proc-buffer nil + "fetch" remote)) + (kill-buffer proc-buffer)))) + +(defun spacemacs//git-fetch-tags (remote branch) + "Fetch the tags for BRANCH in REMOTE repository." + (let ((proc-buffer "git-fetch-tags") + (default-directory (file-truename spacemacs-start-directory))) + (prog1 + ;;;; original comment: seems necessary to fetch first + ;; but we remove this according to issue #6692 proposal + ;; (eq 0 (process-file "git" nil proc-buffer nil + ;; "fetch" remote branch)) + ;; explicitly fetch the new tags + (eq 0 (process-file "git" nil proc-buffer nil + "fetch" "--tags" remote branch)) + (kill-buffer proc-buffer)))) + +(defun spacemacs//git-hard-reset-to-tag (tag) + "Hard reset the current branch to specifed TAG." + (let ((proc-buffer "git-hard-reset") + (default-directory (file-truename spacemacs-start-directory))) + (prog1 + (eq 0 (process-file "git" nil proc-buffer nil + "reset" "--hard" tag)) + (kill-buffer proc-buffer)))) + +(defun spacemacs//git-latest-tag (remote branch) + "Returns the latest tag on REMOTE/BRANCH." + (let ((proc-buffer "git-latest-tag") + (default-directory (file-truename spacemacs-start-directory)) + (where (format "%s/%s" remote branch))) + (when (eq 0 (process-file "git" nil proc-buffer nil + "describe" "--tags" "--abbrev=0" + "--match=v*" where "FETCH_HEAD")) + (with-current-buffer proc-buffer + (prog1 + (when (buffer-string) + (goto-char (point-max)) + (forward-line -1) + (replace-regexp-in-string + "\n$" "" + (buffer-substring (line-beginning-position) + (line-end-position)))) + (kill-buffer proc-buffer)))))) + +(defun spacemacs//git-checkout (branch) + "Checkout the given BRANCH. Return t if there is no error." + (let ((proc-buffer "git-checkout") + (default-directory (file-truename spacemacs-start-directory))) + (prog1 + (eq 0 (process-file "git" nil proc-buffer nil + "checkout" branch)) + (kill-buffer proc-buffer)))) + +(defun spacemacs//git-get-current-branch () + "Return the current branch. Return nil if an error occurred." + (let ((proc-buffer "git-get-current-branch") + (default-directory (file-truename spacemacs-start-directory))) + (when (eq 0 (process-file "git" nil proc-buffer nil + "symbolic-ref" "--short" "-q" "HEAD")) + (with-current-buffer proc-buffer + (prog1 + (when (buffer-string) + (goto-char (point-min)) + (replace-regexp-in-string + "\n$" "" + (buffer-substring (line-beginning-position) + (line-end-position)))) + (kill-buffer proc-buffer)))))) + +(defun spacemacs//git-working-directory-dirty () + "Non-nil if the user's emacs directory is not clean. +Returns the output of git status --porcelain." + (let ((proc-buffer "git-working-directory-dirty") + (default-directory (file-truename spacemacs-start-directory))) + (when (eq 0 (process-file "git" nil proc-buffer nil + "status" "--porcelain")) + (with-current-buffer proc-buffer + (prog1 + (when (and (buffer-string) + ;;simplecheckforanytext + (string-match-p "[^ \t\n]" (buffer-string))) + (replace-regexp-in-string "\n\\'" "" (buffer-string))) + (kill-buffer proc-buffer)))))) + +(defun spacemacs//deffaces-new-version-lighter (state) + "Define a new version lighter face for the given STATE." + (let* ((fname (intern + (format "spacemacs-mode-line-new-version-lighter-%s-face" + (symbol-name state)))) + (foreground (face-foreground state))) + (eval `(defface ,fname '((t ())) + ,(format "Color for new version lighter in mode line (%s)." + (symbol-name state)) + :group 'spacemacs)) + (set-face-attribute fname nil + :foreground foreground + :box (face-attribute 'mode-line :box)))) + +(defun spacemacs//compute-version-score (version) + "Returns an integer from the version list. +Example: (1 42 3) = 1 042 003" + (let ((i -1)) + (cl-reduce '+ (mapcar (lambda (n) (setq i (1+ i)) (* n (expt 10 (* i 3)))) + (reverse version))))) + +(defun spacemacs/set-new-version-lighter-mode-line-faces () + "Define or set the new version lighter mode-line faces." + (mapcar 'spacemacs//deffaces-new-version-lighter + '(error warning success))) +(spacemacs/set-new-version-lighter-mode-line-faces) +(add-hook 'spacemacs-post-theme-change-hook + 'spacemacs/set-new-version-lighter-mode-line-faces) + +(provide 'core-release-management) diff --git a/emacs.d/core/core-spacemacs-buffer.el b/emacs.d/core/core-spacemacs-buffer.el new file mode 100644 index 0000000..5d11296 --- /dev/null +++ b/emacs.d/core/core-spacemacs-buffer.el @@ -0,0 +1,1024 @@ +;;; core-spacemacs-buffer.el --- Spacemacs Core 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 +(defconst spacemacs-buffer-version-info "0.200" + "Current version used to display addition release information.") + +(defconst spacemacs-buffer-name "*spacemacs*" + "The name of the spacemacs buffer.") + +(defconst spacemacs-buffer-logo-title "[S P A C E M A C S]" + "The title displayed beneath the logo.") + +(defconst spacemacs-buffer-buttons-startup-lists-offset 25 + "Relative position in characters of the home buffer buttons and the home + buffer startup lists.") + +(defconst spacemacs-buffer--banner-length 75 + "Width of a banner.") + +(defconst spacemacs-buffer--cache-file + (expand-file-name (concat spacemacs-cache-directory "spacemacs-buffer.el")) + "Cache file for various persistent data for the spacemacs startup buffer") + +(defvar spacemacs-buffer-startup-lists-length 20 + "Length used for startup lists with otherwise unspecified bounds. +Set to nil for unbounded.") + +(defvar spacemacs-buffer--release-note-version nil + "If nil the release note is displayed. If non nil it contains +a version number, if the version number is lesser than the current +version the release note it displayed") + +(defvar spacemacs-buffer--note-widgets nil + "List of widgets used to display the release note.") + +(defvar spacemacs-buffer--previous-insert-type nil + "Previous type of note inserted.") + +(defvar spacemacs-buffer--fresh-install + (not (file-exists-p dotspacemacs-filepath)) + "Non-nil if this Emacs instance if a fresh install.") + +(defvar spacemacs-buffer--buttons-position nil + "Offset in characters between the edge of the screen and the beginning of the + home buffer buttons. Do not set this variable.") + +(defvar spacemacs-buffer-mode-map + (let ((map (make-sparse-keymap))) + (define-key map [down-mouse-1] 'widget-button-click) + (define-key map (kbd "RET") 'widget-button-press) + + (define-key map [tab] 'widget-forward) + (define-key map (kbd "J") 'widget-forward) + (define-key map (kbd "C-i") 'widget-forward) + + (define-key map [backtab] 'widget-backward) + (define-key map (kbd "K") 'widget-backward) + + (define-key map (kbd "C-r") 'spacemacs-buffer/refresh) + (define-key map "q" 'quit-window) + map) + "Keymap for spacemacs buffer mode.") + +(with-eval-after-load 'evil + (evil-make-overriding-map spacemacs-buffer-mode-map 'motion)) + +(define-derived-mode spacemacs-buffer-mode fundamental-mode "Spacemacs buffer" + "Spacemacs major mode for startup screen. + +\\ +" + :group 'spacemacs + :syntax-table nil + :abbrev-table nil + (page-break-lines-mode) + (setq buffer-read-only t + truncate-lines t) + ;; needed to make tab work correctly in terminal + (evil-define-key 'motion spacemacs-buffer-mode-map + (kbd "C-i") 'widget-forward) + ;; motion state since this is a special mode + (evil-set-initial-state 'spacemacs-buffer-mode 'motion)) + +(defun spacemacs-buffer/insert-ascii-banner-centered (file) + (insert-string + (with-temp-buffer + (insert-file-contents file) + (let ((banner-width 0)) + (while (not (eobp)) + (let ((line-length (- (line-end-position) (line-beginning-position)))) + (if (< banner-width line-length) + (setq banner-width line-length))) + (forward-line 1)) + (goto-char 0) + (let ((margin (max 0 (floor (/ (- spacemacs-buffer--banner-length banner-width) 2))))) + (while (not (eobp)) + (insert (make-string margin ?\ )) + (forward-line 1)))) + (buffer-string)))) + +(defun spacemacs-buffer/insert-banner-and-buttons () + "Choose a banner according to `dotspacemacs-startup-banner'and insert it +in spacemacs buffer along with quick buttons underneath. + +Easter egg: +Doge special text banner can be reachable via `999', `doge' or `random*'. +Cate special text banner can de reachable via `998', `cat' or `random*'. +`random' ignore special banners whereas `random*' does not." + (let ((banner (spacemacs-buffer//choose-banner)) + (buffer-read-only nil)) + (progn + (when banner + (spacemacs-buffer/message (format "Banner: %s" banner)) + (if (image-type-available-p (intern (file-name-extension banner))) + (spacemacs-buffer//insert-image-banner banner) + (spacemacs-buffer/insert-ascii-banner-centered banner)) + (spacemacs-buffer//inject-version)) + (spacemacs-buffer//insert-buttons) + (spacemacs//redisplay)))) + +(defun spacemacs-buffer/display-info-box () + "Display an info box." + (when (file-exists-p spacemacs-buffer--cache-file) + (load spacemacs-buffer--cache-file)) + (cond + (spacemacs-buffer--fresh-install + ;; we assume the user is new to spacemacs and open the quickhelp + (spacemacs-buffer/toggle-note + (concat spacemacs-info-directory "quickhelp.txt") + (spacemacs-buffer//insert-note-p 'quickhelp)) + (setq spacemacs-buffer--release-note-version spacemacs-version) + (spacemacs/dump-vars-to-file '(spacemacs-buffer--release-note-version) + spacemacs-buffer--cache-file)) + ((or (not spacemacs-buffer--release-note-version) + (version< spacemacs-buffer--release-note-version + spacemacs-version)) + ;; check the variable ;; spacemacs-buffer--release-note-version + ;; to decide whether ;; we show the release note + (spacemacs-buffer/toggle-note + (concat spacemacs-release-notes-directory + spacemacs-buffer-version-info ".txt") 'release-note))) + (spacemacs//redisplay)) + +(defun spacemacs-buffer//choose-banner () + "Return the full path of a banner based on the dotfile value." + (when dotspacemacs-startup-banner + (cond ((eq 'official dotspacemacs-startup-banner) + (if (and (display-graphic-p) (image-type-available-p 'png)) + spacemacs-banner-official-png + (spacemacs-buffer//get-banner-path 1))) + ((eq 'random dotspacemacs-startup-banner) + (spacemacs-buffer//choose-random-text-banner)) + ((eq 'random* dotspacemacs-startup-banner) + (spacemacs-buffer//choose-random-text-banner t)) + ((eq 'doge dotspacemacs-startup-banner) + (spacemacs-buffer//get-banner-path 999)) + ((eq 'cat dotspacemacs-startup-banner) + (spacemacs-buffer//get-banner-path 998)) + ((integerp dotspacemacs-startup-banner) + (spacemacs-buffer//get-banner-path dotspacemacs-startup-banner)) + ((and dotspacemacs-startup-banner + (image-type-available-p (intern (file-name-extension + dotspacemacs-startup-banner))) + (display-graphic-p)) + (if (file-exists-p dotspacemacs-startup-banner) + dotspacemacs-startup-banner + (spacemacs-buffer/warning (format "could not find banner %s" + dotspacemacs-startup-banner)) + (spacemacs-buffer//get-banner-path 1))) + (t (spacemacs-buffer//get-banner-path 1))))) + +(defvar spacemacs-buffer--random-banner nil + "The random banner chosen.") + +(defun spacemacs-buffer//choose-random-text-banner (&optional all) + "Return the full path of a banner chosen randomly. + +If ALL is non-nil then truly all banners can be selected." + (setq spacemacs-buffer--random-banner + (or spacemacs-buffer--random-banner + (let* ((files (directory-files spacemacs-banner-directory t ".*\.txt")) + (count (length files)) + ;; -2 to remove the two last ones (easter eggs) + (choice (random (- count (if all 0 2))))) + (nth choice files))))) + +(defun spacemacs-buffer//get-banner-path (index) + "Return the full path to banner with index INDEX." + (concat spacemacs-banner-directory (format "%03d-banner.txt" index))) + +(defun spacemacs-buffer//insert-image-banner (banner) + "Display an image banner." + (when (file-exists-p banner) + (let* ((title spacemacs-buffer-logo-title) + (spec (create-image banner)) + (size (image-size spec)) + (width (car size)) + (left-margin (max 0 (floor (- spacemacs-buffer--banner-length width) 2)))) + (goto-char (point-min)) + (insert "\n") + (insert (make-string left-margin ?\ )) + (insert-image spec) + (insert "\n\n") + (insert (make-string (max 0 (floor (/ (- spacemacs-buffer--banner-length + (+ (length title) 1)) 2))) ?\ )) + (insert (format "%s\n\n" title))))) + +(defun spacemacs-buffer//inject-version () + "Inject the current version of spacemacs in the first line of the +buffer, right justified." + (with-current-buffer (get-buffer-create spacemacs-buffer-name) + (save-excursion + (let ((maxcol spacemacs-buffer--banner-length) + (version (format "%s@%s (%s)" + spacemacs-version + emacs-version + dotspacemacs-distribution)) + (buffer-read-only nil)) + (goto-char (point-min)) + (delete-region (point) (progn (end-of-line) (point))) + (insert (format (format "%%%ds" maxcol) version)))))) + +(defun spacemacs-buffer//insert-footer () + (save-excursion + (let* ((maxcol spacemacs-buffer--banner-length) + (badge-path spacemacs-badge-official-png) + (badge (when (and (display-graphic-p) + (image-type-available-p + (intern (file-name-extension badge-path)))) + (create-image badge-path))) + (badge-size (when badge (car (image-size badge)))) + (heart-path spacemacs-purple-heart-png) + (heart (when (and (display-graphic-p) + (image-type-available-p + (intern (file-name-extension badge-path)))) + (create-image heart-path))) + (heart-size (when heart (car (image-size heart)))) + (build-lhs "Made with ") + (build-rhs " by the community") + (buffer-read-only nil)) + (when (or badge heart) + (goto-char (point-max)) + (spacemacs-buffer/insert-page-break) + (insert "\n") + (when badge + (insert (make-string (floor (/ (- maxcol badge-size) 2)) ?\ )) + (insert-image badge)) + (when heart + (when badge (insert "\n\n")) + (insert (make-string (floor (/ (- maxcol + (length build-lhs) + heart-size + (length build-rhs)) 2)) ?\ )) + (insert build-lhs) + (insert-image heart) + (insert build-rhs) + (insert "\n")))))) + +(defun spacemacs-buffer//insert-note (file caption &optional additional-widgets) + "Insert the release note just under the banner. + +FILE is the file that contains the content to show. +CAPTION is the title of the note. +TAG-STRING is the label of the button for additional action. +HELP-STRING is the help message of the button for additional action." + (save-excursion + (goto-char (point-min)) + (search-forward "Search in Spacemacs\]") + (forward-line) + (let* ((note (concat "\n" (spacemacs//render-framed-text + file spacemacs-buffer--banner-length caption)))) + (add-to-list 'spacemacs-buffer--note-widgets (widget-create 'text note)) + (save-excursion + (while (re-search-backward "\\[\\[\\(.*\\)\\]\\]" nil t) + (let ((buffer-read-only nil)) + (make-text-button + (match-beginning 1) + (match-end 1) + 'type 'help-url + 'help-args (list (match-string 1)))))) + (funcall additional-widgets)))) + +(defun spacemacs-buffer//insert-note-p (type) + "Decicde if whether to insert note widget or not based on current note TYPE. + +If note TYPE is `quickhelp' or `release-note' and is equal to +previous insert type in `spacemacs-buffer--previous-insert-type', +which means previous note widget of the same type already +inserted. In this case, we simply delete the widgets but don't insert. + +Otherwise, delete and allow insert note of TYPE." + (if (not (eq spacemacs-buffer--previous-insert-type type)) + type + (setq spacemacs-buffer--previous-insert-type nil))) + +(defun spacemacs-buffer/toggle-note (file type) + "Toggle the note in FILE for the buffer based on TYPE. + +If TYPE is nil, just remove widgets." + (interactive) + (spacemacs-buffer//remove-existing-widget-if-exist) + (cond + ((eq type 'quickhelp) + (spacemacs-buffer//insert-quickhelp-widget file)) + ((eq type 'release-note) + (spacemacs-buffer//insert-release-note-widget file)) + (t))) + +(defun spacemacs-buffer//remove-existing-widget-if-exist () + "Remove existing note widgets if exists." + (when spacemacs-buffer--note-widgets + (spacemacs-buffer//remove-note-widgets))) + +(defun spacemacs-buffer//insert-quickhelp-widget (file) + "Insert quickhelp with content from FILE." + (spacemacs-buffer//remove-existing-widget-if-exist) + (let ((widget-func + (lambda () + (add-to-list + 'spacemacs-buffer--note-widgets + (widget-create 'push-button + :tag (propertize "Evil Tutorial" + 'face 'font-lock-keyword-face) + :help-echo + "Teach you how to use Vim basics." + :action (lambda (&rest ignore) + (call-interactively #'evil-tutor-start)) + :mouse-face 'highlight + :follow-link "\C-m")) + (widget-insert " ") + (add-to-list + 'spacemacs-buffer--note-widgets + (widget-create 'push-button + :tag (propertize "Emacs Tutorial" + 'face 'font-lock-keyword-face) + :help-echo "Teach you how to use Emacs basics." + :action (lambda (&rest ignore) + (call-interactively #'help-with-tutorial)) + :mouse-face 'highlight + :follow-link "\C-m")) + (widget-insert " ") + (add-to-list + 'spacemacs-buffer--note-widgets + (widget-create 'push-button + :tag (propertize "Vim Migration Guide" + 'face 'font-lock-keyword-face) + :help-echo "Documentation for former vim users." + :action (lambda (&rest ignore) + (spacemacs/view-org-file + (concat spacemacs-docs-directory + "VIMUSERS.org") "^" 'all)) + :mouse-face 'highlight + :follow-link "\C-m"))))) + (spacemacs-buffer//insert-note file "Quick Help" widget-func)) + (setq spacemacs-buffer--previous-insert-type 'quickhelp)) + +(defun spacemacs-buffer//insert-release-note-widget (file) + "Insert release note with content from FILE." + (spacemacs-buffer//remove-existing-widget-if-exist) + (let ((widget-func + (lambda () + (add-to-list + 'spacemacs-buffer--note-widgets + (widget-create 'push-button + :tag (propertize "Click here for full change log" + 'face 'font-lock-warning-face) + :help-echo "Open the full change log." + :action + (lambda (&rest ignore) + (funcall 'spacemacs/view-org-file + (concat spacemacs-start-directory + "CHANGELOG.org") + (format "Release %s.x" + spacemacs-buffer-version-info) + 'subtree)) + :mouse-face 'highlight + :follow-link "\C-m"))))) + (spacemacs-buffer//insert-note file + (format " Important Notes (Release %s.x) " + spacemacs-buffer-version-info) + widget-func)) + + (setq spacemacs-buffer--release-note-version nil) + (spacemacs/dump-vars-to-file + '(spacemacs-buffer--release-note-version) spacemacs-buffer--cache-file) + (setq spacemacs-buffer--previous-insert-type 'release-note)) + +(defun spacemacs-buffer//remove-note-widgets () + (mapc 'widget-delete spacemacs-buffer--note-widgets) + (setq spacemacs-buffer--note-widgets nil) + (setq spacemacs-buffer--release-note-version spacemacs-version) + (spacemacs/dump-vars-to-file + '(spacemacs-buffer--release-note-version) spacemacs-buffer--cache-file)) + +(defun spacemacs-buffer/set-mode-line (format) + "Set mode-line format for spacemacs buffer." + (with-current-buffer (get-buffer-create spacemacs-buffer-name) + (setq mode-line-format format))) + +(defun spacemacs-buffer/message (msg &rest args) + "Display MSG in message prepended with '(Spacemacs)'. +The message is displayed only if `init-file-debug' is non nil." + (when init-file-debug + (message "(Spacemacs) %s" (apply 'format msg args)))) + +(defvar spacemacs-buffer--warnings nil + "List of warnings during startup.") + +(defun spacemacs-buffer/warning (msg &rest args) + "Display MSG as a warning message but in buffer `*Messages*'. +The message is always displayed. " + (let ((msg (apply 'format msg args))) + (message "(Spacemacs) Warning: %s" msg) + (add-to-list 'spacemacs-buffer--warnings msg 'append))) + +(defun spacemacs-buffer/insert-page-break () + "Insert a page break line in spacemacs buffer." + (spacemacs-buffer/append "\n \n")) + +(defun spacemacs-buffer/append (msg &optional messagebuf) + "Append MSG to spacemacs buffer. If MESSAGEBUF is not nil then MSG is + also written in message buffer." + (with-current-buffer (get-buffer-create spacemacs-buffer-name) + (goto-char (point-max)) + (let ((buffer-read-only nil)) + (insert msg) + (if messagebuf (message "(Spacemacs) %s" msg))) + (spacemacs-buffer/set-mode-line ""))) + +(defun spacemacs-buffer/replace-last-line (msg &optional messagebuf) + "Replace the last line of the spacemacs buffer with MSG. If MESSAGEBUF is + not nil then MSG is also written in message buffer." + (with-current-buffer (get-buffer-create spacemacs-buffer-name) + (goto-char (point-max)) + (let ((buffer-read-only nil)) + (delete-region (line-beginning-position) (point-max)) + (insert msg) + (if messagebuf (message "(Spacemacs) %s" msg))) + (spacemacs-buffer/set-mode-line ""))) + +(defun spacemacs-buffer/insert-framed-text + (msg &optional caption hpadding) + "Insert MSG in spacemacs buffer within a frame of width FILL-COLUMN. + +See `spacemacs//render-framed-text' for documentation of the other +parameters." + (with-current-buffer (get-buffer-create spacemacs-buffer-name) + (let ((buffer-read-only nil)) + (insert (spacemacs//render-framed-text msg spacemacs-buffer--banner-length + caption hpadding))))) + +(defun spacemacs-buffer/insert-framed-text-from-file + (filepath &optional caption hpadding) + "Insert at point the content of FILENAME file in spacemacs buffer in a +frame. + +If FILEPATH does not exists the function returns nil. + +See `spacemacs//render-framed-text' for documentation of the other +parameters." + (when (file-exists-p filepath) + (with-current-buffer (get-buffer-create spacemacs-buffer-name) + (let ((buffer-read-only nil)) + (insert (spacemacs//render-framed-text + filepath spacemacs-buffer--banner-length caption hpadding)))))) + +(defun spacemacs//render-framed-text (content &optional width caption hpadding) + "Return a formated string framed with plained lines of width FILL-COLUMN. + +CONTENT can be a text or a filepath. + +WIDTH set the `fill-column' variable. + +If CAPTION is non nil string then it is included in at the top of the frame. +If CAPTION length is greater than FILL-COLUMN minus 5 the function returns +nil. + +HPADDING is the horizontal spacing between the text and the frame. +The vertical spacing is always one line." + (with-temp-buffer + (if (not (file-exists-p content)) + (insert content) + (insert-file-contents content) + ;; remove additional newline at eof + (goto-char (point-max)) + (delete-char -1)) + (let* ((hpadding (or hpadding 1)) + (fill-column (if width + (- width (+ 2 (* 2 hpadding))) + fill-column)) + (sentence-end-double-space nil) + (caption-len (length caption))) + (fill-region (point-min) (point-max) 'justify 'nosqueeze) + (concat + ;; top + "╭─" + (if caption + (concat caption + (make-string (max 0 (+ (- fill-column caption-len 1) + hpadding)) ?─)) + (make-string fill-column ?─)) + (make-string hpadding ?─) "╮\n" + ;; content + (spacemacs//render-framed-line "" hpadding) + (mapconcat (lambda (x) + (spacemacs//render-framed-line x hpadding)) + (split-string (buffer-string) "\n" nil) "") + (spacemacs//render-framed-line "" hpadding) + ;; bottom + "╰" (make-string hpadding ?─) + (make-string fill-column ?─) + (make-string hpadding ?─) "╯")))) + +(defun spacemacs//render-framed-line (line hpadding) + "Return a formated LINE with borders of a frame on each side and +with width FILL-COLUMN. + +If length of LINE is bigger than FILL-COLUMN it returns nil. + +HPADDING is the horizontal spacing betwee the content line and the frame +border." + (let* ((len (length line)) + (fill (- fill-column len))) + (when (>= fill 0) + (concat "│" (make-string hpadding ?\s) + line (make-string fill ?\s) + (make-string hpadding ?\s) "│\n")))) + +(defun spacemacs-buffer/loading-animation () + "Display the progress bar by chunk of size +`spacemacs--loading-dots-chunk-threshold'." + (when (and (not noninteractive) dotspacemacs-loading-progress-bar) + (setq spacemacs-loading-counter (1+ spacemacs-loading-counter)) + (setq spacemacs-loading-value (1+ spacemacs-loading-value)) + (when (>= spacemacs-loading-counter spacemacs-loading-dots-chunk-threshold) + (let ((suffix (format "> %s/%s" spacemacs-loading-value + (length configuration-layer--used-packages)))) + (setq spacemacs-loading-counter 0) + (setq spacemacs-loading-string + (make-string + (max 0 + (- (* spacemacs-loading-dots-chunk-size + (floor (/ spacemacs-loading-value + spacemacs-loading-dots-chunk-threshold))) + (length suffix))) + spacemacs-loading-char)) + (spacemacs-buffer/set-mode-line (concat spacemacs-loading-string + suffix))) + (spacemacs//redisplay)))) + +(defmacro spacemacs//insert--shortcut (shortcut-char search-label + &optional no-next-line) + `(define-key spacemacs-buffer-mode-map + ,shortcut-char (lambda () + (interactive) + (unless (search-forward ,search-label (point-max) t) + (search-backward ,search-label (point-min) t)) + ,@(unless no-next-line + '((forward-line 1))) + (back-to-indentation)))) + +(defun spacemacs-buffer//center-line () + (let* ((width (current-column)) + (margin (max 0 (floor (/ (- spacemacs-buffer--banner-length width) 2))))) + (beginning-of-line) + (insert (make-string margin ?\ )) + (end-of-line))) + +(defun spacemacs-buffer//insert-buttons () + (goto-char (point-max)) + (spacemacs//insert--shortcut "m" "[?]" t) + (widget-create 'url-link + :tag (propertize "?" 'face 'font-lock-doc-face) + :help-echo "Open the quickhelp." + :action (lambda (&rest ignore) + (spacemacs-buffer/toggle-note + (concat spacemacs-info-directory "quickhelp.txt") + ;; if nil is returned, + ;; just delete the current note widgets + (spacemacs-buffer//insert-note-p 'quickhelp))) + :mouse-face 'highlight + :follow-link "\C-m") + (insert " ") + (widget-create 'url-link + :tag (propertize "Homepage" 'face 'font-lock-keyword-face) + :help-echo "Open the Spacemacs Github page in your browser." + :mouse-face 'highlight + :follow-link "\C-m" + "http://spacemacs.org") + (insert " ") + (widget-create 'url-link + :tag (propertize "Documentation" 'face 'font-lock-keyword-face) + :help-echo "Open the Spacemacs documentation in your browser." + :mouse-face 'highlight + :follow-link "\C-m" + "http://spacemacs.org/doc/DOCUMENTATION.html") + (insert " ") + (widget-create 'url-link + :tag (propertize "Gitter Chat" 'face 'font-lock-keyword-face) + :help-echo + "Ask questions and chat with fellow users in our chat room." + :mouse-face 'highlight + :follow-link "\C-m" + "https://gitter.im/syl20bnr/spacemacs") + (insert " ") + (widget-create 'push-button + :help-echo "Update Spacemacs core and layers." + :action (lambda (&rest ignore) (spacemacs/switch-to-version)) + :mouse-face 'highlight + :follow-link "\C-m" + (propertize "Update Spacemacs" 'face 'font-lock-keyword-face)) + (let ((len (- (line-end-position) + (line-beginning-position)))) + (spacemacs-buffer//center-line) + (setq spacemacs-buffer--buttons-position (- (line-end-position) + (line-beginning-position) + len))) + (insert "\n") + (widget-create 'push-button + :help-echo "Update all ELPA packages to the latest versions." + :action (lambda (&rest ignore) + (configuration-layer/update-packages)) + :mouse-face 'highlight + :follow-link "\C-m" + (propertize "Update Packages" 'face 'font-lock-keyword-face)) + (insert " ") + (widget-create 'push-button + :help-echo + "Rollback ELPA package updates if something got borked." + :action (lambda (&rest ignore) + (call-interactively 'configuration-layer/rollback)) + :mouse-face 'highlight + :follow-link "\C-m" + (propertize "Rollback Package Update" + 'face 'font-lock-keyword-face)) + (spacemacs-buffer//center-line) + (insert "\n") + (widget-create 'push-button + :tag (propertize "Release Notes" + 'face 'font-lock-preprocessor-face) + :help-echo "Hide or show the Changelog" + :action (lambda (&rest ignore) + (spacemacs-buffer/toggle-note + (concat spacemacs-release-notes-directory + spacemacs-buffer-version-info + ".txt") + ;; if nil is returned, + ;; just delete the current note widgets + (spacemacs-buffer//insert-note-p 'release-note))) + :mouse-face 'highlight + :follow-link "\C-m") + (insert " ") + (widget-create 'url-link + :tag (propertize "Search in Spacemacs" + 'face 'font-lock-function-name-face) + :help-echo "Search Spacemacs contents." + :action + (lambda (&rest ignore) + (let ((comp-frontend + (cond + ((configuration-layer/layer-usedp 'helm) + 'helm-spacemacs-help) + ((configuration-layer/layer-usedp 'ivy) + 'ivy-spacemacs-help)))) + (call-interactively comp-frontend))) + :mouse-face 'highlight + :follow-link "\C-m") + (spacemacs-buffer//center-line) + (insert "\n\n")) + +(defun spacemacs-buffer//insert-string-list (list-display-name list) + (when (car list) + (insert list-display-name) + (mapc (lambda (el) + (insert + "\n" + (with-temp-buffer + (insert el) + (fill-paragraph) + (goto-char (point-min)) + (insert " - ") + (while (= 0 (forward-line)) + (insert " ")) + (buffer-string)))) + list))) + +(defun spacemacs-buffer//insert-file-list (list-display-name list) + (when (car list) + (insert list-display-name) + (mapc (lambda (el) + (insert "\n ") + (widget-create 'push-button + :action `(lambda (&rest ignore) + (find-file-existing ,el)) + :mouse-face 'highlight + :follow-link "\C-m" + :button-prefix "" + :button-suffix "" + :format "%[%t%]" + (abbreviate-file-name el))) + list))) + +(defun spacemacs-buffer//insert-bookmark-list (list-display-name list) + (when (car list) + (insert list-display-name) + (mapc (lambda (el) + (insert "\n ") + (let ((filename (bookmark-get-filename el))) + (widget-create 'push-button + :action `(lambda (&rest ignore) (bookmark-jump ,el)) + :mouse-face 'highlight + :follow-link "\C-m" + :button-prefix "" + :button-suffix "" + :format "%[%t%]" + (if filename + (format "%s - %s" + el (abbreviate-file-name filename)) + (format "%s" el))))) + list))) + +(defun spacemacs-buffer//get-org-items (types) + "Make a list of agenda file items for today of kind types" + (require 'org-agenda) + (let ((date (calendar-gregorian-from-absolute (org-today)))) + (apply #'append + (loop for file in (org-agenda-files nil 'ifmode) + collect + (spacemacs-buffer//make-org-items + file + (apply 'org-agenda-get-day-entries file date + types)))))) + +(defun spacemacs-buffer//agenda-list () + "Returns today's agenda" + (require 'org-agenda) + (spacemacs-buffer//get-org-items org-agenda-entry-types)) + +(defun spacemacs-buffer//todo-list () + "Returns current todos" + (require 'org-agenda) + (spacemacs-buffer//get-org-items '(:todo))) + +(defun spacemacs-buffer//make-org-items (file items) + "make a spacemacs-buffer org item list" + (loop + for item in items + collect + (spacemacs-buffer//make-org-item file item))) + +(defun spacemacs-buffer//make-org-item (file item) + "make a spacemacs-buffer version of an org item" + (list (cons "text" + (get-text-property 0 'txt item)) + (cons "file" file) + (cons "pos" + (marker-position + (get-text-property 0 'org-marker item))) + (cons "time" + (get-text-property 0 'time item)))) + +(defun spacemacs-buffer//org-jump (el) + (require 'org-agenda) + (find-file-other-window (cdr (assoc "file" el))) + (widen) + (goto-char (cdr (assoc "pos" el))) + (when (derived-mode-p 'org-mode) + (org-show-context 'agenda) + (save-excursion + (and (outline-next-heading) + (org-flag-heading nil))) ; show the next heading + (when (outline-invisible-p) + (outline-show-entry)) ; display invisible text + (recenter (/ (window-height) 2)) + (org-back-to-heading t) + (if (re-search-forward org-complex-heading-regexp nil t) + (goto-char (match-beginning 4)))) + (run-hooks 'org-agenda-after-show-hook)) + +(defun spacemacs-buffer//insert-todo-list (list-display-name list) + (when (car list) + (insert list-display-name) + (setq list (sort list + (lambda (a b) + (cond + ((eq "" (cdr (assoc "time" b))) + t) + ((eq "" (cdr (assoc "time" a))) + nil) + (t + (string< (cdr (assoc "time" a)) + (cdr (assoc "time" b)))))))) + (mapc (lambda (el) + (insert "\n ") + (widget-create 'push-button + :action `(lambda (&rest ignore) + (spacemacs-buffer//org-jump ',el)) + :mouse-face 'highlight + :follow-link "\C-m" + :button-prefix "" + :button-suffix "" + :format "%[%t%]" + (format "%s %s %s" + (abbreviate-file-name + (cdr (assoc "file" el))) + (if (not (eq "" (cdr (assoc "time" el)))) + (format "- %s -" + (cdr (assoc "time" el))) + "-") + (cdr (assoc "text" el))))) + list))) + +(defun spacemacs//subseq (seq start end) + "Use `cl-subseq`, but accounting for end points greater than the size of the +list. Return entire list if `END' is omitted." + (let ((len (length seq))) + (cl-subseq seq start (and (number-or-marker-p end) + (min len end))))) + +(defun spacemacs-buffer//do-insert-startupify-lists () + (let ((list-separator "\n\n")) + (mapc (lambda (els) + (let ((el (or (car-safe els) els)) + (list-size + (or (cdr-safe els) + spacemacs-buffer-startup-lists-length))) + (cond + ((eq el 'warnings) + (when (spacemacs-buffer//insert-string-list + "Warnings:" + spacemacs-buffer--warnings) + (spacemacs//insert--shortcut "w" "Warnings:") + (insert list-separator))) + ((eq el 'recents) + (recentf-mode) + (when (spacemacs-buffer//insert-file-list + "Recent Files:" + (spacemacs//subseq recentf-list 0 list-size)) + (spacemacs//insert--shortcut "r" "Recent Files:") + (insert list-separator))) + ((eq el 'todos) + (when (spacemacs-buffer//insert-todo-list + "ToDo:" + (spacemacs//subseq (spacemacs-buffer//todo-list) + 0 list-size)) + (spacemacs//insert--shortcut "d" "ToDo:") + (insert list-separator))) + ((eq el 'agenda) + (when (spacemacs-buffer//insert-todo-list + "Agenda:" + (spacemacs//subseq (spacemacs-buffer//agenda-list) + 0 list-size)) + (spacemacs//insert--shortcut "c" "Agenda:") + (insert list-separator))) + ((eq el 'bookmarks) + (when (configuration-layer/layer-usedp 'spacemacs-helm) + (helm-mode)) + (require 'bookmark) + (when (spacemacs-buffer//insert-bookmark-list + "Bookmarks:" + (spacemacs//subseq (bookmark-all-names) + 0 list-size)) + (spacemacs//insert--shortcut "b" "Bookmarks:") + (insert list-separator))) + ((and (eq el 'projects) + (fboundp 'projectile-mode)) + (projectile-mode) + (when (spacemacs-buffer//insert-file-list + "Projects:" + (spacemacs//subseq (projectile-relevant-known-projects) + 0 list-size)) + (spacemacs//insert--shortcut "p" "Projects:") + (insert list-separator)))))) + (append + '(warnings) + dotspacemacs-startup-lists)))) + +(defun spacemacs-buffer//get-buffer-width () + (save-excursion + (goto-char 0) + (let ((current-max 0)) + (while (not (eobp)) + (let ((line-length (- (line-end-position) (line-beginning-position)))) + (if (< current-max line-length) + (setq current-max line-length))) + (forward-line 1)) + current-max))) + +(defun spacemacs-buffer//center-startupify-lists () + (let* ((lists-width (spacemacs-buffer//get-buffer-width)) + (margin (max 0 (- spacemacs-buffer--buttons-position + spacemacs-buffer-buttons-startup-lists-offset))) + (final-padding (if (< spacemacs-buffer--banner-length (+ margin lists-width)) + (max 0 (floor (/ (- spacemacs-buffer--banner-length lists-width) 2))) + margin))) + (goto-char 0) + (while (not (eobp)) + (line-beginning-position) + (insert (make-string final-padding ?\ )) + (forward-line)))) + +(defun spacemacs-buffer/insert-startupify-lists () + (interactive) + (with-current-buffer (get-buffer spacemacs-buffer-name) + (let ((buffer-read-only nil)) + (goto-char (point-max)) + (spacemacs-buffer/insert-page-break) + (insert "\n") + (save-restriction + (narrow-to-region (point) (point)) + (spacemacs-buffer//do-insert-startupify-lists) + (spacemacs-buffer//center-startupify-lists))))) + +(defun spacemacs-buffer/goto-link-line () + "Set point to the beginning of the link line." + (interactive) + (with-current-buffer spacemacs-buffer-name + (goto-char (point-min)) + (with-demoted-errors "spacemacs buffer error: %s" + (widget-forward 1)))) + +(defun spacemacs-buffer//startup-hook () + "Code executed when Emacs has finished loading." + (with-current-buffer (get-buffer spacemacs-buffer-name) + (when dotspacemacs-startup-lists + (spacemacs-buffer/insert-startupify-lists)) + (spacemacs-buffer//insert-footer) + (if configuration-layer-error-count + (progn + (spacemacs-buffer-mode) + (spacemacs-buffer/set-mode-line + (format + (concat "%s error(s) at startup! " + "Spacemacs may not be able to operate properly.") + configuration-layer-error-count)) + (face-remap-add-relative 'mode-line + '((:background "red") mode-line))) + (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) + (spacemacs-buffer-mode)) + (force-mode-line-update) + (spacemacs-buffer/goto-link-line))) + +(defvar spacemacs-buffer--last-width nil + "Previous width of spacemacs-buffer") + +(defun spacemacs-buffer/goto-buffer (&optional refresh) + "Create the special buffer for `spacemacs-buffer-mode' if it doesn't +already exist, and switch to it." + (interactive) + (let ((buffer-exists (buffer-live-p (get-buffer spacemacs-buffer-name))) + (save-line nil)) + (when (or (not (eq spacemacs-buffer--last-width (window-width))) + (not buffer-exists) + refresh) + (setq spacemacs-buffer--banner-length (window-width) + spacemacs-buffer--last-width spacemacs-buffer--banner-length) + (with-current-buffer (get-buffer-create spacemacs-buffer-name) + (page-break-lines-mode) + (save-excursion + (when (> (buffer-size) 0) + (set 'save-line (line-number-at-pos)) + (let ((inhibit-read-only t)) + (erase-buffer))) + (spacemacs-buffer/set-mode-line "") + ;; needed in case the buffer was deleted and we are recreating it + (setq spacemacs-buffer--note-widgets nil) + (spacemacs-buffer/insert-banner-and-buttons) + ;; non-nil if emacs-startup-hook was run + (if (bound-and-true-p spacemacs-initialized) + (progn + (configuration-layer/display-summary emacs-start-time) + (when dotspacemacs-startup-lists + (spacemacs-buffer/insert-startupify-lists)) + (spacemacs-buffer//insert-footer) + (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) + (force-mode-line-update) + (spacemacs-buffer-mode)) + (add-hook 'emacs-startup-hook 'spacemacs-buffer//startup-hook t)))) + (if save-line + (progn (goto-char (point-min)) + (forward-line (1- save-line)) + (forward-to-indentation 0)) + (spacemacs-buffer/goto-link-line)) + (switch-to-buffer spacemacs-buffer-name) + (spacemacs//redisplay)))) + +(add-hook 'window-setup-hook + (lambda () + (add-hook 'window-configuration-change-hook 'spacemacs-buffer//resize-on-hook) + (spacemacs-buffer//resize-on-hook))) + +(defun spacemacs-buffer//resize-on-hook () + (let ((space-win (get-buffer-window spacemacs-buffer-name)) + (frame-win (frame-selected-window))) + (when (and dotspacemacs-startup-buffer-responsive + space-win + (not (window-minibuffer-p frame-win))) + (with-selected-window space-win + (spacemacs-buffer/goto-buffer))))) + +(defun spacemacs-buffer/refresh () + "Force recreation of the spacemacs buffer." + (interactive) + (setq spacemacs-buffer--last-width nil) + (spacemacs-buffer/goto-buffer t)) + +(defalias 'spacemacs/home 'spacemacs-buffer/refresh + "Go to home Spacemacs buffer") + +(defun spacemacs/home-delete-other-windows () + "Open home Spacemacs buffer and delete other windows. +Useful for making the home buffer the only visible buffer in the frame." + (interactive) + (spacemacs/home) + (delete-other-windows)) + +(provide 'core-spacemacs-buffer) diff --git a/emacs.d/core/core-spacemacs.el b/emacs.d/core/core-spacemacs.el new file mode 100644 index 0000000..0eaafc8 --- /dev/null +++ b/emacs.d/core/core-spacemacs.el @@ -0,0 +1,341 @@ +;;; core-spacemacs.el --- Spacemacs Core 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 +(setq message-log-max 16384) +(defconst emacs-start-time (current-time)) + +(require 'subr-x nil 'noerror) +(require 'page-break-lines) +(require 'core-debug) +(require 'core-command-line) +(require 'core-dotspacemacs) +(require 'core-release-management) +(require 'core-auto-completion) +(require 'core-jump) +(require 'core-display-init) +(require 'core-themes-support) +(require 'core-fonts-support) +(require 'core-spacemacs-buffer) +(require 'core-keybindings) +(require 'core-toggle) +(require 'core-funcs) +(require 'core-micro-state) +(require 'core-transient-state) +(require 'core-use-package-ext) + +(defgroup spacemacs nil + "Spacemacs customizations." + :group 'starter-kit + :prefix 'spacemacs-) + +;; loading progress bar variables +(defvar spacemacs-loading-char ?█) +(defvar spacemacs-loading-string "") +(defvar spacemacs-loading-counter 0) +(defvar spacemacs-loading-value 0) +;; (defvar spacemacs-loading-text "Loading") +;; (defvar spacemacs-loading-done-text "Ready!") +(defvar spacemacs-loading-dots-chunk-count 3) +(defvar spacemacs-loading-dots-count (window-total-size nil 'width)) +(defvar spacemacs-loading-dots-chunk-size + (/ spacemacs-loading-dots-count spacemacs-loading-dots-chunk-count)) +(defvar spacemacs-loading-dots-chunk-threshold 0) + +(defvar spacemacs-post-user-config-hook nil + "Hook run after dotspacemacs/user-config") +(defvar spacemacs-post-user-config-hook-run nil + "Whether `spacemacs-post-user-config-hook' has been run") + +(defvar spacemacs--default-mode-line mode-line-format + "Backup of default mode line format.") +(defvar spacemacs-initialized nil + "Whether or not spacemacs has finished initializing by completing +the final step of executing code in `emacs-startup-hook'.") + +(defun spacemacs/init () + "Perform startup initialization." + (when spacemacs-debugp (spacemacs/init-debug)) + ;; silence ad-handle-definition about advised functions getting redefined + (setq ad-redefinition-action 'accept) + ;; this is for a smoother UX at startup (i.e. less graphical glitches) + (hidden-mode-line-mode) + (spacemacs//removes-gui-elements) + ;; explicitly set the prefered coding systems to avoid annoying prompt + ;; from emacs (especially on Microsoft Windows) + (prefer-coding-system 'utf-8) + ;; TODO move these variables when evil is removed from the bootstrapped + ;; packages. + (setq-default evil-want-C-u-scroll t + ;; `evil-want-C-i-jump' is set to nil to avoid `TAB' being + ;; overlapped in terminal mode. The GUI specific `' is used + ;; instead. + evil-want-C-i-jump nil) + (dotspacemacs/load-file) + (require 'core-configuration-layer) + (dotspacemacs|call-func dotspacemacs/init "Calling dotfile init...") + (dotspacemacs|call-func dotspacemacs/user-init "Calling dotfile user init...") + (setq dotspacemacs-editing-style (dotspacemacs//read-editing-style-config + dotspacemacs-editing-style)) + (configuration-layer/initialize) + ;; default theme + (let ((default-theme (car dotspacemacs-themes))) + (spacemacs/load-theme default-theme) + ;; protect used themes from deletion as orphans + (setq configuration-layer--protected-packages + (append + (delq nil (mapcar 'spacemacs//get-theme-package + dotspacemacs-themes)) + configuration-layer--protected-packages)) + (setq-default spacemacs--cur-theme default-theme) + (setq-default spacemacs--cycle-themes (cdr dotspacemacs-themes))) + ;; font + (spacemacs|do-after-display-system-init + ;; If you are thinking to remove this call to `message', think twice. You'll + ;; break the life of several Spacemacser using Emacs in daemon mode. Without + ;; this, their chosen font will not be set on the *first* instance of + ;; emacsclient, at least if different than their system font. You don't + ;; believe me? Go ahead, try it. After you'll have notice that this was true, + ;; increase the counter bellow so next people will give it more confidence. + ;; Counter = 1 + (message "Setting the font...") + (unless (spacemacs/set-default-font dotspacemacs-default-font) + (spacemacs-buffer/warning + "Cannot find any of the specified fonts (%s)! Font settings may not be correct." + (if (listp (car dotspacemacs-default-font)) + (mapconcat 'car dotspacemacs-default-font ", ") + (car dotspacemacs-default-font))))) + ;; spacemacs init + (setq inhibit-startup-screen t) + (spacemacs-buffer/goto-buffer) + (unless (display-graphic-p) + ;; explicitly recreate the home buffer for the first GUI client + ;; in order to correctly display the logo + (spacemacs|do-after-display-system-init + (kill-buffer (get-buffer spacemacs-buffer-name)) + (spacemacs-buffer/goto-buffer))) + ;; This is set to nil during startup to allow Spacemacs to show buffers opened + ;; as command line arguments. + (setq initial-buffer-choice nil) + (setq inhibit-startup-screen t) + (require 'core-keybindings) + ;; for convenience and user support + (unless (fboundp 'tool-bar-mode) + (spacemacs-buffer/message (concat "No graphical support detected, " + "you won't be able to launch a " + "graphical instance of Emacs" + "with this build."))) + ;; check for new version + (if dotspacemacs-mode-line-unicode-symbols + (setq-default spacemacs-version-check-lighter "[⇪]"))) + +(defun spacemacs//removes-gui-elements () + "Remove the menu bar, tool bar and scroll bars." + ;; removes the GUI elements + (unless (spacemacs/window-system-is-mac) + (when (and (fboundp 'menu-bar-mode) (not (eq menu-bar-mode -1))) + (menu-bar-mode -1))) + (when (and (fboundp 'scroll-bar-mode) (not (eq scroll-bar-mode -1))) + (scroll-bar-mode -1)) + (when (and (fboundp 'tool-bar-mode) (not (eq tool-bar-mode -1))) + (tool-bar-mode -1)) + ;; tooltips in echo-aera + (when (and (fboundp 'tooltip-mode) (not (eq tooltip-mode -1))) + (tooltip-mode -1))) + +(defun spacemacs/maybe-install-dotfile () + "Install the dotfile if it does not exist." + (unless (file-exists-p dotspacemacs-filepath) + (spacemacs-buffer/set-mode-line "Dotfile wizard installer") + (spacemacs//redisplay) + (when (dotspacemacs/install 'with-wizard) + (configuration-layer/sync)))) + +(defun spacemacs/display-and-copy-version () + "Echo the current spacemacs version and copy it." + (interactive) + (let ((msg (format "Spacemacs v.%s" spacemacs-version))) + (message msg) (kill-new msg))) + +(defun display-startup-echo-area-message () + "Change the default welcome message of minibuffer to another one." + (message "Spacemacs is ready.")) + +(defun spacemacs/defer-until-after-user-config (func) + "Call FUNC if dotspacemacs/user-config has been called. Otherwise, +defer call using `spacemacs-post-user-config-hook'." + (if spacemacs-post-user-config-hook-run + (funcall func) + (add-hook 'spacemacs-post-user-config-hook func))) + +(defun spacemacs/setup-startup-hook () + "Add post init processing." + (add-hook + 'emacs-startup-hook + (lambda () + ;; This is set here so that emacsclient will show the startup buffer (and + ;; so that it can be changed in user-config if necessary). It was set to + ;; nil earlier in the startup process to properly handle command line + ;; arguments. + (setq initial-buffer-choice (lambda () (get-buffer spacemacs-buffer-name))) + ;; Ultimate configuration decisions are given to the user who can defined + ;; them in his/her ~/.spacemacs file + (dotspacemacs|call-func dotspacemacs/user-config + "Calling dotfile user config...") + (run-hooks 'spacemacs-post-user-config-hook) + (setq spacemacs-post-user-config-hook-run t) + (when (fboundp dotspacemacs-scratch-mode) + (with-current-buffer "*scratch*" + (funcall dotspacemacs-scratch-mode))) + (configuration-layer/display-summary emacs-start-time) + (spacemacs/check-for-new-version nil spacemacs-version-check-interval) + (setq spacemacs-initialized t)))) + +(defun spacemacs//describe-system-info-string () + "Gathers info about your Spacemacs setup and returns it as a string." + (format + (concat "#### System Info :computer:\n" + "- OS: %s\n" + "- Emacs: %s\n" + "- Spacemacs: %s\n" + "- Spacemacs branch: %s (rev. %s)\n" + "- Graphic display: %s\n" + "- Distribution: %s\n" + "- Editing style: %s\n" + "- Completion: %s\n" + "- Layers:\n```elisp\n%s```\n" + (when (version<= "25.1" emacs-version) + "- System configuration features: %s\n")) + system-type + emacs-version + spacemacs-version + (spacemacs//git-get-current-branch) + (spacemacs/git-get-current-branch-rev) + (display-graphic-p) + dotspacemacs-distribution + dotspacemacs-editing-style + (cond ((configuration-layer/layer-usedp 'helm) + 'helm) + ((configuration-layer/layer-usedp 'ivy) + 'ivy) + (t 'helm)) + (pp-to-string dotspacemacs--configuration-layers-saved) + (bound-and-true-p system-configuration-features))) + +(defun spacemacs/describe-system-info () + "Gathers info about your Spacemacs setup and copies to clipboard." + (interactive) + (let ((sysinfo (spacemacs//describe-system-info-string))) + (kill-new sysinfo) + (message sysinfo) + (message (concat "Information has been copied to clipboard.\n" + "You can paste it in the gitter chat.\n" + "Check the *Messages* buffer if you need to review it")))) + +(defun spacemacs//describe-last-keys-string () + "Gathers info about your Emacs last keys and returns it as a string." + (loop + for key + across (recent-keys) + collect (if (or (integerp key) (symbolp key) (listp key)) + (single-key-description key) + (prin1-to-string key)) + into keys + finally (return + (with-temp-buffer + (set-fill-column 60) + (insert (mapconcat 'identity keys " ")) + (fill-region (point-min) (point-max)) + (format "#### Emacs last keys :musical_keyboard: \n```text\n%s\n```\n" (buffer-string)))))) + +(defun spacemacs/describe-last-keys () + "Gathers info about your Emacs last keys and copies to clipboard." + (interactive) + (let ((lossage (spacemacs//describe-last-keys-string))) + (kill-new lossage) + (message lossage) + (message (concat "Information has been copied to clipboard.\n" + (propertize + "PLEASE REVIEW THE DATA BEFORE GOING FURTHER AS IT CAN CONTAIN SENSITIVE DATA (PASSWORD, ...)\n" + 'face 'font-lock-warning-face) + "You can paste it in the gitter chat.\n" + "Check the *Messages* buffer if you need to review it")))) + +(defun spacemacs/report-issue (arg) + "Open a spacemacs/report-issue-mode buffer prepopulated with + issue report template and system information. + + With prefix arg,include the last keys pressed." + (interactive "P") + (let ((buf + (generate-new-buffer "REPORT_SPACEMACS_ISSUE")) + (system-info + (spacemacs//describe-system-info-string)) + (backtrace + (if (get-buffer "*Backtrace*") + (with-current-buffer "*Backtrace*" + (buffer-substring-no-properties + (point-min) + (min (point-max) 1000))) + "<>")) + (last-keys + (if (and arg (y-or-n-p (concat "Do you really want to " + "include your last pressed keys? It " + "may include some sensitive data."))) + (concat (spacemacs//describe-last-keys-string) "\n") + ""))) + (switch-to-buffer buf) + (insert-file-contents-literally + (concat configuration-layer-template-directory "REPORTING.template")) + (loop + for (placeholder replacement) + in '(("%SYSTEM_INFO%" system-info) + ("%BACKTRACE%" backtrace) + ("(%LAST_KEYS%)\n" last-keys)) + do (save-excursion + (goto-char (point-min)) + (search-forward placeholder) + (replace-match (symbol-value replacement) [keep-case] [literal]))) + (spacemacs/report-issue-mode))) + +(define-derived-mode spacemacs/report-issue-mode markdown-mode "Report-Issue" + "Major mode for reporting issues with Spacemacs. + +When done editing, you can type \\[spacemacs//report-issue-done] to create the +issue on Github. You must be logged in already for this to work. After you see +that the issue has been created successfully, you can close this buffer. + +Markdown syntax is supported in this buffer. + +\\{spacemacs/report-issue-mode-map} +" + (font-lock-add-keywords 'spacemacs/report-issue-mode + '(("\\(<<.*?>>\\)" . 'font-lock-comment-face)))) + +(define-key spacemacs/report-issue-mode-map + (kbd "C-c C-c") 'spacemacs//report-issue-done) +(define-key spacemacs/report-issue-mode-map + (kbd "C-c C-k") 'kill-buffer) + +(with-eval-after-load 'bind-map + (spacemacs/set-leader-keys-for-major-mode 'spacemacs/report-issue-mode + "," 'spacemacs//report-issue-done + "c" 'spacemacs//report-issue-done + "a" 'kill-buffer + "k" 'kill-buffer)) + +(defun spacemacs//report-issue-done () + (interactive) + (let ((url "http://github.com/syl20bnr/spacemacs/issues/new?body=")) + (setq url (url-encode-url (concat url (buffer-string)))) + ;; HACK: Needed because the first `#' is not encoded + (setq url (replace-regexp-in-string "#" "%23" url)) + (browse-url url))) + +(provide 'core-spacemacs) diff --git a/emacs.d/core/core-themes-support.el b/emacs.d/core/core-themes-support.el new file mode 100644 index 0000000..8ce8182 --- /dev/null +++ b/emacs.d/core/core-themes-support.el @@ -0,0 +1,230 @@ +;;; core-themes-support.el --- Spacemacs Core 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 + +(defconst emacs-built-in-themes (cons 'default (custom-available-themes)) + "List of emacs built-in themes") + +(defface org-kbd + '((t (:background "LemonChiffon1" :foreground "black" :box + (:line-width 2 :color nil :style released-button)))) + "Face for displaying key bindings in Spacemacs documents." + :group 'org-faces) + +(defconst spacemacs-theme-name-to-package + '( + (alect-black-alt . alect-themes) + (alect-black . alect-themes) + (alect-dark-alt . alect-themes) + (alect-dark . alect-themes) + (alect-light-alt . alect-themes) + (alect-light . alect-themes) + (ample-light . ample-theme) + (ample-flat . ample-theme) + (apropospriate-light . apropospriate-theme) + (apropospriate-dark . apropospriate-theme) + (base16-3024 . base16-theme) + (base16-apathy . base16-theme) + (base16-ashes . base16-theme) + (base16-atelier-cave . base16-theme) + (base16-atelier-dune . base16-theme) + (base16-atelier-estuary . base16-theme) + (base16-atelier-forest . base16-theme) + (base16-atelier-heath . base16-theme) + (base16-atelier-lakeside . base16-theme) + (base16-atelier-plateau . base16-theme) + (base16-atelier-savanna . base16-theme) + (base16-atelier-seaside . base16-theme) + (base16-atelier-sulphurpool . base16-theme) + (base16-bespin . base16-theme) + (base16-brewer . base16-theme) + (base16-bright . base16-theme) + (base16-chalk . base16-theme) + (base16-codeschool . base16-theme) + (base16-darktooth . base16-theme) + (base16-default-dark . base16-theme) + (base16-default-light . base16-theme) + (base16-eighties . base16-theme) + (base16-embers . base16-theme) + (base16-flat . base16-theme) + (base16-github . base16-theme) + (base16-google-dark . base16-theme) + (base16-google-light . base16-theme) + (base16-grayscale-dark . base16-theme) + (base16-grayscale-light . base16-theme) + (base16-green-screen . base16-theme) + (base16-harmonic16-dark . base16-theme) + (base16-harmonic16-light . base16-theme) + (base16-hopscotch . base16-theme) + (base16-ir-black . base16-theme) + (base16-isotope . base16-theme) + (base16-london-tube . base16-theme) + (base16-macintosh . base16-theme) + (base16-marrakesh . base16-theme) + (base16-mocha . base16-theme) + (base16-monokai . base16-theme) + (base16-ocean . base16-theme) + (base16-oceanicnext . base16-theme) + (base16-paraiso . base16-theme) + (base16-phd . base16-theme) + (base16-pico . base16-theme) + (base16-pop . base16-theme) + (base16-railscasts . base16-theme) + (base16-seti-ui . base16-theme) + (base16-shapeshifter . base16-theme) + (base16-solar-flare . base16-theme) + (base16-solarized-dark . base16-theme) + (base16-solarized-light . base16-theme) + (base16-summerfruit-dark . base16-theme) + (base16-summerfruit-light . base16-theme) + (base16-tomorrow-night . base16-theme) + (base16-tomorrow . base16-theme) + (base16-twilight . base16-theme) + (base16-unikitty-dark . base16-theme) + (base16-unikitty-light . base16-theme) + (sanityinc-solarized-dark . color-theme-sanityinc-solarized) + (sanityinc-solarized-light . color-theme-sanityinc-solarized) + (sanityinc-tomorrow-blue . color-theme-sanityinc-tomorrow) + (sanityinc-tomorrow-bright . color-theme-sanityinc-tomorrow) + (sanityinc-tomorrow-day . color-theme-sanityinc-tomorrow) + (sanityinc-tomorrow-eighties . color-theme-sanityinc-tomorrow) + (sanityinc-tomorrow-night . color-theme-sanityinc-tomorrow) + (doom-one . doom-themes) + (doom-molokai . doom-themes) + (solarized-light . solarized-theme) + (solarized-dark . solarized-theme) + (spacemacs-light . spacemacs-theme) + (spacemacs-dark . spacemacs-theme) + (colorsarenice-dark . colorsarenice-theme) + (colorsarenice-light . colorsarenice-theme) + (hemisu-dark . hemisu-theme) + (hemisu-light . hemisu-theme) + (majapahit-dark . majapahit-theme) + (majapahit-light . majapahit-theme) + (material-light . material-theme) + (minimal-light . minimal-theme) + (moe-dark . moe-theme) + (moe-light . moe-theme) + (stekene-dark . stekene-theme) + (stekene-light . stekene-theme) + (brin . sublime-themes) + (dorsey . sublime-themes) + (fogus . sublime-themes) + (graham . sublime-themes) + (granger . sublime-themes) + (hickey . sublime-themes) + (junio . sublime-themes) + (mccarthy . sublime-themes) + (odersky . sublime-themes) + (omtose-darker . omtose-phellack-theme) + (omtose-softer . omtose-phellack-theme) + (ritchie . sublime-themes) + (spolsky . sublime-themes) + (wilson . sublime-themes) + (zonokai-blue . zonokai-theme) + (zonokai-red . zonokai-theme) + (tao-yin . tao-theme) + (tao-yang . tao-theme) + (farmhouse-light . farmhouse-theme) + (farmhouse-dark . farmhouse-theme) + ) + "alist matching a theme name with its package name, required when +package name does not match theme name + `-theme' suffix.") + +(defvar spacemacs-post-theme-change-hook nil + "Hook run after theme has changed.") + +(defun spacemacs//get-theme-package (theme) + "Returns the package theme for the given THEME name." + (cond + ;; built-in + ((memq theme emacs-built-in-themes) nil) + ;; from explicit alist + ((assq theme spacemacs-theme-name-to-package) + (cdr (assq theme spacemacs-theme-name-to-package))) + ;; fallback to -theme + (t (intern (format "%S-theme" theme))))) + +(defun spacemacs/load-theme (theme) + "Load THEME." + ;; Required dependencies for some themes + (condition-case-unless-debug err + (progn + (when (or (eq 'zonokai-blue theme) + (eq 'zonokai-red theme) + (eq 'solarized-light theme) + (eq 'solarized-dark theme)) + (configuration-layer/load-or-install-package 'dash)) + ;; Unless Emacs stock themes + (unless (or (memq theme (custom-available-themes)) + (eq 'default theme)) + (cond + ;; themes with explicitly declared package names + ((assq theme spacemacs-theme-name-to-package) + (let* ((pkg (spacemacs//get-theme-package theme)) + (pkg-dir (configuration-layer/load-or-install-package pkg))) + (when (or (eq 'moe-light theme) + (eq 'moe-dark theme)) + (load-file (concat pkg-dir "moe-light-theme.el")) + (load-file (concat pkg-dir "moe-dark-theme.el"))) + (add-to-list 'custom-theme-load-path pkg-dir))) + (t + ;; other themes + ;; we assume that the package name is suffixed with `-theme' + ;; if not we will handle the special themes as we get issues + ;; in the tracker. + (let ((pkg (spacemacs//get-theme-package theme))) + (configuration-layer/load-or-install-package pkg)))))) + ('error + (setq theme 'default) + (display-warning 'spacemacs + (format (concat "An error occurred while retrieving the " + "theme, using default theme. (error: %s)") + err) + :warning))) + (mapc 'disable-theme custom-enabled-themes) + (if (eq 'default theme) + (progn + (setq spacemacs--cur-theme 'default) + (spacemacs/post-theme-init 'default)) + (load-theme theme t) + ;; explicitly reload the theme for the first GUI client + (eval `(spacemacs|do-after-display-system-init + (load-theme ',theme t))))) + +(defun spacemacs/cycle-spacemacs-theme () + "Cycle through themes defined in `dotspacemacs-themes.'" + (interactive) + (when spacemacs--cur-theme + (disable-theme spacemacs--cur-theme) + ;; if current theme isn't in cycleable themes, start over + (setq spacemacs--cycle-themes + (or (cdr (memq spacemacs--cur-theme dotspacemacs-themes)) + dotspacemacs-themes))) + (setq spacemacs--cur-theme (pop spacemacs--cycle-themes)) + (message "Loading theme %s..." spacemacs--cur-theme) + (spacemacs/load-theme spacemacs--cur-theme)) + +(defadvice load-theme (after spacemacs/load-theme-adv activate) + "Perform post load processing." + (let ((theme (ad-get-arg 0))) + ;; Without this a popup is raised every time emacs25 starts up for + ;; assignment to a free variable + (with-no-warnings + (setq spacemacs--cur-theme theme)) + (spacemacs/post-theme-init theme))) + +(defun spacemacs/post-theme-init (theme) + "Some processing that needs to be done when the current theme +has been changed to THEME." + (interactive) + (run-hooks 'spacemacs-post-theme-change-hook)) + +(provide 'core-themes-support) diff --git a/emacs.d/core/core-toggle.el b/emacs.d/core/core-toggle.el new file mode 100644 index 0000000..e3f88dc --- /dev/null +++ b/emacs.d/core/core-toggle.el @@ -0,0 +1,113 @@ +;;; core-toggle.el --- Spacemacs Core 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 +(require 'core-funcs) + +(defvar spacemacs-toggles '() + "List of all declared toggles. The structure of an element is a +property list (name :func FUNCTION :doc STRING :key STRING).") + +(defmacro spacemacs|add-toggle (name &rest props) + "Add a toggle with NAME symbol. + +This macro creates the following functions: +- spacemacs/toggle-NAME switches on or off depending on the current state +- spacemacs/toggle-NAME-on only switches on if currently disabled +- spacemacs/toggle-NAME-off only switches off if currently enabled + +Avaiblabe PROPS: + +`:status EXPRESSION' + The EXPRESSION to evaluate to get the current status of the toggle. + +`:if EXPRESSION' + If this EXPRESSION evaluate to nil then no attempt to update the toggle + status will be performed. + +`:on BODY' + Evaluate BODY when the toggle is switched on. + +`:off BODY' + Evaluate BODY when the toggle is switched off. + +`:documentation STRING' + STRING describes what the toggle does. + +`:prefix SYMBOL' + SYMBOL is bound to the raw value of prefix-arg (same as calling + (interactive \"P\")) in the wrapper function. + +`:on-message EXPRESSION' + EXPRESSION is evaluated and displayed when the \"on\" toggle is activated. + +`:mode SYMBOL' + If given, must be a minor mode. This overrides `:on', `:off' and `:status'. + +All properties supported by `spacemacs//create-key-binding-form' can be +used." + (declare (indent 1)) + (let* ((wrapper-func (intern (format "spacemacs/toggle-%s" + (symbol-name name)))) + (wrapper-func-status (intern (format "%s-p" wrapper-func))) + (wrapper-func-on (intern (format "%s-on" wrapper-func))) + (wrapper-func-off (intern (format "%s-off" wrapper-func))) + (mode (plist-get props :mode)) + (status (or mode (plist-get props :status))) + (condition (plist-get props :if)) + (doc (plist-get props :documentation)) + (on-body (if mode `((,mode)) (spacemacs/mplist-get props :on))) + (off-body (if mode `((,mode -1)) (spacemacs/mplist-get props :off))) + (prefix-arg-var (plist-get props :prefix)) + (on-message (plist-get props :on-message)) + (bindkeys (spacemacs//create-key-binding-form props wrapper-func)) + ;; we evaluate condition and status only if they are a list or + ;; a bound symbol + (status-eval `(and (or (and (symbolp ',status) (boundp ',status)) + (listp ',status)) + ,status))) + `(progn + (push (append '(,name) '(:function ,wrapper-func + :predicate ,wrapper-func-status) ',props) + spacemacs-toggles) + ;; toggle function + (defun ,wrapper-func ,(if prefix-arg-var (list prefix-arg-var) ()) + ,(format "Toggle %s on and off." (symbol-name name)) + ,(if prefix-arg-var '(interactive "P") '(interactive)) + (if (or (null ',condition) + (and (or (and (symbolp ',condition) (boundp ',condition)) + (listp ',condition)) + ,condition)) + (if (,wrapper-func-status) + (progn ,@off-body + (when (called-interactively-p 'any) + (message ,(format "%s disabled." name)))) + ,@on-body + (when (called-interactively-p 'any) + (message ,(or on-message (format "%s enabled." name))))) + (message "This toggle is not supported."))) + ;; predicate function + (defun ,wrapper-func-status () + ,(format "Check if %s is on." (symbol-name name)) + ,status-eval) + ;; Only define on- or off-functions when status is available + ,@(when status + ;; on-function + `((defun ,wrapper-func-on () + ,(format "Toggle %s on." (symbol-name name)) + (interactive) + (unless (,wrapper-func-status) (,wrapper-func))) + ;; off-function + (defun ,wrapper-func-off () + ,(format "Toggle %s off." (symbol-name name)) + (interactive) + (when (,wrapper-func-status) (,wrapper-func))))) + ,@bindkeys))) + +(provide 'core-toggle) diff --git a/emacs.d/core/core-transient-state.el b/emacs.d/core/core-transient-state.el new file mode 100644 index 0000000..5e572a0 --- /dev/null +++ b/emacs.d/core/core-transient-state.el @@ -0,0 +1,193 @@ +;;; -*- lexical-binding: t -*- +;;; core-transient-state.el --- Spacemacs Core File +;; +;; Copyright (c) 2012-2016 Sylvain Benner & Contributors +;; +;; Author: Justin Burkett +;; URL: https://github.com/syl20bnr/spacemacs +;; +;; This file is not part of GNU Emacs. +;; +;;; License: GPLv3 + +(defun spacemacs//transient-state-func-name (name) + "Return the name of the transient state function." + (intern (format "spacemacs/%S-transient-state" name))) + +(defun spacemacs//transient-state-props-var-name (name) + "Return the name of the variable use to store the transient state properties." + (intern (format "spacemacs--%S-transient-state-props" name))) + +(defun spacemacs//transient-state-body-func-name (name) + "Return the name of the transient state function." + (intern (format "spacemacs/%S-transient-state/body" name))) + +(defun spacemacs//transient-state-heads-name (name) + "Return the name of the transient state heads variable which +holds the key bindings." + (intern (format "spacemacs/%S-transient-state/heads" name))) + +(defun spacemacs//transient-state-adjust-bindings (bindings to-remove to-add) + (append + (cl-remove-if + (lambda (bnd) + (and (boundp to-remove) + (listp (symbol-value to-remove)) + (member (car bnd) (symbol-value to-remove)))) + bindings) + (when (and (boundp to-add) + (listp (symbol-value to-add))) + (symbol-value to-add)))) + +(defun spacemacs//transient-state-make-doc + (transient-state docstring &optional body) + "Use `hydra' internal function to format and apply DOCSTRING." + (let ((heads (spacemacs//transient-state-heads-name transient-state))) + (setq body (if body body '(nil nil :hint nil :foreign-keys nil))) + (eval + (hydra--format nil body docstring (symbol-value heads))))) + +(defmacro spacemacs|transient-state-format-hint (name var hint) + "Format HINT and store the result in VAR for transient state NAME." + (declare (indent 1)) + `(add-hook 'spacemacs-post-user-config-hook + (lambda () + (let* ((props-var ,(spacemacs//transient-state-props-var-name + name)) + (prop-hint (cadr (assq 'hint props-var))) + (prop-columns (cadr (assq 'columns props-var))) + (prop-foreign-keys (cadr (assq 'foreign-keys props-var))) + (prop-entry-sexp (cadr (assq 'entry-sexp props-var))) + (prop-exit-sexp (cadr (assq 'exit-sexp props-var)))) + (setq ,var (spacemacs//transient-state-make-doc + ',name + ,hint + `(nil + nil + :hint ,prop-hint + :columns ,prop-columns + :foreign-keys ,prop-foreign-keys + :body-pre ,prop-entry-sexp + :before-exit ,prop-exit-sexp))) + 'append)))) + +(defface spacemacs-transient-state-title-face + `((t :inherit mode-line)) + "Face for title of transient states.") + +(defmacro spacemacs|define-transient-state (name &rest props) + "Define a transient state called NAME. +NAME is a symbol. +Available PROPS: +`:on-enter SEXP' + Evaluate SEXP when the transient state is switched on. +`:on-exit SEXP' + Evaluate SEXP when leaving the transient state. +`:doc STRING or SEXP' + A docstring supported by `defhydra'. +`:additional-docs cons cells (VARIABLE . STRING)' + Additional docstrings to format and store in the corresponding VARIABLE. + This can be used to dynamically change the docstring. +`:title STRING' + Provide a title in the header of the transient state +`:columns INTEGER' + Automatically generate :doc with this many number of columns. +`:hint BOOLEAN' + Whether to display hints. Default is nil. +`:hint-is-doc BOOLEAN' + Whether the hints act as a documentation, the only effect of this value is + to change where the hints are displayed. If non-nil the hints are displayed + on the same line as the `:title', otherwise they are displayed below it. + Default is nil. +`:dynamic-hint SEXP' + An sexp evaluating to a string for dynamic hinting. + When provided `:hint' has no effect. Default is nil. +`:foreign-keys SYMBOL' + What to do when keys not bound in the transient state are entered. This + can be nil (default), which means to exit the transient state, warn, + which means to not exit but warn the user that the key is not part + of the transient state, or run, which means to try to run the key binding + without exiting. +`:bindings EXPRESSIONS' + One or several EXPRESSIONS with the form + (STRING1 SYMBOL1 DOCSTRING + :exit SYMBOL) + where: + - STRING1 is a key to be bound to the function or key map SYMBOL1. + - DOCSTRING is a STRING or an SEXP that evaluates to a string + - :exit SYMBOL or SEXP, if non nil then pressing this key will + leave the transient state (default is nil). + Important note: due to inner working of transient-maps in Emacs + the `:exit' keyword is evaluate *before* the actual execution + of the bound command. +All properties supported by `spacemacs//create-key-binding-form' can be +used." + (declare (indent 1)) + (let* ((func (spacemacs//transient-state-func-name name)) + (props-var (spacemacs//transient-state-props-var-name name)) + (body-func (spacemacs//transient-state-body-func-name name)) + (add-bindings + (intern (format "spacemacs-%s-transient-state-add-bindings" name))) + (remove-bindings + (intern (format "spacemacs-%s-transient-state-remove-bindings" name))) + (bindings (spacemacs/mplist-get props :bindings)) + (doc (or (plist-get props :doc) "\n")) + (title (plist-get props :title)) + (hint-var (intern (format "%s/hint" func))) + (columns (plist-get props :columns)) + (entry-sexp (plist-get props :on-enter)) + (exit-sexp (plist-get props :on-exit)) + (hint (plist-get props :hint)) + (hint-doc-p (plist-get props :hint-is-doc)) + (dyn-hint (plist-get props :dynamic-hint)) + (additional-docs (spacemacs/mplist-get props :additional-docs)) + (foreign-keys (plist-get props :foreign-keys)) + (bindkeys (spacemacs//create-key-binding-form props body-func))) + `(progn + (defvar ,props-var nil + ,(format (concat "Association list containing a copy of some " + "properties of the transient state %S. Those " + "properties are used in macro " + "`spacemacs|transient-state-format-hint'.") name)) + (add-to-list ',props-var '(hint ,hint)) + (add-to-list ',props-var '(columns ,columns)) + (add-to-list ',props-var '(foreign-keys ,foreign-keys)) + (add-to-list ',props-var '(entry-sexp ,entry-sexp)) + (add-to-list ',props-var '(exit-sexp ,exit-sexp)) + (spacemacs/defer-until-after-user-config + '(lambda () + (eval + (append + '(defhydra ,func + (nil nil + :hint ,hint + :columns ,columns + :foreign-keys ,foreign-keys + :body-pre ,entry-sexp + :before-exit ,exit-sexp) + ,doc) + (spacemacs//transient-state-adjust-bindings + ',bindings ',remove-bindings ',add-bindings))) + (when ,title + (let ((guide (concat "[" (propertize "KEY" 'face 'hydra-face-blue) + "] exits state [" + (if ',foreign-keys + (propertize "KEY" 'face 'hydra-face-pink) + (propertize "KEY" 'face 'hydra-face-red)) + "] will not exit"))) + ;; (add-face-text-property 0 (length guide) '(:height 0.9) t guide) + (add-face-text-property 0 (length guide) 'italic t guide) + (setq ,hint-var + (list 'concat + (when dotspacemacs-show-transient-state-title + (concat + (propertize + ,title + 'face 'spacemacs-transient-state-title-face) + (if ,hint-doc-p " " "\n"))) ,hint-var + ',dyn-hint + (when dotspacemacs-show-transient-state-color-guide + (concat "\n" guide)))))) + ,@bindkeys))))) + +(provide 'core-transient-state) diff --git a/emacs.d/core/core-use-package-ext.el b/emacs.d/core/core-use-package-ext.el new file mode 100644 index 0000000..f9c7040 --- /dev/null +++ b/emacs.d/core/core-use-package-ext.el @@ -0,0 +1,50 @@ +;;; core-use-package-ext.el --- Spacemacs Core 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 +(defconst spacemacs--use-package-add-hook-keywords '(:pre-init + :post-init + :pre-config + :post-config)) + +(defmacro spacemacs|use-package-add-hook (name &rest plist) + "Add post hooks to `:init' or `:config' arguments of an existing +configuration. + +In order to use this macro the variable `use-package-inject-hooks' +must be non-nil. + +This is useful in the dotfile to override the default configuration +of a package. + +Usage: + + (spacemacs|use-package-add-hook package-name + [:keyword [option]]...) + +:pre-init Code to run before the default `:init' configuration. +:post-init Code to run after the default `:init' configuration. +:pre-config Code to run before the default `:config' configuration. +:post-config Code to run after the default `:config' configuration. + +In practice the most useful hook is the `:post-config' where you can +override lazy-loaded settings." + (declare (indent 1)) + (let ((name-symbol (if (stringp name) (intern name) name)) + (expanded-forms '())) + (dolist (keyword spacemacs--use-package-add-hook-keywords) + (let ((body (spacemacs/mplist-get plist keyword))) + (when body + (let ((hook (intern (format "use-package--%S--%s-hook" + name-symbol + (substring (format "%s" keyword) 1))))) + (push `(add-hook ',hook (lambda nil ,@body)) expanded-forms))))) + `(progn ,@expanded-forms))) + +(provide 'core-use-package-ext) diff --git a/emacs.d/core/info/quickhelp.txt b/emacs.d/core/info/quickhelp.txt new file mode 100644 index 0000000..0591722 --- /dev/null +++ b/emacs.d/core/info/quickhelp.txt @@ -0,0 +1,28 @@ +Press [TAB] or [J] to move to next button. + +Press [Shift-TAB] or [K] to move to previous button. + +Press [r] to jump to recent file list if it is enabled. + +Press [p] to jump to project list if it is enabled. + +Press [b] to jump to bookmark list if it is enabled. + +Press [o] to jump to any link or button. + +Press [m] to jump to the top menu. + +Press [SPC] (in Vim editing style) or [Alt-m] (in Emacs editing style) to access +Spacemacs commands (will list only the Vim style ones for the rest of this +help). + +Press [SPC f e d] (or [Alt-m f e d] in Emacs style) to access .spacemacs file. + +Press [SPC h SPC] to access a list of documentation and supported layers. You +can type anything to narrow to a specific feature i.e. "python" for Python +layer. There are multiple lists and you can press [Ctrl-o] to switch between +them. + +When reading a document, you can use [SPC s j] to jump to a heading. + +Please consult Spacemacs documentation from [SPC h SPC] for more details. diff --git a/emacs.d/core/info/release-notes/0.101.txt b/emacs.d/core/info/release-notes/0.101.txt new file mode 100644 index 0000000..be5f02a --- /dev/null +++ b/emacs.d/core/info/release-notes/0.101.txt @@ -0,0 +1,10 @@ +New layers: +company-mode layer has been replaced by the new layer auto-completion. +Org packages have been moved to the new layer org. +Flycheck has been moved to the new layer syntax-checking. +Be sure to update your dotfile to add these layers. + +Init functions: +The init function /init- is now mandatory. Any package +without an explicit init function will be ignored and uninstalled by +Spacemacs. diff --git a/emacs.d/core/info/release-notes/0.102.txt b/emacs.d/core/info/release-notes/0.102.txt new file mode 100644 index 0000000..1305f63 --- /dev/null +++ b/emacs.d/core/info/release-notes/0.102.txt @@ -0,0 +1,34 @@ +1. Dotfile + +It is now possible to reload the dotfile and layers anywhere with `SPC f e +R`. This key binding *replaces* the old `C-c C-c` and `SPC m c c` only +available in the dotfile. + +*Important* You should replace your `(defvar -packages ...)`, +`(defvar -pre-extensions ...)`, `(defvar -post-extensions ...)` +and `(defvar -excluded-packages ...)` by `(setq ...)`. This will +allow to install newly added packages to a layer without restarting spacemacs +by pressing `SPC f e R`. Be sure to remove the docstring when replacing the +`defvar` since `setq` does not take a third argument. + +`:variables` keyword now behaves like a regular `setq` so you'll have to +quote any value appropriately. + +2. Emacs lisp and Shell config are now in their own layers + +Be sure to add the new layers `emacs-lisp` and `shell` to your dotfile to +continue to enjoy the emacs-lisp and shell configurations of Spacemacs. + +Also be sure to check the key binding `SPC '` to open a shell buffer. + +3. Key bindings + +`SPC b s` to switch buffer is now on `SPC b b`. +`SPC f f` uses helm instead of ido, set the new variable. +`dotspacemacs-use-ido` to t to get back the old ido behavior. +`TAB` and `C-z` in helm buffers have been *swapped*. + +4. Sentence delimiter + +Sentence delimiter is now a *single space* as opposed to Emacs default +which is double spaces. diff --git a/emacs.d/core/info/release-notes/0.103.txt b/emacs.d/core/info/release-notes/0.103.txt new file mode 100644 index 0000000..bc67213 --- /dev/null +++ b/emacs.d/core/info/release-notes/0.103.txt @@ -0,0 +1,36 @@ +1. Magit 2.1 + +Spacemacs is now compatible only with Magit 2.1 and later, be +sure to *update your packages* (at least Magit). + +2. Helm + +Helm input pattern is now displayed in its header instead of the +minibuffer. + +3. Git layer + +The `git` layer has been split into two layers: `git` and `github` so +the layer variable `git-enabled-github-support` is deprecated, you +have to *add the layer `github` in your dotfile*. + +The `git-gutter` has been replaced by `diff-hl`. This package is in +the new layer `version-control`, be sure to *add this new layer to +your dotfile*. + +4. Auctex layer + +The `auctex` layer has been renamed `latex`, be sure to *update your +dotfile* if you use this layer. + +5. Erlang/Elixir layer + +The erlang/elixir layer has been split into two layers `erlang` and +`elixir`, be sure to *update your dotfile* if you use these layers. + +6. Key bindings changes + +Projectile key bindings changes: +~SPC p e~ is now ~SPC p r~ (recent files), +~SPC p R~ is now ~SPC p G~ (regenerate tags), +~SPC p r~ is now ~SPC p R~ (replace). diff --git a/emacs.d/core/info/release-notes/0.104.txt b/emacs.d/core/info/release-notes/0.104.txt new file mode 100644 index 0000000..fa6ac4d --- /dev/null +++ b/emacs.d/core/info/release-notes/0.104.txt @@ -0,0 +1,44 @@ +1. Org + +`org-plus-contrib` is now installed from org ELPA repository, you may +encounter strange behaviours from Org. In this case delete the `org` +directory in the `elpa` directory and restart Emacs. + +2. Helm + +`Helm` key bindings have been slightly adjusted: + +- in `helm-find-files` (`SPC f f`): now `C-h` move up a directory + and `C-l` enter the selected directory. `describe-key` command is + available on `C-S-h` + +- in other `helm` buffers ~C-h~ is used to go to the next source + and `C-l` is the same as `RET`. `describe-key` command is also + available on `C-S-h`. + +3. Vim keys + +`Y` has been remapped to `y$`, if you don't like this behavior you can +set the variable `dotspacemacs-remap-Y-to-y$` to nil in your dotfile. + +4. Guide-key + +`guide-key` has been replaced by `which-key`, you may encounter issues +if you have some `guide-key` custom configuration, remove any `guide-key` +configuration and check the options offered by `which-key`. + +5. Bookmarks + +The `bookmark` save file has been moved to the `.cache` directory, if +you have a bookmark file `~/.emacs.d/bookmarks` then you'll have to move +it to file `~/.emacs.d/.cache/bookmarks` + +6. Ruby on Rails + +Ruby on Rails framework has now its own layer called `ruby-on-rails`, +be sure to add this layer to your dotfile if you use it. + +7. Django + +Django framework has now its own layer called `django`, +be sure to add this layer to your dotfile if you use it. diff --git a/emacs.d/core/info/release-notes/0.105.txt b/emacs.d/core/info/release-notes/0.105.txt new file mode 100644 index 0000000..e114293 --- /dev/null +++ b/emacs.d/core/info/release-notes/0.105.txt @@ -0,0 +1,32 @@ +1. Key binding changes + +- `SPC l` for `avy-goto-line` is now under `SPC y`. `SPC l` is now for + spacemacs layouts. + +- `SPC a p` is now for `list-processes` and `SPC a P` for `proced`, + `paradox` to list ELPA packages is now on `SPC a k`. + +- `SPC s l` is now used to bring back last search buffer and `SPC s j` + is for jumping into a file using `imenu` (was `SPC s l`). + +- In home buffer, jumping to bookmark list is now on ~b~. + +2. Magit + +Magit key bindings have been revamped thanks to the official `evil-magit` +package. `evil-magit` provides a faithful port of Magit UX using Vim key +bindings. If you want to continue to use the old evilified bindings add +`evil-magit` package to the `dotspacemacs-excluded-packages` variable +of your dotfile. + +3. Projectile + +Caching is now disabled by default, while it should not break anything, +if you have some functions relying on caching being enabled be sure to +activate it explicitly with `(setq projectile-enable-caching t)`. + +4. Ruby + +The default major mode is now the Emacs built-in `ruby-mode`. If you want +to continue to use `enh-ruby-mode` set the layer variable +`ruby-enable-enh-ruby-mode` to `t`. diff --git a/emacs.d/core/info/release-notes/0.200.txt b/emacs.d/core/info/release-notes/0.200.txt new file mode 100644 index 0000000..30a241f --- /dev/null +++ b/emacs.d/core/info/release-notes/0.200.txt @@ -0,0 +1,16 @@ +The Autumnal Cleanup 2016 is complete! Thank you to everyone +who helped keep the issue tracker clean. In particular + +1. gilbertw1 (230 issues, 27.09%) +2. NJBS (98 issues, 11.54%) +3. mahinshaw (90 issues, 10.60%) +4. smile13241324 (75 issues, 8.83%) +5. deb0ch (66 issues, 7.77%) + +as well as bleggett, jredville, lazywithclass, rgrinberg, +kdelwat, cmr, bmag, ksjogo, ekmecic, cro, inirudebwoy, +mwillsey, robbyoconnor and alimoeeny. And of course, last but +not least, the hard working organizer d12frosted! + +For more info on release 0.200.x see the newsletter #01 at +[[http://spacemacs.org/news/news01.html]] diff --git a/emacs.d/core/info/release-notes/af-1.01.txt b/emacs.d/core/info/release-notes/af-1.01.txt new file mode 100644 index 0000000..70c43e1 --- /dev/null +++ b/emacs.d/core/info/release-notes/af-1.01.txt @@ -0,0 +1,38 @@ + The new version of Spacemacs has arrived! + +This version brings Emacs to a whole new level by embedding Zerovim technologies +through a state of the art message passing interface, this is Emacs for the next +next NEXT century. + +This is so powerful that we decided to rename Spacemacs! + + Zemacs: Emacs to THE MAX! + +- Zerovim ambitious refactor of the (-1)Vim code base directly improves the code +quality of Emacs while still retaining its important [implementation tricks]. + +- Elisp can now be transpiled to Vimscript which can be transpiled to Lua which +can be used to code plugins for Zerovim, so now Emacs can have true native Vim +plugins in Lua code coded in Elisp. +Note: For performance reasons native plugins are transpiled to Elisp before +being executed. + +- You can now type in [Atom] in Emacs by sharing a Zerovim session. Zemacs is +shipped with a groundbreaking new UI using the new VR headsets capabilities: +by projecting the Atom web-based interface on the left eye and the Emacs +text-based interface on the right eye (also available the `swap-the-eyes' major +mode tailored for colour-blind people) we can create the perfect blend of Emacs +and Atom, instantaneous context switching with the blink of an eye. Welcome +to the definitive GUI: + + Zemacstom, the editor for the next next NEXT millennium. + + ------------------------------------------- + +This text is a parody of Neovim whose only purpose is to be funny (the text, not +Neovim!). Neovim is a popular fork of Vim, you can try it and contribute to it +by visiting this [link] or maybe [this one]. + +This prank will self-destruct the 2nd April 2016. + +Type ~SPC m aprilfool~ to start working :-) diff --git a/emacs.d/core/libs/ht.el b/emacs.d/core/libs/ht.el new file mode 100644 index 0000000..0d5d8b0 --- /dev/null +++ b/emacs.d/core/libs/ht.el @@ -0,0 +1,280 @@ +;;; ht.el --- The missing hash table library for Emacs + +;; Copyright (C) 2013 Wilfred Hughes + +;; Author: Wilfred Hughes +;; Version: 2.0 +;; Keywords: hash table, hash map, hash + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; The missing hash table utility library for Emacs. +;; +;; See documentation on https://github.com/Wilfred/ht.el + +;;; Code: + +(eval-when-compile (require 'cl)) ;; dolist + +(defmacro ht (&rest pairs) + "Create a hash table with the key-value pairs given. +Keys are compared with `equal'. + +\(fn (KEY-1 VALUE-1) (KEY-2 VALUE-2) ...)" + (let* ((table-symbol (make-symbol "ht-temp")) + (assignments + (mapcar + (lambda (pair) `(ht-set! ,table-symbol ,@pair)) + pairs))) + `(let ((,table-symbol (ht-create))) + ,@assignments + ,table-symbol))) + +(defun ht-create (&optional test) + "Create an empty hash table. + +TEST indicates the function used to compare the hash +keys. Default is `equal'. It can be `eq', `eql', `equal' or a +user-supplied test created via `define-hash-table-test'." + (make-hash-table :test (or test 'equal))) + +(defun ht<-alist (alist) + "Create a hash table with initial values according to ALIST." + (let ((h (ht-create))) + ;; the first key-value pair in an alist gets precedence, so we + ;; start from the end of the list: + (dolist (pair (reverse alist) h) + (let ((key (car pair)) + (value (cdr pair))) + (ht-set! h key value))))) + +(defalias 'ht-from-alist 'ht<-alist) + +;; based on the excellent -partition from dash.el, but we aim to be self-contained +(defun ht/group-pairs (list) + "Return a new list with the items in LIST grouped into pairs. +Errors if LIST doesn't contain an even number of elements." + (let ((result) + (sublist) + (len 0)) + + (while list + ;; take the head of LIST and push onto SUBLIST + (setq sublist (cons (car list) sublist)) + (setq list (cdr list)) + + (setq len (1+ len)) + + (when (= len 2) + ;; push this two-item list onto RESULT + (setq result (cons (nreverse sublist) result)) + (setq sublist nil) + (setq len 0))) + + (when sublist (error "Expected an even number of elements")) + (nreverse result))) + +(defun ht<-plist (plist) + "Create a hash table with initial values according to PLIST." + (let ((h (ht-create))) + (dolist (pair (ht/group-pairs plist) h) + (let ((key (car pair)) + (value (cadr pair))) + (ht-set! h key value))))) + +(defalias 'ht-from-plist 'ht<-plist) + +(defun ht-get (table key &optional default) + "Look up KEY in TABLE, and return the matching value. +If KEY isn't present, return DEFAULT (nil if not specified)." + (gethash key table default)) + +(defun ht-set! (table key value) + "Associate KEY in TABLE with VALUE." + (puthash key value table) + nil) + +(defalias 'ht-set 'ht-set!) + +(defun ht-update! (table from-table) + "Update TABLE according to every key-value pair in FROM-TABLE." + (maphash + (lambda (key value) (puthash key value table)) + from-table) + nil) + +(defalias 'ht-update 'ht-update!) + +(defun ht-merge (&rest tables) + "Crete a new tables that includes all the key-value pairs from TABLES. +If multiple have tables have the same key, the value in the last +table is used." + (let ((merged (ht-create))) + (mapc (lambda (table) (ht-update! merged table)) tables) + merged)) + +(defun ht-remove! (table key) + "Remove KEY from TABLE." + (remhash key table)) + +(defalias 'ht-remove 'ht-remove!) + +(defun ht-clear! (table) + "Remove all keys from TABLE." + (clrhash table) + nil) + +(defalias 'ht-clear 'ht-clear!) + +(defun ht-map (function table) + "Apply FUNCTION to each key-value pair of TABLE, and make a list of the results. +FUNCTION is called with two arguments, KEY and VALUE." + (let (results) + (maphash + (lambda (key value) + (push (funcall function key value) results)) + table) + results)) + +(defmacro ht-amap (form table) + "Anaphoric version of `ht-map'. +For every key-value pair in TABLE, evaluate FORM with the +variables KEY and VALUE bound." + `(ht-map (lambda (key value) ,form) ,table)) + +(defun ht-keys (table) + "Return a list of all the keys in TABLE." + (ht-amap key table)) + +(defun ht-values (table) + "Return a list of all the values in TABLE." + (ht-amap value table)) + +(defun ht-items (table) + "Return a list of two-element lists '(key value) from TABLE." + (ht-amap (list key value) table)) + +(defalias 'ht-each 'maphash + "Apply FUNCTION to each key-value pair of TABLE. +Returns nil, used for side-effects only.") + +(defmacro ht-aeach (form table) + "Anaphoric version of `ht-each'. +For every key-value pair in TABLE, evaluate FORM with the +variables key and value bound." + `(ht-each (lambda (key value) ,form) ,table)) + +(defun ht->plist (table) + "Return a flat list '(key1 value1 key2 value2...) from TABLE. + +Note that hash tables are unordered, so this cannot be an exact +inverse of `ht<-plist'. The following is not guaranteed: + +\(let ((data '(a b c d))) + (equalp data + (ht->plist (ht<-plist data))))" + (apply 'append (ht-items table))) + +(defalias 'ht-to-plist 'ht->plist) + +(defun ht-copy (table) + "Return a shallow copy of TABLE (keys and values are shared)." + (copy-hash-table table)) + +(defun ht->alist (table) + "Return a list of two-element lists '(key . value) from TABLE. + +Note that hash tables are unordered, so this cannot be an exact +inverse of `ht<-alist'. The following is not guaranteed: + +\(let ((data '((a . b) (c . d)))) + (equalp data + (ht->alist (ht<-alist data))))" + (ht-amap (cons key value) table)) + +(defalias 'ht-to-alist 'ht->alist) + +(defalias 'ht? 'hash-table-p) + +(defalias 'ht-p 'hash-table-p) + +(defun ht-contains? (table key) + "Return 't if TABLE contains KEY." + (not (eq (ht-get table key 'ht--not-found) 'ht--not-found))) + +(defalias 'ht-contains-p 'ht-contains?) + +(defun ht-size (table) + "Return the actual number of entries in TABLE." + (hash-table-count table)) + +(defun ht-empty? (table) + "Return true if the actual number of entries in TABLE is zero." + (zerop (ht-size table))) + +(defun ht-select (function table) + "Return a hash table containing all entries in TABLE for which +FUNCTION returns a truthy value. + +FUNCTION is called with two arguments, KEY and VALUE." + (let ((results (ht-create))) + (ht-each + (lambda (key value) + (when (funcall function key value) + (ht-set! results key value))) + table) + results)) + +(defun ht-reject (function table) + "Return a hash table containing all entries in TABLE for which +FUNCTION returns a falsy value. + +FUNCTION is called with two arguments, KEY and VALUE." + (let ((results (ht-create))) + (ht-each + (lambda (key value) + (unless (funcall function key value) + (ht-set! results key value))) + table) + results)) + +(defun ht-reject! (function table) + "Delete entries from TABLE for which FUNCTION returns a falsy value. + +FUNCTION is called with two arguments, KEY and VALUE." + (ht-each + (lambda (key value) + (when (funcall function key value) + (remhash key table))) + table) + nil) + +(defalias 'ht-delete-if 'ht-reject!) + +(defun ht-find (function table) + "Return (key, value) from TABLE for which FUNCTION returns a truthy value. +Return nil otherwise. + +FUNCTION is called with two arguments, KEY and VALUE." + (catch 'break + (ht-each + (lambda (key value) + (when (funcall function key value) + (throw 'break (list key value)))) + table))) + +(provide 'ht) +;;; ht.el ends here diff --git a/emacs.d/core/libs/mocker.el b/emacs.d/core/libs/mocker.el new file mode 100644 index 0000000..c06080e --- /dev/null +++ b/emacs.d/core/libs/mocker.el @@ -0,0 +1,368 @@ +;;; mocker.el --- mocking framework for emacs + +;; Copyright (C) 2011 Yann Hodique. + +;; Author: Yann Hodique +;; Keywords: lisp, testing +;; Version: 0.3.0 +;; Package-Requires: ((eieio "1.3") (el-x "0.2.4")) + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; + +;;; Code: + +(eval-when-compile + (require 'cl)) + +(require 'eieio) + +(eval-and-compile + ;; use dflet from el-x if available + (if (require 'dflet nil t) + (defalias 'mocker-flet 'dflet) + ;; fallback to regular flet, hoping it's still there + (defalias 'mocker-flet 'flet))) + +(defvar mocker-mock-default-record-cls 'mocker-record) + +(put 'mocker-mock-error 'error-conditions '(mocker-mock-error error)) +(put 'mocker-mock-error 'error-message "Mocker mock error") + +(put 'mocker-record-error 'error-conditions '(mocker-record-error error)) +(put 'mocker-record-error 'error-message "Mocker record error") + +(defun mocker--plist-remove (plist key) + ;; courtesy of pjb + (if (eq (car plist) key) (cdr (cdr plist)) + (cons (car plist) + (cons (cadr plist) + (mocker--plist-remove (cddr plist) key))))) + +;;; Mock object +(defclass mocker-mock () + ((function :initarg :function :type symbol) + (orig-def :initarg :orig-def :initform nil) + (argspec :initarg :argspec :initform nil :type list) + (ordered :initarg :ordered :initform t) + (records :initarg :records :initform nil :type list))) + +(defmethod constructor :static ((mock mocker-mock) newname &rest args) + (let* ((obj (call-next-method)) + (recs (oref obj :records)) + (func (oref obj :function))) + (oset obj :orig-def (when (fboundp func) (symbol-function func))) + (oset obj :records nil) + (mapc #'(lambda (r) + (apply 'mocker-add-record obj r)) + recs) + obj)) + +(defmethod mocker-add-record ((mock mocker-mock) &rest args) + (object-add-to-list mock :records + (let ((cls mocker-mock-default-record-cls) + (tmp (plist-get args :record-cls))) + (when tmp + (setq cls tmp + args (mocker-read-record cls + (mocker--plist-remove + args :record-cls)))) + (apply 'make-instance cls :-mock mock + :-sym (make-symbol "unique") args)) + t)) + +(defmethod mocker-fail-mock ((mock mocker-mock) args) + (signal 'mocker-mock-error + (list (format (concat "Unexpected call to mock `%s'" + " with input `%s'") + (oref mock :function) args)))) + +(defvar mocker-inhibit nil) + +(defmethod mocker-run ((mock mocker-mock) &rest args) + (if (not mocker-inhibit) + (let* ((mocker-inhibit t) + (rec (mocker-find-active-record mock args)) + (ordered (oref mock :ordered))) + (cond ((null rec) + (mocker-fail-mock mock args)) + ((or (not ordered) (mocker-test-record rec args)) + (mocker-run-record rec args)) + (t + (mocker-fail-record rec args)))) + (apply (oref mock :orig-def) args))) + +(defmethod mocker-find-active-record ((mock mocker-mock) args) + (let ((first-match (lambda (pred seq) + (let ((x nil)) + (while (and seq + (not (setq x (funcall pred (pop seq)))))) + x)))) + (let* ((ordered (oref mock :ordered)) + rec) + (if ordered + (setq rec (funcall + first-match + #'(lambda (r) + (when (oref r :-active) + (if (mocker-test-record r args) + (progn + (mocker-use-record r) + r) + (mocker-skip-record r args)))) + (oref mock :records))) + (setq rec (funcall + first-match + #'(lambda (r) + (and + (oref r :-active) + (mocker-test-record r args) + (progn + (mocker-use-record r) + r))) + (oref mock :records)))) + rec))) + +(defmethod mocker-verify ((mock mocker-mock)) + (mapc #'(lambda (r) (when (and (oref r :-active) + (< (oref r :-occurrences) + (oref r :min-occur))) + (signal 'mocker-record-error + (list (format + (concat "Expected call to mock `%s'," + " with input like %s," + " was not run.") + (oref mock :function) + (mocker-get-record-expectations r)))))) + (oref mock :records))) + +;;; Mock record base object +(defclass mocker-record-base () + ((min-occur :initarg :min-occur :initform 1 :type number) + (max-occur :initarg :max-occur :initform nil :type (or null number)) + (-occur :initarg :occur :initform nil :type (or null number)) + (-occurrences :initarg :-occurrences :initform 0 :type number + :protection :protected) + (-mock :initarg :-mock) + (-active :initarg :-active :initform t :protection :protected) + (-sym :initarg :-sym))) + +(defmethod constructor :static ((rec mocker-record-base) newname &rest args) + (let* ((obj (call-next-method)) + (occur (oref obj :occur))) + (when occur + (oset obj :min-occur (max (oref obj :min-occur) + occur)) + (oset obj :max-occur (if (oref obj :max-occur) + (min (oref obj :max-occur) occur) + occur))) + obj)) + +(defmethod mocker-read-record :static ((rec mocker-record-base) spec) + spec) + +(defmethod mocker-use-record ((rec mocker-record-base)) + (let ((max (oref rec :max-occur)) + (n (1+ (oref rec :-occurrences)))) + (oset rec :-occurrences n) + (when (and (not (null max)) + (= n max)) + (oset rec :-active nil)))) + +(defmethod mocker-skip-record ((rec mocker-record-base) args) + (if (>= (oref rec :-occurrences) + (oref rec :min-occur)) + (oset rec :-active nil) + (mocker-fail-record rec args))) + +(defmethod mocker-test-record ((rec mocker-record-base) args) + (error "not implemented in base class")) + +(defmethod mocker-run-record ((rec mocker-record-base) args) + (error "not implemented in base class")) + +(defmethod mocker-get-record-expectations ((rec mocker-record-base))) + +(defmethod mocker-fail-record ((rec mocker-record-base) args) + (signal 'mocker-record-error + (list (format (concat "Violated record while mocking `%s'." + " Expected input like: %s, got: `%s' instead") + (oref (oref rec :-mock) :function) + (mocker-get-record-expectations rec) + args)))) + +;;; Mock input recognizer +(defclass mocker-input-record (mocker-record-base) + ((input :initarg :input :initform nil :type list) + (input-matcher :initarg :input-matcher :initform nil))) + +(defmethod constructor :static ((rec mocker-input-record) newname &rest args) + (let* ((obj (call-next-method))) + (when (or (not (slot-boundp obj :max-occur)) + (and (oref obj :max-occur) + (< (oref obj :max-occur) + (oref obj :min-occur)))) + (oset obj :max-occur (oref obj :min-occur))) + obj)) + +(defmethod mocker-test-record ((rec mocker-input-record) args) + (let ((matcher (oref rec :input-matcher)) + (input (oref rec :input))) + (cond (matcher + (apply matcher args)) + (t + (equal input args))))) + +(defmethod mocker-get-record-expectations ((rec mocker-input-record)) + (format "`%s'" (or (oref rec :input-matcher) (oref rec :input)))) + +;;; Mock record default object +(defclass mocker-record (mocker-input-record) + ((output :initarg :output :initform nil) + (output-generator :initarg :output-generator :initform nil))) + +(defmethod mocker-run-record ((rec mocker-record) args) + (let ((generator (oref rec :output-generator)) + (output (oref rec :output))) + (cond (generator + (apply generator args)) + (t + output)))) + +;;; Mock simple stub object +(defclass mocker-stub-record (mocker-record-base) + ((output :initarg :output :initform nil))) + +(defmethod constructor :static ((rec mocker-stub-record) newname &rest args) + (let* ((obj (call-next-method))) + (unless (slot-boundp obj :min-occur) + (oset obj :min-occur 0)) + (unless (slot-boundp obj :max-occur) + (oset obj :max-occur nil)) + obj)) + +(defmethod mocker-test-record ((rec mocker-stub-record) args) + t) + +(defmethod mocker-run-record ((rec mocker-stub-record) args) + (oref rec :output)) + +(defmethod mocker-get-record-expectations ((rec mocker-stub-record)) + "anything") + +;;; Mock passthrough record +(defclass mocker-passthrough-record (mocker-input-record) + ()) + +(defmethod mocker-run-record ((rec mocker-passthrough-record) args) + (let* ((mock (oref rec :-mock)) + (def (oref mock :orig-def))) + (when def + (apply def args)))) + +;;; Helpers +(defun mocker-gen-mocks (mockspecs) + "helper to generate mocks from the input of `mocker-let'" + (mapcar #'(lambda (m) + (let* ((func (car m)) + (argspec (cadr m)) + (rest (cddr m)) + (sym (make-symbol (concat (symbol-name func) "--mock")))) + (list sym + (apply 'make-instance 'mocker-mock + :function func + :argspec argspec + (let* ((order (if (plist-member rest :ordered) + (prog1 + (plist-get rest :ordered) + (setq rest + (mocker--plist-remove + rest :ordered))) + (oref-default 'mocker-mock + :ordered)))) + (list :ordered order))) + (if (plist-member rest :records) + (plist-get rest :records) + (car rest))))) + mockspecs)) + +;;;###autoload +(defmacro mocker-let (mockspecs &rest body) + "Generate temporary bindings according to MOCKSPECS then eval +BODY. The value of the last form in BODY is returned. +Each element of MOCKSPECS is a list (FUNC ARGS [OPTIONS] +RECORDS). + +FUNC is the name of the function to bind, whose original + definition must accept arguments compatible with ARGS. +OPTIONS can be :ordered nil if the records can be executed out of +order (by default, order is enforced). +RECORDS is a list ([:record-cls CLASS] ARG1 ARG2...). + +Each element of RECORDS will generate a record for the +corresponding mock. By default, records are objects of the +`mocker-record' class, but CLASS is used instead if specified. +The rest of the arguments are used to construct the record +object. They will be passed to method `mocker-read-record' for +the used CLASS. This method must return a valid list of +parameters for the CLASS constructor. This allows to implement +specialized mini-languages for specific record classes. +" + (declare (indent 1) (debug t)) + (let* ((mocks (mocker-gen-mocks mockspecs)) + (vars (mapcar #'(lambda (m) + `(,(car m) ,(cadr m))) + mocks)) + (specs (mapcar + #'(lambda (m) + (let* ((mock-sym (car m)) + (mock (cadr m)) + (func (oref mock :function)) + (spec (oref mock :argspec)) + (call (or (and (member '&rest spec) 'apply) + 'funcall)) + (args (loop for el in spec + if (or (not (symbolp el)) + (not (equal + (elt (symbol-name el) 0) + ?&))) + collect el))) + (list func + spec + `(,call #'mocker-run ,mock-sym ,@args)))) + mocks)) + (inits (mapcar #'(lambda (m) + (cons 'progn + (mapcar #'(lambda (rec) + `(mocker-add-record ,(car m) + ,@rec)) + (nth 2 m)))) + mocks)) + (verifs (mapcar #'(lambda (m) + `(mocker-verify ,(car m))) + mocks))) + `(let (,@vars) + ,@inits + (prog1 + ,(macroexpand `(mocker-flet (,@specs) + ,@body)) + ,@verifs)))) + +(provide 'mocker) +;;; mocker.el ends here diff --git a/emacs.d/core/libs/page-break-lines.el b/emacs.d/core/libs/page-break-lines.el new file mode 100644 index 0000000..c8b3b9a --- /dev/null +++ b/emacs.d/core/libs/page-break-lines.el @@ -0,0 +1,165 @@ +;;; page-break-lines.el --- Display ugly ^L page breaks as tidy horizontal lines + +;; Copyright (C) 2012-2015 Steve Purcell + +;; Author: Steve Purcell +;; URL: https://github.com/purcell/page-break-lines +;; Package-Version: 20160109.1813 +;; Package-X-Original-Version: DEV +;; Keywords: convenience, faces + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This library provides a global mode which displays form feed +;; characters as horizontal rules. + +;; Install from Melpa or Marmalade, or add to `load-path' and use +;; (require 'page-break-lines). + +;; Use `page-break-lines-mode' to enable the mode in specific buffers, +;; or customize `page-break-lines-modes' and enable the mode globally with +;; `global-page-break-lines-mode'. + +;; Issues and limitations: + +;; If `page-break-lines-char' is displayed at a different width to +;; regular characters, the rule may be either too short or too long: +;; rules may then wrap if `truncate-lines' is nil. On some systems, +;; Emacs may erroneously choose a different font for the page break +;; symbol, which choice can be overridden using code such as: + +;; (set-fontset-font "fontset-default" +;; (cons page-break-lines-char page-break-lines-char) +;; (face-attribute 'default :family)) + +;; Use `describe-char' on a page break char to determine whether this +;; is the case. + +;; Additionally, the use of `text-scale-increase' or +;; `text-scale-decrease' will cause the rule width to be incorrect, +;; because the reported window width (in characters) will continue to +;; be the width in the frame's default font, not the scaled font used to +;; display the rule. + +;; Adapted from code http://www.emacswiki.org/emacs/PageBreaks + +;;; Code: + +(defgroup page-break-lines nil + "Display ugly ^L page breaks as tidy horizontal lines." + :prefix "page-break-lines-" + :group 'faces) + +(defcustom page-break-lines-char ?─ + "Character used to render page break lines." + :type 'character + :group 'page-break-lines) + +(defcustom page-break-lines-lighter " PgLn" + "Mode-line indicator for `page-break-lines-mode'." + :type '(choice (const :tag "No lighter" "") string) + :group 'page-break-lines) + +(defcustom page-break-lines-modes + '(emacs-lisp-mode lisp-mode scheme-mode compilation-mode outline-mode help-mode) + "Modes in which to enable `page-break-lines-mode'." + :type '(repeat symbol) + :group 'page-break-lines) + +(defface page-break-lines + '((t :inherit font-lock-comment-face :bold nil :italic nil)) + "Face used to colorize page break lines. +If using :bold or :italic, please ensure `page-break-lines-char' +is available in that variant of your font, otherwise it may be +displayed as a junk character." + :group 'page-break-lines) + + + +;;;###autoload +(define-minor-mode page-break-lines-mode + "Toggle Page Break Lines mode. + +In Page Break mode, page breaks (^L characters) are displayed as a +horizontal line of `page-break-string-char' characters." + :lighter page-break-lines-lighter + :group 'page-break-lines + (page-break-lines--update-display-tables)) + +;;;###autoload +(defun turn-on-page-break-lines-mode () + "Enable `page-break-lines-mode' in this buffer." + (page-break-lines-mode 1)) + +;;;###autoload +(defun turn-off-page-break-lines-mode () + "Disable `page-break-lines-mode' in this buffer." + (page-break-lines-mode -1)) + + +(dolist (hook '(window-configuration-change-hook + after-setting-font-hook)) + (add-hook hook 'page-break-lines--update-display-tables)) + + + +(defun page-break-lines--update-display-table (window) + "Modify a display-table that displays page-breaks prettily. +If the buffer inside WINDOW has `page-break-lines-mode' enabled, +its display table will be modified as necessary." + (with-current-buffer (window-buffer window) + (if page-break-lines-mode + (progn + (unless buffer-display-table + (setq buffer-display-table (make-display-table))) + (let* ((width (- (window-width window) 1)) + (glyph (make-glyph-code page-break-lines-char 'page-break-lines)) + (new-display-entry (vconcat (make-list width glyph)))) + (unless (equal new-display-entry (elt buffer-display-table ?\^L)) + (aset buffer-display-table ?\^L new-display-entry)))) + (when buffer-display-table + (aset buffer-display-table ?\^L nil))))) + +(defun page-break-lines--update-display-tables () + "Function called for updating display table." + (mapc 'page-break-lines--update-display-table (window-list nil 'no-minibuffer))) + + + +;;;###autoload +(defun page-break-lines-mode-maybe () + "Enable `page-break-lines-mode' in the current buffer if desired. +When `major-mode' is listed in `page-break-lines-modes', then +`page-break-lines-mode' will be enabled." + (if (and (not (minibufferp)) + (apply 'derived-mode-p page-break-lines-modes)) + (page-break-lines-mode 1))) + +;;;###autoload +(define-global-minor-mode global-page-break-lines-mode + page-break-lines-mode page-break-lines-mode-maybe + :group 'page-break-lines) + + +(provide 'page-break-lines) + +;; Local Variables: +;; coding: utf-8 +;; byte-compile-warnings: (not cl-functions) +;; checkdoc-minor-mode: t +;; End: + +;;; page-break-lines.el ends here diff --git a/emacs.d/core/templates/.spacemacs.template b/emacs.d/core/templates/.spacemacs.template new file mode 100644 index 0000000..76d942e --- /dev/null +++ b/emacs.d/core/templates/.spacemacs.template @@ -0,0 +1,305 @@ +;; -*- mode: emacs-lisp -*- +;; This file is loaded by Spacemacs at startup. +;; It must be stored in your home directory. + +(defun dotspacemacs/layers () + "Configuration Layers declaration. +You should not put any user code in this function besides modifying the variable +values." + (setq-default + ;; Base distribution to use. This is a layer contained in the directory + ;; `+distribution'. For now available distributions are `spacemacs-base' + ;; or `spacemacs'. (default 'spacemacs) + dotspacemacs-distribution 'spacemacs + ;; Lazy installation of layers (i.e. layers are installed only when a file + ;; with a supported type is opened). Possible values are `all', `unused' + ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers + ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will + ;; lazy install any layer that support lazy installation even the layers + ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy + ;; installation feature and you have to explicitly list a layer in the + ;; variable `dotspacemacs-configuration-layers' to install it. + ;; (default 'unused) + dotspacemacs-enable-lazy-installation 'unused + ;; If non-nil then Spacemacs will ask for confirmation before installing + ;; a layer lazily. (default t) + dotspacemacs-ask-for-lazy-installation t + ;; If non-nil layers with lazy install support are lazy installed. + ;; List of additional paths where to look for configuration layers. + ;; Paths must have a trailing slash (i.e. `~/.mycontribs/') + dotspacemacs-configuration-layer-path '() + ;; List of configuration layers to load. + dotspacemacs-configuration-layers + '( + ;; ---------------------------------------------------------------- + ;; Example of useful layers you may want to use right away. + ;; Uncomment some layer names and press (Vim style) or + ;; (Emacs style) to install them. + ;; ---------------------------------------------------------------- + helm + ;; auto-completion + ;; better-defaults + emacs-lisp + ;; git + ;; markdown + ;; org + ;; (shell :variables + ;; shell-default-height 30 + ;; shell-default-position 'bottom) + ;; spell-checking + ;; syntax-checking + ;; version-control + ) + ;; List of additional packages that will be installed without being + ;; wrapped in a layer. If you need some configuration for these + ;; packages, then consider creating a layer. You can also put the + ;; configuration in `dotspacemacs/user-config'. + dotspacemacs-additional-packages '() + ;; A list of packages that cannot be updated. + dotspacemacs-frozen-packages '() + ;; A list of packages that will not be installed and loaded. + dotspacemacs-excluded-packages '() + ;; Defines the behaviour of Spacemacs when installing packages. + ;; Possible values are `used-only', `used-but-keep-unused' and `all'. + ;; `used-only' installs only explicitly used packages and uninstall any + ;; unused packages as well as their unused dependencies. + ;; `used-but-keep-unused' installs only the used packages but won't uninstall + ;; them if they become unused. `all' installs *all* packages supported by + ;; Spacemacs and never uninstall them. (default is `used-only') + dotspacemacs-install-packages 'used-only)) + +(defun dotspacemacs/init () + "Initialization function. +This function is called at the very startup of Spacemacs initialization +before layers configuration. +You should not put any user code in there besides modifying the variable +values." + ;; This setq-default sexp is an exhaustive list of all the supported + ;; spacemacs settings. + (setq-default + ;; If non nil ELPA repositories are contacted via HTTPS whenever it's + ;; possible. Set it to nil if you have no way to use HTTPS in your + ;; environment, otherwise it is strongly recommended to let it set to t. + ;; This variable has no effect if Emacs is launched with the parameter + ;; `--insecure' which forces the value of this variable to nil. + ;; (default t) + dotspacemacs-elpa-https t + ;; Maximum allowed time in seconds to contact an ELPA repository. + dotspacemacs-elpa-timeout 5 + ;; If non nil then spacemacs will check for updates at startup + ;; when the current branch is not `develop'. Note that checking for + ;; new versions works via git commands, thus it calls GitHub services + ;; whenever you start Emacs. (default nil) + dotspacemacs-check-for-update nil + ;; If non-nil, a form that evaluates to a package directory. For example, to + ;; use different package directories for different Emacs versions, set this + ;; to `emacs-version'. + dotspacemacs-elpa-subdirectory nil + ;; One of `vim', `emacs' or `hybrid'. + ;; `hybrid' is like `vim' except that `insert state' is replaced by the + ;; `hybrid state' with `emacs' key bindings. The value can also be a list + ;; with `:variables' keyword (similar to layers). Check the editing styles + ;; section of the documentation for details on available variables. + ;; (default 'vim) + dotspacemacs-editing-style 'vim + ;; If non nil output loading progress in `*Messages*' buffer. (default nil) + dotspacemacs-verbose-loading nil + ;; Specify the startup banner. Default value is `official', it displays + ;; the official spacemacs logo. An integer value is the index of text + ;; banner, `random' chooses a random text banner in `core/banners' + ;; directory. A string value must be a path to an image format supported + ;; by your Emacs build. + ;; If the value is nil then no banner is displayed. (default 'official) + dotspacemacs-startup-banner 'official + ;; List of items to show in startup buffer or an association list of + ;; the form `(list-type . list-size)`. If nil then it is disabled. + ;; Possible values for list-type are: + ;; `recents' `bookmarks' `projects' `agenda' `todos'." + ;; List sizes may be nil, in which case + ;; `spacemacs-buffer-startup-lists-length' takes effect. + dotspacemacs-startup-lists '((recents . 5) + (projects . 7)) + ;; True if the home buffer should respond to resize events. + dotspacemacs-startup-buffer-responsive t + ;; Default major mode of the scratch buffer (default `text-mode') + dotspacemacs-scratch-mode 'text-mode + ;; List of themes, the first of the list is loaded when spacemacs starts. + ;; Press T n to cycle to the next theme in the list (works great + ;; with 2 themes variants, one dark and one light) + dotspacemacs-themes '(spacemacs-dark + spacemacs-light) + ;; If non nil the cursor color matches the state color in GUI Emacs. + dotspacemacs-colorize-cursor-according-to-state t + ;; Default font, or prioritized list of fonts. `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" + ;; The key used for Emacs commands (M-x) (after pressing on the leader key). + ;; (default "SPC") + dotspacemacs-emacs-command-key "SPC" + ;; The key used for Vim Ex commands (default ":") + dotspacemacs-ex-command-key ":" + ;; The leader key accessible in `emacs state' and `insert state' + ;; (default "M-m") + dotspacemacs-emacs-leader-key "M-m" + ;; Major mode leader key is a shortcut key which is the equivalent of + ;; pressing ` m`. Set it to `nil` to disable it. (default ",") + dotspacemacs-major-mode-leader-key "," + ;; Major mode leader key accessible in `emacs state' and `insert state'. + ;; (default "C-M-m") + dotspacemacs-major-mode-emacs-leader-key "C-M-m" + ;; These variables control whether separate commands are bound in the GUI to + ;; the key pairs C-i, TAB and C-m, RET. + ;; Setting it to a non-nil value, allows for separate commands under + ;; and TAB or and RET. + ;; In the terminal, these pairs are generally indistinguishable, so this only + ;; works in the GUI. (default nil) + dotspacemacs-distinguish-gui-tab nil + ;; If non nil `Y' is remapped to `y$' in Evil states. (default nil) + dotspacemacs-remap-Y-to-y$ nil + ;; If non-nil, the shift mappings `<' and `>' retain visual state if used + ;; there. (default t) + dotspacemacs-retain-visual-state-on-shift t + ;; If non-nil, J and K move lines up and down when in visual mode. + ;; (default nil) + dotspacemacs-visual-line-move-text nil + ;; If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command. + ;; (default nil) + dotspacemacs-ex-substitute-global nil + ;; Name of the default layout (default "Default") + dotspacemacs-default-layout-name "Default" + ;; If non nil the default layout name is displayed in the mode-line. + ;; (default nil) + dotspacemacs-display-default-layout nil + ;; If non nil then the last auto saved layouts are resume automatically upon + ;; start. (default nil) + dotspacemacs-auto-resume-layouts nil + ;; Size (in MB) above which spacemacs will prompt to open the large file + ;; literally to avoid performance issues. Opening a file literally means that + ;; no major mode or minor modes are active. (default is 1) + dotspacemacs-large-file-size 1 + ;; Location where to auto-save files. Possible values are `original' to + ;; auto-save the file in-place, `cache' to auto-save the file to another + ;; file stored in the cache directory and `nil' to disable auto-saving. + ;; (default 'cache) + dotspacemacs-auto-save-file-location 'cache + ;; Maximum number of rollback slots to keep in the cache. (default 5) + dotspacemacs-max-rollback-slots 5 + ;; If non nil, `helm' will try to minimize the space it uses. (default nil) + dotspacemacs-helm-resize nil + ;; if non nil, the helm header is hidden when there is only one source. + ;; (default nil) + dotspacemacs-helm-no-header nil + ;; define the position to display `helm', options are `bottom', `top', + ;; `left', or `right'. (default 'bottom) + dotspacemacs-helm-position 'bottom + ;; Controls fuzzy matching in helm. If set to `always', force fuzzy matching + ;; in all non-asynchronous sources. If set to `source', preserve individual + ;; source settings. Else, disable fuzzy matching in all sources. + ;; (default 'always) + dotspacemacs-helm-use-fuzzy 'always + ;; If non nil the paste micro-state is enabled. When enabled pressing `p` + ;; several times cycle between the kill ring content. (default nil) + dotspacemacs-enable-paste-transient-state nil + ;; Which-key delay in seconds. The which-key buffer is the popup listing + ;; the commands bound to the current keystroke sequence. (default 0.4) + dotspacemacs-which-key-delay 0.4 + ;; Which-key frame position. Possible values are `right', `bottom' and + ;; `right-then-bottom'. right-then-bottom tries to display the frame to the + ;; right; if there is insufficient space it displays it at the bottom. + ;; (default 'bottom) + dotspacemacs-which-key-position 'bottom + ;; 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. (default t) + dotspacemacs-loading-progress-bar t + ;; If non nil the frame is fullscreen when Emacs starts up. (default nil) + ;; (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. (default nil) + 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. + ;; (default 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'. (default 90) + 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'. (default 90) + dotspacemacs-inactive-transparency 90 + ;; If non nil show the titles of transient states. (default t) + dotspacemacs-show-transient-state-title t + ;; If non nil show the color guide hint for transient state keys. (default t) + dotspacemacs-show-transient-state-color-guide t + ;; If non nil unicode symbols are displayed in the mode line. (default t) + 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 point + ;; when it reaches the top or bottom of the screen. (default t) + dotspacemacs-smooth-scrolling t + ;; If non nil line numbers are turned on in all `prog-mode' and `text-mode' + ;; derivatives. If set to `relative', also turns on relative line numbers. + ;; (default nil) + dotspacemacs-line-numbers nil + ;; Code folding method. Possible values are `evil' and `origami'. + ;; (default 'evil) + dotspacemacs-folding-method 'evil + ;; If non-nil smartparens-strict-mode will be enabled in programming modes. + ;; (default nil) + dotspacemacs-smartparens-strict-mode nil + ;; If non-nil pressing the closing parenthesis `)' key in insert mode passes + ;; over any automatically added closing parenthesis, bracket, quote, etc… + ;; This can be temporary disabled by pressing `C-q' before `)'. (default nil) + dotspacemacs-smart-closing-parenthesis nil + ;; Select a scope to highlight delimiters. Possible values are `any', + ;; `current', `all' or `nil'. Default is `all' (highlight any scope and + ;; emphasis the current one). (default 'all) + dotspacemacs-highlight-delimiters 'all + ;; If non nil, advise quit functions to keep server open when quitting. + ;; (default nil) + dotspacemacs-persistent-server nil + ;; List of search tool executable names. Spacemacs uses the first installed + ;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'. + ;; (default '("ag" "pt" "ack" "grep")) + dotspacemacs-search-tools '("ag" "pt" "ack" "grep") + ;; The default package repository used if no explicit repository has been + ;; specified with an installed package. + ;; Not used for now. (default nil) + dotspacemacs-default-package-repository nil + ;; Delete whitespace while saving buffer. Possible values are `all' + ;; to aggressively delete empty line and long sequences of whitespace, + ;; `trailing' to delete only the whitespace at end of lines, `changed'to + ;; delete only whitespace for changed lines or `nil' to disable cleanup. + ;; (default nil) + dotspacemacs-whitespace-cleanup nil + )) + +(defun dotspacemacs/user-init () + "Initialization function for user code. +It is called immediately after `dotspacemacs/init', before layer configuration +executes. + This function is mostly useful for variables that need to be set +before packages are loaded. If you are unsure, you should try in setting them in +`dotspacemacs/user-config' first." + ) + +(defun dotspacemacs/user-config () + "Configuration function for user code. +This function is called at the very end of Spacemacs initialization after +layers configuration. +This is the place where most of your configurations should be done. Unless it is +explicitly specified that a variable should be set before a package is loaded, +you should place your code here." + ) + +;; Do not write anything past this comment. This is where Emacs will +;; auto-generate custom variable definitions. diff --git a/emacs.d/core/templates/README.org.template b/emacs.d/core/templates/README.org.template new file mode 100644 index 0000000..c5cf7ba --- /dev/null +++ b/emacs.d/core/templates/README.org.template @@ -0,0 +1,30 @@ +#+TITLE: %LAYER_NAME% layer + +# The maximum height of the logo should be 200 pixels. +[[img/%LAYER_NAME%.png]] + +# TOC links should be GitHub style anchors. +* Table of Contents :TOC_4_gh:noexport: + - [[#decsription][Description]] + - [[#install][Install]] + - [[#key-bindings][Key bindings]] + +* Description +This layer does wonderful things: + - thing01 + +* Install +To use this configuration layer, add it to your =~/.spacemacs=. You will need to +add =%LAYER_NAME%= to the existing =dotspacemacs-configuration-layers= list in this +file. + +* Key bindings + +| Key Binding | Description | +|-------------+----------------| +| ~SPC x x x~ | Does thing01 | +# Use GitHub URLs if you wish to link a Spacemacs documentation file or its heading. +# Examples: +# [[https://github.com/syl20bnr/spacemacs/blob/master/doc/VIMUSERS.org#sessions]] +# [[https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Bfun/emoji/README.org][Link to Emoji layer README.org]] +# If space-doc-mode is enabled, Spacemacs will open a local copy of the linked file. diff --git a/emacs.d/core/templates/REPORTING.template b/emacs.d/core/templates/REPORTING.template new file mode 100644 index 0000000..5b0be96 --- /dev/null +++ b/emacs.d/core/templates/REPORTING.template @@ -0,0 +1,21 @@ +<> +#### Description :octocat: +<> + +#### Reproduction guide :beetle: +- Start Emacs +- <> + +*Observed behaviour:* :eyes: :broken_heart: +<> + +*Expected behaviour:* :heart: :smile: +<> + +(%LAST_KEYS%) +%SYSTEM_INFO% + +#### Backtrace :paw_prints: +``` +%BACKTRACE% +``` diff --git a/emacs.d/core/templates/packages.el.template b/emacs.d/core/templates/packages.el.template new file mode 100644 index 0000000..af6bce2 --- /dev/null +++ b/emacs.d/core/templates/packages.el.template @@ -0,0 +1,62 @@ +;;; packages.el --- %LAYER_NAME% layer packages file for Spacemacs. +;; +;; Copyright (c) 2012-2016 Sylvain Benner & Contributors +;; +;; Author: %USER_FULL_NAME% <%USER_MAIL_ADDRESS%> +;; URL: https://github.com/syl20bnr/spacemacs +;; +;; This file is not part of GNU Emacs. +;; +;;; License: GPLv3 + +;;; Commentary: + +;; See the Spacemacs documentation and FAQs for instructions on how to implement +;; a new layer: +;; +;; SPC h SPC layers RET +;; +;; +;; Briefly, each package to be installed or configured by this layer should be +;; added to `%LAYER_NAME%-packages'. Then, for each package PACKAGE: +;; +;; - If PACKAGE is not referenced by any other Spacemacs layer, define a +;; function `%LAYER_NAME%/init-PACKAGE' to load and initialize the package. + +;; - Otherwise, PACKAGE is already referenced by another Spacemacs layer, so +;; define the functions `%LAYER_NAME%/pre-init-PACKAGE' and/or +;; `%LAYER_NAME%/post-init-PACKAGE' to customize the package as it is loaded. + +;;; Code: + +(defconst %LAYER_NAME%-packages + '() + "The list of Lisp packages required by the %LAYER_NAME% layer. + +Each entry is either: + +1. A symbol, which is interpreted as a package to be installed, or + +2. A list of the form (PACKAGE KEYS...), where PACKAGE is the + name of the package to be installed or loaded, and KEYS are + any number of keyword-value-pairs. + + The following keys are accepted: + + - :excluded (t or nil): Prevent the package from being loaded + if value is non-nil + + - :location: Specify a custom installation location. + The following values are legal: + + - The symbol `elpa' (default) means PACKAGE will be + installed using the Emacs package manager. + + - The symbol `local' directs Spacemacs to load the file at + `./local/PACKAGE/PACKAGE.el' + + - A list beginning with the symbol `recipe' is a melpa + recipe. See: https://github.com/milkypostman/melpa#recipe-format") + + +;;; packages.el ends here diff --git a/emacs.d/core/tools/spacefmt/spacefmt b/emacs.d/core/tools/spacefmt/spacefmt new file mode 100755 index 0000000..de742c0 --- /dev/null +++ b/emacs.d/core/tools/spacefmt/spacefmt @@ -0,0 +1,77 @@ +#!/bin/bash +# ---------------------------------------------------------------------- +# Formatting/Migration tool for Spacemacs +# ---------------------------------------------------------------------- +# +# Authors: Eugene Yaremenko and Sylvain Benner +# +# Arguments: +# $1: action name can be `all`, `doc`, `config` +# `doc` formats documentation files +# `config` format configuration files +# `all` performs all actions +# $2: if equal to `test` then use test files as input + +# TODO a function to add headers to config.el, packages.el etc... + +if ! [ -d "./.git" ] +then + echo "Should be executed from the repo root." + exit 1 +fi + +#Use "sed" or "gsed" if avaliable. +seder="sed" +if hash gsed 2>/dev/null; then + seder="gsed" +fi + +#Use md5 or md5sum +mdfive="md5sum" +if hash md5 2>/dev/null; then + mdfive="md5" +fi + + +if [[ $2 = "test" ]] +then + places=("./core/tools/spacefmt/tests") +else + places=("./doc" "./layers") +fi + +for place in "${places[@]}" +do : + before_md5="foo" + after_md5="bar" + while ! [ "$before_md5" = "$after_md5" ] + do + # Calculate md5 of the files in $place before formating + before_md5=$(find $place -type f -exec $mdfive {} \; | sort -k 2 | $mdfive) + + if [ $1 = "all" ] || [ $1 == "doc" ] + then + # Remove trailing delimiters in headlines + find $place -name "*.org" -type f -exec $seder -i 's/^\(*\+\s\+.*\)[;,.]$/\1/g' {} \; + # Remove trailing spaces + find $place -name "*.org" -type f -exec $seder -i 's/[ \t]*$//' {} \; + # Remove #+HTML_HEAD_EXTRA: ... readtheorg.css" /> + find $place -name "*.org" -type f -exec $seder -i '/#+HTML_HEAD_EXTRA.*readtheorg.css.*/d' {} \; + # Replace multiply empty lines with a single empty line + find $place -name "*.org" -type f -exec $seder -i '/^$/N;/^\n$/D' {} \; + # Replace :TOC_4_org: with :TOC_4_gh: + find $place -name "*.org" -type f -exec $seder -i 's/:TOC_4_org:/:TOC_4_gh:/' {} \; + # apply toc-org + find $place -name "*.org" -type f -exec emacs -batch -l ./core/tools/spacefmt/spacefmt.el '{}' -f apply-all \; + fi + + if [ $1 = "all" ] || [ $1 == "config" ] + then + # migrate packages lists to config.el + find $place -name "packages.el" -type f -exec emacs -batch -l ./core/tools/spacefmt/spacefmt.el '{}' -f move-packages-to-config \; + fi + + # Calculate md5 of the files in $place after formating + after_md5=$(find $place -type f -exec $mdfive {} \; | sort -k 2 | $mdfive) + done +done diff --git a/emacs.d/core/tools/spacefmt/spacefmt.el b/emacs.d/core/tools/spacefmt/spacefmt.el new file mode 100644 index 0000000..cb3ea0a --- /dev/null +++ b/emacs.d/core/tools/spacefmt/spacefmt.el @@ -0,0 +1,169 @@ +;;; fmt.el --- .org file formatter. +;; +;; 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 + + +(load-file "./core/tools/spacefmt/toc-org.el") + +(require 'cl) +(require 'files) +(require 'org) +(require 'thingatpt) + +(defconst empty-line-regexp "^[ \t]*$") + +(defconst toc-heading-head "* Table of Contents") +(defconst toc-heading-tail ":TOC_4_gh:noexport:") +(defconst toc-headline (format "%-41s%s" + toc-heading-head + toc-heading-tail)) + +(defun apply-all () + "Apply all filters." + (remove-empty-lines-at-the-beginning) + (insert-title) + (insert-toc) + (apply-toc) + (remove-empty-lines-after-headlines) + ;; Multiply empty lines are handled by + ;; the bash script. + (insert-empty-line-before-tables) + (insert-empty-line-after-tables) + (insert-empty-line-after-sections) + (insert-empty-line-at-the-end) + (align-tables) + (save-buffer 0)) + +(defun remove-empty-lines-at-the-beginning () + "Remove empty lines at the begging of the buffer." + (goto-char (point-min)) + (while (looking-at-p empty-line-regexp) + (delete-blank-lines))) + +(defun insert-empty-line-at-the-end () + "Insert an empty line at the end of the buffer." + (goto-char (point-max)) + (unless (looking-at-p empty-line-regexp) + (open-line 1))) + +(defun insert-title() + "Insert #TITLE:{DIR_NAME} if the buffer doesn't have one." + (goto-char (point-min)) + (unless (looking-at-p "^#\\+TITLE:.*$") + (insert (format "#+TITLE:%s\n" + (clj/->> (buffer-file-name) + file-name-directory + directory-file-name + file-name-base))))) + +(defun insert-toc () + "Insert toc if the buffer doesn't have one." + (goto-char (point-min)) + (unless (re-search-forward toc-org-toc-org-regexp nil t) + (goto-char (point-max)) + ;; Skip from the end of the buffer to the first headling. + (while (re-search-backward org-heading-regexp nil t)) + (open-line 3) + (forward-line 1) + (insert-string toc-headline))) + +(defun remove-empty-lines-after-headlines() + "Remove empty liners after each headline." + (goto-char (point-min)) + (while (re-search-forward org-heading-regexp nil t) + (unless (= (forward-line) 0) + (while (looking-at-p empty-line-regexp) + (delete-blank-lines))))) + +(defun insert-empty-line-before-tables () + "Insert an empty line before each org table." + (goto-char (point-min)) + (while (goto-next-table) + (forward-line -1) + (unless (looking-at-p empty-line-regexp) + (end-of-line) + (open-line 1)) + (forward-line 1))) + +(defun insert-empty-line-after-sections () + "Insert an empty line after each section." + (goto-char (point-min)) + (while (re-search-forward org-heading-regexp nil t) + (forward-line -1) + (unless (or (looking-at-p empty-line-regexp) + (looking-at-p org-heading-regexp)) + (end-of-line) + (open-line 1)) + (forward-line 2))) + +(defun insert-empty-line-after-tables () + "Insert an empty line after each table." + (goto-char (point-min)) + (while (goto-next-table) + ;; Skip current table. + (while (looking-at-p org-table-any-line-regexp) + (forward-line)) + (unless (looking-at-p empty-line-regexp) + (beginning-of-line) + (open-line 1) + (forward-line)))) + +(defun align-tables () + "Align all tables" + (goto-char (point-min)) + (while (goto-next-table) + (org-table-align))) + +(defun apply-toc () + "Apply current toc-org TAG to TOC." + (goto-char (point-min)) + (toc-org-insert-toc)) + +(defun goto-next-table () + "Goto next org table. +Returns nil if no more tables left." + ;; Skip current table. + (while (looking-at-p org-table-any-line-regexp) + (forward-line)) + ;; Skip to the next table. + (when (re-search-forward org-table-hline-regexp nil t) + (forward-line -1 ))) + +(defun move-packages-to-config () + "Move xxx-packages list to config.el." + (let ((config-file (concat default-directory "config.el"))) + (when (or (re-search-forward "(setq.*-packages" nil t) + (re-search-forward "(defcustom.*-packages" nil t)) + (re-search-backward "(") + (kill-sexp) + (with-current-buffer (find-file-noselect config-file) + (when (file-exists-p config-file) + (re-search-forward ";;; License: GPLv3") + (newline) + (forward-line 2)) + (yank) + ;; config.el + (save-buffer 0)) + ;; packages.el + (save-buffer 0)))) + +(defmacro clj/->> (o &rest forms) + "Threads the expr through the forms. +Inserts o as the last item in the first form, +making a list of it if it is not a list already. +If there are more forms, inserts the first form +as the last item in second form, etc." + (cond ((not forms) o) + ((= 1 (length forms)) + (let ((f (first forms))) + (append (if (symbolp f) + (list f) f) + (list o)))) + (:else `(clj/->> (clj/->> ,o ,(first forms)) ,@(rest forms))))) diff --git a/emacs.d/core/tools/spacefmt/tests/config.el b/emacs.d/core/tools/spacefmt/tests/config.el new file mode 100644 index 0000000..4bc681b --- /dev/null +++ b/emacs.d/core/tools/spacefmt/tests/config.el @@ -0,0 +1,7 @@ +;;; packages.el --- test layer configuration file for Spacemacs. +;; +;; Copyright (c) 2012-2016 Sylvain Benner & Contributors +;; +;; This file is not part of GNU Emacs. +;; +;;; License: GPLv3 diff --git a/emacs.d/core/tools/spacefmt/tests/packages.el b/emacs.d/core/tools/spacefmt/tests/packages.el new file mode 100644 index 0000000..f2f74de --- /dev/null +++ b/emacs.d/core/tools/spacefmt/tests/packages.el @@ -0,0 +1,9 @@ +;; Test file for packages.el formatting and migrations + +(setq mylayer-packages + '( + package1 + package2 + package3 + package4 + )) diff --git a/emacs.d/core/tools/spacefmt/tests/test.org b/emacs.d/core/tools/spacefmt/tests/test.org new file mode 100644 index 0000000..851f05c --- /dev/null +++ b/emacs.d/core/tools/spacefmt/tests/test.org @@ -0,0 +1,28 @@ + + + +#+HTML_HEAD_EXTRA: + + +* Links, +[[https://github.com/syl20bnr/spacemacs/blob/master/doc/FAQ.org#os-x][Link to FAQ "OS X" heading]] +[[https://www.google.com][Link to www.google.com]] +[[https://github.com/syl20bnr/spacemacs/blob/master/doc/VIMUSERS.org#sessions]] +[[https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Bfun/emoji/README.org][Link to Emoji layer README.org]] +* FOO; +| Key Binding | Description | +|-------------+--------------------------------------------| + | ~SPC m d~ | lookup thing at point in lua documentation | +| ~SPC m s b~ | send buffer contents to REPL | +| ~SPC m s f~ | send current function to REPL | +| ~SPC m s l~ | send current line to REPL | +| ~SPC m s r~ | send current region to REPL | +=========================================================================== +** Org: +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed conseq +* BAR +** SUBBAR ; , . +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed conseq +* BAZ +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed conseq +* FOOBAZ diff --git a/emacs.d/core/tools/spacefmt/toc-org.el b/emacs.d/core/tools/spacefmt/toc-org.el new file mode 100644 index 0000000..30bb306 --- /dev/null +++ b/emacs.d/core/tools/spacefmt/toc-org.el @@ -0,0 +1,409 @@ +;;; toc-org.el --- add table of contents to org-mode files (formerly, org-toc) + +;; Copyright (C) 2014 Sergei Nosov + +;; Author: Sergei Nosov +;; Version: 1.0 +;; Keywords: org-mode org-toc toc-org org toc table of contents +;; URL: https://github.com/snosov1/toc-org + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; toc-org helps you to have an up-to-date table of contents in org files +;; without exporting (useful primarily for readme files on GitHub). + +;; NOTE: Previous name of the package is org-toc. It was changed because of a +;; name conflict with one of the org contrib modules. + +;; After installation put into your .emacs file something like + +;; (if (require 'toc-org nil t) +;; (add-hook 'org-mode-hook 'toc-org-enable) +;; (warn "toc-org not found")) + +;; And every time you'll be saving an org file, the first headline with a :TOC: +;; tag will be updated with the current table of contents. + +;; For details, see https://github.com/snosov1/toc-org + +;;; Code: + +(require 'ert) +(require 'org) + +(defgroup toc-org nil + "toc-org is a utility to have an up-to-date table of contents +in the org files without exporting (useful primarily for readme +files on GitHub)" + :group 'org) + +;; just in case, simple regexp "^*.*:toc:\\($\\|[^ ]*:$\\)" +(defconst toc-org-toc-org-regexp "^*.*:toc\\([@_][0-9]\\|\\([@_][0-9][@_][a-zA-Z]+\\)\\)?:\\($\\|[^ ]*:$\\)" + "Regexp to find the heading with the :toc: tag") +(defconst toc-org-tags-regexp "\s*:[[:word:]:@]*:\s*$" + "Regexp to find tags on the line") +(defconst toc-org-states-regexp "^*+\s+\\(TODO\s+\\|DONE\s+\\)" + "Regexp to find states on the line") +(defconst toc-org-links-regexp "\\[\\[\\(.*?\\)\\]\\[\\(.*?\\)\\]\\]" + "Regexp to find states on the line") +(defconst toc-org-special-chars-regexp "[^[:alnum:]_-]" + "Regexp with the special characters (which are omitted in hrefs + by GitHub)") + +(defcustom toc-org-max-depth 2 + "Maximum depth of the headings to use in the table of +contents. The default of 2 uses only the highest level headings +and their subheadings (one and two stars)." + :group 'toc-org) + +(defcustom toc-org-hrefify-default "gh" + "Default hrefify function to use." + :group 'toc-org) + +(defcustom toc-org-enable-links-opening t + "With this option, org-open-at-point (C-c C-o) should work on +the TOC links (even if the style is different from org)." + :group 'toc-org) + +(defvar-local toc-org-hrefify-hash nil + "Buffer local hash-table that is used to enable links +opening. The keys are hrefified headings, the values are original +headings.") + +(defun toc-org-raw-toc () + "Return the \"raw\" table of contents of the current file, +i.e. simply flush everything that's not a heading and strip +tags." + (let ((content (buffer-substring-no-properties + (point-min) (point-max)))) + (with-temp-buffer + (insert content) + (goto-char (point-min)) + (keep-lines "^\*+[ ]") + + ;; don't include the TOC itself + (goto-char (point-min)) + (re-search-forward toc-org-toc-org-regexp nil t) + (beginning-of-line) + (delete-region (point) (progn (forward-line 1) (point))) + + ;; strip states + (goto-char (point-min)) + (while (re-search-forward toc-org-states-regexp nil t) + (replace-match "" nil nil nil 1)) + + ;; strip tags + ;; TODO :export: and :noexport: tags semantic should be probably + ;; implemented + (goto-char (point-min)) + (while (re-search-forward toc-org-tags-regexp nil t) + (replace-match "" nil nil)) + + ;; flatten links + (goto-char (point-min)) + (while (re-search-forward toc-org-links-regexp nil t) + (replace-match "\\2" nil nil)) + + (buffer-substring-no-properties + (point-min) (point-max))))) + +(ert-deftest toc-org-test-raw-toc () + "Test the `toc-org-raw-toc' function" + + (defun toc-org-test-raw-toc-gold-test (content gold) + (should (equal + (with-temp-buffer + (insert content) + (toc-org-raw-toc)) + gold))) + (declare-function toc-org-test-raw-toc-gold-test "toc-org") ;; suppress compiler warning + + (let ((beg "* TODO [[http://somewhere.com][About]]\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an up-to-date table of contents in the\norg files without exporting (useful primarily for readme files on\nGitHub).\n\nIt is similar to the [[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works for org files.\n:TOC:\n drawer\n:END:\n\n* Table of Contents ") + (gold "* About\n")) + + ;; different TOC styles + (toc-org-test-raw-toc-gold-test (concat beg ":TOC:" ) gold) + (toc-org-test-raw-toc-gold-test (concat beg ":TOC_1:" ) gold) + (toc-org-test-raw-toc-gold-test (concat beg ":TOC_1_qqq:" ) gold) + (toc-org-test-raw-toc-gold-test (concat beg ":TOC@1:" ) gold) + (toc-org-test-raw-toc-gold-test (concat beg ":TOC@1@cxv:" ) gold) + (toc-org-test-raw-toc-gold-test (concat beg ":TOC@1_hello:" ) gold) + + ;; trailing symbols + (toc-org-test-raw-toc-gold-test (concat beg ":TOC@1_hello:" "\n\n\n") gold) + (toc-org-test-raw-toc-gold-test (concat beg ":TOC@1_hello:" "\n\n\nsdfd") gold)) + + ;; more complex case + (toc-org-test-raw-toc-gold-test + "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an up-to-date table of contents in the\norg files without exporting (useful primarily for readme files on\nGitHub).\n\nIt is similar to the [[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works for org files.\n:TOC:\n drawer\n:END:\n\n* Table of Contents :TOC:\n - [[#about][About]]\n - [[#use][Use]]\n - [[#different-href-styles][Different href styles]]\n - [[#example][Example]]\n\n* Installation\n** via package.el\nThis is the simplest method if you have the package.el module\n(built-in since Emacs 24.1) you can simply use =M-x package-install=\nand then put the following snippet in your ~/.emacs file\n#+BEGIN_SRC elisp\n (eval-after-load \"toc-org-autoloads\"\n '(progn\n (if (require 'toc-org nil t)\n (add-hook 'org-mode-hook 'toc-org-enable)\n (warn \"toc-org not found\"))))\n#+END_SRC\n** Manual :Hello:\n- Create folder ~/.emacs.d if you don't have it\n- Go to it and clone toc-org there\n #+BEGIN_SRC sh\n git clone https://github.com/snosov1/toc-org.git\n #+END_SRC\n- Put this in your ~/.emacs file\n #+BEGIN_SRC elisp\n (add-to-list 'load-path \"~/.emacs.d/toc-org\")\n (when (require 'toc-org nil t)\n (add-hook 'org-mode-hook 'toc-org-enable))\n #+END_SRC\n\n* Use\n\nAfter the installation, every time you'll be saving an org file, the\nfirst headline with a :TOC: tag will be updated with the current table\nof contents.\n\nTo add a TOC tag, you can use the command =org-set-tags-command=.\n\nIn addition to the simple :TOC: tag, you can also use the following\ntag formats:\n\n- :TOC@2: - sets the max depth of the headlines in the table of\n contents to 2 (the default)\n\n- :TOC@2@gh: - sets the max depth as in above and also uses the\n GitHub-style hrefs in the table of contents (the default). The other\n supported href style is 'org', which is the default org style (you\n can use C-c C-o to go to the headline at point).\n\nYou can also use =_= as separator, instead of =@=.\n\n* Different href styles\n\nCurrently, only 2 href styles are supported: =gh= and =org=. You can easily\ndefine your own styles. If you use the tag =:TOC@2@STYLE:= (=STYLE= being a\nstyle name), then the package will look for a function named\n=toc-org-hrefify-STYLE=, which accepts a heading string and returns a href\ncorresponding to that heading.\n\nE.g. for =org= style it simply returns input as is:\n\n#+BEGIN_SRC emacs-lisp\n (defun toc-org-hrefify-org (str)\n \"Given a heading, transform it into a href using the org-mode\n rules.\"\n str)\n#+END_SRC\n\n* Example\n\n#+BEGIN_SRC org\n * About\n * Table of Contents :TOC:\n - [[#about][About]]\n - [[#installation][Installation]]\n - [[#via-packageel][via package.el]]\n - [[#manual][Manual]]\n - [[#use][Use]]\n * Installation\n ** via package.el\n ** Manual\n * Use\n * Example\n#+END_SRC\n" + "* About\n* Installation\n** via package.el\n** Manual\n* Use\n* Different href styles\n* Example\n")) + +(defun toc-org-hrefify-gh (str) + "Given a heading, transform it into a href using the GitHub +rules." + (let* ((spc-fix (replace-regexp-in-string " " "-" str)) + (upcase-fix (replace-regexp-in-string "[A-Z]" 'downcase spc-fix t)) + (special-chars-fix (replace-regexp-in-string toc-org-special-chars-regexp "" upcase-fix t))) + (concat "#" special-chars-fix))) + +(ert-deftest toc-org-test-hrefify-gh () + "Test the `toc-org-hrefify-gh' function" + (should (equal (toc-org-hrefify-gh "About") "#about")) + (should (equal (toc-org-hrefify-gh "!h@#$%^&*(){}|][:;\"'/?.>,<`~") "#h")) + (should (equal (toc-org-hrefify-gh "!h@#$% ^&*(S){}|][:;\"'/?.>,<`~") "#h-s"))) + +(defun toc-org-hrefify-org (str) + "Given a heading, transform it into a href using the org-mode +rules." + str) + +(defun toc-org-unhrefify (type path) + "Looks for a value in toc-org-hrefify-hash using path as a key." + (let ((ret-type type) + (ret-path path) + (original-path (and (not (eq toc-org-hrefify-hash nil)) + (gethash + (concat + ;; Org 8.3 and above provides type as "custom-id" + ;; and strips the leading hash symbol + (if (equal type "custom-id") "#" "") + (substring-no-properties path)) + toc-org-hrefify-hash + nil)))) + (when toc-org-enable-links-opening + (when original-path + ;; Org 8.2 and below provides type as "thisfile" + (when (equal type "thisfile") + (setq ret-path original-path)) + (when (equal type "custom-id") + (setq ret-type "fuzzy") + (setq ret-path original-path)))) + (cons ret-type ret-path))) + +(defun toc-org-hrefify-toc (toc hrefify &optional hash) + "Format the raw `toc' using the `hrefify' function to transform +each heading into a link." + (with-temp-buffer + (insert toc) + (goto-char (point-min)) + + (while + (progn + (when (looking-at "\\*") + (delete-char 1) + + (while (looking-at "\\*") + (delete-char 1) + (insert (make-string + (+ 2 (or (bound-and-true-p org-list-indent-offset) 0)) + ?\s))) + + (skip-chars-forward " ") + (insert "- ") + + (let* ((beg (point)) + (end (line-end-position)) + (heading (buffer-substring-no-properties + beg end)) + (hrefified (funcall hrefify heading))) + (insert "[[") + (insert hrefified) + (insert "][") + (end-of-line) + (insert "]]") + + ;; maintain the hash table, if provided + (when hash + (puthash hrefified heading hash))) + (= 0 (forward-line 1))))) + + (buffer-substring-no-properties + (point-min) (point-max)))) + +(ert-deftest toc-org-test-hrefify-toc () + (let ((hash (make-hash-table :test 'equal))) + (should (equal (toc-org-hrefify-toc "* About\n" 'upcase hash) + " - [[ABOUT][About]]\n")) + (should (equal (gethash "ABOUT" hash) "About"))) + (let ((hash (make-hash-table :test 'equal))) + (should (equal (toc-org-hrefify-toc "* About\n* Installation\n** via package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 'upcase hash) + " - [[ABOUT][About]]\n - [[INSTALLATION][Installation]]\n - [[VIA PACKAGE.EL][via package.el]]\n - [[MANUAL][Manual]]\n - [[USE][Use]]\n - [[DIFFERENT HREF STYLES][Different href styles]]\n - [[EXAMPLE][Example]]\n")) + (should (equal (gethash "ABOUT" hash) "About")) + (should (equal (gethash "INSTALLATION" hash) "Installation")) + (should (equal (gethash "VIA PACKAGE.EL" hash) "via package.el")) + (should (equal (gethash "MANUAL" hash) "Manual")) + (should (equal (gethash "USE" hash) "Use")) + (should (equal (gethash "DIFFERENT HREF STYLES" hash) "Different href styles")) + (should (equal (gethash "EXAMPLE" hash) "Example")))) + +(defun toc-org-flush-subheadings (toc max-depth) + "Flush subheadings of the raw `toc' deeper than `max-depth'." + (with-temp-buffer + (insert toc) + (goto-char (point-min)) + + (let ((re "^")) + (dotimes (i (1+ max-depth)) + (setq re (concat re "\\*"))) + (flush-lines re)) + + (buffer-substring-no-properties + (point-min) (point-max)))) + +(ert-deftest toc-org-test-flush-subheadings () + (should (equal (toc-org-flush-subheadings "* About\n" 0) + "")) + (should (equal (toc-org-flush-subheadings "* About\n" 1) + "* About\n")) + (should (equal (toc-org-flush-subheadings "* About\n" 2) + "* About\n")) + + (should (equal (toc-org-flush-subheadings "* About\n* Installation\n** via package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 0) + "")) + (should (equal (toc-org-flush-subheadings "* About\n* Installation\n** via package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 1) + "* About\n* Installation\n* Use\n* Different href styles\n* Example\n")) + (should (equal (toc-org-flush-subheadings "* About\n* Installation\n** via package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 2) + "* About\n* Installation\n** via package.el\n** Manual\n* Use\n* Different href styles\n* Example\n")) + (should (equal (toc-org-flush-subheadings "* About\n* Installation\n** via package.el\n** Manual\n* Use\n* Different href styles\n* Example\n" 3) + "* About\n* Installation\n** via package.el\n** Manual\n* Use\n* Different href styles\n* Example\n"))) + +(defun toc-org-insert-toc (&optional dry-run) + "Looks for a headline with the TOC tag and updates it with the +current table of contents. + +If optional second argument DRY-RUN is provided, then the buffer +is not modified at all. Only the internal hash-table is updated +to enable `org-open-at-point' for TOC links. + +To add a TOC tag, you can use the command +`org-set-tags-command' (C-c C-q). + +In addition to the simple :TOC: tag, you can also use the +following tag formats: + +- :TOC_2: - sets the max depth of the headlines in the table of + contents to 2 (the default) + +- :TOC_2_gh: - sets the max depth as in above and also uses the + GitHub-style hrefs in the table of contents (this style is + default). The other supported href style is 'org', which is the + default org style." + + (interactive) + (when (eq major-mode 'org-mode) + (save-excursion + (goto-char (point-min)) + (let ((case-fold-search t)) + ;; find the first heading with the :TOC: tag + (when (re-search-forward toc-org-toc-org-regexp (point-max) t) + (let* ((tag (match-string 1)) + (depth (if tag + (- (aref tag 1) ?0) ;; is there a better way to convert char to number? + toc-org-max-depth)) + (hrefify-tag (if (and tag (>= (length tag) 4)) + (downcase (substring tag 3)) + toc-org-hrefify-default)) + (hrefify-string (concat "toc-org-hrefify-" hrefify-tag)) + (hrefify (intern-soft hrefify-string))) + (if hrefify + (let ((new-toc + (toc-org-hrefify-toc + (toc-org-flush-subheadings (toc-org-raw-toc) depth) + hrefify + (when toc-org-hrefify-hash + (clrhash toc-org-hrefify-hash))))) + (unless dry-run + (newline (forward-line 1)) + + ;; insert newline if TOC is currently empty + (when (looking-at "^\\*") + (open-line 1)) + + ;; find TOC boundaries + (let ((beg (point)) + (end + (save-excursion + (when (search-forward-regexp "^\\*" (point-max) t) + (forward-line -1)) + (end-of-line) + (point)))) + ;; update the TOC, but only if it's actually different + ;; from the current one + (unless (equal + (buffer-substring-no-properties beg end) + new-toc) + (delete-region beg end) + (insert new-toc))))) + (message (concat "Hrefify function " hrefify-string " is not found"))))))))) + +;;;###autoload +(defun toc-org-enable () + "Enable toc-org in this buffer." + (add-hook 'before-save-hook 'toc-org-insert-toc nil t) + + ;; conservatively set org-link-translation-function + (when (and (equal toc-org-enable-links-opening t) + (or + (not (fboundp org-link-translation-function)) + (equal org-link-translation-function 'toc-org-unhrefify))) + (setq toc-org-hrefify-hash (make-hash-table :test 'equal)) + (setq org-link-translation-function 'toc-org-unhrefify) + (toc-org-insert-toc t))) + +(ert-deftest toc-org-test-insert-toc () + "Test the `toc-org-insert-toc' function" + + (defun toc-org-test-insert-toc-gold-test (content gold) + (with-temp-buffer + (org-mode) + (insert content) + (toc-org-raw-toc) + (toc-org-insert-toc) + (should (equal + (buffer-substring-no-properties + (point-min) (point-max)) + gold)))) + (declare-function toc-org-test-insert-toc-gold-test "toc-org") ;; suppress compiler warning + + (let ((beg "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an up-to-date table of contents in the\norg files without exporting (useful primarily for readme files on\nGitHub).\n\nIt is similar to the [[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n* Table of Contents ")) + (toc-org-test-insert-toc-gold-test + (concat beg ":TOC:") + "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an up-to-date table of contents in the\norg files without exporting (useful primarily for readme files on\nGitHub).\n\nIt is similar to the [[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n* Table of Contents :TOC:\n - [[#about][About]]\n - [[#hello][Hello]]\n - [[#good-bye][Good-bye]]\n") + + (toc-org-test-insert-toc-gold-test + (concat beg ":TOC_1:") + "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an up-to-date table of contents in the\norg files without exporting (useful primarily for readme files on\nGitHub).\n\nIt is similar to the [[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n* Table of Contents :TOC_1:\n - [[#about][About]]\n - [[#hello][Hello]]\n") + + (toc-org-test-insert-toc-gold-test + (concat beg ":TOC_3:") + "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an up-to-date table of contents in the\norg files without exporting (useful primarily for readme files on\nGitHub).\n\nIt is similar to the [[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n* Table of Contents :TOC_3:\n - [[#about][About]]\n - [[#hello][Hello]]\n - [[#good-bye][Good-bye]]\n - [[#salut][Salut]]\n") + + (toc-org-test-insert-toc-gold-test + (concat beg ":TOC_1_org:") + "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an up-to-date table of contents in the\norg files without exporting (useful primarily for readme files on\nGitHub).\n\nIt is similar to the [[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n* Table of Contents :TOC_1_org:\n - [[About][About]]\n - [[Hello][Hello]]\n") + + (toc-org-test-insert-toc-gold-test + (concat beg ":TOC_3_org:") + "* About\n:TOC:\n drawer\n:END:\n\ntoc-org is a utility to have an up-to-date table of contents in the\norg files without exporting (useful primarily for readme files on\nGitHub).\n\nIt is similar to the [[https://github.com/ardumont/markdown-toc][markdown-toc]] package, but works for org files.\n:TOC:\n drawer\n:END:\n* Hello\n** Good-bye\n*** Salut\n* Table of Contents :TOC_3_org:\n - [[About][About]]\n - [[Hello][Hello]]\n - [[Good-bye][Good-bye]]\n - [[Salut][Salut]]\n"))) + +;; Local Variables: +;; compile-command: "emacs -batch -l ert -l *.el -f ert-run-tests-batch-and-exit && emacs -batch -f batch-byte-compile *.el 2>&1 | sed -n '/Warning\|Error/p' | xargs -r ls" +;; End: + +(provide 'toc-org) +;;; toc-org.el ends here diff --git a/emacs.d/doc/CONVENTIONS.org b/emacs.d/doc/CONVENTIONS.org new file mode 100644 index 0000000..76cfc4f --- /dev/null +++ b/emacs.d/doc/CONVENTIONS.org @@ -0,0 +1,376 @@ +#+TITLE: Spacemacs Conventions + +* Spacemacs conventions :TOC_4_gh:noexport: + - [[#code-guidelines][Code guidelines]] + - [[#spacemacs-core-and-layer][Spacemacs core and layer]] + - [[#all-layers][All layers]] + - [[#use-package][Use-package]] + - [[#key-bindings-conventions][Key bindings conventions]] + - [[#reserved-prefix][Reserved prefix]] + - [[#user-prefix][User prefix]] + - [[#major-mode-prefix][Major mode prefix]] + - [[#transient-state][Transient-state]] + - [[#evilified-buffers][Evilified buffers]] + - [[#navigation][Navigation]] + - [[#n-and-n][n and N]] + - [[#code-navigation][Code Navigation]] + - [[#insert-state-buffers][=insert state= buffers]] + - [[#confirm-and-abort][Confirm and Abort]] + - [[#evaluation][Evaluation]] + - [[#repls][REPLs]] + - [[#send-code][Send code]] + - [[#in-terminal][In terminal]] + - [[#building-and-compilation][Building and Compilation]] + - [[#debugging][Debugging]] + - [[#plain-text-markup-languages][Plain Text Markup Languages]] + - [[#headers][Headers]] + - [[#insertion-of-common-elements][Insertion of common elements]] + - [[#text-manipulation][Text manipulation]] + - [[#movement-in-normal-mode][Movement in normal mode]] + - [[#promotion-demotion-and-element-movement][Promotion, Demotion and element movement]] + - [[#table-editing][Table editing]] + - [[#tests][Tests]] + - [[#all-languages][All languages]] + - [[#language-specific][Language specific]] + - [[#toggles][Toggles]] + - [[#refactoring][Refactoring]] + - [[#code-formatting][Code Formatting]] + - [[#help-or-documentation][Help or Documentation]] + - [[#writing-documentation][Writing documentation]] + - [[#spacing-in-documentation][Spacing in documentation]] + +* Code guidelines +** Spacemacs core and layer +Function names follow these conventions: + - =spacemacs/xxx= is an interactive function called =xxx= + - =spacemacs//xxx= is a private function called =xxx= (implementation details) + - =spacemacs|xxx= is a /macro/ called =xxx= + +Variables follow these conventions: + - =spacemacs-xxx= is a variable + - =spacemacs--xxx= is a private variable (implementation details) + +** All layers +A package is initialized in a function with name =/init-xxx= where: + - == is the layer name + - =xxx= is the package name + +** Use-package +- Always use =progn= when a code block requires multiple lines for =:init= or + =:config= keywords. +- If there is only one line of code then try to keep =:init= or =:config= + keywords on the same line. +- Don't nest multiple =use-package= calls unless you have a very good reason + to do it. + +* Key bindings conventions +** Reserved prefix +*** User prefix +~SPC o~ and ~SPC m o~ must not be used by any layer. They are reserved for the +user. + +*** Major mode prefix +~SPC m~ is reserved for the current major mode. Three keys bindings are not an +issue (ie. ~SPC m h d~) since ~SPC m~ can be accessed via ~​,​~. + +*** Transient-state +Whenever possible a transient-state should be enabled with ~M-SPC~ and ~s-M-SPC~. We +need the latter bindings on OS X since ~M-SPC~ is used by the OS for spotlight. + +For instance transient-states dedicated to special buffers like =helm= or =ido= +buffers are good candidates to be put on ~M-SPC~ and ~s-M-SPC~. + +It is recommended to add ~q~ to leave the transient-state. + +** Evilified buffers +/Evilifying/ a buffer is to set the =evilified state= as the default +state for the major mode of the buffer. + +The =evilified state= is derived from the =emacs state= and modify the +map to: +- add ~hjkl~ navigation +- add scrolling feature on ~C-f~, ~C-b~, ~C-d~ and ~C-u~ +- ~G~ and ~gg~ to go to the end and beginning of the buffer +- add incremental search with ~/~, ~n~ and ~N~ +- enabling =evil-ex= on ~:~ +- add =visual state= and =visual line state= on ~v~ and ~V~ +- add yank on ~y~ _in visual state only_ +- activate evil-leader key on ~SPC~ + +Setting the =evilified state= to a mode is done by calling the macro +=spacemacs|evilify-map=. + +/Evilification/ rebinds shadowed key bindings according to the following +rules: +- alphabetic key bindings: ~x~ -> ~X~ -> ~C-x~ -> ~C-X~ +- ~SPC~ -> ~​'​~ +- ~/~ -> ~\~ +- ~:~ -> ~|~ +- ~C-g~ cannot be shadowed + +If a key binding cannot be remapped then it is ignored and a warning message +is displayed in =*Messages*=. + +** Navigation +*** n and N +To be consistent with the Vim way, ~n~ and ~N~ are favored over Emacs ~n~ and +~p~. + +Ideally a transient-state should be provided to smooth the navigation +experience. A transient-state allows to repeat key bindings without entering +each time the prefix commands. More info on transient-states in the +[[file:DOCUMENTATION.org::Transient-states][documentation]]. + +*** Code Navigation +The prefix for going to something is ~SPC m g~. + +| Key | Description | +|---------+-------------------------------------------------| +| ~m g a~ | go to alternate file (i.e. =.h <--> .cpp=) | +| ~m g b~ | go back to previous location (before last jump) | +| ~m g g~ | go to things under point | +| ~m g G~ | go to things under point in other window | +| ~m g t~ | go to corresponding test file if any | + +*** =insert state= buffers +Navigation in buffers like =Helm= and =ido= which are in =insert state= +should be performed with ~C-j~ and ~C-k~ bindings for vertical movements. + +| Key | Description | +|-------+-------------| +| ~C-j~ | go down | +| ~C-k~ | go up | + +** Confirm and Abort +Confirming and aborting actions which are bound to ~C-c C-c~ and ~C-c C-k~ +in raw Emacs are mirrored in Spacemacs to: + +| Key | Description | +|-------------------------+---------------------------| +| ~SPC m ​,​~ and ~SPC m c~ | Valid/Confirm the message | +| ~SPC m a~ and ~SPC m k~ | Abort/Discard the message | + +Some example of these modes are =magit= commit messages, =message-mode= for +mails or =org-mode= notes. + +** Evaluation +Live evaluation of code is under the prefix ~SPC m e~. + +| Key | Description | +|---------+-----------------------------------------------| +| ~m e $~ | put point at the end of the line and evaluate | +| ~m e b~ | evaluate buffer | +| ~m e e~ | evaluate last expression | +| ~m e f~ | evaluate function | +| ~m e l~ | evaluate line | +| ~m e r~ | evaluate region | + +** REPLs +*** Send code +A lot of languages can interact with a REPL. To help keeping a +consistent behavior between those languages the following conventions +should be followed: + - ~SPC m s~ is the prefix for sending code. This allows fast interaction with + the REPL whenever it is possible + - lower case key bindings keep the focus on the current buffer + - upper case key bindings move the focus to the REPL buffer + +| Key | Description | +|---------+--------------------------------------------------------------| +| ~m s b~ | send buffer | +| ~m s B~ | send buffer and switch to REPL | +| ~m s d~ | first key to send buffer and switch to REPL to debug (step) | +| ~m s D~ | second key to send buffer and switch to REPL to debug (step) | +| ~m s f~ | send function | +| ~m s F~ | send function and switch to REPL | +| ~m s i~ | start/switch to REPL inferior process | +| ~m s l~ | send line | +| ~m s L~ | send line and switch to REPL | +| ~m s r~ | send region | +| ~m s R~ | send region and switch to REPL | + +Note: we don't distinguish between the file and the buffer. + +*** In terminal +History navigation in shells or REPLs buffers should be bound as well to +~C-j~ and ~C-k~. + + | Key | Description | + |-------+----------------------------| + | ~C-j~ | next item in history | + | ~C-k~ | previous item in history | + | ~C-l~ | clear screen | + | ~C-r~ | search backward in history | + +** Building and Compilation +The base prefix for major mode specific compilation is ~SPC m c~. + + | Key Binding | Description | + |-------------+-------------------| + | ~m c b~ | compile buffer | + | ~m c c~ | compile | + | ~m c r~ | clean and compile | + +Note: we don't distinguish between the file and the buffer. We can +implement an auto-save of the buffer before compiling the buffer. + +** Debugging +The base prefix for debugging commands is ~SPC d~. + +| Key Binding | Description | +|-------------+-------------------------| +| ~m d a~ | abandon current process | +| ~m d b~ | toggle a breakpoint | +| ~m d B~ | clear all breakpoints | +| ~m d c~ | continue | +| ~m d d~ | start debug session | +| ~m d i~ | inspect value at point | +| ~m d l~ | local variables | +| ~m d n~ | next | +| ~m d r~ | run | +| ~m d s~ | step | + +Notes: + - Ideally a transient-state for breakpoint navigation should be provided. + - If there is no toggle breakpoint function, then it should be implemented at + the spacemacs level and ideally the function should be proposed as a patch + upstream (major mode repository). + +** Plain Text Markup Languages +For layers supporting markup languages please follow the following +keybindings whenever applicable. + +*** Headers +All header functionality should be grouped under ~SPC m h~ + +| Key Binding | Description | +|-------------+--------------------------------------------------| +| ~m h i~ | Insert a header | +| ~m h I~ | Insert a header alternative method (if existing) | +| ~m h 1..10~ | Insert a header of level 1..10 (if possible) | + +*** Insertion of common elements +Insertion of common elements like links or footnotes should be grouped +under ~SPC m i~ + +| Key Binding | Description | +|-------------+------------------| +| ~m i f~ | Insert footnote | +| ~m i i~ | Insert image | +| ~m i l~ | Insert link | +| ~m i u~ | Insert url | +| ~m i w~ | Insert wiki-link | + +*** Text manipulation +Manipulation of text regions should be grouped under ~SPC m x~ + +| Key Binding | Description | +|-------------+-------------------------------| +| ~m x b~ | Make region bold | +| ~m x c~ | Make region code | +| ~m x i~ | Make region italic | +| ~m x q~ | Quote a region | +| ~m x r~ | Remove formatting from region | +| ~m x s~ | Make region strike-through | +| ~m x u~ | Make region underlined | +| ~m x v~ | Make region verbose | + +*** Movement in normal mode +In normal mode Vim style movement should be enabled with these keybindings: + +| Key Binding | Description | +|-------------+----------------------------------------| +| ~g h~ | Move up one level in headings | +| ~g j~ | Move to next heading on same level | +| ~g k~ | Move to previous heading on same level | +| ~g l~ | Move down one level in headings | + +*** Promotion, Demotion and element movement +Promotion, demotion and movement of headings or list elements (whatever is +possible) should be enabled with the following keys in any mode + +| Key Binding | Description | +|-------------+------------------------------| +| ~M-h~ | Promote heading by one level | +| ~M-j~ | Move element down | +| ~M-k~ | Move element up | +| ~M-l~ | Demote heading by one level | + +*** Table editing +If table specific commands are available the they are grouped under the +~SPC m t~ group. + +** Tests +A lot of languages have their own test frameworks. These frameworks +share common actions that we can unite under the same key bindings: + - ~SPC m t~ is the prefix for test execution. + - ~SPC m t X~ is used to execute ~SPC m t x~ but in debug mode (if supported). + +*** All languages + +| Key | Description | +|---------+--------------------------------------------------------------| +| ~m t a~ | execute all the tests of the current project | +| ~m t A~ | execute all the tests of the current project in debug | +| ~m t b~ | execute all the tests of the current buffer | +| ~m t B~ | execute all the tests of the current buffer in debug | +| ~m t t~ | execute the current test (thing at point, function) | +| ~m t T~ | execute the current test in debug (thing at point, function) | + +Note: we don't distinguish between the file and the buffer. We can +implement an auto-save of the buffer before executing the tests of +buffer. + +*** Language specific + +| Key | Description | +|---------+--------------------------------------------------| +| ~m t m~ | execute the tests of the current module | +| ~m t M~ | execute the tests of the current module in debug | +| ~m t s~ | execute the tests of the current suite | +| ~m t S~ | execute the tests of the current suite in debug | + +Note that there are overlaps, depending on the language we will choose +one or more bindings for the same thing + +** Toggles +- Global toggles are under ~SPC t~, ~SPC T~ and ~SPC C-t~ +- Major mode toggles are only under ~SPC m T~ + +** Refactoring +Refactoring prefix is ~SPC m r~. + +** Code Formatting +Major-mode code formatting is under prefix ~SPC m =~. + +| Key Binding | Description | +|-------------+--------------------------| +| ~m = =~ | format thing under point | +| ~m = b~ | format current buffer | +| ~m = f~ | format current function | + +** Help or Documentation +The base prefix for help commands is ~SPC h~. Documentation is considered +as an help command. + +| Key | Description | +|---------+------------------------------------| +| ~m h h~ | documentation of thing under point | +| ~m h r~ | documentation of selected region | + +* Writing documentation +Spacemacs provides an example layer =README.org= file in +=~/.emacs.d/core/templates/README.org.template=. + +** Spacing in documentation +- Spacemacs tries to keep the documentation consistent between all layers by + providing some rules for spacing: + - After each header, you should not add an empty line + - *Exception*: If the first item under the header is a table, add an empty + line after it + - At the end of each header node, there should be an empty line + - Note: Many layer =READMEs= do not follow this convention yet. Please fix + them if you can. + +- To keep things readable only mention the prefix ~SPC~ when documenting + key bindings, you don't need to mention ~M-m~. diff --git a/emacs.d/doc/DOCUMENTATION.org b/emacs.d/doc/DOCUMENTATION.org new file mode 100644 index 0000000..7e4d4b6 --- /dev/null +++ b/emacs.d/doc/DOCUMENTATION.org @@ -0,0 +1,3258 @@ +#+TITLE: Spacemacs documentation + +* Spacemacs documentation :TOC_4_gh:noexport: + - [[#core-pillars][Core Pillars]] + - [[#mnemonic][Mnemonic]] + - [[#discoverable][Discoverable]] + - [[#consistent][Consistent]] + - [[#crowd-configured][Crowd-Configured]] + - [[#highlighted-feature][Highlighted feature]] + - [[#screenshots][Screenshots]] + - [[#who-can-benefit-from-this][Who can benefit from this?]] + - [[#update-and-rollback][Update and Rollback]] + - [[#update-spacemacs-repository][Update Spacemacs repository]] + - [[#automatic-updates][Automatic Updates]] + - [[#updating-from-the-spacemacs-buffer][Updating from the Spacemacs Buffer]] + - [[#updating-manually-with-git][Updating Manually with git]] + - [[#update-packages][Update packages]] + - [[#configuration-layers][Configuration layers]] + - [[#purpose][Purpose]] + - [[#structure][Structure]] + - [[#configure-packages][Configure packages]] + - [[#with-a-layer][With a layer]] + - [[#declaration][Declaration]] + - [[#initialization][Initialization]] + - [[#exclusion][Exclusion]] + - [[#without-a-layer][Without a layer]] + - [[#packages-synchronization][Packages synchronization]] + - [[#types-of-configuration-layers][Types of configuration layers]] + - [[#submitting-a-configuration-layer-upstream][Submitting a configuration layer upstream]] + - [[#example-themes-megapack-example][Example: Themes Megapack example]] + - [[#managing-private-configuration-layers][Managing private configuration layers]] + - [[#using-the-private-directory][Using the private directory]] + - [[#using-an-external-git-repository][Using an external Git repository]] + - [[#using-a-personal-branch][Using a personal branch]] + - [[#tips-for-writing-layers][Tips for writing layers]] + - [[#dotfile-configuration][Dotfile Configuration]] + - [[#dotfile-installation][Dotfile Installation]] + - [[#alternative-dotdirectory][Alternative dotdirectory]] + - [[#synchronization-of-dotfile-changes][Synchronization of dotfile changes]] + - [[#testing-the-dotfile][Testing the dotfile]] + - [[#dotfile-contents][Dotfile Contents]] + - [[#configuration-functions][Configuration functions]] + - [[#custom-variables][Custom variables]] + - [[#declaring-configuration-layers][Declaring Configuration layers]] + - [[#setting-configuration-layers-variables][Setting configuration layers variables]] + - [[#disabling-layer-services-in-other-layers][Disabling layer services in other layers]] + - [[#selectingignoring-packages-of-a-layer][Selecting/Ignoring packages of a layer]] + - [[#excluding-packages][Excluding packages]] + - [[#concepts][Concepts]] + - [[#editing-styles][Editing Styles]] + - [[#vim][Vim]] + - [[#emacs][Emacs]] + - [[#hybrid][Hybrid]] + - [[#states][States]] + - [[#evilified-modes][Evilified modes]] + - [[#evil-leader][Evil leader]] + - [[#universal-argument][Universal argument]] + - [[#transient-states][Transient-states]] + - [[#differences-between-vim-evil-and-spacemacs][Differences between Vim, Evil and Spacemacs]] + - [[#the-vim-surround-case][The vim-surround case]] + - [[#evil-plugins][Evil plugins]] + - [[#binding-keys][Binding keys]] + - [[#gui-elements][GUI Elements]] + - [[#color-themes][Color themes]] + - [[#font][Font]] + - [[#gui-toggles][GUI Toggles]] + - [[#global-line-numbers][Global line numbers]] + - [[#mode-line][Mode-line]] + - [[#powerline-font-installation-for-terminal-mode-users][Powerline font installation for terminal-mode users]] + - [[#flycheck-integration][Flycheck integration]] + - [[#anzu-integration][Anzu integration]] + - [[#battery-status-integration][Battery status integration]] + - [[#powerline-separators][Powerline separators]] + - [[#minor-modes][Minor Modes]] + - [[#customizing-the-mode-line][Customizing the mode-line]] + - [[#layouts-and-workspaces][Layouts and workspaces]] + - [[#layouts][Layouts]] + - [[#the-default-layout][The default layout]] + - [[#project-layouts][Project layouts]] + - [[#custom-layouts][Custom Layouts]] + - [[#saveload-layouts-into-a-file][Save/Load layouts into a file]] + - [[#layout-key-bindings][Layout key bindings]] + - [[#workspaces][Workspaces]] + - [[#workspace-key-bindings][Workspace key bindings]] + - [[#commands][Commands]] + - [[#vim-key-bindings][Vim key bindings]] + - [[#escaping][Escaping]] + - [[#executing-vim-and-emacs-exm-x-commands][Executing Vim and Emacs ex/M-x commands]] + - [[#leader-key][Leader key]] + - [[#additional-text-objects][Additional text objects]] + - [[#reserved-prefix-command-for-user][Reserved prefix command for user]] + - [[#completion][Completion]] + - [[#helm][Helm]] + - [[#c-z-and-tab-switch][C-z and Tab switch]] + - [[#helm-focus][Helm focus]] + - [[#helm-transient-state][Helm transient state]] + - [[#discovering][Discovering]] + - [[#key-bindings][Key bindings]] + - [[#which-key][Which-key]] + - [[#helm-describe-key-bindings][Helm describe key bindings]] + - [[#getting-help][Getting help]] + - [[#available-layers][Available layers]] + - [[#available-packages-in-spacemacs][Available packages in Spacemacs]] + - [[#new-packages-from-elpa-repositories][New packages from ELPA repositories]] + - [[#toggles][Toggles]] + - [[#navigating][Navigating]] + - [[#pointcursor][Point/Cursor]] + - [[#smooth-scrolling][Smooth scrolling]] + - [[#vim-motions-with-avy][Vim motions with avy]] + - [[#ace-link-mode][ace-link mode]] + - [[#unimpaired-bindings][Unimpaired bindings]] + - [[#jumping-joining-and-splitting][Jumping, Joining and Splitting]] + - [[#jumping][Jumping]] + - [[#joining-and-splitting][Joining and splitting]] + - [[#window-manipulation][Window manipulation]] + - [[#window-manipulation-key-bindings][Window manipulation key bindings]] + - [[#window-manipulation-transient-state][Window manipulation transient state]] + - [[#golden-ratio][Golden ratio]] + - [[#buffers-and-files][Buffers and Files]] + - [[#buffers-manipulation-key-bindings][Buffers manipulation key bindings]] + - [[#buffers-manipulation-transient-state][Buffers manipulation transient state]] + - [[#special-buffers][Special Buffers]] + - [[#files-manipulations-key-bindings][Files manipulations key bindings]] + - [[#emacs-and-spacemacs-files][Emacs and Spacemacs files]] + - [[#browsing-files-with-helm][Browsing files with Helm]] + - [[#ido][Ido]] + - [[#ido-transient-state][Ido transient state]] + - [[#neotree-file-tree][NeoTree file tree]] + - [[#neotree-navigation][NeoTree navigation]] + - [[#opening-files-with-neotree][Opening files with NeoTree]] + - [[#other-neotree-key-bindings][Other NeoTree key bindings]] + - [[#neotree-mode-line][NeoTree mode-line]] + - [[#neotree-source-control-integration][NeoTree Source Control Integration]] + - [[#neotree-theme][NeoTree Theme]] + - [[#bookmarks][Bookmarks]] + - [[#docview-mode][DocView mode]] + - [[#auto-saving][Auto-saving]] + - [[#frequency-of-auto-saving][Frequency of auto-saving]] + - [[#location-of-auto-saved-files][Location of auto-saved files]] + - [[#disable-auto-save][Disable auto-save]] + - [[#searching][Searching]] + - [[#with-an-external-tool][With an external tool]] + - [[#useful-key-bindings][Useful key bindings]] + - [[#searching-in-current-file][Searching in current file]] + - [[#searching-in-all-open-buffers-visiting-files][Searching in all open buffers visiting files]] + - [[#searching-in-files-in-an-arbitrary-directory][Searching in files in an arbitrary directory]] + - [[#searching-in-a-project][Searching in a project]] + - [[#searching-the-web][Searching the web]] + - [[#persistent-highlighting][Persistent highlighting]] + - [[#highlight-current-symbol][Highlight current symbol]] + - [[#visual-star][Visual Star]] + - [[#listing-symbols-by-semantic][Listing symbols by semantic]] + - [[#helm-swoop][Helm-swoop]] + - [[#editing][Editing]] + - [[#paste-text][Paste text]] + - [[#paste-transient-state][Paste Transient-state]] + - [[#auto-indent-pasted-text][Auto-indent pasted text]] + - [[#text-manipulation-commands][Text manipulation commands]] + - [[#text-insertion-commands][Text insertion commands]] + - [[#smartparens-strict-mode][Smartparens Strict mode]] + - [[#zooming][Zooming]] + - [[#text][Text]] + - [[#frame][Frame]] + - [[#increasedecrease-numbers][Increase/Decrease numbers]] + - [[#spell-checking][Spell checking]] + - [[#region-selection][Region selection]] + - [[#expand-region][Expand-region]] + - [[#indent-text-object][Indent text object]] + - [[#region-narrowing][Region narrowing]] + - [[#replacing-text-with-iedit][Replacing text with iedit]] + - [[#iedit-states-key-bindings][iedit states key bindings]] + - [[#examples][Examples]] + - [[#replacing-text-in-several-files][Replacing text in several files]] + - [[#renaming-files-in-a-directory][Renaming files in a directory]] + - [[#commenting][Commenting]] + - [[#regular-expressions][Regular expressions]] + - [[#deleting-files][Deleting files]] + - [[#editing-lisp-code][Editing Lisp code]] + - [[#lisp-key-bindings][Lisp Key Bindings]] + - [[#mouse-usage][Mouse usage]] + - [[#managing-projects][Managing projects]] + - [[#registers][Registers]] + - [[#errors-handling][Errors handling]] + - [[#compiling][Compiling]] + - [[#modes][Modes]] + - [[#major-mode-leader-key][Major Mode leader key]] + - [[#helm-1][Helm]] + - [[#emacs-server][Emacs Server]] + - [[#connecting-to-the-emacs-server][Connecting to the Emacs server]] + - [[#keeping-the-server-alive][Keeping the server alive]] + - [[#troubleshoot][Troubleshoot]] + - [[#loading-fails][Loading fails]] + - [[#upgradingdowngrading-emacs-version][Upgrading/Downgrading Emacs version]] + - [[#achievements][Achievements]] + - [[#issues][Issues]] + - [[#merged-pull-requests][Merged Pull Requests]] + - [[#stars-forks-and-watchers][Stars, forks and watchers]] + - [[#gitter-chat][Gitter chat]] + - [[#first-times][First times]] + - [[#special-mentions][Special Mentions]] + - [[#special-titles][Special Titles]] + - [[#thank-you][Thank you]] + +* Core Pillars +Four core pillars: Mnemonic, Discoverable, Consistent and "Crowd-Configured". + +If any of these core pillars is violated open an issue and we'll try our best +to fix it. + +** Mnemonic +Key bindings are organized using mnemonic prefixes like ~b~ for buffer, ~p~ for +project, ~s~ for search, ~h~ for help, etc... + +** Discoverable +Innovative real-time display of available key bindings. Simple query +system to quickly find available layers, packages, and more. + +** Consistent +Similar functionalities have the same key binding everywhere thanks to a +clearly defined set of conventions. Documentation is mandatory for any layer +that ships with Spacemacs. + +** Crowd-Configured +Community-driven configuration provides curated packages tuned by power users +and bugs are fixed quickly. + +* Highlighted feature +- *Bring the efficiency of modal editing* to the powerful Emacs lisp platform. + Modal UX is optional and Spacemacs can be used with only Emacs key bindings. + +- Integrate nicely with =Evil= states (=Vim= modes). + +- *Keep your fingers on the home row* for quicker editing with support for + QWERTY and BEPO layouts. + +- *Minimalistic and nice graphical UI* keeps your available screen space for + what matters: your text files. + +- *Fast boot time*: packages and configuration are lazy-loaded as much as + possible. + +- *Lower the risk of RSI* by heavily using the space bar instead of modifiers. + If you have issues with your thumbs you can still use Spacemacs using + modifiers. + +- Contribute easily your improvements and new configuration layers. + +- *Very active and helpful community* on =Gitter= and =IRC= + (via Gitter IRC bridge) + +* Screenshots + +[[file:img/spacemacs-python.png]] +/Python/ + +*Note*: Even though screenshots are updated frequently, Spacemacs is evolving +quickly and the screenshots may not reflect exactly the current state of the +project. + +* Who can benefit from this? +- Spacemacs was initially intended to be used by *Vim users* who want to go to + the next level by using Emacs (see [[./VIMUSERS.org][guide]] for Vimmers). But it is now + perfectly *usable by non Vim users* by choosing the =emacs= editing style. + +- It is also a good fit for people wanting to *lower the [[http://en.wikipedia.org/wiki/Repetitive_strain_injury][risk of RSI]]* induced by + the default Emacs key bindings. (This is an assumption, there are no official + studies to prove this!) If you have issues using your thumbs you can still + use the =emacs= editing style which puts the leader key on a modifier + combination. + +- Emacs users wanting to learn *a different way to edit files* or wanting to + learn Vim key bindings or even wanting to mix both editing styles by setting + their style to =hybrid=. + +- Emacs users wanting a simple but deep configuration system that greatly + *lower the risk of .emacs bankruptcy*. + +- *Pair-programming* users thanks to out of the box support for dynamic + switching of editing style. A Vim user and an Emacs user can use the same + Spacemacs comfortably. + +* Update and Rollback +** Update Spacemacs repository +There are several methods of updating the core files and layer information for +Spacemacs. It is recommended to update the packages first; see the next section. + +*** Automatic Updates +Spacemacs will automatically check for a new version every startup. When it +detects that a new version is available an arrow will appear in the modeline. +Click it to update Spacemacs. You must restart Emacs after updating. +[[file:img/powerline-update.png]] +/Update Button/ + +*Note*: If you use the =develop= branch of Spacemacs, automatic update is +disabled---you have to update manually using git. + +*** Updating from the Spacemacs Buffer +Use the button labeled "Update Spacemacs" in the Spacemacs buffer. You will be +prompted for the version you would like to use. + +*Note*: If you use the =develop= branch of Spacemacs, you cannot use this method. + +*** Updating Manually with git +To update manually close Emacs and update the git repository: + +#+BEGIN_SRC sh +$ git pull origin master +#+END_SRC + +*Note*: The master branch is considered to be immutable in the sense that you +must not modify it by adding your own commit. If you do so you will break the +automatic update of Spacemacs on the master branch. To fork Spacemacs code you +have to use a custom branch that you manage manually. + +** Update packages +To update the Emacs packages used by Spacemacs press RET (enter) or click on the +link =[Update Packages]= in the startup page under the banner then restart +Emacs. If you prefer, you can use the command +=configuration-layer/update-packages= instead of the button. + +If anything goes wrong you should be able to rollback the update by pressing +~RET~ or clicking on the =[Rollback Package Update]= link in the startup page +and choosing a rollback slot (sorted by date). This button uses the command +=configuration-layer/rollback=. + +* Configuration layers +This section is an overview of layers. A more extensive introduction to writing +configuration layers can be found [[file:LAYERS.org][here]] (recommended reading!). + +** Purpose +Layers help collect related packages together to provide features. For example, +the =python= layer provides auto-completion, syntax checking, and REPL support +for python files. This approach helps keep configuration organized and reduces +overhead for the user by keeping them from having to think about what packages +to install. To install all the =python= features the user has just to add the +=python= layer to their dotfile. + +** Structure +Configuration is organized in layers. Each layer has the following structure: + +#+BEGIN_EXAMPLE + [layer_name] + |__ [local] + | |__ [package 1] + | | ... + | |__ [package n] + |-- layers.el + |__ packages.el + |__ funcs.el + |__ config.el + |__ keybindings.el + + [] = directory +#+END_EXAMPLE + +Where: + +| File | Usage | +|----------------+--------------------------------------------------------------------------------------------------| +| layers.el | The place to declare additional layers | +| packages.el | The list of packages and their configuration functions (init, post-init, etc...) | +| funcs.el | All functions defined in the layer (used in package configuration for instance) | +| config.el | Layer configuration (defines the layer variables default values and setup some config variables) | +| keybindings.el | General key bindings no tied to a specific package configuration | + +=Packages= can be: +- =ELPA= packages installed from an =ELPA= compliant repository +- local packages in a layer's =local= folder +- installed from an online source using [[https://github.com/quelpa/quelpa][quelpa]]. + +** Configure packages +*** With a layer +**** Declaration +=Packages= are declared in a variable called =-packages= where == +is the name of the layer. + +Example: + +#+BEGIN_SRC emacs-lisp +(setq -packages '(package1 package2 ...) +#+END_SRC + +All packages from all layers are processed in alphabetical order so sometimes +you'll have to use some =with-eval-after-load= black magic to configure them +properly. For instance if package =A= depends on =B= then you can configure +=A= with: + +#+BEGIN_SRC emacs-lisp +(with-eval-after-load 'B ...) +#+END_SRC + +For details on installing packages using quelpa or local packages see [[file:LAYERS.org::packages.el][LAYERS]]. + +**** Initialization +To initialize a package =xxx=, define a function with this format in +=packages.el=: + +#+BEGIN_SRC emacs-lisp +(defun /init-xxx () ...body ) +#+END_SRC + +It is common to define the body with the [[https://github.com/jwiegley/use-package][use-package]] macro. + +**** Exclusion +It is possible to exclude some packages from Spacemacs on a per-layer basis. +This is useful when a configuration layer aims to replace a stock package +declared in the Spacemacs layer. + +To do so add the package names to exclude to the variable +=-excluded-packages=. + +Example: + +#+BEGIN_SRC emacs-lisp +(setq -excluded-packages '(package1 package2 ...) +#+END_SRC + +*** Without a layer +Sometimes a layer can be an unnecessary overhead, this is the case if you just +want to install a package with very few configuration associated to it. A good +example is some niche language where you are only interested in syntax +highlighting. + +You can install such packages by adding them to the variable +=dotspacemacs-additional-packages= under the =dotspacemacs/layers= function in your dotfile. + +For example, to install =llvm-mode= and =dts-mode=: +#+BEGIN_SRC emacs-lisp +(defun dotspacemacs/layers () + "Configuration Layers declaration..." + (setq-default + ;; ... + dotspacemacs-additional-packages '(llvm-mode dts-mode) + ;; ... + )) +#+END_SRC + +If you want to add some configuration for them then put the configuration in +the =dotspacemacs/user-config= function or consider creating a layer. + +** Packages synchronization +Spacemacs will only install the packages that are explicitly used by the user. +A package is considered to be used if its layer is used (i.e. listed in +=dotspacemacs-configuration-layers=). +Any packages that are not used is considered to be orphan and is deleted at +the next startup of Emacs. + +** Types of configuration layers +There are two types of configuration layers: + - distributed layers (in the =layers= directory, those layers are contributions shared + by the community and merged upstream) + - private (in the =private= directory, they are ignored by Git) + +** Submitting a configuration layer upstream +If you decide to provide a configuration layer, please check the contribution +guidelines first in [[file:../CONTRIBUTING.org][CONTRIBUTING]]. + +** Example: Themes Megapack example +This is a simple configuration layer listing a bunch of themes which you can +find [[../layers/themes-megapack/README.org][here]]. + +To install it, just add =themes-megapack= to your =~/.spacemacs= like so: + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-configuration-layers '(themes-megapack)) +#+END_SRC + +Adding this layer will install around 100 themes; to uninstall them remove the +layer from the =dotspacemacs-configuration-layers= and press ~SPC f e R~. + +** Managing private configuration layers +Spacemacs's configuration system is flexible enough to let you manage your +private layers in different ways. + +*** Using the private directory +Everything in the private directory is ignored by Git so it is a good place to +store private layers. There is a huge drawback to this approach though: /your +layers are not source controlled/. + +*** Using an external Git repository +This is the recommended way to manage your private layers. + +The best approach is to store all your private layers into an external Git +repository. It is especially a good practice to store them in your =dotfiles= +repository if you have one. Put also your =~/.spacemacs= file in it. + +Then you are free to symlink your layers into =~/emacs.d/private= /or/ let them +anywhere you want and reference the parent directory in the variable +=dotspacemacs-configuration-layer-path= of your =~/.spacemacs=. + +Note that you could also have a dedicated repository for all your private layers +and then directly clone this repository in =~/.emacs.d/private=. + +*** Using a personal branch +The final main way to manage your private layers is to push them in a personal +branch that you keep up to date with upstream =master= or =develop=. + +** Tips for writing layers +Please refer to [[file:LAYERS.org][this]] introduction for some tips on writing layers, and how to +best make them fit with the Spacemacs philosophy and loading strategy. + +* Dotfile Configuration +User configuration can be stored in your =~/.spacemacs= file. + +** Dotfile Installation +The very first time Spacemacs starts up, it will ask you several questions +and then install the =.spacemacs= in your =HOME= directory. + +** Alternative dotdirectory +A dotdirectory =~/.spacemacs.d/= can be used instead of a dotfile. +If you want to use this option, move =~/.spacemacs= to =~/.spacemacs.d/init.el=. + +It is also possible to override the location of =~/.spacemacs.d/= using the +environment variable =SPACEMACSDIR=. Of course you can also use symlinks to +change the location of this directory. + +*Note:* =~/.spacemacs= will always take priority over =~/.spacemacs.d/init.el=, +so =~/.spacemacs= must not exist for =~/.spacemacs.d/init.el= to be used by +Spacemacs. + +** Synchronization of dotfile changes +To apply the modifications made in =~/.spacemacs= press ~SPC f e R~. It will +re-execute the Spacemacs initialization process. + +*Note*: A synchronization re-executes the functions =dotspacemacs/init=, +=dotspacemacs/user-init= and =dotspacemacs/user-config=. +Depending on the content of this functions you may encounter some unwanted side +effects. For instance if you use a toggle in =dotspacemac/user-config= to enable +some behavior, this behavior will be turned off whenever the dotfile is +re-synchronized. To avoid these side-effects it is recommended to either use +=setq= expressions instead of toggle functions, or to use the =on= or =off= +versions instead (i.e. instead of =spacemacs/toggle-=, use +=spacemacs/toggle--on= or =spacemacs/toggle--off=). + +It is possible to /skip/ the execution of =dotspacemacs/user-config= with the +universal argument (~SPC u SPC f e R~). + +** Testing the dotfile +You can use the command =SPC SPC dotspacemacs/test-dotfile= to check if your +=~/.spacemacs= looks correct. This will check, among other things, whether the +declared layers can be found and that the variables have sensible values. These +tests are also run automatically when you synchronize with ~SPC f e R~. + +** Dotfile Contents +*** Configuration functions +Three special functions in the =~/.spacemacs= file can be used to perform +configuration at the beginning and end of Spacemacs loading process: + +- =dotspacemacs/layers= is called at the very startup of Spacemacs initilialization, + this is where you set the Spacemacs distribution and declare layers to be used + in your configuration. You can also add or excluded packages of your choice + and tweak some behavior of Spacemacs loading. +- =dotspacemacs/init= is called at the very startup of Spacemacs initialization + before layers configuration. *You should not put any user code* in there + besides modifying the Spacemacs variable values prefixed with =dotspacemacs-=. +- =dotspacemacs/user-init= is called immediately after =dotspacemacs/init=, + before layer configuration. This function is mostly useful for variables + that need to be set before packages are loaded. +- =dotspacemacs/user-config= is called at the very end of Spacemacs + initialization after layers configuration. This is the place where most of + your configurations should be done. Unless it is explicitly specified that a + variable should be set before a package is loaded, you should place your code + here. + +*** Custom variables +Custom variables configuration from =M-x customize-group= built-in Emacs feature +are automatically saved by Emacs at the end of your =~/.spacemacs= file. + +** Declaring Configuration layers +To use a configuration layer, declare it in your dotfile by adding it to the +=dotspacemacs-configuration-layers= variable of your =~/.spacemacs=. + +*Note:* In this documentation a =used layer= is equivalent to a =declared +layer=. + +For instance, [[Thank you][RMS]] can add his private configuration layer like this: + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-configuration-layers + '( + ;; other layers + ;; rms layer added at the end of the list + rms + )) +#+END_SRC + +Official layers shipped with Spacemacs are stored in =~/.emacs.d/layers=. The +directory =~/.emacs.d/private= is a drop-in location for your private layers. +It is possible to put layers at the location of your choice provided you tell +Spacemacs where to look for them. This is done by setting the list +=dotspacemacs-configuration-layer-path= in your =~/.spacemacs=. For instance +to add some layers in =~/.myconfig=, set the variable like this: + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-configuration-layer-path '("~/.myconfig/")) +#+END_SRC + +*** Setting configuration layers variables +Some configuration layers have configuration variables to enable specific +feature. For instance the [[../layers/%2Bsource-control/git][git layer]] has several configuration variables, they +can be set directly in the =dotspacemacs-configuration-layers= like this: + +#+BEGIN_SRC emacs-lisp +(defun dotspacemacs/layers () + ;; List of configuration layers to load. + (setq-default dotspacemacs-configuration-layers + '(auto-completion + (git :variables + git-magit-status-fullscreen t + git-variable-example nil) + smex))) +#+END_SRC + +The =:variables= keyword is a convenience to keep layer configuration close to +their declaration. Setting layer variables in the =dotspacemacs/user-init= +function of your dotfile is also a perfectly valid way to configure a layer. + +*** Disabling layer services in other layers +Often layers enable services that other layers can use. For instance if you use +the layer =auto-completion= then every other layers supporting =auto-completion= +will have this feature enabled. + +Sometimes you may want to disable a service added by a layer in some specific +layers. Say you want to disable =auto-completion= in =org= and =git= layers, +you can do it with the following layer declaration. + +#+BEGIN_SRC emacs-lisp +(defun dotspacemacs/layers () + ;; List of configuration layers to load. + (setq-default dotspacemacs-configuration-layers + '(org git + (auto-completion :disabled-for org git)))) +#+END_SRC + +You can also use the =:enabled-for= construct to disable it for /all/ layers +/except/ those explicitly identified. + +#+BEGIN_SRC emacs-lisp +(defun dotspacemacs/layers () + ;; List of configuration layers to load. + (setq-default dotspacemacs-configuration-layers + '(java python c-c++ + (auto-completion :enabled-for java python)))) +#+END_SRC + +Note that =:enabled-for= may be an empty list. + +#+BEGIN_SRC emacs-lisp +(defun dotspacemacs/layers () + ;; List of configuration layers to load. + (setq-default dotspacemacs-configuration-layers + '(java python c-c++ + (auto-completion :enabled-for)))) +#+END_SRC + +=:enabled-for= takes precedence over =:disabled-for= if both are present. + +*** Selecting/Ignoring packages of a layer +By default a declared layer installs/configures all its associated packages. You +may want to select only some of them or ignoring some of them. This is possible +with the =:packages= keyword. + +For instance to ignore the =neotree= and =fancy-battery= packages from +=spacemacs-ui-visual= layer: + +#+BEGIN_SRC emacs-lisp +(defun dotspacemacs/layers () + ;; List of configuration layers to load. + (setq-default dotspacemacs-configuration-layers + '(auto-completion + (spacemacs-ui-visual :packages (not neotree fancy-battery)))) +#+END_SRC + +The opposite would be to ignore all packages except =neotree= and +=fancy-battery=: + +#+BEGIN_SRC emacs-lisp +(defun dotspacemacs/layers () + ;; List of configuration layers to load. + (setq-default dotspacemacs-configuration-layers + '(auto-completion + (spacemacs-ui-visual :packages neotree fancy-battery))) +#+END_SRC + +*Note:* Ignoring a package from a layer is different than excluding a package. +An excluded packages is completely removed from your configuration whereas an +ignored package is ignored only for a given layer but it can remain on your +system. It happens that if the given layer is the owner of the package then +ignoring this package is the same as excluding it (because the package becomes +orphan so it is considered unused by Spacemacs). + +*** Excluding packages +You can exclude packages you don't want to install with the variable +=dotspacemacs-excluded-packages= (see [[Configuration layers][Configuration layers]] for more info +on packages). + +For instance, to disable the =rainbow-delimiters= package: + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-excluded-packages '(rainbow-delimiters)) +#+END_SRC + +When you exclude a package, Spacemacs will automatically delete it for you the +next time you launch Emacs or at the next dotfile synchronization. All the +orphan dependencies are also deleted automatically. Excluding a package +effectively remove _all_ references to it in Spacemacs without breaking the rest +of the configuration, this is a powerful feature which allows you to quickly +remove any feature from Spacemacs. + +*Note:* A few packages are essential for Spacemacs to correctly operate, those +packages are protected and cannot be excluded or unsintalled even if they become +orphans or are excluded. =use-package= is an example of a protected package that +cannot be removed from Spacemacs. + +* Concepts +** Editing Styles +Spacemacs comes with several editing styles which can be switched dynamically +providing an easier way to do pair programming, for instance between a Vim user +and an Emacs user. + +Three styles are available: +- Vim, +- Emacs, +- Hybrid (a mix between Vim and Emacs). + +*** Vim +Spacemacs behaves like in Vim using [[https://gitorious.org/evil/pages/Home][Evil]] mode package to emulate Vim key bindings. +This is the default style of Spacemacs; it can be set explicitly by setting +the =dotspacemacs-editing-style= variable to =vim= in the dotfile. + +To bind keys in Vim editing style (=insert state=): + +#+BEGIN_SRC emacs-lisp +(define-key evil-insert-state-map (kbd "C-]") 'forward-char) +#+END_SRC + +*** Emacs +Spacemacs behaves like in raw Emacs using the Holy mode which configures Evil to +make the =emacs state= the default state everywhere. +Set the =dotspacemacs-editing-style= variable to =emacs= in the dotfile. + +In Emacs style the leader is available on ~M-m~. It is possible to toggle it on +and off with ~SPC t E e~ and ~M-m t E e~. When off the =vim= style is enabled. + +To bind keys in Emacs editing style (=emacs state=): + +#+BEGIN_SRC emacs-lisp +(define-key evil-emacs-state-map (kbd "C-]") 'forward-char) +#+END_SRC + +*** Hybrid +The hybrid editing style is like the Vim style except that =insert state= is +replaced by a new state called =hybrid state=. In =hybrid state= all the Emacs +key bindings are available; this is like replacing the =insert state= with the +=emacs state= but provides an isolated key map =evil-hybrid-state-map=. + +To bind keys in Hybrid editing style (=hybrid state=): + +#+BEGIN_SRC emacs-lisp +(define-key evil-hybrid-state-map (kbd "C-]") 'forward-char) +#+END_SRC + +This style can be tweaked to be more like Emacs or more like Vim depending +on the user preferences. The following variable are available to change the +style configuration: + +- =hybrid-mode-default-state= The default state when opening a new buffer, + default is =normal=. Set it to =emacs= for a more emacsy style. +- =hybrid-mode-enable-hjkl-bindings= If non nil then packages will configure + =h j k l= key bindings for navigation. +- =hybrid-mode-enable-evilified-state= If non nil buffer are =evilified= when + supported, if nil then =emacs= state is enabled in those buffers instead. + +Default configuration is: + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-editing-style '(hybrid :variables + hybrid-mode-enable-evilified-state t + hybrid-mode-enable-hjkl-bindings nil + hybrid-mode-default-state 'normal) +#+END_SRC + +To toggle the hybrid style on and off use ~SPC t E h~ and ~M-m t E h~. When +off the =vim= style is enabled. + +** States +Spacemacs has 10 states: + +| State | Default Color | Description | +|--------------+---------------+------------------------------------------------------------------------------------------------------------| +| normal | orange | like the =normal mode of Vim=, used to execute and combine commands | +| insert | green | like the =insert mode of Vim=, used to actually insert text | +| visual | gray | like the =visual mode of Vim=, used to make text selection | +| motion | purple | exclusive to =Evil=, used to navigate read only buffers | +| emacs | blue | exclusive to =Evil=, using this state is like using a regular Emacs without Vim | +| replace | chocolate | exclusive to =Evil=, overwrites the character under point instead of inserting a new one | +| hybrid | blue | exclusive to Spacemacs, this is like the insert state except that all the emacs key bindings are available | +| evilified | light brown | exclusive to Spacemacs, this is an =emacs state= modified to bring Vim navigation, selection and search. | +| lisp | pink | exclusive to Spacemacs, used to navigate Lisp code and modify it (more [[Editing Lisp code][info]]) | +| iedit | red | exclusive to Spacemacs, used to navigate between multiple regions of text using =iedit= (more [[Replacing text with iedit][info]]) | +| iedit-insert | red | exclusive to Spacemacs, used to replace multiple regions of text using =iedit= (more [[Replacing text with iedit][info]]) | + +Note: Technically speaking there is also the =operator= evil state. + +** Evilified modes +Some buffers are not for editing text and provide their own keybindings for +certain operations. These often conflict with Vim bindings. To make such buffers +behave more like Vim in a consistent manner, they use a special state called +/evilified/ state. In evilified state, a handful of keys work as in Evil, namely +=/=, =:=, =h=, =j=, =k=, =l=, =n=, =N=, =v=, =V=, =gg=, =G=, =C-f=, =C-b=, +=C-d=, =C-e=, =C-u=, =C-y= and =C-z=. All other keys work as intended by the +underlying mode. + +Shadowed keys are moved according to the pattern: =a= → =A= → =C-a= → =C-A= + +For example, if the mode binds a function to =n=, that is found under =C-n= in +evilified state, since both =n= and =N= are reserved, but =C-n= is not. On the +other hand, anything originally bound to =k= will be found on =K=, since =k= is +reserved but =K= is not. If there is a binding on =K=, that will be moved to +=C-k=. + +In addition to this, =C-g=, being an important escape key in Emacs, is skipped. +So anything bound to =g= originally will be found on =C-G=, since =g=, =G= and +=C-g= are all reserved. + +** Evil leader +Spacemacs uses a leader key to bind almost all its key bindings. + +This leader key is commonly set to ~​,​~ by Vim users, in Spacemacs the leader +key is set on ~SPC~ (the space bar, hence the name =spacemacs=). This key is the +most accessible key on a keyboard and it is pressed with the thumb which is a +good choice to lower the risk of [[http://en.wikipedia.org/wiki/Repetitive_strain_injury][RSI]]. It can be customized to any other key +using the variable =dotspacemacs-leader-key= and =dotspacemacs-emacs-leader-key=. + +With Spacemacs there is no need to remap your keyboard modifiers to attempt +to reduce the risk of RSI, every command can be executed very easily while you +are in =normal= mode by pressing the ~SPC~ leader key, here are a few examples: + +- Save a buffer: ~SPC f s~ +- Save all opened buffers: ~SPC f S~ +- Open (switch) to a buffer with =helm=: ~SPC b b~ + +** Universal argument +The universal argument ~C-u~ is an important command in Emacs but it is also a +very handy Vim key binding to scroll up. + +Spacemacs binds ~C-u~ to =scroll-up= and change the universal argument binding +to ~SPC u~. + +*Note*: ~SPC u~ is not working before =helm-M-x= (~SPC SPC~). Instead, call +=helm-M-x= first, select the command you want to run, and press ~C-u~ before +pressing ~RETURN~. For instance: ~SPC SPC org-reload C-u RET~ + +** Transient-states +Spacemacs defines a wide variety of =transient states= (temporary overlay maps) +where it makes sense. This prevents one from doing repetitive and tedious +presses on the ~SPC~ key. + +When a =transient state= is active, a documentation is displayed in the +minibuffer. Additional information may as well be displayed in the minibuffer. + +Auto-highlight-symbol transient state: +[[file:img/spacemacs-ahs-transient-state.png]] +[[Text][Text scale transient state]]: + +[[file:img/spacemacs-scale-transient-state.png]] + +* Differences between Vim, Evil and Spacemacs +- The ~​,​~ key does "repeat last ~f~, ~t~, ~F~, or ~T~ command in + opposite direction in =Vim=, but in Spacemacs it is the major mode specific + leader key by default (which can be set on another key binding in the + dotfile). + +Send a PR to add the differences you found in this section. + +** The vim-surround case +There is one obvious visible difference though. It is not between =Evil= and +=Vim= but between Spacemacs and [[https://github.com/tpope/vim-surround][vim-surround]]: in visual mode the =surround= command is on ~S~ +in =vim-surround= whereas it is on ~s~ in Spacemacs. + +This is something that can surprise some Vim users so here are some motivations +behind this change: + - ~s~ and ~c~ do the same thing in =visual state=, + - ~s~ is only useful to delete /one/ character and add more than one character + which is a /very/ narrow use case + - ~c~ accept motions and can do everything ~s~ can do in =normal state= + (note that this is also true for ~r~ but ~r~ is more useful because it + stays in =normal state=) + - =surround= command is just a more powerful command than ~s~. + +If you are not convinced, then here is the snippet to revert back to the default +=Vim + vim-surround= setup (add it to your =dotspacemacs/user-config= function or +your =~/.spacemacs=): + +#+BEGIN_SRC emacs-lisp +(evil-define-key 'visual evil-surround-mode-map "s" 'evil-substitute) +(evil-define-key 'visual evil-surround-mode-map "S" 'evil-surround-region) +#+END_SRC + +* Evil plugins +Spacemacs ships with the following evil plugins: + +| Mode | Description | +|-------------------------------+--------------------------------------------| +| [[https://github.com/wcsmith/evil-args][evil-args]] | motions and text objects for arguments | +| [[https://github.com/Dewdrops/evil-exchange][evil-exchange]] | port of [[https://github.com/tommcdo/vim-exchange][vim-exchange]] | +| [[https://github.com/cofi/evil-indent-textobject][evil-indent-textobject]] | add text object based on indentation level | +| [[https://github.com/redguardtoo/evil-matchit][evil-matchit]] | port of [[http://www.vim.org/scripts/script.php?script_id=39][matchit.vim]] | +| [[https://github.com/redguardtoo/evil-nerd-commenter][evil-nerd-commenter]] | port of [[https://github.com/scrooloose/nerdcommenter][nerdcommenter]] | +| [[https://github.com/cofi/evil-numbers][evil-numbers]] | like ~C-a~ and ~C-x~ in vim | +| [[https://github.com/juanjux/evil-search-highlight-persist][evil-search-highlight-persist]] | emulation of hlsearch behavior | +| [[https://github.com/timcharper/evil-surround][evil-surround]] | port of [[https://github.com/tpope/vim-surround][vim-surround]] | +| [[https://github.com/bling/evil-visualstar][evil-visualstar]] | search for current selection with ~*~ | +| [[https://github.com/jaypei/emacs-neotree][NeoTree]] | mimic [[https://github.com/scrooloose/nerdtree][NERD Tree]] | + +* Binding keys +Key sequences are bound to commands in Emacs in various keymaps. The most basic +map is the =global-map=. Setting a key binding in the =global-map= is achieved +with the function =global-set-key=. Example to bind a key to the command +=forward-char=: + +#+BEGIN_SRC emacs-lisp +(global-set-key (kbd "C-]") 'forward-char) +#+END_SRC + +The =kbd= macro accepts a string describing a key sequence. The =global-map= is +often shadowed by other maps. For example, =evil-mode= defines keymaps that +target states (or modes in vim terminology). Here is an example that creates the +same binding as above but only in =insert state= (=define-key= is a built-in +function. =Evil-mode= has its own functions for defining keys). + +#+BEGIN_SRC emacs-lisp +(define-key evil-insert-state-map (kbd "C-]") 'forward-char) +#+END_SRC + +Perhaps most importantly for Spacemacs is the use of the bind-map package to +bind keys behind a leader key. +This is where most of the Spacemacs bindings live. Binding keys behind the +leader key is achieved with the functions =spacemacs/set-leader-keys= and +=spacemacs/set-leader-keys-for-major-mode=, example: + +#+BEGIN_SRC emacs-lisp +(spacemacs/set-leader-keys "C-]" 'forward-char) +(spacemacs/set-leader-keys-for-major-mode 'emacs-lisp-mode "C-]" 'forward-char) +#+END_SRC + +These functions use a macro like =kbd= to translate the key sequences for you. +The second function, =spacemacs/set-leader-keys-for-major-mode=, binds the key +only in the specified mode. The second key binding is active only when the +major mode is =emacs-lisp=. + +Finally, one should be aware of prefix keys. Essentially, all keymaps can be +nested. Nested keymaps are used extensively in spacemacs, and in vanilla Emacs +for that matter. For example, ~SPC a~ points to key bindings for "applications", +like ~SPC a c~ for =calc-dispatch=. Nesting bindings is easy. + +#+BEGIN_SRC emacs-lisp +(spacemacs/declare-prefix "]" "bracket-prefix") +(spacemacs/set-leader-keys "]]" 'double-bracket-command) +#+END_SRC + +The first line declares ~SPC ]~ to be a prefix and the second binds the key +sequence ~SPC ]]~ to the corresponding command. The first line is actually +unnecessary to create the prefix, but it will give your new prefix a name that +key-discovery tools can use (e.g., which-key). + +There is much more to say about bindings keys, but these are the basics. Keys +can be bound in your =~/.spacemacs= file or in individual layers. + +* GUI Elements +Spacemacs has a minimalistic and distraction free graphical UI: + - custom [[https://github.com/milkypostman/powerline][powerline]] mode-line [[Flycheck integration][with color feedback]] according to current [[https://github.com/flycheck/flycheck][Flycheck]] status + - Unicode symbols for minor mode lighters which appear in the mode-line + - [[Errors handling][custom fringe bitmaps]] and error feedbacks for [[https://github.com/flycheck/flycheck][Flycheck]] + +** Color themes +The official Spacemacs theme is [[https://github.com/nashamri/spacemacs-theme][spacemacs-dark]] and it is the default theme +installed when you first started Spacemacs. There are two variants of the +theme, a dark one and a light one. Some aspect of these themes can be customized +in the function =dotspacemacs/user-init= of your =~/.spacemacs=: + - the comment background with the boolean =spacemacs-theme-comment-bg= + - the height of org section titles with =spacemacs-theme-org-height= + +It is possible to define your default themes in your =~/.spacemacs= with the +variable =dotspacemacs-themes=. For instance, to specify =spacemacs-light=, +=leuven= and =zenburn=: + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-themes '(spacemacs-light leuven zenburn)) +#+END_SRC + +| Key Binding | Description | +|-------------+-------------------------------------------------------| +| ~SPC T n~ | switch to next theme listed in =dotspacemacs-themes=. | +| ~SPC T s~ | select a theme using a =helm= buffer. | + +You can see samples of all included themes in this [[http://themegallery.robdor.com][theme gallery]] from [[http://www.twitter.com/robmerrell][Rob Merrell]]. + +*Note*: + - You don't need to explicitly list in a layer the theme packages you are + defining in =dotspacemacs-themes=, Spacemacs is smart enough to remove those + packages from the list of orphans. + - Due to the inner working of themes in Emacs, switching theme during the same + session may have some weird side effects. Although these side effects should + be pretty rare. + - In the terminal version of Emacs, color themes will not render correctly as + colors are rendered by the terminal and not by emacs. You will probably have + to change your terminal color palette. More explanations can be found on + [[https://github.com/sellout/emacs-color-theme-solarized#important-note-for-terminal-users][emacs-color-theme-solarized webpage]]. + +*Hint*: If you are an =Org= user, [[https://github.com/fniessen/emacs-leuven-theme][leuven-theme]] is amazing ;-) + +** Font +The default font used by Spacemacs is [[https://github.com/adobe-fonts/source-code-pro][Source Code Pro]] by Adobe. It is +recommended to install it on your system if you wish to use it. + +To change the default font set the variable =dotspacemacs-default-font= in your +=.spacemacs= file. By default its value is: + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-default-font '("Source Code Pro" + :size 13 + :weight normal + :width normal + :powerline-scale 1.1)) +#+END_SRC + +If the specified font is not found, the fallback one will be used (depends on +your system). Also note that changing this value has no effect if you are +running Emacs in terminal. + +The properties should be pretty straightforward, it is possible to set any valid +property of a [[http://www.gnu.org/software/emacs/manual/html_node/elisp/Low_002dLevel-Font.html][font-spec]]: + - =:family= Font family or fontset (a string). + - =:width= Relative character width. This should be one of the symbols: + - ultra-condensed + - extra-condensed + - condensed + - semi-condensed + - normal + - semi-expanded + - expanded + - extra-expanded + - ultra-expanded + - =:height= The height of the font. In the simplest case, this is an integer + in units of 1/10 point. + - =:weight= Font weight- one of the symbols (from densest to faintest): + - ultra-bold + - extra-bold + - bold + - semi-bold + - normal + - semi-light + - light + - extra-light + - ultra-light + - =:slant= Font slant- one of the symbols: + - italic + - oblique + - normal + - reverse-italic + - reverse-oblique + - =:size= The font size- either a non-negative integer that specifies the + pixel size, or a floating-point number that specifies the point size. + - =:adstyle= Additional typographic style information for the font, such as + 'sans'. The value should be a string or a symbol. + - =:registry= The charset registry and encoding of the font, such as + 'iso8859-1'. The value should be a string or a symbol. + - =:script= The script that the font must support (a symbol). + +The special property =:powerline-scale= is Spacemacs specific and it is for +quick tweaking of the mode-line height in order to avoid crappy rendering of the +separators like on the following screenshot (default value is 1.1). + +[[file:img/crappy-powerline-separators.png]] +/Ugly separators/ + +** GUI Toggles +Some graphical UI indicators can be toggled on and off (toggles start with ~t~ +and ~T~): + +| Key Binding | Description | +|-------------+-------------------------------------------------------------------| +| ~SPC t 8~ | highlight any character past the 80th column | +| ~SPC t f~ | display the fill column (by default the fill column is set to 80) | +| ~SPC t h h~ | toggle highlight of the current line | +| ~SPC t h i~ | toggle highlight indentation levels | +| ~SPC t h c~ | toggle highlight indentation current column | +| ~SPC t i~ | toggle indentation guide at point | +| ~SPC t l~ | toggle truncate lines | +| ~SPC t L~ | toggle visual lines | +| ~SPC t n~ | toggle line numbers | +| ~SPC t v~ | toggle smooth scrolling | + +| Key Binding | Description | +|-------------+------------------------------------------------------------------| +| ~SPC T ~~ | display =~= in the fringe on empty lines | +| ~SPC T F~ | toggle frame fullscreen | +| ~SPC T f~ | toggle display of the fringe | +| ~SPC T m~ | toggle menu bar | +| ~SPC T M~ | toggle frame maximize | +| ~SPC T t~ | toggle tool bar | +| ~SPC T T~ | toggle frame transparency and enter transparency transient state | + +*Note*: These toggles are all available via the =helm-spacemacs-help= interface +(press ~SPC h SPC~ to display the =helm-spacemacs-help= buffer). + +**** Global line numbers +Line numbers can be toggled on in all =prog-mode= and =text-mode= buffers by +setting the =dotspacemacs-line-numbers= variable in your =~/.spacemacs= +to something different than =nil=. + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-line-numbers t) +#+END_SRC + +If it is set to =relative=, line numbers are show in a relative way: + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-line-numbers 'relative) +#+END_SRC + +** Mode-line +The mode line is a heavily customized [[https://github.com/milkypostman/powerline][powerline]] with the following capabilities: + - show the window number + - color code for current state + - show the number of search occurrences via anzu + - toggle flycheck info + - toggle battery info + - toggle minor mode lighters + +Reminder of the color codes for the states: + +| Evil State | Color | +|--------------------+-----------| +| Normal | Orange | +| Insert | Green | +| Visual | Grey | +| Emacs | Blue | +| Motion | Purple | +| Replace | Chocolate | +| Lisp | Pink | +| Iedit/Iedit-Insert | Red | + +Some elements can be dynamically toggled: + +| Key Binding | Description | +|-------------+-----------------------------------------------------------------| +| ~SPC t m b~ | toggle the battery status | +| ~SPC t m c~ | toggle the =org= task clock (available in =org= layer) | +| ~SPC t m m~ | toggle the minor mode lighters | +| ~SPC t m M~ | toggle the major mode | +| ~SPC t m n~ | toggle the cat! (if =colors= layer is declared in your dotfile) | +| ~SPC t m p~ | toggle the point character position | +| ~SPC t m t~ | toggle the mode line itself | +| ~SPC t m v~ | toggle the version control info | +| ~SPC t m V~ | toggle the new version lighter | + +**** Powerline font installation for terminal-mode users +Users who run Emacs in terminal mode may need to install the [[https://github.com/powerline/fonts][Powerline patched +fonts]] and configure their terminal clients to use them to make the Powerline +separators render correctly. + +**** Flycheck integration +When [[https://github.com/flycheck/flycheck][Flycheck]] minor mode is enabled, a new element appears showing the number of +errors, warnings and info. + +[[file:img/powerline-wave.png]] +/Flycheck integration in mode-line/ + +**** Anzu integration +[[https://github.com/syohex/emacs-anzu][Anzu]] shows the number of occurrence when performing a search. Spacemacs +integrates nicely the Anzu status by displaying it temporarily when ~n~ or ~N~ +are being pressed. See the =5/6= segment on the screenshot below. + +[[file:img/powerline-anzu.png]] +/Anzu integration in mode-line/ + +**** Battery status integration +[[https://github.com/lunaryorn/fancy-battery.el][fancy-battery]] displays the percentage of total charge of the battery as well as +the time remaining to charge or discharge completely the battery. + +A color code is used for the battery status: + +| Battery State | Color | +|---------------+--------| +| Charging | Green | +| Discharging | Orange | +| Critical | Red | + +Note the these colors may vary depending on your theme. + +**** Powerline separators +It is possible to easily customize the =powerline separator= by setting the +=powerline-default-separator= variable in your =~./spacemacs= and then +recompiling the modeline. For instance if you want to set back the separator to +the well-known =arrow= separator add the following snippet to your configuration +file: + +#+BEGIN_SRC emacs-lisp +(defun dotspacemacs/user-config () + "This is were you can ultimately override default Spacemacs configuration. +This function is called at the very end of Spacemacs initialization." + (setq powerline-default-separator 'arrow)) +#+END_SRC + +To save you the time to try all the possible separators provided by the +powerline, here is an exhaustive set of screenshots: + +| Separator | Screenshot | +|--------------+-----------------------------------| +| =alternate= | [[file:img/powerline-alternate.png]] | +| =arrow= | [[file:img/powerline-arrow.png]] | +| =arrow-fade= | [[file:img/powerline-arrow-fade.png]] | +| =bar= | [[file:img/powerline-bar.png]] | +| =box= | [[file:img/powerline-box.png]] | +| =brace= | [[file:img/powerline-brace.png]] | +| =butt= | [[file:img/powerline-butt.png]] | +| =chamfer= | [[file:img/powerline-chamfer.png]] | +| =contour= | [[file:img/powerline-contour.png]] | +| =curve= | [[file:img/powerline-curve.png]] | +| =rounded= | [[file:img/powerline-rounded.png]] | +| =roundstub= | [[file:img/powerline-roundstub.png]] | +| =slant= | [[file:img/powerline-slant.png]] | +| =wave= | [[file:img/powerline-wave.png]] | +| =zigzag= | [[file:img/powerline-zigzag.png]] | +| =nil= | [[file:img/powerline-nil.png]] | + +**** Minor Modes +Spacemacs uses [[http://www.emacswiki.org/emacs/DiminishedModes][diminish]] mode to reduce the size of minor mode indicators: + +The minor mode area can be toggled on and off with ~SPC t m m~ + +Unicode symbols are displayed by default. Setting the variable +=dotspacemacs-mode-line-unicode-symbols= to =nil= in your =~/.spacemacs= will +display ASCII characters instead (may be useful in terminal if you cannot set an +appropriate font). + +The letters displayed in the mode-line correspond to the key bindings used to +toggle them. + +Some toggle have two flavors: local and global. The global version of the toggle +can be reached using the =control= key. + +| Key Binding | Unicode | ASCII | Mode | +|-------------+---------+-------+----------------------------------------------------------------------| +| ~SPC t -~ | =⊝= | - | [[http://emacswiki.org/emacs/centered-cursor-mode.el][centered-cursor]] mode | +| ~SPC t 8~ | =⑧= | 8 | toggle highlight of characters for long lines | +| ~SPC t C-8~ | =⑧= | 8 | global toggle highlight of characters for long lines | +| ~SPC t C--~ | =⊝= | - | global centered cursor | +| ~SPC t a~ | =ⓐ= | a | auto-completion | +| ~SPC t c~ | =ⓒ= | c | camel case motion with subword mode | +| =none= | =ⓔ= | e | [[https://github.com/edwtjo/evil-org-mode][evil-org]] mode | +| ~SPC t E e~ | =Ⓔe= | Ee | emacs editing style (holy mode) | +| ~SPC t E h~ | =Ⓔh= | Eh | hybrid editing style (hybrid mode) | +| ~SPC t f~ | =ⓕ= | f | fill-column-indicator mode | +| ~SPC t F~ | =Ⓕ= | F | auto-fill mode | +| ~SPC t g~ | =ⓖ= | g | [[https://github.com/roman/golden-ratio.el][golden-ratio]] mode | +| ~SPC t h i~ | =ⓗi= | hi | toggle highlight indentation levels | +| ~SPC t h c~ | =ⓗc= | hc | toggle highlight indentation current column | +| ~SPC t i~ | =ⓘ= | i | indentation guide | +| ~SPC t C-i~ | =ⓘ= | i | global indentation guide | +| ~SPC t I~ | =Ⓘ= | I | aggressive indent mode | +| ~SPC t K~ | =Ⓚ= | K | which-key mode | +| ~SPC t p~ | =ⓟ= | p | [[https://github.com/Fuco1/smartparens][smartparens]] mode | +| ~SPC t C-p~ | =ⓟ= | p | global smartparens | +| ~SPC t s~ | =ⓢ= | s | syntax checking (flycheck) | +| ~SPC t S~ | =Ⓢ= | S | enabled in [[../layers/spell-checking][spell checking layer]] (flyspell) | +| ~SPC t w~ | =ⓦ= | w | whitespace mode | +| ~SPC t C-w~ | =ⓦ= | w | global whitespace | +| ~SPC t W~ | =Ⓦ= | W | automatic whitespace cleanup (see =dotspacemacs-whitespace-cleanup=) | +| ~SPC t C-W~ | =Ⓦ= | W | automatic whitespace cleanup globally | +| ~SPC t y~ | =ⓨ= | y | [[https://github.com/capitaomorte/yasnippet][yasnippet]] mode | + +**** Customizing the mode-line +Spacemacs uses [[https://github.com/TheBB/spaceline][Spaceline]] to provide its mode-line. It consists of a number of +/segments/ arranged on the left and right sides. These are defined in the +variables =spaceline-left= and =spaceline-right=. Segments can be defined using +=spaceline-define-segment=, and added to the appropriate location in the left or +right hand side variables. + +Please see the Spaceline documentation for more information. + +* Layouts and workspaces +Layouts are window configurations with buffer isolation, each layout can define +several workspaces (think of them as sub-layouts) sharing the same list of +buffers as their parent layout. + +** Layouts +A layout is a window configuration associated with a list of buffers. The list +of buffers can be an arbitrarily chosen set of buffers. Spacemacs provides +some facilities to create meaningful sets of buffers, for instance the buffers +related to a projectile project. + +The name of the current layout appears in the mode-line at the far left (first +element of the mode-line). + +To create a new layout type a layout number that does not exist yet. +For instance if you have two layouts currently then type ~SPC l 3~ to create a +third layout. + +*** The default layout +The =default= layout (the layout created at the startup of Emacs) is not +displayed in the mode-line but it is possible to display it by setting the +variable =dotspacemacs-display-default-layout= to =t=. + +Its name is "default" by default but it can be changed by setting the variable +=dotspacemacs-default-layout-name=. + +The =default= layout is special because it has a global scope which means that +all the opened buffers belong to it. So using only the =default= layout feels +like not using layouts at all. + +*** Project layouts +A project layout is bound to a projectile project. To create a project layout +use ~SPC p l~. + +The name of the layout is the name of the project root directory. + +*** Custom Layouts +Custom layouts can be defined using the macro ~spacemacs|define-custom-layout~, +they are accessible via ~SPC l o~. + +By convention the name of a custom layout should start with =@=. + +Example of custom layout definition for =ERC= buffers: + +#+BEGIN_SRC emacs-lisp + (spacemacs|define-custom-layout "@ERC" + :binding "E" + :body + (progn + ;; hook to add all ERC buffers to the layout + (defun spacemacs-layouts/add-erc-buffer-to-persp () + (persp-add-buffer (current-buffer) + (persp-get-by-name + erc-spacemacs-layout-name))) + (add-hook 'erc-mode-hook #'spacemacs-layouts/add-erc-buffer-to-persp) + ;; Start ERC + (call-interactively 'erc))) +#+END_SRC + +Then use ~SPC l o E~ to start ERC inside its own layout. Any new ERC buffer +will be part of the custom layout. + +Some custom layouts that ship with Spacemacs: + +| Name | Key Binding | Description | +|------------+-------------+---------------------------------------------------------------------------------| +| @Spacemacs | ~e~ | Custom perspective containing all buffers of =~/.emacs.d= | +| @ERC | ~E~ | Custom perspective containing all ERC buffers (needs the erc layer enabled) | +| @RCIRC | ~i~ | Custom perspective containing all RCIRC buffers (needs the rcirc layer enabled) | +| @Org | ~o~ | Custom perspective containing all the =org-agenda= buffers | + +*** Save/Load layouts into a file +With ~SPC l s~ and ~SPC l L~ you can save and load layouts to/from a file. + +*Note:* By default, Spacemacs will automatically save the layouts under the name +=persp-auto-save=. + +Setting the variable =dotspacemacs-auto-resume-layouts= to =t= will +automatically resume the last saved layouts. + +*** Layout key bindings +The key bindings are registered in a transient state. The docstring of the +transient state displays the existing layouts and the currently active +layout has square brackets. Pressing a layout number will activate it (or +create a new one) and exit the transient state. It is possible to just preview a +layout with ~Ctrl-~. Pressing ~TAB~ will activate the previously +selected layout. + +Press ~?~ to toggle the full help. + +| Key Binding | Description | +|-------------------+------------------------------------------------------------| +| ~SPC l~ | activate the transient- state | +| ~?~ | toggle the documentation | +| ~[1..9, 0]~ | switch to nth layout | +| ~[C-1..C-9, C-0]~ | switch to nth layout and keep the transient state active | +| ~~ | switch to the latest layout | +| ~a~ | add a buffer to the current layout | +| ~A~ | add all the buffers from another layout in the current one | +| ~b~ | select a buffer in the current layout | +| ~d~ | delete the current layout and keep its buffers | +| ~D~ | delete the other layouts and keep their buffers | +| ~h~ | go to default layout | +| ~C-h~ | previous layout in list | +| ~l~ | select/create a layout with helm | +| ~L~ | load layouts from file | +| ~C-l~ | next layout in list | +| ~n~ | next layout in list | +| ~N~ | previous layout in list | +| ~o~ | open a custom layout | +| ~p~ | previous layout in list | +| ~r~ | remove current buffer from layout | +| ~R~ | rename current layout | +| ~s~ | save layouts | +| ~t~ | display a buffer without adding it to the current layout | +| ~w~ | workspaces transient state (needs eyebrowse layer enabled) | +| ~x~ | kill current layout with its buffers | +| ~X~ | kill other layouts with their buffers | + +** Workspaces +Workspaces are sub-layouts, they allow to define multiple layouts into a given +layout, those layouts share the same buffer as the parent layout. + +The currently active workspace number is displayed before the window number, +for instance "➊|➍" or "1|4" means the fourth window of the first workspace. + +Any new layout comes with a default workspace which is the workspace 1. + +Switching to a workspace that does not exist in the current layout will create a +new one. For instance at startup you can press ~SPC l w 2~ to create the +workspace 2 in the =default= layout. + +When created a workspace is anonymous, you can give them a name with +~SPC l w R~. + +*** Workspace key bindings +The key bindings are registered in a transient state. The docstring of the +transient state displays the existing workspaces and the currently active +workspace has square brackets. Pressing a workspace number will activate it (or +create a new one) and exit the transient state. It is possible to just preview a +workspace with ~Ctrl-~. Pressing ~TAB~ will activate the previously +selected workspace. + +Press ~?~ to toggle the full help. + +| Key Binding | Description | +|-------------------+-------------------------------------------------------------| +| ~SPC l w~ | activate the transient state | +| ~?~ | toggle the documentation | +| ~[1..9, 0]~ | switch to nth workspace | +| ~[C-1..C-9, C-0]~ | switch to nth workspace and keep the transient state active | +| ~TAB~ | switch to last active workspace | +| ~d~ | close current workspace | +| ~n~ or ~l~ | switch to next workspace | +| ~N~ or ~p~ or ~h~ | switch to previous workspace | +| ~R~ | set a tag to the current workspace | +| ~w~ | switched to tagged workspace | + +There are also some handy globally available key bindings related to workspaces: + +| Key Binding | Description | +|-------------+--------------------------------------| +| ~gt~ | go to next workspace | +| ~gT~ | got to previous workspace | +| ~SPC b W~ | go to workspace and window by buffer | + +* Commands +** Vim key bindings +Spacemacs is based on =Vim= modal user interface to navigate and edit text. If +you are not familiar with the =Vim= way of editing text you can try the +[[https://github.com/syl20bnr/evil-tutor][evil-tutor]] lessons by pressing ~SPC h T~ at any time. + +*** Escaping +Spacemacs uses [[https://github.com/syl20bnr/evil-escape][evil-escape]] to +easily switch between =insert state= and =normal state= by quickly pressing the +~fd~ keys. + +The choice of ~fd~ was made to be able to use the same sequence to escape from +"everything" in Emacs: + - escape from all stock evil states to normal state + - escape from evil-lisp-state to normal state + - escape from evil-iedit-state to normal state + - abort evil ex command + - quit minibuffer + - abort isearch + - quit magit buffers + - quit help buffers + - quit apropos buffers + - quit ert buffers + - quit undo-tree buffer + - quit paradox + - quit gist-list menu + - quit helm-ag-edit + - hide neotree buffer + +If you find yourself in a buffer where the Spacemacs (~SPC~) or Vim keybindings +don't work you can use this to get back to =normal state= (for example in ~SPC +SPC customize~ press ~fd~ to make ~SPC b b~ work again). + +This sequence can be customized in your =~/.spacemacs=. +Example to set it to ~jj~: + +#+BEGIN_SRC emacs-lisp +(defun dotspacemacs/user-config () + (setq-default evil-escape-key-sequence "jj")) +#+END_SRC + +*Note*: Although ~jj~ or ~jk~ are popular choices of vim users, these key +sequences are not optimal for Spacemacs. Indeed it is very easy in =visual +state= to press quickly ~jj~ and inadvertently escape to =normal state=. + +*** Executing Vim and Emacs ex/M-x commands + +| Command | Key Binding | +|------------------+-------------| +| Vim (ex-command) | ~:~ | +| Emacs (M-x) | ~SPC SPC~ | + +The emacs command key ~SPC~ (executed after the leader key) can be changed +with the variable =dotspacemacs-emacs-command-key= of your =~/.spacemacs=. + +*** Leader key +On top of =Vim= modes (modes are called states in Spacemacs) there is a +special key called the leader key which once pressed gives a whole new keyboard +layer. The leader key is by default ~SPC~ (space). It is possible to change this +key with the variable =dotspacemacs-leader-key=. + +*** Additional text objects +Additional text objects are defined in Spacemacs: + +| Object | Description | +|---------+----------------------------| +| ~a~ | an argument | +| ~g~ | the entire buffer | +| ~$~ | text between =$= | +| ~*~ | text between =*= | +| ~8~ | text between =/*= and =*/= | +| ~%~ | text between =%= | +| ~\vert~ | text between =\vert= | + +** Reserved prefix command for user +~SPC o~ and ~SPC m o~ are reserved for the user. Setting key bindings behind +these is *guaranteed* to never conflict with Spacemacs default key bindings. + +*Example:* Put =(spacemacs/set-leader-keys "oc" 'org-capture)= inside +=dotspacemacs/user-config= in your =~/.spacemacs= file, to be able to use ~SPC o +c~ to run org mode capture. + +** Completion +Spacemacs is powered by one of two incremental completion and selection +narrowing frameworks: [[https://github.com/emacs-helm/helm][Helm]] (default) or [[https://github.com/abo-abo/swiper][Ivy]]. To use Ivy, add the =ivy= layer to +your list of enabled layers. If the =ivy= layer is not enabled, Helm will be +enabled automatically. (Please note that, as Helm is the more mature of the two, +some functions may be unavailable if you choose Ivy.) + +These completion systems are the central control towers of Spacemacs, they are +used to manage buffers, projects, search results, configuration layers, toggles +and more... + +Mastering your choice of completion system will make you a Spacemacs power user. + +*** Helm +Do not hesitate to read the [[https://github.com/emacs-helm/helm/wiki][Helm documentation wiki]]. + +**** C-z and Tab switch +The command bound to ~C-z~ is much more useful than the one bound to Tab, so it +makes sense to swap them. It's also recommended [[http://tuhdo.github.io/helm-intro.html][here]]. + +**** Helm focus +If you find yourself unable to return focus to Helm (after a careless +mouse-click for example), use ~SPC w b~ to return focus to the minibuffer. + +**** Helm transient state +Spacemacs defines a [[Transient-states][transient state]] for =Helm= to make it work like [[https://github.com/Shougo/unite.vim][Vim's Unite]] +plugin. + +Initiate the transient state with ~M-SPC~ or ~s-M-SPC~ while in a =Helm= buffer. + +| Key Binding | Description | +|----------------------+------------------------------------------------------| +| ~M-SPC~ or ~s-M-SPC~ | initiate the transient state | +| ~q~ | quit transient state | +| ~TAB~ | switch to actions page and leave the transient state | +| ~1~ | execute action 0 | +| ~2~ | execute action 1 | +| ~3~ | execute action 2 | +| ~4~ | execute action 3 | +| ~5~ | execute action 4 | +| ~6~ | execute action 5 | +| ~7~ | execute action 6 | +| ~8~ | execute action 7 | +| ~9~ | execute action 8 | +| ~0~ | execute action 9 | +| ~a~ | switch to actions page | +| ~g~ | go to first candidate | +| ~G~ | go to last candidate | +| ~h~ | go to previous source | +| ~j~ | select next candidate | +| ~k~ | select previous candidate | +| ~l~ | go to next source | +| ~t~ | mark current candidate | +| ~T~ | mark all candidates | +| ~v~ | execute persistent action | + +** Discovering +*** Key bindings +**** Which-key +A help buffer is displayed each time the ~SPC~ key is pressed in normal mode. +It lists the available key bindings and their associated commands. + +By default the [[https://github.com/justbur/emacs-which-key][which-key]] buffer will be displayed quickly after the key has been +pressed. You can change the delay by setting the variable +=dotspacemacs-which-key-delay= to your liking (the value is in second). + +**** Helm describe key bindings +It is possible to search for specific key bindings by pressing ~SPC ?~. + +To narrow the list to some key bindings using the leader key type a pattern like +this regular expression: ~SPC\ b~ which would list all =buffer= related +bindings. + +*** Getting help +=Describe functions= are powerful Emacs introspection commands to get +information about functions, variables, modes etc. These commands are bound +thusly: + +| Key Binding | Description | +|-------------+-----------------------------------------------------------| +| ~SPC h d b~ | describe bindings in a =helm= buffer | +| ~SPC h d c~ | describe current character under point | +| ~SPC h d d~ | describe current expression under point | +| ~SPC h d f~ | describe a function | +| ~SPC h d F~ | describe a face | +| ~SPC h d k~ | describe a key | +| ~SPC h d K~ | describe a keymap | +| ~SPC h d l~ | copy last pressed keys that you can paste in gitter chat | +| ~SPC h d m~ | describe current modes | +| ~SPC h d p~ | describe a package (Emacs built-in function) | +| ~SPC h d P~ | describe a package (Spacemacs layer information) | +| ~SPC h d s~ | copy system information that you can paste in gitter chat | +| ~SPC h d t~ | describe a theme | +| ~SPC h d v~ | describe a variable | + +Other help key bindings: + +| Key Binding | Description | +|-------------+--------------------------------------------------------------------| +| ~SPC h SPC~ | discover Spacemacs documentation, layers and packages using =helm= | +| ~SPC h i~ | search in info pages with the symbol at point | +| ~SPC h k~ | show top-level bindings with =which-key= | +| ~SPC h m~ | search available man pages | +| ~SPC h n~ | browse emacs news | + +Navigation key bindings in =help-mode=: + +| Key Binding | Description | +|--------------+-----------------------------------------------------| +| ~g b~ or ~[~ | go back (same as clicking on =[back]= button) | +| ~g f~ or ~]~ | go forward (same as clicking on =[forward]= button) | +| ~g h~ | go to help for symbol under point | + +Reporting an issue: + +| Key Binding | Description | +|-----------------+------------------------------------------------------------------------------------------| +| ~SPC h I~ | Open Spacemacs GitHub issue page with pre-filled information | +| ~SPC u SPC h I~ | Open Spacemacs GitHub issue page with pre-filled information - include last pressed keys | + +/Note:/ If these two bindings are used with the =*Backtrace*= buffer open, the +backtrace is automatically included + +*** Available layers +All layers can be easily discovered via =helm-spacemacs-help= accessible with +~SPC h SPC~. + +The following helm actions are available: + - default: open the layer =README.org= + - 2nd: open the layer =packages.el= + +**** Available packages in Spacemacs +=helm-spacemacs-help= also lists all the packages available in Spacemacs. The +entry format is =(layer) packages=. If you type =flycheck= you'll be able to see +all the layers where =flycheck= is used. + +The following helm actions are available on packages: + - default: go the package init function + +**** New packages from ELPA repositories +=package-list-packages= is where you can browse for all available packages in the +different Elpa repositories. It is possible to upgrade packages from there but +it is not recommended, use the =[Update Packages]= link on the Spacemacs startup +page instead. + +Spacemacs uses [[https://github.com/Bruce-Connor/paradox][Paradox]] instead of =package-list-packages= to list available +ELPA packages. Paradox enhances the package list buffer with better feedbacks, +new filters and Github information like the number of stars. Optionally you can +also star packages directly in the buffer. + +*Important Note 1*: Installing a new package from =Paradox= won't make it +persistent. To install a package persistently you have to add it explicitly to a +configuration layer. + +*Important Note 2*: Don't /update/ your packages from =Paradox= or +=package-list-packages= because they don't support the rollback feature of +Spacemacs. + +| Key Binding | Description | +|-------------+-------------------------------------------------------| +| ~SPC a k~ | launch =paradox= | +| ~/~ | evil-search | +| ~f k~ | filter by keywords | +| ~f r~ | filter by regexp | +| ~f u~ | display only installed package with updates available | +| ~h~ | go left | +| ~H~ | show help (not accurate) | +| ~j~ | go down | +| ~k~ | go up | +| ~l~ | go right | +| ~L~ | show last commits | +| ~n~ | next search occurrence | +| ~N~ | previous search occurrence | +| ~o~ | open package homepage | +| ~r~ | refresh | +| ~S P~ | sort by package name | +| ~S S~ | sort by status (installed, available, etc...) | +| ~S *~ | sort by Github stars | +| ~v~ | =visual state= | +| ~V~ | =visual-line state= | +| ~x~ | execute (action flags) | + +*** Toggles +=helm-spacemacs-help= is also a central place to discover the available toggles. +To display only the toggles source press ~C-l~ (or in [[Helm transient state][Helm transient state]] you can +press just ~l~). + +The following helm actions are available on packages: + - default: toggle on/off + +*Tips* Use ~SPC h l~ to resume the last helm session. It is handy to quickly +toggle on and off a toggle. + +** Navigating +*** Point/Cursor +Navigation is performed using the Vi key bindings ~hjkl~. + +| Key Binding | Description | +|-------------+-----------------------------------------------------------------------------------| +| ~h~ | move cursor left | +| ~j~ | move cursor down | +| ~k~ | move cursor up | +| ~l~ | move cursor right | +| ~H~ | move cursor to the top of the screen | +| ~L~ | move cursor to the bottom of the screen | +| ~SPC j 0~ | go to the beginning of line (and set a mark at the previous location in the line) | +| ~SPC j $~ | go to the end of line (and set a mark at the previous location in the line) | +| ~SPC t -~ | lock the cursor at the center of the screen | + +**** Smooth scrolling +[[https://github.com/aspiers/smooth-scrolling][smooth-scrolling]] prevent the point to jump when it reaches the top or +bottom of the screen. It is enabled by default. + +On Windows, you may want to disable it. To disable the smooth scrolling set the +=dotspacemacs-smooth-scrolling= variable in your =~/.spacemacs= to =nil=: + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-smooth-scrolling nil) +#+END_SRC + +You can also toggle smooth scrolling with ~SPC t v~. + +*** Vim motions with avy +Spacemacs uses the =evil= integration of [[https://github.com/abo-abo/avy][avy]] which enables the +invocation of =avy= during motions. + +For instance, it is useful for deleting a set of visual lines from the current line. +Try the following sequence in a buffer containing some text: ~d SPC j l~, followed by +selecting an avy candidate. + +| Key Binding | Description | +|-------------+----------------------------------------------------| +| ~SPC j b~ | go back to the previous location (before the jump) | +| ~SPC j j~ | initiate avy jump char | +| ~SPC j w~ | initiate avy jump word | +| ~SPC j l~ | initiate avy jump line | + +**** ace-link mode +Similar to =avy=, [[https://github.com/abo-abo/ace-link][ace-link]] allows one to jump to any link in +=help-mode= and =info-mode= with two key strokes. + +| Key Binding | Description | +|-------------+-------------------------------------------------------| +| ~o~ | initiate ace link mode in =help-mode= and =info-mode= | + +*** Unimpaired bindings +Spacemacs comes with a built-in port of [[https://github.com/tpope/vim-unimpaired][tpope's vim-unimpaired]]. + +This plugin provides several pairs of bracket maps using ~[~ to denote +previous, and ~]~ as next. + +| KeyBindings | Description | +|-------------+----------------------------------| +| ~[ SPC~ | Insert space above | +| ~] SPC~ | Insert space below | +| ~[ b~ | Go to previous buffer | +| ~] b~ | Go to next buffer | +| ~[ f~ | Go to previous file in directory | +| ~] f~ | Go to next file in directory | +| ~[ l~ | Go to the previous error | +| ~] l~ | Go to the next error | +| ~[ h~ | Go to the previous vcs hunk | +| ~] h~ | Go to the next vcs hunk | +| ~[ q~ | Go to the previous error | +| ~] q~ | Go to the next error | +| ~[ t~ | Go to the previous frame | +| ~] t~ | Go to the next frame | +| ~[ w~ | Go to the previous window | +| ~] w~ | Go to the next window | +| ~[ e~ | Move line up | +| ~] e~ | Move line down | +| ~[ p~ | Paste above current line | +| ~] p~ | Paste below current line | +| ~g p~ | Select pasted text | + +*** Jumping, Joining and Splitting +The ~SPC j~ prefix is for jumping, joining and splitting. + +**** Jumping + +| Key Binding | Description | +|-------------+-----------------------------------------------------------------------------------| +| ~SPC j 0~ | go to the beginning of line (and set a mark at the previous location in the line) | +| ~SPC j $~ | go to the end of line (and set a mark at the previous location in the line) | +| ~SPC j b~ | undo a jump (go back to previous location) | +| ~SPC j d~ | jump to a listing of the current directory | +| ~SPC j D~ | jump to a listing of the current directory (other window) | +| ~SPC j f~ | jump to the definition of an Emacs Lisp function | +| ~SPC j i~ | jump to a definition in buffer (imenu) | +| ~SPC j I~ | jump to a definition in any buffer (imenu) | +| ~SPC j j~ | jump to a character in the buffer (works as an evil motion) | +| ~SPC j J~ | jump to a suite of two characters in the buffer (works as an evil motion) | +| ~SPC j k~ | jump to next line and indent it using auto-indent rules | +| ~SPC j l~ | jump to a line with avy (works as an evil motion) | +| ~SPC j q~ | show the dumb-jump quick look tooltip | +| ~SPC j u~ | jump to a URL in the current buffer | +| ~SPC j v~ | jump to the definition/declaration of an Emacs Lisp variable | +| ~SPC j w~ | jump to a word in the current buffer (works as an evil motion) | + +**** Joining and splitting + +| Key Binding | Description | +|-------------+--------------------------------------------------------------------------| +| ~J~ | join the current line with the next line | +| ~SPC j k~ | go to next line and indent it using auto-indent rules | +| ~SPC j n~ | split the current line at point, insert a new line and auto-indent | +| ~SPC j s~ | split a quoted string or s-expression in place | +| ~SPC j S~ | split a quoted string or s-expression, insert a new line and auto-indent | + +*** Window manipulation +**** Window manipulation key bindings +Every window has a number displayed at the start of the mode-line and +can be quickly accessed using =SPC number=. + +| Key Binding | Description | +|-------------+-----------------------| +| ~SPC 1~ | go to window number 1 | +| ~SPC 2~ | go to window number 2 | +| ~SPC 3~ | go to window number 3 | +| ~SPC 4~ | go to window number 4 | +| ~SPC 5~ | go to window number 5 | +| ~SPC 6~ | go to window number 6 | +| ~SPC 7~ | go to window number 7 | +| ~SPC 8~ | go to window number 8 | +| ~SPC 9~ | go to window number 9 | +| ~SPC 0~ | go to window number 0 | + +Windows manipulation commands (start with ~w~): + +| Key Binding | Description | +|------------------------+-----------------------------------------------------------------------------| +| ~SPC w =~ | balance split windows | +| ~SPC w b~ | force the focus back to the minibuffer (usefull with =helm= popups) | +| ~SPC w c~ | maximize/minimize a window and center it | +| ~SPC w C~ | maximize/minimize a window and center it using [[https://github.com/abo-abo/ace-window][ace-window]] | +| ~SPC w d~ | delete a window | +| ~SPC u SPC w d~ | delete a window and its current buffer (does not delete the file) | +| ~SPC w D~ | delete another window using [[https://github.com/abo-abo/ace-window][ace-window]] | +| ~SPC u SPC w D~ | delete another window and its current buffer using [[https://github.com/abo-abo/ace-window][ace-window]] | +| ~SPC w t~ | toggle window dedication (dedicated window cannot be reused by a mode) | +| ~SPC w f~ | toggle follow mode | +| ~SPC w F~ | create new frame | +| ~SPC w h~ | move to window on the left | +| ~SPC w H~ | move window to the left | +| ~SPC w j~ | move to window below | +| ~SPC w J~ | move window to the bottom | +| ~SPC w k~ | move to window above | +| ~SPC w K~ | move window to the top | +| ~SPC w l~ | move to window on the right | +| ~SPC w L~ | move window to the right | +| ~SPC w m~ | maximize/minimize a window (maximize is equivalent to delete other windows) | +| ~SPC w M~ | swap windows using [[https://github.com/abo-abo/ace-window][ace-window]] | +| ~SPC w o~ | cycle and focus between frames | +| ~SPC w p m~ | open messages buffer in a popup window | +| ~SPC w p p~ | close the current sticky popup window | +| ~SPC w r~ | rotate windows forward | +| ~SPC w R~ | rotate windows backward | +| ~SPC w s~ or ~SPC w -~ | horizontal split | +| ~SPC w S~ | horizontal split and focus new window | +| ~SPC w u~ | undo window layout (used to effectively undo a closed window) | +| ~SPC w U~ | redo window layout | +| ~SPC w v~ or ~SPC w /~ | vertical split | +| ~SPC w V~ | vertical split and focus new window | +| ~SPC w w~ | cycle and focus between windows | +| ~SPC w W~ | select window using [[https://github.com/abo-abo/ace-window][ace-window]] | + +**** Window manipulation transient state +A convenient window manipulation transient state allows performing most of the +actions listed above. The transient state allows additional actions as well like +window resizing. + +| Key Binding | Description | +|---------------+---------------------------------------------------------------| +| ~SPC w .~ | initiate transient state | +| ~?~ | display the full documentation in minibuffer | +| ~0~ | go to window number 0 | +| ~1~ | go to window number 1 | +| ~2~ | go to window number 2 | +| ~3~ | go to window number 3 | +| ~4~ | go to window number 4 | +| ~5~ | go to window number 5 | +| ~6~ | go to window number 6 | +| ~7~ | go to window number 7 | +| ~8~ | go to window number 8 | +| ~9~ | go to window number 9 | +| ~/~ | vertical split | +| ~-~ | horizontal split | +| ~[~ | shrink window horizontally | +| ~]~ | enlarge window horizontally | +| ~{~ | shrink window vertically | +| ~}~ | enlarge window vertically | +| ~d~ | delete window | +| ~D~ | delete other windows | +| ~g~ | toggle =golden-ratio= on and off | +| ~h~ | go to window on the left | +| ~j~ | go to window below | +| ~k~ | go to window above | +| ~l~ | go to window on the right | +| ~H~ | move window to the left | +| ~J~ | move window to the bottom | +| ~K~ | move bottom to the top | +| ~L~ | move window to the right | +| ~o~ | focus other frame | +| ~r~ | rotate windows forward | +| ~R~ | rotate windows backward | +| ~s~ | horizontal split | +| ~S~ | horizontal split and focus new window | +| ~u~ | undo window layout (used to effectively undo a closed window) | +| ~U~ | redo window layout | +| ~v~ | vertical split | +| ~V~ | horizontal split and focus new window | +| ~w~ | focus other window | +| Any other key | leave the transient state | + +**** Golden ratio +If you resize windows like crazy you may want to give a try to [[https://github.com/roman/golden-ratio.el][golden-ratio]]. + +=golden-ratio= resizes windows dynamically depending on whether they are +selected or not. By default =golden-ratio= is off. + +The mode can be toggled on and off with ~SPC t g~. + +*** Buffers and Files +By default Spacemacs uses =helm= to open files. + +**** Buffers manipulation key bindings +Buffer manipulation commands (start with ~b~): + +| Key Binding | Description | +|-----------------+--------------------------------------------------------------------------| +| ~SPC TAB~ | switch to alternate buffer in the current window (switch back and forth) | +| ~SPC b b~ | switch to a buffer using [[https://github.com/emacs-helm/helm][helm]] | +| ~SPC b d~ | kill the current buffer (does not delete the visited file) | +| ~SPC u SPC b d~ | kill the current buffer and window (does not delete the visited file) | +| ~SPC b D~ | kill a visible buffer using [[https://github.com/abo-abo/ace-window][ace-window]] | +| ~SPC u SPC b D~ | kill a visible buffer and its window using [[https://github.com/abo-abo/ace-window][ace-window]] | +| ~SPC b C-d~ | kill buffers using a regular expression | +| ~SPC b e~ | erase the content of the buffer (ask for confirmation) | +| ~SPC b h~ | open =*spacemacs*= home buffer | +| ~SPC b n~ | switch to next buffer avoiding special buffers | +| ~SPC b m~ | kill all buffers except the current one | +| ~SPC u SPC b m~ | kill all buffers and windows except the current one | +| ~SPC b M~ | kill all buffers matching the regexp | +| ~SPC b p~ | switch to previous buffer avoiding special buffers | +| ~SPC b P~ | copy clipboard and replace buffer (useful when pasting from a browser) | +| ~SPC b R~ | revert the current buffer (reload from disk) | +| ~SPC b s~ | switch to the =*scratch*= buffer (create it if needed) | +| ~SPC b w~ | toggle read-only (writable state) | +| ~SPC b Y~ | copy whole buffer to clipboard (useful when copying to a browser) | +| ~z f~ | Make current function or comments visible in buffer as much as possible | + +**** Buffers manipulation transient state +A convenient buffer manipulation transient state allows to quickly cycles through +the opened buffer and kill them. + +| Key Binding | Description | +|---------------+-----------------------------------------------| +| ~SPC b .~ | initiate transient state | +| ~K~ | kill current buffer | +| ~n~ | go to next buffer (avoid special buffers) | +| ~N~ | go to previous buffer (avoid special buffers) | +| Any other key | leave the transient state | + +**** Special Buffers +Unlike vim, emacs creates many buffers that most people do not need to see. Some +examples are =*Messages*= and =*Compile-Log*=. Spacemacs tries to automatically +ignore buffers that are not useful. However, you may want to change the way +Spacemacs marks buffers as useful. For instructions, see the [[file:FAQ.org::Change%20special%20buffer%20rules?][special buffer howto]]. + +**** Files manipulations key bindings +Files manipulation commands (start with ~f~): + +| Key Binding | Description | +|-------------+---------------------------------------------------------------------------------------------------------------------------------| +| ~SPC f b~ | go to file bookmarks | +| ~SPC f c~ | copy current file to a different location | +| ~SPC f C d~ | convert file from unix to dos encoding | +| ~SPC f C u~ | convert file from dos to unix encoding | +| ~SPC f D~ | delete a file and the associated buffer (ask for confirmation) | +| ~SPC f E~ | open a file with elevated privileges (sudo edit) | +| ~SPC f f~ | open file with =helm= | +| ~SPC f F~ | try to open the file under point =helm= | +| ~SPC f h~ | open binary file with =hexl= (a hex editor) | +| ~SPC f j~ | jump to the current buffer file in dired | +| ~SPC f J~ | open a junk file, in mode determined by the file extension provided (defaulting to =fundamental mode=), using =helm= (or =ivy=) | +| ~SPC f l~ | open file literally in =fundamental mode= | +| ~SPC f L~ | Locate a file (using =locate=) | +| ~SPC f o~ | open a file using the default external program | +| ~SPC f R~ | rename the current file | +| ~SPC f s~ | save a file | +| ~SPC f S~ | save all files | +| ~SPC f r~ | open a recent file with =helm= | +| ~SPC f t~ | toggle file tree side bar using [[https://github.com/jaypei/emacs-neotree][NeoTree]] | +| ~SPC f v d~ | add a directory variable | +| ~SPC f v f~ | add a local variable to the current file | +| ~SPC f v p~ | add a local variable to the first line of the current file | +| ~SPC f y~ | show and copy current file absolute path in the minibuffer | + +**** Emacs and Spacemacs files +Convenient key bindings are located under the prefix ~SPC f e~ to quickly +navigate between =Emacs= and Spacemacs specific files. + +| Key Binding | Description | +|-------------+-----------------------------------------------------------------| +| ~SPC f e d~ | open the spacemacs dotfile (=~/.spacemacs=) | +| ~SPC f e D~ | open =ediff= buffer of =~/.spacemacs= and =.spacemacs.template= | +| ~SPC f e f~ | discover the =FAQ= using =helm= | +| ~SPC f e i~ | open the all mighty =init.el= | +| ~SPC f e l~ | locate an Emacs library | +| ~SPC f e R~ | resync the dotfile with spacemacs | +| ~SPC f e v~ | display and copy the spacemacs version | + +**** Browsing files with Helm +In =vim= and =hybrid= styles, Spacemacs remap the navigation in Helm find-files +to keep finger on the home row. + +| Key Binding | Description | +|-------------+-----------------------------------| +| ~C-h~ | go up one level (parent directory | +| ~C-H~ | describe key (replace ~C-h~) | +| ~C-j~ | go to previous candidate | +| ~C-k~ | go to next candidate | +| ~C-l~ | enter current directory | + +*** Ido +Spacemacs displays the =ido= minibuffer vertically thanks to the +[[https://github.com/gempesaw/ido-vertical-mode.el][ido-vertical-mode]]. + +Basic =ido= operations can be done with ~Ctrl~ key: + +| Key Binding | Description | +|--------------------+---------------------------------------------------| +| ~C-~ | open a =dired buffer= | +| ~M-~ | open a =dired buffer= in terminal | +| ~C-d~ | delete selected file (ask for confirmation) | +| ~C-h~ | go to parent directory | +| ~C-j~ | select next file or directory | +| ~C-k~ | select previous file or directory | +| ~C-l~ | open the selected file | +| ~C-n~ | select next file or directory | +| ~C-o~ | open selected file in other window | +| ~C-p~ | select previous file or directory | +| ~C-s~ | open selected file in a vertically split window | +| ~C-t~ | open selected file in a new frame | +| ~C-v~ | open selected file in a horizontally split window | +| ~C-S-h~ | go to previous directory | +| ~C-S-j~ or ~C-S-n~ | next history element | +| ~C-S-k~ or ~C-S-p~ | previous history element | +| ~C-S-l~ | go to next directory | + +*** Ido transient state +Spacemacs defines a [[Transient-states][transient state]] for =ido=. + +Initiate the transient state with ~M-SPC~ or ~s-M-SPC~ while in an =ido= buffer. + +| Key Binding | Description | +|----------------------+---------------------------------------| +| ~M-SPC~ or ~s-M-SPC~ | initiate or leave the transient state | +| ~?~ | display help | +| ~e~ | open dired | +| ~h~ | delete backward or parent directory | +| ~j~ | next match | +| ~J~ | sub directory | +| ~k~ | previous match | +| ~K~ | parent directory | +| ~l~ | select match | +| ~n~ | next directory in history | +| ~o~ | open in other window | +| ~p~ | previous directory in history | +| ~q~ | quit transient state | +| ~s~ | open in a new horizontal split | +| ~t~ | open in other frame | +| ~v~ | open in a new vertical split | + +*** NeoTree file tree +Spacemacs provides a quick and simple way to navigate in an unknown project +file tree with [[https://github.com/jaypei/emacs-neotree][NeoTree]]. + +To toggle the =NeoTree= buffer press ~SPC f t~ or ~SPC p t~ (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 ~SPC 0~. + +VCS integration is supported, the file color will change depending on its +current state. With default =spacemacs-dark= theme: +- green: new file +- purple: modified file + +**** NeoTree navigation +Navigation is centered on the ~hjkl~ keys with the hope of providing a fast +navigation experience like in [[http://ranger.nongnu.org/][ranger]]: + +| Key Binding | Description | +|--------------+-------------------------------------------------------------------------------| +| ~h~ | collapse expanded directory or go to parent node | +| ~H~ | select previous sibling | +| ~j~ | select next file or directory | +| ~J~ | select next expanded directory on level down | +| ~k~ | select previous file or directory | +| ~K~ | select parent directory, when reaching the root change it to parent directory | +| ~l~ or ~RET~ | expand directory | +| ~L~ | select next sibling | +| ~R~ | make a directory the root directory | + +*Note*: Point is automatically set to the first letter of a node for a smoother +experience. + +**** Opening files with NeoTree +By default a file is opened in the last active window. It is possible to choose +window number where to open a file by using a numeric argument, for instance ~2 +l~ or ~2 RET~ will open the current file in window 2. It is also possible to +open the file in a split window with ~|~ and ~-~: + +| Key Binding | Description | +|------------------+-------------------------------------------| +| ~l~ or ~RET~ | open file in last active window | +| ~# l~ or ~# RET~ | open file in window number =#= | +| ~¦~ | open file in an vertically split window | +| ~-~ | open file in an horizontally split window | + +**** Other NeoTree key bindings + +| Key Binding | Description | +|-------------+---------------------------------| +| ~TAB~ | toggle stretching of the buffer | +| ~c~ | create a node | +| ~d~ | delete a node | +| ~gr~ | refresh | +| ~s~ | toggle showing of hidden files | +| ~q~ or ~fd~ | hide =NeoTree= buffer | +| ~r~ | rename a node | +| ~?~ | show help | + +**** NeoTree mode-line +The mode-line has the following format =[x/y] d (D:a, F:b)= where: + - =x= is the index of the current selected file or directory + - =y= the total number of items (file and directory) in the current directory + - =d= the name of the current directory + - =a= the number of directories in the current directory + - =b= the number of files in the current directory + +**** NeoTree Source Control Integration +If you would like NeoTree to show source control information, you can use the +setting =neo-vc-integration=. It is a list containing the possible values: + +| Setting | Description | +|---------+---------------------------------------------------------------------------| +| =face= | Show information by changing the color of the file/directory name. | +| =char= | Show information with a character to the left of the file/directory name. | + +The default is =nil= (do not show source control information), which is recommended. + +For example, + +#+BEGIN_SRC emacs-lisp +(setq neo-vc-integration 'face) +#+END_SRC + +*Note*: At this time, it is not recommended to set this to anything other +than =nil=. Otherwise, it will become very slow with larger source trees. +See https://github.com/jaypei/emacs-neotree/issues/126 for more information. + +**** NeoTree Theme +You can change the NeoTree theme by using the setting =neo-theme=. Possible +values are: + +| Setting | Description | +|-----------+------------------------------------------------------------------| +| =classic= | Use an icon to display items - only suitable for gui mode. | +| =ascii= | The simplest style, it will use =x=, =-= to display fold status. | +| =arrow= | Use unicode arrows to display fold status. | +| =nerd= | Use the NERDTree indentation mode and arrows. | + +The default is =classic=. + +Use =nerd= if you want it to look most like NERDTree in VIM. For example: + +#+BEGIN_SRC emacs-lisp +(setq neo-theme 'nerd) +#+END_SRC + +*** Bookmarks +Bookmarks can be set anywhere in a file. Bookmarks are persistent. They are very +useful to jump to/open a known project. Spacemacs uses =helm-bookmarks= to +manage them. + +Open an =helm= window with the current bookmarks by pressing: ~SPC f b~ + +Then in the =helm-bookmarks= buffer: + +| Key Binding | Description | +|-------------+----------------------------------------------| +| ~C-d~ | delete the selected bookmark | +| ~C-e~ | edit the selected bookmark | +| ~C-f~ | toggle filename location | +| ~C-o~ | open the selected bookmark in another window | + +To save a new bookmark, just type the name of the bookmark and press ~RET~. + +*** DocView mode +=doc-view-mode= is a built-in major mode to view DVI, PostScript (PS), PDF, +OpenDocument, and Microsoft Office documents. + +| Key Binding | Description | +|-------------+------------------------------------------| +| ~/~ | search forward | +| ~?~ | search backward | +| ~+~ | enlarge | +| ~-~ | shrink | +| ~gg~ | go to first page | +| ~G~ | go to last page | +| ~gt~ | go to page number | +| ~h~ | previous page | +| ~H~ | adjust to height | +| ~j~ | next line | +| ~k~ | previous line | +| ~K~ | kill proc and buffer | +| ~l~ | next page | +| ~n~ | go to next search occurrence | +| ~N~ | go to previous search occurrence | +| ~P~ | fit page to window | +| ~r~ | revert | +| ~W~ | adjust to width | +| ~C-d~ | scroll down | +| ~C-k~ | kill proc | +| ~C-u~ | scroll up | +| ~C-c C-c~ | toggle display text and image display | +| ~C-c C-t~ | open new buffer with doc's text contents | + +** Auto-saving +*** Frequency of auto-saving +By default auto-saving of files is performed every 300 characters and +every 30 seconds of idle time which can be changed by setting to a +new value the variables =auto-save-inteval= and =auto-save-timeout= +respectively. + +*** Location of auto-saved files +Auto-save of modified files can be performed in-place on the original file +itself /or/ in the cache directory (in this case the original file will remain +unsaved). By default Spacemacs auto-save the file in the cache directory. + +To modify the location set the variable =dotspacemacs-auto-save-file-location= +to =original= or =cache=. + +Local files are auto-saved in a sub-directory called =site= in the =cache= +directory whereas remote files (i.e. files edited over TRAMP) are auto-saved +in a sub-directory called =dist=. + +*** Disable auto-save +To disable auto-saving set the variable =dotspacemacs-auto-save-file-location= +to =nil=. + +You can toggle auto-save in a buffer by calling the command =auto-save-mode=. + +** Searching +*** With an external tool +Spacemacs can be interfaced with different search utilities like: + - ack + - grep + - [[https://github.com/ggreer/the_silver_searcher][ag]] + - [[https://github.com/monochromegane/the_platinum_searcher][pt]] + +The search commands in Spacemacs are organized under the ~SPC s~ prefix with the +next key is the tool to use and the last key is the scope. For instance ~SPC s a +b~ will search in all opened buffers using =ag=. + +If the last key (determining the scope) is uppercase then the current region or +symbol under point is used as default input for the search. For instance ~SPC s +a B~ will search with symbol under point (if there is no active region). + +If the tool key is omitted then a default tool will be automatically selected +for the search. This tool corresponds to the first tool found on the system of +the list =dotspacemacs-search-tools=, the default order is =ag=, =pt=, =ack= +then =grep=. For instance ~SPC s b~ will search in the opened buffers using =pt= +if =ag= has not been found on the system. + +The tool keys are: + +| Tool | Key | +|------+-----| +| ag | a | +| grep | g | +| ack | k | +| pt | t | + +The available scopes and corresponding keys are: + +| Scope | Key | +|----------------------------+-----| +| opened buffers | b | +| files in a given directory | f | +| current project | p | + +It is possible to search in the current file by double tapping the second key +of the sequence, for instance ~SPC s a a~ will search in the current +file with =ag=. + +*Notes*: +- =ag= and =pt= are optimized to be used in a source control repository but + they can be used in an arbitrary directory as well. +- It is also possible to search in several directories at once by marking + them in the helm buffer. + +*Beware* if you use =pt=, [[https://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/apps/pt.html][TCL parser tools]] also install a command line tool +called =pt=. + +**** Useful key bindings + +| Key Binding | Description | +|------------------------+---------------------------------------------------------------| +| ~F3~ | in a =helm= or =ivy= buffer, save results to a regular buffer | +| ~SPC r l~ | resume the last =completion= buffer | +| ~SPC r s~ or ~SPC s l~ | resume search buffer (completion or converted search buffer) | +| ~SPC s `~ | go back to the previous place reached with =helm-ag= | +| Prefix argument | will ask for file extensions | + +When results have been saved in a regular buffer with ~F3~, that buffer supports +browsing through the matches with Spacemacs’ =next-error= and =previous-error= +bindings (~SPC e n~ and ~SPC e p~) as well as the error transient state (~SPC e~). + +**** Searching in current file + +| Key Binding | Description | +|-------------+-----------------------------------------------------| +| ~SPC s s~ | search with the first found tool | +| ~SPC s S~ | search with the first found tool with default input | +| ~SPC s a a~ | =ag= | +| ~SPC s a A~ | =ag= with default input | +| ~SPC s g g~ | =grep= | +| ~SPC s g G~ | =grep= with default input | + +**** Searching in all open buffers visiting files + +| Key Binding | Description | +|-------------+-----------------------------------------------------| +| ~SPC s b~ | search with the first found tool | +| ~SPC s B~ | search with the first found tool with default input | +| ~SPC s a b~ | =ag= | +| ~SPC s a B~ | =ag= with default text | +| ~SPC s g b~ | =grep= | +| ~SPC s g B~ | =grep= with default text | +| ~SPC s k b~ | =ack= | +| ~SPC s k B~ | =ack= with default text | +| ~SPC s t b~ | =pt= | +| ~SPC s t B~ | =pt= with default text | + +**** Searching in files in an arbitrary directory + +| Key Binding | Description | +|-------------+-----------------------------------------------------| +| ~SPC s f~ | search with the first found tool | +| ~SPC s F~ | search with the first found tool with default input | +| ~SPC s a f~ | =ag= | +| ~SPC s a F~ | =ag= with default text | +| ~SPC s g f~ | =grep= | +| ~SPC s g F~ | =grep= with default text | +| ~SPC s k f~ | =ack= | +| ~SPC s k F~ | =ack= with default text | +| ~SPC s t f~ | =pt= | +| ~SPC s t F~ | =pt= with default text | + +**** Searching in a project + +| Key Binding | Description | +|-----------------------+-----------------------------------------------------| +| ~SPC /~ or ~SPC s p~ | search with the first found tool | +| ~SPC *~ or ~SPC s P~ | search with the first found tool with default input | +| ~SPC s a p~ | =ag= | +| ~SPC s a P~ | =ag= with default text | +| ~SPC s g p~ | =grep= with default text | +| ~SPC s k p~ | =ack= | +| ~SPC s k P~ | =ack= with default text | +| ~SPC s t p~ | =pt= | +| ~SPC s t P~ | =pt= with default text | + +*Hint*: It is also possible to search in a project without needing to open a +file beforehand. To do so use ~SPC p p~ and then ~C-s~ on a given project to +directly search into it like with ~SPC s p~. + +**** Searching the web + +| Key Binding | Description | +|-------------+----------------------------------------------------------------------| +| ~SPC s w g~ | Get Google suggestions in emacs. Opens Google results in Browser. | +| ~SPC s w w~ | Get Wikipedia suggestions in emacs. Opens Wikipedia page in Browser. | + +*** Persistent highlighting +Spacemacs uses =evil-search-highlight-persist= to keep the searched expression +highlighted until the next search. It is also possible to clear the highlighting +by pressing ~SPC s c~ or executing the ex command =:noh=. + +*** Highlight current symbol +Spacemacs supports highlighting of the current symbol on demand (provided by +[[https://github.com/emacsmirror/auto-highlight-symbol][auto-highlight-symbol]] mode) and adds a transient state to easily navigate and rename +this symbol. + +It is also possible to change the range of the navigation on the fly to: + - buffer + - function + - visible area + +To initiate the highlighting of the current symbol under point press ~SPC s h~. + +Navigation between the highlighted symbols can be done with the commands: + +| Key Binding | Description | +|-------------+------------------------------------------------------------------------------------| +| ~*~ | initiate navigation transient state on current symbol and jump forwards | +| ~#~ | initiate navigation transient state on current symbol and jump backwards | +| ~SPC s e~ | edit all occurrences of the current symbol(/) | +| ~SPC s h~ | highlight the current symbol and all its occurrence within the current range | +| ~SPC s H~ | go to the last searched occurrence of the last highlighted symbol | +| ~SPC t h a~ | toggle automatic highlight of symbol under point after =ahs-idle-interval= seconds | + +In 'Spacemacs' highlight symbol transient state: + +| Key Binding | Description | +|---------------+---------------------------------------------------------------| +| ~e~ | edit occurrences (*) | +| ~n~ | go to next occurrence | +| ~N~ | go to previous occurrence | +| ~d~ | go to next definition occurrence | +| ~D~ | go to previous definition occurrence | +| ~r~ | change range (=function=, =display area=, =whole buffer=) | +| ~R~ | go to home occurrence (reset position to starting occurrence) | +| Any other key | leave the navigation transient state | + +(*) using [[https://github.com/tsdh/iedit][iedit]] or the default implementation +of =auto-highlight-symbol= + +The transient state text in minibuffer display the following information: + +#+BEGIN_EXAMPLE + [6/11]* press (n/N) to navigate, (e) to edit, (r) to change range or (R) + for reset +#+END_EXAMPLE + +Where = [x/y]*= is: + - M: the current range mode + - ==: whole buffer range + - ==: current display range + - ==: current function range + - =x=: the index of the current highlighted occurrence + - =y=: the total number of occurrences + - =*=: appears if there is at least one occurrence which is not currently visible. + +*** Visual Star +With [[https://github.com/bling/evil-visualstar][evil-visualstar]] you can search for the next occurrence of the current +selection. + +It is pretty useful combined with the [[Region selection][expand-region]] bindings. + +*Note*: If the current state is not the =visual state= then pressing ~*~ uses +auto-highlight-symbol and its transient state. + +*** Listing symbols by semantic +Use =helm-semantic-or-imenu= command from =Helm= to quickly navigate between the +symbols in a buffer. + +To list all the symbols of a buffer press: ~SPC s j~ + +*** Helm-swoop +This is very similar to =moccur=, it displays a =helm= buffer with all the +occurrences of the word under point. You can then change the search query in +real-time and navigate between them easily. + +You can even edit the occurrences directly in the =helm= buffer and apply the +modifications to the buffer. + +| Key Binding | Description | +|-------------+--------------------------------| +| ~SPC s s~ | execute =helm-swoop= | +| ~SPC s S~ | execute =helm-multi-swoop= | +| ~SPC s C-s~ | execute =helm-multi-swoop-all= | + +** Editing +*** Paste text +**** Paste Transient-state +The paste transient state can be enabled by settings the variable +=dotspacemacs-enable-paste-transient-state= to =t=. By default it is disabled. + +When the transient state is enabled, pressing ~p~ again will replace the pasted text +with the previous yanked (copied) text on the kill ring. + +For example if you copy =foo= and =bar= then press ~p~ the text =bar= will +be pasted, pressing ~p~ again will replace =bar= with =foo=. + +| Key Binding | Description | +|---------------+-------------------------------------------------------------------------------| +| ~p~ or ~P~ | paste the text before or after point and initiate the =paste= transient state | +| ~C-j~ | in transient state: replace paste text with the previously copied one | +| ~C-k~ | in transient state: replace paste text with the next copied one | +| Any other key | leave the transient state | + +**** Auto-indent pasted text +By default any pasted text will be auto-indented. To paste text un-indented use +the universal argument. + +It is possible to disable the auto-indentation for specific major-modes by +adding a major-mode to the variable =spacemacs-indent-sensitive-modes= in your +=dotspacemacs/user-config= function. + +*** Text manipulation commands +Text related commands (start with ~x~): + +| Key Binding | Description | +|-------------+---------------------------------------------------------------| +| ~SPC x a &~ | align region at & | +| ~SPC x a (~ | align region at ( | +| ~SPC x a )~ | align region at ) | +| ~SPC x a ​,​~ | align region at , | +| ~SPC x a .~ | align region at . (for numeric tables) | +| ~SPC x a :~ | align region at : | +| ~SPC x a ;~ | align region at ; | +| ~SPC x a =~ | align region at = | +| ~SPC x a a~ | align region (or guessed section) using default rules | +| ~SPC x a c~ | align current intendation region using default rules | +| ~SPC x a r~ | align region using user-specified regexp | +| ~SPC x a m~ | align region at arithmetic operators (+-*/) | +| ~SPC x a ¦~ | align region at ¦ | +| ~SPC x c~ | count the number of chars/words/lines in the selection region | +| ~SPC x d w~ | delete trailing whitespaces | +| ~SPC x g l~ | set languages used by translate commands | +| ~SPC x g t~ | translate current word using Google Translate | +| ~SPC x g T~ | reverse source and target languages | +| ~SPC x j c~ | set the justification to center | +| ~SPC x j f~ | set the justification to full | +| ~SPC x j l~ | set the justification to left | +| ~SPC x j n~ | set the justification to none | +| ~SPC x j r~ | set the justification to right | +| ~SPC x J~ | move down a line of text (enter transient state) | +| ~SPC x K~ | move up a line of text (enter transient state) | +| ~SPC x l s~ | sort lines | +| ~SPC x l u~ | uniquify lines | +| ~SPC x o~ | use avy to select a link in the frame and open it | +| ~SPC x O~ | use avy to select multiple links in the frame and open them | +| ~SPC x t c~ | swap (transpose) the current character with the previous one | +| ~SPC x t w~ | swap (transpose) the current word with the previous one | +| ~SPC x t l~ | swap (transpose) the current line with the previous one | +| ~SPC x u~ | set the selected text to lower case | +| ~SPC x U~ | set the selected text to upper case | +| ~SPC x w c~ | count the number of occurrences per word in the select region | +| ~SPC x w d~ | show dictionary entry of word from wordnik.com | +| ~SPC x TAB~ | indent or dedent a region rigidly | + +*** Text insertion commands +Text insertion commands (start with ~i~): + +| Key binding | Description | +|-------------+-----------------------------------------------------------------------| +| ~SPC i l l~ | insert lorem-ipsum list | +| ~SPC i l p~ | insert lorem-ipsum paragraph | +| ~SPC i l s~ | insert lorem-ipsum sentence | +| ~SPC i u~ | Search for Unicode characters and insert them into the active buffer. | +| ~SPC i U 1~ | insert UUIDv1 (use universal argument to insert with CID format) | +| ~SPC i U 4~ | insert UUIDv4 (use universal argument to insert with CID format) | +| ~SPC i U U~ | insert UUIDv4 (use universal argument to insert with CID format) | + +*** Smartparens Strict mode +[[https://github.com/Fuco1/smartparens][Smartparens]] comes with a strict mode which prevents deletion of parenthesis if +the result is unbalanced. + +This mode can be frustrating for novices, this is why it is not enabled by +default. + +It is possible to enable it easily for /all programming modes/ with the variable +=dotspacemacs-smartparens-strict-mode= of you =~/.spacemacs=. + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-smartparens-strict-mode t) +#+END_SRC + +*** Zooming +**** Text +The font size of the current buffer can be adjusted with the commands: + +| Key Binding | Description | +|---------------+--------------------------------------------------------------------------------| +| ~SPC z x +~ | scale up the font and initiate the font scaling transient state | +| ~SPC z x =~ | scale up the font and initiate the font scaling transient state | +| ~SPC z x -~ | scale down the font and initiate the font scaling transient state | +| ~SPC z x 0~ | reset the font size (no scaling) and initiate the font scaling transient state | +| ~+~ | increase the font size | +| ~=~ | increase the font size | +| ~-~ | decrease the font size | +| ~0~ | reset the font size | +| Any other key | leave the font scaling transient state | + +Note that /only/ the text of the current buffer is scaled, the other buffers, +the mode-line and the minibuffer are not affected. To zoom the whole content of +a frame use the =zoom frame= bindings (see next section). + +**** Frame +You can zoom in and out the whole content of the frame with the commands: + +| Key Binding | Description | +|---------------+-----------------------------------------------------------------------------| +| ~SPC z f +~ | zoom in the frame content and initiate the frame scaling transient state | +| ~SPC z f =~ | zoom in the frame content and initiate the frame scaling transient state | +| ~SPC z f -~ | zoom out the frame content and initiate the frame scaling transient state | +| ~SPC z f 0~ | reset the frame content size and initiate the frame scaling transient state | +| ~+~ | zoom in | +| ~=~ | zoom in | +| ~-~ | zoom out | +| ~0~ | reset zoom | +| Any other key | leave the zoom frame transient state | + +*** Increase/Decrease numbers +Spacemacs uses [[https://github.com/cofi/evil-numbers][evil-numbers]] to easily increase or decrease numbers. + +| Key Binding | Description | +|-------------+---------------------------------------------------------------------| +| ~SPC n +~ | increase the number under point by one and initiate transient state | +| ~SPC n -~ | decrease the number under point by one and initiate transient state | + +In transient state: + +| Key Binding | Description | +|---------------+----------------------------------------| +| ~+~ | increase the number under point by one | +| ~-~ | decrease the number under point by one | +| Any other key | leave the transient state | + +*Tips:* you can increase or decrease a value by more that once by using a prefix +argument (ie. ~10 SPC n +~ will add 10 to the number under point). + +*** Spell checking +Spell checking is enabled by including the [[../layers/spell-checking][spell +checking]] layer in your dotfile. + +Keybindings are listed in the layer documentation. + +*** Region selection +Vi =Visual= modes are all supported by =evil=. + +**** Expand-region +Spacemacs adds another =Visual= mode via the [[https://github.com/magnars/expand-region.el][expand-region]] mode. + +| Key Binding | Description | +|-------------+------------------------------------------| +| ~SPC v~ | initiate expand-region mode then... | +| ~v~ | expand the region by one semantic unit | +| ~V~ | contract the region by one semantic unit | +| ~r~ | reset the region to initial selection | +| ~ESC~ | leave expand-region mode | + +**** Indent text object +With [[https://github.com/TheBB/evil-indent-plus][evil-indent-plus]] the following text objects are available: + +- ~ii~ - Inner Indentation: the surrounding textblock with the same indentation +- ~iI~ - Above and Indentation: ~ii~ + the line above with a different indentation +- ~iJ~ - Above, Below and Indentation+: ~iI~ + the line below with a different indentation + +There are also ~a~ variants that include whitespace. Example (=|= indicates point): + +#+BEGIN_SRC emacs-lisp + (while (not done) + (messa|ge "All work and no play makes Jack a dull boy.")) + (1+ 41) +#+END_SRC + +- ~vii~ will select the line with message +- ~viI~ will select the whole while loop +- ~viJ~ will select the whole fragment + +*** Region narrowing +The displayed text of a buffer can be narrowed with the commands (start with +~n~): + +| Key Binding | Description | +|-------------+-------------------------------------------| +| ~SPC n f~ | narrow the buffer to the current function | +| ~SPC n p~ | narrow the buffer to the visible page | +| ~SPC n r~ | narrow the buffer to the selected text | +| ~SPC n w~ | widen, i.e show the whole buffer again | + +*** Replacing text with iedit +Spacemacs uses the powerful [[https://github.com/tsdh/iedit][iedit]] mode through [[https://github.com/syl20bnr/evil-iedit-state][evil-iedit-state]] to quickly +edit multiple occurrences of a symbol or selection. + +=evil-iedit-state= defines two new evil states: + - =iedit state= + - =iedit-insert state= + +The color code for these states is =red=. + +=evil-iedit-state= has also a nice integration with [[https://github.com/magnars/expand-region.el][expand-region]] for quick +editing of the currently selected text by pressing ~e~. + +**** iedit states key bindings +***** State transitions + +| Key Binding | From | To | +|-------------+------------------+--------| +| ~SPC s e~ | normal or visual | iedit | +| ~e~ | expand-region | iedit | +| ~ESC~ | iedit | normal | +| ~C-g~ | iedit | normal | +| ~fd~ | iedit | normal | +| ~ESC~ | iedit-insert | iedit | +| ~C-g~ | iedit-insert | normal | +| ~fd~ | iedit-insert | normal | + +To sum-up, in =iedit-insert state= you have to press ESC twice to go back to the +=normal state=. You can also at any time press ~C-g~ or ~fd~ to return to =normal +state=. + +*Note*: evil commands which switch to =insert state= will switch in +=iedit-insert state=. + +***** In iedit state +=iedit state= inherits from =normal state=, the following key bindings are +specific to =iedit state=. + +| Key Binding | Description | +|-------------+-----------------------------------------------------------------------------------------| +| ~ESC~ | go back to =normal state= | +| ~TAB~ | toggle current occurrence | +| ~0~ | go to the beginning of the current occurrence | +| ~$~ | go to the end of the current occurrence | +| ~#~ | prefix all occurrences with an increasing number (SPC u to choose the starting number). | +| ~A~ | go to the end of the current occurrence and switch to =iedit-insert state= | +| ~D~ | delete the occurrences | +| ~F~ | restrict the scope to the function | +| ~gg~ | go to first occurrence | +| ~G~ | go to last occurrence | +| ~I~ | go to the beginning of the current occurrence and switch to =iedit-insert state= | +| ~J~ | increase the editing scope by one line below | +| ~K~ | increase the editing scope by one line above | +| ~L~ | restrict the scope to the current line | +| ~n~ | go to next occurrence | +| ~N~ | go to previous occurrence | +| ~p~ | replace occurrences with last yanked (copied) text | +| ~S~ | (substitute) delete the occurrences and switch to =iedit-insert state= | +| ~V~ | toggle visibility of lines with no occurrence | +| ~U~ | Up-case the occurrences | +| ~C-U~ | down-case the occurrences | + +*Note*: ~0~, ~$~, ~A~ and ~I~ have the default Vim behavior when used outside of +an ~occurrence~. + +***** In iedit-insert state + +| Key Binding | Description | +|-------------+---------------------------| +| ~ESC~ | go back to =iedit state= | +| ~C-g~ | go back to =normal state= | + +**** Examples +- manual selection of several words then replace: ~v w w SPC s e S "toto" ESC ESC~ +- append text to a word on two lines: ~v i w SPC s e J i "toto" ESC ESC~ +- substitute symbol /with expand-region/: ~SPC v v e S "toto" ESC ESC~ +- replace symbol with yanked (copied) text /with expand region/: ~SPC v + e p ESC ESC~ + +*** Replacing text in several files +If you have =ag=, =pt= or =ack= installed, replacing an occurrence of text in +several files can be performed via [[https://github.com/syohex/emacs-helm-ag][helm-ag]]. + +Say you want to replace all =foo= occurrences by =bar= in your current +project: + - initiate a search with ~SPC /~ + - enter in edit mode with ~C-c C-e~ + - go to the occurrence and enter in =iedit state= with ~SPC s e~ + - edit the occurrences then leave the =iedit state= + - press ~C-c C-c~ + +*Note*: In Spacemacs, =helm-ag= despite its name works with =ack= and =pt= as +well (but not with =grep=). + +*** Renaming files in a directory +It is possible to batch rename files in a directory using =wdired= from an +=helm= session: +- browse for a directory using ~SPC f f~ +- enter =wdired= with ~C-c C-e~ +- edit the file names and use ~C-c C-c~ to confirm the changes +- use ~C-c C-k~ to abort any changes + +*** Commenting +Comments are handled by [[https://github.com/redguardtoo/evil-nerd-commenter][evil-nerd-commenter]], it's bound to the following keys. + +| Key Binding | Description | +|-------------+---------------------------| +| ~SPC ;~ | comment operator | +| ~SPC c h~ | hide/show comments | +| ~SPC c l~ | comment lines | +| ~SPC c L~ | invert comment lines | +| ~SPC c p~ | comment paragraphs | +| ~SPC c P~ | invert comment paragraphs | +| ~SPC c t~ | comment to line | +| ~SPC c T~ | invert comment to line | +| ~SPC c y~ | comment and yank | +| ~SPC c Y~ | invert comment and yank | + +*Tips:* To comment efficiently a block of line use the combo ~SPC ; SPC y~ + +*** Regular expressions +Spacemacs uses the packages [[https://github.com/joddie/pcre2el][pcre2el]] to manipulate regular expressions. It is +useful when working with =Emacs Lisp= buffers since it allows to easily converts +=PCRE= (Perl Compatible RegExp) to Emacs RegExp or =rx=. It can also be used to +"explain" a PCRE RegExp around point in =rx= form. + +The key bindings start with ~SPC x r~ and have the following mnemonic structure: + +- ~SPC x r ~ convert from source to target +- ~SPC x r~ do what I mean + +| Key Binding | Function | +|---------------+----------------------------------------------------------------------------------------| +| ~SPC x r /~ | Explain the regexp around point with =rx= | +| ~SPC x r '​~ | Generate strings given by a regexp given this list is finite | +| ~SPC x r t~ | Replace regexp around point by the =rx= form or vice versa | +| ~SPC x r x~ | Convert regexp around point in =rx= form and display the result in the minibuffer | +| ~SPC x r c~ | Convert regexp around point to the other form and display the result in the minibuffer | +| ~SPC x r e /~ | Explain Emacs Lisp regexp | +| ~SPC x r e '​~ | Generate strings from Emacs Lisp regexp | +| ~SPC x r e p~ | Convert Emacs Lisp regexp to PCRE | +| ~SPC x r e t~ | Replace Emacs Lisp regexp by =rx= form or vice versa | +| ~SPC x r e x~ | Convert Emacs Lisp regexp to =rx= form | +| ~SPC x r p /~ | Explain PCRE regexp | +| ~SPC x r p '​~ | Generate strings from PCRE regexp | +| ~SPC x r p e~ | Convert PCRE regexp to Emacs Lisp | +| ~SPC x r p x~ | Convert PCRE to =rx= form | + +*** Deleting files +Deletion is configured to send deleted files to system trash. + +On OS X the =trash= program is required. It can be installed with [[http:www.brew.sh][homebrew]] with +the following command: + +#+BEGIN_SRC sh +$ brew install trash +#+END_SRC + +To disable the trash you can set the variable =delete-by-moving-to-trash= to +=nil= in your =~/.spacemacs=. + +*** Editing Lisp code +Editing of lisp code is provided by [[https://github.com/syl20bnr/evil-lisp-state][evil-lisp-state]]. + +Commands will set the current state to =lisp state= where different commands +combo can be repeated without pressing on ~SPC k~. + +When in =lisp state= the color of the mode-line changes to pink. + +Examples: + - to slurp three times while in normal state: ~SPC k 3 s~ + - to wrap a symbol in parentheses then slurp two times: ~SPC k w 2 s~ + +*Note*: The =lisp state= commands are available in /any/ modes! Try it out. + +**** Lisp Key Bindings +***** Lisp state key bindings +These commands automatically switch to =lisp state=. + +| Key Binding | Function | +|-------------+---------------------------------------------------------------------| +| ~SPC k %~ | evil jump item | +| ~SPC k :~ | ex command | +| ~SPC k (~ | insert expression before (same level as current one) | +| ~SPC k )~ | insert expression after (same level as current one) | +| ~SPC k $~ | go to the end of current sexp | +| ~SPC k ` k~ | hybrid version of push sexp (can be used in non lisp dialects) | +| ~SPC k ` p~ | hybrid version of push sexp (can be used in non lisp dialects) | +| ~SPC k ` s~ | hybrid version of slurp sexp (can be used in non lisp dialects) | +| ~SPC k ` t~ | hybrid version of transpose sexp (can be used in non lisp dialects) | +| ~SPC k 0~ | go to the beginning of current sexp | +| ~SPC k a~ | absorb expression | +| ~SPC k b~ | forward barf expression | +| ~SPC k B~ | backward barf expression | +| ~SPC k c~ | convolute expression | +| ~SPC k ds~ | delete symbol | +| ~SPC k Ds~ | backward delete symbol | +| ~SPC k dw~ | delete word | +| ~SPC k Dw~ | backward delete word | +| ~SPC k dx~ | delete expression | +| ~SPC k Dx~ | backward delete expression | +| ~SPC k e~ | unwrap current expression and kill all symbols after point | +| ~SPC k E~ | unwrap current expression and kill all symbols before point | +| ~SPC k h~ | previous symbol | +| ~SPC k H~ | go to previous sexp | +| ~SPC k i~ | switch to =insert state= | +| ~SPC k I~ | go to beginning of current expression and switch to =insert state= | +| ~SPC k j~ | next closing parenthesis | +| ~SPC k J~ | join expression | +| ~SPC k k~ | previous opening parenthesis | +| ~SPC k l~ | next symbol | +| ~SPC k L~ | go to next sexp | +| ~SPC k p~ | paste after | +| ~SPC k P~ | paste before | +| ~SPC k r~ | raise expression (replace parent expression by current one) | +| ~SPC k s~ | forward slurp expression | +| ~SPC k S~ | backward slurp expression | +| ~SPC k t~ | transpose expression | +| ~SPC k u~ | undo | +| ~SPC k U~ | got to parent sexp backward | +| ~SPC k C-r~ | redo | +| ~SPC k v~ | switch to =visual state= | +| ~SPC k V~ | switch to =visual line state= | +| ~SPC k C-v~ | switch to =visual block state= | +| ~SPC k w~ | wrap expression with parenthesis | +| ~SPC k W~ | unwrap expression | +| ~SPC k y~ | copy expression | + +***** Emacs lisp specific key bindings + +| Key Binding | Function | +|-------------+--------------------------------------------| +| ~SPC m e $~ | go to end of line and evaluate last sexp | +| ~SPC m e b~ | evaluate buffer | +| ~SPC m e c~ | evaluate current form (a =def= or a =set=) | +| ~SPC m e e~ | evaluate last sexp | +| ~SPC m e f~ | evaluate current defun | +| ~SPC m e l~ | go to end of line and evaluate last sexp | +| ~SPC m e r~ | evaluate region | + +| Key Binding | Function | +|-------------+----------------------------------------------------| +| ~SPC m g g~ | go to definition | +| ~SPC m g G~ | go to definition in another window | +| ~SPC m h h~ | describe elisp thing at point (show documentation) | +| ~SPC m t b~ | execute buffer tests | +| ~SPC m t q~ | ask for test function to execute | + +*** Mouse usage +There are some added mouse features set for the line number margin (if shown): + +- single click in line number margin visually selects the entire line +- drag across line number margin visually selects the region +- double click in line number margin visually select the current code block + +** Managing projects +Projects in Spacemacs are managed with [[https://github.com/bbatsov/projectile][projectile]]. In =projectile= projects +are defined implicitly, for instance the root of a project is found when a +=.git= repository or =.projectile= file is encountered in the file tree. + +=Helm= is used whenever it is possible. + +To search in a project see [[Searching in a project][project searching]]. + +=projectile= commands start with p: + +| Key Binding | Description | +|-------------+---------------------------------------------------------| +| ~SPC p '​~ | open a shell in project's root (with the =shell= layer) | +| ~SPC p !~ | run shell command in project's root | +| ~SPC p &~ | run async shell command in project's root | +| ~SPC p %~ | replace a regexp | +| ~SPC p a~ | toggle between implementation and test | +| ~SPC p b~ | switch to project buffer | +| ~SPC p c~ | compile project using =projectile= | +| ~SPC p d~ | find directory | +| ~SPC p D~ | open project root in =dired= | +| ~SPC p f~ | find file | +| ~SPC p F~ | find file based on path around point | +| ~SPC p g~ | find tags | +| ~SPC p C-g~ | regenerate the project's =etags= / =gtags= | +| ~SPC p h~ | find file using =helm= | +| ~SPC p I~ | invalidate the projectile cache | +| ~SPC p k~ | kill all project buffers | +| ~SPC p o~ | run =multi-occur= | +| ~SPC p p~ | switch project | +| ~SPC p r~ | open a recent file | +| ~SPC p R~ | replace a string | +| ~SPC p t~ | open =NeoTree= in =projectile= root | +| ~SPC p T~ | test project | +| ~SPC p v~ | open project root in =vc-dir= or =magit= | +| ~SPC /~ | search in project with the best search tool available | +| ~SPC s p~ | see [[Searching in a project][search in project]] | +| ~SPC s a p~ | run =ag= | +| ~SPC s g p~ | run =grep= | +| ~SPC s k p~ | run =ack= | +| ~SPC s t p~ | run =pt= | + +*Note for Windows Users*: To enable fast indexing the GNU ~find~ or +Cygwin ~find~ must be in your ~PATH~. + +** Registers +Access commands to the various registers start with =r=: + +| Key Binding | Description | +|-------------+------------------------------------| +| ~SPC r e~ | show evil yank and named registers | +| ~SPC r m~ | show marks register | +| ~SPC r r~ | show helm register | +| ~SPC r y~ | show kill ring | + +** Errors handling +Spacemacs uses [[https://github.com/flycheck/flycheck][Flycheck]] to gives error feedback on the fly. The checks are +only performed at save time by default. + +Errors management commands (start with ~e~): + +| Key Binding | Description | +|-------------+-----------------------------------------------------------------------| +| ~SPC t s~ | toggle flycheck | +| ~SPC e c~ | clear all errors | +| ~SPC e h~ | describe a flycheck checker | +| ~SPC e l~ | toggle the display of the =flycheck= list of errors/warnings | +| ~SPC e n~ | go to the next error | +| ~SPC e p~ | go to the previous error | +| ~SPC e v~ | verify flycheck setup (useful to debug 3rd party tools configuration) | +| ~SPC e .~ | error transient state | + +The next/previous error bindings and the error transient state can be used to +browse errors from flycheck as well as errors from compilation buffers, and +indeed anything that supports Emacs’ =next-error= API. This includes for example +search results that have been saved to a separate buffer. + +Custom fringe bitmaps: + +| Symbol | Description | +|--------------------------+-------------| +| [[file:img/dot-error.png]] | Error | +| [[file:img/dot-warning.png]] | warning | +| [[file:img/dot-info.png]] | Info | + +** Compiling +Spacemacs binds a few commands to support compiling a project. + + | Key Binding | Description | + |-------------+--------------------------------| + | ~SPC c c~ | use =helm-make= via projectile | + | ~SPC c C~ | compile | + | ~SPC c d~ | close compilation window | + | ~SPC c k~ | kill compilation | + | ~SPC c m~ | =helm-make= | + | ~SPC c r~ | recompile | + +** Modes +*** Major Mode leader key +Key bindings specific to the current =major mode= start with ~SPC m~. For +convenience a shortcut key called the major mode leader key is set by default on +~​,​~ which saves one precious keystroke. + +It is possible to change the major mode leader key by defining the variable +=dotspacemacs-major-mode-leader-key= in your =~/.spacemacs=. For example to +setup the key on tabulation: + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-major-mode-leader-key "") +#+END_SRC + +*** Helm +Spacemacs add =hjkl= navigation to =helm= buffers: + + | Key Binding | Description | + |-------------+------------------------------| + | ~C-h~ | go to next source | + | ~C-H~ | describe key (replace ~C-h~) | + | ~C-j~ | go to previous candidate | + | ~C-k~ | go to next candidate | + | ~C-l~ | same as ~return~ | + +** Emacs Server +Spacemacs starts a server at launch. This server is killed whenever you close +your Emacs windows. + +*** Connecting to the Emacs server +You can open a file in Emacs from the terminal using =emacsclient=. Use +=emacsclient -c= to open the file in Emacs GUI. Use =emacsclient -t= to open the +file in Emacs within the terminal. + +If you want your Linux/OS X system to use Emacs by default for any prompt, you +need to set it in your shell configuration, e.g. =~/.bashrc= or =~/.zshrc=: + +#+BEGIN_SRC sh-mode +export EDITOR="emacsclient -c" +#+END_SRC + +Note that if you're on OS X, you may have to refer to the emacsclient that comes +with your GUI Emacs, e.g.: + +#+BEGIN_SRC sh-mode +export EDITOR="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -c" +#+END_SRC + +Tip: Remember to use ~:wq~ or ~C-x #~ after you are done editing the file in +Emacs. + +See [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html][Emacs as a Server]] in the official Emacs manual for more details. + +** Keeping the server alive +It is possible to keep the server alive when you close Emacs by setting the +variable =dotspacemacs-persistent-server= to =t= in your =~./spacemacs=. + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-persistent-server t) +#+END_SRC + +When this variable is set to =t=, the only way to quit Emacs /and/ kill the +server is to use the following bindings: + +| Keybinding | Description | +|------------+--------------------------------------------------------------------------| +| ~SPC q q~ | Quit Emacs and kill the server, prompt for changed buffers to save | +| ~SPC q Q~ | Quit Emacs and kill the server, lose all unsaved changes. | +| ~SPC q r~ | Restart both Emacs and the server, prompting to save any changed buffers | +| ~SPC q s~ | Save the buffers, quit Emacs and kill the server | +| ~SPC q z~ | Kill the current frame | + +** Troubleshoot +*** Loading fails +If any errors happen during the loading the mode-line will turn red and the +errors should appear inline in the startup buffer. Spacemacs should still be +usable; if it is not then restart Emacs with =emacs --debug-init= and open a +[[https://github.com/syl20bnr/spacemacs/issues][Github issue]] with the backtrace. + +*** Upgrading/Downgrading Emacs version +To ensure that packages are correctly compiled for the new Emacs version you +installed, be sure to run the interactive command =spacemacs/recompile-elpa= +with ~SPC SPC spacemacs/recompile-elpa~. + +* Achievements +** Issues + +| Achievements | Account | +|---------------------------+--------------| +| [[https://github.com/syl20bnr/spacemacs/pull/100][100th issue (PR)]] | [[https://github.com/danielwuz][danielwuz]] | +| [[https://github.com/syl20bnr/spacemacs/issues/200][200th issue (question)]] | [[https://github.com/justrajdeep][justrajdeep]] | +| [[https://github.com/syl20bnr/spacemacs/pull/300][300th issue (PR)]] | [[https://github.com/danielwuz][danielwuz]] | +| [[https://github.com/syl20bnr/spacemacs/pull/400][400th issue (PR)]] | [[https://github.com/CestDiego][CestDiego]] | +| [[https://github.com/syl20bnr/spacemacs/pull/500][500th issue (PR)]] | [[https://github.com/bjarkevad][bjarkevad]] | +| [[https://github.com/syl20bnr/spacemacs/pull/600][600th issue (PR)]] | [[https://github.com/bjarkevad][bjarkevad]] | +| [[https://github.com/syl20bnr/spacemacs/pull/700][700th issue (enhancement)]] | [[https://github.com/jcpetkovich][jcpetkovich]] | +| [[https://github.com/syl20bnr/spacemacs/pull/800][800th issue (PR)]] | [[https://github.com/laat][ryansroberts]] | +| [[https://github.com/syl20bnr/spacemacs/pull/900][900th issue (PR)]] | [[https://github.com/jcpetkovich][jcpetkovich]] | +| [[https://github.com/syl20bnr/spacemacs/pull/1000][1000th issue (PR)]] | [[https://github.com/tuhdo][tuhdo]] | +| [[https://github.com/syl20bnr/spacemacs/pull/2000][2000th issue (PR)]] | [[https://github.com/IvanMalison][IvanMalison]] | +| [[https://github.com/syl20bnr/spacemacs/pull/3000][3000th issue (issue)]] | [[https://github.com/malchmih][malchmih]] | +| [[https://github.com/syl20bnr/spacemacs/pull/4000][4000th issue (issue)]] | [[https://github.com/icymist][icymist]] | +| [[https://github.com/syl20bnr/spacemacs/pull/5000][5000th issue (issue)]] | [[https://github.com/justbur][justbur]] | +| [[https://github.com/syl20bnr/spacemacs/pull/6000][6000th issue (issue)]] | [[https://github.com/d12frosted][d12frosted]] | +| [[https://github.com/syl20bnr/spacemacs/pull/7000][7000th issue (issue)]] | [[https://github.com/deb0ch][deb0ch]] | + +** Merged Pull Requests + +| Achievements | Account | +|---------------------+----------------| +| [[https://github.com/syl20bnr/spacemacs/pull/228][100th pull request]] | [[https://github.com/bru][bru]] | +| [[https://github.com/syl20bnr/spacemacs/pull/418][200th pull request]] | [[https://github.com/smt][smt]] | +| [[https://github.com/syl20bnr/spacemacs/pull/617][300th pull request]] | [[https://github.com/BrianHicks][BrianHicks]] | +| [[https://github.com/syl20bnr/spacemacs/pull/806][400th pull request]] | [[https://github.com/cpaulik][cpaulik]] | +| [[https://github.com/syl20bnr/spacemacs/pull/993][500th pull request]] | [[https://github.com/tuhdo][tuhdo]] | +| [[https://github.com/syl20bnr/spacemacs/pull/1205][600th pull request]] | [[https://github.com/trishume][trishume]] | +| [[https://github.com/syl20bnr/spacemacs/pull/1995][1000th pull request]] | [[https://github.com/justbur][justbur]] | +| [[https://github.com/syl20bnr/spacemacs/pull/4089][2000th pull request]] | [[https://github.com/channingwalton][channingwalton]] | +| [[https://github.com/syl20bnr/spacemacs/pull/6338][3000th pull request]] | [[https://github.com/darkfeline][darkfeline]] | + +** Stars, forks and watchers + +| Achievements | Account | +|----------------------+-----------------| +| 100th watcher | [[https://github.com/adouzzy][adouzzy]] | +| 100th fork | [[https://github.com/balajisivaraman][balajisivaraman]] | +| 200th fork | [[https://github.com/alcol80][alcol80]] | +| 300th fork | [[https://github.com/mlopes][mlopes]] | +| 2000th fork | [[https://github.com/Gameguykiler][Gameguykiler]] | +| 100th star | [[https://github.com/Jackneill][Jackneill]] | +| 200th star | [[https://github.com/jb55][jb55]] | +| 400th star | [[https://github.com/dbohdan][dbohdan]] | +| 600th star | [[https://github.com/laat][laat]] | +| 700th star | [[https://github.com/kendall][kendall]] | +| 800th star | [[https://github.com/urso][urso]] | +| 900th star | [[https://github.com/luisgerhorst][luisgerhorst]] | +| 1000th star! | [[https://github.com/rashly][rashly]] | +| 2000th star!! | [[https://github.com/stshine][stshine]] | +| 3000th star!!! | [[https://github.com/TheBB][TheBB]] | +| 4000th star!!!! | [[https://github.com/nixmaniack][nixmaniack]] | +| 5000th star!!!!! | [[https://github.com/StreakyCobra][StreakyCobra]] | +| 6000th star!!!!!! | [[https://github.com/NJBS][NJBS]] | +| 7000th star!!!!!!! | [[https://github.com/mukhali][mukhali]] | +| 8000th star!!!!!!!! | [[https://github.com/shsteven][shsteven]] | +| 9000th star!!!!!!!!! | [[https://github.com/deb0ch][deb0ch]] | + +** Gitter chat + +| Achievements | Account | +|---------------------------------+-------------| +| First joiner on the Gitter Chat | [[https://github.com/trishume][trishume]] | +| 1000th joiner | [[https://github.com/gabrielpoca][gabrielpoca]] | + +** First times + +| Achievements | Account | +|---------------------------------+--------------| +| [[https://github.com/syl20bnr/spacemacs/pull/19][First contribution]] | [[https://github.com/trishume][trishume]] | +| [[https://github.com/syl20bnr/spacemacs/commit/e802027d75d0c0aed55539b0da2dfa0df94dfd39][First contribution layer]] | [[https://github.com/trishume][trishume]] | +| [[http://oli.me.uk/2014/11/06/spacemacs-emacs-vim/][First blog article on Spacemacs]] | [[https://github.com/Wolfy87][Wolfy87]] | +| [[https://github.com/syl20bnr/spacemacs/commit/7b44a56263049482ed540ed6815a295633ffe9d1][First contributed banner]] | [[https://github.com/chrisbarrett][chrisbarrett]] | + +** Special Mentions + +| Reason | Account | +|---------------------------------------------------------------------+-----------------| +| Autumnal Cleanup 2015 ([[https://github.com/syl20bnr/spacemacs/wiki/Autumnal-Cleanup-2015][wiki]]) | [[https://github.com/StreakyCobra][StreakyCobra]] | +| Test and debug tools | [[https://github.com/justbur][justbur]] | +| Integration of Ivy | [[https://github.com/justbur][justbur]] | +| Transient States | [[https://github.com/justbur][justbur]] | +| Integration of Persp-mode | [[https://github.com/CestDiego][CestDiego]] | +| Cleanest PR ([[https://github.com/syl20bnr/spacemacs/pull/5545][PR #5545]]) | [[https://github.com/JAremko][JAremko]] | +| Documentation tools and GitHub support | [[https://github.com/JAremko][JAremko]] | +| Code navigation improvement (jump handlers, generalized next error) | [[https://github.com/TheBB][TheBB]] | +| Better support for GUI using an Emacs daemon (after-display macro) | [[https://github.com/travisbhartwell][travisbhartwell]] | + +** Special Titles + +| Achievements | Account | +|-------------------------------------------------+--------------| +| The Gunner (18 PRs in a row) | [[https://github.com/ralesi][ralesi]] | +| The Saint (unlocked the holy-mode) | [[https://github.com/trishume][trishume]] | +| The Artist ([[https://github.com/nashamri/spacemacs-logo][logo]] and [[https://github.com/nashamri/spacemacs-theme][theme]]) | [[https://github.com/nashamri][nashamri]] | +| The Meme Master (doge banner) | [[https://github.com/chrisbarrett][chrisbarrett]] | +| The Helm captain ([[http://tuhdo.github.io/helm-intro.html][helm guide]]) | [[https://github.com/tuhdo][tuhdo]] | +| The Master of the Keys ([[https://github.com/justbur/emacs-which-key][which-key]] and [[https://github.com/justbur/emacs-bind-map][bind-map]]) | [[https://github.com/justbur][justbur]] | +| The PR Patrol Officer | [[https://github.com/robbyoconnor][robbyoconnor]] | +| The Expert in Latin Language ([[https://github.com/syl20bnr/spacemacs/pull/4043][PR]]) | [[https://github.com/vijaykiran][vijaykiran]] | +| The Tiler ([[https://github.com/syl20bnr/spacemacs/pull/4068][eyebrowse integration]]) | [[https://github.com/bmag][bmag]] | +| The Geometer ([[https://github.com/TheBB/spaceline][spaceline]]) | [[https://github.com/TheBB][TheBB]] | +| The Librarian (doc-fmt tool and space-doc mode) | [[https://github.com/JAremko][JAremko]] | + +* Thank you +Thank you Richard for this great piece of software. + +Thank you to all the contributors and the whole Emacs community from core +developers to elisp hackers! diff --git a/emacs.d/doc/FAQ.org b/emacs.d/doc/FAQ.org new file mode 100644 index 0000000..1e3d57c --- /dev/null +++ b/emacs.d/doc/FAQ.org @@ -0,0 +1,582 @@ +#+TITLE: Frequently Asked Questions + +* FAQ :TOC_4_gh:noexport: + - [[#common][Common]] + - [[#which-version-of-spacemacs-am-i-running][Which version of Spacemacs am I running?]] + - [[#what-is-the-official-pronunciation-of-spacemacs][What is the official pronunciation of Spacemacs?]] + - [[#why-do-you-call-this-a-distribution-i-dont-see-any-spacemacs-executable][Why do you call this a "distribution", I don't see any "Spacemacs" executable?]] + - [[#why-are-packages-installed-with-package-install-automatically-deleted-by-spacemacs-when-it-boots][Why are packages installed with =package-install= automatically deleted by Spacemacs when it boots?]] + - [[#how-to-fix-package-download-errors-when-installing-spacemacs-][How to fix package download errors when installing Spacemacs ?]] + - [[#how-to-fix-symbols-value-as-variable-is-void-errors-on-startup][How to fix =Symbol's value as variable is void= errors on startup?]] + - [[#how-to-fix-wrong-type-argument-arrayp-nil-errors-on-startup][How to fix =(wrong-type-argument arrayp nil)= errors on startup?]] + - [[#the-spacemacs-banner-is-ugly-what-should-i-do][The Spacemacs banner is ugly, what should I do?]] + - [[#the-powerline-separators-are-ugly-how-can-i-fix-them][The powerline separators are ugly, how can I fix them?]] + - [[#the-powerline-separators-have-no-anti-aliasing-what-can-i-do][The powerline separators have no anti-aliasing, what can I do?]] + - [[#why-is-after-init-hook-not-executed][Why is after-init-hook not executed?]] + - [[#what-is-the-difference-between-spacemacs-base-and-spacemacs-distributions][What is the difference between =spacemacs-base= and =spacemacs= distributions?]] + - [[#should-i-place-my-settings-in-user-init-or-user-config][Should I place my settings in =user-init= or =user-config=?]] + - [[#why-do-some-of-my-org-related-settings-cause-problems][Why do some of my =org=-related settings cause problems?]] + - [[#why-is-spacemacs-hanging-on-startup][Why is Spacemacs hanging on startup?]] + - [[#why-does-helm-m-x-spc-spc-not-accept-the-prefix-argument][Why does =helm-M-x= (~SPC SPC~) not accept the prefix argument?]] + - [[#why-does-my-color-theme-not-render-correctly-in-terminal-mode][Why does my color theme not render correctly in terminal mode?]] + - [[#typing-quickly-fd-takes-me-out-of-insert-state-what-is-going-on][Typing quickly =fd= takes me out of =insert state=. What is going on?]] + - [[#why-do-i-get-files-starting-with-][Why do I get files starting with .#?]] + - [[#why-do-i-get-4m-characters-inside-ansi-term][Why do I get '4m' characters inside ansi-term?]] + - [[#why-are-my-font-settings-not-being-respected][Why are my font settings not being respected?]] + - [[#why-am-i-getting-a-message-about-environment-variables-on-startup][Why am I getting a message about environment variables on startup?]] + - [[#how-do-i][How do I:]] + - [[#install-a-package-not-provided-by-a-layer][Install a package not provided by a layer?]] + - [[#disable-a-package-completely][Disable a package completely?]] + - [[#disable-a-package-only-for-a-specific-major-mode][Disable a package only for a specific major-mode?]] + - [[#disable-company-for-a-specific-major-mode][Disable company for a specific major-mode?]] + - [[#change-special-buffer-rules][Change special buffer rules?]] + - [[#enable-navigation-by-visual-lines][Enable navigation by visual lines?]] + - [[#disable-evilification-of-a-mode][Disable evilification of a mode?]] + - [[#include-underscores-in-word-motions][Include underscores in word motions?]] + - [[#setup-path][Setup =$PATH=?]] + - [[#change-or-define-an-alias-for-a-leader-key][Change or define an alias for a leader key?]] + - [[#restore-the-sentence-delimiter-to-two-spaces][Restore the sentence delimiter to two spaces?]] + - [[#prevent-the-visual-selection-overriding-my-system-clipboard][Prevent the visual selection overriding my system clipboard?]] + - [[#make-spell-checking-support-curly-quotes-or-any-other-character][Make spell-checking support curly quotes (or any other character)?]] + - [[#use-spacemacs-as-the-editor-for-git-commits][Use Spacemacs as the =$EDITOR= for git commits?]] + - [[#try-spacemacs-without-modifying-my-existing-emacs-configuration][Try Spacemacs without modifying my existing Emacs configuration?]] + - [[#make-copypaste-working-with-the-mouse-in-x11-terminals][Make copy/paste working with the mouse in X11 terminals?]] + - [[#use-helm-ag-to-search-only-in-files-of-a-certain-type][Use =helm-ag= to search only in files of a certain type?]] + - [[#modify-spacemacs-documentation-look-space-doc-mode][Modify spacemacs documentation look (space-doc-mode)]] + - [[#remap-paste-key-to-be-able-to-paste-copied-text-multiple-times][Remap paste key to be able to paste copied text multiple times]] + - [[#windows][Windows]] + - [[#why-do-the-fonts-look-crappy-on-windows][Why do the fonts look crappy on Windows?]] + - [[#why-is-there-no-spacemacs-logo-in-the-startup-buffer][Why is there no Spacemacs logo in the startup buffer?]] + - [[#why-are-all-packages-unavailable][Why are all packages unavailable?]] + - [[#the-powerline-isnt-shown-correctly-when-spacemacs-is-used-within-putty][The powerline isn't shown correctly when Spacemacs is used within =PuTTY=]] + +* Common +** Which version of Spacemacs am I running? +The version is displayed on the upper right corner of the loading screen. You +may also just type ~SPC f e v~. + +** What is the official pronunciation of Spacemacs? +As it is written, that is _space_ then _macs_. + +** Why do you call this a "distribution", I don't see any "Spacemacs" executable? +Although we could do it we don't package Emacs with Spacemacs. We allow users to +choose whatever build of Emacs they want that works with their OS, this is more +flexible and it saves use tons of issues. Spacemacs is more than a configuration +of Emacs it comes with advanced feature, concepts and tooling. Roughly, think of +it as a Linux distribution where we would ask people to install the kernel first +and then fetch somehow the actual code to get the distribution. +Note that some Linux distributions may start to create packages for Spacemacs, +they are unofficial packages, we will never package Emacs with Spacemacs. + +** Why are packages installed with =package-install= automatically deleted by Spacemacs when it boots? +By default Spacemacs will keep only the packages that you use (i.e. the packages +belonging to a layer explicitly listed in the variable +=dotspacemacs-configuration-layers=). + +To install packages that does not belong to any Spacemacs layers, you can: + +- use the variable =dotspacemacs-additional-packages=. +- or create a configuration layer configuring the package and add this layer to + =dotspacemacs-configuration-layers= +- or set the variable =dotspacemacs-install-packages= to =used-but-keep-unused= + which will prevent Spacemacs from removing the packages you installed + manually. + +To create a new configuration layer see the [[file:QUICK_START.org][quick start guide]] for more info. + +** How to fix package download errors when installing Spacemacs ? +Since 0.105.0 HTTPS protocol is used by default to download packages. If your +environment does not allow HTTPS to reach ELPA repositories then you can start +Emacs with the =--insecure= argument for force the usage of HTTP non secured +protocol. You can set the variable =dotspacemacs-elpa-https= to =nil= in your +dotfile to remove the need to start Emacs with =--insecure= argument. + +** How to fix =Symbol's value as variable is void= errors on startup? +If Emacs reports an error that the symbol =closed= or =-= is unbound as a +variable, it is probably because you are using HTTPS to download packages, but +you shouldn't be. Try deleting your packages (the =.emacs.d/elpa= folder), and +restart Emacs without HTTPS to download the packages again. There are two ways +to do this: + +- Run Emacs with the =--insecure= command line argument: =emacs --insecure=. You + will have to do this again the next time you update your packages. +- Set the variable =dotspacemacs-elpa-https= to =nil= in your dotfile. This has + the same effect as =--insecure=, but is persistent. + +** How to fix =(wrong-type-argument arrayp nil)= errors on startup? +This is most likely caused by a corrupted package archive. Try deleting your +=~/.emacs.d/elpa/archives/= folder and restart Emacs. + +** The Spacemacs banner is ugly, what should I do? +Install the default font supported by Spacemacs or choose a fixed width font. +More information in the font section of the [[file:DOCUMENTATION.org][documentation]]. + +** The powerline separators are ugly, how can I fix them? +Use the property =:powerline-scale= of the variable =dotspacemacs-default-font=. +See font section of the [[file:DOCUMENTATION.org][documentation]] for more details. + +** The powerline separators have no anti-aliasing, what can I do? +Emacs powerline uses XMP images to draw the separators in a graphical +environment. You can have anti-aliasing if you use the =utf8= separator. Note +that by default the =utf8= separator is used in a terminal. See the powerline +section in the font section of the [[file:DOCUMENTATION.org][documentation]]. + +** Why is after-init-hook not executed? +Don't launch Spacemacs with =emacs -q -l init.el= command. This command will run +the hooked functions in =after-init-hook= before the evaluation of the passed +=-l init.el= file. + +** What is the difference between =spacemacs-base= and =spacemacs= distributions? +The =distribution= concept was introduced in 0.104.x. You can now choose between +two distributions =spacemacs= or =spacemacs-base=. =spacemacs-base= contains +only a minimal set of packages; whereas =spacemacs= is the full Spacemacs +experience. + +Set the distribution with =dotspacemacs-distribution= variable. The default is +=spacemacs=. For more information as to what is included, check out the +=packages.el= file in the respective folders in the =+distributions= folder of +the =layers/= directory. + +** Should I place my settings in =user-init= or =user-config=? +Any variable that layer configuration code will *read* and *act on* must be set +in =user-init=, and any variable that Spacemacs explicitly sets but you wish to +*override* must be set in =user-config=. + +Anything that isn't just setting a variable should 99% be in =user-config=. + +** Why do some of my =org=-related settings cause problems? +Since version 0.104, spacemacs uses the =org= version from the org ELPA +repository instead of the one shipped with emacs. Then, any =org= related code +should not be loaded before =dotspacemacs/user-config=, otherwise both versions +will be loaded and will conflict. + +Because of autoloading, calling to =org= functions will trigger the loading up +of the =org= shipped with emacs wich will induce conflicts. One way to avoid +conflict is to wrap your =org= config code in a =with-eval-after-load= block +like this: + +#+BEGIN_SRC emacs-lisp +(with-eval-after-load 'org + ;; here goes your Org config :) + ;; .... + ) +#+END_SRC + +** Why is Spacemacs hanging on startup? +This is probably related to Helm using Tramp which tries to figure out some +SSH/DNS settings at startup. The root cause is probably your ISP redirecting +non-existing addresses to their own servers. + +Try using these settings in the ~user-init~ function in your ~.spacemacs~ +configuration: + +#+BEGIN_SRC emacs-lisp +(setq tramp-ssh-controlmaster-options + "-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no") +#+END_SRC + +See [[https://github.com/syl20bnr/spacemacs/issues/3422#issuecomment-148919047][issue #3422]] and [[https://github.com/emacs-helm/helm/issues/1000#issuecomment-119487649][helm issue #1000]] for details. If for any reason this code is +not working, you can try to put these settings directly in =~/.ssh/config=: + +#+BEGIN_SRC ssh +Host * +ControlMaster auto +ControlPath ~/.ssh/master -%r@%h:%p +ControlPersist = no +#+END_SRC + +** Why does =helm-M-x= (~SPC SPC~) not accept the prefix argument? +If you try to run =helm-M-x= with the prefix argument (i.e. ~SPC u SPC SPC~) it +will fail with this message: + +#+BEGIN_VERSE +Error: Specifying a prefix arg before calling helm-M-x +#+END_VERSE + +Instead, call =helm-M-x= first, select the command you want to run, and press +~C-u~ before pressing ~RETURN~. For instance: ~SPC SPC org-reload C-u RET~ + +** Why does my color theme not render correctly in terminal mode? +In the terminal version of Emacs, color themes will not render correctly as +colors are rendered by the terminal and not by emacs. You will probably have to +change your terminal color palette. More explanations can be found on +[[https://github.com/sellout/emacs-color-theme-solarized#important-note-for-terminal-users][emacs-color-theme-solarized webpage]]. + +** Typing quickly =fd= takes me out of =insert state=. What is going on? +This is a feature of Spacemacs, enabling you to easily escape from a lot of +situations, like escaping from =insert state= to =normal state=. + +The sequence of characters used can be customized. See the [[http://spacemacs.org/doc/DOCUMENTATION.html#orgheadline78][documentation]] for +more information. + +If you don't like this feature, you can deactivate it by adding =evil-escape= to +=dotspacemacs-excluded-packages= in your init file. + +** Why do I get files starting with .#? +These are lockfiles, created by Emacs to prevent editing conflicts which occur +when the same file is edited simultaneously by two different programs. To +disable this behaviour: + +#+BEGIN_SRC emacs-lisp +(setq create-lockfiles nil) +#+END_SRC + +** Why do I get '4m' characters inside ansi-term? +Ansi-term only has a subset of capabilities supported by xterm256. Your shell +(e.g. fish shell) might ignore =$TERMINFO= information and require you to set +the =~/.terminfo= yourself. + +#+BEGIN_SRC fish +tic -o ~/.terminfo $TERMINFO/e/eterm-color.ti +#+END_SRC + +Note that =eterm-color.ti= may be at a different location, to find out the exact +location you may try to use =locate=: + +#+BEGIN_SRC fish +locate eterm-color.ti +#+END_SRC + +** Why are my font settings not being respected? +The settings of =dotspacemacs-default-font= (such as size, weight, etc.) will +only be applied if the name of the font exists on your system. Check to make +sure that this is the case. If Spacemacs can't find the font, there should be a +warning to this effect in the =*Messages*= buffer. + +** Why am I getting a message about environment variables on startup? +Spacemacs uses the =exec-path-from-shell= package to set the executable path +when Emacs starts up. This is done by launching a shell and reading the values +of variables such as =PATH= and =MANPATH= from it. If your shell configuration +sets the values of these variables inconsistently, this could be problematic. It +is recommended to set such variables in shell configuration files that are +sourced unconditionally, such as =.profile=, =.bash_profile= or =.zshenv=, as +opposed to files that are sourced only for interactive shells, such as =.bashrc= +or =.zshrc=. If you are willing to neglect this advice, you may disable the +warning, e.g. from =dotspacemacs/user-init=: + +#+BEGIN_SRC emacs-lisp + (setq exec-path-from-shell-check-startup-files nil) +#+END_SRC + +You can also disable this feature entirely by adding =exec-path-from-shell= to +the list =dotspacemacs-excluded-packages= if you prefer setting =exec-path= +yourself. + +* How do I: +** Install a package not provided by a layer? +Spacemacs provides a variable in the =dotspacemacs/layers= function in +=.spacemacs= called =dotspacemacs-additional-packages=. Just add a package name +to the list and it will be installed when you reload your configuration with +~SPC f e R~, or at the next Spacemacs launch. + +** Disable a package completely? +To completely disable a package and effectively uninstalling it even if it is +part of your used layers, look for the variable =dotspacemacs-excluded-packages= +in your dotfile and add the package name to it: + +#+BEGIN_SRC emacs-lisp +(setq-default dotspacemacs-excluded-packages '(package1 package2 ...)) +#+END_SRC + +** Disable a package only for a specific major-mode? +This is done by removing the hook added by Spacemacs. For example to remove +=flycheck= support in python buffers, look for the function +=dotspacemacs/user-config= in your dotfile and add the following code: + +#+BEGIN_SRC emacs-lisp +(remove-hook 'python-mode-hook 'flycheck-mode) +#+END_SRC + +*Hint* to know the name of the major-mode of the current buffer press: ~SPC h d +v major-mode RET~ + +** Disable company for a specific major-mode? +It may be handy to disable =company= for a given mode if you plan on configuring +=auto-complete= instead. One easy way to do it is to use the macro +=spacemacs|disable-company= in the function =dotspacemacs/user-config= of your +dotfile. The following snippet disables company for =python-mode=: + +#+BEGIN_SRC emacs-lisp +(spacemacs|disable-company python-mode) +#+END_SRC + +** Change special buffer rules? +To change the way spacemacs marks buffers as useless, you can customize +=spacemacs-useless-buffers-regexp= which marks buffers matching the regexp as +useless. The variable =spacemacs-useful-buffers-regexp= marks buffers matching +the regexp as useful buffers. Both can be customized the same way. + +Examples: +#+BEGIN_SRC emacs-lisp +;; Only mark helm buffers as useless +(setq spacemacs-useless-buffers-regexp '("\\*helm\.\+\\*")) + +;; Marking the *Messages* buffer as useful +(push "\\*Messages\\*" spacemacs-useful-buffers-regexp) +#+END_SRC + +** Enable navigation by visual lines? +Add the following snippet to your =dotspacemacs/user-config= function: + +#+BEGIN_SRC emacs-lisp +;; Make evil-mode up/down operate in screen lines instead of logical lines +(define-key evil-motion-state-map "j" 'evil-next-visual-line) +(define-key evil-motion-state-map "k" 'evil-previous-visual-line) +;; Also in visual mode +(define-key evil-visual-state-map "j" 'evil-next-visual-line) +(define-key evil-visual-state-map "k" 'evil-previous-visual-line) +#+END_SRC + +** Disable evilification of a mode? +You can ensure a mode opens in emacs state by using =evil-set-initial-state=. + +#+BEGIN_SRC emacs-lisp +(evil-set-initial-state 'magit-status-mode 'emacs) +#+END_SRC + +You can also do this using buffer name regular expressions. E.g. for magit, +which has a number of different major modes, you can catch them all with + +#+BEGIN_SRC emacs-lisp +(push '("*magit" . emacs) evil-buffer-regexps) +#+END_SRC + +This should make all original magit bindings work in the major modes in +question. To enable the leader key in this case, you may have to define a +binding in the mode's map, e.g. for =magit-status-mode=, + +#+BEGIN_SRC emacs-lisp +(with-eval-after-load 'magit + (define-key magit-status-mode-map + (kbd dotspacemacs-leader-key) spacemacs-default-map)) +#+END_SRC + +** Include underscores in word motions? +You can modify the syntax table of the mode in question. To do so you can +include this on your =dotspacemacs/user-config=. + +#+BEGIN_SRC emacs-lisp +;; For python +(add-hook 'python-mode-hook #'(lambda () (modify-syntax-entry ?_ "w"))) +;; For ruby +(add-hook 'ruby-mode-hook #'(lambda () (modify-syntax-entry ?_ "w"))) +;; For Javascript +(add-hook 'js2-mode-hook #'(lambda () (modify-syntax-entry ?_ "w"))) +#+END_SRC + +** Setup =$PATH=? +Some layers require certain tools to be available on your =$PATH=. This means +that your =$PATH= must contain the installation paths for those tools. For +example, if you have installed some tools to =~/.local/bin= and want them to be +available in Spacemacs, you need to add =~/.local/bin= to your =$PATH=. + +Users of =bash=, =zsh=, =sh= and other similar shells should add following line +to their =.bashrc= (=.zshrc=, =.profile= or your shell's equivalent). Note that +the =export= part is very important. + +#+BEGIN_SRC sh +export PATH=~/.local/bin:$PATH +#+END_SRC + +Users of =fish= should add following line to their =config.fish= file (should be +in =$XDG_CONFIG_HOME= or its default value - =~/.config/fish=). Note that =-x= +part is very important. + +#+BEGIN_SRC fish +set -x PATH ~/.local/bin $PATH +#+END_SRC + +Users of other shells should consult its documentation on how to setup =$PATH= +variable (with export to environment). + +So now, =~/.local/bin= should be available in your =$PATH=. You can verify this +by calling =echo $PATH=. But you also should verify that =$PATH= is set properly +in your environment. To do so call following command in your terminal. + +#+BEGIN_SRC sh +env | grep "PATH" +#+END_SRC + +This is the value that will be used by Emacs. So it must contain =~/.local/bin=. + +After that you can run Spacemacs and check that it properly gets the value of +=$PATH= by running =M-: (getenv "PATH")=. + +Note that having =~/.local/bin= in your =$PATH= also means that it's possible to +run terminal and call tools from =~/.local/bin= without specifying their full +path. Under certain conditions you might want to avoid modifying your =$PATH=. +In that case you have the option of updating the value of =exec-path= in the +=dotspacemacs/user-config= function of your =.spacemacs= file. + +#+BEGIN_SRC emacs-lisp +(add-to-list 'exec-path "~/.local/bin/") +#+END_SRC + +** Change or define an alias for a leader key? +It is possible to change a leader key by binding its keymap to another sequence. +For instance, if you want to switch ~SPC S~ (spelling) with ~SPC d~ (used by +dash) to make the former easier to reach, you can use: + +#+BEGIN_SRC emacs-lisp +(defun dear-leader/swap-keys (key1 key2) + (let ((map1 (lookup-key spacemacs-default-map key1)) + (map2 (lookup-key spacemacs-default-map key2))) + (spacemacs/set-leader-keys key1 map2 key2 map1))) +(dear-leader/swap-keys "S" "d") +#+END_SRC + +If you want to define your own alias, like using ~SPC é~ (because it's a not +used key on your keyboard-layout for instance) for accessing ~SPC w~ (windows +management), you can use this: + +#+BEGIN_SRC emacs-lisp +(defun dear-leader/alias-of (key1 key2) + (let ((map (lookup-key spacemacs-default-map key2))) + (spacemacs/set-leader-keys key1 map))) +(dear-leader/alias-of "é" "w") +#+END_SRC + +** Restore the sentence delimiter to two spaces? +To restore the sentence delimiter to two spaces, add the following code to the +=dotspacemacs/user-init= function of your =.spacemacs=: + +#+BEGIN_SRC emacs-lisp +(setq sentence-end-double-space t) +#+END_SRC + +** Prevent the visual selection overriding my system clipboard? +On some operating systems, there is only one clipboard for both *copied* and +*selected* texts. This has the consequence that visual *selection* – which +should normally be saved to the /PRIMARY/ clipboard – overrides the /SYSTEM/ +clipboard, where normally goes the *copied* text. This can be corrected by +adding the following code to the =dotspacemacs/user-config= of your +=.spacemacs=: + +#+BEGIN_SRC emacs-lisp +(fset 'evil-visual-update-x-selection 'ignore) +#+END_SRC + +** Make spell-checking support curly quotes (or any other character)? +To have spell-checking support curly quotes (or any other character), you need +to add a new entry to =ispell-local-dictionary-alist=, by adding for example the +following code in the =dotspacemacs/user-config= of your =.spacemacs=: + +#+BEGIN_SRC emacs-lisp +(add-to-list 'ispell-local-dictionary-alist + (quote ("my_english" "[[:alpha:]]" "[^[:alpha:]]" "['’]" t ("-d" "en_US") nil utf-8))) +#+END_SRC + +You can then add any regular expression you want in the fourth argument (i.e. +add a symbol within =['’]=) to make it supported. Consult the help of +=ispell-dictionary-alist= for more details about the possibilities. + +You finally have to set =my_english= as your =ispell-local-dictionary= in order +to use the dictionary supporting your newly added characters. + +** Use Spacemacs as the =$EDITOR= for git commits? +Spacemacs can be used as the =$EDITOR= (or =$GIT_EDITOR=) for editing git +commits messages. To enable this you have to add the following line to your +=dotspacemacs/user-config=: + +#+BEGIN_SRC emacs-lisp +(global-git-commit-mode t) +#+END_SRC + +** Try Spacemacs without modifying my existing Emacs configuration? +Emacs' ability to use any directory as the home for launching it allows us to +try out Spacemacs (or any other Emacs configuration we desire) without having to +go through the trouble of backing up our =~/.emacs.d= directory and then cloning +the new configuration. This can be achieved easily using the following steps: + +#+BEGIN_SRC sh +mkdir ~/spacemacs +git clone git@github.com:syl20bnr/spacemacs.git ~/spacemacs/.emacs.d +HOME=~/spacemacs emacs +#+END_SRC + +If you're on Fish shell, you will need to modify the last command to: +=env HOME=$HOME/spacemacs emacs= + +** Make copy/paste working with the mouse in X11 terminals? +It is possible to disable the mouse support in X11 terminals in order to +enable copying/pasting with the mouse. You need to add this line to your +=dotspacemacs/user-config=: + +#+begin_src emacs-lisp +(xterm-mouse-mode -1) +#+end_src + +** Use =helm-ag= to search only in files of a certain type? +It is possible to restrict the scope of =helm-ag= to search only expressions in +some specified file types. There are two ways of doing this, both by appending +some expressions to the search input: + +- By using a regexp with =-G=, for instance =-G\.el$= will look for all files + ending with =.el= which are emacs-lisp files. + +- By using a flag like =--python= which should be self-explaining. The list of + available flags colud be accessed from terminal with: + + #+begin_src shell + ag --list-file-types + #+end_src + +This is possible because =helm-ag= is treating the search input as command-line +arguments of the =ag= program. + +** Modify spacemacs documentation look (space-doc-mode) +You can modify the list of visual enhancements applied by the =space-doc-mode=: +#+BEGIN_SRC emacs-lisp +(setq spacemacs-space-doc-modificators + '(center-buffer-mode + org-indent-mode + view-mode + hide-line-numbers + alternative-emphasis + alternative-tags-look + link-protocol + org-block-line-face-remap + org-kbd-face-remap + resize-inline-images)) +#+END_SRC +By default only =center-buffer-mode= is disabled. +Both =space-doc-mode= and =center-buffer-mode= can be customized +with "Easy Customization Interface". + +** Remap paste key to be able to paste copied text multiple times +In vim and evil, pasting over a text would cause it to be copied, hence making it impossible to paste +the same text multiple times. + +To fix this, add the following snippet to your ~user-config~: +#+BEGIN_SRC emacs-lisp +(defun evil-paste-after-from-0 () + (interactive) + (let ((evil-this-register ?0)) + (call-interactively 'evil-paste-after))) + +(define-key evil-visual-state-map "p" 'evil-paste-after-from-0) +#+END_SRC + +* Windows +** Why do the fonts look crappy on Windows? +You can install [[https://code.google.com/archive/p/gdipp/][GDIPP]] (simplest) or [[https://code.google.com/p/mactype/][MacType]] (more complete) on Windows to get +very nice looking fonts. It is also recommended to disable smooth scrolling on +Windows. + +** Why is there no Spacemacs logo in the startup buffer? +A GUI build of emacs supporting image display is required. You can follow the +instructions [[http://stackoverflow.com/questions/2650041/emacs-under-windows-and-png-files][here]]. Alternatively you can download binaries of emacs with image +support included such as [[http://emacsbinw64.sourceforge.net/][this one]]. + +** Why are all packages unavailable? +Check if your Emacs has HTTPS capabilities by doing =M-:= and then: + +#+BEGIN_SRC emacs-lisp + (gnutls-available-p) +#+END_SRC + +If this returns =nil=, you need to install the GnuTLS DLL file in the same +directory as Emacs. See [[https://www.gnu.org/software/emacs/manual/html_mono/emacs-gnutls.html#Help-For-Users][here]] for instructions. + +** The powerline isn't shown correctly when Spacemacs is used within =PuTTY= +You can follow [[http://mschulte.nl/posts/using-powerline-in-PuTTY.html][this explanation]] explaining how to correct this. diff --git a/emacs.d/doc/LAYERS.org b/emacs.d/doc/LAYERS.org new file mode 100644 index 0000000..9b58f27 --- /dev/null +++ b/emacs.d/doc/LAYERS.org @@ -0,0 +1,623 @@ +#+TITLE: Configuration layers + +* Configuration Layers :TOC_4_gh:noexport: + - [[#introduction][Introduction]] + - [[#nomenclature][Nomenclature]] + - [[#the-emacs-loading-process][The Emacs loading process]] + - [[#emacs-lisp-files][Emacs Lisp files]] + - [[#loading-a-file][Loading a file]] + - [[#features][Features]] + - [[#the-load-path][The load path]] + - [[#auto-loading][Auto-loading]] + - [[#eval-after-load][Eval after load]] + - [[#use-package][Use-package]] + - [[#anatomy-of-a-layer][Anatomy of a layer]] + - [[#layersel][layers.el]] + - [[#packagesel][packages.el]] + - [[#funcsel][funcs.el]] + - [[#configel][config.el]] + - [[#keybindingsel][keybindings.el]] + - [[#the-spacemacs-loading-process][The Spacemacs loading process]] + - [[#case-study-auto-completion][Case study: auto-completion]] + - [[#layer-tips-and-tricks][Layer tips and tricks]] + - [[#cross-dependencies][Cross-dependencies]] + - [[#use-package-1][Use-package]] + - [[#use-package-hooks][Use-package hooks]] + - [[#best-practices][Best practices]] + - [[#package-ownership][Package ownership]] + - [[#localize-your-configuration][Localize your configuration]] + - [[#load-ordering][Load ordering]] + - [[#no-require][No require]] + - [[#auto-load-everything][Auto-load everything]] + - [[#how-do-i--idiomatically][How do I ... idiomatically?]] + - [[#setup-auto-completion-for-a-major-mode][Setup auto-completion for a major mode]] + +* Introduction +This document is intended as a tutorial for users who are interested in writing +their first configuration layer, whether for private use or for contributing +upstream. It should help clear up some confusion regarding how layers work and +how Spacemacs (and Emacs) loads packages. + +* Nomenclature +Layers and packages. What gives? + +- Package :: A set of Emacs Lisp files that, taken together, provide some + feature. Packages may be available on a package repository, such as ELPA or + MELPA or on a third-party service provider (such as github) or even + locally on the disk. +- Layer :: A collected unit of configuration that can be enabled (or disabled) + in Spacemacs. A layer typically brings together one or more packages, as + well as the glue configuration code required to make them play well with + each other and Spacemacs in general. + +Before writing a layer, it is helpful to consider what you are trying to +achieve. Is there a package that provides the functionality you are after, and +you want to integrate it in Spacemacs? If yes, you should write a layer. Are you +trying to implement a new feature that would be useful for the Emacs community +at large? In that case, consider whether it wouldn't be more appropriate to +write a package first, and then a layer that uses your package. + +* The Emacs loading process +To understand how to best implement a layer, we have to investigate how Emacs +loads code. + +** Emacs Lisp files +Emacs Lisp files contains code that can be evaluated. When evaluated, the +functions, macros and modes defined in that file become available to the current +Emacs session. Henceforth, this will be termed as /loading/ a file. + +One major problem is to ensure that all the correct files are loaded, and in the +proper order. Another issue is to ensure that not too many files are loaded +immediately. This causes startup to take too long. Instead, we want to make sure +that files are loaded only as needed, and not all at once. + +How is this done in Emacs, and how is it done in Spacemacs? + +*** Loading a file +The simplest way to load a file is to call =load-file=. + +#+begin_src emacs-lisp +(load-file "~/elisp/foo.el") +#+end_src + +This is as primitive as it comes. The path must be exact, and it does not have +to be in the Emacs load path (we'll get to that later). It will not look for a +byte-compiled =.elc= file. It will simply load exactly what you tell it to. + +** Features +A better way to load what you need is to use /features/. A feature is a symbol +that typically has the same name as the file it resides in. Let us say you have +the following contents in a file called =my-feature.el=. + +#+begin_src emacs-lisp +;; Your code goes here ... + +(provide 'my-feature) +#+end_src + +To have Emacs load this file, call =require=, as such: + +#+begin_src emacs-lisp +(require 'my-feature) +#+end_src + +This checks whether the feature =my-feature= has already been loaded. If not, it +looks for a file called =my-feature.el=, =my-feature.elc= or some such. If it +finds such a file, it will load it. When the call to =provide= is evaluated, the +feature is added to the list of loaded features, so that subsequent calls to +=require= will do nothing. + +This will cause an error if no such file can be found. + +The file =my-feature.el= may very well contain other calls to =require=, and in +fact this is quite a common way to ensure that dependencies are loaded before +your code runs. + +Package authors should use this technique to make sure that dependencies are +loaded before their code runs. + +*** The load path +When loaded using =require=, Emacs looks for files in its /load path/. This is +nothing more than a list of paths where elisp files can be found, and you can +inspect it through ~SPC h d v load-path~ in Spacemacs. To add to the load path, +simply push to this list, e.g. + +#+begin_src emacs-lisp +(push "/some/path/" load-path) +#+end_src + +** Auto-loading +Calling =require= is nothing more than a glorified way of calling =load-file=. +It solves the problem of ensuring that files are loaded in the correct order, +and to some degree it solved the problem of where to find the files on disk but +a long list of calls to =require= at startup would still cause Emacs to take for +ever to load. + +Emacs uses auto-loading to solve this problem. When a function is registered as +auto-loading, an "empty" definition is provided. When that function is called, +the file that provides the function is immediately loaded (along with all its +required features). Finally, the "empty" function is substituted with the real +one and called normally. The end user will see only a slight delay when first +calling the function, while subsequent calls to that function (or any other +function loaded as part of the same procedure) will be as quick as normal. + +To register a function as auto-loadable, we call =autoload=: + +#+begin_src emacs-lisp +(autoload 'some-function "some-file") +#+end_src + +This instructs Emacs that whenever =some-function= is called, load +=some-file.el= first, and then proceed. + +After evaluating the above code, you can try to inspect =some-function= by doing +~SPC h d f some-function~. It will say it's an auto-loaded function, and that +nothing else is known about it until it is loaded. The call to =autoload= can +optionally include more information, such as a doc-string, whether the function +can be called interactively, and so on. This provides more information to the +end-user without her having to actually load the file first. + +Open your =elpa= directory, go to =helm= and look at the file +=helm-autoloads.el=. This provides all the auto-loads for all the files in Helm. +However, this file is not written by hand. Instead, it is automatically +generated from "magic" comments in the source code of Helm. They look like this: + +#+begin_src emacs-lisp +;;;###autoload +(defun my-function () + ;; Source code... + ) +#+end_src + +The magic comment =;;;###autoload= instructs Emacs that the following definition +should be auto-loaded. This automatically generates an appropriate call to +=autoload=. + +Things that can be auto-loaded generally involve anything "definable", such as +functions, macros, major or minor modes, groups, classes, and so on. + +Magic comments also work on other things, such as variable definitions +(=defvar=), but in that case, the definition is just copied verbatim into the +auto-loading file. For example, this code will load Helm on startup, long before +your file is actually evaluated, probably not what was intended: + +#+begin_src emacs-lisp +;;;###autoload +(require 'helm) +#+end_src + +It is the responsibility of the package authors to ensure that their package can +be appropriately auto-loaded, and most packages do this quite well. + +Spacemacs makes thorough use of auto-loading. Almost everything in Spacemacs is +loaded when needed instead of right away. + +** Eval after load +Often, we will want to configure packages after loading them. We may want to set +some variables or call some functions. This is trivial with =require=, because +it loads immediately, but it can be tricky with autoloading, because the +configuration code must also be deferred. + +Emacs offers =with-eval-after-load= for this purpose. It can be used like this: + +#+begin_src emacs-lisp +(with-eval-after-load 'helm + ;; Code + ) +#+end_src + +This arranges for the relevant code to be executed after Helm is loaded (using +either =require= or an autoload), or if Helm is already loaded, the code is +executed immediately. + +Since =with-eval-after-load= is a macro and not a function, its argument does +not have to be quoted. + +** Use-package +For /end users/ who are trying to put together an efficient Emacs configuration, +there is a very useful /package/ called =use-package= that provides a macro +which is /also/ called =use-package= which does a very good job of streamlining +the whole process of loading packages. + +The aspiring layer author is recommended to have a look at the =use-package= +[[https://github.com/jwiegley/use-package][documentation]]. Some examples follow. + +#+begin_src emacs-lisp +(use-package helm) +#+end_src + +This simply loads Helm. It is essentially equivalent to =(require 'helm)=. + +#+begin_src emacs-lisp +(use-package helm + :defer t) +#+end_src + +This defers the loading of Helm using the auto-load facility and the auto-load +commands provided by the Helm source code. It is, in fact, a no-op. + +#+begin_src emacs-lisp +(use-package helm + :defer t + :init + ;; Code to execute before Helm is loaded + :config + ;; Code to execute after Helm is loaded + ) +#+end_src + +This form includes code to execute before and after Helm is loaded. The =:init= +section can be executed immediately, but since Helm is deferred, the =:config= +section is not executed until after loading, if ever. It is essentially +equivalent to simply running the =:init= block, and then adding the =:config= +block in an =with-eval-after-load=. + +#+begin_src emacs-lisp +(use-package helm + :commands (helm-find-files helm-M-x)) +#+end_src + +This creates auto-load references for additional commands, if you find that the +package author has been slacking. + +#+begin_src emacs-lisp +(use-package ruby-mode + :mode "\\.rb\\'") +#+end_src + +For packages that provide major modes, you can associate file extensions to that +mode by using the =:mode= keyword. This adds an entry to =auto-mode-alist= and +an auto-load for =ruby-mode=. Typically this is not required, as =ruby-mode= +should already be auto-loadable, and the package should associate Ruby files +with itself already. + +Use-package supports heaps of useful keywords. Look at the [[https://github.com/jwiegley/use-package][documentation]] for +more. + +* Anatomy of a layer +A layer is simply a folder somewhere in Spacemacs' layer search path that +usually contains these files (listed in loading order). + +- =layers.el= :: declare additional layers +- =packages.el= :: the packages list and configuration +- =funcs.el= :: all functions used in the layer should be declared here +- =config.el= :: layer specific configuration +- =keybindings.el= :: general key bindings + +Additionally, for each local package (see the next section), there should be a +folder =/local//= containing the source code for that package. +Before initializing that package, Spacemacs will add this folder to the load +path for you. + +** layers.el +This file is the first file to be loaded and this is the place where addtional +layers can be declared. + +For instance is layer A depends on some functionality of layer B then in the +file =layers.el= of layer A we can add: + +#+begin_src emacs-lisp +(configuration-layer/declare-layer 'B) +#+end_src + +The effect is that B is considered a used layer and will be loaded as if it +was added to =dotspacemacs-configuration-layers= variables. + +** packages.el +It contains this list of packages of the layer and the actual configuration for +the packages included in the layer. + +This file is loaded after =layers.el=. + +It must define a variable called =-packages=, which should be a list of +all the packages that this layer needs. Some valid package specifications are +as follows: + +#+begin_src emacs-lisp +(defconst mylayer-packages + '( + ;; Get the package from MELPA, ELPA, etc. + some-package + (some-package :location elpa) + + ;; A local package + (some-package :location local) + + ;; A package recipe + (some-package :location (recipe + :fetcher github + :repo "some/repo")) + + ;; An excluded package + (some-package :excluded t) + )) +#+end_src + +The =:location= attribute specifies where the package may be found. Spacemacs +currently supports packages on ELPA compliant repositories, local packages and +MELPA recipes (through the Quelpa package). Local packages should reside at =/local//=. For information about recipes see the [[https://github.com/milkypostman/melpa#recipe-format][MELPA documentation]]. + +Packages may be /excluded/ by setting the =:excluded= property to true. This +will prevent the package from being installed even if it is used by another +layer. + +For each included package, you may define one or more of the following +functions, which are called in order by Spacemacs to initialize the package. + +1. =/pre-init-= +2. =/init-= +3. =/post-init-= + +It is the responsibility of these functions to load and configure the package in +question. Spacemacs will do nothing other than download the package and place it +in the load path for you. + +*Note:* A package will not be installed unless at least one layer defines an +=init= function for it. That is to say, in a certain sense, the =init= function +does mandatory setup while the =pre-init= and =post-init= functions do optional +setup. This can be used for managing cross-layer dependencies, which we will +discuss later. + +** funcs.el +It contains all the defined functions used in the layer. + +This file is loaded after =packages.el= and before =config.el=. + +It is good practice to guard the definition of functions to make sure a package +is actually used. For instance: + +#+begin_src emacs-lisp +(when (configuration-layer/package-usedp 'my-package) + (defun spacemacs/my-package-enable () ...) + (defun spacemacs/my-package-disable () ...)) +#+end_src + +By guarding these functions we avoid to define them in case the package +`my-package` is not used. + +** config.el +This file configure the layer like declaring layer variables default values +and setup some other variables related to the layer. + +This file is loaded after =funcs.el=. + +** keybindings.el +It contains general key bindings. + +This is the last file loaded. + +The word /general/ here means /independent of any package/. Since the end user +can exclude an arbitrary set of packages, you cannot be sure that, just because +your layer includes a package, that package will necessarily be loaded. For this +reason, code in these files must be generally safe, regardless of which packages +are installed. + +More on this in the next section. + +* The Spacemacs loading process +The Spacemacs loading process can be summarized as follows: + +1. Spacemacs goes through all the enabled layers and evaluates their files. The + changes introduced by =config.el= are thus applied, then =funcs.el= and + =packages.el= are loaded, but nothing happens from =packages.el=, since these + files only define functions and variables. +2. Spacemacs checks which packages should be downloaded and installed. To be + installed, a package must be + - included by a layer that the user has enabled, + - not be excluded by any other layer that the user has enabled, + - not be excluded by the user herself, and + - there must be at least one =/init-= function defined for + it. + Alternatively, if a package is part of the end user's + =dotspacemacs-additional-packages=, it will also be installed. +3. All packages which should be installed are installed in alphabetical order, + =package.el= built-in Emacs library is in charge of implicit dependencies. + Installed packages not following the rules of 2. are removed as well as + their dependencies if possible. (This last behavior is optional but default.) +4. The =pre-init=, =init= and =post-init= functions for each installed package + are executed in turn. + +It is step four that interests us. It is very important that a package is not +installed if no =init= function is defined for it. + +We say that a layer *owns* a package if it defines an =init= function for it. A +layer does *not* own a package if it only defines =pre-init= or =post-init= +functions. + +Only one layer may own a package. Since layers are processed in order of +specification in the user's dotfile, it is possible for layers to "seize" +ownership of a package that was owned by a previously enabled layer. + +* Case study: auto-completion +Spacemacs provides a layer called =auto-completion= which provides +auto-completion features in many modes. It does this using the package +=company=. This layer owns the =company= package, so it defines a function +called =auto-completion/init-company=. + +When a user enables the =auto-completion= layer, Spacemacs locates it and finds +=company= in the list of packages. Provided that =company= is not excluded, +either by the user or another layer, Spacemacs then locates and runs the =init= +function for =company=. This function includes a call to =use-package= that sets +up the basic configuration. + +However, auto-completion is a two-horse game. By its very nature, it is specific +to the major mode in question. It is pointless to expect the =auto-completion= +layer to include configuration for each conceivable major mode, and equally +futile to expect each programming language layer (python, ruby, etc.) to fully +configure =company= on their own. + +This is solved using the =post-init= functions. The Python layer, for example, +includes the =company= package and defines a function called +=python/post-init-company=. This function is called after +=auto-completion/init-company=, but it is not called if + +- the =auto-completion= layer is not enabled, in which case no =init= function + for =company= will be found, or +- the =company= package is excluded either by the user or another layer + +As such, =python/post-init-company= is the /only/ safe place to put +configuration related to =company= in Python mode. + +If the Python layer had defined an =init= function for =company=, that package +would have been installed even if the =auto-completion= layer had been disabled, +which is not what we want. + +* Layer tips and tricks + +** Cross-dependencies +Spacemacs provides a couple of additional useful functions you can use to check +whether other layers or packages are included. + +- =configuration-layer/layer-usedp= :: check if a layer is enabled +- =configuration-layer/package-usedp= :: check if a package is or will be installed + +These are useful in some cases, but usually you can get the desired result just +by using =post-init= functions. + +For layers that require another layers to be enabled, use the functions +=configuration-layer/declare-layer= and =configuration-layer/declare-layers= to +ensure that layers are enabled even if the user has not enabled them explicitly. +Calls to these functions must go in the =config.el= file. + +** Use-package +In the vast majority of cases, a package =init= function should do nothing but +call to =use-package=. Again, in the vast majority of cases, all the +configuration you need to do should be doable within the =:init= or =:config= +blocks of such a call. + +What goes where? Since =:init= is executed before load and =:config= after, +these rules of thumb apply. + +In =:config= should be +- Anything that requires the package to be already loaded. +- Anything that takes a long time to run, which would ruin startup performance. + +The =:init= block should contain setup for the entry points to the package. This +includes keybindings, if the package should be loaded manually by the user, or +hooks, if the package should be loaded upon some event. It is not unusual to +have both! + +** Use-package hooks +Spacemacs includes a macro for adding more code to the =:init= or =:config= +blocks of a call to =use-package=, after the fact. This is useful for =pre-init= +or =post-init= functions to "inject" code into the =use-package= call of the +=init= function. + +#+begin_src emacs-lisp +(spacemacs|use-package-add-hook helm + :pre-init + ;; Code + :post-init + ;; Code + :pre-config + ;; Code + :post-config + ;; Code + ) +#+end_src + +Since a call to =use-package= may evaluate the =:init= block immediately, any +function that wants to inject code into this block must run =before= the call to +=use-package=. Further, since this call to =use-package= typically takes place +in the =init-= function, calls to =spacemacs|use-package-add-hook= +typically happen in the =pre-init-= functions, and not in +=post-init-=. It is quite safe to do this in =pre-init=, so that should +be the default choice. + +** Best practices +If you break any of these rules, you should know what you are doing and have a +good reason for doing it. + +*** Package ownership +Each package should be owned by one layer only. The layer that owns the +package should define its =init= function. Other layers should rely on +=pre-init= or =post-init= functions. + +*** Localize your configuration +*Each function can only assume the existence of one package.* With some +exceptions, the =pre-init=, =init= and =post-init= functions can /only/ +configure exactly the package they are defined for. Since the user can exclude +an arbitrary set of packages, there is no /a priori/ safe way to assume that +another package is included. Use =configuration-layer/package-usedp= if you +must. + +This can be very challenging, so please take this as a guideline and not +something that is absolute. It is quite possible for the user to break her +Spacemacs installation by excluding the wrong packages, and it is not our +intention to prevent this at all costs. + +*** Load ordering +In Spacemacs, layers are loaded in order of inclusion in the dotfile, and +packages are loaded in alphabetical order. In the rare cases where you make use +of this property, you should make sure to document it well. Many will assume +that layers can be included in arbitrary order (which is true in most cases), +and that packages can be renamed without problems (which is also in most cases). + +Preferably, write your layer so that it is independent of load ordering. The +=pre=- and =post-init= functions are helpful, together with +=configuration-layer/package-usedp=. + +*** No require +Do not use require. If you find yourself using =require=, you are almost +certainly doing something wrong. Packages in Spacemacs should be loaded through +auto-loading, and not explicitly by you. Calls to =require= in package init +functions will cause a package to be loaded upon startup. Code in an =:init= +block of =use-package= should not cause anything to be loaded, either. If you +need a =require= in a =:config= block, that is a sign that some other package is +missing appropriate auto-loads. + +*** Auto-load everything +Defer everything. You should have a very good reason not to defer the loading +of a package. + +* How do I ... idiomatically? + +** Setup auto-completion for a major mode +In your layer's =config.el=, call =spacemacs|defvar-company-backends=. + +#+begin_src emacs-lisp +(spacemacs|defvar-company-backends yoyo-mode) +#+end_src + +This creates a variable called =company-backends-yoyo-mode=. In the package +=init= functions, you should push backends to this variable. But of course, only +if the =auto-completion= layer is enabled. + +#+begin_src emacs-lisp +(defconst yoyo-packages '( + ;; ... + some-weird-package + ;; ... + ) + + (when (configuration-layer/package-usedp 'company) + (defun yoyo/init-some-weird-package () + (use-package some-weird-package + :defer t + ;; This has to be in init because it's a package entry point + :init + (push 'some-weird-backend company-backends-yoyo-mode)))) +#+end_src + +Finally, we must make sure company is started when we enter =yoyo-mode=, but +again only if the =auto-completion= layer is enabled. + +#+begin_src emacs-lisp +(defconst yoyo-packages '( + ;; ... + yoyo-mode + ;; ... + )) + +(defun yoyo/init-yoyo-mode () + (use-package yoyo-mode + ;; Some configuration goes here, however nothing relating to company + ;; since this function may be called even if company is not installed! + )) + +(when (configuration-layer/package-usedp 'company) + (defun yoyo/post-init-yoyo-mode () + ;; This makes no reference to `some-weird-package', which may have + ;; been excluded by the user + (spacemacs|add-company-hook yoyo-mode))) +#+end_src diff --git a/emacs.d/doc/QUICK_START.org b/emacs.d/doc/QUICK_START.org new file mode 100644 index 0000000..dd35ba6 --- /dev/null +++ b/emacs.d/doc/QUICK_START.org @@ -0,0 +1,177 @@ +#+TITLE: Quick start + +* Configuration :TOC_4_gh:noexport: + - [[#configuration-layers][Configuration layers]] + - [[#dotfile-spacemacs][Dotfile (.spacemacs)]] + - [[#dotdirectory-spacemacsd][Dotdirectory (~/.spacemacs.d)]] + - [[#learning-spacemacs][Learning Spacemacs]] + - [[#editing-styles][Editing Styles]] + - [[#the-leader-keys][The leader keys]] + - [[#evil-tutor][Evil-tutor]] + - [[#universal-argument][Universal argument]] + - [[#configuration-layers-and-package-discovery][Configuration layers and Package discovery]] + - [[#key-bindings-discovery][Key bindings discovery]] + - [[#describe-functions][Describe functions]] + - [[#how-tos][How-To's]] + +* Configuration layers +Spacemacs divides its configuration into self-contained units called +=configuration layers=. These layers are stacked on top of each other +to achieve a custom configuration. + +By default Spacemacs uses a dotfile called =~/.spacemacs= to control which +layers to load. Within this file you can also configure certain features. + +A configuration layer is a directory containing at least a =packages.el= +file which defines and configures packages to be downloaded from Emacs +package repositories using the =package.el= built-in feature of Emacs. + +If you already have your own =Emacs= configuration you can move it to your +own layer. + +The following command creates a layer in the =private= directory: + +#+BEGIN_EXAMPLE + SPC SPC configuration-layer/create-layer RET +#+END_EXAMPLE + +Any configuration layers you create must be explicitly loaded in =~/.spacemacs=. + +Note: For your privacy, the contents of the =private= directory are not +under source control. See the section on private configuration management in +the [[file:DOCUMENTATION.org][documentation]]. + +* Dotfile (.spacemacs) +As mentioned =.spacemacs= controls which configuration layers to load and +is also a means to customizing Spacemacs. + +The following command will create a =.spacemacs= file in your home directory: + +#+BEGIN_EXAMPLE + SPC SPC dotspacemacs/install RET +#+END_EXAMPLE + +To open the installed dotfile: + +#+BEGIN_EXAMPLE + SPC f e d +#+END_EXAMPLE + +To load some configuration layers using the variable +=dotspacemacs-configuration-layers=: + +#+BEGIN_SRC elisp +;; List of configuration layers to load. +dotspacemacs-configuration-layers '(auto-completion smex) +#+END_SRC + +Some configuration layers support configuration variables to expose granular +control over layer-specific features, [[file:../layers/+source-control/git/README.org][git layer]] being one such example. +Variables can be directly set within =dotspacemacs-configuration-layers= like so: + +#+BEGIN_SRC elisp +;; List of configuration layers to load. +dotspacemacs-configuration-layers '(auto-completion + (git :variables + git-magit-status-fullscreen t) + smex) +#+END_SRC + +At anytime you can apply the changes made to the dotfile or layers +_without restarting_ Spacemacs by pressing ~SPC f e R~. + +The [[file:../core/templates/.spacemacs.template][dotfile template]] contain further information about how to customize +Spacemacs. See the dotfile configuration section of the [[file:DOCUMENTATION.org][documentation]] for +more details. + +* Dotdirectory (~/.spacemacs.d) +Like =Emacs=, Spacemacs initialization can also be contained in an =init.el= file +in a special directory =~/.spacemacs.d=. The contents of the dotfile should be +then copied in the =init.el= file. + +The Emacs dotfile or dotdirectory is not replaced but rather +complemented by the Spacemacs dotfile or dotdirectory. During startup, +Emacs still uses =~/.emacs.d/init.el= (or =~/.emacs=) for its +initialization, and variable =user-emacs-directory= will still point +to =~/.emacs.d/=, even if =~/.spacemacs.d= or =~/.spacemacs= are +present. Only now =~/.emacs.d/init.el= is provided by Spacemacs +(e.g. after cloning the Spacemacs git repo into an empty +=~/.emacs.d/=), and your own personnal configurations go into +=~/.spacemacs.d/init.el= (or =~/.spacemacs=). + +Have a look into the FAQ for an easy workaround to maintain (your +former) vanilla Emacs and (your new) Spacemacs configurations +side-by-side without the need to rename and backup =~/.emacs.d/=. + +* Learning Spacemacs +** Editing Styles +Spacemacs can be used by Vim users or Emacs users by setting the +=dotspacemacs-editing-style= variable to =vim=, =emacs= or even =hybrid= +in the dotfile =~/.spacemacs=. + +** The leader keys +Spacemacs key bindings use a leader key which is by default bound to +~SPC~ (space bar) in =vim= or =hybrid= editing styles and ~M-m~ in =emacs= +style. + +You can change it by setting the variable =dotspacemacs-leader-key= if +you use the =vim= style or =dotspacemacs-emacs-leader-key= if you use +the =emacs= style (these variables must be set in the file =~/.spacemacs=). + +For simplicity the documentation always refers to the leader key as +~SPC~. + +There is secondary leader key called the major-mode leader key which is +set to ~​,​~ by default. This key is a shortcut for ~SPC m~ +where all the major-mode specific commands are bound. + +** Evil-tutor +If you are willing to learn the Vim key bindings (highly recommended since +you can benefit from them even in =emacs= style), press ~SPC h T~ +to begin an Evil-adapted Vimtutor. + +** Universal argument +In =vim= editing style the universal argument defaults to ~SPC u~ +instead of ~C-u~ because the latter is used to scroll up as in Vim. + +** Configuration layers and Package discovery +By using =helm-spacemacs-help= with ~SPC h SPC~ you can quickly search +for a package and get the name of the layers using it. + +You can also easily go to the =README.org= of a layer or go to the initialization +function of a package. + +** Key bindings discovery +Thanks to [[https://github.com/justbur/emacs-which-key][which-key]], whenever a prefix command is pressed (like ~SPC~) +a buffer appears after one second listing the possible keys for this prefix. + +It is also possible to search for specific key bindings by pressing: + +#+BEGIN_EXAMPLE + SPC ? +#+END_EXAMPLE + +To narrow the bindings list to those prefixed with =SPC=, +type a pattern like this regular expression: + +#+BEGIN_EXAMPLE + SPC\ b +#+END_EXAMPLE + +which would list all =buffer= related bindings. *Note:* You are at the +/HELM-Descbind/ prompt, the pattern consists of 6 letters: uppercase ~SPC~, a +backslash, an actual space and a lowercase ~b~. + +** Describe functions +=Describe functions= are powerful Emacs introspection commands to get information +about functions, variables, modes etc. These commands are bound thusly: + +| Key Binding | Description | +|-------------+-------------------| +| ~SPC h d f~ | describe-function | +| ~SPC h d k~ | describe-key | +| ~SPC h d m~ | describe-mode | +| ~SPC h d v~ | describe-variable | + +* How-To's +Some quick =how-to's= are compiled in the [[file:FAQ.org::How%20do%20I...][FAQ.org]] file. diff --git a/emacs.d/doc/VIMUSERS.org b/emacs.d/doc/VIMUSERS.org new file mode 100644 index 0000000..39820ec --- /dev/null +++ b/emacs.d/doc/VIMUSERS.org @@ -0,0 +1,484 @@ +#+TITLE: Migrating from Vim + +* Migrating from vim :TOC_4_gh:noexport: + - [[#purpose-of-this-document][Purpose of this document]] + - [[#philosophy][Philosophy]] + - [[#basic-orientation][Basic orientation]] + - [[#terms][Terms]] + - [[#modes-vs-states][Modes vs. States]] + - [[#layers][Layers]] + - [[#transient-states][Transient-states]] + - [[#keybinding-conventions][Keybinding conventions]] + - [[#running-commands][Running commands]] + - [[#buffer-and-window-management][Buffer and window management]] + - [[#buffers][Buffers]] + - [[#special-buffers][Special buffers]] + - [[#windows][Windows]] + - [[#files][Files]] + - [[#the-help-system][The Help System]] + - [[#exploring][Exploring]] + - [[#customization][Customization]] + - [[#the-spacemacs-file][The .spacemacs file]] + - [[#emacs-lisp][Emacs Lisp]] + - [[#variables][Variables]] + - [[#keybindings][Keybindings]] + - [[#functions][Functions]] + - [[#activating-a-layer][Activating a Layer]] + - [[#creating-a-layer][Creating a Layer]] + - [[#installing-a-single-package][Installing a single package]] + - [[#loading-packages][Loading packages]] + - [[#uninstalling-a-package][Uninstalling a package]] + - [[#common-tweaks][Common tweaks]] + - [[#changing-the-escape-key][Changing the escape key]] + - [[#changing-the-colorscheme][Changing the colorscheme]] + - [[#nohlsearch][Nohlsearch]] + - [[#sessions][Sessions]] + - [[#navigating-using-visual-lines][Navigating using visual lines]] + - [[#other-useful-links][Other useful links]] + +* Purpose of this document +This document is intended to supplement the Spacemacs documentation by bridging +the gap between vim and Spacemacs. While some information may be duplicated, +this does not replace the Spacemacs documentation. It is recommended that you +read both files to fully understand Spacemacs. + +[[file:DOCUMENTATION.org][Spacemacs Documentation]] + +* Philosophy + One misconception many vim users have is that Spacemacs is an Emacs /clone/ of + vim. Spacemacs does not seek to completely mimic the behavior of vim + everywhere, only when editing. You should not expect every vim command to be + available, although many are. You cannot use Vimscript to configure Spacemacs, + but who likes Vimscript anyway? It is important to understand that Spacemacs is + an attempt to improve on both vim and Emacs using the superior modal editing of + vim and the nicer configuration language of Emacs. + +* Basic orientation +** Terms +Spacemacs uses some different terminology than vim, which can cause confusion +for new users. This section attempts to clear up any confusion. + +*** Modes vs. States +In vim you have various editing modes like =insert mode= and =visual mode= to +manipulate text. In Emacs, we have [[./DOCUMENTATION.org#states][states]]. These are equivalent to vim modes. +For example, =evil-insert-state= is the same as =insert-mode= in vim. + +A =minor-mode= in Emacs is like a feature that is activated. For example, +=aggressive-indent-mode= is a =minor-mode= that automatically indents code as you +type. It is important to know that there can be many =minor-modes= activated in a +buffer. Many Emacs packages work by providing a =minor-mode=. A =major-mode= +determines the editing behavior of Emacs in the current buffer. There is +generally a corresponding =major-mode= per filetype. An example of a =major-mode= is +=python-mode=, which provides python specific settings in python files. There is +only one =major-mode= per buffer. + +*** Layers +Spacemacs has the concept of layers. Layers are similar to vim plugins. They +provide new features to use in Spacemacs. However, layers are often comprised of +several packages that integrate well with each other. For example, the =python= +layer includes support for auto-completion, documentation look-up, tests, and +much more by using several different packages. This keeps you from thinking +about what packages to install, and instead worry about what features you want. +More information on layers can be found in the [[./VIMUSERS.org#customization][customization]] section and in the +[[./DOCUMENTATION.org#configuration-layers][documentation]]. There is also a more in-depth guide on writing layers [[file:LAYERS.org][here]]. + +*** Transient-states +Spacemacs provides a special functionality called transient-states. Transient-states +allow similar commands to be run in succession without repeatedly pressing the +~~ key. Transient-states are usually triggered by using a keybinding with the +following pattern: ~ .~ where group is the category the +transient-state falls under. When in a transient-state you will see documentation at the +bottom of your window. To exit a transient-state press ~q~. + +#+CAPTION: Transient-state documentation window + +[[file:img/spacemacs-scale-transient-state.png]] + +** Keybinding conventions +Spacemacs uses ~SPC~ as its ~~ key. This document will use ~SPC~ to refer to +the ~~ key. All keybindings are mnemonic and are organized under the +~~ key. For example, the keybindings for language-specific commands are +always under the ~SPC m~ prefix. A full list of conventions used in Spacemacs is +[[./CONVENTIONS.org][here]]. Note that all keybindings can be changed. + +Spacemacs uses [[https://github.com/justbur/emacs-which-key][which-key]] to show available keybindings after a delay: + +#+CAPTION: Which-key window + +[[file:img/which-key.png]] + +** Running commands +Emacs commands can be run using ~SPC SPC~. This will pop up a buffer using [[https://github.com/emacs-helm/helm][Helm]] +which can be used to run any Emacs command. You can also run many ex commands +using ~:~, just like in vim. + +Note: You can run Emacs interactive commands using ~:~, but you cannot run ex +commands using ~SPC SPC~. + +** Buffer and window management +*** Buffers +Buffers in Emacs and vim are essentially the same. The keybindings for buffers +are located under the ~SPC b~ prefix. + +| Keybinding | Function | +|---------------------------+------------------------------------------------------| +| ~SPC b b ~ | Create a buffer named ==. | +| ~SPC b b~ | Search through open buffers and recent files. | +| ~SPC b n~ or ~:bnext~ | Switch to the next buffer. (See [[*Special%20buffers][Special buffers]]) | +| ~SPC b p~ or ~:bprevious~ | Switch to the previous buffer. (See [[*Special%20buffers][Special buffers]]) | +| ~SPC b d~ or ~:bdelete~ | Kill current buffer. | +| ~SPC b C-d~ | Kill buffers using a regular expression. | +| ~SPC b m~ | Kill all buffers except the current buffer. | +| ~SPC b .~ | Buffer transient-state. | + +**** Special buffers +By default Emacs creates a lot of buffers that most people will never need, like +=*Messages*=. Spacemacs automatically ignores these when using these +key bindings. More information can be found [[./DOCUMENTATION.org#special-buffers][here]]. + +*** Windows +Windows are like splits in vim. They are useful for editing multiple files at +once. All window keybindings are under the ~SPC w~ prefix. + +| Keybinding | Function | +|------------------------+--------------------------------------| +| ~SPC w v~ or ~:vsplit~ | Opens a vertical split on the right. | +| ~SPC w s~ or ~:split~ | Opens a horizontal split below. | +| ~SPC w h/j/k/l~ | Navigate among windows. | +| ~SPC w H/J/K/L~ | Move the current window. | +| ~SPC w .~ | Window transient-state. | + +** Files +All file commands in Spacemacs are available under the ~SPC f~ prefix. + +| Keybinding | Function | +|-------------------+--------------------------------------------------------------| +| ~SPC f f~ | Opens a buffer to search for files in the current directory. | +| ~SPC f r~ | Opens a buffer to search through recently opened files. | +| ~SPC f s~ or ~:w~ | Save the current file. | +| ~:x~ | Save the current file and quit. | +| ~:e ~ | Open == | + +** The Help System +Emacs has an extensive help system. All keybindings under the ~SPC h d~ prefix +allow convenient access to the help system. The most important of these +keybindings are ~SPC h d f~ , ~SPC h d k~ , and ~SPC h d v~. There is also the +~SPC ~ keybinding which allows you to search for documentation. + +| Keybinding | Function | +|-------------+----------------------------------------------------------------------------------| +| ~SPC h d f~ | Prompts for a function and shows its documentation. | +| ~SPC h d k~ | Prompts for a keybinding and shows what it is bound to. | +| ~SPC h d v~ | Prompts for a variable and shows its documentation and current value. | +| ~SPC ~ | Searches for a command, function, variable, or face and shows its documentation. | + +Whenever, you see weird behavior or want to know what something does, these +functions are the first thing you should refer to. + +** Exploring +There are a few ways to explore the functionality of Spacemacs. One is to read +the [[https://github.com/syl20bnr/spacemacs][source code]] on Github. You can begin to feel your way around Emacs Lisp and +how Spacemacs works this way. You can also use the following keybindings to +explore: + +| Keybinding | Function | +|-------------+---------------------------------------------------------------| +| ~SPC h SPC~ | Lists all layers and allows you to view files from the layer. | +| ~SPC ?~ | Lists all keybindings. | + +* Customization +** The .spacemacs file +When you first start spacemacs, you will be prompted to choose an editing style. +If you are reading this, you likely want to choose the vim style. A =.spacemacs= +file will be created with the appropriate style selected. Most trivial +configuration will go in this file. + +There are four top-level functions in the file: =dotspacemacs/layers=, +=dotspacemacs/init=, =dotspacemacs/user-init= and =dotspacemacs/user-config=. +The =dotspacemacs/layers= function exist only to enable and disable layers and +packages. The =dotspacemacs/init= function is run before anything else during +startup and contains Spacemacs settings. You will never need to touch this +function except to change default Spacemacs settings. +The =dotspacemacs/user-init= function is also run before anything else and +contains user specific configuration. The =dotspacemacs/user-config= function +is the one you will use the most. This is where you define any user configuration. + +| Keybinding | Function | +|-------------+--------------------------------------------------------------------------| +| ~SPC f e d~ | Open your =.spacemacs= | +| ~SPC f e D~ | Update your =.spacemacs= manually using a diff with the default template | + +** Emacs Lisp +This section introduces a few emacs lisp functions that are needed to configure +Spacemacs. For a more detailed look at the language, see [[http://learnxinyminutes.com/docs/elisp/][this]] link. If you +really want to learn everything there is about emacs lisp, use the info page +found at ~SPC h i elisp RET~ . + +*** Variables +Setting variables is the most common way to customize the behavior of Spacemacs. +The syntax is simple: + +#+begin_src emacs-lisp + (setq variable value) ; Syntax + ;; Setting variables example + (setq variable1 t ; True + variable2 nil ; False + variable3 '("A" "list" "of" "things")) +#+end_src + +*** Keybindings +Defining keybindings is something that almost everyone will want to do. The +built-in =define-key= function is the best way to do that. + +#+begin_src emacs-lisp + (define-key map new-keybinding function) ; Syntax + ;; Map H to go to the previous buffer in normal mode + (define-key evil-normal-state-map (kbd "H") 'previous-buffer) + ;; Mapping keybinding to another keybinding + (define-key evil-normal-state-map (kbd "H") (kbd "^")) ; H goes to beginning of the line +#+end_src + +The map is the keymap you want to bind the key in. Most of the time you will use +=evil--state-map=. These correspond to different =evil-mode= states. +For example, using =evil-insert-state-map= maps the keybinding in insert mode. + +To map ~~ keybindings, use the =spacemacs/set-leader-keys= function. + +#+begin_src emacs-lisp + (spacemacs/set-leader-keys key function) ; Syntax + ;; Map killing a buffer to b c + (spacemacs/set-leader-keys "bc" 'spacemacs/kill-this-buffer) + ;; Map opening a link to o l only in org-mode (works for any major-mode) + (spacemacs/set-leader-keys-for-major-mode 'org-mode + "ol" 'org-open-at-point) +#+end_src + +*** Functions +You may occasionally want to define a function to do a more complex +customization. The syntax is simple: + +#+begin_src emacs-lisp + (defun func-name (arg1 arg2) + "docstring" + ;; Body + ) + + ;; Calling a function + (func-name arg1 arg1) +#+end_src + +Here is an example of a function that is useful in real life: + +#+begin_src emacs-lisp + ;; This snippet allows you to run clang-format before saving + ;; given the current file as the correct filetype. + ;; This relies on the c-c++ layer being enabled. + (defun clang-format-for-filetype () + "Run clang-format if the current file has a file extensions + in the filetypes list." + (let ((filetypes '("c" "cpp"))) + (when (member (file-name-extension (buffer-file-name)) filetypes) + (clang-format-buffer)))) + + ;; See http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html for + ;; what this line means + (add-hook 'before-save-hook 'clang-format-for-filetype) +#+end_src + +** Activating a Layer +As said in the terms section, layers provide an easy way to add features. +Activating a layer is done in the =.spacemacs= file. In the file search for the +=dotspacemacs-configuration-layers= variable. By default, it should look like +this: + +#+begin_src emacs-lisp + (defun dotspacemacs/layers () + (setq-default + ;; ... + dotspacemacs-configuration-layers '(;; auto-completion + ;; better-defaults + emacs-lisp + ;; (git :variables + ;; git-gutter-use-fringe t) + ;; markdown + ;; org + ;; syntax-checking + ))) +#+end_src + +You can uncomment these suggested layers by deleting the semi-colons for a nice +out-of-the-box experience. To add a layer, add its name to the list and restart +Emacs or press ~SPC f e R~ . To view all layers and their documentation use ~SPC +h SPC~. + +** Creating a Layer +To group configuration or when configuration doesn't fit well in your +=.spacemacs= file, you can create a configuration layer. Spacemacs provides a +builtin command to generate the layer boilerplate: ~SPC SPC +configuration-layer/create-layer~. This generates a folder that looks like this: + +#+BEGIN_EXAMPLE + [layer-name] + |__ [local]* + | |__ [example-mode-1] + | | ... + | |__ [example-mode-n] + |__ config.el* + |__ funcs.el* + |__ keybindings.el* + |__ packages.el + + [] = directory + * = not created by the command +#+END_EXAMPLE + +The =packages.el= file contains a list of packages that you can install in the +variable =-packages=. Any package that is available on the [[http:melpa.org][MELPA]] +repository can be added to the list. A list can also exclude packages using the +=:excluded t= property. +Each package requires a function to initialize it. The function /must/ be named +with this pattern: =/init-=. This function contains +configuration for the package. There are also =pre/post-init= functions to +execute code before or after a package loads. It would look like this: + +#+begin_src emacs-lisp + (setq layer-name-packages '(example-package + ;; This layer uninstalls example-package-2 + ;; by setting the :excluded property to true (t) + (example-package-2 :excluded t))) + + (defun layer-name/post-init-package () + ;; Add configuration to a package in another layer here + ) + + (defun layer-name/init-example-package () + ;; Configuration for example-package goes here + ) +#+end_src + +**Note**: Only one layer can have a =init= function for a package. If you want +to override the configuration of a package in another layer, use a +=/pre-init= function in addition to [[file:LAYERS.org#use-package-hooks][use-package hooks]]. + +If a package is not available on MELPA, you must use a local package or a +package recipe. For more details see [[file:LAYERS.org#anatomy-of-a-layer][anatomy of a layer]]. + +Make sure you [[Activating a Layer][add]] your layer to your =.spacemacs= file and restart to +activate it. + +A detailed description of the loading process and how layers work can be found in +[[file:LAYERS.org][LAYERS.org]]. + +** Installing a single package +Sometimes creating a layer is a bit overkill. Maybe you just want one package +and don't want to maintain a whole layer. Spacemacs provides a variable in the +=dotspacemacs/layers= function in =.spacemacs= called +=dotspacemacs-additional-packages=. Just add a package name to the list and it +will be installed when you restart. Loading the package is covered in the next +[[Loading packages][section]]. + +** Loading packages +Ever wonder how Spacemacs can load over a 100 packages in just a few seconds? +Such low loading times must require some kind of unreadable black magic that no +one can understand. Thanks to [[https://github.com/jwiegley/use-package][use-package]], this is not true. It is a package +that allows easy lazy-loading and configuration of packages. Here are the basics +to using it: + +#+begin_src emacs-lisp + ;; Basic form of use-package declaration. The :defer t tells use-package to + ;; try to lazy load the package. + (use-package package-name + :defer t) + ;; The :init section is run before the package loads The :config section is + ;; run after the package loads + (use-package package-name + :defer t + :init + (progn + ;; Change some variables + (setq variable1 t variable2 nil) + ;; Define a function + (defun foo () + (message "%s" "Hello, World!"))) + :config + (progn + ;; Calling a function that is defined when the package loads + (function-defined-when-package-loads))) +#+end_src + +This is just a very basic overview of =use-package=. There are many other ways +to control how a package loads using it that aren't covered here. + +** Uninstalling a package +Spacemacs provides a variable in the =dotspacemacs/init= function in +=.spacemacs= called =dotspacemacs-excluded-packages=. Just add a package name to +the list and it will be uninstalled when you restart. + +** Common tweaks +This section is for things many will want to change. All of these settings go in +the =dotspacemacs/user-config= function in your =.spacemacs= unless otherwise noted. + +*** Changing the escape key +Spacemacs uses [[https://github.com/syl20bnr/evil-escape][evil-escape]] to +allow escaping from many =major-modes= with one keybinding. You can customize +the variable in your =dotspacemacs/user-config= like this: + +#+begin_src emacs-lisp + (defun dotspacemacs/user-config () + ;; ... + ;; Set escape keybinding to "jk" + (setq-default evil-escape-key-sequence "jk")) +#+end_src + +More documentation is found in the =evil-escape= [[https://github.com/syl20bnr/evil-escape/blob/master/README.md][README]]. + +*** Changing the colorscheme +The =.spacemacs= file contains the =dotspacemacs-themes= variable in the +=dotspacemacs/init= function. This is a list of themes that can be cycled +through with the ~SPC T n~ keybinding. The first theme in the list is the one +that is loaded at startup. Here is an example: + +#+begin_src emacs-lisp + (defun dotspacemacs/init + ;; Darktooth theme is the default theme + ;; Each theme is automatically installed. + ;; Note that we drop the -theme from the package name. + ;; Ex. darktooth-theme -> darktooth + (setq-default dotspacemacs-themes '(darktooth + soothe + gotham))) +#+end_src + +All installed themes can be listed and chosen using the ~SPC T h~ keybinding. + +*** Nohlsearch +Spacemacs emulates the default vim behavior which highlights search results even +when you are not navigating between them. You can use ~SPC s c~ or ~:nohlsearch~ +to disable search result highlighting. + +To disable the result highlighting when it is not needed anymore automatically, +you can [[Uninstalling a package][uninstall]] the =evil-search-highlight-persist= package. + +*** Sessions +Spacemacs does not automatically restore your windows and buffers when you +reopen it. If you use vim sessions regularly you may want to set +=dotspacemacs-auto-resume-layouts= to =t= in your =.spacemacs=. + +*** Navigating using visual lines +Spacemacs uses the vim default of navigating by actual lines, even if they are +wrapped. If you want ~j~ and ~k~ to behave like ~g j~ and ~g k~, add this to +your =.spacemacs=: + +#+begin_src emacs-lisp + (define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line) + (define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line) +#+end_src + +* Other useful links +- [[https://www.gnu.org/software/emacs/manual/emacs.html][Emacs Manual]] +- [[file:DOCUMENTATION.org][Spacemacs Documentation]] +- [[http://ian.mccowan.space/2015/04/07/Spacemacs/][Spacemacs: A Vimmer's Emacs Prerequisites]] + - Note: The article refers to ~SPC b s~ as the keybinding to switch buffers. + It is ~SPC b b~ +- [[http://thume.ca/howto/2015/03/07/configuring-spacemacs-a-tutorial/][Configuring Spacemacs: A Tutorial]] +- [[http://juanjoalvarez.net/es/detail/2014/sep/19/vim-emacsevil-chaotic-migration-guide/][From Vim to Emacs+Evil chaotic migration guide]] diff --git a/emacs.d/doc/img/crappy-powerline-separators.png b/emacs.d/doc/img/crappy-powerline-separators.png new file mode 100644 index 0000000..0d813b8 Binary files /dev/null and b/emacs.d/doc/img/crappy-powerline-separators.png differ diff --git a/emacs.d/doc/img/dot-error.png b/emacs.d/doc/img/dot-error.png new file mode 100644 index 0000000..9e1d366 Binary files /dev/null and b/emacs.d/doc/img/dot-error.png differ diff --git a/emacs.d/doc/img/dot-info.png b/emacs.d/doc/img/dot-info.png new file mode 100644 index 0000000..7583bbe Binary files /dev/null and b/emacs.d/doc/img/dot-info.png differ diff --git a/emacs.d/doc/img/dot-warning.png b/emacs.d/doc/img/dot-warning.png new file mode 100644 index 0000000..2e8a36c Binary files /dev/null and b/emacs.d/doc/img/dot-warning.png differ diff --git a/emacs.d/doc/img/flycheck-error.png b/emacs.d/doc/img/flycheck-error.png new file mode 100644 index 0000000..3405cdf Binary files /dev/null and b/emacs.d/doc/img/flycheck-error.png differ diff --git a/emacs.d/doc/img/flycheck-info.png b/emacs.d/doc/img/flycheck-info.png new file mode 100644 index 0000000..c3428f1 Binary files /dev/null and b/emacs.d/doc/img/flycheck-info.png differ diff --git a/emacs.d/doc/img/flycheck-mode-line.png b/emacs.d/doc/img/flycheck-mode-line.png new file mode 100644 index 0000000..f23e315 Binary files /dev/null and b/emacs.d/doc/img/flycheck-mode-line.png differ diff --git a/emacs.d/doc/img/flycheck-warning.png b/emacs.d/doc/img/flycheck-warning.png new file mode 100644 index 0000000..b32026f Binary files /dev/null and b/emacs.d/doc/img/flycheck-warning.png differ diff --git a/emacs.d/doc/img/powerline-alternate.png b/emacs.d/doc/img/powerline-alternate.png new file mode 100644 index 0000000..4979224 Binary files /dev/null and b/emacs.d/doc/img/powerline-alternate.png differ diff --git a/emacs.d/doc/img/powerline-anzu.png b/emacs.d/doc/img/powerline-anzu.png new file mode 100644 index 0000000..b5a2f9c Binary files /dev/null and b/emacs.d/doc/img/powerline-anzu.png differ diff --git a/emacs.d/doc/img/powerline-arrow-fade.png b/emacs.d/doc/img/powerline-arrow-fade.png new file mode 100644 index 0000000..0facdec Binary files /dev/null and b/emacs.d/doc/img/powerline-arrow-fade.png differ diff --git a/emacs.d/doc/img/powerline-arrow.png b/emacs.d/doc/img/powerline-arrow.png new file mode 100644 index 0000000..e887a36 Binary files /dev/null and b/emacs.d/doc/img/powerline-arrow.png differ diff --git a/emacs.d/doc/img/powerline-bar.png b/emacs.d/doc/img/powerline-bar.png new file mode 100644 index 0000000..4c810f1 Binary files /dev/null and b/emacs.d/doc/img/powerline-bar.png differ diff --git a/emacs.d/doc/img/powerline-box.png b/emacs.d/doc/img/powerline-box.png new file mode 100644 index 0000000..7ec53ca Binary files /dev/null and b/emacs.d/doc/img/powerline-box.png differ diff --git a/emacs.d/doc/img/powerline-brace.png b/emacs.d/doc/img/powerline-brace.png new file mode 100644 index 0000000..e667039 Binary files /dev/null and b/emacs.d/doc/img/powerline-brace.png differ diff --git a/emacs.d/doc/img/powerline-butt.png b/emacs.d/doc/img/powerline-butt.png new file mode 100644 index 0000000..981263c Binary files /dev/null and b/emacs.d/doc/img/powerline-butt.png differ diff --git a/emacs.d/doc/img/powerline-chamfer.png b/emacs.d/doc/img/powerline-chamfer.png new file mode 100644 index 0000000..9fb4f4b Binary files /dev/null and b/emacs.d/doc/img/powerline-chamfer.png differ diff --git a/emacs.d/doc/img/powerline-contour.png b/emacs.d/doc/img/powerline-contour.png new file mode 100644 index 0000000..b4112eb Binary files /dev/null and b/emacs.d/doc/img/powerline-contour.png differ diff --git a/emacs.d/doc/img/powerline-curve.png b/emacs.d/doc/img/powerline-curve.png new file mode 100644 index 0000000..6d31e5e Binary files /dev/null and b/emacs.d/doc/img/powerline-curve.png differ diff --git a/emacs.d/doc/img/powerline-fix-windows.png b/emacs.d/doc/img/powerline-fix-windows.png new file mode 100644 index 0000000..fa87e7f Binary files /dev/null and b/emacs.d/doc/img/powerline-fix-windows.png differ diff --git a/emacs.d/doc/img/powerline-nil.png b/emacs.d/doc/img/powerline-nil.png new file mode 100644 index 0000000..9da702e Binary files /dev/null and b/emacs.d/doc/img/powerline-nil.png differ diff --git a/emacs.d/doc/img/powerline-rounded.png b/emacs.d/doc/img/powerline-rounded.png new file mode 100644 index 0000000..9666167 Binary files /dev/null and b/emacs.d/doc/img/powerline-rounded.png differ diff --git a/emacs.d/doc/img/powerline-roundstub.png b/emacs.d/doc/img/powerline-roundstub.png new file mode 100644 index 0000000..90402c6 Binary files /dev/null and b/emacs.d/doc/img/powerline-roundstub.png differ diff --git a/emacs.d/doc/img/powerline-slant.png b/emacs.d/doc/img/powerline-slant.png new file mode 100644 index 0000000..f02078d Binary files /dev/null and b/emacs.d/doc/img/powerline-slant.png differ diff --git a/emacs.d/doc/img/powerline-update.png b/emacs.d/doc/img/powerline-update.png new file mode 100644 index 0000000..9bd6523 Binary files /dev/null and b/emacs.d/doc/img/powerline-update.png differ diff --git a/emacs.d/doc/img/powerline-wave.png b/emacs.d/doc/img/powerline-wave.png new file mode 100644 index 0000000..d6090f5 Binary files /dev/null and b/emacs.d/doc/img/powerline-wave.png differ diff --git a/emacs.d/doc/img/powerline-zigzag.png b/emacs.d/doc/img/powerline-zigzag.png new file mode 100644 index 0000000..7fb3cf2 Binary files /dev/null and b/emacs.d/doc/img/powerline-zigzag.png differ diff --git a/emacs.d/doc/img/spacemacs-ahs-transient-state.png b/emacs.d/doc/img/spacemacs-ahs-transient-state.png new file mode 100644 index 0000000..cef0dac Binary files /dev/null and b/emacs.d/doc/img/spacemacs-ahs-transient-state.png differ diff --git a/emacs.d/doc/img/spacemacs-lisp-transient-state.png b/emacs.d/doc/img/spacemacs-lisp-transient-state.png new file mode 100644 index 0000000..f3eb236 Binary files /dev/null and b/emacs.d/doc/img/spacemacs-lisp-transient-state.png differ diff --git a/emacs.d/doc/img/spacemacs-python.png b/emacs.d/doc/img/spacemacs-python.png new file mode 100644 index 0000000..497075b Binary files /dev/null and b/emacs.d/doc/img/spacemacs-python.png differ diff --git a/emacs.d/doc/img/spacemacs-scale-transient-state.png b/emacs.d/doc/img/spacemacs-scale-transient-state.png new file mode 100644 index 0000000..1b2726a Binary files /dev/null and b/emacs.d/doc/img/spacemacs-scale-transient-state.png differ diff --git a/emacs.d/doc/img/spacemacs-startup.png b/emacs.d/doc/img/spacemacs-startup.png new file mode 100644 index 0000000..4118b01 Binary files /dev/null and b/emacs.d/doc/img/spacemacs-startup.png differ diff --git a/emacs.d/doc/img/spacemacs-urxvt.png b/emacs.d/doc/img/spacemacs-urxvt.png new file mode 100644 index 0000000..a837e64 Binary files /dev/null and b/emacs.d/doc/img/spacemacs-urxvt.png differ diff --git a/emacs.d/doc/img/title.png b/emacs.d/doc/img/title.png new file mode 100644 index 0000000..331537e Binary files /dev/null and b/emacs.d/doc/img/title.png differ diff --git a/emacs.d/doc/img/title2.png b/emacs.d/doc/img/title2.png new file mode 100644 index 0000000..3c3e62d Binary files /dev/null and b/emacs.d/doc/img/title2.png differ diff --git a/emacs.d/doc/img/update-green.png b/emacs.d/doc/img/update-green.png new file mode 100644 index 0000000..e2f7166 Binary files /dev/null and b/emacs.d/doc/img/update-green.png differ diff --git a/emacs.d/doc/img/update-orange.png b/emacs.d/doc/img/update-orange.png new file mode 100644 index 0000000..253df50 Binary files /dev/null and b/emacs.d/doc/img/update-orange.png differ diff --git a/emacs.d/doc/img/update-red.png b/emacs.d/doc/img/update-red.png new file mode 100644 index 0000000..9601734 Binary files /dev/null and b/emacs.d/doc/img/update-red.png differ diff --git a/emacs.d/doc/img/which-key.png b/emacs.d/doc/img/which-key.png new file mode 100644 index 0000000..4a1409d Binary files /dev/null and b/emacs.d/doc/img/which-key.png differ diff --git a/emacs.d/elpa/ack-and-a-half-20130815.1917/ack-and-a-half-autoloads.el b/emacs.d/elpa/ack-and-a-half-20130815.1917/ack-and-a-half-autoloads.el deleted file mode 100644 index 1bd9dca..0000000 --- a/emacs.d/elpa/ack-and-a-half-20130815.1917/ack-and-a-half-autoloads.el +++ /dev/null @@ -1,55 +0,0 @@ -;;; ack-and-a-half-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) - -;;;### (autoloads nil "ack-and-a-half" "ack-and-a-half.el" (21570 -;;;;;; 24235 0 0)) -;;; Generated autoloads from ack-and-a-half.el - -(autoload 'ack-and-a-half "ack-and-a-half" "\ -Run ack. -PATTERN is interpreted as a regular expression, iff REGEXP is -non-nil. If called interactively, the value of REGEXP is -determined by `ack-and-a-half-regexp-search'. A prefix arg -toggles the behavior. DIRECTORY is the root directory. If -called interactively, it is determined by -`ack-and-a-half-project-root-file-patterns'. The user is only -prompted, if `ack-and-a-half-prompt-for-directory' is set. - -\(fn PATTERN &optional REGEXP DIRECTORY)" t nil) - -(autoload 'ack-and-a-half-same "ack-and-a-half" "\ -Run ack with --type matching the current `major-mode'. -The types of files searched are determined by -`ack-and-a-half-mode-type-alist' and -`ack-and-a-half-mode-extension-alist'. If no type is configured, -the buffer's file extension is used for the search. PATTERN is -interpreted as a regular expression, iff REGEXP is non-nil. If -called interactively, the value of REGEXP is determined by -`ack-and-a-half-regexp-search'. A prefix arg toggles that value. -DIRECTORY is the directory in which to start searching. If -called interactively, it is determined by -`ack-and-a-half-project-root-file-patterns`. The user is only -prompted, if `ack-and-a-half-prompt-for-directory' is set.` - -\(fn PATTERN &optional REGEXP DIRECTORY)" t nil) - -(autoload 'ack-and-a-half-find-file "ack-and-a-half" "\ -Prompt to find a file found by ack in DIRECTORY. - -\(fn &optional DIRECTORY)" t nil) - -(autoload 'ack-and-a-half-find-file-same "ack-and-a-half" "\ -Prompt to find a file found by ack in DIRECTORY. - -\(fn &optional DIRECTORY)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; ack-and-a-half-autoloads.el ends here diff --git a/emacs.d/elpa/ack-and-a-half-20130815.1917/ack-and-a-half-pkg.el b/emacs.d/elpa/ack-and-a-half-20130815.1917/ack-and-a-half-pkg.el deleted file mode 100644 index 83643c4..0000000 --- a/emacs.d/elpa/ack-and-a-half-20130815.1917/ack-and-a-half-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "ack-and-a-half" "20130815.1917" "Yet another front-end for ack" 'nil :url "http://technosorcery.net") diff --git a/emacs.d/elpa/ack-and-a-half-20130815.1917/ack-and-a-half.el b/emacs.d/elpa/ack-and-a-half-20130815.1917/ack-and-a-half.el deleted file mode 100644 index fbe2bb3..0000000 --- a/emacs.d/elpa/ack-and-a-half-20130815.1917/ack-and-a-half.el +++ /dev/null @@ -1,503 +0,0 @@ -;;; ack-and-a-half.el --- Yet another front-end for ack -;; -;; Copyright (C) 2013 Jacob Helwig -;; Alexey Lebedeff -;; Andrew Pennebaker -;; Andrew Stine -;; Derek Chen-Becker -;; Gleb Peregud -;; Kim van Wyk -;; Lars Andersen -;; Ronaldo M. Ferraz -;; Ryan Thompson -;; -;; Author: Jacob Helwig -;; Homepage: http://technosorcery.net -;; Version: 20130815.1917 -;; X-Original-Version: 1.2.0 -;; URL: https://github.com/jhelwig/ack-and-a-half -;; -;; This file is NOT part of GNU Emacs. -;; -;; Permission is hereby granted, free of charge, to any person obtaining a copy of -;; this software and associated documentation files (the "Software"), to deal in -;; the Software without restriction, including without limitation the rights to -;; use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -;; of the Software, and to permit persons to whom the Software is furnished to do -;; so, subject to the following conditions: -;; -;; The above copyright notice and this permission notice shall be included in all -;; copies or substantial portions of the Software. -;; -;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -;; SOFTWARE. -;; -;;; Commentary: -;; -;; ack-and-a-half.el provides a simple compilation mode for the perl -;; grep-a-like ack (http://petdance.com/ack/). -;; -;; Add the following to your .emacs: -;; -;; (add-to-list 'load-path "/path/to/ack-and-a-half") -;; (require 'ack-and-a-half) -;; (defalias 'ack 'ack-and-a-half) -;; (defalias 'ack-same 'ack-and-a-half-same) -;; (defalias 'ack-find-file 'ack-and-a-half-find-file) -;; (defalias 'ack-find-file-same 'ack-and-a-half-find-file-same) -;; -;; Run `ack' to search for all files and `ack-same' to search for -;; files of the same type as the current buffer. -;; -;; `next-error' and `previous-error' can be used to jump to the -;; matches. -;; -;; `ack-find-file' and `ack-find-same-file' use ack to list the files -;; in the current project. It's a convenient, though slow, way of -;; finding files. -;; - -;;; Code: - -(eval-when-compile (require 'cl)) -(require 'compile) -(require 'grep) -(require 'thingatpt) - -(add-to-list 'debug-ignored-errors - "^Moved \\(back before fir\\|past la\\)st match$") -(add-to-list 'debug-ignored-errors "^File .* not found$") - -(define-compilation-mode ack-and-a-half-mode "Ack" - "Ack results compilation mode." - (set (make-local-variable 'truncate-lines) t) - (set (make-local-variable 'compilation-disable-input) t) - (let ((smbl 'compilation-ack-nogroup) - (pttrn '("^\\([^:\n]+?\\):\\([0-9]+\\):\\([0-9]+\\):" 1 2 3))) - (set (make-local-variable 'compilation-error-regexp-alist) (list smbl)) - (set (make-local-variable 'compilation-error-regexp-alist-alist) (list (cons smbl pttrn)))) - (set (make-local-variable 'compilation-process-setup-function) 'ack-and-a-half-mode-setup) - (set (make-local-variable 'compilation-error-face) grep-hit-face)) - -(defgroup ack-and-a-half nil "Yet another front end for ack." - :group 'tools - :group 'matching) - -(defcustom ack-and-a-half-executable (or (executable-find "ack") - (executable-find "ack-grep")) - "*The location of the ack executable." - :group 'ack-and-a-half - :type 'file) - -(defcustom ack-and-a-half-buffer-name "*Ack-and-a-half*" - "*The name of the ack-and-a-half buffer." - :group 'ack-and-a-half - :type 'string) - -(defun ack-buffer-name (mode) ack-and-a-half-buffer-name) - -(defcustom ack-and-a-half-arguments nil - "*Extra arguments to pass to ack." - :group 'ack-and-a-half - :type '(repeat (string))) - -(defcustom ack-and-a-half-mode-type-alist nil - "*File type(s) to search per major mode. (ack-and-a-half-same) -This overrides values in `ack-and-a-half-mode-type-default-alist'. -The car in each list element is a major mode, and the rest -is a list of strings passed to the --type flag of ack when running -`ack-and-a-half-same'." - :group 'ack-and-a-half - :type '(repeat (cons (symbol :tag "Major mode") - (repeat (string :tag "ack --type"))))) - -(defcustom ack-and-a-half-mode-extension-alist nil - "*File extensions to search per major mode. (ack-and-a-half-same) -This overrides values in `ack-and-a-half-mode-extension-default-alist'. -The car in each list element is a major mode, and the rest -is a list of file extensions to be searched in addition to -the type defined in `ack-and-a-half-mode-type-alist' when -running `ack-and-a-half-same'." - :group 'ack-and-a-half - :type '(repeat (cons (symbol :tag "Major mode") - (repeat :tag "File extensions" (string))))) - -(defcustom ack-and-a-half-ignore-case 'smart - "*Whether or not to ignore case when searching. -The special value 'smart enables the ack option \"smart-case\"." - :group 'ack-and-a-half - :type '(choice (const :tag "Case sensitive" nil) - (const :tag "Smart case" 'smart) - (const :tag "Case insensitive" t))) - -(defcustom ack-and-a-half-regexp-search t - "*Default to regular expression searching. -Giving a prefix argument to `ack-and-a-half' toggles this option." - :group 'ack-and-a-half - :type '(choice (const :tag "Literal searching" nil) - (const :tag "Regular expression searching" t))) - -(defcustom ack-and-a-half-use-environment t - "*Use .ackrc and ACK_OPTIONS when searching." - :group 'ack-and-a-half - :type '(choice (const :tag "Ignore environment" nil) - (const :tag "Use environment" t))) - -(defcustom ack-and-a-half-root-directory-functions '(ack-and-a-half-guess-project-root) - "*List of functions used to find the base directory to ack from. -These functions are called until one returns a directory. If successful, -`ack-and-a-half' is run from that directory instead of from `default-directory'. -The directory is verified by the user depending on `ack-and-a-half-prompt-for-directory'." - :group 'ack-and-a-half - :type '(repeat function)) - -(defcustom ack-and-a-half-project-root-file-patterns - '(".project\\'" - ".xcodeproj\\'" - ".sln\\'" - "\\`Project.ede\\'" - "\\`.git\\'" - "\\`.bzr\\'" - "\\`_darcs\\'" - "\\`.hg\\'") - "*List of file patterns for the project root (used by `ack-and-a-half-guess-project-root'). -Each element is a regular expression. If a file matching any element is -found in a directory, then that directory is assumed to be the project -root by `ack-and-a-half-guess-project-root'." - :group 'ack-and-a-half - :type '(repeat (string :tag "Regular expression"))) - -(defcustom ack-and-a-half-prompt-for-directory 'unless-guessed - "*Prompt for directory in which to run ack. -If this is 'unless-guessed, then the value determined by -`ack-and-a-half-root-directory-functions' is used without -confirmation. If it is nil, then the directory is never -confirmed. If t, then always prompt for the directory to use." - :group 'ack-and-a-half - :type '(choice (const :tag "Don't prompt" nil) - (const :tag "Don't prompt when guessed" unless-guessed) - (const :tag "Always prompt" t))) - -(defcustom ack-and-a-half-use-ido nil - "Whether or not ack-and-a-half should use ido to provide - completion suggestions when prompting for directory.") - -;;; Default setting lists ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defconst ack-and-a-half-mode-type-default-alist - '((actionscript-mode "actionscript") - (LaTeX-mode "tex") - (TeX-mode "tex") - (asm-mode "asm") - (batch-file-mode "batch") - (c++-mode "cpp") - (c-mode "cc") - (cfmx-mode "cfmx") - (cperl-mode "perl") - (csharp-mode "csharp") - (css-mode "css") - (emacs-lisp-mode "elisp") - (erlang-mode "erlang") - (espresso-mode "java") - (fortran-mode "fortran") - (haskell-mode "haskell") - (hexl-mode "binary") - (html-mode "html") - (java-mode "java") - (javascript-mode "js") - (jde-mode "java") - (js2-mode "js") - (jsp-mode "jsp") - (latex-mode "tex") - (lisp-mode "lisp") - (lua-mode "lua") - (makefile-mode "make") - (mason-mode "mason") - (nxml-mode "xml") - (objc-mode "objc" "objcpp") - (ocaml-mode "ocaml") - (parrot-mode "parrot") - (perl-mode "perl") - (php-mode "php") - (plone-mode "plone") - (python-mode "python") - (ruby-mode "ruby") - (scala-mode "scala") - (scheme-mode "scheme") - (shell-script-mode "shell") - (skipped-mode "skipped") - (smalltalk-mode "smalltalk") - (sql-mode "sql") - (tcl-mode "tcl") - (tex-mode "tex") - (tt-mode "tt") - (vb-mode "vb") - (vim-mode "vim") - (xml-mode "xml") - (yaml-mode "yaml")) - "Default values for `ack-and-a-half-mode-type-alist'.") - -(defconst ack-and-a-half-mode-extension-default-alist - '((d-mode "d")) - "Default values for `ack-and-a-half-mode-extension-alist'.") - -(defun ack-and-a-half-create-type (extensions) - (list "--type-set" - (concat "ack-and-a-half-custom-type=" (mapconcat 'identity extensions ",")) - "--type" "ack-and-a-half-custom-type")) - -(defun ack-and-a-half-type-for-major-mode (mode) - "Return the --type and --type-set arguments to use with ack for major mode MODE." - (let ((types (cdr (or (assoc mode ack-and-a-half-mode-type-alist) - (assoc mode ack-and-a-half-mode-type-default-alist)))) - (ext (cdr (or (assoc mode ack-and-a-half-mode-extension-alist) - (assoc mode ack-and-a-half-mode-extension-default-alist)))) - result) - (dolist (type types) - (push type result) - (push "--type" result)) - (if ext - (if types - `("--type-add" ,(concat (car types) - "=" (mapconcat 'identity ext ",")) - . ,result) - (ack-and-a-half-create-type ext)) - result))) - -;;; Project root ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defun ack-and-a-half-guess-project-root () - "Guess the project root directory. -This is intended to be used in `ack-and-a-half-root-directory-functions'." - (catch 'root - (let ((dir (expand-file-name (if buffer-file-name - (file-name-directory buffer-file-name) - default-directory))) - (pattern (mapconcat 'identity ack-and-a-half-project-root-file-patterns "\\|"))) - (while (not (equal dir "/")) - (when (directory-files dir nil pattern t) - (throw 'root dir)) - (setq dir (file-name-directory (directory-file-name dir))))))) - -;;; Commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defvar ack-and-a-half-directory-history nil - "Directories recently searched with `ack-and-a-half'.") -(defvar ack-and-a-half-literal-history nil - "Strings recently searched for with `ack-and-a-half'.") -(defvar ack-and-a-half-regexp-history nil - "Regular expressions recently searched for with `ack-and-a-half'.") - -(defun ack-and-a-half-initial-contents-for-read () - (when (ack-and-a-half-use-region-p) - (buffer-substring-no-properties (region-beginning) (region-end)))) - -(defun ack-and-a-half-default-for-read () - (unless (ack-and-a-half-use-region-p) - (thing-at-point 'symbol))) - -(defun ack-and-a-half-use-region-p () - (or (and (fboundp 'use-region-p) (use-region-p)) - (and transient-mark-mode mark-active - (> (region-end) (region-beginning))))) - -(defsubst ack-and-a-half-read (regexp) - (let* ((default (ack-and-a-half-default-for-read)) - (type (if regexp "pattern" "literal search")) - (history-var ) - (prompt (if default - (format "ack %s (default %s): " type default) - (format "ack %s: " type)))) - (read-string prompt - (ack-and-a-half-initial-contents-for-read) - (if regexp 'ack-regexp-history 'ack-literal-history) - default))) - -(defun ack-and-a-half-read-dir () - (let ((dir (run-hook-with-args-until-success 'ack-and-a-half-root-directory-functions))) - (if ack-and-a-half-prompt-for-directory - (if (and dir (eq ack-and-a-half-prompt-for-directory 'unless-guessed)) - dir - (if ack-and-a-half-use-ido - (ido-read-directory-name "Directory: " dir dir t) - (read-directory-name "Directory: " dir dir t))) - (or dir - (and buffer-file-name (file-name-directory buffer-file-name)) - default-directory)))) - -(defsubst ack-and-a-half-xor (a b) - (if a (not b) b)) - -(defun ack-and-a-half-interactive () - "Return the (interactive) arguments for `ack-and-a-half' and `ack-and-a-half-same'." - (let ((regexp (ack-and-a-half-xor current-prefix-arg ack-and-a-half-regexp-search))) - (list (ack-and-a-half-read regexp) - regexp - (ack-and-a-half-read-dir)))) - -(defun ack-and-a-half-type () - (or (ack-and-a-half-type-for-major-mode major-mode) - (when buffer-file-name - (ack-and-a-half-create-type (list (file-name-extension buffer-file-name)))))) - -(defun ack-and-a-half-option (name enabled) - (format "--%s%s" (if enabled "" "no") name)) - -(defun ack-and-a-half-arguments-from-options (regexp) - (let ((arguments (list "--nocolor" "--nogroup" "--column" - (ack-and-a-half-option "smart-case" (eq ack-and-a-half-ignore-case 'smart)) - (ack-and-a-half-option "env" ack-and-a-half-use-environment) - ))) - (unless ack-and-a-half-ignore-case - (push "-i" arguments)) - (unless regexp - (push "--literal" arguments)) - arguments)) - -(defun ack-and-a-half-string-replace (from to string &optional re) - "Replace all occurrences of FROM with TO in STRING. -All arguments are strings. When optional fourth argument (RE) is -non-nil, treat FROM as a regular expression." - (let ((pos 0) - (res "") - (from (if re from (regexp-quote from)))) - (while (< pos (length string)) - (if (setq beg (string-match from string pos)) - (progn - (setq res (concat res - (substring string pos (match-beginning 0)) - to)) - (setq pos (match-end 0))) - (progn - (setq res (concat res (substring string pos (length string)))) - (setq pos (length string))))) - res)) - -(defun ack-and-a-half-run (directory regexp pattern &rest arguments) - "Run ack in DIRECTORY with ARGUMENTS." - (let ((default-directory (if directory - (file-name-as-directory (expand-file-name directory)) - default-directory))) - (setq arguments (append ack-and-a-half-arguments - (ack-and-a-half-arguments-from-options regexp) - arguments - (list "--") - (list (shell-quote-argument pattern)) - (when (eq system-type 'windows-nt) - (list (concat " < " null-device))) - )) - (make-local-variable 'compilation-buffer-name-function) - (let (compilation-buffer-name-function) - (setq compilation-buffer-name-function 'ack-buffer-name) - (compilation-start (mapconcat 'identity (nconc (list ack-and-a-half-executable) arguments) " ") - 'ack-and-a-half-mode)))) - -(defun ack-and-a-half-read-file (prompt choices) - (if ido-mode - (ido-completing-read prompt choices nil t) - (require 'iswitchb) - (with-no-warnings - (let ((iswitchb-make-buflist-hook - (lambda () (setq iswitchb-temp-buflist choices)))) - (iswitchb-read-buffer prompt nil t))))) - -(defun ack-and-a-half-list-files (directory &rest arguments) - (with-temp-buffer - (let ((default-directory directory)) - (when (eq 0 (apply 'call-process ack-and-a-half-executable nil t nil "-f" "--print0" - arguments)) - (goto-char (point-min)) - (let ((beg (point-min)) - files) - (while (re-search-forward "\0" nil t) - (push (buffer-substring beg (match-beginning 0)) files) - (setq beg (match-end 0))) - files))))) - -(defun ack-and-a-half-version-string () - "Return the ack version string." - (with-temp-buffer - (call-process ack-and-a-half-executable nil t nil "--version") - (goto-char (point-min)) - (re-search-forward " +") - (buffer-substring (point) (point-at-eol)))) - -(defun ack-and-a-half-mode-setup () - "Setup compilation variables and buffer for `ack-and-a-half'. -Set up `compilation-exit-message-function'." - (set (make-local-variable 'compilation-exit-message-function) - (lambda (status code msg) - (if (eq status 'exit) - (cond ((and (zerop code) (buffer-modified-p)) - '("finished (matches found)\n" . "matched")) - ((not (buffer-modified-p)) - '("finished with no matches found\n" . "no match")) - (t - (cons msg code))) - (cons msg code))))) - -;;; Public interface ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;;###autoload -(defun ack-and-a-half (pattern &optional regexp directory) - "Run ack. -PATTERN is interpreted as a regular expression, iff REGEXP is -non-nil. If called interactively, the value of REGEXP is -determined by `ack-and-a-half-regexp-search'. A prefix arg -toggles the behavior. DIRECTORY is the root directory. If -called interactively, it is determined by -`ack-and-a-half-project-root-file-patterns'. The user is only -prompted, if `ack-and-a-half-prompt-for-directory' is set." - (interactive (ack-and-a-half-interactive)) - (ack-and-a-half-run directory regexp pattern)) - -;;;###autoload -(defun ack-and-a-half-same (pattern &optional regexp directory) - "Run ack with --type matching the current `major-mode'. -The types of files searched are determined by -`ack-and-a-half-mode-type-alist' and -`ack-and-a-half-mode-extension-alist'. If no type is configured, -the buffer's file extension is used for the search. PATTERN is -interpreted as a regular expression, iff REGEXP is non-nil. If -called interactively, the value of REGEXP is determined by -`ack-and-a-half-regexp-search'. A prefix arg toggles that value. -DIRECTORY is the directory in which to start searching. If -called interactively, it is determined by -`ack-and-a-half-project-root-file-patterns`. The user is only -prompted, if `ack-and-a-half-prompt-for-directory' is set.`" - (interactive (ack-and-a-half-interactive)) - (let ((type (ack-and-a-half-type))) - (if type - (apply 'ack-and-a-half-run directory regexp pattern type) - (ack-and-a-half pattern regexp directory)))) - -;;;###autoload -(defun ack-and-a-half-find-file (&optional directory) - "Prompt to find a file found by ack in DIRECTORY." - (interactive (list (ack-and-a-half-read-dir))) - (find-file (expand-file-name - (ack-and-a-half-read-file - "Find file: " - (ack-and-a-half-list-files directory)) - directory))) - -;;;###autoload -(defun ack-and-a-half-find-file-same (&optional directory) - "Prompt to find a file found by ack in DIRECTORY." - (interactive (list (ack-and-a-half-read-dir))) - (find-file (expand-file-name - (ack-and-a-half-read-file - "Find file: " - (apply 'ack-and-a-half-list-files directory (ack-and-a-half-type))) - directory))) - -;;; End ack-and-a-half.el ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(provide 'ack-and-a-half) - -;;; ack-and-a-half.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-autoloads.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-autoloads.el deleted file mode 100644 index 8235240..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-autoloads.el +++ /dev/null @@ -1,116 +0,0 @@ -;;; alchemist-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) - -;;;### (autoloads nil "alchemist" "alchemist.el" (22171 46586 0 0)) -;;; Generated autoloads from alchemist.el - -(autoload 'alchemist-mode "alchemist" "\ -Toggle alchemist mode. - -Key bindings: -\\{alchemist-mode-map} - -\(fn &optional ARG)" t nil) - -;;;*** - -;;;### (autoloads nil "alchemist-iex" "alchemist-iex.el" (22171 46586 -;;;;;; 0 0)) -;;; Generated autoloads from alchemist-iex.el - -(defalias 'run-elixir 'alchemist-iex-run) - -(autoload 'alchemist-iex-run "alchemist-iex" "\ -Start an IEx process. -Show the IEx buffer if an IEx process is already run. - -\(fn &optional ARG)" t nil) - -(autoload 'alchemist-iex-project-run "alchemist-iex" "\ -Start an IEx process with mix 'iex -S mix' in the -context of an Elixir project. -Show the IEx buffer if an IEx process is already run. - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil "alchemist-phoenix" "alchemist-phoenix.el" -;;;;;; (22171 46586 0 0)) -;;; Generated autoloads from alchemist-phoenix.el - -(autoload 'alchemist-phoenix-project-p "alchemist-phoenix" "\ -Return non-nil if `default-directory' is inside an Phoenix project. - -\(fn)" nil nil) - -(autoload 'alchemist-phoenix-mode "alchemist-phoenix" "\ -Minor mode for Elixir Phoenix web framework projects. - -The following commands are available: - -\\{alchemist-phoenix-mode-map} - -\(fn &optional ARG)" t nil) - -(autoload 'alchemist-phoenix-enable-mode "alchemist-phoenix" "\ - - -\(fn)" nil nil) - -(dolist (hook '(alchemist-mode-hook)) (add-hook hook 'alchemist-phoenix-enable-mode)) - -;;;*** - -;;;### (autoloads nil "alchemist-refcard" "alchemist-refcard.el" -;;;;;; (22171 46586 0 0)) -;;; Generated autoloads from alchemist-refcard.el - -(autoload 'alchemist-refcard "alchemist-refcard" "\ -Generate an Alchemist refcard of all the features. - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil "alchemist-test-mode" "alchemist-test-mode.el" -;;;;;; (22171 46586 0 0)) -;;; Generated autoloads from alchemist-test-mode.el - -(autoload 'alchemist-test-mode "alchemist-test-mode" "\ -Minor mode for Elixir ExUnit files. - -The following commands are available: - -\\{alchemist-test-mode-map} - -\(fn &optional ARG)" t nil) - -(autoload 'alchemist-test-enable-mode "alchemist-test-mode" "\ - - -\(fn)" nil nil) - -(dolist (hook '(alchemist-mode-hook)) (add-hook hook 'alchemist-test-enable-mode)) - -;;;*** - -;;;### (autoloads nil nil ("alchemist-company.el" "alchemist-compile.el" -;;;;;; "alchemist-complete.el" "alchemist-eval.el" "alchemist-execute.el" -;;;;;; "alchemist-file.el" "alchemist-goto.el" "alchemist-help.el" -;;;;;; "alchemist-hooks.el" "alchemist-info.el" "alchemist-interact.el" -;;;;;; "alchemist-key.el" "alchemist-macroexpand.el" "alchemist-message.el" -;;;;;; "alchemist-mix.el" "alchemist-pkg.el" "alchemist-project.el" -;;;;;; "alchemist-report.el" "alchemist-scope.el" "alchemist-server.el" -;;;;;; "alchemist-utils.el") (22171 46586 526902 0)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; alchemist-autoloads.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-company.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-company.el deleted file mode 100644 index 113f33d..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-company.el +++ /dev/null @@ -1,146 +0,0 @@ -;;; alchemist-company.el --- Elixir company-mode backend -*- lexical-binding: t -*- - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Elixir company-mode backend. - -;;; Code: - -(require 'cl-lib) -(require 'company) -(require 'alchemist-help) -(require 'alchemist-goto) -(require 'alchemist-scope) -(require 'alchemist-server) -(require 'alchemist-complete) - -(defgroup alchemist-company nil - "Elixir company-mode backend." - :prefix "alchemist-company-" - :group 'alchemist) - -;; Variables - -(defcustom alchemist-company-show-annotation t - "Show an annotation inline with the candidate." - :type 'boolean - :group 'alchemist-company) - -(defvar alchemist-company-callback nil) -(defvar alchemist-company-filter-output nil) -(defvar alchemist-company-last-completion nil) -(defvar alchemist-company-doc-lookup-done nil) - -(defun alchemist-company--wait-for-doc-buffer () - (while (not alchemist-company-doc-lookup-done) - (sit-for 0.01))) - -(defun alchemist-company-show-documentation (candidate) - (interactive) - (let* ((annotation (alchemist-company--annotation candidate)) - (candidate (if annotation - (format "%s%s" candidate annotation) - candidate)) - (candidate (alchemist-help--prepare-search-expr candidate))) - (setq alchemist-company-doc-lookup-done nil) - (alchemist-server-help (alchemist-help--server-arguments candidate) #'alchemist-company-doc-buffer-filter) - (alchemist-company--wait-for-doc-buffer) - (get-buffer alchemist-help-buffer-name))) - -(defun alchemist-company-open-definition (candidate) - (interactive) - (alchemist-goto--open-definition candidate)) - -(defun alchemist-company--annotation (candidate) - (get-text-property 0 'meta candidate)) - -(defun alchemist-company-build-scope-arg (arg) - "Build informations about the current context." - (let* ((modules (alchemist-utils-prepare-modules-for-elixir - (alchemist-scope-all-modules))) - (aliases (alchemist-utils-prepare-aliases-for-elixir - (alchemist-scope-aliases)))) - (format "{ \"%s\", [ context: Elixir, imports: %s, aliases: %s ] }" arg modules aliases))) - -(defun alchemist-company-build-server-arg (arg) - (if (not (equal major-mode 'alchemist-iex-mode)) - (alchemist-company-build-scope-arg arg) - (format "{ \"%s\", [ context: [], imports: [], aliases: [] ] }" arg))) - -(defun alchemist-company-filter (_process output) - (setq alchemist-company-filter-output (cons output alchemist-company-filter-output)) - (if (alchemist-server-contains-end-marker-p output) - (let* ((candidates (alchemist-complete--build-candidates-from-process-output alchemist-company-filter-output))) - (setq alchemist-company-filter-output nil) - (alchemist-company-serve-candidates-to-callback (-distinct candidates))))) - -(defun alchemist-company-doc-buffer-filter (_process output) - (setq alchemist-company-filter-output (cons output alchemist-company-filter-output)) - (if (alchemist-server-contains-end-marker-p output) - (let ((string (alchemist-server-prepare-filter-output alchemist-company-filter-output))) - (setq alchemist-company-filter-output nil) - (if (get-buffer alchemist-help-buffer-name) - (kill-buffer alchemist-help-buffer-name)) - (with-current-buffer (get-buffer-create alchemist-help-buffer-name) - (insert string) - (ansi-color-apply-on-region (point-min) (point-max)) - (alchemist-help-minor-mode 1)) - (setq alchemist-company-doc-lookup-done t)))) - -(defun alchemist-company-serve-candidates-to-callback (candidates) - (let* ((candidates (if candidates - candidates - (alchemsit-complete--dabbrev-code-candidates))) - (candidates (if (eq (length candidates) 1) - (-insert-at 0 company-prefix candidates) - candidates)) - (candidates (-distinct candidates))) - (funcall alchemist-company-callback candidates))) - -(defun alchemist-company (command &optional arg &rest ignored) - "`company-mode' completion back-end for Elixir." - (interactive (list 'interactive)) - (when alchemist-company-show-annotation - (set 'company-tooltip-align-annotations t)) - (cl-case command - (interactive (company-begin-backend 'alchemist-company)) - (init (or (eq major-mode 'elixir-mode) - (string= mode-name "Alchemist-IEx"))) - (prefix (and (or (eq major-mode 'elixir-mode) - (string= mode-name "Alchemist-IEx")) - (alchemist-scope-expression))) - (doc-buffer (alchemist-company-show-documentation arg)) - (location (alchemist-company-open-definition arg)) - (candidates (cons :async - (lambda (cb) - (setq alchemist-company-last-completion arg) - (setq alchemist-company-callback cb) - (alchemist-server-complete-candidates (alchemist-company-build-server-arg arg) - #'alchemist-company-filter)))) - (annotation (when alchemist-company-show-annotation - (alchemist-company--annotation arg))))) - -(add-to-list 'company-backends 'alchemist-company) - -(provide 'alchemist-company) - -;;; alchemist-company.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-compile.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-compile.el deleted file mode 100644 index 6d7bdc9..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-compile.el +++ /dev/null @@ -1,89 +0,0 @@ -;;; alchemist-compile.el --- Elixir compilation functionality - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Elixir compilation functionality. - -;;; Code: - -(require 'alchemist-utils) -(require 'alchemist-report) - -(defgroup alchemist-compile nil - "Elixir compilation functionality." - :prefix "alchemist-compile-" - :group 'alchemist) - -;; Variables - -(defcustom alchemist-compile-command "elixirc" - "The shell command for elixirc." - :type 'string - :group 'alchemist-compile) - -(defvar alchemist-compile-buffer-name "*alchemist elixirc*" - "Name of the elixir output buffer.") - -(defvar alchemist-compile-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "q" #'quit-window) - map)) - -;; Private functions - -(defun alchemist-compile--file (filename) - (cond ((not (file-exists-p filename)) (error "The given file doesn't exist")) - ((string-match "\.exs$" filename) (error "The given file is an Elixir Script")) - (t (alchemist-compile (list alchemist-compile-command (expand-file-name filename)))))) - -(defun alchemist-compile--read-command (command) - (read-shell-command "elixirc command: " (concat command " "))) - -;; Public functions - -(defun alchemist-compile-this-buffer () - "Compile the current buffer with elixirc." - (interactive) - (alchemist-compile--file buffer-file-name)) - -(defun alchemist-compile-file (filename) - "Compile the given FILENAME." - (interactive "Felixirc: ") - (alchemist-compile--file (expand-file-name filename))) - -(define-derived-mode alchemist-compile-mode fundamental-mode "Elixir Compile Mode" - "Major mode for compiling Elixir files. - -\\{alchemist-compile-mode-map}" - (setq buffer-read-only t) - (setq-local truncate-lines t) - (setq-local electric-indent-chars nil)) - -(defun alchemist-compile (cmdlist) - "Compile CMDLIST with elixirc." - (interactive (list (alchemist-compile--read-command alchemist-compile-command))) - (let ((command (alchemist-utils-build-command cmdlist))) - (alchemist-report-run command "alchemist-compile-report" alchemist-compile-buffer-name 'alchemist-compile-mode))) - -(provide 'alchemist-compile) - -;;; alchemist-compile.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-complete.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-complete.el deleted file mode 100644 index 053ef16..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-complete.el +++ /dev/null @@ -1,142 +0,0 @@ -;;; alchemist-complete.el --- Complete functionality for Elixir source code -*- lexical-binding: t -*- - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Complete functionality for Elixir and Erlang source code. - -;;; Code: - -(require 'cl-lib) -(require 'dash) -(require 'ansi-color) -(require 'company-dabbrev-code) -(require 'alchemist-utils) - -(defgroup alchemist-complete nil - "Complete functionality for Elixir source code." - :prefix "alchemist-complete-" - :group 'alchemist) - -(defvar alchemist-company-last-completion nil) - -(defun alchemist-complete--concat-prefix-with-functions (prefix functions &optional add-prefix) - (let* ((prefix (mapconcat 'concat (butlast (split-string prefix "\\.") 1) ".")) - (candidates (-map (lambda (c) (concat prefix "." c)) (cdr functions)))) - (if add-prefix - (push prefix candidates) - candidates))) - -(defun alchemist-complete--add-prefix-to-function (prefix function) - (let* ((prefix (mapconcat 'concat (butlast (split-string prefix "\\.") 1) ".")) - (candidate (concat prefix "." function))) - candidate)) - -(defun alchemist-complete--build-candidates (a-list) - (let* ((search-term (car a-list)) - (candidates a-list) - (candidates (-map (lambda (f) - (let* ((candidate f) - (meta (if (string-match-p "^.+/" f) - (replace-regexp-in-string "^.+/" "/" f) - ""))) - (cond - ((and (string-match-p "^:" search-term) - (not (string-match-p "\\." search-term))) - (unless (string= search-term candidate) - (propertize (concat ":" candidate)) - )) - ((string-match-p "\\." search-term) - (unless (string= search-term candidate) - (propertize (alchemist-complete--add-prefix-to-function (concat (alchemist-scope-extract-module search-term) ".") - (replace-regexp-in-string "/[0-9]$" "" candidate)) 'meta meta))) - (t (propertize (replace-regexp-in-string "/[0-9]$" "" candidate) 'meta meta))))) - candidates)) - (candidates (-remove 'null candidates))) - (cond - ((and (string-match-p "\\.$" search-term) - (not (string-match-p "\\.$" alchemist-company-last-completion))) - (push (alchemist-utils-remove-dot-at-the-end search-term) candidates)) - (t candidates)))) - -(defun alchemist-complete--build-help-candidates (a-list) - (let* ((search-term (car a-list)) - (candidates (cond ((> (alchemist-utils-count-char-occurence "\\." search-term) 1) - (let ((search (if (string-match-p "\\.[a-z0-9_\?!]+$" search-term) - (list (replace-regexp-in-string "\\.[a-z0-9_\?!]+$" "" search-term)) - (list (alchemist-utils-remove-dot-at-the-end search-term)))) - (candidates (-map (lambda (c) - (if (string-match-p "\\.[a-z0-9_\?!]+$" search-term) - (concat (replace-regexp-in-string "\\.[a-z0-9_\?!]+$" "." search-term) c) - (concat search-term c))) - (cdr a-list)))) - (append search candidates))) - ((string-match-p "\\.$" search-term) - (alchemist-complete--concat-prefix-with-functions search-term a-list t)) - ((string-match-p "\\.[a-z0-9_\?!]+$" search-term) - (alchemist-complete--concat-prefix-with-functions search-term a-list)) - (t - a-list)))) - (-distinct candidates))) - -(defun alchemist-complete--output-to-list (output) - (let* ((output (split-string output))) - (-remove 'null output))) - -(defun alchemist-complete--build-candidates-from-process-output (output) - (let* ((output (alchemist-server-prepare-filter-output output)) - (candidates (if (not (alchemist-utils-empty-string-p output)) - (alchemist-complete--output-to-list - (ansi-color-filter-apply output)) - '())) - (candidates (if candidates - (alchemist-complete--build-candidates candidates) - '()))) - candidates)) - -(defun alchemist-complete--completing-prompt (initial completing-collection) - (let* ((completing-collection (alchemist-complete--build-help-candidates completing-collection))) - (cond ((equal (length completing-collection) 1) - (car completing-collection)) - (completing-collection - (completing-read - "Elixir help: " - completing-collection - nil - nil - (replace-regexp-in-string "\\.$" "" initial))) - (t initial)))) - -(defun alchemsit-complete--dabbrev-code-candidates () - "This function uses a piece of functionality of company-dabbrev-code backend. - -Please have a look at the company-dabbrev-code function for more -detailed information." - (let ((case-fold-search nil)) - (-distinct (company-dabbrev--search - (company-dabbrev-code--make-regexp alchemist-company-last-completion) - company-dabbrev-code-time-limit - (list major-mode) - t)))) - -(provide 'alchemist-complete) - -;;; alchemist-complete.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-eval.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-eval.el deleted file mode 100644 index a3c4c5d..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-eval.el +++ /dev/null @@ -1,219 +0,0 @@ -;;; alchemist-eval.el --- Elixir code inline evaluation functionality - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Elixir code inline evaluation functionality - -;;; Code: - -(require 'elixir-mode) -(require 'alchemist-server) -(require 'alchemist-interact) - -(defgroup alchemist-eval nil - "Elixir code inline evaluation functionality." - :prefix "alchemist-eval-" - :group 'alchemist) - -(defconst alchemist-eval-buffer-name "*alchemist-eval-mode*" - "Name of the Elixir evaluation buffer.") - -(defvar alchemist-eval-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "q") #'quit-window) - map) - "Keymap for `alchemist-eval-mode'.") - -(defvar alchemist-eval-filter-output nil) - -;; Private functions - -(defun alchemist-eval--insert (string) - (let ((lines (split-string string "\n"))) - (if (> (length lines) 1) - (progn - (save-excursion - (end-of-line) - (mapc (lambda (s) - (newline) - (insert (format "# => %s" s)) - (indent-according-to-mode)) - lines))) - (save-excursion - (end-of-line) - (insert (format " # => %s" string)))))) - -(defun alchemist-eval--expression (expression) - (let ((file (make-temp-file "alchemist-eval" nil ".exs"))) - (with-temp-file file - (insert expression)) - (alchemist-server-eval (format "{ :eval, '%s' }" file) #'alchemist-eval-filter))) - -(defun alchemist-eval--expression-and-print (expression) - (let ((file (make-temp-file "alchemist-eval" nil ".exs"))) - (with-temp-file file - (insert expression)) - (alchemist-server-eval (format "{ :eval, '%s' }" file) #'alchemist-eval-insert-filter))) - -(defun alchemist-eval--quote-expression (expression) - (let ((file (make-temp-file "alchemist-eval" nil ".exs"))) - (with-temp-file file - (insert expression)) - (alchemist-server-eval (format "{ :quote, '%s' }" file) #'alchemist-eval-quoted-filter))) - -(defun alchemist-eval--quote-expression-and-print (expression) - (let ((file (make-temp-file "alchemist-eval" nil ".exs"))) - (with-temp-file file - (insert expression)) - (alchemist-server-eval (format "{ :quote, '%s' }" file) #'alchemist-eval-quoted-insert-filter))) - -(defun alchemist-eval-filter (_process output) - (setq alchemist-eval-filter-output (cons output alchemist-eval-filter-output)) - (when (alchemist-server-contains-end-marker-p output) - (alchemist-interact-create-popup alchemist-eval-buffer-name - (alchemist-server-prepare-filter-output alchemist-eval-filter-output) - #'(lambda () - (elixir-mode) - (alchemist-eval-mode) - (ansi-color-apply-on-region (point-min) (point-max)))) - (setq alchemist-eval-filter-output nil))) - -(defun alchemist-eval-insert-filter (_process output) - (setq alchemist-eval-filter-output (cons output alchemist-eval-filter-output)) - (when (alchemist-server-contains-end-marker-p output) - (alchemist-interact-insert-as-comment - (alchemist-server-prepare-filter-output alchemist-eval-filter-output)) - (setq alchemist-eval-filter-output nil))) - -(defun alchemist-eval-quoted-filter (_process output) - (setq alchemist-eval-filter-output (cons output alchemist-eval-filter-output)) - (when (alchemist-server-contains-end-marker-p output) - (alchemist-interact-create-popup alchemist-eval-buffer-name - (alchemist-server-prepare-filter-output alchemist-eval-filter-output) - #'alchemist-eval-mode) - (setq alchemist-eval-filter-output nil))) - -(defun alchemist-eval-quoted-insert-filter (_process output) - (setq alchemist-eval-filter-output (cons output alchemist-eval-filter-output)) - (when (alchemist-server-contains-end-marker-p output) - (alchemist-interact-insert-as-comment - (alchemist-server-prepare-filter-output alchemist-eval-filter-output)) - (setq alchemist-eval-filter-output nil))) - -;; Public functions - -(defun alchemist-eval-current-line () - "Evaluate the Elixir code on the current line." - (interactive) - (alchemist-eval--expression (thing-at-point 'line))) - -(defun alchemist-eval-print-current-line () - "Evaluate the Elixir code on the current line and insert the result." - (interactive) - (alchemist-eval--expression-and-print (thing-at-point 'line))) - -(defun alchemist-eval-region (beg end) - "Evaluate the Elixir code on marked region." - (interactive (list (point) (mark))) - (unless (and beg end) - (error "The mark is not set now, so there is no region")) - (let ((string (buffer-substring-no-properties beg end))) - (alchemist-eval--expression string))) - -(defun alchemist-eval-print-region (beg end) - "Evaluate the Elixir code on marked region and insert the result." - (interactive (list (point) (mark))) - (unless (and beg end) - (error "The mark is not set now, so there is no region")) - (let ((string (buffer-substring-no-properties beg end))) - (when (> end beg) - (exchange-point-and-mark)) - (alchemist-eval--expression-and-print string))) - -(defun alchemist-eval-buffer () - "Evaluate the Elixir code in the current buffer." - (interactive) - (let ((string (buffer-substring-no-properties (point-min) (point-max)))) - (alchemist-eval--expression string))) - -(defun alchemist-eval-print-buffer () - "Evaluate the Elixir code in the current buffer and insert the result." - (interactive) - (let ((string (buffer-substring-no-properties (point-min) (point-max)))) - (goto-char (point-max)) - (alchemist-eval--expression-and-print string))) - -(defun alchemist-eval-quoted-current-line () - "Get the Elixir code representation of the expression on the current line." - (interactive) - (alchemist-eval--quote-expression (thing-at-point 'line))) - -(defun alchemist-eval-print-quoted-current-line () - "Get the Elixir code representation of the expression on the current line and insert the result." - (interactive) - (alchemist-eval--quote-expression-and-print (thing-at-point 'line))) - -(defun alchemist-eval-quoted-region (beg end) - "Get the Elixir code representation of the expression on marked region." - (interactive (list (point) (mark))) - (unless (and beg end) - (error "The mark is not set now, so there is no region")) - (let ((string (buffer-substring-no-properties beg end))) - (alchemist-eval--quote-expression string))) - -(defun alchemist-eval-print-quoted-region (beg end) - "Get the Elixir code representation of the expression on marked region and insert the result." - (interactive (list (point) (mark))) - (unless (and beg end) - (error "The mark is not set now, so there is no region")) - (let ((string (buffer-substring-no-properties beg end))) - (when (> end beg) - (exchange-point-and-mark)) - (alchemist-eval--quote-expression-and-print string))) - -(defun alchemist-eval-quoted-buffer () - "Get the Elixir code representation of the expression in the current buffer." - (interactive) - (let ((string (buffer-substring-no-properties (point-min) (point-max)))) - (alchemist-eval--quote-expression string))) -(defun alchemist-eval-print-quoted-buffer () - "Get the Elixir code representation of the expression in the current buffer and insert result." - (interactive) - (let ((string (buffer-substring-no-properties (point-min) (point-max)))) - (alchemist-eval--quote-expression-and-print string))) - -(defun alchemist-eval-close-popup () - "Quit the evaluation buffer window." - (interactive) - (quit-windows-on alchemist-eval-buffer-name)) - -(define-minor-mode alchemist-eval-mode - "Minor mode for Alchemist Elixir code evaluation. - -\\{alchemist-eval-mode-map}" - nil - " Alchemist-Eval" - alchemist-eval-mode-map) - -(provide 'alchemist-eval) - -;;; alchemist-eval.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-execute.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-execute.el deleted file mode 100644 index 4cd0eda..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-execute.el +++ /dev/null @@ -1,93 +0,0 @@ -;;; alchemist-execute.el --- Elixir's script execution integration - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Elixir's script execution integration - -;;; Code: - -(require 'alchemist-utils) -(require 'alchemist-test-mode) -(require 'alchemist-report) - -(defgroup alchemist-execute nil - "Elixir's script execution integration." - :prefix "alchemist-execute-" - :group 'alchemist) - -;; Variables - -(defcustom alchemist-execute-command "elixir" - "The shell command for elixir." - :type 'string - :group 'alchemist-execute) - -(defvar alchemist-execute-buffer-name "*alchemist elixir*" - "Name of the elixir output buffer.") - -(defvar alchemist-execute-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "q" #'quit-window) - map)) - -;; Private functions - -(defun alchemist-execute--file (filename) - (when (not (file-exists-p filename)) - (error "The given file doesn't exist")) - (alchemist-execute (list alchemist-execute-command (expand-file-name filename)))) - -(defun alchemist-execute--read-command (command) - (read-shell-command "elixir command: " (concat command " "))) - -;; Public functions - -(defun alchemist-execute-this-buffer () - "Run the current buffer through elixir." - (interactive) - (alchemist-execute--file buffer-file-name)) - -(defun alchemist-execute-file (filename) - "Run elixir with the given FILENAME." - (interactive "Felixir: ") - (alchemist-execute--file (expand-file-name filename))) - -(define-derived-mode alchemist-execute-mode fundamental-mode "Elixir Execute Mode" - "Major mode for execute Elixir files. - -\\{alchemist-execute-mode-map}" - (setq buffer-read-only t) - (setq-local truncate-lines t) - (setq-local electric-indent-chars nil)) - -(defun alchemist-execute (cmdlist) - "Run a elixir with CMDLIST." - (interactive (list (alchemist-execute--read-command alchemist-execute-command))) - (let ((command (alchemist-utils-build-command cmdlist))) - (alchemist-report-run command - "alchemist-execute-report" - alchemist-execute-buffer-name - 'alchemist-execute-mode))) - -(provide 'alchemist-execute) - -;;; alchemist-execute.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-file.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-file.el deleted file mode 100644 index 5a021d5..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-file.el +++ /dev/null @@ -1,57 +0,0 @@ -;;; alchemist-file.el --- Functionality to work with directory content - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Functionality to work with directory content. - -;;; Code: - -(defgroup alchemist-file nil - "Functionality to work with directory content." - :prefix "alchemist-file-" - :group 'alchemist) - -(defun alchemist-file-find-files (root directory) - "Open DIRECTORY inside ROOT and prompt for a file." - (let* ((files (alchemist-file-read-dir root directory)) - (root-name (car (cdr (reverse (split-string root "/"))))) - (file (completing-read (format "[%s] %s: " root-name directory) files))) - (find-file (expand-file-name file root)))) - -(defun alchemist-file-read-dir (root directory) - "Return all files in DIRECTORY and use ROOT as `default-directory'." - (let ((default-directory root)) - (-map (lambda (file) (file-relative-name file root)) - (alchemist-file--files-from directory)))) - -(defun alchemist-file--files-from (directory) - (--mapcat - (if (file-directory-p it) - (unless (or (equal (file-relative-name it directory) "..") - (equal (file-relative-name it directory) ".")) - (alchemist-file--files-from it)) - (list it)) - (directory-files directory t))) - -(provide 'alchemist-file) - -;;; alchemist-file.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-goto.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-goto.el deleted file mode 100644 index 2f461b0..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-goto.el +++ /dev/null @@ -1,297 +0,0 @@ -;;; alchemist-goto.el --- Functionality to jump modules and function definitions -*- lexical-binding: t -*- - -;; Copyright © 2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Functionality to jump modules and function definitions - -;;; Code: - -(require 'cl-lib) -(require 'etags) -(require 'dash) -(require 'alchemist-utils) -(require 'alchemist-server) -(require 'alchemist-scope) - -(defgroup alchemist-goto nil - "Functionality to jump modules and function definitions." - :prefix "alchemist-goto-" - :group 'alchemist) - -;; Variables - -(defcustom alchemist-goto-erlang-source-dir "" - "Path to the erlang source code." - :type 'string - :group 'alchemist-goto) - -(defcustom alchemist-goto-elixir-source-dir "" - "Path to the elixir source code." - :type 'string - :group 'alchemist-goto) - -(defvar alchemist-goto--symbol-list '()) -(defvar alchemist-goto--symbol-name-and-pos '()) -(defvar alchemist-goto--symbol-list-bare '()) -(defvar alchemist-goto--symbol-name-and-pos-bare '()) -(defvar alchemist-goto-filter-output nil) -(defvar alchemist-goto-callback nil) - -(defconst alchemist-goto--symbol-def-extract-regex - "^\\s-*\\(defp?\\|defmacrop?\\|defmodule\\|defimpl\\)[ \n\t]+\\([a-z_\?!]+\\)\\(.*\\)\\(do\\|\n\\)?$") - -(defconst alchemist-goto--symbol-def-regex - "^[[:space:]]*\\(defmodule\\|defmacrop?\\|defimpl\\|defp?\\)") - -;; Faces - -(defface alchemist-goto--def-face - '((t (:inherit font-lock-constant-face))) - "Face for def* symbols." - :group 'alchemist-goto) - -(defface alchemist-goto--name-face - '((t (:bold t))) - "Face for def* symbol names." - :group 'alchemist-goto) - -;; Private functions - -(defun alchemist-goto--build-elixir-ex-core-file (file) - (when (string-match "\\/\\(lib\\/.+\\/lib\\)\\/.+\.ex$" file) - (let* ((file (substring-no-properties file (match-beginning 1))) - (source-directory (alchemist-utils-add-trailing-slash - (expand-file-name alchemist-goto-elixir-source-dir)))) - (concat source-directory file)))) - -(defun alchemist-goto--build-elixir-erl-core-file (file) - (when (string-match "\\/\\(lib\\/.+\\/src\\)\\/.+\.erl$" file) - (let* ((file (substring-no-properties file (match-beginning 1))) - (source-directory (alchemist-utils-add-trailing-slash - (expand-file-name alchemist-goto-elixir-source-dir)))) - (concat source-directory file)))) - -(defun alchemist-goto--build-erlang-core-file (file) - (when (string-match "\\/\\(lib\\/.+\\/src\\)\\/.+\.erl$" file) - (let* ((file (substring-no-properties file (match-beginning 1))) - (source-directory (alchemist-utils-add-trailing-slash - (expand-file-name alchemist-goto-erlang-source-dir)))) - (concat source-directory file)))) - -(defun alchemist-goto-elixir-file-p (file) - "Return non-nil if FILE is an Elixir file type." - (string-match-p "\\.ex\\(s\\)?$" file)) - -(defun alchemist-goto-erlang-file-p (file) - "Return non-nil if FILE is an Erlang file type." - (string-match-p "\\.erl$" file)) - -(defun alchemist-goto--symbol-definition-p (symbol) - (alchemist-goto--fetch-symbol-definitions) - (if (member symbol alchemist-goto--symbol-list-bare) - t - nil)) - -(defun alchemist-goto--fetch-symbols-from-propertize-list (symbol) - (-remove 'null (-map (lambda (e) - (when (string-match-p (format "^\\s-*\\(defp?\\|defmacrop?\\|defimpl\\|defmodule\\)\s+%s\\((.*\\)?$" symbol) e) - e)) alchemist-goto--symbol-list))) - -(defun alchemist-goto--goto-symbol (symbol) - (let ((amount (length (-remove 'null (-map (lambda (e) (when (string= symbol e) e)) - alchemist-goto--symbol-list-bare))))) - (if (> amount 1) - (let* ((selected-def (completing-read "Symbol definitions:" - (alchemist-goto--fetch-symbols-from-propertize-list symbol))) - (position (cdr (assoc selected-def alchemist-goto--symbol-name-and-pos)))) - (goto-char (if (overlayp position) (overlay-start position) position))) - (let* ((position (cdr (assoc symbol alchemist-goto--symbol-name-and-pos-bare))) - (position (if (overlayp position) (overlay-start position) position))) - (when (not (equal (line-number-at-pos) - (line-number-at-pos position))) - (goto-char position)))))) - -(defun alchemist-goto-list-symbol-definitions () - "List all symbol definitions in the current file like functions/macros/modules. - -It will jump to the position of the symbol definition after selection." - (interactive) - (alchemist-goto--fetch-symbol-definitions) - (ring-insert find-tag-marker-ring (point-marker)) - (let* ((selected-def (completing-read "Symbol definitions:" alchemist-goto--symbol-list)) - (position (cdr (assoc selected-def alchemist-goto--symbol-name-and-pos)))) - (goto-char (if (overlayp position) (overlay-start position) position)))) - -(defun alchemist-goto--fetch-symbol-definitions () - (alchemist-goto--search-for-symbols "^\\s-*\\(defp?\\|defmacrop?\\|defimpl\\|defstruct\\|defmodule\\)\s.*")) - -(defun alchemist-goto--extract-symbol (str) - (save-match-data - (when (string-match alchemist-goto--symbol-def-extract-regex str) - (let ((type (substring str (match-beginning 1) (match-end 1))) - (name (substring str (match-beginning 2) (match-end 2))) - (arguments (substring str (match-beginning 3) (match-end 3)))) - (concat - (propertize type - 'face 'alchemist-goto--def-face) - " " - (propertize name - 'face 'alchemist-goto--name-face) - (replace-regexp-in-string ",?\s+do:.*$" "" (replace-regexp-in-string "\s+do$" "" arguments))))))) - -(defun alchemist-goto--file-contains-defs-p () - (alchemist-utils-occur-in-buffer-p (current-buffer) alchemist-goto--symbol-def-extract-regex)) - -(defun alchemist-goto-jump-to-next-def-symbol () - (interactive) - (alchemist-utils-jump-to-next-matching-line alchemist-goto--symbol-def-regex 'back-to-indentation)) - -(defun alchemist-goto-jump-to-previous-def-symbol () - (interactive) - (alchemist-utils-jump-to-previous-matching-line alchemist-goto--symbol-def-regex 'back-to-indentation)) - -(defun alchemist-goto--extract-symbol-bare (str) - (save-match-data - (when (string-match alchemist-goto--symbol-def-extract-regex str) - (let ((name (substring str (match-beginning 2) (match-end 2)))) - name)))) - -(defun alchemist-goto--get-symbol-from-position (position) - (goto-char position) - (end-of-line) - (let* ((end-position (point)) - (line (buffer-substring-no-properties position end-position))) - (alchemist-goto--extract-symbol line))) - -(defun alchemist-goto--get-symbol-from-position-bare (position) - (with-current-buffer (buffer-name) - (save-excursion - (goto-char position) - (end-of-line) - (let* ((end-position (point)) - (line (buffer-substring-no-properties position end-position))) - (alchemist-goto--extract-symbol-bare line))))) - -(defun alchemist-goto--search-for-symbols (regex) - (setq alchemist-goto--symbol-list '()) - (setq alchemist-goto--symbol-name-and-pos '()) - (setq alchemist-goto--symbol-list-bare '()) - (setq alchemist-goto--symbol-name-and-pos-bare '()) - (with-current-buffer (buffer-name) - (save-excursion - (goto-char (point-min)) - (save-match-data - (while (re-search-forward regex nil t) - (when (not (alchemist-scope-inside-string-p)) - (when (alchemist-goto--get-symbol-from-position (car (match-data))) - (let* ((position (car (match-data))) - (symbol (alchemist-goto--get-symbol-from-position position)) - (symbol-bare (alchemist-goto--get-symbol-from-position-bare position))) - (setq alchemist-goto--symbol-list (append alchemist-goto--symbol-list (list symbol))) - (setq alchemist-goto--symbol-name-and-pos (append alchemist-goto--symbol-name-and-pos (list (cons symbol position)))) - (setq alchemist-goto--symbol-list-bare (append alchemist-goto--symbol-list-bare (list symbol-bare))) - (setq alchemist-goto--symbol-name-and-pos-bare (append alchemist-goto--symbol-name-and-pos-bare (list (cons symbol-bare position)))))))))))) - -(defun alchemist-goto--open-definition (expr) - (let* ((module (alchemist-scope-extract-module expr)) - (aliases (alchemist-utils-prepare-aliases-for-elixir - (alchemist-scope-aliases))) - (function (alchemist-scope-extract-function expr)) - (modules (alchemist-utils-prepare-modules-for-elixir - (alchemist-scope-all-modules)))) - (ring-insert find-tag-marker-ring (point-marker)) - (cond - ((and (null module) - (alchemist-goto--symbol-definition-p function) - (not (string= (buffer-name) alchemist-help-buffer-name))) - (alchemist-goto--goto-symbol function)) - (t - (setq alchemist-goto-callback (lambda (file) - (cond ((alchemist-utils-empty-string-p file) - (message "Don't know how to find: %s" expr)) - ((file-exists-p file) - (alchemist-goto--open-file file module function)) - ((alchemist-goto-elixir-file-p file) - (let* ((elixir-source-file (alchemist-goto--build-elixir-ex-core-file file))) - (if (file-exists-p elixir-source-file) - (alchemist-goto--open-file elixir-source-file module function) - (message "Don't know how to find: %s" expr)))) - ((alchemist-goto-erlang-file-p file) - (let* ((elixir-source-file (alchemist-goto--build-elixir-erl-core-file file)) - (erlang-source-file (alchemist-goto--build-erlang-core-file file))) - (cond ((file-exists-p elixir-source-file) - (alchemist-goto--open-file elixir-source-file module function)) - ((file-exists-p erlang-source-file) - (alchemist-goto--open-file erlang-source-file module function)) - (t - (message "Don't know how to find: %s" expr))))) - (t - (pop-tag-mark) - (message "Don't know how to find: %s" expr))))) - (alchemist-server-goto (format "{ \"%s,%s\", [ context: Elixir, imports: %s, aliases: %s ] }" module function modules aliases) - #'alchemist-goto-filter))))) - -(defun alchemist-goto--open-file (file module function) - (let ((buf (find-file-noselect file))) - (switch-to-buffer buf) - (goto-char (point-min)) - (cond ((alchemist-goto-elixir-file-p file) - (alchemist-goto--jump-to-elixir-source module function)) - ((alchemist-goto-erlang-file-p file) - (alchemist-goto--jump-to-erlang-source module function))))) - -(defun alchemist-goto--jump-to-elixir-source (module function) - (cond - (function - (alchemist-goto--fetch-symbol-definitions) - (alchemist-goto--goto-symbol function)) - (t - (when (re-search-forward (format "\\(defmodule\\|defimpl\\|defprotocol\\)\s+%s\s+do" module) nil t) - (goto-char (match-beginning 0)))))) - -(defun alchemist-goto--jump-to-erlang-source (module function) - (when (re-search-forward (format "\\(^%s\(\\)" function) nil t) - (goto-char (match-beginning 0))) - (when (re-search-forward (format "\\(^-module\(%s\)\\)" (substring module 1)) nil t) - (goto-char (match-beginning 0)))) - -(defun alchemist-goto-filter (_process output) - (with-local-quit - (setq alchemist-goto-filter-output (cons output alchemist-goto-filter-output)) - (if (alchemist-server-contains-end-marker-p output) - (let* ((output (alchemist-server-prepare-filter-output alchemist-goto-filter-output)) - (file output)) - (setq alchemist-goto-filter-output nil) - (funcall alchemist-goto-callback file))))) - -;; Public functions - -(defun alchemist-goto-definition-at-point () - "Jump to the elixir expression definition at point." - (interactive) - (alchemist-goto--open-definition (alchemist-scope-expression))) - -(defalias 'alchemist-goto-jump-back 'pop-tag-mark) - -(provide 'alchemist-goto) - -;;; alchemist-goto.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-help.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-help.el deleted file mode 100644 index c96be2f..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-help.el +++ /dev/null @@ -1,266 +0,0 @@ -;;; alchemist-help.el --- Functionality for Elixir documentation lookup -*- lexical-binding: t -*- - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Functionality for Elixir documentation lookup. - -;;; Code: - -(require 'dash) -(require 'ansi-color) -(require 'alchemist-utils) -(require 'alchemist-project) -(require 'alchemist-server) -(require 'alchemist-scope) -(require 'alchemist-goto) - -(defgroup alchemist-help nil - "Functionality for Elixir documentation lookup." - :prefix "alchemist-help-" - :group 'alchemist) - -(defcustom alchemist-help-buffer-name "*alchemist help*" - "Name of the Elixir help buffer." - :type 'string - :group 'alchemist-help) - -(defvar alchemist-help-search-history '() - "Storage for the search history.") - -(defvar alchemist-help-current-search-text '() - "Stores the current search.") - -(defvar alchemist-help-filter-output nil) - -(defface alchemist-help-key-face - '((t (:inherit font-lock-variable-name-face :bold t :foreground "red"))) - "Face for the letter keys in the summary." - :group 'alchemist-help) - -(defun alchemist-help-lookup-doc (search) - "Lookup Elixir documentation for SEARCH." - (setq alchemist-help-current-search-text search) - (setq alchemist-help-filter-output nil) - (if (not (alchemist-utils-empty-string-p search)) - (alchemist-server-complete-candidates - (alchemist-help--completion-server-arguments search) - #'alchemist-help-complete-filter-output) - (message "No documentation for [%s] found." search))) - -(defun alchemist-help-no-doc-available-p (string) - "Return non-nil if STRING contains Elixir no documentation message." - (or (string-match-p "No documentation for" string) - (string-match-p "Could not load module" string) - (string-match-p "it does not have Elixir-style docs" string) - (alchemist-utils-empty-string-p string))) - -(defun alchemist-help-store-search-in-history () - "Store the last `alchemist-help-current-search-text' in `alchemist-help-search-history'." - (unless (memq 'alchemist-help-current-search-text alchemist-help-search-history) - (add-to-list 'alchemist-help-search-history alchemist-help-current-search-text))) - -(defun alchemist-help-display-doc (content) - "Initialize the `alchemist-help-buffer-name' and insert CONTENT." - (let ((default-directory (alchemist-project-root-or-default-dir)) - (buffer (get-buffer-create alchemist-help-buffer-name))) - (cond - ((alchemist-help-no-doc-available-p content) - (message (format "No documentation for [%s] found." - alchemist-help-current-search-text))) - (t - (alchemist-help-store-search-in-history) - (with-current-buffer buffer - (let ((inhibit-read-only t)) - (goto-char (point-min)) - (erase-buffer) - (insert content) - (goto-char (point-min)) - (ansi-color-apply-on-region (point-min) (point-max)) - (alchemist-help-minor-mode))) - (pop-to-buffer buffer))))) - -(defun alchemist-help--search-at-point () - "Search through `alchemist-help' with the expression under the cursor" - (let* ((expr (alchemist-scope-expression))) - (alchemist-help-lookup-doc (alchemist-help--prepare-search-expr expr)))) - -(defun alchemist-help--search-marked-region (begin end) - "Run `alchemist-help' with the marked region. -Argument BEGIN where the mark starts. -Argument END where the mark ends." - (let ((expr (buffer-substring-no-properties begin end))) - (alchemist-help-lookup-doc (alchemist-help--prepare-search-expr expr)))) - -(defun alchemist-help--prepare-search-expr (expr) - (let* ((module (alchemist-scope-extract-module expr)) - (module (alchemist-scope-alias-full-path module)) - (module (if module module "")) - (function (alchemist-scope-extract-function expr)) - (function (if function function "")) - (expr (cond - ((and (not (alchemist-utils-empty-string-p module)) - (not (alchemist-utils-empty-string-p function))) - (format "%s.%s" module function)) - ((not (alchemist-utils-empty-string-p module)) - module) - (t - expr)))) - expr)) - -(defun alchemist-help--elixir-modules-to-list (str) - (let* ((str (replace-regexp-in-string "^Elixir\\." "" str)) - (modules (split-string str)) - (modules (delete nil modules)) - (modules (cl-sort modules 'string-lessp :key 'downcase)) - (modules (-distinct modules))) - modules)) - -(defun alchemist-help-minor-mode-key-binding-summary () - (interactive) - (message - (concat "[" (propertize "q" 'face 'alchemist-help-key-face) - "]-quit [" - (propertize "e" 'face 'alchemist-help-key-face) - "]-search-at-point [" - (propertize "s" 'face 'alchemist-help-key-face) - "]-search [" - (propertize "h" 'face 'alchemist-help-key-face) - "]-history [" - (propertize "?" 'face 'alchemist-help-key-face) - "]-keys"))) - -(defun alchemist-help--server-arguments (args) - (if (and (not (equal major-mode 'alchemist-iex-mode)) - (not (bound-and-true-p alchemist-help-minor-mode))) - (let* ((modules (alchemist-utils-prepare-modules-for-elixir - (alchemist-scope-all-modules)))) - (format "{ \"%s\", [ context: Elixir, imports: %s, aliases: [] ] }" args modules)) - (format "{ \"%s\", [ context: Elixir, imports: [], aliases: [] ] }" args))) - -(defun alchemist-help--completion-server-arguments (args) - "Build informations about the current context." - (if (and (not (equal major-mode 'alchemist-iex-mode)) - (not (bound-and-true-p alchemist-help-minor-mode))) - (let* ((modules (alchemist-utils-prepare-modules-for-elixir - (alchemist-scope-all-modules))) - (aliases (alchemist-utils-prepare-aliases-for-elixir - (alchemist-scope-aliases)))) - (format "{ \"%s\", [ context: Elixir, imports: %s, aliases: %s ] }" args modules aliases)) - (format "{ \"%s\", [ context: Elixir, imports: [], aliases: [] ] }" args))) - -(defun alchemist-help-complete-filter-output (_process output) - (with-local-quit - (setq alchemist-help-filter-output (cons output alchemist-help-filter-output)) - (if (alchemist-server-contains-end-marker-p output) - (let* ((string (alchemist-server-prepare-filter-output alchemist-help-filter-output)) - (candidates (alchemist-complete--output-to-list - (ansi-color-filter-apply string))) - (candidates (if (= (length candidates) 2) - nil - candidates))) - (setq alchemist-help-filter-output nil) - (if candidates - (let* ((search (alchemist-complete--completing-prompt alchemist-help-current-search-text candidates))) - (setq alchemist-help-current-search-text search) - (alchemist-server-help (alchemist-help--server-arguments search) #'alchemist-help-filter-output)) - (alchemist-server-help (alchemist-help--server-arguments alchemist-help-current-search-text) #'alchemist-help-filter-output)))))) - -(defun alchemist-help-filter-output (_process output) - (setq alchemist-help-filter-output (cons output alchemist-help-filter-output)) - (if (alchemist-server-contains-end-marker-p output) - (let ((string (alchemist-server-prepare-filter-output alchemist-help-filter-output))) - (alchemist-help-display-doc string) - (setq alchemist-help-current-search-text nil) - (setq alchemist-help-filter-output nil)))) - -(defun alchemist-help-modules-filter (_process output) - (with-local-quit - (setq alchemist-help-filter-output (cons output alchemist-help-filter-output)) - (if (alchemist-server-contains-end-marker-p output) - (let* ((output (alchemist-server-prepare-filter-output alchemist-help-filter-output)) - (modules (alchemist-help--elixir-modules-to-list output)) - (search (completing-read - "Elixir help: " - modules - nil - nil - nil)) - (module (alchemist-scope-extract-module search)) - (function (alchemist-scope-extract-function search)) - (search (cond - ((and module function) - search) - ((and module - (not (string-match-p "[\/0-9]+$" module))) - (concat module ".")) - (t - search)))) - (alchemist-help-lookup-doc (alchemist-utils-remove-dot-at-the-end search)))))) - -;; Public functions - -(defun alchemist-help-search-at-point () - "Search through `alchemist-help' with the expression under the cursor. - -If the buffer local variable `mark-active' is non-nil, -the actively marked region will be used for passing to `alchemist-help'." - (interactive) - (if mark-active - (alchemist-help--search-marked-region (region-beginning) (region-end)) - (alchemist-help--search-at-point))) - -(defvar alchemist-help-minor-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "q") #'quit-window) - (define-key map (kbd "e") #'alchemist-help-search-at-point) - (define-key map (kbd "s") #'alchemist-help) - (define-key map (kbd "h") #'alchemist-help-history) - (define-key map (kbd "M-.") #'alchemist-goto-definition-at-point) - (define-key map (kbd "?") #'alchemist-help-minor-mode-key-binding-summary) - map) - "Keymap for `alchemist-help-minor-mode'.") - -(define-minor-mode alchemist-help-minor-mode - "Minor mode for displaying elixir help." - :group 'alchemist-help - :keymap alchemist-help-minor-mode-map - (cond (alchemist-help-minor-mode - (setq buffer-read-only t)) - (t - (setq buffer-read-only nil)))) - -(defun alchemist-help () - "Load Elixir documentation for SEARCH." - (interactive) - (setq alchemist-help-filter-output nil) - (alchemist-server-info "{ :type, :modules }" #'alchemist-help-modules-filter)) - -(defun alchemist-help-history (search) - "Load Elixir from the documentation history for SEARCH." - (interactive - (list - (completing-read "Elixir help history: " alchemist-help-search-history nil nil ""))) - (alchemist-help-lookup-doc search)) - -(provide 'alchemist-help) - -;;; alchemist-help.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-hooks.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-hooks.el deleted file mode 100644 index 5418054..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-hooks.el +++ /dev/null @@ -1,60 +0,0 @@ -;;; alchemist-hooks.el --- Hooks functionality - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini - -;; This file is not part of GNU Emacs. - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Hooks functionality - -;;; Code: - -(require 'alchemist-project) -(require 'alchemist-mix) -(require 'alchemist-report) -(require 'alchemist-test-mode) - -(defgroup alchemist-hooks nil - "Hooks" - :prefix "alchemist-hooks-" - :group 'alchemist) - -(defcustom alchemist-hooks-test-on-save nil - "If t, run `alchemist-mix-test' on save." - :type 'boolean - :group 'alchemist-hooks) - -(defun alchemist-hooks-test-on-save () - (when (and alchemist-hooks-test-on-save - (alchemist-project-p)) - (alchemist-report-run "mix test" - alchemist-test-report-process-name - alchemist-test-report-buffer-name - #'alchemist-test-report-mode - #'alchemist-test--handle-exit - t))) - -(eval-after-load 'elixir-mode - '(progn - (add-hook 'after-save-hook 'alchemist-hooks-test-on-save nil nil))) - -(provide 'alchemist-hooks) - -;;; alchemist-hooks.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-iex.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-iex.el deleted file mode 100644 index e5dc498..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-iex.el +++ /dev/null @@ -1,229 +0,0 @@ -;;; alchemist-help.el --- Interaction with an Elixir IEx process - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Interaction with an Elixir IEx process - -;;; Code: - -(require 'comint) -(require 'company) -(require 'alchemist-key) -(require 'alchemist-scope) -(require 'alchemist-project) - -(defgroup alchemist-iex nil - "Interaction with an Elixir IEx process." - :prefix "alchemist-iex-" - :group 'alchemist) - -(defcustom alchemist-iex-program-name "iex" - "The shell command for iex." - :type 'string - :group 'alchemist-iex) - -(defcustom alchemist-iex-prompt-read-only t - "If non-nil, the prompt will be read-only." - :type 'boolean - :group 'alchemist-iex) - -(defvar alchemist-iex-buffer nil - "The buffer in which the Elixir IEx process is running.") - -(defvar alchemist-iex-mode-hook nil - "Hook for customizing `alchemist-iex-mode'.") - -(defvar alchemist-iex-mode-map - (let ((map (nconc (make-sparse-keymap) comint-mode-map))) - (define-key map "\t" 'completion-at-point) - (define-key map (kbd (format "%s i r" alchemist-key-command-prefix)) 'alchemist-iex-open-input-ring) - (define-key map (kbd (format "%s i c" alchemist-key-command-prefix)) 'alchemist-iex-clear-buffer) - (define-key map (kbd (format "%s h e" alchemist-key-command-prefix)) 'alchemist-help-search-at-point) - (define-key map (kbd "M-.") 'alchemist-goto-definition-at-point) - map)) - -(eval-after-load 'company - '(progn - (defun alchemist-iex--set-company-as-completion-at-point-function () - (setq completion-at-point-functions '(company-complete))) - (add-hook 'alchemist-iex-mode-hook 'alchemist-iex--set-company-as-completion-at-point-function))) - -(define-derived-mode alchemist-iex-mode comint-mode "Alchemist-IEx" - "Major mode for interacting with an Elixir IEx process. - -\\" - nil "Alchemist-IEx" - (set (make-local-variable 'comint-prompt-regexp) "^\\(iex\\|\.\.\.\\)\(.+\)>") - (set (make-local-variable 'comint-prompt-read-only) alchemist-iex-prompt-read-only) - (set (make-local-variable 'comint-input-autoexpand) nil) - (set (make-local-variable 'comint-input-sender) 'alchemist-iex--send-command) - (add-hook 'comint-output-filter-functions 'alchemist-iex-spot-prompt nil t)) - -(defun alchemist-iex-command (arg) - (split-string-and-unquote - (if (null arg) alchemist-iex-program-name - (read-string "Command to run Elixir IEx: " (concat alchemist-iex-program-name arg))))) - -(defun alchemist-iex-start-process (command) - "Start an IEX process. -With universal prefix \\[universal-argument], prompts for a COMMAND, -otherwise uses `alchemist-iex-program-name'. -It runs the hook `alchemist-iex-mode-hook' after starting the process and -setting up the IEx buffer." - (interactive (list (alchemist-iex-command current-prefix-arg))) - (setq alchemist-iex-buffer - (apply 'make-comint "Alchemist-IEx" (car command) nil (cdr command))) - (with-current-buffer alchemist-iex-buffer - (alchemist-iex-mode) - (run-hooks 'alchemist-iex-mode-hook))) - -(defun alchemist-iex-process (&optional arg) - (or (if (buffer-live-p alchemist-iex-buffer) - (get-buffer-process alchemist-iex-buffer)) - (progn - (let ((current-prefix-arg arg)) - (call-interactively 'alchemist-iex-start-process)) - (alchemist-iex-process arg)))) - -(defun alchemist-iex--remove-newlines (string) - (replace-regexp-in-string "\n" " " string)) - -(defun alchemist-iex-send-last-sexp () - "Send the previous sexp to the inferior IEx process." - (interactive) - (alchemist-iex-send-region (save-excursion (backward-sexp) (point)) (point))) - -(defun alchemist-iex-send-current-line () - "Sends the current line to the IEx process." - (interactive) - (let ((str (thing-at-point 'line))) - (alchemist-iex--send-command (alchemist-iex-process) str))) - -(defun alchemist-iex-send-current-line-and-go () - "Sends the current line to the inferior IEx process -and jump to the buffer." - (interactive) - (call-interactively 'alchemist-iex-send-current-line) - (pop-to-buffer (process-buffer (alchemist-iex-process)))) - -(defun alchemist-iex-send-region-and-go () - "Sends the marked region to the inferior IEx process -and jump to the buffer." - (interactive) - (call-interactively 'alchemist-iex-send-region) - (pop-to-buffer (process-buffer (alchemist-iex-process)))) - -(defun alchemist-iex-send-region (beg end) - "Sends the marked region to the IEx process." - (interactive (list (point) (mark))) - (unless (and beg end) - (error "The mark is not set now, so there is no region")) - (let* ((region (buffer-substring-no-properties beg end))) - (alchemist-iex--send-command (alchemist-iex-process) region))) - -(defun alchemist-iex-compile-this-buffer () - "Compiles the current buffer in the IEx process." - (interactive) - (let ((str (format "c(\"%s\")" (buffer-file-name)))) - (alchemist-iex--send-command (alchemist-iex-process) str))) - -(defun alchemist-iex-reload-module () - "Recompiles and reloads the current module in the IEx process." - (interactive) - (let ((str (format "r(%s)" (alchemist-scope-module)))) - (alchemist-iex--send-command (alchemist-iex-process) str))) - -(defun alchemist-iex--send-command (proc str) - (let ((lines (split-string str "\n" nil))) - (with-current-buffer (process-buffer proc) - (-map (lambda (line) - (alchemist-iex-wait-for-prompt proc) - (goto-char (process-mark proc)) - (insert-before-markers (concat line "\n")) - (move-marker comint-last-input-end (point)) - (comint-send-string proc (concat line "\n"))) lines)))) - -(defvar alchemist-iex-seen-prompt nil) -(make-variable-buffer-local 'alchemist-iex-seen-prompt) - -(defun alchemist-iex-spot-prompt (_string) - (let ((proc (get-buffer-process (current-buffer)))) - (when proc - (save-excursion - (goto-char (process-mark proc)) - (if (re-search-backward comint-prompt-regexp - (line-beginning-position) t) - (setq alchemist-iex-seen-prompt t)))))) - -(defun alchemist-iex-wait-for-prompt (proc &optional timeout) - "Wait until PROC sends us a prompt. -The process PROC should be associated to a comint buffer." - (with-current-buffer (process-buffer proc) - (while (progn - (goto-char comint-last-input-end) - (not (or alchemist-iex-seen-prompt - (setq alchemist-iex-seen-prompt - (re-search-forward comint-prompt-regexp nil t)) - (not (accept-process-output proc timeout)))))) - (unless alchemist-iex-seen-prompt - (error "Can't find the IEx prompt")) - (setq alchemist-iex-seen-prompt nil))) - -(defun alchemist-iex-clear-buffer () - "Clear the current iex process buffer." - (interactive) - (let ((comint-buffer-maximum-size 0)) - (comint-truncate-buffer))) - -(defun alchemist-iex-open-input-ring () - "Open the buffer containing the input history." - (interactive) - (progn - (comint-dynamic-list-input-ring) - (other-window 1))) - -;;;###autoload -(defalias 'run-elixir 'alchemist-iex-run) -(defalias 'inferior-elixir 'alchemist-iex-run) - -;;;###autoload -(defun alchemist-iex-run (&optional arg) - "Start an IEx process. -Show the IEx buffer if an IEx process is already run." - (interactive "P") - (let ((proc (alchemist-iex-process arg))) - (pop-to-buffer (process-buffer proc)))) - -;;;###autoload -(defun alchemist-iex-project-run () - "Start an IEx process with mix 'iex -S mix' in the -context of an Elixir project. -Show the IEx buffer if an IEx process is already run." - (interactive) - (if (alchemist-project-p) - (let ((default-directory (alchemist-project-root))) - (pop-to-buffer (process-buffer (alchemist-iex-process " -S mix")))) - (message "No mix.exs file available. Please use `alchemist-iex-run' instead."))) - -(provide 'alchemist-iex) - -;;; alchemist-iex.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-info.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-info.el deleted file mode 100644 index 8fdf79b..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-info.el +++ /dev/null @@ -1,95 +0,0 @@ -;;; alchemist-info.el --- Getting informations from the server. -*- lexical-binding: t -*- - -;; Copyright © 2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Getting informations from the server. - -;;; Code: - -(require 'ansi-color) - -(defgroup alchemist-info nil - "Getting informations from the server." - :prefix "alchemist-info-" - :group 'alchemist) - -(defconst alchemist-info-buffer-name "*alchemist-info-mode*" - "Name of the Elixir info buffer.") - -(defvar alchemist-info-filter-output nil) - -(defvar alchemist-info-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "q") #'quit-window) - map) - "Keymap for `alchemist-info-mode'.") - -(defun alchemist-info-datatype-filter (_process output) - (setq alchemist-info-filter-output (cons output alchemist-info-filter-output)) - (when (alchemist-server-contains-end-marker-p output) - (alchemist-interact-create-popup alchemist-info-buffer-name - (alchemist-server-prepare-filter-output alchemist-info-filter-output) - #'(lambda () - (alchemist-info-mode) - (ansi-color-apply-on-region (point-min) (point-max)))) - (setq alchemist-info-filter-output nil))) - -(defun alchemist-info-expression-at-point () - "Return the expression under the cursor." - (let (p1 p2) - (save-excursion - (skip-chars-backward "-_A-Za-z0-9.?!:@\'\"") - (setq p1 (point)) - (skip-chars-forward "-_A-Za-z0-9.?!:@\'\"") - (setq p2 (point)) - (buffer-substring-no-properties p1 p2)))) - -(defun alchemist-info-datatype-at-point () - "Return information about any datatype under the cursor." - (interactive) - (let ((expr (if mark-active - (buffer-substring-no-properties (region-beginning) (region-end)) - (alchemist-info-expression-at-point)))) - (alchemist-server-info (format "{ :type, :info, '%s' }" expr) #'alchemist-info-datatype-filter))) - -(defun alchemist-info-types-at-point () - "Return information of types under the cursor." - (interactive) - (let ((expr (alchemist-info-expression-at-point))) - (alchemist-server-info (format "{ :type, :types, '%s' }" expr) #'alchemist-info-datatype-filter))) - -(defun alchemist-info-close-popup () - "Quit the information buffer window." - (interactive) - (quit-windows-on alchemist-info-buffer-name)) - -(define-minor-mode alchemist-info-mode - "Minor mode for Alchemist server information. - -\\{alchemist-info-mode-map}" - nil - " Alchemist-Info" - alchemist-info-mode-map) - -(provide 'alchemist-info) - -;;; alchemist-info.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-interact.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-interact.el deleted file mode 100644 index 2188dd5..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-interact.el +++ /dev/null @@ -1,64 +0,0 @@ -;;; alchemist-interact.el --- Interaction interface -*- lexical-binding: t -*- - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Interaction interface. - -;;; Code: - -(defgroup alchemist-interact nil - "Interaction interface." - :prefix "alchemist-interact-" - :group 'alchemist) - -(defun alchemist-interact-insert-as-comment (string) - "Insert STRING at point as comment." - (let ((lines (split-string string "\n"))) - (if (> (length lines) 1) - (save-excursion - (end-of-line) - (mapc (lambda (s) - (newline) - (insert (format "# => %s" s)) - (indent-according-to-mode)) - lines)) - (save-excursion - (end-of-line) - (insert (format " # => %s" string)))))) - -(defun alchemist-interact-create-popup (name content mode) - "Create a NAME buffer and insert CONTENT. -Call the MODE afterwards." - (let ((buffer (get-buffer-create name))) - (with-current-buffer buffer - (with-current-buffer-window - buffer (cons 'display-buffer-below-selected - '((window-height . fit-window-to-buffer))) - (lambda (_window _buffer)) - (let ((inhibit-read-only t)) - (insert content) - (goto-char (point-min)) - (funcall mode)))))) - -(provide 'alchemist-interact) - -;;; alchemist-interact.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-key.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-key.el deleted file mode 100644 index 2a58f9a..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-key.el +++ /dev/null @@ -1,40 +0,0 @@ -;;; alchemist-key.el --- Key prefix setup for Alchemist related key commands - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Key prefix setup for Alchemist related key commands. - -;;; Code: - -(defgroup alchemist-key nil - "Key prefix setup for Alchemist related key commands." - :prefix "alchemist-key-" - :group 'alchemist) - -(defcustom alchemist-key-command-prefix (kbd "C-c a") - "The prefix for Alchemist related key commands." - :type 'string - :group 'alchemist) - -(provide 'alchemist-key) - -;;; alchemist-key.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-macroexpand.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-macroexpand.el deleted file mode 100644 index 7513372..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-macroexpand.el +++ /dev/null @@ -1,156 +0,0 @@ -;;; alchemist-macroexpand.el --- Macro expansion support -*- lexical-binding: t -*- - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Macro expansion support - -;;; Code: - -(require 'alchemist-server) -(require 'alchemist-interact) - -(defgroup alchemist-macroexpand nil - "Macro expansion support." - :prefix "alchemist-macroexpand-" - :group 'alchemist) - -(defvar alchemist-macroexpand-filter-output nil) - -(defconst alchemist-macroexpand-buffer-name "*alchemist macroexpand*" - "Name of the Elixir Macro expand buffer.") - -(defun alchemist-macroexpand-filter (_process output) - (setq alchemist-macroexpand-filter-output (cons output alchemist-macroexpand-filter-output)) - (when (alchemist-server-contains-end-marker-p output) - (alchemist-interact-create-popup alchemist-macroexpand-buffer-name - (alchemist-server-prepare-filter-output alchemist-macroexpand-filter-output) - #'(lambda () - (elixir-mode) - (alchemist-macroexpand-mode))) - (setq alchemist-macroexpand-filter-output nil))) - -(defun alchemist-macroexpand-insert-filter (_process output) - (setq alchemist-macroexpand-filter-output (cons output alchemist-macroexpand-filter-output)) - (when (alchemist-server-contains-end-marker-p output) - (alchemist-interact-insert-as-comment - (alchemist-server-prepare-filter-output alchemist-macroexpand-filter-output)) - (setq alchemist-macroexpand-filter-output nil))) - -(defun alchemist-macroexpand-expand-request (expr) - (let ((file (make-temp-file "alchemist-expand" nil ".exs"))) - (with-temp-file file - (insert expr)) - (alchemist-server-eval (format "{ :expand, '%s' }" file) #'alchemist-macroexpand-filter))) - -(defun alchemist-macroexpand-expand-and-print-request (expr) - (let ((file (make-temp-file "alchemist-expand" nil ".exs"))) - (with-temp-file file - (insert expr)) - (alchemist-server-eval (format "{ :expand, '%s' }" file) #'alchemist-macroexpand-insert-filter))) - -(defun alchemist-macroexpand-expand-once-request (expr) - (let ((file (make-temp-file "alchemist-expand-once" nil ".exs"))) - (with-temp-file file - (insert expr)) - (alchemist-server-eval (format "{ :expand_once, '%s' }" file) #'alchemist-macroexpand-filter))) - -(defun alchemist-macroexpand-expand-once-and-print-request (expr) - (let ((file (make-temp-file "alchemist-expand-once" nil ".exs"))) - (with-temp-file file - (insert expr)) - (alchemist-server-eval (format "{ :expand_once, '%s' }" file) #'alchemist-macroexpand-insert-filter))) - -(defun alchemist-macroexpand-current-line () - "Macro expand the Elixir code on the current line." - (interactive) - (alchemist-macroexpand-expand-request (thing-at-point 'line))) - -(defun alchemist-macroexpand-print-current-line () - "Macro expand the Elixir code on the current line and insert the result." - (interactive) - (alchemist-macroexpand-expand-and-print-request (thing-at-point 'line))) - -(defun alchemist-macroexpand-once-current-line () - "Macro expand the Elixir code on the current line." - (interactive) - (alchemist-macroexpand-expand-once-request (thing-at-point 'line))) - -(defun alchemist-macroexpand-once-print-current-line () - "Macro expand the Elixir code on the current line and insert the result." - (interactive) - (alchemist-macroexpand-expand-once-and-print-request (thing-at-point 'line))) - -(defun alchemist-macroexpand-print-region (beg end) - "Macro expand the Elixir code on marked region and insert the result." - (interactive (list (point) (mark))) - (unless (and beg end) - (error "The mark is not set now, so there is no region")) - (let ((string (buffer-substring-no-properties beg end))) - (when (> end beg) - (exchange-point-and-mark)) - (alchemist-macroexpand-expand-and-print-request string))) - -(defun alchemist-macroexpand-region (beg end) - "Macro expand the Elixir code on marked region." - (interactive (list (point) (mark))) - (unless (and beg end) - (error "The mark is not set now, so there is no region")) - (let ((string (buffer-substring-no-properties beg end))) - (alchemist-macroexpand-expand-request string))) - -(defun alchemist-macroexpand-once-print-region (beg end) - "Macro expand the Elixir code on marked region once and insert the result." - (interactive "r") - (let ((string (buffer-substring-no-properties beg end))) - (when (> end beg) - (exchange-point-and-mark)) - (alchemist-macroexpand-expand-once-and-print-request string))) - -(defun alchemist-macroexpand-once-region (beg end) - "Macro expand the Elixir code on marked region once." - (interactive (list (point) (mark))) - (unless (and beg end) - (error "The mark is not set now, so there is no region")) - (let ((string (buffer-substring-no-properties beg end))) - (alchemist-macroexpand-expand-once-request string))) - -(defun alchemist-macroexpand-close-popup () - "Quit the macroexpand buffer window." - (interactive) - (quit-windows-on alchemist-macroexpand-buffer-name)) - -(defvar alchemist-macroexpand-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "q") #'quit-window) - map) - "Keymap for `alchemist-macroexpand-mode'.") - -(define-minor-mode alchemist-macroexpand-mode - "Minor mode for Alchemist Elixir macroexpand functionality. - -\\{alchemist-macroexpand-mode-map}" - nil - alchemist-macroexpand-mode-map) - -(provide 'alchemist-macroexpand) - -;;; alchemist-macroexpand.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-message.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-message.el deleted file mode 100644 index 177d0b8..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-message.el +++ /dev/null @@ -1,60 +0,0 @@ -;;; alchemist-message.el --- Internal message functionality - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Internal message functionality. - -;;; Code: - -(defgroup alchemist-message nil - "Internal message functionality." - :prefix "alchemist-message-" - :group 'alchemist) - -;; Variables - -(defvar alchemist-message--buffer-name "*alchemist message*") - -(defun alchemist-message (message) - (alchemist-message--initialize-buffer message)) - -(defun alchemist-message--initialize-buffer (message) - (display-buffer (get-buffer-create alchemist-message--buffer-name)) - (with-current-buffer alchemist-message--buffer-name - (let ((inhibit-read-only t) - (buffer-undo-list t)) - (erase-buffer) - (insert message) - (goto-char (point-min)) - (ansi-color-apply-on-region (point-min) (point-max)) - (read-only-mode) - (alchemist-message-mode 1)))) - -(define-minor-mode alchemist-message-mode - "Minor mode for displaying alchemist messages" - :group 'alchemist-message - :lighter " alchemist-msg" - :keymap '(("q" . quit-window))) - -(provide 'alchemist-message) - -;;; alchemist-message.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-mix.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-mix.el deleted file mode 100644 index 5585bd4..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-mix.el +++ /dev/null @@ -1,227 +0,0 @@ -;;; alchemist-mix.el --- Interface to run Elixir mix tasks inside Emacs - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Interface to run Elixir mix tasks inside Emacs. - -;;; Code: - -(require 'alchemist-utils) -(require 'alchemist-project) -(require 'alchemist-test-mode) -(require 'alchemist-server) - -(defgroup alchemist-mix nil - "Emacs integration for Elixir's mix." - :prefix "alchemist-mix-" - :group 'alchemist) - -;; Variables - -(defvar alchemist-last-run-test nil) -(defvar alchemist-mix-filter-output nil) - -(defcustom alchemist-mix-command "mix" - "The shell command for mix." - :type 'string - :group 'alchemist-mix) - -(defcustom alchemist-mix-test-task "test" - "Default task to run tests." - :type 'string - :group 'alchemist-mix) - -(defcustom alchemist-mix-test-default-options '() - "Default options for alchemist test command." - :type '(repeat string) - :group 'alchemist-mix) - -(defcustom alchemist-mix-env nil - "The default mix env to run mix commands with. If nil, the mix env is -not set explicitly." - :type '(string boolean) - :group 'alchemist-mix) - -(defvar alchemist-mix-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "q" #'quit-window) - (define-key map "i" #'alchemist-mix-send-input-to-mix-process) - map)) - -(defvar alchemist-mix-buffer-name "*alchemist mix*" - "Name of the mix output buffer.") - -(defvar alchemist-mix--envs '("dev" "prod" "test") - "The list of mix envs to use as defaults.") - -;; Private functions - -(defun alchemist-mix--completing-read (prompt cmdlist) - (completing-read prompt cmdlist nil t nil nil (car cmdlist))) - -(defun alchemist-mix--execute-test (&optional what) - "Execute 'mix test' on the given `WHAT'. - -`WHAT' could be a filename, a filename:line string or the empty string (meaning -run all tests)." - (if what - (setq alchemist-last-run-test what) - (setq alchemist-last-run-test "")) - (alchemist-test-execute (list "mix" - alchemist-mix-test-task - what - alchemist-mix-test-default-options))) - -(defun alchemist-mix--test-file (filename) - "Run a specific FILENAME as argument for the mix command test." - (when (not (file-exists-p filename)) - (error "The given file doesn't exist")) - (alchemist-mix--execute-test (expand-file-name filename))) - -;; Public functions - -(defun alchemist-mix () - "Prompt for a specific mix task to run. - -If the command `universal-argument' is called before `alchemist-mix', -a prompt for a specific mix environment in which the task will be -executed, gets called." - (interactive) - (alchemist-server-info "{ :type, :mixtasks }" #'alchemist-mix-filter)) - -(defun alchemist-mix-display-mix-buffer () - "Display the mix buffer when exists." - (interactive) - (when (get-buffer alchemist-mix-buffer-name) - (display-buffer alchemist-mix-buffer-name))) - -(defun alchemist-mix-test () - "Run the whole elixir test suite." - (interactive) - (alchemist-mix--execute-test)) - -(defun alchemist-mix-test-this-buffer () - "Run the current buffer through mix test." - (interactive) - (alchemist-mix--test-file buffer-file-name)) - -(defun alchemist-mix-test-file (filename) - "Run `alchemist-mix--test-file' with the FILENAME." - (interactive "Fmix test: ") - (alchemist-mix--test-file (expand-file-name filename))) - -(defun alchemist-mix-test-at-point () - "Run the test at point." - (interactive) - (let* ((line (line-number-at-pos (point))) - (file-and-line (format "%s:%s" buffer-file-name line))) - (alchemist-mix--execute-test file-and-line))) - -(defun alchemist-mix-rerun-last-test () - "Rerun the last test that was run by alchemist. - -When no tests had been run before calling this function, do nothing." - (interactive) - (if alchemist-last-run-test - (alchemist-mix--execute-test alchemist-last-run-test) - (message "No tests have been run yet"))) - -(defun alchemist-mix-compile (command &optional prefix) - "Compile the whole elixir project. Prompt for the mix env if the prefix -arg is set." - (interactive "Mmix compile: \nP") - (alchemist-mix-execute (list "compile" command) prefix)) - -(defun alchemist-mix-run (command &optional prefix) - "Runs the given file or expression in the context of the application." - (interactive "Mmix run: \nP") - (alchemist-mix-execute (list "run" command) prefix)) - -(defun alchemist-mix-send-input-to-mix-process (input) - "Send INPUT to the current running mix task process." - (interactive "MSend to running mix task: ") - (let* ((buffer (get-buffer alchemist-mix-buffer-name)) - (process (get-buffer-process buffer))) - (if (and process (eq (process-status process) 'run)) - (with-current-buffer buffer - (let ((inhibit-read-only t)) - (goto-char (point-max)) - (insert (concat input "\n\n")) - (set-marker (process-mark process) (point))) - (comint-send-string process (concat input "\n"))) - (error "No %s process is running" alchemist-mix-buffer-name)))) - -(defun alchemist-mix-help () (interactive) - (alchemist-utils-deprecated-message "alchemist-mix-help" "alchemist-mix")) -(defun alchemist-mix-new () (interactive) - (alchemist-utils-deprecated-message "alchemist-mix-new" "alchemist-mix")) -(defun alchemist-mix-deps () (interactive) - (alchemist-utils-deprecated-message "alchemist-mix-deps" "alchemist-mix")) -(defun alchemist-mix-deps-with-prompt () (interactive) - (alchemist-utils-deprecated-message "alchemist-mix-deps-with-prompt" "alchemist-mix")) -(defun alchemist-mix-local-with-prompt () (interactive) - (alchemist-utils-deprecated-message "alchemist-mix-local-with-prompt" "alchemist-mix")) -(defun alchemist-mix-local () (interactive) - (alchemist-utils-deprecated-message "alchemist-mix-local" "alchemist-mix")) -(defun alchemist-mix-local-install () (interactive) - (alchemist-utils-deprecated-message "alchemist-mix-local-install" "alchemist-mix")) -(defun alchemist-mix-local-with-url () (interactive) - (alchemist-utils-deprecated-message "alchemist-mix-local-with-url" "alchemist-mix")) -(defun alchemist-mix-local-with-path () (interactive) - (alchemist-utils-deprecated-message "alchemist-mix-local-with-path" "alchemist-mix")) -(defun alchemist-mix-hex-search () (interactive) - (alchemist-utils-deprecated-message "alchemist-mix-local-hex-search" "alchemist-mix")) - -(defun alchemist-mix-filter (_process output) - (with-local-quit - (setq alchemist-mix-filter-output (cons output alchemist-mix-filter-output)) - (when (alchemist-server-contains-end-marker-p output) - (let* ((output (alchemist-server-prepare-filter-output alchemist-mix-filter-output)) - (tasks (split-string output "\n")) - (selected-task (alchemist-mix--completing-read "mix: " tasks)) - (command (read-shell-command "mix " (concat selected-task " ")))) - (setq alchemist-mix-filter-output nil) - (alchemist-mix-execute (list command) current-prefix-arg))))) - -(define-derived-mode alchemist-mix-mode fundamental-mode "Mix Mode" - "Major mode for presenting Mix tasks. - -\\{alchemist-mix-mode-map}" - (setq buffer-read-only t) - (setq-local truncate-lines t) - (setq-local electric-indent-chars nil)) - -(defun alchemist-mix-execute (command-list &optional prefix) - "Run a mix task specified by COMMAND-LIST. - -If PREFIX is non-nil, prompt for a mix environment variable." - (let* ((mix-env (if prefix - (completing-read "mix env: " alchemist-mix--envs nil nil alchemist-mix-env) - alchemist-mix-env)) - (command (alchemist-utils-build-command - (list (when mix-env (concat "MIX_ENV=" mix-env)) - alchemist-mix-command command-list)))) - (alchemist-report-run command "alchemist-mix-report" alchemist-mix-buffer-name 'alchemist-mix-mode))) - -(provide 'alchemist-mix) - -;;; alchemist-mix.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-phoenix.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-phoenix.el deleted file mode 100644 index 1d06004..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-phoenix.el +++ /dev/null @@ -1,145 +0,0 @@ -;;; alchemist-phoenix.el --- Minor mode for the Phoenix web framework - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Minor mode for the Phoenix web framework - -;;; Code: - -(require 'alchemist-key) -(require 'alchemist-project) - -(defgroup alchemist-phoenix nil - "Minor mode for the Phoenix web framework." - :prefix "alchemist-phoenix-" - :group 'alchemist) - -;;;###autoload -(defun alchemist-phoenix-project-p () - "Return non-nil if `default-directory' is inside an Phoenix project." - (and (alchemist-project-p) - (file-directory-p (concat (alchemist-project-root) "web")))) - -(defun alchemist-phoenix-find-dir (directory) - (unless (alchemist-phoenix-project-p) - (error "Could not find an Phoenix Mix project root.")) - (alchemist-file-find-files (alchemist-project-root) directory)) - -(defun alchemist-phoenix-find-web () - (interactive) - (alchemist-phoenix-find-dir "web")) - -(defun alchemist-phoenix-find-views () - (interactive) - (alchemist-phoenix-find-dir "web/views")) - -(defun alchemist-phoenix-find-controllers () - (interactive) - (alchemist-phoenix-find-dir "web/controllers")) - -(defun alchemist-phoenix-find-channels () - (interactive) - (alchemist-phoenix-find-dir "web/channels")) - -(defun alchemist-phoenix-find-templates () - (interactive) - (alchemist-phoenix-find-dir "web/templates")) - -(defun alchemist-phoenix-find-models () - (interactive) - (alchemist-phoenix-find-dir "web/models")) - -(defun alchemist-phoenix-find-static () - (interactive) - (alchemist-phoenix-find-dir "web/static")) - -(defun alchemist-phoenix-routes (&optional prefix) - (interactive) - "Run the Mix task 'phoenix.routes' and list all available Phoenix routes." - (alchemist-mix-execute '("phoenix.routes") prefix)) - -(defun alchemist-phoenix-router () - "Open the 'router.ex' file from 'web' directory." - (interactive) - (unless (alchemist-phoenix-project-p) - (error "Could not find an Phoenix Mix project root.")) - (find-file (concat (alchemist-project-root) "web/router.ex"))) - -(defvar alchemist-phoenix-command-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "n w") #'alchemist-phoenix-find-web) - (define-key map (kbd "n v") #'alchemist-phoenix-find-views) - (define-key map (kbd "n c") #'alchemist-phoenix-find-controllers) - (define-key map (kbd "n l") #'alchemist-phoenix-find-channels) - (define-key map (kbd "n t") #'alchemist-phoenix-find-templates) - (define-key map (kbd "n m") #'alchemist-phoenix-find-models) - (define-key map (kbd "n s") #'alchemist-phoenix-find-static) - (define-key map (kbd "n r") #'alchemist-phoenix-router) - (define-key map (kbd "n R") #'alchemist-phoenix-routes) - map) - "Keymap for Alchemist Phoenix commands after `alchemist-key-command-prefix'.") -(fset 'alchemist-phoenix-command-map alchemist-phoenix-command-map) - -(defvar alchemist-phoenix-mode-map - (let ((map (make-sparse-keymap))) - (define-key map alchemist-key-command-prefix 'alchemist-phoenix-command-map) - map) - "Keymap for Alchemist Phoenix minor mode.") - -(easy-menu-define alchemist-mode-menu alchemist-phoenix-mode-map - "Menu for Alchemist-Phoenix mode." - '("Phoenix" - ("Directory lookup" - ["Lookup 'web' " alchemist-phoenix-find-web] - ["Lookup 'web/views' " alchemist-phoenix-find-views] - ["Lookup 'web/controllers' " alchemist-phoenix-find-controllers] - ["Lookup 'web/channels' " alchemist-phoenix-find-channels] - ["Lookup 'web/templates' " alchemist-phoenix-find-templates] - ["Lookup 'web/models' " alchemist-phoenix-find-models] - ["Lookup 'web/static'" alchemist-phoenix-find-static]) - ("Mix tasks" - ["Run 'phoenix.routes'" alchemist-phoenix-routes]) - ["Open the 'router.ex' file" alchemist-phoenix-router])) - -;;;###autoload -(define-minor-mode alchemist-phoenix-mode - "Minor mode for Elixir Phoenix web framework projects. - -The following commands are available: - -\\{alchemist-phoenix-mode-map}" - :lighter " alchemist-phoenix" - :keymap alchemist-phoenix-mode-map - :group 'alchemist) - -;;;###autoload -(defun alchemist-phoenix-enable-mode () - (when (alchemist-phoenix-project-p) - (alchemist-phoenix-mode))) - -;;;###autoload -(dolist (hook '(alchemist-mode-hook)) - (add-hook hook 'alchemist-phoenix-enable-mode)) - -(provide 'alchemist-phoenix) - -;;; alchemist-phoenix.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-pkg.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-pkg.el deleted file mode 100644 index c155e2d..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-pkg.el +++ /dev/null @@ -1,11 +0,0 @@ -(define-package "alchemist" "20160111.2340" "Elixir tooling integration into Emacs" - '((elixir-mode "2.2.5") - (dash "2.11.0") - (emacs "24.4") - (company "0.8.0") - (pkg-info "0.4")) - :url "http://www.github.com/tonini/alchemist.el" :keywords - '("languages" "elixir" "elixirc" "mix" "hex" "alchemist")) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-project.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-project.el deleted file mode 100644 index 0aa19c5..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-project.el +++ /dev/null @@ -1,222 +0,0 @@ -;;; alchemist-project.el --- API to identify Elixir mix projects. - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; API to identify Elixir mix projects. - -;;; Code: - -(require 'cl-lib) -(require 'dash) -(require 'alchemist-utils) -(require 'alchemist-file) - -(defgroup alchemist-project nil - "API to identify Elixir mix projects." - :prefix "alchemist-help-" - :group 'alchemist) - -(defconst alchemist-project-mix-project-indicator "mix.exs" - "File which indicates the root directory of an Elixir Mix project.") - -(defconst alchemist-project-hex-pkg-indicator ".hex" - "File which indicates the root directory of an Elixir Hex package.") - -(defun alchemist-project-elixir-p () - "Return non-nil if `default-directory' is inside the Elixir source codebase." - (stringp (alchemist-project-elixir-root))) - -(defun alchemist-project-elixir-root (&optional dir) - "Return root directory of the Elixir source." - (let* ((dir (file-name-as-directory (or dir (expand-file-name default-directory)))) - (present-files (directory-files dir))) - (cond ((alchemist-project-top-level-dir-p dir) - nil) - ((and (-contains-p present-files "eex") - (-contains-p present-files "elixir") - (-contains-p present-files "logger") - (-contains-p present-files "mix") - (-contains-p present-files "iex") - (-contains-p present-files "ex_unit")) - (file-name-directory (directory-file-name dir))) - (t (alchemist-project-elixir-root (file-name-directory (directory-file-name dir))))))) - -(defun alchemist-project-p () - "Return non-nil if `default-directory' is inside an Elixir Mix project." - (stringp (alchemist-project-root))) - -(defun alchemist-project-top-level-dir-p (dir) - "Return non-nil if DIR is the top level directory." - (equal dir (file-name-directory (directory-file-name dir)))) - -(defun alchemist-project-root (&optional dir) - "Return root directory of the current Elixir Mix project. - -It starts walking the directory tree to find the Elixir Mix root directory -from `default-directory'. If DIR is non-nil it starts walking the -directory from there instead." - (let* ((dir (file-name-as-directory (or dir (expand-file-name default-directory)))) - (present-files (directory-files dir))) - (cond ((alchemist-project-top-level-dir-p dir) - nil) - ((-contains-p present-files alchemist-project-hex-pkg-indicator) - (alchemist-project-root (file-name-directory (directory-file-name dir)))) - ((-contains-p present-files alchemist-project-mix-project-indicator) - dir) - (t - (alchemist-project-root (file-name-directory (directory-file-name dir))))))) - -(defun alchemist-project-root-or-default-dir () - "Return the current Elixir mix project root or `default-directory'." - (let* ((project-root (alchemist-project-root)) - (dir (if project-root - project-root - default-directory))) - dir)) - -(defun alchemist-project-toggle-file-and-tests-other-window () - "Toggle between a file and its tests in other window." - (interactive) - (if (alchemist-utils-test-file-p) - (alchemist-project-open-file-for-current-tests 'find-file-other-window) - (alchemist-project-open-tests-for-current-file 'find-file-other-window))) - -(defun alchemist-project-toggle-file-and-tests () - "Toggle between a file and its tests in the current window." - (interactive) - (if (alchemist-utils-test-file-p) - (alchemist-project-open-file-for-current-tests 'find-file) - (alchemist-project-open-tests-for-current-file 'find-file))) - -(defun alchemist-project-file-under-test (file directory) - "Return the file which are tested by FILE. -DIRECTORY is the place where the file under test is located." - (let* ((filename (file-relative-name file (alchemist-project-root))) - (filename (replace-regexp-in-string "^test" directory filename)) - (filename (replace-regexp-in-string "_test\.exs$" "\.ex" filename))) - (concat (alchemist-project-root) filename))) - -(defun alchemist-project-open-file-for-current-tests (opener) - "Visit the implementation file for the current buffer with OPENER." - (let* ((filename (alchemist-project-file-under-test (buffer-file-name) "web")) - (filename (if (file-exists-p filename) - filename - (alchemist-project-file-under-test (buffer-file-name) "lib")))) - (funcall opener filename))) - -(defun alchemist-project-open-tests-for-current-file (opener) - "Visit the test file for the current buffer with OPENER." - (let* ((filename (file-relative-name (buffer-file-name) (alchemist-project-root))) - (filename (replace-regexp-in-string "^lib/" "test/" filename)) - (filename (replace-regexp-in-string "^web/" "test/" filename)) - (filename (replace-regexp-in-string "\.ex$" "_test\.exs" filename)) - (filename (format "%s/%s" (alchemist-project-root) filename))) - (if (file-exists-p filename) - (funcall opener filename) - (if (y-or-n-p "No test file found; create one now?") - (alchemist-project--create-test-for-current-file - filename (current-buffer)) - (message "No test file found."))))) - -(defun alchemist-project--create-test-for-current-file (filename buffer) - "Creates and populates a test module, FILENAME, for the code in BUFFER. -The module name given to the test module is determined from the name of the -first module defined in BUFFER." - (let* ((directory-name (file-name-directory filename)) - (module-name (alchemist-project--grok-module-name buffer)) - (test-module-name (concat module-name "Test"))) - (unless (file-exists-p directory-name) - (make-directory (file-name-directory filename) t)) - (alchemist-project--insert-test-boilerplate - (find-file-other-window filename) test-module-name))) - -(defun alchemist-project--grok-module-name (buffer) - "Determines the name of the first module defined in BUFFER." - (save-excursion - (with-current-buffer buffer - (goto-char (point-min)) - (re-search-forward "defmodule\\s-\\(.+?\\)\\s-?,?\\s-do") - (match-string 1)))) - -(defun alchemist-project--insert-test-boilerplate (buffer module) - "Inserts ExUnit boilerplate for MODULE in BUFFER. -Point is left in a convenient location." - (with-current-buffer buffer - (insert (concat "defmodule " module " do\n" - " use ExUnit.Case\n\n\n" - "end\n")) - (goto-char (point-min)) - (beginning-of-line 4) - (indent-according-to-mode))) - -(defun alchemist-project-run-tests-for-current-file () - "Run the tests related to the current file." - (interactive) - (alchemist-project-open-tests-for-current-file 'alchemist-mix-test-file)) - -(defun alchemist-project-create-file () - "Create a file under lib/ in the current project. - -The newly created buffer is filled with a module definition based on the file name." - (interactive) - (let ((root (alchemist-project-root))) - (if (not root) - (message "You're not in a Mix project") - (let* ((lib-path (concat root "lib/")) - (abs-path (read-file-name "New file in lib/: " lib-path)) - (abs-path (alchemist-utils-add-ext-to-path-if-not-present abs-path ".ex")) - (relative-path (file-relative-name abs-path lib-path))) - (if (file-readable-p abs-path) - (message "%s already exists" relative-path) - (make-directory (file-name-directory abs-path) t) - (find-file abs-path) - (insert (concat "defmodule " - (alchemist-utils-path-to-module-name relative-path) - " do\n" - " \n" - "end\n")) - (goto-char (point-min)) - (beginning-of-line 2) - (back-to-indentation)))))) - -(defun alchemist-project-name () - "Return the name of the current Elixir Mix project." - (if (alchemist-project-p) - (car (cdr (reverse (split-string (alchemist-project-root) "/")))) - "")) - -(defun alchemist-project-find-dir (directory) - (unless (alchemist-project-p) - (error "Could not find an Elixir Mix project root.")) - (alchemist-file-find-files (alchemist-project-root) directory)) - -(defun alchemist-project-find-lib () - (interactive) - (alchemist-project-find-dir "lib")) - -(defun alchemist-project-find-test () - (interactive) - (alchemist-project-find-dir "test")) - -(provide 'alchemist-project) - -;;; alchemist-project.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-refcard.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-refcard.el deleted file mode 100644 index 1ca791f..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-refcard.el +++ /dev/null @@ -1,201 +0,0 @@ -;;; alchemist-refcard.el --- Generates a refcard of alchemist functionality - -;; Copyright © 2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Generates a refcard of alchemist functionality - -;;; Code: - -(require 'cl-lib) -(require 'dash) -(require 'tabulated-list) - -;; Tell the byte compiler about autoloaded functions from packages -(eval-when-compile - (declare-function alchemist-mode "alchemist.el") - (declare-function alchemist-version "alchemist.el")) - -(defgroup alchemist-refcard nil - "Generate a refcard of alchemist functionality." - :prefix "alchemist-" - :group 'applications) - -(defconst alchemist-refcard--buffer-name "*alchemist-refcard*" - "Name of Alchemist-Refcard mode buffer.") - -(defconst alchemist-refcard-list-format - [("" 55 t) - ("" 35 t)] - "List format.") - -(defvar alchemist-refcard-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "i") 'alchemist-refcard--describe-funtion-at-point) - (define-key map (kbd "q") 'quit-window) - map) - "Keymap for `alchemist-refcard-mode'.") - -(defun alchemist-refcard--get-keybinding (function-name) - (let* ((keys (where-is-internal (intern function-name))) - (keys (-map (lambda (k) - (let ((key (format "%s" k))) - (if (string-match-p "menu-bar" key) - nil - k))) keys)) - (keys (-remove 'null keys))) - (if keys - (progn - (mapconcat (lambda (k) (key-description k)) keys " , ")) - ""))) - -(defun alchemist-refcard--tabulated-list-entries () - (alchemist-mode +1) ;; needs to be enabled for fetching current keybindings - (let ((rows (list (alchemist-refcard--build-empty-tabulated-row) - (alchemist-refcard--build-tabulated-refcard-title-row (format "Alchemist Refcard v%s" (alchemist-version))) - (alchemist-refcard--build-empty-tabulated-row) - (alchemist-refcard--build-tabulated-title-row "Mix") - (alchemist-refcard--build-tabulated-row "alchemist-mix") - (alchemist-refcard--build-tabulated-row "alchemist-mix-compile") - (alchemist-refcard--build-tabulated-row "alchemist-mix-run") - (alchemist-refcard--build-empty-tabulated-row) - (alchemist-refcard--build-tabulated-title-row "Testing") - (alchemist-refcard--build-tabulated-row "alchemist-mix-test") - (alchemist-refcard--build-tabulated-row "alchemist-mix-rerun-last-test") - (alchemist-refcard--build-tabulated-row "alchemist-mix-test-file") - (alchemist-refcard--build-tabulated-row "alchemist-mix-test-this-buffer") - (alchemist-refcard--build-tabulated-row "alchemist-mix-test-at-point") - (alchemist-refcard--build-tabulated-row "alchemist-test-toggle-test-report-display") - (alchemist-refcard--build-empty-tabulated-row) - (alchemist-refcard--build-tabulated-title-row "Compilation") - (alchemist-refcard--build-tabulated-row "alchemist-compile") - (alchemist-refcard--build-tabulated-row "alchemist-compile-file") - (alchemist-refcard--build-tabulated-row "alchemist-compile-this-buffer") - (alchemist-refcard--build-empty-tabulated-row) - (alchemist-refcard--build-tabulated-title-row "Execution") - (alchemist-refcard--build-tabulated-row "alchemist-execute") - (alchemist-refcard--build-tabulated-row "alchemist-execute-file") - (alchemist-refcard--build-tabulated-row "alchemist-execute-this-buffer") - (alchemist-refcard--build-empty-tabulated-row) - (alchemist-refcard--build-tabulated-title-row "Documentation Lookup") - (alchemist-refcard--build-tabulated-row "alchemist-help") - (alchemist-refcard--build-tabulated-row "alchemist-help-history") - (alchemist-refcard--build-tabulated-row "alchemist-help-search-at-point") - (alchemist-refcard--build-tabulated-row "alchemist-refcard") - (alchemist-refcard--build-empty-tabulated-row) - (alchemist-refcard--build-tabulated-title-row "Definition Lookup") - (alchemist-refcard--build-tabulated-row "alchemist-goto-definition-at-point") - (alchemist-refcard--build-tabulated-row "alchemist-goto-jump-back") - (alchemist-refcard--build-tabulated-row "alchemist-goto-jump-to-previous-def-symbol") - (alchemist-refcard--build-tabulated-row "alchemist-goto-jump-to-next-def-symbol") - (alchemist-refcard--build-tabulated-row "alchemist-goto-list-symbol-definitions") - (alchemist-refcard--build-empty-tabulated-row) - (alchemist-refcard--build-tabulated-title-row "Project") - (alchemist-refcard--build-tabulated-row "alchemist-project-find-test") - (alchemist-refcard--build-tabulated-row "alchemist-project-toggle-file-and-tests") - (alchemist-refcard--build-tabulated-row "alchemist-project-toggle-file-and-tests-other-window") - (alchemist-refcard--build-tabulated-row "alchemist-project-run-tests-for-current-file") - (alchemist-refcard--build-empty-tabulated-row) - (alchemist-refcard--build-tabulated-title-row "IEx") - (alchemist-refcard--build-tabulated-row "alchemist-iex-run") - (alchemist-refcard--build-tabulated-row "alchemist-iex-project-run") - (alchemist-refcard--build-tabulated-row "alchemist-iex-send-current-line") - (alchemist-refcard--build-tabulated-row "alchemist-iex-send-current-line-and-go") - (alchemist-refcard--build-tabulated-row "alchemist-iex-send-region") - (alchemist-refcard--build-tabulated-row "alchemist-iex-send-region-and-go") - (alchemist-refcard--build-tabulated-row "alchemist-iex-compile-this-buffer") - (alchemist-refcard--build-empty-tabulated-row) - (alchemist-refcard--build-tabulated-title-row "Eval") - (alchemist-refcard--build-tabulated-row "alchemist-eval-current-line") - (alchemist-refcard--build-tabulated-row "alchemist-eval-print-current-line") - (alchemist-refcard--build-tabulated-row "alchemist-eval-quoted-current-line") - (alchemist-refcard--build-tabulated-row "alchemist-eval-print-quoted-current-line") - (alchemist-refcard--build-tabulated-row "alchemist-eval-region") - (alchemist-refcard--build-tabulated-row "alchemist-eval-print-region") - (alchemist-refcard--build-tabulated-row "alchemist-eval-quoted-region") - (alchemist-refcard--build-tabulated-row "alchemist-eval-print-quoted-region") - (alchemist-refcard--build-tabulated-row "alchemist-eval-buffer") - (alchemist-refcard--build-tabulated-row "alchemist-eval-print-buffer") - (alchemist-refcard--build-tabulated-row "alchemist-eval-quoted-buffer") - (alchemist-refcard--build-tabulated-row "alchemist-eval-print-quoted-buffer") - (alchemist-refcard--build-tabulated-row "alchemist-eval-close-popup") - (alchemist-refcard--build-empty-tabulated-row) - (alchemist-refcard--build-tabulated-title-row "Macroexpand") - (alchemist-refcard--build-tabulated-row "alchemist-macroexpand-once-current-line") - (alchemist-refcard--build-tabulated-row "alchemist-macroexpand-once-print-current-line") - (alchemist-refcard--build-tabulated-row "alchemist-macroexpand-current-line") - (alchemist-refcard--build-tabulated-row "alchemist-macroexpand-print-current-line") - (alchemist-refcard--build-tabulated-row "alchemist-macroexpand-once-region") - (alchemist-refcard--build-tabulated-row "alchemist-macroexpand-once-print-region") - (alchemist-refcard--build-tabulated-row "alchemist-macroexpand-region") - (alchemist-refcard--build-tabulated-row "alchemist-macroexpand-print-region") - (alchemist-refcard--build-tabulated-row "alchemist-macroexpand-close-popup")))) - (alchemist-mode -1) ;; disable it after getting the current keybindings - rows)) - -(defun alchemist-refcard--build-empty-tabulated-row () - (list "" `[,"" ""])) - -(defun alchemist-refcard--build-tabulated-row (function-name) - (list function-name `[,function-name - ,(propertize (alchemist-refcard--get-keybinding function-name) 'face font-lock-builtin-face)])) - -(defun alchemist-refcard--build-tabulated-refcard-title-row (title) - (list "" `[,(propertize title 'face font-lock-variable-name-face) ""])) - -(defun alchemist-refcard--build-tabulated-title-row (title) - (list "" `[,(propertize title 'face font-lock-constant-face) ""])) - -(defun alchemist-refcard--describe-funtion-at-point () - (interactive) - (let ((function-name (get-text-property (point) 'tabulated-list-id))) - (when (not (alchemist-utils-empty-string-p function-name)) - (describe-function (intern function-name))))) - -(defun alchemist-refcard--buffer () - "Return alchemist-refcard buffer if it exists." - (get-buffer alchemist-refcard--buffer-name)) - -(define-derived-mode alchemist-refcard-mode tabulated-list-mode "Alchemist" - "Alchemist refcard mode." - (buffer-disable-undo) - (kill-all-local-variables) - (setq truncate-lines t) - (setq mode-name "Alchemist-Refcard") - (setq-local alchemist-test-status-modeline nil) - (use-local-map alchemist-refcard-mode-map) - (setq tabulated-list-format alchemist-refcard-list-format) - (setq tabulated-list-entries 'alchemist-refcard--tabulated-list-entries) - (tabulated-list-print)) - -;;;###autoload -(defun alchemist-refcard () - "Generate an Alchemist refcard of all the features." - (interactive) - (let ((buffer-p (alchemist-refcard--buffer)) - (buffer (get-buffer-create alchemist-refcard--buffer-name))) - (pop-to-buffer buffer) - (unless buffer-p - (alchemist-refcard-mode)))) - -(provide 'alchemist-refcard) - -;;; alchemist-refcard.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-report.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-report.el deleted file mode 100644 index d5f4023..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-report.el +++ /dev/null @@ -1,167 +0,0 @@ -;;; alchemist-report.el --- Run command in a process and handles buffer of it - -;; Copyright © 2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Run command in a process and handles buffer output and display - -;;; Code: - -(require 'ansi-color) -(require 'alchemist-project) - -(defgroup alchemist-report nil - "Run command in a process and handles buffer output and display" - :prefix "alchemist-report-" - :group 'alchemist) - -(defvar alchemist-report-on-exit nil) -(defvar alchemist-report-on-exit-function nil) -(defvar alchemist-report-on-render nil) -(defvar alchemist-report-on-render-function nil) -(defvar alchemist-report--last-run-status nil) -(defvar alchemist-report-mode-name nil) - -(defun alchemist-report--kill-process (process) - "Interrupt and kill the running report PROCESS." - (when process - (let ((mode-name (replace-regexp-in-string ":.+$" "" mode-name))) - (if (or (not (eq (process-status process) 'run)) - (eq (process-query-on-exit-flag process) nil) - (yes-or-no-p - (format "A %s process already running; kill it? " - mode-name))) - (condition-case () - (progn - (interrupt-process process) - (sit-for 1) - (delete-process process)) - (error nil)) - (error "Cannot have two processes in `%s' at once" - (buffer-name)))))) - -(defun alchemist-report--sentinel (process status) - "Sentinel for test report buffer." - (if (memq (process-status process) '(exit signal)) - (let ((buffer (process-buffer process))) - (if (null (buffer-name buffer)) - (set-process-buffer process nil) - (progn - (alchemist-report--render-report buffer) - (alchemist-report--handle-exit status buffer) - (alchemist-report-update-mode-name process) - (delete-process process)))))) - -(defun alchemist-report--render-report (buffer) - "Call the defined render functions for the BUFFER." - (when alchemist-report-on-render-function - (funcall alchemist-report-on-render-function buffer))) - -(defun alchemist-report--handle-exit (status buffer) - "Call the defined exit function specified in `alchemist-report-on-exit-function'. -Argument for the exit function is the STATUS and BUFFER of the finished process." - (alchemist-report--store-process-status status) - (when alchemist-report-on-exit-function - (funcall alchemist-report-on-exit-function status buffer))) - -(defun alchemist-report--store-process-status (status) - "Store STATUS of the last finished process." - (setq alchemist-report--last-run-status status)) - -(defun alchemist-report--last-run-successful-p () - "Return non-nil if the last process successfully finished." - (when (string-prefix-p "finished" alchemist-report--last-run-status) t)) - -(defun alchemist-report-filter (process output) - "Process filter for report buffers." - (with-current-buffer (process-buffer process) - (let* ((buffer-read-only nil) - (output (if (string= (process-name process) alchemist-test-report-process-name) - (alchemist-test-clean-compilation-output output) - output)) - (moving (= (point) (process-mark process)))) - (save-excursion - (goto-char (process-mark process)) - (insert output) - (set-marker (process-mark process) (point)) - (ansi-color-apply-on-region (point-min) (point-max))) - (if moving (goto-char (process-mark process)))))) - -(defun alchemist-report-update-mode-name (process) - "Update the `mode-name' with the status of PROCESS." - (with-current-buffer (process-buffer process) - (setq-local mode-name (format "%s:%s" - (replace-regexp-in-string ":.+$" "" mode-name) - (process-status process))))) - -(defun alchemist-report-interrupt-current-process () - "Interrupt the current running report process." - (interactive) - (let ((buffer (current-buffer)) - (name (replace-regexp-in-string ":.+" "" mode-name))) - (if (get-buffer-process buffer) - (interrupt-process (get-buffer-process buffer)) - (error "The [%s] process is not running" (downcase name))))) - -(defun alchemist-report-cleanup-process-buffer (buffer) - "Clean the content BUFFER of process. -If there is already a running process, ask for interrupting it." - (with-current-buffer buffer - (let ((inhibit-read-only t) - (process (get-buffer-process buffer))) - (erase-buffer)))) - -(defun alchemist-report-display-buffer (buffer) - "Display the BUFFER." - (display-buffer buffer)) - -(defun alchemist-report-activate-mode (mode buffer) - "Enable MODE inside BUFFER." - (with-current-buffer buffer - (funcall mode) - (setq-local truncate-lines t) ;; Do not display continuation lines. - (setq-local window-point-insertion-type t))) - -(defun alchemist-report-run (command process-name buffer-name mode &optional on-exit hidden) - "Run COMMAND in a new process called PROCESS-NAME. -The output of PROCESS-NAME will be displayed in BUFFER-NAME. -After displaying BUFFER-NAME, the MODE function will be called within. - -Optional ON-EXIT and HIDDEN functions could be defined. -The function ON-EXIT will be called when PROCESS-NAME is finished. -The HIDDEN variable defines if PROCESS-NAME should run in the background." - (let* ((buffer (get-buffer-create buffer-name)) - (default-directory (alchemist-project-root-or-default-dir))) - (alchemist-report-cleanup-process-buffer buffer) - (alchemist-report--kill-process (get-buffer-process buffer)) - (start-process-shell-command process-name buffer command) - (when on-exit - (setq alchemist-report-on-exit-function on-exit)) - (set-process-sentinel (get-buffer-process buffer) 'alchemist-report--sentinel) - (set-process-filter (get-buffer-process buffer) 'alchemist-report-filter) - (alchemist-report-activate-mode mode buffer) - (if (not hidden) - (alchemist-report-display-buffer buffer)) - (alchemist-report-update-mode-name (get-buffer-process buffer)))) - -(provide 'alchemist-report) - -;;; alchemist-report.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-scope.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-scope.el deleted file mode 100644 index c1fafa3..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-scope.el +++ /dev/null @@ -1,205 +0,0 @@ -;;; alchemist-scope.el --- Provides information about Elixir source code context -*- lexical-binding: t -*- - -;; Copyright © 2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Provides information about the Elixir source code context. - -;;; Code: - -(require 'dash) - -(defgroup alchemist-scope nil - "Provides information about the Elixir source code context." - :prefix "alchemist-scope-" - :group 'alchemist) - -(defconst alchemist-scope-defmodule-regex "defmodule \\([A-Za-z\._]+\\)\s+" - "The regex for matching Elixir defmodule macro.") - -(defconst alchemist-scope-alias-regex - "^\s+alias\s+\\([-:_A-Za-z0-9,\.\?!\]+\\)\\(\s*,\s*as:\s*\\)?\\([-_A-Za-z0-9,\.\?!\]+\\)?\n" - "The regex for matching Elixir alias definitions. - Example: - alias Phoenix.Router.Resource, as: Special") - -(defconst alchemist-scope-alias-regex-two - "^\s+alias\s+\\([-:_A-Za-z0-9,\.\?!\]+\\)\.{\\([-:_A-Za-z0-9\s,\.\?!\]+\\)}\n" - "The regex for matching Elixir alias definitions. - Example: - alias List.Chars.{Atom, Float}") - -(defconst alchemist-scope-use-regex - "^\s+use\s+\\([A-Za-z0-9\.]+\\)" - "The regex for matching Elixir use definitions.") - -(defconst alchemist-scope-import-regex - "^\s+import\s+\\([A-Za-z0-9\.]+\\)" - "The regex for matching Elixir import definitions.") - -(defun alchemist-scope-inside-string-p () - "Return non-nil if `point' is inside a string or heredoc." - (let* ((pos (point)) - (parse-info (syntax-ppss pos))) - (or (and (nth 3 parse-info) - (nth 8 parse-info)) - (and (looking-at "\"\"\"\\|'''\\|\"\\|\'") - (match-beginning 0))))) - -(defun alchemist-scope-inside-module-p () - "Return non-nil if `point' is currently inside a module." - (save-excursion - (end-of-line) - (let ((found-flag-p nil) - (found-p nil)) - (while (and (not found-flag-p) - (re-search-backward alchemist-scope-defmodule-regex nil t)) - (when (not (alchemist-scope-inside-string-p)) - (setq found-flag-p t) - (setq found-p t))) - found-p))) - -(defun alchemist-scope-module () - "Return name from the current defmodule." - (save-excursion - (let ((found-flag-p nil) - (module-name "")) - (save-match-data - (while (and (not found-flag-p) - (re-search-backward alchemist-scope-defmodule-regex nil t)) - (when (not (alchemist-scope-inside-string-p)) - (setq module-name (match-string 1)) - (setq found-flag-p t)) - (when (equal 1 (line-number-at-pos (point))) - (setq found-flag-p t))) - module-name)))) - -(defun alchemist-scope-aliases () - "Return aliases from the current module." - (let* ((aliases '()) - (context (alchemist-scope-module))) - (save-excursion - (when (alchemist-scope-inside-module-p) - (end-of-line) - ;; alias definition like: - ;; - ;; alias Phoenix.Router.Resource, as: Special - (while (re-search-backward alchemist-scope-alias-regex nil t) - (when (and - (not (alchemist-scope-inside-string-p)) - (equal context (alchemist-scope-module))) - (let* ((alias (match-string 1)) - (as (if (match-string 3) (match-string 3) nil)) - (as (if as as (car (last (split-string alias "\\.")))))) - (setq aliases (append aliases (list (list (alchemist-utils-remove-dot-at-the-end alias) - (alchemist-utils-remove-dot-at-the-end as)))))))) - ;; alias definition like: - ;; - ;; alias List.Chars.{Atom, Float} - (while (re-search-backward alchemist-scope-alias-regex-two nil t) - (when (and - (not (alchemist-scope-inside-string-p)) - (equal context (alchemist-scope-module))) - (let* ((prefix (match-string 1)) - (alias-collection (if (match-string 2) (split-string (match-string 2) ",") nil))) - (-map (lambda (alias) - (let* ((alias (replace-regexp-in-string "\s+" "" alias)) - (namespace (format "%s.%s" prefix alias))) - (setq aliases (append aliases (list (list (alchemist-utils-remove-dot-at-the-end namespace) - (alchemist-utils-remove-dot-at-the-end alias))))))) - alias-collection)))))) - aliases)) - -(defun alchemist-scope--modules (regex) - (let ((modules '()) - (context (alchemist-scope-module))) - (save-excursion - (when (not (alchemist-utils-empty-string-p context)) - (while (re-search-backward regex nil t) - (when (and (match-string 1) - (not (alchemist-scope-inside-string-p)) - (equal context (alchemist-scope-module))) - (cl-pushnew (substring-no-properties (match-string 1)) modules)))) - modules))) - -(defun alchemist-scope-use-modules () - "Return `use' introduced module names from the current module." - (alchemist-scope--modules alchemist-scope-use-regex)) - -(defun alchemist-scope-import-modules () - "Return `import' introduced module names from the current module." - (alchemist-scope--modules alchemist-scope-import-regex)) - -(defun alchemist-scope-all-modules () - "Return `use' and `import' introduced modules from the current module." - (let ((current (alchemist-scope-module)) - (use (alchemist-scope-use-modules)) - (import (alchemist-scope-import-modules)) - (modules '())) - (push current modules) - (push use modules) - (push import modules) - (-flatten modules))) - -(defun alchemist-scope-extract-module (expr) - "Extract module from EXPR." - (let* ((parts (split-string expr "\\.")) - (function (car (last parts))) - (case-fold-search nil)) - (when (string-match-p "^[a-z_\?!]+" function) - (delete function parts)) - (unless (string-match-p "^[a-z_\?!]+" (car parts)) - (alchemist-utils-remove-dot-at-the-end (mapconcat 'concat parts "."))))) - -(defun alchemist-scope-extract-function (expr) - "Extract function from EXPR." - (let* ((parts (split-string expr "\\.")) - (function (car (last parts))) - (case-fold-search nil)) - (when (and function - (string-match-p "^[a-z_\?!]+" function)) - function))) - -(defun alchemist-scope-alias-full-path (module) - "Solve the full path for the MODULE alias." - (if (not (alchemist-utils-empty-string-p module)) - (let* ((aliases (-map (lambda (m) - (when (string-match-p (format "^%s" (car (cdr m))) module) - (replace-regexp-in-string (format "^%s" (car (cdr m))) (car m) module t))) - (alchemist-scope-aliases))) - (aliases (delete nil aliases))) - (if aliases - (car aliases) - module)))) - -(defun alchemist-scope-expression () - "Return the expression under the cursor." - (let (p1 p2) - (save-excursion - (skip-chars-backward "-_A-Za-z0-9.?!:@") - (setq p1 (point)) - (skip-chars-forward "-_A-Za-z0-9.?!:@") - (setq p2 (point)) - (buffer-substring-no-properties p1 p2)))) - -(provide 'alchemist-scope) - -;;; alchemist-scope.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server.el deleted file mode 100644 index 1f5fd45..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server.el +++ /dev/null @@ -1,211 +0,0 @@ -;;; alchemist-server.el --- Interface to the Alchemist Elixir server. -*- lexical-binding: t -*- - -;; Copyright © 2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Interface to the Alchemist Elixir server. - -;;; Code: - -(require 'alchemist-execute) - -(defgroup alchemist-server nil - "Interface to the Alchemist Elixir server." - :prefix "alchemist-server-" - :group 'alchemist) - -(defvar alchemist-server-processes '() - "Store running Alchemist server processes.") - -(defvar alchemist-server-env "dev" - "Default environment in for the Alchemist server.") - -(defvar alchemist-server-envs '("dev" "prod" "test" "shared") - "List of available Alchemist server environments.") - -(defconst alchemist-server - (concat (file-name-directory load-file-name) "alchemist-server/run.exs") - "Path to the Alchemist server file.") - -(defconst alchemist-server-command - (format "%s %s %s" - alchemist-execute-command - alchemist-server - alchemist-server-env) - "Alchemist server command.") - -(defconst alchemist-server-codes '((server-eval "EVAL") - (server-defl "DEFL") - (server-info "INFO") - (server-docl "DOCL") - (server-comp "COMP")) - "Alchemist server API codes.") - -(defun alchemist-server-start (env) - "Start alchemist server for the current mix project in specific ENV. - -If a server already running, the current one will be killed and new one -will be started instead." - (interactive (list - (completing-read (format "(Alchemist-Server) run in environment: (default: %s) " alchemist-server-env) - alchemist-server-envs nil nil nil))) - (when (alchemist-server-process-p) - (kill-process (alchemist-server-process))) - (alchemist-server-start-in-env env)) - -(defun alchemist-server-start-if-not-running () - "Start a new Alchemist server if not already running. - -An Alchemist server will be started for the current Elixir mix project." - (unless (alchemist-server-process-p) - (alchemist-server-start-in-env alchemist-server-env))) - -(defun alchemist-server-start-in-env (env) - "Start an Alchemist server with the ENV." - (let* ((process-name (alchemist-server-process-name)) - (default-directory (if (string= process-name "alchemist-server") - default-directory - process-name)) - (server-command (format "elixir %s %s" alchemist-server env)) - (process (start-process-shell-command process-name "*alchemist-server*" server-command))) - (set-process-query-on-exit-flag process nil) - (alchemist-server--store-process process))) - -(defun alchemist-server--store-process (process) - "Store PROCESS in `alchemist-server-processes'." - (let ((process-name (alchemist-server-process-name))) - (if (cdr (assoc process-name alchemist-server-processes)) - (setq alchemist-server-processes - (delq (assoc process-name alchemist-server-processes) alchemist-server-processes))) - (add-to-list 'alchemist-server-processes (cons process-name process)))) - -(defun alchemist-server-process-p () - "Return non-nil if a process for the current -Elixir mix project is live." - (process-live-p (alchemist-server-process))) - -(defun alchemist-server-process () - "Return process for the current Elixir mix project." - (cdr (assoc (alchemist-server-process-name) alchemist-server-processes))) - -(defun alchemist-server-process-name () - "Return process name for the current Elixir mix project." - (let* ((process-name (if (alchemist-project-elixir-p) - "alchemist-server" - (alchemist-project-root))) - (process-name (if process-name - process-name - "alchemist-server"))) - process-name)) - -(defun alchemist-server-api-code (symbol) - "Return Alchemist server API code for SYMBOL." - (car (cdr (assoc symbol alchemist-server-codes)))) - -(defconst alchemist-server-code-end-marker-regex - (format "END-OF-\\(%s\\|%s\\|%s\\|%s\\|%s\\)$" - (alchemist-server-api-code 'server-eval) - (alchemist-server-api-code 'server-defl) - (alchemist-server-api-code 'server-info) - (alchemist-server-api-code 'server-docl) - (alchemist-server-api-code 'server-comp)) - "Regular expression to identify Alchemist server API end markers.") - -(defun alchemist-server-contains-end-marker-p (string) - "Return non-nil if STRING contain an Alchemist server API end marker." - (string-match-p alchemist-server-code-end-marker-regex string)) - -(defun alchemist-server-build-request-string (code &optional args) - "Build Alchemist server request string for CODE. - -If ARGS available add them to the request string." - (let* ((code (car (cdr (assoc code alchemist-server-codes))))) - (if args - (format "%s %s\n" code args) - (format "%s\n" code)))) - -(defun alchemist-server-prepare-filter-output (output) - "Clean OUTPUT by remove Alchemist server API end markes." - (let* ((output (apply #'concat (reverse output))) - (output (replace-regexp-in-string alchemist-server-code-end-marker-regex "" output)) - (output (replace-regexp-in-string "\n+$" "" output))) - output)) - -(defun alchemist-server-send-request (string filter) - "Send STRING to Alchemist server API and set FILTER to process." - (alchemist-server-start-if-not-running) - (set-process-filter (alchemist-server-process) filter) - (process-send-string (alchemist-server-process) string)) - -(defun alchemist-server-goto (args filter) - "Make an Alchemist server source request with ARGS. - -Process server respond with FILTER." - (alchemist-server-start-if-not-running) - (alchemist-server-send-request (alchemist-server-build-request-string 'server-defl args) filter)) - -(defun alchemist-server-info (args filter) - "Make an Alchemist server mix request. - -Process server respond with FILTER." - (alchemist-server-start-if-not-running) - (alchemist-server-send-request (alchemist-server-build-request-string 'server-info args) filter)) - -(defun alchemist-server-help-with-modules (filter) - "Make an Alchemist server modules request. - -Process server respond with FILTER." - (alchemist-server-start-if-not-running) - (alchemist-server-send-request (alchemist-server-build-request-string 'server-info) filter)) - -(defun alchemist-server-help (args filter) - "Make an Alchemist server doc request with ARGS. - -Process server respond with FILTER." - (alchemist-server-start-if-not-running) - (alchemist-server-send-request (alchemist-server-build-request-string 'server-docl args) filter)) - -(defun alchemist-server-eval (args filter) - "Make an Alchemist server evaluate request with FILE. - -Process server respond with FILTER." - (alchemist-server-start-if-not-running) - (alchemist-server-send-request (alchemist-server-build-request-string 'server-eval args) filter)) - -(defun alchemist-server-complete-candidates (args filter) - "Make an Alchemist server complete request with ARGS. - -Process server respond with FILTER." - (alchemist-server-start-if-not-running) - (alchemist-server-send-request (alchemist-server-build-request-string 'server-comp args) filter)) - -(defun alchemist-server-status () - "Report the server status for the current Elixir project." - (interactive) - (message "Alchemist-Server-Status: [Project: %s Status: %s]" - (alchemist-server-process-name) - (if (alchemist-server-process-p) - "Connected" - "Not Connected"))) - -(provide 'alchemist-server) - -;;; alchemist-server.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/.gitignore b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/.gitignore deleted file mode 100644 index 5663f4d..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -test/sandbox -.cask \ No newline at end of file diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/.travis.yml b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/.travis.yml deleted file mode 100644 index 7839941..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: elixir -elixir: - - 1.1.1 - - 1.2.0-rc.0 -otp_release: - - 18.0 -sudo: false -install: mix local.hex --force -script: - - make -notifications: - irc: "irc.freenode.org#emacs-elixir" \ No newline at end of file diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/Makefile b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/Makefile deleted file mode 100644 index 6e02908..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -ELIXIR = elixir - -VERSION = $(shell git describe --tags --abbrev=0 | sed 's/^v//') - -NO_COLOR=\033[0m -INFO_COLOR=\033[2;32m -STAT_COLOR=\033[2;33m - -all: test - -test: test_server - ${MAKE} test_helpers - ${MAKE} test_api - -test_server: - @ echo "\n$(INFO_COLOR)Run server tests: $(NO_COLOR)\n" - $(ELIXIR) test/server_test.exs - -test_helpers: - @ echo "\n$(INFO_COLOR)Run helper tests: $(NO_COLOR)\n" - $(ELIXIR) test/helpers/module_info_test.exs - $(ELIXIR) test/helpers/complete_test.exs - -test_api: - @ echo "\n$(INFO_COLOR)Run api tests: $(NO_COLOR)\n" - $(ELIXIR) test/api/docl_test.exs - $(ELIXIR) test/api/comp_test.exs - $(ELIXIR) test/api/defl_test.exs - -api_completer: - @ echo "\n$(INFO_COLOR)Run api tests: $(NO_COLOR)\n" - $(ELIXIR) test/api_test.exs - - -.PHONY: test test_server test_helpers test_api diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/README.md b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/README.md deleted file mode 100644 index cbc2a1a..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/README.md +++ /dev/null @@ -1,161 +0,0 @@ -[![License GPL 3](https://img.shields.io/badge/license-GPL_3-green.svg)](http://www.gnu.org/licenses/gpl-3.0.txt) -[![Build Status](https://img.shields.io/travis/tonini/alchemist-server.svg)](https://travis-ci.org/tonini/alchemist-server) - -**INFO:** The Alchemist-Server is in Beta status and the API will most likey change until the first release. Feedback and critic are highly appreciated though. - -# Alchemist Server - -The Alchemist-Server operates as an informant for a specific desired -Elixir Mix project and serves with informations as the following: - -* Completion for Modules and functions. -* Documentation lookup for Modules and functions. -* Code evaluation and quoted representation of code. -* Definition lookup of code. -* Listing of all available Mix tasks. -* Listing of all available Modules with documentation. - -# Usage - -The server needs to be started inside an Elixir mix project like below: - -``` -$ cd elixir_project -$ elixir path/to/alchemist-server/run.exs dev -``` - -The Alchemist-Server API is `STDIN/STDOUT` based, when input sent to a -running server process it responds by sending information back to the `STDOUT`. - -A request consisting of two parts, the request type and the request arguments. - -Example for a completion request: - -``` -[type] [arguments] - -COMP { "def", [ context: Elixir, imports: [Enum], aliases: [{MyList, List}] ] } -``` - -# API - -## Completion - -Return a completion list of all the available candidates. - -``` -COMP -COMP { "def", [ context: Elixir, imports: [], aliases: [] ] } -COMP { "List.fla", [ context: Elixir, imports: [], aliases: [] ] } -``` - -## Documentation lookup - -Return the documentation. - -``` -DOCL { "defmodule", [ context: Elixir, imports: [], aliases: [] ] } -DOCL { "List.flatten/1", [ context: Elixir, imports: [], aliases: [] ] } -``` - -## Evaluation, Quoted & Macro expand - -### Evaluation - -Return the evaluation result of the code from the file. - -``` -EVAL { :eval, 'path/to/file/which/holds/content/to/eval.tmp' } -``` - -### Quoted - -Return the code from the file quoted. - -``` -EVAL { :quote, 'path/to/file/which/holds/content/to/quote.tmp' } -``` - -### Macro expand - -Return the code from the file expanded. - -``` -EVAL { :expand, 'path/to/file/which/holds/content/to/expand.tmp' } -``` - -Return the code from the file expanded once. - -``` -EVAL { :expand_once, 'path/to/file/which/holds/content/to/expand_once.tmp' } -``` - -## Definition lookup - -Return the path to the source file which holds the definition. - -``` -DEFL { "List,flatten", [ context: Elixir, imports: [], aliases: [] ] } -DEFL { "nil,defmacro", [ context: Elixir, imports: [], aliases: [] ] } -DEFL { "nil,create_file", [ context: Elixir, imports: [Mix.Generator], aliases: [] ] } -DEFL { "MyList,nil", [ context: Elixir, imports: [], aliases: [{MyList, List}] ] } -``` - -## Informations - -### Mix tasks - -Return a list of all available mix tasks. - -``` -INFO { :type, :mixtasks } -``` - -### Modules - -Return a list of all available modules which has documentation. - -``` -INFO { :type, :modules } -``` - -### Datatype Information - -Return information about any datatype. - -``` -INFO { :type, :info, List } -``` - -### Module Or Function/Arity Types Information - -Return types for a module or function/arity pair. - -``` -INFO { :type, :types, 'List' } -INFO { :type, :types, 'Enum.t' } -INFO { :type, :types, 'Agent.on_start/0' } -``` - -## End Markers - -Each request type ends with a specific end marker tag to notify that the request is done. - -An end tag looks like the following: - -``` -END-OF- -``` - -For example, after the following request an end tag would look like this: - -``` -INFO { :type, :modules } -List -String -Enum -. -... -.... -END-OF-INFO -``` diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/comp.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/comp.exs deleted file mode 100644 index 2740f68..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/comp.exs +++ /dev/null @@ -1,41 +0,0 @@ -Code.require_file "../helpers/complete.exs", __DIR__ - -defmodule Alchemist.API.Comp do - - @moduledoc false - - alias Alchemist.Helpers.Complete - - def request(args) do - args - |> normalize - |> process - end - - def process([nil, _, imports, _]) do - Complete.run('', imports) ++ Complete.run('') - |> print - end - - def process([hint, _context, imports, aliases]) do - Application.put_env(:"alchemist.el", :aliases, aliases) - - Complete.run(hint, imports) ++ Complete.run(hint) - |> print - end - - defp normalize(request) do - {{hint, [ context: context, - imports: imports, - aliases: aliases ]}, _} = Code.eval_string(request) - [hint, context, imports, aliases] - end - - defp print(result) do - result - |> Enum.uniq - |> Enum.map(&IO.puts/1) - - IO.puts "END-OF-COMP" - end -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/defl.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/defl.exs deleted file mode 100644 index db7e8f8..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/defl.exs +++ /dev/null @@ -1,80 +0,0 @@ -Code.require_file "../helpers/module_info.exs", __DIR__ - -defmodule Alchemist.API.Defl do - - @moduledoc false - - alias Alchemist.Helpers.ModuleInfo - - def request(args) do - args - |> normalize - |> process - |> IO.puts - - IO.puts "END-OF-DEFL" - end - - def process([nil, function, [context: _, imports: [], aliases: _]]) do - look_for_kernel_functions(function) - end - - def process([nil, function, [context: _, imports: imports, aliases: _ ]]) do - module = Enum.filter(imports, &ModuleInfo.has_function?(&1, function)) - |> List.first - - case module do - nil -> look_for_kernel_functions(function) - _ -> source(module) - end - end - - def process([module, _function, [context: _, imports: _, aliases: aliases]]) do - if elixir_module?(module) do - module - |> Module.split - |> ModuleInfo.expand_alias(aliases) - else - module - end |> source - end - - defp elixir_module?(module) do - module == Module.concat(Elixir, module) - end - - defp look_for_kernel_functions(function) do - cond do - ModuleInfo.docs?(Kernel, function) -> - source(Kernel) - ModuleInfo.docs?(Kernel.SpecialForms, function) -> - source(Kernel.SpecialForms) - true -> "" - end - end - - defp source([]), do: nil - defp source(module) when is_list(module) do - module - |> Module.concat - |> do_source - end - defp source(module), do: do_source(module) - - defp do_source(module) do - if Code.ensure_loaded? module do - case module.module_info(:compile)[:source] do - nil -> nil - source -> List.to_string(source) - end - end - end - - defp normalize(request) do - {{expr, context_info}, _} = Code.eval_string(request) - [module, function] = String.split(expr, ",", parts: 2) - {module, _} = Code.eval_string(module) - function = String.to_atom function - [module, function, context_info] - end -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/docl.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/docl.exs deleted file mode 100644 index 5467030..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/docl.exs +++ /dev/null @@ -1,78 +0,0 @@ -Code.require_file "../helpers/module_info.exs", __DIR__ - -defmodule Alchemist.API.Docl do - - @moduledoc false - - import IEx.Helpers, warn: false - - alias Alchemist.Helpers.ModuleInfo - - def request(args) do - Application.put_env(:iex, :colors, [enabled: true]) - - args - |> normalize - |> process - - IO.puts "END-OF-DOCL" - end - - def process([expr, modules, aliases]) do - search(expr, modules, aliases) - end - - def search(nil), do: true - def search(expr) do - try do - Code.eval_string("h(#{expr})", [], __ENV__) - rescue - _e -> nil - end - end - - def search(expr, modules, []) do - expr = to_string expr - unless function?(expr) do - search(expr) - else - search_with_context(modules, expr) - end - end - - def search(expr, modules, aliases) do - unless function?(expr) do - String.split(expr, ".") - |> ModuleInfo.expand_alias(aliases) - |> search - else - search_with_context(modules, expr) - end - end - - defp search_with_context(modules, expr) do - modules ++ [Kernel, Kernel.SpecialForms] - |> build_search(expr) - |> search - end - - defp build_search(modules, search) do - function = Regex.replace(~r/\/[0-9]$/, search, "") - function = String.to_atom(function) - for module <- modules, - ModuleInfo.docs?(module, function) do - "#{module}.#{search}" - end |> List.first - end - - defp function?(expr) do - Regex.match?(~r/^[a-z_]/, expr) - end - - defp normalize(request) do - {{expr, [ context: _, - imports: imports, - aliases: aliases]}, _} = Code.eval_string(request) - [expr, imports, aliases] - end -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/eval.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/eval.exs deleted file mode 100644 index 9269be1..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/eval.exs +++ /dev/null @@ -1,63 +0,0 @@ -defmodule Alchemist.API.Eval do - - @moduledoc false - - def request(args) do - args - |> normalize - |> process - - IO.puts "END-OF-EVAL" - end - - def process({:eval, file}) do - try do - File.read!("#{file}") - |> Code.eval_string - |> Tuple.to_list - |> List.first - |> IO.inspect - rescue - e -> IO.inspect e - end - end - - def process({:quote, file}) do - try do - File.read!("#{file}") - |> Code.string_to_quoted - |> Tuple.to_list - |> List.last - |> IO.inspect - rescue - e -> IO.inspect e - end - end - - def process({:expand, file}) do - try do - {_, expr} = File.read!("#{file}") - |> Code.string_to_quoted - res = Macro.expand(expr, __ENV__) - IO.puts Macro.to_string(res) - rescue - e -> IO.inspect e - end - end - - def process({:expand_once, file}) do - try do - {_, expr} = File.read!("#{file}") - |> Code.string_to_quoted - res = Macro.expand_once(expr, __ENV__) - IO.puts Macro.to_string(res) - rescue - e -> IO.inspect e - end - end - - def normalize(request) do - {expr , _} = Code.eval_string(request) - expr - end -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/info.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/info.exs deleted file mode 100644 index 13d7c2c..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/api/info.exs +++ /dev/null @@ -1,86 +0,0 @@ -Code.require_file "../helpers/module_info.exs", __DIR__ -Code.require_file "../helpers/complete.exs", __DIR__ - -defmodule Alchemist.API.Info do - - @moduledoc false - - import IEx.Helpers, warn: false - - alias Alchemist.Helpers.ModuleInfo - alias Alchemist.Helpers.Complete - - def request(args) do - args - |> normalize - |> process - end - - def process(:modules) do - modules = ModuleInfo.all_applications_modules - |> Enum.uniq - |> Enum.reject(&is_nil/1) - |> Enum.filter(&ModuleInfo.moduledoc?/1) - - functions = Complete.run('') - - modules ++ functions - |> Enum.uniq - |> Enum.map(&IO.puts/1) - - IO.puts "END-OF-INFO" - end - - def process(:mixtasks) do - # append things like hex or phoenix archives to the load_path - Mix.Local.append_archives - - :code.get_path - |> Mix.Task.load_tasks - |> Enum.map(&Mix.Task.task_name/1) - |> Enum.sort - |> Enum.map(&IO.puts/1) - - IO.puts "END-OF-INFO" - end - - def process({:info, arg}) do - try do - Code.eval_string("i(#{arg})", [], __ENV__) - rescue - _e -> nil - end - - IO.puts "END-OF-INFO" - end - - def process({:types, arg}) do - try do - Code.eval_string("t(#{arg})", [], __ENV__) - rescue - _e -> nil - end - - IO.puts "END-OF-INFO" - end - - def process(nil) do - IO.puts "END-OF-INFO" - end - - def normalize(request) do - try do - Code.eval_string(request) - rescue - _e -> nil - else - {{_, type }, _} -> type - {{_, type, arg}, _} -> - if Version.match?(System.version, ">=1.2.0-rc") do - {type, arg} - else - nil - end - end - end -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/helpers/complete.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/helpers/complete.exs deleted file mode 100644 index 3ca1586..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/helpers/complete.exs +++ /dev/null @@ -1,351 +0,0 @@ -Code.require_file "module_info.exs", __DIR__ - -defmodule Alchemist.Helpers.Complete do - - alias Alchemist.Helpers.ModuleInfo - - @moduledoc """ - This Alchemist.Completer holds a codebase copy of the - IEx.Autocomplete because for the use of context specific - aliases. - - With the release of Elixir v1.1 the IEx.Autocomplete will - look for aliases in a certain environment variable - `Application.get_env(:iex, :autocomplete_server)` and until - then we'll use our own autocomplete codebase. - """ - - def run(exp) do - code = case is_bitstring(exp) do - true -> exp |> String.to_char_list - _ -> exp - end - - {status, result, list } = expand(code |> Enum.reverse) - - case { status, result, list } do - { :no, _, _ } -> '' - { :yes, [], _ } -> List.insert_at(list, 0, exp) - { :yes, _, _ } -> run(code ++ result) - end - end - - def run(hint, modules) do - for module <- modules do - ModuleInfo.get_functions(module, hint) - end |> List.flatten - end - - def expand('') do - expand_import("") - end - - def expand([h|t]=expr) do - cond do - h === ?. and t != []-> - expand_dot(reduce(t)) - h === ?: -> - expand_erlang_modules() - identifier?(h) -> - expand_expr(reduce(expr)) - (h == ?/) and t != [] and identifier?(hd(t)) -> - expand_expr(reduce(t)) - h in '([{' -> - expand('') - true -> - no() - end - end - - defp identifier?(h) do - (h in ?a..?z) or (h in ?A..?Z) or (h in ?0..?9) or h in [?_, ??, ?!] - end - - defp expand_dot(expr) do - case Code.string_to_quoted expr do - {:ok, atom} when is_atom(atom) -> - expand_call(atom, "") - {:ok, {:__aliases__, _, list}} -> - expand_elixir_modules(list, "") - _ -> - no() - end - end - - defp expand_expr(expr) do - case Code.string_to_quoted expr do - {:ok, atom} when is_atom(atom) -> - expand_erlang_modules(Atom.to_string(atom)) - {:ok, {atom, _, nil}} when is_atom(atom) -> - expand_import(Atom.to_string(atom)) - {:ok, {:__aliases__, _, [root]}} -> - expand_elixir_modules([], Atom.to_string(root)) - {:ok, {:__aliases__, _, [h|_] = list}} when is_atom(h) -> - hint = Atom.to_string(List.last(list)) - list = Enum.take(list, length(list) - 1) - expand_elixir_modules(list, hint) - {:ok, {{:., _, [mod, fun]}, _, []}} when is_atom(fun) -> - expand_call(mod, Atom.to_string(fun)) - _ -> - no() - end - end - - defp reduce(expr) do - Enum.reverse Enum.reduce ' ([{', expr, fn token, acc -> - hd(:string.tokens(acc, [token])) - end - end - - defp yes(hint, entries) do - {:yes, String.to_char_list(hint), Enum.map(entries, &String.to_char_list/1)} - end - - defp no do - {:no, '', []} - end - - ## Formatting - - defp format_expansion([], _) do - no() - end - - defp format_expansion([uniq], hint) do - case to_hint(uniq, hint) do - "" -> yes("", to_uniq_entries(uniq)) - hint -> yes(hint, []) - end - end - - defp format_expansion([first|_]=entries, hint) do - binary = Enum.map(entries, &(&1.name)) - length = byte_size(hint) - prefix = :binary.longest_common_prefix(binary) - if prefix in [0, length] do - yes("", Enum.flat_map(entries, &to_entries/1)) - else - yes(:binary.part(first.name, prefix, length-prefix), []) - end - end - - ## Expand calls - - # :atom.fun - defp expand_call(mod, hint) when is_atom(mod) do - expand_require(mod, hint) - end - - # Elixir.fun - defp expand_call({:__aliases__, _, list}, hint) do - expand_alias(list) - |> normalize_module - |> expand_require(hint) - end - - defp expand_call(_, _) do - no() - end - - defp expand_require(mod, hint) do - format_expansion match_module_funs(mod, hint), hint - end - - defp expand_import(hint) do - funs = match_module_funs(IEx.Helpers, hint) ++ - match_module_funs(Kernel, hint) ++ - match_module_funs(Kernel.SpecialForms, hint) - format_expansion funs, hint - end - - ## Erlang modules - - defp expand_erlang_modules(hint \\ "") do - format_expansion match_erlang_modules(hint), hint - end - - defp match_erlang_modules(hint) do - for mod <- match_modules(hint, true) do - %{kind: :module, name: mod, type: :erlang} - end - end - - ## Elixir modules - - defp expand_elixir_modules([], hint) do - expand_elixir_modules(Elixir, hint, match_aliases(hint)) - end - - defp expand_elixir_modules(list, hint) do - expand_alias(list) - |> normalize_module - |> expand_elixir_modules(hint, []) - end - - defp expand_elixir_modules(mod, hint, aliases) do - aliases - |> Kernel.++(match_elixir_modules(mod, hint)) - |> Kernel.++(match_module_funs(mod, hint)) - |> format_expansion(hint) - end - - defp expand_alias([name | rest] = list) do - module = Module.concat(Elixir, name) - Enum.find_value env_aliases(), list, fn {alias, mod} -> - if alias === module do - case Atom.to_string(mod) do - "Elixir." <> mod -> - Module.concat [mod|rest] - _ -> - mod - end - end - end - end - - defp env_aliases() do - Application.get_env(:"alchemist.el", :aliases) - |> format_aliases - end - - defp format_aliases(nil), do: [] - defp format_aliases(list), do: list - - defp match_aliases(hint) do - for {alias, _mod} <- env_aliases(), - [name] = Module.split(alias), - starts_with?(name, hint) do - %{kind: :module, type: :alias, name: name} - end - end - - defp match_elixir_modules(module, hint) do - name = Atom.to_string(module) - depth = length(String.split(name, ".")) + 1 - base = name <> "." <> hint - - for mod <- match_modules(base, module === Elixir), - parts = String.split(mod, "."), - depth <= length(parts) do - %{kind: :module, type: :elixir, name: Enum.at(parts, depth-1)} - end - |> Enum.uniq - end - - ## Helpers - - defp normalize_module(mod) do - if is_list(mod) do - Module.concat(mod) - else - mod - end - end - - defp match_modules(hint, root) do - get_modules(root) - |> :lists.usort() - |> Enum.drop_while(& not starts_with?(&1, hint)) - |> Enum.take_while(& starts_with?(&1, hint)) - end - - defp get_modules(true) do - ["Elixir.Elixir"] ++ get_modules(false) - end - - defp get_modules(false) do - modules = Enum.map(:code.all_loaded(), &Atom.to_string(elem(&1, 0))) - case :code.get_mode() do - :interactive -> modules ++ get_modules_from_applications() - _otherwise -> modules - end - end - - defp get_modules_from_applications do - for [app] <- loaded_applications(), - {:ok, modules} = :application.get_key(app, :modules), - module <- modules do - Atom.to_string(module) - end - end - - defp loaded_applications do - # If we invoke :application.loaded_applications/0, - # it can error if we don't call safe_fixtable before. - # Since in both cases we are reaching over the - # application controller internals, we choose to match - # for performance. - :ets.match(:ac_tab, {{:loaded, :"$1"}, :_}) - end - - defp match_module_funs(mod, hint) do - case ensure_loaded(mod) do - {:module, _} -> - falist = get_module_funs(mod) - - list = Enum.reduce falist, [], fn {f, a}, acc -> - case :lists.keyfind(f, 1, acc) do - {f, aa} -> :lists.keyreplace(f, 1, acc, {f, [a|aa]}) - false -> [{f, [a]}|acc] - end - end - - for {fun, arities} <- list, - name = Atom.to_string(fun), - starts_with?(name, hint) do - %{kind: :function, name: name, arities: arities} - end |> :lists.sort() - - _otherwise -> [] - end - end - - defp get_module_funs(mod) do - if function_exported?(mod, :__info__, 1) do - if docs = Code.get_docs(mod, :docs) do - for {tuple, _line, _kind, _sign, doc} <- docs, doc != false, do: tuple - else - mod.__info__(:macros) ++ (mod.__info__(:functions) -- [__info__: 1]) - end - else - mod.module_info(:exports) - end - end - - defp ensure_loaded(Elixir), do: {:error, :nofile} - defp ensure_loaded(mod), do: Code.ensure_compiled(mod) - - defp starts_with?(_string, ""), do: true - defp starts_with?(string, hint), do: String.starts_with?(string, hint) - - ## Ad-hoc conversions - - defp to_entries(%{kind: :module, name: name}) do - [name] - end - - defp to_entries(%{kind: :function, name: name, arities: arities}) do - for a <- :lists.sort(arities), do: "#{name}/#{a}" - end - - defp to_uniq_entries(%{kind: :module}) do - [] - end - - defp to_uniq_entries(%{kind: :function} = fun) do - to_entries(fun) - end - - defp to_hint(%{kind: :module, name: name}, hint) do - format_hint(name, hint) <> "." - end - - defp to_hint(%{kind: :function, name: name}, hint) do - format_hint(name, hint) - end - - defp format_hint(name, hint) do - hint_size = byte_size(hint) - :binary.part(name, hint_size, byte_size(name) - hint_size) - end -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/helpers/module_info.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/helpers/module_info.exs deleted file mode 100644 index c8de52e..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/helpers/module_info.exs +++ /dev/null @@ -1,117 +0,0 @@ -defmodule Alchemist.Helpers.ModuleInfo do - - @moduledoc false - - def moduledoc?(module) do - case Code.get_docs module, :moduledoc do - {_, doc} -> is_binary doc - _ -> false - end - end - - def docs?(module, function) do - docs = Code.get_docs module, :docs - do_docs?(docs, function) - end - - def expand_alias([name | rest] = list, aliases) do - module = Module.concat(Elixir, name) - Enum.find_value(aliases, list, fn {alias, mod} -> - if alias === module do - case Atom.to_string(mod) do - "Elixir." <> mod -> - Module.concat [mod|rest] - _ -> - mod - end - end - end) |> normalize_module - end - - def get_functions(module, hint) do - hint = to_string hint - {module, _} = Code.eval_string(module) - functions = get_module_funs(module) - - list = Enum.reduce functions, [], fn({f, a}, acc) -> - case :lists.keyfind(f, 1, acc) do - {f, aa} -> :lists.keyreplace(f, 1, acc, {f, [a|aa]}) - false -> [{f, [a]}|acc] - end - end - - do_get_functions(list, hint) |> :lists.sort() - end - - def has_function?(module, function) do - List.keymember? get_module_funs(module), function, 0 - end - - defp do_get_functions(list, "") do - all_functions(list) - end - - defp do_get_functions(list, hint) do - all_functions(list, hint) - end - - defp get_module_funs(module) do - case Code.ensure_loaded(module) do - {:module, _} -> - module.module_info(:functions) ++ module.__info__(:macros) - _otherwise -> - [] - end - end - - defp all_functions(list) do - for {fun, arities} <- list, name = Atom.to_string(fun) do - "#{name}/#{List.first(arities)}" - end - end - - defp all_functions(list, hint) do - for {fun, arities} <- list, - name = Atom.to_string(fun), - String.starts_with?(name, hint) do - "#{name}/#{List.first(arities)}" - end - end - - def all_applications_modules do - for [app] <- loaded_applications(), - {:ok, modules} = :application.get_key(app, :modules), - module <- modules do - module - end - end - - defp do_docs?([head|tail], function) do - {{func, _}, _, _, _, doc} = head - if func == function and is_binary(doc) do - true - else - do_docs?(tail, function) - end - end - defp do_docs?([], _function), do: false - defp do_docs?(nil, _function), do: false - - defp loaded_applications do - # If we invoke :application.loaded_applications/0, - # it can error if we don't call safe_fixtable before. - # Since in both cases we are reaching over the - # application controller internals, we choose to match - # for performance. - :ets.match(:ac_tab, {{:loaded, :"$1"}, :_}) - end - - defp normalize_module(mod) do - if is_list(mod) do - Module.concat(mod) - else - mod - end - end - -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/server.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/server.exs deleted file mode 100644 index 09ae6de..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/lib/server.exs +++ /dev/null @@ -1,93 +0,0 @@ -Code.require_file "api/comp.exs", __DIR__ -Code.require_file "api/docl.exs", __DIR__ -Code.require_file "api/defl.exs", __DIR__ -Code.require_file "api/eval.exs", __DIR__ -Code.require_file "api/info.exs", __DIR__ - -defmodule Alchemist.Server do - - @version "0.1.0-beta" - - @moduledoc """ - The Alchemist-Server operates as an informant for a specific desired - Elixir Mix project and serves with informations as the following: - - * Completion for Modules and functions. - * Documentation lookup for Modules and functions. - * Code evaluation and quoted representation of code. - * Definition lookup of code. - * Listing of all available Mix tasks. - * Listing of all available Modules with documentation. - """ - - alias Alchemist.API - - def start([env]) do - loop(all_loaded(), env) - end - - def loop(loaded, env) do - line = IO.gets("") |> String.rstrip() - paths = load_paths(env) - apps = load_apps(env) - - read_input(line) - - purge_modules(loaded) - purge_paths(paths) - purge_apps(apps) - - loop(loaded, env) - end - - def read_input(line) do - case line |> String.split(" ", parts: 2) do - ["COMP", args] -> - API.Comp.request(args) - ["DOCL", args] -> - API.Docl.request(args) - ["INFO", args] -> - API.Info.request(args) - ["EVAL", args] -> - API.Eval.request(args) - ["DEFL", args] -> - API.Defl.request(args) - _ -> - nil - end - end - - defp all_loaded() do - for {m,_} <- :code.all_loaded, do: m - end - - defp load_paths(env) do - for path <- Path.wildcard("_build/#{env}/lib/*/ebin") do - Code.prepend_path(path) - path - end - end - - defp load_apps(env) do - for path <- Path.wildcard("_build/#{env}/lib/*/ebin/*.app") do - app = path |> Path.basename() |> Path.rootname() |> String.to_atom - Application.load(app) - app - end - end - - defp purge_modules(loaded) do - for m <- (all_loaded() -- loaded) do - :code.delete(m) - :code.purge(m) - end - end - - defp purge_paths(paths) do - for p <- paths, do: Code.delete_path(p) - end - - defp purge_apps(apps) do - for a <- apps, do: Application.unload(a) - end -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/run.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/run.exs deleted file mode 100644 index 4616198..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/run.exs +++ /dev/null @@ -1,3 +0,0 @@ -Code.require_file "lib/server.exs", __DIR__ - -Alchemist.Server.start([System.argv]) diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api/comp_test.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api/comp_test.exs deleted file mode 100644 index e9d0c8a..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api/comp_test.exs +++ /dev/null @@ -1,57 +0,0 @@ -Code.require_file "../test_helper.exs", __DIR__ -Code.require_file "../../lib/api/comp.exs", __DIR__ - -defmodule Alchemist.API.CompTest do - - use ExUnit.Case, async: true - import ExUnit.CaptureIO - - alias Alchemist.API.Comp - - test "COMP request with empty hint" do - assert capture_io(fn -> - Comp.process([nil, Elixir, [], [] ]) - end) =~ """ - import/2 - quote/2 - require/2 - END-OF-COMP - """ - end - - test "COMP request without empty hint" do - assert capture_io(fn -> - Comp.process(['is_b', Elixir, [], []]) - end) =~ """ - is_b - is_binary/1 - is_bitstring/1 - is_boolean/1 - END-OF-COMP - """ - end - - test "COMP request with an alias" do - assert capture_io(fn -> - Comp.process(['MyList.flat', Elixir, [], [{MyList, List}]]) - end) =~ """ - MyList.flatten - flatten/1 - flatten/2 - END-OF-COMP - """ - end - - test "COMP request with a module hint" do - assert capture_io(fn -> - Comp.process(['Str', Elixir, [], []]) - end) =~ """ - Str - Stream - String - StringIO - END-OF-COMP - """ - end - -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api/defl_test.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api/defl_test.exs deleted file mode 100644 index d0ead2f..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api/defl_test.exs +++ /dev/null @@ -1,45 +0,0 @@ -Code.require_file "../test_helper.exs", __DIR__ -Code.require_file "../../lib/api/defl.exs", __DIR__ - -defmodule Alchemist.API.DeflTest do - - use ExUnit.Case - - alias Alchemist.API.Defl - - test "DEFL request call for defmodule" do - context = [context: Elixir, imports: [], aliases: []] - assert Defl.process([nil, :defmodule, context]) =~ "lib/elixir/lib/kernel.ex" - end - - test "DEFL request call for import" do - context = [context: Elixir, imports: [], aliases: []] - assert Defl.process([nil, :import, context]) =~ "lib/elixir/lib/kernel/special_forms.ex" - end - - test "DEFL request call for create_file with available import" do - context = [context: Elixir, imports: [Mix.Generator], aliases: []] - assert Defl.process([nil, :create_file, context]) =~ "lib/mix/lib/mix/generator.ex" - end - - test "DEFL request call for MyList.flatten with available aliases" do - context = [context: Elixir, imports: [], aliases: [{MyList, List}]] - assert Defl.process([MyList, :flatten, context]) =~ "lib/elixir/lib/list.ex" - end - - test "DEFL request call for String module" do - context = [context: Elixir, imports: [], aliases: []] - assert Defl.process([String, nil, context]) =~ "lib/elixir/lib/string.ex" - end - - test "DEFL request call for erlang module" do - context = [ context: Elixir, imports: [], aliases: [] ] - assert Defl.process([:lists, :duplicate, context]) =~ "lib/stdlib/src/lists.erl" - end - - test "DEFL request call for none existing module" do - context = [ context: Elixir, imports: [], aliases: [] ] - assert Defl.process([Rock, :duplicate, context]) == nil - end - -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api/docl_test.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api/docl_test.exs deleted file mode 100644 index fc1eaa5..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api/docl_test.exs +++ /dev/null @@ -1,73 +0,0 @@ -Code.require_file "../test_helper.exs", __DIR__ -Code.require_file "../../lib/api/comp.exs", __DIR__ -Code.require_file "../../lib/api/docl.exs", __DIR__ - -defmodule Alchemist.API.DoclTest do - - use ExUnit.Case, async: true - import ExUnit.CaptureIO - - alias Alchemist.API.Docl - - test "DOCL request" do - assert capture_io(fn -> - Docl.process(['defmodule', [], []]) - end) =~ """ - Defines a module given by name with the given contents. - """ - end - - test "DOCL request for List.flatten" do - assert capture_io(fn -> - Docl.process(["List.flatten", [], []]) - end) =~ """ - Flattens the given \e[36mlist\e[0m of nested lists. - \e[0m - \e[33mExamples\e[0m - \e[0m - \e[36m\e[1m┃ iex> List.flatten([1, [[2], 3]]) - """ - end - - test "DOCL request for MyCustomList.flatten with alias" do - assert capture_io(fn -> - Docl.process(["MyCustomList.flatten", [], [{MyCustomList, List}]]) - end) =~ """ - Flattens the given \e[36mlist\e[0m of nested lists. - \e[0m - \e[33mExamples\e[0m - \e[0m - \e[36m\e[1m┃ iex> List.flatten([1, [[2], 3]]) - """ - end - - test "DOCL request for search create_file with import" do - assert capture_io(fn -> - Docl.process(["create_file", [Mix.Generator], []]) - end) =~ """ - def create_file(path, contents, opts \\\\ []) \e[0m - \e[0m - Creates a file with the given contents. If the file already exists, asks for - user confirmation. - \e[0m - """ - end - - test "DOCL request for defmacro" do - assert capture_io(fn -> - Docl.process(["defmacro", [], []]) - end) =~ """ - \e[7m\e[33m defmacro defmacro(call, expr \\\\ nil) \e[0m - """ - end - - test "DOCL request for Path.basename/1" do - assert capture_io(fn -> - Docl.process(["Path.basename/1", [], []]) - end) =~ """ - Returns the last component of the path or the path itself if it does not - contain any directory separators. - """ - end - -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api_test.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api_test.exs deleted file mode 100644 index 7928920..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/api_test.exs +++ /dev/null @@ -1,19 +0,0 @@ -Code.require_file "test_helper.exs", __DIR__ -Code.require_file "../lib/api/comp.exs", __DIR__ -Code.require_file "../lib/api/docl.exs", __DIR__ - -defmodule APITest do - use ExUnit.Case, async: true - import ExUnit.CaptureIO - - alias Alchemist.API - - test "DOCL request" do - assert capture_io(fn -> - API.Docl.process(['defmodule', [], []]) - end) =~ """ - Defines a module given by name with the given contents. - """ - end - -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/fixtures/.gitkeep b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/fixtures/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/helpers/complete_test.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/helpers/complete_test.exs deleted file mode 100644 index 1c10e12..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/helpers/complete_test.exs +++ /dev/null @@ -1,41 +0,0 @@ -Code.require_file "../test_helper.exs", __DIR__ -Code.require_file "../../lib/helpers/complete.exs", __DIR__ - -defmodule CompleteTest do - use ExUnit.Case, async: true - - import Alchemist.Helpers.Complete - - defmodule MyModule do - def say_hi, do: true - end - - test "return completion candidates for 'List'" do - assert run('List') == ['List.', 'Chars', 'first/1', 'last/1', 'to_atom/1', - 'to_existing_atom/1', 'to_float/1', 'to_string/1', 'to_tuple/1', - 'wrap/1', 'zip/1', 'delete/2', 'delete_at/2', 'duplicate/2', - 'keysort/2', 'flatten/1', 'flatten/2', 'to_integer/1', - 'to_integer/2', 'foldl/3', 'foldr/3', 'insert_at/3', 'keydelete/3', - 'keymember?/3', 'keytake/3', 'replace_at/3', 'update_at/3', - 'keyfind/4', 'keyreplace/4', 'keystore/4'] - end - - test "return completion candidates for 'Str'" do - assert run('Str') == ['Str', 'Stream', 'String', 'StringIO'] - end - - test "return completion candidates for 'List.del'" do - assert run('List.del') == ['List.delete', 'delete/2', 'delete_at/2'] - end - - test "return completion candidates for module with alias" do - Application.put_env(:"alchemist.el", :aliases, [{MyList, List}]) - - assert run('MyList.del') == ['MyList.delete', 'delete/2', 'delete_at/2'] - end - - test "return completion candidates for functions from import" do - imports = [MyModule] - assert run('say', imports) == ["say_hi/0"] - end -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/helpers/module_info_test.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/helpers/module_info_test.exs deleted file mode 100644 index 4bbf645..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/helpers/module_info_test.exs +++ /dev/null @@ -1,45 +0,0 @@ -Code.require_file "../test_helper.exs", __DIR__ -Code.require_file "../../lib/helpers/module_info.exs", __DIR__ - -defmodule Alchemist.Helpers.ModuleTest do - - use ExUnit.Case - - alias Alchemist.Helpers.ModuleInfo - - test "moduledoc? returns true" do - assert ModuleInfo.moduledoc?(List) == true - end - - test "moduledoc? returns false" do - assert ModuleInfo.moduledoc?(List.Chars.Atom) == false - end - - test "docs? returns true" do - assert ModuleInfo.docs?(List, :flatten) == true - assert ModuleInfo.docs?(Kernel, :def) == true - end - - test "docs? returns false" do - assert ModuleInfo.docs?(List, :dance) == false - assert ModuleInfo.docs?(nil, :dance) == false - end - - test "expand_alias return expanded module alias" do - aliases = [{MyList, List}, {MyGenServer, :gen_server}] - - assert ModuleInfo.expand_alias([MyList], aliases) == List - assert ModuleInfo.expand_alias([MyGenServer], aliases) == :gen_server - assert ModuleInfo.expand_alias([MyList], aliases) == List - end - - test "has_function? return true" do - assert ModuleInfo.has_function?(List, :flatten) == true - assert ModuleInfo.has_function?(List, :to_string) == true - end - - test "has_function? return false" do - assert ModuleInfo.has_function?(List, :split) == false - assert ModuleInfo.has_function?(List, :map) == false - end -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/server_test.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/server_test.exs deleted file mode 100644 index 0f09f76..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/server_test.exs +++ /dev/null @@ -1,126 +0,0 @@ -Code.require_file "test_helper.exs", __DIR__ -Code.require_file "../lib/server.exs", __DIR__ - -defmodule ServerTest do - use ExUnit.Case - import ExUnit.CaptureIO - - setup_all do - on_exit fn -> - {_status, files} = File.ls Path.expand("fixtures", __DIR__) - files |> Enum.each(fn(file) -> - unless file == ".gitkeep" do - File.rm Path.expand("fixtures/#{file}", __DIR__) - end - end) - end - end - - test "Expression completion" do - assert send_signal("COMP { 'def', [context: Elixir, imports: [], aliases: []]}") =~ """ - defoverridable/1 - """ - end - - test "Documentation lookup" do - assert send_signal("DOCL { 'List', [context: Elixir, imports: [], aliases: []]}") =~ """ - \e[0m\n\e[7m\e[33m List \e[0m\n\e[0m - """ - end - - test "Getting the definition source file information of code" do - assert send_signal("DEFL {\"List,delete\", [context: Elixir, imports: [], aliases: []]}") =~ "/lib/elixir/lib/list.ex" - end - - test "Evaluate the content of a file" do - filename = Path.expand("fixtures/eval_fixture.exs", __DIR__) - File.write(filename, "1+1") - assert send_signal("EVAL { :eval, '#{filename}' }") =~ "2" - end - - test "Evaluate and quote the content of a file" do - filename = Path.expand("fixtures/eval_and_quote_fixture.exs", __DIR__) - File.write(filename, "[4,2,1,3] |> Enum.sort") - assert send_signal("EVAL { :quote, '#{filename}' }") =~ """ - {{:., [line: 1], [{:__aliases__, [counter: 0, line: 1], [:Enum]}, :sort]},\n [line: 1], []}]} - """ - end - - test "Expand macro once" do - filename = Path.expand("fixtures/macro_expand_once_fixture.exs", __DIR__) - File.write(filename, "unless true, do: IO.puts \"this should never be printed\"") - assert send_signal("EVAL { :expand_once, '#{filename}' }") =~ """ - if(true) do - nil - else - IO.puts("this should never be printed") - end - """ - end - - test "Expand macro" do - filename = Path.expand("fixtures/macro_expand_fixture.exs", __DIR__) - File.write(filename, "unless true, do: IO.puts \"this should never be printed\"") - assert send_signal("EVAL { :expand, '#{filename}' }") =~ """ - case(true) do - x when x in [false, nil] -> - IO.puts("this should never be printed") - _ -> - nil - end - """ - end - - test "Get all available application modules" do - assert send_signal("INFO { :type, :modules }") =~ """ - Elixir.Logger - Elixir.Logger.Formatter - Elixir.Logger.Translator - """ - end - - test "Get all available mix tasks by name" do - assert send_signal("INFO { :type, :mixtasks }") =~ """ - app.start - archive - archive.build - archive.install - archive.uninstall - clean - cmd - compile - """ - end - - # The IEx.Helpers.t and IEx.Helpers.i are functionality which come with - # Elixir version 1.2.0 - if Version.match?(System.version, ">=1.2.0-rc") do - test "Get information from data type" do - assert send_signal("INFO { :type, :info, List}") =~ """ - Reference modules\e[0m\n\e[22m Module, Atom\e[0m\nEND-OF-INFO - """ - end - - test "Don't crash server if data type argument is faulty" do - assert send_signal("INFO { :type, :info, whatever}") =~ """ - END-OF-INFO - """ - end - - test "Prints the types for the given module or for the given function/arity pair" do - assert send_signal("INFO { :type, :types, 'Agent'}") =~ """ - @type agent() :: pid() | {atom(), node()} | name()\e[0m\n\e[22m@type state() :: term()\e[0m\nEND-OF-INFO - """ - - assert send_signal("INFO { :type, :types, 'Agent.on_start/0'}") =~ """ - @type on_start() :: {:ok, pid()} | {:error, {:already_started, pid()} | term()}\e[0m - """ - end - end - - defp send_signal(signal) do - capture_io(fn -> - Alchemist.Server.read_input(signal) - end) - end -end diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/test_helper.exs b/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/test_helper.exs deleted file mode 100644 index 869559e..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-server/test/test_helper.exs +++ /dev/null @@ -1 +0,0 @@ -ExUnit.start() diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-test-mode.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-test-mode.el deleted file mode 100644 index f9bd0fd..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-test-mode.el +++ /dev/null @@ -1,373 +0,0 @@ -;;; alchemist-test-mode.el --- Minor mode for Elixir test files. - -;; Copyright © 2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Minor mode for Elixir test files. - -;;; Code: - -(require 'dash) -(require 'alchemist-project) - -(defgroup alchemist-test-mode nil - "Minor mode for Elixir ExUnit files." - :prefix "alchemist-test-mode-" - :group 'alchemist) - -;; Variables - -(defcustom alchemist-test-mode-highlight-tests t - "Non-nil means that specific functions for testing will -be highlighted with more significant font faces." - :type 'boolean - :group 'alchemist-test-mode) - -(defcustom alchemist-test-display-compilation-output nil - "if Non-nil, compilation informations will be displayed -in the test report buffer." - :type 'boolean - :group 'alchemist-test-mode) - -(defcustom alchemist-test-status-modeline t - "if Non-nil, the face of local `mode-name' variable will change with test run status. - -For example, when `alchemist-mix-test' fails, the `mode-name' will be -formatted with the `alchemist-test--failed-face' face, to symbolize failing tests." - :type 'boolean - :group 'alchemist-test) - -(defcustom alchemist-test-ask-about-save t - "Non-nil means 'alchemist-test-excute` asks which buffers to save before running. -Otherwise, it saves all modified buffers without asking." - :type 'boolean - :group 'alchemist-test) - -(defvar alchemist-test--last-run-status "") - -(defconst alchemist-test-report-buffer-name "*alchemist test report*" - "Name of the test report buffer.") - -(defconst alchemist-test-report-process-name "alchemist-test-process" - "Name of the test report process.") - -(defconst alchemist-test--failing-files-regex - "\\( [0-9]+).+\n\s+\\)\\([-A-Za-z0-9./_]+:[0-9]+\\)$") -(defconst alchemist-test--stacktrace-files-regex - "\\( \\)\\([-A-Za-z0-9./_]+:[0-9]+\\).*") - -;; Faces - -(defface alchemist-test--test-file-and-location-face - '((t (:inherit font-lock-variable-name-face :weight bold))) - "Face for the file where the failed test are." - :group 'alchemist-test) - -(defface alchemist-test--stacktrace-file-and-location-face - '((t (:inherit font-lock-keyword-face :weight bold))) - "Face for the stacktrace files." - :group 'alchemist-test) - -(defface alchemist-test--success-face - '((t (:inherit font-lock-variable-name-face :bold t :background "darkgreen" :foreground "white"))) - "Face for successful compilation run." - :group 'alchemist-test) - -(defface alchemist-test--failed-face - '((t (:inherit font-lock-variable-name-face :bold t :background "red" :foreground "white"))) - "Face for failed compilation run." - :group 'alchemist-test) - -(defvar alchemist-test--mode-name-face 'mode-line) - -(defvar alchemist-test-at-point #'alchemist-mix-test-at-point) -(defvar alchemist-test-this-buffer #'alchemist-mix-test-this-buffer) -(defvar alchemist-test #'alchemist-mix-test) -(defvar alchemist-test-file #'alchemist-mix-test-file) -(defvar alchemist-test-jump-to-previous-test #'alchemist-test-mode-jump-to-previous-test) -(defvar alchemist-test-jump-to-next-test #'alchemist-test-mode-jump-to-next-test) -(defvar alchemist-test-list-tests #'alchemist-test-mode-list-tests) - -(defvar alchemist-test-report-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "q" #'quit-window) - (define-key map "t" #'toggle-truncate-lines) - (define-key map "r" #'alchemist-mix-rerun-last-test) - (define-key map (kbd "M-n") #'alchemist-test-next-result) - (define-key map (kbd "M-p") #'alchemist-test-previous-result) - (define-key map (kbd "M-N") #'alchemist-test-next-stacktrace-file) - (define-key map (kbd "M-P") #'alchemist-test-previous-stacktrace-file) - (define-key map (kbd "C-c C-k") #'alchemist-report-interrupt-current-process) - map)) - -(defvar alchemist-test-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-c , s") alchemist-test-at-point) - (define-key map (kbd "C-c , v") alchemist-test-this-buffer) - (define-key map (kbd "C-c , a") alchemist-test) - (define-key map (kbd "C-c , f") alchemist-test-file) - (define-key map (kbd "C-c , p") alchemist-test-jump-to-previous-test) - (define-key map (kbd "C-c , n") alchemist-test-jump-to-next-test) - (define-key map (kbd "C-c , l") alchemist-test-list-tests) - map) - "Keymap for `alchemist-test-mode'.") - -(defconst alchemist-test-mode--test-regex - (let ((whitespace-opt "[[:space:]]*") - (whitespace "[[:space:]]+")) - (concat "\\(^" whitespace-opt "test" whitespace "\\(?10:.+\\)" whitespace "do" whitespace-opt "$" - "\\|" - whitespace " [0-9]+) test .+\\)"))) - -;; Private functions - -(defun alchemist-test--set-modeline-color (status) - (setq alchemist-test--mode-name-face - (if (string-prefix-p "finished" status) - 'alchemist-test--success-face - 'alchemist-test--failed-face))) - -(defun alchemist-test--render-report (buffer) - (with-current-buffer buffer - (let ((inhibit-read-only t)) - (alchemist-test--render-files)))) - -(defun alchemist-test--render-files () - (alchemist-test--render-test-failing-files) - (alchemist-test--render-stacktrace-files)) - -(defun alchemist-test--render-test-failing-files () - (alchemist-test--render-file alchemist-test--failing-files-regex - 'alchemist-test--test-file-and-location-face)) - -(defun alchemist-test--render-stacktrace-files () - (alchemist-test--render-file alchemist-test--stacktrace-files-regex - 'alchemist-test--stacktrace-file-and-location-face)) - -(defun alchemist-test--render-file (regex face) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward regex nil t) - (let ((file (buffer-substring-no-properties (match-beginning 2) (match-end 2)))) - (goto-char (match-beginning 2)) - (replace-match "" nil nil nil 2) - (insert-text-button file - 'face face - 'file file - 'follow-link t - 'action #'alchemist-test--open-file - 'help-echo "visit the source location"))))) - -(defun alchemist-test--open-file (button) - (save-match-data - (string-match "\\([-A-Za-z0-9./_]+\\):\\([0-9]+\\)" (button-get button 'file)) - (let* ((file-with-line (button-get button 'file)) - (file (substring-no-properties file-with-line (match-beginning 1) (match-end 1))) - (line (string-to-number (substring-no-properties file-with-line (match-beginning 2) (match-end 2)))) - (file-path (if (file-exists-p file) - file - (expand-file-name (concat (alchemist-project-root) file))))) - (with-current-buffer (find-file-other-window file-path) - (goto-char (point-min)) - (forward-line (- line 1)))))) - -(defun alchemist-test--handle-exit (status buffer) - (when alchemist-test-status-modeline - (alchemist-test--set-modeline-color status)) - (with-current-buffer buffer - (let ((inhibit-read-only t)) - (alchemist-test--render-files)))) - -(defun alchemist-test-mode--buffer-contains-tests-p () - "Return nil if the current buffer contains no tests, non-nil if it does." - (alchemist-utils-occur-in-buffer-p (current-buffer) alchemist-test-mode--test-regex)) - -(defun alchemist-test-mode--tests-in-buffer () - "Return an alist of tests in this buffer. - -The keys in the list are the test names (e.g., the string passed to the test/2 -macro) while the values are the position at which the test matched." - (save-match-data - (save-excursion - (goto-char (point-min)) - (let ((tests '())) - (while (re-search-forward alchemist-test-mode--test-regex nil t) - (let* ((position (car (match-data))) - (matched-string (match-string 10))) - (set-text-properties 0 (length matched-string) nil matched-string) - (add-to-list 'tests (cons matched-string position) t))) - tests)))) - -(defun alchemist-test-mode--highlight-syntax () - (if alchemist-test-mode-highlight-tests - (font-lock-add-keywords nil - '(("^\s+\\(test\\)\s+" 1 - font-lock-variable-name-face t) - ("^\s+\\(assert[_a-z]*\\|refute[_a-z]*\\|flunk\\)\s+" 1 - font-lock-type-face t) - ("^\s+\\(assert[_a-z]*\\|refute[_a-z]*\\|flunk\\)\(" 1 - font-lock-type-face t))))) - -;; Public functions - -(define-derived-mode alchemist-test-report-mode fundamental-mode "Alchemist Test Report" - "Major mode for presenting Elixir test results. - -\\{alchemist-test-report-mode-map}" - (setq buffer-read-only t) - (setq-local truncate-lines t) - (setq-local electric-indent-chars nil)) - -(defun alchemist-test-save-buffers () - "Save some modified file-visiting buffers." - (save-some-buffers (not alchemist-test-ask-about-save) nil)) - -(defun alchemist-test-clean-compilation-output (output) - (if (not alchemist-test-display-compilation-output) - (with-temp-buffer - (insert output) - (delete-matching-lines "^Compiled .+" (point-min) (point-max)) - (delete-matching-lines "^Generated .+" (point-min) (point-max)) - (buffer-substring-no-properties (point-min) (point-max))) - output)) - -(defun alchemist-test-execute (command-list) - (message "Testing...") - (let* ((command (mapconcat 'concat (-flatten command-list) " "))) - (alchemist-test-save-buffers) - (alchemist-report-run command - alchemist-test-report-process-name - alchemist-test-report-buffer-name - 'alchemist-test-report-mode - #'alchemist-test--handle-exit))) - -(defun alchemist-test-initialize-modeline () - "Initialize the mode-line face." - (when alchemist-test-status-modeline - (setq mode-name - '(:eval (propertize "Elixir" 'face alchemist-test--mode-name-face))))) - -(defun alchemist-test-reset-modeline () - "Reset the current mode-line face to default." - (setq mode-name "Elixir")) - -(defun alchemist-test-mode-jump-to-next-test () - "Jump to the next ExUnit test. If there are no tests after the current -position, jump to the first test in the buffer. Do nothing if there are no tests -in this buffer." - (interactive) - (alchemist-utils-jump-to-next-matching-line alchemist-test-mode--test-regex 'back-to-indentation)) - -(defun alchemist-test-mode-jump-to-previous-test () - "Jump to the previous ExUnit test. If there are no tests before the current -position, jump to the last test in the buffer. Do nothing if there are no tests -in this buffer." - (interactive) - (alchemist-utils-jump-to-previous-matching-line alchemist-test-mode--test-regex 'back-to-indentation)) - -(defun alchemist-test-next-result () - "Jump to the next error in the test report. - -If there are no error after the current position, -jump to the first error in the test report. -Do nothing if there are no error in this test report." - (interactive) - (alchemist-utils-jump-to-next-matching-line alchemist-test--failing-files-regex - 'back-to-indentation)) - -(defun alchemist-test-previous-result () - "Jump to the previous error in the test report. - -If there are no error before the current position, -jump to the first error in the test report. -Do nothing if there are no error in this test report." - (interactive) - (alchemist-utils-jump-to-previous-matching-line alchemist-test--failing-files-regex - #'(lambda () - (forward-line 1) - (back-to-indentation)))) - -(defun alchemist-test-next-stacktrace-file () - "Jump to the next stacktrace file in the test report. - -If there are no stacktrace file after the current position, -jump to the first stacktrace file in the test report. -Do nothing if there are no stacktrace file in this test report." - (interactive) - (alchemist-utils-jump-to-next-matching-line alchemist-test--stacktrace-files-regex - 'back-to-indentation)) - -(defun alchemist-test-previous-stacktrace-file () - "Jump to the previous stacktrace file in the test report. - -If there are no stacktrace file before the current position, -jump to the first stacktrace file in the test report. -Do nothing if there are no stacktrace file in this test report." - (interactive) - (alchemist-utils-jump-to-previous-matching-line alchemist-test--stacktrace-files-regex - 'back-to-indentation)) - -(defun alchemist-test-mode-list-tests () - "List ExUnit tests (calls to the test/2 macro) in the current buffer and jump -to the selected one." - (interactive) - (let* ((tests (alchemist-test-mode--tests-in-buffer)) - (selected (completing-read "Test: " tests)) - (position (cdr (assoc selected tests)))) - (goto-char position) - (back-to-indentation))) - -(defun alchemist-test-toggle-test-report-display () - "Toggle between display or hidding `alchemist-test-report-buffer-name' buffer." - (interactive) - (let* ((buffer (get-buffer alchemist-test-report-buffer-name)) - (window (get-buffer-window buffer))) - (if buffer - (if window - (quit-window nil window) - (display-buffer buffer)) - (message "No Alchemist test report buffer exists.")))) - -;;;###autoload -(define-minor-mode alchemist-test-mode - "Minor mode for Elixir ExUnit files. - -The following commands are available: - -\\{alchemist-test-mode-map}" - :lighter "" - :keymap alchemist-test-mode-map - :group 'alchemist - (when alchemist-test-mode - (alchemist-test-mode--highlight-syntax))) - -;;;###autoload -(defun alchemist-test-enable-mode () - (if (alchemist-utils-test-file-p) - (alchemist-test-mode))) - -;;;###autoload -(dolist (hook '(alchemist-mode-hook)) - (add-hook hook 'alchemist-test-enable-mode)) - -(provide 'alchemist-test-mode) - -;;; alchemist-test-mode.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist-utils.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist-utils.el deleted file mode 100644 index 3c16bc5..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist-utils.el +++ /dev/null @@ -1,162 +0,0 @@ -;;; alchemist-utils.el --- Common utility functions that don't belong anywhere else -*- lexical-binding: t -*- - -;; Copyright © 2014-2015 Samuel Tonini - -;; Author: Samuel Tonini . - -;;; Commentary: - -;; Common utility functions that don't belong anywhere else - -;;; Code: - -(require 'cl-lib) -(require 'dash) - -(defface alchemist-utils--deprecated-face - '((t (:inherit font-lock-variable-name-face :bold t :foreground "red"))) - "Face for 'deprecated' word inside deprecated message." - :group 'alchemist) - -(defun alchemist-utils-deprecated-message (function new-function) - (message "'%s is %s in favor of '%s" - function (propertize "deprecated" - 'face 'alchemist-utils--deprecated-face) - new-function)) - -(defun alchemist-utils-build-command (command-list) - "Build the commands list for the runner." - (let* ((command-list (-flatten (if (stringp command-list) - (split-string command-list) - command-list))) - (command (-remove (lambda (e) (equal e "")) command-list))) - (mapconcat 'concat command " "))) - -(defun alchemist-utils-count-char-occurence (regexp str) - "Count occurrence of char with REGEXP inside STR." - (cl-loop with start = 0 - for count from 0 - while (string-match regexp str start) - do (setq start (match-end 0)) - finally return count)) - -(defun alchemist-utils-test-file-p () - "Return non-nil `current-buffer' holds an Elixir test file." - (string-match "_test\\.exs$" (or (buffer-file-name) ""))) - -(defun alchemist-utils-remove-dot-at-the-end (string) - "Remove dot character at the end of STRING." - (replace-regexp-in-string "\\.$" "" string)) - -(defun alchemist-utils-empty-string-p (string) - "Return non-nil if STRING is null, blank or whitespace only." - (or (null string) - (string= string "") - (if (string-match-p "^\s+$" string) t))) - -(defun alchemist-utils-prepare-aliases-for-elixir (aliases) - (let* ((aliases (-map (lambda (a) - (let ((module (alchemist-utils-remove-dot-at-the-end (car a))) - (alias (alchemist-utils-remove-dot-at-the-end (car (cdr a))))) - (if (not (or (alchemist-utils-empty-string-p alias) - (string= alias module))) - (format "{%s, %s}" - (if (alchemist-utils-empty-string-p alias) - module - alias) - module)))) aliases)) - (aliases (mapconcat #'identity aliases ","))) - (format "[%s]" aliases))) - -(defun alchemist-utils-prepare-modules-for-elixir (modules) - (let* ((modules (mapconcat #'identity modules ","))) - (format "[%s]" modules))) - -(defun alchemist-utils--snakecase-to-camelcase (str) - "Convert a snake_case string STR to a CamelCase string. - -This function is useful for converting file names like my_module to Elixir -module names (MyModule)." - (mapconcat 'capitalize (split-string str "_") "")) - -(defun alchemist-utils-add-ext-to-path-if-not-present (path ext) - "Add EXT to PATH if PATH doesn't already ends with EXT." - (if (string-suffix-p ext path) - path - (concat path ext))) - -(defun alchemist-utils-path-to-module-name (path) - "Convert PATH to its Elixir module name equivalent. - -For example, convert 'my_app/my_module.ex' to 'MyApp.MyModule'." - (let* ((path (file-name-sans-extension path)) - (path (split-string path "/")) - (path (-remove (lambda (str) (equal str "")) path))) - (mapconcat #'alchemist-utils--snakecase-to-camelcase path "."))) - -(defun alchemist-utils-add-trailing-slash (path) - "Add trailing slash to PATH if not already contain." - (if (not (string-match-p "/$" path)) - (format "%s/" path) - path)) - -(defun alchemist-utils-occur-in-buffer-p (buffer regex) - "Return non-nil if BUFFER contains at least one occurrence of REGEX." - (with-current-buffer buffer - (save-excursion - (save-match-data - (goto-char (point-min)) - (re-search-forward regex nil t))))) - -(defun alchemist-utils-jump-to-regex (regex before-fn after-fn search-fn reset-fn) - "Jump to REGEX using SEARCH-FN to search for it. -A common use case would be to use `re-search-forward' as the SEARCH-FN. -Call RESET-FN if the regex isn't found at the first try. BEFORE-FN is called -before performing the search while AFTER-FN after." - (when (alchemist-utils-occur-in-buffer-p (current-buffer) regex) - (save-match-data - (funcall before-fn) - (unless (funcall search-fn regex nil t) - (funcall reset-fn) - (funcall search-fn regex nil t)) - (funcall after-fn)))) - -(defun alchemist-utils-jump-to-next-matching-line (regex after-fn) - "Jump to the next line matching REGEX. -Call AFTER-FN after performing the search." - (alchemist-utils-jump-to-regex regex 'end-of-line after-fn 're-search-forward 'beginning-of-buffer)) - -(defun alchemist-utils-jump-to-previous-matching-line (regex after-fn) - "Jump to the previous line matching REGEX. - -Call AFTER-FN after performing the search." - (alchemist-utils-jump-to-regex regex 'beginning-of-line after-fn 're-search-backward 'end-of-buffer)) - -(defun alchemist-utils-elixir-version () - "Return the current Elixir version on the system." - (let* ((output (shell-command-to-string (format "%s --version" alchemist-execute-command))) - (output (split-string output "\n")) - (output (-remove (lambda (string) (alchemist-utils-empty-string-p string)) - output)) - (version (-last-item output)) - (version (replace-regexp-in-string "Elixir " "" version))) - version)) - -(provide 'alchemist-utils) - -;;; alchemist-utils.el ends here diff --git a/emacs.d/elpa/alchemist-20160111.2340/alchemist.el b/emacs.d/elpa/alchemist-20160111.2340/alchemist.el deleted file mode 100644 index 28342b8..0000000 --- a/emacs.d/elpa/alchemist-20160111.2340/alchemist.el +++ /dev/null @@ -1,282 +0,0 @@ -;;; alchemist.el --- Elixir tooling integration into Emacs - -;; Copyright © 2014-2015 Samuel Tonini -;; -;; Author: Samuel Tonini -;; Maintainer: Samuel Tonini -;; URL: http://www.github.com/tonini/alchemist.el -;; Version: 1.7.0 -;; Package-Requires: ((elixir-mode "2.2.5") (dash "2.11.0") (emacs "24.4") (company "0.8.0") (pkg-info "0.4")) -;; Keywords: languages, elixir, elixirc, mix, hex, alchemist - -;; This file is not part of GNU Emacs. - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: -;; -;; What Does Alchemist Do For You? -;; -;; Alchemist brings you all the Elixir tooling and power inside your Emacs editor. -;; -;; Alchemist comes with a bunch of features, which are: -;; -;; * Mix integration -;; * Compile & Execution of Elixir code -;; * Inline code evaluation -;; * Inline macro expanding -;; * Documentation lookup -;; * Definition lookup -;; * Powerful IEx integration -;; * Smart code completion -;; * Elixir project management -;; * Phoenix support - -;;; Code: - -;; Tell the byte compiler about autoloaded functions from packages -(declare-function pkg-info-version-info "pkg-info" (package)) - -(defgroup alchemist nil - "Elixir Tooling Integration Into Emacs." - :prefix "alchemist-" - :group 'applications - :link '(url-link :tag "Website" "http://www.alchemist-elixir.org") - :link '(url-link :tag "Github" "https://github.com/tonini/alchemist.el") - :link '(emacs-commentary-link :tag "Commentary" "alchemist")) - -(defvar alchemist-mode-keymap nil) - -(require 'easymenu) -(require 'company) -(require 'elixir-mode) -(require 'alchemist-utils) -(require 'alchemist-key) -(require 'alchemist-eval) -(require 'alchemist-goto) -(require 'alchemist-info) -(require 'alchemist-report) -(require 'alchemist-mix) -(require 'alchemist-hooks) -(require 'alchemist-message) -(require 'alchemist-iex) -(require 'alchemist-compile) -(require 'alchemist-refcard) -(require 'alchemist-complete) -(require 'alchemist-company) -(require 'alchemist-macroexpand) -(require 'alchemist-phoenix) - -(defun alchemist-mode-hook () - "Hook which enables `alchemist-mode'" - (alchemist-mode 1)) - -(defun alchemist-version (&optional show-version) - "Get the Alchemist version as string. - -If called interactively or if SHOW-VERSION is non-nil, show the -version in the echo area and the messages buffer. - -The returned string includes both, the version from package.el -and the library version, if both a present and different. - -If the version number could not be determined, signal an error, -if called interactively, or if SHOW-VERSION is non-nil, otherwise -just return nil." - (interactive (list t)) - (let ((version (pkg-info-version-info 'alchemist))) - (when show-version - (message "Alchemist version: %s" version)) - version)) - -(defun alchemist-elixir-version () - "Display the current Elixir version on the system." - (interactive) - (message "Elixir %s" (alchemist-utils-elixir-version))) - -(define-prefix-command 'alchemist-mode-keymap) - -;;;###autoload -(define-minor-mode alchemist-mode - "Toggle alchemist mode. - -Key bindings: -\\{alchemist-mode-map}" - nil - ;; The indicator for the mode line. - " alchemist" - :group 'alchemist - :global nil - :keymap `((,alchemist-key-command-prefix . alchemist-mode-keymap)) - (cond (alchemist-mode - (alchemist-server-start-if-not-running) - (alchemist-test-initialize-modeline)) - (t - (alchemist-test-reset-modeline)))) - -(let ((map alchemist-mode-keymap)) - (define-key map (kbd "x") 'alchemist-mix) - (define-key map (kbd "t") 'alchemist-mix-test) - (define-key map (kbd "r") 'alchemist-mix-rerun-last-test) - - (define-key map (kbd "m c") 'alchemist-mix-compile) - (define-key map (kbd "m r") 'alchemist-mix-run) - (define-key map (kbd "m t f") 'alchemist-mix-test-file) - (define-key map (kbd "m t b") 'alchemist-mix-test-this-buffer) - (define-key map (kbd "m t .") 'alchemist-mix-test-at-point) - - (define-key map (kbd "c c") 'alchemist-compile) - (define-key map (kbd "c f") 'alchemist-compile-file) - (define-key map (kbd "c b") 'alchemist-compile-this-buffer) - - (define-key map (kbd "e e") 'alchemist-execute) - (define-key map (kbd "e f") 'alchemist-execute-file) - (define-key map (kbd "e b") 'alchemist-execute-this-buffer) - - (define-key map (kbd "h h") 'alchemist-help) - (define-key map (kbd "h i") 'alchemist-help-history) - (define-key map (kbd "h e") 'alchemist-help-search-at-point) - (define-key map (kbd "h r") 'alchemist-refcard) - - (define-key map (kbd "p s") 'alchemist-project-toggle-file-and-tests) - (define-key map (kbd "p o") 'alchemist-project-toggle-file-and-tests-other-window) - (define-key map (kbd "p t") 'alchemist-project-run-tests-for-current-file) - (define-key map (kbd "p l") 'alchemist-project-find-lib) - (define-key map (kbd "p f") 'alchemist-project-find-test) - - (define-key map (kbd "i i") 'alchemist-iex-run) - (define-key map (kbd "i p") 'alchemist-iex-project-run) - (define-key map (kbd "i l") 'alchemist-iex-send-current-line) - (define-key map (kbd "i c") 'alchemist-iex-send-current-line-and-go) - (define-key map (kbd "i r") 'alchemist-iex-send-region) - (define-key map (kbd "i m") 'alchemist-iex-send-region-and-go) - (define-key map (kbd "i b") 'alchemist-iex-compile-this-buffer) - (define-key map (kbd "i R") 'alchemist-iex-reload-module) - - (define-key map (kbd "v l") 'alchemist-eval-current-line) - (define-key map (kbd "v k") 'alchemist-eval-print-current-line) - (define-key map (kbd "v j") 'alchemist-eval-quoted-current-line) - (define-key map (kbd "v h") 'alchemist-eval-print-quoted-current-line) - (define-key map (kbd "v o") 'alchemist-eval-region) - (define-key map (kbd "v i") 'alchemist-eval-print-region) - (define-key map (kbd "v u") 'alchemist-eval-quoted-region) - (define-key map (kbd "v y") 'alchemist-eval-print-quoted-region) - (define-key map (kbd "v q") 'alchemist-eval-buffer) - (define-key map (kbd "v w") 'alchemist-eval-print-buffer) - (define-key map (kbd "v e") 'alchemist-eval-quoted-buffer) - (define-key map (kbd "v r") 'alchemist-eval-print-quoted-buffer) - (define-key map (kbd "v !") 'alchemist-eval-close-popup) - - (define-key map (kbd "o l") 'alchemist-macroexpand-once-current-line) - (define-key map (kbd "o L") 'alchemist-macroexpand-once-print-current-line) - (define-key map (kbd "o k") 'alchemist-macroexpand-current-line) - (define-key map (kbd "o K") 'alchemist-macroexpand-print-current-line) - (define-key map (kbd "o i") 'alchemist-macroexpand-once-region) - (define-key map (kbd "o I") 'alchemist-macroexpand-once-print-region) - (define-key map (kbd "o r") 'alchemist-macroexpand-region) - (define-key map (kbd "o R") 'alchemist-macroexpand-print-region) - (define-key map (kbd "o !") 'alchemist-macroexpand-close-popup) - - (define-key map (kbd "n i") 'alchemist-info-datatype-at-point) - (define-key map (kbd "n t") 'alchemist-info-types-at-point)) - -(define-key alchemist-mode-map (kbd "M-.") 'alchemist-goto-definition-at-point) -(define-key alchemist-mode-map (kbd "M-,") 'alchemist-goto-jump-back) -(define-key alchemist-mode-map (kbd "C-c , .") 'alchemist-goto-list-symbol-definitions) -(define-key alchemist-mode-map (kbd "M-P") 'alchemist-goto-jump-to-previous-def-symbol) -(define-key alchemist-mode-map (kbd "M-N") 'alchemist-goto-jump-to-next-def-symbol) -(define-key alchemist-mode-map (kbd "C-c M-r") 'alchemist-test-toggle-test-report-display) - -(easy-menu-define alchemist-mode-menu alchemist-mode-map - "Alchemist mode menu." - '("Alchemist" - ("Goto" - ["Jump to definition at point" alchemist-goto-definition-at-point] - ["Jump back" alchemist-goto-jump-back]) - ("Evaluate" - ["Evaluate current line" alchemist-eval-current-line] - ["Evaluate current line and print" alchemist-eval-print-current-line] - ["Evaluate quoted current line" alchemist-eval-quoted-current-line] - ["Evaluate quoted current line and print" alchemist-eval-print-quoted-current-line] - "---" - ["Evaluate region" alchemist-eval-region] - ["Evaluate region and print" alchemist-eval-print-region] - ["Evaluate quoted region" alchemist-eval-quoted-region] - ["Evaluate quoted region and print" alchemist-eval-print-quoted-region] - "---" - ["Evaluate buffer" alchemist-eval-buffer] - ["Evaluate buffer and print" alchemist-eval-print-buffer] - ["Evaluate quoted buffer" alchemist-eval-quoted-buffer] - ["Evaluate quoted buffer and print" alchemist-eval-print-quoted-buffer]) - ("Macroexpand" - ["Macro expand once current line" alchemist-macroexpand-once-current-line] - ["Macro expand once current line and print" alchemist-macroexpand-print-current-line] - ["Macro expand current line" alchemist-macroexpand-current-line] - ["Macro expand current line and print" alchemist-macroexpand-print-current-line] - "---" - ["Macro expand once region" alchemist-macroexpand-once-region] - ["Macro expand once region and print" alchemist-macroexpand-print-region] - ["Macro expand region" alchemist-macroexpand-region] - ["Macro expand region and print" alchemist-macroexpand-print-region]) - ("Compile" - ["Compile..." alchemist-compile] - ["Compile this buffer" alchemist-compile-this-buffer] - ["Compile file" alchemist-compile-file]) - ("Execute" - ["Execute..." alchemist-compile] - ["Execute this buffer" alchemist-execute-this-buffer] - ["Execute file" alchemist-execute-file]) - ("Mix" - ["Mix compile..." alchemist-mix-compile] - ["Mix run..." alchemist-mix-run] - "---" - ["Mix test this buffer" alchemist-mix-test-this-buffer] - ["Mix test file..." alchemist-mix-test-file] - ["Mix test at point" alchemist-mix-test-at-point] - "---" - ["Mix..." alchemist-mix] - "---" - ["Display mix buffer" alchemist-mix-display-mix-buffer] - "---" - ["Mix help..." alchemist-mix-help]) - ("IEx" - ["IEx send current line" alchemist-iex-send-current-line] - ["IEx send current line and go" alchemist-iex-send-current-line-and-go] - "---" - ["IEx send last region" alchemist-iex-send-last-sexp] - ["IEx send region" alchemist-iex-send-region] - ["IEx send region and go" alchemist-iex-send-region-and-go] - "---" - ["IEx compile this buffer" alchemist-iex-compile-this-buffer] - ["IEx recompile this buffer" alchemist-iex-recompile-this-buffer] - "---" - ["IEx run" alchemist-iex-run]) - ("Project" - ["Project list all files inside test directory" alchemist-project-find-test] - ["Project list all files inside lib directory" alchemist-project-find-lib] - ["Project toggle between file and test" alchemist-project-toggle-file-and-tests] - ["Project toggle between file and test in other window" alchemist-project-toggle-file-and-tests-other-window]) - ("Documentation" - ["Documentation search..." alchemist-help] - ["Documentation search history..." alchemist-help-history] - "---" - ["Documentation search at point..." alchemist-help-search-at-point]) - ("About" - ["Show Alchemist version" alchemist-version t]))) - -(add-hook 'elixir-mode-hook 'alchemist-mode-hook) - -(provide 'alchemist) - -;;; alchemist.el ends here diff --git a/emacs.d/elpa/async-20160108.1249/async-autoloads.el b/emacs.d/elpa/async-20160108.1249/async-autoloads.el deleted file mode 100644 index dd498c3..0000000 --- a/emacs.d/elpa/async-20160108.1249/async-autoloads.el +++ /dev/null @@ -1,129 +0,0 @@ -;;; async-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) - -;;;### (autoloads nil "async" "async.el" (22171 46585 0 0)) -;;; Generated autoloads from async.el - -(autoload 'async-start-process "async" "\ -Start the executable PROGRAM asynchronously. See `async-start'. -PROGRAM is passed PROGRAM-ARGS, calling FINISH-FUNC with the -process object when done. If FINISH-FUNC is nil, the future -object will return the process object when the program is -finished. Set DEFAULT-DIRECTORY to change PROGRAM's current -working directory. - -\(fn NAME PROGRAM FINISH-FUNC &rest PROGRAM-ARGS)" nil nil) - -(autoload 'async-start "async" "\ -Execute START-FUNC (often a lambda) in a subordinate Emacs process. -When done, the return value is passed to FINISH-FUNC. Example: - - (async-start - ;; What to do in the child process - (lambda () - (message \"This is a test\") - (sleep-for 3) - 222) - - ;; What to do when it finishes - (lambda (result) - (message \"Async process done, result should be 222: %s\" - result))) - -If FINISH-FUNC is nil or missing, a future is returned that can -be inspected using `async-get', blocking until the value is -ready. Example: - - (let ((proc (async-start - ;; What to do in the child process - (lambda () - (message \"This is a test\") - (sleep-for 3) - 222)))) - - (message \"I'm going to do some work here\") ;; .... - - (message \"Waiting on async process, result should be 222: %s\" - (async-get proc))) - -If you don't want to use a callback, and you don't care about any -return value form the child process, pass the `ignore' symbol as -the second argument (if you don't, and never call `async-get', it -will leave *emacs* process buffers hanging around): - - (async-start - (lambda () - (delete-file \"a remote file on a slow link\" nil)) - 'ignore) - -Note: Even when FINISH-FUNC is present, a future is still -returned except that it yields no value (since the value is -passed to FINISH-FUNC). Call `async-get' on such a future always -returns nil. It can still be useful, however, as an argument to -`async-ready' or `async-wait'. - -\(fn START-FUNC &optional FINISH-FUNC)" nil nil) - -;;;*** - -;;;### (autoloads nil "async-bytecomp" "async-bytecomp.el" (22171 -;;;;;; 46585 0 0)) -;;; Generated autoloads from async-bytecomp.el - -(autoload 'async-byte-recompile-directory "async-bytecomp" "\ -Compile all *.el files in DIRECTORY asynchronously. -All *.elc files are systematically deleted before proceeding. - -\(fn DIRECTORY &optional QUIET)" nil nil) - -(defvar async-bytecomp-package-mode nil "\ -Non-nil if Async-Bytecomp-Package mode is enabled. -See the command `async-bytecomp-package-mode' for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `async-bytecomp-package-mode'.") - -(custom-autoload 'async-bytecomp-package-mode "async-bytecomp" nil) - -(autoload 'async-bytecomp-package-mode "async-bytecomp" "\ -Byte compile asynchronously packages installed with package.el. -Async compilation of packages can be controlled by -`async-bytecomp-allowed-packages'. - -\(fn &optional ARG)" t nil) - -;;;*** - -;;;### (autoloads nil "dired-async" "dired-async.el" (22171 46585 -;;;;;; 0 0)) -;;; Generated autoloads from dired-async.el - -(defvar dired-async-mode nil "\ -Non-nil if Dired-Async mode is enabled. -See the command `dired-async-mode' for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `dired-async-mode'.") - -(custom-autoload 'dired-async-mode "dired-async" nil) - -(autoload 'dired-async-mode "dired-async" "\ -Do dired actions asynchronously. - -\(fn &optional ARG)" t nil) - -;;;*** - -;;;### (autoloads nil nil ("async-pkg.el" "smtpmail-async.el") (22171 -;;;;;; 46585 642069 0)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; async-autoloads.el ends here diff --git a/emacs.d/elpa/async-20160108.1249/async-bytecomp.el b/emacs.d/elpa/async-20160108.1249/async-bytecomp.el deleted file mode 100644 index 54313c0..0000000 --- a/emacs.d/elpa/async-20160108.1249/async-bytecomp.el +++ /dev/null @@ -1,177 +0,0 @@ -;;; async-bytecomp.el --- Async functions to compile elisp files async - -;; Copyright (C) 2014-2016 Free Software Foundation, Inc. - -;; Authors: John Wiegley -;; Thierry Volpiatto - -;; Keywords: dired async byte-compile -;; X-URL: https://github.com/jwiegley/dired-async - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2, or (at -;; your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Commentary: -;; -;; This package provide the `async-byte-recompile-directory' function -;; which allows, as the name says to recompile a directory outside of -;; your running emacs. -;; The benefit is your files will be compiled in a clean environment without -;; the old *.el files loaded. -;; Among other things, this fix a bug in package.el which recompile -;; the new files in the current environment with the old files loaded, creating -;; errors in most packages after upgrades. -;; -;; NB: This package is advicing the function `package--compile'. - -;;; Code: - -(require 'cl-lib) -(require 'async) - -(defcustom async-bytecomp-allowed-packages - '(async helm helm-core helm-ls-git helm-ls-hg magit) - "Packages in this list will be compiled asynchronously by `package--compile'. -All the dependencies of these packages will be compiled async too, -so no need to add dependencies to this list. -The value of this variable can also be a list with a single element, -the symbol `all', in this case packages are always compiled asynchronously." - :group 'async - :type '(repeat (choice symbol))) - -(defvar async-byte-compile-log-file "~/.emacs.d/async-bytecomp.log") - -;;;###autoload -(defun async-byte-recompile-directory (directory &optional quiet) - "Compile all *.el files in DIRECTORY asynchronously. -All *.elc files are systematically deleted before proceeding." - (cl-loop with dir = (directory-files directory t "\\.elc\\'") - unless dir return nil - for f in dir - when (file-exists-p f) do (delete-file f)) - ;; Ensure async is reloaded when async.elc is deleted. - ;; This happen when recompiling its own directory. - (load "async") - (let ((call-back - `(lambda (&optional ignore) - (if (file-exists-p async-byte-compile-log-file) - (let ((buf (get-buffer-create byte-compile-log-buffer)) - (n 0)) - (with-current-buffer buf - (goto-char (point-max)) - (let ((inhibit-read-only t)) - (insert-file-contents async-byte-compile-log-file) - (compilation-mode)) - (display-buffer buf) - (delete-file async-byte-compile-log-file) - (unless ,quiet - (save-excursion - (goto-char (point-min)) - (while (re-search-forward "^.*:Error:" nil t) - (cl-incf n))) - (if (> n 0) - (message "Failed to compile %d files in directory `%s'" n ,directory) - (message "Directory `%s' compiled asynchronously with warnings" ,directory))))) - (unless ,quiet - (message "Directory `%s' compiled asynchronously with success" ,directory)))))) - (async-start - `(lambda () - (require 'bytecomp) - ,(async-inject-variables "\\`\\(load-path\\)\\|byte\\'") - (let ((default-directory (file-name-as-directory ,directory)) - error-data) - (add-to-list 'load-path default-directory) - (byte-recompile-directory ,directory 0 t) - (when (get-buffer byte-compile-log-buffer) - (setq error-data (with-current-buffer byte-compile-log-buffer - (buffer-substring-no-properties (point-min) (point-max)))) - (unless (string= error-data "") - (with-temp-file ,async-byte-compile-log-file - (erase-buffer) - (insert error-data)))))) - call-back) - (unless quiet (message "Started compiling asynchronously directory %s" directory)))) - -(defvar package-archive-contents) -(defvar package-alist) -(declare-function package-desc-reqs "package.el" (cl-x)) - -(defun async-bytecomp--get-package-deps (pkg &optional only) - ;; Same as `package--get-deps' but parse instead `package-archive-contents' - ;; because PKG is not already installed and not present in `package-alist'. - ;; However fallback to `package-alist' in case PKG no more present - ;; in `package-archive-contents' due to modification to `package-archives'. - ;; See issue #58. - (let* ((pkg-desc (cadr (or (assq pkg package-archive-contents) - (assq pkg package-alist)))) - (direct-deps (cl-loop for p in (package-desc-reqs pkg-desc) - for name = (car p) - when (or (assq name package-archive-contents) - (assq name package-alist)) - collect name)) - (indirect-deps (unless (eq only 'direct) - (delete-dups - (cl-loop for p in direct-deps append - (async-bytecomp--get-package-deps p)))))) - (cl-case only - (direct direct-deps) - (separate (list direct-deps indirect-deps)) - (indirect indirect-deps) - (t (delete-dups (append direct-deps indirect-deps)))))) - -(defun async-bytecomp-get-allowed-pkgs () - (when (and async-bytecomp-allowed-packages - (listp async-bytecomp-allowed-packages)) - (if package-archive-contents - (cl-loop for p in async-bytecomp-allowed-packages - when (assq p package-archive-contents) - append (async-bytecomp--get-package-deps p) into reqs - finally return - (delete-dups - (append async-bytecomp-allowed-packages reqs))) - async-bytecomp-allowed-packages))) - -(defadvice package--compile (around byte-compile-async) - (let ((cur-package (package-desc-name pkg-desc)) - (pkg-dir (package-desc-dir pkg-desc))) - (if (or (equal async-bytecomp-allowed-packages '(all)) - (memq cur-package (async-bytecomp-get-allowed-pkgs))) - (progn - (when (eq cur-package 'async) - (fmakunbound 'async-byte-recompile-directory)) - ;; Add to `load-path' the latest version of async and - ;; reload it when reinstalling async. - (when (string= cur-package "async") - (cl-pushnew pkg-dir load-path) - (load "async-bytecomp")) - ;; `async-byte-recompile-directory' will add directory - ;; as needed to `load-path'. - (async-byte-recompile-directory (package-desc-dir pkg-desc) t)) - ad-do-it))) - -;;;###autoload -(define-minor-mode async-bytecomp-package-mode - "Byte compile asynchronously packages installed with package.el. -Async compilation of packages can be controlled by -`async-bytecomp-allowed-packages'." - :group 'async - :global t - (if async-bytecomp-package-mode - (ad-activate 'package--compile) - (ad-deactivate 'package--compile))) - -(provide 'async-bytecomp) - -;;; async-bytecomp.el ends here diff --git a/emacs.d/elpa/async-20160108.1249/async-pkg.el b/emacs.d/elpa/async-20160108.1249/async-pkg.el deleted file mode 100644 index b042040..0000000 --- a/emacs.d/elpa/async-20160108.1249/async-pkg.el +++ /dev/null @@ -1,6 +0,0 @@ -(define-package "async" "20160108.1249" "Asynchronous processing in Emacs" 'nil :keywords - '("async") - :url "http://elpa.gnu.org/packages/async.html") -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/emacs.d/elpa/async-20160108.1249/async.el b/emacs.d/elpa/async-20160108.1249/async.el deleted file mode 100644 index 24db2a1..0000000 --- a/emacs.d/elpa/async-20160108.1249/async.el +++ /dev/null @@ -1,303 +0,0 @@ -;;; async.el --- Asynchronous processing in Emacs - -;; Copyright (C) 2012-2016 Free Software Foundation, Inc. - -;; Author: John Wiegley -;; Created: 18 Jun 2012 -;; Version: 1.6 - -;; Keywords: async -;; X-URL: https://github.com/jwiegley/emacs-async - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2, or (at -;; your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Commentary: - -;; Adds the ability to call asynchronous functions and process with ease. See -;; the documentation for `async-start' and `async-start-process'. - -;;; Code: - -(defgroup async nil - "Simple asynchronous processing in Emacs" - :group 'emacs) - -(defvar async-debug nil) -(defvar async-send-over-pipe t) -(defvar async-in-child-emacs nil) -(defvar async-callback nil) -(defvar async-callback-for-process nil) -(defvar async-callback-value nil) -(defvar async-callback-value-set nil) -(defvar async-current-process nil) -(defvar async--procvar nil) - -(defun async-inject-variables - (include-regexp &optional predicate exclude-regexp) - "Return a `setq' form that replicates part of the calling environment. -It sets the value for every variable matching INCLUDE-REGEXP and -also PREDICATE. It will not perform injection for any variable -matching EXCLUDE-REGEXP (if present). It is intended to be used -as follows: - - (async-start - `(lambda () - (require 'smtpmail) - (with-temp-buffer - (insert ,(buffer-substring-no-properties (point-min) (point-max))) - ;; Pass in the variable environment for smtpmail - ,(async-inject-variables \"\\`\\(smtpmail\\|\\(user-\\)?mail\\)-\") - (smtpmail-send-it))) - 'ignore)" - `(setq - ,@(let (bindings) - (mapatoms - (lambda (sym) - (if (and (boundp sym) - (or (null include-regexp) - (string-match include-regexp (symbol-name sym))) - (not (string-match - (or exclude-regexp "-syntax-table\\'") - (symbol-name sym)))) - (let ((value (symbol-value sym))) - (when (or (null predicate) - (funcall predicate sym)) - (setq bindings (cons `(quote ,value) bindings) - bindings (cons sym bindings))))))) - bindings))) - -(defalias 'async-inject-environment 'async-inject-variables) - -(defun async-handle-result (func result buf) - (if (null func) - (progn - (set (make-local-variable 'async-callback-value) result) - (set (make-local-variable 'async-callback-value-set) t)) - (unwind-protect - (if (and (listp result) - (eq 'async-signal (nth 0 result))) - (signal (car (nth 1 result)) - (cdr (nth 1 result))) - (funcall func result)) - (unless async-debug - (kill-buffer buf))))) - -(defun async-when-done (proc &optional change) - "Process sentinal used to retrieve the value from the child process." - (when (eq 'exit (process-status proc)) - (with-current-buffer (process-buffer proc) - (let ((async-current-process proc)) - (if (= 0 (process-exit-status proc)) - (if async-callback-for-process - (if async-callback - (prog1 - (funcall async-callback proc) - (unless async-debug - (kill-buffer (current-buffer)))) - (set (make-local-variable 'async-callback-value) proc) - (set (make-local-variable 'async-callback-value-set) t)) - (goto-char (point-max)) - (backward-sexp) - (async-handle-result async-callback (read (current-buffer)) - (current-buffer))) - (set (make-local-variable 'async-callback-value) - (list 'error - (format "Async process '%s' failed with exit code %d" - (process-name proc) (process-exit-status proc)))) - (set (make-local-variable 'async-callback-value-set) t)))))) - -(defun async--receive-sexp (&optional stream) - (let ((sexp (decode-coding-string (base64-decode-string - (read stream)) 'utf-8-unix)) - ;; Parent expects UTF-8 encoded text. - (coding-system-for-write 'utf-8-unix)) - (if async-debug - (message "Received sexp {{{%s}}}" (pp-to-string sexp))) - (setq sexp (read sexp)) - (if async-debug - (message "Read sexp {{{%s}}}" (pp-to-string sexp))) - (eval sexp))) - -(defun async--insert-sexp (sexp) - (let (print-level - print-length - (print-escape-nonascii t) - (print-circle t)) - (prin1 sexp (current-buffer)) - ;; Just in case the string we're sending might contain EOF - (encode-coding-region (point-min) (point-max) 'utf-8-unix) - (base64-encode-region (point-min) (point-max) t) - (goto-char (point-min)) (insert ?\") - (goto-char (point-max)) (insert ?\" ?\n))) - -(defun async--transmit-sexp (process sexp) - (with-temp-buffer - (if async-debug - (message "Transmitting sexp {{{%s}}}" (pp-to-string sexp))) - (async--insert-sexp sexp) - (process-send-region process (point-min) (point-max)))) - -(defun async-batch-invoke () - "Called from the child Emacs process' command-line." - ;; Make sure 'message' and 'prin1' encode stuff in UTF-8, as parent - ;; process expects. - (let ((coding-system-for-write 'utf-8-unix)) - (setq async-in-child-emacs t - debug-on-error async-debug) - (if debug-on-error - (prin1 (funcall - (async--receive-sexp (unless async-send-over-pipe - command-line-args-left)))) - (condition-case err - (prin1 (funcall - (async--receive-sexp (unless async-send-over-pipe - command-line-args-left)))) - (error - (prin1 (list 'async-signal err))))))) - -(defun async-ready (future) - "Query a FUTURE to see if the ready is ready -- i.e., if no blocking -would result from a call to `async-get' on that FUTURE." - (and (memq (process-status future) '(exit signal)) - (with-current-buffer (process-buffer future) - async-callback-value-set))) - -(defun async-wait (future) - "Wait for FUTURE to become ready." - (while (not (async-ready future)) - (sit-for 0.05))) - -(defun async-get (future) - "Get the value from an asynchronously function when it is ready. -FUTURE is returned by `async-start' or `async-start-process' when -its FINISH-FUNC is nil." - (async-wait future) - (with-current-buffer (process-buffer future) - (async-handle-result #'identity async-callback-value (current-buffer)))) - -(defun async-message-p (value) - "Return true of VALUE is an async.el message packet." - (and (listp value) - (plist-get value :async-message))) - -(defun async-send (&rest args) - "Send the given messages to the asychronous Emacs PROCESS." - (let ((args (append args '(:async-message t)))) - (if async-in-child-emacs - (if async-callback - (funcall async-callback args)) - (async--transmit-sexp (car args) (list 'quote (cdr args)))))) - -(defun async-receive (&rest args) - "Send the given messages to the asychronous Emacs PROCESS." - (async--receive-sexp)) - -;;;###autoload -(defun async-start-process (name program finish-func &rest program-args) - "Start the executable PROGRAM asynchronously. See `async-start'. -PROGRAM is passed PROGRAM-ARGS, calling FINISH-FUNC with the -process object when done. If FINISH-FUNC is nil, the future -object will return the process object when the program is -finished. Set DEFAULT-DIRECTORY to change PROGRAM's current -working directory." - (let* ((buf (generate-new-buffer (concat "*" name "*"))) - (proc (let ((process-connection-type nil)) - (apply #'start-process name buf program program-args)))) - (with-current-buffer buf - (set (make-local-variable 'async-callback) finish-func) - (set-process-sentinel proc #'async-when-done) - (unless (string= name "emacs") - (set (make-local-variable 'async-callback-for-process) t)) - proc))) - -;;;###autoload -(defun async-start (start-func &optional finish-func) - "Execute START-FUNC (often a lambda) in a subordinate Emacs process. -When done, the return value is passed to FINISH-FUNC. Example: - - (async-start - ;; What to do in the child process - (lambda () - (message \"This is a test\") - (sleep-for 3) - 222) - - ;; What to do when it finishes - (lambda (result) - (message \"Async process done, result should be 222: %s\" - result))) - -If FINISH-FUNC is nil or missing, a future is returned that can -be inspected using `async-get', blocking until the value is -ready. Example: - - (let ((proc (async-start - ;; What to do in the child process - (lambda () - (message \"This is a test\") - (sleep-for 3) - 222)))) - - (message \"I'm going to do some work here\") ;; .... - - (message \"Waiting on async process, result should be 222: %s\" - (async-get proc))) - -If you don't want to use a callback, and you don't care about any -return value form the child process, pass the `ignore' symbol as -the second argument (if you don't, and never call `async-get', it -will leave *emacs* process buffers hanging around): - - (async-start - (lambda () - (delete-file \"a remote file on a slow link\" nil)) - 'ignore) - -Note: Even when FINISH-FUNC is present, a future is still -returned except that it yields no value (since the value is -passed to FINISH-FUNC). Call `async-get' on such a future always -returns nil. It can still be useful, however, as an argument to -`async-ready' or `async-wait'." - (let ((sexp start-func) - ;; Subordinate Emacs will send text encoded in UTF-8. - (coding-system-for-read 'utf-8-unix)) - (setq async--procvar - (async-start-process - "emacs" (file-truename - (expand-file-name invocation-name - invocation-directory)) - finish-func - "-Q" "-l" - ;; Using `locate-library' ensure we use the right file - ;; when the .elc have been deleted. - (locate-library "async") - "-batch" "-f" "async-batch-invoke" - (if async-send-over-pipe - "" - (with-temp-buffer - (async--insert-sexp (list 'quote sexp)) - (buffer-string))))) - (if async-send-over-pipe - (async--transmit-sexp async--procvar (list 'quote sexp))) - async--procvar)) - -(defmacro async-sandbox(func) - "Evaluate FUNC in a separate Emacs process, synchronously." - `(async-get (async-start ,func))) - -(provide 'async) - -;;; async.el ends here diff --git a/emacs.d/elpa/async-20160108.1249/dired-async.el b/emacs.d/elpa/async-20160108.1249/dired-async.el deleted file mode 100644 index ecab9cb..0000000 --- a/emacs.d/elpa/async-20160108.1249/dired-async.el +++ /dev/null @@ -1,290 +0,0 @@ -;;; dired-async.el --- Copy/move/delete asynchronously in dired. - -;; Copyright (C) 2012-2016 Free Software Foundation, Inc. - -;; Authors: John Wiegley -;; Thierry Volpiatto - -;; Keywords: dired async network -;; X-URL: https://github.com/jwiegley/dired-async - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2, or (at -;; your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Commentary: - -;; This file provide a redefinition of `dired-create-file' function, -;; performs copies, moves and all what is handled by `dired-create-file' -;; in the background using a slave Emacs process, -;; by means of the async.el module. -;; To use it, put this in your .emacs: - -;; (dired-async-mode 1) - -;; This will enable async copy/rename etc... -;; in dired and helm. - -;;; Code: - -(require 'cl-lib) -(require 'dired-aux) -(require 'async) - -(eval-when-compile - (defvar async-callback)) -(defvar dired-async-operation nil) - -(defgroup dired-async nil - "Copy rename files asynchronously from dired." - :group 'dired) - -(defcustom dired-async-env-variables-regexp - "\\`\\(tramp-\\(default\\|connection\\|remote\\)\\|ange-ftp\\)-.*" - "Variables matching this regexp will be loaded on Child Emacs." - :type 'regexp - :group 'dired-async) - -(defcustom dired-async-message-function 'dired-async-mode-line-message - "Function to use to notify result when operation finish. -Should take same args as `message'." - :group 'dired-async - :type 'function) - -(defcustom dired-async-log-file "/tmp/dired-async.log" - "File use to communicate errors from Child Emacs to host Emacs." - :group 'dired-async - :type 'string) - -(defface dired-async-message - '((t (:foreground "yellow"))) - "Face used for mode-line message." - :group 'dired-async) - -(defface dired-async-mode-message - '((t (:foreground "Gold"))) - "Face used for `dired-async--modeline-mode' lighter." - :group 'dired-async) - -(define-minor-mode dired-async--modeline-mode - "Notify mode-line that an async process run." - :group 'dired-async - :global t - :lighter (:eval (propertize (format " [%s Async job(s) running]" - (length (dired-async-processes))) - 'face 'dired-async-mode-message)) - (unless dired-async--modeline-mode - (let ((visible-bell t)) (ding)))) - -(defun dired-async-mode-line-message (text &rest args) - "Notify end of operation in `mode-line'." - (message nil) - (let ((mode-line-format (concat - " " (propertize - (if args - (apply #'format text args) - text) - 'face 'dired-async-message)))) - (force-mode-line-update) - (sit-for 3) - (force-mode-line-update))) - -(defun dired-async-processes () - (cl-loop for p in (process-list) - when (cl-loop for c in (process-command p) thereis - (string= "async-batch-invoke" c)) - collect p)) - -(defun dired-async-kill-process () - (interactive) - (let* ((processes (dired-async-processes)) - (proc (car (last processes)))) - (delete-process proc) - (unless (> (length processes) 1) - (dired-async--modeline-mode -1)))) - -(defun dired-async-after-file-create (len-flist) - "Callback function used for operation handled by `dired-create-file'." - (unless (dired-async-processes) - ;; Turn off mode-line notification - ;; only when last process end. - (dired-async--modeline-mode -1)) - (when dired-async-operation - (if (file-exists-p dired-async-log-file) - (progn - (pop-to-buffer (get-buffer-create "*dired async*")) - (erase-buffer) - (insert "Error: ") - (insert-file-contents dired-async-log-file) - (delete-file dired-async-log-file)) - (run-with-timer - 0.1 nil - dired-async-message-function "Asynchronous %s of %s file(s) on %s file(s) done" - (car dired-async-operation) (cadr dired-async-operation) len-flist)))) - -(defun dired-async-maybe-kill-ftp () - "Return a form to kill ftp process in child emacs." - (quote - (progn - (require 'cl-lib) - (let ((buf (cl-loop for b in (buffer-list) - thereis (and (string-match - "\\`\\*ftp.*" - (buffer-name b)) b)))) - (when buf (kill-buffer buf)))))) - -(defun dired-async-create-files (file-creator operation fn-list name-constructor - &optional marker-char) - "Same as `dired-create-files' but asynchronous. - -See `dired-create-files' for the behavior of arguments." - (setq dired-async-operation nil) - (let (dired-create-files-failures - failures async-fn-list - skipped (success-count 0) - (total (length fn-list)) - callback) - (let (to overwrite-query - overwrite-backup-query) ; for dired-handle-overwrite - (dolist (from fn-list) - (setq to (funcall name-constructor from)) - (if (equal to from) - (progn - (setq to nil) - (dired-log "Cannot %s to same file: %s\n" - (downcase operation) from))) - (if (not to) - (setq skipped (cons (dired-make-relative from) skipped)) - (let* ((overwrite (file-exists-p to)) - (dired-overwrite-confirmed ; for dired-handle-overwrite - (and overwrite - (let ((help-form '(format "\ -Type SPC or `y' to overwrite file `%s', -DEL or `n' to skip to next, -ESC or `q' to not overwrite any of the remaining files, -`!' to overwrite all remaining files with no more questions." to))) - (dired-query 'overwrite-query - "Overwrite `%s'?" to)))) - ;; must determine if FROM is marked before file-creator - ;; gets a chance to delete it (in case of a move). - (actual-marker-char - (cond ((integerp marker-char) marker-char) - (marker-char (dired-file-marker from)) ; slow - (t nil)))) - ;; Handle the `dired-copy-file' file-creator specially - ;; When copying a directory to another directory or - ;; possibly to itself or one of its subdirectories. - ;; e.g "~/foo/" => "~/test/" - ;; or "~/foo/" =>"~/foo/" - ;; or "~/foo/ => ~/foo/bar/") - ;; In this case the 'name-constructor' have set the destination - ;; TO to "~/test/foo" because the old emacs23 behavior - ;; of `copy-directory' was to not create the subdirectory - ;; and instead copy the contents. - ;; With the new behavior of `copy-directory' - ;; (similar to the `cp' shell command) we don't - ;; need such a construction of the target directory, - ;; so modify the destination TO to "~/test/" instead of "~/test/foo/". - (let ((destname (file-name-directory to))) - (when (and (file-directory-p from) - (file-directory-p to) - (eq file-creator 'dired-copy-file)) - (setq to destname)) - ;; If DESTNAME is a subdirectory of FROM, not a symlink, - ;; and the method in use is copying, signal an error. - (and (eq t (car (file-attributes destname))) - (eq file-creator 'dired-copy-file) - (file-in-directory-p destname from) - (error "Cannot copy `%s' into its subdirectory `%s'" - from to))) - (if overwrite - (or (and dired-overwrite-confirmed - (push (cons from to) async-fn-list)) - (progn - (push (dired-make-relative from) failures) - (dired-log "%s `%s' to `%s' failed" - operation from to))) - (push (cons from to) async-fn-list))))) - (setq callback - `(lambda (&optional ignore) - (dired-async-after-file-create ,total) - (when (string= ,(downcase operation) "rename") - (cl-loop for (file . to) in ',async-fn-list - do (and (get-file-buffer file) - (with-current-buffer (get-file-buffer file) - (set-visited-file-name to nil t)))))))) - ;; Handle error happening in host emacs. - (cond - (dired-create-files-failures - (setq failures (nconc failures dired-create-files-failures)) - (dired-log-summary - (format "%s failed for %d file%s in %d requests" - operation (length failures) - (dired-plural-s (length failures)) - total) - failures)) - (failures - (dired-log-summary - (format "%s failed for %d of %d file%s" - operation (length failures) - total (dired-plural-s total)) - failures)) - (skipped - (dired-log-summary - (format "%s: %d of %d file%s skipped" - operation (length skipped) total - (dired-plural-s total)) - skipped)) - (t (message "%s: %s file%s" - operation success-count (dired-plural-s success-count)))) - ;; Start async process. - (when async-fn-list - (async-start `(lambda () - (require 'cl-lib) (require 'dired-aux) (require 'dired-x) - ,(async-inject-variables dired-async-env-variables-regexp) - (condition-case err - (let ((dired-recursive-copies (quote always))) - (cl-loop for (f . d) in (quote ,async-fn-list) - do (funcall (quote ,file-creator) f d t))) - (file-error - (with-temp-file ,dired-async-log-file - (insert (format "%S" err))))) - ,(dired-async-maybe-kill-ftp)) - callback) - ;; Run mode-line notifications while process running. - (dired-async--modeline-mode 1) - (setq dired-async-operation (list operation (length async-fn-list))) - (message "%s proceeding asynchronously..." operation)))) - -(defadvice dired-create-files (around dired-async) - (dired-async-create-files file-creator operation fn-list - name-constructor marker-char)) - -;;;###autoload -(define-minor-mode dired-async-mode - "Do dired actions asynchronously." - :group 'dired-async - :global t - (if dired-async-mode - (if (fboundp 'advice-add) - (advice-add 'dired-create-files :override #'dired-async-create-files) - (ad-activate 'dired-create-files)) - (if (fboundp 'advice-remove) - (advice-remove 'dired-create-files #'dired-async-create-files) - (ad-deactivate 'dired-create-files)))) - - -(provide 'dired-async) - -;;; dired-async.el ends here diff --git a/emacs.d/elpa/async-20160108.1249/smtpmail-async.el b/emacs.d/elpa/async-20160108.1249/smtpmail-async.el deleted file mode 100644 index 5ac426d..0000000 --- a/emacs.d/elpa/async-20160108.1249/smtpmail-async.el +++ /dev/null @@ -1,73 +0,0 @@ -;;; smtpmail-async.el --- Send e-mail with smtpmail.el asynchronously - -;; Copyright (C) 2012-2016 Free Software Foundation, Inc. - -;; Author: John Wiegley -;; Created: 18 Jun 2012 - -;; Keywords: email async -;; X-URL: https://github.com/jwiegley/emacs-async - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2, or (at -;; your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Commentary: - -;; Send e-mail with smtpmail.el asynchronously. To use: -;; -;; (require 'smtpmail-async) -;; -;; (setq send-mail-function 'async-smtpmail-send-it -;; message-send-mail-function 'async-smtpmail-send-it) -;; -;; This assumes you already have smtpmail.el working. - -;;; Code: - -(defgroup smtpmail-async nil - "Send e-mail with smtpmail.el asynchronously" - :group 'smptmail) - -(require 'async) -(require 'smtpmail) -(require 'message) - -(defvar async-smtpmail-before-send-hook nil - "Hook running in the child emacs in `async-smtpmail-send-it'. -It is called just before calling `smtpmail-send-it'.") - -(defun async-smtpmail-send-it () - (let ((to (message-field-value "To")) - (buf-content (buffer-substring-no-properties - (point-min) (point-max)))) - (message "Delivering message to %s..." to) - (async-start - `(lambda () - (require 'smtpmail) - (with-temp-buffer - (insert ,buf-content) - (set-buffer-multibyte nil) - ;; Pass in the variable environment for smtpmail - ,(async-inject-variables - "\\`\\(smtpmail\\|async-smtpmail\\|\\(user-\\)?mail\\)-\\|auth-sources\\|epg" - nil "\\`\\(mail-header-format-function\\|smtpmail-address-buffer\\|mail-mode-abbrev-table\\)") - (run-hooks 'async-smtpmail-before-send-hook) - (smtpmail-send-it))) - `(lambda (&optional ignore) - (message "Delivering message to %s...done" ,to))))) - -(provide 'smtpmail-async) - -;;; smtpmail-async.el ends here diff --git a/emacs.d/elpa/auto-complete-20160107.8/auto-complete-autoloads.el b/emacs.d/elpa/auto-complete-20160107.8/auto-complete-autoloads.el deleted file mode 100644 index 963e0f2..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/auto-complete-autoloads.el +++ /dev/null @@ -1,64 +0,0 @@ -;;; auto-complete-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) - -;;;### (autoloads nil "auto-complete" "auto-complete.el" (22171 46584 -;;;;;; 0 0)) -;;; Generated autoloads from auto-complete.el - -(autoload 'auto-complete "auto-complete" "\ -Start auto-completion at current point. - -\(fn &optional SOURCES)" t nil) - -(autoload 'auto-complete-mode "auto-complete" "\ -AutoComplete mode - -\(fn &optional ARG)" t nil) - -(defvar global-auto-complete-mode nil "\ -Non-nil if Global-Auto-Complete mode is enabled. -See the command `global-auto-complete-mode' for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `global-auto-complete-mode'.") - -(custom-autoload 'global-auto-complete-mode "auto-complete" nil) - -(autoload 'global-auto-complete-mode "auto-complete" "\ -Toggle Auto-Complete mode in all buffers. -With prefix ARG, enable Global-Auto-Complete mode if ARG is positive; -otherwise, disable it. If called from Lisp, enable the mode if -ARG is omitted or nil. - -Auto-Complete mode is enabled in all buffers where -`auto-complete-mode-maybe' would do it. -See `auto-complete-mode' for more information on Auto-Complete mode. - -\(fn &optional ARG)" t nil) - -;;;*** - -;;;### (autoloads nil "auto-complete-config" "auto-complete-config.el" -;;;;;; (22171 46584 0 0)) -;;; Generated autoloads from auto-complete-config.el - -(autoload 'ac-config-default "auto-complete-config" "\ - - -\(fn)" nil nil) - -;;;*** - -;;;### (autoloads nil nil ("auto-complete-pkg.el") (22171 46584 590372 -;;;;;; 0)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; auto-complete-autoloads.el ends here diff --git a/emacs.d/elpa/auto-complete-20160107.8/auto-complete-config.el b/emacs.d/elpa/auto-complete-20160107.8/auto-complete-config.el deleted file mode 100644 index 021bdbd..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/auto-complete-config.el +++ /dev/null @@ -1,543 +0,0 @@ -;;; auto-complete-config.el --- auto-complete additional configuations - -;; Copyright (C) 2009, 2010 Tomohiro Matsuyama - -;; Author: Tomohiro Matsuyama -;; Keywords: convenience -;; Version: 1.5.0 - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; - -;;; Code: - -(require 'cl-lib) -(require 'auto-complete) - - - -;;;; Additional sources - -;; imenu - -(defvar ac-imenu-index nil) - -(ac-clear-variable-every-10-minutes 'ac-imenu-index) - -(defun ac-imenu-candidates () - (cl-loop with i = 0 - with stack = (progn - (unless (local-variable-p 'ac-imenu-index) - (make-local-variable 'ac-imenu-index)) - (or ac-imenu-index - (setq ac-imenu-index - (ignore-errors - (with-no-warnings - (imenu--make-index-alist)))))) - with result - while (and stack (or (not (integerp ac-limit)) - (< i ac-limit))) - for node = (pop stack) - if (consp node) - do - (let ((car (car node)) - (cdr (cdr node))) - (if (consp cdr) - (mapc (lambda (child) - (push child stack)) - cdr) - (when (and (stringp car) - (string-match (concat "^" (regexp-quote ac-prefix)) car)) - ;; Remove extra characters - (if (string-match "^.*\\(()\\|=\\|<>\\)$" car) - (setq car (substring car 0 (match-beginning 1)))) - (push car result) - (cl-incf i)))) - finally return (nreverse result))) - -(ac-define-source imenu - '((depends imenu) - (candidates . ac-imenu-candidates) - (symbol . "s"))) - -;; gtags - -(defface ac-gtags-candidate-face - '((t (:inherit ac-candidate-face :foreground "navy"))) - "Face for gtags candidate" - :group 'auto-complete) - -(defface ac-gtags-selection-face - '((t (:inherit ac-selection-face :background "navy"))) - "Face for the gtags selected candidate." - :group 'auto-complete) - -(defun ac-gtags-candidate () - (ignore-errors - (split-string (shell-command-to-string (format "global -ciq %s" ac-prefix)) "\n"))) - -(ac-define-source gtags - '((candidates . ac-gtags-candidate) - (candidate-face . ac-gtags-candidate-face) - (selection-face . ac-gtags-selection-face) - (requires . 3) - (symbol . "s"))) - -;; yasnippet - -(defface ac-yasnippet-candidate-face - '((t (:inherit ac-candidate-face - :background "sandybrown" :foreground "black"))) - "Face for yasnippet candidate." - :group 'auto-complete) - -(defface ac-yasnippet-selection-face - '((t (:inherit ac-selection-face :background "coral3"))) - "Face for the yasnippet selected candidate." - :group 'auto-complete) - -(defun ac-yasnippet-table-hash (table) - (cond - ((fboundp 'yas/snippet-table-hash) - (yas/snippet-table-hash table)) - ((fboundp 'yas/table-hash) - (yas/table-hash table)))) - -(defun ac-yasnippet-table-parent (table) - (cond - ((fboundp 'yas/snippet-table-parent) - (yas/snippet-table-parent table)) - ((fboundp 'yas/table-parent) - (yas/table-parent table)))) - -(defun ac-yasnippet-candidate-1 (table) - (with-no-warnings - (let ((hashtab (ac-yasnippet-table-hash table)) - (parent (ac-yasnippet-table-parent table)) - candidates) - (maphash (lambda (key value) - (push key candidates)) - hashtab) - (setq candidates (all-completions ac-prefix (nreverse candidates))) - (if parent - (setq candidates - (append candidates (ac-yasnippet-candidate-1 parent)))) - candidates))) - -(defun ac-yasnippet-candidates () - (with-no-warnings - (cond (;; 0.8 onwards - (fboundp 'yas-active-keys) - (all-completions ac-prefix (yas-active-keys))) - (;; >0.6.0 - (fboundp 'yas/get-snippet-tables) - (apply 'append (mapcar 'ac-yasnippet-candidate-1 - (condition-case nil - (yas/get-snippet-tables major-mode) - (wrong-number-of-arguments - (yas/get-snippet-tables))))) - ) - (t - (let ((table - (if (fboundp 'yas/snippet-table) - ;; <0.6.0 - (yas/snippet-table major-mode) - ;; 0.6.0 - (yas/current-snippet-table)))) - (if table - (ac-yasnippet-candidate-1 table))))))) - -(ac-define-source yasnippet - '((depends yasnippet) - (candidates . ac-yasnippet-candidates) - (action . yas/expand) - (candidate-face . ac-yasnippet-candidate-face) - (selection-face . ac-yasnippet-selection-face) - (symbol . "a"))) - -;; semantic - -(defun ac-semantic-candidates (prefix) - (with-no-warnings - (delete "" ; semantic sometimes returns an empty string - (mapcar (lambda (elem) - (cons (semantic-tag-name elem) - (semantic-tag-clone elem))) - (ignore-errors - (or (semantic-analyze-possible-completions - (semantic-analyze-current-context)) - (senator-find-tag-for-completion prefix))))))) - -(defun ac-semantic-doc (symbol) - (with-no-warnings - (let* ((proto (semantic-format-tag-summarize-with-file symbol nil t)) - (doc (semantic-documentation-for-tag symbol)) - (res proto)) - (when doc - (setq res (concat res "\n\n" doc))) - res))) - -(defun ac-semantic-action () - (when (and (boundp 'yas-minor-mode) yas-minor-mode) - (let* ((tag (car (last (oref (semantic-analyze-current-context) prefix)))) - (class (semantic-tag-class tag)) - (args)) - (when (eq class 'function) - (setq args (semantic-tag-function-arguments tag)) - (yas-expand-snippet - (concat "(" - (mapconcat - (lambda (arg) - (let ((arg-type (semantic-format-tag-type arg nil)) - (arg-name (semantic-format-tag-name arg nil))) - (concat "${" - (if (string= arg-name "") - arg-type - (concat arg-type " " arg-name)) - "}"))) - args - ", ") - ")$0")))))) - -(ac-define-source semantic - '((available . (or (require 'semantic-ia nil t) - (require 'semantic/ia nil t))) - (candidates . (ac-semantic-candidates ac-prefix)) - (document . ac-semantic-doc) - (action . ac-semantic-action) - (prefix . cc-member) - (requires . 0) - (symbol . "m"))) - -(ac-define-source semantic-raw - '((available . (or (require 'semantic-ia nil t) - (require 'semantic/ia nil t))) - (candidates . (ac-semantic-candidates ac-prefix)) - (document . ac-semantic-doc) - (action . ac-semantic-action) - (symbol . "s"))) - -;; eclim - -(defun ac-eclim-candidates () - (with-no-warnings - (cl-loop for c in (eclim/java-complete) - collect (nth 1 c)))) - -(ac-define-source eclim - '((candidates . ac-eclim-candidates) - (prefix . c-dot) - (requires . 0) - (symbol . "f"))) - -;; css - -;; Copied from company-css.el -(defconst ac-css-property-alist - ;; see http://www.w3.org/TR/CSS21/propidx.html - '(("azimuth" angle "left-side" "far-left" "left" "center-left" "center" - "center-right" "right" "far-right" "right-side" "behind" "leftwards" - "rightwards") - ("background" background-color background-image background-repeat - background-attachment background-position) - ("background-attachment" "scroll" "fixed") - ("background-color" color "transparent") - ("background-image" uri "none") - ("background-position" percentage length "left" "center" "right" percentage - length "top" "center" "bottom" "left" "center" "right" "top" "center" - "bottom") - ("background-repeat" "repeat" "repeat-x" "repeat-y" "no-repeat") - ("border" border-width border-style border-color) - ("border-bottom" border) - ("border-bottom-color" border-color) - ("border-bottom-style" border-style) - ("border-bottom-width" border-width) - ("border-collapse" "collapse" "separate") - ("border-color" color "transparent") - ("border-left" border) - ("border-left-color" border-color) - ("border-left-style" border-style) - ("border-left-width" border-width) - ("border-right" border) - ("border-right-color" border-color) - ("border-right-style" border-style) - ("border-right-width" border-width) - ("border-spacing" length length) - ("border-style" border-style) - ("border-top" border) - ("border-top-color" border-color) - ("border-top-style" border-style) - ("border-top-width" border-width) - ("border-width" border-width) - ("bottom" length percentage "auto") - ("caption-side" "top" "bottom") - ("clear" "none" "left" "right" "both") - ("clip" shape "auto") - ("color" color) - ("content" "normal" "none" string uri counter "attr()" "open-quote" - "close-quote" "no-open-quote" "no-close-quote") - ("counter-increment" identifier integer "none") - ("counter-reset" identifier integer "none") - ("cue" cue-before cue-after) - ("cue-after" uri "none") - ("cue-before" uri "none") - ("cursor" uri "*" "auto" "crosshair" "default" "pointer" "move" "e-resize" - "ne-resize" "nw-resize" "n-resize" "se-resize" "sw-resize" "s-resize" - "w-resize" "text" "wait" "help" "progress") - ("direction" "ltr" "rtl") - ("display" "inline" "block" "list-item" "run-in" "inline-block" "table" - "inline-table" "table-row-group" "table-header-group" "table-footer-group" - "table-row" "table-column-group" "table-column" "table-cell" - "table-caption" "none") - ("elevation" angle "below" "level" "above" "higher" "lower") - ("empty-cells" "show" "hide") - ("float" "left" "right" "none") - ("font" font-style font-variant font-weight font-size "/" line-height - font-family "caption" "icon" "menu" "message-box" "small-caption" - "status-bar") - ("font-family" family-name generic-family) - ("font-size" absolute-size relative-size length percentage) - ("font-style" "normal" "italic" "oblique") - ("font-variant" "normal" "small-caps") - ("font-weight" "normal" "bold" "bolder" "lighter" "100" "200" "300" "400" - "500" "600" "700" "800" "900") - ("height" length percentage "auto") - ("left" length percentage "auto") - ("letter-spacing" "normal" length) - ("line-height" "normal" number length percentage) - ("list-style" list-style-type list-style-position list-style-image) - ("list-style-image" uri "none") - ("list-style-position" "inside" "outside") - ("list-style-type" "disc" "circle" "square" "decimal" "decimal-leading-zero" - "lower-roman" "upper-roman" "lower-greek" "lower-latin" "upper-latin" - "armenian" "georgian" "lower-alpha" "upper-alpha" "none") - ("margin" margin-width) - ("margin-bottom" margin-width) - ("margin-left" margin-width) - ("margin-right" margin-width) - ("margin-top" margin-width) - ("max-height" length percentage "none") - ("max-width" length percentage "none") - ("min-height" length percentage) - ("min-width" length percentage) - ("orphans" integer) - ("outline" outline-color outline-style outline-width) - ("outline-color" color "invert") - ("outline-style" border-style) - ("outline-width" border-width) - ("overflow" "visible" "hidden" "scroll" "auto") - ("padding" padding-width) - ("padding-bottom" padding-width) - ("padding-left" padding-width) - ("padding-right" padding-width) - ("padding-top" padding-width) - ("page-break-after" "auto" "always" "avoid" "left" "right") - ("page-break-before" "auto" "always" "avoid" "left" "right") - ("page-break-inside" "avoid" "auto") - ("pause" time percentage) - ("pause-after" time percentage) - ("pause-before" time percentage) - ("pitch" frequency "x-low" "low" "medium" "high" "x-high") - ("pitch-range" number) - ("play-during" uri "mix" "repeat" "auto" "none") - ("position" "static" "relative" "absolute" "fixed") - ("quotes" string string "none") - ("richness" number) - ("right" length percentage "auto") - ("speak" "normal" "none" "spell-out") - ("speak-header" "once" "always") - ("speak-numeral" "digits" "continuous") - ("speak-punctuation" "code" "none") - ("speech-rate" number "x-slow" "slow" "medium" "fast" "x-fast" "faster" - "slower") - ("stress" number) - ("table-layout" "auto" "fixed") - ("text-align" "left" "right" "center" "justify") - ("text-decoration" "none" "underline" "overline" "line-through" "blink") - ("text-indent" length percentage) - ("text-transform" "capitalize" "uppercase" "lowercase" "none") - ("top" length percentage "auto") - ("unicode-bidi" "normal" "embed" "bidi-override") - ("vertical-align" "baseline" "sub" "super" "top" "text-top" "middle" - "bottom" "text-bottom" percentage length) - ("visibility" "visible" "hidden" "collapse") - ("voice-family" specific-voice generic-voice "*" specific-voice - generic-voice) - ("volume" number percentage "silent" "x-soft" "soft" "medium" "loud" - "x-loud") - ("white-space" "normal" "pre" "nowrap" "pre-wrap" "pre-line") - ("widows" integer) - ("width" length percentage "auto") - ("word-spacing" "normal" length) - ("z-index" "auto" integer)) - "A list of CSS properties and their possible values.") - -(defconst ac-css-value-classes - '((absolute-size "xx-small" "x-small" "small" "medium" "large" "x-large" - "xx-large") - (border-style "none" "hidden" "dotted" "dashed" "solid" "double" "groove" - "ridge" "inset" "outset") - (color "aqua" "black" "blue" "fuchsia" "gray" "green" "lime" "maroon" "navy" - "olive" "orange" "purple" "red" "silver" "teal" "white" "yellow" - "rgb") - (counter "counter") - (family-name "Courier" "Helvetica" "Times") - (generic-family "serif" "sans-serif" "cursive" "fantasy" "monospace") - (generic-voice "male" "female" "child") - (margin-width "auto") ;; length percentage - (relative-size "larger" "smaller") - (shape "rect") - (uri "url")) - "A list of CSS property value classes and their contents.") - -(defconst ac-css-pseudo-classes - '("active" "after" "before" "first" "first-child" "first-letter" "first-line" - "focus" "hover" "lang" "left" "link" "right" "visited") - "Identifiers for CSS pseudo-elements and pseudo-classes.") - -(defvar ac-css-property nil - "Current editing property.") - -(defun ac-css-prefix () - (when (save-excursion (re-search-backward "\\_<\\(.+?\\)\\_>\\s *:[^;]*\\=" nil t)) - (setq ac-css-property (match-string 1)) - (or (ac-prefix-symbol) (point)))) - -(defun ac-css-property-candidates () - (let ((list (assoc-default ac-css-property ac-css-property-alist))) - (if list - (cl-loop with seen - with value - while (setq value (pop list)) - if (symbolp value) - do (unless (memq value seen) - (push value seen) - (setq list - (append list - (or (assoc-default value ac-css-value-classes) - (assoc-default (symbol-name value) ac-css-property-alist))))) - else collect value) - ac-css-pseudo-classes))) - -(ac-define-source css-property - '((candidates . ac-css-property-candidates) - (prefix . ac-css-prefix) - (requires . 0))) - -;; slime -(ac-define-source slime - '((depends slime) - (candidates . (car (slime-simple-completions ac-prefix))) - (symbol . "s") - (cache))) - -;; ghc-mod -(ac-define-source ghc-mod - '((depends ghc) - (candidates . (ghc-select-completion-symbol)) - (symbol . "s") - (cache))) - - - -;;;; Not maintained sources - -;; ropemacs - -(defvar ac-ropemacs-loaded nil) -(defun ac-ropemacs-require () - (with-no-warnings - (unless ac-ropemacs-loaded - (pymacs-load "ropemacs" "rope-") - (if (boundp 'ropemacs-enable-autoimport) - (setq ropemacs-enable-autoimport t)) - (setq ac-ropemacs-loaded t)))) - -(defun ac-ropemacs-setup () - (ac-ropemacs-require) - ;(setq ac-sources (append (list 'ac-source-ropemacs) ac-sources)) - (setq ac-omni-completion-sources '(("\\." ac-source-ropemacs)))) - -(defun ac-ropemacs-initialize () - (autoload 'pymacs-apply "pymacs") - (autoload 'pymacs-call "pymacs") - (autoload 'pymacs-eval "pymacs" nil t) - (autoload 'pymacs-exec "pymacs" nil t) - (autoload 'pymacs-load "pymacs" nil t) - (add-hook 'python-mode-hook 'ac-ropemacs-setup) - t) - -(defvar ac-ropemacs-completions-cache nil) -(defvar ac-source-ropemacs - '((init - . (lambda () - (setq ac-ropemacs-completions-cache - (mapcar - (lambda (completion) - (concat ac-prefix completion)) - (ignore-errors - (rope-completions)))))) - (candidates . ac-ropemacs-completions-cache))) - -;; rcodetools - -(defvar ac-source-rcodetools - '((init . (lambda () - (require 'rcodetools) - (condition-case x - (save-excursion - (rct-exec-and-eval rct-complete-command-name "--completion-emacs-icicles")) - (error) (setq rct-method-completion-table nil)))) - (candidates . (lambda () - (all-completions - ac-prefix - (mapcar - (lambda (completion) - (replace-regexp-in-string "\t.*$" "" (car completion))) - rct-method-completion-table)))))) - - - -;;;; Default settings - -(defun ac-common-setup () - ;(add-to-list 'ac-sources 'ac-source-filename) - ) - -(defun ac-emacs-lisp-mode-setup () - (setq ac-sources (append '(ac-source-features ac-source-functions ac-source-yasnippet ac-source-variables ac-source-symbols) ac-sources))) - -(defun ac-cc-mode-setup () - (setq ac-sources (append '(ac-source-yasnippet ac-source-gtags) ac-sources))) - -(defun ac-ruby-mode-setup ()) - -(defun ac-css-mode-setup () - (setq ac-sources (append '(ac-source-css-property) ac-sources))) - -;;;###autoload -(defun ac-config-default () - (setq-default ac-sources '(ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers)) - (add-hook 'emacs-lisp-mode-hook 'ac-emacs-lisp-mode-setup) - (add-hook 'c-mode-common-hook 'ac-cc-mode-setup) - (add-hook 'ruby-mode-hook 'ac-ruby-mode-setup) - (add-hook 'css-mode-hook 'ac-css-mode-setup) - (add-hook 'auto-complete-mode-hook 'ac-common-setup) - (global-auto-complete-mode t)) - -(provide 'auto-complete-config) -;;; auto-complete-config.el ends here diff --git a/emacs.d/elpa/auto-complete-20160107.8/auto-complete-pkg.el b/emacs.d/elpa/auto-complete-20160107.8/auto-complete-pkg.el deleted file mode 100644 index 797a9e9..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/auto-complete-pkg.el +++ /dev/null @@ -1,6 +0,0 @@ -(define-package "auto-complete" "20160107.8" "Auto Completion for GNU Emacs" - '((popup "0.5.0") - (cl-lib "0.5"))) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/emacs.d/elpa/auto-complete-20160107.8/auto-complete.el b/emacs.d/elpa/auto-complete-20160107.8/auto-complete.el deleted file mode 100644 index f497e29..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/auto-complete.el +++ /dev/null @@ -1,2163 +0,0 @@ -;;; auto-complete.el --- Auto Completion for GNU Emacs - -;; Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Tomohiro Matsuyama - -;; Author: Tomohiro Matsuyama -;; URL: https://github.com/auto-complete/auto-complete -;; Keywords: completion, convenience -;; Version: 1.5.0 - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: -;; -;; This extension provides a way to complete with popup menu like: -;; -;; def-!- -;; +-----------------+ -;; |defun::::::::::::| -;; |defvar | -;; |defmacro | -;; | ... | -;; +-----------------+ -;; -;; You can complete by typing and selecting menu. -;; -;; Entire documents are located in doc/ directory. -;; Take a look for information. -;; -;; Enjoy! - -;;; Code: - - - -(defconst ac-version "1.5.0" - "Version of auto-complete in string format. -Use `version-to-list' to get version component.") - -(defconst ac-version-major (car (version-to-list ac-version)) - "Major version number of auto-complete") - -(defconst ac-version-minor (cadr (version-to-list ac-version)) - "Minor version number of auto-complete") - -(require 'cl-lib) -(require 'popup) - -;;;; Global stuff - -(defun ac-error (&optional var) - "Report an error and disable `auto-complete-mode'." - (ignore-errors - (message "auto-complete error: %s" var) - (auto-complete-mode -1) - var)) - - - -;;;; Customization - -(defgroup auto-complete nil - "Auto completion." - :group 'completion - :prefix "ac-") - -(defcustom ac-delay 0.1 - "Delay to completions will be available." - :type 'float - :group 'auto-complete) - -(defcustom ac-auto-show-menu 0.8 - "Non-nil means completion menu will be automatically shown." - :type '(choice (const :tag "Yes" t) - (const :tag "Never" nil) - (float :tag "Timer")) - :group 'auto-complete) - -(defcustom ac-show-menu-immediately-on-auto-complete t - "Non-nil means menu will be showed immediately on `auto-complete'." - :type 'boolean - :group 'auto-complete) - -(defcustom ac-expand-on-auto-complete t - "Non-nil means expand whole common part on first time `auto-complete'." - :type 'boolean - :group 'auto-complete) - -(defcustom ac-disable-faces '(font-lock-comment-face font-lock-string-face font-lock-doc-face) - "Non-nil means disable automatic completion on specified faces." - :type '(repeat symbol) - :group 'auto-complete) - -(defcustom ac-stop-flymake-on-completing t - "Non-nil means disble flymake temporarily on completing." - :type 'boolean - :group 'auto-complete) - -(defcustom ac-flycheck-poll-completion-end-interval 0.5 - "Polling interval to restart automatically flycheck's checking after completion is end." - :type 'float - :group 'auto-complete) - -(defcustom ac-use-fuzzy (and (locate-library "fuzzy") t) - "Non-nil means use fuzzy matching." - :type 'boolean - :group 'auto-complete) - -(defcustom ac-fuzzy-cursor-color "red" - "Cursor color in fuzzy mode." - :type 'string - :group 'auto-complete) - -(defcustom ac-use-comphist t - "Non-nil means use intelligent completion history." - :type 'boolean - :group 'auto-complete) - -(defcustom ac-comphist-threshold 0.7 - "Percentage of ignoring low scored candidates." - :type 'float - :group 'auto-complete) - -(defcustom ac-comphist-file - (expand-file-name (concat (if (boundp 'user-emacs-directory) - user-emacs-directory - "~/.emacs.d/") - "/ac-comphist.dat")) - "Completion history file name." - :type 'string - :group 'auto-complete) - -(defcustom ac-user-dictionary nil - "User defined dictionary" - :type '(repeat string) - :group 'auto-complete) - -(defcustom ac-dictionary-files '("~/.dict") - "Dictionary files." - :type '(repeat string) - :group 'auto-complete) -(defvaralias 'ac-user-dictionary-files 'ac-dictionary-files) - -(defcustom ac-dictionary-directories - (ignore-errors - (when load-file-name - (let ((installed-dir (file-name-directory load-file-name))) - (cl-loop for name in '("ac-dict" "dict") - for dir = (concat installed-dir name) - if (file-directory-p dir) - collect dir)))) - "Dictionary directories." - :type '(repeat string) - :group 'auto-complete) - -(defcustom ac-use-quick-help t - "Non-nil means use quick help." - :type 'boolean - :group 'auto-complete) - -(defcustom ac-quick-help-delay 1.5 - "Delay to show quick help." - :type 'float - :group 'auto-complete) - -(defcustom ac-menu-height 10 - "Max height of candidate menu." - :type 'integer - :group 'auto-complete) -(defvaralias 'ac-candidate-menu-height 'ac-menu-height) - -(defcustom ac-quick-help-height 20 - "Max height of quick help." - :type 'integer - :group 'auto-complete) - -(defcustom ac-quick-help-prefer-pos-tip t - "Prefer native tooltip with pos-tip than overlay popup for displaying quick help." - :type 'boolean - :group 'auto-complete) -(defvaralias 'ac-quick-help-prefer-x 'ac-quick-help-prefer-pos-tip) - -(defcustom ac-candidate-limit nil - "Limit number of candidates. Non-integer means no limit." - :type 'integer - :group 'auto-complete) -(defvaralias 'ac-candidate-max 'ac-candidate-limit) - -(defcustom ac-modes - '(emacs-lisp-mode lisp-mode lisp-interaction-mode - slime-repl-mode - c-mode cc-mode c++-mode go-mode - java-mode malabar-mode clojure-mode clojurescript-mode scala-mode - scheme-mode - ocaml-mode tuareg-mode coq-mode haskell-mode agda-mode agda2-mode - perl-mode cperl-mode python-mode ruby-mode lua-mode tcl-mode - ecmascript-mode javascript-mode js-mode js2-mode php-mode css-mode scss-mode less-css-mode - makefile-mode sh-mode fortran-mode f90-mode ada-mode - xml-mode sgml-mode web-mode - ts-mode - sclang-mode - verilog-mode - qml-mode - apples-mode) - "Major modes `auto-complete-mode' can run on." - :type '(repeat symbol) - :group 'auto-complete) - -(defcustom ac-compatible-packages-regexp - "^ac-" - "Regexp to indicate what packages can work with auto-complete." - :type 'string - :group 'auto-complete) - -(defcustom ac-non-trigger-commands - '(*table--cell-self-insert-command - electric-buffer-list) - "Commands that can't be used as triggers of `auto-complete'." - :type '(repeat symbol) - :group 'auto-complete) - -(defcustom ac-trigger-commands - '(self-insert-command) - "Trigger commands that specify whether `auto-complete' should start or not." - :type '(repeat symbol) - :group 'auto-complete) - -(defcustom ac-trigger-commands-on-completing - '(delete-backward-char - backward-delete-char - backward-delete-char-untabify - ;; autopair - autopair-backspace - ;; paredit - paredit-backward-delete - paredit-backward-delete-word) - "Trigger commands that specify whether `auto-complete' should continue or not." - :type '(repeat symbol) - :group 'auto-complete) - -(defcustom ac-trigger-key nil - "Non-nil means `auto-complete' will start by typing this key. -If you specify this TAB, for example, `auto-complete' will start by typing TAB, -and if there is no completions, an original command will be fallbacked." - :type '(choice (const :tag "None" nil) - (string :tag "Key")) - :group 'auto-complete - :set (lambda (symbol value) - (set-default symbol value) - (when (and value - (fboundp 'ac-set-trigger-key)) - (ac-set-trigger-key value)))) - -(defcustom ac-auto-start 2 - "Non-nil means completion will be started automatically. -Positive integer means if a length of a word you entered is larger than the value, -completion will be started automatically. -If you specify `nil', never be started automatically." - :type '(choice (const :tag "Yes" t) - (const :tag "Never" nil) - (integer :tag "Require")) - :group 'auto-complete) - -(defcustom ac-stop-words nil - "List of string to stop completion." - :type '(repeat string) - :group 'auto-complete) -(defvaralias 'ac-ignores 'ac-stop-words) - -(defcustom ac-use-dictionary-as-stop-words t - "Non-nil means a buffer related dictionary will be thought of as stop words." - :type 'boolean - :group 'auto-complete) - -(defcustom ac-ignore-case 'smart - "Non-nil means auto-complete ignores case. -If this value is `smart', auto-complete ignores case only when -a prefix doesn't contain any upper case letters." - :type '(choice (const :tag "Yes" t) - (const :tag "Smart" smart) - (const :tag "No" nil)) - :group 'auto-complete) - -(defcustom ac-dwim t - "Non-nil means `auto-complete' works based on Do What I Mean." - :type 'boolean - :group 'auto-complete) - -(defcustom ac-use-menu-map nil - "Non-nil means a special keymap `ac-menu-map' on completing menu will be used." - :type 'boolean - :group 'auto-complete) - -(defcustom ac-use-overriding-local-map nil - "Non-nil means `overriding-local-map' will be used to hack for overriding key events on auto-completion." - :type 'boolean - :group 'auto-complete) - -(defcustom ac-disable-inline nil - "Non-nil disable inline completion visibility" - :type 'boolean - :group 'auto-complete) - -(defcustom ac-candidate-menu-min 1 - "Number of candidates required to display menu" - :type 'integer - :group 'auto-complete) - -(defcustom ac-max-width nil - "Maximum width for auto-complete menu to have" - :type '(choice (const :tag "No limit" nil) - (const :tag "Character Limit" 25) - (const :tag "Window Ratio Limit" 0.5)) - :group 'auto-complete) - -(defface ac-completion-face - '((t (:foreground "darkgray" :underline t))) - "Face for inline completion" - :group 'auto-complete) - -(defface ac-candidate-face - '((t (:inherit popup-face))) - "Face for candidate." - :group 'auto-complete) - -(defface ac-candidate-mouse-face - '((t (:inherit popup-menu-mouse-face))) - "Mouse face for candidate." - :group 'auto-complete) - -(defface ac-selection-face - '((t (:inherit popup-menu-selection-face))) - "Face for selected candidate." - :group 'auto-complete) - -(defvar auto-complete-mode-hook nil - "Hook for `auto-complete-mode'.") - - - -;;;; Internal variables - -(defvar auto-complete-mode nil - "Dummy variable to suppress compiler warnings.") - -(defvar ac-cursor-color nil - "Old cursor color.") - -(defvar ac-inline nil - "Inline completion instance.") - -(defvar ac-menu nil - "Menu instance.") - -(defvar ac-show-menu nil - "Flag to show menu on timer tick.") - -(defvar ac-last-completion nil - "Cons of prefix marker and selected item of last completion.") - -(defvar ac-quick-help nil - "Quick help instance") - -(defvar ac-completing nil - "Non-nil means `auto-complete-mode' is now working on completion.") - -(defvar ac-buffer nil - "Buffer where auto-complete is started.") - -(defvar ac-point nil - "Start point of prefix.") - -(defvar ac-last-point nil - "Last point of updating pattern.") - -(defvar ac-prefix nil - "Prefix string.") -(defvaralias 'ac-target 'ac-prefix) - -(defvar ac-selected-candidate nil - "Last selected candidate.") - -(defvar ac-common-part nil - "Common part string of meaningful candidates. -If there is no common part, this will be nil.") - -(defvar ac-whole-common-part nil - "Common part string of whole candidates. -If there is no common part, this will be nil.") - -(defvar ac-prefix-overlay nil - "Overlay for prefix string.") - -(defvar ac-timer nil - "Completion idle timer.") - -(defvar ac-show-menu-timer nil - "Show menu idle timer.") - -(defvar ac-quick-help-timer nil - "Quick help idle timer.") - -(defvar ac-triggered nil - "Flag to update.") - -(defvar ac-limit nil - "Limit number of candidates for each sources.") - -(defvar ac-candidates nil - "Current candidates.") - -(defvar ac-candidates-cache nil - "Candidates cache for individual sources.") - -(defvar ac-fuzzy-enable nil - "Non-nil means fuzzy matching is enabled.") - -(defvar ac-dwim-enable nil - "Non-nil means DWIM completion will be allowed.") - -(defvar ac-mode-map (make-sparse-keymap) - "Auto-complete mode map. It is also used for trigger key command. See also `ac-trigger-key'.") - -(defvar ac-completing-map - (let ((map (make-sparse-keymap))) - (define-key map "\t" 'ac-expand) - (define-key map [tab] 'ac-expand) - (define-key map "\r" 'ac-complete) - (define-key map (kbd "M-TAB") 'auto-complete) - - (define-key map "\M-n" 'ac-next) - (define-key map "\M-p" 'ac-previous) - (define-key map [down] 'ac-next) - (define-key map [up] 'ac-previous) - - (define-key map [f1] 'ac-help) - (define-key map [M-f1] 'ac-persist-help) - (define-key map (kbd "C-?") 'ac-help) - (define-key map (kbd "C-M-?") 'ac-persist-help) - - (define-key map [C-down] 'ac-quick-help-scroll-down) - (define-key map [C-up] 'ac-quick-help-scroll-up) - (define-key map "\C-\M-n" 'ac-quick-help-scroll-down) - (define-key map "\C-\M-p" 'ac-quick-help-scroll-up) - - (dotimes (i 9) - (let ((symbol (intern (format "ac-complete-select-%d" (1+ i))))) - (fset symbol - `(lambda () - (interactive) - (when (and (ac-menu-live-p) (popup-select ac-menu ,i)) - (ac-complete)))) - (define-key map (read-kbd-macro (format "M-%s" (1+ i))) symbol))) - - map) - "Keymap for completion.") -(defvaralias 'ac-complete-mode-map 'ac-completing-map) - -(defvar ac-menu-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map ac-completing-map) - (define-key map (kbd "RET") 'ac-complete) - (define-key map "\C-n" 'ac-next) - (define-key map "\C-p" 'ac-previous) - (define-key map "\C-s" 'ac-isearch) - (define-key map [mouse-1] 'ac-mouse-1) - (define-key map [down-mouse-1] 'ac-ignore) - (define-key map [mouse-4] 'ac-mouse-4) - (define-key map [mouse-5] 'ac-mouse-5) - map) - "Keymap for completion on completing menu.") - -(defvar ac-current-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map ac-completing-map) - map)) - -(defvar ac-match-function 'all-completions - "Default match function.") - -(defvar ac-prefix-definitions - '((symbol . ac-prefix-symbol) - (file . ac-prefix-file) - (valid-file . ac-prefix-valid-file) - (c-dot . ac-prefix-c-dot) - (c-dot-ref . ac-prefix-c-dot-ref) - (cc-member . ac-prefix-cc-member)) - "Prefix definitions for common use.") - -(defvar ac-sources '(ac-source-words-in-same-mode-buffers) - "Sources for completion.") -(make-variable-buffer-local 'ac-sources) - -(defvar ac-compiled-sources nil - "Compiled source of `ac-sources'.") - -(defvar ac-current-sources nil - "Current working sources. This is sublist of `ac-compiled-sources'.") - -(defvar ac-omni-completion-sources nil - "Do not use this anymore.") - -(defvar ac-current-prefix-def nil) - -(defvar ac-ignoring-prefix-def nil) - - - -;;;; Intelligent completion history - -(defvar ac-comphist nil - "Database of completion history.") - -(defsubst ac-comphist-make-tab () - (make-hash-table :test 'equal)) - -(defsubst ac-comphist-tab (db) - (nth 0 db)) - -(defsubst ac-comphist-cache (db) - (nth 1 db)) - -(defun ac-comphist-make (&optional tab) - (list (or tab (ac-comphist-make-tab)) (make-hash-table :test 'equal :weakness t))) - -(defun ac-comphist-get (db string &optional create) - (let* ((tab (ac-comphist-tab db)) - (index (gethash string tab))) - (when (and create (null index)) - (setq index (make-vector (length string) 0)) - (puthash string index tab)) - index)) - -(defun ac-comphist-add (db string prefix) - (setq prefix (min prefix (1- (length string)))) - (when (<= 0 prefix) - (setq string (substring-no-properties string)) - (let ((stat (ac-comphist-get db string t))) - (cl-incf (aref stat prefix)) - (remhash string (ac-comphist-cache db))))) - -(defun ac-comphist-score (db string prefix) - (setq prefix (min prefix (1- (length string)))) - (if (<= 0 prefix) - (let ((cache (gethash string (ac-comphist-cache db)))) - (or (and cache (aref cache prefix)) - (let ((stat (ac-comphist-get db string)) - (score 0.0)) - (when stat - (cl-loop for p from 0 below (length string) - ;; sigmoid function - with a = 5 - with b = (/ 700.0 a) ; bounds for avoiding range error in `exp' - with d = (/ 6.0 a) - for x = (max (- b) (min b (- d (abs (- prefix p))))) - for r = (/ 1.0 (1+ (exp (* (- a) x)))) - do - (cl-incf score (* (aref stat p) r)))) - ;; Weight by distance - (cl-incf score (max 0.0 (- 0.3 (/ (- (length string) prefix) 100.0)))) - (unless cache - (setq cache (make-vector (length string) nil)) - (puthash string cache (ac-comphist-cache db))) - (aset cache prefix score) - score))) - 0.0)) - -(defun ac-comphist-sort (db collection prefix &optional threshold) - (let (result - (n 0) - (total 0) - (cur 0)) - (setq result (mapcar (lambda (a) - (when (and cur threshold) - (if (>= cur (* total threshold)) - (setq cur nil) - (cl-incf n) - (cl-incf cur (cdr a)))) - (car a)) - (sort (mapcar (lambda (string) - (let ((score (ac-comphist-score db string prefix))) - (cl-incf total score) - (cons string score))) - collection) - (lambda (a b) (< (cdr b) (cdr a)))))) - (if threshold - (cons n result) - result))) - -(defun ac-comphist-serialize (db) - (let (alist) - (maphash (lambda (k v) - (push (cons k v) alist)) - (ac-comphist-tab db)) - (list alist))) - -(defun ac-comphist-deserialize (sexp) - (condition-case nil - (ac-comphist-make (let ((tab (ac-comphist-make-tab))) - (mapc (lambda (cons) - (puthash (car cons) (cdr cons) tab)) - (nth 0 sexp)) - tab)) - (error (message "Invalid comphist db.") nil))) - -(defun ac-comphist-init () - (ac-comphist-load) - (add-hook 'kill-emacs-hook 'ac-comphist-save)) - -(defun ac-comphist-load () - (interactive) - (let ((db (if (file-exists-p ac-comphist-file) - (ignore-errors - (with-temp-buffer - (insert-file-contents ac-comphist-file) - (goto-char (point-min)) - (ac-comphist-deserialize (read (current-buffer)))))))) - (setq ac-comphist (or db (ac-comphist-make))))) - -(defun ac-comphist-save () - (interactive) - (require 'pp) - (ignore-errors - (with-temp-buffer - (pp (ac-comphist-serialize ac-comphist) (current-buffer)) - (write-region (point-min) (point-max) ac-comphist-file)))) - - - -;;;; Dictionary -(defvar ac-buffer-dictionary nil) -(defvar ac-file-dictionary (make-hash-table :test 'equal)) - -(defun ac-clear-dictionary-cache () - (interactive) - (dolist (buffer (buffer-list)) - (with-current-buffer buffer - (if (local-variable-p 'ac-buffer-dictionary) - (kill-local-variable 'ac-buffer-dictionary)))) - (clrhash ac-file-dictionary)) - -(defun ac-file-dictionary (filename) - (let ((cache (gethash filename ac-file-dictionary 'none))) - (if (and cache (not (eq cache 'none))) - cache - (let (result) - (ignore-errors - (with-temp-buffer - (insert-file-contents filename) - (setq result (split-string (buffer-string) "\n" t)))) - (puthash filename result ac-file-dictionary) - result)))) - -(defun ac-mode-dictionary (mode) - (cl-loop for name in (cons (symbol-name mode) - (ignore-errors (list (file-name-extension (buffer-file-name))))) - append (cl-loop for dir in ac-dictionary-directories - for file = (concat dir "/" name) - if (file-exists-p file) - append (ac-file-dictionary file)))) - -(defun ac-buffer-dictionary (&optional buffer) - (with-current-buffer (or buffer (current-buffer)) - (if (local-variable-p 'ac-buffer-dictionary) - ac-buffer-dictionary - (make-local-variable 'ac-buffer-dictionary) - (setq ac-buffer-dictionary - (apply 'append - ac-user-dictionary - (ac-mode-dictionary major-mode) - (mapcar 'ac-file-dictionary ac-dictionary-files)))))) - - - -;;;; Auto completion internals - -(defun ac-menu-at-wrapper-line-p () - "Return non-nil if current line is long and wrapped to next visual line." - (and (not truncate-lines) - (eq (line-beginning-position) - (save-excursion - (vertical-motion 1) - (line-beginning-position))))) - -(defun ac-stop-word-p (word) - (or (member word ac-stop-words) - (if ac-use-dictionary-as-stop-words - (member word (ac-buffer-dictionary))))) - -(defun ac-prefix-default () - "Same as `ac-prefix-symbol' but ignore a number prefix." - (let ((start (ac-prefix-symbol))) - (when start - (cl-loop with end = (point) - for pos from start below end - for c = (char-after pos) - if (not (and (<= ?0 c) (<= c ?9))) - return start)))) - -(defun ac-prefix-symbol () - "Default prefix definition function." - (require 'thingatpt) - (car-safe (bounds-of-thing-at-point 'symbol))) - -(defun ac-prefix-file () - "File prefix." - (let ((point (re-search-backward "[\"<>' \t\r\n]" nil t))) - (if point (1+ point)))) - -(defsubst ac-windows-remote-file-p (file) - (and (memq system-type '(ms-dos windows-nt cygwin)) - (string-match-p "\\`\\(?://\\|\\\\\\\\\\)" file))) - -(defun ac-prefix-valid-file () - "Existed (or to be existed) file prefix." - (let* ((line-beg (line-beginning-position)) - (end (point)) - (start (or (let ((point (re-search-backward "[\"<>'= \t\r\n]" line-beg t))) - (if point (1+ point))) - line-beg)) - (file (buffer-substring start end))) - (if (and file (or (string-match "^/" file) - (and (setq file (and (string-match "^[^/]*/" file) - (match-string 0 file))) - (file-directory-p file)))) - (unless (ac-windows-remote-file-p file) - start)))) - -(defun ac-prefix-c-dot () - "C-like languages dot(.) prefix." - (if (re-search-backward "\\.\\(\\(?:[a-zA-Z0-9][_a-zA-Z0-9]*\\)?\\)\\=" nil t) - (match-beginning 1))) - -(defun ac-prefix-c-dot-ref () - "C-like languages dot(.) and reference(->) prefix." - (if (re-search-backward "\\(?:\\.\\|->\\)\\(\\(?:[a-zA-Z0-9][_a-zA-Z0-9]*\\)?\\)\\=" nil t) - (match-beginning 1))) - -(defun ac-prefix-cc-member () - "C-like languages member(.)(->)(::) prefix." - (when (re-search-backward "\\(?:\\.\\|->\\|::\\)\\(\\(?:[a-zA-Z0-9][_a-zA-Z0-9]*\\)?\\)\\=" nil t) - (match-beginning 1))) - -(defun ac-define-prefix (name prefix) - "Define new prefix definition. -You can not use it in source definition like (prefix . `NAME')." - (push (cons name prefix) ac-prefix-definitions)) - -(defun ac-match-substring (prefix candidates) - (cl-loop with regexp = (regexp-quote prefix) - for candidate in candidates - if (string-match regexp candidate) - collect candidate)) - -(defsubst ac-source-entity (source) - (if (symbolp source) - (symbol-value source) - source)) - -(defun ac-source-available-p (source) - (if (and (symbolp source) - (get source 'available)) - (eq (get source 'available) t) - (let* ((src (ac-source-entity source)) - (avail-pair (assq 'available src)) - (avail-cond (cdr avail-pair)) - (available (and (if avail-pair - (cond - ((symbolp avail-cond) - (funcall avail-cond)) - ((listp avail-cond) - (eval avail-cond))) - t) - (cl-loop for feature in (assoc-default 'depends src) - unless (require feature nil t) return nil - finally return t)))) - (if (symbolp source) - (put source 'available (if available t 'no))) - available))) - -(defun ac-compile-sources (sources) - "Compiled `SOURCES' into expanded sources style." - (cl-loop for source in sources - if (ac-source-available-p source) - do - (setq source (ac-source-entity source)) - ;; prefix - (let* ((prefix (assoc 'prefix source)) - (real (assoc-default (cdr prefix) ac-prefix-definitions))) - (cond - (real - (add-to-list 'source (cons 'prefix real))) - ((null prefix) - (add-to-list 'source (cons 'prefix 'ac-prefix-default))))) - ;; match - (let ((match (assq 'match source))) - (cond - ((eq (cdr match) 'substring) - (setcdr match 'ac-match-substring)))) - and collect source)) - -(defun ac-compiled-sources () - (or ac-compiled-sources - (setq ac-compiled-sources - (ac-compile-sources ac-sources)))) - -(defsubst ac-menu-live-p () - (popup-live-p ac-menu)) - -(defun ac-menu-create (point width height) - (setq ac-menu - (popup-create point width height - :around t - :face 'ac-candidate-face - :max-width ac-max-width - :mouse-face 'ac-candidate-mouse-face - :selection-face 'ac-selection-face - :symbol t - :scroll-bar t - :margin-left 1 - :keymap ac-menu-map - ))) - -(defun ac-menu-delete () - (when ac-menu - (popup-delete ac-menu) - (setq ac-menu nil))) - -(defsubst ac-inline-overlay () - (nth 0 ac-inline)) - -(defsubst ac-inline-live-p () - (and ac-inline (ac-inline-overlay) t)) - -(defun ac-inline-show (point string) - (unless ac-inline - (setq ac-inline (list nil))) - (save-excursion - (let ((overlay (ac-inline-overlay)) - (width 0) - (string-width (string-width string)) - (length 0) - (original-string string)) - ;; Calculate string space to show completion - (goto-char point) - (let (c) - (while (and (not (eolp)) - (< width string-width) - (setq c (char-after)) - (not (eq c ?\t))) ; special case for tab - (cl-incf width (char-width c)) - (cl-incf length) - (forward-char))) - - ;; Show completion - (goto-char point) - (cond - ((= width 0) - ;; End-of-line - ;; Do nothing - ) - ((<= width string-width) - ;; No space to show - ;; Do nothing - ) - ((> width string-width) - ;; Need to fill space - (setq string (concat string (make-string (- width string-width) ? ))))) - (setq string (propertize string 'face 'ac-completion-face)) - (if overlay - (progn - (move-overlay overlay point (+ point length)) - (overlay-put overlay 'invisible nil)) - (setq overlay (make-overlay point (+ point length))) - (setf (nth 0 ac-inline) overlay) - (overlay-put overlay 'priority 9999) - ;; Help prefix-overlay in some cases - (overlay-put overlay 'keymap ac-current-map)) - ;; TODO no width but char - (if (eq length 0) - ;; Case: End-of-line - (progn - (put-text-property 0 1 'cursor t string) - (overlay-put overlay 'after-string string)) - (let ((display (substring string 0 1)) - (after-string (substring string 1))) - (overlay-put overlay 'display display) - (overlay-put overlay 'after-string after-string))) - (overlay-put overlay 'string original-string)))) - -(defun ac-inline-delete () - (when (ac-inline-live-p) - (ac-inline-hide) - (delete-overlay (ac-inline-overlay)) - (setq ac-inline nil))) - -(defun ac-inline-hide () - (when (ac-inline-live-p) - (let ((overlay (ac-inline-overlay)) - (buffer-undo-list t)) - (when overlay - (move-overlay overlay (point-min) (point-min)) - (overlay-put overlay 'invisible t) - (overlay-put overlay 'display nil) - (overlay-put overlay 'after-string nil))))) - -(defun ac-inline-update () - (if (and ac-completing ac-prefix (stringp ac-common-part)) - (let ((common-part-length (length ac-common-part)) - (prefix-length (length ac-prefix))) - (if (> common-part-length prefix-length) - (progn - (ac-inline-hide) - (ac-inline-show (point) (substring ac-common-part prefix-length))) - (ac-inline-delete))) - (ac-inline-delete))) - -(defun ac-put-prefix-overlay () - (unless ac-prefix-overlay - (let (newline) - ;; Insert newline to make sure that cursor always on the overlay - (when (eobp) - (popup-save-buffer-state - (insert "\n")) - (setq newline t)) - (setq ac-prefix-overlay (make-overlay ac-point (1+ (point)) nil t t)) - (overlay-put ac-prefix-overlay 'priority 9999) - (overlay-put ac-prefix-overlay 'keymap (make-sparse-keymap)) - (overlay-put ac-prefix-overlay 'newline newline)))) - -(defun ac-remove-prefix-overlay () - (when ac-prefix-overlay - (when (overlay-get ac-prefix-overlay 'newline) - ;; Remove inserted newline - (popup-save-buffer-state - (goto-char (point-max)) - (if (eq (char-before) ?\n) - (delete-char -1)))) - (delete-overlay ac-prefix-overlay))) - -(defun ac-activate-completing-map () - (if (and ac-show-menu ac-use-menu-map) - (set-keymap-parent ac-current-map ac-menu-map)) - (when (and ac-use-overriding-local-map - (null overriding-terminal-local-map)) - (setq overriding-terminal-local-map ac-current-map)) - (when ac-prefix-overlay - (set-keymap-parent (overlay-get ac-prefix-overlay 'keymap) ac-current-map))) - -(defun ac-deactivate-completing-map () - (set-keymap-parent ac-current-map ac-completing-map) - (when (and ac-use-overriding-local-map - (eq overriding-terminal-local-map ac-current-map)) - (setq overriding-terminal-local-map nil)) - (when ac-prefix-overlay - (set-keymap-parent (overlay-get ac-prefix-overlay 'keymap) nil))) - -(defsubst ac-selected-candidate () - (if ac-menu - (popup-selected-item ac-menu))) - -(defun ac-prefix (requires ignore-list) - (cl-loop with current = (point) - with point - with point-def - with prefix-def - with sources - for source in (ac-compiled-sources) - for prefix = (assoc-default 'prefix source) - for req = (or (assoc-default 'requires source) requires 1) - - do - (unless (member prefix ignore-list) - (save-excursion - (setq point (cond - ((symbolp prefix) - (funcall prefix)) - ((stringp prefix) - (and (re-search-backward (concat prefix "\\=") nil t) - (or (match-beginning 1) (match-beginning 0)))) - ((stringp (car-safe prefix)) - (let ((regexp (nth 0 prefix)) - (end (nth 1 prefix)) - (group (nth 2 prefix))) - (and (re-search-backward (concat regexp "\\=") nil t) - (funcall (if end 'match-end 'match-beginning) - (or group 0))))) - (t - (eval prefix)))) - (if (and point - (integerp req) - (< (- current point) req)) - (setq point nil)) - (when point - (if (null prefix-def) - (setq prefix-def prefix - point-def point)) - (if (equal point point-def) - (push source sources))))) - - finally return - (and point-def (list prefix-def point-def (nreverse sources))))) - -(defun ac-init () - "Initialize current sources to start completion." - (setq ac-candidates-cache nil) - (cl-loop for source in ac-current-sources - for function = (assoc-default 'init source) - if function do - (save-excursion - (cond - ((functionp function) - (funcall function)) - (t - (eval function)))))) - -(defun ac-candidates-1 (source) - (let* ((do-cache (assq 'cache source)) - (function (assoc-default 'candidates source)) - (action (assoc-default 'action source)) - (document (assoc-default 'document source)) - (symbol (assoc-default 'symbol source)) - (ac-limit (or (assoc-default 'limit source) ac-limit)) - (face (or (assoc-default 'face source) (assoc-default 'candidate-face source))) - (selection-face (assoc-default 'selection-face source)) - (cache (and do-cache (assq source ac-candidates-cache))) - (candidates (cdr cache))) - (unless cache - (setq candidates (save-excursion - (cond - ((functionp function) - (funcall function)) - (t - (eval function))))) - ;; Convert (name value) format candidates into name with text properties. - (setq candidates (mapcar (lambda (candidate) - (if (consp candidate) - (propertize (car candidate) 'value (cdr candidate)) - candidate)) - candidates)) - (when do-cache - (push (cons source candidates) ac-candidates-cache))) - (setq candidates (funcall (or (assoc-default 'match source) - ac-match-function) - ac-prefix candidates)) - ;; Remove extra items regarding to ac-limit - (if (and (integerp ac-limit) (> ac-limit 1) (> (length candidates) ac-limit)) - (setcdr (nthcdr (1- ac-limit) candidates) nil)) - ;; Put candidate properties - (setq candidates (mapcar (lambda (candidate) - (popup-item-propertize candidate - 'action action - 'symbol symbol - 'document document - 'popup-face face - 'selection-face selection-face)) - candidates)) - candidates)) - -(defun ac-delete-duplicated-candidates (candidates) - (cl-delete-duplicates - candidates - :test (lambda (x y) - ;; We assume two candidates are same if their titles are - ;; equal and their actions are equal. - (and (equal x y) - (eq (popup-item-property x 'action) - (popup-item-property y 'action)))) - :from-end t)) - -(defun ac-reduce-candidates (candidates) - ;; Call `ac-delete-duplicated-candidates' on first portion of - ;; candidate list for speed. - (let ((size 20)) - (if (< (length candidates) size) - (ac-delete-duplicated-candidates candidates) - (cl-loop for c on candidates by 'cdr - repeat (1- size) - finally return - (let ((rest (cdr c))) - (setcdr c nil) - (append (ac-delete-duplicated-candidates candidates) (copy-sequence rest))))))) - -(defun ac-candidates () - "Produce candidates for current sources." - (cl-loop with completion-ignore-case = (or (eq ac-ignore-case t) - (and (eq ac-ignore-case 'smart) - (let ((case-fold-search nil)) (not (string-match "[[:upper:]]" ac-prefix))))) - with case-fold-search = completion-ignore-case - with prefix-len = (length ac-prefix) - for source in ac-current-sources - append (ac-candidates-1 source) into candidates - finally return - (progn - (if (and ac-use-comphist ac-comphist) - (if ac-show-menu - (let* ((pair (ac-comphist-sort ac-comphist candidates prefix-len ac-comphist-threshold)) - (n (car pair)) - (result (ac-reduce-candidates (cdr pair))) - (cons (if (> n 0) (nthcdr (1- n) result))) - (cdr (cdr cons))) - ;; XXX ugly - (if cons (setcdr cons nil)) - (setq ac-common-part (try-completion ac-prefix result)) - (setq ac-whole-common-part (try-completion ac-prefix candidates)) - (if cons (setcdr cons cdr)) - result) - (setq candidates (ac-comphist-sort ac-comphist candidates prefix-len)) - (setq ac-common-part (if candidates (popup-x-to-string (car candidates)))) - (setq ac-whole-common-part (try-completion ac-prefix candidates)) - candidates) - (when ac-show-menu - (setq candidates (ac-reduce-candidates candidates))) - (setq ac-common-part (try-completion ac-prefix candidates)) - (setq ac-whole-common-part ac-common-part) - candidates)))) - -(defun ac-update-candidates (cursor scroll-top) - "Update candidates of menu to `ac-candidates' and redraw it." - (setf (popup-cursor ac-menu) cursor - (popup-scroll-top ac-menu) scroll-top) - (setq ac-dwim-enable (= (length ac-candidates) 1)) - (if ac-candidates - (progn - (setq ac-completing t) - (ac-activate-completing-map)) - (setq ac-completing nil) - (ac-deactivate-completing-map)) - (unless ac-disable-inline - (ac-inline-update)) - (popup-set-list ac-menu ac-candidates) - (if (and (not ac-fuzzy-enable) - (<= (length ac-candidates) ac-candidate-menu-min)) - (popup-hide ac-menu) - (if ac-show-menu - (popup-draw ac-menu)))) - -(defun ac-reposition () - "Force to redraw candidate menu with current `ac-candidates'." - (let ((cursor (popup-cursor ac-menu)) - (scroll-top (popup-scroll-top ac-menu)) - (height (popup-height ac-menu))) - (ac-menu-delete) - (ac-menu-create ac-point (popup-preferred-width ac-candidates) height) - (ac-update-candidates cursor scroll-top))) - -(defun ac-cleanup () - "Cleanup auto completion." - (if ac-cursor-color - (set-cursor-color ac-cursor-color)) - (when (and ac-use-comphist ac-comphist) - (when (and (null ac-selected-candidate) - (member ac-prefix ac-candidates)) - ;; Assume candidate is selected by just typing - (setq ac-selected-candidate ac-prefix) - (setq ac-last-point ac-point)) - (when ac-selected-candidate - (ac-comphist-add ac-comphist - ac-selected-candidate - (if ac-last-point - (- ac-last-point ac-point) - (length ac-prefix))))) - (ac-deactivate-completing-map) - (ac-remove-prefix-overlay) - (ac-remove-quick-help) - (ac-inline-delete) - (ac-menu-delete) - (ac-cancel-timer) - (ac-cancel-show-menu-timer) - (ac-cancel-quick-help-timer) - (setq ac-cursor-color nil - ac-inline nil - ac-show-menu nil - ac-menu nil - ac-completing nil - ac-point nil - ac-last-point nil - ac-prefix nil - ac-prefix-overlay nil - ac-selected-candidate nil - ac-common-part nil - ac-whole-common-part nil - ac-triggered nil - ac-limit nil - ac-candidates nil - ac-candidates-cache nil - ac-fuzzy-enable nil - ac-dwim-enable nil - ac-compiled-sources nil - ac-current-sources nil - ac-current-prefix-def nil - ac-ignoring-prefix-def nil)) - -(defsubst ac-abort () - "Abort completion." - (ac-cleanup)) - -(defun ac-extend-region-to-delete (string) - "Determine the boundary of the region to delete before -inserting the completed string. This will be either the position -of current point, or the end of the symbol at point, if the text -from point to end of symbol is the right part of the completed -string." - (let* ((end-of-symbol (or (cdr-safe (bounds-of-thing-at-point 'symbol)) - (point))) - (remaindar (buffer-substring-no-properties (point) end-of-symbol)) - (remaindar-length (length remaindar))) - (if (and (>= (length string) remaindar-length) - (string= (substring-no-properties string (- remaindar-length)) - remaindar)) - end-of-symbol - (point)))) - -(defun ac-expand-string (string &optional remove-undo-boundary) - "Expand `STRING' into the buffer and update `ac-prefix' to `STRING'. -This function records deletion and insertion sequences by `undo-boundary'. -If `remove-undo-boundary' is non-nil, this function also removes `undo-boundary' -that have been made before in this function. When `buffer-undo-list' is -`t', `remove-undo-boundary' has no effect." - (when (eq buffer-undo-list t) - (setq remove-undo-boundary nil)) - (when (not (equal string (buffer-substring ac-point (point)))) - (undo-boundary) - ;; We can't use primitive-undo since it undoes by - ;; groups, divided by boundaries. - ;; We don't want boundary between deletion and insertion. - ;; So do it manually. - ;; Delete region silently for undo: - (if remove-undo-boundary - (progn - (let (buffer-undo-list) - (save-excursion - (delete-region ac-point (ac-extend-region-to-delete string)))) - (setq buffer-undo-list - (nthcdr 2 buffer-undo-list))) - (delete-region ac-point (ac-extend-region-to-delete string))) - (insert (substring-no-properties string)) - ;; Sometimes, possible when omni-completion used, (insert) added - ;; to buffer-undo-list strange record about position changes. - ;; Delete it here: - (when (and remove-undo-boundary - (integerp (cadr buffer-undo-list))) - (setcdr buffer-undo-list (nthcdr 2 buffer-undo-list))) - (undo-boundary) - (setq ac-selected-candidate string) - (setq ac-prefix string))) - -(defun ac-set-trigger-key (key) - "Set `ac-trigger-key' to `KEY'. It is recommemded to use this function instead of calling `setq'." - ;; Remove old mapping - (when ac-trigger-key - (define-key ac-mode-map (read-kbd-macro ac-trigger-key) nil)) - - ;; Make new mapping - (setq ac-trigger-key key) - (when key - (define-key ac-mode-map (read-kbd-macro key) 'ac-trigger-key-command))) - -(defun ac-set-timer () - (unless ac-timer - (setq ac-timer (run-with-idle-timer ac-delay ac-delay 'ac-update-greedy)))) - -(defun ac-cancel-timer () - (when (timerp ac-timer) - (cancel-timer ac-timer) - (setq ac-timer nil))) - -(defun ac-update (&optional force) - (when (and auto-complete-mode - ac-prefix - (or ac-triggered - force) - (not isearch-mode)) - (ac-put-prefix-overlay) - (setq ac-candidates (ac-candidates)) - (let ((preferred-width (popup-preferred-width ac-candidates))) - ;; Reposition if needed - (when (or (null ac-menu) - (>= (popup-width ac-menu) preferred-width) - (<= (popup-width ac-menu) (- preferred-width 10)) - (and (> (popup-direction ac-menu) 0) - (ac-menu-at-wrapper-line-p))) - (ac-inline-hide) ; Hide overlay to calculate correct column - (ac-remove-quick-help) - (ac-menu-delete) - (ac-menu-create ac-point preferred-width ac-menu-height))) - (ac-update-candidates 0 0) - t)) - -(defun ac-update-greedy (&optional force) - (let (result) - (while (when (and (setq result (ac-update force)) - (null ac-candidates)) - (add-to-list 'ac-ignoring-prefix-def ac-current-prefix-def) - (ac-start :force-init t) - ac-current-prefix-def)) - result)) - -(defun ac-set-show-menu-timer () - (when (and (or (integerp ac-auto-show-menu) (floatp ac-auto-show-menu)) - (null ac-show-menu-timer)) - (setq ac-show-menu-timer (run-with-idle-timer ac-auto-show-menu ac-auto-show-menu 'ac-show-menu)))) - -(defun ac-cancel-show-menu-timer () - (when (timerp ac-show-menu-timer) - (cancel-timer ac-show-menu-timer) - (setq ac-show-menu-timer nil))) - -(defun ac-show-menu () - (when (not (eq ac-show-menu t)) - (setq ac-show-menu t) - (ac-inline-hide) - (ac-remove-quick-help) - (ac-update t))) - -(defun ac-help (&optional persist) - (interactive "P") - (when ac-menu - (popup-menu-show-help ac-menu persist))) - -(defun ac-persist-help () - (interactive) - (ac-help t)) - -(defun ac-last-help (&optional persist) - (interactive "P") - (when ac-last-completion - (popup-item-show-help (cdr ac-last-completion) persist))) - -(defun ac-last-persist-help () - (interactive) - (ac-last-help t)) - -(defun ac-set-quick-help-timer () - (when (and ac-use-quick-help - (null ac-quick-help-timer)) - (setq ac-quick-help-timer (run-with-idle-timer ac-quick-help-delay ac-quick-help-delay 'ac-quick-help)))) - -(defun ac-cancel-quick-help-timer () - (when (timerp ac-quick-help-timer) - (cancel-timer ac-quick-help-timer) - (setq ac-quick-help-timer nil))) - -(defun ac-pos-tip-show-quick-help (menu &optional item &rest args) - (let* ((point (plist-get args :point)) - (around nil) - (parent-offset (popup-offset menu)) - (doc (popup-menu-documentation menu item))) - (when (stringp doc) - (if (popup-hidden-p menu) - (setq around t) - (setq point nil)) - (with-no-warnings - (pos-tip-show doc - 'popup-tip-face - (or point - (and menu - (popup-child-point menu parent-offset)) - (point)) - nil 300 - popup-tip-max-width - nil nil - (and (not around) 0)) - (unless (plist-get args :nowait) - (clear-this-command-keys) - (unwind-protect - (push (read-event (plist-get args :prompt)) unread-command-events) - (pos-tip-hide)) - t))))) - -(defun ac-quick-help-use-pos-tip-p () - (and ac-quick-help-prefer-pos-tip - window-system - (featurep 'pos-tip))) - -(defun ac-quick-help (&optional force) - (interactive) - ;; TODO don't use FORCE - (when (and (or force - (with-no-warnings - ;; called-interactively-p can take no args - (called-interactively-p)) - ;; ac-isearch'ing - (null this-command)) - (ac-menu-live-p) - (null ac-quick-help)) - (setq ac-quick-help - (funcall (if (ac-quick-help-use-pos-tip-p) - 'ac-pos-tip-show-quick-help - 'popup-menu-show-quick-help) - ac-menu nil - :point ac-point - :height ac-quick-help-height - :nowait t)))) - -(defun ac-remove-quick-help () - (when (ac-quick-help-use-pos-tip-p) - (with-no-warnings - (pos-tip-hide))) - (when ac-quick-help - (popup-delete ac-quick-help) - (setq ac-quick-help nil))) - -(defun ac-last-quick-help () - (interactive) - (when (and ac-last-completion - (eq (marker-buffer (car ac-last-completion)) - (current-buffer))) - (let ((doc (popup-item-documentation (cdr ac-last-completion))) - (point (marker-position (car ac-last-completion)))) - (when (stringp doc) - (if (ac-quick-help-use-pos-tip-p) - (with-no-warnings (pos-tip-show doc nil point nil 300)) - (popup-tip doc - :point point - :around t - :scroll-bar t - :margin t)))))) - -(defmacro ac-define-quick-help-command (name arglist &rest body) - (declare (indent 2)) - `(progn - (defun ,name ,arglist ,@body) - (put ',name 'ac-quick-help-command t))) - -(ac-define-quick-help-command ac-quick-help-scroll-down () - (interactive) - (when ac-quick-help - (popup-scroll-down ac-quick-help))) - -(ac-define-quick-help-command ac-quick-help-scroll-up () - (interactive) - (when ac-quick-help - (popup-scroll-up ac-quick-help))) - - - -;;;; Auto completion isearch - -(defun ac-isearch-callback (list) - (setq ac-dwim-enable (eq (length list) 1))) - -(defun ac-isearch () - (interactive) - (when (ac-menu-live-p) - (ac-cancel-show-menu-timer) - (ac-show-menu) - (if ac-use-quick-help - (let ((popup-menu-show-quick-help-function - (if (ac-quick-help-use-pos-tip-p) - 'ac-pos-tip-show-quick-help - 'popup-menu-show-quick-help))) - (popup-isearch ac-menu - :callback 'ac-isearch-callback - :help-delay ac-quick-help-delay)) - (popup-isearch ac-menu :callback 'ac-isearch-callback)))) - - - -;;;; Auto completion commands - -(cl-defun auto-complete-1 (&key sources (triggered 'command)) - (let ((menu-live (ac-menu-live-p)) - (inline-live (ac-inline-live-p)) - started) - (ac-abort) - (let ((ac-sources (or sources ac-sources))) - (if (or ac-show-menu-immediately-on-auto-complete - inline-live) - (setq ac-show-menu t)) - (setq started (ac-start :triggered triggered))) - (when (ac-update-greedy t) - ;; TODO Not to cause inline completion to be disrupted. - (if (ac-inline-live-p) - (ac-inline-hide)) - ;; Not to expand when it is first time to complete - (when (and (or (and (not ac-expand-on-auto-complete) - (> (length ac-candidates) 1) - (not menu-live)) - (not (let ((ac-common-part ac-whole-common-part)) - (ac-expand-common)))) - ac-use-fuzzy - (null ac-candidates)) - (ac-fuzzy-complete))) - started)) - -;;;###autoload -(defun auto-complete (&optional sources) - "Start auto-completion at current point." - (interactive) - (auto-complete-1 :sources sources)) - -(defun ac-fuzzy-complete () - "Start fuzzy completion at current point." - (interactive) - (if (not (require 'fuzzy nil t)) - (message "Please install fuzzy.el if you use fuzzy completion") - (unless (ac-menu-live-p) - (ac-start)) - (let ((ac-match-function 'fuzzy-all-completions)) - (when ac-fuzzy-cursor-color - (unless ac-cursor-color - (setq ac-cursor-color (frame-parameter (selected-frame) 'cursor-color))) - (set-cursor-color ac-fuzzy-cursor-color)) - (setq ac-show-menu t) - (setq ac-fuzzy-enable t) - (setq ac-triggered nil) - (ac-update t))) - t) - -(defun ac-next () - "Select next candidate." - (interactive) - (when (ac-menu-live-p) - (when (popup-hidden-p ac-menu) - (ac-show-menu)) - (popup-next ac-menu) - (if (eq this-command 'ac-next) - (setq ac-dwim-enable t)))) - -(defun ac-previous () - "Select previous candidate." - (interactive) - (when (ac-menu-live-p) - (when (popup-hidden-p ac-menu) - (ac-show-menu)) - (popup-previous ac-menu) - (if (eq this-command 'ac-previous) - (setq ac-dwim-enable t)))) - -(defun ac-expand (arg) - "Try expand, and if expanded twice, select next candidate. -If given a prefix argument, select the previous candidate." - (interactive "P") - (unless (ac-expand-common) - (let ((string (ac-selected-candidate))) - (when string - (when (equal ac-prefix string) - (if (not arg) - (ac-next) - (ac-previous)) - (setq string (ac-selected-candidate))) - (ac-expand-string string - (or (eq last-command 'ac-expand) - (eq last-command 'ac-expand-previous))) - ;; Do reposition if menu at long line - (if (and (> (popup-direction ac-menu) 0) - (ac-menu-at-wrapper-line-p)) - (ac-reposition)) - (setq ac-show-menu t) - string)))) - -(defun ac-expand-previous (arg) - "Like `ac-expand', but select previous candidate." - (interactive "P") - (ac-expand (not arg))) - -(defun ac-expand-common () - "Try to expand meaningful common part." - (interactive) - (if (and ac-dwim ac-dwim-enable) - (ac-complete) - (when (and (ac-inline-live-p) - ac-common-part) - (ac-inline-hide) - (ac-expand-string ac-common-part (eq last-command this-command)) - (setq ac-common-part nil) - t))) - -(defun ac-complete-1 (candidate) - (let ((action (popup-item-property candidate 'action)) - (fallback nil)) - (when candidate - (unless (ac-expand-string candidate) - (setq fallback t)) - ;; Remember to show help later - (when (and ac-point candidate) - (unless ac-last-completion - (setq ac-last-completion (cons (make-marker) nil))) - (set-marker (car ac-last-completion) ac-point ac-buffer) - (setcdr ac-last-completion candidate))) - (ac-abort) - (cond - (action - (funcall action)) - (fallback - (ac-fallback-command))) - candidate)) - -(defun ac-complete () - "Try complete." - (interactive) - (ac-complete-1 (ac-selected-candidate))) - -(cl-defun ac-start (&key - requires - force-init - (triggered (or ac-triggered t))) - "Start completion." - (interactive) - (if (not auto-complete-mode) - (message "auto-complete-mode is not enabled") - (let* ((info (ac-prefix requires ac-ignoring-prefix-def)) - (prefix-def (nth 0 info)) - (point (nth 1 info)) - (sources (nth 2 info)) - prefix - (init (or force-init (not (eq ac-point point))))) - (if (or (null point) - (progn - (setq prefix (buffer-substring-no-properties point (point))) - (and (not (eq triggered 'command)) - (ac-stop-word-p prefix)))) - (prog1 nil - (ac-abort)) - (when (and ac-use-fuzzy ac-fuzzy-cursor-color) - (unless ac-cursor-color - (setq ac-cursor-color (frame-parameter (selected-frame) 'cursor-color)))) - (setq ac-show-menu (or ac-show-menu (if (eq ac-auto-show-menu t) t)) - ac-current-sources sources - ac-buffer (current-buffer) - ac-point point - ac-prefix prefix - ac-limit ac-candidate-limit - ac-triggered triggered - ac-current-prefix-def prefix-def) - (when (or init (null ac-prefix-overlay)) - (ac-init)) - (ac-set-timer) - (ac-set-show-menu-timer) - (ac-set-quick-help-timer) - (ac-put-prefix-overlay) - t)))) - -(defun ac-stop () - "Stop completing." - (interactive) - (setq ac-selected-candidate nil) - (ac-abort)) - -(defun ac-ignore (&rest ignore) - "Same as `ignore'." - (interactive)) - -(defun ac-mouse-1 (event) - (interactive "e") - (popup-awhen (popup-menu-item-of-mouse-event event) - (ac-complete-1 it))) - -(defun ac-mouse-4 (event) - (interactive "e") - (ac-previous)) - -(defun ac-mouse-5 (event) - (interactive "e") - (ac-next)) - -(defun ac-trigger-key-command (&optional force) - (interactive "P") - (let (started) - (when (or force (ac-trigger-command-p last-command)) - (setq started (auto-complete-1 :triggered 'trigger-key))) - (unless started - (ac-fallback-command 'ac-trigger-key-command)))) - - - -;;;; Basic cache facility - -(defvar ac-clear-variables-every-minute-timer nil) -(defvar ac-clear-variables-after-save nil) -(defvar ac-clear-variables-every-minute nil) -(defvar ac-minutes-counter 0) - -(defun ac-clear-variable-after-save (variable &optional pred) - (add-to-list 'ac-clear-variables-after-save (cons variable pred))) - -(defun ac-clear-variables-after-save () - (dolist (pair ac-clear-variables-after-save) - (if (or (null (cdr pair)) - (funcall (cdr pair))) - (set (car pair) nil)))) - -(defun ac-clear-variable-every-minutes (variable minutes) - (add-to-list 'ac-clear-variables-every-minute (cons variable minutes))) - -(defun ac-clear-variable-every-minute (variable) - (ac-clear-variable-every-minutes variable 1)) - -(defun ac-clear-variable-every-10-minutes (variable) - (ac-clear-variable-every-minutes variable 10)) - -(defun ac-clear-variables-every-minute () - (cl-incf ac-minutes-counter) - (dolist (pair ac-clear-variables-every-minute) - (if (eq (% ac-minutes-counter (cdr pair)) 0) - (set (car pair) nil)))) - - - -;;;; Auto complete mode - -(defun ac-cursor-on-diable-face-p (&optional point) - (memq (get-text-property (or point (point)) 'face) ac-disable-faces)) - -(defun ac-trigger-command-p (command) - "Return non-nil if `COMMAND' is a trigger command." - (and (symbolp command) - (not (memq command ac-non-trigger-commands)) - (or (memq command ac-trigger-commands) - (string-match "self-insert-command" (symbol-name command)) - (string-match "electric" (symbol-name command))))) - -(defun ac-fallback-key-sequence () - (setq unread-command-events - (append (this-single-command-raw-keys) - unread-command-events)) - (read-key-sequence-vector "")) - -(defun ac-fallback-command (&optional except-command) - (let* ((auto-complete-mode nil) - (keys (ac-fallback-key-sequence)) - (command (and keys (key-binding keys)))) - (when (and (commandp command) - (not (eq command except-command))) - (setq this-command command) - (call-interactively command)))) - -(defun ac-compatible-package-command-p (command) - "Return non-nil if `COMMAND' is compatible with auto-complete." - (and (symbolp command) - (string-match ac-compatible-packages-regexp (symbol-name command)))) - -(defun ac-handle-pre-command () - (condition-case var - (if (or (setq ac-triggered (and (not ac-fuzzy-enable) ; ignore key storkes in fuzzy mode - (or (eq this-command 'auto-complete) ; special case - (ac-trigger-command-p this-command) - (and ac-completing - (memq this-command ac-trigger-commands-on-completing))) - (not (ac-cursor-on-diable-face-p)) - (or ac-triggered t))) - (ac-compatible-package-command-p this-command)) - (progn - (if (or (not (symbolp this-command)) - (not (get this-command 'ac-quick-help-command))) - (ac-remove-quick-help)) - ;; Not to cause inline completion to be disrupted. - (ac-inline-hide)) - (ac-abort)) - (error (ac-error var)))) - -(defun ac-handle-post-command () - (condition-case var - (when (and ac-triggered - (or ac-auto-start - ac-completing) - (not isearch-mode)) - (setq ac-last-point (point)) - (ac-start :requires (unless ac-completing ac-auto-start)) - (unless ac-disable-inline - (ac-inline-update))) - (error (ac-error var)))) - -(defvar ac-flycheck-poll-completion-end-timer nil - "Timer to poll end of completion.") - -(defun ac-syntax-checker-workaround () - (if ac-stop-flymake-on-completing - (progn - (make-local-variable 'ac-flycheck-poll-completion-end-timer) - (when (require 'flymake nil t) - (defadvice flymake-on-timer-event (around ac-flymake-stop-advice activate) - (unless ac-completing - ad-do-it))) - (when (require 'flycheck nil t) - (defadvice flycheck-handle-idle-change (around ac-flycheck-stop-advice activate) - (if ac-completing - (setq ac-flycheck-poll-completion-end-timer - (run-at-time ac-flycheck-poll-completion-end-interval - nil - #'flycheck-handle-idle-change)) - ad-do-it)))) - (when (featurep 'flymake) - (ad-disable-advice 'flymake-on-timer-event 'around 'ac-flymake-stop-advice)) - (when (featurep 'flycheck) - (ad-disable-advice 'flycheck-handle-idle-change 'around 'ac-flycheck-stop-advice)))) - -(defun ac-setup () - (if ac-trigger-key - (ac-set-trigger-key ac-trigger-key)) - (if ac-use-comphist - (ac-comphist-init)) - (unless ac-clear-variables-every-minute-timer - (setq ac-clear-variables-every-minute-timer (run-with-timer 60 60 'ac-clear-variables-every-minute))) - (ac-syntax-checker-workaround)) - -;;;###autoload -(define-minor-mode auto-complete-mode - "AutoComplete mode" - :lighter " AC" - :keymap ac-mode-map - :group 'auto-complete - (if auto-complete-mode - (progn - (ac-setup) - (add-hook 'pre-command-hook 'ac-handle-pre-command nil t) - (add-hook 'post-command-hook 'ac-handle-post-command nil t) - (add-hook 'after-save-hook 'ac-clear-variables-after-save nil t) - (run-hooks 'auto-complete-mode-hook)) - (remove-hook 'pre-command-hook 'ac-handle-pre-command t) - (remove-hook 'post-command-hook 'ac-handle-post-command t) - (remove-hook 'after-save-hook 'ac-clear-variables-after-save t) - (ac-abort))) - -(defun auto-complete-mode-maybe () - "What buffer `auto-complete-mode' prefers." - (if (and (not (minibufferp (current-buffer))) - (memq major-mode ac-modes)) - (auto-complete-mode 1))) - -;;;###autoload -(define-global-minor-mode global-auto-complete-mode - auto-complete-mode auto-complete-mode-maybe - :group 'auto-complete) - - - -;;;; Compatibilities with other extensions - -(defun ac-flyspell-workaround () - "Flyspell uses `sit-for' for delaying its process. Unfortunatelly, -it stops auto completion which is trigger with `run-with-idle-timer'. -This workaround avoid flyspell processes when auto completion is being started." - (interactive) - (defadvice flyspell-post-command-hook (around ac-flyspell-workaround activate) - (unless ac-triggered - ad-do-it))) - -(defun ac-linum-workaround () - "linum-mode tries to display the line numbers even for the -completion menu. This workaround stops that annoying behavior." - (interactive) - (defadvice linum-update (around ac-linum-update-workaround activate) - (unless ac-completing - ad-do-it))) - - - -;;;; Standard sources - -(defmacro ac-define-source (name source) - "Source definition macro. It defines a complete command also." - (declare (indent 1)) - `(progn - (defvar ,(intern (format "ac-source-%s" name))) - ;; Use `setq' to reset ac-source-NAME every time - ;; `ac-define-source' is called. This is useful, for example - ;; when evaluating `ac-define-source' using C-M-x (`eval-defun'). - (setq ,(intern (format "ac-source-%s" name)) ,source) - (defun ,(intern (format "ac-complete-%s" name)) () - (interactive) - (auto-complete '(,(intern (format "ac-source-%s" name))))))) - -;; Words in buffer source -(defvar ac-word-index nil) - -(defun ac-candidate-words-in-buffer (point prefix limit) - (let ((i 0) - candidate - candidates - (regexp (concat "\\_<" (regexp-quote prefix) "\\(\\sw\\|\\s_\\)+\\_>"))) - (save-excursion - ;; Search backward - (goto-char point) - (while (and (or (not (integerp limit)) (< i limit)) - (re-search-backward regexp nil t)) - (setq candidate (match-string-no-properties 0)) - (unless (member candidate candidates) - (push candidate candidates) - (cl-incf i))) - ;; Search backward - (goto-char (+ point (length prefix))) - (while (and (or (not (integerp limit)) (< i limit)) - (re-search-forward regexp nil t)) - (setq candidate (match-string-no-properties 0)) - (unless (member candidate candidates) - (push candidate candidates) - (cl-incf i))) - (nreverse candidates)))) - -(defun ac-incremental-update-word-index () - (unless (local-variable-p 'ac-word-index) - (make-local-variable 'ac-word-index)) - (if (null ac-word-index) - (setq ac-word-index (cons nil nil))) - ;; Mark incomplete - (if (car ac-word-index) - (setcar ac-word-index nil)) - (let ((index (cdr ac-word-index)) - (words (ac-candidate-words-in-buffer ac-point ac-prefix (or (and (integerp ac-limit) ac-limit) 10)))) - (dolist (word words) - (unless (member word index) - (push word index) - (setcdr ac-word-index index))))) - -(defun ac-update-word-index-1 () - (unless (local-variable-p 'ac-word-index) - (make-local-variable 'ac-word-index)) - (when (and (not (car ac-word-index)) - (< (buffer-size) 1048576)) - ;; Complete index - (setq ac-word-index - (cons t - (split-string (buffer-substring-no-properties (point-min) (point-max)) - "\\(?:^\\|\\_>\\).*?\\(?:\\_<\\|$\\)"))))) - -(defun ac-update-word-index () - (dolist (buffer (buffer-list)) - (when (or ac-fuzzy-enable - (not (eq buffer (current-buffer)))) - (with-current-buffer buffer - (ac-update-word-index-1))))) - -(defun ac-word-candidates (&optional buffer-pred) - (cl-loop initially (unless ac-fuzzy-enable (ac-incremental-update-word-index)) - for buffer in (buffer-list) - if (and (or (not (integerp ac-limit)) (< (length candidates) ac-limit)) - (if buffer-pred (funcall buffer-pred buffer) t)) - append (funcall ac-match-function - ac-prefix - (and (local-variable-p 'ac-word-index buffer) - (cdr (buffer-local-value 'ac-word-index buffer)))) - into candidates - finally return (delete-dups candidates))) - -(ac-define-source words-in-buffer - '((candidates . ac-word-candidates))) - -(ac-define-source words-in-all-buffer - '((init . ac-update-word-index) - (candidates . ac-word-candidates))) - -(ac-define-source words-in-same-mode-buffers - '((init . ac-update-word-index) - (candidates . (ac-word-candidates - (lambda (buffer) - (derived-mode-p (buffer-local-value 'major-mode buffer))))))) - -;; Lisp symbols source -(defvar ac-symbols-cache nil) -(ac-clear-variable-every-10-minutes 'ac-symbols-cache) - -(defun ac-symbol-file (symbol type) - (if (fboundp 'find-lisp-object-file-name) - (find-lisp-object-file-name symbol type) - (let ((file-name (with-no-warnings - (describe-simplify-lib-file-name - (symbol-file symbol type))))) - (when (equal file-name "loaddefs.el") - ;; Find the real def site of the preloaded object. - (let ((location (condition-case nil - (if (eq type 'defun) - (find-function-search-for-symbol symbol nil - "loaddefs.el") - (find-variable-noselect symbol file-name)) - (error nil)))) - (when location - (with-current-buffer (car location) - (when (cdr location) - (goto-char (cdr location))) - (when (re-search-backward - "^;;; Generated autoloads from \\(.*\\)" nil t) - (setq file-name (match-string 1))))))) - (if (and (null file-name) - (or (eq type 'defun) - (integerp (get symbol 'variable-documentation)))) - ;; It's a object not defined in Elisp but in C. - (if (get-buffer " *DOC*") - (if (eq type 'defun) - (help-C-file-name (symbol-function symbol) 'subr) - (help-C-file-name symbol 'var)) - 'C-source) - file-name)))) - -(defun ac-symbol-documentation (symbol) - (if (stringp symbol) - (setq symbol (intern-soft symbol))) - (ignore-errors - (with-temp-buffer - (let ((standard-output (current-buffer))) - (prin1 symbol) - (princ " is ") - (cond - ((fboundp symbol) - ;; import help-xref-following - (require 'help-mode) - (let ((help-xref-following t) - (major-mode 'help-mode)) ; avoid error in Emacs 24 - (describe-function-1 symbol)) - (buffer-string)) - ((boundp symbol) - (let ((file-name (ac-symbol-file symbol 'defvar))) - (princ "a variable") - (when file-name - (princ " defined in `") - (princ (if (eq file-name 'C-source) - "C source code" - (file-name-nondirectory file-name)))) - (princ "'.\n\n") - (princ (or (documentation-property symbol 'variable-documentation t) - "Not documented.")) - (buffer-string))) - ((facep symbol) - (let ((file-name (ac-symbol-file symbol 'defface))) - (princ "a face") - (when file-name - (princ " defined in `") - (princ (if (eq file-name 'C-source) - "C source code" - (file-name-nondirectory file-name)))) - (princ "'.\n\n") - (princ (or (documentation-property symbol 'face-documentation t) - "Not documented.")) - (buffer-string))) - (t - (let ((doc (documentation-property symbol 'group-documentation t))) - (when doc - (princ "a group.\n\n") - (princ doc) - (buffer-string))))))))) - -(defun ac-symbol-candidates () - (or ac-symbols-cache - (setq ac-symbols-cache - (cl-loop for x being the symbols - if (or (fboundp x) - (boundp x) - (symbol-plist x)) - collect (symbol-name x))))) - -(ac-define-source symbols - '((candidates . ac-symbol-candidates) - (document . ac-symbol-documentation) - (symbol . "s") - (cache))) - -;; Lisp functions source -(defvar ac-functions-cache nil) -(ac-clear-variable-every-10-minutes 'ac-functions-cache) - -(defun ac-function-candidates () - (or ac-functions-cache - (setq ac-functions-cache - (cl-loop for x being the symbols - if (fboundp x) - collect (symbol-name x))))) - -(ac-define-source functions - '((candidates . ac-function-candidates) - (document . ac-symbol-documentation) - (symbol . "f") - (prefix . "(\\(\\(?:\\sw\\|\\s_\\)+\\)") - (cache))) - -;; Lisp variables source -(defvar ac-variables-cache nil) -(ac-clear-variable-every-10-minutes 'ac-variables-cache) - -(defun ac-variable-candidates () - (or ac-variables-cache - (setq ac-variables-cache - (cl-loop for x being the symbols - if (boundp x) - collect (symbol-name x))))) - -(ac-define-source variables - '((candidates . ac-variable-candidates) - (document . ac-symbol-documentation) - (symbol . "v") - (cache))) - -;; Lisp features source -(defvar ac-emacs-lisp-features nil) -(ac-clear-variable-every-10-minutes 'ac-emacs-lisp-features) - -(defun ac-emacs-lisp-feature-candidates () - (or ac-emacs-lisp-features - (if (fboundp 'find-library-suffixes) - (let ((suffix (concat (regexp-opt (find-library-suffixes) t) "\\'"))) - (setq ac-emacs-lisp-features - (append (mapcar 'prin1-to-string features) - (cl-loop for dir in load-path - if (file-directory-p dir) - append (cl-loop for file in (directory-files dir) - if (string-match suffix file) - collect (substring file 0 (match-beginning 0)))))))))) - -(ac-define-source features - '((depends find-func) - (candidates . ac-emacs-lisp-feature-candidates) - (prefix . "require +'\\(\\(?:\\sw\\|\\s_\\)*\\)") - (requires . 0))) - -(defvaralias 'ac-source-emacs-lisp-features 'ac-source-features) - -;; Abbrev source -(ac-define-source abbrev - '((candidates . (mapcar 'popup-x-to-string (append (vconcat local-abbrev-table global-abbrev-table) nil))) - (action . expand-abbrev) - (symbol . "a") - (cache))) - -;; Files in current directory source -(ac-define-source files-in-current-dir - '((candidates . (directory-files default-directory)) - (cache))) - -;; Filename source -(defvar ac-filename-cache nil) - -(defun ac-filename-candidate () - (let (file-name-handler-alist) - (unless (or (and comment-start-skip - (string-match comment-start-skip ac-prefix)) - (file-regular-p ac-prefix)) - (ignore-errors - (cl-loop with dir = (file-name-directory ac-prefix) - with files = (or (assoc-default dir ac-filename-cache) - (let ((files (directory-files dir nil "^[^.]"))) - (push (cons dir files) ac-filename-cache) - files)) - for file in files - for path = (concat dir file) - collect (if (file-directory-p path) - (concat path "/") - path)))))) - -(ac-define-source filename - '((init . (setq ac-filename-cache nil)) - (candidates . ac-filename-candidate) - (prefix . valid-file) - (requires . 0) - (action . ac-start) - (limit . nil))) - -;; Dictionary source -(ac-define-source dictionary - '((candidates . ac-buffer-dictionary) - (symbol . "d"))) - -(provide 'auto-complete) -;;; auto-complete.el ends here diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/ada-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/ada-mode deleted file mode 100644 index bea538f..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/ada-mode +++ /dev/null @@ -1,72 +0,0 @@ -abort -abs -abstract -accept -access -aliased -all -and -array -at -begin -body -case -constant -declare -delay -delta -digits -do -else -elsif -end -entry -exception -exit -for -function -generic -goto -if -in -interface -is -limited -loop -mod -new -not -null -of -or -others -out -overriding -package -pragma -private -procedure -protected -raise -range -record -rem -renames -requeue -return -reverse -select -separate -subtype -synchronized -tagged -task -terminate -then -type -until -use -when -while -with -xor diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/c++-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/c++-mode deleted file mode 100644 index 292dd8a..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/c++-mode +++ /dev/null @@ -1,99 +0,0 @@ -alignas -alignof -and -and_eq -asm -auto -bitand -bitor -bool -break -case -catch -char -char16_t -char32_t -class -compl -concept -const -const_cast -constexpr -continue -decltype -default -define -defined -delete -do -double -dynamic_cast -elif -else -endif -enum -error -explicit -export -extern -false -final -float -for -friend -goto -if -ifdef -ifndef -include -inline -int -line -long -mutable -namespace -new -noexcept -not -not_eq -nullptr -operator -or -or_eq -override -pragma -_Pragma -private -protected -public -register -reinterpret_cast -requires -return -short -signed -sizeof -static -static_assert -static_cast -struct -switch -template -this -thread_local -throw -true -try -typedef -typeid -typename -union -unsigned -using -virtual -void -volatile -wchar_t -while -xor -xor_eq diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/c-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/c-mode deleted file mode 100644 index a4a8bac..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/c-mode +++ /dev/null @@ -1,55 +0,0 @@ -auto -_Alignas -_Alignof -_Atomic -_Bool -break -case -char -_Complex -const -continue -default -define -defined -do -double -elif -else -endif -enum -error -extern -float -for -goto -_Generic -if -ifdef -ifndef -_Imaginary -include -inline -int -line -long -_Noreturn -pragma -register -restrict -return -short -signed -sizeof -static -struct -switch -_Static_assert -typedef -_Thread_local -undef -union -unsigned -void -volatile -while diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/caml-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/caml-mode deleted file mode 100644 index e709f9f..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/caml-mode +++ /dev/null @@ -1,231 +0,0 @@ -# OCaml 3.12.1 - -# Keywords -and -as -assert -begin -class -constraint -do -done -downto -else -end -exception -external -false -for -fun -function -functor -if -in -include -inherit -initializer -lazy -let -match -method -module -mutable -new -object -of -open -or -private -rec -sig -struct -then -to -true -try -type -val -virtual -when -while -with - -# Pervasives -! -!= -& -&& -* -** -*. -+ -+. -- --. -/ -/. -:= -< -<= -<> -= -== -> ->= -@ -FP_infinite -FP_nan -FP_normal -FP_subnormal -FP_zero -LargeFile -Open_append -Open_binary -Open_creat -Open_nonblock -Open_rdonly -Open_text -Open_trunc -Open_wronly -Oupen_excl -^ -^^ -abs -abs_float -acos -asin -asr -at_exit -atan -atan2 -bool_of_string -ceil -char_of_int -classify_float -close_in -close_in_noerr -close_out -close_out_noerr -compare -cos -cosh -decr -do_at_exit -epsilon_float -exit -exp -expm1 -failwith -float -float_of_int -float_of_string -floor -flush -flush_all -format -format4 -format_of_string -fpclass -frexp -fst -ignore -in_channel -in_channel_length -incr -infinity -input -input_binary_int -input_byte -input_char -input_line -input_value -int_of_char -int_of_float -int_of_string -invalid_arg -land -ldexp -lnot -log -log10 -log1p -lor -lsl -lsr -lxor -max -max_float -max_int -min -min_float -min_int -mod -mod_float -modf -nan -neg_infinity -not -open_flag -open_in -open_in_bin -open_in_gen -open_out -open_out_bin -open_out_gen -or -out_channel -out_channel_length -output -output_binary_int -output_byte -output_char -output_string -output_value -pos_in -pos_out -pred -prerr_char -prerr_endline -prerr_float -prerr_int -prerr_newline -prerr_string -print_char -print_endline -print_float -print_int -print_newline -print_string -raise -read_float -read_int -read_line -really_input -ref -seek_in -seek_out -set_binary_mode_in -set_binary_mode_out -sin -sinh -snd -sqrt -stderr -stdin -stdout -string_of_bool -string_of_float -string_of_format -string_of_int -succ -tan -tanh -truncate -unsafe_really_input -valid_float_lexem -|| -~ -~+ -~+. -~- -~-. diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/clojure-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/clojure-mode deleted file mode 100644 index eefe33f..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/clojure-mode +++ /dev/null @@ -1,580 +0,0 @@ -*agent* -*allow-unresolved-vars* -*assert* -*clojure-version* -*command-line-args* -*compile-files* -*compile-path* -*compiler-options* -*data-readers* -*default-data-reader-fn* -*err* -*file* -*flush-on-newline* -*fn-loader* -*in* -*math-context* -*ns* -*out* -*print-dup* -*print-length* -*print-level* -*print-meta* -*print-readably* -*read-eval* -*source-path* -*unchecked-math* -*use-context-classloader* -*verbose-defrecords* -*warn-on-reflection* -->ArrayChunk -->Vec -->VecNode -->VecSeq --cache-protocol-fn --reset-methods -accessor -aclone -add-classpath -add-watch -agent -agent-error -agent-errors -aget -alength -alias -all-ns -alter -alter-meta! -alter-var-root -amap -ancestors -and -apply -areduce -array-map -as-> -aset -aset-boolean -aset-byte -aset-char -aset-double -aset-float -aset-int -aset-long -aset-short -assert -assoc -assoc! -assoc-in -associative? -atom -await -await-for -await1 -bases -bean -bigdec -bigint -biginteger -binding -bit-and -bit-and-not -bit-clear -bit-flip -bit-not -bit-or -bit-set -bit-shift-left -bit-shift-right -bit-test -bit-xor -boolean -boolean-array -booleans -bound-fn -bound-fn* -bound? -butlast -byte -byte-array -bytes -case -cast -char -char-array -char-escape-string -char-name-string -char? -chars -chunk -chunk-append -chunk-buffer -chunk-cons -chunk-first -chunk-next -chunk-rest -chunked-seq? -class -class? -clear-agent-errors -clojure-version -coll? -comment -commute -comp -comparator -compare -compare-and-set! -compile -complement -concat -cond -cond-> -cond->> -condp -conj -conj! -cons -constantly -construct-proxy -contains? -count -counted? -create-ns -create-struct -cycle -dec -dec' -decimal? -declare -default-data-readers -definline -definterface -defmacro -defmethod -defmulti -defn -defn- -defonce -defprotocol -defrecord -defstruct -deftype -delay -delay? -deliver -denominator -deref -derive -descendants -destructure -disj -disj! -dissoc -dissoc! -distinct -distinct? -doall -doc -dorun -doseq -dosync -dotimes -doto -double -double-array -doubles -drop -drop-last -drop-while -dtype -empty -empty? -ensure -enumeration-seq -error-handler -error-mode -eval -even? -every-pred -every? -ex-data -ex-info -extend -extend-class -extend-protocol -extend-type -extenders -extends? -false? -ffirst -file-seq -filter -filterv -find -find-doc -find-keyword -find-ns -find-protocol-impl -find-protocol-method -find-var -first -flatten -float -float-array -float? -floats -flush -fn -fn? -fnext -fnil -for -force -format -frequencies -future -future-call -future-cancel -future-cancelled? -future-done? -future? -gen-class -gen-interface -gensym -get -get-in -get-method -get-proxy-class -get-thread-bindings -get-validator -group-by -hash -hash-combine -hash-map -hash-set -identical? -identity -if-let -if-not -ifn? -import -in-ns -inc -inc' -init-proxy -instance? -int -int-array -integer? -interleave -intern -interpose -into -into-array -ints -io! -isa? -iterate -iterator-seq -juxt -keep -keep-indexed -key -keys -keyword -keyword? -last -lazy-cat -lazy-seq -let -letfn -line-seq -list -list* -list? -load -load-file -load-reader -load-string -loaded-libs -locking -long -long-array -longs -loop -macroexpand -macroexpand-1 -make-array -make-hierarchy -map -map-indexed -map? -mapcat -mapv -max -max-key -memfn -memoize -merge -merge-with -meta -method-sig -methods -min -min-key -mod -munge -name -namespace -namespace-munge -neg? -newline -next -nfirst -nil? -nnext -not -not-any? -not-empty -not-every? -not= -ns -ns-aliases -ns-imports -ns-interns -ns-map -ns-name -ns-publics -ns-refers -ns-resolve -ns-unalias -ns-unmap -nth -nthnext -nthrest -num -number? -numerator -object-array -odd? -or -parents -partial -partition -partition-all -partition-by -pcalls -peek -persistent! -pmap -pop -pop! -pop-thread-bindings -pos? -pr -pr-str -prefer-method -prefers -primitives-classnames -print -print-ctor -print-dup -print-method -print-namespace-doc -print-simple -print-str -printf -println -println-str -prn -prn-str -promise -proxy -proxy-call-with-super -proxy-mappings -proxy-name -proxy-super -push-thread-bindings -pvalues -quot -rand -rand-int -rand-nth -range -ratio? -rational? -rationalize -re-find -re-groups -re-matcher -re-matches -re-pattern -re-seq -read -read-line -read-string -realized? -reduce -reduce-kv -reduced -reduced? -reductions -ref -ref-history-count -ref-max-history -ref-min-history -ref-set -refer -refer-clojure -reify -release-pending-sends -rem -remove -remove-all-methods -remove-method -remove-ns -remove-watch -repeat -repeatedly -replace -replicate -require -reset! -reset-meta! -resolve -rest -restart-agent -resultset-seq -reverse -reversible? -rseq -rsubseq -satisfies? -second -select-keys -send -send-off -send-via -seq -seq? -seque -sequence -sequential? -set -set-agent-send-executor! -set-agent-send-off-executor! -set-error-handler! -set-error-mode! -set-validator! -set? -short -short-array -shorts -shuffle -shutdown-agents -slurp -some -some-> -some->> -some-fn -sort -sort-by -sorted-map -sorted-map-by -sorted-set -sorted-set-by -sorted? -special-form-anchor -special-symbol? -spit -split-at -split-with -str -stream? -string? -struct -struct-map -subs -subseq -subvec -supers -swap! -symbol -symbol? -sync -syntax-symbol-anchor -take -take-last -take-nth -take-while -test -the-ns -thread-bound? -time -to-array -to-array-2d -trampoline -transient -tree-seq -true? -type -unchecked-add -unchecked-add-int -unchecked-byte -unchecked-char -unchecked-dec -unchecked-dec-int -unchecked-divide -unchecked-divide-int -unchecked-double -unchecked-float -unchecked-inc -unchecked-inc-int -unchecked-int -unchecked-long -unchecked-multiply -unchecked-multiply-int -unchecked-negate -unchecked-negate-int -unchecked-remainder -unchecked-remainder-int -unchecked-short -unchecked-subtract -unchecked-subtract-int -underive -unquote -unquote-splicing -update-in -update-proxy -use -val -vals -var-get -var-set -var? -vary-meta -vec -vector -vector-of -vector? -when -when-first -when-let -when-not -while -with-bindings -with-bindings* -with-in-str -with-loading-context -with-local-vars -with-meta -with-open -with-out-str -with-precision -with-redefs -with-redefs-fn -xml-seq -zero? -zipmap \ No newline at end of file diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/clojurescript-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/clojurescript-mode deleted file mode 100644 index 16348ed..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/clojurescript-mode +++ /dev/null @@ -1,475 +0,0 @@ -*agent* -*clojure-version* -*command-line-args* -*compile-files* -*compile-path* -*err* -*file* -*flush-on-newline* -*in* -*ns* -*out* -*print-dup* -*print-length* -*print-level* -*print-meta* -*print-readably* -*read-eval* -*warn-on-reflection* -accessor -aclone -add-classpath -add-watch -agent -agent-error -agent-errors -aget -alength -alias -all-ns -alter -alter-meta! -alter-var-root -amap -ancestors -and -apply -areduce -array-map -aset -aset-boolean -aset-byte -aset-char -aset-double -aset-float -aset-int -aset-long -aset-short -assert -assoc -assoc! -assoc-in -associative? -atom -await -await-for -bases -bean -bigdec -bigint -binding -bit-and -bit-and-not -bit-clear -bit-flip -bit-not -bit-or -bit-set -bit-shift-left -bit-shift-right -bit-test -bit-xor -boolean -boolean-array -booleans -bound-fn -bound-fn* -butlast -byte -byte-array -bytes -case -cast -char -char-array -char-escape-string -char-name-string -char? -chars -class -class? -clear-agent-errors -clojure-version -coll? -comment -commute -comp -comparator -compare -compare-and-set! -compile -complement -concat -cond -condp -conj -conj! -cons -constantly -construct-proxy -contains? -count -counted? -create-ns -create-struct -cycle -dec -decimal? -declare -definline -defmacro -defmethod -defmulti -defn -defn- -defonce -defprotocol -defstruct -deftype -delay -delay? -deliver -deref -derive -descendants -disj -disj! -dissoc -dissoc! -distinct -distinct? -doall -doc -dorun -doseq -dosync -dotimes -doto -double -double-array -doubles -drop -drop-last -drop-while -dtype -empty -empty? -ensure -enumeration-seq -error-handler -error-mode -eval -even? -every? -extend -extend-class -extend-protocol -extend-type -extenders -extends? -false? -ffirst -file-seq -filter -find -find-doc -find-ns -find-var -first -float -float-array -float? -floats -flush -fn -fn? -fnext -for -force -format -future -future-call -future-cancel -future-cancelled? -future-done? -future? -gen-class -gen-interface -gensym -get -get-in -get-method -get-proxy-class -get-thread-bindings -get-validator -hash -hash-map -hash-set -identical? -identity -if-let -if-not -ifn? -import -in-ns -inc -init-proxy -instance? -int -int-array -integer? -interleave -intern -interpose -into -into-array -ints -io! -isa? -iterate -iterator-seq -juxt -key -keys -keyword -keyword? -last -lazy-cat -lazy-seq -let -letfn -line-seq -list -list* -list? -load -load-file -load-reader -load-string -loaded-libs -locking -long -long-array -longs -loop -macroexpand -macroexpand-1 -make-array -make-hierarchy -map -map? -mapcat -max -max-key -memfn -memoize -merge -merge-with -meta -methods -min -min-key -mod -name -namespace -neg? -newline -next -nfirst -nil? -nnext -not -not-any? -not-empty -not-every? -not= -ns -ns-aliases -ns-imports -ns-interns -ns-map -ns-name -ns-publics -ns-refers -ns-resolve -ns-unalias -ns-unmap -nth -nthnext -num -number? -object-array -odd? -or -parents -partial -partition -pcalls -peek -persistent! -pmap -pop -pop! -pop-thread-bindings -pos? -pr -pr-str -prefer-method -prefers -print -print-namespace-doc -print-str -printf -println -println-str -prn -prn-str -promise -proxy -proxy-mappings -proxy-super -push-thread-bindings -pvalues -quot -rand -rand-int -range -ratio? -rationalize -re-find -re-groups -re-matcher -re-matches -re-pattern -re-seq -read -read-line -read-string -reduce -ref -ref-history-count -ref-max-history -ref-min-history -ref-set -refer -refer-clojure -reify -release-pending-sends -rem -remove -remove-method -remove-ns -remove-watch -repeat -repeatedly -replace -replicate -require -reset! -reset-meta! -resolve -rest -restart-agent -resultset-seq -reverse -reversible? -rseq -rsubseq -satisfies? -second -select-keys -send -send-off -seq -seq? -seque -sequence -sequential? -set -set-error-handler! -set-error-mode! -set-validator! -set? -short -short-array -shorts -shutdown-agents -slurp -some -sort -sort-by -sorted-map -sorted-map-by -sorted-set -sorted-set-by -sorted? -special-form-anchor -special-symbol? -split-at -split-with -str -stream? -string? -struct -struct-map -subs -subseq -subvec -supers -swap! -symbol -symbol? -sync -syntax-symbol-anchor -take -take-last -take-nth -take-while -test -the-ns -time -to-array -to-array-2d -trampoline -transient -tree-seq -true? -type -unchecked-add -unchecked-dec -unchecked-divide -unchecked-inc -unchecked-multiply -unchecked-negate -unchecked-remainder -unchecked-subtract -underive -update-in -update-proxy -use -val -vals -var-get -var-set -var? -vary-meta -vec -vector -vector-of -vector? -when -when-first -when-let -when-not -while -with-bindings -with-bindings* -with-in-str -with-local-vars -with-meta -with-open -with-out-str -with-precision -xml-seq -zero? -zipmap \ No newline at end of file diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/coq-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/coq-mode deleted file mode 100644 index 219448f..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/coq-mode +++ /dev/null @@ -1,278 +0,0 @@ -# Generated by the following form. -# (loop for regexp in (append -# coq-solve-tactics -# coq-keywords -# coq-reserved -# coq-tactics -# coq-tacticals -# (list "Set" "Type" "Prop")) -# append (split-string regexp (regexp-quote "\\s-+")) into words -# finally (loop initially (goto-char (point-max)) -# for word in (delete-dups (sort words 'string<)) -# do (insert word) (newline))) - -Abort -About -Abstract -Add -Admit -Admitted -All -Arguments -AutoInline -Axiom -Bind -Canonical -Cd -Chapter -Check -Close -CoFixpoint -CoInductive -Coercion -Coercions -Comments -Conjecture -Constant -Constructors -Corollary -Declare -Defined -Definition -Delimit -Dependent -Depth -Derive -End -Eval -Export -Extern -Extract -Extraction -Fact -False -Field -File -Fixpoint -Focus -Function -Functional -Goal -Hint -Hypotheses -Hypothesis -Hyps -Identity -If -Immediate -Implicit -Import -Inductive -Infix -Inline -Inlined -Inspect -Inversion -Language -Lemma -Let -Library -Limit -LoadPath -Local -Locate -Ltac -ML -Module -Morphism -Next Obligation -NoInline -Notation -Notations -Obligation -Obligations -Off -On -Opaque -Open -Optimize -Parameter -Parameters -Path -Print -Printing -Program -Proof -Prop -Pwd -Qed -Rec -Record -Recursive -Remark -Remove -Require -Reserved -Reset -Resolve -Rewrite -Ring -Save -Scheme -Scope -Search -SearchAbout -SearchPattern -SearchRewrite -Section -Semi -Set -Setoid -Show -Solve -Sort -Strict -Structure -Synth -Tactic -Test -Theorem -Time -Transparent -True -Type -Undo -Unfocus -Unfold -Unset -Variable -Variables -Width -Wildcard -abstract -absurd -after -apply -as -assert -assumption -at -auto -autorewrite -beta -by -case -cbv -change -clear -clearbody -cofix -coinduction -compare -compute -congruence -constructor -contradiction -cut -cutrewrite -decide -decompose -delta -dependent -dest -destruct -discrR -discriminate -do -double -eapply -eauto -econstructor -eexists -eleft -elim -else -end -equality -esplit -exact -exists -fail -field -first -firstorder -fix -fold -forall -fourier -fun -functional -generalize -hnf -idtac -if -in -induction -info -injection -instantiate -into -intro -intros -intuition -inversion -inversion_clear -iota -lapply -lazy -left -let -linear -load -match -move -omega -pattern -pose -progress -prolog -quote -record -red -refine -reflexivity -rename -repeat -replace -return -rewrite -right -ring -set -setoid -setoid_replace -setoid_rewrite -simpl -simple -simplify_eq -solve -specialize -split -split_Rabs -split_Rmult -stepl -stepr -struct -subst -sum -symmetry -tauto -then -transitivity -trivial -try -unfold -until -using -with -zeta diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/css-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/css-mode deleted file mode 100644 index f25e400..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/css-mode +++ /dev/null @@ -1,874 +0,0 @@ -!important -@font-face -@font-feature-values -@keyframes -ActiveBorder -ActiveCaption -Alpha -AppWorkspace -Background -Barn -BasicImage -Blinds -Blur -ButtonFace -ButtonHighlight -ButtonShadow -ButtonText -CaptionText -CheckerBoard -Chroma -Compositor -CradientWipe -DXImageTransform -DropShadow -Emboss -Engrave -Fade -FlipH -FlipV -Glow -Gray -GrayText -Highlight -HighlightText -Hz -ICMFilter -InactiveBorder -InactiveCaption -InactiveCaptionText -InfoBackground -InfoText -Inset -Invert -Iris -Light -MaskFilter -Matrix -Menu -MenuText -Microsoft -MotionBlur -Pixelate -RadialWipe -RandomBars -RandomDissolve -RevealTrans -Scrollbar -Shadow -Slide -Spiral -Stretch -Strips -ThreeDDarkShadow -ThreeDFace -ThreeDHighlight -ThreeDLightShadow -ThreeDShadow -Wave -Wheel -Window -WindowFrame -WindowText -Xray -Zigzag -_azimuth -_background -_background-position-x -_background-position-y -_border -_bottom -_caption -_clear -_clip -_color -_content -_counter -_cue -_cursor -_direction -_display -_elevation -_empty -_filter -_filter:progid:DXImageTransform.Microsoft -_float -_font -_height -_ime -_ime-mode -_layout -_layout-flow -_layout-grid -_layout-grid-char -_layout-grid-line -_layout-grid-mode -_layout-grid-type -_left -_letter -_line -_line-break -_list -_margin -_orphans -_outline -_overflow -_overflow-x -_overflow-y -_padding -_page -_pause -_pitch -_play -_position -_quotes -_richness -_right -_ruby -_ruby-align -_ruby-overhang -_ruby-position -_scrollbar -_scrollbar-3dlight-color -_scrollbar-arrow-color -_scrollbar-base-color -_scrollbar-darkshadow-color -_scrollbar-face-color -_scrollbar-highlight-color -_scrollbar-track-color -_speak -_speech -_stress -_table -_text -_text-align-last -_text-autospace -_text-justify -_text-kashida-space -_text-overflow -_text-underline-position -_top -_unicode -_vertical -_visibility -_voice -_volume -_white -_widows -_width -_word -_word-break -_word-wrap -_writing -_writing-mode -_z -_zoom -above -active -adjust -after -aliceblue -align -align-content -align-items -align-self -always -animation -animation-delay -animation-direction -animation-duration -animation-fill-mode -animation-iteration-count -animation-name -animation-play-state -animation-timing-function -antiquewhite -aqua -aquamarine -armenian -arrow -attachment -auto -autospace -avoid -azimuth -azure -backface-visibility -background -background-attachment -background-clip -background-color -background-image -background-origin -background-position -background-repeat -background-size -bar -base -baseline -before -behind -beige -below -bidi -bidi-override -bisque -black -blanchedalmond -blink -block -blue -blueviolet -bold -bolder -border -border-bottom -border-bottom-color -border-bottom-left-radius -border-bottom-right-radius -border-bottom-style -border-bottom-width -border-collapse -border-color -border-image -border-image-outset -border-image-repeat -border-image-slice -border-image-source -border-image-width -border-left -border-left-color -border-left-style -border-left-width -border-radius -border-right -border-right-color -border-right-style -border-right-width -border-spacing -border-style -border-top -border-top-color -border-top-left-radius -border-top-right-radius -border-top-style -border-top-width -border-width -both -bottom -box -box-decoration-break -box-shadow -box-sizing -break -break-after -break-before -break-inside -brown -burlwood -cadetblue -capitalize -caps -caption -caption-side -cell -cells -center -center-left -center-right -char -chartreuse -chocolate -circle -cjk -cjk-ideographic -clear -clip -close -close-quote -cm -code -collapse -color -column -column-count -column-fill -column-gap -column-rule -column-rule-color -column-rule-style -column-rule-width -column-span -column-width -columns -compact -condensed -content -continuous -coral -cornflowerblue -cornsilk -counter -counter-increment -counter-reset -crimson -crop -cross -crosshair -cue -cue-after -cue-before -cursive -cursor -cyan -darkblue -darkcyan -darkgoldenrod -darkgray -darkgreen -darkkhaki -darkmagenta -darkolivegreen -darkorange -darkorchid -darkred -darksalmon -darkseagreen -darkshadow -darkslateblue -darkslategray -darkturquoise -darkviolet -dashed -decimal -decimal-leading-zero -decoration -deeppink -deepskyblue -default -deg -digits -dimgray -direction -disc -display -dodgerblue -dotted -double -during -e -e-resize -elevation -em -embed -empty -empty-cells -ex -expanded -extra -extra-condensed -extra-expanded -face -family -fantasy -far -far-left -far-right -fast -faster -filter -firebrick -first -first-child -first-letter -first-line -fixed -flex -flex-basis -flex-direction -flex-flow -flex-grow -flex-shrink -flex-wrap -float -floralwhite -flow -focus -font -font-family -font-feature-setting -font-kerning -font-language-override -font-size -font-size-adjust -font-stretch -font-style -font-synthesis -font-variant -font-variant-alternates -font-variant-caps -font-variant-east-asian -font-variant-ligatures -font-variant-numeric -font-variant-position -font-weight -footer -forestgreen -fuchsia -gainsboro -georgian -ghostwhite -gold -goldenrod -gray -greek -green -greenyellow -grid -groove -group -hanging-punctuation -header -hebrew -height -help -hidden -hide -high -higher -hiragana -hiragana-iroha -honeydew -hotpink -hover -hyphens -icon -ideographic -image -image-orientation -image-rendering -image-resolution -ime-mode -in -increment -indent -index -indianred -indigo -inherit -inline -inline-block -inline-table -inset -inside -iroha -italic -item -ivory -justify -justify-content -kHz -kashida -katakana -katakana-iroha -khaki -landscape -lang() -large -larger -last -latin -lavender -lavenderblush -lawngreen -layout -leading -left -left-side -leftwards -lenonchiffon -letter -letter-spacing -level -lightblue -lightcoral -lightcyan -lighter -lightgoldenrodyellow -lightgray -lightgreen -lightgrey -lightpink -lightsalmon -lightseagreen -lightskyblue -lightslategray -lightsteelblue -lightyellow -lime -limegreen -line -line-break -line-height -line-through -linen -link -list -list-item -list-style -list-style-image -list-style-position -list-style-type -loud -low -lower -lower-alpha -lower-greek -lower-latin -lower-roman -lowercase -ltr -magenta -margin -margin-bottom -margin-left -margin-right -margin-top -mark -mark-after -mark-before -marker -marker-offset -marks -maroon -marquee-direction -marquee-play-count -marquee-speed -marquee-style -mask -mask-type -max -max-height -max-width -medium -mediumaquamarine -mediumblue -mediumorchid -mediumpurple -mediumseagreen -mediumslateblue -mediumspringgreen -mediumturquoise -mediumvioletred -menu -message -message-box -middle -midnightblue -min -min-height -min-width -mintcream -mistyrose -mix -mm -moccasin -mode -monospace -move -ms -n -n-resize -naby -narrower -nav-down -nav-index -nav-left -nav-right -nav-up -navajowhite -ne -ne-resize -no -no-close-quote -no-open-quote -no-repeat -none -normal -nowrap -number -numeral -nw -nw-resize -object-fit -object-position -oblique -offset -oldlace -olive -olivedrab -once -opacity -open -open-quote -orange -orangered -orchid -order -orphans -out -outline -outline-color -outline-offset -outline-style -outline-width -outset -outside -overflow -overflow-wrap -overflow-x -overflow-y -overhang -overline -override -padding -padding-bottom -padding-left -padding-right -padding-top -page -page-break-after -page-break-before -page-break-inside -palegoldenrod -palegreen -paleturquoise -palevioletred -papayawhip -pause -pause-after -pause-before -pc -peachpuff -perspective -perspective-origin -peru -phonemes -pink -pitch -pitch-range -play -play-during -plum -pointer -portrait -position -powderblue -pre -pre-line -pre-wrap -progid -progress -pt -punctuation -purple -px -quote -quotes -rad -range -rate -red -relative -repeat -repeat-x -repeat-y -reset -resize -rest -rest-after -rest-before -richness -ridge -right -right-side -rightwards -roman -rosybrown -row -royalblue -rtl -run -run-in -s -s-resize -saddlebrown -salmon -sandybrown -sans-serif -scroll -se -se-resize -seagreen -seashell -semi -semi-condensed -semi-expanded -separate -serif -shadow -show -side -sienna -silent -silever -silver -size -skyblue -slateblue -slategray -slow -slower -small -small-caps -small-caption -smaller -snow -soft -solid -space -spacing -speak -speak-header -speak-numeral -speak-punctuation -specific -specific-voice -speech -speech-rate -spell -spell-out -springgreen -square -static -status -status-bar -steelblue -stress -stretch -style -sub -super -sw -sw-resize -tab-size -table -table-caption -table-cell -table-column -table-column-group -table-footer-group -table-header-group -table-layout -table-row -table-row-group -tan -teal -text -text-align -text-align-last -text-bottom -text-combine-horizontal -text-decoration -text-decoration-color -text-decoration-line -text-decoration-style -text-indent -text-justify -text-orientation -text-overflow -text-shadow -text-top -text-transform -text-underline-position -thick -thin -thistle -through -tomato -top -track -transform -transform-origin -transform-style -transition -transition-delay -transition-duration -transition-property -transition-timing-function -transparent -turquoise -type -ultra -ultra-condensed -ultra-expanded -underline -unicode -unicode-bidi -upper -upper-alpha -upper-latin -upper-roman -uppercase -variant -vertical -vertical-align -violet -visibility -visible -visited -voice -voice-balance -voice-duration -voice-family -voice-pitch -voice-pitch-range -voice-rate -voice-stress -voice-volume -volume -w -w-resize -wait -weight -wheat -white -white-space -whitesmoke -wider -widows -width -word -word-break -word-spacing -word-wrap -wrap -writing-mode -x -x-fast -x-high -x-large -x-loud -x-low -x-slow -x-small -x-soft -xx -xx-large -xx-small -y -yellow -yellowgreen -z -z-index -zero diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/erlang-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/erlang-mode deleted file mode 100644 index 960f2b8..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/erlang-mode +++ /dev/null @@ -1,216 +0,0 @@ -after -begin -catch -case -cond -end -fun -if -let -of -query -receive -try -when -and -andalso -band -bnot -bor -bsl -bsr -bxor -div -not -or -orelse -rem -xor -is_atom -is_binary -is_bitstring -is_boolean -is_float -is_function -is_integer -is_list -is_number -is_pid -is_port -is_record -is_reference -is_tuple -atom -binary -bitstring -boolean -function -integer -list -number -pid -port -record -reference -tuple -abs -adler32 -adler32_combine -alive -apply -atom_to_binary -atom_to_list -binary_to_atom -binary_to_existing_atom -binary_to_list -binary_to_term -bit_size -bitstring_to_list -byte_size -check_process_code -contact_binary -crc32 -crc32_combine -date -decode_packet -delete_module -disconnect_node -element -erase -exit -float -float_to_list -garbage_collect -get -get_keys -group_leader -halt -hd -integer_to_list -internal_bif -iolist_size -iolist_to_binary -is_alive -is_atom -is_binary -is_bitstring -is_boolean -is_float -is_function -is_integer -is_list -is_number -is_pid -is_port -is_process_alive -is_record -is_reference -is_tuple -length -link -list_to_atom -list_to_binary -list_to_bitstring -list_to_existing_atom -list_to_float -list_to_integer -list_to_pid -list_to_tuple -load_module -make_ref -module_loaded -monitor_node -node -node_link -node_unlink -nodes -notalive -now -open_port -pid_to_list -port_close -port_command -port_connect -port_control -pre_loaded -process_flag -process_info -processes -purge_module -put -register -registered -round -self -setelement -size -spawn -spawn_link -spawn_monitor -spawn_opt -split_binary -statistics -term_to_binary -time -throw -tl -trunc -tuple_size -tuple_to_list -unlink -unregister -whereis -append_element -bump_reductions -cancel_timer -demonitor -display -fun_info -fun_to_list -function_exported -get_cookie -get_stacktrace -hash -integer_to_list -is_builtin -list_to_integer -loaded -localtime -localtime_to_universaltime -make_tuple -max -md5 -md5_final -md5_init -md5_update -memory -min -monitor -monitor_node -phash -phash2 -port_call -port_info -port_to_list -ports -process_display -read_timer -ref_to_list -resume_process -send -send_after -send_nosuspend -set_cookie -start_timer -suspend_process -system_flag -system_info -system_monitor -system_profile -trace -trace_delivered -trace_info -trace_pattern -universaltime -universaltime_to_localtime -yield diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/go-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/go-mode deleted file mode 100644 index b943a16..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/go-mode +++ /dev/null @@ -1,25 +0,0 @@ -break -case -chan -const -continue -default -defer -else -fallthrough -for -func -go -goto -if -import -interface -map -package -range -return -select -struct -switch -type -var diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/haskell-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/haskell-mode deleted file mode 100644 index 9ad1b99..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/haskell-mode +++ /dev/null @@ -1,679 +0,0 @@ -Arrows -BangPatterns -Bool -Bounded -CPP -Char -Complex -ConstrainedClassMethods -Control.Applicative -Control.Arrow -Control.Category -Control.Concurrent -Control.Concurrent.MVar -Control.Concurrent.QSem -Control.Concurrent.QSemN -Control.Concurrent.STM -Control.Concurrent.STM.TArray -Control.Concurrent.STM.TChan -Control.Concurrent.STM.TMVar -Control.Concurrent.STM.TVar -Control.Concurrent.SampleVar -Control.Exception -Control.Exception.Base -Control.Monad -Control.Monad.Cont -Control.Monad.Cont.Class -Control.Monad.Error -Control.Monad.Error.Class -Control.Monad.Fix -Control.Monad.Identity -Control.Monad.Instances -Control.Monad.List -Control.Monad.RWS -Control.Monad.RWS.Class -Control.Monad.RWS.Lazy -Control.Monad.RWS.Strict -Control.Monad.Reader -Control.Monad.Reader.Class -Control.Monad.ST -Control.Monad.ST.Lazy -Control.Monad.ST.Strict -Control.Monad.STM -Control.Monad.State -Control.Monad.State.Class -Control.Monad.State.Lazy -Control.Monad.State.Strict -Control.Monad.Trans -Control.Monad.Writer -Control.Monad.Writer.Class -Control.Monad.Writer.Lazy -Control.Monad.Writer.Strict -Control.OldException -Control.Parallel -Control.Parallel.Strategies -DEPRECATED -Data.Array -Data.Array.Diff -Data.Array.IArray -Data.Array.IO -Data.Array.IO.Internals -Data.Array.MArray -Data.Array.Paralell -Data.Array.Paralell.Arr -Data.Array.Paralell.Base -Data.Array.Paralell.Int -Data.Array.Paralell.Lifted -Data.Array.Paralell.PArray -Data.Array.Paralell.Prelude -Data.Array.Paralell.Prelude.Double -Data.Array.Paralell.Stream -Data.Array.Paralell.Unlifted -Data.Array.Paralell.Unlifted.Distributed -Data.Array.Paralell.Unlifted.Paralell -Data.Array.Paralell.Unlifted.Sqeuential -Data.Array.Paralell.Word8 -Data.Array.ST -Data.Array.Storable -Data.Array.Unboxed -Data.Bits -Data.Bool -Data.ByteString -Data.ByteString.Char8 -Data.ByteString.Fusion -Data.ByteString.Internal -Data.ByteString.Lazy -Data.ByteString.Lazy.Char8 -Data.ByteString.Lazy.Fusion -Data.ByteString.Lazy.Internal -Data.ByteString.Unsafe -Data.Char -Data.Complex -Data.Data -Data.Dynamic -Data.Either -Data.Eq -Data.Fixed -Data.Foldable -Data.Function -Data.Generics -Data.Generics.Aliases -Data.Generics.Basics -Data.Generics.Instances -Data.Generics.Schemes -Data.Generics.Text -Data.Generics.Twins -Data.Graph -Data.HashTable -Data.IORef -Data.Int -Data.IntMap -Data.IntSet -Data.Ix -Data.List -Data.Map -Data.Maybe -Data.Monoid -Data.Ord -Data.Ratio -Data.STRef -Data.STRef.Lazy -Data.STRef.Strict -Data.Sequence -Data.Set -Data.String -Data.Time -Data.Time.Calendar -Data.Time.Calendar.Easter -Data.Time.Calendar.Julian -Data.Time.Calendar.MonthDay -Data.Time.Calendar.OrdinalDate -Data.Time.Calendar.WeekDate -Data.Time.Clock -Data.Time.Clock.POSIX -Data.Time.Clock.TAI -Data.Time.Format -Data.Time.LocalTime -Data.Traversable -Data.Tree -Data.Tuple -Data.Typeable -Data.Unique -Data.Version -Data.Word -Debug.Trace -DeriveDataTypeable -DisambiguateRecordFields -Distribution.Compat.ReadP -Distribution.Compiler -Distribution.InstalledPackageInfo -Distribution.License -Distribution.Make -Distribution.ModuleName -Distribution.Package -Distribution.PackageDescription -Distribution.PackageDescription.Check -Distribution.PackageDescription.Configuration -Distribution.PackageDescription.Parse -Distribution.ParseUtils -Distribution.ReadE -Distribution.Simple -Distribution.Simple.Build -Distribution.Simple.Build.Macros -Distribution.Simple.Build.PathsModule -Distribution.Simple.BuildPaths -Distribution.Simple.Command -Distribution.Simple.Compiler -Distribution.Simple.Configure -Distribution.Simple.GHC -Distribution.Simple.Haddock -Distribution.Simple.Hugs -Distribution.Simple.Install -Distribution.Simple.InstallDirs -Distribution.Simple.JHC -Distribution.Simple.LocalBuildInfo -Distribution.Simple.NHC -Distribution.Simple.PackageIndex -Distribution.Simple.PreProcess -Distribution.Simple.PreProcess.Unlit -Distribution.Simple.Program -Distribution.Simple.Register -Distribution.Simple.Setup -Distribution.Simple.SrcDist -Distribution.Simple.UserHooks -Distribution.Simple.Utils -Distribution.System -Distribution.Text -Distribution.Verbosity -Distribution.Version -Double -EQ -Either -EmptyDataDecls -Enum -Eq -ExistentialQuantification -ExtendedDefaultRules -False -FilePath -FlexibleContexts -FlexibleInstances -Float -Floating -Foreign -Foreign.C -Foreign.C.Error -Foreign.C.String -Foreign.C.Types -Foreign.Concurrent -Foreign.ForeignPtr -Foreign.Marshal -Foreign.Marshal.Alloc -Foreign.Marshal.Array -Foreign.Marshal.Error -Foreign.Marshal.Pool -Foreign.Marshal.Utils -Foreign.Ptr -Foreign.StablePtr -Foreign.Storable -ForeignFunctionInterface -Fractional -FunctionnalDependencies -Functor -GADTs -GHC.Arr -GHC.Bool -GHC.Conc -GHC.ConsoleHandler -GHC.Desugar -GHC.Environment -GHC.Err -GHC.Exts -GHC.Generics -GHC.Handle -GHC.Ordering -GHC.PArr -GHC.Prim -GHC.PrimopWrappers -GHC.Tuple -GHC.Types -GHC.Unicode -GHC.Unit -GT -GeneralizedNewtypeDeriving -Generics -INCLUDE -INLINE -IO -IOError -IOException -ImplicitParams -ImplicitPrelude -ImpredicativeTypes -IncoherentInstances -Int -Integer -Integral -Just -KindSignatures -LANGUAGE -LINE -LT -Language.Haskell.Extension -Language.Haskell.Lexer -Language.Haskell.ParseMonad -Language.Haskell.ParseUtils -Language.Haskell.Parser -Language.Haskell.Pretty -Language.Haskell.Syntax -Language.Haskell.TH -Language.Haskell.TH.Lib -Language.Haskell.TH.Ppr -Language.Haskell.TH.PprLib -Language.Haskell.TH.Quote -Language.Haskell.TH.Syntax -Left -LiberalTypeSynonyms -MagicHash -Maybe -Monad -MonoPatBinds -MonomorphismRestriction -MultiParamTypeClasses -NOINLINE -NamedFieldPuns -Network -Network.BSD -Network.Socket -Network.URI -NewQualifiedOperators -NoArrows -NoBangPatterns -NoCPP -NoConstrainedClassMethods -NoDeriveDataTypeable -NoDisambiguateRecordFields -NoEmptyDataDecls -NoExistentialQuantification -NoExtendedDefaultRules -NoFlexibleContexts -NoFlexibleInstances -NoForeignFunctionInterface -NoFunctionnalDependencies -NoGADTs -NoGeneralizedNewtypeDeriving -NoGenerics -NoImplicitParams -NoImplicitPrelude -NoImpredicativeTypes -NoIncoherentInstances -NoKindSignatures -NoLiberalTypeSynonyms -NoMagicHash -NoMonoPatBinds -NoMonomorphismRestriction -NoMultiParamTypeClasses -NoNamedFieldPuns -NoNewQualifiedOperators -NoOverlappingInstances -NoOverloadedStrings -NoPArr -NoPackageImports -NoParallelListComp -NoPatternGuards -NoPolymorphicComponents -NoQuasiQuotes -NoRank2Types -NoRankNTypes -NoRecordWildCards -NoRecursiveDo -NoRelaxedPolyRec -NoScopedTypeVariables -NoStandaloneDeriving -NoTemplateHaskell -NoTransformListComp -NoTypeFamilies -NoTypeOperators -NoTypeSynonymInstances -NoUnboxedTuples -NoUndecidableInstances -NoUnicodeSyntax -NoUnliftedFFITypes -NoViewPatterns -Nothing -Num -Numeric -OPTIONS_GHC -Ord -Ordering -OverlappingInstances -OverloadedStrings -PArr -PackageImports -ParallelListComp -PatternGuards -PolymorphicComponents -Prelude -QuasiQuotes -RULES -Rank2Types -RankNTypes -Ratio -Read -ReadS -Real -RealFloat -RealFrac -RecordWildCards -RecursiveDo -RelaxedPolyRec -Right -SOURCE -SPECIALIZE -ScopedTypeVariables -ShowS -StandaloneDeriving -String -System.CPUTime -System.Cmd -System.Console.Editline -System.Console.GetOpt -System.Console.Readline -System.Directory -System.Environment -System.Exit -System.FilePath -System.FilePath.Posix -System.FilePath.Windows -System.IO -System.IO.Error -System.IO.Unsafe -System.Info -System.Locale -System.Mem -System.Mem.StableName -System.Mem.Weak -System.Posix -System.Posix.Directory -System.Posix.DynamicLinker -System.Posix.DynamicLinker.Module -System.Posix.DynamicLinker.Prim -System.Posix.Env -System.Posix.Error -System.Posix.Files -System.Posix.IO -System.Posix.Process -System.Posix.Process.Internals -System.Posix.Resource -System.Posix.Semaphore -System.Posix.SharedMem -System.Posix.Signals -System.Posix.Signals.Exts -System.Posix.Temp -System.Posix.Terminal -System.Posix.Time -System.Posix.Types -System.Posix.Unistd -System.Posix.User -System.Process -System.Random -System.Time -System.Timeout -TemplateHaskell -Test.HUnit -Test.HUnit.Base -Test.HUnit.Lang -Test.HUnit.Terminal -Test.HUnit.Text -Test.QuickCheck -Test.QuickCheck.Batch -Test.QuickCheck.Poly -Test.QuickCheck.Utils -Text.Html -Text.Html.BlockTable -Text.ParserCombinators.Parsec -Text.ParserCombinators.Parsec.Char -Text.ParserCombinators.Parsec.Combinator -Text.ParserCombinators.Parsec.Error -Text.ParserCombinators.Parsec.Expr -Text.ParserCombinators.Parsec.Language -Text.ParserCombinators.Parsec.Perm -Text.ParserCombinators.Parsec.Pos -Text.ParserCombinators.Parsec.Prim -Text.ParserCombinators.Parsec.Token -Text.ParserCombinators.ReadP -Text.ParserCombinators.ReadPrec -Text.PrettyPrint -Text.PrettyPrint.HughesPJ -Text.Printf -Text.Read -Text.Read.Lex -Text.Regex.Base -Text.Regex.Base.Context -Text.Regex.Base.Impl -Text.Regex.Base.RegexLike -Text.Regex.Posix -Text.Regex.Posix.ByteString -Text.Regex.Posix.String -Text.Regex.Posix.Wrap -Text.Show -Text.Show.Functions -Text.XHtml -Text.XHtml.Debug -Text.XHtml.Frameset -Text.XHtml.Strict -Text.XHtml.Table -Text.XHtml.Transitional -Trace.Hpc.Mix -Trace.Hpc.Reflect -Trace.Hpc.Tix -Trace.Hpc.Util -TransformListComp -True -TypeFamilies -TypeOperators -TypeSynonymInstances -UNPACK -UnboxedTuples -UndecidableInstances -UnicodeSyntax -UnliftedFFITypes -Unsafe.Coerce -ViewPatterns -WARNING -abs -acos -acosh -all -and -any -appendFile -as -asTypeOf -asin -asinh -atan -atan2 -atanh -break -case -catch -ceiling -class -compare -concat -concatMap -const -cos -cosh -curry -cycle -data -decodeFloat -default -deriving -div -divMod -do -drop -dropWhile -either -elem -else -encodeFloat -enumFrom -enumFromThen -enumFromThenTo -enumFromTo -error -exp -exponent -fail -filter -flip -floatDigits -floatRadix -floatRange -floor -fmap -fold -fold1 -foldr -foldr1 -fromEnum -fromInteger -fromIntegral -fromRational -fst -gcd -getChar -getContents -getLine -head -hiding -id -if -import -in -infix -infixl -infixr -init -instance -intract -ioError -isDenormalized -isIEEE -isInfinite -isNan -isNegativeZero -iterate -last -lcm -length -let -lex -lines -log -logBase -lookup -map -mapM -mapM_ -max -maxBound -maximum -maybe -min -minBound -minimum -mod -module -negate -newtype -not -notElem -null -odd -of -or -otherwise -pi -pred -print -product -properFraction -putChar -putStr -putStrLn -qualified -quot -quotRem -read -readFile -readIO -readList -readLn -readParen -reads -readsPrec -realtoFrac -recip -rem -repeat -replicate -return -reverse -round -scaleFloat -scanl -scanl1 -scanr -scanr1 -seq -sequence -sequence_ -show -showChar -showList -showParen -showString -shows -showsPrec -significand -signum -sin -sinh -snd -span -splitAt -sqrt -subtract -succ -sum -tail -take -takeWhile -tan -tanh -then -toEnum -toInteger -toRational -truncate -type -uncurry -undefined -unlines -until -unwords -unzip -unzip3 -userError -where -words -writeFile -zip -zip3 -zipWith -zipWith3 \ No newline at end of file diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/java-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/java-mode deleted file mode 100644 index 125deeb..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/java-mode +++ /dev/null @@ -1,53 +0,0 @@ -abstract -assert -boolean -break -byte -case -catch -char -class -const -continue -default -do -double -else -enum -extends -final -finally -float -for -goto -if -implements -import -instanceof -int -interface -long -native -new -package -private -protected -public -return -short -static -strictfp -super -switch -synchronized -this -throw -throws -transient -try -void -volatile -while -@Override -@Deprecated -@SuppressWarnings \ No newline at end of file diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/js-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/js-mode deleted file mode 100644 index 3d83f84..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/js-mode +++ /dev/null @@ -1,148 +0,0 @@ -Anchor -Area -Array -Boolean -Button -Checkbox -Date -Document -Element -FileUpload -Form -Frame -Function -Hidden -History -Image -Infinity -JavaArray -JavaClass -JavaObject -JavaPackage -Link -Location -Math -MimeType -NaN -Navigator -Number -Object -Option -Packages -Password -Plugin -Radio -RegExp -Reset -Select -String -Submit -Text -Textarea -Window -alert -arguments -assign -blur -break -callee -caller -captureEvents -case -clearInterval -clearTimeout -close -closed -comment -confirm -constructor -continue -default -defaultStatus -delete -do -document -else -escape -eval -export -find -focus -for -frames -function -getClass -history -home -if -import -in -innerHeight -innerWidth -isFinite -isNan -java -label -length -location -locationbar -menubar -moveBy -moveTo -name -navigate -navigator -netscape -new -onBlur -onError -onFocus -onLoad -onUnload -open -opener -outerHeight -outerWidth -pageXoffset -pageYoffset -parent -parseFloat -parseInt -personalbar -print -prompt -prototype -ref -releaseEvents -resizeBy -resizeTo -return -routeEvent -scroll -scrollBy -scrollTo -scrollbars -self -setInterval -setTimeout -status -statusbar -stop -sun -switch -taint -this -toString -toolbar -top -typeof -unescape -untaint -unwatch -valueOf -var -void -watch -while -window -with diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/lua-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/lua-mode deleted file mode 100644 index d0de6a4..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/lua-mode +++ /dev/null @@ -1,21 +0,0 @@ -and -break -do -else -elseif -end -false -for -function -if -in -local -nil -not -or -repeat -return -then -true -until -while diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/octave-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/octave-mode deleted file mode 100644 index 77c4ea1..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/octave-mode +++ /dev/null @@ -1,46 +0,0 @@ -# GNU Octave, and probably proprietary MATLAB -# https://www.gnu.org/software/octave/doc/interpreter/Keywords.html - -__FILE__ -__LINE__ -break -case -catch -classdef -continue -do -else -elseif -end -end_try_catch -end_unwind_protect -endclassdef -endenumeration -endevents -endfor -endfunction -endif -endmethods -endparfor -endproperties -endswitch -endwhile -enumeration -events -for -function -global -if -methods -otherwise -parfor -persistent -properties -return -static -switch -try -unitl -unwind_protect -unwind_protect_cleanup -while diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/php-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/php-mode deleted file mode 100644 index 07f2e89..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/php-mode +++ /dev/null @@ -1,6144 +0,0 @@ -abs -acos -acosh -addcslashes -addslashes -aggregate -aggregate_info -aggregate_methods -aggregate_methods_by_list -aggregate_methods_by_regexp -aggregate_properties -aggregate_properties_by_list -aggregate_properties_by_regexp -aggregation_info -amqpconnection -amqpexchange -amqpqueue -and -apache_child_terminate -apache_getenv -apache_get_modules -apache_get_version -apache_lookup_uri -apache_note -apache_request_headers -apache_reset_timeout -apache_response_headers -apache_setenv -apc_add -apc_bin_dump -apc_bin_dumpfile -apc_bin_load -apc_bin_loadfile -apc_cache_info -apc_cas -apc_clear_cache -apc_compile_file -apc_dec -apc_define_constants -apc_delete -apc_delete_file -apc_exists -apc_fetch -apc_inc -apciterator -apc_load_constants -apc_sma_info -apc_store -apd_breakpoint -apd_callstack -apd_clunk -apd_continue -apd_croak -apd_dump_function_table -apd_dump_persistent_resources -apd_dump_regular_resources -apd_echo -apd_get_active_symbols -apd_set_pprof_trace -apd_set_session -apd_set_session_trace -apd_set_session_trace_socket -appenditerator -array -arrayaccess -array_change_key_case -array_chunk -array_combine -array_count_values -array_diff -array_diff_assoc -array_diff_key -array_diff_uassoc -array_diff_ukey -array_fill -array_fill_keys -array_filter -array_flip -array_intersect -array_intersect_assoc -array_intersect_key -array_intersect_uassoc -array_intersect_ukey -arrayiterator -array_key_exists -array_keys -array_map -array_merge -array_merge_recursive -array_multisort -arrayobject -array_pad -array_pop -array_product -array_push -array_rand -array_reduce -array_replace -array_replace_recursive -array_reverse -array_search -array_shift -array_slice -array_splice -array_sum -array_udiff -array_udiff_assoc -array_udiff_uassoc -array_uintersect -array_uintersect_assoc -array_uintersect_uassoc -array_unique -array_unshift -array_values -array_walk -array_walk_recursive -arsort -as -asin -asinh -asort -assert -assert_options -atan -atan2 -atanh -badfunctioncallexception -badmethodcallexception -base64_decode -base64_encode -base_convert -basename -bbcode_add_element -bbcode_add_smiley -bbcode_create -bbcode_destroy -bbcode_parse -bbcode_set_arg_parser -bbcode_set_flags -bcadd -bccomp -bcdiv -bcmod -bcmul -bcompiler_load -bcompiler_load_exe -bcompiler_parse_class -bcompiler_read -bcompiler_write_class -bcompiler_write_constant -bcompiler_write_exe_footer -bcompiler_write_file -bcompiler_write_footer -bcompiler_write_function -bcompiler_write_functions_from_file -bcompiler_write_header -bcompiler_write_included_filename -bcpow -bcpowmod -bcscale -bcsqrt -bcsub -bin2hex -bindec -bindtextdomain -bind_textdomain_codeset -break -bson_decode -bson_encode -bumpValue -bzclose -bzcompress -bzdecompress -bzerrno -bzerror -bzerrstr -bzflush -bzopen -bzread -bzwrite -cachingiterator -cairo -cairoantialias -cairocontent -cairocontext -cairo_create -cairoexception -cairoextend -cairofillrule -cairofilter -cairofontface -cairo_font_face_get_type -cairo_font_face_status -cairofontoptions -cairo_font_options_create -cairo_font_options_equal -cairo_font_options_get_antialias -cairo_font_options_get_hint_metrics -cairo_font_options_get_hint_style -cairo_font_options_get_subpixel_order -cairo_font_options_hash -cairo_font_options_merge -cairo_font_options_set_antialias -cairo_font_options_set_hint_metrics -cairo_font_options_set_hint_style -cairo_font_options_set_subpixel_order -cairo_font_options_status -cairofontslant -cairofonttype -cairofontweight -cairoformat -cairo_format_stride_for_width -cairogradientpattern -cairohintmetrics -cairohintstyle -cairoimagesurface -cairo_image_surface_create -cairo_image_surface_create_for_data -cairo_image_surface_create_from_png -cairo_image_surface_get_data -cairo_image_surface_get_format -cairo_image_surface_get_height -cairo_image_surface_get_stride -cairo_image_surface_get_width -cairolineargradient -cairolinecap -cairolinejoin -cairomatrix -cairo_matrix_create_scale -cairo_matrix_create_translate -cairo_matrix_invert -cairo_matrix_multiply -cairo_matrix_rotate -cairo_matrix_transform_distance -cairo_matrix_transform_point -cairo_matrix_translate -cairooperator -cairopath -cairopattern -cairo_pattern_add_color_stop_rgb -cairo_pattern_add_color_stop_rgba -cairo_pattern_create_for_surface -cairo_pattern_create_linear -cairo_pattern_create_radial -cairo_pattern_create_rgb -cairo_pattern_create_rgba -cairo_pattern_get_color_stop_count -cairo_pattern_get_color_stop_rgba -cairo_pattern_get_extend -cairo_pattern_get_filter -cairo_pattern_get_linear_points -cairo_pattern_get_matrix -cairo_pattern_get_radial_circles -cairo_pattern_get_rgba -cairo_pattern_get_surface -cairo_pattern_get_type -cairo_pattern_set_extend -cairo_pattern_set_filter -cairo_pattern_set_matrix -cairo_pattern_status -cairopatterntype -cairopdfsurface -cairo_pdf_surface_create -cairo_pdf_surface_set_size -cairo_ps_get_levels -cairopslevel -cairo_ps_level_to_string -cairopssurface -cairo_ps_surface_create -cairo_ps_surface_dsc_begin_page_setup -cairo_ps_surface_dsc_begin_setup -cairo_ps_surface_dsc_comment -cairo_ps_surface_get_eps -cairo_ps_surface_restrict_to_level -cairo_ps_surface_set_eps -cairo_ps_surface_set_size -cairoradialgradient -cairoscaledfont -cairo_scaled_font_create -cairo_scaled_font_extents -cairo_scaled_font_get_ctm -cairo_scaled_font_get_font_face -cairo_scaled_font_get_font_matrix -cairo_scaled_font_get_font_options -cairo_scaled_font_get_scale_matrix -cairo_scaled_font_get_type -cairo_scaled_font_glyph_extents -cairo_scaled_font_status -cairo_scaled_font_text_extents -cairosolidpattern -cairostatus -cairosubpixelorder -cairosurface -cairo_surface_copy_page -cairo_surface_create_similar -cairo_surface_finish -cairo_surface_flush -cairo_surface_get_content -cairo_surface_get_device_offset -cairo_surface_get_font_options -cairo_surface_get_type -cairo_surface_mark_dirty -cairo_surface_mark_dirty_rectangle -cairosurfacepattern -cairo_surface_set_device_offset -cairo_surface_set_fallback_resolution -cairo_surface_show_page -cairo_surface_status -cairosurfacetype -cairo_surface_write_to_png -cairosvgsurface -cairo_svg_surface_create -cairo_svg_surface_restrict_to_version -cairosvgversion -cairo_svg_version_to_string -cairotoyfontface -calculhmac -calcul_hmac -cal_days_in_month -cal_from_jd -cal_info -__call() -callbackfilteriterator -__callStatic() -call_user_func -call_user_func_array -call_user_method -call_user_method_array -cal_to_jd -case -catch -ceil -cfunction -chdb -chdb_create -chdir -checkdate -checkdnsrr -chgrp -chmod -chop -chown -chr -chroot -chunk_split -class -__CLASS__ -class_alias -class_exists -class_implements -classkit_import -classkit_method_add -classkit_method_copy -classkit_method_redefine -classkit_method_remove -classkit_method_rename -class_parents -clearstatcache -clone -__clone() -closedir -closelog -collator -com -com_addref -com_create_guid -com_event_sink -com_get -com_get_active_object -com_invoke -com_isenum -com_load -com_load_typelib -com_message_pump -compact -com_print_typeinfo -com_propget -com_propput -com_propset -com_release -com_set -connection_aborted -connection_status -connection_timeout -const -constant -construct -__construct() -continue -convert_cyr_string -convert_uudecode -convert_uuencode -copy -cos -cosh -count -countable -count_chars -counter_bump -counter_bump_value -counter_create -counter_get -counter_get_meta -counter_get_named -counter_get_value -counter_reset -counter_reset_value -crack_check -crack_closedict -crack_getlastmessage -crack_opendict -crc32 -create_function -crypt -ctype_alnum -ctype_alpha -ctype_cntrl -ctype_digit -ctype_graph -ctype_lower -ctype_print -ctype_punct -ctype_space -ctype_upper -ctype_xdigit -cubrid_affected_rows -cubrid_bind -cubrid_client_encoding -cubrid_close -cubrid_close_prepare -cubrid_close_request -cubrid_col_get -cubrid_col_size -cubrid_column_names -cubrid_column_types -cubrid_commit -cubrid_connect -cubrid_connect_with_url -cubrid_current_oid -cubrid_data_seek -cubrid_db_name -cubrid_disconnect -cubrid_drop -cubrid_errno -cubrid_error -cubrid_error_code -cubrid_error_code_facility -cubrid_error_msg -cubrid_execute -cubrid_fetch -cubrid_fetch_array -cubrid_fetch_assoc -cubrid_fetch_field -cubrid_fetch_lengths -cubrid_fetch_object -cubrid_fetch_row -cubrid_field_flags -cubrid_field_len -cubrid_field_name -cubrid_field_seek -cubrid_field_table -cubrid_field_type -cubrid_free_result -cubrid_get -cubrid_get_autocommit -cubrid_get_charset -cubrid_get_class_name -cubrid_get_client_info -cubrid_get_db_parameter -cubrid_get_server_info -cubrid_insert_id -cubrid_is_instance -cubrid_list_dbs -cubrid_load_from_glo -cubrid_lob_close -cubrid_lob_export -cubrid_lob_get -cubrid_lob_send -cubrid_lob_size -cubrid_lock_read -cubrid_lock_write -cubrid_move_cursor -cubrid_new_glo -cubrid_next_result -cubrid_num_cols -cubrid_num_fields -cubrid_num_rows -cubrid_ping -cubrid_prepare -cubrid_put -cubrid_query -cubrid_real_escape_string -cubrid_result -cubrid_rollback -cubrid_save_to_glo -cubrid_schema -cubrid_send_glo -cubrid_seq_drop -cubrid_seq_insert -cubrid_seq_put -cubrid_set_add -cubrid_set_autocommit -cubrid_set_db_parameter -cubrid_set_drop -cubrid_unbuffered_query -cubrid_version -curl_close -curl_copy_handle -curl_errno -curl_error -curl_exec -curl_getinfo -curl_init -curl_multi_add_handle -curl_multi_close -curl_multi_exec -curl_multi_getcontent -curl_multi_info_read -curl_multi_init -curl_multi_remove_handle -curl_multi_select -curl_setopt -curl_setopt_array -curl_version -current -cyrus_authenticate -cyrus_bind -cyrus_close -cyrus_connect -cyrus_query -cyrus_unbind -date -date_add -date_create -date_create_from_format -date_date_set -date_default_timezone_get -date_default_timezone_set -date_diff -date_format -date_get_last_errors -dateinterval -date_interval_create_from_date_string -date_interval_format -date_isodate_set -date_modify -date_offset_get -date_parse -date_parse_from_format -dateperiod -date_sub -date_sun_info -date_sunrise -date_sunset -datetime -date_time_set -date_timestamp_get -date_timestamp_set -datetimezone -date_timezone_get -date_timezone_set -db2_autocommit -db2_bind_param -db2_client_info -db2_close -db2_column_privileges -db2_columns -db2_commit -db2_connect -db2_conn_error -db2_conn_errormsg -db2_cursor_type -db2_escape_string -db2_exec -db2_execute -db2_fetch_array -db2_fetch_assoc -db2_fetch_both -db2_fetch_object -db2_fetch_row -db2_field_display_size -db2_field_name -db2_field_num -db2_field_precision -db2_field_scale -db2_field_type -db2_field_width -db2_foreign_keys -db2_free_result -db2_free_stmt -db2_get_option -db2_last_insert_id -db2_lob_read -db2_next_result -db2_num_fields -db2_num_rows -db2_pclose -db2_pconnect -db2_prepare -db2_primary_keys -db2_procedure_columns -db2_procedures -db2_result -db2_rollback -db2_server_info -db2_set_option -db2_special_columns -db2_statistics -db2_stmt_error -db2_stmt_errormsg -db2_table_privileges -db2_tables -dba_close -dba_delete -dba_exists -dba_fetch -dba_firstkey -dba_handlers -dba_insert -dba_key_split -dba_list -dba_nextkey -dba_open -dba_optimize -dba_popen -dba_replace -dbase_add_record -dbase_close -dbase_create -dbase_delete_record -dbase_get_header_info -dbase_get_record -dbase_get_record_with_names -dbase_numfields -dbase_numrecords -dbase_open -dbase_pack -dbase_replace_record -dba_sync -dbplus_add -dbplus_aql -dbplus_chdir -dbplus_close -dbplus_curr -dbplus_errcode -dbplus_errno -dbplus_find -dbplus_first -dbplus_flush -dbplus_freealllocks -dbplus_freelock -dbplus_freerlocks -dbplus_getlock -dbplus_getunique -dbplus_info -dbplus_last -dbplus_lockrel -dbplus_next -dbplus_open -dbplus_prev -dbplus_rchperm -dbplus_rcreate -dbplus_rcrtexact -dbplus_rcrtlike -dbplus_resolve -dbplus_restorepos -dbplus_rkeys -dbplus_ropen -dbplus_rquery -dbplus_rrename -dbplus_rsecindex -dbplus_runlink -dbplus_rzap -dbplus_savepos -dbplus_setindex -dbplus_setindexbynumber -dbplus_sql -dbplus_tcl -dbplus_tremove -dbplus_undo -dbplus_undoprepare -dbplus_unlockrel -dbplus_unselect -dbplus_update -dbplus_xlockrel -dbplus_xunlockrel -dbx_close -dbx_compare -dbx_connect -dbx_error -dbx_escape_string -dbx_fetch_row -dbx_query -dbx_sort -dcgettext -dcngettext -deaggregate -debug_backtrace -debug_print_backtrace -debug_zval_dump -decbin -dechex -declare -decoct -default -define -defined -define_syslog_variables -deg2rad -delete -__destruct() -dgettext -die -dio_close -dio_fcntl -dio_open -dio_read -dio_seek -dio_stat -dio_tcsetattr -dio_truncate -dio_write -dir -__DIR__ -directoryiterator -dirname -diskfreespace -disk_free_space -disk_total_space -dl -dngettext -dns_check_record -dns_get_mx -dns_get_record -do -domainexception -domattr -domattribute_name -domattribute_set_value -domattribute_specified -domattribute_value -domcharacterdata -domcomment -domdocument -domdocument_add_root -domdocument_create_attribute -domdocument_create_cdata_section -domdocument_create_comment -domdocument_create_element -domdocument_create_element_ns -domdocument_create_entity_reference -domdocument_create_processing_instruction -domdocument_create_text_node -domdocument_doctype -domdocument_document_element -domdocument_dump_file -domdocument_dump_mem -domdocumentfragment -domdocument_get_element_by_id -domdocument_get_elements_by_tagname -domdocument_html_dump_mem -domdocumenttype -domdocumenttype_entities -domdocumenttype_internal_subset -domdocumenttype_name -domdocumenttype_notations -domdocumenttype_public_id -domdocumenttype_system_id -domdocument_xinclude -domelement -domelement_get_attribute -domelement_get_attribute_node -domelement_get_elements_by_tagname -domelement_has_attribute -domelement_remove_attribute -domelement_set_attribute -domelement_set_attribute_node -domelement_tagname -domentity -domentityreference -domexception -domimplementation -dom_import_simplexml -domnamednodemap -domnode -domnode_add_namespace -domnode_append_child -domnode_append_sibling -domnode_attributes -domnode_child_nodes -domnode_clone_node -domnode_dump_node -domnode_first_child -domnode_get_content -domnode_has_attributes -domnode_has_child_nodes -domnode_insert_before -domnode_is_blank_node -domnode_last_child -domnodelist -domnode_next_sibling -domnode_node_name -domnode_node_type -domnode_node_value -domnode_owner_document -domnode_parent_node -domnode_prefix -domnode_previous_sibling -domnode_remove_child -domnode_replace_child -domnode_replace_node -domnode_set_content -domnode_set_name -domnode_set_namespace -domnode_unlink_node -domnotation -domprocessinginstruction -domprocessinginstruction_data -domprocessinginstruction_target -domtext -domxml_new_doc -domxml_open_file -domxml_open_mem -domxml_version -domxml_xmltree -domxml_xslt_stylesheet -domxml_xslt_stylesheet_doc -domxml_xslt_stylesheet_file -domxml_xslt_version -domxpath -domxsltstylesheet_process -domxsltstylesheet_result_dump_file -domxsltstylesheet_result_dump_mem -dotnet -dotnet_load -doubleval -each -easter_date -easter_days -echo -else -elseif -empty -emptyiterator -enchant_broker_describe -enchant_broker_dict_exists -enchant_broker_free -enchant_broker_free_dict -enchant_broker_get_error -enchant_broker_init -enchant_broker_list_dicts -enchant_broker_request_dict -enchant_broker_request_pwl_dict -enchant_broker_set_ordering -enchant_dict_add_to_personal -enchant_dict_add_to_session -enchant_dict_check -enchant_dict_describe -enchant_dict_get_error -enchant_dict_is_in_session -enchant_dict_quick_check -enchant_dict_store_replacement -enchant_dict_suggest -end -enddeclare -endfor -endforeach -endif -endswitch -endwhile -ereg -eregi -eregi_replace -ereg_replace -errorexception -error_get_last -error_log -error_reporting -escapeshellarg -escapeshellcmd -eval -event_add -event_base_free -event_base_loop -event_base_loopbreak -event_base_loopexit -event_base_new -event_base_priority_init -event_base_set -event_buffer_base_set -event_buffer_disable -event_buffer_enable -event_buffer_fd_set -event_buffer_free -event_buffer_new -event_buffer_priority_set -event_buffer_read -event_buffer_set_callback -event_buffer_timeout_set -event_buffer_watermark_set -event_buffer_write -event_del -event_free -event_new -event_set -exception -exec -exif_imagetype -exif_read_data -exif_tagname -exif_thumbnail -exit -exp -expect_expectl -expect_popen -explode -expm1 -export -extends -extension_loaded -extract -ezmlm_hash -fam_cancel_monitor -fam_close -fam_monitor_collection -fam_monitor_directory -fam_monitor_file -fam_next_event -fam_open -fam_pending -fam_resume_monitor -fam_suspend_monitor -fbsql_affected_rows -fbsql_autocommit -fbsql_blob_size -fbsql_change_user -fbsql_clob_size -fbsql_close -fbsql_commit -fbsql_connect -fbsql_create_blob -fbsql_create_clob -fbsql_create_db -fbsql_database -fbsql_database_password -fbsql_data_seek -fbsql_db_query -fbsql_db_status -fbsql_drop_db -fbsql_errno -fbsql_error -fbsql_fetch_array -fbsql_fetch_assoc -fbsql_fetch_field -fbsql_fetch_lengths -fbsql_fetch_object -fbsql_fetch_row -fbsql_field_flags -fbsql_field_len -fbsql_field_name -fbsql_field_seek -fbsql_field_table -fbsql_field_type -fbsql_free_result -fbsql_get_autostart_info -fbsql_hostname -fbsql_insert_id -fbsql_list_dbs -fbsql_list_fields -fbsql_list_tables -fbsql_next_result -fbsql_num_fields -fbsql_num_rows -fbsql_password -fbsql_pconnect -fbsql_query -fbsql_read_blob -fbsql_read_clob -fbsql_result -fbsql_rollback -fbsql_rows_fetched -fbsql_select_db -fbsql_set_characterset -fbsql_set_lob_mode -fbsql_set_password -fbsql_set_transaction -fbsql_start_db -fbsql_stop_db -fbsql_tablename -fbsql_table_name -fbsql_username -fbsql_warnings -fclose -fdf_add_doc_javascript -fdf_add_template -fdf_close -fdf_create -fdf_enum_values -fdf_errno -fdf_error -fdf_get_ap -fdf_get_attachment -fdf_get_encoding -fdf_get_file -fdf_get_flags -fdf_get_opt -fdf_get_status -fdf_get_value -fdf_get_version -fdf_header -fdf_next_field_name -fdf_open -fdf_open_string -fdf_remove_item -fdf_save -fdf_save_string -fdf_set_ap -fdf_set_encoding -fdf_set_file -fdf_set_flags -fdf_set_javascript_action -fdf_set_on_import_javascript -fdf_set_opt -fdf_set_status -fdf_set_submit_form_action -fdf_set_target_frame -fdf_set_value -fdf_set_version -feof -fflush -fgetc -fgetcsv -fgets -fgetss -file -__FILE__ -fileatime -filectime -file_exists -file_get_contents -filegroup -fileinode -filemtime -fileowner -fileperms -filepro -filepro_fieldcount -filepro_fieldname -filepro_fieldtype -filepro_fieldwidth -filepro_retrieve -filepro_rowcount -file_put_contents -filesize -filesystemiterator -filetype -filter_has_var -filter_id -filter_input -filter_input_array -filteriterator -filter_list -filter_var -filter_var_array -final -finfo_buffer -finfo_close -finfo_file -finfo_open -finfo_set_flags -floatval -flock -floor -flush -fmod -fnmatch -fopen -for -foreach -forward_static_call -forward_static_call_array -fpassthru -fprintf -fputcsv -fputs -fread -frenchtojd -fribidi_log2vis -fscanf -fseek -fsockopen -fstat -ftell -ftok -ftp_alloc -ftp_cdup -ftp_chdir -ftp_chmod -ftp_close -ftp_connect -ftp_delete -ftp_exec -ftp_fget -ftp_fput -ftp_get -ftp_get_option -ftp_login -ftp_mdtm -ftp_mkdir -ftp_nb_continue -ftp_nb_fget -ftp_nb_fput -ftp_nb_get -ftp_nb_put -ftp_nlist -ftp_pasv -ftp_put -ftp_pwd -ftp_quit -ftp_raw -ftp_rawlist -ftp_rename -ftp_rmdir -ftp_set_option -ftp_site -ftp_size -ftp_ssl_connect -ftp_systype -ftruncate -func_get_arg -func_get_args -func_num_args -function -__FUNCTION__ -function_exists -fwrite -gc_collect_cycles -gc_disable -gc_enable -gc_enabled -gd_info -gearmanclient -gearmanjob -gearmantask -gearmanworker -geoip_continent_code_by_name -geoip_country_code3_by_name -geoip_country_code_by_name -geoip_country_name_by_name -geoip_database_info -geoip_db_avail -geoip_db_filename -geoip_db_get_all_info -geoip_id_by_name -geoip_isp_by_name -geoip_org_by_name -geoip_record_by_name -geoip_region_by_name -geoip_region_name_by_code -geoip_time_zone_by_country_and_region -__get() -getallheaders -get_browser -get_called_class -get_cfg_var -get_class -get_class_methods -get_class_vars -getclosure -getconstant -getconstants -getconstructor -get_current_user -getcwd -getdate -get_declared_classes -get_declared_interfaces -getdefaultproperties -get_defined_constants -get_defined_functions -get_defined_vars -getdoccomment -getendline -getenv -getextension -get_extension_funcs -getextensionname -getfilename -get_headers -gethostbyaddr -gethostbyname -gethostbynamel -gethostname -get_html_translation_table -getimagesize -get_included_files -get_include_path -getinterfacenames -getinterfaces -getlastmod -get_loaded_extensions -get_magic_quotes_gpc -get_magic_quotes_runtime -getMeta -get_meta_tags -getmethod -getmethods -getmodifiers -getmxrr -getmygid -getmyinode -getmypid -getmyuid -getname -getNamed -getnamespacename -get_object_vars -getopt -getparentclass -get_parent_class -getproperties -getproperty -getprotobyname -getprotobynumber -getrandmax -get_required_files -get_resource_type -getrusage -getservbyname -getservbyport -getshortname -getstartline -getstaticproperties -getstaticpropertyvalue -gettext -gettimeofday -gettraitaliases -gettraitnames -gettraits -gettype -getValue -glob -global -globiterator -gmagick -gmagickdraw -gmagickpixel -gmdate -gmmktime -gmp_abs -gmp_add -gmp_and -gmp_clrbit -gmp_cmp -gmp_com -gmp_div -gmp_divexact -gmp_div_q -gmp_div_qr -gmp_div_r -gmp_fact -gmp_gcd -gmp_gcdext -gmp_hamdist -gmp_init -gmp_intval -gmp_invert -gmp_jacobi -gmp_legendre -gmp_mod -gmp_mul -gmp_neg -gmp_nextprime -gmp_or -gmp_perfect_square -gmp_popcount -gmp_pow -gmp_powm -gmp_prob_prime -gmp_random -gmp_scan0 -gmp_scan1 -gmp_setbit -gmp_sign -gmp_sqrt -gmp_sqrtrem -gmp_strval -gmp_sub -gmp_testbit -gmp_xor -gmstrftime -gnupg_adddecryptkey -gnupg_addencryptkey -gnupg_addsignkey -gnupg_cleardecryptkeys -gnupg_clearencryptkeys -gnupg_clearsignkeys -gnupg_decrypt -gnupg_decryptverify -gnupg_encrypt -gnupg_encryptsign -gnupg_export -gnupg_geterror -gnupg_getprotocol -gnupg_import -gnupg_init -gnupg_keyinfo -gnupg_setarmor -gnupg_seterrormode -gnupg_setsignmode -gnupg_sign -gnupg_verify -gopher_parsedir -goto -grapheme_extract -grapheme_stripos -grapheme_stristr -grapheme_strlen -grapheme_strpos -grapheme_strripos -grapheme_strrpos -grapheme_strstr -grapheme_substr -gregoriantojd -gupnp_context_get_host_ip -gupnp_context_get_port -gupnp_context_get_subscription_timeout -gupnp_context_host_path -gupnp_context_new -gupnp_context_set_subscription_timeout -gupnp_context_timeout_add -gupnp_context_unhost_path -gupnp_control_point_browse_start -gupnp_control_point_browse_stop -gupnp_control_point_callback_set -gupnp_control_point_new -gupnp_device_action_callback_set -gupnp_device_info_get -gupnp_device_info_get_service -gupnp_root_device_get_available -gupnp_root_device_get_relative_location -gupnp_root_device_new -gupnp_root_device_set_available -gupnp_root_device_start -gupnp_root_device_stop -gupnp_service_action_get -gupnp_service_action_return -gupnp_service_action_return_error -gupnp_service_action_set -gupnp_service_freeze_notify -gupnp_service_info_get -gupnp_service_info_get_introspection -gupnp_service_introspection_get_state_variable -gupnp_service_notify -gupnp_service_proxy_action_get -gupnp_service_proxy_action_set -gupnp_service_proxy_add_notify -gupnp_service_proxy_callback_set -gupnp_service_proxy_get_subscribed -gupnp_service_proxy_remove_notify -gupnp_service_proxy_set_subscribed -gupnp_service_thaw_notify -gzclose -gzcompress -gzdecode -gzdeflate -gzencode -gzeof -gzfile -gzgetc -gzgets -gzgetss -gzinflate -gzopen -gzpassthru -gzputs -gzread -gzrewind -gzseek -gztell -gzuncompress -gzwrite -halt_compiler -haruannotation -haruannotation_setborderstyle -haruannotation_sethighlightmode -haruannotation_seticon -haruannotation_setopened -harudestination -harudestination_setfit -harudestination_setfitb -harudestination_setfitbh -harudestination_setfitbv -harudestination_setfith -harudestination_setfitr -harudestination_setfitv -harudestination_setxyz -harudoc -harudoc_addpage -harudoc_addpagelabel -harudoc_construct -harudoc_createoutline -harudoc_getcurrentencoder -harudoc_getcurrentpage -harudoc_getencoder -harudoc_getfont -harudoc_getinfoattr -harudoc_getpagelayout -harudoc_getpagemode -harudoc_getstreamsize -harudoc_insertpage -harudoc_loadjpeg -harudoc_loadpng -harudoc_loadraw -harudoc_loadttc -harudoc_loadttf -harudoc_loadtype1 -harudoc_output -harudoc_readfromstream -harudoc_reseterror -harudoc_resetstream -harudoc_save -harudoc_savetostream -harudoc_setcompressionmode -harudoc_setcurrentencoder -harudoc_setencryptionmode -harudoc_setinfoattr -harudoc_setinfodateattr -harudoc_setopenaction -harudoc_setpagelayout -harudoc_setpagemode -harudoc_setpagesconfiguration -harudoc_setpassword -harudoc_setpermission -harudoc_usecnsencodings -harudoc_usecnsfonts -harudoc_usecntencodings -harudoc_usecntfonts -harudoc_usejpencodings -harudoc_usejpfonts -harudoc_usekrencodings -harudoc_usekrfonts -haruencoder -haruencoder_getbytetype -haruencoder_gettype -haruencoder_getunicode -haruencoder_getwritingmode -haruexception -harufont -harufont_getascent -harufont_getcapheight -harufont_getdescent -harufont_getencodingname -harufont_getfontname -harufont_gettextwidth -harufont_getunicodewidth -harufont_getxheight -harufont_measuretext -haruimage -haruimage_getbitspercomponent -haruimage_getcolorspace -haruimage_getheight -haruimage_getsize -haruimage_getwidth -haruimage_setcolormask -haruimage_setmaskimage -haruoutline -haruoutline_setdestination -haruoutline_setopened -harupage -harupage_arc -harupage_begintext -harupage_circle -harupage_closepath -harupage_concat -harupage_createdestination -harupage_createlinkannotation -harupage_createtextannotation -harupage_createurlannotation -harupage_curveto -harupage_curveto2 -harupage_curveto3 -harupage_drawimage -harupage_ellipse -harupage_endpath -harupage_endtext -harupage_eofill -harupage_eofillstroke -harupage_fill -harupage_fillstroke -harupage_getcharspace -harupage_getcmykfill -harupage_getcmykstroke -harupage_getcurrentfont -harupage_getcurrentfontsize -harupage_getcurrentpos -harupage_getcurrenttextpos -harupage_getdash -harupage_getfillingcolorspace -harupage_getflatness -harupage_getgmode -harupage_getgrayfill -harupage_getgraystroke -harupage_getheight -harupage_gethorizontalscaling -harupage_getlinecap -harupage_getlinejoin -harupage_getlinewidth -harupage_getmiterlimit -harupage_getrgbfill -harupage_getrgbstroke -harupage_getstrokingcolorspace -harupage_gettextleading -harupage_gettextmatrix -harupage_gettextrenderingmode -harupage_gettextrise -harupage_gettextwidth -harupage_gettransmatrix -harupage_getwidth -harupage_getwordspace -harupage_lineto -harupage_measuretext -harupage_movetextpos -harupage_moveto -harupage_movetonextline -harupage_rectangle -harupage_setcharspace -harupage_setcmykfill -harupage_setcmykstroke -harupage_setdash -harupage_setflatness -harupage_setfontandsize -harupage_setgrayfill -harupage_setgraystroke -harupage_setheight -harupage_sethorizontalscaling -harupage_setlinecap -harupage_setlinejoin -harupage_setlinewidth -harupage_setmiterlimit -harupage_setrgbfill -harupage_setrgbstroke -harupage_setrotate -harupage_setsize -harupage_setslideshow -harupage_settextleading -harupage_settextmatrix -harupage_settextrenderingmode -harupage_settextrise -harupage_setwidth -harupage_setwordspace -harupage_showtext -harupage_showtextnextline -harupage_stroke -harupage_textout -harupage_textrect -hasconstant -hash -hash_algos -hash_copy -hash_file -hash_final -hash_hmac -hash_hmac_file -hash_init -hash_update -hash_update_file -hash_update_stream -hasmethod -hasproperty -header -header_register_callback -header_remove -headers_list -headers_sent -hebrev -hebrevc -hex2bin -hexdec -highlight_file -highlight_string -htmlentities -html_entity_decode -htmlspecialchars -htmlspecialchars_decode -http_build_cookie -http_build_query -http_build_str -http_build_url -http_cache_etag -http_cache_last_modified -http_chunked_decode -http_date -http_deflate -httpdeflatestream -httpdeflatestream_construct -httpdeflatestream_factory -httpdeflatestream_finish -httpdeflatestream_flush -httpdeflatestream_update -http_get -http_get_request_body -http_get_request_body_stream -http_get_request_headers -http_head -http_inflate -httpinflatestream -httpinflatestream_construct -httpinflatestream_factory -httpinflatestream_finish -httpinflatestream_flush -httpinflatestream_update -http_match_etag -http_match_modified -http_match_request_header -httpmessage -httpmessage_addheaders -httpmessage_construct -httpmessage_detach -httpmessage_factory -httpmessage_fromenv -httpmessage_fromstring -httpmessage_getbody -httpmessage_getheader -httpmessage_getheaders -httpmessage_gethttpversion -httpmessage_getparentmessage -httpmessage_getrequestmethod -httpmessage_getrequesturl -httpmessage_getresponsecode -httpmessage_getresponsestatus -httpmessage_gettype -httpmessage_guesscontenttype -httpmessage_prepend -httpmessage_reverse -httpmessage_send -httpmessage_setbody -httpmessage_setheaders -httpmessage_sethttpversion -httpmessage_setrequestmethod -httpmessage_setrequesturl -httpmessage_setresponsecode -httpmessage_setresponsestatus -httpmessage_settype -httpmessage_tomessagetypeobject -httpmessage_tostring -http_negotiate_charset -http_negotiate_content_type -http_negotiate_language -http_parse_cookie -http_parse_headers -http_parse_message -http_parse_params -http_persistent_handles_clean -http_persistent_handles_count -http_persistent_handles_ident -http_post_data -http_post_fields -http_put_data -http_put_file -http_put_stream -httpquerystring -httpquerystring_construct -httpquerystring_get -httpquerystring_mod -httpquerystring_set -httpquerystring_singleton -httpquerystring_toarray -httpquerystring_tostring -httpquerystring_xlate -http_redirect -httprequest -http_request -httprequest_addcookies -httprequest_addheaders -httprequest_addpostfields -httprequest_addpostfile -httprequest_addputdata -httprequest_addquerydata -httprequest_addrawpostdata -httprequest_addssloptions -http_request_body_encode -httprequest_clearhistory -httprequest_construct -httprequest_enablecookies -httprequest_getcontenttype -httprequest_getcookies -httprequest_getheaders -httprequest_gethistory -httprequest_getmethod -httprequest_getoptions -httprequest_getpostfields -httprequest_getpostfiles -httprequest_getputdata -httprequest_getputfile -httprequest_getquerydata -httprequest_getrawpostdata -httprequest_getrawrequestmessage -httprequest_getrawresponsemessage -httprequest_getrequestmessage -httprequest_getresponsebody -httprequest_getresponsecode -httprequest_getresponsecookies -httprequest_getresponsedata -httprequest_getresponseheader -httprequest_getresponseinfo -httprequest_getresponsemessage -httprequest_getresponsestatus -httprequest_getssloptions -httprequest_geturl -http_request_method_exists -http_request_method_name -http_request_method_register -http_request_method_unregister -httprequestpool -httprequestpool_attach -httprequestpool_construct -httprequestpool_destruct -httprequestpool_detach -httprequestpool_getattachedrequests -httprequestpool_getfinishedrequests -httprequestpool_reset -httprequestpool_send -httprequestpool_socketperform -httprequestpool_socketselect -httprequest_resetcookies -httprequest_send -httprequest_setcontenttype -httprequest_setcookies -httprequest_setheaders -httprequest_setmethod -httprequest_setoptions -httprequest_setpostfields -httprequest_setpostfiles -httprequest_setputdata -httprequest_setputfile -httprequest_setquerydata -httprequest_setrawpostdata -httprequest_setssloptions -httprequest_seturl -httpresponse -httpresponse_capture -http_response_code -httpresponse_getbuffersize -httpresponse_getcache -httpresponse_getcachecontrol -httpresponse_getcontentdisposition -httpresponse_getcontenttype -httpresponse_getdata -httpresponse_getetag -httpresponse_getfile -httpresponse_getgzip -httpresponse_getheader -httpresponse_getlastmodified -httpresponse_getrequestbody -httpresponse_getrequestbodystream -httpresponse_getrequestheaders -httpresponse_getstream -httpresponse_getthrottledelay -httpresponse_guesscontenttype -httpresponse_redirect -httpresponse_send -httpresponse_setbuffersize -httpresponse_setcache -httpresponse_setcachecontrol -httpresponse_setcontentdisposition -httpresponse_setcontenttype -httpresponse_setdata -httpresponse_setetag -httpresponse_setfile -httpresponse_setgzip -httpresponse_setheader -httpresponse_setlastmodified -httpresponse_setstream -httpresponse_setthrottledelay -httpresponse_status -http_send_content_disposition -http_send_content_type -http_send_data -http_send_file -http_send_last_modified -http_send_status -http_send_stream -http_support -http_throttle -hwapi_attribute -hwapi_attribute_key -hwapi_attribute_langdepvalue -hwapi_attribute_value -hwapi_attribute_values -hwapi_checkin -hwapi_checkout -hwapi_children -hwapi_content -hwapi_content_mimetype -hwapi_content_read -hwapi_copy -hwapi_dbstat -hwapi_dcstat -hwapi_dstanchors -hwapi_dstofsrcanchor -hwapi_error_count -hwapi_error_reason -hwapi_find -hwapi_ftstat -hwapi_hgcsp -hwapi_hwstat -hwapi_identify -hwapi_info -hwapi_insert -hwapi_insertanchor -hwapi_insertcollection -hwapi_insertdocument -hwapi_link -hwapi_lock -hwapi_move -hwapi_new_content -hwapi_object -hwapi_object_assign -hwapi_object_attreditable -hwapi_objectbyanchor -hwapi_object_count -hwapi_object_insert -hwapi_object_new -hwapi_object_remove -hwapi_object_title -hwapi_object_value -hwapi_parents -hwapi_reason_description -hwapi_reason_type -hwapi_remove -hwapi_replace -hwapi_setcommittedversion -hwapi_srcanchors -hwapi_srcsofdst -hwapi_unlock -hwapi_user -hwapi_userlist -hw_array2objrec -hw_changeobject -hw_children -hw_childrenobj -hw_close -hw_connect -hw_connection_info -hw_cp -hw_deleteobject -hw_docbyanchor -hw_docbyanchorobj -hw_document_attributes -hw_document_bodytag -hw_document_content -hw_document_setcontent -hw_document_size -hw_dummy -hw_edittext -hw_error -hw_errormsg -hw_free_document -hw_getanchors -hw_getanchorsobj -hw_getandlock -hw_getchildcoll -hw_getchildcollobj -hw_getchilddoccoll -hw_getchilddoccollobj -hw_getobject -hw_getobjectbyquery -hw_getobjectbyquerycoll -hw_getobjectbyquerycollobj -hw_getobjectbyqueryobj -hw_getparents -hw_getparentsobj -hw_getrellink -hw_getremote -hw_getremotechildren -hw_getsrcbydestobj -hw_gettext -hw_getusername -hw_identify -hw_incollections -hw_info -hw_inscoll -hw_insdoc -hw_insertanchors -hw_insertdocument -hw_insertobject -hw_mapid -hw_modifyobject -hw_mv -hw_new_document -hw_objrec2array -hw_output_document -hw_pconnect -hw_pipedocument -hw_root -hw_setlinkroot -hw_stat -hw_unlock -hw_who -hypot -ibase_add_user -ibase_affected_rows -ibase_backup -ibase_blob_add -ibase_blob_cancel -ibase_blob_close -ibase_blob_create -ibase_blob_echo -ibase_blob_get -ibase_blob_import -ibase_blob_info -ibase_blob_open -ibase_close -ibase_commit -ibase_commit_ret -ibase_connect -ibase_db_info -ibase_delete_user -ibase_drop_db -ibase_errcode -ibase_errmsg -ibase_execute -ibase_fetch_assoc -ibase_fetch_object -ibase_fetch_row -ibase_field_info -ibase_free_event_handler -ibase_free_query -ibase_free_result -ibase_gen_id -ibase_maintain_db -ibase_modify_user -ibase_name_result -ibase_num_fields -ibase_num_params -ibase_param_info -ibase_pconnect -ibase_prepare -ibase_query -ibase_restore -ibase_rollback -ibase_rollback_ret -ibase_server_info -ibase_service_attach -ibase_service_detach -ibase_set_event_handler -ibase_timefmt -ibase_trans -ibase_wait_event -iconv -iconv_get_encoding -iconv_mime_decode -iconv_mime_decode_headers -iconv_mime_encode -iconv_set_encoding -iconv_strlen -iconv_strpos -iconv_strrpos -iconv_substr -id3_get_frame_long_name -id3_get_frame_short_name -id3_get_genre_id -id3_get_genre_list -id3_get_genre_name -id3_get_tag -id3_get_version -id3_remove_tag -id3_set_tag -idate -idn_to_ascii -idn_to_unicode -idn_to_utf8 -if -ifx_affected_rows -ifx_blobinfile_mode -ifx_byteasvarchar -ifx_close -ifx_connect -ifx_copy_blob -ifx_create_blob -ifx_create_char -ifx_do -ifx_error -ifx_errormsg -ifx_fetch_row -ifx_fieldproperties -ifx_fieldtypes -ifx_free_blob -ifx_free_char -ifx_free_result -ifx_get_blob -ifx_get_char -ifx_getsqlca -ifx_htmltbl_result -ifx_nullformat -ifx_num_fields -ifx_num_rows -ifx_pconnect -ifx_prepare -ifx_query -ifx_textasvarchar -ifx_update_blob -ifx_update_char -ifxus_close_slob -ifxus_create_slob -ifxus_free_slob -ifxus_open_slob -ifxus_read_slob -ifxus_seek_slob -ifxus_tell_slob -ifxus_write_slob -ignore_user_abort -iis_add_server -iis_get_dir_security -iis_get_script_map -iis_get_server_by_comment -iis_get_server_by_path -iis_get_server_rights -iis_get_service_state -iis_remove_server -iis_set_app_settings -iis_set_dir_security -iis_set_script_map -iis_set_server_rights -iis_start_server -iis_start_service -iis_stop_server -iis_stop_service -image2wbmp -imagealphablending -imageantialias -imagearc -imagechar -imagecharup -imagecolorallocate -imagecolorallocatealpha -imagecolorat -imagecolorclosest -imagecolorclosestalpha -imagecolorclosesthwb -imagecolordeallocate -imagecolorexact -imagecolorexactalpha -imagecolormatch -imagecolorresolve -imagecolorresolvealpha -imagecolorset -imagecolorsforindex -imagecolorstotal -imagecolortransparent -imageconvolution -imagecopy -imagecopymerge -imagecopymergegray -imagecopyresampled -imagecopyresized -imagecreate -imagecreatefromgd -imagecreatefromgd2 -imagecreatefromgd2part -imagecreatefromgif -imagecreatefromjpeg -imagecreatefrompng -imagecreatefromstring -imagecreatefromwbmp -imagecreatefromxbm -imagecreatefromxpm -imagecreatetruecolor -imagedashedline -imagedestroy -imageellipse -imagefill -imagefilledarc -imagefilledellipse -imagefilledpolygon -imagefilledrectangle -imagefilltoborder -imagefilter -imagefontheight -imagefontwidth -imageftbbox -imagefttext -imagegammacorrect -imagegd -imagegd2 -imagegif -imagegrabscreen -imagegrabwindow -imageinterlace -imageistruecolor -imagejpeg -imagelayereffect -imageline -imageloadfont -imagepalettecopy -imagepng -imagepolygon -imagepsbbox -imagepsencodefont -imagepsextendfont -imagepsfreefont -imagepsloadfont -imagepsslantfont -imagepstext -imagerectangle -imagerotate -imagesavealpha -imagesetbrush -imagesetpixel -imagesetstyle -imagesetthickness -imagesettile -imagestring -imagestringup -imagesx -imagesy -imagetruecolortopalette -imagettfbbox -imagettftext -imagetypes -image_type_to_extension -image_type_to_mime_type -imagewbmp -imagexbm -imagick -imagick_adaptiveblurimage -imagick_adaptiveresizeimage -imagick_adaptivesharpenimage -imagick_adaptivethresholdimage -imagick_addimage -imagick_addnoiseimage -imagick_affinetransformimage -imagick_animateimages -imagick_annotateimage -imagick_appendimages -imagick_averageimages -imagick_blackthresholdimage -imagick_blurimage -imagick_borderimage -imagick_charcoalimage -imagick_chopimage -imagick_clear -imagick_clipimage -imagick_clippathimage -imagick_clone -imagick_clutimage -imagick_coalesceimages -imagick_colorfloodfillimage -imagick_colorizeimage -imagick_combineimages -imagick_commentimage -imagick_compareimagechannels -imagick_compareimagelayers -imagick_compareimages -imagick_compositeimage -imagick_construct -imagick_contrastimage -imagick_contraststretchimage -imagick_convolveimage -imagick_cropimage -imagick_cropthumbnailimage -imagick_current -imagick_cyclecolormapimage -imagick_decipherimage -imagick_deconstructimages -imagick_deleteimageartifact -imagick_despeckleimage -imagick_destroy -imagick_displayimage -imagick_displayimages -imagick_distortimage -imagickdraw -imagickdraw_affine -imagickdraw_annotation -imagickdraw_arc -imagickdraw_bezier -imagickdraw_circle -imagickdraw_clear -imagickdraw_clone -imagickdraw_color -imagickdraw_comment -imagickdraw_composite -imagickdraw_construct -imagickdraw_destroy -imagickdraw_ellipse -imagickdraw_getclippath -imagickdraw_getcliprule -imagickdraw_getclipunits -imagickdraw_getfillcolor -imagickdraw_getfillopacity -imagickdraw_getfillrule -imagickdraw_getfont -imagickdraw_getfontfamily -imagickdraw_getfontsize -imagickdraw_getfontstyle -imagickdraw_getfontweight -imagickdraw_getgravity -imagickdraw_getstrokeantialias -imagickdraw_getstrokecolor -imagickdraw_getstrokedasharray -imagickdraw_getstrokedashoffset -imagickdraw_getstrokelinecap -imagickdraw_getstrokelinejoin -imagickdraw_getstrokemiterlimit -imagickdraw_getstrokeopacity -imagickdraw_getstrokewidth -imagickdraw_gettextalignment -imagickdraw_gettextantialias -imagickdraw_gettextdecoration -imagickdraw_gettextencoding -imagickdraw_gettextundercolor -imagickdraw_getvectorgraphics -imagick_drawimage -imagickdraw_line -imagickdraw_matte -imagickdraw_pathclose -imagickdraw_pathcurvetoabsolute -imagickdraw_pathcurvetoquadraticbezierabsolute -imagickdraw_pathcurvetoquadraticbezierrelative -imagickdraw_pathcurvetoquadraticbeziersmoothabsolute -imagickdraw_pathcurvetoquadraticbeziersmoothrelative -imagickdraw_pathcurvetorelative -imagickdraw_pathcurvetosmoothabsolute -imagickdraw_pathcurvetosmoothrelative -imagickdraw_pathellipticarcabsolute -imagickdraw_pathellipticarcrelative -imagickdraw_pathfinish -imagickdraw_pathlinetoabsolute -imagickdraw_pathlinetohorizontalabsolute -imagickdraw_pathlinetohorizontalrelative -imagickdraw_pathlinetorelative -imagickdraw_pathlinetoverticalabsolute -imagickdraw_pathlinetoverticalrelative -imagickdraw_pathmovetoabsolute -imagickdraw_pathmovetorelative -imagickdraw_pathstart -imagickdraw_point -imagickdraw_polygon -imagickdraw_polyline -imagickdraw_pop -imagickdraw_popclippath -imagickdraw_popdefs -imagickdraw_poppattern -imagickdraw_push -imagickdraw_pushclippath -imagickdraw_pushdefs -imagickdraw_pushpattern -imagickdraw_rectangle -imagickdraw_render -imagickdraw_rotate -imagickdraw_roundrectangle -imagickdraw_scale -imagickdraw_setclippath -imagickdraw_setcliprule -imagickdraw_setclipunits -imagickdraw_setfillalpha -imagickdraw_setfillcolor -imagickdraw_setfillopacity -imagickdraw_setfillpatternurl -imagickdraw_setfillrule -imagickdraw_setfont -imagickdraw_setfontfamily -imagickdraw_setfontsize -imagickdraw_setfontstretch -imagickdraw_setfontstyle -imagickdraw_setfontweight -imagickdraw_setgravity -imagickdraw_setstrokealpha -imagickdraw_setstrokeantialias -imagickdraw_setstrokecolor -imagickdraw_setstrokedasharray -imagickdraw_setstrokedashoffset -imagickdraw_setstrokelinecap -imagickdraw_setstrokelinejoin -imagickdraw_setstrokemiterlimit -imagickdraw_setstrokeopacity -imagickdraw_setstrokepatternurl -imagickdraw_setstrokewidth -imagickdraw_settextalignment -imagickdraw_settextantialias -imagickdraw_settextdecoration -imagickdraw_settextencoding -imagickdraw_settextundercolor -imagickdraw_setvectorgraphics -imagickdraw_setviewbox -imagickdraw_skewx -imagickdraw_skewy -imagickdraw_translate -imagick_edgeimage -imagick_embossimage -imagick_encipherimage -imagick_enhanceimage -imagick_equalizeimage -imagick_evaluateimage -imagick_extentimage -imagick_flattenimages -imagick_flipimage -imagick_floodfillpaintimage -imagick_flopimage -imagick_frameimage -imagick_fximage -imagick_gammaimage -imagick_gaussianblurimage -imagick_getcolorspace -imagick_getcompression -imagick_getcompressionquality -imagick_getcopyright -imagick_getfilename -imagick_getfont -imagick_getformat -imagick_getgravity -imagick_gethomeurl -imagick_getimage -imagick_getimagealphachannel -imagick_getimageartifact -imagick_getimagebackgroundcolor -imagick_getimageblob -imagick_getimageblueprimary -imagick_getimagebordercolor -imagick_getimagechanneldepth -imagick_getimagechanneldistortion -imagick_getimagechanneldistortions -imagick_getimagechannelextrema -imagick_getimagechannelmean -imagick_getimagechannelrange -imagick_getimagechannelstatistics -imagick_getimageclipmask -imagick_getimagecolormapcolor -imagick_getimagecolors -imagick_getimagecolorspace -imagick_getimagecompose -imagick_getimagecompression -imagick_getimagecompressionquality -imagick_getimagedelay -imagick_getimagedepth -imagick_getimagedispose -imagick_getimagedistortion -imagick_getimageextrema -imagick_getimagefilename -imagick_getimageformat -imagick_getimagegamma -imagick_getimagegeometry -imagick_getimagegravity -imagick_getimagegreenprimary -imagick_getimageheight -imagick_getimagehistogram -imagick_getimageindex -imagick_getimageinterlacescheme -imagick_getimageinterpolatemethod -imagick_getimageiterations -imagick_getimagelength -imagick_getimagemagicklicense -imagick_getimagematte -imagick_getimagemattecolor -imagick_getimageorientation -imagick_getimagepage -imagick_getimagepixelcolor -imagick_getimageprofile -imagick_getimageprofiles -imagick_getimageproperties -imagick_getimageproperty -imagick_getimageredprimary -imagick_getimageregion -imagick_getimagerenderingintent -imagick_getimageresolution -imagick_getimagesblob -imagick_getimagescene -imagick_getimagesignature -imagick_getimagesize -imagick_getimagetickspersecond -imagick_getimagetotalinkdensity -imagick_getimagetype -imagick_getimageunits -imagick_getimagevirtualpixelmethod -imagick_getimagewhitepoint -imagick_getimagewidth -imagick_getinterlacescheme -imagick_getiteratorindex -imagick_getnumberimages -imagick_getoption -imagick_getpackagename -imagick_getpage -imagick_getpixeliterator -imagick_getpixelregioniterator -imagick_getpointsize -imagick_getquantumdepth -imagick_getquantumrange -imagick_getreleasedate -imagick_getresource -imagick_getresourcelimit -imagick_getsamplingfactors -imagick_getsize -imagick_getsizeoffset -imagick_getversion -imagick_hasnextimage -imagick_haspreviousimage -imagick_identifyimage -imagick_implodeimage -imagick_labelimage -imagick_levelimage -imagick_linearstretchimage -imagick_liquidrescaleimage -imagick_magnifyimage -imagick_mapimage -imagick_mattefloodfillimage -imagick_medianfilterimage -imagick_mergeimagelayers -imagick_minifyimage -imagick_modulateimage -imagick_montageimage -imagick_morphimages -imagick_mosaicimages -imagick_motionblurimage -imagick_negateimage -imagick_newimage -imagick_newpseudoimage -imagick_nextimage -imagick_normalizeimage -imagick_oilpaintimage -imagick_opaquepaintimage -imagick_optimizeimagelayers -imagick_orderedposterizeimage -imagick_paintfloodfillimage -imagick_paintopaqueimage -imagick_painttransparentimage -imagick_pingimage -imagick_pingimageblob -imagick_pingimagefile -imagickpixel -imagickpixel_clear -imagickpixel_construct -imagickpixel_destroy -imagickpixel_getcolor -imagickpixel_getcolorasstring -imagickpixel_getcolorcount -imagickpixel_getcolorvalue -imagickpixel_gethsl -imagickpixel_issimilar -imagickpixeliterator -imagickpixeliterator_clear -imagickpixeliterator_construct -imagickpixeliterator_destroy -imagickpixeliterator_getcurrentiteratorrow -imagickpixeliterator_getiteratorrow -imagickpixeliterator_getnextiteratorrow -imagickpixeliterator_getpreviousiteratorrow -imagickpixeliterator_newpixeliterator -imagickpixeliterator_newpixelregioniterator -imagickpixeliterator_resetiterator -imagickpixeliterator_setiteratorfirstrow -imagickpixeliterator_setiteratorlastrow -imagickpixeliterator_setiteratorrow -imagickpixeliterator_synciterator -imagickpixel_setcolor -imagickpixel_setcolorvalue -imagickpixel_sethsl -imagick_polaroidimage -imagick_posterizeimage -imagick_previewimages -imagick_previousimage -imagick_profileimage -imagick_quantizeimage -imagick_quantizeimages -imagick_queryfontmetrics -imagick_queryfonts -imagick_queryformats -imagick_radialblurimage -imagick_raiseimage -imagick_randomthresholdimage -imagick_readimage -imagick_readimageblob -imagick_readimagefile -imagick_recolorimage -imagick_reducenoiseimage -imagick_removeimage -imagick_removeimageprofile -imagick_render -imagick_resampleimage -imagick_resetimagepage -imagick_resizeimage -imagick_rollimage -imagick_rotateimage -imagick_roundcorners -imagick_sampleimage -imagick_scaleimage -imagick_separateimagechannel -imagick_sepiatoneimage -imagick_setbackgroundcolor -imagick_setcolorspace -imagick_setcompression -imagick_setcompressionquality -imagick_setfilename -imagick_setfirstiterator -imagick_setfont -imagick_setformat -imagick_setgravity -imagick_setimage -imagick_setimagealphachannel -imagick_setimageartifact -imagick_setimagebackgroundcolor -imagick_setimagebias -imagick_setimageblueprimary -imagick_setimagebordercolor -imagick_setimagechanneldepth -imagick_setimageclipmask -imagick_setimagecolormapcolor -imagick_setimagecolorspace -imagick_setimagecompose -imagick_setimagecompression -imagick_setimagecompressionquality -imagick_setimagedelay -imagick_setimagedepth -imagick_setimagedispose -imagick_setimageextent -imagick_setimagefilename -imagick_setimageformat -imagick_setimagegamma -imagick_setimagegravity -imagick_setimagegreenprimary -imagick_setimageindex -imagick_setimageinterlacescheme -imagick_setimageinterpolatemethod -imagick_setimageiterations -imagick_setimagematte -imagick_setimagemattecolor -imagick_setimageopacity -imagick_setimageorientation -imagick_setimagepage -imagick_setimageprofile -imagick_setimageproperty -imagick_setimageredprimary -imagick_setimagerenderingintent -imagick_setimageresolution -imagick_setimagescene -imagick_setimagetickspersecond -imagick_setimagetype -imagick_setimageunits -imagick_setimagevirtualpixelmethod -imagick_setimagewhitepoint -imagick_setinterlacescheme -imagick_setiteratorindex -imagick_setlastiterator -imagick_setoption -imagick_setpage -imagick_setpointsize -imagick_setresolution -imagick_setresourcelimit -imagick_setsamplingfactors -imagick_setsize -imagick_setsizeoffset -imagick_settype -imagick_shadeimage -imagick_shadowimage -imagick_sharpenimage -imagick_shaveimage -imagick_shearimage -imagick_sigmoidalcontrastimage -imagick_sketchimage -imagick_solarizeimage -imagick_spliceimage -imagick_spreadimage -imagick_steganoimage -imagick_stereoimage -imagick_stripimage -imagick_swirlimage -imagick_textureimage -imagick_thresholdimage -imagick_thumbnailimage -imagick_tintimage -imagick_transformimage -imagick_transparentpaintimage -imagick_transposeimage -imagick_transverseimage -imagick_trimimage -imagick_uniqueimagecolors -imagick_unsharpmaskimage -imagick_valid -imagick_vignetteimage -imagick_waveimage -imagick_whitethresholdimage -imagick_writeimage -imagick_writeimagefile -imagick_writeimages -imagick_writeimagesfile -imap_8bit -imap_alerts -imap_append -imap_base64 -imap_binary -imap_body -imap_bodystruct -imap_check -imap_clearflag_full -imap_close -imap_create -imap_createmailbox -imap_delete -imap_deletemailbox -imap_errors -imap_expunge -imap_fetchbody -imap_fetchheader -imap_fetchmime -imap_fetch_overview -imap_fetchstructure -imap_fetchtext -imap_gc -imap_getacl -imap_getmailboxes -imap_get_quota -imap_get_quotaroot -imap_getsubscribed -imap_header -imap_headerinfo -imap_headers -imap_last_error -imap_list -imap_listmailbox -imap_listscan -imap_listsubscribed -imap_lsub -imap_mail -imap_mailboxmsginfo -imap_mail_compose -imap_mail_copy -imap_mail_move -imap_mime_header_decode -imap_msgno -imap_num_msg -imap_num_recent -imap_open -imap_ping -imap_qprint -imap_rename -imap_renamemailbox -imap_reopen -imap_rfc822_parse_adrlist -imap_rfc822_parse_headers -imap_rfc822_write_address -imap_savebody -imap_scan -imap_scanmailbox -imap_search -imap_setacl -imap_setflag_full -imap_set_quota -imap_sort -imap_status -imap_subscribe -imap_thread -imap_timeout -imap_uid -imap_undelete -imap_unsubscribe -imap_utf7_decode -imap_utf7_encode -imap_utf8 -implements -implementsinterface -implode -import_request_variables -in_array -include -include_once -inclued_get_data -inet_ntop -inet_pton -infiniteiterator -ingres_autocommit -ingres_autocommit_state -ingres_charset -ingres_close -ingres_commit -ingres_connect -ingres_cursor -ingres_errno -ingres_error -ingres_errsqlstate -ingres_escape_string -ingres_execute -ingres_fetch_array -ingres_fetch_assoc -ingres_fetch_object -ingres_fetch_proc_return -ingres_fetch_row -ingres_field_length -ingres_field_name -ingres_field_nullable -ingres_field_precision -ingres_field_scale -ingres_field_type -ingres_free_result -ingres_next_error -ingres_num_fields -ingres_num_rows -ingres_pconnect -ingres_prepare -ingres_query -ingres_result_seek -ingres_rollback -ingres_set_environment -ingres_unbuffered_query -ini_alter -ini_get -ini_get_all -ini_restore -ini_set -innamespace -inotify_add_watch -inotify_init -inotify_queue_len -inotify_read -inotify_rm_watch -instanceof -interface -interface_exists -intldateformatter -intl_error_name -intl_get_error_code -intl_get_error_message -intl_is_failure -intval -invalidargumentexception -invoke -__invoke() -invokeargs -ip2long -iptcembed -iptcparse -is_a -isabstract -is_array -is_bool -is_callable -iscloneable -is_dir -isdisabled -is_double -is_executable -is_file -isfinal -is_finite -is_float -is_infinite -isinstance -isinstantiable -is_int -is_integer -isinterface -isinternal -isiterateable -is_link -is_long -is_nan -is_null -is_numeric -is_object -is_readable -is_real -is_resource -is_scalar -isset -__isset() -is_soap_fault -is_string -issubclassof -is_subclass_of -istrait -is_uploaded_file -isuserdefined -is_writable -is_writeable -iterator -iteratoraggregate -iterator_apply -iterator_count -iteratoriterator -iterator_to_array -java_last_exception_clear -java_last_exception_get -jddayofweek -jdmonthname -jdtofrench -jdtogregorian -jdtojewish -jdtojulian -jdtounix -jewishtojd -join -jpeg2wbmp -json_decode -json_encode -json_last_error -jsonserializable -judy -judy_type -judy_version -juliantojd -kadm5_chpass_principal -kadm5_create_principal -kadm5_delete_principal -kadm5_destroy -kadm5_flush -kadm5_get_policies -kadm5_get_principal -kadm5_get_principals -kadm5_init_with_password -kadm5_modify_principal -key -krsort -ksort -ktaglib_id3v2_attachedpictureframe -ktaglib_id3v2_frame -ktaglib_id3v2_tag -ktaglib_mpeg_audioproperties -ktaglib_mpeg_file -ktaglib_tag -lcfirst -lcg_value -lchgrp -lchown -ldap_8859_to_t61 -ldap_add -ldap_bind -ldap_close -ldap_compare -ldap_connect -ldap_count_entries -ldap_delete -ldap_dn2ufn -ldap_err2str -ldap_errno -ldap_error -ldap_explode_dn -ldap_first_attribute -ldap_first_entry -ldap_first_reference -ldap_free_result -ldap_get_attributes -ldap_get_dn -ldap_get_entries -ldap_get_option -ldap_get_values -ldap_get_values_len -ldap_list -ldap_mod_add -ldap_mod_del -ldap_modify -ldap_mod_replace -ldap_next_attribute -ldap_next_entry -ldap_next_reference -ldap_parse_reference -ldap_parse_result -ldap_read -ldap_rename -ldap_sasl_bind -ldap_search -ldap_set_option -ldap_set_rebind_proc -ldap_sort -ldap_start_tls -ldap_t61_to_8859 -ldap_unbind -lengthexception -levenshtein -libxml_clear_errors -libxml_disable_entity_loader -libxmlerror -libxml_get_errors -libxml_get_last_error -libxml_set_streams_context -libxml_use_internal_errors -limititerator -__LINE__ -link -linkinfo -list -locale -localeconv -localtime -log -log10 -log1p -logicexception -long2ip -lstat -ltrim -lua -luaclosure -lzf_compress -lzf_decompress -lzf_optimized_for -magic_quotes_runtime -mail -mailparse_determine_best_xfer_encoding -mailparse_msg_create -mailparse_msg_extract_part -mailparse_msg_extract_part_file -mailparse_msg_extract_whole_part_file -mailparse_msg_free -mailparse_msg_get_part -mailparse_msg_get_part_data -mailparse_msg_get_structure -mailparse_msg_parse -mailparse_msg_parse_file -mailparse_rfc822_parse_addresses -mailparse_stream_encode -mailparse_uudecode_all -main -max -maxdb_affected_rows -maxdb_autocommit -maxdb_bind_param -maxdb_bind_result -maxdb_change_user -maxdb_character_set_name -maxdb_client_encoding -maxdb_close -maxdb_close_long_data -maxdb_commit -maxdb_connect -maxdb_connect_errno -maxdb_connect_error -maxdb_data_seek -maxdb_debug -maxdb_disable_reads_from_master -maxdb_disable_rpl_parse -maxdb_dump_debug_info -maxdb_embedded_connect -maxdb_enable_reads_from_master -maxdb_enable_rpl_parse -maxdb_errno -maxdb_error -maxdb_escape_string -maxdb_execute -maxdb_fetch -maxdb_fetch_array -maxdb_fetch_assoc -maxdb_fetch_field -maxdb_fetch_field_direct -maxdb_fetch_fields -maxdb_fetch_lengths -maxdb_fetch_object -maxdb_fetch_row -maxdb_field_count -maxdb_field_seek -maxdb_field_tell -maxdb_free_result -maxdb_get_client_info -maxdb_get_client_version -maxdb_get_host_info -maxdb_get_metadata -maxdb_get_proto_info -maxdb_get_server_info -maxdb_get_server_version -maxdb_info -maxdb_init -maxdb_insert_id -maxdb_kill -maxdb_master_query -maxdb_more_results -maxdb_multi_query -maxdb_next_result -maxdb_num_fields -maxdb_num_rows -maxdb_options -maxdb_param_count -maxdb_ping -maxdb_prepare -maxdb_query -maxdb_real_connect -maxdb_real_escape_string -maxdb_real_query -maxdb_report -maxdb_rollback -maxdb_rpl_parse_enabled -maxdb_rpl_probe -maxdb_rpl_query_type -maxdb_select_db -maxdb_send_long_data -maxdb_send_query -maxdb_server_end -maxdb_server_init -maxdb_set_opt -maxdb_sqlstate -maxdb_ssl_set -maxdb_stat -maxdb_stmt_affected_rows -maxdb_stmt_bind_param -maxdb_stmt_bind_result -maxdb_stmt_close -maxdb_stmt_close_long_data -maxdb_stmt_data_seek -maxdb_stmt_errno -maxdb_stmt_error -maxdb_stmt_execute -maxdb_stmt_fetch -maxdb_stmt_free_result -maxdb_stmt_init -maxdb_stmt_num_rows -maxdb_stmt_param_count -maxdb_stmt_prepare -maxdb_stmt_reset -maxdb_stmt_result_metadata -maxdb_stmt_send_long_data -maxdb_stmt_sqlstate -maxdb_stmt_store_result -maxdb_store_result -maxdb_thread_id -maxdb_thread_safe -maxdb_use_result -maxdb_warning_count -mb_check_encoding -mb_convert_case -mb_convert_encoding -mb_convert_kana -mb_convert_variables -mb_decode_mimeheader -mb_decode_numericentity -mb_detect_encoding -mb_detect_order -mb_encode_mimeheader -mb_encode_numericentity -mb_encoding_aliases -mb_ereg -mb_eregi -mb_eregi_replace -mb_ereg_match -mb_ereg_replace -mb_ereg_search -mb_ereg_search_getpos -mb_ereg_search_getregs -mb_ereg_search_init -mb_ereg_search_pos -mb_ereg_search_regs -mb_ereg_search_setpos -mb_get_info -mb_http_input -mb_http_output -mb_internal_encoding -mb_language -mb_list_encodings -mb_output_handler -mb_parse_str -mb_preferred_mime_name -mb_regex_encoding -mb_regex_set_options -mb_send_mail -mb_split -mb_strcut -mb_strimwidth -mb_stripos -mb_stristr -mb_strlen -mb_strpos -mb_strrchr -mb_strrichr -mb_strripos -mb_strrpos -mb_strstr -mb_strtolower -mb_strtoupper -mb_strwidth -mb_substitute_character -mb_substr -mb_substr_count -m_checkstatus -m_completeauthorizations -m_connect -m_connectionerror -mcrypt_cbc -mcrypt_cfb -mcrypt_create_iv -mcrypt_decrypt -mcrypt_ecb -mcrypt_enc_get_algorithms_name -mcrypt_enc_get_block_size -mcrypt_enc_get_iv_size -mcrypt_enc_get_key_size -mcrypt_enc_get_modes_name -mcrypt_enc_get_supported_key_sizes -mcrypt_enc_is_block_algorithm -mcrypt_enc_is_block_algorithm_mode -mcrypt_enc_is_block_mode -mcrypt_encrypt -mcrypt_enc_self_test -mcrypt_generic -mcrypt_generic_deinit -mcrypt_generic_end -mcrypt_generic_init -mcrypt_get_block_size -mcrypt_get_cipher_name -mcrypt_get_iv_size -mcrypt_get_key_size -mcrypt_list_algorithms -mcrypt_list_modes -mcrypt_module_close -mcrypt_module_get_algo_block_size -mcrypt_module_get_algo_key_size -mcrypt_module_get_supported_key_sizes -mcrypt_module_is_block_algorithm -mcrypt_module_is_block_algorithm_mode -mcrypt_module_is_block_mode -mcrypt_module_open -mcrypt_module_self_test -mcrypt_ofb -md5 -md5_file -mdecrypt_generic -m_deletetrans -m_destroyconn -m_destroyengine -memcache -memcached -memcache_debug -memory_get_peak_usage -memory_get_usage -messageformatter -metaphone -__METHOD__ -method_exists -m_getcell -m_getcellbynum -m_getcommadelimited -m_getheader -mhash -mhash_count -mhash_get_block_size -mhash_get_hash_name -mhash_keygen_s2k -microtime -mime_content_type -min -ming_keypress -ming_setcubicthreshold -ming_setscale -ming_setswfcompression -ming_useconstants -ming_useswfversion -m_initconn -m_initengine -m_iscommadelimited -mkdir -mktime -m_maxconntimeout -m_monitor -m_numcolumns -m_numrows -money_format -mongo -mongobindata -mongocode -mongocollection -mongoconnectionexception -mongocursor -mongocursorexception -mongocursortimeoutexception -mongodate -mongodb -mongodbref -mongoexception -mongogridfs -mongogridfscursor -mongogridfsexception -mongogridfsfile -mongoid -mongoint32 -mongoint64 -mongolog -mongomaxkey -mongominkey -mongopool -mongoregex -mongotimestamp -move_uploaded_file -m_parsecommadelimited -mqseries_back -mqseries_begin -mqseries_close -mqseries_cmit -mqseries_conn -mqseries_connx -mqseries_disc -mqseries_get -mqseries_inq -mqseries_open -mqseries_put -mqseries_put1 -mqseries_set -mqseries_strerror -m_responsekeys -m_responseparam -m_returnstatus -msession_connect -msession_count -msession_create -msession_destroy -msession_disconnect -msession_find -msession_get -msession_get_array -msession_get_data -msession_inc -msession_list -msession_listvar -msession_lock -msession_plugin -msession_randstr -msession_set -msession_set_array -msession_set_data -msession_timeout -msession_uniq -msession_unlock -m_setblocking -m_setdropfile -m_setip -m_setssl -m_setssl_cafile -m_setssl_files -m_settimeout -msg_get_queue -msg_queue_exists -msg_receive -msg_remove_queue -msg_send -msg_set_queue -msg_stat_queue -msql -msql_affected_rows -msql_close -msql_connect -msql_createdb -msql_create_db -msql_data_seek -msql_dbname -msql_db_query -msql_drop_db -msql_error -msql_fetch_array -msql_fetch_field -msql_fetch_object -msql_fetch_row -msql_fieldflags -msql_field_flags -msql_fieldlen -msql_field_len -msql_fieldname -msql_field_name -msql_field_seek -msql_fieldtable -msql_field_table -msql_fieldtype -msql_field_type -msql_free_result -msql_list_dbs -msql_list_fields -msql_list_tables -msql_numfields -msql_num_fields -msql_numrows -msql_num_rows -msql_pconnect -msql_query -msql_regcase -msql_result -msql_select_db -msql_tablename -m_sslcert_gen_hash -mssql_bind -mssql_close -mssql_connect -mssql_data_seek -mssql_execute -mssql_fetch_array -mssql_fetch_assoc -mssql_fetch_batch -mssql_fetch_field -mssql_fetch_object -mssql_fetch_row -mssql_field_length -mssql_field_name -mssql_field_seek -mssql_field_type -mssql_free_result -mssql_free_statement -mssql_get_last_message -mssql_guid_string -mssql_init -mssql_min_error_severity -mssql_min_message_severity -mssql_next_result -mssql_num_fields -mssql_num_rows -mssql_pconnect -mssql_query -mssql_result -mssql_rows_affected -mssql_select_db -mt_getrandmax -mt_rand -m_transactionssent -m_transinqueue -m_transkeyval -m_transnew -m_transsend -mt_srand -multipleiterator -m_uwait -m_validateidentifier -m_verifyconnection -m_verifysslcert -mysql_affected_rows -mysql_client_encoding -mysql_close -mysql_connect -mysql_create_db -mysql_data_seek -mysql_db_name -mysql_db_query -mysql_drop_db -mysql_errno -mysql_error -mysql_escape_string -mysql_fetch_array -mysql_fetch_assoc -mysql_fetch_field -mysql_fetch_lengths -mysql_fetch_object -mysql_fetch_row -mysql_field_flags -mysql_field_len -mysql_field_name -mysql_field_seek -mysql_field_table -mysql_field_type -mysql_free_result -mysql_get_client_info -mysql_get_host_info -mysql_get_proto_info -mysql_get_server_info -mysqli -mysqli_bind_param -mysqli_bind_result -mysqli_client_encoding -mysqli_connect -mysqli_disable_reads_from_master -mysqli_disable_rpl_parse -mysqli_driver -mysqli_enable_reads_from_master -mysqli_enable_rpl_parse -mysqli_escape_string -mysqli_execute -mysqli_fetch -mysqli_get_metadata -mysqli_master_query -mysql_info -mysql_insert_id -mysqli_param_count -mysqli_report -mysqli_result -mysqli_rpl_parse_enabled -mysqli_rpl_probe -mysqli_rpl_query_type -mysqli_send_long_data -mysqli_send_query -mysqli_set_opt -mysqli_slave_query -mysqli_stmt -mysqli_warning -mysql_list_dbs -mysql_list_fields -mysql_list_processes -mysql_list_tables -mysqlnd_ms_get_stats -mysqlnd_ms_query_is_select -mysqlnd_ms_set_user_pick_server -mysqlnd_qc_change_handler -mysqlnd_qc_clear_cache -mysqlnd_qc_get_cache_info -mysqlnd_qc_get_core_stats -mysqlnd_qc_get_handler -mysqlnd_qc_get_query_trace_log -mysqlnd_qc_set_user_handlers -mysql_num_fields -mysql_num_rows -mysql_pconnect -mysql_ping -mysql_query -mysql_real_escape_string -mysql_result -mysql_select_db -mysql_set_charset -mysql_stat -mysql_tablename -mysql_thread_id -mysql_unbuffered_query -namespace -__NAMESPACE__ -natcasesort -natsort -ncurses_addch -ncurses_addchnstr -ncurses_addchstr -ncurses_addnstr -ncurses_addstr -ncurses_assume_default_colors -ncurses_attroff -ncurses_attron -ncurses_attrset -ncurses_baudrate -ncurses_beep -ncurses_bkgd -ncurses_bkgdset -ncurses_border -ncurses_bottom_panel -ncurses_can_change_color -ncurses_cbreak -ncurses_clear -ncurses_clrtobot -ncurses_clrtoeol -ncurses_color_content -ncurses_color_set -ncurses_curs_set -ncurses_define_key -ncurses_def_prog_mode -ncurses_def_shell_mode -ncurses_delay_output -ncurses_delch -ncurses_deleteln -ncurses_del_panel -ncurses_delwin -ncurses_doupdate -ncurses_echo -ncurses_echochar -ncurses_end -ncurses_erase -ncurses_erasechar -ncurses_filter -ncurses_flash -ncurses_flushinp -ncurses_getch -ncurses_getmaxyx -ncurses_getmouse -ncurses_getyx -ncurses_halfdelay -ncurses_has_colors -ncurses_has_ic -ncurses_has_il -ncurses_has_key -ncurses_hide_panel -ncurses_hline -ncurses_inch -ncurses_init -ncurses_init_color -ncurses_init_pair -ncurses_insch -ncurses_insdelln -ncurses_insertln -ncurses_insstr -ncurses_instr -ncurses_isendwin -ncurses_keyok -ncurses_keypad -ncurses_killchar -ncurses_longname -ncurses_meta -ncurses_mouseinterval -ncurses_mousemask -ncurses_mouse_trafo -ncurses_move -ncurses_move_panel -ncurses_mvaddch -ncurses_mvaddchnstr -ncurses_mvaddchstr -ncurses_mvaddnstr -ncurses_mvaddstr -ncurses_mvcur -ncurses_mvdelch -ncurses_mvgetch -ncurses_mvhline -ncurses_mvinch -ncurses_mvvline -ncurses_mvwaddstr -ncurses_napms -ncurses_newpad -ncurses_new_panel -ncurses_newwin -ncurses_nl -ncurses_nocbreak -ncurses_noecho -ncurses_nonl -ncurses_noqiflush -ncurses_noraw -ncurses_pair_content -ncurses_panel_above -ncurses_panel_below -ncurses_panel_window -ncurses_pnoutrefresh -ncurses_prefresh -ncurses_putp -ncurses_qiflush -ncurses_raw -ncurses_refresh -ncurses_replace_panel -ncurses_reset_prog_mode -ncurses_reset_shell_mode -ncurses_resetty -ncurses_savetty -ncurses_scr_dump -ncurses_scr_init -ncurses_scrl -ncurses_scr_restore -ncurses_scr_set -ncurses_show_panel -ncurses_slk_attr -ncurses_slk_attroff -ncurses_slk_attron -ncurses_slk_attrset -ncurses_slk_clear -ncurses_slk_color -ncurses_slk_init -ncurses_slk_noutrefresh -ncurses_slk_refresh -ncurses_slk_restore -ncurses_slk_set -ncurses_slk_touch -ncurses_standend -ncurses_standout -ncurses_start_color -ncurses_termattrs -ncurses_termname -ncurses_timeout -ncurses_top_panel -ncurses_typeahead -ncurses_ungetch -ncurses_ungetmouse -ncurses_update_panels -ncurses_use_default_colors -ncurses_use_env -ncurses_use_extended_names -ncurses_vidattr -ncurses_vline -ncurses_waddch -ncurses_waddstr -ncurses_wattroff -ncurses_wattron -ncurses_wattrset -ncurses_wborder -ncurses_wclear -ncurses_wcolor_set -ncurses_werase -ncurses_wgetch -ncurses_whline -ncurses_wmouse_trafo -ncurses_wmove -ncurses_wnoutrefresh -ncurses_wrefresh -ncurses_wstandend -ncurses_wstandout -ncurses_wvline -new -newinstance -newinstanceargs -newinstancewithoutconstructor -newt_bell -newt_button -newt_button_bar -newt_centered_window -newt_checkbox -newt_checkbox_get_value -newt_checkbox_set_flags -newt_checkbox_set_value -newt_checkbox_tree -newt_checkbox_tree_add_item -newt_checkbox_tree_find_item -newt_checkbox_tree_get_current -newt_checkbox_tree_get_entry_value -newt_checkbox_tree_get_multi_selection -newt_checkbox_tree_get_selection -newt_checkbox_tree_multi -newt_checkbox_tree_set_current -newt_checkbox_tree_set_entry -newt_checkbox_tree_set_entry_value -newt_checkbox_tree_set_width -newt_clear_key_buffer -newt_cls -newt_compact_button -newt_component_add_callback -newt_component_takes_focus -newt_create_grid -newt_cursor_off -newt_cursor_on -newt_delay -newt_draw_form -newt_draw_root_text -newt_entry -newt_entry_get_value -newt_entry_set -newt_entry_set_filter -newt_entry_set_flags -newt_finished -newt_form -newt_form_add_component -newt_form_add_components -newt_form_add_hot_key -newt_form_destroy -newt_form_get_current -newt_form_run -newt_form_set_background -newt_form_set_height -newt_form_set_size -newt_form_set_timer -newt_form_set_width -newt_form_watch_fd -newt_get_screen_size -newt_grid_add_components_to_form -newt_grid_basic_window -newt_grid_free -newt_grid_get_size -newt_grid_h_close_stacked -newt_grid_h_stacked -newt_grid_place -newt_grid_set_field -newt_grid_simple_window -newt_grid_v_close_stacked -newt_grid_v_stacked -newt_grid_wrapped_window -newt_grid_wrapped_window_at -newt_init -newt_label -newt_label_set_text -newt_listbox -newt_listbox_append_entry -newt_listbox_clear -newt_listbox_clear_selection -newt_listbox_delete_entry -newt_listbox_get_current -newt_listbox_get_selection -newt_listbox_insert_entry -newt_listbox_item_count -newt_listbox_select_item -newt_listbox_set_current -newt_listbox_set_current_by_key -newt_listbox_set_data -newt_listbox_set_entry -newt_listbox_set_width -newt_listitem -newt_listitem_get_data -newt_listitem_set -newt_open_window -newt_pop_help_line -newt_pop_window -newt_push_help_line -newt_radiobutton -newt_radio_get_current -newt_redraw_help_line -newt_reflow_text -newt_refresh -newt_resize_screen -newt_resume -newt_run_form -newt_scale -newt_scale_set -newt_scrollbar_set -newt_set_help_callback -newt_set_suspend_callback -newt_suspend -newt_textbox -newt_textbox_get_num_lines -newt_textbox_reflowed -newt_textbox_set_height -newt_textbox_set_text -newt_vertical_scrollbar -newt_wait_for_key -newt_win_choice -newt_win_entries -newt_win_menu -newt_win_message -newt_win_messagev -newt_win_ternary -next -ngettext -nl2br -nl_langinfo -norewinditerator -normalizer -notes_body -notes_copy_db -notes_create_db -notes_create_note -notes_drop_db -notes_find_note -notes_header_info -notes_list_msgs -notes_mark_read -notes_mark_unread -notes_nav_create -notes_search -notes_unread -notes_version -nsapi_request_headers -nsapi_response_headers -nsapi_virtual -nthmac -number_format -numberformatter -oauth -oauthexception -oauth_get_sbs -oauthprovider -oauth_urlencode -ob_clean -ob_deflatehandler -ob_end_clean -ob_end_flush -ob_etaghandler -ob_flush -ob_get_clean -ob_get_contents -ob_get_flush -ob_get_length -ob_get_level -ob_get_status -ob_gzhandler -ob_iconv_handler -ob_implicit_flush -ob_inflatehandler -ob_list_handlers -ob_start -ob_tidyhandler -oci_bind_array_by_name -ocibindbyname -oci_bind_by_name -ocicancel -oci_cancel -oci_client_version -oci_close -ocicloselob -ocicollappend -ocicollassign -ocicollassignelem -oci_collection_append -oci_collection_assign -oci_collection_element_assign -oci_collection_element_get -oci_collection_free -oci_collection_max -oci_collection_size -oci_collection_trim -ocicollgetelem -ocicollmax -ocicollsize -ocicolltrim -ocicolumnisnull -ocicolumnname -ocicolumnprecision -ocicolumnscale -ocicolumnsize -ocicolumntype -ocicolumntyperaw -ocicommit -oci_commit -oci_connect -ocidefinebyname -oci_define_by_name -ocierror -oci_error -ociexecute -oci_execute -ocifetch -oci_fetch -oci_fetch_all -oci_fetch_array -oci_fetch_assoc -ocifetchinto -oci_fetch_object -oci_fetch_row -ocifetchstatement -oci_field_is_null -oci_field_name -oci_field_precision -oci_field_scale -oci_field_size -oci_field_type -oci_field_type_raw -ocifreecollection -ocifreecursor -ocifreedesc -ocifreestatement -oci_free_statement -ociinternaldebug -oci_internal_debug -ociloadlob -oci_lob_append -oci_lob_close -oci_lob_copy -oci_lob_eof -oci_lob_erase -oci_lob_export -oci_lob_flush -oci_lob_free -oci_lob_getbuffering -oci_lob_import -oci_lob_is_equal -oci_lob_load -oci_lob_read -oci_lob_rewind -oci_lob_save -oci_lob_savefile -oci_lob_seek -oci_lob_setbuffering -oci_lob_size -oci_lob_tell -oci_lob_truncate -oci_lob_write -oci_lob_writetemporary -oci_lob_writetofile -ocilogoff -ocilogon -ocinewcollection -oci_new_collection -oci_new_connect -ocinewcursor -oci_new_cursor -ocinewdescriptor -oci_new_descriptor -ocinlogon -ocinumcols -oci_num_fields -oci_num_rows -ociparse -oci_parse -oci_password_change -oci_pconnect -ociplogon -ociresult -oci_result -ocirollback -oci_rollback -ocirowcount -ocisavelob -ocisavelobfile -ociserverversion -oci_server_version -oci_set_action -oci_set_client_identifier -oci_set_client_info -oci_set_edition -oci_set_module_name -ocisetprefetch -oci_set_prefetch -ocistatementtype -oci_statement_type -ociwritelobtofile -ociwritetemporarylob -octdec -odbc_autocommit -odbc_binmode -odbc_close -odbc_close_all -odbc_columnprivileges -odbc_columns -odbc_commit -odbc_connect -odbc_cursor -odbc_data_source -odbc_do -odbc_error -odbc_errormsg -odbc_exec -odbc_execute -odbc_fetch_array -odbc_fetch_into -odbc_fetch_object -odbc_fetch_row -odbc_field_len -odbc_field_name -odbc_field_num -odbc_field_precision -odbc_field_scale -odbc_field_type -odbc_foreignkeys -odbc_free_result -odbc_gettypeinfo -odbc_longreadlen -odbc_next_result -odbc_num_fields -odbc_num_rows -odbc_pconnect -odbc_prepare -odbc_primarykeys -odbc_procedurecolumns -odbc_procedures -odbc_result -odbc_result_all -odbc_rollback -odbc_setoption -odbc_specialcolumns -odbc_statistics -odbc_tableprivileges -odbc_tables -old_function -openal_buffer_create -openal_buffer_data -openal_buffer_destroy -openal_buffer_get -openal_buffer_loadwav -openal_context_create -openal_context_current -openal_context_destroy -openal_context_process -openal_context_suspend -openal_device_close -openal_device_open -openal_listener_get -openal_listener_set -openal_source_create -openal_source_destroy -openal_source_get -openal_source_pause -openal_source_play -openal_source_rewind -openal_source_set -openal_source_stop -openal_stream -opendir -openlog -openssl_cipher_iv_length -openssl_csr_export -openssl_csr_export_to_file -openssl_csr_get_public_key -openssl_csr_get_subject -openssl_csr_new -openssl_csr_sign -openssl_decrypt -openssl_dh_compute_key -openssl_digest -openssl_encrypt -openssl_error_string -openssl_free_key -openssl_get_cipher_methods -openssl_get_md_methods -openssl_get_privatekey -openssl_get_publickey -openssl_open -openssl_pkcs12_export -openssl_pkcs12_export_to_file -openssl_pkcs12_read -openssl_pkcs7_decrypt -openssl_pkcs7_encrypt -openssl_pkcs7_sign -openssl_pkcs7_verify -openssl_pkey_export -openssl_pkey_export_to_file -openssl_pkey_free -openssl_pkey_get_details -openssl_pkey_get_private -openssl_pkey_get_public -openssl_pkey_new -openssl_private_decrypt -openssl_private_encrypt -openssl_public_decrypt -openssl_public_encrypt -openssl_random_pseudo_bytes -openssl_seal -openssl_sign -openssl_verify -openssl_x509_check_private_key -openssl_x509_checkpurpose -openssl_x509_export -openssl_x509_export_to_file -openssl_x509_free -openssl_x509_parse -openssl_x509_read -or -ord -outeriterator -outofboundsexception -outofrangeexception -output_add_rewrite_var -output_reset_rewrite_vars -overflowexception -overload -override_function -ovrimos_close -ovrimos_commit -ovrimos_connect -ovrimos_cursor -ovrimos_exec -ovrimos_execute -ovrimos_fetch_into -ovrimos_fetch_row -ovrimos_field_len -ovrimos_field_name -ovrimos_field_num -ovrimos_field_type -ovrimos_free_result -ovrimos_longreadlen -ovrimos_num_fields -ovrimos_num_rows -ovrimos_prepare -ovrimos_result -ovrimos_result_all -ovrimos_rollback -pack -parentiterator -parse_ini_file -parse_ini_string -parsekit_compile_file -parsekit_compile_string -parsekit_func_arginfo -parse_str -parse_url -passthru -pathinfo -pclose -pcntl_alarm -pcntl_exec -pcntl_fork -pcntl_getpriority -pcntl_setpriority -pcntl_signal -pcntl_signal_dispatch -pcntl_sigprocmask -pcntl_sigtimedwait -pcntl_sigwaitinfo -pcntl_wait -pcntl_waitpid -pcntl_wexitstatus -pcntl_wifexited -pcntl_wifsignaled -pcntl_wifstopped -pcntl_wstopsig -pcntl_wtermsig -pdf_activate_item -pdf_add_annotation -pdf_add_bookmark -pdf_add_launchlink -pdf_add_locallink -pdf_add_nameddest -pdf_add_note -pdf_add_outline -pdf_add_pdflink -pdf_add_table_cell -pdf_add_textflow -pdf_add_thumbnail -pdf_add_weblink -pdf_arc -pdf_arcn -pdf_attach_file -pdf_begin_document -pdf_begin_font -pdf_begin_glyph -pdf_begin_item -pdf_begin_layer -pdf_begin_page -pdf_begin_page_ext -pdf_begin_pattern -pdf_begin_template -pdf_begin_template_ext -pdf_circle -pdf_clip -pdf_close -pdf_close_image -pdf_closepath -pdf_closepath_fill_stroke -pdf_closepath_stroke -pdf_close_pdi -pdf_close_pdi_page -pdf_concat -pdf_continue_text -pdf_create_3dview -pdf_create_action -pdf_create_annotation -pdf_create_bookmark -pdf_create_field -pdf_create_fieldgroup -pdf_create_gstate -pdf_create_pvf -pdf_create_textflow -pdf_curveto -pdf_define_layer -pdf_delete -pdf_delete_pvf -pdf_delete_table -pdf_delete_textflow -pdf_encoding_set_char -pdf_end_document -pdf_end_font -pdf_end_glyph -pdf_end_item -pdf_end_layer -pdf_end_page -pdf_end_page_ext -pdf_endpath -pdf_end_pattern -pdf_end_template -pdf_fill -pdf_fill_imageblock -pdf_fill_pdfblock -pdf_fill_stroke -pdf_fill_textblock -pdf_findfont -pdf_fit_image -pdf_fit_pdi_page -pdf_fit_table -pdf_fit_textflow -pdf_fit_textline -pdf_get_apiname -pdf_get_buffer -pdf_get_errmsg -pdf_get_errnum -pdf_get_font -pdf_get_fontname -pdf_get_fontsize -pdf_get_image_height -pdf_get_image_width -pdf_get_majorversion -pdf_get_minorversion -pdf_get_parameter -pdf_get_pdi_parameter -pdf_get_pdi_value -pdf_get_value -pdf_info_font -pdf_info_matchbox -pdf_info_table -pdf_info_textflow -pdf_info_textline -pdf_initgraphics -pdf_lineto -pdf_load_3ddata -pdf_load_font -pdf_load_iccprofile -pdf_load_image -pdf_makespotcolor -pdf_moveto -pdf_new -pdf_open_ccitt -pdf_open_file -pdf_open_gif -pdf_open_image -pdf_open_image_file -pdf_open_jpeg -pdf_open_memory_image -pdf_open_pdi -pdf_open_pdi_document -pdf_open_pdi_page -pdf_open_tiff -pdf_pcos_get_number -pdf_pcos_get_stream -pdf_pcos_get_string -pdf_place_image -pdf_place_pdi_page -pdf_process_pdi -pdf_rect -pdf_restore -pdf_resume_page -pdf_rotate -pdf_save -pdf_scale -pdf_set_border_color -pdf_set_border_dash -pdf_set_border_style -pdf_set_char_spacing -pdf_setcolor -pdf_setdash -pdf_setdashpattern -pdf_set_duration -pdf_setflat -pdf_setfont -pdf_setgray -pdf_setgray_fill -pdf_setgray_stroke -pdf_set_gstate -pdf_set_horiz_scaling -pdf_set_info -pdf_set_info_author -pdf_set_info_creator -pdf_set_info_keywords -pdf_set_info_subject -pdf_set_info_title -pdf_set_layer_dependency -pdf_set_leading -pdf_setlinecap -pdf_setlinejoin -pdf_setlinewidth -pdf_setmatrix -pdf_setmiterlimit -pdf_set_parameter -pdf_setpolydash -pdf_setrgbcolor -pdf_setrgbcolor_fill -pdf_setrgbcolor_stroke -pdf_set_text_matrix -pdf_set_text_pos -pdf_set_text_rendering -pdf_set_text_rise -pdf_set_value -pdf_set_word_spacing -pdf_shading -pdf_shading_pattern -pdf_shfill -pdf_show -pdf_show_boxed -pdf_show_xy -pdf_skew -pdf_stringwidth -pdf_stroke -pdf_suspend_page -pdf_translate -pdf_utf16_to_utf8 -pdf_utf32_to_utf16 -pdf_utf8_to_utf16 -pdo -pdo_cubrid_schema -pdoexception -pdo_pgsqllobcreate -pdo_pgsqllobopen -pdo_pgsqllobunlink -pdo_sqlitecreateaggregate -pdo_sqlitecreatefunction -pdostatement -pfsockopen -pg_affected_rows -pg_cancel_query -pg_client_encoding -pg_close -pg_connect -pg_connection_busy -pg_connection_reset -pg_connection_status -pg_convert -pg_copy_from -pg_copy_to -pg_dbname -pg_delete -pg_end_copy -pg_escape_bytea -pg_escape_string -pg_execute -pg_fetch_all -pg_fetch_all_columns -pg_fetch_array -pg_fetch_assoc -pg_fetch_object -pg_fetch_result -pg_fetch_row -pg_field_is_null -pg_field_name -pg_field_num -pg_field_prtlen -pg_field_size -pg_field_table -pg_field_type -pg_field_type_oid -pg_free_result -pg_get_notify -pg_get_pid -pg_get_result -pg_host -pg_insert -pg_last_error -pg_last_notice -pg_last_oid -pg_lo_close -pg_lo_create -pg_lo_export -pg_lo_import -pg_lo_open -pg_lo_read -pg_lo_read_all -pg_lo_seek -pg_lo_tell -pg_lo_unlink -pg_lo_write -pg_meta_data -pg_num_fields -pg_num_rows -pg_options -pg_parameter_status -pg_pconnect -pg_ping -pg_port -pg_prepare -pg_put_line -pg_query -pg_query_params -pg_result_error -pg_result_error_field -pg_result_seek -pg_result_status -pg_select -pg_send_execute -pg_send_prepare -pg_send_query -pg_send_query_params -pg_set_client_encoding -pg_set_error_verbosity -pg_trace -pg_transaction_status -pg_tty -pg_unescape_bytea -pg_untrace -pg_update -pg_version -Phar -PharData -PharException -PharFileInfo -php_check_syntax -phpcredits -phpinfo -php_ini_loaded_file -php_ini_scanned_files -php_logo_guid -php_sapi_name -php_strip_whitespace -php_uname -phpversion -pi -png2wbmp -popen -pos -posix_access -posix_ctermid -posix_errno -posix_getcwd -posix_getegid -posix_geteuid -posix_getgid -posix_getgrgid -posix_getgrnam -posix_getgroups -posix_get_last_error -posix_getlogin -posix_getpgid -posix_getpgrp -posix_getpid -posix_getppid -posix_getpwnam -posix_getpwuid -posix_getrlimit -posix_getsid -posix_getuid -posix_initgroups -posix_isatty -posix_kill -posix_mkfifo -posix_mknod -posix_setegid -posix_seteuid -posix_setgid -posix_setpgid -posix_setsid -posix_setuid -posix_strerror -posix_times -posix_ttyname -posix_uname -pow -preg_filter -preg_grep -preg_last_error -preg_match -preg_match_all -preg_quote -preg_replace -preg_replace_callback -preg_split -prev -print -printer_abort -printer_close -printer_create_brush -printer_create_dc -printer_create_font -printer_create_pen -printer_delete_brush -printer_delete_dc -printer_delete_font -printer_delete_pen -printer_draw_bmp -printer_draw_chord -printer_draw_elipse -printer_draw_line -printer_draw_pie -printer_draw_rectangle -printer_draw_roundrect -printer_draw_text -printer_end_doc -printer_end_page -printer_get_option -printer_list -printer_logical_fontheight -printer_open -printer_select_brush -printer_select_font -printer_select_pen -printer_set_option -printer_start_doc -printer_start_page -printer_write -printf -print_r -private -proc_close -proc_get_status -proc_nice -proc_open -proc_terminate -property_exists -protected -ps_add_bookmark -ps_add_launchlink -ps_add_locallink -ps_add_note -ps_add_pdflink -ps_add_weblink -ps_arc -ps_arcn -ps_begin_page -ps_begin_pattern -ps_begin_template -ps_circle -ps_clip -ps_close -ps_close_image -ps_closepath -ps_closepath_stroke -ps_continue_text -ps_curveto -ps_delete -ps_end_page -ps_end_pattern -ps_end_template -ps_fill -ps_fill_stroke -ps_findfont -ps_get_buffer -ps_get_parameter -ps_get_value -ps_hyphenate -ps_include_file -ps_lineto -ps_makespotcolor -ps_moveto -ps_new -ps_open_file -ps_open_image -ps_open_image_file -ps_open_memory_image -pspell_add_to_personal -pspell_add_to_session -pspell_check -pspell_clear_session -pspell_config_create -pspell_config_data_dir -pspell_config_dict_dir -pspell_config_ignore -pspell_config_mode -pspell_config_personal -pspell_config_repl -pspell_config_runtogether -pspell_config_save_repl -pspell_new -pspell_new_config -pspell_new_personal -pspell_save_wordlist -pspell_store_replacement -pspell_suggest -ps_place_image -ps_rect -ps_restore -ps_rotate -ps_save -ps_scale -ps_set_border_color -ps_set_border_dash -ps_set_border_style -ps_setcolor -ps_setdash -ps_setflat -ps_setfont -ps_setgray -ps_set_info -ps_setlinecap -ps_setlinejoin -ps_setlinewidth -ps_setmiterlimit -ps_setoverprintmode -ps_set_parameter -ps_setpolydash -ps_set_text_pos -ps_set_value -ps_shading -ps_shading_pattern -ps_shfill -ps_show -ps_show2 -ps_show_boxed -ps_show_xy -ps_show_xy2 -ps_string_geometry -ps_stringwidth -ps_stroke -ps_symbol -ps_symbol_name -ps_symbol_width -ps_translate -public -putenv -px_close -px_create_fp -px_date2string -px_delete -px_delete_record -px_get_field -px_get_info -px_get_parameter -px_get_record -px_get_schema -px_get_value -px_insert_record -px_new -px_numfields -px_numrecords -px_open_fp -px_put_record -px_retrieve_record -px_set_blob_file -px_set_parameter -px_set_tablename -px_set_targetencoding -px_set_value -px_timestamp2string -px_update_record -qdom_error -qdom_tree -quickhashinthash -quickhashintset -quickhashintstringhash -quickhashstringinthash -quoted_printable_decode -quoted_printable_encode -quotemeta -rad2deg -radius_acct_open -radius_add_server -radius_auth_open -radius_close -radius_config -radius_create_request -radius_cvt_addr -radius_cvt_int -radius_cvt_string -radius_demangle -radius_demangle_mppe_key -radius_get_attr -radius_get_vendor_attr -radius_put_addr -radius_put_attr -radius_put_int -radius_put_string -radius_put_vendor_addr -radius_put_vendor_attr -radius_put_vendor_int -radius_put_vendor_string -radius_request_authenticator -radius_send_request -radius_server_secret -radius_strerror -rand -range -rangeexception -rararchive -rarentry -rarexception -rar_wrapper_cache_stats -rawurldecode -rawurlencode -readdir -read_exif_data -readfile -readgzfile -readline -readline_add_history -readline_callback_handler_install -readline_callback_handler_remove -readline_callback_read_char -readline_clear_history -readline_completion_function -readline_info -readline_list_history -readline_on_new_line -readline_read_history -readline_redisplay -readline_write_history -readlink -realpath -realpath_cache_get -realpath_cache_size -recode -recode_file -recode_string -recursivearrayiterator -recursivecachingiterator -recursivecallbackfilteriterator -recursivedirectoryiterator -recursivefilteriterator -recursiveiterator -recursiveiteratoriterator -recursiveregexiterator -recursivetreeiterator -reflection -reflectionclass -reflectionexception -reflectionextension -reflectionfunction -reflectionfunctionabstract -reflectionmethod -reflectionobject -reflectionparameter -reflectionproperty -reflector -regexiterator -register_shutdown_function -register_tick_function -rename -rename_function -require -require_once -reset -resetValue -resourcebundle -restore_error_handler -restore_exception_handler -restore_include_path -return -rewind -rewinddir -rmdir -round -rpm_close -rpm_get_tag -rpm_is_valid -rpm_open -rpm_version -rrd_create -rrdcreator -rrd_error -rrd_fetch -rrd_first -rrdgraph -rrd_graph -rrd_info -rrd_last -rrd_lastupdate -rrd_restore -rrd_tune -rrd_update -rrdupdater -rrd_version -rrd_xport -rsort -rtrim -runkit_class_adopt -runkit_class_emancipate -runkit_constant_add -runkit_constant_redefine -runkit_constant_remove -runkit_function_add -runkit_function_copy -runkit_function_redefine -runkit_function_remove -runkit_function_rename -runkit_import -runkit_lint -runkit_lint_file -runkit_method_add -runkit_method_copy -runkit_method_redefine -runkit_method_remove -runkit_method_rename -runkit_return_value_used -runkit_sandbox_output_handler -runkit_superglobals -runtimeexception -samconnection_commit -samconnection_connect -samconnection_constructor -samconnection_disconnect -samconnection_errno -samconnection_error -samconnection_isconnected -samconnection_peek -samconnection_peekall -samconnection_receive -samconnection_remove -samconnection_rollback -samconnection_send -samconnection_setDebug -samconnection_subscribe -samconnection_unsubscribe -sammessage_body -sammessage_constructor -sammessage_header -sca_createdataobject -sca_getservice -sca_localproxy_createdataobject -scandir -sca_soapproxy_createdataobject -sdo_das_changesummary_beginlogging -sdo_das_changesummary_endlogging -sdo_das_changesummary_getchangeddataobjects -sdo_das_changesummary_getchangetype -sdo_das_changesummary_getoldcontainer -sdo_das_changesummary_getoldvalues -sdo_das_changesummary_islogging -sdo_das_datafactory_addpropertytotype -sdo_das_datafactory_addtype -sdo_das_datafactory_getdatafactory -sdo_das_dataobject_getchangesummary -sdo_das_relational_applychanges -sdo_das_relational_construct -sdo_das_relational_createrootdataobject -sdo_das_relational_executepreparedquery -sdo_das_relational_executequery -sdo_das_setting_getlistindex -sdo_das_setting_getpropertyindex -sdo_das_setting_getpropertyname -sdo_das_setting_getvalue -sdo_das_setting_isset -sdo_das_xml_addtypes -sdo_das_xml_create -sdo_das_xml_createdataobject -sdo_das_xml_createdocument -sdo_das_xml_document_getrootdataobject -sdo_das_xml_document_getrootelementname -sdo_das_xml_document_getrootelementuri -sdo_das_xml_document_setencoding -sdo_das_xml_document_setxmldeclaration -sdo_das_xml_document_setxmlversion -sdo_das_xml_loadfile -sdo_das_xml_loadstring -sdo_das_xml_savefile -sdo_das_xml_savestring -sdo_datafactory_create -sdo_dataobject_clear -sdo_dataobject_createdataobject -sdo_dataobject_getcontainer -sdo_dataobject_getsequence -sdo_dataobject_gettypename -sdo_dataobject_gettypenamespaceuri -sdo_exception_getcause -sdo_list_insert -sdo_model_property_getcontainingtype -sdo_model_property_getdefault -sdo_model_property_getname -sdo_model_property_gettype -sdo_model_property_iscontainment -sdo_model_property_ismany -sdo_model_reflectiondataobject_construct -sdo_model_reflectiondataobject_export -sdo_model_reflectiondataobject_getcontainmentproperty -sdo_model_reflectiondataobject_getinstanceproperties -sdo_model_reflectiondataobject_gettype -sdo_model_type_getbasetype -sdo_model_type_getname -sdo_model_type_getnamespaceuri -sdo_model_type_getproperties -sdo_model_type_getproperty -sdo_model_type_isabstracttype -sdo_model_type_isdatatype -sdo_model_type_isinstance -sdo_model_type_isopentype -sdo_model_type_issequencedtype -sdo_sequence_getproperty -sdo_sequence_insert -sdo_sequence_move -seekableiterator -sem_acquire -sem_get -sem_release -sem_remove -serializable -serialize -session_cache_expire -session_cache_limiter -session_commit -session_decode -session_destroy -session_encode -session_get_cookie_params -session_id -session_is_registered -session_module_name -session_name -session_pgsql_add_error -session_pgsql_get_error -session_pgsql_get_field -session_pgsql_reset -session_pgsql_set_field -session_pgsql_status -session_regenerate_id -session_register -session_save_path -session_set_cookie_params -session_set_save_handler -session_start -session_unregister -session_unset -session_write_close -__set() -setcookie -setCounterClass -set_error_handler -set_exception_handler -set_file_buffer -set_include_path -setlocale -set_magic_quotes_runtime -setproctitle -setrawcookie -set_socket_blocking -__set_state() -setstaticpropertyvalue -setthreadtitle -set_time_limit -settype -sha1 -sha1_file -shell_exec -shm_attach -shm_detach -shm_get_var -shm_has_var -shmop_close -shmop_delete -shmop_open -shmop_read -shmop_size -shmop_write -shm_put_var -shm_remove -shm_remove_var -show_source -shuffle -signeurlpaiement -similar_text -simplexmlelement -simplexml_import_dom -simplexmliterator -simplexml_load_file -simplexml_load_string -sin -sinh -sizeof -sleep -__sleep() -snmp -snmp2_get -snmp2_getnext -snmp2_real_walk -snmp2_set -snmp2_walk -snmp3_get -snmp3_getnext -snmp3_real_walk -snmp3_set -snmp3_walk -snmpexception -snmpget -snmpgetnext -snmp_get_quick_print -snmp_get_valueretrieval -snmp_read_mib -snmprealwalk -snmpset -snmp_set_enum_print -snmp_set_oid_numeric_print -snmp_set_oid_output_format -snmp_set_quick_print -snmp_set_valueretrieval -snmpwalk -snmpwalkoid -soapclient -soapfault -soapheader -soapparam -soapserver -soapvar -socket_accept -socket_bind -socket_clear_error -socket_close -socket_connect -socket_create -socket_create_listen -socket_create_pair -socket_get_option -socket_getpeername -socket_getsockname -socket_get_status -socket_last_error -socket_listen -socket_read -socket_recv -socket_recvfrom -socket_select -socket_send -socket_sendto -socket_set_block -socket_set_blocking -socket_set_nonblock -socket_set_option -socket_set_timeout -socket_shutdown -socket_strerror -socket_write -solrclient -solrclientexception -solrdocument -solrdocumentfield -solrexception -solrgenericresponse -solr_get_version -solrillegalargumentexception -solrillegaloperationexception -solrinputdocument -solrmodifiableparams -solrobject -solrparams -solrpingresponse -solrquery -solrqueryresponse -solrresponse -solrupdateresponse -solrutils -sort -soundex -sphinxclient -spl_autoload -spl_autoload_call -spl_autoload_extensions -spl_autoload_functions -spl_autoload_register -spl_autoload_unregister -splbool -spl_classes -spldoublylinkedlist -splenum -splfileinfo -splfileobject -splfixedarray -splfloat -splheap -splint -split -spliti -splmaxheap -splminheap -spl_object_hash -splobjectstorage -splobserver -splpriorityqueue -splqueue -splstack -splstring -splsubject -spltempfileobject -spltype -spoofchecker -sprintf -sqlite3 -sqlite3result -sqlite3stmt -sqlite_array_query -sqlite_busy_timeout -sqlite_changes -sqlite_close -sqlite_column -sqlite_create_aggregate -sqlite_create_function -sqlite_current -sqlite_error_string -sqlite_escape_string -sqlite_exec -sqlite_factory -sqlite_fetch_all -sqlite_fetch_array -sqlite_fetch_column_types -sqlite_fetch_object -sqlite_fetch_single -sqlite_fetch_string -sqlite_field_name -sqlite_has_more -sqlite_has_prev -sqlite_key -sqlite_last_error -sqlite_last_insert_rowid -sqlite_libencoding -sqlite_libversion -sqlite_next -sqlite_num_fields -sqlite_num_rows -sqlite_open -sqlite_popen -sqlite_prev -sqlite_query -sqlite_rewind -sqlite_seek -sqlite_single_query -sqlite_udf_decode_binary -sqlite_udf_encode_binary -sqlite_unbuffered_query -sqlite_valid -sql_regcase -sqlsrv_begin_transaction -sqlsrv_cancel -sqlsrv_client_info -sqlsrv_close -sqlsrv_commit -sqlsrv_configure -sqlsrv_connect -sqlsrv_errors -sqlsrv_execute -sqlsrv_fetch -sqlsrv_fetch_array -sqlsrv_fetch_object -sqlsrv_field_metadata -sqlsrv_free_stmt -sqlsrv_get_config -sqlsrv_get_field -sqlsrv_has_rows -sqlsrv_next_result -sqlsrv_num_fields -sqlsrv_num_rows -sqlsrv_prepare -sqlsrv_query -sqlsrv_rollback -sqlsrv_rows_affected -sqlsrv_send_stream_data -sqlsrv_server_info -sqrt -srand -sscanf -ssdeep_fuzzy_compare -ssdeep_fuzzy_hash -ssdeep_fuzzy_hash_filename -ssh2_auth_hostbased_file -ssh2_auth_none -ssh2_auth_password -ssh2_auth_pubkey_file -ssh2_connect -ssh2_exec -ssh2_fetch_stream -ssh2_fingerprint -ssh2_methods_negotiated -ssh2_publickey_add -ssh2_publickey_init -ssh2_publickey_list -ssh2_publickey_remove -ssh2_scp_recv -ssh2_scp_send -ssh2_sftp -ssh2_sftp_lstat -ssh2_sftp_mkdir -ssh2_sftp_readlink -ssh2_sftp_realpath -ssh2_sftp_rename -ssh2_sftp_rmdir -ssh2_sftp_stat -ssh2_sftp_symlink -ssh2_sftp_unlink -ssh2_shell -ssh2_tunnel -stat -static -stats_absolute_deviation -stats_cdf_beta -stats_cdf_binomial -stats_cdf_cauchy -stats_cdf_chisquare -stats_cdf_exponential -stats_cdf_f -stats_cdf_gamma -stats_cdf_laplace -stats_cdf_logistic -stats_cdf_negative_binomial -stats_cdf_noncentral_chisquare -stats_cdf_noncentral_f -stats_cdf_poisson -stats_cdf_t -stats_cdf_uniform -stats_cdf_weibull -stats_covariance -stats_dens_beta -stats_dens_cauchy -stats_dens_chisquare -stats_dens_exponential -stats_dens_f -stats_dens_gamma -stats_dens_laplace -stats_dens_logistic -stats_dens_negative_binomial -stats_dens_normal -stats_dens_pmf_binomial -stats_dens_pmf_hypergeometric -stats_dens_pmf_poisson -stats_dens_t -stats_dens_weibull -stats_den_uniform -stats_harmonic_mean -stats_kurtosis -stats_rand_gen_beta -stats_rand_gen_chisquare -stats_rand_gen_exponential -stats_rand_gen_f -stats_rand_gen_funiform -stats_rand_gen_gamma -stats_rand_gen_ibinomial -stats_rand_gen_ibinomial_negative -stats_rand_gen_int -stats_rand_gen_ipoisson -stats_rand_gen_iuniform -stats_rand_gen_noncenral_chisquare -stats_rand_gen_noncentral_f -stats_rand_gen_noncentral_t -stats_rand_gen_normal -stats_rand_gen_t -stats_rand_get_seeds -stats_rand_phrase_to_seeds -stats_rand_ranf -stats_rand_setall -stats_skew -stats_standard_deviation -stats_stat_binomial_coef -stats_stat_correlation -stats_stat_gennch -stats_stat_independent_t -stats_stat_innerproduct -stats_stat_noncentral_t -stats_stat_paired_t -stats_stat_percentile -stats_stat_powersum -stats_variance -stomp -stomp_connect_error -stompexception -stompframe -stomp_version -strcasecmp -strchr -strcmp -strcoll -strcspn -stream_bucket_append -stream_bucket_make_writeable -stream_bucket_new -stream_bucket_prepend -stream_context_create -stream_context_get_default -stream_context_get_options -stream_context_get_params -stream_context_set_default -stream_context_set_option -stream_context_set_params -stream_copy_to_stream -stream_encoding -stream_filter_append -stream_filter_prepend -stream_filter_register -stream_filter_remove -stream_get_contents -stream_get_filters -stream_get_line -stream_get_meta_data -stream_get_transports -stream_get_wrappers -stream_is_local -stream_notification_callback -stream_register_wrapper -stream_resolve_include_path -stream_select -stream_set_blocking -stream_set_read_buffer -stream_set_timeout -stream_set_write_buffer -stream_socket_accept -stream_socket_client -stream_socket_enable_crypto -stream_socket_get_name -stream_socket_pair -stream_socket_recvfrom -stream_socket_sendto -stream_socket_server -stream_socket_shutdown -stream_supports_lock -streamwrapper -stream_wrapper_register -stream_wrapper_restore -stream_wrapper_unregister -strftime -str_getcsv -stripcslashes -stripos -stripslashes -strip_tags -str_ireplace -stristr -strlen -strnatcasecmp -strnatcmp -strncasecmp -strncmp -str_pad -strpbrk -strpos -strptime -strrchr -str_repeat -str_replace -strrev -strripos -str_rot13 -strrpos -str_shuffle -str_split -strspn -strstr -strtok -strtolower -strtotime -strtoupper -strtr -strval -str_word_count -substr -substr_compare -substr_count -substr_replace -svm -svmmodel -svn_add -svn_auth_get_parameter -svn_auth_set_parameter -svn_blame -svn_cat -svn_checkout -svn_cleanup -svn_client_version -svn_commit -svn_delete -svn_diff -svn_export -svn_fs_abort_txn -svn_fs_apply_text -svn_fs_begin_txn2 -svn_fs_change_node_prop -svn_fs_check_path -svn_fs_contents_changed -svn_fs_copy -svn_fs_delete -svn_fs_dir_entries -svn_fs_file_contents -svn_fs_file_length -svn_fs_is_dir -svn_fs_is_file -svn_fs_make_dir -svn_fs_make_file -svn_fs_node_created_rev -svn_fs_node_prop -svn_fs_props_changed -svn_fs_revision_prop -svn_fs_revision_root -svn_fs_txn_root -svn_fs_youngest_rev -svn_import -svn_log -svn_ls -svn_mkdir -svn_repos_create -svn_repos_fs -svn_repos_fs_begin_txn_for_commit -svn_repos_fs_commit_txn -svn_repos_hotcopy -svn_repos_open -svn_repos_recover -svn_revert -svn_status -svn_update -swfaction -swfaction.construct -swf_actiongeturl -swf_actiongotoframe -swf_actiongotolabel -swf_actionnextframe -swf_actionplay -swf_actionprevframe -swf_actionsettarget -swf_actionstop -swf_actiontogglequality -swf_actionwaitforframe -swf_addbuttonrecord -swf_addcolor -swfbitmap -swfbitmap.construct -swfbitmap.getheight -swfbitmap.getwidth -swfbutton -swfbutton.addaction -swfbutton.addasound -swfbutton.addshape -swfbutton.construct -swfbutton.setaction -swfbutton.setdown -swfbutton.sethit -swfbutton.setmenu -swfbutton.setover -swfbutton.setup -swf_closefile -swf_definebitmap -swf_definefont -swf_defineline -swf_definepoly -swf_definerect -swf_definetext -swfdisplayitem -swfdisplayitem.addaction -swfdisplayitem.addcolor -swfdisplayitem.endmask -swfdisplayitem.getrot -swfdisplayitem.getx -swfdisplayitem.getxscale -swfdisplayitem.getxskew -swfdisplayitem.gety -swfdisplayitem.getyscale -swfdisplayitem.getyskew -swfdisplayitem.move -swfdisplayitem.moveto -swfdisplayitem.multcolor -swfdisplayitem.remove -swfdisplayitem.rotate -swfdisplayitem.rotateto -swfdisplayitem.scale -swfdisplayitem.scaleto -swfdisplayitem.setdepth -swfdisplayitem.setmasklevel -swfdisplayitem.setmatrix -swfdisplayitem.setname -swfdisplayitem.setratio -swfdisplayitem.skewx -swfdisplayitem.skewxto -swfdisplayitem.skewy -swfdisplayitem.skewyto -swf_endbutton -swf_enddoaction -swf_endshape -swf_endsymbol -swffill -swffill.moveto -swffill.rotateto -swffill.scaleto -swffill.skewxto -swffill.skewyto -swffont -swffontchar -swffontchar.addchars -swffontchar.addutf8chars -swffont.construct -swffont.getascent -swffont.getdescent -swffont.getleading -swffont.getshape -swffont.getutf8width -swffont.getwidth -swf_fontsize -swf_fontslant -swf_fonttracking -swf_getbitmapinfo -swf_getfontinfo -swf_getframe -swfgradient -swfgradient.addentry -swfgradient.construct -swf_labelframe -swf_lookat -swf_modifyobject -swfmorph -swfmorph.construct -swfmorph.getshape1 -swfmorph.getshape2 -swfmovie -swfmovie.add -swfmovie.addexport -swfmovie.addfont -swfmovie.construct -swfmovie.importchar -swfmovie.importfont -swfmovie.labelframe -swfmovie.nextframe -swfmovie.output -swfmovie.remove -swfmovie.save -swfmovie.savetofile -swfmovie.setbackground -swfmovie.setdimension -swfmovie.setframes -swfmovie.setrate -swfmovie.startsound -swfmovie.stopsound -swfmovie.streammp3 -swfmovie.writeexports -swf_mulcolor -swf_nextid -swf_oncondition -swf_openfile -swf_ortho -swf_ortho2 -swf_perspective -swf_placeobject -swf_polarview -swf_popmatrix -swf_posround -swfprebuiltclip -swfprebuiltclip.construct -swf_pushmatrix -swf_removeobject -swf_rotate -swf_scale -swf_setfont -swf_setframe -swfshape -swfshape.addfill -swf_shapearc -swfshape.construct -swf_shapecurveto -swf_shapecurveto3 -swfshape.drawarc -swfshape.drawcircle -swfshape.drawcubic -swfshape.drawcubicto -swfshape.drawcurve -swfshape.drawcurveto -swfshape.drawglyph -swfshape.drawline -swfshape.drawlineto -swf_shapefillbitmapclip -swf_shapefillbitmaptile -swf_shapefilloff -swf_shapefillsolid -swf_shapelinesolid -swf_shapelineto -swfshape.movepen -swfshape.movepento -swf_shapemoveto -swfshape.setleftfill -swfshape.setline -swfshape.setrightfill -swf_showframe -swfsound -swfsound.construct -swfsoundinstance -swfsoundinstance.loopcount -swfsoundinstance.loopinpoint -swfsoundinstance.loopoutpoint -swfsoundinstance.nomultiple -swfsprite -swfsprite.add -swfsprite.construct -swfsprite.labelframe -swfsprite.nextframe -swfsprite.remove -swfsprite.setframes -swfsprite.startsound -swfsprite.stopsound -swf_startbutton -swf_startdoaction -swf_startshape -swf_startsymbol -swftext -swftext.addstring -swftext.addutf8string -swftext.construct -swftextfield -swftextfield.addchars -swftextfield.addstring -swftextfield.align -swftextfield.construct -swftextfield.setbounds -swftextfield.setcolor -swftextfield.setfont -swftextfield.setheight -swftextfield.setindentation -swftextfield.setleftmargin -swftextfield.setlinespacing -swftextfield.setmargins -swftextfield.setname -swftextfield.setpadding -swftextfield.setrightmargin -swftext.getascent -swftext.getdescent -swftext.getleading -swftext.getutf8width -swftext.getwidth -swftext.moveto -swftext.setcolor -swftext.setfont -swftext.setheight -swftext.setspacing -swf_textwidth -swf_translate -swfvideostream -swfvideostream.construct -swfvideostream.getnumframes -swfvideostream.setdimension -swf_viewport -swish_construct -swish_getmetalist -swish_getpropertylist -swish_prepare -swish_query -swishresult_getmetalist -swishresults_getparsedwords -swishresults_getremovedstopwords -swishresults_nextresult -swishresults_seekresult -swishresult_stem -swishsearch_execute -swishsearch_resetlimit -swishsearch_setlimit -swishsearch_setphrasedelimiter -swishsearch_setsort -swishsearch_setstructure -switch -sybase_affected_rows -sybase_close -sybase_connect -sybase_data_seek -sybase_deadlock_retry_count -sybase_fetch_array -sybase_fetch_assoc -sybase_fetch_field -sybase_fetch_object -sybase_fetch_row -sybase_field_seek -sybase_free_result -sybase_get_last_message -sybase_min_client_severity -sybase_min_error_severity -sybase_min_message_severity -sybase_min_server_severity -sybase_num_fields -sybase_num_rows -sybase_pconnect -sybase_query -sybase_result -sybase_select_db -sybase_set_message_handler -sybase_unbuffered_query -symlink -sys_getloadavg -sys_get_temp_dir -syslog -system -tan -tanh -tcpwrap_check -tempnam -textdomain -throw -tidy -tidy_access_count -tidy_config_count -tidy_diagnose -tidy_error_count -tidy_get_error_buffer -tidy_get_output -tidy_load_config -tidynode -tidy_reset_config -tidy_save_config -tidy_set_encoding -tidy_setopt -tidy_warning_count -time -time_nanosleep -time_sleep_until -timezone_abbreviations_list -timezone_identifiers_list -timezone_location_get -timezone_name_from_abbr -timezone_name_get -timezone_offset_get -timezone_open -timezone_transitions_get -timezone_version_get -tmpfile -token_get_all -token_name -tokyotyrant -tokyotyrantquery -tokyotyranttable -tostring -__toString() -touch -transliterator -traversable -trigger_error -trim -try -uasort -ucfirst -ucwords -udm_add_search_limit -udm_alloc_agent -udm_alloc_agent_array -udm_api_version -udm_cat_list -udm_cat_path -udm_check_charset -udm_check_stored -udm_clear_search_limits -udm_close_stored -udm_crc32 -udm_errno -udm_error -udm_find -udm_free_agent -udm_free_ispell_data -udm_free_res -udm_get_doc_count -udm_get_res_field -udm_get_res_param -udm_hash32 -udm_load_ispell_data -udm_open_stored -udm_set_agent_param -uksort -umask -underflowexception -unexpectedvalueexception -uniqid -unixtojd -unlink -unpack -unregister_tick_function -unserialize -unset -__unset() -urldecode -urlencode -use -user_error -use_soap_error_handler -usleep -usort -utf8_decode -utf8_encode -v8js -v8jsexception -var -var_dump -var_export -variant -variant_abs -variant_add -variant_and -variant_cast -variant_cat -variant_cmp -variant_date_from_timestamp -variant_date_to_timestamp -variant_div -variant_eqv -variant_fix -variant_get_type -variant_idiv -variant_imp -variant_int -variant_mod -variant_mul -variant_neg -variant_not -variant_or -variant_pow -variant_round -variant_set -variant_set_type -variant_sub -variant_xor -version_compare -vfprintf -virtual -vpopmail_add_alias_domain -vpopmail_add_alias_domain_ex -vpopmail_add_domain -vpopmail_add_domain_ex -vpopmail_add_user -vpopmail_alias_add -vpopmail_alias_del -vpopmail_alias_del_domain -vpopmail_alias_get -vpopmail_alias_get_all -vpopmail_auth_user -vpopmail_del_domain -vpopmail_del_domain_ex -vpopmail_del_user -vpopmail_error -vpopmail_passwd -vpopmail_set_user_quota -vprintf -vsprintf -w32api_deftype -w32api_init_dtype -w32api_invoke_function -w32api_register_function -w32api_set_call_method -__wakeup() -wddx_add_vars -wddx_deserialize -wddx_packet_end -wddx_packet_start -wddx_serialize_value -wddx_serialize_vars -weakref -while -win32_continue_service -win32_create_service -win32_delete_service -win32_get_last_control_message -win32_pause_service -win32_ps_list_procs -win32_ps_stat_mem -win32_ps_stat_proc -win32_query_service_status -win32_set_service_status -win32_start_service -win32_start_service_ctrl_dispatcher -win32_stop_service -wincache_fcache_fileinfo -wincache_fcache_meminfo -wincache_lock -wincache_ocache_fileinfo -wincache_ocache_meminfo -wincache_refresh_if_changed -wincache_rplist_fileinfo -wincache_rplist_meminfo -wincache_scache_info -wincache_scache_meminfo -wincache_ucache_add -wincache_ucache_cas -wincache_ucache_clear -wincache_ucache_dec -wincache_ucache_delete -wincache_ucache_exists -wincache_ucache_get -wincache_ucache_inc -wincache_ucache_info -wincache_ucache_meminfo -wincache_ucache_set -wincache_unlock -wordwrap -xattr_get -xattr_list -xattr_remove -xattr_set -xattr_supported -xdiff_file_bdiff -xdiff_file_bdiff_size -xdiff_file_bpatch -xdiff_file_diff -xdiff_file_diff_binary -xdiff_file_merge3 -xdiff_file_patch -xdiff_file_patch_binary -xdiff_file_rabdiff -xdiff_string_bdiff -xdiff_string_bdiff_size -xdiff_string_bpatch -xdiff_string_diff -xdiff_string_diff_binary -xdiff_string_merge3 -xdiff_string_patch -xdiff_string_patch_binary -xdiff_string_rabdiff -xhprof_disable -xhprof_enable -xhprof_sample_disable -xhprof_sample_enable -xml_error_string -xml_get_current_byte_index -xml_get_current_column_number -xml_get_current_line_number -xml_get_error_code -xml_parse -xml_parse_into_struct -xml_parser_create -xml_parser_create_ns -xml_parser_free -xml_parser_get_option -xml_parser_set_option -xmlreader -xmlrpc_decode -xmlrpc_decode_request -xmlrpc_encode -xmlrpc_encode_request -xmlrpc_get_type -xmlrpc_is_fault -xmlrpc_parse_method_descriptions -xmlrpc_server_add_introspection_data -xmlrpc_server_call_method -xmlrpc_server_create -xmlrpc_server_destroy -xmlrpc_server_register_introspection_callback -xmlrpc_server_register_method -xmlrpc_set_type -xml_set_character_data_handler -xml_set_default_handler -xml_set_element_handler -xml_set_end_namespace_decl_handler -xml_set_external_entity_ref_handler -xml_set_notation_decl_handler -xml_set_object -xml_set_processing_instruction_handler -xml_set_start_namespace_decl_handler -xml_set_unparsed_entity_decl_handler -xmlwriter_end_attribute -xmlwriter_end_cdata -xmlwriter_end_comment -xmlwriter_end_document -xmlwriter_end_dtd -xmlwriter_end_dtd_attlist -xmlwriter_end_dtd_element -xmlwriter_end_dtd_entity -xmlwriter_end_element -xmlwriter_end_pi -xmlwriter_flush -xmlwriter_full_end_element -xmlwriter_open_memory -xmlwriter_open_uri -xmlwriter_output_memory -xmlwriter_set_indent -xmlwriter_set_indent_string -xmlwriter_start_attribute -xmlwriter_start_attribute_ns -xmlwriter_start_cdata -xmlwriter_start_comment -xmlwriter_start_document -xmlwriter_start_dtd -xmlwriter_start_dtd_attlist -xmlwriter_start_dtd_element -xmlwriter_start_dtd_entity -xmlwriter_start_element -xmlwriter_start_element_ns -xmlwriter_start_pi -xmlwriter_text -xmlwriter_write_attribute -xmlwriter_write_attribute_ns -xmlwriter_write_cdata -xmlwriter_write_comment -xmlwriter_write_dtd -xmlwriter_write_dtd_attlist -xmlwriter_write_dtd_element -xmlwriter_write_dtd_entity -xmlwriter_write_element -xmlwriter_write_element_ns -xmlwriter_write_pi -xmlwriter_write_raw -xor -xpath_eval -xpath_eval_expression -xpath_new_context -xpath_register_ns -xpath_register_ns_auto -xptr_eval -xptr_new_context -xslt_backend_info -xslt_backend_name -xslt_backend_version -xslt_create -xslt_errno -xslt_error -xslt_free -xslt_getopt -xslt_process -xsltprocessor -xslt_set_base -xslt_set_encoding -xslt_set_error_handler -xslt_set_log -xslt_set_object -xslt_setopt -xslt_set_sax_handler -xslt_set_sax_handlers -xslt_set_scheme_handler -xslt_set_scheme_handlers -yaml_emit -yaml_emit_file -yaml_parse -yaml_parse_file -yaml_parse_url -yaz_addinfo -yaz_ccl_conf -yaz_ccl_parse -yaz_close -yaz_connect -yaz_database -yaz_element -yaz_errno -yaz_error -yaz_es -yaz_es_result -yaz_get_option -yaz_hits -yaz_itemorder -yaz_present -yaz_range -yaz_record -yaz_scan -yaz_scan_result -yaz_schema -yaz_search -yaz_set_option -yaz_sort -yaz_syntax -yaz_wait -yp_all -yp_cat -yp_errno -yp_err_string -yp_first -yp_get_default_domain -yp_master -yp_match -yp_next -yp_order -zend_logo_guid -zend_thread_id -zend_version -ziparchive -ziparchive_addemptydir -ziparchive_addfile -ziparchive_addfromstring -ziparchive_close -ziparchive_deleteindex -ziparchive_deletename -ziparchive_extractto -ziparchive_getarchivecomment -ziparchive_getcommentindex -ziparchive_getcommentname -ziparchive_getfromindex -ziparchive_getfromname -ziparchive_getnameindex -ziparchive_getstatusstring -ziparchive_getstream -ziparchive_locatename -ziparchive_open -ziparchive_renameindex -ziparchive_renamename -ziparchive_setarchivecomment -ziparchive_setcommentindex -ziparchive_setCommentName -ziparchive_statindex -ziparchive_statname -ziparchive_unchangeall -ziparchive_unchangearchive -ziparchive_unchangeindex -ziparchive_unchangename -zip_close -zip_entry_close -zip_entry_compressedsize -zip_entry_compressionmethod -zip_entry_filesize -zip_entry_name -zip_entry_open -zip_entry_read -zip_open -zip_read -zlib_get_coding_type -amqpchannel -amqpenvelope -autoload -bumpvalue -class_uses -closure -cubrid_get_query_timeout -cubrid_pconnect -cubrid_pconnect_with_url -cubrid_set_query_timeout -directory -domcdatasection -eio_busy -eio_cancel -eio_chmod -eio_chown -eio_close -eio_custom -eio_dup2 -eio_event_loop -eio_fallocate -eio_fchmod -eio_fchown -eio_fdatasync -eio_fstat -eio_fstatvfs -eio_fsync -eio_ftruncate -eio_futime -eio_get_event_stream -eio_grp -eio_grp_add -eio_grp_cancel -eio_grp_limit -eio_link -eio_lstat -eio_mkdir -eio_mknod -eio_nop -eio_npending -eio_nready -eio_nreqs -eio_nthreads -eio_open -eio_poll -eio_read -eio_readahead -eio_readdir -eio_readlink -eio_realpath -eio_rename -eio_rmdir -eio_sendfile -eio_set_max_idle -eio_set_max_parallel -eio_set_max_poll_reqs -eio_set_max_poll_time -eio_set_min_parallel -eio_stat -eio_statvfs -eio_symlink -eio_sync -eio_sync_file_range -eio_syncfs -eio_truncate -eio_unlink -eio_utime -eio_write -get_declared_traits -getimagesizefromstring -getmeta -getnamed -getvalue -hwapi_attribute_new -hwapi_content_new -is_tainted -lapack -lapackexception -ldap_control_paged_result -ldap_control_paged_result_response -libxml_set_external_entity_loader -mysqli_get_cache_stats -mysqli_sql_exception -mysqlnd_ms_get_last_gtid -mysqlnd_ms_get_last_used_connection -mysqlnd_ms_match_wild -mysqlnd_ms_set_qos -mysqlnd_qc_get_available_handlers -mysqlnd_qc_get_normalized_query_trace_log -mysqlnd_qc_set_cache_condition -mysqlnd_qc_set_is_select -mysqlnd_qc_set_storage_handler -mysqlnd_uh_convert_to_mysqlnd -mysqlnd_uh_set_connection_proxy -mysqlnd_uh_set_statement_proxy -mysqlnduhconnection -mysqlnduhpreparedstatement -pg_escape_identifier -pg_escape_literal -phar -phardata -pharexception -pharfileinfo -php_user_filter -reflectionzendextension -resetvalue -session_register_shutdown -session_status -sessionhandler -sessionhandlerinterface -setcounterclass -socket_import_stream -stream_set_chunk_size -taint -tokyotyrantexception -tokyotyrantiterator -trait_exists -untaint -varnishadmin -varnishlog -varnishstat -yaf_action_abstract -yaf_application -yaf_bootstrap_abstract -yaf_config_abstract -yaf_config_ini -yaf_config_simple -yaf_controller_abstract -yaf_dispatcher -yaf_exception -yaf_exception_dispatchfailed -yaf_exception_loadfailed -yaf_exception_loadfailed_action -yaf_exception_loadfailed_controller -yaf_exception_loadfailed_module -yaf_exception_loadfailed_view -yaf_exception_routerfailed -yaf_exception_startuperror -yaf_exception_typeerror -yaf_loader -yaf_plugin_abstract -yaf_registry -yaf_request_abstract -yaf_request_http -yaf_request_simple -yaf_response_abstract -yaf_route_interface -yaf_route_map -yaf_route_regex -yaf_route_rewrite -yaf_route_simple -yaf_route_static -yaf_route_supervar -yaf_router -yaf_session -yaf_view_interface -yaf_view_simple -zlib_decode -zlib_encode -trait -insteadof diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/python-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/python-mode deleted file mode 100644 index 09e936c..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/python-mode +++ /dev/null @@ -1,379 +0,0 @@ -ArithmeticError -AssertionError -AttributeError -BaseException -BufferError -BytesWarning -DeprecationWarning -EOFError -Ellipsis -EnvironmentError -Exception -False -FloatingPointError -FutureWarning -GeneratorExit -IOError -ImportError -ImportWarning -IndentationError -IndexError -KeyError -KeyboardInterrupt -LookupError -MemoryError -NameError -None -NotImplemented -NotImplementedError -OSError -OverflowError -PendingDeprecationWarning -ReferenceError -RuntimeError -RuntimeWarning -StandardError -StopIteration -SyntaxError -SyntaxWarning -SystemError -SystemExit -TabError -True -TypeError -UnboundLocalError -UnicodeDecodeError -UnicodeEncodeError -UnicodeError -UnicodeTranslateError -UnicodeWarning -UserWarning -ValueError -Warning -ZeroDivisionError -__builtins__ -__debug__ -__doc__ -__file__ -__future__ -__import__ -__init__ -__main__ -__name__ -__package__ -_dummy_thread -_thread -abc -abs -aifc -all -and -any -apply -argparse -array -as -assert -ast -asynchat -asyncio -asyncore -atexit -audioop -base64 -basestring -bdb -bin -binascii -binhex -bisect -bool -break -buffer -builtins -bytearray -bytes -bz2 -calendar -callable -cgi -cgitb -chr -chuck -class -classmethod -cmath -cmd -cmp -code -codecs -codeop -coerce -collections -colorsys -compile -compileall -complex -concurrent -configparser -contextlib -continue -copy -copyreg -copyright -credits -crypt -csv -ctypes -curses -datetime -dbm -decimal -def -del -delattr -dict -difflib -dir -dis -distutils -divmod -doctest -dummy_threading -elif -else -email -enumerate -ensurepip -enum -errno -eval -except -exec -execfile -exit -faulthandler -fcntl -file -filecmp -fileinput -filter -finally -float -fnmatch -for -format -formatter -fpectl -fractions -from -frozenset -ftplib -functools -gc -getattr -getopt -getpass -gettext -glob -global -globals -grp -gzip -hasattr -hash -hashlib -heapq -help -hex -hmac -html -http -id -if -imghdr -imp -impalib -import -importlib -in -input -inspect -int -intern -io -ipaddress -is -isinstance -issubclass -iter -itertools -json -keyword -lambda -len -license -linecache -list -locale -locals -logging -long -lzma -macpath -mailbox -mailcap -map -marshal -math -max -memoryview -mimetypes -min -mmap -modulefinder -msilib -msvcrt -multiprocessing -netrc -next -nis -nntplib -not -numbers -object -oct -open -operator -optparse -or -ord -os -ossaudiodev -parser -pass -pathlib -pdb -pickle -pickletools -pipes -pkgutil -platform -plistlib -poplib -posix -pow -pprint -print -profile -property -pty -pwd -py_compiler -pyclbr -pydoc -queue -quit -quopri -raise -random -range -raw_input -re -readline -reduce -reload -repr -reprlib -resource -return -reversed -rlcompleter -round -runpy -sched -select -selectors -self -set -setattr -shelve -shlex -shutil -signal -site -slice -smtpd -smtplib -sndhdr -socket -socketserver -sorted -spwd -sqlite3 -ssl -stat -staticmethod -statistics -str -string -stringprep -struct -subprocess -sum -sunau -super -symbol -symtable -sys -sysconfig -syslog -tabnanny -tarfile -telnetlib -tempfile -termios -test -textwrap -threading -time -timeit -tkinter -token -tokenize -trace -traceback -tracemalloc -try -tty -tuple -turtle -type -types -unichr -unicode -unicodedata -unittest -urllib -uu -uuid -vars -venv -warnings -wave -weakref -webbrowser -while -winsound -winreg -with -wsgiref -xdrlib -xml -xmlrpc -xrange -yield -zip -zipfile -zipimport -zlib diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/qml-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/qml-mode deleted file mode 100644 index 7d9976e..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/qml-mode +++ /dev/null @@ -1,183 +0,0 @@ -AlignBottom -AlignCenter -AlignHCenter -AlignLeft -AlignRight -AlignTop -AlignVCenter -AnchorAnimation -AnchorChanges -Audio -Behavior -Binding -BorderImage -ColorAnimation -Column -Component -Connections -Easing -Flickable -Flipable -Flow -FocusScope -GestureArea -Grid -GridView -Horizontal -Image -InBack -InBounce -InCirc -InCubic -InElastic -InExpo -InOutBack -InOutBounce -InOutCirc -InOutCubic -InOutElastic -InOutExpo -InOutQuad -InOutQuart -InOutQuint -InQuad -InQuart -InQuint -InQuint -InSine -Item -LayoutItem -LeftButton -Linear -ListElement -ListModel -ListView -Loader -MidButton -MiddleButton -MouseArea -NoButton -NumberAnimation -OutBack -OutBounce -OutCirc -OutCubic -OutElastic -OutExpo -OutInBack -OutInBounce -OutInCirc -OutInCubic -OutInElastic -OutInExpo -OutInQuad -OutInQuart -OutInQuint -OutQuad -OutQuart -OutQuint -OutSine -Package -ParallelAnimation -ParentAnimation -ParentChange -ParticleMotionGravity -ParticleMotionLinear -ParticleMotionWander -Particles -Path -PathAttribute -PathCubic -PathLine -PathPercent -PathQuad -PathView -PauseAnimation -PropertyAction -PropertyAnimation -PropertyChanges -Qt -QtObject -Rectangle -Repeater -RightButton -Rotation -RotationAnimation -Row -Scale -ScriptAction -SequentialAnimation -SmoothedAnimation -SoundEffect -SpringFollow -State -StateChangeScript -StateGroup -SystemPalette -Text -TextEdit -TextInput -Timer -Transition -Translate -Vertical -Video -ViewsPositionersMediaEffects -VisualDataModel -VisualItemModel -WebView -WorkerScript -XmlListModel -XmlRole -alias -as -bool -break -case -catch -color -const -continue -date -debugger -default -delete -do -double -else -enum -false -false -finally -for -function -if -import -import -in -instanceof -int -let -new -null -on -parent -property -real -return -signal -string -switch -this -throw -true -try -typeof -undefined -url -var -variant -void -while -with -yield diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/ruby-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/ruby-mode deleted file mode 100644 index 1a85417..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/ruby-mode +++ /dev/null @@ -1,181 +0,0 @@ -$! -$" -$$ -$& -$' -$* -$+ -$, -$-0 -$-F -$-I -$-K -$-a -$-d -$-i -$-l -$-p -$-v -$-w -$. -$/ -$0 -$1 -$10 -$11 -$2 -$3 -$4 -$5 -$6 -$7 -$8 -$9 -$: -$; -$< -$= -$> -$? -$@ -$DEBUG -$FILENAME -$KCODE -$LOADED_FEATURES -$LOAD_PATH -$PROGRAM_NAME -$SAFE -$VERBOSE -$\ -$_ -$` -$deferr -$defout -$stderr -$stdin -$stdout -$~ -ARGF -ARGV -Array -BEGIN -DATA -END -ENV -FALSE -Float -Integer -NIL -PLATFORM -RELEASE_DATE -RUBY_COPYRIGHT -RUBY_DESCRIPTION -RUBY_PATCHLEVEL -RUBY_PLATFORM -RUBY_RELEASE_DATE -RUBY_VERSION -SCRIPT_LINES__ -STDERR -STDIN -STDOUT -String -TOPLEVEL_BINDING -TRUE -VERSION -__method__ -` -abort -alias -and -at_exit -autoload -autoload? -begin -binding -block_given -break -callcc -caller -case -catch -chomp -chomp! -chop -chop -class -def -defined? -do -else -elsif -end -ensure -eval -exec -exit -exit! -fail -false -for -fork -format -getc -gets -global_variables -gsub -gsub! -if -in -iterator? -lambda -load -local_variables -loop -module -next -nil -not -open -or -p -printf -proc -putc -puts -raise -rand -readline -readlines -redo -require -require_relative -rescue -retry -return -scan -select -self -set_trace_func -sleep -split -sprintf -srand -sub -sub! -super -syscall -system -test -then -throw -trace_var -trap -true -undef -unless -until -untrace_var -warn -when -while -yield diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/scala-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/scala-mode deleted file mode 100644 index b1ed3a4..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/scala-mode +++ /dev/null @@ -1,1347 +0,0 @@ -_ -: -= -=> -<<: -<% ->: -# -@ -abstract -case -catch -class -def -do -else -extends -false -final -finally -for -forSome -if -implicit -import -lazy -match -new -null -object -override -package -private -protected -requires -return -sealed -super -this -throw -trait -true -try -type -val -var -while -with -yield - -scala -scala.actors -scala.actors.remote -scala.annotation.unchecked -scala.collection -scala.collection.immutable -scala.collection.jcl -scala.collection.mutable -scala.compat -scala.concurrent -scala.io -scala.mobile -scala.ref -scala.reflect -scala.runtime -scala.swing -scala.swing.event -scala.swing.test -scala.testing -scala.text -scala.util -scala.util.automata -scala.util.grammar -scala.util.logging -scala.util.matching -scala.util.parsing -scala.util.parsing.ast -scala.util.parsing.combinator -scala.util.parsing.combinator.lexical -scala.util.parsing.combinator.syntactical -scala.util.parsing.combinator.testing -scala.util.parsing.combinatorold -scala.util.parsing.combinatorold.lexical -scala.util.parsing.combinatorold.syntactical -scala.util.parsing.combinatorold.testing -scala.util.parsing.input -scala.util.parsing.json -scala.util.parsing.syntax -scala.util.regexp -scala.xml -scala.xml.dtd -scala.xml.factory -scala.xml.include -scala.xml.include.sax -scala.xml.parsing -scala.xml.path -scala.xml.persistent -scala.xml.pull -scala.xml.transform - -! -:: -AbstractActor -AbstractButton -AbstractSyntax -AbstractSyntax.Element -AbstractSyntax.NameElement -Action -Action.Trigger -Action.Trigger.Wrapper -ActionEvent -Actor -AdjustingEvent -Annotation -Any -AnyRef -AnyVal -Applet -Applet.UI -Application -Apply0 -Array -Array.Array0 -Array.ArrayLike -Array.Projection -ArrayBuffer -ArrayList -ArrayStack -Atom -AttListDecl -AttrDecl -Attribute -BackgroundChanged -Base -Base.Alt -Base.Meta -Base.RegExp -Base.Sequ -Base.Star -BaseBerrySethi -BasicTransformer -BasicTransformer.NeedsCopy -BeanDescription -BeanDisplayName -BeanInfo -BeanInfoSkip -BeanProperty -Benchmark -BigDecimal -BigInt -Binder -Binders -Binders.BinderEnv -Binders.BindingSensitive -Binders.BoundElement -Binders.ReturnAndDo -Binders.Scope -Binders.UnboundElement -Binders.UnderBinder -BindingParsers -BitSet -Boolean -BorderPanel -BoxPanel -Buffer -Buffer.DefaultBufferIterator -Buffer.Projection -Buffer.Projection0 -Buffer.Projection0.MapProjection -Buffer.Range -Buffer.Range.RangeIterator -BufferIterator -BufferProxy -BufferWrapper -BufferWrapper.IteratorWrapper -BufferWrapper.Range -BufferedIterator -BufferedIterator.Advanced -BufferedIterator.Default -BufferedIterator.PutBack -BufferedSource -Button -ButtonClicked -ButtonGroup -ByNameFunction -Byte -BytePickle.Def -BytePickle.PU -BytePickle.PicklerEnv -BytePickle.PicklerState -BytePickle.Ref -BytePickle.RefDef -BytePickle.SPU -BytePickle.UnPicklerEnv -BytePickle.UnPicklerState -CachedFileStorage -CaretUpdate -Cell -Channel -Channel.LinkedList -Char -CharArrayPosition -CharArrayReader -CharInputStreamIterator -CharSequenceReader -CheckBox -CheckMenuItem -CircularIncludeException -ClassfileAnnotation -ClassfileAttribute -CloneableCollection -Code -Collection -Collection.Projection -CollectionProxy -CollectionWrapper -ComboBox -ComboBox.BuiltInEditor -ComboBox.BuiltInEditor.DelegatedEditor -ComboBox.Editor -Comment -Component -Component.SuperMixin -ComponentAdded -ComponentEvent -ComponentHidden -ComponentMoved -ComponentRemoved -ComponentResized -ComponentShown -ConsRHS -ConsoleLogger -ConstructingHandler -ConstructingParser -Container -Container.Wrapper -Container.Wrapper.Content -ContainerEvent -ContentModel -ContentModel.ElemName -CountedIterator -CustomObjectInputStream -DEFAULT -DFAContentModel -DTD -Debug -Decl -DefaultDecl -DefaultEntry -DefaultMapModel -DefaultMarkupHandler -DetWordAutom -DocCons -DocGroup -DocNest -DocText -DocType -Document -Double -DoubleLinkedList -DtdTypeSymbol -DynamicVariable -ELEMENTS -EditDone -Either -Either.LeftProjection -Either.RightProjection -Elem -ElemDecl -ElementValidator -EmptyMap -EmptySet -EntityDecl -EntityDef -EntityRef -Enumeration -Enumeration.Set32 -Enumeration.Set64 -Enumeration.SetXX -Enumeration.Val -Enumeration.Value -Equiv -EvComment -EvElemEnd -EvElemStart -EvEntityRef -EvProcInstr -EvText -Event -Exit -ExitFun -Expression.Attrib -Expression.Child -Expression.Cond -Expression.DescOrSelf -Expression.Equals -Expression.Exists -Expression.Expr -Expression.FExp -Expression.GenExp -Expression.NameTest -Expression.Test -ExtDef -ExternalID -ExternalSources -FJTaskScheduler2 -FactoryAdapter -FatalError -FileChooser -FlatHashTable -Float -FlowPanel -FocusEvent -FocusGained -FocusLost -FontChanged -ForegroundChanged -FormattedTextField -Frame -Function0 -Function1 -Function10 -Function11 -Function12 -Function13 -Function14 -Function15 -Function16 -Function17 -Function18 -Function19 -Function2 -Function20 -Function21 -Function22 -Function3 -Function4 -Function5 -Function6 -Function7 -Function8 -Function9 -Future -GBTree -GUIApplication -GridBagPanel -GridBagPanel.Constraints -GridPanel -Group -HasKeyValue -HashEntry -HashMap -HashSet -HashTable -Hashtable -HedgeRHS -History -IScheduler -Ident -IdentityHashMap -ImmutableIterator -ImmutableMapAdaptor -ImmutableSetAdaptor -ImplicitConversions -Include -Inclusion -Index -IndexedStorage -InputChannel -InputEvent -InsertTree -Int -IntDef -IntMap -Iterable -Iterable.Projection -IterableProxy -IterableWrapper -Iterator -Iterator.PredicatedIterator -Iterator.TakeWhileIterator -JavaMapAdaptor -JavaSerializer -JavaSetAdaptor -JavaTokenParsers -Label -LabelledRHS -LayoutContainer -Left -Lexer -Lexical -LinkToFun -LinkedHashMap -LinkedHashSet -LinkedList -LinkedListQueueCreator -List -ListBuffer -ListChange -ListChanged -ListElementsAdded -ListElementsRemoved -ListEvent -ListMap -ListMap.Node -ListQueueCreator -ListSelectionChanged -ListSelectionEvent -ListSet -ListSet.Node -ListView -ListView.AbstractRenderer -ListView.ModelWrapper -ListView.Renderer -ListView.Renderer.Wrapped -ListView.selection.Indices -LocalApply0 -Location -Locator -Lock -Logged -LoggedNodeFactory -Long -LongMap -MIXED -MailBox -MainFrame -MalformedAttributeException -Map -Map.Filter -Map.KeySet -Map.Lense -Map.MapTo -Map.MutableIterableProjection -Map.Projection -Map1 -Map2 -Map3 -Map4 -MapProxy -MapWrapper -MapWrapper.IteratorWrapper -MapWrapper.KeySet -MapWrapper.ValueSet -Mappable -Mappable.Mappable -Mappable.Mapper -MarkupDecl -MarkupHandler -MarkupParser -MatchError -Menu -MenuBar -MenuItem -Message -MessageQueue -MessageQueueElement -MetaData -MouseButtonEvent -MouseClicked -MouseDragged -MouseEntered -MouseEvent -MouseExited -MouseMotionEvent -MouseMoved -MousePressed -MouseReleased -MouseWheelMoved -MultiMap -MutableIterable -MutableIterable.Filter -MutableIterable.Map -MutableIterable.Projection -MutableIterator -MutableIterator.Map -MutableIterator.Wrapper -MutableList -MutableSeq -MutableSeq.DefaultSeqIterator -MutableSeq.Filter -MutableSeq.Filter.FilterIterator -MutableSeq.Map -MutableSeq.Projection -NamedSend -NamespaceBinding -NetKernel -NoBindingFactoryAdapter -Node -NodeBuffer -NodeFactory -NodeSeq -NodeTraverser -NonLocalReturnException -NondetWordAutom -NotDefinedError -NotNull -NotationDecl -Nothing -Null -Number -ObservableBuffer -ObservableMap -ObservableSet -OffsetPosition -OpenHashMap -Option -Ordered -Ordering -Orientable -Oriented -OutputChannel -PCData -PCDataMarkupParser -PEReference -PagedSeq -PagedSeqReader -Panel -ParameterEntityDecl -ParsedEntityDecl -Parser -Parsers -Parsers.Error -Parsers.Failure -Parsers.NoSuccess -Parsers.OnceParser -Parsers.ParseResult -Parsers.Parser -Parsers.Success -Parsers.UnitOnceParser -Parsers.UnitParser -Parsers.~ -PartialFunction -PartialOrdering -PartiallyOrdered -PasswordField -PhantomReference -PointedHedgeExp -PointedHedgeExp.Node -PointedHedgeExp.TopIter -Position -Positional -Predef.ArrowAssoc -Predef.Ensuring -PrefixedAttribute -PrettyPrinter -PrettyPrinter.Box -PrettyPrinter.BrokenException -PrettyPrinter.Item -PrettyPrinter.Para -PriorityQueue -PriorityQueueProxy -ProcInstr -Product -Product1 -Product10 -Product11 -Product12 -Product13 -Product14 -Product15 -Product16 -Product17 -Product18 -Product19 -Product2 -Product20 -Product21 -Product22 -Product3 -Product4 -Product5 -Product6 -Product7 -Product8 -Product9 -ProgressBar -Proxy -PublicID -Publisher -Queue -QueueModule -QueueProxy -RadioButton -RadioMenuItem -Random -RandomAccessSeq -RandomAccessSeq.Mutable -RandomAccessSeq.MutableProjection -RandomAccessSeq.Projection -RandomAccessSeq.Projection.MapProjection -RandomAccessSeqProxy -Range -Range.Inclusive -Ranged -Ranged.Comparator -Reaction -Reactions -Reactions.Impl -Reactions.StronglyReferenced -Reactions.Wrapper -Reactor -Reader -RedBlack -RedBlack.BlackTree -RedBlack.NonEmpty -RedBlack.RedTree -RedBlack.Tree -RefBuffer -Reference -ReferenceQueue -ReferenceQueue.Wrapper -ReferenceWrapper -Regex -Regex.Match -Regex.MatchData -Regex.MatchIterator -RegexParsers -RemoteApply0 -Remove -Reset -ResizableArray -Responder -RevertableHistory -RewriteRule -RichBoolean -RichByte -RichChar -RichDouble -RichException -RichFloat -RichInt -RichLong -RichShort -RichSorting -RichString -RichStringBuilder -Right -RollbackIterator -RootPanel -RuleTransformer -SUnit.Assert -SUnit.AssertFailed -SUnit.Test -SUnit.TestCase -SUnit.TestConsoleMain -SUnit.TestFailure -SUnit.TestResult -SUnit.TestSuite -ScalaBeanInfo -ScalaObject -Scanner -Scanners -Scanners.Scanner -SchedulerAdapter -Script -Scriptable -ScrollPane -Scrollable -SelectionChanged -SelectionEvent -SendTo -Separator -Seq -Seq.Projection -Seq.Projection.ComputeSize -Seq.Projection.MapProjection -Seq.singleton -SeqIterator -SeqIterator.Map -SeqProxy -SequentialContainer -SequentialContainer.Wrapper -SerialVersionUID -Serializer -Service -Set -Set.Filter -Set.Projection -Set1 -Set2 -Set3 -Set4 -SetProxy -SetStorage -SetWrapper -Short -Show -Show.SymApply -SimpleApplet -SimpleGUIApplication -SimpleTokenizer -SingleLinkedList -SingleThreadedScheduler -Slider -SoftReference -Some -Sorted -SortedMap -SortedMap.DefaultKeySet -SortedMap.Filter -SortedMap.KeySet -SortedMap.Lense -SortedMap.Projection -SortedMap.Range -SortedMap.Range.Filter -SortedMapWrapper -SortedMapWrapper.KeySet -SortedMapWrapper.Range -SortedSet -SortedSet.Filter -SortedSet.Projection -SortedSet.Range -SortedSetWrapper -SortedSetWrapper.Range -Source -SpecialNode -SplitPane -Stack -Stack.Node -StackProxy -StandardTokenParsers -StaticAnnotation -StaticAttribute -StdLexical -StdTokenParsers -StdTokens -StdTokens.Identifier -StdTokens.Keyword -StdTokens.NumericLit -StdTokens.StringLit -Str -Stream -Stream.Definite -StreamReader -StringBuilder -Subscriber -SubsetConstruction -Swing.Embossing -Symbol -SyncChannel -SyncVar -SynchronizedBuffer -SynchronizedMap -SynchronizedPriorityQueue -SynchronizedQueue -SynchronizedSet -SynchronizedStack -SyntaxError -SystemID -TabbedPane -TabbedPane.Page -Table -Table.AbstractRenderer -Table.LabelRenderer -Table.Renderer -Table.selection.SelectionSet -TableChange -TableChanged -TableColumnsSelected -TableEvent -TableResized -TableRowsAdded -TableRowsRemoved -TableRowsSelected -TableStructureChanged -TableUpdated -TcpService -TcpServiceWorker -Tester -Text -TextArea -TextBuffer -TextComponent -TextComponent.Caret -TextComponent.HasColumns -TextComponent.HasRows -TextField -TickedScheduler -ToggleButton -TokenParsers -TokenTests -Tokens -Tokens.ErrorToken -Tokens.Token -Tree -TreeHashMap -TreeMap -TreeRHS -TreeSet -Tuple1 -Tuple10 -Tuple11 -Tuple12 -Tuple13 -Tuple14 -Tuple15 -Tuple16 -Tuple17 -Tuple18 -Tuple19 -Tuple2 -Tuple20 -Tuple21 -Tuple22 -Tuple3 -Tuple4 -Tuple5 -Tuple6 -Tuple7 -Tuple8 -Tuple9 -TypeConstraint -TypeSymbol -UIElement -UIEvent -UnavailableResourceException -UnbalancedTreeMap -UnbalancedTreeMap.Node -Undoable -UninitializedError -UninitializedFieldError -Unit -UnlinkFromFun -Unparsed -UnparsedEntityDecl -UnprefixedAttribute -Update -ValidatingMarkupHandler -ValidationException -ValueChanged -WeakHashMap -WeakReference -WindowActivated -WindowClosed -WindowClosing -WindowDeactivated -WindowDeiconified -WindowEvent -WindowIconified -WindowOpened -WordBerrySethi -WordExp -WordExp.Label -WordExp.Letter -WordExp.Wildcard -WorkerThread -WorkerThreadScheduler -XIncludeException -XIncludeFilter -XIncluder -XMLEvent -XMLEventReader -XMLEventReader.Parser -XhtmlParser -cloneable -deprecated -inline -jolib.Asynchr -jolib.Join -jolib.Signal -jolib.Synchr -native -noinline -pilib.Chan -pilib.GP -pilib.Product -pilib.Spawn -pilib.Sum -pilib.UChan -pilib.UGP -remote -serializable -throws -transient -unchecked -uncheckedStable -uncheckedVariance -unsealed -volatile -~ - -! -:: -ANY -Action -Action.NoAction -Action.Trigger -ActionEvent -Actor -ActorGC -Alignment -AnyHedgeRHS -AnyTreeRHS -Apply0 -Array -AttListDecl -AttrDecl -BackgroundChanged -Base.Eps -BigDecimal -BigDecimal.RoundingMode -BigInt -Binders.EmptyBinderEnv -Binders.UnderBinder -BorderPanel -BorderPanel.Position -Buffer -BufferedIterator -BufferedSource -ButtonApp -ButtonClicked -BytePickle -CaretUpdate -Cell -CelsiusConverter -CelsiusConverter2 -CharArrayReader -CharSequenceReader -Collection -ComboBox -ComboBox.selection -ComboBoxes -Comment -Component -Component.Mouse -ComponentAdded -ComponentHidden -ComponentMoved -ComponentRemoved -ComponentResized -ComponentShown -ConsRHS -Console -ConstructingParser -Container -ContentModel -ContentModel.Translator -ContentModelParser -Conversions -CountButton -DEFAULT -Debug -Dialog -Dialog.Message -Dialog.Options -Dialog.Result -Dialogs -DocBreak -DocCons -DocGroup -DocNest -DocNil -DocText -DocType -Document -ELEMENTS -EMPTY -EditDone -Either -Elem -ElemDecl -EmptyHedgeRHS -EncodingHeuristics -End -EntityRef -EvComment -EvElemEnd -EvElemStart -EvEntityRef -EvProcInstr -EvText -Exit -Expression -Expression.Root -Expression.WildcardTest -ExtDef -FatalError -FileChooser -FileChooser.Result -FileChooser.SelectionMode -FlowPanel -FlowPanel.Alignment -FocusGained -FocusLost -FontChanged -ForegroundChanged -FormattedTextField -FormattedTextField.FocusLostBehavior -FreshNameCreator -Function -Futures -GridBagDemo -GridBagPanel -GridBagPanel.Anchor -GridBagPanel.Fill -GridPanel -Group -HashMap -HashSet -HelloWorld -IMPLIED -Ident -ImmutableIterator -ImmutableIterator.Empty -Include -Index -IntDef -IntMap -Iterable -Iterator -JSON -Key -LabelledRHS -Left -LinkedHashMap -LinkedHashSet -List -ListChanged -ListElementsAdded -ListElementsRemoved -ListMap -ListSelectionChanged -ListSet -ListView -ListView.GenericRenderer -ListView.IntervalMode -ListView.Renderer -ListView.selection -ListView.selection.indices -ListView.selection.items -LocalApply0 -Location -Locator -LongMap -MIXED -Main -MakeValidationException -MalformedAttributeException -Map -Marshal -Math -MetaData -MouseClicked -MouseDragged -MouseEntered -MouseExited -MouseMoved -MousePressed -MouseReleased -MouseWheelMoved -MutableIterable -MutableIterator -MutableSeq -NA -NamedSend -Nil -NoPosition -Node -NodeSeq -None -NotationDecl -Null -Number -OffsetPosition -OpenHashMap -Option -Orientation -PCDATA -PCData -PEReference -PagedSeq -PagedSeqReader -ParameterEntityDecl -ParsedEntityDecl -Parsing -Platform -PointedHedgeExp.Point -Position -Predef -Predef.Pair -Predef.Triple -PrettyPrinter.Break -ProcInstr -Product1 -Product10 -Product11 -Product12 -Product13 -Product14 -Product15 -Product16 -Product17 -Product18 -Product19 -Product2 -Product20 -Product21 -Product22 -Product3 -Product4 -Product5 -Product6 -Product7 -Product8 -Product9 -Properties -PublicID -QNode -Queue -REQUIRED -RandomAccessSeq -Range -Reactions -RedBlack.Empty -Regex -Regex.Match -RegexTest -RemoteActor -RemoteApply0 -Remove -Reset -Responder -RichString -Right -SUnit -Scheduler -SelectionChanged -SendTo -Seq -SequentialContainer -Set -SimpleApplet.ui -Some -SortedMap -SortedSet -Sorting -Source -Stack -Start -Str -Stream -Stream.cons -Stream.lazy_:: -StreamReader -StringBuilder -Swing -Swing.EmptyIcon -Swing.Lowered -Swing.Raised -SwingApp -Symbol -SystemID -TIMEOUT -TabbedPane -TabbedPane.Layout -TabbedPane.pages -TabbedPane.selection -Table -Table.AutoResizeMode -Table.ElementMode -Table.IntervalMode -Table.selection -Table.selection.columns -Table.selection.rows -TableChanged -TableColumnsSelected -TableResized -TableRowsAdded -TableRowsRemoved -TableRowsSelected -TableSelection -TableStructureChanged -TableUpdated -TcpService -Terminate -Text -TextBuffer -TextComponent -TextComponent.caret -Tokens.EOF -TopScope -TreeHashMap -TreeMap -TreeSet -Tuple1 -Tuple10 -Tuple11 -Tuple12 -Tuple13 -Tuple14 -Tuple15 -Tuple16 -Tuple17 -Tuple18 -Tuple19 -Tuple2 -Tuple20 -Tuple21 -Tuple22 -Tuple3 -Tuple4 -Tuple5 -Tuple6 -Tuple7 -Tuple8 -Tuple9 -UIDemo -UTF8Codec -UnbalancedTreeMap -UninitializedFieldError -Unparsed -UnparsedEntityDecl -Update -Utility -ValidationException -ValueChanged -WindowActivated -WindowClosed -WindowClosing -WindowDeactivated -WindowDeiconified -WindowIconified -WindowOpened -XML -Xhtml -XhtmlEntities -XhtmlParser -jolib -mkTilde -ops -pilib -~ - -ArrayIndexOutOfBoundsException -Character -Class -ClassCastException -Error -Exception -Function -IllegalArgumentException -IndexOutOfBoundsException -Integer -Map -NoSuchElementException -NullPointerException -NumberFormatException -Pair -Runnable -RuntimeException -Set -String -StringIndexOutOfBoundsException -Throwable -Triple -Tuple -UnsupportedOperationException -any2ArrowAssoc -any2Ensuring -any2stringadd -assert -assume -boolean -boolean2Boolean -booleanWrapper -byte -byte2Byte -byte2double -byte2float -byte2int -byte2long -byte2short -byteWrapper -char -char2Character -char2double -char2float -char2int -char2long -charWrapper -classOf -currentThread -double -double2Double -doubleWrapper -error -exceptionWrapper -exit -float -float2Float -float2double -floatWrapper -forceArrayProjection -forceRandomAccessCharSeq -format -identity -int -int2Integer -int2double -int2float -int2long -intWrapper -iterable2ordered -lazyStreamToConsable -long -long2Long -long2double -long2float -longWrapper -print -printf -println -readBoolean -readByte -readChar -readDouble -readFloat -readInt -readLine -readLong -readShort -readf -readf1 -readf2 -readf3 -require -seqToCharSequence -short -short2Short -short2double -short2float -short2int -short2long -shortWrapper -stringBuilderWrapper -stringWrapper -tuple22ordered -tuple32ordered -tuple42ordered -tuple52ordered -tuple62ordered -tuple72ordered -tuple82ordered -tuple92ordered -unit -unit2ordered diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/scheme-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/scheme-mode deleted file mode 100644 index e5cca61..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/scheme-mode +++ /dev/null @@ -1,216 +0,0 @@ -case-lambda -call/cc -class -define-class -exit-handler -field -import -inherit -init-field -interface -let*-values -let-values -let/ec -mixin -opt-lambda -override -protect -provide -public -rename -require -require-for-syntax -syntax -syntax-case -syntax-error -unit/sig -unless -when -with-syntax -and -begin -call-with-current-continuation -call-with-input-file -call-with-output-file -case -cond -define -define-syntax -delay -do -dynamic-wind -else -for-each -if -lambda -let -let* -let-syntax -letrec -letrec-syntax -map -or -syntax-rules -abs -acos -angle -append -apply -asin -assoc -assq -assv -atan -boolean? -caar -cadr -call-with-input-file -call-with-output-file -call-with-values -car -cdddar -cddddr -cdr -ceiling -char->integer -char-alphabetic? -char-ci<=? -char-ci=? -char-ci>? -char-downcase -char-lower-case? -char-numeric? -char-ready? -char-upcase -char-upper-case? -char-whitespace? -char<=? -char=? -char>? -char? -close-input-port -close-output-port -complex? -cons -cos -current-input-port -current-output-port -denominator -display -eof-object? -eq? -equal? -eqv? -eval -even? -exact->inexact -exact? -exp -expt -#f -floor -force -gcd -imag-part -inexact->exact -inexact? -input-port? -integer->char -integer? -interaction-environment -lcm -length -list -list->string -list->vector -list-ref -list-tail -list? -load -log -magnitude -make-polar -make-rectangular -make-string -make-vector -max -member -memq -memv -min -modulo -negative? -newline -not -null-environment -null? -number->string -number? -numerator -odd? -open-input-file -open-output-file -output-port? -pair? -peek-char -port? -positive? -procedure? -quasiquote -quote -quotient -rational? -rationalize -read -read-char -real-part -real? -remainder -reverse -round -scheme-report-environment -set! -set-car! -set-cdr! -sin -sqrt -string -string->list -string->number -string->symbol -string-append -string-ci<=? -string-ci=? -string-ci>? -string-copy -string-fill! -string-length -string-ref -string-set! -string<=? -string=? -string>? -string? -substring -symbol->string -symbol? -#t -tan -transcript-off -transcript-on -truncate -values -vector -vector->list -vector-fill! -vector-length -vector-ref -vector-set! diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/sclang-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/sclang-mode deleted file mode 100644 index 2b92135..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/sclang-mode +++ /dev/null @@ -1,1481 +0,0 @@ -A2K -A2K -abs -absdif -AbstractFunction -AbstractIn -AbstractOut -AbstractServerAction -acos -addition -Adverbs -AllpassC -AllpassL -AllpassN -amclip -AmpComp -AmpComp -AmpCompA -AmpCompA -ampdb -Amplitude -Amplitude -APF -AppClock -Archive -Array -Array2D -ArrayedCollection -asin -Assignment -Association -asTarget -atan -atan2 -AudioControl -AudioIn -audio_rate_mapping -AutoClassHelper -Bag -Balance2 -Balance2 -Ball -Ball -BAllPass -BAllPass -BasicOpUGen -basic_live_coding_techniques -BBandPass -BBandPass -BBandStop -BBandStop -BeatTrack -BeatTrack -BeatTrack -BeatTrack2 -BeatTrack2 -BeatTrack2 -BEQSuite -BEQSuite -BHiPass -BHiPass -BHiPass4 -BHiShelf -BHiShelf -BinaryOpFunction -BinaryOpStream -BinaryOpUGen -BiPanB2 -BiPanB2 -Blip -Blip -BLowPass -BLowPass -BLowPass4 -BLowShelf -BLowShelf -Boolean -BPeakEQ -BPeakEQ -BPF -BPF -BPZ2 -BPZ2 -BRF -BRF -BrownNoise -BrownNoise -BRZ2 -BRZ2 -BufAllpassC -BufAllpassL -BufAllpassN -BufChannels -BufChannels -BufCombC -BufCombL -BufCombN -BufDelayC -BufDelayL -BufDelayN -BufDur -BufDur -Buffer -Buffers -BufFrames -BufFrames -BufRateScale -BufRateScale -BufRd -BufRd -BufSampleRate -BufSampleRate -BufSamples -BufSamples -BufWr -BufWr -bundledCommands -Bus -BusPlug -Busses -Button -CCResponder -ceil -Changed -Changed -ChaosGen -Char -CheckBadValues -Class -Classes -ClassHelpTemplate -ClearBuf -ClientVsServer -Clip -Clip -clip2 -ClipNoise -ClipNoise -Clock -CmdPeriod -cmds -CocoaMenuItem -CoinGate -CoinGate -Collection -Collections -Color -CombC -CombL -CombN -Comments -Compander -Compander -CompanderD -Complex -CompositeView -Condition -ContiguousBlockAllocator -Control -Control-Structures -ControlDur -ControlName -ControlRate -ControlSpec -convertRhythm -Convolution -Convolution2 -Convolution2L -Convolution3 -cos -COsc -COsc -cosh -cpsmidi -cpsoct -Crackle -Crackle -Creating-Standalone-Applications -Crossplatform -CSVFileReader -cubed -CuspL -CuspL -CuspN -CuspN -Date -dbamp -Dbrown -Dbrown -Dbufrd -Dbufrd -Dbufwr -Dbufwr -DC -DC -Debugging-tips -DebugNodeWatcher -Decay -Decay -Decay2 -Decay2 -DecodeB2 -DecodeB2 -default_group -DegreeToKey -DegreeToKey -Delay1 -Delay2 -DelayC -DelayL -DelayN -DelTapRd -DelTapRd -DelTapWr -DelTapWr -Demand -Demand -DemandEnvGen -DemandEnvGen -DemandEnvGen -DetectIndex -DetectIndex -DetectSilence -DetectSilence -DetectSilence -Dgeom -Dgeom -Dialog -Dibrown -Dictionary -difsqr -DiskIn -DiskIn -DiskIn -DiskOut -DiskOut -DiskOut -distort -division -Diwhite -Document -DocumentAutoCompletion -Donce -Done -Done -DoubleArray -Dpoll -Dpoll -DragBoth -DragSink -DragSource -Drand -Drand -Dreset -Dreset -Dseq -Dseq -Dser -Dser -Dseries -Dseries -Dshuf -Dshuf -Dstutter -Dstutter -Dswitch -Dswitch -Dswitch1 -Dswitch1 -DUGen -Dunique -Dust -Dust -Dust2 -Dust2 -Duty -Duty -Dwhite -Dwhite -Dwrand -Dwrand -Dxrand -DynKlang -DynKlang -DynKlank -DynKlank -DynKlank -EmacsEditor -EmacsGUI -Env -EnvelopeView -EnvGate -EnvGen -EnvGen -EnvirGui -Environment -EnvironmentRedirect -Error -Event -EventPatternProxy -EventPatternProxy -EventStream -EventStreamPlayer -Event_types -Exception -excess -exp -exponentiation -ExpRand -ExpRand -ExpRand -Expression-Sequence -EZGui -EZKnob -EZLists -EZListView -EZNumber -EZPopUpMenu -EZRanger -EZScroller -EZSlider -EZText -False -FBSineC -FBSineC -FBSineL -FBSineL -FBSineN -FBSineN -Fdef -FFT -FFTTrigger -File -FileReader -Filter -FilterPattern -FilterPattern -Float -FloatArray -floor -FlowLayout -FlowView -Fold -Fold -fold2 -Font -Formant -Formant -Formlet -Formlet -FOS -FOS -frac -Frame -Free -Free -FreeSelf -FreeSelf -FreeSelfWhenDone -FreeSelfWhenDone -FreeVerb -FreeVerb2 -FreqScope -FreqScopeView -FreqShift -FreqShift -FreqShift -FSinOsc -FSinOsc -FuncFilterPattern -Function -FunctionDef -FunctionList -Functions -Gate -GbmanL -GbmanL -GbmanN -GbmanN -Gendy1 -Gendy1 -Gendy2 -Gendy2 -Gendy3 -Gendy3 -GeneralHID -GeneralHIDDevice -GeneralHIDSlot -GeneralHIDSpec -Glossary -Gradient -GrainBuf -GrainBuf -GrainFM -GrainIn -GrainSin -GrayNoise -GrayNoise -greaterorequalthan -greaterthan -Group -Groups -GUI -gui -GUI-Classes -GUI-Overview -GVerb -Harmonics -Hasher -Hasher -Help -HelpDocsLicensing -Helper -HelpSearchResult -HenonC -HenonC -HenonL -HenonL -HenonN -HenonN -HIDDeviceService -Hilbert -HilbertFIR -HiliteGradient -History -HistoryGui -HLayoutView -How-to-Use-the-Interpreter -HPF -HPF -HPZ1 -HPZ1 -HPZ2 -HPZ2 -hypot -hypotApx -IdentityBag -IdentityDictionary -IdentitySet -IEnvGen -IEnvGen -if -IFFT -Impulse -Impulse -In -Index -Index -IndexInBetween -IndexInBetween -IndexL -IndexL -InFeedback -Infinitum -initClass -InRange -InRange -InRect -InRect -Int16Array -Int32Array -Int8Array -Integer -Integrator -Integrator -Integrator -Internal-Snooping -InterplEnv -InterplPairs -InterplXYC -Interpreter -Interval -InTrig -Intro-to-Objects -Introductory_tutorial -IRand -IRand -IRand -isKindOf -isNegative -isPositive -isStrictlyPositive -JITGui -JITLib -jitlib_asCompileString -jitlib_basic_concepts_01 -jitlib_basic_concepts_02 -jitlib_basic_concepts_03 -jitlib_basic_concepts_04 -jitlib_efficiency -jitlib_fading -jitlib_networking -J_concepts_in_SC -K2A -K2A -KeyState -KeyState -KeyTrack -KeyTrack -Klang -Klang -Klang -Klank -Klank -Klank -Knob -Lag -Lag -Lag2 -Lag2 -Lag2UD -Lag2UD -Lag3 -Lag3 -Lag3UD -Lag3UD -LagControl -LagIn -LagUD -LagUD -LastValue -Latch -Latch -LatoocarfianC -LatoocarfianC -LatoocarfianL -LatoocarfianL -LatoocarfianN -LatoocarfianN -LazyEnvir -LeakDC -LeakDC -LeastChange -LeastChange -lessorequalthan -lessthan -LFClipNoise -LFClipNoise -LFCub -LFCub -LFDClipNoise -LFDClipNoise -LFDNoise0 -LFDNoise0 -LFDNoise1 -LFDNoise1 -LFDNoise3 -LFDNoise3 -LFGauss -LFGauss -LFNoise0 -LFNoise0 -LFNoise1 -LFNoise1 -LFNoise2 -LFNoise2 -LFPar -LFPar -LFPulse -LFPulse -LFSaw -LFSaw -LFTri -LFTri -Library -LibraryBase -Licensing -LID -Limiter -Limiter -LinCongC -LinCongC -LinCongL -LinCongL -LinCongN -LinCongN -Line -Line -Linen -Linen -LinExp -LinExp -LinkedList -LinkedListNode -LinLin -LinLin -LinPan2 -LinPan2 -LinRand -LinRand -LinRand -LinSelectX -Linux_udev_setup -LinXFade2 -LinXFade2 -List -ListComprehensions -ListDUGen -ListPattern -ListPattern -ListView -Literals -LocalBuf -LocalBuf -LocalIn -LocalOut -log -log10 -log2 -Logistic -Logistic -loop -LorenzL -LorenzL -Loudness -Loudness -LPF -LPF -LPZ1 -LPZ1 -LPZ2 -LPZ2 -Magnitude -Main -MantissaMask -MantissaMask -matchItem -max -MaxLocalBufs -MaxLocalBufs -Maybe -Median -Median -Method -Method-Calls -MFCC -MFCC -MidEQ -MidEQ -MIDI -midicps -MIDIIn -MIDIOut -MIDIResponder -min -Mix -modifiers -Modifying_Standalones -modulo -Monitor -MonitorGui -MoogFF -MoogFF -More-On-Getting-Help -MostChange -MostChange -MouseButton -MouseButton -MouseX -MouseX -MouseY -MouseY -MovieView -MulAdd -MultiChannel -MultiLevelIdentityDictionary -MultiOutUGen -multiplication -MultiSliderView -MultiTap -NamedControl -NAryOpFunction -NAryOpStream -Ndef -NdefGui -NdefMixer -NdefMixerOld -NdefParamGui -neg -NetAddr -Nil -Node -NodeControl -NodeEvent -NodeMap -NodeMessaging -NodeProxy -NodeProxyEditor -NodeProxy_roles -NodeWatcher -Non-Realtime-Synthesis -Normalizer -Normalizer -NoteOnResponder -Notes-on-the-HTML-Help-System -NotificationCenter -NRand -NRand -NRand -NumAudioBuses -Number -NumberBox -NumBuffers -NumControlBuses -NumInputBuses -NumOutputBuses -NumRunningSynths -Object -ObjectGui -ObjectTable -octcps -OffsetOut -OnePole -OnePole -OneZero -OneZero -Onsets -Onsets -Operators -Order -Order-of-execution -OrderedIdentitySet -Osc -Osc -OSCBundle -OscN -OscN -OSCpathResponder -OSCresponder -OSCresponderNode -OSC_communication -Out -OutputProxy -PAbstractGroup -PackFFT -Padd -Padd -Paddp -Paddp -Paddpre -Paddpre -Pair -Pan2 -Pan2 -Pan4 -Pan4 -PanAz -PanAz -PanB -PanB -PanB2 -PanB2 -Panner -PartConv -Partial-Application -PathName -Pattern -PatternConductor -PatternProxy -PatternProxy -PatternsDocumentedAndNot -Pause -Pause -PauseSelf -PauseSelf -PauseSelfWhenDone -Pavaroh -Pavaroh -Pbeta -Pbeta -Pbind -Pbind -Pbindef -Pbindef -Pbindf -Pbindf -PbindProxy -PbindProxy -Pbinop -Pbinop -Pbrown -Pbrown -Pbus -Pbus -Pcauchy -Pcauchy -Pchain -Pchain -Pclump -Pclutch -Pclutch -Pcollect -Pcollect -Pconst -Pconst -Pdef -Pdef -PdefAllGui -PdefEditor -PdefGui -Pdefn -Pdefn -PdegreeToKey -PdegreeToKey -Pdfsm -Pdfsm -Pdict -Pdict -Pdiff -Pdrop -PdurStutter -PdurStutter -Peak -Peak -PeakFollower -PeakFollower -Pen -Penvir -Penvir -Pevent -Peventmod -Pexprand -Pexprand -PfadeIn -PfadeOut -Pfin -Pfin -Pfindur -Pfindur -PfinQuant -Pfinval -Pfinval -Pflatten -Pflow -Pflow -Pfpar -Pfset -Pfset -Pfsm -Pfsm -Pfunc -Pfunc -Pfuncn -Pfuncn -Pfx -Pfx -Pfxb -Pfxb -Pgate -Pgate -Pgauss -Pgauss -Pgbrown -Pgbrown -Pgeom -Pgeom -Pget -Pgpar -Pgpar -Pgroup -Pgroup -Pgtpar -PG_01_Introduction -PG_02_Basic_Vocabulary -PG_03_What_Is_Pbind -PG_04_Words_to_Phrases -PG_05_Math_on_Patterns -PG_060_Filter_Patterns -PG_06a_Repetition_Contraint_Patterns -PG_06b_Time_Based_Patterns -PG_06c_Composition_of_Patterns -PG_06d_Parallel_Patterns -PG_06e_Language_Control -PG_06f_Server_Control -PG_06g_Data_Sharing -PG_07_Value_Conversions -PG_08_Event_Types_and_Parameters -PG_Cookbook01_Basic_Sequencing -PG_Cookbook02_Manipulating_Patterns -PG_Cookbook03_External_Control -PG_Cookbook04_Sending_MIDI -PG_Cookbook05_Using_Samples -PG_Cookbook06_Phrase_Network -PG_Cookbook07_Rhythmic_Variations -PG_Ref01_Pattern_Internals -Phasor -Phasor -Phid -Phid -PhidKey -PhidKey -PhidSlot -PhidSlot -Phprand -Phprand -Pif -Pif -Pindex -Pindex -PingPong -PinkerNoise -PinkNoise -PinkNoise -Pipe -Pitch -Pitch -Pitch -PitchShift -PitchShift -Pkey -Pkey -Place -Place -Plag -Plambda -Plambda -Platform -play -PlayBuf -PlayBuf -playN -Plazy -Plazy -PlazyEnvir -PlazyEnvir -PlazyEnvirN -PlazyEnvirN -Plet -plot -Plotter -Plprand -Plprand -Pluck -Pluck -Pmeanrand -Pmeanrand -Pmono -Pmono -PmonoArtic -PmonoArtic -PMOsc -PMOsc -Pmul -Pmul -Pmulp -Pmulp -Pmulpre -Pmulpre -Pn -Pn -Pnaryop -Pnaryop -Pnsym -Pnsym -Pnsym1 -Point -Polar -Poll -Poll -Polymorphism -PopUpMenu -Post -pow -Ppar -Ppar -PparGroup -Ppatlace -Ppatlace -Ppatmod -Ppatmod -Pplayer -Ppoisson -Ppoisson -Pprob -Pprob -Pprotect -Pprotect -Pproto -Pproto -Prand -Prand -Preject -Preject -Prewrite -Prewrite -PriorityQueue -Process -Prorate -Prorate -Prout -Prout -Proutine -Proutine -ProxyMixer -ProxyMixerOld -ProxyMonitorGui -ProxySpace -proxyspace_examples -ProxySynthDef -Pseed -Pseed -Pseg -Pseg -Pselect -Pselect -Pseq -Pseq -Pser -Pser -Pseries -Pseries -Pset -Pset -Psetp -Psetp -Psetpre -Psetpre -Pshuf -Pshuf -PSinGrain -Pslide -Pslide -Pspawn -Pspawn -Pspawner -Pspawner -Pstep -Pstep -Pstep2add -Pstep3add -PstepNadd -PstepNadd -PstepNfunc -PstepNfunc -Pstretch -Pstretchp -Pstutter -Pstutter -Pswitch -Pswitch -Pswitch1 -Pswitch1 -Psym -Psym -Psym1 -Psync -Psync -Ptime -Ptime -Ptpar -Ptpar -Ptrace -Ptsym -Ptuple -Ptuple -publishing_code -Pulse -Pulse -PulseCount -PulseDivider -Punop -Punop -pvcalc -pvcalc2 -pvcollect -PV_Add -PV_BinScramble -PV_BinShift -PV_BinWipe -PV_BrickWall -PV_ChainUGen -PV_ChainUGen -PV_ConformalMap -PV_Conj -PV_Copy -PV_CopyPhase -PV_Diffuser -PV_Div -PV_HainsworthFoote -PV_JensenAndersen -PV_LocalMax -PV_MagAbove -PV_MagBelow -PV_MagClip -PV_MagDiv -PV_MagFreeze -PV_MagMul -PV_MagNoise -PV_MagShift -PV_MagSmear -PV_MagSquared -PV_Max -PV_Min -PV_Mul -PV_PhaseShift -PV_PhaseShift270 -PV_PhaseShift90 -PV_RandComb -PV_RandWipe -PV_RectComb -PV_RectComb2 -Pwalk -Pwalk -Pwhile -Pwhile -Pwhite -Pwhite -Pwrand -Pwrand -Pwrap -Pwrap -Pxrand -Pxrand -QuadC -QuadC -QuadL -QuadL -QuadN -QuadN -Quant -Quark -Quarks -RadiansPerSample -Ramp -Ramp -Rand -Rand -Rand -RandID -RandID -Randomness -randomSeed -RandSeed -RandSeed -RangeSlider -RawArray -RawPointer -reciprocal -RecNodeProxy -RecordBuf -RecordBuf -Rect -recursive_phrasing -Ref -RefCopy -Regenerate-GUI-Help -ReplaceOut -resize -Resonz -Resonz -RHPF -RHPF -ring1 -ring2 -ring3 -ring4 -Ringz -Ringz -RLPF -RLPF -RootNode -Rossler -Rotate2 -Rotate2 -round -Routine -runMe -runMe2 -RunningMax -RunningMax -RunningMin -RunningMin -RunningSum -RunningSum -SampleDur -SampleRate -Saw -Saw -SC2DSlider -SC2DTabletSlider -Scale -scaleneg -SCButton -SCCompositeView -SCContainerView -SCControlView -SCDragBoth -SCDragSink -SCDragSource -SCDragView -SCEnvelopeEdit -SCEnvelopeView -SCFont -SCFreqScope -SCFreqScopeWindow -Scheduler -SCHLayoutView -Schmidt -Schmidt -SCImage -SCImageFilter -SCImageKernel -SCKnob -SCLayoutView -SCLevelIndicator -SCListView -SCMenuGroup -SCMenuItem -SCMenuSeparator -SCModalSheet -SCModalWindow -SCMovieView -SCMultiSliderView -SCNumberBox -Scope -ScopeOut -ScopeOut2 -ScopeView -Score -SCPen -SCPopUpMenu -SCQuartzComposerView -SCRangeSlider -ScrollView -SCScope -SCScrollTopView -SCScrollView -SCSlider -SCSliderBase -SCSoundFileView -SCStaticText -SCStaticTextBase -SCStethoscope -SCTabletView -SCTextField -SCTextView -SCTopView -SCUserView -SCUserView-Subclassing -SCView -SCVLayoutView -SCWindow -Select -Select -SelectX -SelectX -SelectXFocus -SelectXFocus -Semaphore -SendPeakRMS -SendReply -SendTrig -SequenceableCollection -SerialPort -Server -Server-Architecture -Server-Command-Reference -ServerBoot -ServerOptions -ServerQuit -ServerTiming -ServerTree -Set -SetBuf -SetResetFF -Shaper -Shaper -SharedIn -SharedOut -Shortcuts -sign -Signal -Silent -Silent -SimpleController -SimpleNumber -sin -sinh -SinOsc -SinOsc -SinOscFB -SkipJack -Slew -Slew -Slider -Slider2D -Slope -Slope -Slope -softclip -softPut -softSet -softVol_ -somepage -SortedList -SOS -SOS -SoundFile -SoundFileView -SoundFileViewProgressWindow -SoundIn -SparseArray -Spawner -Spec -SpecCentroid -SpecCentroid -SpecFlatness -SpecFlatness -SpecPcile -SpecPcile -Splay -SplayAz -SplayZ -Spring -Spring -sqrdif -sqrsum -sqrt -squared -StandardL -StandardL -StandardN -StandardN -StartUp -StaticText -Stepper -StereoConvolution2L -Stethoscope -Stream -StreamClutch -Streams -Streams-Patterns-Events1 -Streams-Patterns-Events2 -Streams-Patterns-Events3 -Streams-Patterns-Events4 -Streams-Patterns-Events5 -Streams-Patterns-Events6 -Streams-Patterns-Events7 -String -StubTemplate -SubsampleOffset -subtraction -sumsqr -Sweep -switch -Symbol -SymbolArray -SymbolicNotations -SyncSaw -SyncSaw -Syntax-Shortcuts -Synth -Synth-Controlling-UGens -Synth-Definition-File-Format -SynthDef -SynthDesc -SynthDescLib -SystemClock -T2A -T2A -T2K -T2K -TabFileReader -TabletSlider2D -TabletView -tan -tanh -Tap -Tap -Task -TaskProxy -TaskProxy -TaskProxyGui -TBall -TBall -TChoose -Tdef -Tdef -TdefAllGui -TdefEditor -TdefGui -TDelay -TDelay -TDuty -TDuty -TempoBusClock -TempoClock -TExpRand -TExpRand -TextField -TextView -TGrains -TGrains -TGrains -the_lazy_proxy -Thread -thresh -Thunk -Timer -TIRand -TIRand -ToggleFF -TopicHelpTemplate -Tour_of_UGens -TRand -TRand -Trig -Trig1 -TrigControl -True -trunc -Tuning -Tutorial -TWChoose -TWChoose -TWindex -TWindex -TwoPole -TwoPole -TwoWayIdentityDictionary -TwoZero -TwoZero -UGen -UGen-doneActions -UGenHelpTemplate -UGens -UGens-and-Synths -UnaryOpFunction -UnaryOpStream -UnaryOpUGen -Understanding-Errors -Undocumented-Classes -UniqueID -UnixFILE -Unpack1FFT -UnpackFFT -UserView -Using-Extensions -Using-the-Startup-File -UsingMIDI -VarLag -VarSaw -VarSaw -VDiskIn -VDiskIn -VDiskIn -Vibrato -View -ViewRedirect -VLayoutView -Volume -VOsc -VOsc -VOsc3 -VOsc3 -Warp -Warp1 -Warp1 -Warp1 -Wavetable -WhiteNoise -WhiteNoise -WidthFirstUGen -WiiMote -WikiUsage -Window -Wrap -Wrap -wrap2 -WrapIndex -WrapIndex -Writing-Classes -Writing_Unit_Generators -XFade -XFade2 -XFade2 -XLine -XLine -XOut -ZeroCrossing -ZeroCrossing diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/sh-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/sh-mode deleted file mode 100644 index df66ae3..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/sh-mode +++ /dev/null @@ -1,182 +0,0 @@ -# Bash Family Shell Dictionary -# http://www.gnu.org/software/bash/manual/bash.html - -. -: -[ -alias -bg -bind -break -builtin -caller -cd -command -compgen -complete -compopt -continue -declare -dirs -disown -echo -enable -eval -exec -exit -export -fc -fg -getopts -hash -help -history -jobs -kill -let -local -logout -mapfile -popd -printf -pushd -pwd -read -readarray -readonly -return -set -shift -shopt -source -suspend -test -times -trap -type -typeset -ulimit -umask -unalias -unset -wait -! -[[ -]] -case -do -done -elif -else -esac -fi -for -function -if -in -select -then -time -until -while -{ -} -! -# -$ -* -- -0 -? -@ -_ -BASH -BASH_ALIASES -BASH_ARGC -BASH_ARGV -BASH_CMDS -BASH_COMMAND -BASH_ENV -BASH_EXECUTION_STRING -BASH_LINENO -BASH_REMATCH -BASH_SOURCE -BASH_SUBSHELL -BASH_VERSINFO -BASH_VERSION -BASH_XTRACEFD -BASHOPTS -BASHPID -CDPATH -COLUMNS -COMP_CWORD -COMP_KEY -COMP_LINE -COMP_POINT -COMP_TYPE -COMP_WORDBREAKS -COMP_WORDS -COMPREPLY -DIRSTACK -EMACS -EUID -FCEDIT -FIGNORE -FUNCNAME -GLOBIGNORE -GROUPS -HISTCMD -HISTCONTROL -HISTFILE -HISTFILESIZE -HISTIGNORE -HISTSIZE -HISTTIMEFORMAT -HOME -HOSTFILE -HOSTNAME -HOSTTYPE -IFS -IGNOREEOF -INPUTRC -LANG -LC_ALL -LC_COLLATE -LC_CTYPE -LC_MESSAGES -LC_MESSAGES -LC_NUMERIC -LINENO -LINES -MACHTYPE -MAIL -MAILCHECK -MAILPATH -OLDPWD -OPTARG -OPTERR -OPTIND -OSTYPE -PATH -PIPESTATUS -POSIXLY_CORRECT -PPID -PROMPT_COMMAND -PROMPT_DIRTRIM -PS1 -PS2 -PS3 -PS4 -PWD -RANDOM -REPLY -SECONDS -SHELL -SHELLOPTS -SHLVL -TEXTDOMAIN -TEXTDOMAINDIR -TIMEFORMAT -TMOUT -TMPDIR -UID diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/tcl-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/tcl-mode deleted file mode 100644 index 07a1281..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/tcl-mode +++ /dev/null @@ -1,172 +0,0 @@ -after -append -apply -array -auto_execok -auto_import -auto_load -auto_load_index -auto_mkindex -auto_mkindex_old -auto_qualify -auto_reset -bell -binary -bind -bindtags -break -button -canvas -case -catch -cd -chan -checkbutton -clipboard -clock -close -concat -continue -destroy -dict -encoding -entry -eof -error -eval -event -exec -exit -expr -fblocked -fconfigure -fcopy -file -fileevent -flush -focus -font -for -foreach -format -frame -gets -glob -global -grab -grid -if -image -incr -info -interp -join -label -labelframe -lappend -lassign -lindex -linsert -list -listbox -llength -load -lower -lrange -lrepeat -lreplace -lreverse -lsearch -lset -lsort -menu -menubutton -message -namespace -open -option -pack -package -panedwindow -pid -pkg_mkIndex -place -proc -puts -pwd -radiobutton -raise -read -regexp -registry -regsub -rename -return -scale -scan -scrollbar -seek -selection -set -socket -source -spinbox -split -string -subst -switch -tclLog -tclPkgSetup -tclPkgUnknown -tcl_findLibrary -tell -text -time -tk -tk_chooseColor -tk_chooseDirectory -tk_getOpenFile -tk_getSaveFile -tk_menuSetFocus -tk_messageBox -tk_popup -tk_textCopy -tk_textCut -tk_textPaste -tkwait -toplevel -ttk::button -ttk::checkbutton -ttk::combobox -ttk::entry -ttk::focusFirst -ttk::frame -ttk::label -ttk::labelframe -ttk::menubutton -ttk::notebook -ttk::paned -ttk::panedwindow -ttk::progressbar -ttk::radiobutton -ttk::scale -ttk::scrollbar -ttk::separator -ttk::setTheme -ttk::sizegrip -ttk::style -ttk::takefocus -ttk::themes -ttk::treeview -trace -unknown -unload -unset -update -uplevel -upvar -variable -vwait -while -winfo -wm diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/ts-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/ts-mode deleted file mode 100644 index ffe377f..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/ts-mode +++ /dev/null @@ -1,797 +0,0 @@ -absRefPrefix -accessibility -accessibilityWrap -accessKey -ACT -ACTIFSUB -ACTIVSUBRO -ACTRO -addAttributes -addExtUrlsAndShortCuts -additionalHeaders -additionalParams -addParams -addQueryString -addQueryString -adjustItemsH -adjustSubItemsH -adminPanelStyles -after -age -align -align.field -all -allowedAttribs -allowedGroups -allowEdit -allowNew -allowTags -allStdWrap -allWrap -alternativeSortingField -alternativeTempPath -altImgResource -altTarget -altText -alwaysActivePIDlist -alwaysLink -andWhere -angle -antiAlias -append -applyTotalH -applyTotalW -arrayReturnMode -arrowACT -arrowImgParams -arrowNO -ATagBeforeWrap -ATagParams -ATagTitle -atLeast -atMost -authcodeFields -autoInsertPID -autostart -backColor -badMess -base64 -baseURL -beforeImg -beforeImgLink -beforeImgTagParams -beforeROImg -beforeWrap -begin -begin -beginAtLevel -beLoginLinkIPList -beLoginLinkIPList_login -beLoginLinkIPList_logout -beUserLogin -bgImg -blankStrEqFalse -blur -bm -bodyTag -bodyTag -bodyTagAdd -bodyTagCObject -bodyTagMargins -border -border -borderCol -bordersWithin -borderThick -bottomContent -bottomHeight -br -breakSpace -breakWidth -brTag -bytes -c -cache_clearAtMidnight -cached -cache_period -caption -captionAlign -captionSplit -case -case -CASE -casesensitiveComp -cellpadding -cellspacing -char -charcoal -clearCacheOfPages -cMargins -COA -COA_INT -cObject -cObjNum -code -collapse -color -color1 -color2 -color3 -color.default -color.field -colRelations -cols -cols -colSpace -COLUMNS -COMMENT -commentWrap -compensateFieldWidth -compX -compY -concatenateJsAndCss -conf -config -config -CONFIG -constants -CONTENT -content_fallback -content_from_pid_allowOutsideDomain -controllerActionName -controllerExtensionName -controllerName -crop -cropHTML -csConv -cssInline -CSS_inlineStyle -CTABLE -CUR -CURIFSUB -CURIFSUBRO -current -CURRO -cWidth -data -dataArray -dataWrap -date -debug -debugData -debugFunc -debugItemConf -debugRenumberedObject -decimals -dec_point -default -defaultAlign -defaultCmd -defaultCode -defaultGetVars -delete -denyTags -depth -dimensions -directImageLink -directionLeft -directionUp -directReturn -disableAllHeaderCode -disableAltText -disableCharsetHeader -disableImgBorderAttr -disablePageExternalUrl -disablePrefixComment -disablePreviewNotification -displayActiveOnLoad -displayActiveOnLoad -displayrecord -distributeX -distributeY -doctype -doctypeSwitch -doNotLinkIt -doNotShowLink -doNotStripHTML -dontCheckPid -dontFollowMouse -dontHideOnMouseUp -dontLinkIfSubmenu -dontMd5FieldNames -dontWrapInTable -doubleBrTag -doublePostCheck -dWorkArea -edge -edit -editIcons -editIcons -editPanel -EDITPANEL -EDITPANEL -effects -email -emailMess -emboss -emptyTitleHandling -emptyTitleHandling -emptyTitleHandling -enable -enableContentLengthHeader -encapsLines -encapsLinesStdWrap -encapsTagList -entryLevel -equalH -equals -evalErrors -evalFunc -excludeDoktypes -excludeNoSearchPages -excludeUidList -expAll -explode -ext -extbase -externalBlocks -extOnReady -extTarget -face.default -face.field -FEData -fe_userEditSelf -fe_userOwnSelf -field -fieldPrefix -fieldRequired -fieldWrap -file -FILE -filelink -fileList -fileTarget -firstLabel -firstLabelGeneral -flip -flop -foldSpeed -foldTimer -fontFile -fontSize -fontSizeMultiplicator -fontTag -footerData -forceAbsoluteUrl -forceTypeValue -FORM -format -formName -formurl -frame -frameReloadIfNotInFrameset -frameSet -freezeMouseover -ftu -gamma -gapBgCol -gapLineCol -gapLineThickness -gapWidth -gif -GIFBUILDER -globalNesting -GMENU -goodMess -gray -gr_list -groupBy -headerComment -headerData -headTag -height -hiddenFields -hide -hideButCreateMap -hideMenuTimer -hideMenuWhenNotOver -hideNonTranslated -highColor -HMENU -hover -hoverStyle -HRULER -HTML -html5 -htmlmail -HTMLparser -htmlSpecialChars -htmlTag_dir -htmlTag_langKey -htmlTag_setParams -http -icon -iconCObject -icon_image_ext_list -icon_link -icon_thumbSize -if -ifBlank -ifEmpty -IFSUB -IFSUBRO -ignore -IMAGE -image_compression -image_effects -image_frames -imgList -imgMap -imgMapExtras -imgMax -imgNameNotRandom -imgNamePrefix -imgObjNum -imgParams -imgPath -imgStart -IMGTEXT -import -inBranch -includeCSS -includeJS -includeJSFooter -includeJSFooterlibs -includeJSlibs -includeLibrary -includeLibs -includeNotInMenu -incT3Lib_htmlmail -index_descrLgd -index_enable -index_externals -index_metatags -infomail -inlineJS -inlineLanguageLabel -inlineSettings -inlineStyle2TempFile -innerStdWrap_all -innerWrap -innerWrap2 -inputLevels -insertClassesFromRTE -insertData -intensity -intTarget -intval -invert -IProcFunc -isFalse -isGreaterThan -isInList -isLessThan -isPositive -isTrue -itemArrayProcFunc -items -iterations -javascriptLibs -join -jpg -jsFooterInline -jsInline -JSMENU -JSwindow -JSwindow.altUrl -JSwindow.altUrl_noDefaultParams -JSwindow.expand -JSwindow.newWindow -JSwindow_params -jumpurl -jumpurl_enable -jumpurl_mailto_disable -keep -keepNonMatchedTags -keywords -keywordsField -labelStdWrap -labelWrap -lang -language -language_alt -languageField -layer_menu_id -layerStyle -layout -layoutRootPath -leftjoin -leftOffset -levels -limit -lineColor -lineThickness -linkAccessRestrictedPages -linkParams -linkVars -linkWrap -list -listNum -lm -LOAD_REGISTER -locale_all -localNesting -locationData -lockFilePath -lockPosition -lockPosition_addSelf -lockPosition_adjust -loginUser -longdescURL -loop -lowColor -lower -mailto -main -mainScript -makelinks -markers -markerWrap -mask -max -maxAge -maxH -maxHeight -maxItems -maxW -maxWidth -maxWInText -m.bgImg -m.bottomImg -m.bottomImg_mask -md5 -meaningfulTempFilePrefix -menuBackColor -menuHeight -menuOffset -menuWidth -message_page_is_being_generated -message_preview -message_preview_workspace -meta -metaCharset -method -minH -minifyCSS -minifyJS -minItems -minItems -minW -m.mask -moveJsFromHeaderToFooter -MP_defaults -MP_disableTypolinkClosestMPvalue -MP_mapRootPoints -MULTIMEDIA -name -namespaces -negate -newRecordFromTable -newRecordInPid -next -niceText -NO -noAttrib -noBlur -no_cache -noCols -noLink -noLinkUnderline -nonCachedSubst -none -nonTypoTagStdWrap -nonTypoTagUserFunc -nonWrappedTag -noOrderBy -noPageTitle -noResultObj -normalWhenNoLanguage -noRows -noScale -noScaleUp -noscript -noStretchAndMarginCells -notification_email_charset -notification_email_encoding -notification_email_urlmode -noTrimWrap -noValueInsert -noWrapAttr -numberFormat -numRows -obj -offset -offset -_offset -offsetWrap -onlyCurrentPid -opacity -options -orderBy -OTABLE -outerWrap -outline -output -outputLevels -override -overrideAttribs -overrideEdit -overrideId -PAGE -pageGenScript -pageRendererTemplateFile -pageTitleFirst -parameter -params -parseFunc -parseFunc -parseValues -partialRootPath -path -pidInList -pixelSpaceFontSizeRef -plainTextStdWrap -pluginNames -png -postCObject -postUserFunc -postUserFunkInt -preCObject -prefixComment -prefixLocalAnchors -prefixLocalAnchors -prefixRelPathWith -preIfEmptyListNum -prepend -preUserFunc -prev -previewBorder -printBeforeContent -prioriCalc -processScript -properties -protect -protectLvar -quality -quality -radioInputWrap -radioWrap -range -range -rawUrlEncode -recipient -RECORDS -recursive -redirect -reduceColors -relativeToParentLayer -relativeToTriggerItem -relPathPrefix -remap -remapTag -removeBadHTML -removeDefaultJS -removeIfEquals -removeIfFalse -removeObjectsOfDummy -removePrependedNumbers -removeTags -removeWrapping -renderCharset -renderObj -renderWrap -REQ -required -required -resources -resultObj -returnKey -returnLast -reverseOrder -rightjoin -rm -rmTagIfNoAttrib -RO_chBgColor -rootline -rotate -rows -rowSpace -sample -sample -section -sectionIndex -select -sendCacheHeaders -sendCacheHeaders_onlyWhenLoginDeniedInBranch -separator -setContentToCurrent -setCurrent -setfixed -setFixedHeight -setFixedWidth -setJS_mouseOver -setJS_openPic -setKeywords -shadow -sharpen -shear -short -shortcutIcon -showAccessRestrictedPages -showActive -showFirst -simulateStaticDocuments -simulateStaticDocuments_addTitle -simulateStaticDocuments_dontRedirectPathInfoError -simulateStaticDocuments_noTypeIfNoTitle -simulateStaticDocuments_pEnc -simulateStaticDocuments_pEnc_onlyP -simulateStaticDocuments_replacementChar -sitetitle -size -size.default -size.field -slide -smallFormFields -solarize -source -space -spaceAfter -spaceBefore -spaceBelowAbove -spaceLeft -spaceRight -spacing -spamProtectEmailAddresses -spamProtectEmailAddresses_atSubst -spamProtectEmailAddresses_lastDotSubst -SPC -special -split -splitRendering -src -stat -stat_apache -stat_apache_logfile -stat_apache_niceTitle -stat_apache_noHost -stat_apache_noRoot -stat_apache_notExtended -stat_apache_pagenames -stat_excludeBEuserHits -stat_excludeIPList -stat_mysql -stat_pageLen -stat_titleLen -stat_typeNumList -stayFolded -stdWrap -stdWrap2 -strftime -stripHtml -stripProfile -stylesheet -submenuObjSuffixes -subMenuOffset -subparts -subst_elementUid -subst_elementUid -substMarksSeparately -substring -swirl -sword -sword_noMixedCase -sword_standAlone -sys_language_mode -sys_language_overlay -sys_language_softExclude -sys_language_softMergeIfNotBlank -sys_language_uid -sys_page -table -tableParams -tables -tableStdWrap -tableStyle -tags -target -TCAselectItem -TDparams -template -TEMPLATE -templateFile -text -TEXT -textMargin -textMargin_outOfText -textMaxLength -textObjNum -textPos -textStyle -thickness -thousands_sep -title -titleTagFunction -titleText -titleText -tm -TMENU -token -topOffset -totalWidth -transparentBackground -transparentColor -trim -twice -typeNum -types -typolink -typolinkCheckRootline -typolinkEnableLinksAcrossDomains -typolinkLinkAccessRestrictedPages -typolinkLinkAccessRestrictedPages_addParams -uid -uidInList -uniqueGlobal -uniqueLinkVars -uniqueLocal -unset -unsetEmpty -upper -url -useCacheHash -useLargestItemX -useLargestItemY -USER -USERDEF1 -USERDEF1RO -USERDEF2RO -USERFEF2 -userFunc -userFunc_updateArray -userIdColumn -USER_INT -USERNAME_substToken -USERUID_substToken -USR -USRRO -value -variables -wave -where -width -wordSpacing -workArea -workOnSubpart -wrap -wrap2 -wrap3 -wrapAlign -wrapFieldName -wrapItemAndSub -wrapNoWrappedLines -wraps -xhtml_11 -xhtml_2 -xhtml_basic -xhtml_cleaning -xhtmlDoctype -xhtml_frames -xhtml+rdfa_10 -xhtml_strict -xhtml_trans -xml_10 -xml_11 -xmlprologue -xPosOffset -yPosOffset diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/tuareg-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/tuareg-mode deleted file mode 100644 index e709f9f..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/tuareg-mode +++ /dev/null @@ -1,231 +0,0 @@ -# OCaml 3.12.1 - -# Keywords -and -as -assert -begin -class -constraint -do -done -downto -else -end -exception -external -false -for -fun -function -functor -if -in -include -inherit -initializer -lazy -let -match -method -module -mutable -new -object -of -open -or -private -rec -sig -struct -then -to -true -try -type -val -virtual -when -while -with - -# Pervasives -! -!= -& -&& -* -** -*. -+ -+. -- --. -/ -/. -:= -< -<= -<> -= -== -> ->= -@ -FP_infinite -FP_nan -FP_normal -FP_subnormal -FP_zero -LargeFile -Open_append -Open_binary -Open_creat -Open_nonblock -Open_rdonly -Open_text -Open_trunc -Open_wronly -Oupen_excl -^ -^^ -abs -abs_float -acos -asin -asr -at_exit -atan -atan2 -bool_of_string -ceil -char_of_int -classify_float -close_in -close_in_noerr -close_out -close_out_noerr -compare -cos -cosh -decr -do_at_exit -epsilon_float -exit -exp -expm1 -failwith -float -float_of_int -float_of_string -floor -flush -flush_all -format -format4 -format_of_string -fpclass -frexp -fst -ignore -in_channel -in_channel_length -incr -infinity -input -input_binary_int -input_byte -input_char -input_line -input_value -int_of_char -int_of_float -int_of_string -invalid_arg -land -ldexp -lnot -log -log10 -log1p -lor -lsl -lsr -lxor -max -max_float -max_int -min -min_float -min_int -mod -mod_float -modf -nan -neg_infinity -not -open_flag -open_in -open_in_bin -open_in_gen -open_out -open_out_bin -open_out_gen -or -out_channel -out_channel_length -output -output_binary_int -output_byte -output_char -output_string -output_value -pos_in -pos_out -pred -prerr_char -prerr_endline -prerr_float -prerr_int -prerr_newline -prerr_string -print_char -print_endline -print_float -print_int -print_newline -print_string -raise -read_float -read_int -read_line -really_input -ref -seek_in -seek_out -set_binary_mode_in -set_binary_mode_out -sin -sinh -snd -sqrt -stderr -stdin -stdout -string_of_bool -string_of_float -string_of_format -string_of_int -succ -tan -tanh -truncate -unsafe_really_input -valid_float_lexem -|| -~ -~+ -~+. -~- -~-. diff --git a/emacs.d/elpa/auto-complete-20160107.8/dict/verilog-mode b/emacs.d/elpa/auto-complete-20160107.8/dict/verilog-mode deleted file mode 100644 index acc2f32..0000000 --- a/emacs.d/elpa/auto-complete-20160107.8/dict/verilog-mode +++ /dev/null @@ -1,313 +0,0 @@ -`define -`else -`endif -`ifdef -`ifndef -`macromodule -`module -`primitive -`timescale -above -abs -absdelay -ac_stim -acos -acosh -alias -aliasparam -always -always_comb -always_ff -always_latch -analog -analysis -and -asin -asinh -assert -assign -assume -atan -atan2 -atanh -automatic -before -begin -bind -bins -binsof -bit -branch -break -buf -bufif0 -bufif1 -byte -case -casex -casez -cell -chandle -class -clocking -cmos -config -connectmodule -connectrules -const -constraint -context -continue -cos -cosh -cover -covergroup -coverpoint -cross -ddt -ddx -deassign -default -define -defparam -design -disable -discipline -dist -do -driver_update -edge -else -end -endcase -endclass -endclocking -endconfig -endconnectrules -enddiscipline -endfunction -endgenerate -endgroup -endif -endinterface -endmodule -endnature -endpackage -endparamset -endprimitive -endprogram -endproperty -endsequence -endspecify -endtable -endtask -enum -event -exclude -exp -expect -export -extends -extern -final -final_step -first_match -flicker_noise -floor -flow -for -force -foreach -forever -fork -forkjoin -from -function -generate -genvar -ground -highz0 -highz1 -hypot -idt -idtmod -if -ifdef -iff -ifndef -ifnone -ignore_bins -illegal_bins -import -incdir -include -inf -initial -initial_step -inout -input -inside -instance -int -integer -interface -intersect -join -join_any -join_none -laplace_nd -laplace_np -laplace_zd -laplace_zp -large -last_crossing -liblist -library -limexp -ln -local -localparam -log -logic -longint -macromodule -mailbox -matches -max -medium -min -modport -module -nand -nand -nature -negedge -net_resolution -new -nmos -nmos -noise_table -nor -noshowcancelled -not -notif0 -notif1 -null -or -output -package -packed -parameter -paramset -pmos -pmos -posedge -potential -pow -primitive -priority -program -property -protected -pull0 -pull1 -pullup -pulsestyle_ondetect -pulsestyle_onevent -pure -rand -randc -randcase -randcase -randsequence -rcmos -real -realtime -ref -reg -release -repeat -return -rnmos -rpmos -rtran -rtranif0 -rtranif1 -scalared -semaphore -sequence -shortint -shortreal -showcancelled -signed -sin -sinh -slew -small -solve -specify -specparam -sqrt -static -string -strong0 -strong1 -struct -super -supply -supply0 -supply1 -table -tagged -tan -tanh -task -then -this -throughout -time -timeprecision -timer -timescale -timeunit -tran -tran -tranif0 -tranif1 -transition -tri -tri -tri0 -tri1 -triand -trior -trireg -type -typedef -union -unique -unsigned -use -uwire -var -vectored -virtual -void -wait -wait_order -wand -weak0 -weak1 -while -white_noise -wildcard -wire -with -within -wor -wreal -xnor -xor -zi_nd -zi_np -zi_zd diff --git a/emacs.d/elpa/centered-cursor-mode-20151001.634/centered-cursor-mode-autoloads.el b/emacs.d/elpa/centered-cursor-mode-20151001.634/centered-cursor-mode-autoloads.el deleted file mode 100644 index 79e2254..0000000 --- a/emacs.d/elpa/centered-cursor-mode-20151001.634/centered-cursor-mode-autoloads.el +++ /dev/null @@ -1,23 +0,0 @@ -;;; centered-cursor-mode-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) - -;;;### (autoloads nil "centered-cursor-mode" "centered-cursor-mode.el" -;;;;;; (22171 46582 0 0)) -;;; Generated autoloads from centered-cursor-mode.el - -(autoload 'centered-cursor-mode "centered-cursor-mode" "\ -Makes the cursor stay vertically in a defined -position (usually centered). - -\(fn &optional ARG)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; centered-cursor-mode-autoloads.el ends here diff --git a/emacs.d/elpa/centered-cursor-mode-20151001.634/centered-cursor-mode-pkg.el b/emacs.d/elpa/centered-cursor-mode-20151001.634/centered-cursor-mode-pkg.el deleted file mode 100644 index b899942..0000000 --- a/emacs.d/elpa/centered-cursor-mode-20151001.634/centered-cursor-mode-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "centered-cursor-mode" "20151001.634" "cursor stays vertically centered" 'nil :url "http://www.emacswiki.org/cgi-bin/wiki/centered-cursor-mode.el" :keywords '("convenience")) diff --git a/emacs.d/elpa/centered-cursor-mode-20151001.634/centered-cursor-mode.el b/emacs.d/elpa/centered-cursor-mode-20151001.634/centered-cursor-mode.el deleted file mode 100644 index 1e2f615..0000000 --- a/emacs.d/elpa/centered-cursor-mode-20151001.634/centered-cursor-mode.el +++ /dev/null @@ -1,436 +0,0 @@ -;;; centered-cursor-mode.el --- cursor stays vertically centered - -;; Copyright (C) 2007 André Riemann - -;; Author: André Riemann -;; Maintainer: André Riemann -;; Created: 2007-09-14 -;; Keywords: convenience -;; Package-Version: 20151001.634 -;; Package-X-Original-Version: 20150302.831 - -;; URL: http://www.emacswiki.org/cgi-bin/wiki/centered-cursor-mode.el -;; Compatibility: tested with GNU Emacs 23.0, 24 -;; Version: 0.5.4 -;; Last-Updated: 2015-10-01 - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the Free -;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. - -;;; Commentary: - -;; Makes the cursor stay vertically in a defined position (usually -;; centered). The vertical position can be altered, see key definition -;; below. - -;; To load put that in .emacs: -;; (require 'centered-cursor-mode) -;; To activate do: -;; M-x centered-cursor-mode -;; for buffer local or -;; M-x global-centered-cursor-mode -;; for global minor mode. -;; Also possible: put that in .emacs -;; (and -;; (require 'centered-cursor-mode) -;; (global-centered-cursor-mode +1)) -;; to always have centered-cursor-mode on in all buffers. - -;;; TODO: -;; - the code is a mess -;; - ccm-vpos-inverted doesn't work with ccm-vpos == 0, because first -;; position from top is 0 and from bottom -1 -;; - interactive first start isn't animated when calling global-... -;; because it starts the modes for each buffer and interactive-p fails -;; for that -;; - more bugs? - -;;; Change Log: -;; 2015-10-01 Hinrik Örn Sigurðsson -;; * Avoided calling count-lines when unnecessary, which -;; fixes slow scrolling in large files -;; 2015-03-01 andre-r -;; * fixed bug where Emacs without X support (emacs-nox) didn't find mouse-wheel-mode -;; 2009-08-31 andre-r -;; * replaced window-body-height with window-text-height -;; (partially visible lines are not counted in window-text-height) -;; * bug fixed in ccm-vpos-recenter -;; (some parentheses where wrong after the last update) -;; 2009-02-23 andre-r -;; * some simplifications -;; 2009-02-22 andre-r -;; * some tips from Drew Adams: -;; - new local variable coding:utf-8 -;; - made recenter-sequence a defvar -;; - added groups scrolling and convenience -;; - replaced mouse-4 and mouse-5 with -;; mouse-wheel-up-event and mouse-wheel-down-event -;; - added scroll-bar-toolkit-scroll to ccm-ignored-commands -;; - made ccm-ignored-commands customisable -;; * removed a bug where it didn't work with more than one window -;; displaying the same buffer -;; * added function for page up and down scrolling -;; (standard ones didn't work well with this mode) -;; * made the animation delay customisable -;; * made the initial vertical position customisable -;; * made the behaviour at the end of the file customisable -;; 2008-02-02 andre-r -;; * fixed bug that led to wrong-type-argument -;; when opening a new buffer -;; * some other minor stuff -;; 2007-09-24 andre-r -;; * added global minor mode -;; 2007-09-21 andre-r -;; * not recentering at end of buffer -;; * defvar animate-first-start-p -;; 2007-09-14 andre-r -;; * inital release - -;; This file is *NOT* part of GNU Emacs. - -;;; Code: - - -(require 'mouse-wheel-mode nil 'noerror) - -(defgroup centered-cursor nil - "Makes the cursor stay vertically in a defined position (usually centered). -Instead the cursor the text moves around the cursor." - :group 'scrolling - :group 'convenience - :link '(emacs-library-link :tag "Source Lisp File" "centered-cursor-mode.el") - :link '(url-link "http://www.emacswiki.org/cgi-bin/wiki/centered-cursor-mode.el")) - -(defcustom ccm-step-size 2 - "Step size when animated recentering." - :group 'centered-cursor - :tag "Animation step size" - :type 'integer) - -(defcustom ccm-step-delay 0.02 - "Delay between animation steps. -If you want a different animation speed." - :group 'centered-cursor - :tag "Animation step delay" - :type 'number) - -(defcustom ccm-ignored-commands '(mouse-drag-region - mouse-set-point - widget-button-click - scroll-bar-toolkit-scroll) - "After these commands recentering is ignored. -This is to prevent unintentional jumping (especially when mouse -clicking). Following commands (except the ignored ones) will -cause an animated recentering to give a feedback and not just -jumping to the center." - :group 'centered-cursor - :tag "Ignored commands" - :type '(repeat (symbol :tag "Command"))) - -(defcustom ccm-vpos-init '(round (window-text-height) 2) - "This is the screen line position where the cursor initially stays." - :group 'centered-cursor - :tag "Vertical cursor position" - :type '(choice (const :tag "Center" (round (window-text-height) 2)) - (const :tag "Golden ratio" (round (* 21 (window-text-height)) 34)) - (integer :tag "Lines from top" :value 10))) -(make-variable-buffer-local 'ccm-vpos-init) - -(defcustom ccm-vpos-inverted 1 - "Inverted vertical cursor position. -Defines if the initial vertical position `ccm-vpos-init' is -measured from the bottom instead from the top." - :group 'centered-cursor - :tag "Inverted cursor position" - :type '(choice (const :tag "Inverted" -1) - (const :tag "Not inverted" 1))) -(make-variable-buffer-local 'ccm-vpos-inverted) - -(defcustom ccm-recenter-at-end-of-file nil - "Recenter at the end of the file. -If non-nil the end of the file is recentered. If nil the end of -the file stays at the end of the window." - :group 'centered-cursor - :tag "Recenter at EOF" - :type '(choice (const :tag "Don't recenter at the end of the file" nil) - (const :tag "Recenter at the end of the file" t))) -(make-variable-buffer-local 'ccm-recenter-end-of-file) - -(defvar ccm-vpos nil - "This is the screen line position where the cursor stays.") -(make-variable-buffer-local 'ccm-vpos) - -(defvar animate-first-start-p nil - "Whether or not to animate at first start. It is set to nil, if -centered-cursor-mode is called non-interactively.") -(make-variable-buffer-local 'animate-first-start-p) - -(defvar recenter-sequence nil - "Before animated recentering a list is generated first with positions -to successively recenter to") -(make-variable-buffer-local 'recenter-sequence) - -(defvar ccm-map - (let ((ccm-map (make-sparse-keymap))) - (define-key ccm-map [(control meta -)] 'ccm-vpos-up) - (define-key ccm-map [(control meta +)] 'ccm-vpos-down) - (define-key ccm-map [(control meta =)] 'ccm-vpos-down) - (define-key ccm-map [(control meta ?0)] 'ccm-vpos-recenter) - (when (and (boundp 'mouse-wheel-mode) mouse-wheel-mode) - (mapc (lambda (key) - (define-key ccm-map key 'ccm-mwheel-scroll)) - (list (vector mouse-wheel-up-event) - (vector mouse-wheel-down-event) - (vector (list 'control mouse-wheel-up-event)) - (vector (list 'control mouse-wheel-down-event)) - (vector (list 'shift mouse-wheel-up-event)) - (vector (list 'shift mouse-wheel-down-event))))) - (define-key ccm-map [(meta v)] 'ccm-scroll-down) - (define-key ccm-map [(control v)] 'ccm-scroll-up) - (define-key ccm-map [prior] 'ccm-scroll-down) - (define-key ccm-map [next] 'ccm-scroll-up) - ccm-map) - "Keymap used in centered-cursor-mode.") - - -(defun ccm-mwheel-scroll (event) - "Very similar to `mwheel-scroll', but does not use `scroll-down' -and `scroll-up' but `previous-line' and `next-line', that is, the -cursor is moved and thus the text in the window is scrolled -due to `recenter'. - -The customizable variable `mouse-wheel-scroll-amount' is used to -determine how much to scroll, where nil instead of a number means -the same as in mwheel-scroll, scroll by a near full screen. - -This command exists, because mwheel-scroll caused strange -behaviour with automatic recentering." -;; (interactive (list last-input-event)) - (interactive "e") - (let* ((mods (delq 'click (delq 'double (delq 'triple (event-modifiers event))))) - (amt (assoc mods mouse-wheel-scroll-amount))) - ;;(message "%S" mods) - (if amt - (setq amt (or (cdr amt) - (- (window-text-height) - next-screen-context-lines))) - (let ((list-elt mouse-wheel-scroll-amount)) - (while (consp (setq amt (pop list-elt)))))) - (if mouse-wheel-follow-mouse - (select-window (posn-window (event-start event)))) - (let ((button (mwheel-event-button event))) - (cond - ((eq button mouse-wheel-down-event) - (forward-line (- amt))) - ;;(princ amt)) - ((eq button mouse-wheel-up-event) - (forward-line amt)) - ;;(princ amt)) - (t (error "Bad binding in ccm-mwheel-scroll")))))) - -(defun ccm-scroll-down (&optional arg) - "Replaces `scroll-down' because with scroll-down -`centered-cursor-mode' sometimes doesn't reach the top of the -buffer. This version actually moves the cursor with -`previous-line'. Since with centered-cursor-mode the cursor is in -a fixed position the movement appears as page up." - (interactive "P") - (let ((amt (or arg (- (window-text-height) - next-screen-context-lines)))) - (forward-line (- amt)))) - -(defun ccm-scroll-up (&optional arg) - "Replaces `scroll-up' to be consistent with `ccm-scroll-down'. -This version actually moves the cursor with `previous-line'. -Since with centered-cursor-mode the cursor is in a fixed position -the movement appears as page up." - (interactive "P") - (let ((amt (or arg (- (window-text-height) - next-screen-context-lines)))) - (forward-line amt))) - - -(defun ccm-vpos-down (arg) - "Adjust the value of the screen line (where the cursor stays) by arg. -Negative values for arg are possible. Just the variable ccm-vpos -is set." - (interactive "p") - (or arg (setq arg 1)) - (let ((new-pos (if (< ccm-vpos 0) - (- ccm-vpos arg) - (+ ccm-vpos arg))) - ;; see pos-visible-in-window-p - (vpos-max (if (< ccm-vpos 0) - -1 - (- (window-text-height) 1))) - (vpos-min (if (< ccm-vpos 0) - (- (window-text-height)) - 0))) - (setq ccm-vpos - (cond - ((< new-pos vpos-min) - vpos-min) - ((> new-pos vpos-max) - vpos-max) - (t - new-pos))))) - -(defun ccm-vpos-up (arg) - "See `ccm-vpos-down'." - (interactive "p") - (or arg (setq arg 1)) - (ccm-vpos-down (- arg))) - -(defun ccm-vpos-recenter () - "Set the value of the screen line (where the cursor stays) in -the center. Just the variable ccm-vpos is set." - (interactive) - (if (equal (current-buffer) - (window-buffer (selected-window))) - (setq ccm-vpos (* (eval ccm-vpos-init) - ccm-vpos-inverted)))) - -(defun ccm-position-cursor () - "Do the actual recentering at the position `ccm-vpos'." - (unless (member this-command ccm-ignored-commands) - (unless ccm-vpos - (ccm-vpos-recenter)) - (unless (minibufferp (current-buffer)) - (if (equal (current-buffer) - (window-buffer (selected-window))) - (let* ((current-line - (if (< ccm-vpos 0) - ;; one-based, from bottom, negative - (- (count-lines (point) - ;; window-end is sometimes < 0 - ;; when opening a help buffer - (if (> (window-end) 0) - (window-end) - 1))) - ;; zero-based, from top, positive - (+ (count-lines (window-start) (point)) - ;; count-lines returns different value in column 0 - (if (= (current-column) 0) 0 -1)))) - (diff (- ccm-vpos current-line)) - (step-size ccm-step-size) - (step-delay ccm-step-delay) - (vpos-inverted ccm-vpos-inverted) - (recenter-at-end-of-file ccm-recenter-at-end-of-file)) - - (let* ((bottom-vpos (if (< ccm-vpos 0) - (- ccm-vpos) - (- (window-text-height) ccm-vpos))) - (correction (save-excursion - (if (or (= (point) (point-max)) - (progn - (goto-char (point-max)) - (zerop (current-column)))) - 1 0))) - (window-is-at-bottom (= (window-end) (point-max))) - ;; lines from point to end of buffer - (bottom-lines (if window-is-at-bottom - (+ (count-lines (point) (point-max)) - correction)))) - - ;; only animate if the point was moved rather far away - ;; before by a mouseclick (see ccm-ignored-commands) - ;; or if minor mode is just entered interactively - (if (not (and (> (abs diff) 4) - (or (member last-command ccm-ignored-commands) - animate-first-start-p))) - - (recenter (if (and window-is-at-bottom - (< bottom-lines bottom-vpos) - (not recenter-at-end-of-file)) - ;; if near the bottom, recenter in the - ;; negative screen line that equals the - ;; bottom buffer line, i.e. if we are in - ;; the second last line (-2) of the - ;; buffer, the cursor will be recentered - ;; in -2 - (- bottom-lines) - ccm-vpos)) - - (setq animate-first-start-p nil) - ;; first build a list with positions to successively recenter to - (setq recenter-sequence - ;; reverse: because we build the list not FROM -> TO but - ;; TO -> FROM because if step size in number-sequence is - ;; bigger than one, TO might not included, that means the - ;; ccm-vpos would not be reached - ;; cdr: don't recenter the current-line - (if (and window-is-at-bottom - (< bottom-lines bottom-vpos) - (not recenter-at-end-of-file)) - ;; this one is for animation near the bottom - (cdr (reverse (number-sequence - (- bottom-lines) - (if (< ccm-vpos 0) - current-line - (- (- (window-text-height) current-line))) - (* (/ diff (abs diff)) (- step-size))))) - (cdr (reverse (number-sequence - ccm-vpos - current-line - (* (/ diff (abs diff)) (- step-size))))))) - ;; (message "%d %d %d (%d): %S" current-line ccm-vpos bottom-lines diff recenter-sequence) - (while recenter-sequence - ;; actual animation - (recenter (pop recenter-sequence)) - (if (car recenter-sequence) (sit-for step-delay t)))))))))) - -(defun ccm-first-start (animate) - "Called from centered-cursor-mode. Animate at first start, if -centered-cursor-mode is called interactively." - (let ((animate-first-start-p animate)) - (ccm-vpos-recenter) - (ccm-position-cursor))) - -;;(defalias 'ccm 'centered-cursor-mode) -;;;###autoload -(define-minor-mode centered-cursor-mode - "Makes the cursor stay vertically in a defined -position (usually centered)." - :init-value nil -;; :lighter nil - :lighter " ¢" - :keymap ccm-map - (cond - (centered-cursor-mode - (ccm-first-start (interactive-p)) - (add-hook 'post-command-hook 'ccm-position-cursor t t) - (add-hook 'window-configuration-change-hook 'ccm-vpos-recenter t t)) - (t - (remove-hook 'post-command-hook 'ccm-position-cursor t) - (remove-hook 'window-configuration-change-hook 'ccm-vpos-recenter t)))) - - -(define-global-minor-mode global-centered-cursor-mode centered-cursor-mode - centered-cursor-mode) - -(provide 'centered-cursor-mode) - -;;; Help: -;; (info "(elisp)Defining Minor Modes") -;; (info "(elisp)Screen Lines") -;; (info "(elisp)Hooks") -;; (info "(elisp)Customization") -;; (find-function 'mwheel-scroll) - -;; Local Variables: -;; coding: utf-8 -;; End: - -;;; centered-cursor-mode.el ends here diff --git a/emacs.d/elpa/company-20160211.520/company-abbrev.el b/emacs.d/elpa/company-20160211.520/company-abbrev.el deleted file mode 100644 index 24ec3b7..0000000 --- a/emacs.d/elpa/company-20160211.520/company-abbrev.el +++ /dev/null @@ -1,50 +0,0 @@ -;;; company-abbrev.el --- company-mode completion backend for abbrev - -;; Copyright (C) 2009-2011, 2015 Free Software Foundation, Inc. - -;; Author: Nikolaj Schumacher - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - - -;;; Commentary: -;; - -;;; Code: - -(require 'company) -(require 'cl-lib) -(require 'abbrev) - -(defun company-abbrev-insert (match) - "Replace MATCH with the expanded abbrev." - (expand-abbrev)) - -;;;###autoload -(defun company-abbrev (command &optional arg &rest ignored) - "`company-mode' completion backend for abbrev." - (interactive (list 'interactive)) - (cl-case command - (interactive (company-begin-backend 'company-abbrev - 'company-abbrev-insert)) - (prefix (company-grab-symbol)) - (candidates (nconc - (delete "" (all-completions arg global-abbrev-table)) - (delete "" (all-completions arg local-abbrev-table)))) - (meta (abbrev-expansion arg)))) - -(provide 'company-abbrev) -;;; company-abbrev.el ends here diff --git a/emacs.d/elpa/company-20160211.520/company-autoloads.el b/emacs.d/elpa/company-20160211.520/company-autoloads.el deleted file mode 100644 index 358bb88..0000000 --- a/emacs.d/elpa/company-20160211.520/company-autoloads.el +++ /dev/null @@ -1,284 +0,0 @@ -;;; company-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) - -;;;### (autoloads nil "company" "company.el" (22223 33912 0 0)) -;;; Generated autoloads from company.el - -(autoload 'company-mode "company" "\ -\"complete anything\"; is an in-buffer completion framework. -Completion starts automatically, depending on the values -`company-idle-delay' and `company-minimum-prefix-length'. - -Completion can be controlled with the commands: -`company-complete-common', `company-complete-selection', `company-complete', -`company-select-next', `company-select-previous'. If these commands are -called before `company-idle-delay', completion will also start. - -Completions can be searched with `company-search-candidates' or -`company-filter-candidates'. These can be used while completion is -inactive, as well. - -The completion data is retrieved using `company-backends' and displayed -using `company-frontends'. If you want to start a specific backend, call -it interactively or use `company-begin-backend'. - -By default, the completions list is sorted alphabetically, unless the -backend chooses otherwise, or `company-transformers' changes it later. - -regular keymap (`company-mode-map'): - -\\{company-mode-map} -keymap during active completions (`company-active-map'): - -\\{company-active-map} - -\(fn &optional ARG)" t nil) - -(defvar global-company-mode nil "\ -Non-nil if Global-Company mode is enabled. -See the command `global-company-mode' for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `global-company-mode'.") - -(custom-autoload 'global-company-mode "company" nil) - -(autoload 'global-company-mode "company" "\ -Toggle Company mode in all buffers. -With prefix ARG, enable Global-Company mode if ARG is positive; -otherwise, disable it. If called from Lisp, enable the mode if -ARG is omitted or nil. - -Company mode is enabled in all buffers where -`company-mode-on' would do it. -See `company-mode' for more information on Company mode. - -\(fn &optional ARG)" t nil) - -;;;*** - -;;;### (autoloads nil "company-abbrev" "company-abbrev.el" (22223 -;;;;;; 33912 0 0)) -;;; Generated autoloads from company-abbrev.el - -(autoload 'company-abbrev "company-abbrev" "\ -`company-mode' completion backend for abbrev. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-bbdb" "company-bbdb.el" (22223 33912 -;;;;;; 0 0)) -;;; Generated autoloads from company-bbdb.el - -(autoload 'company-bbdb "company-bbdb" "\ -`company-mode' completion backend for BBDB. - -\(fn COMMAND &optional ARG &rest IGNORE)" t nil) - -;;;*** - -;;;### (autoloads nil "company-css" "company-css.el" (22223 33912 -;;;;;; 0 0)) -;;; Generated autoloads from company-css.el - -(autoload 'company-css "company-css" "\ -`company-mode' completion backend for `css-mode'. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-dabbrev" "company-dabbrev.el" (22223 -;;;;;; 33912 0 0)) -;;; Generated autoloads from company-dabbrev.el - -(autoload 'company-dabbrev "company-dabbrev" "\ -dabbrev-like `company-mode' completion backend. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-dabbrev-code" "company-dabbrev-code.el" -;;;;;; (22223 33912 0 0)) -;;; Generated autoloads from company-dabbrev-code.el - -(autoload 'company-dabbrev-code "company-dabbrev-code" "\ -dabbrev-like `company-mode' backend for code. -The backend looks for all symbols in the current buffer that aren't in -comments or strings. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-elisp" "company-elisp.el" (22223 33912 -;;;;;; 0 0)) -;;; Generated autoloads from company-elisp.el - -(autoload 'company-elisp "company-elisp" "\ -`company-mode' completion backend for Emacs Lisp. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-etags" "company-etags.el" (22223 33912 -;;;;;; 0 0)) -;;; Generated autoloads from company-etags.el - -(autoload 'company-etags "company-etags" "\ -`company-mode' completion backend for etags. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-files" "company-files.el" (22223 33912 -;;;;;; 0 0)) -;;; Generated autoloads from company-files.el - -(autoload 'company-files "company-files" "\ -`company-mode' completion backend existing file names. -Completions works for proper absolute and relative files paths. -File paths with spaces are only supported inside strings. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-gtags" "company-gtags.el" (22223 33912 -;;;;;; 0 0)) -;;; Generated autoloads from company-gtags.el - -(autoload 'company-gtags "company-gtags" "\ -`company-mode' completion backend for GNU Global. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-ispell" "company-ispell.el" (22223 -;;;;;; 33912 0 0)) -;;; Generated autoloads from company-ispell.el - -(autoload 'company-ispell "company-ispell" "\ -`company-mode' completion backend using Ispell. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-keywords" "company-keywords.el" (22223 -;;;;;; 33912 0 0)) -;;; Generated autoloads from company-keywords.el - -(autoload 'company-keywords "company-keywords" "\ -`company-mode' backend for programming language keywords. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-nxml" "company-nxml.el" (22223 33912 -;;;;;; 0 0)) -;;; Generated autoloads from company-nxml.el - -(autoload 'company-nxml "company-nxml" "\ -`company-mode' completion backend for `nxml-mode'. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-oddmuse" "company-oddmuse.el" (22223 -;;;;;; 33912 0 0)) -;;; Generated autoloads from company-oddmuse.el - -(autoload 'company-oddmuse "company-oddmuse" "\ -`company-mode' completion backend for `oddmuse-mode'. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-semantic" "company-semantic.el" (22223 -;;;;;; 33912 0 0)) -;;; Generated autoloads from company-semantic.el - -(autoload 'company-semantic "company-semantic" "\ -`company-mode' completion backend using CEDET Semantic. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-tempo" "company-tempo.el" (22223 33912 -;;;;;; 0 0)) -;;; Generated autoloads from company-tempo.el - -(autoload 'company-tempo "company-tempo" "\ -`company-mode' completion backend for tempo. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-xcode" "company-xcode.el" (22223 33912 -;;;;;; 0 0)) -;;; Generated autoloads from company-xcode.el - -(autoload 'company-xcode "company-xcode" "\ -`company-mode' completion backend for Xcode projects. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-yasnippet" "company-yasnippet.el" -;;;;;; (22223 33912 0 0)) -;;; Generated autoloads from company-yasnippet.el - -(autoload 'company-yasnippet "company-yasnippet" "\ -`company-mode' backend for `yasnippet'. - -This backend should be used with care, because as long as there are -snippets defined for the current major mode, this backend will always -shadow backends that come after it. Recommended usages: - -* In a buffer-local value of `company-backends', grouped with a backend or - several that provide actual text completions. - - (add-hook 'js-mode-hook - (lambda () - (set (make-local-variable 'company-backends) - '((company-dabbrev-code company-yasnippet))))) - -* After keyword `:with', grouped with other backends. - - (push '(company-semantic :with company-yasnippet) company-backends) - -* Not in `company-backends', just bound to a key. - - (global-set-key (kbd \"C-c y\") 'company-yasnippet) - -\(fn COMMAND &optional ARG &rest IGNORE)" t nil) - -;;;*** - -;;;### (autoloads nil nil ("company-capf.el" "company-clang.el" "company-cmake.el" -;;;;;; "company-eclim.el" "company-pkg.el" "company-template.el") -;;;;;; (22223 33913 41216 0)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; company-autoloads.el ends here diff --git a/emacs.d/elpa/company-20160211.520/company-bbdb.el b/emacs.d/elpa/company-20160211.520/company-bbdb.el deleted file mode 100644 index 36307d0..0000000 --- a/emacs.d/elpa/company-20160211.520/company-bbdb.el +++ /dev/null @@ -1,61 +0,0 @@ -;;; company-bbdb.el --- company-mode completion backend for BBDB in message-mode - -;; Copyright (C) 2013-2014, 2016 Free Software Foundation, Inc. - -;; Author: Jan Tatarik - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -(require 'company) -(require 'cl-lib) - -(declare-function bbdb-record-get-field "bbdb") -(declare-function bbdb-records "bbdb") -(declare-function bbdb-dwim-mail "bbdb-com") -(declare-function bbdb-search "bbdb-com") - -(defgroup company-bbdb nil - "Completion backend for BBDB." - :group 'company) - -(defcustom company-bbdb-modes '(message-mode) - "Major modes in which `company-bbdb' may complete." - :type '(repeat (symbol :tag "Major mode")) - :package-version '(company . "0.8.8")) - -(defun company-bbdb--candidates (arg) - (cl-mapcan (lambda (record) - (mapcar (lambda (mail) (bbdb-dwim-mail record mail)) - (bbdb-record-get-field record 'mail))) - (eval '(bbdb-search (bbdb-records) arg nil arg)))) - -;;;###autoload -(defun company-bbdb (command &optional arg &rest ignore) - "`company-mode' completion backend for BBDB." - (interactive (list 'interactive)) - (cl-case command - (interactive (company-begin-backend 'company-bbdb)) - (prefix (and (memq major-mode company-bbdb-modes) - (featurep 'bbdb-com) - (looking-back "^\\(To\\|Cc\\|Bcc\\): *.*?\\([^,; ]*\\)" - (line-beginning-position)) - (match-string-no-properties 2))) - (candidates (company-bbdb--candidates arg)) - (sorted t) - (no-cache t))) - -(provide 'company-bbdb) -;;; company-bbdb.el ends here diff --git a/emacs.d/elpa/company-20160211.520/company-capf.el b/emacs.d/elpa/company-20160211.520/company-capf.el deleted file mode 100644 index 9eeb248..0000000 --- a/emacs.d/elpa/company-20160211.520/company-capf.el +++ /dev/null @@ -1,167 +0,0 @@ -;;; company-capf.el --- company-mode completion-at-point-functions backend -*- lexical-binding: t -*- - -;; Copyright (C) 2013-2016 Free Software Foundation, Inc. - -;; Author: Stefan Monnier - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - - -;;; Commentary: -;; - -;;; Code: - -(require 'company) -(require 'cl-lib) - -(defvar company--capf-cache nil) - -(defun company--capf-data () - (let ((cache company--capf-cache)) - (if (and (equal (current-buffer) (car cache)) - (equal (point) (car (setq cache (cdr cache)))) - (equal (buffer-chars-modified-tick) (car (setq cache (cdr cache))))) - (cadr cache) - (let ((data (company--capf-data-real))) - (setq company--capf-cache - (list (current-buffer) (point) (buffer-chars-modified-tick) data)) - data)))) - -(defun company--capf-data-real () - (cl-letf* (((default-value 'completion-at-point-functions) - ;; Ignore tags-completion-at-point-function because it subverts - ;; company-etags in the default value of company-backends, where - ;; the latter comes later. - (remove 'tags-completion-at-point-function - (default-value 'completion-at-point-functions))) - (completion-at-point-functions (company--capf-workaround)) - (data (run-hook-wrapped 'completion-at-point-functions - ;; Ignore misbehaving functions. - #'completion--capf-wrapper 'optimist))) - (when (and (consp (cdr data)) (integer-or-marker-p (nth 1 data))) data))) - -(declare-function python-shell-get-process "python") - -(defun company--capf-workaround () - ;; For http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18067 - (if (or (not (listp completion-at-point-functions)) - (not (memq 'python-completion-complete-at-point completion-at-point-functions)) - (python-shell-get-process)) - completion-at-point-functions - (remq 'python-completion-complete-at-point completion-at-point-functions))) - -(defun company-capf (command &optional arg &rest _args) - "`company-mode' backend using `completion-at-point-functions'." - (interactive (list 'interactive)) - (pcase command - (`interactive (company-begin-backend 'company-capf)) - (`prefix - (let ((res (company--capf-data))) - (when res - (let ((length (plist-get (nthcdr 4 res) :company-prefix-length)) - (prefix (buffer-substring-no-properties (nth 1 res) (point)))) - (cond - ((> (nth 2 res) (point)) 'stop) - (length (cons prefix length)) - (t prefix)))))) - (`candidates - (let ((res (company--capf-data))) - (when res - (let* ((table (nth 3 res)) - (pred (plist-get (nthcdr 4 res) :predicate)) - (meta (completion-metadata - (buffer-substring (nth 1 res) (nth 2 res)) - table pred)) - (sortfun (cdr (assq 'display-sort-function meta))) - (candidates (completion-all-completions arg table pred (length arg))) - (last (last candidates)) - (base-size (and (numberp (cdr last)) (cdr last)))) - (when base-size - (setcdr last nil)) - (when sortfun - (setq candidates (funcall sortfun candidates))) - (if (not (zerop (or base-size 0))) - (let ((before (substring arg 0 base-size))) - (mapcar (lambda (candidate) - (concat before candidate)) - candidates)) - candidates))))) - (`sorted - (let ((res (company--capf-data))) - (when res - (let ((meta (completion-metadata - (buffer-substring (nth 1 res) (nth 2 res)) - (nth 3 res) (plist-get (nthcdr 4 res) :predicate)))) - (cdr (assq 'display-sort-function meta)))))) - (`match - ;; Can't just use 0 when base-size (see above) is non-zero. - (let ((start (if (get-text-property 0 'font-lock-face arg) - 0 - (next-single-property-change 0 'font-lock-face arg)))) - (when start - ;; completions-common-part comes first, but we can't just look for this - ;; value because it can be in a list. - (or - (let ((value (get-text-property start 'font-lock-face arg))) - (text-property-not-all start (length arg) - 'font-lock-face value arg)) - (length arg))))) - (`duplicates t) - (`no-cache t) ;Not much can be done here, as long as we handle - ;non-prefix matches. - (`meta - (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-docsig))) - (when f (funcall f arg)))) - (`doc-buffer - (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-doc-buffer))) - (when f (funcall f arg)))) - (`location - (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-location))) - (when f (funcall f arg)))) - (`annotation - (save-excursion - ;; FIXME: `company-begin' sets `company-point' after calling - ;; `company--begin-new'. We shouldn't rely on `company-point' here, - ;; better to cache the capf-data value instead. However: we can't just - ;; save the last capf-data value in `prefix', because that command can - ;; get called more often than `candidates', and at any point in the - ;; buffer (https://github.com/company-mode/company-mode/issues/153). - ;; We could try propertizing the returned prefix string, but it's not - ;; passed to `annotation', and `company-prefix' is set only after - ;; `company--strip-duplicates' is called. - (when company-point - (goto-char company-point)) - (let ((f (plist-get (nthcdr 4 (company--capf-data)) :annotation-function))) - (when f (funcall f arg))))) - (`require-match - (plist-get (nthcdr 4 (company--capf-data)) :company-require-match)) - (`init nil) ;Don't bother: plenty of other ways to initialize the code. - (`post-completion - (let* ((res (company--capf-data)) - (exit-function (plist-get (nthcdr 4 res) :exit-function)) - (table (nth 3 res)) - (pred (plist-get (nthcdr 4 res) :predicate))) - (if exit-function - ;; Follow the example of `completion--done'. - (funcall exit-function arg - (if (eq (try-completion arg table pred) t) - 'finished 'sole))))) - )) - -(provide 'company-capf) - -;;; company-capf.el ends here diff --git a/emacs.d/elpa/company-20160211.520/company-clang.el b/emacs.d/elpa/company-20160211.520/company-clang.el deleted file mode 100644 index 54d4b9b..0000000 --- a/emacs.d/elpa/company-20160211.520/company-clang.el +++ /dev/null @@ -1,331 +0,0 @@ -;;; company-clang.el --- company-mode completion backend for Clang -*- lexical-binding: t -*- - -;; Copyright (C) 2009, 2011, 2013-2016 Free Software Foundation, Inc. - -;; Author: Nikolaj Schumacher - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - - -;;; Commentary: -;; - -;;; Code: - -(require 'company) -(require 'company-template) -(require 'cl-lib) - -(defgroup company-clang nil - "Completion backend for Clang." - :group 'company) - -(defcustom company-clang-executable - (executable-find "clang") - "Location of clang executable." - :type 'file) - -(defcustom company-clang-begin-after-member-access t - "When non-nil, automatic completion will start whenever the current -symbol is preceded by \".\", \"->\" or \"::\", ignoring -`company-minimum-prefix-length'. - -If `company-begin-commands' is a list, it should include `c-electric-lt-gt' -and `c-electric-colon', for automatic completion right after \">\" and -\":\".") - -(defcustom company-clang-arguments nil - "Additional arguments to pass to clang when completing. -Prefix files (-include ...) can be selected with `company-clang-set-prefix' -or automatically through a custom `company-clang-prefix-guesser'." - :type '(repeat (string :tag "Argument"))) - -(defcustom company-clang-prefix-guesser 'company-clang-guess-prefix - "A function to determine the prefix file for the current buffer." - :type '(function :tag "Guesser function" nil)) - -(defvar company-clang-modes '(c-mode c++-mode objc-mode) - "Major modes which clang may complete.") - -(defcustom company-clang-insert-arguments t - "When non-nil, insert function arguments as a template after completion." - :type 'boolean - :package-version '(company . "0.8.0")) - -;; prefix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defvar company-clang--prefix nil) - -(defsubst company-clang--guess-pch-file (file) - (let ((dir (directory-file-name (file-name-directory file)))) - (when (equal (file-name-nondirectory dir) "Classes") - (setq dir (file-name-directory dir))) - (car (directory-files dir t "\\([^.]h\\|[^h]\\).pch\\'" t)))) - -(defsubst company-clang--file-substring (file beg end) - (with-temp-buffer - (insert-file-contents-literally file nil beg end) - (buffer-string))) - -(defun company-clang-guess-prefix () - "Try to guess the prefix file for the current buffer." - ;; Prefixes seem to be called .pch. Pre-compiled headers do, too. - ;; So we look at the magic number to rule them out. - (let* ((file (company-clang--guess-pch-file buffer-file-name)) - (magic-number (and file (company-clang--file-substring file 0 4)))) - (unless (member magic-number '("CPCH" "gpch")) - file))) - -(defun company-clang-set-prefix (&optional prefix) - "Use PREFIX as a prefix (-include ...) file for clang completion." - (interactive (let ((def (funcall company-clang-prefix-guesser))) - (unless (stringp def) - (setq def default-directory)) - (list (read-file-name "Prefix file: " - (when def (file-name-directory def)) - def t (when def (file-name-nondirectory def)))))) - ;; TODO: pre-compile? - (setq company-clang--prefix (and (stringp prefix) - (file-regular-p prefix) - prefix))) - -;; Clean-up on exit. -(add-hook 'kill-emacs-hook 'company-clang-set-prefix) - -;; parsing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; TODO: Handle Pattern (syntactic hints would be neat). -;; Do we ever see OVERLOAD (or OVERRIDE)? -(defconst company-clang--completion-pattern - "^COMPLETION: \\_<\\(%s[a-zA-Z0-9_:]*\\)\\(?: : \\(.*\\)$\\)?$") - -(defconst company-clang--error-buffer-name "*clang-error*") - -(defun company-clang--lang-option () - (if (eq major-mode 'objc-mode) - (if (string= "m" (file-name-extension buffer-file-name)) - "objective-c" "objective-c++") - (substring (symbol-name major-mode) 0 -5))) - -(defun company-clang--parse-output (prefix _objc) - (goto-char (point-min)) - (let ((pattern (format company-clang--completion-pattern - (regexp-quote prefix))) - (case-fold-search nil) - lines match) - (while (re-search-forward pattern nil t) - (setq match (match-string-no-properties 1)) - (unless (equal match "Pattern") - (save-match-data - (when (string-match ":" match) - (setq match (substring match 0 (match-beginning 0))))) - (let ((meta (match-string-no-properties 2))) - (when (and meta (not (string= match meta))) - (put-text-property 0 1 'meta - (company-clang--strip-formatting meta) - match))) - (push match lines))) - lines)) - -(defun company-clang--meta (candidate) - (get-text-property 0 'meta candidate)) - -(defun company-clang--annotation (candidate) - (let ((ann (company-clang--annotation-1 candidate))) - (if (not (and ann (string-prefix-p "(*)" ann))) - ann - (with-temp-buffer - (insert ann) - (search-backward ")") - (let ((pt (1+ (point)))) - (re-search-forward ".\\_>" nil t) - (delete-region pt (point))) - (buffer-string))))) - -(defun company-clang--annotation-1 (candidate) - (let ((meta (company-clang--meta candidate))) - (cond - ((null meta) nil) - ((string-match "[^:]:[^:]" meta) - (substring meta (1+ (match-beginning 0)))) - ((string-match "\\((.*)[ a-z]*\\'\\)" meta) - (let ((paren (match-beginning 1))) - (if (not (eq (aref meta (1- paren)) ?>)) - (match-string 1 meta) - (with-temp-buffer - (insert meta) - (goto-char paren) - (substring meta (1- (search-backward "<")))))))))) - -(defun company-clang--strip-formatting (text) - (replace-regexp-in-string - "#]" " " - (replace-regexp-in-string "[<{[]#\\|#[>}]" "" text t) - t)) - -(defun company-clang--handle-error (res args) - (goto-char (point-min)) - (let* ((buf (get-buffer-create company-clang--error-buffer-name)) - (cmd (concat company-clang-executable " " (mapconcat 'identity args " "))) - (pattern (format company-clang--completion-pattern "")) - (err (if (re-search-forward pattern nil t) - (buffer-substring-no-properties (point-min) - (1- (match-beginning 0))) - ;; Warn the user more aggressively if no match was found. - (message "clang failed with error %d:\n%s" res cmd) - (buffer-string)))) - - (with-current-buffer buf - (let ((inhibit-read-only t)) - (erase-buffer) - (insert (current-time-string) - (format "\nclang failed with error %d:\n" res) - cmd "\n\n") - (insert err) - (setq buffer-read-only t) - (goto-char (point-min)))))) - -(defun company-clang--start-process (prefix callback &rest args) - (let ((objc (derived-mode-p 'objc-mode)) - (buf (get-buffer-create "*clang-output*")) - ;; Looks unnecessary in Emacs 25.1 and later. - (process-adaptive-read-buffering nil)) - (if (get-buffer-process buf) - (funcall callback nil) - (with-current-buffer buf - (erase-buffer) - (setq buffer-undo-list t)) - (let ((process (apply #'start-process "company-clang" buf - company-clang-executable args))) - (set-process-sentinel - process - (lambda (proc status) - (unless (string-match-p "hangup" status) - (funcall - callback - (let ((res (process-exit-status proc))) - (with-current-buffer buf - (unless (eq 0 res) - (company-clang--handle-error res args)) - ;; Still try to get any useful input. - (company-clang--parse-output prefix objc))))))) - (unless (company-clang--auto-save-p) - (send-region process (point-min) (point-max)) - (send-string process "\n") - (process-send-eof process)))))) - -(defsubst company-clang--build-location (pos) - (save-excursion - (goto-char pos) - (format "%s:%d:%d" - (if (company-clang--auto-save-p) buffer-file-name "-") - (line-number-at-pos) - (1+ (length - (encode-coding-region - (line-beginning-position) - (point) - 'utf-8 - t)))))) - -(defsubst company-clang--build-complete-args (pos) - (append '("-fsyntax-only" "-Xclang" "-code-completion-macros") - (unless (company-clang--auto-save-p) - (list "-x" (company-clang--lang-option))) - company-clang-arguments - (when (stringp company-clang--prefix) - (list "-include" (expand-file-name company-clang--prefix))) - (list "-Xclang" (format "-code-completion-at=%s" - (company-clang--build-location pos))) - (list (if (company-clang--auto-save-p) buffer-file-name "-")))) - -(defun company-clang--candidates (prefix callback) - (and (company-clang--auto-save-p) - (buffer-modified-p) - (basic-save-buffer)) - (when (null company-clang--prefix) - (company-clang-set-prefix (or (funcall company-clang-prefix-guesser) - 'none))) - (apply 'company-clang--start-process - prefix - callback - (company-clang--build-complete-args (- (point) (length prefix))))) - -(defun company-clang--prefix () - (if company-clang-begin-after-member-access - (company-grab-symbol-cons "\\.\\|->\\|::" 2) - (company-grab-symbol))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defconst company-clang-required-version 1.1) - -(defvar company-clang--version nil) - -(defun company-clang--auto-save-p () - (< company-clang--version 2.9)) - -(defsubst company-clang-version () - "Return the version of `company-clang-executable'." - (with-temp-buffer - (call-process company-clang-executable nil t nil "--version") - (goto-char (point-min)) - (if (re-search-forward "clang\\(?: version \\|-\\)\\([0-9.]+\\)" nil t) - (let ((ver (string-to-number (match-string-no-properties 1)))) - (if (> ver 100) - (/ ver 100) - ver)) - 0))) - -(defun company-clang (command &optional arg &rest ignored) - "`company-mode' completion backend for Clang. -Clang is a parser for C and ObjC. Clang version 1.1 or newer is required. - -Additional command line arguments can be specified in -`company-clang-arguments'. Prefix files (-include ...) can be selected -with `company-clang-set-prefix' or automatically through a custom -`company-clang-prefix-guesser'. - -With Clang versions before 2.9, we have to save the buffer before -performing completion. With Clang 2.9 and later, buffer contents are -passed via standard input." - (interactive (list 'interactive)) - (cl-case command - (interactive (company-begin-backend 'company-clang)) - (init (when (memq major-mode company-clang-modes) - (unless company-clang-executable - (error "Company found no clang executable")) - (setq company-clang--version (company-clang-version)) - (when (< company-clang--version company-clang-required-version) - (error "Company requires clang version 1.1")))) - (prefix (and (memq major-mode company-clang-modes) - buffer-file-name - company-clang-executable - (not (company-in-string-or-comment)) - (or (company-clang--prefix) 'stop))) - (candidates (cons :async - (lambda (cb) (company-clang--candidates arg cb)))) - (meta (company-clang--meta arg)) - (annotation (company-clang--annotation arg)) - (post-completion (let ((anno (company-clang--annotation arg))) - (when (and company-clang-insert-arguments anno) - (insert anno) - (if (string-match "\\`:[^:]" anno) - (company-template-objc-templatify anno) - (company-template-c-like-templatify - (concat arg anno)))))))) - -(provide 'company-clang) -;;; company-clang.el ends here diff --git a/emacs.d/elpa/company-20160211.520/company-cmake.el b/emacs.d/elpa/company-20160211.520/company-cmake.el deleted file mode 100644 index 010df32..0000000 --- a/emacs.d/elpa/company-20160211.520/company-cmake.el +++ /dev/null @@ -1,198 +0,0 @@ -;;; company-cmake.el --- company-mode completion backend for CMake - -;; Copyright (C) 2013-2014 Free Software Foundation, Inc. - -;; Author: Chen Bin -;; Version: 0.2 - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: -;; -;; company-cmake offers completions for module names, variable names and -;; commands used by CMake. And their descriptions. - -;;; Code: - -(require 'company) -(require 'cl-lib) - -(defgroup company-cmake nil - "Completion backend for CMake." - :group 'company) - -(defcustom company-cmake-executable - (executable-find "cmake") - "Location of cmake executable." - :type 'file) - -(defvar company-cmake-executable-arguments - '("--help-command-list" - "--help-module-list" - "--help-variable-list") - "The arguments we pass to cmake, separately. -They affect which types of symbols we get completion candidates for.") - -(defvar company-cmake--completion-pattern - "^\\(%s[a-zA-Z0-9_<>]%s\\)$" - "Regexp to match the candidates.") - -(defvar company-cmake-modes '(cmake-mode) - "Major modes in which cmake may complete.") - -(defvar company-cmake--candidates-cache nil - "Cache for the raw candidates.") - -(defvar company-cmake--meta-command-cache nil - "Cache for command arguments to retrieve descriptions for the candidates.") - -(defun company-cmake--replace-tags (rlt) - (setq rlt (replace-regexp-in-string - "\\(.*?\\(IS_GNU\\)?\\)\\(.*\\)" - (lambda (_match) - (mapconcat 'identity - (if (match-beginning 2) - '("\\1CXX\\3" "\\1C\\3" "\\1G77\\3") - '("\\1CXX\\3" "\\1C\\3" "\\1Fortran\\3")) - "\n")) - rlt t)) - (setq rlt (replace-regexp-in-string - "\\(.*\\)\\(.*\\)" - (mapconcat 'identity '("\\1DEBUG\\2" "\\1RELEASE\\2" - "\\1RELWITHDEBINFO\\2" "\\1MINSIZEREL\\2") - "\n") - rlt)) - rlt) - -(defun company-cmake--fill-candidates-cache (arg) - "Fill candidates cache if needed." - (let (rlt) - (unless company-cmake--candidates-cache - (setq company-cmake--candidates-cache (make-hash-table :test 'equal))) - - ;; If hash is empty, fill it. - (unless (gethash arg company-cmake--candidates-cache) - (with-temp-buffer - (let ((res (call-process company-cmake-executable nil t nil arg))) - (unless (zerop res) - (message "cmake executable exited with error=%d" res))) - (setq rlt (buffer-string))) - (setq rlt (company-cmake--replace-tags rlt)) - (puthash arg rlt company-cmake--candidates-cache)) - )) - -(defun company-cmake--parse (prefix content cmd) - (let ((start 0) - (pattern (format company-cmake--completion-pattern - (regexp-quote prefix) - (if (zerop (length prefix)) "+" "*"))) - (lines (split-string content "\n")) - match - rlt) - (dolist (line lines) - (when (string-match pattern line) - (let ((match (match-string 1 line))) - (when match - (puthash match cmd company-cmake--meta-command-cache) - (push match rlt))))) - rlt)) - -(defun company-cmake--candidates (prefix) - (let (results - cmd-opts - str) - - (unless company-cmake--meta-command-cache - (setq company-cmake--meta-command-cache (make-hash-table :test 'equal))) - - (dolist (arg company-cmake-executable-arguments) - (company-cmake--fill-candidates-cache arg) - (setq cmd-opts (replace-regexp-in-string "-list$" "" arg) ) - - (setq str (gethash arg company-cmake--candidates-cache)) - (when str - (setq results (nconc results - (company-cmake--parse prefix str cmd-opts))))) - results)) - -(defun company-cmake--unexpand-candidate (candidate) - (cond - ((string-match "^CMAKE_\\(C\\|CXX\\|Fortran\\)\\(_.*\\)$" candidate) - (setq candidate (concat "CMAKE_" (match-string 2 candidate)))) - - ;; C flags - ((string-match "^\\(.*_\\)IS_GNU\\(C\\|CXX\\|G77\\)$" candidate) - (setq candidate (concat (match-string 1 candidate) "IS_GNU"))) - - ;; C flags - ((string-match "^\\(.*_\\)OVERRIDE_\\(C\\|CXX\\|Fortran\\)$" candidate) - (setq candidate (concat (match-string 1 candidate) "OVERRIDE_"))) - - ((string-match "^\\(.*\\)\\(_DEBUG\\|_RELEASE\\|_RELWITHDEBINFO\\|_MINSIZEREL\\)\\(.*\\)$" candidate) - (setq candidate (concat (match-string 1 candidate) - "_" - (match-string 3 candidate))))) - candidate) - -(defun company-cmake--meta (candidate) - (let ((cmd-opts (gethash candidate company-cmake--meta-command-cache)) - result) - (setq candidate (company-cmake--unexpand-candidate candidate)) - - ;; Don't cache the documentation of every candidate (command) - ;; Cache in this case will cost too much memory. - (with-temp-buffer - (call-process company-cmake-executable nil t nil cmd-opts candidate) - ;; Go to the third line, trim it and return the result. - ;; Tested with cmake 2.8.9. - (goto-char (point-min)) - (forward-line 2) - (setq result (buffer-substring-no-properties (line-beginning-position) - (line-end-position))) - (setq result (replace-regexp-in-string "^[ \t\n\r]+" "" result)) - result))) - -(defun company-cmake--doc-buffer (candidate) - (let ((cmd-opts (gethash candidate company-cmake--meta-command-cache))) - - (setq candidate (company-cmake--unexpand-candidate candidate)) - (with-temp-buffer - (call-process company-cmake-executable nil t nil cmd-opts candidate) - ;; Go to the third line, trim it and return the doc buffer. - ;; Tested with cmake 2.8.9. - (goto-char (point-min)) - (forward-line 2) - (company-doc-buffer - (buffer-substring-no-properties (line-beginning-position) - (point-max)))))) - -(defun company-cmake (command &optional arg &rest ignored) - "`company-mode' completion backend for CMake. -CMake is a cross-platform, open-source make system." - (interactive (list 'interactive)) - (cl-case command - (interactive (company-begin-backend 'company-cmake)) - (init (when (memq major-mode company-cmake-modes) - (unless company-cmake-executable - (error "Company found no cmake executable")))) - (prefix (and (memq major-mode company-cmake-modes) - (not (company-in-string-or-comment)) - (company-grab-symbol))) - (candidates (company-cmake--candidates arg)) - (meta (company-cmake--meta arg)) - (doc-buffer (company-cmake--doc-buffer arg)) - )) - -(provide 'company-cmake) -;;; company-cmake.el ends here diff --git a/emacs.d/elpa/company-20160211.520/company-css.el b/emacs.d/elpa/company-20160211.520/company-css.el deleted file mode 100644 index cf8c683..0000000 --- a/emacs.d/elpa/company-20160211.520/company-css.el +++ /dev/null @@ -1,442 +0,0 @@ -;;; company-css.el --- company-mode completion backend for css-mode -*- lexical-binding: t -*- - -;; Copyright (C) 2009, 2011, 2014 Free Software Foundation, Inc. - -;; Author: Nikolaj Schumacher - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;;; Code: - -(require 'company) -(require 'cl-lib) - -(declare-function web-mode-language-at-pos "web-mode" (&optional pos)) - -(defconst company-css-property-alist - ;; see http://www.w3.org/TR/CSS21/propidx.html - '(("azimuth" angle "left-side" "far-left" "left" "center-left" "center" - "center-right" "right" "far-right" "right-side" "behind" "leftwards" - "rightwards") - ("background" background-color background-image background-repeat - background-attachment background-position - background-clip background-origin background-size) - ("background-attachment" "scroll" "fixed") - ("background-color" color "transparent") - ("background-image" uri "none") - ("background-position" percentage length "left" "center" "right" percentage - length "top" "center" "bottom" "left" "center" "right" "top" "center" - "bottom") - ("background-repeat" "repeat" "repeat-x" "repeat-y" "no-repeat") - ("border" border-width border-style border-color) - ("border-bottom" border) - ("border-bottom-color" border-color) - ("border-bottom-style" border-style) - ("border-bottom-width" border-width) - ("border-collapse" "collapse" "separate") - ("border-color" color "transparent") - ("border-left" border) - ("border-left-color" border-color) - ("border-left-style" border-style) - ("border-left-width" border-width) - ("border-right" border) - ("border-right-color" border-color) - ("border-right-style" border-style) - ("border-right-width" border-width) - ("border-spacing" length length) - ("border-style" border-style) - ("border-top" border) - ("border-top-color" border-color) - ("border-top-style" border-style) - ("border-top-width" border-width) - ("border-width" border-width) - ("bottom" length percentage "auto") - ("caption-side" "top" "bottom") - ("clear" "none" "left" "right" "both") - ("clip" shape "auto") - ("color" color) - ("content" "normal" "none" string uri counter "attr()" "open-quote" - "close-quote" "no-open-quote" "no-close-quote") - ("counter-increment" identifier integer "none") - ("counter-reset" identifier integer "none") - ("cue" cue-before cue-after) - ("cue-after" uri "none") - ("cue-before" uri "none") - ("cursor" uri "*" "auto" "crosshair" "default" "pointer" "move" "e-resize" - "ne-resize" "nw-resize" "n-resize" "se-resize" "sw-resize" "s-resize" - "w-resize" "text" "wait" "help" "progress") - ("direction" "ltr" "rtl") - ("display" "inline" "block" "list-item" "run-in" "inline-block" "table" - "inline-table" "table-row-group" "table-header-group" "table-footer-group" - "table-row" "table-column-group" "table-column" "table-cell" - "table-caption" "none") - ("elevation" angle "below" "level" "above" "higher" "lower") - ("empty-cells" "show" "hide") - ("float" "left" "right" "none") - ("font" font-style font-weight font-size "/" line-height - font-family "caption" "icon" "menu" "message-box" "small-caption" - "status-bar" "normal" "small-caps" - ;; CSS3 - font-stretch) - ("font-family" family-name generic-family) - ("font-size" absolute-size relative-size length percentage) - ("font-style" "normal" "italic" "oblique") - ("font-weight" "normal" "bold" "bolder" "lighter" "100" "200" "300" "400" - "500" "600" "700" "800" "900") - ("height" length percentage "auto") - ("left" length percentage "auto") - ("letter-spacing" "normal" length) - ("line-height" "normal" number length percentage) - ("list-style" list-style-type list-style-position list-style-image) - ("list-style-image" uri "none") - ("list-style-position" "inside" "outside") - ("list-style-type" "disc" "circle" "square" "decimal" "decimal-leading-zero" - "lower-roman" "upper-roman" "lower-greek" "lower-latin" "upper-latin" - "armenian" "georgian" "lower-alpha" "upper-alpha" "none") - ("margin" margin-width) - ("margin-bottom" margin-width) - ("margin-left" margin-width) - ("margin-right" margin-width) - ("margin-top" margin-width) - ("max-height" length percentage "none") - ("max-width" length percentage "none") - ("min-height" length percentage) - ("min-width" length percentage) - ("orphans" integer) - ("outline" outline-color outline-style outline-width) - ("outline-color" color "invert") - ("outline-style" border-style) - ("outline-width" border-width) - ("overflow" "visible" "hidden" "scroll" "auto" - ;; CSS3: - "no-display" "no-content") - ("padding" padding-width) - ("padding-bottom" padding-width) - ("padding-left" padding-width) - ("padding-right" padding-width) - ("padding-top" padding-width) - ("page-break-after" "auto" "always" "avoid" "left" "right") - ("page-break-before" "auto" "always" "avoid" "left" "right") - ("page-break-inside" "avoid" "auto") - ("pause" time percentage) - ("pause-after" time percentage) - ("pause-before" time percentage) - ("pitch" frequency "x-low" "low" "medium" "high" "x-high") - ("pitch-range" number) - ("play-during" uri "mix" "repeat" "auto" "none") - ("position" "static" "relative" "absolute" "fixed") - ("quotes" string string "none") - ("richness" number) - ("right" length percentage "auto") - ("speak" "normal" "none" "spell-out") - ("speak-header" "once" "always") - ("speak-numeral" "digits" "continuous") - ("speak-punctuation" "code" "none") - ("speech-rate" number "x-slow" "slow" "medium" "fast" "x-fast" "faster" - "slower") - ("stress" number) - ("table-layout" "auto" "fixed") - ("text-align" "left" "right" "center" "justify") - ("text-indent" length percentage) - ("text-transform" "capitalize" "uppercase" "lowercase" "none") - ("top" length percentage "auto") - ("unicode-bidi" "normal" "embed" "bidi-override") - ("vertical-align" "baseline" "sub" "super" "top" "text-top" "middle" - "bottom" "text-bottom" percentage length) - ("visibility" "visible" "hidden" "collapse") - ("voice-family" specific-voice generic-voice "*" specific-voice - generic-voice) - ("volume" number percentage "silent" "x-soft" "soft" "medium" "loud" - "x-loud") - ("white-space" "normal" "pre" "nowrap" "pre-wrap" "pre-line") - ("widows" integer) - ("width" length percentage "auto") - ("word-spacing" "normal" length) - ("z-index" "auto" integer) - ;; CSS3 - ("align-content" align-stretch "space-between" "space-around") - ("align-items" align-stretch "baseline") - ("align-self" align-items "auto") - ("animation" animation-name animation-duration animation-timing-function - animation-delay animation-iteration-count animation-direction - animation-fill-mode) - ("animation-delay" time) - ("animation-direction" "normal" "reverse" "alternate" "alternate-reverse") - ("animation-duration" time) - ("animation-fill-mode" "none" "forwards" "backwards" "both") - ("animation-iteration-count" integer "infinite") - ("animation-name" "none") - ("animation-play-state" "paused" "running") - ("animation-timing-function" transition-timing-function - "step-start" "step-end" "steps(,)") - ("backface-visibility" "visible" "hidden") - ("background-clip" background-origin) - ("background-origin" "border-box" "padding-box" "content-box") - ("background-size" length percentage "auto" "cover" "contain") - ("border-image" border-image-outset border-image-repeat border-image-source - border-image-slice border-image-width) - ("border-image-outset" length) - ("border-image-repeat" "stretch" "repeat" "round" "space") - ("border-image-source" uri "none") - ("border-image-slice" length) - ("border-image-width" length percentage) - ("border-radius" length) - ("border-top-left-radius" length) - ("border-top-right-radius" length) - ("border-bottom-left-radius" length) - ("border-bottom-right-radius" length) - ("box-decoration-break" "slice" "clone") - ("box-shadow" length color) - ("box-sizing" "content-box" "border-box") - ("break-after" "auto" "always" "avoid" "left" "right" "page" "column" - "avoid-page" "avoid-column") - ("break-before" break-after) - ("break-inside" "avoid" "auto") - ("columns" column-width column-count) - ("column-count" integer) - ("column-fill" "auto" "balance") - ("column-gap" length "normal") - ("column-rule" column-rule-width column-rule-style column-rule-color) - ("column-rule-color" color) - ("column-rule-style" border-style) - ("column-rule-width" border-width) - ("column-span" "all" "none") - ("column-width" length "auto") - ("filter" url "blur()" "brightness()" "contrast()" "drop-shadow()" - "grayscale()" "hue-rotate()" "invert()" "opacity()" "saturate()" "sepia()") - ("flex" flex-grow flex-shrink flex-basis) - ("flex-basis" percentage length "auto") - ("flex-direction" "row" "row-reverse" "column" "column-reverse") - ("flex-flow" flex-direction flex-wrap) - ("flex-grow" number) - ("flex-shrink" number) - ("flex-wrap" "nowrap" "wrap" "wrap-reverse") - ("font-feature-setting" normal string number) - ("font-kerning" "auto" "normal" "none") - ("font-language-override" "normal" string) - ("font-size-adjust" "none" number) - ("font-stretch" "normal" "ultra-condensed" "extra-condensed" "condensed" - "semi-condensed" "semi-expanded" "expanded" "extra-expanded" "ultra-expanded") - ("font-synthesis" "none" "weight" "style") - ("font-variant" font-variant-alternates font-variant-caps - font-variant-east-asian font-variant-ligatures font-variant-numeric - font-variant-position) - ("font-variant-alternates" "normal" "historical-forms" "stylistic()" - "styleset()" "character-variant()" "swash()" "ornaments()" "annotation()") - ("font-variant-caps" "normal" "small-caps" "all-small-caps" "petite-caps" - "all-petite-caps" "unicase" "titling-caps") - ("font-variant-east-asian" "jis78" "jis83" "jis90" "jis04" "simplified" - "traditional" "full-width" "proportional-width" "ruby") - ("font-variant-ligatures" "normal" "none" "common-ligatures" - "no-common-ligatures" "discretionary-ligatures" "no-discretionary-ligatures" - "historical-ligatures" "no-historical-ligatures" "contextual" "no-contextual") - ("font-variant-numeric" "normal" "ordinal" "slashed-zero" - "lining-nums" "oldstyle-nums" "proportional-nums" "tabular-nums" - "diagonal-fractions" "stacked-fractions") - ("font-variant-position" "normal" "sub" "super") - ("hyphens" "none" "manual" "auto") - ("justify-content" align-common "space-between" "space-around") - ("line-break" "auto" "loose" "normal" "strict") - ("marquee-direction" "forward" "reverse") - ("marquee-play-count" integer "infinite") - ("marquee-speed" "slow" "normal" "fast") - ("marquee-style" "scroll" "slide" "alternate") - ("opacity" number) - ("order" number) - ("outline-offset" length) - ("overflow-x" overflow) - ("overflow-y" overflow) - ("overflow-style" "auto" "marquee-line" "marquee-block") - ("overflow-wrap" "normal" "break-word") - ("perspective" "none" length) - ("perspective-origin" percentage length "left" "center" "right" "top" "bottom") - ("resize" "none" "both" "horizontal" "vertical") - ("tab-size" integer length) - ("text-align-last" "auto" "start" "end" "left" "right" "center" "justify") - ("text-decoration" text-decoration-color text-decoration-line text-decoration-style) - ("text-decoration-color" color) - ("text-decoration-line" "none" "underline" "overline" "line-through" "blink") - ("text-decoration-style" "solid" "double" "dotted" "dashed" "wavy") - ("text-overflow" "clip" "ellipsis") - ("text-shadow" color length) - ("text-underline-position" "auto" "under" "left" "right") - ("transform" "matrix(,,,,,)" "translate(,)" "translateX()" "translateY()" - "scale()" "scaleX()" "scaleY()" "rotate()" "skewX()" "skewY()" "none") - ("transform-origin" perspective-origin) - ("transform-style" "flat" "preserve-3d") - ("transition" transition-property transition-duration - transition-timing-function transition-delay) - ("transition-delay" time) - ("transition-duration" time) - ("transition-timing-function" - "ease" "linear" "ease-in" "ease-out" "ease-in-out" "cubic-bezier(,,,)") - ("transition-property" "none" "all" identifier) - ("word-wrap" overflow-wrap) - ("word-break" "normal" "break-all" "keep-all")) - "A list of CSS properties and their possible values.") - -(defconst company-css-value-classes - '((absolute-size "xx-small" "x-small" "small" "medium" "large" "x-large" - "xx-large") - (align-common "flex-start" "flex-end" "center") - (align-stretch align-common "stretch") - (border-style "none" "hidden" "dotted" "dashed" "solid" "double" "groove" - "ridge" "inset" "outset") - (border-width "thick" "medium" "thin") - (color "aqua" "black" "blue" "fuchsia" "gray" "green" "lime" "maroon" "navy" - "olive" "orange" "purple" "red" "silver" "teal" "white" "yellow") - (counter "counter(,)") - (family-name "Courier" "Helvetica" "Times") - (generic-family "serif" "sans-serif" "cursive" "fantasy" "monospace") - (generic-voice "male" "female" "child") - (margin-width "auto") ;; length percentage - (relative-size "larger" "smaller") - (shape "rect(,,,)") - (uri "url()")) - "A list of CSS property value classes and their contents.") -;; missing, because not completable -;; -;;