Commit f381bc4a60df

Vincent Demeester <vincent@sbr.pm>
2018-03-20 19:47:42
re-init the configuration
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 9772091
Changed files (382)
.config
mr
.emacs.d
config
elpa
all-the-icons-20170817.642
async-20170916.2256
auto-compile-1.4.1
counsel-20170911.1121
counsel-projectile-20170911.1304
dash-20170810.137
dashboard-1.2.3
diminish-20170419.1036
direnv-20170717.1049
doom-themes-1.2.5
epl-20150517.433
evil-20170904.1346
evil-indent-textobject-20130831.1519
evil-surround-20170910.1952
exec-path-from-shell-20170508.4
font-lock+-20170222.1755
general-20170708.104
git-annex-20170417.1653
git-commit-20170914.258
gnupg
go-mode-20170726.555
goto-chg-20131228.659
htmlize-20161211.1019
hydra-20170903.218
ivy-20170911.1034
ivy-hydra-20170703.2350
magit-20170913.1424
magit-annex-20170913.659
magit-popup-20170918.1116
memoize-20170720.1802
nix-mode-20170831.1721
packed-20170819.942
page-break-lines-20170829.157
persp-projectile-20160709.2317
perspective-20160609.1444
pkg-info-20150517.443
projectile-20170917.410
s-20170906.1304
solaire-mode-1.0.2
swiper-20170911.1036
undo-tree-20170706.246
which-key-20170817.1107
with-editor-20170817.1240
images
lisp
.gitignore.d
lisp
tmp
.config/mr/config.d/emacs.vcsh
@@ -1,3 +0,0 @@
-[$HOME/.config/vcsh/repo.d/emacs-config.git]
-lib = VCSH_NAME="emacs-config"
-include = cat $HOME/lib/vcsh/mr
.config/mr/groups.d/emacs-config
@@ -1,5 +0,0 @@
-[$HOME/.emacs.d/snippets/andreaCrotti-snippets]
-checkout = git clone git@github.com:vdemeester/yasnippet-snippets.git andreaCrotti-snippets
-
-[$HOME/.emacs.d/lisp/pt]
-checkout = git clone git@github.com:vdemeester/pt.el pt
.emacs.d/config/go-config.el
@@ -1,5 +0,0 @@
-
-(use-package go-mode
-  :ensure t)
-
-(provide 'go-config)
.emacs.d/config/go-config.elc
Binary file
.emacs.d/config/go-config.org
@@ -1,15 +0,0 @@
-#+TITLE: golang configuration 🐹
-
-I'm doing a lot of =golang= development so let's configure Emacs to handle =go=
-files.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package go-mode
-    :ensure t)
-#+END_SRC
-
-* Provide configuration
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (provide 'go-config)
-#+END_SRC
.emacs.d/config/navigation-config.el
@@ -1,164 +0,0 @@
-
-(defun vde:config-evil ()
-  "Configure evil mode the way I want"
-  (vde:evil:configure-emacs-mode)
-  (vde:evil:configure-bepo))
-
-(defun vde:evil:configure-emacs-mode ()
-  "configure evil emacs mode"
-  (dolist (mode '(custom-mode
-                  dired-mode
-                  eshell-mode
-                  term-mode
-                  grep-mode))
-    (add-to-list 'evil-emacs-state-modes mode)))
-
-(defun vde:evil:configure-bepo ()
-  "Remap default bindings to bépo one *if* the computer is
-  running on a bépo keyboard layout.")
-
-(use-package evil
-  :ensure t
-  :config
-  (add-hook 'evil-mode-hook 'vde:config-evil)
-  (evil-mode 1)
-  (use-package evil-jumper
-    :ensure t
-    :config
-    (global-evil-jumper-mode))
-  (use-package evil-surround
-    :ensure t
-    :config
-    (global-evil-surround-mode))
-  (use-package evil-indent-textobject
-    :ensure t))
-
-(use-package which-key
-  :ensure t
-  :diminish which-key-mode
-  :init
-  (setq which-key-sort-order 'which-key-key-order-alpha)
-  :config
-  (which-key-mode))
-
-(use-package ivy
-  :ensure t
-  :diminish ivy-mode
-  :config
-  (use-package ivy-hydra
-    :ensure t)
-  (ido-mode -1)
-  (ivy-mode 1)  ;; Show recently killed buffers when calling `ivy-switch-buffer'
-  (setq ivy-use-virtual-buffers t)
-  (defun modi/ivy-kill-buffer ()
-    (interactive)
-    (ivy-set-action 'kill-buffer)
-    (ivy-done))
-  (bind-keys
-   :map ivy-switch-buffer-map
-   ("C-k" . modi/ivy-kill-buffer))
-  (bind-keys
-   :map ivy-minibuffer-map
-   ;; Exchange the default bindings for C-j and C-m
-   ("C-m" . ivy-alt-done) ; RET, default C-j
-   ("C-j" . ivy-done) ; default C-m
-   ("C-S-m" . ivy-immediate-done)
-   ("C-t" . ivy-toggle-fuzzy)
-   ("C-o" . hydra-ivy/body))
-  ;; version of ivy-yank-word to yank from start of word
-  (defun bjm/ivy-yank-whole-word ()
-    "Pull next word from buffer into search string."
-    (interactive)
-    (let (amend)
-  (with-ivy-window
-        ;;move to last word boundary
-        (re-search-backward "\\b")
-        (let ((pt (point))
-          (le (line-end-position)))
-          (forward-word 1)
-          (if (> (point) le)
-          (goto-char pt)
-            (setq amend (buffer-substring-no-properties pt (point))))))
-  (when amend
-        (insert (replace-regexp-in-string " +" " " amend)))))
-
-  ;; bind it to M-j
-  (define-key ivy-minibuffer-map (kbd "M-j") 'bjm/ivy-yank-whole-word))
-
-(use-package counsel
-  :ensure t
-  :bind*                    
-  (("M-x"     . counsel-M-x)
-   ("M-y"     . counsel-yank-pop)
-   ("C-x C-f" . counsel-find-file)
-   ("C-x C-r" . counsel-recentf)
-   ("C-c f"   . counsel-git)
-   ("C-c s"   . counsel-git-grep)
-   ("C-c /"   . counsel-ag))
-  :config
-  (progn
-    (ivy-set-actions
-     'counsel-find-file
-     '(("d" (lambda (x) (delete-file (expand-file-name x)))
-        "delete"
-        )))
-    (ivy-set-actions
-     'ivy-switch-buffer
-     '(("k" (lamba (x)
-                   (kill-buffer x)
-                   (ivy--reset-state ivy-last))
-        "kill")
-   ("j"
-        ivy--switch-buffer-other-window-action
-        "other window")))
-    )
-  )
-
-(use-package projectile
-  :ensure t
-  :init
-  (setq projectile-enable-caching t
-        projectile-verbose nil
-        projectile-completion-system 'ivy)
-  (put 'projectile-project-run-cmd 'safe-local-variable #'stringp)
-  (defun projectile-do-invalidate-cache (&rest _args)
-    (projectile-invalidate-cache nil))
-  (advice-add 'rename-file :after #'projectile-do-invalidate-cache)
-  (projectile-mode)
-  (projectile-cleanup-known-projects))
-
-(use-package counsel-projectile
-  :ensure t
-  :after projectile
-  :config (counsel-projectile-on))
-
-(use-package persp-projectile
-  :ensure t
-  :after projectile)
-
-(use-package general
-  :ensure t
-  :after projectile
-  :config
-  (let ((leader "SPC")
-        (emacs-leader "M-m"))
-    (general-define-key
-     :states '(normal visual insert emacs)
-     :prefix leader
-     :non-normal-prefix emacs-leader
-     "p" 'projectile-command-map
-     "TAB" '(ivy-switch-buffer :which-key "switch buffer")
-     "/" '(:ignore t :which-key "search")
-     "/a" '(counsel-ag :which-key "ag")
-     "/g" '(counsel-git-grep :which-key "git grep")
-     "y" '(counsel-yank-pop :which-key "yank-pop")
-     "SPC" '(counsel-M-x :which-key "M-x")
-     "f" '(:ignore t :which-key "Files")
-     "ff" '(counsel-find-file :which-key "find file")
-     "fd" '(counsel-git :which-key "find file in git")
-     "g" '(:ignore t :which-key "Git")
-     "gs" '(magit-status :which-key "git status")
-     "g@" '(magit-annex-sync :which-key "git annex sync")
-     "r" '(counsel-recentf :which-key "recent file"))))
-
-(provide 'navigation-config)
.emacs.d/config/navigation-config.elc
Binary file
.emacs.d/config/navigation-config.org
@@ -1,312 +0,0 @@
-#+TITLE: Navigation configuration
-
-Let's configure general navigation elements of emacs here. By that I
-mean using modal edition (like =evil=) but also command and search
-like =ivy= and =counsel=.
-
-* Evil
-
-#+BEGIN_QUOTE
-Evil Mode, or, How I Learned to Stop Worrying and Love Emacs
-#+END_QUOTE
-
-As [[https://blog.aaronbieber.com/][Aaron Bieber]] says in one of his [[https://blog.aaronbieber.com/2015/06/03/evil-mode.html][talk]], let's stop worrying and use
-best of both worlds.
-
-First let's define the =vde:config-evil= function 👼.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (defun vde:config-evil ()
-    "Configure evil mode the way I want"
-    (vde:evil:configure-emacs-mode)
-    (vde:evil:configure-bepo))
-#+END_SRC
-
-Some modes will work better with =emacs= evil mode, i.e. not the
-default vim =normal= mode or =insert= mode. One example would be
-=grep-mode= which has already pretty useful one key bindings.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (defun vde:evil:configure-emacs-mode ()
-    "configure evil emacs mode"
-    (dolist (mode '(custom-mode
-                    dired-mode
-                    eshell-mode
-                    term-mode
-                    grep-mode))
-      (add-to-list 'evil-emacs-state-modes mode)))
-#+END_SRC
-
-I am a =bépo= user in /most/ of my computer. This means the default
-vim bindings of evil are really not optimized for my keyboard
-layout. That said in a few (macbook at work/home and on tablets) I am
-using mainly qwerty or azerty. So…
-
-I need to rebind those bindings to bépo-optimized bindings,
-/conditionaly/. Any bindings I do for evil (and in general) should act
-the same with my bépo keymap *and* a qwerty/azerty keymap. This means
-I need a way to rebind dynamically some stuff — well not that
-dynamically but I need to have *one way* to bind things (the qwerty
-way) that should be translated to the =bépo=-way if I'm on a bépo
-computer. We'll detect they keyboard layout using a variable that
-needs to be set-up on bépo machines.
-
-Let's first create a map that correspond one bépo char to a qwerty
-char.
-
-#+BEGIN_SRC emacs-lisp :tangle no
-    (defvar vde:bepo-base-rebinding-map
-      (;;row0
-       ("=" . "-")
-       ;;row1
-       ("b" . "q")
-       ("é" . "w")
-       ("p" . "e")
-       ("o" . "r")
-       ("è" . "t")
-       ("^" . "y")
-       ("v" . "u")
-       ("d" . "i")
-       ("l" . "o")
-       ("j" . "p")
-       ("z" . "[")
-       ;;row2
-       ("a" . "a")
-       ("u" . "s")
-       ("i" . "d")
-       ("e" . "f")
-       ("," . "g")
-       ("c" . "h")
-       ("t" . "j")
-       ("s" . "k")
-       ("r" . "l")
-       ("n" . ";")
-       ("m" . "'")
-       ;;row3
-       ("à" . "z")
-       ("y" . "x")
-       ("x" . "c")
-       ("." . "v")
-       ("k" . "b")
-       ("'" . "n")
-       ("q" . "m")
-       ("g" . ",")
-       ("h" . ".")
-       ("f" . "/")
-       ("w" . "]")))
-#+END_SRC
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (defun vde:evil:configure-bepo ()
-    "Remap default bindings to bépo one *if* the computer is
-    running on a bépo keyboard layout.")
-#+END_SRC
-
-Finally let's tie this altogether.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package evil
-    :ensure t
-    :config
-    (add-hook 'evil-mode-hook 'vde:config-evil)
-    (evil-mode 1)
-    (use-package evil-jumper
-      :ensure t
-      :config
-      (global-evil-jumper-mode))
-    (use-package evil-surround
-      :ensure t
-      :config
-      (global-evil-surround-mode))
-    (use-package evil-indent-textobject
-      :ensure t))
-#+END_SRC
-
-* Which key
-
- Emacs has 100s of bindings and it is impossible to remember them all. Sometimes
- I can remember the start of a key chord but not the entire one. [[https://github.com/justbur/emacs-which-key][which-key]] is a
- package that gives you key hints on delay or if prompted. I really like it and
- use it extensively to setup the modal state.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package which-key
-    :ensure t
-    :diminish which-key-mode
-    :init
-    (setq which-key-sort-order 'which-key-key-order-alpha)
-    :config
-    (which-key-mode))
-#+END_SRC
-
-* Ivy, counsel and swiper
-
-[[https://github.com/abo-abo/swiper][ivy, counsel and swiper]] are a bunch of packages from the awesome [[https://github.com/abo-abo][abo-abo]] that
-provides a very good and lightweight alternative to =helm=.
-
-- Ivy is a genery completion mechanism for Emacs.
-- Counsel is a collection of ivy-enhanced versions of common Emacs commands.
-- Swiper is an ivy-enhanced alternative to isearch.
-
-** ivy
-
-> Ivy is a generic completion mechanism for Emacs. While it operates similarly
-> to other completion schemes such as icomplete-mode, Ivy aims to be more
-> efficient, smaller, simpler, and smoother to use yet highly customizable.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package ivy
-    :ensure t
-    :diminish ivy-mode
-    :config
-    (use-package ivy-hydra
-      :ensure t)
-    (ido-mode -1)
-    (ivy-mode 1)  ;; Show recently killed buffers when calling `ivy-switch-buffer'
-    (setq ivy-use-virtual-buffers t)
-    (defun modi/ivy-kill-buffer ()
-      (interactive)
-      (ivy-set-action 'kill-buffer)
-      (ivy-done))
-    (bind-keys
-     :map ivy-switch-buffer-map
-     ("C-k" . modi/ivy-kill-buffer))
-    (bind-keys
-     :map ivy-minibuffer-map
-     ;; Exchange the default bindings for C-j and C-m
-     ("C-m" . ivy-alt-done) ; RET, default C-j
-     ("C-j" . ivy-done) ; default C-m
-     ("C-S-m" . ivy-immediate-done)
-     ("C-t" . ivy-toggle-fuzzy)
-     ("C-o" . hydra-ivy/body))
-    ;; version of ivy-yank-word to yank from start of word
-    (defun bjm/ivy-yank-whole-word ()
-      "Pull next word from buffer into search string."
-      (interactive)
-      (let (amend)
-    (with-ivy-window
-          ;;move to last word boundary
-          (re-search-backward "\\b")
-          (let ((pt (point))
-            (le (line-end-position)))
-            (forward-word 1)
-            (if (> (point) le)
-            (goto-char pt)
-              (setq amend (buffer-substring-no-properties pt (point))))))
-    (when amend
-          (insert (replace-regexp-in-string " +" " " amend)))))
-
-    ;; bind it to M-j
-    (define-key ivy-minibuffer-map (kbd "M-j") 'bjm/ivy-yank-whole-word))
-#+END_SRC
-
-** counsel
-
-> ivy-mode ensures that any Emacs command using completing-read-function uses
-> ivy for completion. Counsel takes this further, providing versions of common
-> Emacs commands that are customised to make the best use of ivy. For example,
-> counsel-find-file has some additional keybindings. Pressing DEL will move you
-> to the parent directory.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package counsel
-    :ensure t
-    :bind*                    
-    (("M-x"     . counsel-M-x)
-     ("M-y"     . counsel-yank-pop)
-     ("C-x C-f" . counsel-find-file)
-     ("C-x C-r" . counsel-recentf)
-     ("C-c f"   . counsel-git)
-     ("C-c s"   . counsel-git-grep)
-     ("C-c /"   . counsel-ag))
-    :config
-    (progn
-      (ivy-set-actions
-       'counsel-find-file
-       '(("d" (lambda (x) (delete-file (expand-file-name x)))
-          "delete"
-          )))
-      (ivy-set-actions
-       'ivy-switch-buffer
-       '(("k" (lamba (x)
-                     (kill-buffer x)
-                     (ivy--reset-state ivy-last))
-          "kill")
-     ("j"
-          ivy--switch-buffer-other-window-action
-          "other window")))
-      )
-    )
-#+END_SRC
-
-* Project management
-
-In order to manage project under Emacs, the most used package is =projectile=.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package projectile
-    :ensure t
-    :init
-    (setq projectile-enable-caching t
-          projectile-verbose nil
-          projectile-completion-system 'ivy)
-    (put 'projectile-project-run-cmd 'safe-local-variable #'stringp)
-    (defun projectile-do-invalidate-cache (&rest _args)
-      (projectile-invalidate-cache nil))
-    (advice-add 'rename-file :after #'projectile-do-invalidate-cache)
-    (projectile-mode)
-    (projectile-cleanup-known-projects))
-
-  (use-package counsel-projectile
-    :ensure t
-    :after projectile
-    :config (counsel-projectile-on))
-
-  (use-package persp-projectile
-    :ensure t
-    :after projectile)
-#+END_SRC
-
-* General
-
-A good complement to =evil= is the [[https://github.com/noctuid/general.el][general]].
-
-> general.el provides a more convenient way to bind keys in emacs for both evil
-> and non-evil users. general-define-key allows defining multiple keys at once,
-> implicitly wrapping key strings with (kbd ...), having named prefix key
-> sequences (like the leader key in vim), and more.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package general
-    :ensure t
-    :after projectile
-    :config
-    (let ((leader "SPC")
-          (emacs-leader "M-m"))
-      (general-define-key
-       :states '(normal visual insert emacs)
-       :prefix leader
-       :non-normal-prefix emacs-leader
-       "p" 'projectile-command-map
-       "TAB" '(ivy-switch-buffer :which-key "switch buffer")
-       "/" '(:ignore t :which-key "search")
-       "/a" '(counsel-ag :which-key "ag")
-       "/g" '(counsel-git-grep :which-key "git grep")
-       "y" '(counsel-yank-pop :which-key "yank-pop")
-       "SPC" '(counsel-M-x :which-key "M-x")
-       "f" '(:ignore t :which-key "Files")
-       "ff" '(counsel-find-file :which-key "find file")
-       "fd" '(counsel-git :which-key "find file in git")
-       "g" '(:ignore t :which-key "Git")
-       "gs" '(magit-status :which-key "git status")
-       "g@" '(magit-annex-sync :which-key "git annex sync")
-       "r" '(counsel-recentf :which-key "recent file"))))
-#+END_SRC
-
-
-* Provide configuration
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (provide 'navigation-config)
-#+END_SRC
-
.emacs.d/config/nix-config.el
@@ -1,11 +0,0 @@
-
-(use-package nix-mode
-  :ensure t)
-
-(use-package direnv
-  :ensure t
-  :init
-  (setq direnv-always-show-summary t)
-  (direnv-mode t))
-
-(provide 'nix-config)
.emacs.d/config/nix-config.elc
Binary file
.emacs.d/config/nix-config.org
@@ -1,41 +0,0 @@
-#+TITLE: nix configuration 🐹
-
-I am using [[https://nixos.org][nixos]] on my computers (mainly laptops and desktops).
-
-> NixOS is a Linux distribution with a unique approach to package and
-> configuration management. Built on top of the Nix package manager, it is
-> completely declarative, makes upgrading systems reliable, and has many other
-> advantages.
-
-I want to be able to configure syntax highlighting and also some magic tricks
-with it.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package nix-mode
-    :ensure t)
-#+END_SRC
-
-* direnv
-
-> =direnv= is an environment switcher for the shell. It knows how to hook into
-> bash, zsh, tcsh and fish shell to load or unload environment variables depending
-> on the current directory. This allows project-specific environment variables
-> without cluttering the =~/.profile= file.
-
-[[https://github.com/direnv/direnv/][direnv]] is awesome and I'm relying on it quite a lot — mainly because it has this
-magic =use_nix= support that will rely on the =default.nix= file in the folder
-(or parents) you are in.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package direnv
-    :ensure t
-    :init
-    (setq direnv-always-show-summary t)
-    (direnv-mode t))
-#+END_SRC
-
-* Provide configuration
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (provide 'nix-config)
-#+END_SRC
.emacs.d/config/org-config.el
@@ -1,521 +0,0 @@
-
-(setq org-root-directory (expand-file-name "org" desktop-directory)
-      org-sites-directory-name "sites"
-      org-archive-directory-name "archive"
-      org-archive-file-pattern "/%s_archive::"
-      org-inbox-file "inbox.org"
-      org-main-file "personal.org"
-      org-todos-directory org-root-directory
-      org-notes-directory org-root-directory
-      org-sites-directory (expand-file-name org-sites-directory-name org-root-directory)
-      org-archive-directory (expand-file-name org-archive-directory-name org-root-directory)
-      org-docker-file "docker.org"
-      org-journal-file "journal.org"
-      org-publish-folder (substitute-env-in-file-name "$HOME/var/public_html")
-      sites-folder (substitute-env-in-file-name "$HOME/src/sites/"))
-
-(use-package org
-  :ensure t)
-(require 'find-lisp)
-(setq org-directory org-root-directory)
-(setq org-agenda-files (find-lisp-find-files org-todos-directory "\.org$"))
-(setq org-enforce-todo-dependencies t)
-(setq org-enforce-todo-checkbox-dependencies t)
-
-(setq org-log-redeadline (quote time))
-(setq org-log-reschedule (quote time))
-
-;;warn me of any deadlines in next 7 days
-(setq org-deadline-warning-days 7)
-;;show me tasks scheduled or due in next fortnight
-(setq org-agenda-span (quote fortnight))
-;;don't show tasks as scheduled if they are already shown as a deadline
-(setq org-agenda-skip-scheduled-if-deadline-is-shown t)
-;;don't give awarning colour to tasks with impending deadlines
-;;if they are scheduled to be done
-(setq org-agenda-skip-deadline-prewarning-if-scheduled (quote pre-scheduled))
-;;don't show tasks that are scheduled or have deadlines in the
-;;normal todo list
-(setq org-agenda-todo-ignore-deadlines (quote all))
-(setq org-agenda-todo-ignore-scheduled (quote all))
-;;sort tasks in order of when they are due and then by priority
-(setq org-agenda-sorting-strategy
-  (quote
-   ((agenda deadline-up priority-down)
-    (todo priority-down category-keep)
-    (tags priority-down category-keep)
-    (search category-keep))))
-
-(setq org-todo-keywords
-      (quote ((sequence "TODO(t)" "PROGRESS(p)" "PAUSED" "BLOCKED" "REVIEW" "|" "DONE(d!)" "ARCHIVED")
-              (sequence "REPORT(r!)" "BUG" "KNOWNCAUSE" "|" "FIXED(f!)")
-              (sequence "|" "CANCELLED(c@)"))))
-(setq org-todo-keyword-faces
-      (quote (("TODO" . org-todo)
-              ("PROGRESS" . "green")
-              ("PAUSED" . "cyan")
-              ("BLOCKED" . "red")
-              ("REVIEW" . "yellow")
-              ("DONE" . org-done)
-              ("ARCHIVED" . org-done)
-              ("CANCELLED" . "black")
-              ("REPORT" . org-todo)
-              ("BUG" . "red")
-              ("KNOWNCAUSE" . "yellow")
-              ("FIXED" . org-done))))
-
-(setq org-todo-state-tags-triggers
-      (quote (("CANCELLED" ("CANCELLED" . t)))))
-
-(defun org-summary-todo (n-done n-not-done)
-  "Switch entry to DONE when all subentries are done, to PROGRESS otherwise."
-  (let (org-log-done org-log-states)   ; turn off logging
-    (if (not (string-blank-p (org-get-todo-state)))
-        (org-todo (if (= n-not-done 0) "DONE" "PROGRESS")))
-    ))
-
-(add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
-
-(require 'org-archive)
-(setq org-archive-location (concat org-archive-directory org-archive-file-pattern))
-
-(defvar org-my-archive-expiry-days 9
-  "The number of days after which a completed task should be auto-archived.
-This can be 0 for immediate, or a floating point value.")
-
-(defun org-archive-done-tasks ()
-  (interactive)
-  (save-excursion
-    (goto-char (point-min))
-    (while (re-search-forward "\* \\(DONE\\|CANCELED\\) " nil t)
-   (if (save-restriction
-            (save-excursion
-        (org-narrow-to-subtree)
-        (search-forward ":LOGBOOK:" nil t)))
-          (forward-line)
-        (org-archive-subtree)
-        (goto-char (line-beginning-position))))))
-
-(defalias 'archive-done-tasks 'org-archive-done-tasks)
-
-(defvar oc-capture-prmt-history nil
-  "History of prompt answers for org capture.")
-(defun oc/prmt (prompt variable)
-  "PROMPT for string, save it to VARIABLE and insert it."
-  (make-local-variable variable)
-  (set variable (read-string (concat prompt ": ") nil oc-capture-prmt-history)))
-(defun oc/inc (what text &rest fmtvars)
-  "Ask user to include WHAT.  If user agrees return TEXT."
-  (when (y-or-n-p (concat "Include " what "?"))
-    (apply 'format text fmtvars)))
-
-(setq org-capture-templates
-   '(;; other entries
-        ("t" "inbox"
-      entry (file (expand-file-name org-inbox-file org-todos-directory))
-         "* %?\n%i\n%a")
-        ("d" "task"
-      entry (file+headline (expand-file-name org-main-file org-todos-directory) "Tasks")
-         "* TODO %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n")
-        ("d" "docker task"
-      entry (file+headline (expand-file-name org-docker-file org-todos-directory) "Tasks")
-         "* TODO gh:docker/%(oc/prmt \"project\" 'd-prj)#%(oc/prmt \"issue/pr\" 'd-issue) %?%(oc/inc \"feature content\" \" [/]\n- [ ] Implementation\n- [ ] Tests\n- [ ] Docs\")")
-        ("j" "Journal entry"
-         entry (file+datetree+prompt (expand-file-name org-journal-file org-root-directory))
-         "* %?\n%i\nFrom: %a\n%U" :empty-lines 1)
-        ;; other entries
-        ))
-
-(org-add-link-type
- "grep" 'my/follow-grep-link
- )
-(defun my/follow-grep-link (regexp)
-  "Run `rgrep' with REGEXP and FOLDER as argument,
-like this : [[grep:REGEXP:FOLDER]]."
-  (setq expressions (split-string regexp ":"))
-  (setq exp (nth 0 expressions))
-  (grep-compute-defaults)
-  (if (= (length expressions) 1)
-      (progn
-        (rgrep exp "*" (expand-file-name "./")))
-    (progn
-      (setq folder (nth 1 expressions))
-      (rgrep exp "*" (expand-file-name folder))))
-  )
-
-(use-package pt
-  :load-path "~/.emacs.d/lisp/pt/")
-
-;; pt-regexp (regexp directory &optional args)
-(org-add-link-type
- "pt" 'my/follow-pt-link)
-(defun my/follow-pt-link (regexp)
-  "Run `pt-regexp` with REXEP and FOLDER as argument,
-like this : [[pt:REGEXP:FOLDER]]"
-  (setq expressions (split-string regexp ":"))
-  (setq exp (nth 0 expressions))
-  (if (= (length expressions) 1)
-      (progn
-        (pt-regexp exp (expand-file-name "./")))
-    (progn
-      (setq folder (nth 1 expressions))
-      (pt-regexp exp (file-name-as-directory (expand-file-name folder)))))
-  )
-
-(defvar yt-iframe-format
-  ;; You may want to change your width and height.
-  (concat "<iframe width=\"440\""
-          " height=\"335\""
-          " src=\"https://www.youtube.com/embed/%s\""
-          " frameborder=\"0\""
-          " allowfullscreen>%s</iframe>"))
-
-(org-add-link-type
- "youtube"
- (lambda (handle)
-   (browse-url
-    (concat "https://www.youtube.com/embed/"
-            handle)))
- (lambda (path desc backend)
-   (cl-case backend
-     (html (format yt-iframe-format
-                   path (or desc "")))
-     (latex (format "\href{%s}{%s}"
-                    path (or desc "video"))))))
-
-(org-add-link-type
- "gh" 'my/follow-gh-link)
-(defun my/follow-gh-link (issue)
-  "Browse github issue/pr specified"
-  (setq expressions (split-string issue "#"))
-  (setq project (nth 0 expressions))
-  (setq issue (nth 1 expressions))
-  (browse-url
-   (format "https://github.com/%s/issues/%s" project issue)))
-
-(setq org-link-abbrev-alist
-      '(("gmane" . "http://thread.gmane.org/%s")
-        ("google" . "https://www.google.com/search?q=%s")
-        ("github" . "http://github.com/%s")
-        ))
-
-;; from http://endlessparentheses.com/use-org-mode-links-for-absolutely-anything.html
-(org-add-link-type
- "tag" 'endless/follow-tag-link)
-
-(defun endless/follow-tag-link (tag)
-  "Display a list of TODO headlines with tag TAG.
-With prefix argument, also display headlines without a TODO keyword."
-  (org-tags-view (null current-prefix-arg) tag))
-
-(setq org-src-fontify-natively t)
-(setq org-html-htmlize-output-type 'css)
-(setq org-html-htmlize-font-prefix "org-")
-(org-babel-do-load-languages
- 'org-babel-load-languages
- '( (perl . t)
-    (ruby . t)
-    (sh . t)
-    (python . t)
-    (emacs-lisp . t)
-    ;; (golang . t)
-    (haskell . t)
-    (ditaa . t)
-    ))
-
-(defun my/org-insert-src-block (src-code-type)
-  "Insert a `SRC-CODE-TYPE' type source code block in org-mode."
-  (interactive
-   (let ((src-code-types
-          '("emacs-lisp" "python" "C" "sh" "java" "js" "clojure" "C++" "css"
-            "calc" "dot" "gnuplot" "ledger" "R" "sass" "screen" "sql" "awk"
-            "ditaa" "haskell" "latex" "lisp" "matlab" "org" "perl" "ruby"
-            "sqlite" "rust" "scala" "golang" "restclient")))
-     (list (ido-completing-read "Source code type: " src-code-types))))
-  (progn
-    (newline-and-indent)
-    (insert (format "#+BEGIN_SRC %s\n" src-code-type))
-    (newline-and-indent)
-    (insert "#+END_SRC\n")
-    (previous-line 2)
-    (org-edit-src-code)))
-
-(defun my/org-insert-html-block ()
-  "Insert a `HTML-BLOCK` type in org-mode."
-  (interactive
-   (progn
-     (newline-and-indent)
-     (insert "#+BEGIN_HTML\n")
-     (newline-and-indent)
-     (insert "#+END_HTML\n")
-     (previous-line 2))))
-
-
-(defun my/org-insert-blockquote-block ()
-  "Insert a `BLOCKQUOTE-BLOCK` type in org-mode."
-  (interactive
-   (progn
-     (newline-and-indent)
-     (insert "#+BEGIN_BLOCKQUOTE\n")
-     (newline-and-indent)
-     (insert "#+END_BLOCKQUOTE\n")
-     (previous-line 2))))
-
-
-
-(add-hook 'org-mode-hook
-          '(lambda ()
-             (local-set-key (kbd "C-c s e") 'org-edit-src-code)
-             (local-set-key (kbd "C-c s i") 'my/org-insert-src-block)
-             (local-set-key (kbd "C-c s h") 'my/org-insert-html-block)
-             (local-set-key (kbd "C-c s b") 'my/org-insert-blockquote-block))
-          'append)
-
-(require 'org-archive)
-(setq org-archive-location (concat org-archive-directory org-archive-file-pattern))
-
-(defvar org-my-archive-expiry-days 9
-  "The number of days after which a completed task should be auto-archived.
-This can be 0 for immediate, or a floating point value.")
-
-(defun org-archive-done-tasks ()
-  (interactive)
-  (save-excursion
-    (goto-char (point-min))
-    (while (re-search-forward "\* \\(DONE\\|CANCELED\\) " nil t)
-   (if (save-restriction
-            (save-excursion
-        (org-narrow-to-subtree)
-        (search-forward ":LOGBOOK:" nil t)))
-          (forward-line)
-        (org-archive-subtree)
-        (goto-char (line-beginning-position))))))
-
-(defalias 'archive-done-tasks 'org-archive-done-tasks)
-
-;; Wish I could use taggroup but it doesn't seem to work..
-(setq org-tag-alist '(
-                   ("important" . ?i)
-                   ("ongoing" . ?o)         ;; ongoing "project", use to filter big project that are on the go
-                   ("next" . ?n)            ;; next "project"/"task", use to filter next things to do
-                   ("@home" . ?h)           ;; needs to be done at home
-                   ("@work" . ?w)           ;; needs to be done at work
-                   ("dev" . ?e)             ;; this is a development task
-                   ("infra" . ?a)           ;; this is a sysadmin/infra task
-                   ("document" . ?d)        ;; needs to produce a document (article, post, ..)
-                   ("download" . ?D)        ;; needs to download something
-                   ("media" . ?m)           ;; this is a media (something to watch, listen, record, ..)
-                   ("mail" . ?M)            ;; mail-related (to write & send or to read)
-                   ("triage" . ?t)          ;; need "triage", tag it to easily find them
-                   ("task" . ?a)            ;; a simple task (no project), the name is kinda misleading
-                   ;; docker-related tags
-                   ("docker")
-                   ("kubernetes")
-                   ("compose")
-                   ("moby")
-                   ("linuxkit")
-                   ("docs")
-                   ;; languages
-                   ("golang")
-                   ("python")
-                   ("java")
-                   ("clojure")
-                   ("emacs-lisp")
-                   ;; sites tags
-                   ("sites")
-                   ("vdf")
-                   ;; configs tags
-                   ("configs")
-                   ("emacs")
-                   ("i3")
-                   ("shell")
-                   ;; services
-                   ("services")
-                   ))
-
-(defadvice org-clock-in (after sacha activate)
-  "Set this task's status to 'PROGRESS'."
-  (org-todo "PROGRESS"))
-
-(setq org-agenda-custom-commands
-      '(("d" "Daily agenda and all TODOs"
-         ((tags "urgent+PRIORITY=\"A\""
-                ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
-                 (org-agenda-overriding-header "High-priority unfinished tasks:")))
-          (agenda "" ((org-agenda-ndays 1)))
-          (tags "next"
-                ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
-                 (org-agenda-overriding-header "Today's tasks")))
-          (tags "PRIORITY=\"A\""
-                ((org-agenda-skip-function '(or (org-agenda-skip-entry-if 'tag 'urgent)
-                                                (org-agenda-skip-entry-if 'todo 'done)))
-                 (org-agenda-overriding-header "Kaizen tasks -improvement-")))
-          (alltodo ""
-                   ((org-agenda-sorting-strategy '(priority-down))
-                    (org-agenda-skip-function '(or (org-agenda-skip-entry-if 'todo 'progress)
-                                                   (org-agenda-skip-entry-if 'todo 'review)
-                                                   (org-agenda-skip-entry-if 'todo 'done)
-                                                   (vde/org-skip-subtree-if-habit)
-                                                   (vde/org-skip-subtree-if-priority ?A)
-                                                   (org-agenda-skip-if nil '(scheduled deadline))))
-                    (org-agenda-overriding-header "ALL normal priority tasks:"))))
-         ((org-agenda-compact-blocks t)))
-        ("t" todo "TODO"
-         ((org-agenda-sorting-strategy '(priority-down))
-          (org-agenda-prefix-format "  Mixed: ")))
-        ("p" todo "PROGRESS"
-         ((org-agenda-sorting-strategy '(priority-down))
-          (org-agenda-prefix-format "  Mixed: ")))
-        ("r" todo "REVIEW"
-         ((org-agenda-sorting-strategy '(priority-down))
-          (org-agenda-prefix-format "  Mixed: ")))
-        ("u" todo "PAUSED"
-         ((org-agenda-sorting-strategy '(priority-down))
-          (org-agenda-prefix-format "  Mixed: ")))
-        ("b" todo "BLOCKED"
-         ((org-agenda-sorting-strategy '(priority-down))
-          (org-agenda-prefix-format "  Mixed: ")))
-        ("n" "Next tasks" tags-todo "next"
-         ((org-agenda-sorting-strategy '(priority-down))
-          (org-tags-exclude-from-inheritance '("next"))
-          (org-agenda-prefix-format "  Mixed: ")))
-        ("i" "Triage tasks — to look" tags-todo "triage"
-         ((org-agenda-sorting-strategy '(priority-down))
-          (org-agenda-prefix-format "  Mixed: ")))
-        ;; Timelines
-        ("d" "Timeline for today" ((agenda "" ))
-         ((org-agenda-ndays 1)
-          (org-agenda-show-log t)
-          (org-agenda-log-mode-items '(clock closed))
-          (org-agenda-clockreport-mode t)
-          (org-agenda-entry-types '())))
-        ("w" "Weekly review" agenda ""
-         ((org-agenda-span 7)
-          (org-agenda-log-mode 1)))
-        ("W" "Weekly review sans DAILY" agenda ""
-         ((org-agenda-span 7)
-          (org-agenda-log-mode 1)
-          (org-agenda-tag-filter-preset '("-DAILY"))))
-        ;; Panic tasks : urgent & important
-        ;; Probably the most important to do, but try not have to much of them..
-        ("P" "Panic -emergency-" tags-todo "urgent+PRIORITY=\"A\""
-         ((org-agenda-sorting-strategy '(priority-down))
-          (org-agenda-prefix-format "  Mixed: ")))
-        ;; Kaizen tasks : important but not urgent
-        ("K" "Kaizen -improvement-" tags-todo "PRIORITY=\"A\"&-urgent"
-         ((org-agenda-sorting-strategy '(priority-down))
-          (org-agenda-prefix-format "  Mixed: ")))
-        ;; Social investment : urgent
-        ("S" "Social -investment-" tags-todo "-PRIORITY=\"A\"+urgent"
-         ((org-agenda-sorting-strategy '(priority-down))
-          (org-agenda-prefix-format "  Mixed: ")))
-        ;; Organics
-        ("O" "Organics -inspiration-" tags-todo "-PRIORITY=\"A\"&-urgent"
-         ((org-agenda-sorting-strategy '(priority-down))
-          (org-agenda-prefix-format "  Mixed: ")))
-        ("N" search ""
-         ((org-agenda-text-search-extra-files nil)))))
-
-(defun vde/org-skip-subtree-if-priority (priority)
-  "Skip an agenda subtree if it has a priority of PRIORITY.
-
-PRIORITY may be one of the characters ?A, ?B, or ?C."
-  (let ((subtree-end (save-excursion (org-end-of-subtree t)))
-        (pri-value (* 1000 (- org-lowest-priority priority)))
-        (pri-current (org-get-priority (thing-at-point 'line t))))
-    (if (= pri-value pri-current)
-        subtree-end
-      nil)))
-
-(defun vde/org-skip-subtree-if-habit ()
-  "Skip an agenda entry if it has a STYLE property equal to \"habit\"."
-  (let ((subtree-end (save-excursion (org-end-of-subtree t))))
-    (if (string= (org-entry-get nil "STYLE") "habit")
-        subtree-end
-      nil)))
-
-(use-package htmlize
-  :ensure t
-  :defer t)
-;;      (setq org-html-head "<link rel=\"stylesheet\" type=\"text/css\" hrefl=\"css/stylesheet.css\" />")
-(setq org-html-include-timestamps nil)
-;; (setq org-html-htmlize-output-type 'css)
-(setq org-html-head-include-default-style nil)
-
-(use-package ox-publish)
-;; (use-package ox-rss)
-
-(setq org-html-html5-fancy t)
-
-;; Define some variables to write less :D
-(setq sbr-base-directory (expand-file-name "sbr" org-sites-directory)
-      sbr-publishing-directory (expand-file-name "sbr" org-publish-folder)
-      vdf-base-directory (expand-file-name "vdf" org-sites-directory)
-      vdf-site-directory (expand-file-name "blog" github-personal-folder)
-      vdf-publishing-directory (expand-file-name "posts" (expand-file-name "content" vdf-site-directory))
-      vdf-static-directory (expand-file-name "static" vdf-site-directory)
-      vdf-css-publishing-directory (expand-file-name "css" vdf-static-directory)
-      vdf-assets-publishing-directory vdf-static-directory)
-
-;; Project
-(setq org-publish-project-alist
-      `(("sbr-notes"
-         :base-directory ,sbr-base-directory
-         :base-extension "org"
-         :publishing-directory ,sbr-publishing-directory
-         :makeindex t
-         :exclude "FIXME"
-         :recursive t
-         :htmlized-source t
-         :publishing-function org-html-publish-to-html
-         :headline-levels 4
-         :auto-preamble t
-         :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"
-         :html-preamble "<div id=\"nav\">
-<ul>
-<li><a href=\"/\" class=\"home\">Home</a></li>
-</ul>
-</div>"
-         :html-postamble "<div id=\"footer\">
-%a %C %c
-</div>")
-        ("sbr-static"
-         :base-directory ,sbr-base-directory
-         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg"
-         :publishing-directory ,sbr-publishing-directory
-         :recursive t
-         :publishing-function org-publish-attachment
-         )
-        ("sbr" :components ("sbr-notes" "sbr-static"))
-        ("vdf-notes"
-         :base-directory ,vdf-base-directory
-         :base-extension "org"
-         :publishing-directory ,vdf-publishing-directory
-         :exclude "FIXME"
-         :section-numbers nil
-         :with-toc nil
-         :with-drawers t
-         :htmlized-source t
-         :org-html-htmlize-output-type 'css
-         :html-html5-fancy t
-         :publishing-function org-html-publish-to-html
-         :headline-levels 4
-         :body-only t)
-        ("vdf-static-css"
-         :base-directory ,vdf-base-directory
-         :base-extension "css"
-         :publishing-directory ,vdf-css-publishing-directory
-         :recursive t
-         :publishing-function org-publish-attachment
-         )
-        ("vdf-static-assets"
-         :base-directory ,vdf-base-directory
-         :base-extension "png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg"
-         :publishing-directory ,vdf-assets-publishing-directory
-         :recursive t
-         :publishing-function org-publish-attachment
-         )
-        ("vdf" :components ("vdf-notes" "vdf-static-css" "vdf-static-assets"))
-        ))
-
-(provide 'org-config)
.emacs.d/config/org-config.elc
Binary file
.emacs.d/config/org-config.org
@@ -1,711 +0,0 @@
-#+TITLE: org-mode configuration ꙮ
-
-#+BEGIN_QUOTE
-Org-mode is a powerful system for organizing your complex life with
-simple plain-text files. It seamlessly integrates all your notes,
-mindmaps, TODO lists, calendar, day planner, and project schedules
-into a single system that can be easily searched (e.g. by grep),
-encrypted (e.g. by GnuPG), backed up and synced (e.g. by Dropbox),
-imported/exported, and accessed on the go (e.g. on an iPhone or
-Android smartphone). It can even be used for authoring web pages and
-documents.
-#+END_QUOTE
-
-Depending on how this section grows, org-mode might need its own
-litterate org configuration file.
-
-Let's define a bunch of variable name that will be useful later (like
-where are =org-mode= file stored, etc.)
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (setq org-root-directory (expand-file-name "org" desktop-directory)
-        org-sites-directory-name "sites"
-        org-archive-directory-name "archive"
-        org-archive-file-pattern "/%s_archive::"
-        org-inbox-file "inbox.org"
-        org-main-file "personal.org"
-        org-todos-directory org-root-directory
-        org-notes-directory org-root-directory
-        org-sites-directory (expand-file-name org-sites-directory-name org-root-directory)
-        org-archive-directory (expand-file-name org-archive-directory-name org-root-directory)
-        org-docker-file "docker.org"
-        org-journal-file "journal.org"
-        org-publish-folder (substitute-env-in-file-name "$HOME/var/public_html")
-        sites-folder (substitute-env-in-file-name "$HOME/src/sites/"))
-#+END_SRC
-
-* Standard configuration
-
-First let's define the default directory for the =org= files, the one
-to be added to the agenda and the archives.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package org
-    :ensure t)
-  (require 'find-lisp)
-  (setq org-directory org-root-directory)
-  (setq org-agenda-files (find-lisp-find-files org-todos-directory "\.org$"))
-  (setq org-enforce-todo-dependencies t)
-  (setq org-enforce-todo-checkbox-dependencies t)
-
-  (setq org-log-redeadline (quote time))
-  (setq org-log-reschedule (quote time))
-
-  ;;warn me of any deadlines in next 7 days
-  (setq org-deadline-warning-days 7)
-  ;;show me tasks scheduled or due in next fortnight
-  (setq org-agenda-span (quote fortnight))
-  ;;don't show tasks as scheduled if they are already shown as a deadline
-  (setq org-agenda-skip-scheduled-if-deadline-is-shown t)
-  ;;don't give awarning colour to tasks with impending deadlines
-  ;;if they are scheduled to be done
-  (setq org-agenda-skip-deadline-prewarning-if-scheduled (quote pre-scheduled))
-  ;;don't show tasks that are scheduled or have deadlines in the
-  ;;normal todo list
-  (setq org-agenda-todo-ignore-deadlines (quote all))
-  (setq org-agenda-todo-ignore-scheduled (quote all))
-  ;;sort tasks in order of when they are due and then by priority
-  (setq org-agenda-sorting-strategy
-    (quote
-     ((agenda deadline-up priority-down)
-      (todo priority-down category-keep)
-      (tags priority-down category-keep)
-      (search category-keep))))
-#+END_SRC
-
-Let's also define the default /todo-keywords/ and the workflow between
-them.
-
-- =TODO= : task not started yet, part of the backlog :)
-- =PROGRESS= : task that are currently in progress, should be a minimum
-- =BLOCKED= : task that I start working on but cannot anymore (for
-  some reason), thus they are blocked
-- =REVIEW= : task that should be done, but I need or wait for a review
-  (by someone else or by me)
-- =DONE= : task that are completed.
-- =ARCHIVED= : same as done but keep it here (and not moving into
-  archive)
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (setq org-todo-keywords
-        (quote ((sequence "TODO(t)" "PROGRESS(p)" "PAUSED" "BLOCKED" "REVIEW" "|" "DONE(d!)" "ARCHIVED")
-                (sequence "REPORT(r!)" "BUG" "KNOWNCAUSE" "|" "FIXED(f!)")
-                (sequence "|" "CANCELLED(c@)"))))
-  (setq org-todo-keyword-faces
-        (quote (("TODO" . org-todo)
-                ("PROGRESS" . "green")
-                ("PAUSED" . "cyan")
-                ("BLOCKED" . "red")
-                ("REVIEW" . "yellow")
-                ("DONE" . org-done)
-                ("ARCHIVED" . org-done)
-                ("CANCELLED" . "black")
-                ("REPORT" . org-todo)
-                ("BUG" . "red")
-                ("KNOWNCAUSE" . "yellow")
-                ("FIXED" . org-done))))
-
-  (setq org-todo-state-tags-triggers
-        (quote (("CANCELLED" ("CANCELLED" . t)))))
-#+END_SRC
-
-If a parent has all it's children =DONE=, make it =DONE= too.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (defun org-summary-todo (n-done n-not-done)
-    "Switch entry to DONE when all subentries are done, to PROGRESS otherwise."
-    (let (org-log-done org-log-states)   ; turn off logging
-      (if (not (string-blank-p (org-get-todo-state)))
-          (org-todo (if (= n-not-done 0) "DONE" "PROGRESS")))
-      ))
-
-  (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
-#+END_SRC
-
-* Archives
-
-We want to be able to archive some /done/ projects. Let's load
-org-archive and configure it.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (require 'org-archive)
-  (setq org-archive-location (concat org-archive-directory org-archive-file-pattern))
-#+END_SRC
-
-Let's also have some /auto-archive/ stuff, taken inspiration from [[http://article.gmane.org/gmane.emacs.orgmode/2963][john wiegley]].
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (defvar org-my-archive-expiry-days 9
-    "The number of days after which a completed task should be auto-archived.
-  This can be 0 for immediate, or a floating point value.")
-
-  (defun org-archive-done-tasks ()
-    (interactive)
-    (save-excursion
-      (goto-char (point-min))
-      (while (re-search-forward "\* \\(DONE\\|CANCELED\\) " nil t)
-     (if (save-restriction
-              (save-excursion
-          (org-narrow-to-subtree)
-          (search-forward ":LOGBOOK:" nil t)))
-            (forward-line)
-          (org-archive-subtree)
-          (goto-char (line-beginning-position))))))
-
-  (defalias 'archive-done-tasks 'org-archive-done-tasks)
-#+END_SRC
-
-* Captures
-
-Let's define some useful function… Mainly add support for allowing
-prompt input in templates (see [[http://storax.github.io/blog/2016/05/02/org-capture-tricks/][org-capture-tricks]]).
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (defvar oc-capture-prmt-history nil
-    "History of prompt answers for org capture.")
-  (defun oc/prmt (prompt variable)
-    "PROMPT for string, save it to VARIABLE and insert it."
-    (make-local-variable variable)
-    (set variable (read-string (concat prompt ": ") nil oc-capture-prmt-history)))
-  (defun oc/inc (what text &rest fmtvars)
-    "Ask user to include WHAT.  If user agrees return TEXT."
-    (when (y-or-n-p (concat "Include " what "?"))
-      (apply 'format text fmtvars)))
-#+END_SRC
-
-Setup captures templates..
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (setq org-capture-templates
-     '(;; other entries
-          ("t" "inbox"
-        entry (file (expand-file-name org-inbox-file org-todos-directory))
-           "* %?\n%i\n%a")
-          ("d" "task"
-        entry (file+headline (expand-file-name org-main-file org-todos-directory) "Tasks")
-           "* TODO %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n")
-          ("d" "docker task"
-        entry (file+headline (expand-file-name org-docker-file org-todos-directory) "Tasks")
-           "* TODO gh:docker/%(oc/prmt \"project\" 'd-prj)#%(oc/prmt \"issue/pr\" 'd-issue) %?%(oc/inc \"feature content\" \" [/]\n- [ ] Implementation\n- [ ] Tests\n- [ ] Docs\")")
-          ("j" "Journal entry"
-           entry (file+datetree+prompt (expand-file-name org-journal-file org-root-directory))
-           "* %?\n%i\nFrom: %a\n%U" :empty-lines 1)
-          ;; other entries
-          ))
-#+END_SRC
-
-* Links
-
-#+BEGIN_QUOTE
-One little-know feature of org-mode is that you can define new types
-of links with the aptly named org-add-link-type. The applications of
-this virtue are many.
-#+END_QUOTE
-
-Let's define one for =grep= and =pt=.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (org-add-link-type
-   "grep" 'my/follow-grep-link
-   )
-  (defun my/follow-grep-link (regexp)
-    "Run `rgrep' with REGEXP and FOLDER as argument,
-  like this : [[grep:REGEXP:FOLDER]]."
-    (setq expressions (split-string regexp ":"))
-    (setq exp (nth 0 expressions))
-    (grep-compute-defaults)
-    (if (= (length expressions) 1)
-        (progn
-          (rgrep exp "*" (expand-file-name "./")))
-      (progn
-        (setq folder (nth 1 expressions))
-        (rgrep exp "*" (expand-file-name folder))))
-    )
-
-  (use-package pt
-    :load-path "~/.emacs.d/lisp/pt/")
-
-  ;; pt-regexp (regexp directory &optional args)
-  (org-add-link-type
-   "pt" 'my/follow-pt-link)
-  (defun my/follow-pt-link (regexp)
-    "Run `pt-regexp` with REXEP and FOLDER as argument,
-  like this : [[pt:REGEXP:FOLDER]]"
-    (setq expressions (split-string regexp ":"))
-    (setq exp (nth 0 expressions))
-    (if (= (length expressions) 1)
-        (progn
-          (pt-regexp exp (expand-file-name "./")))
-      (progn
-        (setq folder (nth 1 expressions))
-        (pt-regexp exp (file-name-as-directory (expand-file-name folder)))))
-    )
-#+END_SRC
-
-Let's define some for youtube and other media websites.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (defvar yt-iframe-format
-    ;; You may want to change your width and height.
-    (concat "<iframe width=\"440\""
-            " height=\"335\""
-            " src=\"https://www.youtube.com/embed/%s\""
-            " frameborder=\"0\""
-            " allowfullscreen>%s</iframe>"))
-
-  (org-add-link-type
-   "youtube"
-   (lambda (handle)
-     (browse-url
-      (concat "https://www.youtube.com/embed/"
-              handle)))
-   (lambda (path desc backend)
-     (cl-case backend
-       (html (format yt-iframe-format
-                     path (or desc "")))
-       (latex (format "\href{%s}{%s}"
-                      path (or desc "video"))))))
-#+END_SRC
-
-Let's define some for github.com sites.
-
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (org-add-link-type
-   "gh" 'my/follow-gh-link)
-  (defun my/follow-gh-link (issue)
-    "Browse github issue/pr specified"
-    (setq expressions (split-string issue "#"))
-    (setq project (nth 0 expressions))
-    (setq issue (nth 1 expressions))
-    (browse-url
-     (format "https://github.com/%s/issues/%s" project issue)))
-#+END_SRC
-
-
-Add some more abbreviation to links
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (setq org-link-abbrev-alist
-        '(("gmane" . "http://thread.gmane.org/%s")
-          ("google" . "https://www.google.com/search?q=%s")
-          ("github" . "http://github.com/%s")
-          ))
-#+END_SRC
-
-
-And some for =org-mode= itself.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  ;; from http://endlessparentheses.com/use-org-mode-links-for-absolutely-anything.html
-  (org-add-link-type
-   "tag" 'endless/follow-tag-link)
-
-  (defun endless/follow-tag-link (tag)
-    "Display a list of TODO headlines with tag TAG.
-  With prefix argument, also display headlines without a TODO keyword."
-    (org-tags-view (null current-prefix-arg) tag))
-#+END_SRC
-
-* Code blocks
-
- We are using a lot of code block in org-mode, in this file for
- example ; let's /fontify/ the code blocks first.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (setq org-src-fontify-natively t)
-  (setq org-html-htmlize-output-type 'css)
-  (setq org-html-htmlize-font-prefix "org-")
-  (org-babel-do-load-languages
-   'org-babel-load-languages
-   '( (perl . t)
-      (ruby . t)
-      (sh . t)
-      (python . t)
-      (emacs-lisp . t)
-      ;; (golang . t)
-      (haskell . t)
-      (ditaa . t)
-      ))
-#+END_SRC
-
-Add a function to easily add a code block and bind it.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (defun my/org-insert-src-block (src-code-type)
-    "Insert a `SRC-CODE-TYPE' type source code block in org-mode."
-    (interactive
-     (let ((src-code-types
-            '("emacs-lisp" "python" "C" "sh" "java" "js" "clojure" "C++" "css"
-              "calc" "dot" "gnuplot" "ledger" "R" "sass" "screen" "sql" "awk"
-              "ditaa" "haskell" "latex" "lisp" "matlab" "org" "perl" "ruby"
-              "sqlite" "rust" "scala" "golang" "restclient")))
-       (list (ido-completing-read "Source code type: " src-code-types))))
-    (progn
-      (newline-and-indent)
-      (insert (format "#+BEGIN_SRC %s\n" src-code-type))
-      (newline-and-indent)
-      (insert "#+END_SRC\n")
-      (previous-line 2)
-      (org-edit-src-code)))
-
-  (defun my/org-insert-html-block ()
-    "Insert a `HTML-BLOCK` type in org-mode."
-    (interactive
-     (progn
-       (newline-and-indent)
-       (insert "#+BEGIN_HTML\n")
-       (newline-and-indent)
-       (insert "#+END_HTML\n")
-       (previous-line 2))))
-
-
-  (defun my/org-insert-blockquote-block ()
-    "Insert a `BLOCKQUOTE-BLOCK` type in org-mode."
-    (interactive
-     (progn
-       (newline-and-indent)
-       (insert "#+BEGIN_BLOCKQUOTE\n")
-       (newline-and-indent)
-       (insert "#+END_BLOCKQUOTE\n")
-       (previous-line 2))))
-
-
-
-  (add-hook 'org-mode-hook
-            '(lambda ()
-               (local-set-key (kbd "C-c s e") 'org-edit-src-code)
-               (local-set-key (kbd "C-c s i") 'my/org-insert-src-block)
-               (local-set-key (kbd "C-c s h") 'my/org-insert-html-block)
-               (local-set-key (kbd "C-c s b") 'my/org-insert-blockquote-block))
-            'append)
-#+END_SRC
-
-* Archives
-
-We want to be able to archive some /done/ projects. Let's load
-org-archive and configure it.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-     (require 'org-archive)
-     (setq org-archive-location (concat org-archive-directory org-archive-file-pattern))
-#+END_SRC
-
-Let's also have some /auto-archive/ stuff, taken inspiration from [[http://article.gmane.org/gmane.emacs.orgmode/2963][john
-wiegley]].
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (defvar org-my-archive-expiry-days 9
-    "The number of days after which a completed task should be auto-archived.
-  This can be 0 for immediate, or a floating point value.")
-
-  (defun org-archive-done-tasks ()
-    (interactive)
-    (save-excursion
-      (goto-char (point-min))
-      (while (re-search-forward "\* \\(DONE\\|CANCELED\\) " nil t)
-     (if (save-restriction
-              (save-excursion
-          (org-narrow-to-subtree)
-          (search-forward ":LOGBOOK:" nil t)))
-            (forward-line)
-          (org-archive-subtree)
-          (goto-char (line-beginning-position))))))
-
-  (defalias 'archive-done-tasks 'org-archive-done-tasks)
-#+END_SRC
-
-* Tags
-
-Tags should be displayed from the 90 column.
-
-#+BEGIN_SRC emacs-lisp
-  (setq org-tags-column -90)
-#+END_SRC
-
-Define a list of default tags that should apply for all org-mode
-buffers.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  ;; Wish I could use taggroup but it doesn't seem to work..
-  (setq org-tag-alist '(
-                     ("important" . ?i)
-                     ("ongoing" . ?o)         ;; ongoing "project", use to filter big project that are on the go
-                     ("next" . ?n)            ;; next "project"/"task", use to filter next things to do
-                     ("@home" . ?h)           ;; needs to be done at home
-                     ("@work" . ?w)           ;; needs to be done at work
-                     ("dev" . ?e)             ;; this is a development task
-                     ("infra" . ?a)           ;; this is a sysadmin/infra task
-                     ("document" . ?d)        ;; needs to produce a document (article, post, ..)
-                     ("download" . ?D)        ;; needs to download something
-                     ("media" . ?m)           ;; this is a media (something to watch, listen, record, ..)
-                     ("mail" . ?M)            ;; mail-related (to write & send or to read)
-                     ("triage" . ?t)          ;; need "triage", tag it to easily find them
-                     ("task" . ?a)            ;; a simple task (no project), the name is kinda misleading
-                     ;; docker-related tags
-                     ("docker")
-                     ("kubernetes")
-                     ("compose")
-                     ("moby")
-                     ("linuxkit")
-                     ("docs")
-                     ;; languages
-                     ("golang")
-                     ("python")
-                     ("java")
-                     ("clojure")
-                     ("emacs-lisp")
-                     ;; sites tags
-                     ("sites")
-                     ("vdf")
-                     ;; configs tags
-                     ("configs")
-                     ("emacs")
-                     ("i3")
-                     ("shell")
-                     ;; services
-                     ("services")
-                     ))
-#+END_SRC
-
-Note that =important= and =urgent= helps me prioritize my /todos/, in
-a /quadrant fashion way/.
-
-| Important          | *Kaizen*        | *Panic*             |
-| /tag important/    | improvements    | emergency           |
-|--------------------+-----------------+---------------------|
-| Less Important     | *Organics*      | Social *investment* |
-| /no tag important/ | inspiration     | Social activities   |
-|--------------------+-----------------+---------------------|
-|                    | Less Urgent     | Urgent              |
-|                    | /no tag urgent/ | /tag urgent/        |
-
-* Clocks
-
-Let's configure org-mode clocks a little bit. Let's first setup some
-common things.
-
-#+BEGIN_SRC emacs-lisp :tange yes
-  ;; Sometimes I change tasks I'm clocking quickly
-  ;; this removes clocked tasks with 0:00 duration
-  (setq org-clock-out-remove-zero-time-clocks 1)
-  ;; Clock out when moving task to a done state
-  (setq org-clock-out-when-done 1)
-  ;; If idle for more than 15 minutes, resolve the things by asking what to do
-  ;; with the clock time
-  (setq org-clock-idle-time 15)
-#+END_SRC
-
-We also want to set the state to =PROGRESS= when we are clocking in.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (defadvice org-clock-in (after sacha activate)
-    "Set this task's status to 'PROGRESS'."
-    (org-todo "PROGRESS"))
-#+END_SRC
-
-* Agenda(s)
-
-Set custom agendas.. For the syntax, look in worg : [[http://orgmode.org/worg/org-tutorials/advanced-searching.html][Advanced searching]]
-and [[http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html][Custom Agenda Commands]].
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (setq org-agenda-custom-commands
-        '(("d" "Daily agenda and all TODOs"
-           ((tags "urgent+PRIORITY=\"A\""
-                  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
-                   (org-agenda-overriding-header "High-priority unfinished tasks:")))
-            (agenda "" ((org-agenda-ndays 1)))
-            (tags "next"
-                  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
-                   (org-agenda-overriding-header "Today's tasks")))
-            (tags "PRIORITY=\"A\""
-                  ((org-agenda-skip-function '(or (org-agenda-skip-entry-if 'tag 'urgent)
-                                                  (org-agenda-skip-entry-if 'todo 'done)))
-                   (org-agenda-overriding-header "Kaizen tasks -improvement-")))
-            (alltodo ""
-                     ((org-agenda-sorting-strategy '(priority-down))
-                      (org-agenda-skip-function '(or (org-agenda-skip-entry-if 'todo 'progress)
-                                                     (org-agenda-skip-entry-if 'todo 'review)
-                                                     (org-agenda-skip-entry-if 'todo 'done)
-                                                     (vde/org-skip-subtree-if-habit)
-                                                     (vde/org-skip-subtree-if-priority ?A)
-                                                     (org-agenda-skip-if nil '(scheduled deadline))))
-                      (org-agenda-overriding-header "ALL normal priority tasks:"))))
-           ((org-agenda-compact-blocks t)))
-          ("t" todo "TODO"
-           ((org-agenda-sorting-strategy '(priority-down))
-            (org-agenda-prefix-format "  Mixed: ")))
-          ("p" todo "PROGRESS"
-           ((org-agenda-sorting-strategy '(priority-down))
-            (org-agenda-prefix-format "  Mixed: ")))
-          ("r" todo "REVIEW"
-           ((org-agenda-sorting-strategy '(priority-down))
-            (org-agenda-prefix-format "  Mixed: ")))
-          ("u" todo "PAUSED"
-           ((org-agenda-sorting-strategy '(priority-down))
-            (org-agenda-prefix-format "  Mixed: ")))
-          ("b" todo "BLOCKED"
-           ((org-agenda-sorting-strategy '(priority-down))
-            (org-agenda-prefix-format "  Mixed: ")))
-          ("n" "Next tasks" tags-todo "next"
-           ((org-agenda-sorting-strategy '(priority-down))
-            (org-tags-exclude-from-inheritance '("next"))
-            (org-agenda-prefix-format "  Mixed: ")))
-          ("i" "Triage tasks — to look" tags-todo "triage"
-           ((org-agenda-sorting-strategy '(priority-down))
-            (org-agenda-prefix-format "  Mixed: ")))
-          ;; Timelines
-          ("d" "Timeline for today" ((agenda "" ))
-           ((org-agenda-ndays 1)
-            (org-agenda-show-log t)
-            (org-agenda-log-mode-items '(clock closed))
-            (org-agenda-clockreport-mode t)
-            (org-agenda-entry-types '())))
-          ("w" "Weekly review" agenda ""
-           ((org-agenda-span 7)
-            (org-agenda-log-mode 1)))
-          ("W" "Weekly review sans DAILY" agenda ""
-           ((org-agenda-span 7)
-            (org-agenda-log-mode 1)
-            (org-agenda-tag-filter-preset '("-DAILY"))))
-          ;; Panic tasks : urgent & important
-          ;; Probably the most important to do, but try not have to much of them..
-          ("P" "Panic -emergency-" tags-todo "urgent+PRIORITY=\"A\""
-           ((org-agenda-sorting-strategy '(priority-down))
-            (org-agenda-prefix-format "  Mixed: ")))
-          ;; Kaizen tasks : important but not urgent
-          ("K" "Kaizen -improvement-" tags-todo "PRIORITY=\"A\"&-urgent"
-           ((org-agenda-sorting-strategy '(priority-down))
-            (org-agenda-prefix-format "  Mixed: ")))
-          ;; Social investment : urgent
-          ("S" "Social -investment-" tags-todo "-PRIORITY=\"A\"+urgent"
-           ((org-agenda-sorting-strategy '(priority-down))
-            (org-agenda-prefix-format "  Mixed: ")))
-          ;; Organics
-          ("O" "Organics -inspiration-" tags-todo "-PRIORITY=\"A\"&-urgent"
-           ((org-agenda-sorting-strategy '(priority-down))
-            (org-agenda-prefix-format "  Mixed: ")))
-          ("N" search ""
-           ((org-agenda-text-search-extra-files nil)))))
-
-  (defun vde/org-skip-subtree-if-priority (priority)
-    "Skip an agenda subtree if it has a priority of PRIORITY.
-
-  PRIORITY may be one of the characters ?A, ?B, or ?C."
-    (let ((subtree-end (save-excursion (org-end-of-subtree t)))
-          (pri-value (* 1000 (- org-lowest-priority priority)))
-          (pri-current (org-get-priority (thing-at-point 'line t))))
-      (if (= pri-value pri-current)
-          subtree-end
-        nil)))
-
-  (defun vde/org-skip-subtree-if-habit ()
-    "Skip an agenda entry if it has a STYLE property equal to \"habit\"."
-    (let ((subtree-end (save-excursion (org-end-of-subtree t))))
-      (if (string= (org-entry-get nil "STYLE") "habit")
-          subtree-end
-        nil)))
-#+END_SRC
-
-* Publishing
-
-Let's configure the publishing part of org-mode. The first org-mode
-files we want to publish are in =~/desktop/org/sites/{project}=, and
-we want to publish them in =~/var/public_html/{project}= for now.
-
-Few org-export and org-html configuration.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package htmlize
-    :ensure t
-    :defer t)
-  ;;      (setq org-html-head "<link rel=\"stylesheet\" type=\"text/css\" hrefl=\"css/stylesheet.css\" />")
-  (setq org-html-include-timestamps nil)
-  ;; (setq org-html-htmlize-output-type 'css)
-  (setq org-html-head-include-default-style nil)
-#+END_SRC
-
-And the projects.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package ox-publish)
-  ;; (use-package ox-rss)
-
-  (setq org-html-html5-fancy t)
-
-  ;; Define some variables to write less :D
-  (setq sbr-base-directory (expand-file-name "sbr" org-sites-directory)
-        sbr-publishing-directory (expand-file-name "sbr" org-publish-folder)
-        vdf-base-directory (expand-file-name "vdf" org-sites-directory)
-        vdf-site-directory (expand-file-name "blog" github-personal-folder)
-        vdf-publishing-directory (expand-file-name "posts" (expand-file-name "content" vdf-site-directory))
-        vdf-static-directory (expand-file-name "static" vdf-site-directory)
-        vdf-css-publishing-directory (expand-file-name "css" vdf-static-directory)
-        vdf-assets-publishing-directory vdf-static-directory)
-
-  ;; Project
-  (setq org-publish-project-alist
-        `(("sbr-notes"
-           :base-directory ,sbr-base-directory
-           :base-extension "org"
-           :publishing-directory ,sbr-publishing-directory
-           :makeindex t
-           :exclude "FIXME"
-           :recursive t
-           :htmlized-source t
-           :publishing-function org-html-publish-to-html
-           :headline-levels 4
-           :auto-preamble t
-           :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"
-           :html-preamble "<div id=\"nav\">
-  <ul>
-  <li><a href=\"/\" class=\"home\">Home</a></li>
-  </ul>
-  </div>"
-           :html-postamble "<div id=\"footer\">
-  %a %C %c
-  </div>")
-          ("sbr-static"
-           :base-directory ,sbr-base-directory
-           :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg"
-           :publishing-directory ,sbr-publishing-directory
-           :recursive t
-           :publishing-function org-publish-attachment
-           )
-          ("sbr" :components ("sbr-notes" "sbr-static"))
-          ("vdf-notes"
-           :base-directory ,vdf-base-directory
-           :base-extension "org"
-           :publishing-directory ,vdf-publishing-directory
-           :exclude "FIXME"
-           :section-numbers nil
-           :with-toc nil
-           :with-drawers t
-           :htmlized-source t
-           :org-html-htmlize-output-type 'css
-           :html-html5-fancy t
-           :publishing-function org-html-publish-to-html
-           :headline-levels 4
-           :body-only t)
-          ("vdf-static-css"
-           :base-directory ,vdf-base-directory
-           :base-extension "css"
-           :publishing-directory ,vdf-css-publishing-directory
-           :recursive t
-           :publishing-function org-publish-attachment
-           )
-          ("vdf-static-assets"
-           :base-directory ,vdf-base-directory
-           :base-extension "png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg"
-           :publishing-directory ,vdf-assets-publishing-directory
-           :recursive t
-           :publishing-function org-publish-attachment
-           )
-          ("vdf" :components ("vdf-notes" "vdf-static-css" "vdf-static-assets"))
-          ))
-#+END_SRC
-* Provide configuration
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (provide 'org-config)
-#+END_SRC
.emacs.d/config/vcs-config.el
@@ -1,17 +0,0 @@
-
-(use-package magit
-  :ensure t
-  :diminish "🔮 "
-  :commands magit-status
-  :config
-  (setq magit-completing-read-function 'ivy-completing-read)
-  (add-to-list 'magit-no-confirm 'stage-all-changes)
-  (setq magit-push-always-verify nil)
-  (setq magit-last-seen-setup-instructions "2.1.0"))
-
-(use-package git-annex
-  :ensure t)
-(use-package magit-annex
-  :ensure t)
-
-(provide 'vcs-config)
.emacs.d/config/vcs-config.elc
Binary file
.emacs.d/config/vcs-config.org
@@ -1,44 +0,0 @@
-#+TITLE: vcs configuration
-
-* Magit
-
-Let's configure [[https://magit.vc/][the best interface to git ever]]. Enough said.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package magit
-    :ensure t
-    :diminish "🔮 "
-    :commands magit-status
-    :config
-    (setq magit-completing-read-function 'ivy-completing-read)
-    (add-to-list 'magit-no-confirm 'stage-all-changes)
-    (setq magit-push-always-verify nil)
-    (setq magit-last-seen-setup-instructions "2.1.0"))
-#+END_SRC
-
-* Git annex
-
-[[http://git-annex.branchable.com/][git-annex]] is a wonderful piece of software — I use it a lot.
-
-#+BEGIN_QUOTE
-git-annex allows managing files with git, without checking the file contents
-into git. While that may seem paradoxical, it is useful when dealing with files
-larger than git can currently easily handle, whether due to limitations in
-memory, time, or disk space.
-#+END_QUOTE
-
-In Emacs, it integrates with =magit= and =dired=. The subcommand for annex in
-magit is =@=.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package git-annex
-    :ensure t)
-  (use-package magit-annex
-    :ensure t)
-#+END_SRC
-
-* Provide configuration
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (provide 'vcs-config)
-#+END_SRC
.emacs.d/config/visual-config.el
@@ -1,60 +0,0 @@
-
-(use-package dashboard
-  :ensure t
-  :config
-  (setq dashboard-banner-logo-title "Welcome to Emacs, Vincent !"
-        dashboard-startup-banner (expand-file-name "images/okumura_rin_4_by_naruto_lover16-d4ktg50.png" user-emacs-directory))
-  (dashboard-setup-startup-hook))
-
-(use-package doom-themes
-  :ensure t
-  :config
-  (setq doom-themes-enable-bolt t)
-  (setq doom-themes-enable-italic t)
-  (load-theme 'doom-one t))
-
-(use-package solaire-mode
-  :ensure t
-  :config
-  (setq solaire-mode-remap-modeline nil)
-  (add-hook 'after-change-major-mode-hook #'turn-on-solaire-mode)
-  (add-hook 'after-revert-hook #'turn-on-solaire-mode)
-  (add-hook 'minibuffer-setup-hook #'solaire-mode-in-minibuffer)
-  (add-hook 'ediff-prepare-buffer-hook #'solaire-mode)
-  (advice-add #'persp-load-state-from-file :after #'solaire-mode-restore-persp-mode-buffers))
-
-(line-number-mode 1)
-(column-number-mode 1)
-(global-hl-line-mode 1)
-
-(setq font-lock-maximum-decoration 2)
-
-(setq-default indicate-buffer-boundaries 'left)
-(setq-default indicate-empty-lines +1)
-
-(defun vde/byte-recompile ()
-  (interactive)
-  (byte-recompile-directory user-emacs-directory 0)
-  (byte-recompile-directory (expand-file-name "lisp" user-emacs-directory) 0)
-  (byte-recompile-directory (expand-file-name "config" user-emacs-directory) 0)
-  (byte-recompile-directory (expand-file-name "lisp/use-package" user-emacs-directory) 0))
-
-(when (display-graphic-p)
-  (defvar vde/fixed-font-family
-    (cond ((x-list-fonts "Ubuntu Mono") "Ubuntu Mono-14")
-          ((x-list-fonts "Hasklig") "Hasklig-14")
-          ((x-list-fonts "Consolas") "Consolas-14"))
-    "Fixed width font based on what is install")
-
-  ;; FIXME(vdemeester) extract the condition out 👼
-  (set-frame-font vde/fixed-font-family)
-  (set-face-attribute 'default nil :font vde/fixed-font-family :height 110)
-  (set-face-font 'default vde/fixed-font-family))
-
-(line-number-mode t)
-(column-number-mode t)
-
-(global-linum-mode -1)
-(add-hook 'prog-mode-hook (lambda () (linum-mode t)))
-
-(provide 'visual-config)
.emacs.d/config/visual-config.elc
Binary file
.emacs.d/config/visual-config.org
@@ -1,133 +0,0 @@
-#+TITLE: Visual configuration 😎
-
-Let's customize some graphical element, like dashboard, mode-line, and stuff
-
-* Dashboard							  :CANCELLED:
-
-The default Emacs splash-screen is not that useful. A useful
-splash-screen would display some recent files opened, bookmaks,
-projects and org-agenda items. Luckily, there is already a project
-that does that, [[https://github.com/rakanalh/emacs-dashboard][emacs-dashboard]].
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package dashboard
-    :ensure t
-    :config
-    (setq dashboard-banner-logo-title "Welcome to Emacs, Vincent !"
-          dashboard-startup-banner (expand-file-name "images/okumura_rin_4_by_naruto_lover16-d4ktg50.png" user-emacs-directory))
-    (dashboard-setup-startup-hook))
-#+END_SRC
-
-* Theme
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package doom-themes
-    :ensure t
-    :config
-    (setq doom-themes-enable-bolt t)
-    (setq doom-themes-enable-italic t)
-    (load-theme 'doom-one t))
-#+END_SRC
-
-A good companion to =doom-one= theme is [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]]. It helps
-visually distinguish file-visiting from other types of windows (like
-popups or sidebars).
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (use-package solaire-mode
-    :ensure t
-    :config
-    (setq solaire-mode-remap-modeline nil)
-    (add-hook 'after-change-major-mode-hook #'turn-on-solaire-mode)
-    (add-hook 'after-revert-hook #'turn-on-solaire-mode)
-    (add-hook 'minibuffer-setup-hook #'solaire-mode-in-minibuffer)
-    (add-hook 'ediff-prepare-buffer-hook #'solaire-mode)
-    (advice-add #'persp-load-state-from-file :after #'solaire-mode-restore-persp-mode-buffers))
-#+END_SRC
-* Lines and columns
-
-We want to see somewhere the column and line number, and also
-highlight the current line to see it easily.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (line-number-mode 1)
-  (column-number-mode 1)
-  (global-hl-line-mode 1)
-#+END_SRC
-
-* Syntax highlighting
-
-Depending on the files opened and the syntax highlighting enabled,
-~font-lock-mode~ can be slow, we try to limit that, to keep Emacs
-reactive.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (setq font-lock-maximum-decoration 2)
-#+END_SRC
-
-* Fringe decorations
-
-[[http://www.emacswiki.org/emacs/TheFringe][The fringe]] is the vertical region at the right and left of the
-buffer. Emacs lets you customize it of course.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (setq-default indicate-buffer-boundaries 'left)
-  (setq-default indicate-empty-lines +1)
-#+END_SRC
-
-* Byte-compiles =.emacs.d= folder
-
-Let's also define a quick function to byte-compile files under
-=.emacs.d= folder to speed things up.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (defun vde/byte-recompile ()
-    (interactive)
-    (byte-recompile-directory user-emacs-directory 0)
-    (byte-recompile-directory (expand-file-name "lisp" user-emacs-directory) 0)
-    (byte-recompile-directory (expand-file-name "config" user-emacs-directory) 0)
-    (byte-recompile-directory (expand-file-name "lisp/use-package" user-emacs-directory) 0))
-#+END_SRC
-
-* Fonts
-
-Depending on the machine used I might not have the correct font
-installed or another one renders better. I am a long-time fan of
-=Ubuntu Mono= fonts but some fonts are starting to interesting me,
-mainly =[[https://github.com/tonsky/FiraCode][Fira]]= and =[[https://github.com/i-tu/Hasklig][Hasklig]]= which do symbol ligatures.
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (when (display-graphic-p)
-    (defvar vde/fixed-font-family
-      (cond ((x-list-fonts "Ubuntu Mono") "Ubuntu Mono-14")
-            ((x-list-fonts "Hasklig") "Hasklig-14")
-            ((x-list-fonts "Consolas") "Consolas-14"))
-      "Fixed width font based on what is install")
-
-    ;; FIXME(vdemeester) extract the condition out 👼
-    (set-frame-font vde/fixed-font-family)
-    (set-face-attribute 'default nil :font vde/fixed-font-family :height 110)
-    (set-face-font 'default vde/fixed-font-family))
-#+END_SRC
-
-Let's write some emojis to see how they look 🙆 😆 😁 ♨ ⛅ 🚲.
-
-* Line numbers
-
-Enable line-number and column number mode (in the mode line) but also
-add linum on programming modes (feel safe to enable on those but not
-on other file that could be too big).
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-  (line-number-mode t)
-  (column-number-mode t)
-
-  (global-linum-mode -1)
-  (add-hook 'prog-mode-hook (lambda () (linum-mode t)))
-#+END_SRC
-
-* Provide configuration
-
-#+BEGIN_SRC emacs-lisp :tangle yes
-(provide 'visual-config)
-#+END_SRC
.emacs.d/elpa/all-the-icons-20170817.642/data/data-alltheicons.el
@@ -1,70 +0,0 @@
-(defvar all-the-icons-data/alltheicons-alist
-  '(
-
-    ( "apache"             . "\xe909" )
-    ( "atom"               . "\xe917" )
-    ( "aws"                . "\xe90c" )
-    ( "bower"              . "\xe918" )
-    ( "c"                  . "\xe915" )
-    ( "c-line"             . "\xe90f" )
-    ( "clojure"            . "\xe919" )
-    ( "clojure-line"       . "\xe91a" )
-    ( "coffeescript"       . "\xe914" )
-    ( "cplusplus"          . "\xe913" )
-    ( "cplusplus-line"     . "\xe910" )
-    ( "csharp"             . "\xe911" )
-    ( "csharp-line"        . "\xe912" )
-    ( "css3"               . "\xe91b" )
-    ( "css3-alt"           . "\xe91c" )
-    ( "d3"                 . "\xe90e" )
-    ( "dlang"              . "\xe935" )
-    ( "elixir"             . "\xe936" )
-    ( "erlang"             . "\xe934" )
-    ( "git"                . "\xe907" )
-    ( "go"                 . "\xe91d" )
-    ( "google-drive"       . "\xe91e" )
-    ( "grunt"              . "\xe90d" )
-    ( "grunt-line"         . "\xe91f" )
-    ( "gulp"               . "\xe920" )
-    ( "haskell"            . "\xe921" )
-    ( "html5"              . "\xe932" )
-    ( "jasmine"            . "\xe904" )
-    ( "java"               . "\xe922" )
-    ( "javascript"         . "\xe906" )
-    ( "javascript-badge"   . "\xe923" )
-    ( "javascript-shield"  . "\xe924" )
-    ( "less"               . "\xe90b" )
-    ( "nginx"              . "\xe933" )
-    ( "nodejs"             . "\xe925" )
-    ( "perl"               . "\xe905" )
-    ( "perldocs"           . "\xe926" )
-    ( "postgresql"         . "\xe938" )
-    ( "prolog"             . "\xe927" )
-    ( "python"             . "\xe928" )
-    ( "react"              . "\xe929" )
-    ( "ruby"               . "\xe92a" )
-    ( "ruby-alt"           . "\xe92b" )
-    ( "rust"               . "\xe92c" )
-    ( "sass"               . "\xe92d" )
-    ( "scala"              . "\xe908" )
-    ( "script"             . "\xe90a" )
-    ( "spring"             . "\xe937" )
-    ( "stylus"             . "\xe92e" )
-    ( "svg"                . "\xe903" )
-    ( "swift"              . "\xe92f" )
-    ( "terminal"           . "\xe930" )
-    ( "terminal-alt"       . "\xe931" )
-    ( "battery-charging"   . "\xe939" )
-
-    ( "arrow-left"  . "\xe93a" )
-    ( "arrow-right" . "\xe93b" )
-    ( "cup-left"    . "\xe93c" )
-    ( "cup-right"   . "\xe93d" )
-    ( "slant-left"  . "\xe93e" )
-    ( "slant-right" . "\xe93f" )
-    ( "wave-left"   . "\xe940" )
-    ( "wave-right"  . "\xe941" )
-
-    ))
-
-(provide 'data-alltheicons)
.emacs.d/elpa/all-the-icons-20170817.642/data/data-alltheicons.elc
Binary file
.emacs.d/elpa/all-the-icons-20170817.642/data/data-faicons.el
@@ -1,641 +0,0 @@
-(defvar all-the-icons-data/fa-icon-alist
-  '(
-
-    ("500px" . "\xf26e")
-    ("adjust" . "\xf042")
-    ("adn" . "\xf170")
-    ("align-center" . "\xf037")
-    ("align-justify" . "\xf039")
-    ("align-left" . "\xf036")
-    ("align-right" . "\xf038")
-    ("amazon" . "\xf270")
-    ("ambulance" . "\xf0f9")
-    ("american-sign-language-interpreting" . "\xf2a3")
-    ("anchor" . "\xf13d")
-    ("android" . "\xf17b")
-    ("angellist" . "\xf209")
-    ("angle-double-down" . "\xf103")
-    ("angle-double-left" . "\xf100")
-    ("angle-double-right" . "\xf101")
-    ("angle-double-up" . "\xf102")
-    ("angle-down" . "\xf107")
-    ("angle-left" . "\xf104")
-    ("angle-right" . "\xf105")
-    ("angle-up" . "\xf106")
-    ("apple" . "\xf179")
-    ("archive" . "\xf187")
-    ("area-chart" . "\xf1fe")
-    ("arrow-circle-down" . "\xf0ab")
-    ("arrow-circle-left" . "\xf0a8")
-    ("arrow-circle-o-down" . "\xf01a")
-    ("arrow-circle-o-left" . "\xf190")
-    ("arrow-circle-o-right" . "\xf18e")
-    ("arrow-circle-o-up" . "\xf01b")
-    ("arrow-circle-right" . "\xf0a9")
-    ("arrow-circle-up" . "\xf0aa")
-    ("arrow-down" . "\xf063")
-    ("arrow-left" . "\xf060")
-    ("arrow-right" . "\xf061")
-    ("arrow-up" . "\xf062")
-    ("arrows" . "\xf047")
-    ("arrows-alt" . "\xf0b2")
-    ("arrows-h" . "\xf07e")
-    ("arrows-v" . "\xf07d")
-    ("assistive-listening-systems" . "\xf2a2")
-    ("asterisk" . "\xf069")
-    ("at" . "\xf1fa")
-    ("audio-description" . "\xf29e")
-    ("backward" . "\xf04a")
-    ("balance-scale" . "\xf24e")
-    ("ban" . "\xf05e")
-    ("bar-chart" . "\xf080")
-    ("barcode" . "\xf02a")
-    ("bars" . "\xf0c9")
-    ("battery-empty" . "\xf244")
-    ("battery-full" . "\xf240")
-    ("battery-half" . "\xf242")
-    ("battery-quarter" . "\xf243")
-    ("battery-three-quarters" . "\xf241")
-    ("bed" . "\xf236")
-    ("beer" . "\xf0fc")
-    ("behance" . "\xf1b4")
-    ("behance-square" . "\xf1b5")
-    ("bell" . "\xf0f3")
-    ("bell-o" . "\xf0a2")
-    ("bell-slash" . "\xf1f6")
-    ("bell-slash-o" . "\xf1f7")
-    ("bicycle" . "\xf206")
-    ("binoculars" . "\xf1e5")
-    ("birthday-cake" . "\xf1fd")
-    ("bitbucket" . "\xf171")
-    ("bitbucket-square" . "\xf172")
-    ("black-tie" . "\xf27e")
-    ("blind" . "\xf29d")
-    ("bluetooth" . "\xf293")
-    ("bluetooth-b" . "\xf294")
-    ("bold" . "\xf032")
-    ("bolt" . "\xf0e7")
-    ("bomb" . "\xf1e2")
-    ("book" . "\xf02d")
-    ("bookmark" . "\xf02e")
-    ("bookmark-o" . "\xf097")
-    ("braille" . "\xf2a1")
-    ("briefcase" . "\xf0b1")
-    ("btc" . "\xf15a")
-    ("bug" . "\xf188")
-    ("building" . "\xf1ad")
-    ("building-o" . "\xf0f7")
-    ("bullhorn" . "\xf0a1")
-    ("bullseye" . "\xf140")
-    ("bus" . "\xf207")
-    ("buysellads" . "\xf20d")
-    ("calculator" . "\xf1ec")
-    ("calendar" . "\xf073")
-    ("calendar-check-o" . "\xf274")
-    ("calendar-minus-o" . "\xf272")
-    ("calendar-o" . "\xf133")
-    ("calendar-plus-o" . "\xf271")
-    ("calendar-times-o" . "\xf273")
-    ("camera" . "\xf030")
-    ("camera-retro" . "\xf083")
-    ("car" . "\xf1b9")
-    ("caret-down" . "\xf0d7")
-    ("caret-left" . "\xf0d9")
-    ("caret-right" . "\xf0da")
-    ("caret-square-o-down" . "\xf150")
-    ("caret-square-o-left" . "\xf191")
-    ("caret-square-o-right" . "\xf152")
-    ("caret-square-o-up" . "\xf151")
-    ("caret-up" . "\xf0d8")
-    ("cart-arrow-down" . "\xf218")
-    ("cart-plus" . "\xf217")
-    ("cc" . "\xf20a")
-    ("cc-amex" . "\xf1f3")
-    ("cc-diners-club" . "\xf24c")
-    ("cc-discover" . "\xf1f2")
-    ("cc-jcb" . "\xf24b")
-    ("cc-mastercard" . "\xf1f1")
-    ("cc-paypal" . "\xf1f4")
-    ("cc-stripe" . "\xf1f5")
-    ("cc-visa" . "\xf1f0")
-    ("certificate" . "\xf0a3")
-    ("chain-broken" . "\xf127")
-    ("check" . "\xf00c")
-    ("check-circle" . "\xf058")
-    ("check-circle-o" . "\xf05d")
-    ("check-square" . "\xf14a")
-    ("check-square-o" . "\xf046")
-    ("chevron-circle-down" . "\xf13a")
-    ("chevron-circle-left" . "\xf137")
-    ("chevron-circle-right" . "\xf138")
-    ("chevron-circle-up" . "\xf139")
-    ("chevron-down" . "\xf078")
-    ("chevron-left" . "\xf053")
-    ("chevron-right" . "\xf054")
-    ("chevron-up" . "\xf077")
-    ("child" . "\xf1ae")
-    ("chrome" . "\xf268")
-    ("circle" . "\xf111")
-    ("circle-o" . "\xf10c")
-    ("circle-o-notch" . "\xf1ce")
-    ("circle-thin" . "\xf1db")
-    ("clipboard" . "\xf0ea")
-    ("clock-o" . "\xf017")
-    ("clone" . "\xf24d")
-    ("cloud" . "\xf0c2")
-    ("cloud-download" . "\xf0ed")
-    ("cloud-upload" . "\xf0ee")
-    ("code" . "\xf121")
-    ("code-fork" . "\xf126")
-    ("codepen" . "\xf1cb")
-    ("codiepie" . "\xf284")
-    ("coffee" . "\xf0f4")
-    ("cog" . "\xf013")
-    ("cogs" . "\xf085")
-    ("columns" . "\xf0db")
-    ("comment" . "\xf075")
-    ("comment-o" . "\xf0e5")
-    ("commenting" . "\xf27a")
-    ("commenting-o" . "\xf27b")
-    ("comments" . "\xf086")
-    ("comments-o" . "\xf0e6")
-    ("compass" . "\xf14e")
-    ("compress" . "\xf066")
-    ("connectdevelop" . "\xf20e")
-    ("contao" . "\xf26d")
-    ("copyright" . "\xf1f9")
-    ("creative-commons" . "\xf25e")
-    ("credit-card" . "\xf09d")
-    ("credit-card-alt" . "\xf283")
-    ("crop" . "\xf125")
-    ("crosshairs" . "\xf05b")
-    ("css3" . "\xf13c")
-    ("cube" . "\xf1b2")
-    ("cubes" . "\xf1b3")
-    ("cutlery" . "\xf0f5")
-    ("dashcube" . "\xf210")
-    ("database" . "\xf1c0")
-    ("deaf" . "\xf2a4")
-    ("delicious" . "\xf1a5")
-    ("desktop" . "\xf108")
-    ("deviantart" . "\xf1bd")
-    ("diamond" . "\xf219")
-    ("digg" . "\xf1a6")
-    ("dot-circle-o" . "\xf192")
-    ("download" . "\xf019")
-    ("dribbble" . "\xf17d")
-    ("dropbox" . "\xf16b")
-    ("drupal" . "\xf1a9")
-    ("edge" . "\xf282")
-    ("eject" . "\xf052")
-    ("ellipsis-h" . "\xf141")
-    ("ellipsis-v" . "\xf142")
-    ("empire" . "\xf1d1")
-    ("envelope" . "\xf0e0")
-    ("envelope-o" . "\xf003")
-    ("envelope-square" . "\xf199")
-    ("envira" . "\xf299")
-    ("eraser" . "\xf12d")
-    ("eur" . "\xf153")
-    ("exchange" . "\xf0ec")
-    ("exclamation" . "\xf12a")
-    ("exclamation-circle" . "\xf06a")
-    ("exclamation-triangle" . "\xf071")
-    ("expand" . "\xf065")
-    ("expeditedssl" . "\xf23e")
-    ("external-link" . "\xf08e")
-    ("external-link-square" . "\xf14c")
-    ("eye" . "\xf06e")
-    ("eye-slash" . "\xf070")
-    ("eyedropper" . "\xf1fb")
-    ("facebook" . "\xf09a")
-    ("facebook-official" . "\xf230")
-    ("facebook-square" . "\xf082")
-    ("fast-backward" . "\xf049")
-    ("fast-forward" . "\xf050")
-    ("fax" . "\xf1ac")
-    ("female" . "\xf182")
-    ("fighter-jet" . "\xf0fb")
-    ("file" . "\xf15b")
-    ("file-archive-o" . "\xf1c6")
-    ("file-audio-o" . "\xf1c7")
-    ("file-code-o" . "\xf1c9")
-    ("file-excel-o" . "\xf1c3")
-    ("file-image-o" . "\xf1c5")
-    ("file-o" . "\xf016")
-    ("file-pdf-o" . "\xf1c1")
-    ("file-powerpoint-o" . "\xf1c4")
-    ("file-text" . "\xf15c")
-    ("file-text-o" . "\xf0f6")
-    ("file-video-o" . "\xf1c8")
-    ("file-word-o" . "\xf1c2")
-    ("files-o" . "\xf0c5")
-    ("film" . "\xf008")
-    ("filter" . "\xf0b0")
-    ("fire" . "\xf06d")
-    ("fire-extinguisher" . "\xf134")
-    ("firefox" . "\xf269")
-    ("first-order" . "\xf2b0")
-    ("flag" . "\xf024")
-    ("flag-checkered" . "\xf11e")
-    ("flag-o" . "\xf11d")
-    ("flask" . "\xf0c3")
-    ("flickr" . "\xf16e")
-    ("floppy-o" . "\xf0c7")
-    ("folder" . "\xf07b")
-    ("folder-o" . "\xf114")
-    ("folder-open" . "\xf07c")
-    ("folder-open-o" . "\xf115")
-    ("font" . "\xf031")
-    ("font-awesome" . "\xf2b4")
-    ("fonticons" . "\xf280")
-    ("fort-awesome" . "\xf286")
-    ("forumbee" . "\xf211")
-    ("forward" . "\xf04e")
-    ("foursquare" . "\xf180")
-    ("frown-o" . "\xf119")
-    ("futbol-o" . "\xf1e3")
-    ("gamepad" . "\xf11b")
-    ("gavel" . "\xf0e3")
-    ("gbp" . "\xf154")
-    ("genderless" . "\xf22d")
-    ("get-pocket" . "\xf265")
-    ("gg" . "\xf260")
-    ("gg-circle" . "\xf261")
-    ("gift" . "\xf06b")
-    ("git" . "\xf1d3")
-    ("git-square" . "\xf1d2")
-    ("github" . "\xf09b")
-    ("github-alt" . "\xf113")
-    ("github-square" . "\xf092")
-    ("gitlab" . "\xf296")
-    ("glass" . "\xf000")
-    ("glide" . "\xf2a5")
-    ("glide-g" . "\xf2a6")
-    ("globe" . "\xf0ac")
-    ("google" . "\xf1a0")
-    ("google-plus" . "\xf0d5")
-    ("google-plus-official" . "\xf2b3")
-    ("google-plus-square" . "\xf0d4")
-    ("google-wallet" . "\xf1ee")
-    ("graduation-cap" . "\xf19d")
-    ("gratipay" . "\xf184")
-    ("h-square" . "\xf0fd")
-    ("hacker-news" . "\xf1d4")
-    ("hand-lizard-o" . "\xf258")
-    ("hand-o-down" . "\xf0a7")
-    ("hand-o-left" . "\xf0a5")
-    ("hand-o-right" . "\xf0a4")
-    ("hand-o-up" . "\xf0a6")
-    ("hand-paper-o" . "\xf256")
-    ("hand-peace-o" . "\xf25b")
-    ("hand-pointer-o" . "\xf25a")
-    ("hand-rock-o" . "\xf255")
-    ("hand-scissors-o" . "\xf257")
-    ("hand-spock-o" . "\xf259")
-    ("hashtag" . "\xf292")
-    ("hdd-o" . "\xf0a0")
-    ("header" . "\xf1dc")
-    ("headphones" . "\xf025")
-    ("heart" . "\xf004")
-    ("heart-o" . "\xf08a")
-    ("heartbeat" . "\xf21e")
-    ("history" . "\xf1da")
-    ("home" . "\xf015")
-    ("hospital-o" . "\xf0f8")
-    ("hourglass" . "\xf254")
-    ("hourglass-end" . "\xf253")
-    ("hourglass-half" . "\xf252")
-    ("hourglass-o" . "\xf250")
-    ("hourglass-start" . "\xf251")
-    ("houzz" . "\xf27c")
-    ("html5" . "\xf13b")
-    ("i-cursor" . "\xf246")
-    ("ils" . "\xf20b")
-    ("inbox" . "\xf01c")
-    ("indent" . "\xf03c")
-    ("industry" . "\xf275")
-    ("info" . "\xf129")
-    ("info-circle" . "\xf05a")
-    ("inr" . "\xf156")
-    ("instagram" . "\xf16d")
-    ("internet-explorer" . "\xf26b")
-    ("ioxhost" . "\xf208")
-    ("italic" . "\xf033")
-    ("joomla" . "\xf1aa")
-    ("jpy" . "\xf157")
-    ("jsfiddle" . "\xf1cc")
-    ("key" . "\xf084")
-    ("keyboard-o" . "\xf11c")
-    ("krw" . "\xf159")
-    ("language" . "\xf1ab")
-    ("laptop" . "\xf109")
-    ("lastfm" . "\xf202")
-    ("lastfm-square" . "\xf203")
-    ("leaf" . "\xf06c")
-    ("leanpub" . "\xf212")
-    ("lemon-o" . "\xf094")
-    ("level-down" . "\xf149")
-    ("level-up" . "\xf148")
-    ("life-ring" . "\xf1cd")
-    ("lightbulb-o" . "\xf0eb")
-    ("line-chart" . "\xf201")
-    ("link" . "\xf0c1")
-    ("linkedin" . "\xf0e1")
-    ("linkedin-square" . "\xf08c")
-    ("linux" . "\xf17c")
-    ("list" . "\xf03a")
-    ("list-alt" . "\xf022")
-    ("list-ol" . "\xf0cb")
-    ("list-ul" . "\xf0ca")
-    ("location-arrow" . "\xf124")
-    ("lock" . "\xf023")
-    ("long-arrow-down" . "\xf175")
-    ("long-arrow-left" . "\xf177")
-    ("long-arrow-right" . "\xf178")
-    ("long-arrow-up" . "\xf176")
-    ("low-vision" . "\xf2a8")
-    ("magic" . "\xf0d0")
-    ("magnet" . "\xf076")
-    ("male" . "\xf183")
-    ("map" . "\xf279")
-    ("map-marker" . "\xf041")
-    ("map-o" . "\xf278")
-    ("map-pin" . "\xf276")
-    ("map-signs" . "\xf277")
-    ("mars" . "\xf222")
-    ("mars-double" . "\xf227")
-    ("mars-stroke" . "\xf229")
-    ("mars-stroke-h" . "\xf22b")
-    ("mars-stroke-v" . "\xf22a")
-    ("maxcdn" . "\xf136")
-    ("meanpath" . "\xf20c")
-    ("medium" . "\xf23a")
-    ("medkit" . "\xf0fa")
-    ("meh-o" . "\xf11a")
-    ("mercury" . "\xf223")
-    ("microphone" . "\xf130")
-    ("microphone-slash" . "\xf131")
-    ("minus" . "\xf068")
-    ("minus-circle" . "\xf056")
-    ("minus-square" . "\xf146")
-    ("minus-square-o" . "\xf147")
-    ("mixcloud" . "\xf289")
-    ("mobile" . "\xf10b")
-    ("modx" . "\xf285")
-    ("money" . "\xf0d6")
-    ("moon-o" . "\xf186")
-    ("motorcycle" . "\xf21c")
-    ("mouse-pointer" . "\xf245")
-    ("music" . "\xf001")
-    ("neuter" . "\xf22c")
-    ("newspaper-o" . "\xf1ea")
-    ("object-group" . "\xf247")
-    ("object-ungroup" . "\xf248")
-    ("odnoklassniki" . "\xf263")
-    ("odnoklassniki-square" . "\xf264")
-    ("opencart" . "\xf23d")
-    ("openid" . "\xf19b")
-    ("opera" . "\xf26a")
-    ("optin-monster" . "\xf23c")
-    ("outdent" . "\xf03b")
-    ("pagelines" . "\xf18c")
-    ("paint-brush" . "\xf1fc")
-    ("paper-plane" . "\xf1d8")
-    ("paper-plane-o" . "\xf1d9")
-    ("paperclip" . "\xf0c6")
-    ("paragraph" . "\xf1dd")
-    ("pause" . "\xf04c")
-    ("pause-circle" . "\xf28b")
-    ("pause-circle-o" . "\xf28c")
-    ("paw" . "\xf1b0")
-    ("paypal" . "\xf1ed")
-    ("pencil" . "\xf040")
-    ("pencil-square" . "\xf14b")
-    ("pencil-square-o" . "\xf044")
-    ("percent" . "\xf295")
-    ("phone" . "\xf095")
-    ("phone-square" . "\xf098")
-    ("picture-o" . "\xf03e")
-    ("pie-chart" . "\xf200")
-    ("pied-piper" . "\xf2ae")
-    ("pied-piper-alt" . "\xf1a8")
-    ("pied-piper-pp" . "\xf1a7")
-    ("pinterest" . "\xf0d2")
-    ("pinterest-p" . "\xf231")
-    ("pinterest-square" . "\xf0d3")
-    ("plane" . "\xf072")
-    ("play" . "\xf04b")
-    ("play-circle" . "\xf144")
-    ("play-circle-o" . "\xf01d")
-    ("plug" . "\xf1e6")
-    ("plus" . "\xf067")
-    ("plus-circle" . "\xf055")
-    ("plus-square" . "\xf0fe")
-    ("plus-square-o" . "\xf196")
-    ("power-off" . "\xf011")
-    ("print" . "\xf02f")
-    ("product-hunt" . "\xf288")
-    ("puzzle-piece" . "\xf12e")
-    ("qq" . "\xf1d6")
-    ("qrcode" . "\xf029")
-    ("question" . "\xf128")
-    ("question-circle" . "\xf059")
-    ("question-circle-o" . "\xf29c")
-    ("quote-left" . "\xf10d")
-    ("quote-right" . "\xf10e")
-    ("random" . "\xf074")
-    ("rebel" . "\xf1d0")
-    ("recycle" . "\xf1b8")
-    ("reddit" . "\xf1a1")
-    ("reddit-alien" . "\xf281")
-    ("reddit-square" . "\xf1a2")
-    ("refresh" . "\xf021")
-    ("registered" . "\xf25d")
-    ("renren" . "\xf18b")
-    ("repeat" . "\xf01e")
-    ("reply" . "\xf112")
-    ("reply-all" . "\xf122")
-    ("retweet" . "\xf079")
-    ("road" . "\xf018")
-    ("rocket" . "\xf135")
-    ("rss" . "\xf09e")
-    ("rss-square" . "\xf143")
-    ("rub" . "\xf158")
-    ("safari" . "\xf267")
-    ("scissors" . "\xf0c4")
-    ("scribd" . "\xf28a")
-    ("search" . "\xf002")
-    ("search-minus" . "\xf010")
-    ("search-plus" . "\xf00e")
-    ("sellsy" . "\xf213")
-    ("server" . "\xf233")
-    ("share" . "\xf064")
-    ("share-alt" . "\xf1e0")
-    ("share-alt-square" . "\xf1e1")
-    ("share-square" . "\xf14d")
-    ("share-square-o" . "\xf045")
-    ("shield" . "\xf132")
-    ("ship" . "\xf21a")
-    ("shirtsinbulk" . "\xf214")
-    ("shopping-bag" . "\xf290")
-    ("shopping-basket" . "\xf291")
-    ("shopping-cart" . "\xf07a")
-    ("sign-in" . "\xf090")
-    ("sign-language" . "\xf2a7")
-    ("sign-out" . "\xf08b")
-    ("signal" . "\xf012")
-    ("simplybuilt" . "\xf215")
-    ("sitemap" . "\xf0e8")
-    ("skyatlas" . "\xf216")
-    ("skype" . "\xf17e")
-    ("slack" . "\xf198")
-    ("sliders" . "\xf1de")
-    ("slideshare" . "\xf1e7")
-    ("smile-o" . "\xf118")
-    ("snapchat" . "\xf2ab")
-    ("snapchat-ghost" . "\xf2ac")
-    ("snapchat-square" . "\xf2ad")
-    ("sort" . "\xf0dc")
-    ("sort-alpha-asc" . "\xf15d")
-    ("sort-alpha-desc" . "\xf15e")
-    ("sort-amount-asc" . "\xf160")
-    ("sort-amount-desc" . "\xf161")
-    ("sort-asc" . "\xf0de")
-    ("sort-desc" . "\xf0dd")
-    ("sort-numeric-asc" . "\xf162")
-    ("sort-numeric-desc" . "\xf163")
-    ("soundcloud" . "\xf1be")
-    ("space-shuttle" . "\xf197")
-    ("spinner" . "\xf110")
-    ("spoon" . "\xf1b1")
-    ("spotify" . "\xf1bc")
-    ("square" . "\xf0c8")
-    ("square-o" . "\xf096")
-    ("stack-exchange" . "\xf18d")
-    ("stack-overflow" . "\xf16c")
-    ("star" . "\xf005")
-    ("star-half" . "\xf089")
-    ("star-half-o" . "\xf123")
-    ("star-o" . "\xf006")
-    ("steam" . "\xf1b6")
-    ("steam-square" . "\xf1b7")
-    ("step-backward" . "\xf048")
-    ("step-forward" . "\xf051")
-    ("stethoscope" . "\xf0f1")
-    ("sticky-note" . "\xf249")
-    ("sticky-note-o" . "\xf24a")
-    ("stop" . "\xf04d")
-    ("stop-circle" . "\xf28d")
-    ("stop-circle-o" . "\xf28e")
-    ("street-view" . "\xf21d")
-    ("strikethrough" . "\xf0cc")
-    ("stumbleupon" . "\xf1a4")
-    ("stumbleupon-circle" . "\xf1a3")
-    ("subscript" . "\xf12c")
-    ("subway" . "\xf239")
-    ("suitcase" . "\xf0f2")
-    ("sun-o" . "\xf185")
-    ("superscript" . "\xf12b")
-    ("table" . "\xf0ce")
-    ("tablet" . "\xf10a")
-    ("tachometer" . "\xf0e4")
-    ("tag" . "\xf02b")
-    ("tags" . "\xf02c")
-    ("tasks" . "\xf0ae")
-    ("taxi" . "\xf1ba")
-    ("television" . "\xf26c")
-    ("tencent-weibo" . "\xf1d5")
-    ("terminal" . "\xf120")
-    ("text-height" . "\xf034")
-    ("text-width" . "\xf035")
-    ("th" . "\xf00a")
-    ("th-large" . "\xf009")
-    ("th-list" . "\xf00b")
-    ("themeisle" . "\xf2b2")
-    ("thumb-tack" . "\xf08d")
-    ("thumbs-down" . "\xf165")
-    ("thumbs-o-down" . "\xf088")
-    ("thumbs-o-up" . "\xf087")
-    ("thumbs-up" . "\xf164")
-    ("ticket" . "\xf145")
-    ("times" . "\xf00d")
-    ("times-circle" . "\xf057")
-    ("times-circle-o" . "\xf05c")
-    ("tint" . "\xf043")
-    ("toggle-off" . "\xf204")
-    ("toggle-on" . "\xf205")
-    ("trademark" . "\xf25c")
-    ("train" . "\xf238")
-    ("transgender" . "\xf224")
-    ("transgender-alt" . "\xf225")
-    ("trash" . "\xf1f8")
-    ("trash-o" . "\xf014")
-    ("tree" . "\xf1bb")
-    ("trello" . "\xf181")
-    ("tripadvisor" . "\xf262")
-    ("trophy" . "\xf091")
-    ("truck" . "\xf0d1")
-    ("try" . "\xf195")
-    ("tty" . "\xf1e4")
-    ("tumblr" . "\xf173")
-    ("tumblr-square" . "\xf174")
-    ("twitch" . "\xf1e8")
-    ("twitter" . "\xf099")
-    ("twitter-square" . "\xf081")
-    ("umbrella" . "\xf0e9")
-    ("underline" . "\xf0cd")
-    ("undo" . "\xf0e2")
-    ("universal-access" . "\xf29a")
-    ("university" . "\xf19c")
-    ("unlock" . "\xf09c")
-    ("unlock-alt" . "\xf13e")
-    ("upload" . "\xf093")
-    ("usb" . "\xf287")
-    ("usd" . "\xf155")
-    ("user" . "\xf007")
-    ("user-md" . "\xf0f0")
-    ("user-plus" . "\xf234")
-    ("user-secret" . "\xf21b")
-    ("user-times" . "\xf235")
-    ("users" . "\xf0c0")
-    ("venus" . "\xf221")
-    ("venus-double" . "\xf226")
-    ("venus-mars" . "\xf228")
-    ("viacoin" . "\xf237")
-    ("viadeo" . "\xf2a9")
-    ("viadeo-square" . "\xf2aa")
-    ("video-camera" . "\xf03d")
-    ("vimeo" . "\xf27d")
-    ("vimeo-square" . "\xf194")
-    ("vine" . "\xf1ca")
-    ("vk" . "\xf189")
-    ("volume-control-phone" . "\xf2a0")
-    ("volume-down" . "\xf027")
-    ("volume-off" . "\xf026")
-    ("volume-up" . "\xf028")
-    ("weibo" . "\xf18a")
-    ("weixin" . "\xf1d7")
-    ("whatsapp" . "\xf232")
-    ("wheelchair" . "\xf193")
-    ("wheelchair-alt" . "\xf29b")
-    ("wifi" . "\xf1eb")
-    ("wikipedia-w" . "\xf266")
-    ("windows" . "\xf17a")
-    ("wordpress" . "\xf19a")
-    ("wpbeginner" . "\xf297")
-    ("wpforms" . "\xf298")
-    ("wrench" . "\xf0ad")
-    ("xing" . "\xf168")
-    ("xing-square" . "\xf169")
-    ("y-combinator" . "\xf23b")
-    ("yahoo" . "\xf19e")
-    ("yelp" . "\xf1e9")
-    ("yoast" . "\xf2b1")
-    ("youtube" . "\xf167")
-    ("youtube-play" . "\xf16a")
-    ("youtube-square" . "\xf166")
-
-    ))
-
-(provide 'data-faicons)
.emacs.d/elpa/all-the-icons-20170817.642/data/data-faicons.elc
Binary file
.emacs.d/elpa/all-the-icons-20170817.642/data/data-fileicons.el
@@ -1,487 +0,0 @@
-(defvar all-the-icons-data/file-icon-alist
-  '(
-		
-    ( "1c" . "\xa5ea" )
-    ( "1c-alt" . "\xea28" )
-    ( "MJML" . "\xea6f" )
-    ( "R" . "\xe905" )
-    ( "abap" . "\xe92b" )
-    ( "abif" . "\xea4e" )
-    ( "access" . "\xe9ea" )
-    ( "actionscript" . "\xe92e" )
-    ( "ada" . "\xe90b" )
-    ( "ae" . "\xe9f3" )
-    ( "ai" . "\xe6b4" )
-    ( "akka" . "\xea0e" )
-    ( "alex" . "\x29cb" )
-    ( "alloy" . "\xe935" )
-    ( "alpine-linux" . "\xe9ff" )
-    ( "ampl" . "\xe94e" )
-    ( "amx" . "\xe99b" )
-    ( "angelscript" . "\xea5b" )
-    ( "ansible" . "\x24b6" )
-    ( "ansible-alt" . "\x61" )
-    ( "ant" . "\xe93e" )
-    ( "antlr" . "\xe92c" )
-    ( "antwar" . "\x2591" )
-    ( "api-blueprint" . "\xe92d" )
-    ( "apl" . "\x234b" )
-    ( "apl-old" . "\xe909" )
-    ( "apple" . "\xe925" )
-    ( "appveyor" . "\xe923" )
-    ( "arc" . "\xe92f" )
-    ( "arch-linux" . "\x41" )
-    ( "arduino" . "\xe930" )
-    ( "arttext" . "\x24d0" )
-    ( "asciidoc" . "\xe918" )
-    ( "ats" . "\xe934" )
-    ( "audacity" . "\xe9f9" )
-    ( "augeas" . "\xe931" )
-    ( "aurelia" . "\xea48" )
-    ( "auto-hotkey" . "\xe932" )
-    ( "autoit" . "\xe933" )
-    ( "babel" . "\xe91f" )
-    ( "bazel" . "\xea5a" )
-    ( "bem" . "\xea59" )
-    ( "bib" . "\xe601" )
-    ( "bintray" . "\xea6e" )
-    ( "bithound" . "\xea2a" )
-    ( "blender" . "\xe9fa" )
-    ( "bluespec" . "\xe93c" )
-    ( "boo" . "\xe939" )
-    ( "brain" . "\xe93a" )
-    ( "brakeman" . "\xe9d6" )
-    ( "bro" . "\xe93b" )
-    ( "broccoli" . "\xe922" )
-    ( "brotli" . "\xea6c" )
-    ( "browserslist" . "\xea80" )
-    ( "brunch" . "\xea47" )
-    ( "buck" . "\xea46" )
-    ( "build-boot" . "\xf103" )
-    ( "bundler" . "\xea45" )
-    ( "byond" . "\xe962" )
-    ( "cabal" . "\xe9c2" )
-    ( "caddy" . "\xea58" )
-    ( "cake" . "\xe9e3" )
-    ( "cakefile" . "\xe924" )
-    ( "cakephp" . "\xea43" )
-    ( "cakephp-old" . "\xe9d3" )
-    ( "cc" . "\xe9d5" )
-    ( "ceylon" . "\xe94f" )
-    ( "chai" . "\x63" )
-    ( "chapel" . "\xe950" )
-    ( "chartjs" . "\xea0b" )
-    ( "chef" . "\xea42" )
-    ( "chuck" . "\xe943" )
-    ( "circle-ci" . "\xea12" )
-    ( "cirru" . "\xe951" )
-    ( "ckeditor" . "\xea0c" )
-    ( "clarion" . "\xe952" )
-    ( "clean" . "\xe95b" )
-    ( "click" . "\xe95c" )
-    ( "clips" . "\xe940" )
-    ( "clj" . "\xf105" )
-    ( "cljs" . "\xf104" )
-    ( "closure-template" . "\xea82" )
-    ( "cmake" . "\xe93f" )
-    ( "cobol" . "\xea44" )
-    ( "codecov" . "\x2602" )
-    ( "codekit" . "\xea41" )
-    ( "codemirror" . "\xea0d" )
-    ( "codeship" . "\xea6a" )
-    ( "cold-fusion" . "\xe929" )
-    ( "clisp" . "\xe972" )
-    ( "composer" . "\xe683" )
-    ( "config" . "\xf07c" )
-    ( "coq" . "\xe95f" )
-    ( "cordova" . "\xea11" )
-    ( "cp" . "\xe942" )
-    ( "cpan" . "\xea87" )
-    ( "creole" . "\xe95e" )
-    ( "crystal" . "\xe902" )
-    ( "cs-script" . "\xe9e2" )
-    ( "csound" . "\xe9f0" )
-    ( "cucumber" . "\xf02b" )
-    ( "cython" . "\xe963" )
-    ( "d3" . "\xea10" )
-    ( "darcs" . "\xe964" )
-    ( "dashboard" . "\xf07d" )
-    ( "dbase" . "\xe9f1" )
-    ( "default" . "\x1f5cc" )
-    ( "delphi" . "\xea40" )
-    ( "devicetree" . "\xea57" )
-    ( "diff" . "\xe960" )
-    ( "dockerfile" . "\xf106" )
-    ( "doclets" . "\xea3f" )
-    ( "doge" . "\xe946" )
-    ( "dom" . "\xea71" )
-    ( "donejs" . "\x1f3c1" )
-    ( "doxygen" . "\xe928" )
-    ( "dragula" . "\x1f44c" )
-    ( "drone" . "\xea3d" )
-    ( "dyalog" . "\xe90c" )
-    ( "dylib" . "\xea15" )
-    ( "e" . "\x45" )
-    ( "eagle" . "\xe965" )
-    ( "easybuild" . "\xea85" )
-    ( "ec" . "\xe9c9" )
-    ( "ecere" . "\xe966" )
-    ( "edge" . "\xea78" )
-    ( "editorconfig" . "\xea1b" )
-    ( "eiffel" . "\xe967" )
-    ( "ejs" . "\xea4b" )
-    ( "electron" . "\xea27" )
-    ( "elm" . "\xf102" )
-    ( "emacs" . "\xe926" )
-    ( "elisp" . "\xe926" )
-    ( "ember" . "\xe61b" )
-    ( "emberscript" . "\xe968" )
-    ( "eq" . "\xea0a" )
-    ( "esdoc" . "\xea5c" )
-    ( "eslint" . "\xea0f" )
-    ( "eslint-old" . "\xe90e" )
-    ( "excel" . "\xe9ee" )
-    ( "fabfile" . "\xe94b" )
-    ( "factor" . "\xe96a" )
-    ( "fancy" . "\xe96b" )
-    ( "fantom" . "\xe96f" )
-    ( "fbx" . "\xe9fc" )
-    ( "ffmpeg" . "\xea22" )
-    ( "finder" . "\xe9e9" )
-    ( "firebase" . "\xea7f" )
-    ( "flow" . "\xe921" )
-    ( "flux" . "\xe969" )
-    ( "font" . "\xe90f" )
-    ( "fontforge" . "\xfb00" )
-    ( "fortran" . "\xe90a" )
-    ( "franca" . "\xea56" )
-    ( "freemarker" . "\xe970" )
-    ( "frege" . "\xe96e" )
-    ( "fuel-ux" . "\xea09" )
-    ( "gams" . "\xe973" )
-    ( "gap" . "\xe971" )
-    ( "gdb" . "\xea08" )
-    ( "genshi" . "\xe976" )
-    ( "gentoo" . "\xe96d" )
-    ( "gf" . "\xe978" )
-    ( "gitlab" . "\xea3c" )
-    ( "glade" . "\xe938" )
-    ( "glyphs" . "\x47" )
-    ( "gn" . "\xea25" )
-    ( "gnu" . "\xe679" )
-    ( "go" . "\xe624" )
-    ( "godot" . "\xe974" )
-    ( "golo" . "\xe979" )
-    ( "gosu" . "\xe97a" )
-    ( "gradle" . "\xe903" )
-    ( "graphql" . "\xe97c" )
-    ( "graphviz" . "\xe97d" )
-    ( "groovy" . "\xe904" )
-    ( "grunt" . "\xe611" )
-    ( "gulp" . "\xe610" )
-    ( "hack" . "\xe9ce" )
-    ( "haml" . "\xf15b" )
-    ( "harbour" . "\xe97b" )
-    ( "hashicorp" . "\xe97e" )
-    ( "haxe" . "\xe907" )
-    ( "haxedevelop" . "\xea3b" )
-    ( "hg" . "\x263f" )
-    ( "hoplon" . "\xea4d" )
-    ( "hy" . "\xe97f" )
-    ( "icu" . "\xea23" )
-    ( "id" . "\xe9f4" )
-    ( "idl" . "\xe947" )
-    ( "idris" . "\xe983" )
-    ( "igorpro" . "\xe980" )
-    ( "image" . "\xf012" )
-    ( "inform7" . "\xe984" )
-    ( "inno" . "\xe985" )
-    ( "io" . "\xe981" )
-    ( "ioke" . "\xe982" )
-    ( "ionic-project" . "\xf14b" )
-    ( "isabelle" . "\xe945" )
-    ( "j" . "\xe937" )
-    ( "jade" . "\xe90d" )
-    ( "jake" . "\xe948" )
-    ( "jasmine" . "\xea3a" )
-    ( "jenkins" . "\xe667" )
-    ( "jest" . "\xea39" )
-    ( "jinja" . "\xe944" )
-    ( "jison" . "\xea55" )
-    ( "jolie" . "\xea75" )
-    ( "jsonld" . "\xe958" )
-    ( "jsx" . "\xf100" )
-    ( "jsx-2" . "\xf101" )
-    ( "jsx2-alt" . "\xe9e6" )
-    ( "julia" . "\x26ec" )
-    ( "junos" . "\xea81" )
-    ( "jupyter" . "\xe987" )
-    ( "karma" . "\xe9cd" )
-    ( "keynote" . "\xe9e5" )
-    ( "khronos" . "\xe9f8" )
-    ( "kicad" . "\xea4c" )
-    ( "kitchenci" . "\xea38" )
-    ( "kivy" . "\xe901" )
-    ( "knockout" . "\x4b" )
-    ( "kotlin" . "\xe989" )
-    ( "krl" . "\xe988" )
-    ( "labview" . "\xe98a" )
-    ( "lasso" . "\xe98c" )
-    ( "leaflet" . "\xea07" )
-    ( "lean" . "\x4c" )
-    ( "lerna" . "\xea37" )
-    ( "lfe" . "\xe94c" )
-    ( "libuv" . "\xea21" )
-    ( "lightwave" . "\xe9fb" )
-    ( "lime" . "\xea36" )
-    ( "lisp" . "\xe908" )
-    ( "livescript" . "\xe914" )
-    ( "llvm" . "\xe91d" )
-    ( "logtalk" . "\xe98d" )
-    ( "lookml" . "\xe98e" )
-    ( "lsl" . "\xe98b" )
-    ( "lua" . "\xe91b" )
-    ( "mako" . "\xe98f" )
-    ( "man-page" . "\xe936" )
-    ( "mapbox" . "\xe941" )
-    ( "markdownlint" . "\xf0c9" )
-    ( "marko" . "\xe920" )
-    ( "mathematica" . "\xe990" )
-    ( "mathjax" . "\xea06" )
-    ( "matlab" . "\xe991" )
-    ( "max" . "\xe993" )
-    ( "maxscript" . "\xe900" )
-    ( "maya" . "\xe9f6" )
-    ( "mediawiki" . "\xe954" )
-    ( "mercury" . "\xe994" )
-    ( "meson" . "\xea54" )
-    ( "metal" . "\x4d" )
-    ( "meteor" . "\xe6a5" )
-    ( "microsoft-infopath" . "\xea35" )
-    ( "minecraft" . "\xe9dc" )
-    ( "minizinc" . "\xea53" )
-    ( "mirah" . "\xe995" )
-    ( "miranda" . "\xea52" )
-    ( "mocha" . "\x26fe" )
-    ( "modula-2" . "\xe996" )
-    ( "moment" . "\x1f558" )
-    ( "moment-tz" . "\x1f30d" )
-    ( "monkey" . "\xe997" )
-    ( "moustache" . "\xe60f" )
-    ( "mruby" . "\xea18" )
-    ( "mupad" . "\xe9ca" )
-    ( "nano" . "\xea76" )
-    ( "nanoc" . "\xea51" )
-    ( "nant" . "\xe9e1" )
-    ( "nasm" . "\xea72" )
-    ( "neko" . "\xea05" )
-    ( "netlogo" . "\xe99c" )
-    ( "new-relic" . "\xe9d7" )
-    ( "nginx" . "\xf146b" )
-    ( "nib" . "\x2712" )
-    ( "nimrod" . "\xe998" )
-    ( "nit" . "\xe999" )
-    ( "nix" . "\xe99a" )
-    ( "nmap" . "\xe94d" )
-    ( "nodemon" . "\xea26" )
-    ( "normalize" . "\xea04" )
-    ( "npm" . "\xe91c" )
-    ( "npm-old" . "\xf17b" )
-    ( "nsis" . "\xea1e" )
-    ( "nsis-old" . "\xe992" )
-    ( "nuclide" . "\xea34" )
-    ( "nuget" . "\xe9d9" )
-    ( "numpy" . "\xe99d" )
-    ( "nunjucks" . "\xe953" )
-    ( "nvidia" . "\xe95d" )
-    ( "nxc" . "\xea6b" )
-    ( "obj" . "\xe9e8" )
-    ( "objective-j" . "\xe99e" )
-    ( "ocaml" . "\xe91a" )
-    ( "octave" . "\xea33" )
-    ( "onenote" . "\xe9eb" )
-    ( "ooc" . "\xe9cb" )
-    ( "opa" . "\x2601" )
-    ( "opencl" . "\xe99f" )
-    ( "opengl" . "\xea7a" )
-    ( "openoffice" . "\xe9e4" )
-    ( "openscad" . "\xe911" )
-    ( "org" . "\xe917" )
-    ( "owl" . "\xe957" )
-    ( "ox" . "\xe9a1" )
-    ( "oxygene" . "\xe9bf" )
-    ( "oz" . "\xe9be" )
-    ( "p4" . "\xea50" )
-    ( "pan" . "\xe9bd" )
-    ( "papyrus" . "\xe9bc" )
-    ( "parrot" . "\xe9bb" )
-    ( "pascal" . "\xe92a" )
-    ( "patch" . "\xe961" )
-    ( "pawn" . "\x265f" )
-    ( "pb" . "\xea14" )
-    ( "pegjs" . "\xea74" )
-    ( "perl6" . "\xe96c" )
-    ( "phalcon" . "\xe94a" )
-    ( "phoenix" . "\xea5f" )
-    ( "php" . "\xf147" )
-    ( "phpunit" . "\xea32" )
-    ( "pickle" . "\xe9c4" )
-    ( "pike" . "\xe9b9" )
-    ( "platformio" . "\xea2c" )
-    ( "pm2" . "\x2630" )
-    ( "pod" . "\xea84" )
-    ( "pogo" . "\xe9b8" )
-    ( "pointwise" . "\xe977" )
-    ( "polymer" . "\xea2b" )
-    ( "pony" . "\xe9b7" )
-    ( "postcss" . "\xe910" )
-    ( "postscript" . "\xe955" )
-    ( "povray" . "\x50" )
-    ( "powerpoint" . "\xe9ec" )
-    ( "powershell" . "\xe9da" )
-    ( "precision" . "\x2295" )
-    ( "premiere" . "\xe9f5" )
-    ( "processing" . "\xe9a0" )
-    ( "progress" . "\xe9c0" )
-    ( "propeller" . "\xe9b5" )
-    ( "proselint" . "\xea6d" )
-    ( "protractor" . "\xe9de" )
-    ( "ps" . "\xe6b8" )
-    ( "pug" . "\xea13" )
-    ( "pug-alt" . "\xe9d0" )
-    ( "puppet" . "\xf0c3" )
-    ( "purebasic" . "\x1b5" )
-    ( "purescript" . "\xe9b2" )
-    ( "racket" . "\xe9b1" )
-    ( "raml" . "\xe913" )
-    ( "rascal" . "\xea24" )
-    ( "rdoc" . "\xe9b0" )
-    ( "realbasic" . "\xe9af" )
-    ( "reason" . "\xea1d" )
-    ( "rebol" . "\xe9ae" )
-    ( "red" . "\xe9ad" )
-    ( "redux" . "\xea30" )
-    ( "regex" . "\x2a" )
-    ( "rexx" . "\xea16" )
-    ( "rhino" . "\xea4a" )
-    ( "ring" . "\x1f48d" )
-    ( "riot" . "\xe919" )
-    ( "robot" . "\xe9ac" )
-    ( "rollup" . "\xea20" )
-    ( "rollup-old" . "\xe9fd" )
-    ( "rot" . "\x1f764" )
-    ( "rspec" . "\xea31" )
-    ( "rst" . "\xe9cc" )
-    ( "sage" . "\xe9ab" )
-    ( "saltstack" . "\xe915" )
-    ( "sas" . "\xe95a" )
-    ( "sbt" . "\xe9d2" )
-    ( "sc" . "\xe9a2" )
-    ( "scheme" . "\x3bb" )
-    ( "scilab" . "\xe9a9" )
-    ( "scrutinizer" . "\xe9d4" )
-    ( "self" . "\xe9a8" )
-    ( "sequelize" . "\xea2f" )
-    ( "sf" . "\xe9db" )
-    ( "shen" . "\xe9a7" )
-    ( "shipit" . "\x26f5" )
-    ( "shippable" . "\xea2d" )
-    ( "shopify" . "\xe9cf" )
-    ( "shuriken" . "\x272b" )
-    ( "silverstripe" . "\xe800" )
-    ( "sinatra" . "\xea03" )
-    ( "sketch" . "\xe927" )
-    ( "sketchup-layout" . "\xea7c" )
-    ( "sketchup-make" . "\xea7e" )
-    ( "sketchup-stylebuilder" . "\xea7d" )
-    ( "slash" . "\xe9a6" )
-    ( "snyk" . "\xea1c" )
-    ( "solidity" . "\xea86" )
-    ( "sparql" . "\xe959" )
-    ( "spray" . "\xea02" )
-    ( "sqf" . "\xe9a5" )
-    ( "sqlite" . "\xe9dd" )
-    ( "squarespace" . "\xea5e" )
-    ( "stan" . "\xe9a4" )
-    ( "stata" . "\xe9a3" )
-    ( "storyist" . "\xe9ef" )
-    ( "strings" . "\xe9e0" )
-    ( "stylelint" . "\xe93d" )
-    ( "stylus" . "\x73" )
-    ( "stylus-full" . "\xe9f7" )
-    ( "stylus-orb" . "\x53" )
-    ( "sublime" . "\xe986" )
-    ( "sv" . "\xe9c3" )
-    ( "svn" . "\xea17" )
-    ( "swagger" . "\xea29" )
-    ( "tag" . "\xf015" )
-    ( "tcl" . "\xe956" )
-    ( "telegram" . "\x2708" )
-    ( "terminal" . "\xf0c8" )
-    ( "tern" . "\x1f54a" )
-    ( "terraform" . "\xe916" )
-    ( "test-coffeescript" . "\xea62" )
-    ( "test-dir" . "\xea60" )
-    ( "test-generic" . "\xea63" )
-    ( "test-js" . "\xea64" )
-    ( "test-perl" . "\xea65" )
-    ( "test-python" . "\xea66" )
-    ( "test-react" . "\xea67" )
-    ( "test-ruby" . "\xea68" )
-    ( "test-typescript" . "\xea69" )
-    ( "tex" . "\xe600" )
-    ( "textile" . "\x74" )
-    ( "textmate" . "\x2122" )
-    ( "thor" . "\xe9d8" )
-    ( "tinymce" . "\xea01" )
-    ( "tsx" . "\xe9d1" )
-    ( "tsx-alt" . "\xe9e7" )
-    ( "tt" . "\x54" )
-    ( "turing" . "\xe9b6" )
-    ( "twig" . "\x2e19" )
-    ( "twine" . "\xea5d" )
-    ( "txl" . "\xe9c1" )
-    ( "typedoc" . "\xe9fe" )
-    ( "typescript" . "\xe912" )
-    ( "typescript-alt" . "\x2a6" )
-    ( "typings" . "\xe9df" )
-    ( "uno" . "\xe9b3" )
-    ( "unreal" . "\x75" )
-    ( "urweb" . "\xe9ba" )
-    ( "v8" . "\xea1f" )
-    ( "vagrant" . "\x56" )
-    ( "vcl" . "\xe9b4" )
-    ( "verilog" . "\xe949" )
-    ( "vertex-shader" . "\xea79" )
-    ( "vhdl" . "\xe9aa" )
-    ( "video" . "\xf057" )
-    ( "virtualbox" . "\xea3e" )
-    ( "virtualbox-alt" . "\xea2e" )
-    ( "visio" . "\xea83" )
-    ( "vmware" . "\xea49" )
-    ( "vue" . "\xe906" )
-    ( "wasm" . "\xea70" )
-    ( "watchman" . "\xea4f" )
-    ( "webgl" . "\xea7b" )
-    ( "webpack" . "\xea61" )
-    ( "webpack-old" . "\xe91e" )
-    ( "wercker" . "\xea19" )
-    ( "word" . "\xe9ed" )
-    ( "x10" . "\x2169" )
-    ( "xamarin" . "\xea77" )
-    ( "xmos" . "\x58" )
-    ( "xpages" . "\xe9c5" )
-    ( "xtend" . "\xe9c6" )
-    ( "yarn" . "\xea1a" )
-    ( "yasm" . "\xea73" )
-    ( "yin-yang" . "\x262f" )
-    ( "yoyo" . "\xe975" )
-    ( "yui" . "\xea00" )
-    ( "zbrush" . "\xe9f2" )
-    ( "zephir" . "\xe9c7" )
-    ( "zimpl" . "\xe9c8" )
-    
-    )
-  )
-
-(provide 'data-fileicons)
.emacs.d/elpa/all-the-icons-20170817.642/data/data-fileicons.elc
Binary file
.emacs.d/elpa/all-the-icons-20170817.642/data/data-material.el
@@ -1,935 +0,0 @@
-(defvar all-the-icons-data/material-icons-alist
-  '(("3d_rotation" . "\xe84d")
-    ("ac_unit" . "\xeb3b")
-    ("access_alarm" . "\xe190")
-    ("access_alarms" . "\xe191")
-    ("access_time" . "\xe192")
-    ("accessibility" . "\xe84e")
-    ("accessible" . "\xe914")
-    ("account_balance" . "\xe84f")
-    ("account_balance_wallet" . "\xe850")
-    ("account_box" . "\xe851")
-    ("account_circle" . "\xe853")
-    ("adb" . "\xe60e")
-    ("add" . "\xe145")
-    ("add_a_photo" . "\xe439")
-    ("add_alarm" . "\xe193")
-    ("add_alert" . "\xe003")
-    ("add_box" . "\xe146")
-    ("add_circle" . "\xe147")
-    ("add_circle_outline" . "\xe148")
-    ("add_location" . "\xe567")
-    ("add_shopping_cart" . "\xe854")
-    ("add_to_photos" . "\xe39d")
-    ("add_to_queue" . "\xe05c")
-    ("adjust" . "\xe39e")
-    ("airline_seat_flat" . "\xe630")
-    ("airline_seat_flat_angled" . "\xe631")
-    ("airline_seat_individual_suite" . "\xe632")
-    ("airline_seat_legroom_extra" . "\xe633")
-    ("airline_seat_legroom_normal" . "\xe634")
-    ("airline_seat_legroom_reduced" . "\xe635")
-    ("airline_seat_recline_extra" . "\xe636")
-    ("airline_seat_recline_normal" . "\xe637")
-    ("airplanemode_active" . "\xe195")
-    ("airplanemode_inactive" . "\xe194")
-    ("airplay" . "\xe055")
-    ("airport_shuttle" . "\xeb3c")
-    ("alarm" . "\xe855")
-    ("alarm_add" . "\xe856")
-    ("alarm_off" . "\xe857")
-    ("alarm_on" . "\xe858")
-    ("album" . "\xe019")
-    ("all_inclusive" . "\xeb3d")
-    ("all_out" . "\xe90b")
-    ("android" . "\xe859")
-    ("announcement" . "\xe85a")
-    ("apps" . "\xe5c3")
-    ("archive" . "\xe149")
-    ("arrow_back" . "\xe5c4")
-    ("arrow_downward" . "\xe5db")
-    ("arrow_drop_down" . "\xe5c5")
-    ("arrow_drop_down_circle" . "\xe5c6")
-    ("arrow_drop_up" . "\xe5c7")
-    ("arrow_forward" . "\xe5c8")
-    ("arrow_upward" . "\xe5d8")
-    ("art_track" . "\xe060")
-    ("aspect_ratio" . "\xe85b")
-    ("assessment" . "\xe85c")
-    ("assignment" . "\xe85d")
-    ("assignment_ind" . "\xe85e")
-    ("assignment_late" . "\xe85f")
-    ("assignment_return" . "\xe860")
-    ("assignment_returned" . "\xe861")
-    ("assignment_turned_in" . "\xe862")
-    ("assistant" . "\xe39f")
-    ("assistant_photo" . "\xe3a0")
-    ("attach_file" . "\xe226")
-    ("attach_money" . "\xe227")
-    ("attachment" . "\xe2bc")
-    ("audiotrack" . "\xe3a1")
-    ("autorenew" . "\xe863")
-    ("av_timer" . "\xe01b")
-    ("backspace" . "\xe14a")
-    ("backup" . "\xe864")
-    ("battery_alert" . "\xe19c")
-    ("battery_charging_full" . "\xe1a3")
-    ("battery_full" . "\xe1a4")
-    ("battery_std" . "\xe1a5")
-    ("battery_unknown" . "\xe1a6")
-    ("beach_access" . "\xeb3e")
-    ("beenhere" . "\xe52d")
-    ("block" . "\xe14b")
-    ("bluetooth" . "\xe1a7")
-    ("bluetooth_audio" . "\xe60f")
-    ("bluetooth_connected" . "\xe1a8")
-    ("bluetooth_disabled" . "\xe1a9")
-    ("bluetooth_searching" . "\xe1aa")
-    ("blur_circular" . "\xe3a2")
-    ("blur_linear" . "\xe3a3")
-    ("blur_off" . "\xe3a4")
-    ("blur_on" . "\xe3a5")
-    ("book" . "\xe865")
-    ("bookmark" . "\xe866")
-    ("bookmark_border" . "\xe867")
-    ("border_all" . "\xe228")
-    ("border_bottom" . "\xe229")
-    ("border_clear" . "\xe22a")
-    ("border_color" . "\xe22b")
-    ("border_horizontal" . "\xe22c")
-    ("border_inner" . "\xe22d")
-    ("border_left" . "\xe22e")
-    ("border_outer" . "\xe22f")
-    ("border_right" . "\xe230")
-    ("border_style" . "\xe231")
-    ("border_top" . "\xe232")
-    ("border_vertical" . "\xe233")
-    ("branding_watermark" . "\xe06b")
-    ("brightness_1" . "\xe3a6")
-    ("brightness_2" . "\xe3a7")
-    ("brightness_3" . "\xe3a8")
-    ("brightness_4" . "\xe3a9")
-    ("brightness_5" . "\xe3aa")
-    ("brightness_6" . "\xe3ab")
-    ("brightness_7" . "\xe3ac")
-    ("brightness_auto" . "\xe1ab")
-    ("brightness_high" . "\xe1ac")
-    ("brightness_low" . "\xe1ad")
-    ("brightness_medium" . "\xe1ae")
-    ("broken_image" . "\xe3ad")
-    ("brush" . "\xe3ae")
-    ("bubble_chart" . "\xe6dd")
-    ("bug_report" . "\xe868")
-    ("build" . "\xe869")
-    ("burst_mode" . "\xe43c")
-    ("business" . "\xe0af")
-    ("business_center" . "\xeb3f")
-    ("cached" . "\xe86a")
-    ("cake" . "\xe7e9")
-    ("call" . "\xe0b0")
-    ("call_end" . "\xe0b1")
-    ("call_made" . "\xe0b2")
-    ("call_merge" . "\xe0b3")
-    ("call_missed" . "\xe0b4")
-    ("call_missed_outgoing" . "\xe0e4")
-    ("call_received" . "\xe0b5")
-    ("call_split" . "\xe0b6")
-    ("call_to_action" . "\xe06c")
-    ("camera" . "\xe3af")
-    ("camera_alt" . "\xe3b0")
-    ("camera_enhance" . "\xe8fc")
-    ("camera_front" . "\xe3b1")
-    ("camera_rear" . "\xe3b2")
-    ("camera_roll" . "\xe3b3")
-    ("cancel" . "\xe5c9")
-    ("card_giftcard" . "\xe8f6")
-    ("card_membership" . "\xe8f7")
-    ("card_travel" . "\xe8f8")
-    ("casino" . "\xeb40")
-    ("cast" . "\xe307")
-    ("cast_connected" . "\xe308")
-    ("center_focus_strong" . "\xe3b4")
-    ("center_focus_weak" . "\xe3b5")
-    ("change_history" . "\xe86b")
-    ("chat" . "\xe0b7")
-    ("chat_bubble" . "\xe0ca")
-    ("chat_bubble_outline" . "\xe0cb")
-    ("check" . "\xe5ca")
-    ("check_box" . "\xe834")
-    ("check_box_outline_blank" . "\xe835")
-    ("check_circle" . "\xe86c")
-    ("chevron_left" . "\xe5cb")
-    ("chevron_right" . "\xe5cc")
-    ("child_care" . "\xeb41")
-    ("child_friendly" . "\xeb42")
-    ("chrome_reader_mode" . "\xe86d")
-    ("class" . "\xe86e")
-    ("clear" . "\xe14c")
-    ("clear_all" . "\xe0b8")
-    ("close" . "\xe5cd")
-    ("closed_caption" . "\xe01c")
-    ("cloud" . "\xe2bd")
-    ("cloud_circle" . "\xe2be")
-    ("cloud_done" . "\xe2bf")
-    ("cloud_download" . "\xe2c0")
-    ("cloud_off" . "\xe2c1")
-    ("cloud_queue" . "\xe2c2")
-    ("cloud_upload" . "\xe2c3")
-    ("code" . "\xe86f")
-    ("collections" . "\xe3b6")
-    ("collections_bookmark" . "\xe431")
-    ("color_lens" . "\xe3b7")
-    ("colorize" . "\xe3b8")
-    ("comment" . "\xe0b9")
-    ("compare" . "\xe3b9")
-    ("compare_arrows" . "\xe915")
-    ("computer" . "\xe30a")
-    ("confirmation_number" . "\xe638")
-    ("contact_mail" . "\xe0d0")
-    ("contact_phone" . "\xe0cf")
-    ("contacts" . "\xe0ba")
-    ("content_copy" . "\xe14d")
-    ("content_cut" . "\xe14e")
-    ("content_paste" . "\xe14f")
-    ("control_point" . "\xe3ba")
-    ("control_point_duplicate" . "\xe3bb")
-    ("copyright" . "\xe90c")
-    ("create" . "\xe150")
-    ("create_new_folder" . "\xe2cc")
-    ("credit_card" . "\xe870")
-    ("crop" . "\xe3be")
-    ("crop_16_9" . "\xe3bc")
-    ("crop_3_2" . "\xe3bd")
-    ("crop_5_4" . "\xe3bf")
-    ("crop_7_5" . "\xe3c0")
-    ("crop_din" . "\xe3c1")
-    ("crop_free" . "\xe3c2")
-    ("crop_landscape" . "\xe3c3")
-    ("crop_original" . "\xe3c4")
-    ("crop_portrait" . "\xe3c5")
-    ("crop_rotate" . "\xe437")
-    ("crop_square" . "\xe3c6")
-    ("dashboard" . "\xe871")
-    ("data_usage" . "\xe1af")
-    ("date_range" . "\xe916")
-    ("dehaze" . "\xe3c7")
-    ("delete" . "\xe872")
-    ("delete_forever" . "\xe92b")
-    ("delete_sweep" . "\xe16c")
-    ("description" . "\xe873")
-    ("desktop_mac" . "\xe30b")
-    ("desktop_windows" . "\xe30c")
-    ("details" . "\xe3c8")
-    ("developer_board" . "\xe30d")
-    ("developer_mode" . "\xe1b0")
-    ("device_hub" . "\xe335")
-    ("devices" . "\xe1b1")
-    ("devices_other" . "\xe337")
-    ("dialer_sip" . "\xe0bb")
-    ("dialpad" . "\xe0bc")
-    ("directions" . "\xe52e")
-    ("directions_bike" . "\xe52f")
-    ("directions_boat" . "\xe532")
-    ("directions_bus" . "\xe530")
-    ("directions_car" . "\xe531")
-    ("directions_railway" . "\xe534")
-    ("directions_run" . "\xe566")
-    ("directions_subway" . "\xe533")
-    ("directions_transit" . "\xe535")
-    ("directions_walk" . "\xe536")
-    ("disc_full" . "\xe610")
-    ("dns" . "\xe875")
-    ("do_not_disturb" . "\xe612")
-    ("do_not_disturb_alt" . "\xe611")
-    ("do_not_disturb_off" . "\xe643")
-    ("do_not_disturb_on" . "\xe644")
-    ("dock" . "\xe30e")
-    ("domain" . "\xe7ee")
-    ("done" . "\xe876")
-    ("done_all" . "\xe877")
-    ("donut_large" . "\xe917")
-    ("donut_small" . "\xe918")
-    ("drafts" . "\xe151")
-    ("drag_handle" . "\xe25d")
-    ("drive_eta" . "\xe613")
-    ("dvr" . "\xe1b2")
-    ("edit" . "\xe3c9")
-    ("edit_location" . "\xe568")
-    ("eject" . "\xe8fb")
-    ("email" . "\xe0be")
-    ("enhanced_encryption" . "\xe63f")
-    ("equalizer" . "\xe01d")
-    ("error" . "\xe000")
-    ("error_outline" . "\xe001")
-    ("euro_symbol" . "\xe926")
-    ("ev_station" . "\xe56d")
-    ("event" . "\xe878")
-    ("event_available" . "\xe614")
-    ("event_busy" . "\xe615")
-    ("event_note" . "\xe616")
-    ("event_seat" . "\xe903")
-    ("exit_to_app" . "\xe879")
-    ("expand_less" . "\xe5ce")
-    ("expand_more" . "\xe5cf")
-    ("explicit" . "\xe01e")
-    ("explore" . "\xe87a")
-    ("exposure" . "\xe3ca")
-    ("exposure_neg_1" . "\xe3cb")
-    ("exposure_neg_2" . "\xe3cc")
-    ("exposure_plus_1" . "\xe3cd")
-    ("exposure_plus_2" . "\xe3ce")
-    ("exposure_zero" . "\xe3cf")
-    ("extension" . "\xe87b")
-    ("face" . "\xe87c")
-    ("fast_forward" . "\xe01f")
-    ("fast_rewind" . "\xe020")
-    ("favorite" . "\xe87d")
-    ("favorite_border" . "\xe87e")
-    ("featured_play_list" . "\xe06d")
-    ("featured_video" . "\xe06e")
-    ("feedback" . "\xe87f")
-    ("fiber_dvr" . "\xe05d")
-    ("fiber_manual_record" . "\xe061")
-    ("fiber_new" . "\xe05e")
-    ("fiber_pin" . "\xe06a")
-    ("fiber_smart_record" . "\xe062")
-    ("file_download" . "\xe2c4")
-    ("file_upload" . "\xe2c6")
-    ("filter" . "\xe3d3")
-    ("filter_1" . "\xe3d0")
-    ("filter_2" . "\xe3d1")
-    ("filter_3" . "\xe3d2")
-    ("filter_4" . "\xe3d4")
-    ("filter_5" . "\xe3d5")
-    ("filter_6" . "\xe3d6")
-    ("filter_7" . "\xe3d7")
-    ("filter_8" . "\xe3d8")
-    ("filter_9" . "\xe3d9")
-    ("filter_9_plus" . "\xe3da")
-    ("filter_b_and_w" . "\xe3db")
-    ("filter_center_focus" . "\xe3dc")
-    ("filter_drama" . "\xe3dd")
-    ("filter_frames" . "\xe3de")
-    ("filter_hdr" . "\xe3df")
-    ("filter_list" . "\xe152")
-    ("filter_none" . "\xe3e0")
-    ("filter_tilt_shift" . "\xe3e2")
-    ("filter_vintage" . "\xe3e3")
-    ("find_in_page" . "\xe880")
-    ("find_replace" . "\xe881")
-    ("fingerprint" . "\xe90d")
-    ("first_page" . "\xe5dc")
-    ("fitness_center" . "\xeb43")
-    ("flag" . "\xe153")
-    ("flare" . "\xe3e4")
-    ("flash_auto" . "\xe3e5")
-    ("flash_off" . "\xe3e6")
-    ("flash_on" . "\xe3e7")
-    ("flight" . "\xe539")
-    ("flight_land" . "\xe904")
-    ("flight_takeoff" . "\xe905")
-    ("flip" . "\xe3e8")
-    ("flip_to_back" . "\xe882")
-    ("flip_to_front" . "\xe883")
-    ("folder" . "\xe2c7")
-    ("folder_open" . "\xe2c8")
-    ("folder_shared" . "\xe2c9")
-    ("folder_special" . "\xe617")
-    ("font_download" . "\xe167")
-    ("format_align_center" . "\xe234")
-    ("format_align_justify" . "\xe235")
-    ("format_align_left" . "\xe236")
-    ("format_align_right" . "\xe237")
-    ("format_bold" . "\xe238")
-    ("format_clear" . "\xe239")
-    ("format_color_fill" . "\xe23a")
-    ("format_color_reset" . "\xe23b")
-    ("format_color_text" . "\xe23c")
-    ("format_indent_decrease" . "\xe23d")
-    ("format_indent_increase" . "\xe23e")
-    ("format_italic" . "\xe23f")
-    ("format_line_spacing" . "\xe240")
-    ("format_list_bulleted" . "\xe241")
-    ("format_list_numbered" . "\xe242")
-    ("format_paint" . "\xe243")
-    ("format_quote" . "\xe244")
-    ("format_shapes" . "\xe25e")
-    ("format_size" . "\xe245")
-    ("format_strikethrough" . "\xe246")
-    ("format_textdirection_l_to_r" . "\xe247")
-    ("format_textdirection_r_to_l" . "\xe248")
-    ("format_underlined" . "\xe249")
-    ("forum" . "\xe0bf")
-    ("forward" . "\xe154")
-    ("forward_10" . "\xe056")
-    ("forward_30" . "\xe057")
-    ("forward_5" . "\xe058")
-    ("free_breakfast" . "\xeb44")
-    ("fullscreen" . "\xe5d0")
-    ("fullscreen_exit" . "\xe5d1")
-    ("functions" . "\xe24a")
-    ("g_translate" . "\xe927")
-    ("gamepad" . "\xe30f")
-    ("games" . "\xe021")
-    ("gavel" . "\xe90e")
-    ("gesture" . "\xe155")
-    ("get_app" . "\xe884")
-    ("gif" . "\xe908")
-    ("golf_course" . "\xeb45")
-    ("gps_fixed" . "\xe1b3")
-    ("gps_not_fixed" . "\xe1b4")
-    ("gps_off" . "\xe1b5")
-    ("grade" . "\xe885")
-    ("gradient" . "\xe3e9")
-    ("grain" . "\xe3ea")
-    ("graphic_eq" . "\xe1b8")
-    ("grid_off" . "\xe3eb")
-    ("grid_on" . "\xe3ec")
-    ("group" . "\xe7ef")
-    ("group_add" . "\xe7f0")
-    ("group_work" . "\xe886")
-    ("hd" . "\xe052")
-    ("hdr_off" . "\xe3ed")
-    ("hdr_on" . "\xe3ee")
-    ("hdr_strong" . "\xe3f1")
-    ("hdr_weak" . "\xe3f2")
-    ("headset" . "\xe310")
-    ("headset_mic" . "\xe311")
-    ("healing" . "\xe3f3")
-    ("hearing" . "\xe023")
-    ("help" . "\xe887")
-    ("help_outline" . "\xe8fd")
-    ("high_quality" . "\xe024")
-    ("highlight" . "\xe25f")
-    ("highlight_off" . "\xe888")
-    ("history" . "\xe889")
-    ("home" . "\xe88a")
-    ("hot_tub" . "\xeb46")
-    ("hotel" . "\xe53a")
-    ("hourglass_empty" . "\xe88b")
-    ("hourglass_full" . "\xe88c")
-    ("http" . "\xe902")
-    ("https" . "\xe88d")
-    ("image" . "\xe3f4")
-    ("image_aspect_ratio" . "\xe3f5")
-    ("import_contacts" . "\xe0e0")
-    ("import_export" . "\xe0c3")
-    ("important_devices" . "\xe912")
-    ("inbox" . "\xe156")
-    ("indeterminate_check_box" . "\xe909")
-    ("info" . "\xe88e")
-    ("info_outline" . "\xe88f")
-    ("input" . "\xe890")
-    ("insert_chart" . "\xe24b")
-    ("insert_comment" . "\xe24c")
-    ("insert_drive_file" . "\xe24d")
-    ("insert_emoticon" . "\xe24e")
-    ("insert_invitation" . "\xe24f")
-    ("insert_link" . "\xe250")
-    ("insert_photo" . "\xe251")
-    ("invert_colors" . "\xe891")
-    ("invert_colors_off" . "\xe0c4")
-    ("iso" . "\xe3f6")
-    ("keyboard" . "\xe312")
-    ("keyboard_arrow_down" . "\xe313")
-    ("keyboard_arrow_left" . "\xe314")
-    ("keyboard_arrow_right" . "\xe315")
-    ("keyboard_arrow_up" . "\xe316")
-    ("keyboard_backspace" . "\xe317")
-    ("keyboard_capslock" . "\xe318")
-    ("keyboard_hide" . "\xe31a")
-    ("keyboard_return" . "\xe31b")
-    ("keyboard_tab" . "\xe31c")
-    ("keyboard_voice" . "\xe31d")
-    ("kitchen" . "\xeb47")
-    ("label" . "\xe892")
-    ("label_outline" . "\xe893")
-    ("landscape" . "\xe3f7")
-    ("language" . "\xe894")
-    ("laptop" . "\xe31e")
-    ("laptop_chromebook" . "\xe31f")
-    ("laptop_mac" . "\xe320")
-    ("laptop_windows" . "\xe321")
-    ("last_page" . "\xe5dd")
-    ("launch" . "\xe895")
-    ("layers" . "\xe53b")
-    ("layers_clear" . "\xe53c")
-    ("leak_add" . "\xe3f8")
-    ("leak_remove" . "\xe3f9")
-    ("lens" . "\xe3fa")
-    ("library_add" . "\xe02e")
-    ("library_books" . "\xe02f")
-    ("library_music" . "\xe030")
-    ("lightbulb_outline" . "\xe90f")
-    ("line_style" . "\xe919")
-    ("line_weight" . "\xe91a")
-    ("linear_scale" . "\xe260")
-    ("link" . "\xe157")
-    ("linked_camera" . "\xe438")
-    ("list" . "\xe896")
-    ("live_help" . "\xe0c6")
-    ("live_tv" . "\xe639")
-    ("local_activity" . "\xe53f")
-    ("local_airport" . "\xe53d")
-    ("local_atm" . "\xe53e")
-    ("local_bar" . "\xe540")
-    ("local_cafe" . "\xe541")
-    ("local_car_wash" . "\xe542")
-    ("local_convenience_store" . "\xe543")
-    ("local_dining" . "\xe556")
-    ("local_drink" . "\xe544")
-    ("local_florist" . "\xe545")
-    ("local_gas_station" . "\xe546")
-    ("local_grocery_store" . "\xe547")
-    ("local_hospital" . "\xe548")
-    ("local_hotel" . "\xe549")
-    ("local_laundry_service" . "\xe54a")
-    ("local_library" . "\xe54b")
-    ("local_mall" . "\xe54c")
-    ("local_movies" . "\xe54d")
-    ("local_offer" . "\xe54e")
-    ("local_parking" . "\xe54f")
-    ("local_pharmacy" . "\xe550")
-    ("local_phone" . "\xe551")
-    ("local_pizza" . "\xe552")
-    ("local_play" . "\xe553")
-    ("local_post_office" . "\xe554")
-    ("local_printshop" . "\xe555")
-    ("local_see" . "\xe557")
-    ("local_shipping" . "\xe558")
-    ("local_taxi" . "\xe559")
-    ("location_city" . "\xe7f1")
-    ("location_disabled" . "\xe1b6")
-    ("location_off" . "\xe0c7")
-    ("location_on" . "\xe0c8")
-    ("location_searching" . "\xe1b7")
-    ("lock" . "\xe897")
-    ("lock_open" . "\xe898")
-    ("lock_outline" . "\xe899")
-    ("looks" . "\xe3fc")
-    ("looks_3" . "\xe3fb")
-    ("looks_4" . "\xe3fd")
-    ("looks_5" . "\xe3fe")
-    ("looks_6" . "\xe3ff")
-    ("looks_one" . "\xe400")
-    ("looks_two" . "\xe401")
-    ("loop" . "\xe028")
-    ("loupe" . "\xe402")
-    ("low_priority" . "\xe16d")
-    ("loyalty" . "\xe89a")
-    ("mail" . "\xe158")
-    ("mail_outline" . "\xe0e1")
-    ("map" . "\xe55b")
-    ("markunread" . "\xe159")
-    ("markunread_mailbox" . "\xe89b")
-    ("memory" . "\xe322")
-    ("menu" . "\xe5d2")
-    ("merge_type" . "\xe252")
-    ("message" . "\xe0c9")
-    ("mic" . "\xe029")
-    ("mic_none" . "\xe02a")
-    ("mic_off" . "\xe02b")
-    ("mms" . "\xe618")
-    ("mode_comment" . "\xe253")
-    ("mode_edit" . "\xe254")
-    ("monetization_on" . "\xe263")
-    ("money_off" . "\xe25c")
-    ("monochrome_photos" . "\xe403")
-    ("mood" . "\xe7f2")
-    ("mood_bad" . "\xe7f3")
-    ("more" . "\xe619")
-    ("more_horiz" . "\xe5d3")
-    ("more_vert" . "\xe5d4")
-    ("motorcycle" . "\xe91b")
-    ("mouse" . "\xe323")
-    ("move_to_inbox" . "\xe168")
-    ("movie" . "\xe02c")
-    ("movie_creation" . "\xe404")
-    ("movie_filter" . "\xe43a")
-    ("multiline_chart" . "\xe6df")
-    ("music_note" . "\xe405")
-    ("music_video" . "\xe063")
-    ("my_location" . "\xe55c")
-    ("nature" . "\xe406")
-    ("nature_people" . "\xe407")
-    ("navigate_before" . "\xe408")
-    ("navigate_next" . "\xe409")
-    ("navigation" . "\xe55d")
-    ("near_me" . "\xe569")
-    ("network_cell" . "\xe1b9")
-    ("network_check" . "\xe640")
-    ("network_locked" . "\xe61a")
-    ("network_wifi" . "\xe1ba")
-    ("new_releases" . "\xe031")
-    ("next_week" . "\xe16a")
-    ("nfc" . "\xe1bb")
-    ("no_encryption" . "\xe641")
-    ("no_sim" . "\xe0cc")
-    ("not_interested" . "\xe033")
-    ("note" . "\xe06f")
-    ("note_add" . "\xe89c")
-    ("notifications" . "\xe7f4")
-    ("notifications_active" . "\xe7f7")
-    ("notifications_none" . "\xe7f5")
-    ("notifications_off" . "\xe7f6")
-    ("notifications_paused" . "\xe7f8")
-    ("offline_pin" . "\xe90a")
-    ("ondemand_video" . "\xe63a")
-    ("opacity" . "\xe91c")
-    ("open_in_browser" . "\xe89d")
-    ("open_in_new" . "\xe89e")
-    ("open_with" . "\xe89f")
-    ("pages" . "\xe7f9")
-    ("pageview" . "\xe8a0")
-    ("palette" . "\xe40a")
-    ("pan_tool" . "\xe925")
-    ("panorama" . "\xe40b")
-    ("panorama_fish_eye" . "\xe40c")
-    ("panorama_horizontal" . "\xe40d")
-    ("panorama_vertical" . "\xe40e")
-    ("panorama_wide_angle" . "\xe40f")
-    ("party_mode" . "\xe7fa")
-    ("pause" . "\xe034")
-    ("pause_circle_filled" . "\xe035")
-    ("pause_circle_outline" . "\xe036")
-    ("payment" . "\xe8a1")
-    ("people" . "\xe7fb")
-    ("people_outline" . "\xe7fc")
-    ("perm_camera_mic" . "\xe8a2")
-    ("perm_contact_calendar" . "\xe8a3")
-    ("perm_data_setting" . "\xe8a4")
-    ("perm_device_information" . "\xe8a5")
-    ("perm_identity" . "\xe8a6")
-    ("perm_media" . "\xe8a7")
-    ("perm_phone_msg" . "\xe8a8")
-    ("perm_scan_wifi" . "\xe8a9")
-    ("person" . "\xe7fd")
-    ("person_add" . "\xe7fe")
-    ("person_outline" . "\xe7ff")
-    ("person_pin" . "\xe55a")
-    ("person_pin_circle" . "\xe56a")
-    ("personal_video" . "\xe63b")
-    ("pets" . "\xe91d")
-    ("phone" . "\xe0cd")
-    ("phone_android" . "\xe324")
-    ("phone_bluetooth_speaker" . "\xe61b")
-    ("phone_forwarded" . "\xe61c")
-    ("phone_in_talk" . "\xe61d")
-    ("phone_iphone" . "\xe325")
-    ("phone_locked" . "\xe61e")
-    ("phone_missed" . "\xe61f")
-    ("phone_paused" . "\xe620")
-    ("phonelink" . "\xe326")
-    ("phonelink_erase" . "\xe0db")
-    ("phonelink_lock" . "\xe0dc")
-    ("phonelink_off" . "\xe327")
-    ("phonelink_ring" . "\xe0dd")
-    ("phonelink_setup" . "\xe0de")
-    ("photo" . "\xe410")
-    ("photo_album" . "\xe411")
-    ("photo_camera" . "\xe412")
-    ("photo_filter" . "\xe43b")
-    ("photo_library" . "\xe413")
-    ("photo_size_select_actual" . "\xe432")
-    ("photo_size_select_large" . "\xe433")
-    ("photo_size_select_small" . "\xe434")
-    ("picture_as_pdf" . "\xe415")
-    ("picture_in_picture" . "\xe8aa")
-    ("picture_in_picture_alt" . "\xe911")
-    ("pie_chart" . "\xe6c4")
-    ("pie_chart_outlined" . "\xe6c5")
-    ("pin_drop" . "\xe55e")
-    ("place" . "\xe55f")
-    ("play_arrow" . "\xe037")
-    ("play_circle_filled" . "\xe038")
-    ("play_circle_outline" . "\xe039")
-    ("play_for_work" . "\xe906")
-    ("playlist_add" . "\xe03b")
-    ("playlist_add_check" . "\xe065")
-    ("playlist_play" . "\xe05f")
-    ("plus_one" . "\xe800")
-    ("poll" . "\xe801")
-    ("polymer" . "\xe8ab")
-    ("pool" . "\xeb48")
-    ("portable_wifi_off" . "\xe0ce")
-    ("portrait" . "\xe416")
-    ("power" . "\xe63c")
-    ("power_input" . "\xe336")
-    ("power_settings_new" . "\xe8ac")
-    ("pregnant_woman" . "\xe91e")
-    ("present_to_all" . "\xe0df")
-    ("print" . "\xe8ad")
-    ("priority_high" . "\xe645")
-    ("public" . "\xe80b")
-    ("publish" . "\xe255")
-    ("query_builder" . "\xe8ae")
-    ("question_answer" . "\xe8af")
-    ("queue" . "\xe03c")
-    ("queue_music" . "\xe03d")
-    ("queue_play_next" . "\xe066")
-    ("radio" . "\xe03e")
-    ("radio_button_checked" . "\xe837")
-    ("radio_button_unchecked" . "\xe836")
-    ("rate_review" . "\xe560")
-    ("receipt" . "\xe8b0")
-    ("recent_actors" . "\xe03f")
-    ("record_voice_over" . "\xe91f")
-    ("redeem" . "\xe8b1")
-    ("redo" . "\xe15a")
-    ("refresh" . "\xe5d5")
-    ("remove" . "\xe15b")
-    ("remove_circle" . "\xe15c")
-    ("remove_circle_outline" . "\xe15d")
-    ("remove_from_queue" . "\xe067")
-    ("remove_red_eye" . "\xe417")
-    ("remove_shopping_cart" . "\xe928")
-    ("reorder" . "\xe8fe")
-    ("repeat" . "\xe040")
-    ("repeat_one" . "\xe041")
-    ("replay" . "\xe042")
-    ("replay_10" . "\xe059")
-    ("replay_30" . "\xe05a")
-    ("replay_5" . "\xe05b")
-    ("reply" . "\xe15e")
-    ("reply_all" . "\xe15f")
-    ("report" . "\xe160")
-    ("report_problem" . "\xe8b2")
-    ("restaurant" . "\xe56c")
-    ("restaurant_menu" . "\xe561")
-    ("restore" . "\xe8b3")
-    ("restore_page" . "\xe929")
-    ("ring_volume" . "\xe0d1")
-    ("room" . "\xe8b4")
-    ("room_service" . "\xeb49")
-    ("rotate_90_degrees_ccw" . "\xe418")
-    ("rotate_left" . "\xe419")
-    ("rotate_right" . "\xe41a")
-    ("rounded_corner" . "\xe920")
-    ("router" . "\xe328")
-    ("rowing" . "\xe921")
-    ("rss_feed" . "\xe0e5")
-    ("rv_hookup" . "\xe642")
-    ("satellite" . "\xe562")
-    ("save" . "\xe161")
-    ("scanner" . "\xe329")
-    ("schedule" . "\xe8b5")
-    ("school" . "\xe80c")
-    ("screen_lock_landscape" . "\xe1be")
-    ("screen_lock_portrait" . "\xe1bf")
-    ("screen_lock_rotation" . "\xe1c0")
-    ("screen_rotation" . "\xe1c1")
-    ("screen_share" . "\xe0e2")
-    ("sd_card" . "\xe623")
-    ("sd_storage" . "\xe1c2")
-    ("search" . "\xe8b6")
-    ("security" . "\xe32a")
-    ("select_all" . "\xe162")
-    ("send" . "\xe163")
-    ("sentiment_dissatisfied" . "\xe811")
-    ("sentiment_neutral" . "\xe812")
-    ("sentiment_satisfied" . "\xe813")
-    ("sentiment_very_dissatisfied" . "\xe814")
-    ("sentiment_very_satisfied" . "\xe815")
-    ("settings" . "\xe8b8")
-    ("settings_applications" . "\xe8b9")
-    ("settings_backup_restore" . "\xe8ba")
-    ("settings_bluetooth" . "\xe8bb")
-    ("settings_brightness" . "\xe8bd")
-    ("settings_cell" . "\xe8bc")
-    ("settings_ethernet" . "\xe8be")
-    ("settings_input_antenna" . "\xe8bf")
-    ("settings_input_component" . "\xe8c0")
-    ("settings_input_composite" . "\xe8c1")
-    ("settings_input_hdmi" . "\xe8c2")
-    ("settings_input_svideo" . "\xe8c3")
-    ("settings_overscan" . "\xe8c4")
-    ("settings_phone" . "\xe8c5")
-    ("settings_power" . "\xe8c6")
-    ("settings_remote" . "\xe8c7")
-    ("settings_system_daydream" . "\xe1c3")
-    ("settings_voice" . "\xe8c8")
-    ("share" . "\xe80d")
-    ("shop" . "\xe8c9")
-    ("shop_two" . "\xe8ca")
-    ("shopping_basket" . "\xe8cb")
-    ("shopping_cart" . "\xe8cc")
-    ("short_text" . "\xe261")
-    ("show_chart" . "\xe6e1")
-    ("shuffle" . "\xe043")
-    ("signal_cellular_4_bar" . "\xe1c8")
-    ("signal_cellular_connected_no_internet_4_bar" . "\xe1cd")
-    ("signal_cellular_no_sim" . "\xe1ce")
-    ("signal_cellular_null" . "\xe1cf")
-    ("signal_cellular_off" . "\xe1d0")
-    ("signal_wifi_4_bar" . "\xe1d8")
-    ("signal_wifi_4_bar_lock" . "\xe1d9")
-    ("signal_wifi_off" . "\xe1da")
-    ("sim_card" . "\xe32b")
-    ("sim_card_alert" . "\xe624")
-    ("skip_next" . "\xe044")
-    ("skip_previous" . "\xe045")
-    ("slideshow" . "\xe41b")
-    ("slow_motion_video" . "\xe068")
-    ("smartphone" . "\xe32c")
-    ("smoke_free" . "\xeb4a")
-    ("smoking_rooms" . "\xeb4b")
-    ("sms" . "\xe625")
-    ("sms_failed" . "\xe626")
-    ("snooze" . "\xe046")
-    ("sort" . "\xe164")
-    ("sort_by_alpha" . "\xe053")
-    ("spa" . "\xeb4c")
-    ("space_bar" . "\xe256")
-    ("speaker" . "\xe32d")
-    ("speaker_group" . "\xe32e")
-    ("speaker_notes" . "\xe8cd")
-    ("speaker_notes_off" . "\xe92a")
-    ("speaker_phone" . "\xe0d2")
-    ("spellcheck" . "\xe8ce")
-    ("star" . "\xe838")
-    ("star_border" . "\xe83a")
-    ("star_half" . "\xe839")
-    ("stars" . "\xe8d0")
-    ("stay_current_landscape" . "\xe0d3")
-    ("stay_current_portrait" . "\xe0d4")
-    ("stay_primary_landscape" . "\xe0d5")
-    ("stay_primary_portrait" . "\xe0d6")
-    ("stop" . "\xe047")
-    ("stop_screen_share" . "\xe0e3")
-    ("storage" . "\xe1db")
-    ("store" . "\xe8d1")
-    ("store_mall_directory" . "\xe563")
-    ("straighten" . "\xe41c")
-    ("streetview" . "\xe56e")
-    ("strikethrough_s" . "\xe257")
-    ("style" . "\xe41d")
-    ("subdirectory_arrow_left" . "\xe5d9")
-    ("subdirectory_arrow_right" . "\xe5da")
-    ("subject" . "\xe8d2")
-    ("subscriptions" . "\xe064")
-    ("subtitles" . "\xe048")
-    ("subway" . "\xe56f")
-    ("supervisor_account" . "\xe8d3")
-    ("surround_sound" . "\xe049")
-    ("swap_calls" . "\xe0d7")
-    ("swap_horiz" . "\xe8d4")
-    ("swap_vert" . "\xe8d5")
-    ("swap_vertical_circle" . "\xe8d6")
-    ("switch_camera" . "\xe41e")
-    ("switch_video" . "\xe41f")
-    ("sync" . "\xe627")
-    ("sync_disabled" . "\xe628")
-    ("sync_problem" . "\xe629")
-    ("system_update" . "\xe62a")
-    ("system_update_alt" . "\xe8d7")
-    ("tab" . "\xe8d8")
-    ("tab_unselected" . "\xe8d9")
-    ("tablet" . "\xe32f")
-    ("tablet_android" . "\xe330")
-    ("tablet_mac" . "\xe331")
-    ("tag_faces" . "\xe420")
-    ("tap_and_play" . "\xe62b")
-    ("terrain" . "\xe564")
-    ("text_fields" . "\xe262")
-    ("text_format" . "\xe165")
-    ("textsms" . "\xe0d8")
-    ("texture" . "\xe421")
-    ("theaters" . "\xe8da")
-    ("thumb_down" . "\xe8db")
-    ("thumb_up" . "\xe8dc")
-    ("thumbs_up_down" . "\xe8dd")
-    ("time_to_leave" . "\xe62c")
-    ("timelapse" . "\xe422")
-    ("timeline" . "\xe922")
-    ("timer" . "\xe425")
-    ("timer_10" . "\xe423")
-    ("timer_3" . "\xe424")
-    ("timer_off" . "\xe426")
-    ("title" . "\xe264")
-    ("toc" . "\xe8de")
-    ("today" . "\xe8df")
-    ("toll" . "\xe8e0")
-    ("tonality" . "\xe427")
-    ("touch_app" . "\xe913")
-    ("toys" . "\xe332")
-    ("track_changes" . "\xe8e1")
-    ("traffic" . "\xe565")
-    ("train" . "\xe570")
-    ("tram" . "\xe571")
-    ("transfer_within_a_station" . "\xe572")
-    ("transform" . "\xe428")
-    ("translate" . "\xe8e2")
-    ("trending_down" . "\xe8e3")
-    ("trending_flat" . "\xe8e4")
-    ("trending_up" . "\xe8e5")
-    ("tune" . "\xe429")
-    ("turned_in" . "\xe8e6")
-    ("turned_in_not" . "\xe8e7")
-    ("tv" . "\xe333")
-    ("unarchive" . "\xe169")
-    ("undo" . "\xe166")
-    ("unfold_less" . "\xe5d6")
-    ("unfold_more" . "\xe5d7")
-    ("update" . "\xe923")
-    ("usb" . "\xe1e0")
-    ("verified_user" . "\xe8e8")
-    ("vertical_align_bottom" . "\xe258")
-    ("vertical_align_center" . "\xe259")
-    ("vertical_align_top" . "\xe25a")
-    ("vibration" . "\xe62d")
-    ("video_call" . "\xe070")
-    ("video_label" . "\xe071")
-    ("video_library" . "\xe04a")
-    ("videocam" . "\xe04b")
-    ("videocam_off" . "\xe04c")
-    ("videogame_asset" . "\xe338")
-    ("view_agenda" . "\xe8e9")
-    ("view_array" . "\xe8ea")
-    ("view_carousel" . "\xe8eb")
-    ("view_column" . "\xe8ec")
-    ("view_comfy" . "\xe42a")
-    ("view_compact" . "\xe42b")
-    ("view_day" . "\xe8ed")
-    ("view_headline" . "\xe8ee")
-    ("view_list" . "\xe8ef")
-    ("view_module" . "\xe8f0")
-    ("view_quilt" . "\xe8f1")
-    ("view_stream" . "\xe8f2")
-    ("view_week" . "\xe8f3")
-    ("vignette" . "\xe435")
-    ("visibility" . "\xe8f4")
-    ("visibility_off" . "\xe8f5")
-    ("voice_chat" . "\xe62e")
-    ("voicemail" . "\xe0d9")
-    ("volume_down" . "\xe04d")
-    ("volume_mute" . "\xe04e")
-    ("volume_off" . "\xe04f")
-    ("volume_up" . "\xe050")
-    ("vpn_key" . "\xe0da")
-    ("vpn_lock" . "\xe62f")
-    ("wallpaper" . "\xe1bc")
-    ("warning" . "\xe002")
-    ("watch" . "\xe334")
-    ("watch_later" . "\xe924")
-    ("wb_auto" . "\xe42c")
-    ("wb_cloudy" . "\xe42d")
-    ("wb_incandescent" . "\xe42e")
-    ("wb_iridescent" . "\xe436")
-    ("wb_sunny" . "\xe430")
-    ("wc" . "\xe63d")
-    ("web" . "\xe051")
-    ("web_asset" . "\xe069")
-    ("weekend" . "\xe16b")
-    ("whatshot" . "\xe80e")
-    ("widgets" . "\xe1bd")
-    ("wifi" . "\xe63e")
-    ("wifi_lock" . "\xe1e1")
-    ("wifi_tethering" . "\xe1e2")
-    ("work" . "\xe8f9")
-    ("wrap_text" . "\xe25b")
-    ("youtube_searched_for" . "\xe8fa")
-    ("zoom_in" . "\xe8ff")
-    ("zoom_out" . "\xe900")
-    ("zoom_out_map" . "\xe56b")))
-
-  (provide 'data-material)
.emacs.d/elpa/all-the-icons-20170817.642/data/data-material.elc
Binary file
.emacs.d/elpa/all-the-icons-20170817.642/data/data-octicons.el
@@ -1,165 +0,0 @@
-(defvar all-the-icons-data/octicons-alist
-  '(
-
-    ("alert" . "\xf02d")
-    ("arrow-down" . "\xf03f")
-    ("arrow-left" . "\xf040")
-    ("arrow-right" . "\xf03e")
-    ("arrow-small-down" . "\xf0a0")
-    ("arrow-small-left" . "\xf0a1")
-    ("arrow-small-right" . "\xf071")
-    ("arrow-small-up" . "\xf09f")
-    ("arrow-up" . "\xf03d")
-    ("book" . "\xf007")
-    ("bookmark" . "\xf07b")
-    ("briefcase" . "\xf0d3")
-    ("broadcast" . "\xf048")
-    ("browser" . "\xf0c5")
-    ("bug" . "\xf091")
-    ("calendar" . "\xf068")
-    ("check" . "\xf03a")
-    ("checklist" . "\xf076")
-    ("chevron-down" . "\xf0a3")
-    ("chevron-left" . "\xf0a4")
-    ("chevron-right" . "\xf078")
-    ("chevron-up" . "\xf0a2")
-    ("circle-slash" . "\xf084")
-    ("circuit-board" . "\xf0d6")
-    ("clippy" . "\xf035")
-    ("clock" . "\xf046")
-    ("cloud-download" . "\xf00b")
-    ("cloud-upload" . "\xf00c")
-    ("code" . "\xf05f")
-    ("comment" . "\xf02b")
-    ("comment-discussion" . "\xf04f")
-    ("credit-card" . "\xf045")
-    ("dash" . "\xf0ca")
-    ("dashboard" . "\xf07d")
-    ("database" . "\xf096")
-    ("device-camera" . "\xf056")
-    ("device-camera-video" . "\xf057")
-    ("device-desktop" . "\xf27c")
-    ("device-mobile" . "\xf038")
-    ("diff" . "\xf04d")
-    ("diff-added" . "\xf06b")
-    ("diff-ignored" . "\xf099")
-    ("diff-modified" . "\xf06d")
-    ("diff-removed" . "\xf06c")
-    ("diff-renamed" . "\xf06e")
-    ("ellipsis" . "\xf09a")
-    ("eye" . "\xf04e")
-    ("file-binary" . "\xf094")
-    ("file-code" . "\xf010")
-    ("file-directory" . "\xf016")
-    ("file-media" . "\xf012")
-    ("file-pdf" . "\xf014")
-    ("file-submodule" . "\xf017")
-    ("file-symlink-directory" . "\xf0b1")
-    ("file-symlink-file" . "\xf0b0")
-    ("file-text" . "\xf011")
-    ("file-zip" . "\xf013")
-    ("flame" . "\xf0d2")
-    ("fold" . "\xf0cc")
-    ("gear" . "\xf02f")
-    ("gift" . "\xf042")
-    ("gist" . "\xf00e")
-    ("gist-secret" . "\xf08c")
-    ("git-branch" . "\xf020")
-    ("git-commit" . "\xf01f")
-    ("git-compare" . "\xf0ac")
-    ("git-merge" . "\xf023")
-    ("git-pull-request" . "\xf009")
-    ("globe" . "\xf0b6")
-    ("graph" . "\xf043")
-    ("beaker" . "\xf0dd")
-    ("heart" . "\x2665")
-    ("history" . "\xf07e")
-    ("home" . "\xf08d")
-    ("horizontal-rule" . "\xf070")
-    ("hourglass" . "\xf09e")
-    ("hubot" . "\xf09d")
-    ("inbox" . "\xf0cf")
-    ("info" . "\xf059")
-    ("issue-closed" . "\xf028")
-    ("issue-opened" . "\xf026")
-    ("issue-reopened" . "\xf027")
-    ("jersey" . "\xf019")
-    ("key" . "\xf049")
-    ("keyboard" . "\xf00d")
-    ("law" . "\xf0d8")
-    ("light-bulb" . "\xf000")
-    ("link" . "\xf05c")
-    ("link-external" . "\xf07f")
-    ("list-ordered" . "\xf062")
-    ("list-unordered" . "\xf061")
-    ("location" . "\xf060")
-    ("lock" . "\xf06a")
-    ("logo-github" . "\xf092")
-    ("mail" . "\xf03b")
-    ("mail-read" . "\xf03c")
-    ("mail-reply" . "\xf051")
-    ("mark-github" . "\xf00a")
-    ("markdown" . "\xf0c9")
-    ("megaphone" . "\xf077")
-    ("mention" . "\xf0be")
-    ("milestone" . "\xf075")
-    ("mirror" . "\xf024")
-    ("mortar-board" . "\xf0d7")
-    ("mute" . "\xf080")
-    ("no-newline" . "\xf09c")
-    ("octoface" . "\xf008")
-    ("organization" . "\xf037")
-    ("package" . "\xf0c4")
-    ("paintcan" . "\xf0d1")
-    ("pencil" . "\xf058")
-    ("person" . "\xf018")
-    ("pin" . "\xf041")
-    ("plug" . "\xf0d4")
-    ("plus" . "\xf05d")
-    ("primitive-dot" . "\xf052")
-    ("primitive-square" . "\xf053")
-    ("pulse" . "\xf085")
-    ("puzzle" . "\xf0c0")
-    ("question" . "\xf02c")
-    ("quote" . "\xf063")
-    ("radio-tower" . "\xf030")
-    ("repo" . "\xf001")
-    ("repo-clone" . "\xf04c")
-    ("repo-force-push" . "\xf04a")
-    ("repo-forked" . "\xf002")
-    ("repo-pull" . "\xf006")
-    ("repo-push" . "\xf005")
-    ("rocket" . "\xf033")
-    ("rss" . "\xf034")
-    ("ruby" . "\xf047")
-    ("search" . "\xf02e")
-    ("server" . "\xf097")
-    ("settings" . "\xf07c")
-    ("sign-in" . "\xf036")
-    ("sign-out" . "\xf032")
-    ("squirrel" . "\xf0b2")
-    ("star" . "\xf02a")
-    ("steps" . "\xf0c7")
-    ("stop" . "\xf08f")
-    ("sync" . "\xf087")
-    ("tag" . "\xf015")
-    ("telescope" . "\xf088")
-    ("terminal" . "\xf0c8")
-    ("three-bars" . "\xf05e")
-    ("thumbsdown" . "\xf0db")
-    ("thumbsup" . "\xf0da")
-    ("tools" . "\xf031")
-    ("trashcan" . "\xf0d0")
-    ("triangle-down" . "\xf05b")
-    ("triangle-left" . "\xf044")
-    ("triangle-right" . "\xf05a")
-    ("triangle-up" . "\xf0aa")
-    ("unfold" . "\xf039")
-    ("unmute" . "\xf0ba")
-    ("versions" . "\xf064")
-    ("x" . "\xf081")
-    ("zap" . "\x26A1")
-
-    ))
-
-(provide 'data-octicons)
.emacs.d/elpa/all-the-icons-20170817.642/data/data-octicons.elc
Binary file
.emacs.d/elpa/all-the-icons-20170817.642/data/data-weathericons.el
@@ -1,594 +0,0 @@
-(defvar all-the-icons-data/weather-icons-alist
-  '(
-
-    ("alien"                           . "\xf075")
-    ("barometer"                       . "\xf079")
-    ("celsius"                         . "\xf03c")
-    ("cloud"                           . "\xf041")
-    ("cloud-down"                      . "\xf03d")
-    ("cloud-refresh"                   . "\xf03e")
-    ("cloud-up"                        . "\xf040")
-    ("cloudy"                          . "\xf013")
-    ("cloudy-gusts"                    . "\xf011")
-    ("cloudy-windy"                    . "\xf012")
-    ("day-cloudy"                      . "\xf002")
-    ("day-cloudy-gusts"                . "\xf000")
-    ("day-cloudy-high"                 . "\xf07d")
-    ("day-cloudy-windy"                . "\xf001")
-    ("day-fog"                         . "\xf003")
-    ("day-hail"                        . "\xf004")
-    ("day-haze"                        . "\xf0b6")
-    ("day-light-wind"                  . "\xf0c4")
-    ("day-lightning"                   . "\xf005")
-    ("day-rain"                        . "\xf008")
-    ("day-rain-mix"                    . "\xf006")
-    ("day-rain-wind"                   . "\xf007")
-    ("day-showers"                     . "\xf009")
-    ("day-sleet"                       . "\xf0b2")
-    ("day-sleet-storm"                 . "\xf068")
-    ("day-snow"                        . "\xf00a")
-    ("day-snow-thunderstorm"           . "\xf06b")
-    ("day-snow-wind"                   . "\xf065")
-    ("day-sprinkle"                    . "\xf00b")
-    ("day-storm-showers"               . "\xf00e")
-    ("day-sunny"                       . "\xf00d")
-    ("day-sunny-overcast"              . "\xf00c")
-    ("day-thunderstorm"                . "\xf010")
-    ("day-windy"                       . "\xf085")
-    ("degrees"                         . "\xf042")
-    ("direction-down"                  . "\xf044")
-    ("direction-down-left"             . "\xf043")
-    ("direction-down-right"            . "\xf088")
-    ("direction-left"                  . "\xf048")
-    ("direction-right"                 . "\xf04d")
-    ("direction-up"                    . "\xf058")
-    ("direction-up-left"               . "\xf087")
-    ("direction-up-right"              . "\xf057")
-    ("dust"                            . "\xf063")
-    ("earthquake"                      . "\xf0c6")
-    ("fahrenheit"                      . "\xf045")
-    ("fire"                            . "\xf0c7")
-    ("flood"                           . "\xf07c")
-    ("fog"                             . "\xf014")
-    ("forecast-io-clear-day"           . "\xf00d")
-    ("forecast-io-clear-night"         . "\xf02e")
-    ("forecast-io-cloudy"              . "\xf013")
-    ("forecast-io-fog"                 . "\xf014")
-    ("forecast-io-hail"                . "\xf015")
-    ("forecast-io-partly-cloudy-day"   . "\xf002")
-    ("forecast-io-partly-cloudy-night" . "\xf031")
-    ("forecast-io-rain"                . "\xf019")
-    ("forecast-io-sleet"               . "\xf0b5")
-    ("forecast-io-snow"                . "\xf01b")
-    ("forecast-io-thunderstorm"        . "\xf01e")
-    ("forecast-io-tornado"             . "\xf056")
-    ("forecast-io-wind"                . "\xf050")
-    ("gale-warning"                    . "\xf0cd")
-    ("hail"                            . "\xf015")
-    ("horizon"                         . "\xf047")
-    ("horizon-alt"                     . "\xf046")
-    ("hot"                             . "\xf072")
-    ("humidity"                        . "\xf07a")
-    ("hurricane"                       . "\xf073")
-    ("hurricane-warning"               . "\xf0cf")
-    ("lightning"                       . "\xf016")
-    ("lunar-eclipse"                   . "\xf070")
-    ("meteor"                          . "\xf071")
-    ("moon-0"                          . "\xf095")
-    ("moon-1"                          . "\xf096")
-    ("moon-10"                         . "\xf09f")
-    ("moon-11"                         . "\xf0a0")
-    ("moon-12"                         . "\xf0a1")
-    ("moon-13"                         . "\xf0a2")
-    ("moon-14"                         . "\xf0a3")
-    ("moon-15"                         . "\xf0a4")
-    ("moon-16"                         . "\xf0a5")
-    ("moon-17"                         . "\xf0a6")
-    ("moon-18"                         . "\xf0a7")
-    ("moon-19"                         . "\xf0a8")
-    ("moon-2"                          . "\xf097")
-    ("moon-20"                         . "\xf0a9")
-    ("moon-21"                         . "\xf0aa")
-    ("moon-22"                         . "\xf0ab")
-    ("moon-23"                         . "\xf0ac")
-    ("moon-24"                         . "\xf0ad")
-    ("moon-25"                         . "\xf0ae")
-    ("moon-26"                         . "\xf0af")
-    ("moon-27"                         . "\xf0b0")
-    ("moon-3"                          . "\xf098")
-    ("moon-4"                          . "\xf099")
-    ("moon-5"                          . "\xf09a")
-    ("moon-6"                          . "\xf09b")
-    ("moon-7"                          . "\xf09c")
-    ("moon-8"                          . "\xf09d")
-    ("moon-9"                          . "\xf09e")
-    ("moon-alt-first-quarter"          . "\xf0d6")
-    ("moon-alt-full"                   . "\xf0dd")
-    ("moon-alt-new"                    . "\xf0eb")
-    ("moon-alt-third-quarter"          . "\xf0e4")
-    ("moon-alt-waning-crescent-1"      . "\xf0e5")
-    ("moon-alt-waning-crescent-2"      . "\xf0e6")
-    ("moon-alt-waning-crescent-3"      . "\xf0e7")
-    ("moon-alt-waning-crescent-4"      . "\xf0e8")
-    ("moon-alt-waning-crescent-5"      . "\xf0e9")
-    ("moon-alt-waning-crescent-6"      . "\xf0ea")
-    ("moon-alt-waning-gibbous-1"       . "\xf0de")
-    ("moon-alt-waning-gibbous-2"       . "\xf0df")
-    ("moon-alt-waning-gibbous-3"       . "\xf0e0")
-    ("moon-alt-waning-gibbous-4"       . "\xf0e1")
-    ("moon-alt-waning-gibbous-5"       . "\xf0e2")
-    ("moon-alt-waning-gibbous-6"       . "\xf0e3")
-    ("moon-alt-waxing-crescent-1"      . "\xf0d0")
-    ("moon-alt-waxing-crescent-2"      . "\xf0d1")
-    ("moon-alt-waxing-crescent-3"      . "\xf0d2")
-    ("moon-alt-waxing-crescent-4"      . "\xf0d3")
-    ("moon-alt-waxing-crescent-5"      . "\xf0d4")
-    ("moon-alt-waxing-crescent-6"      . "\xf0d5")
-    ("moon-alt-waxing-gibbous-1"       . "\xf0d7")
-    ("moon-alt-waxing-gibbous-2"       . "\xf0d8")
-    ("moon-alt-waxing-gibbous-3"       . "\xf0d9")
-    ("moon-alt-waxing-gibbous-4"       . "\xf0da")
-    ("moon-alt-waxing-gibbous-5"       . "\xf0db")
-    ("moon-alt-waxing-gibbous-6"       . "\xf0dc")
-    ("moon-first-quarter"              . "\xf09c")
-    ("moon-full"                       . "\xf0a3")
-    ("moon-new"                        . "\xf095")
-    ("moon-third-quarter"              . "\xf0aa")
-    ("moon-waning-crescent-1"          . "\xf0ab")
-    ("moon-waning-crescent-2"          . "\xf0ac")
-    ("moon-waning-crescent-3"          . "\xf0ad")
-    ("moon-waning-crescent-4"          . "\xf0ae")
-    ("moon-waning-crescent-5"          . "\xf0af")
-    ("moon-waning-crescent-6"          . "\xf0b0")
-    ("moon-waning-gibbous-1"           . "\xf0a4")
-    ("moon-waning-gibbous-2"           . "\xf0a5")
-    ("moon-waning-gibbous-3"           . "\xf0a6")
-    ("moon-waning-gibbous-4"           . "\xf0a7")
-    ("moon-waning-gibbous-5"           . "\xf0a8")
-    ("moon-waning-gibbous-6"           . "\xf0a9")
-    ("moon-waxing-crescent-1"          . "\xf096")
-    ("moon-waxing-crescent-2"          . "\xf097")
-    ("moon-waxing-crescent-3"          . "\xf098")
-    ("moon-waxing-crescent-4"          . "\xf099")
-    ("moon-waxing-crescent-5"          . "\xf09a")
-    ("moon-waxing-crescent-6"          . "\xf09b")
-    ("moon-waxing-gibbous-1"           . "\xf09d")
-    ("moon-waxing-gibbous-2"           . "\xf09e")
-    ("moon-waxing-gibbous-3"           . "\xf09f")
-    ("moon-waxing-gibbous-4"           . "\xf0a0")
-    ("moon-waxing-gibbous-5"           . "\xf0a1")
-    ("moon-waxing-gibbous-6"           . "\xf0a2")
-    ("moonrise"                        . "\xf0c9")
-    ("moonset"                         . "\xf0ca")
-    ("na"                              . "\xf07b")
-    ("night-alt-cloudy"                . "\xf086")
-    ("night-alt-cloudy-gusts"          . "\xf022")
-    ("night-alt-cloudy-high"           . "\xf07e")
-    ("night-alt-cloudy-windy"          . "\xf023")
-    ("night-alt-hail"                  . "\xf024")
-    ("night-alt-lightning"             . "\xf025")
-    ("night-alt-partly-cloudy"         . "\xf081")
-    ("night-alt-rain"                  . "\xf028")
-    ("night-alt-rain-mix"              . "\xf026")
-    ("night-alt-rain-wind"             . "\xf027")
-    ("night-alt-showers"               . "\xf029")
-    ("night-alt-sleet"                 . "\xf0b4")
-    ("night-alt-sleet-storm"           . "\xf06a")
-    ("night-alt-snow"                  . "\xf02a")
-    ("night-alt-snow-thunderstorm"     . "\xf06d")
-    ("night-alt-snow-wind"             . "\xf067")
-    ("night-alt-sprinkle"              . "\xf02b")
-    ("night-alt-storm-showers"         . "\xf02c")
-    ("night-alt-thunderstorm"          . "\xf02d")
-    ("night-clear"                     . "\xf02e")
-    ("night-cloudy"                    . "\xf031")
-    ("night-cloudy-gusts"              . "\xf02f")
-    ("night-cloudy-high"               . "\xf080")
-    ("night-cloudy-windy"              . "\xf030")
-    ("night-fog"                       . "\xf04a")
-    ("night-hail"                      . "\xf032")
-    ("night-lightning"                 . "\xf033")
-    ("night-partly-cloudy"             . "\xf083")
-    ("night-rain"                      . "\xf036")
-    ("night-rain-mix"                  . "\xf034")
-    ("night-rain-wind"                 . "\xf035")
-    ("night-showers"                   . "\xf037")
-    ("night-sleet"                     . "\xf0b3")
-    ("night-sleet-storm"               . "\xf069")
-    ("night-snow"                      . "\xf038")
-    ("night-snow-thunderstorm"         . "\xf06c")
-    ("night-snow-wind"                 . "\xf066")
-    ("night-sprinkle"                  . "\xf039")
-    ("night-storm-showers"             . "\xf03a")
-    ("night-thunderstorm"              . "\xf03b")
-    ("owm-200"                         . "\xf01e")
-    ("owm-201"                         . "\xf01e")
-    ("owm-202"                         . "\xf01e")
-    ("owm-210"                         . "\xf016")
-    ("owm-211"                         . "\xf016")
-    ("owm-212"                         . "\xf016")
-    ("owm-221"                         . "\xf016")
-    ("owm-230"                         . "\xf01e")
-    ("owm-231"                         . "\xf01e")
-    ("owm-232"                         . "\xf01e")
-    ("owm-300"                         . "\xf01c")
-    ("owm-301"                         . "\xf01c")
-    ("owm-302"                         . "\xf019")
-    ("owm-310"                         . "\xf017")
-    ("owm-311"                         . "\xf019")
-    ("owm-312"                         . "\xf019")
-    ("owm-313"                         . "\xf01a")
-    ("owm-314"                         . "\xf019")
-    ("owm-321"                         . "\xf01c")
-    ("owm-500"                         . "\xf01c")
-    ("owm-501"                         . "\xf019")
-    ("owm-502"                         . "\xf019")
-    ("owm-503"                         . "\xf019")
-    ("owm-504"                         . "\xf019")
-    ("owm-511"                         . "\xf017")
-    ("owm-520"                         . "\xf01a")
-    ("owm-521"                         . "\xf01a")
-    ("owm-522"                         . "\xf01a")
-    ("owm-531"                         . "\xf01d")
-    ("owm-600"                         . "\xf01b")
-    ("owm-601"                         . "\xf01b")
-    ("owm-602"                         . "\xf0b5")
-    ("owm-611"                         . "\xf017")
-    ("owm-612"                         . "\xf017")
-    ("owm-615"                         . "\xf017")
-    ("owm-616"                         . "\xf017")
-    ("owm-620"                         . "\xf017")
-    ("owm-621"                         . "\xf01b")
-    ("owm-622"                         . "\xf01b")
-    ("owm-701"                         . "\xf01a")
-    ("owm-711"                         . "\xf062")
-    ("owm-721"                         . "\xf0b6")
-    ("owm-731"                         . "\xf063")
-    ("owm-741"                         . "\xf014")
-    ("owm-761"                         . "\xf063")
-    ("owm-762"                         . "\xf063")
-    ("owm-771"                         . "\xf011")
-    ("owm-781"                         . "\xf056")
-    ("owm-800"                         . "\xf00d")
-    ("owm-801"                         . "\xf011")
-    ("owm-802"                         . "\xf011")
-    ("owm-803"                         . "\xf012")
-    ("owm-804"                         . "\xf013")
-    ("owm-900"                         . "\xf056")
-    ("owm-901"                         . "\xf01d")
-    ("owm-902"                         . "\xf073")
-    ("owm-903"                         . "\xf076")
-    ("owm-904"                         . "\xf072")
-    ("owm-905"                         . "\xf021")
-    ("owm-906"                         . "\xf015")
-    ("owm-957"                         . "\xf050")
-    ("owm-day-200"                     . "\xf010")
-    ("owm-day-201"                     . "\xf010")
-    ("owm-day-202"                     . "\xf010")
-    ("owm-day-210"                     . "\xf005")
-    ("owm-day-211"                     . "\xf005")
-    ("owm-day-212"                     . "\xf005")
-    ("owm-day-221"                     . "\xf005")
-    ("owm-day-230"                     . "\xf010")
-    ("owm-day-231"                     . "\xf010")
-    ("owm-day-232"                     . "\xf010")
-    ("owm-day-300"                     . "\xf00b")
-    ("owm-day-301"                     . "\xf00b")
-    ("owm-day-302"                     . "\xf008")
-    ("owm-day-310"                     . "\xf008")
-    ("owm-day-311"                     . "\xf008")
-    ("owm-day-312"                     . "\xf008")
-    ("owm-day-313"                     . "\xf008")
-    ("owm-day-314"                     . "\xf008")
-    ("owm-day-321"                     . "\xf00b")
-    ("owm-day-500"                     . "\xf00b")
-    ("owm-day-501"                     . "\xf008")
-    ("owm-day-502"                     . "\xf008")
-    ("owm-day-503"                     . "\xf008")
-    ("owm-day-504"                     . "\xf008")
-    ("owm-day-511"                     . "\xf006")
-    ("owm-day-520"                     . "\xf009")
-    ("owm-day-521"                     . "\xf009")
-    ("owm-day-522"                     . "\xf009")
-    ("owm-day-531"                     . "\xf00e")
-    ("owm-day-600"                     . "\xf00a")
-    ("owm-day-601"                     . "\xf0b2")
-    ("owm-day-602"                     . "\xf00a")
-    ("owm-day-611"                     . "\xf006")
-    ("owm-day-612"                     . "\xf006")
-    ("owm-day-615"                     . "\xf006")
-    ("owm-day-616"                     . "\xf006")
-    ("owm-day-620"                     . "\xf006")
-    ("owm-day-621"                     . "\xf00a")
-    ("owm-day-622"                     . "\xf00a")
-    ("owm-day-701"                     . "\xf009")
-    ("owm-day-711"                     . "\xf062")
-    ("owm-day-721"                     . "\xf0b6")
-    ("owm-day-731"                     . "\xf063")
-    ("owm-day-741"                     . "\xf003")
-    ("owm-day-761"                     . "\xf063")
-    ("owm-day-762"                     . "\xf063")
-    ("owm-day-781"                     . "\xf056")
-    ("owm-day-800"                     . "\xf00d")
-    ("owm-day-801"                     . "\xf000")
-    ("owm-day-802"                     . "\xf000")
-    ("owm-day-803"                     . "\xf000")
-    ("owm-day-804"                     . "\xf00c")
-    ("owm-day-900"                     . "\xf056")
-    ("owm-day-902"                     . "\xf073")
-    ("owm-day-903"                     . "\xf076")
-    ("owm-day-904"                     . "\xf072")
-    ("owm-day-906"                     . "\xf004")
-    ("owm-day-957"                     . "\xf050")
-    ("owm-night-200"                   . "\xf02d")
-    ("owm-night-201"                   . "\xf02d")
-    ("owm-night-202"                   . "\xf02d")
-    ("owm-night-210"                   . "\xf025")
-    ("owm-night-211"                   . "\xf025")
-    ("owm-night-212"                   . "\xf025")
-    ("owm-night-221"                   . "\xf025")
-    ("owm-night-230"                   . "\xf02d")
-    ("owm-night-231"                   . "\xf02d")
-    ("owm-night-232"                   . "\xf02d")
-    ("owm-night-300"                   . "\xf02b")
-    ("owm-night-301"                   . "\xf02b")
-    ("owm-night-302"                   . "\xf028")
-    ("owm-night-310"                   . "\xf028")
-    ("owm-night-311"                   . "\xf028")
-    ("owm-night-312"                   . "\xf028")
-    ("owm-night-313"                   . "\xf028")
-    ("owm-night-314"                   . "\xf028")
-    ("owm-night-321"                   . "\xf02b")
-    ("owm-night-500"                   . "\xf02b")
-    ("owm-night-501"                   . "\xf028")
-    ("owm-night-502"                   . "\xf028")
-    ("owm-night-503"                   . "\xf028")
-    ("owm-night-504"                   . "\xf028")
-    ("owm-night-511"                   . "\xf026")
-    ("owm-night-520"                   . "\xf029")
-    ("owm-night-521"                   . "\xf029")
-    ("owm-night-522"                   . "\xf029")
-    ("owm-night-531"                   . "\xf02c")
-    ("owm-night-600"                   . "\xf02a")
-    ("owm-night-601"                   . "\xf0b4")
-    ("owm-night-602"                   . "\xf02a")
-    ("owm-night-611"                   . "\xf026")
-    ("owm-night-612"                   . "\xf026")
-    ("owm-night-615"                   . "\xf026")
-    ("owm-night-616"                   . "\xf026")
-    ("owm-night-620"                   . "\xf026")
-    ("owm-night-621"                   . "\xf02a")
-    ("owm-night-622"                   . "\xf02a")
-    ("owm-night-701"                   . "\xf029")
-    ("owm-night-711"                   . "\xf062")
-    ("owm-night-721"                   . "\xf0b6")
-    ("owm-night-731"                   . "\xf063")
-    ("owm-night-741"                   . "\xf04a")
-    ("owm-night-761"                   . "\xf063")
-    ("owm-night-762"                   . "\xf063")
-    ("owm-night-781"                   . "\xf056")
-    ("owm-night-800"                   . "\xf02e")
-    ("owm-night-801"                   . "\xf022")
-    ("owm-night-802"                   . "\xf022")
-    ("owm-night-803"                   . "\xf022")
-    ("owm-night-804"                   . "\xf086")
-    ("owm-night-900"                   . "\xf056")
-    ("owm-night-902"                   . "\xf073")
-    ("owm-night-903"                   . "\xf076")
-    ("owm-night-904"                   . "\xf072")
-    ("owm-night-906"                   . "\xf024")
-    ("owm-night-957"                   . "\xf050")
-    ("rain"                            . "\xf019")
-    ("rain-mix"                        . "\xf017")
-    ("rain-wind"                       . "\xf018")
-    ("raindrop"                        . "\xf078")
-    ("raindrops"                       . "\xf04e")
-    ("refresh"                         . "\xf04c")
-    ("refresh-alt"                     . "\xf04b")
-    ("sandstorm"                       . "\xf082")
-    ("showers"                         . "\xf01a")
-    ("sleet"                           . "\xf0b5")
-    ("small-craft-advisory"            . "\xf0cc")
-    ("smog"                            . "\xf074")
-    ("smoke"                           . "\xf062")
-    ("snow"                            . "\xf01b")
-    ("snow"                            . "\xf01b")
-    ("snow-wind"                       . "\xf064")
-    ("snowflake-cold"                  . "\xf076")
-    ("solar-eclipse"                   . "\xf06e")
-    ("sprinkle"                        . "\xf01c")
-    ("stars"                           . "\xf077")
-    ("storm-showers"                   . "\xf01d")
-    ("storm-showers"                   . "\xf01d")
-    ("storm-warning"                   . "\xf0ce")
-    ("strong-wind"                     . "\xf050")
-    ("sunrise"                         . "\xf051")
-    ("sunset"                          . "\xf052")
-    ("thermometer"                     . "\xf055")
-    ("thermometer-exterior"            . "\xf053")
-    ("thermometer-internal"            . "\xf054")
-    ("thunderstorm"                    . "\xf01e")
-    ("thunderstorm"                    . "\xf01e")
-    ("time-1"                          . "\xf08a")
-    ("time-10"                         . "\xf093")
-    ("time-11"                         . "\xf094")
-    ("time-12"                         . "\xf089")
-    ("time-2"                          . "\xf08b")
-    ("time-3"                          . "\xf08c")
-    ("time-4"                          . "\xf08d")
-    ("time-5"                          . "\xf08e")
-    ("time-6"                          . "\xf08f")
-    ("time-7"                          . "\xf090")
-    ("time-8"                          . "\xf091")
-    ("time-9"                          . "\xf092")
-    ("tornado"                         . "\xf056")
-    ("train"                           . "\xf0cb")
-    ("tsunami"                         . "\xf0c5")
-    ("umbrella"                        . "\xf084")
-    ("volcano"                         . "\xf0c8")
-    ("wind-beaufort-0"                 . "\xf0b7")
-    ("wind-beaufort-1"                 . "\xf0b8")
-    ("wind-beaufort-10"                . "\xf0c1")
-    ("wind-beaufort-11"                . "\xf0c2")
-    ("wind-beaufort-12"                . "\xf0c3")
-    ("wind-beaufort-2"                 . "\xf0b9")
-    ("wind-beaufort-3"                 . "\xf0ba")
-    ("wind-beaufort-4"                 . "\xf0bb")
-    ("wind-beaufort-5"                 . "\xf0bc")
-    ("wind-beaufort-6"                 . "\xf0bd")
-    ("wind-beaufort-7"                 . "\xf0be")
-    ("wind-beaufort-8"                 . "\xf0bf")
-    ("wind-beaufort-9"                 . "\xf0c0")
-    ("wind-direction"                  . "\xf0b1")
-    ("windy"                           . "\xf021")
-    ("wmo4680-00"                      . "\xf055")
-    ("wmo4680-01"                      . "\xf013")
-    ("wmo4680-02"                      . "\xf055")
-    ("wmo4680-03"                      . "\xf013")
-    ("wmo4680-04"                      . "\xf014")
-    ("wmo4680-05"                      . "\xf014")
-    ("wmo4680-10"                      . "\xf014")
-    ("wmo4680-11"                      . "\xf014")
-    ("wmo4680-12"                      . "\xf016")
-    ("wmo4680-18"                      . "\xf050")
-    ("wmo4680-20"                      . "\xf014")
-    ("wmo4680-21"                      . "\xf017")
-    ("wmo4680-22"                      . "\xf017")
-    ("wmo4680-23"                      . "\xf019")
-    ("wmo4680-24"                      . "\xf01b")
-    ("wmo4680-25"                      . "\xf015")
-    ("wmo4680-26"                      . "\xf01e")
-    ("wmo4680-27"                      . "\xf063")
-    ("wmo4680-28"                      . "\xf063")
-    ("wmo4680-29"                      . "\xf063")
-    ("wmo4680-30"                      . "\xf014")
-    ("wmo4680-31"                      . "\xf014")
-    ("wmo4680-32"                      . "\xf014")
-    ("wmo4680-33"                      . "\xf014")
-    ("wmo4680-34"                      . "\xf014")
-    ("wmo4680-35"                      . "\xf014")
-    ("wmo4680-40"                      . "\xf017")
-    ("wmo4680-41"                      . "\xf01c")
-    ("wmo4680-42"                      . "\xf019")
-    ("wmo4680-43"                      . "\xf01c")
-    ("wmo4680-44"                      . "\xf019")
-    ("wmo4680-45"                      . "\xf015")
-    ("wmo4680-46"                      . "\xf015")
-    ("wmo4680-47"                      . "\xf01b")
-    ("wmo4680-48"                      . "\xf01b")
-    ("wmo4680-50"                      . "\xf01c")
-    ("wmo4680-51"                      . "\xf01c")
-    ("wmo4680-52"                      . "\xf019")
-    ("wmo4680-53"                      . "\xf019")
-    ("wmo4680-54"                      . "\xf076")
-    ("wmo4680-55"                      . "\xf076")
-    ("wmo4680-56"                      . "\xf076")
-    ("wmo4680-57"                      . "\xf01c")
-    ("wmo4680-58"                      . "\xf019")
-    ("wmo4680-60"                      . "\xf01c")
-    ("wmo4680-61"                      . "\xf01c")
-    ("wmo4680-62"                      . "\xf019")
-    ("wmo4680-63"                      . "\xf019")
-    ("wmo4680-64"                      . "\xf015")
-    ("wmo4680-65"                      . "\xf015")
-    ("wmo4680-66"                      . "\xf015")
-    ("wmo4680-67"                      . "\xf017")
-    ("wmo4680-68"                      . "\xf017")
-    ("wmo4680-70"                      . "\xf01b")
-    ("wmo4680-71"                      . "\xf01b")
-    ("wmo4680-72"                      . "\xf01b")
-    ("wmo4680-73"                      . "\xf01b")
-    ("wmo4680-74"                      . "\xf076")
-    ("wmo4680-75"                      . "\xf076")
-    ("wmo4680-76"                      . "\xf076")
-    ("wmo4680-77"                      . "\xf01b")
-    ("wmo4680-78"                      . "\xf076")
-    ("wmo4680-80"                      . "\xf019")
-    ("wmo4680-81"                      . "\xf01c")
-    ("wmo4680-82"                      . "\xf019")
-    ("wmo4680-83"                      . "\xf019")
-    ("wmo4680-84"                      . "\xf01d")
-    ("wmo4680-85"                      . "\xf017")
-    ("wmo4680-86"                      . "\xf017")
-    ("wmo4680-87"                      . "\xf017")
-    ("wmo4680-89"                      . "\xf015")
-    ("wmo4680-90"                      . "\xf016")
-    ("wmo4680-91"                      . "\xf01d")
-    ("wmo4680-92"                      . "\xf01e")
-    ("wmo4680-93"                      . "\xf01e")
-    ("wmo4680-94"                      . "\xf016")
-    ("wmo4680-95"                      . "\xf01e")
-    ("wmo4680-96"                      . "\xf01e")
-    ("wmo4680-99"                      . "\xf056")
-    ("wu-chanceflurries"               . "\xf064")
-    ("wu-chancerain"                   . "\xf019")
-    ("wu-chancesleat"                  . "\xf0b5")
-    ("wu-chancesnow"                   . "\xf01b")
-    ("wu-chancetstorms"                . "\xf01e")
-    ("wu-clear"                        . "\xf00d")
-    ("wu-cloudy"                       . "\xf002")
-    ("wu-flurries"                     . "\xf064")
-    ("wu-hazy"                         . "\xf0b6")
-    ("wu-mostlycloudy"                 . "\xf002")
-    ("wu-mostlysunny"                  . "\xf00d")
-    ("wu-partlycloudy"                 . "\xf002")
-    ("wu-partlysunny"                  . "\xf00d")
-    ("wu-rain"                         . "\xf01a")
-    ("wu-sleat"                        . "\xf0b5")
-    ("wu-snow"                         . "\xf01b")
-    ("wu-sunny"                        . "\xf00d")
-    ("wu-tstorms"                      . "\xf01e")
-    ("wu-unknown"                      . "\xf00d")
-    ("yahoo-0"                         . "\xf056")
-    ("yahoo-1"                         . "\xf00e")
-    ("yahoo-10"                        . "\xf015")
-    ("yahoo-11"                        . "\xf01a")
-    ("yahoo-12"                        . "\xf01a")
-    ("yahoo-13"                        . "\xf01b")
-    ("yahoo-14"                        . "\xf00a")
-    ("yahoo-15"                        . "\xf064")
-    ("yahoo-16"                        . "\xf01b")
-    ("yahoo-17"                        . "\xf015")
-    ("yahoo-18"                        . "\xf017")
-    ("yahoo-19"                        . "\xf063")
-    ("yahoo-2"                         . "\xf073")
-    ("yahoo-20"                        . "\xf014")
-    ("yahoo-21"                        . "\xf021")
-    ("yahoo-22"                        . "\xf062")
-    ("yahoo-23"                        . "\xf050")
-    ("yahoo-24"                        . "\xf050")
-    ("yahoo-25"                        . "\xf076")
-    ("yahoo-26"                        . "\xf013")
-    ("yahoo-27"                        . "\xf031")
-    ("yahoo-28"                        . "\xf002")
-    ("yahoo-29"                        . "\xf031")
-    ("yahoo-3"                         . "\xf01e")
-    ("yahoo-30"                        . "\xf002")
-    ("yahoo-31"                        . "\xf02e")
-    ("yahoo-32"                        . "\xf00d")
-    ("yahoo-3200"                      . "\xf077")
-    ("yahoo-33"                        . "\xf083")
-    ("yahoo-34"                        . "\xf00c")
-    ("yahoo-35"                        . "\xf017")
-    ("yahoo-36"                        . "\xf072")
-    ("yahoo-37"                        . "\xf00e")
-    ("yahoo-38"                        . "\xf00e")
-    ("yahoo-39"                        . "\xf00e")
-    ("yahoo-4"                         . "\xf01e")
-    ("yahoo-40"                        . "\xf01a")
-    ("yahoo-41"                        . "\xf064")
-    ("yahoo-42"                        . "\xf01b")
-    ("yahoo-43"                        . "\xf064")
-    ("yahoo-44"                        . "\xf00c")
-    ("yahoo-45"                        . "\xf00e")
-    ("yahoo-46"                        . "\xf01b")
-    ("yahoo-47"                        . "\xf00e")
-    ("yahoo-5"                         . "\xf017")
-    ("yahoo-6"                         . "\xf017")
-    ("yahoo-7"                         . "\xf017")
-    ("yahoo-8"                         . "\xf015")
-    ("yahoo-9"                         . "\xf01a")
-
-    ))
-
-(provide 'data-weathericons)
.emacs.d/elpa/all-the-icons-20170817.642/data/data-weathericons.elc
Binary file
.emacs.d/elpa/all-the-icons-20170817.642/all-the-icons-autoloads.el
@@ -1,59 +0,0 @@
-;;; all-the-icons-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "all-the-icons" "all-the-icons.el" (22964 3867
-;;;;;;  256660 856000))
-;;; Generated autoloads from all-the-icons.el
-
-(autoload 'all-the-icons-icon-for-file "all-the-icons" "\
-Get the formatted icon for FILE.
-ARG-OVERRIDES should be a plist containining `:height',
-`:v-adjust' or `:face' properties like in the normal icon
-inserting functions.
-
-\(fn FILE &rest ARG-OVERRIDES)" nil nil)
-
-(autoload 'all-the-icons-icon-for-mode "all-the-icons" "\
-Get the formatted icon for MODE.
-ARG-OVERRIDES should be a plist containining `:height',
-`:v-adjust' or `:face' properties like in the normal icon
-inserting functions.
-
-\(fn MODE &rest ARG-OVERRIDES)" nil nil)
-
-(autoload 'all-the-icons--icon-info-for-buffer "all-the-icons" "\
-Get icon info for the current buffer.
-
-When F is provided, the info function is calculated with the format
-`all-the-icons-icon-%s-for-file' or `all-the-icons-icon-%s-for-mode'.
-
-\(fn &optional F)" nil nil)
-
-(autoload 'all-the-icons-install-fonts "all-the-icons" "\
-Helper function to download and install the latests fonts based on OS.
-When PFX is non-nil, ignore the prompt and just install
-
-\(fn &optional PFX)" t nil)
-
-(autoload 'all-the-icons-insert "all-the-icons" "\
-Interactive icon insertion function.
-When Prefix ARG is non-nil, insert the propertized icon.
-When FAMILY is non-nil, limit the candidates to the icon set matching it.
-
-\(fn &optional ARG FAMILY)" t nil)
-
-;;;***
-
-;;;### (autoloads nil nil ("all-the-icons-faces.el" "all-the-icons-pkg.el")
-;;;;;;  (22964 3867 257660 856000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; all-the-icons-autoloads.el ends here
.emacs.d/elpa/all-the-icons-20170817.642/all-the-icons-faces.el
@@ -1,225 +0,0 @@
-;;; all-the-icons-faces.el --- A module of faces for all-the-icons
-
-;; Copyright (C) 2016  Dominic Charlesworth <dgc336@gmail.com>
-
-;; Author: Dominic Charlesworth <dgc336@gmail.com>
-;; Version: 1.0.0
-;; Package-Requires: ((emacs "24.3"))
-;; URL: https://github.com/domtronn/all-the-icons.el
-;; Keywords: convenient, lisp
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This file contains all of the faces used by the package for
-;; colouring icons
-
-;;; Code:
-
-(defgroup all-the-icons-faces nil
-  "Manage how All The Icons icons are coloured and themed."
-  :prefix "all-the-icons-"
-  :group 'tools
-  :group 'all-the-icons)
-
-
-;; red
-(defface all-the-icons-red
-  '((((background dark)) :foreground "#AC4142")
-    (((background light)) :foreground "#AC4142"))
-  "Face for red icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-lred
-  '((((background dark)) :foreground "#EB595A")
-    (((background light)) :foreground "#EB595A"))
-  "Face for lred icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-dred
-  '((((background dark)) :foreground "#843031")
-    (((background light)) :foreground "#843031"))
-  "Face for dred icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-red-alt
-  '((((background dark)) :foreground "#ce5643")
-    (((background light)) :foreground "#843031"))
-  "Face for dred icons"
-  :group 'all-the-icons-faces)
-
-;; green
-(defface all-the-icons-green
-  '((((background dark)) :foreground "#90A959")
-    (((background light)) :foreground "#90A959"))
-  "Face for green icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-lgreen
-  '((((background dark)) :foreground "#C6E87A")
-    (((background light)) :foreground "#3D6837"))
-  "Face for lgreen icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-dgreen
-  '((((background dark)) :foreground "#6D8143")
-    (((background light)) :foreground "#6D8143"))
-  "Face for dgreen icons"
-  :group 'all-the-icons-faces)
-
-;; yellow
-(defface all-the-icons-yellow
-  '((((background dark)) :foreground "#FFD446")
-    (((background light)) :foreground "#FFCC0E"))
-  "Face for yellow icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-lyellow
-  '((((background dark)) :foreground "#FFC16D")
-    (((background light)) :foreground "#FF9300"))
-  "Face for lyellow icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-dyellow
-  '((((background dark)) :foreground "#B48D56")
-    (((background light)) :foreground "#B48D56"))
-  "Face for dyellow icons"
-  :group 'all-the-icons-faces)
-
-;; blue
-(defface all-the-icons-blue
-  '((((background dark)) :foreground "#6A9FB5")
-    (((background light)) :foreground "#6A9FB5"))
-  "Face for blue icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-blue-alt
-  '((((background dark)) :foreground "#2188b6")
-    (((background light)) :foreground "#2188b6"))
-  "Face for blue icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-lblue
-  '((((background dark)) :foreground "#8FD7F4")
-    (((background light)) :foreground "#677174"))
-  "Face for lblue icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-dblue
-  '((((background dark)) :foreground "#446674")
-    (((background light)) :foreground "#446674"))
-  "Face for dblue icons"
-  :group 'all-the-icons-faces)
-
-;; maroon
-(defface all-the-icons-maroon
-  '((((background dark)) :foreground "#8F5536")
-    (((background light)) :foreground "#8F5536"))
-  "Face for maroon icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-lmaroon
-  '((((background dark)) :foreground "#CE7A4E")
-    (((background light)) :foreground "#CE7A4E"))
-  "Face for lmaroon icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-dmaroon
-  '((((background dark)) :foreground "#72584B")
-    (((background light)) :foreground "#72584B"))
-  "Face for dmaroon icons"
-  :group 'all-the-icons-faces)
-
-;; purple
-(defface all-the-icons-purple
-  '((((background dark)) :foreground "#AA759F")
-    (((background light)) :foreground "#68295B"))
-  "Face for purple icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-lpurple
-  '((((background dark)) :foreground "#E69DD6")
-    (((background light)) :foreground "#E69DD6"))
-  "Face for lpurple icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-dpurple
-  '((((background dark)) :foreground "#694863")
-    (((background light)) :foreground "#694863"))
-  "Face for dpurple icons"
-  :group 'all-the-icons-faces)
-
-;; orange
-(defface all-the-icons-orange
-  '((((background dark)) :foreground "#D4843E")
-    (((background light)) :foreground "#D4843E"))
-  "Face for orange icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-lorange
-  '((((background dark)) :foreground "#FFA500")
-    (((background light)) :foreground "#FFA500"))
-  "Face for lorange icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-dorange
-  '((((background dark)) :foreground "#915B2D")
-    (((background light)) :foreground "#915B2D"))
-  "Face for dorange icons"
-  :group 'all-the-icons-faces)
-
-;; cyan
-(defface all-the-icons-cyan
-  '((((background dark)) :foreground "#75B5AA")
-    (((background light)) :foreground "#75B5AA"))
-  "Face for cyan icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-cyan-alt
-  '((((background dark)) :foreground "#61dafb")
-    (((background light)) :foreground "#0595bd"))
-  "Face for cyan icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-lcyan
-  '((((background dark)) :foreground "#A5FDEC")
-    (((background light)) :foreground "#2C7D6E"))
-  "Face for lcyan icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-dcyan
-  '((((background dark)) :foreground "#48746D")
-    (((background light)) :foreground "#48746D"))
-  "Face for dcyan icons"
-  :group 'all-the-icons-faces)
-
-;; pink
-(defface all-the-icons-pink
-  '((((background dark)) :foreground "#F2B4B8")
-    (((background light)) :foreground "#FC505B"))
-  "Face for pink icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-lpink
-  '((((background dark)) :foreground "#FFBDC1")
-    (((background light)) :foreground "#FF505B"))
-  "Face for lpink icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-dpink
-  '((((background dark)) :foreground "#B18286")
-    (((background light)) :foreground "#7E5D5F"))
-  "Face for dpink icons"
-  :group 'all-the-icons-faces)
-
-;; silver
-(defface all-the-icons-silver
-  '((((background dark)) :foreground "#716E68")
-    (((background light)) :foreground "#716E68"))
-  "Face for silver icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-lsilver
-  '((((background dark)) :foreground "#B9B6AA")
-    (((background light)) :foreground "#7F7869"))
-  "Face for lsilver icons"
-  :group 'all-the-icons-faces)
-(defface all-the-icons-dsilver
-  '((((background dark)) :foreground "#838484")
-    (((background light)) :foreground "#838484"))
-  "Face for dsilver icons"
-  :group 'all-the-icons-faces)
-
-
-(provide 'all-the-icons-faces)
-;;; all-the-icons-faces.el ends here
.emacs.d/elpa/all-the-icons-20170817.642/all-the-icons-faces.elc
Binary file
.emacs.d/elpa/all-the-icons-20170817.642/all-the-icons-pkg.el
@@ -1,9 +0,0 @@
-(define-package "all-the-icons" "20170817.642" "A library for inserting Developer icons"
-  '((emacs "24.3")
-    (font-lock+ "0")
-    (memoize "1.0.1"))
-  :url "https://github.com/domtronn/all-the-icons.el" :keywords
-  '("convenient" "lisp"))
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/all-the-icons-20170817.642/all-the-icons.el
@@ -1,831 +0,0 @@
-;;; all-the-icons.el --- A library for inserting Developer icons
-
-;; Copyright (C) 2016  Dominic Charlesworth <dgc336@gmail.com>
-
-;; Author: Dominic Charlesworth <dgc336@gmail.com>
-;; Version: 2.6.4
-;; Package-Requires: ((emacs "24.3") (font-lock+ "0") (memoize "1.0.1"))
-;; URL: https://github.com/domtronn/all-the-icons.el
-;; Keywords: convenient, lisp
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package is a utility for using and formatting various Icon
-;; fonts within Emacs.  Icon Fonts allow you to propertize and format
-;; icons the same way you would normal text.  This enables things such
-;; as better scaling of and anti aliasing of the icons.
-
-;; This package was inspired by
-
-;; - `mode-icons' for Emacs, found at https://github.com/ryuslash/mode-icons
-;; - `file-icons' for Atom, found at https://atom.io/packages/file-icons
-
-;; Currently, this package provides an interface to the following Icon Fonts
-
-;; - Atom File Icons,       found at https://atom.io/packages/file-icons
-;; - FontAwesome Icons,     found at http://fontawesome.io/
-;; - GitHub Octicons,       found at http://octicons.github.com
-;; - Material Design Icons, found at http://google.github.io/material-design-icons/
-;; - Weather Icons,         found at https://erikflowers.github.io/weather-icons/
-;; - AllTheIcons,           a custom Icon Font maintained as part of this package
-
-;; Requests for new icons will be accepted and added to the AllTheIcons Icon Font
-
-;;; Usage:
-
-;; The simplest usage for this package is to use the following functions;
-
-;;   `all-the-icons-icon-for-buffer'
-;;   `all-the-icons-icon-for-file'
-;;   `all-the-icons-icon-for-mode'
-
-;; Which can be used to get a formatted icon for the current buffer, a
-;; file name or a major mode respectively.  e.g.
-
-;;   (insert (all-the-icons-icon-for-file "foo.js"))
-
-;; Inserts a JavaScript icon formatted like this
-
-;;   #("some-icon" 0 1 (display (raise -0.24)
-;;              face (:family "dev-icons" :height 1.08 :foreground "#FFD446")))
-
-;; You can also insert icons directly using the individual icon family
-;; functions
-
-;;   `all-the-icons-alltheicon'     // Custom font with fewest icons
-;;   `all-the-icons-devicon'        // Developer Icons
-;;   `all-the-icons-faicon'         // Font Awesome Icons
-;;   `all-the-icons-fileicon'       // File Icons from the Atom File Icons package
-;;   `all-the-icons-octicon'        // GitHub Octicons
-;;   `all-the-icons-material'       // Material Design Icons
-;;   `all-the-icons-wicon'          // Weather Icons
-
-;; You can call these functions with the icon name you want to insert, e.g.
-
-;;   (all-the-icons-octicon "file-binary")  // GitHub Octicon for Binary File
-;;   (all-the-icons-faicon  "cogs")         // FontAwesome icon for cogs
-;;   (all-the-icons-wicon   "tornado")      // Weather Icon for tornado
-
-;; A list of all the icon names for the different font families can be
-;; found in the data directory, or by inspecting the alist variables.
-;; All the alist variables are prefixed with `all-the-icons-data/'
-
-;;; Code:
-(require 'font-lock+)
-(require 'memoize)
-(require 'cl-lib)
-
-(require 'data-alltheicons  "./data/data-alltheicons.el")
-(require 'data-faicons      "./data/data-faicons.el")
-(require 'data-fileicons    "./data/data-fileicons.el")
-(require 'data-octicons     "./data/data-octicons.el")
-(require 'data-weathericons "./data/data-weathericons.el")
-(require 'data-material     "./data/data-material.el")
-
-(require 'all-the-icons-faces)
-
-;;; Custom Variables
-(defgroup all-the-icons nil
-  "Manage how All The Icons formats icons."
-  :prefix "all-the-icons-"
-  :group 'appearance
-  :group 'convenience)
-
-(defcustom all-the-icons-color-icons t
-  "Whether or not to include a foreground colour when formatting the icon."
-  :group 'all-the-icons
-  :type 'boolean)
-
-(defcustom all-the-icons-scale-factor 1.2
-  "The base Scale Factor for the `height' face property of an icon."
-  :group 'all-the-icons
-  :type 'number)
-
-(defcustom all-the-icons-default-adjust -0.2
-  "The default adjustment to be made to the `raise' display property of an icon."
-  :group 'all-the-icons
-  :type 'number)
-
-(defvar all-the-icons-font-families '() "List of defined icon font families.")
-(defvar all-the-icons-font-names '() "List of defined font file names this package was built with.")
-
-(defvar all-the-icons-icon-alist
-  '(
-    ;; Meta
-    ("\\.tags"          all-the-icons-octicon "tag"                     :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
-    ("^TAGS$"           all-the-icons-octicon "tag"                     :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
-    ("\\.log"           all-the-icons-octicon "bug"                     :height 1.0 :v-adjust 0.0 :face all-the-icons-maroon)
-
-    ;;
-    ("\\.key$"          all-the-icons-octicon "key"                     :v-adjust 0.0 :face all-the-icons-lblue)
-    ("\\.pem$"          all-the-icons-octicon "key"                     :v-adjust 0.0 :face all-the-icons-orange)
-    ("\\.p12$"          all-the-icons-octicon "key"                     :v-adjust 0.0 :face all-the-icons-dorange)
-    ("\\.crt$"          all-the-icons-octicon "key"                     :v-adjust 0.0 :face all-the-icons-lblue)
-    ("\\.pub$"          all-the-icons-octicon "key"                     :v-adjust 0.0 :face all-the-icons-blue)
-    ("\\.gpg$"          all-the-icons-octicon "key"                     :v-adjust 0.0 :face all-the-icons-lblue)
-
-    ("^TODO$"           all-the-icons-octicon "checklist"               :v-adjust 0.0 :face all-the-icons-lyellow)
-    ("^LICENSE$"        all-the-icons-octicon "book"                    :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
-    ("^readme"          all-the-icons-octicon "book"                    :height 1.0 :v-adjust 0.0 :face all-the-icons-lcyan)
-
-    ("\\.fish"          all-the-icons-alltheicon "terminal"             :face all-the-icons-lpink)
-    ("\\.zsh"           all-the-icons-alltheicon "terminal"             :face all-the-icons-lcyan)
-    ("\\.sh"            all-the-icons-alltheicon "terminal"             :face all-the-icons-purple)
-
-    ;; Config
-    ("\\.node"          all-the-icons-alltheicon "nodejs"               :height 1.0  :face all-the-icons-green)
-    ("\\.babelrc$"      all-the-icons-fileicon "babel"                  :face all-the-icons-yellow)
-    ("\\.bashrc$"       all-the-icons-alltheicon "script"               :height 0.9  :face all-the-icons-dpink)
-    ("\\.bowerrc$"      all-the-icons-alltheicon "bower"                :height 1.0 :v-adjust 0.0 :face all-the-icons-silver)
-    ("^bower.json$"     all-the-icons-alltheicon "bower"                :height 1.0 :v-adjust 0.0 :face all-the-icons-lorange)
-    ("\\.ini$"          all-the-icons-octicon "settings"                :v-adjust 0.0 :face all-the-icons-yellow)
-    ("\\.eslintignore"  all-the-icons-fileicon "eslint"                 :height 0.9  :face all-the-icons-purple)
-    ("\\.eslint"        all-the-icons-fileicon "eslint"                 :height 0.9  :face all-the-icons-lpurple)
-    ("\\.git"           all-the-icons-alltheicon "git"                  :height 1.0  :face all-the-icons-lred)
-    ("nginx"            all-the-icons-fileicon "nginx"                  :height 0.9  :face all-the-icons-dgreen)
-    ("apache"           all-the-icons-alltheicon "apache"               :height 0.9  :face all-the-icons-dgreen)
-    ("^Makefile$"       all-the-icons-fileicon "gnu"                    :face all-the-icons-dorange)
-    ("\\.mk$"           all-the-icons-fileicon "gnu"                    :face all-the-icons-dorange)
-
-    ("\\.dockerignore$" all-the-icons-fileicon "dockerfile"             :height 1.2  :face all-the-icons-dblue)
-    ("^\\.?Dockerfile"  all-the-icons-fileicon "dockerfile"             :face all-the-icons-blue)
-    ("^Brewfile$"       all-the-icons-faicon "beer"                     :face all-the-icons-lsilver)
-    ("\\.npmignore"     all-the-icons-fileicon "npm"                    :face all-the-icons-dred)
-    ("^package.json$"   all-the-icons-fileicon "npm"                    :face all-the-icons-red)
-    ("^package.lock.json$" all-the-icons-fileicon "npm"                 :face all-the-icons-dred)
-    ("^yarn\.lock"      all-the-icons-fileicon "yarn"                   :face all-the-icons-blue-alt)
-
-    ("\.xml$"           all-the-icons-faicon "file-code-o"              :height 0.95 :face all-the-icons-lorange)
-
-    ;; ;; AWS
-    ("^stack.*.json$"   all-the-icons-alltheicon "aws"                  :face all-the-icons-orange)
-
-    
-    ("^serverless\\.yml$" all-the-icons-faicon "bolt"                   :v-adjust 0.0 :face all-the-icons-yellow)
-    ("\\.[jc]son$"      all-the-icons-octicon "settings"                :v-adjust 0.0 :face all-the-icons-yellow)
-    ("\\.ya?ml$"        all-the-icons-octicon "settings"                :v-adjust 0.0 :face all-the-icons-dyellow)
-
-    ("\\.pkg$"          all-the-icons-octicon "package"                 :v-adjust 0.0 :face all-the-icons-dsilver)
-    ("\\.rpm$"          all-the-icons-octicon "package"                 :v-adjust 0.0 :face all-the-icons-dsilver)
-
-    ("\\.elc$"          all-the-icons-octicon "file-binary"             :v-adjust 0.0 :face all-the-icons-dsilver)
-
-    ("\\.gz$"           all-the-icons-octicon "file-binary"             :v-adjust 0.0 :face all-the-icons-lmaroon)
-    ("\\.zip$"          all-the-icons-octicon "file-zip"                :v-adjust 0.0 :face all-the-icons-lmaroon)
-    ("\\.7z$"           all-the-icons-octicon "file-zip"                :v-adjust 0.0 :face all-the-icons-lmaroon)
-
-    ("\\.dat$"          all-the-icons-faicon "bar-chart"                :face all-the-icons-cyan :height 0.9)
-    ;; lock files
-    ("~$"               all-the-icons-octicon "lock"                    :v-adjust 0.0 :face all-the-icons-maroon)
-
-    ("\\.dmg$"          all-the-icons-octicon "tools"                   :v-adjust 0.0 :face all-the-icons-lsilver)
-    ("\\.dll$"          all-the-icons-faicon "cogs"                     :face all-the-icons-silver)
-    ("\\.DS_STORE$"     all-the-icons-faicon "cogs"                     :face all-the-icons-silver)
-
-    ;; Source Codes
-    ("\\.scpt$"         all-the-icons-fileicon "apple"                  :face all-the-icons-pink)
-    ("\\.aup$"          all-the-icons-fileicon "audacity"               :face all-the-icons-yellow)
-
-    ("\\.elm"           all-the-icons-fileicon "elm"                    :face all-the-icons-blue)
-
-    ("\\.erl$"          all-the-icons-alltheicon "erlang"               :face all-the-icons-red :v-adjust -0.1 :height 0.9)
-    ("\\.hrl$"          all-the-icons-alltheicon "erlang"               :face all-the-icons-dred :v-adjust -0.1 :height 0.9)
-
-    ("\\.eex$"          all-the-icons-alltheicon "elixir"               :face all-the-icons-lorange :v-adjust -0.1 :height 0.9)
-    ("\\.ex$"           all-the-icons-alltheicon "elixir"               :face all-the-icons-lpurple :v-adjust -0.1 :height 0.9)
-    ("\\.exs$"          all-the-icons-alltheicon "elixir"               :face all-the-icons-lred :v-adjust -0.1 :height 0.9)
-    ("^mix.lock$"       all-the-icons-alltheicon "elixir"               :face all-the-icons-lyellow :v-adjust -0.1 :height 0.9)
-
-    ("\\.java$"         all-the-icons-alltheicon "java"                 :height 1.0  :face all-the-icons-purple)
-
-    ("\\.go$"           all-the-icons-alltheicon "go"                   :height 1.0  :face all-the-icons-blue)
-
-    ("\\.mp3$"          all-the-icons-faicon "volume-up"                :face all-the-icons-dred)
-    ("\\.wav$"          all-the-icons-faicon "volume-up"                :face all-the-icons-dred)
-    ("\\.m4a$"          all-the-icons-faicon "volume-up"                :face all-the-icons-dred)
-
-    ("\\.jl$"           all-the-icons-fileicon "julia"                  :v-adjust 0.0 :face all-the-icons-purple)
-    ("\\.matlab$"       all-the-icons-fileicon "matlab"                 :face all-the-icons-orange)
-
-    ("\\.p[ml]$"        all-the-icons-alltheicon "perl"                 :face all-the-icons-lorange)
-    ("\\.pl6$"          all-the-icons-fileicon "perl6"                  :face all-the-icons-cyan)
-    ("\\.pod$"          all-the-icons-alltheicon "perldocs"             :height 1.2  :face all-the-icons-lgreen)
-
-    ("\\.php$"          all-the-icons-fileicon "php"                    :face all-the-icons-lsilver)
-    ("\\.pony$"         all-the-icons-fileicon "pony"                   :face all-the-icons-maroon)
-    ("\\.prol?o?g?$"    all-the-icons-alltheicon "prolog"               :height 1.1  :face all-the-icons-lmaroon)
-    ("\\.py$"           all-the-icons-alltheicon "python"               :height 1.0  :face all-the-icons-dblue)
-
-    ("\\.rkt$"          all-the-icons-fileicon "racket"                 :height 1.2 :face all-the-icons-red)
-    ("\\.gem$"          all-the-icons-alltheicon "ruby-alt"             :face all-the-icons-red)
-    ("_?test\\.rb$"        all-the-icons-fileicon "test-ruby"            :height 1.0 :v-adjust 0.0 :face all-the-icons-red)
-    ("_?test_helper\\.rb$" all-the-icons-fileicon "test-ruby"            :height 1.0 :v-adjust 0.0 :face all-the-icons-dred)
-    ("\\.rb$"           all-the-icons-octicon "ruby"                    :v-adjust 0.0 :face all-the-icons-lred)
-    ("\\.rs$"           all-the-icons-alltheicon "rust"                 :height 1.2  :face all-the-icons-maroon)
-    ("\\.rlib$"         all-the-icons-alltheicon "rust"                 :height 1.2  :face all-the-icons-dmaroon)
-    ("\\.r[ds]?x?$"     all-the-icons-fileicon "R"                      :face all-the-icons-lblue)
-
-    ("\\.scala$"        all-the-icons-alltheicon "scala"                :face all-the-icons-red)
-    ("\\.scm$"          all-the-icons-fileicon   "scheme"               :height 1.2 :face all-the-icons-red)
-    ("\\.swift$"        all-the-icons-alltheicon "swift"                :height 1.0 :v-adjust -0.1 :face all-the-icons-green)
-
-    ("-?spec\\.ts$"     all-the-icons-fileicon "test-typescript"        :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
-    ("-?test\\.ts$"     all-the-icons-fileicon "test-typescript"        :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
-    ("-?spec\\.js$"     all-the-icons-fileicon "test-js"                :height 1.0 :v-adjust 0.0 :face all-the-icons-lpurple)
-    ("-?test\\.js$"     all-the-icons-fileicon "test-js"                :height 1.0 :v-adjust 0.0 :face all-the-icons-lpurple)
-    ("-?spec\\.jsx$"    all-the-icons-fileicon "test-react"             :height 1.0 :v-adjust 0.0 :face all-the-icons-blue-alt)
-    ("-?test\\.jsx$"    all-the-icons-fileicon "test-react"             :height 1.0 :v-adjust 0.0 :face all-the-icons-blue-alt)
-
-    ("-?spec\\."        all-the-icons-fileicon "test-generic"           :height 1.0 :v-adjust 0.0 :face all-the-icons-dgreen)
-    ("-?test\\."        all-the-icons-fileicon "test-generic"           :height 1.0 :v-adjust 0.0 :face all-the-icons-dgreen)
-
-    ;; There seems to be a a bug with this font icon which does not
-    ;; let you propertise it without it reverting to being a lower
-    ;; case phi
-    ("\\.c$"            all-the-icons-alltheicon "c-line"               :face all-the-icons-blue)
-    ("\\.h$"            all-the-icons-alltheicon "c-line"               :face all-the-icons-purple)
-    ("\\.m$"            all-the-icons-fileicon "apple"                  :v-adjust 0.0 :height 1.0)
-    ("\\.mm$"           all-the-icons-fileicon "apple"                  :v-adjust 0.0 :height 1.0)
-
-    ("\\.c\\(c\\|pp\\|xx\\)$"   all-the-icons-alltheicon "cplusplus-line"       :v-adjust -0.2 :face all-the-icons-blue)
-    ("\\.h\\(h\\|pp\\|xx\\)$"   all-the-icons-alltheicon "cplusplus-line"       :v-adjust -0.2 :face all-the-icons-purple)
-
-    ("\\.csx?$"         all-the-icons-alltheicon "csharp-line"          :face all-the-icons-dblue)
-
-    ("\\.cljc?$"        all-the-icons-alltheicon "clojure-line"         :height 1.0 :face all-the-icons-blue :v-adjust 0.0)
-    ("\\.cljs$"         all-the-icons-fileicon "cljs"                   :height 1.0 :face all-the-icons-dblue :v-adjust 0.0)
-
-    ("\\.coffee$"       all-the-icons-alltheicon "coffeescript"         :height 1.0  :face all-the-icons-maroon)
-    ("\\.iced$"         all-the-icons-alltheicon "coffeescript"         :height 1.0  :face all-the-icons-lmaroon)
-
-    ;; Git
-    ("^MERGE_"          all-the-icons-octicon "git-merge"               :v-adjust 0.0 :face all-the-icons-red)
-    ("^COMMIT_EDITMSG"  all-the-icons-octicon "git-commit"              :v-adjust 0.0 :face all-the-icons-red)
-
-    ;; Lisps
-    ("\\.cl$"           all-the-icons-fileicon "clisp"                  :face all-the-icons-lorange)
-    ("\\.l$"            all-the-icons-fileicon "lisp"                   :face all-the-icons-orange)
-    ("\\.el$"           all-the-icons-fileicon "elisp"                  :height 1.0 :v-adjust -0.2 :face all-the-icons-purple)
-
-    ;; Stylesheeting
-    ("\\.css$"          all-the-icons-alltheicon "css3"                 :face all-the-icons-yellow)
-    ("\\.scss$"         all-the-icons-alltheicon "sass"                 :face all-the-icons-pink)
-    ("\\.sass$"         all-the-icons-alltheicon "sass"                 :face all-the-icons-dpink)
-    ("\\.less$"         all-the-icons-alltheicon "less"                 :height 0.8  :face all-the-icons-dyellow)
-    ("\\.postcss$"      all-the-icons-fileicon "postcss"                :face all-the-icons-dred)
-    ("\\.sss$"          all-the-icons-fileicon "postcss"                :face all-the-icons-dred)
-    ("\\.styl$"         all-the-icons-alltheicon "stylus"               :face all-the-icons-lgreen)
-    ("stylelint"        all-the-icons-fileicon "stylelint"              :face all-the-icons-lyellow)
-    ("\\.csv$"          all-the-icons-octicon "graph"                   :v-adjust 0.0 :face all-the-icons-dblue)
-
-    ("\\.hs$"           all-the-icons-alltheicon "haskell"              :height 1.0  :face all-the-icons-red)
-
-    ;; Web modes
-    ("\\.inky-haml$"    all-the-icons-fileicon "haml"                   :face all-the-icons-lyellow)
-    ("\\.haml$"         all-the-icons-fileicon "haml"                   :face all-the-icons-lyellow)
-    ("\\.html?$"        all-the-icons-alltheicon "html5"                :face all-the-icons-orange)
-    ("\\.inky-erb?$"    all-the-icons-alltheicon "html5"                :face all-the-icons-lred)
-    ("\\.erb$"          all-the-icons-alltheicon "html5"                :face all-the-icons-lred)
-    ("\\.hbs$"          all-the-icons-fileicon "moustache"              :face all-the-icons-green)
-    ("\\.inky-slim$"    all-the-icons-octicon "dashboard"               :v-adjust 0.0 :face all-the-icons-yellow)
-    ("\\.slim$"         all-the-icons-octicon "dashboard"               :v-adjust 0.0 :face all-the-icons-yellow)
-    ("\\.jade$"         all-the-icons-fileicon "jade"                   :face all-the-icons-red)
-    ("\\.pug$"          all-the-icons-fileicon "pug-alt"                :face all-the-icons-red)
-
-    ;; JavaScript
-    ("^gulpfile"        all-the-icons-alltheicon "gulp"                 :height 1.0  :face all-the-icons-lred)
-    ("^gruntfile"       all-the-icons-alltheicon "grunt"                :height 1.0 :v-adjust -0.1 :face all-the-icons-lyellow)
-    ("^webpack"         all-the-icons-fileicon "webpack"                :face all-the-icons-lblue)
-
-    ("\\.d3\\.?js"      all-the-icons-alltheicon "d3"                   :height 0.8  :face all-the-icons-lgreen)
-
-    ("\\.re$"            all-the-icons-fileicon "reason"                :height 1.0  :face all-the-icons-red-alt)
-    ("\\.rei$"           all-the-icons-fileicon "reason"                :height 1.0  :face all-the-icons-dred)
-    ("\\.ml$"            all-the-icons-fileicon "ocaml"                 :height 1.0  :face all-the-icons-lpink)
-    ("\\.mli$"           all-the-icons-fileicon "ocaml"                 :height 1.0  :face all-the-icons-dpink)
-
-    ("\\.react"         all-the-icons-alltheicon "react"                :height 1.1  :face all-the-icons-lblue)
-    ("\\.d\\.ts$"       all-the-icons-fileicon "typescript"             :height 1.0 :v-adjust -0.1 :face all-the-icons-cyan-alt)
-    ("\\.ts$"           all-the-icons-fileicon "typescript"             :height 1.0 :v-adjust -0.1 :face all-the-icons-blue-alt)
-    ("\\.js$"           all-the-icons-alltheicon "javascript"           :height 1.0 :v-adjust 0.0 :face all-the-icons-yellow)
-    ("\\.es[0-9]$"      all-the-icons-alltheicon "javascript"           :height 1.0 :v-adjust 0.0 :face all-the-icons-yellow)
-    ("\\.jsx$"          all-the-icons-fileicon "jsx-2"                  :height 1.0 :v-adjust -0.1 :face all-the-icons-cyan-alt)
-    ("\\.njs$"          all-the-icons-alltheicon "nodejs"               :height 1.2  :face all-the-icons-lgreen)
-    ("\\.vue$"          all-the-icons-fileicon "vue"                    :face all-the-icons-lgreen)
-
-    ;; File Types
-    ("\\.ico$"          all-the-icons-octicon "file-media"              :v-adjust 0.0 :face all-the-icons-blue)
-    ("\\.png$"          all-the-icons-octicon "file-media"              :v-adjust 0.0 :face all-the-icons-orange)
-    ("\\.gif$"          all-the-icons-octicon "file-media"              :v-adjust 0.0 :face all-the-icons-green)
-    ("\\.jpe?g$"        all-the-icons-octicon "file-media"              :v-adjust 0.0 :face all-the-icons-dblue)
-    ("\\.svg$"          all-the-icons-alltheicon "svg"                  :height 0.9  :face all-the-icons-lgreen)
-
-    ;; Video
-    ("\\.mov"           all-the-icons-faicon "film"                     :face all-the-icons-blue)
-    ("\\.mp4"           all-the-icons-faicon "film"                     :face all-the-icons-blue)
-    ("\\.ogv"           all-the-icons-faicon "film"                     :face all-the-icons-dblue)
-
-    ;; Fonts
-    ("\\.ttf$"          all-the-icons-fileicon "font"                   :v-adjust 0.0 :face all-the-icons-dcyan)
-    ("\\.woff2?$"       all-the-icons-fileicon "font"                   :v-adjust 0.0 :face all-the-icons-cyan)
-
-    ;; Doc
-    ("\\.pdf"           all-the-icons-octicon "file-pdf"                :v-adjust 0.0 :face all-the-icons-dred)
-    ("\\.te?xt"         all-the-icons-octicon "file-text"               :v-adjust 0.0 :face all-the-icons-cyan)
-    ("\\.doc[xm]?$"     all-the-icons-fileicon "word"                   :face all-the-icons-blue)
-    ("\\.texi?$"        all-the-icons-fileicon "tex"                    :face all-the-icons-lred)
-    ("\\.md$"           all-the-icons-octicon "markdown"                :v-adjust 0.0 :face all-the-icons-lblue)
-    ("\\.bib$"          all-the-icons-fileicon "bib"                    :face all-the-icons-maroon)
-    ("\\.org$"          all-the-icons-fileicon "org"                    :face all-the-icons-lgreen)
-
-    ("\\.pp[st]$"       all-the-icons-fileicon "powerpoint"             :face all-the-icons-orange)
-    ("\\.pp[st]x$"      all-the-icons-fileicon "powerpoint"             :face all-the-icons-red)
-    ("\\.knt$"          all-the-icons-fileicon "powerpoint"             :face all-the-icons-cyan)
-
-    ("bookmark"         all-the-icons-octicon "bookmark"                :height 1.1 :v-adjust 0.0 :face all-the-icons-lpink)
-    ("\\.cache$"        all-the-icons-octicon "database"                :height 1.0 :v-adjust 0.0 :face all-the-icons-green)
-
-    ("^\\*scratch\\*$"  all-the-icons-faicon "sticky-note"              :face all-the-icons-lyellow)
-    ("^\\*scratch.*"    all-the-icons-faicon "sticky-note"              :face all-the-icons-yellow)
-    ("^\\*new-tab\\*$"  all-the-icons-material "star"                     :face all-the-icons-cyan)
-
-    ("^\\."             all-the-icons-octicon "gear"                    :v-adjust 0.0)
-    ("."                all-the-icons-faicon "file-o"                   :height 0.8 :v-adjust 0.0 :face all-the-icons-dsilver)))
-
-(defvar all-the-icons-dir-icon-alist
-  '(
-    ("trash"            all-the-icons-faicon "trash-o"          :height 1.2 :v-adjust -0.1)
-    ("dropbox"          all-the-icons-faicon "dropbox"          :height 1.0 :v-adjust -0.1)
-    ("google[ _-]drive" all-the-icons-alltheicon "google-drive" :height 1.3 :v-adjust -0.1)
-    ("^atom$"           all-the-icons-alltheicon "atom"         :height 1.2 :v-adjust -0.1)
-    ("documents"        all-the-icons-faicon "book"             :height 1.0 :v-adjust -0.1)
-    ("download"         all-the-icons-faicon "cloud-download"   :height 0.9 :v-adjust -0.2)
-    ("desktop"          all-the-icons-octicon "device-desktop"  :height 1.0 :v-adjust -0.1)
-    ("pictures"         all-the-icons-faicon "picture-o"        :height 0.9 :v-adjust -0.2)
-    ("photos"           all-the-icons-faicon "camera-retro"     :height 1.0 :v-adjust -0.1)
-    ("music"            all-the-icons-faicon "music"            :height 1.0 :v-adjust -0.1)
-    ("movies"           all-the-icons-faicon "film"             :height 0.9 :v-adjust -0.1)
-    ("code"             all-the-icons-octicon "code"            :height 1.1 :v-adjust -0.1)
-    ("workspace"        all-the-icons-octicon "code"            :height 1.1 :v-adjust -0.1)
-    ("test"             all-the-icons-fileicon "test-dir"       :height 0.9)
-    ("\\.git"           all-the-icons-alltheicon "git"          :height 1.0)
-    ("."                all-the-icons-octicon "file-directory"  :height 1.0 :v-adjust -0.1)
-    ))
-
-(defvar all-the-icons-weather-icon-alist
-  '(
-    ("tornado"               all-the-icons-wicon "tornado")
-    ("hurricane"             all-the-icons-wicon "hurricane")
-    ("thunderstorms"         all-the-icons-wicon "thunderstorm")
-    ("sunny"                 all-the-icons-wicon "day-sunny")
-    ("rain.*snow"            all-the-icons-wicon "rain-mix")
-    ("rain.*hail"            all-the-icons-wicon "rain-mix")
-    ("sleet"                 all-the-icons-wicon "sleet")
-    ("hail"                  all-the-icons-wicon "hail")
-    ("drizzle"               all-the-icons-wicon "sprinkle")
-    ("rain"                  all-the-icons-wicon "showers" :height 1.1 :v-adjust 0.0)
-    ("showers"               all-the-icons-wicon "showers")
-    ("blowing.*snow"         all-the-icons-wicon "snow-wind")
-    ("snow"                  all-the-icons-wicon "snow")
-    ("dust"                  all-the-icons-wicon "dust")
-    ("fog"                   all-the-icons-wicon "fog")
-    ("haze"                  all-the-icons-wicon "day-haze")
-    ("smoky"                 all-the-icons-wicon "smoke")
-    ("blustery"              all-the-icons-wicon "cloudy-windy")
-    ("windy"                 all-the-icons-wicon "cloudy-gusts")
-    ("cold"                  all-the-icons-wicon "snowflake-cold")
-    ("partly.*cloudy.*night" all-the-icons-wicon "night-alt-partly-cloudy")
-    ("partly.*cloudy"        all-the-icons-wicon "day-cloudy-high")
-    ("cloudy.*night"         all-the-icons-wicon "night-alt-cloudy")
-    ("cxloudy.*day"          all-the-icons-wicon "day-cloudy")
-    ("cloudy"                all-the-icons-wicon "cloudy")
-    ("clear.*night"          all-the-icons-wicon "night-clear")
-    ("fair.*night"           all-the-icons-wicon "stars")
-    ("fair.*day"             all-the-icons-wicon "horizon")
-    ("hot"                   all-the-icons-wicon "hot")
-    ("not.*available"        all-the-icons-wicon "na")
-    ))
-
-(defvar all-the-icons-mode-icon-alist
-  '(
-    (emacs-lisp-mode           all-the-icons-fileicon "elisp"              :height 1.0 :v-adjust -0.2 :face all-the-icons-purple)
-    (inferior-emacs-lisp-mode  all-the-icons-fileicon "elisp"              :height 1.0 :v-adjust -0.2 :face all-the-icons-lblue)
-    (dired-mode                all-the-icons-octicon "file-directory"      :v-adjust 0.0)
-    (lisp-interaction-mode     all-the-icons-fileicon "lisp"               :v-adjust -0.1 :face all-the-icons-orange)
-    (org-mode                  all-the-icons-fileicon "org"                :v-adjust 0.0 :face all-the-icons-lgreen)
-    (typescript-mode           all-the-icons-fileicon "typescript"         :v-adjust -0.1 :face all-the-icons-blue-alt)
-    (js-mode                   all-the-icons-alltheicon "javascript"       :v-adjust -0.1 :face all-the-icons-yellow)
-    (js-jsx-mode               all-the-icons-alltheicon "javascript"       :v-adjust -0.1 :face all-the-icons-yellow)
-    (js2-mode                  all-the-icons-alltheicon "javascript"       :v-adjust -0.1 :face all-the-icons-yellow)
-    (js3-mode                  all-the-icons-alltheicon "javascript"       :v-adjust -0.1 :face all-the-icons-yellow)
-    (rjsx-mode                 all-the-icons-fileicon "jsx-2"              :v-adjust -0.1 :face all-the-icons-cyan-alt)
-    (term-mode                 all-the-icons-octicon "terminal"            :v-adjust 0.2)
-    (eshell-mode               all-the-icons-octicon "terminal"            :v-adjust 0.0 :face all-the-icons-purple)
-    (magit-refs-mode           all-the-icons-octicon "git-branch"          :v-adjust 0.0 :face all-the-icons-red)
-    (magit-process-mode        all-the-icons-octicon "mark-github"         :v-adjust 0.0)
-    (magit-diff-mode           all-the-icons-octicon "git-compare"         :v-adjust 0.0 :face all-the-icons-lblue)
-    (ediff-mode                all-the-icons-octicon "git-compare"         :v-adjust 0.0 :Face all-the-icons-red)
-    (comint-mode               all-the-icons-faicon "terminal"             :v-adjust 0.0 :face all-the-icons-lblue)
-    (eww-mode                  all-the-icons-faicon "firefox"              :v-adjust -0.1 :face all-the-icons-red)
-    (org-agenda-mode           all-the-icons-octicon "checklist"           :v-adjust 0.0 :face all-the-icons-lgreen)
-    (cfw:calendar-mode         all-the-icons-octicon "calendar"            :v-adjust 0.0)
-    (ibuffer-mode              all-the-icons-faicon "files-o"              :v-adjust 0.0 :face all-the-icons-dsilver)
-    (messages-buffer-mode      all-the-icons-faicon "stack-overflow"       :v-adjust -0.1)
-    (help-mode                 all-the-icons-faicon "info"                 :v-adjust -0.1 :face all-the-icons-purple)
-    (benchmark-init/tree-mode  all-the-icons-octicon "dashboard"           :v-adjust 0.0)
-    (jenkins-mode              all-the-icons-fileicon "jenkins"            :face all-the-icons-blue)
-    (magit-popup-mode          all-the-icons-alltheicon "git"              :face all-the-icons-red)
-    (magit-status-mode         all-the-icons-alltheicon "git"              :face all-the-icons-lred)
-    (magit-log-mode            all-the-icons-alltheicon "git"              :face all-the-icons-green)
-    (Custom-mode               all-the-icons-octicon "settings")
-
-    ;; Special matcher for Web Mode based on the `web-mode-content-type' of the current buffer
-    (web-mode             all-the-icons--web-mode-icon)
-
-    (fundamental-mode                   all-the-icons-fileicon "elisp"            :height 1.0 :v-adjust -0.2 :face all-the-icons-dsilver)
-    (special-mode                       all-the-icons-fileicon "elisp"            :height 1.0 :v-adjust -0.2 :face all-the-icons-yellow)
-    (text-mode                          all-the-icons-octicon "file-text"         :v-adjust 0.0 :face all-the-icons-cyan)
-    (ruby-mode                          all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-lred)
-    (inf-ruby-mode                      all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-red)
-    (projectile-rails-compilation-mode  all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-red)
-    (rspec-compilation-mode             all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-red)
-    (rake-compilation-mode              all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-red)
-    (shell-mode                         all-the-icons-alltheicon "terminal"       :face all-the-icons-purple)
-    (fish-mode                          all-the-icons-alltheicon "terminal"       :face all-the-icons-lpink)
-    (nginx-mode                         all-the-icons-fileicon "nginx"            :height 0.9  :face all-the-icons-dgreen)
-    (apache-mode                        all-the-icons-alltheicon "apache"         :height 0.9  :face all-the-icons-dgreen)
-    (makefile-mode                      all-the-icons-fileicon "gnu"              :face all-the-icons-dorange)
-    (dockerfile-mode                    all-the-icons-fileicon "dockerfile"       :face all-the-icons-blue)
-    (docker-compose-mode                all-the-icons-fileicon "dockerfile"       :face all-the-icons-lblue)
-    (xml-mode                           all-the-icons-faicon "file-code-o"        :height 0.95 :face all-the-icons-lorange)
-    (json-mode                          all-the-icons-octicon "settings"          :face all-the-icons-yellow)
-    (yaml-mode                          all-the-icons-octicon "settings"          :v-adjust 0.0 :face all-the-icons-dyellow)
-    (elisp-byte-code-mode               all-the-icons-octicon "file-binary"       :v-adjust 0.0 :face all-the-icons-dsilver)
-    (archive-mode                       all-the-icons-octicon "file-zip"          :v-adjust 0.0 :face all-the-icons-lmaroon)
-    (elm-mode                           all-the-icons-fileicon "elm"              :face all-the-icons-blue)
-    (erlang-mode                        all-the-icons-alltheicon "erlang"         :face all-the-icons-red :v-adjust -0.1 :height 0.9)
-    (elixir-mode                        all-the-icons-alltheicon "elixir"         :face all-the-icons-lorange :v-adjust -0.1 :height 0.9)
-    (java-mode                          all-the-icons-alltheicon "java"           :height 1.0  :face all-the-icons-purple)
-    (go-mode                            all-the-icons-alltheicon "go"             :height 1.0  :face all-the-icons-blue)
-    (matlab-mode                        all-the-icons-fileicon "matlab"           :face all-the-icons-orange)
-    (perl-mode                          all-the-icons-alltheicon "perl"           :face all-the-icons-lorange)
-    (cperl-mode                         all-the-icons-alltheicon "perl"           :face all-the-icons-lorange)
-    (php-mode                           all-the-icons-fileicon "php"              :face all-the-icons-lsilver)
-    (prolog-mode                        all-the-icons-alltheicon "prolog"         :height 1.1  :face all-the-icons-lmaroon)
-    (python-mode                        all-the-icons-alltheicon "python"         :height 1.0  :face all-the-icons-dblue)
-    (racket-mode                        all-the-icons-fileicon "racket"           :height 1.2 :face all-the-icons-red)
-    (rust-mode                          all-the-icons-alltheicon "rust"           :height 1.2  :face all-the-icons-maroon)
-    (scala-mode                         all-the-icons-alltheicon "scala"          :face all-the-icons-red)
-    (scheme-mode                        all-the-icons-fileicon   "scheme"         :height 1.2 :face all-the-icons-red)
-    (swift-mode                         all-the-icons-alltheicon "swift"          :height 1.0 :v-adjust -0.1 :face all-the-icons-green)
-    (c-mode                             all-the-icons-alltheicon "c-line"         :face all-the-icons-blue)
-    (c++-mode                           all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
-    (csharp-mode                        all-the-icons-alltheicon "csharp-line"    :face all-the-icons-dblue)
-    (clojure-mode                       all-the-icons-alltheicon "clojure-line"   :height 1.0  :face all-the-icons-blue)
-    (cider-repl-mode                    all-the-icons-alltheicon "clojure-line"   :height 1.0  :face all-the-icons-dblue)
-    (clojurescript-mode                 all-the-icons-fileicon "cljs"             :height 1.0  :face all-the-icons-dblue)
-    (coffee-mode                        all-the-icons-alltheicon "coffeescript"   :height 1.0  :face all-the-icons-maroon)
-    (lisp-mode                          all-the-icons-fileicon "lisp"             :face all-the-icons-orange)
-    (css-mode                           all-the-icons-alltheicon "css3"           :face all-the-icons-yellow)
-    (scss-mode                          all-the-icons-alltheicon "sass"           :face all-the-icons-pink)
-    (sass-mode                          all-the-icons-alltheicon "sass"           :face all-the-icons-dpink)
-    (less-css-mode                      all-the-icons-alltheicon "less"           :height 0.8  :face all-the-icons-dyellow)
-    (stylus-mode                        all-the-icons-alltheicon "stylus"         :face all-the-icons-lgreen)
-    (csv-mode                           all-the-icons-octicon "graph"             :v-adjust 0.0 :face all-the-icons-dblue)
-    (haskell-mode                       all-the-icons-alltheicon "haskell"        :height 1.0  :face all-the-icons-red)
-    (haml-mode                          all-the-icons-fileicon "haml"             :face all-the-icons-lyellow)
-    (html-mode                          all-the-icons-alltheicon "html5"          :face all-the-icons-orange)
-    (rhtml-mode                         all-the-icons-alltheicon "html5"          :face all-the-icons-lred)
-    (mustache-mode                      all-the-icons-fileicon "moustache"        :face all-the-icons-green)
-    (slim-mode                          all-the-icons-octicon "dashboard"         :v-adjust 0.0 :face all-the-icons-yellow)
-    (jade-mode                          all-the-icons-fileicon "jade"             :face all-the-icons-red)
-    (pug-mode                           all-the-icons-fileicon "pug"              :face all-the-icons-red)
-    (react-mode                         all-the-icons-alltheicon "react"          :height 1.1  :face all-the-icons-lblue)
-    (image-mode                         all-the-icons-octicon "file-media"        :v-adjust 0.0 :face all-the-icons-blue)
-    (texinfo-mode                       all-the-icons-fileicon "tex"              :face all-the-icons-lred)
-    (markdown-mode                      all-the-icons-octicon "markdown"          :v-adjust 0.0 :face all-the-icons-lblue)
-    (bibtex-mode                        all-the-icons-fileicon "bib"              :face all-the-icons-maroon)
-    (org-mode                           all-the-icons-fileicon "org"              :face all-the-icons-lgreen)
-    (compilation-mode                   all-the-icons-faicon "cogs"               :v-adjust 0.0 :height 1.0)
-    (objc-mode                          all-the-icons-faicon "apple"              :v-adjust 0.0 :height 1.0)
-    ))
-
-;; ====================
-;;   Functions Start
-;; ====================
-
-(defun all-the-icons-auto-mode-match? (&optional file)
-  "Whether or not FILE's `major-mode' match against its `auto-mode-alist'."
-  (let* ((file (or file (buffer-file-name) (buffer-name)))
-         (auto-mode (all-the-icons-match-to-alist file auto-mode-alist)))
-    (eq major-mode auto-mode)))
-
-(defun all-the-icons-match-to-alist (file alist)
-  "Match FILE against an entry in ALIST using `string-match'."
-  (cdr (cl-find-if (lambda (it) (string-match (car it) file)) alist)))
-
-(defun all-the-icons-dir-is-submodule (dir)
-  "Checker whether or not DIR is a git submodule."
-  (let* ((gitmodule-dir (locate-dominating-file dir ".gitmodules"))
-         (modules-file  (expand-file-name (format "%s.gitmodules" gitmodule-dir)))
-         (module-search (format "submodule \".*?%s\"" (file-name-base dir))))
-
-    (when (and gitmodule-dir (file-exists-p (format "%s/.git" dir)))
-      (with-temp-buffer
-        (insert-file-contents modules-file)
-        (search-forward-regexp module-search (point-max) t)))))
-
-;; Icon functions
-(defun all-the-icons-icon-for-dir (dir &optional chevron padding)
-  "Format an icon for DIR with CHEVRON similar to tree based directories.
-
-If PADDING is provided, it will prepend and separate the chevron
-and directory with PADDING.
-
-Produces different symbols by inspecting DIR to distinguish
-symlinks and git repositories which do not depend on the
-directory contents"
-  (let* ((matcher (all-the-icons-match-to-alist (file-name-base dir) all-the-icons-dir-icon-alist))
-         (path (expand-file-name dir))
-         (chevron (if chevron (all-the-icons-octicon (format "chevron-%s" chevron) :height 0.8 :v-adjust -0.1) ""))
-         (padding (or padding "\t"))
-         (icon (cond
-                ((file-symlink-p path)
-                 (all-the-icons-octicon "file-symlink-directory" :height 1.0))
-                ((all-the-icons-dir-is-submodule path)
-                 (all-the-icons-octicon "file-submodule" :height 1.0))
-                ((file-exists-p (format "%s/.git" path))
-                 (format "%s" (all-the-icons-octicon "repo" :height 1.1)))
-                (t (apply (car matcher) (cdr matcher))))))
-    (format "%s%s%s%s%s" padding chevron padding icon padding)))
-
-(defun all-the-icons-icon-for-buffer ()
-  "Get the formatted icon for the current buffer.
-
-This function prioritises the use of the buffers file extension to
-discern the icon when its `major-mode' matches its auto mode,
-otherwise it will use the buffers `major-mode' to decide its
-icon."
-  (all-the-icons--icon-info-for-buffer))
-
-(defun all-the-icons-icon-family-for-buffer ()
-  "Get the icon font family for the current buffer."
-  (all-the-icons--icon-info-for-buffer "family"))
-
-(defun all-the-icons--web-mode-icon () "Get icon for a `web-mode' buffer." (all-the-icons--web-mode))
-(defun all-the-icons--web-mode-icon-family () "Get icon family for a `web-mode' buffer." (all-the-icons--web-mode t))
-(defun all-the-icons--web-mode (&optional family)
-  "Return icon or FAMILY for `web-mode' based on `web-mode-content-type'."
-  (cond
-   ((equal web-mode-content-type "jsx")
-    (if family (all-the-icons-fileicon-family) (all-the-icons-fileicon "jsx-2")))
-   ((equal web-mode-content-type "javascript")
-    (if family (all-the-icons-alltheicon-family) (all-the-icons-alltheicon "javascript")))
-   ((equal web-mode-content-type "json")
-    (if family (all-the-icons-alltheicon-family) (all-the-icons-alltheicon "less")))
-   ((equal web-mode-content-type "xml")
-    (if family (all-the-icons-faicon-family) (all-the-icons-faicon "file-code-o")))
-   ((equal web-mode-content-type "css")
-    (if family (all-the-icons-alltheicon-family) (all-the-icons-alltheicon "css3")))
-   (t
-    (if family (all-the-icons-alltheicon-family) (all-the-icons-alltheicon "html5")))))
-
-;; Icon Functions
-
-;;;###autoload
-(defun all-the-icons-icon-for-file (file &rest arg-overrides)
-  "Get the formatted icon for FILE.
-ARG-OVERRIDES should be a plist containining `:height',
-`:v-adjust' or `:face' properties like in the normal icon
-inserting functions."
-  (let* ((icon (all-the-icons-match-to-alist file all-the-icons-icon-alist))
-         (args (cdr icon)))
-    (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
-    (apply (car icon) args)))
-
-;;;###autoload
-(defun all-the-icons-icon-for-mode (mode &rest arg-overrides)
-  "Get the formatted icon for MODE.
-ARG-OVERRIDES should be a plist containining `:height',
-`:v-adjust' or `:face' properties like in the normal icon
-inserting functions."
-  (let* ((icon (cdr (assoc mode all-the-icons-mode-icon-alist)))
-         (args (cdr icon)))
-    (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
-    (if icon (apply (car icon) args) mode)))
-
-(memoize 'all-the-icons-icon-for-file)
-(memoize 'all-the-icons-icon-for-mode)
-
-;; Family Face Functions
-(defun all-the-icons-icon-family-for-file (file)
-  "Get the icons font family for FILE."
-  (let ((icon (all-the-icons-match-to-alist file all-the-icons-icon-alist)))
-    (funcall (intern (format "%s-family" (car icon))))))
-
-(defun all-the-icons-icon-family-for-mode (mode)
-  "Get the icons font family for MODE."
-  (let ((icon (cdr (assoc mode all-the-icons-mode-icon-alist))))
-    (if icon (funcall (intern (format "%s-family" (car icon)))) nil)))
-
-(defun all-the-icons-icon-family (icon)
-  "Get a propertized ICON family programatically."
-  (plist-get (get-text-property 0 'face icon) :family))
-
-(memoize 'all-the-icons-icon-family-for-file)
-(memoize 'all-the-icons-icon-family-for-mode)
-(memoize 'all-the-icons-icon-family)
-
-;;;###autoload
-(defun all-the-icons--icon-info-for-buffer (&optional f)
-  "Get icon info for the current buffer.
-
-When F is provided, the info function is calculated with the format
-`all-the-icons-icon-%s-for-file' or `all-the-icons-icon-%s-for-mode'."
-  (let* ((base-f (concat "all-the-icons-icon" (when f (format "-%s" f))))
-         (file-f (intern (concat base-f "-for-file")))
-         (mode-f (intern (concat base-f "-for-mode"))))
-    (if (and (buffer-file-name)
-             (all-the-icons-auto-mode-match?))
-        (funcall file-f (file-name-nondirectory (buffer-file-name)))
-      (funcall mode-f major-mode))))
-
-;; Weather icons
-(defun all-the-icons-icon-for-weather (weather)
-  "Get an icon for a WEATHER status."
-  (let ((icon (all-the-icons-match-to-alist weather all-the-icons-weather-icon-alist)))
-    (if icon (apply (car icon) (cdr icon)) weather)))
-
-;; Definitions
-
-(eval-and-compile
-  (defun all-the-icons--function-name (name)
-    "Get the symbol for an icon function name for icon set NAME."
-    (intern (concat "all-the-icons-" (downcase (symbol-name name)))))
-
-  (defun all-the-icons--family-name (name)
-    "Get the symbol for an icon family function for icon set NAME."
-    (intern (concat "all-the-icons-" (downcase (symbol-name name)) "-family")))
-
-  (defun all-the-icons--data-name (name)
-    "Get the symbol for an icon family function for icon set NAME."
-    (intern (concat "all-the-icons-" (downcase (symbol-name name)) "-data")))
-
-  (defun all-the-icons--insert-function-name (name)
-    "Get the symbol for an icon insert function for icon set NAME."
-    (intern (concat "all-the-icons-insert-" (downcase (symbol-name name))))))
-
-;; Icon insertion functions
-
-(defun all-the-icons--read-candidates ()
-  "Helper to build a list of candidates for all families."
-  (cl-reduce 'append (mapcar (lambda (it) (all-the-icons--read-candidates-for-family it t)) all-the-icons-font-families)))
-
-(defun all-the-icons--read-candidates-for-family (family &optional show-family)
-  "Helper to build read candidates for FAMILY.
-If SHOW-FAMILY is non-nil, displays the icons family in the candidate string."
-  (let ((data   (funcall (all-the-icons--data-name family)))
-        (icon-f (all-the-icons--function-name family)))
-    (mapcar
-     (lambda (it)
-       (let* ((icon-name (car it))
-              (icon-name-head (substring icon-name 0 1))
-              (icon-name-tail (substring icon-name 1))
-
-              (icon-display (propertize icon-name-head 'display (format "%s\t%s" (funcall icon-f icon-name) icon-name-head)))
-              (icon-family (if show-family (format "\t[%s]" family) ""))
-
-              (candidate-name (format "%s%s%s" icon-display icon-name-tail icon-family))
-              (candidate-icon (funcall (all-the-icons--function-name family) icon-name)))
-
-         (cons candidate-name candidate-icon)))
-     data)))
-
-;;;###autoload
-(defun all-the-icons-install-fonts (&optional pfx)
-  "Helper function to download and install the latests fonts based on OS.
-When PFX is non-nil, ignore the prompt and just install"
-  (interactive "P")
-  (when (or pfx (yes-or-no-p "This will download and install fonts, are you sure you want to do this?"))
-    (let* ((url-format "https://github.com/domtronn/all-the-icons.el/blob/master/fonts/%s?raw=true")
-           (font-dest (cl-case window-system
-                        (x  (concat (or (getenv "XDG_DATA_HOME")            ;; Default Linux install directories
-                                        (concat (getenv "HOME") "/.local/share"))
-                                    "/fonts/"))
-                        (mac (concat (getenv "HOME") "/Library/Fonts/" ))
-                        (ns (concat (getenv "HOME") "/Library/Fonts/" ))))  ;; Default MacOS install directory
-           (known-dest? (stringp font-dest))
-           (font-dest (or font-dest (read-directory-name "Font installation directory: " "~/"))))
-
-      (unless (file-directory-p font-dest) (mkdir font-dest t))
-
-      (mapc (lambda (font)
-              (url-copy-file (format url-format font) (expand-file-name font font-dest) t))
-            all-the-icons-font-names)
-      (when known-dest?
-        (message "Fonts downloaded, updating font cache... <fc-cache -f -v> ")
-        (shell-command-to-string (format "fc-cache -f -v")))
-      (message "%s Successfully %s `all-the-icons' fonts to `%s'!"
-               (all-the-icons-wicon "stars" :v-adjust 0.0)
-               (if known-dest? "installed" "downloaded")
-               font-dest))))
-
-;;;###autoload
-(defun all-the-icons-insert (&optional arg family)
-  "Interactive icon insertion function.
-When Prefix ARG is non-nil, insert the propertized icon.
-When FAMILY is non-nil, limit the candidates to the icon set matching it."
-  (interactive "P")
-  (let* ((standard-output (current-buffer))
-         (candidates (if family
-                         (all-the-icons--read-candidates-for-family family)
-                       (all-the-icons--read-candidates)))
-         (prompt     (if family
-                         (format "%s Icon: " (funcall (all-the-icons--family-name family)))
-                       "Icon : "))
-
-         (selection (completing-read prompt candidates nil t))
-         (result    (cdr (assoc selection candidates))))
-
-    (if arg (prin1 result) (insert result))))
-
-;; Debug Helpers
-
-(defun all-the-icons-insert-icons-for (family &optional height duration)
-  "Insert all of the available icons associated with FAMILY.
-If a HEIGHT is provided it will render the icons at this height.
-This is useful both to see the icons more clearly and to test
-different height rendering.  If DURATION is provided, it will
-pause for DURATION seconds between printing each character."
-  (let* ((data-f    (all-the-icons--data-name family))
-         (insert-f  (all-the-icons--function-name family))
-
-         (height (or height 2.0))
-         (data (funcall data-f)))
-    (mapc
-     (lambda (it)
-       (insert (format "%s - %s\n" (funcall insert-f (car it) :height height) (car it)))
-       (when duration (sit-for duration 0)))
-     data)))
-
-(defmacro define-icon (name alist family &optional font-name)
-  "Macro to generate functions for inserting icons for icon set NAME.
-
-NAME defines is the name of the iconset and will produce a
-function of the for `all-the-icons-NAME'.
-
-ALIST is the alist containing maps between icon names and the
-UniCode for the character.  All of these can be found in the data
-directory of this package.
-
-FAMILY is the font family to use for the icons.
-FONT-NAME is the name of the .ttf file providing the font, defaults to FAMILY."
-  `(progn
-     (add-to-list 'all-the-icons-font-families (quote ,name))
-     (add-to-list 'all-the-icons-font-names (quote ,(downcase (format "%s.ttf" (or font-name family)))))
-
-     (defun ,(all-the-icons--family-name name) () ,family)
-     (defun ,(all-the-icons--data-name name) () ,alist)
-     (defun ,(all-the-icons--function-name name) (icon-name &rest args)
-       (let ((icon (cdr (assoc icon-name ,alist)))
-             (other-face (when all-the-icons-color-icons (plist-get args :face)))
-             (height  (* all-the-icons-scale-factor (or (plist-get args :height) 1.0)))
-             (v-adjust (* all-the-icons-scale-factor (or (plist-get args :v-adjust) all-the-icons-default-adjust)))
-             (family ,family))
-         (unless icon
-           (error (format "Unable to find icon with name `%s' in icon set `%s'" icon-name (quote ,name))))
-         (propertize icon
-                     'face (if other-face
-                               `(:family ,family :height ,height :inherit ,other-face)
-                             `(:family ,family :height ,height))
-                     'display `(raise ,v-adjust)
-                     'rear-nonsticky t
-                     'font-lock-ignore t)))
-     (defun ,(all-the-icons--insert-function-name name) (&optional arg)
-       ,(format "Insert a %s icon at point." family)
-       (interactive "P")
-       (all-the-icons-insert arg (quote ,name)))))
-
-(define-icon alltheicon all-the-icons-data/alltheicons-alist    "all-the-icons")
-(define-icon fileicon   all-the-icons-data/file-icon-alist      "file-icons")
-(define-icon faicon     all-the-icons-data/fa-icon-alist        "FontAwesome")
-(define-icon octicon    all-the-icons-data/octicons-alist       "github-octicons" "octicons")
-(define-icon wicon      all-the-icons-data/weather-icons-alist  "Weather Icons"   "weathericons")
-(define-icon material   all-the-icons-data/material-icons-alist "Material Icons"  "material-design-icons")
-
-(provide 'all-the-icons)
-
-;;; all-the-icons.el ends here
.emacs.d/elpa/all-the-icons-20170817.642/all-the-icons.elc
Binary file
.emacs.d/elpa/async-20170916.2256/async-autoloads.el
@@ -1,131 +0,0 @@
-;;; async-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "async" "async.el" (22977 26777 480084 575000))
-;;; 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 from 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" (22977
-;;;;;;  26777 479084 581000))
-;;; 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 `async-bytecomp-package-mode' command
-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" (22977 26777
-;;;;;;  471084 632000))
-;;; Generated autoloads from dired-async.el
-
-(defvar dired-async-mode nil "\
-Non-nil if Dired-Async mode is enabled.
-See the `dired-async-mode' command
-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") (22977
-;;;;;;  26777 481084 568000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; async-autoloads.el ends here
.emacs.d/elpa/async-20170916.2256/async-bytecomp.el
@@ -1,177 +0,0 @@
-;;; async-bytecomp.el --- Compile elisp files asynchronously -*- lexical-binding: t -*-
-
-;; Copyright (C) 2014-2016 Free Software Foundation, Inc.
-
-;; Authors: John Wiegley <jwiegley@gmail.com>
-;;          Thierry Volpiatto <thierry.volpiatto@gmail.com>
-
-;; 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
.emacs.d/elpa/async-20170916.2256/async-bytecomp.elc
Binary file
.emacs.d/elpa/async-20170916.2256/async-pkg.el
@@ -1,6 +0,0 @@
-(define-package "async" "20170916.2256" "Asynchronous processing in Emacs" 'nil :keywords
-  '("async")
-  :url "https://github.com/jwiegley/emacs-async")
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/async-20170916.2256/async.el
@@ -1,353 +0,0 @@
-;;; async.el --- Asynchronous processing in Emacs -*- lexical-binding: t -*-
-
-;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
-
-;; Author: John Wiegley <jwiegley@gmail.com>
-;; Created: 18 Jun 2012
-;; Version: 1.9.2
-
-;; 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 sentinel 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 it 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))
-       (let ((buf (process-buffer future)))
-         (if (buffer-live-p buf)
-             (with-current-buffer buf
-               async-callback-value-set)
-             t))))
-
-(defun async-wait (future)
-  "Wait for FUTURE to become ready."
-  (while (not (async-ready future))
-    (sleep-for 0.05)))
-
-(defun async-get (future)
-  "Get the value from process FUTURE when it is ready.
-FUTURE is returned by `async-start' or `async-start-process' when
-its FINISH-FUNC is nil."
-  (and future (async-wait future))
-  (let ((buf (process-buffer future)))
-    (when (buffer-live-p buf)
-      (with-current-buffer buf
-        (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 ()
-  "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)))
-
-(defvar async-quiet-switch "-Q"
-  "The Emacs parameter to use to call emacs without config.
-Can be one of \"-Q\" or \"-q\".
-Default is \"-Q\" but it is sometimes useful to use \"-q\" to have a
-enhanced config or some more variables loaded.")
-
-;;;###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 from 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
-           async-quiet-switch "-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
-               "<none>"
-               (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)))
-
-(defun async--fold-left (fn forms bindings)
-  (let ((res forms))
-    (dolist (binding bindings)
-      (setq res (funcall fn res
-                         (if (listp binding)
-                             binding
-                             (list binding)))))
-    res))
-
-(defmacro async-let (bindings &rest forms)
-  "Implements `let', but each binding is established asynchronously.
-For example:
-
-  (async-let ((x (foo))
-              (y (bar)))
-     (message \"%s %s\" x y))
-
-    expands to ==>
-
-  (async-start (foo)
-   (lambda (x)
-     (async-start (bar)
-      (lambda (y)
-        (message \"%s %s\" x y)))))"
-  (declare (indent 1))
-  (async--fold-left
-   (lambda (acc binding)
-     (let ((fun (pcase (cadr binding)
-                  ((and (pred functionp) f) f)
-                  (f `(lambda () ,f)))))
-       `(async-start ,fun
-                     (lambda (,(car binding))
-                       ,acc))))
-   `(progn ,@forms)
-   (reverse bindings)))
-
-(provide 'async)
-
-;;; async.el ends here
.emacs.d/elpa/async-20170916.2256/async.elc
Binary file
.emacs.d/elpa/async-20170916.2256/dired-async.el
@@ -1,368 +0,0 @@
-;;; dired-async.el --- Asynchronous dired actions -*- lexical-binding: t -*-
-
-;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
-
-;; Authors: John Wiegley <jwiegley@gmail.com>
-;;          Thierry Volpiatto <thierry.volpiatto@gmail.com>
-
-;; 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))
-
-(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)
-
-(defcustom dired-async-mode-lighter '(:eval
-                                      (when (eq major-mode 'dired-mode)
-                                        " Async"))
-  "Mode line lighter used for `dired-async-mode'."
-  :group 'dired-async
-  :risky t
-  :type 'sexp)
-
-(defface dired-async-message
-    '((t (:foreground "yellow")))
-  "Face used for mode-line message."
-  :group 'dired-async)
-
-(defface dired-async-failures
-    '((t (:foreground "red")))
-  "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 face &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 face))))
-    (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))))
-    (and proc (delete-process proc))
-    (unless (> (length processes) 1)
-      (dired-async--modeline-mode -1))))
-
-(defun dired-async-after-file-create (total operation failures skipped)
-  "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 operation
-    (if (file-exists-p dired-async-log-file)
-        (progn
-          (pop-to-buffer (get-buffer-create dired-log-buffer))
-          (goto-char (point-max))
-          (setq inhibit-read-only t)
-          (insert "Error: ")
-          (insert-file-contents dired-async-log-file)
-          (special-mode)
-          (shrink-window-if-larger-than-buffer)
-          (delete-file dired-async-log-file))
-        (run-with-timer
-         0.1 nil
-         (lambda ()
-           ;; First send error messages.
-           (cond (failures
-                  (funcall dired-async-message-function
-                           "%s failed for %d of %d file%s -- See *Dired log* buffer"
-                           'dired-async-failures
-                           (car operation) (length failures)
-                           total (dired-plural-s total)))
-                 (skipped
-                  (funcall dired-async-message-function
-                           "%s: %d of %d file%s skipped -- See *Dired log* buffer"
-                           'dired-async-failures
-                           (car operation) (length skipped) total
-                           (dired-plural-s total))))
-           ;; Finally send the success message.
-           (funcall dired-async-message-function
-                    "Asynchronous %s of %s on %s file%s done"
-                    'dired-async-message
-                    (car operation) (cadr operation)
-                    total (dired-plural-s total)))))))
-
-(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))))))
-
-(defvar overwrite-query)
-(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 overwrite-query nil)
-  (let ((total (length fn-list))
-        failures async-fn-list skipped callback
-        async-quiet-switch)
-    (let (to)
-      (dolist (from fn-list)
-        (setq to (funcall name-constructor from))
-        (if (and (equal to from)
-                 (null (eq file-creator 'backup-file)))
-            (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 (and (null (eq file-creator 'backup-file))
-                                   (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)))))
-              ;; 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\n"
-                                   operation from to)))
-                  (push (cons from to) async-fn-list)))))
-      ;; Fix tramp issue #80 with emacs-26, use "-q" only when needed.
-      (setq async-quiet-switch
-            (if (and (boundp 'tramp-cache-read-persistent-data)
-                     async-fn-list
-                     (cl-loop for (from . to) in async-fn-list
-                              thereis (file-remote-p to)))
-                "-q" "-Q"))
-      ;; When failures have been printed to dired log add the date at bob.
-      (when (or failures skipped) (dired-log t))
-      ;; When async-fn-list is empty that's mean only one file
-      ;; had to be copied and user finally answer NO.
-      ;; In this case async process will never start and callback
-      ;; will have no chance to run, so notify failures here.
-      (unless async-fn-list
-        (cond (failures
-               (funcall dired-async-message-function
-                        "%s failed for %d of %d file%s -- See *Dired log* buffer"
-                        'dired-async-failures
-                        operation (length failures)
-                        total (dired-plural-s total)))
-              (skipped
-               (funcall dired-async-message-function
-                        "%s: %d of %d file%s skipped -- See *Dired log* buffer"
-                        'dired-async-failures
-                        operation (length skipped) total
-                        (dired-plural-s total)))))
-      ;; Setup callback.
-      (setq callback
-            (lambda (&optional _ignore)
-               (dired-async-after-file-create
-                total (list operation (length async-fn-list)) failures skipped)
-               (when (string= (downcase operation) "rename")
-                 (cl-loop for (file . to) in async-fn-list
-                          for bf = (get-file-buffer file)
-                          for destp = (file-exists-p to)
-                          do (and bf destp
-                                  (with-current-buffer bf
-                                    (set-visited-file-name to t t))))))))
-    ;; 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)
-                          (let ((dired-recursive-copies (quote always))
-                                (dired-copy-preserve-time
-                                 ,dired-copy-preserve-time))
-                            (setq overwrite-backup-query nil)
-                            ;; Inline `backup-file' as long as it is not
-                            ;; available in emacs.
-                            (defalias 'backup-file
-                                ;; Same feature as "cp -f --backup=numbered from to"
-                                ;; Symlinks are copied as file from source unlike
-                                ;; `dired-copy-file' which is same as cp -d.
-                                ;; Directories are omitted.
-                                (lambda (from to ok)
-                                  (cond ((file-directory-p from) (ignore))
-                                        (t (let ((count 0))
-                                             (while (let ((attrs (file-attributes to)))
-                                                      (and attrs (null (nth 0 attrs))))
-                                               (cl-incf count)
-                                               (setq to (concat (file-name-sans-versions to)
-                                                                (format ".~%s~" count)))))
-                                           (condition-case err
-                                               (copy-file from to ok dired-copy-preserve-time)
-                                             (file-date-error
-                                              (dired-log "Can't set date on %s:\n%s\n" from err)))))))
-                            ;; Now run the FILE-CREATOR function on files.
-                            (cl-loop with fn = (quote ,file-creator)
-                                     for (from . dest) in (quote ,async-fn-list)
-                                     do (condition-case err
-                                            (funcall fn from dest t)
-                                          (file-error
-                                           (dired-log "%s: %s\n" (car err) (cdr err)))
-                                          nil))
-                        (when (get-buffer dired-log-buffer)
-                          (dired-log t)
-                          (with-current-buffer dired-log-buffer
-                           (write-region (point-min) (point-max)
-                                         ,dired-async-log-file))))
-                      ,(dired-async-maybe-kill-ftp))
-                   callback)
-      ;; Run mode-line notifications while process running.
-      (dired-async--modeline-mode 1)
-      (message "%s proceeding asynchronously..." operation))))
-
-(defvar wdired-use-interactive-rename)
-(defun dired-async-wdired-do-renames (old-fn &rest args)
-  ;; Perhaps a better fix would be to ask for renaming BEFORE starting
-  ;; OLD-FN when `wdired-use-interactive-rename' is non-nil.  For now
-  ;; just bind it to nil to ensure no questions will be asked between
-  ;; each rename.
-  (let (wdired-use-interactive-rename)
-    (apply old-fn args)))
-
-(defadvice wdired-do-renames (around wdired-async)
-  (let (wdired-use-interactive-rename)
-    ad-do-it))
-
-(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
-  :lighter dired-async-mode-lighter
-  :global t
-  (if dired-async-mode
-      (if (fboundp 'advice-add)
-          (progn (advice-add 'dired-create-files :override #'dired-async-create-files)
-                 (advice-add 'wdired-do-renames :around #'dired-async-wdired-do-renames))
-        (ad-activate 'dired-create-files)
-        (ad-activate 'wdired-do-renames))
-      (if (fboundp 'advice-remove)
-          (progn (advice-remove 'dired-create-files #'dired-async-create-files)
-                 (advice-remove 'wdired-do-renames #'dired-async-wdired-do-renames))
-          (ad-deactivate 'dired-create-files)
-          (ad-deactivate 'wdired-do-renames))))
-
-
-(provide 'dired-async)
-
-;;; dired-async.el ends here
.emacs.d/elpa/async-20170916.2256/dired-async.elc
Binary file
.emacs.d/elpa/async-20170916.2256/smtpmail-async.el
@@ -1,73 +0,0 @@
-;;; smtpmail-async.el --- Send e-mail with smtpmail.el asynchronously -*- lexical-binding: t -*-
-
-;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
-
-;; Author: John Wiegley <jwiegley@gmail.com>
-;; 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\\|nsm"
-            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
.emacs.d/elpa/async-20170916.2256/smtpmail-async.elc
Binary file
.emacs.d/elpa/auto-compile-1.4.1/auto-compile-autoloads.el
@@ -1,125 +0,0 @@
-;;; auto-compile-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "auto-compile" "auto-compile.el" (22964 2141
-;;;;;;  731199 518000))
-;;; Generated autoloads from auto-compile.el
-
-(autoload 'auto-compile-mode "auto-compile" "\
-Compile Emacs Lisp source files after the visiting buffers are saved.
-
-After a buffer containing Emacs Lisp code is saved to its source
-file update the respective byte code file.  If the latter does
-not exist do nothing.  Therefore to disable automatic compilation
-remove the byte code file.  See command `toggle-auto-compile' for
-a convenient way to do so.
-
-This mode should be enabled globally, using it's globalized
-variant `auto-compile-on-save-mode'.  Also see the related
-`auto-compile-on-load-mode'.
-
-\(fn &optional ARG)" t nil)
-
-(defvar auto-compile-on-save-mode nil "\
-Non-nil if Auto-Compile-On-Save mode is enabled.
-See the `auto-compile-on-save-mode' command
-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 `auto-compile-on-save-mode'.")
-
-(custom-autoload 'auto-compile-on-save-mode "auto-compile" nil)
-
-(autoload 'auto-compile-on-save-mode "auto-compile" "\
-Toggle Auto-Compile mode in all buffers.
-With prefix ARG, enable Auto-Compile-On-Save mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
-
-Auto-Compile mode is enabled in all buffers where
-`turn-on-auto-compile-mode' would do it.
-See `auto-compile-mode' for more information on Auto-Compile mode.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'toggle-auto-compile "auto-compile" "\
-Toggle automatic compilation of an Emacs Lisp source file or files.
-
-Read a file or directory name from the minibuffer defaulting to
-the visited Emacs Lisp source file or `default-directory' if no
-such file is being visited in the current buffer.
-
-If the user selects a file then automatic compilation of only
-that file is toggled.  Since both `auto-compile-on-save' and
-`auto-compile-on-save' only ever _recompile_ byte code files,
-toggling automatic compilation is done simply by creating or
-removing the respective byte code file.
-
-If the user selects a directory then automatic compilation for
-multiple files is toggled as follows:
-
-* With a positive prefix argument always compile source files;
-  with a negative prefix argument always remove byte code files.
-
-* Otherwise the existence or absence of the byte code file of
-  the source file that was current when this command was invoked
-  determines whether byte code files should be created or removed.
-
-* If no Emacs Lisp source file is being visited in the buffer
-  that was current when the command was invoked ask the user what
-  to do.
-
-* When _removing_ byte code files then all byte code files are
-  removed.  If `auto-compile-deletes-stray-dest' is non-nil this
-  even includes byte code files for which no source file exists.
-
-* When _creating_ byte code files only do so for source files
-  that are actual libraries.  Source files that provide the
-  correct feature are considered to be libraries; see
-  `packed-library-p'.
-
-* Note that non-libraries can still be automatically compiled,
-  you just cannot _recursively_ turn on automatic compilation
-  using this command.
-
-* When `auto-compile-toggle-recompiles' is non-nil recompile all
-  affected source files even when the respective source files are
-  up-to-date.  Do so even for non-library source files.
-
-* Only enter subdirectories for which `packed-ignore-directory-p'
-  returns nil; i.e. don't enter hidden directories or directories
-  containing a file named \".nosearch\".
-
-\(fn FILE ACTION)" t nil)
-
-(defvar auto-compile-on-load-mode nil "\
-Non-nil if Auto-Compile-On-Load mode is enabled.
-See the `auto-compile-on-load-mode' command
-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 `auto-compile-on-load-mode'.")
-
-(custom-autoload 'auto-compile-on-load-mode "auto-compile" nil)
-
-(autoload 'auto-compile-on-load-mode "auto-compile" "\
-Before loading a library recompile it if it needs recompilation.
-
-A library needs to be recompiled if the source file is newer than
-it's byte-compile destination.  Without this advice the outdated
-byte code file would be loaded instead.
-
-Also see the related `auto-compile-on-save-mode'.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; auto-compile-autoloads.el ends here
.emacs.d/elpa/auto-compile-1.4.1/auto-compile-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "auto-compile" "1.4.1" "automatically compile Emacs Lisp libraries" '((emacs "24.3") (packed "2.0.0")) :commit "a31819a1b75a2320edb0f7f25d6c6faf528bf41a" :url "https://github.com/emacscollective/auto-compile" :keywords '("compile" "convenience" "lisp"))
.emacs.d/elpa/auto-compile-1.4.1/auto-compile.el
@@ -1,786 +0,0 @@
-;;; auto-compile.el --- automatically compile Emacs Lisp libraries
-
-;; Copyright (C) 2008-2017  Jonas Bernoulli
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Created: 20080830
-;; Package-Requires: ((emacs "24.3") (packed "2.0.0"))
-;; Package-Version: 1.4.1
-;; Homepage: https://github.com/emacscollective/auto-compile
-;; Keywords: compile, convenience, lisp
-
-;; This file is not part of GNU Emacs.
-
-;; 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 3, 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.
-
-;; For a full copy of the GNU General Public License
-;; see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package provides two minor modes which automatically recompile
-;; Emacs Lisp source files.  Together these modes guarantee that Emacs
-;; never loads outdated byte code files.
-
-;; `auto-compile-on-save-mode' re-compiles source files when they are
-;; being saved and `auto-compile-on-load-mode' does so before they are
-;; being loaded (by advising `load' and `require').  Both modes only
-;; ever _re-compile_ a source file when the respective byte code file
-;; already exists but is outdated.  Otherwise they do _not_ compile
-;; the source file.
-
-;; Even when using `auto-compile-on-save-mode' it can happen that some
-;; source file is newer than the respective byte code file, which is a
-;; problem because by default Emacs load the byte code file even when
-;; the respective source file has been modified more recently.
-
-;; Starting with Emacs version 24.4, setting `load-prefer-newer' to t
-;; prevents outdated byte code files from being loaded.  However this
-;; does not cause re-compilation of the source file, to actually do
-;; that `auto-compile-on-load-mode' is still required.
-
-;; Setup
-;; -----
-
-;; To reduce the risk of loading outdated byte code files, you should
-;; set `load-prefer-newer' and enable `auto-compile-on-load-mode' as
-;; early as possible.  Then also enable `auto-compile-on-save-mode'.
-;; You should also consider not byte-compiling your personal init
-;; file, or setting `load-prefer-newer' in a system-wide init file.
-
-;; If you use `package.el' then use something like this:
-;;
-;;     ;;; init.el --- user init file      -*- no-byte-compile: t -*-
-;;     (setq load-prefer-newer t)
-;;     (package-initialize)
-;;     (require 'auto-compile)
-;;     (auto-compile-on-load-mode)
-;;     (auto-compile-on-save-mode)
-
-;; otherwise:
-;;
-;;     ;;; init.el --- user init file      -*- no-byte-compile: t -*-
-;;     (setq load-prefer-newer t)
-;;     (add-to-list 'load-path "/path/to/dash")
-;;     (add-to-list 'load-path "/path/to/packed")
-;;     (add-to-list 'load-path "/path/to/auto-compile")
-;;     (require 'auto-compile)
-;;     (auto-compile-on-load-mode)
-;;     (auto-compile-on-save-mode)
-
-;; Usage
-;; -----
-
-;; Take note of the compile warnings and fix them.
-
-;; To permanently or temporarily toggle automatic compilation of some
-;; source file use the command `toggle-auto-compile'.  Since the modes
-;; only ever _update_ byte code files, toggling automatic compilation
-;; is done simply by either creating the byte code file or by removing
-;; it.  `toggle-auto-compile' can also toggle automatic compilation of
-;; multiple files at once; see its doc-string for more information.
-
-;; Customization
-;; -------------
-
-;; Constantly having the *Compile-Log* buffer pop up when a file is
-;; being saved can quickly become annoying.  Obviously the first thing
-;; you should do to about that is to actually fix outstanding issues.
-
-;; Once you have done that you might also want to keep that buffer
-;; from being automatically displayed and instead only show the number
-;; of compile warnings for the current file in the mode-line.
-
-;;     (setq auto-compile-display-buffer nil)
-;;     (setq auto-compile-mode-line-counter t)
-
-;; To display the buffer use `M-x auto-compile-display-log' or click
-;; on the counter in the mode-line.
-
-;; Using `auto-compile-inhibit-compile-hook' it is possible to inhibit
-;; automatic compilation under certain circumstances; e.g. when HEAD
-;; is detached inside a Git repository (useful during rebase sessions).
-
-;;; Code:
-
-(require 'bytecomp)
-(require 'cl-lib)
-(require 'packed)
-
-(declare-function autoload-rubric "autoload")
-(declare-function autoload-find-destination "autoload")
-(declare-function autoload-file-load-name "autoload")
-(declare-function autoload-generate-file-autoloads "autoload")
-
-(defvar autoload-modified-buffers)
-
-(defvar auto-compile-update-autoloads)
-(defvar auto-compile-use-mode-line)
-
-(defgroup auto-compile nil
-  "Automatically compile Emacs Lisp source libraries."
-  :group 'convenience
-  :prefix 'auto-compile
-  :link '(function-link toggle-auto-compile)
-  :link '(function-link auto-compile-mode))
-
-;;; Auto-Compile-On-Save Mode
-
-;;;###autoload
-(define-minor-mode auto-compile-mode
-  "Compile Emacs Lisp source files after the visiting buffers are saved.
-
-After a buffer containing Emacs Lisp code is saved to its source
-file update the respective byte code file.  If the latter does
-not exist do nothing.  Therefore to disable automatic compilation
-remove the byte code file.  See command `toggle-auto-compile' for
-a convenient way to do so.
-
-This mode should be enabled globally, using it's globalized
-variant `auto-compile-on-save-mode'.  Also see the related
-`auto-compile-on-load-mode'."
-  :lighter auto-compile-mode-lighter
-  :group 'auto-compile
-  (unless (derived-mode-p 'emacs-lisp-mode)
-    (user-error "This mode only makes sense with emacs-lisp-mode"))
-  (if auto-compile-mode
-      (add-hook  'after-save-hook 'auto-compile-byte-compile nil t)
-    (remove-hook 'after-save-hook 'auto-compile-byte-compile t))
-  (auto-compile-modify-mode-line auto-compile-use-mode-line))
-
-;;;###autoload
-(define-globalized-minor-mode auto-compile-on-save-mode
-  auto-compile-mode turn-on-auto-compile-mode)
-
-(defun turn-on-auto-compile-mode ()
-  (when (eq major-mode 'emacs-lisp-mode)
-    (auto-compile-mode 1)))
-
-(defvar auto-compile-mode-lighter ""
-  "Mode lighter for Auto-Compile Mode.")
-
-;;; Options
-
-(defcustom auto-compile-visit-failed t
-  "Whether to visit source files which failed to compile.
-
-If this is non-nil visit but don't select a source file if it
-isn't being visited in a buffer already.  Also set the buffer
-local value of variable `auto-compile-pretend-byte-compiled'
-\(which see) to t and mark the buffer as modified if the value
-of variable `auto-compile-mark-failed-modified' is non-nil."
-  :group 'auto-compile
-  :type 'boolean)
-
-(defcustom auto-compile-mark-failed-modified nil
-  "Whether to mark buffers which failed to compile as modified.
-
-This serves as a reminder to fix fatal errors.  While useful this
-can get annoying so this variable can be quickly toggled with the
-command `auto-compile-toggle-mark-failed-modified'."
-  :group 'auto-compile
-  :type 'boolean)
-
-(defcustom auto-compile-ding t
-  "Whether to beep (or flash the screen) when an error occurs.
-
-Expected errors (such as compile error, unmatched parens, or
-failure to remove a file) are caught and execution continues so
-that failure to process one file does not prevent other files
-from being processed.
-
-To inform users of such errors Auto-Compile instead beeps or
-flashes the screen; set this variable to nil to disable even
-that."
-  :group 'auto-compile
-  :type 'boolean)
-
-(defcustom auto-compile-check-parens t
-  "Whether to check for unbalanced parentheses before compiling.
-
-This only has as an effect on files which are currently being
-visited in a buffer.  Other files are compiled without performing
-this check first.  If unbalanced parentheses are found no attempt
-is made to compile the file as that would obviously fail also."
-  :group 'auto-compile
-  :type 'boolean)
-
-(defcustom auto-compile-update-autoloads nil
-  "Whether to update autoloads after compiling.
-
-If no autoload file as specified by `packed-loaddefs-filename' can be
-found quietly skip this step."
-  :group 'auto-compile
-  :type 'boolean)
-
-(defcustom auto-compile-inhibit-compile-hook nil
-  "Hook used to inhibit automatic compilation.
-
-This hook is run before automatic compilation takes place, if
-any of the hook functions returns non-nil, then do not compile."
-  :group 'auto-compile
-  :options '(auto-compile-inhibit-compile-detached-git-head)
-  :type 'hook)
-
-(defcustom auto-compile-verbose nil
-  "Whether to print messages describing progress of byte-compiler.
-
-This overrides `byte-compile-verbose' but unlike that does not
-default to t, and thus avoids unnecessary echo-area messages."
-  :group 'auto-compile
-  :type 'boolean)
-
-(defcustom auto-compile-display-buffer t
-  "Whether to automatically display the *Compile-Log* buffer.
-
-When there are errors then the buffer is always displayed,
-when there are no warnings or errors it is never displayed."
-  :group 'auto-compile
-  :type 'boolean)
-
-(defcustom auto-compile-mode-line-counter nil
-  "Whether to display the number of warnings in the mode line.
-
-This assumes that `auto-compile-use-mode-line' (which see) is
-non-nil."
-  :group 'auto-compile
-  :type 'boolean)
-
-(defun auto-compile-modify-mode-line (after)
-  (let ((format (delete 'mode-line-auto-compile
-                        (default-value 'mode-line-format)))
-        cell)
-    (when (and after auto-compile-mode
-               (setq cell (member after format)))
-      (push 'mode-line-auto-compile (cdr cell)))
-    (set-default 'mode-line-format format)))
-
-(defcustom auto-compile-use-mode-line
-  (car (memq 'mode-line-modified (default-value 'mode-line-format)))
-  "Whether to show information about the byte code file in the mode line.
-
-This works by inserting `mode-line-auto-compile' into the default
-value of `mode-line-format' after the construct (usually a symbol)
-specified here.  This happens every time local Auto-Compile mode
-is turned on so the specified construct does not have to a member
-of `mode-line-format' when this is set (this allows loading that
-package after `auto-compile-on-load-mode' has been activated, so
-that it can ensures the respective byte code file is up-to-date).
-
-If you want to add `mode-line-auto-compile' as a member of a
-variable that is itself a member of `mode-line-format' then you
-have to set this option to nil and manually modify that variable
-to include `mode-line-auto-compile'."
-  :group 'auto-compile
-  :set (lambda (symbol value)
-         (set-default symbol value)
-         (auto-compile-modify-mode-line value))
-  :type '(choice (const :tag "don't insert" nil)
-                 (const :tag "after mode-line-modified" mode-line-modified)
-                 (const :tag "after mode-line-remote" mode-line-remote)
-                 (sexp  :tag "after construct")))
-
-(defcustom auto-compile-toggle-recompiles t
-  "Whether to recompile all source files when turning on compilation.
-
-When turning on auto compilation for multiple files at once
-recompile source files even if their byte code file already
-exist and are up-to-date.  It's advisable to keep this enabled
-to ensure changes to macros are picked up."
-  :group 'auto-compile
-  :type 'boolean)
-
-(defcustom auto-compile-delete-stray-dest t
-  "Whether to remove stray byte code files.
-
-If this is non-nil byte code files without a corresponding source
-file are removed as they are encountered.  This happens in the
-functions `auto-compile-on-save' and `toggle-auto-compile'.  The
-main purpose of this functionality is to prevent leftover byte
-code files from shadowing a source or byte code file in a
-directory that comes later in the `load-path'."
-  :group 'auto-compile
-  :type 'boolean)
-
-(defcustom auto-compile-toggle-deletes-nonlib-dest nil
-  "Whether to delete non-library byte code files when toggling compilation."
-  :group 'auto-compile
-  :type 'boolean)
-
-(defcustom auto-compile-source-recreate-deletes-dest nil
-  "Whether to delete leftover byte code file when creating source file.
-
-When this is non-nil and saving a source buffer causes the file
-to be created (as opposed to being overwritten) while its byte
-code file already exists (because the source already existed and
-was compiled in the past), then remove the latter (instead of
-updating it by recompiling the source).  This can e.g. happen
-when switching git branches."
-  :group 'auto-compile
-  :type 'boolean)
-
-;;; Toggle and Perform Compilation
-
-;;;###autoload
-(defun toggle-auto-compile (file action)
-  "Toggle automatic compilation of an Emacs Lisp source file or files.
-
-Read a file or directory name from the minibuffer defaulting to
-the visited Emacs Lisp source file or `default-directory' if no
-such file is being visited in the current buffer.
-
-If the user selects a file then automatic compilation of only
-that file is toggled.  Since both `auto-compile-on-save' and
-`auto-compile-on-save' only ever _recompile_ byte code files,
-toggling automatic compilation is done simply by creating or
-removing the respective byte code file.
-
-If the user selects a directory then automatic compilation for
-multiple files is toggled as follows:
-
-* With a positive prefix argument always compile source files;
-  with a negative prefix argument always remove byte code files.
-
-* Otherwise the existence or absence of the byte code file of
-  the source file that was current when this command was invoked
-  determines whether byte code files should be created or removed.
-
-* If no Emacs Lisp source file is being visited in the buffer
-  that was current when the command was invoked ask the user what
-  to do.
-
-* When _removing_ byte code files then all byte code files are
-  removed.  If `auto-compile-deletes-stray-dest' is non-nil this
-  even includes byte code files for which no source file exists.
-
-* When _creating_ byte code files only do so for source files
-  that are actual libraries.  Source files that provide the
-  correct feature are considered to be libraries; see
-  `packed-library-p'.
-
-* Note that non-libraries can still be automatically compiled,
-  you just cannot _recursively_ turn on automatic compilation
-  using this command.
-
-* When `auto-compile-toggle-recompiles' is non-nil recompile all
-  affected source files even when the respective source files are
-  up-to-date.  Do so even for non-library source files.
-
-* Only enter subdirectories for which `packed-ignore-directory-p'
-  returns nil; i.e. don't enter hidden directories or directories
-  containing a file named \".nosearch\"."
-  (interactive
-   (let* ((buf  (current-buffer))
-          (file (and (eq major-mode 'emacs-lisp-mode)
-                     (buffer-file-name)))
-          (action
-           (cond
-            (current-prefix-arg
-             (if (> (prefix-numeric-value current-prefix-arg) 0)
-                 'start
-               'quit))
-            (file
-             (if (file-exists-p (byte-compile-dest-file file))
-                 'quit
-               'start))
-            (t
-             (pcase (read-char-choice
-                     "Toggle automatic compilation (s=tart, q=uit, C-g)? "
-                     '(?s ?q))
-               (?s 'start)
-               (?q 'quit))))))
-     (list (read-file-name (concat (capitalize (symbol-name action))
-                                   " auto-compiling: ")
-                           (and file (file-name-directory file))
-                           nil t
-                           (and file (file-name-nondirectory file)))
-           action)))
-  (if (file-regular-p file)
-      (pcase action
-        (`start (auto-compile-byte-compile file t))
-        (`quit  (auto-compile-delete-dest (byte-compile-dest-file file))))
-    (when (called-interactively-p 'any)
-      (let ((buffer (get-buffer byte-compile-log-buffer)))
-        (when buffer
-          (kill-buffer buffer))))
-    (dolist (f (directory-files file t))
-      (cond
-       ((file-directory-p f)
-        (unless (packed-ignore-directory-p f)
-          (toggle-auto-compile f action)))
-       ((packed-library-p f)
-        (let ((dest (byte-compile-dest-file f)))
-          (if (eq action 'start)
-              (and (file-exists-p f)
-                   (or auto-compile-toggle-recompiles
-                       (file-newer-than-file-p f dest))
-                   (or (not (string-match "^\\.?#" (file-name-nondirectory f)))
-                       (file-exists-p dest))
-                   (auto-compile-byte-compile f t))
-            (auto-compile-delete-dest dest))))
-       ((and auto-compile-toggle-deletes-nonlib-dest
-             (eq action 'quit)
-             (string-match (packed-el-regexp) f))
-        (auto-compile-delete-dest (byte-compile-dest-file f)))
-       ((and auto-compile-delete-stray-dest
-             (string-match "\\.elc$" f)
-             (not (file-exists-p (packed-el-file f))))
-        (auto-compile-delete-dest f))))))
-
-(defalias 'auto-compile-toggle 'toggle-auto-compile)
-
-(defun auto-compile-toggle-mark-failed-modified ()
-  "Toggle whether buffers which failed to compile are marked as modified."
-  (interactive)
-  (message (concat (if (setq auto-compile-mark-failed-modified
-                             (not auto-compile-mark-failed-modified))
-                       "Mark "
-                     "Don't mark ")
-                   "files that failed to compile as modified")))
-
-(defvar-local auto-compile-pretend-byte-compiled nil
-  "Whether to try again to compile this file after a failed attempt.
-
-Command `auto-compile-byte-compile' sets this buffer local
-variable to t after failing to compile a source file being
-visited in a buffer (or when variable `auto-compile-visit-failed'
-is non-nil for all files being compiled) causing it to try again
-when being called again. Command `toggle-auto-compile' will also
-pretend the byte code file exists.")
-
-(defvar auto-compile-file-buffer nil)
-(defvar-local auto-compile-warnings 0)
-
-(defadvice byte-compile-log-warning
-  (before auto-compile-count-warnings activate)
-  ;; (STRING &optional FILL LEVEL)
-  (when auto-compile-file-buffer
-    (with-current-buffer auto-compile-file-buffer
-      (cl-incf auto-compile-warnings))))
-
-(cl-defun auto-compile-byte-compile (&optional file start)
-  "Perform byte compilation for Auto-Compile mode."
-  (when (run-hook-with-args-until-success 'auto-compile-inhibit-compile-hook)
-    (cl-return-from auto-compile-byte-compile))
-  (let ((default-directory default-directory)
-        dest buf auto-compile-file-buffer success loaddefs)
-    (when (and file
-               (setq buf (get-file-buffer file))
-               (buffer-modified-p buf)
-               (y-or-n-p (format "Save buffer %s first? " (buffer-name buf))))
-      (with-current-buffer buf (save-buffer)))
-    (unless file
-      (setq file (buffer-file-name))
-      (setq buf  (get-file-buffer file)))
-    (setq default-directory (file-name-directory file))
-    (setq auto-compile-file-buffer buf)
-    (with-current-buffer buf
-      (setq auto-compile-warnings 0))
-    (catch 'auto-compile
-      (when (and auto-compile-check-parens buf)
-        (condition-case check-parens
-            (save-restriction
-              (widen)
-              (check-parens))
-          (error
-           (message (error-message-string check-parens))
-           (auto-compile-handle-compile-error file buf start)
-           (throw 'auto-compile nil))))
-      (setq dest (byte-compile-dest-file file))
-      (when (or start
-                (and (file-exists-p dest)
-                     (or (file-exists-p file)
-                         (not auto-compile-source-recreate-deletes-dest)
-                         (prog1 nil
-                           (auto-compile-delete-dest dest))))
-                (and buf (with-current-buffer buf
-                           auto-compile-pretend-byte-compiled)))
-        (condition-case byte-compile
-            (let ((byte-compile-verbose auto-compile-verbose)
-                  (warning-minimum-level
-                   (if auto-compile-display-buffer :warning :error)))
-              (setq success (packed-byte-compile-file file))
-              (when buf
-                (with-current-buffer buf
-                  (kill-local-variable auto-compile-pretend-byte-compiled))))
-          (file-error
-           (message "Byte-compiling %s failed" file)
-           (auto-compile-handle-compile-error file buf start)
-           (setq success nil)))
-        (when (and auto-compile-update-autoloads
-                   (setq loaddefs (packed-loaddefs-file)))
-          (require 'autoload)
-          (condition-case autoload
-              (packed-with-loaddefs loaddefs
-                (let ((autoload-modified-buffers
-                       (list (find-buffer-visiting file))))
-                  (autoload-generate-file-autoloads file)))
-            (error
-             (message "Generating loaddefs for %s failed" file)
-             (setq loaddefs nil))))
-        (pcase success
-          (`no-byte-compile)
-          (`t (message "Wrote %s.{%s,%s}%s"
-                        (file-name-sans-extension
-                         (file-name-sans-extension file))
-                        (progn (string-match "\\(\\.[^./]+\\)+$" file)
-                               (substring (match-string 0 file) 1))
-                        (file-name-extension dest)
-                        (if loaddefs " (+)" "")))
-          (_  (message "Wrote %s (byte-compiling failed)" file))))
-      success)))
-
-(defun auto-compile-delete-dest (dest &optional failurep)
-  (unless failurep
-    (let ((buffer (get-file-buffer (packed-el-file dest))))
-      (when buffer
-        (with-current-buffer buffer
-          (kill-local-variable 'auto-compile-pretend-byte-compiled)))))
-  (condition-case nil
-      (when (file-exists-p dest)
-        (message "Deleting %s..." dest)
-        (delete-file dest)
-        (message "Deleting %s...done" dest))
-    (file-error
-     (auto-compile-ding)
-     (message "Deleting %s...failed" dest))))
-
-(defun auto-compile-handle-compile-error (file buf &optional start)
-  (auto-compile-ding)
-  (let (update)
-    (let ((dest (byte-compile-dest-file file)))
-      (when (file-exists-p dest)
-        (setq update t)
-        (auto-compile-delete-dest dest t)))
-    (when (or buf
-              (and auto-compile-visit-failed
-                   (setq buf (find-file-noselect file))))
-      (with-current-buffer buf
-        (when (or update start)
-          (setq auto-compile-pretend-byte-compiled t))
-        (when auto-compile-mark-failed-modified
-          (set-buffer-modified-p t))))))
-
-(defun auto-compile-handle-autoloads-error (dest)
-  (auto-compile-ding)
-  (packed-remove-autoloads dest nil))
-
-(defun auto-compile-ding ()
-  (when auto-compile-ding
-    (ding)))
-
-(defadvice save-buffers-kill-emacs
-  (around auto-compile-dont-mark-failed-modified disable)
-  "Set `auto-compile-mark-failed-modified' to nil when killing Emacs.
-If the regular value of this variable is non-nil the user might
-still be asked whether she wants to save modified buffers, which
-she actually did already safe.  This advice ensures she at least
-is only asked once about each such file."
-  (let ((auto-compile-mark-failed-modified nil))
-    ad-do-it))
-
-(defadvice save-buffers-kill-terminal
-  (around auto-compile-dont-mark-failed-modified disable)
-  "Set `auto-compile-mark-failed-modified' to nil when killing Emacs.
-If the regular value of this variable is non-nil the user might
-still be asked whether she wants to save modified buffers, which
-she actually did already safe.  This advice ensures she at least
-is only asked once about each such file."
-  (let ((auto-compile-mark-failed-modified nil))
-    ad-do-it))
-
-;; REDEFINE autoload-save-buffers defined in autoload.el
-;; - verify buffers are still live before killing them
-(eval-after-load 'autoload
-  '(defun autoload-save-buffers ()
-     (while autoload-modified-buffers
-       (let ((buf (pop autoload-modified-buffers)))
-         (when (buffer-live-p buf)
-           (with-current-buffer buf
-             (let ((version-control 'never))
-               (save-buffer))))))))
-
-(defun auto-compile-inhibit-compile-detached-git-head ()
-  "Inhibit compiling in Git repositories when `HEAD' is detached.
-This is especially useful during rebase sessions."
-  (with-temp-buffer
-    (call-process "git" nil t nil "symbolic-ref" "HEAD")
-    (equal (buffer-string) "fatal: ref HEAD is not a symbolic ref\n")))
-
-;;; Mode-Line
-
-(defvar-local mode-line-auto-compile
-  '(auto-compile-mode (:eval (mode-line-auto-compile-control))))
-(put 'mode-line-auto-compile 'risky-local-variable t)
-
-(defun mode-line-auto-compile-control ()
-  (let ((src (buffer-file-name))
-        dst)
-    (when (and src (setq dst (byte-compile-dest-file src)))
-      (list
-       (when (and auto-compile-mode-line-counter
-                  (> auto-compile-warnings 0))
-         (propertize
-          (format "%s" auto-compile-warnings)
-          'help-echo (format "%s compile warnings\nmouse-1 display compile log"
-                             auto-compile-warnings)
-          'face 'error
-          'mouse-face 'mode-line-highlight
-          'local-map (purecopy (make-mode-line-mouse-map
-                                'mouse-1
-                                #'auto-compile-display-log))))
-       (cond
-        ((file-writable-p dst)
-         (propertize
-          "-"
-          'help-echo "Byte-compile destination is writable"
-          'mouse-face 'mode-line))
-        (t
-         (propertize
-          "%%"
-          'help-echo "Byte-compile destination is read-only"
-          'mouse-face 'mode-line)))
-       (cond
-        ((and auto-compile-pretend-byte-compiled
-              (not (file-exists-p dst)))
-         (propertize
-          "!"
-          'help-echo "Failed to byte-compile updating\nmouse-1 retry"
-          'mouse-face 'mode-line-highlight
-          'local-map (purecopy (make-mode-line-mouse-map
-                                'mouse-1
-                                #'auto-compile-mode-line-byte-compile))))
-        ((not (file-exists-p dst))
-         (propertize
-          "%%"
-          'help-echo "Byte-compiled file doesn't exist\nmouse-1 create"
-          'mouse-face 'mode-line-highlight
-          'local-map (purecopy (make-mode-line-mouse-map
-                                'mouse-1
-                                #'mode-line-toggle-auto-compile))))
-        ((file-newer-than-file-p src dst)
-         (propertize
-          "*"
-          'help-echo "Byte-compiled file needs updating\nmouse-1 update"
-          'mouse-face 'mode-line-highlight
-          'local-map (purecopy (make-mode-line-mouse-map
-                                'mouse-1
-                                #'auto-compile-mode-line-byte-compile))))
-        (t
-         (propertize
-          "-"
-          'help-echo "Byte-compiled file is up-to-date\nmouse-1 remove"
-          'mouse-face 'mode-line-highlight
-          'local-map (purecopy (make-mode-line-mouse-map
-                                'mouse-1
-                                #'mode-line-toggle-auto-compile)))))))))
-
-(defun auto-compile-display-log ()
-  "Display the *Compile-Log* buffer."
-  (interactive)
-  (let ((buffer (get-buffer byte-compile-log-buffer)))
-    (if buffer
-        (pop-to-buffer buffer)
-      (user-error "Buffer %s doesn't exist" byte-compile-log-buffer))))
-
-(defun mode-line-toggle-auto-compile (event)
-  "Toggle automatic compilation from the mode-line."
-  (interactive "e")
-  (save-selected-window
-    (select-window (posn-window (event-start event)))
-    (toggle-auto-compile
-     (buffer-file-name)
-     (if (file-exists-p (byte-compile-dest-file (buffer-file-name)))
-         'quit
-       'start))
-    (force-mode-line-update)))
-
-(defun auto-compile-mode-line-byte-compile (event)
-  "Recompile visited file from the mode-line."
-  (interactive "e")
-  (save-selected-window
-    (select-window (posn-window (event-start event)))
-    (auto-compile-byte-compile (buffer-file-name) t)
-    (force-mode-line-update)))
-
-;;; Auto-Compile-On-Load Mode
-
-;;;###autoload
-(define-minor-mode auto-compile-on-load-mode
-  "Before loading a library recompile it if it needs recompilation.
-
-A library needs to be recompiled if the source file is newer than
-it's byte-compile destination.  Without this advice the outdated
-byte code file would be loaded instead.
-
-Also see the related `auto-compile-on-save-mode'."
-  :lighter auto-compile-on-load-mode-lighter
-  :group 'auto-compile
-  :global t
-  (cond (auto-compile-on-load-mode
-         (ad-enable-advice  'load    'before 'auto-compile-on-load)
-         (ad-enable-advice  'require 'before 'auto-compile-on-load)
-         (ad-activate 'load)
-         (ad-activate 'require))
-        (t
-         (ad-disable-advice 'load    'before 'auto-compile-on-load)
-         (ad-disable-advice 'require 'before 'auto-compile-on-load))))
-
-(defvar auto-compile-on-load-mode-lighter ""
-  "Mode lighter for Auto-Compile-On-Load Mode.")
-
-(defadvice load (before auto-compile-on-load disable)
-  ;; (file &optional noerror nomessage nosuffix must-suffix)
-  "Before loading the library recompile it if it needs recompilation.
-It needs recompilation if it is newer than the byte-compile
-destination.  Without this advice the outdated byte-compiled
-file would get loaded."
-  (auto-compile-on-load file nosuffix))
-
-(defadvice require (before auto-compile-on-load disable)
-  ;; (feature &optional FILENAME NOERROR)
-  "Before loading the library recompile it if it needs recompilation.
-It needs recompilation if it is newer than the byte-compile
-destination.  Without this advice the outdated byte-compiled
-file would get loaded."
-  (unless (featurep feature)
-    (auto-compile-on-load (or filename (symbol-name feature)))))
-
-(defvar auto-compile--loading nil)
-
-(defun auto-compile-on-load (file &optional nosuffix)
-  (unless (member file auto-compile--loading)
-    (let ((auto-compile--loading (cons file auto-compile--loading))
-          byte-compile-verbose el elc el*)
-      (condition-case nil
-          (when (setq el (packed-locate-library file nosuffix))
-            (setq elc (byte-compile-dest-file el))
-            (when (and (file-exists-p elc)
-                       (file-writable-p elc)
-                       (file-newer-than-file-p el elc))
-              (message "Recompiling %s..." el)
-              (packed-byte-compile-file el)
-              (message "Recompiling %s...done" el))
-            (when auto-compile-delete-stray-dest
-              (setq el* (locate-library file))
-              (unless (equal (file-name-directory el)
-                             (file-name-directory el*))
-                (auto-compile-delete-dest el* t))))
-        (error
-         (message "Recompiling %s...failed" el)
-         (when elc
-           (auto-compile-delete-dest elc t)))))))
-
-(provide 'auto-compile)
-;; Local Variables:
-;; indent-tabs-mode: nil
-;; End:
-;;; auto-compile.el ends here
.emacs.d/elpa/auto-compile-1.4.1/auto-compile.elc
Binary file
.emacs.d/elpa/counsel-20170911.1121/counsel-autoloads.el
@@ -1,372 +0,0 @@
-;;; counsel-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "counsel" "counsel.el" (22977 29294 369907
-;;;;;;  188000))
-;;; Generated autoloads from counsel.el
-
-(autoload 'counsel-el "counsel" "\
-Elisp completion at point.
-
-\(fn)" t nil)
-
-(autoload 'counsel-cl "counsel" "\
-Common Lisp completion at point.
-
-\(fn)" t nil)
-
-(autoload 'counsel-clj "counsel" "\
-Clojure completion at point.
-
-\(fn)" t nil)
-
-(autoload 'counsel-unicode-char "counsel" "\
-Insert COUNT copies of a Unicode character at point.
-COUNT defaults to 1.
-
-\(fn &optional COUNT)" t nil)
-
-(autoload 'counsel-describe-variable "counsel" "\
-Forward to `describe-variable'.
-
-Variables declared using `defcustom' are highlighted according to
-`ivy-highlight-face'.
-
-\(fn)" t nil)
-
-(autoload 'counsel-describe-function "counsel" "\
-Forward to `describe-function'.
-
-Interactive functions (i.e., commands) are highlighted according
-to `ivy-highlight-face'.
-
-\(fn)" t nil)
-
-(autoload 'counsel-set-variable "counsel" "\
-Set a variable, with completion.
-
-When the selected variable is a `defcustom' with the type boolean
-or radio, offer completion of all possible values.
-
-Otherwise, offer a variant of `eval-expression', with the initial
-input corresponding to the chosen variable.
-
-\(fn)" t nil)
-
-(autoload 'counsel-info-lookup-symbol "counsel" "\
-Forward to (`info-lookup-symbol' SYMBOL MODE) with ivy completion.
-
-\(fn SYMBOL &optional MODE)" t nil)
-
-(autoload 'counsel-file-register "counsel" "\
-Search file in register.
-
-You cannot use Emacs' normal register commands to create file
-registers.  Instead you must use the `set-register' function like
-so: `(set-register ?i \"/home/eric/.emacs.d/init.el\")'.  Now you
-can use `C-x r j i' to open that file.
-
-\(fn)" t nil)
-
-(autoload 'counsel-bookmark "counsel" "\
-Forward to `bookmark-jump' or `bookmark-set' if bookmark doesn't exist.
-
-\(fn)" t nil)
-
-(autoload 'counsel-M-x "counsel" "\
-Ivy version of `execute-extended-command'.
-Optional INITIAL-INPUT is the initial input in the minibuffer.
-
-\(fn &optional INITIAL-INPUT)" t nil)
-
-(autoload 'counsel-load-library "counsel" "\
-Load a selected the Emacs Lisp library.
-The libraries are offered from `load-path'.
-
-\(fn)" t nil)
-
-(autoload 'counsel-find-library "counsel" "\
-Visit a selected the Emacs Lisp library.
-The libraries are offered from `load-path'.
-
-\(fn)" t nil)
-
-(autoload 'counsel-load-theme "counsel" "\
-Forward to `load-theme'.
-Usable with `ivy-resume', `ivy-next-line-and-call' and
-`ivy-previous-line-and-call'.
-
-\(fn)" t nil)
-
-(autoload 'counsel-descbinds "counsel" "\
-Show a list of all defined keys and their definitions.
-If non-nil, show only bindings that start with PREFIX.
-BUFFER defaults to the current one.
-
-\(fn &optional PREFIX BUFFER)" t nil)
-
-(autoload 'counsel-git "counsel" "\
-Find file in the current Git repository.
-INITIAL-INPUT can be given as the initial minibuffer input.
-
-\(fn &optional INITIAL-INPUT)" t nil)
-
-(autoload 'counsel-git-grep "counsel" "\
-Grep for a string in the current git repository.
-When CMD is a string, use it as a \"git grep\" command.
-When CMD is non-nil, prompt for a specific \"git grep\" command.
-INITIAL-INPUT can be given as the initial minibuffer input.
-
-\(fn &optional CMD INITIAL-INPUT)" t nil)
-
-(autoload 'counsel-git-stash "counsel" "\
-Search through all available git stashes.
-
-\(fn)" t nil)
-
-(autoload 'counsel-git-change-worktree "counsel" "\
-Find the file corresponding to the current buffer on a different worktree.
-
-\(fn)" t nil)
-
-(autoload 'counsel-git-checkout "counsel" "\
-Call the \"git checkout\" command.
-
-\(fn)" t nil)
-
-(autoload 'counsel-git-log "counsel" "\
-Call the \"git log --grep\" shell command.
-
-\(fn)" t nil)
-
-(autoload 'counsel-find-file "counsel" "\
-Forward to `find-file'.
-When INITIAL-INPUT is non-nil, use it in the minibuffer during completion.
-
-\(fn &optional INITIAL-INPUT)" t nil)
-
-(autoload 'counsel-recentf "counsel" "\
-Find a file on `recentf-list'.
-
-\(fn)" t nil)
-
-(autoload 'counsel-locate "counsel" "\
-Call the \"locate\" shell command.
-INITIAL-INPUT can be given as the initial minibuffer input.
-
-\(fn &optional INITIAL-INPUT)" t nil)
-
-(autoload 'counsel-dpkg "counsel" "\
-Call the \"dpkg\" shell command.
-
-\(fn)" t nil)
-
-(autoload 'counsel-rpm "counsel" "\
-Call the \"rpm\" shell command.
-
-\(fn)" t nil)
-
-(autoload 'counsel-file-jump "counsel" "\
-Jump to a file below the current directory.
-List all files within the current directory or any of its subdirectories.
-INITIAL-INPUT can be given as the initial minibuffer input.
-INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
-
-\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY)" t nil)
-
-(autoload 'counsel-dired-jump "counsel" "\
-Jump to a directory (in dired) below the current directory.
-List all subdirectories within the current directory.
-INITIAL-INPUT can be given as the initial minibuffer input.
-INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
-
-\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY)" t nil)
-
-(autoload 'counsel-ag "counsel" "\
-Grep for a string in the current directory using ag.
-INITIAL-INPUT can be given as the initial minibuffer input.
-INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
-EXTRA-AG-ARGS string, if non-nil, is appended to `counsel-ag-base-command'.
-AG-PROMPT, if non-nil, is passed as `ivy-read' prompt argument.
-
-\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY EXTRA-AG-ARGS AG-PROMPT)" t nil)
-
-(autoload 'counsel-pt "counsel" "\
-Grep for a string in the current directory using pt.
-INITIAL-INPUT can be given as the initial minibuffer input.
-This uses `counsel-ag' with `counsel-pt-base-command' instead of
-`counsel-ag-base-command'.
-
-\(fn &optional INITIAL-INPUT)" t nil)
-
-(autoload 'counsel-ack "counsel" "\
-Grep for a string in the current directory using ack.
-INITIAL-INPUT can be given as the initial minibuffer input.
-This uses `counsel-ag' with `counsel-ack-base-command' replacing
-`counsel-ag-base-command'.
-
-\(fn &optional INITIAL-INPUT)" t nil)
-
-(autoload 'counsel-rg "counsel" "\
-Grep for a string in the current directory using rg.
-INITIAL-INPUT can be given as the initial minibuffer input.
-INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
-EXTRA-RG-ARGS string, if non-nil, is appended to `counsel-rg-base-command'.
-RG-PROMPT, if non-nil, is passed as `ivy-read' prompt argument.
-
-\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY EXTRA-RG-ARGS RG-PROMPT)" t nil)
-
-(autoload 'counsel-grep "counsel" "\
-Grep for a string in the current file.
-
-\(fn)" t nil)
-
-(autoload 'counsel-grep-or-swiper "counsel" "\
-Call `swiper' for small buffers and `counsel-grep' for large ones.
-
-\(fn)" t nil)
-
-(autoload 'counsel-org-tag "counsel" "\
-Add or remove tags in `org-mode'.
-
-\(fn)" t nil)
-
-(autoload 'counsel-org-tag-agenda "counsel" "\
-Set tags for the current agenda item.
-
-\(fn)" t nil)
-
-(autoload 'counsel-org-goto "counsel" "\
-Go to a different location in the current file.
-
-\(fn)" t nil)
-
-(autoload 'counsel-org-goto-all "counsel" "\
-Go to a different location in any org file.
-
-\(fn)" t nil)
-
-(autoload 'counsel-tmm "counsel" "\
-Text-mode emulation of looking and choosing from a menubar.
-
-\(fn)" t nil)
-
-(autoload 'counsel-yank-pop "counsel" "\
-Ivy replacement for `yank-pop'.
-
-\(fn)" t nil)
-
-(autoload 'counsel-imenu "counsel" "\
-Jump to a buffer position indexed by imenu.
-
-\(fn)" t nil)
-
-(autoload 'counsel-list-processes "counsel" "\
-Offer completion for `process-list'.
-The default action deletes the selected process.
-An extra action allows to switch to the process buffer.
-
-\(fn)" t nil)
-
-(autoload 'counsel-expression-history "counsel" "\
-Select an element of `read-expression-history'.
-And insert it into the minibuffer.  Useful during `eval-expression'.
-
-\(fn)" t nil)
-
-(autoload 'counsel-shell-command-history "counsel" "\
-Browse shell command history.
-
-\(fn)" t nil)
-
-(autoload 'counsel-esh-history "counsel" "\
-Browse Eshell history.
-
-\(fn)" t nil)
-
-(autoload 'counsel-shell-history "counsel" "\
-Browse shell history.
-
-\(fn)" t nil)
-
-(autoload 'counsel-rhythmbox "counsel" "\
-Choose a song from the Rhythmbox library to play or enqueue.
-
-\(fn)" t nil)
-
-(autoload 'counsel-linux-app "counsel" "\
-Launch a Linux desktop application, similar to Alt-<F2>.
-
-\(fn)" t nil)
-
-(autoload 'counsel-company "counsel" "\
-Complete using `company-candidates'.
-
-\(fn)" t nil)
-
-(autoload 'counsel-colors-emacs "counsel" "\
-Show a list of all supported colors for a particular frame.
-
-You can insert or kill the name or the hexadecimal rgb value of the
-selected candidate.
-
-\(fn)" t nil)
-
-(autoload 'counsel-colors-web "counsel" "\
-Show a list of all W3C web colors for use in CSS.
-
-You can insert or kill the name or the hexadecimal rgb value of the
-selected candidate.
-
-\(fn)" t nil)
-
-(autoload 'counsel-org-agenda-headlines "counsel" "\
-Choose from headers of `org-mode' files in the agenda.
-
-\(fn)" t nil)
-
-(autoload 'counsel-irony "counsel" "\
-Inline C/C++ completion using Irony.
-
-\(fn)" t nil)
-
-(autoload 'counsel-apropos "counsel" "\
-Show all matching symbols.
-See `apropos' for further information about what is considered
-a symbol and how to search for them.
-
-\(fn)" t nil)
-
-(autoload 'counsel-switch-to-shell-buffer "counsel" "\
-Switch to a shell buffer, or create one.
-
-\(fn)" t nil)
-
-(defvar counsel-mode nil "\
-Non-nil if Counsel mode is enabled.
-See the `counsel-mode' command
-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 `counsel-mode'.")
-
-(custom-autoload 'counsel-mode "counsel" nil)
-
-(autoload 'counsel-mode "counsel" "\
-Toggle Counsel mode on or off.
-Turn Counsel mode on if ARG is positive, off otherwise. Counsel
-mode remaps built-in emacs functions that have counsel
-replacements. 
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; counsel-autoloads.el ends here
.emacs.d/elpa/counsel-20170911.1121/counsel-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "counsel" "20170911.1121" "Various completion functions using Ivy" '((emacs "24.3") (swiper "0.9.0")) :commit "0a1d361b926291874124f8c63a653d83ead64a36" :url "https://github.com/abo-abo/swiper" :keywords '("completion" "matching"))
.emacs.d/elpa/counsel-20170911.1121/counsel.el
@@ -1,4018 +0,0 @@
-;;; counsel.el --- Various completion functions using Ivy -*- lexical-binding: t -*-
-
-;; Copyright (C) 2015-2017  Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-;; URL: https://github.com/abo-abo/swiper
-;; Package-Version: 20170911.1121
-;; Version: 0.9.1
-;; Package-Requires: ((emacs "24.3") (swiper "0.9.0"))
-;; Keywords: completion, matching
-
-;; This file is part of GNU Emacs.
-
-;; 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 3, 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.
-
-;; For a full copy of the GNU General Public License
-;; see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; Just call one of the interactive functions in this file to complete
-;; the corresponding thing using `ivy'.
-;;
-;; Currently available:
-;; - Symbol completion for Elisp, Common Lisp, Python and Clojure.
-;; - Describe fuctions for Elisp: function, variable, library, command,
-;;   bindings, theme.
-;; - Navigation functions: imenu, ace-line, semantic, outline
-;; - Git utilities: git-files, git-grep, git-log, git-stash.
-;; - Grep utitilies: grep, ag, pt, recoll.
-;; - System utilities: process list, rhythmbox, linux-app.
-;; - Many more.
-
-;;; Code:
-
-(require 'swiper)
-(require 'etags)
-(require 'esh-util)
-
-;;* Utility
-(defun counsel-more-chars (n)
-  "Return two fake candidates prompting for at least N input."
-  (list ""
-        (format "%d chars more" (- n (length ivy-text)))))
-
-(defun counsel-unquote-regex-parens (str)
-  "Unquote regex parenthesis in STR."
-  (let ((start 0)
-        ms)
-    (while (setq start (string-match "\\\\)\\|\\\\(\\|[()]" str start))
-      (setq ms (match-string-no-properties 0 str))
-      (cond ((equal ms "\\(")
-             (setq str (replace-match "(" nil t str))
-             (setq start (+ start 1)))
-            ((equal ms "\\)")
-             (setq str (replace-match ")" nil t str))
-             (setq start (+ start 1)))
-            ((equal ms "(")
-             (setq str (replace-match "\\(" nil t str))
-             (setq start (+ start 2)))
-            ((equal ms ")")
-             (setq str (replace-match "\\)" nil t str))
-             (setq start (+ start 2)))
-            (t
-             (error "Unexpected"))))
-    str))
-
-(defun counsel-directory-parent (dir)
-  "Return the directory parent of directory DIR."
-  (concat (file-name-nondirectory
-           (directory-file-name dir)) "/"))
-
-(defun counsel-string-compose (prefix str)
-  "Make PREFIX the display prefix of STR through text properties."
-  (let ((str (copy-sequence str)))
-    (put-text-property
-     0 1 'display
-     (concat prefix (substring str 0 1))
-     str)
-    str))
-
-(defun counsel-require-program (program)
-  "Check system for PROGRAM, printing error if unfound."
-  (when (and (stringp program)
-             (not (string= program ""))
-             (not (executable-find program)))
-    (user-error "Required program \"%s\" not found in your path" program)))
-
-;;* Async Utility
-(defvar counsel--async-time nil
-  "Store the time when a new process was started.
-Or the time of the last minibuffer update.")
-
-(defvar counsel--async-start nil
-  "Store the time when a new process was started.
-Or the time of the last minibuffer update.")
-
-(defvar counsel--async-duration nil
-  "Store the time a process takes to gather all its candidates.
-The time is measured in seconds.")
-
-(defvar counsel--async-exit-code-plist nil
-  "Associates exit codes with reasons.")
-
-(defun counsel-set-async-exit-code (cmd number str)
-  "For CMD, associate NUMBER exit code with STR."
-  (let ((plist (plist-get counsel--async-exit-code-plist cmd)))
-    (setq counsel--async-exit-code-plist
-          (plist-put
-           counsel--async-exit-code-plist
-           cmd
-           (plist-put plist number str)))))
-
-(defvar counsel-async-split-string-re "\n"
-  "Store the regexp for splitting shell command output.")
-
-(defvar counsel-async-ignore-re nil
-  "Candidates matched the regexp will be ignored by `counsel--async-command'.")
-
-(defun counsel--async-command (cmd &optional process-sentinel process-filter)
-  "Start new counsel process by calling CMD.
-If a counsel process is already running, kill it and its associated buffer
-before starting a new one.  If non-nil, use PROCESS-SENTINEL as the sentinel
-function instead of `counsel--async-sentinel'.  If non-nil, use PROCESS-FILTER
-for handling the output of the process instead of `counsel--async-filter'."
-  (let* ((counsel--process " *counsel*")
-         (proc (get-process counsel--process))
-         (buff (get-buffer counsel--process)))
-    (when proc
-      (delete-process proc))
-    (when buff
-      (kill-buffer buff))
-    (setq proc (start-process-shell-command
-                counsel--process
-                counsel--process
-                cmd))
-    (setq counsel--async-start
-          (setq counsel--async-time (current-time)))
-    (set-process-sentinel proc (or process-sentinel #'counsel--async-sentinel))
-    (set-process-filter proc (or process-filter #'counsel--async-filter))))
-
-(defvar counsel-grep-last-line nil)
-
-(defun counsel--async-sentinel (process event)
-  "Sentinel function for an asynchronous counsel PROCESS.
-EVENT is a string describing the change."
-  (let ((cands
-         (cond ((string= event "finished\n")
-                (with-current-buffer (process-buffer process)
-                  (split-string
-                   (buffer-string)
-                   counsel-async-split-string-re
-                   t)))
-               ((string-match "exited abnormally with code \\([0-9]+\\)\n" event)
-                (let* ((exit-code-plist (plist-get counsel--async-exit-code-plist
-                                                   (ivy-state-caller ivy-last)))
-                       (exit-num (read (match-string 1 event)))
-                       (exit-code (plist-get exit-code-plist exit-num)))
-                  (list
-                   (or exit-code
-                       (format "error code %d" exit-num))))))))
-    (cond ((string= event "finished\n")
-           (ivy--set-candidates
-            (ivy--sort-maybe
-             cands))
-           (setq counsel-grep-last-line nil)
-           (when counsel--async-start
-             (setq counsel--async-duration
-                   (time-to-seconds (time-since counsel--async-start))))
-           (let ((re (funcall ivy--regex-function ivy-text)))
-             (unless (stringp re)
-               (setq re (caar re)))
-             (if (null ivy--old-cands)
-                 (unless (ivy-set-index
-                          (ivy--preselect-index
-                           (ivy-state-preselect ivy-last)
-                           ivy--all-candidates))
-                   (ivy--recompute-index
-                    ivy-text re ivy--all-candidates))
-               (ivy--recompute-index
-                ivy-text re ivy--all-candidates)))
-           (setq ivy--old-cands ivy--all-candidates)
-           (if (null ivy--all-candidates)
-               (ivy--insert-minibuffer "")
-             (ivy--exhibit)))
-          ((string-match "exited abnormally with code \\([0-9]+\\)\n" event)
-           (setq ivy--all-candidates cands)
-           (setq ivy--old-cands ivy--all-candidates)
-           (ivy--exhibit)))))
-
-(defcustom counsel-async-filter-update-time 500000
-  "The amount of time in microseconds to wait until updating
-`counsel--async-filter'."
-  :type 'integer
-  :group 'ivy)
-
-(defun counsel--async-filter (process str)
-  "Receive from PROCESS the output STR.
-Update the minibuffer with the amount of lines collected every
-`counsel-async-filter-update-time' microseconds since the last update."
-  (with-current-buffer (process-buffer process)
-    (insert str))
-  (let (size)
-    (when (time-less-p
-           `(0 0 ,counsel-async-filter-update-time 0)
-           (time-since counsel--async-time))
-      (with-current-buffer (process-buffer process)
-        (goto-char (point-min))
-        (setq size (- (buffer-size) (forward-line (buffer-size))))
-        (ivy--set-candidates
-         (let ((strings (split-string (buffer-string)
-                                      counsel-async-split-string-re
-                                      t)))
-           (if (and counsel-async-ignore-re
-                    (stringp counsel-async-ignore-re))
-               (cl-remove-if
-                (lambda (str)
-                  (string-match-p counsel-async-ignore-re str))
-                strings)
-             strings))))
-      (let ((ivy--prompt (format
-                          (concat "%d++ " (ivy-state-prompt ivy-last))
-                          size)))
-        (ivy--insert-minibuffer
-         (ivy--format ivy--all-candidates)))
-      (setq counsel--async-time (current-time)))))
-
-(defcustom counsel-prompt-function 'counsel-prompt-function-default
-  "A function to return a full prompt string from a basic prompt string."
-  :type
-  '(choice
-    (const :tag "Plain" counsel-prompt-function-default)
-    (const :tag "Directory" counsel-prompt-function-dir)
-    (function :tag "Custom"))
-  :group 'ivy)
-
-(make-obsolete-variable
- 'counsel-prompt-function
- "Use `ivy-set-prompt' instead"
- "0.8.0 <2016-06-20 Mon>")
-
-(defun counsel-prompt-function-default ()
-  "Return prompt appended with a semicolon."
-  (ivy-add-prompt-count
-   (format "%s: " (ivy-state-prompt ivy-last))))
-
-(defun counsel-delete-process ()
-  "Delete current counsel process."
-  (let ((process (get-process " *counsel*")))
-    (when process
-      (delete-process process))))
-
-;;* Completion at point
-;;** `counsel-el'
-;;;###autoload
-(defun counsel-el ()
-  "Elisp completion at point."
-  (interactive)
-  (let* ((bnd (unless (and (looking-at ")")
-                           (eq (char-before) ?\())
-                (bounds-of-thing-at-point
-                 'symbol)))
-         (str (if bnd
-                  (buffer-substring-no-properties
-                   (car bnd)
-                   (cdr bnd))
-                ""))
-         (ivy-height 7)
-         (funp (eq (char-before (car bnd)) ?\())
-         symbol-names)
-    (if bnd
-        (progn
-          (setq ivy-completion-beg
-                (move-marker (make-marker) (car bnd)))
-          (setq ivy-completion-end
-                (move-marker (make-marker) (cdr bnd))))
-      (setq ivy-completion-beg nil)
-      (setq ivy-completion-end nil))
-    (if (string= str "")
-        (mapatoms
-         (lambda (x)
-           (when (symbolp x)
-             (push (symbol-name x) symbol-names))))
-      (setq symbol-names
-            (all-completions str obarray
-                             (and funp
-                                  (lambda (x)
-                                    (or (functionp x)
-                                        (macrop x)
-                                        (special-form-p x)))))))
-    (ivy-read "Symbol name: " symbol-names
-              :predicate (and funp #'functionp)
-              :initial-input str
-              :action #'ivy-completion-in-region-action)))
-
-;;** `counsel-cl'
-(declare-function slime-symbol-start-pos "ext:slime")
-(declare-function slime-symbol-end-pos "ext:slime")
-(declare-function slime-contextual-completions "ext:slime-c-p-c")
-
-;;;###autoload
-(defun counsel-cl ()
-  "Common Lisp completion at point."
-  (interactive)
-  (setq ivy-completion-beg (slime-symbol-start-pos))
-  (setq ivy-completion-end (slime-symbol-end-pos))
-  (ivy-read "Symbol name: "
-            (car (slime-contextual-completions
-                  ivy-completion-beg
-                  ivy-completion-end))
-            :action #'ivy-completion-in-region-action))
-
-;;** `counsel-jedi'
-(declare-function deferred:sync! "ext:deferred")
-(declare-function jedi:complete-request "ext:jedi-core")
-(declare-function jedi:ac-direct-matches "ext:jedi")
-
-(defun counsel-jedi ()
-  "Python completion at point."
-  (interactive)
-  (let ((bnd (bounds-of-thing-at-point 'symbol)))
-    (if bnd
-        (progn
-          (setq ivy-completion-beg (car bnd))
-          (setq ivy-completion-end (cdr bnd)))
-      (setq ivy-completion-beg nil)
-      (setq ivy-completion-end nil)))
-  (deferred:sync!
-      (jedi:complete-request))
-  (ivy-read "Symbol name: " (jedi:ac-direct-matches)
-            :action #'counsel--py-action))
-
-(defun counsel--py-action (symbol)
-  "Insert SYMBOL, erasing the previous one."
-  (when (stringp symbol)
-    (with-ivy-window
-      (when ivy-completion-beg
-        (delete-region
-         ivy-completion-beg
-         ivy-completion-end))
-      (setq ivy-completion-beg
-            (move-marker (make-marker) (point)))
-      (insert symbol)
-      (setq ivy-completion-end
-            (move-marker (make-marker) (point)))
-      (when (equal (get-text-property 0 'symbol symbol) "f")
-        (insert "()")
-        (setq ivy-completion-end
-              (move-marker (make-marker) (point)))
-        (backward-char 1)))))
-
-;;** `counsel-clj'
-(declare-function cider-sync-request:complete "ext:cider-client")
-(defun counsel--generic (completion-fn)
-  "Complete thing at point with COMPLETION-FN."
-  (let* ((bnd (or (bounds-of-thing-at-point 'symbol)
-                  (cons (point) (point))))
-         (str (buffer-substring-no-properties
-               (car bnd) (cdr bnd)))
-         (candidates (funcall completion-fn str))
-         (ivy-height 7)
-         (res (ivy-read (format "pattern (%s): " str)
-                        candidates)))
-    (when (stringp res)
-      (when bnd
-        (delete-region (car bnd) (cdr bnd)))
-      (insert res))))
-
-;;;###autoload
-(defun counsel-clj ()
-  "Clojure completion at point."
-  (interactive)
-  (counsel--generic
-   (lambda (str)
-     (mapcar
-      #'cl-caddr
-      (cider-sync-request:complete str ":same")))))
-
-;;** `counsel-unicode-char'
-(defvar counsel-unicode-char-history nil
-  "History for `counsel-unicode-char'.")
-
-;;;###autoload
-(defun counsel-unicode-char (&optional count)
-  "Insert COUNT copies of a Unicode character at point.
-COUNT defaults to 1."
-  (interactive "p")
-  (let ((minibuffer-allow-text-properties t)
-        (ivy-sort-max-size (expt 256 6)))
-    (setq ivy-completion-beg (point))
-    (setq ivy-completion-end (point))
-    (ivy-read "Unicode name: "
-              (nreverse
-               (mapcar (lambda (x)
-                         (propertize
-                          (format "%06X % -60s%c" (cdr x) (car x) (cdr x))
-                          'result (cdr x)))
-                       (ucs-names)))
-              :action (lambda (char)
-                        (with-ivy-window
-                          (delete-region ivy-completion-beg ivy-completion-end)
-                          (setq ivy-completion-beg (point))
-                          (insert-char (get-text-property 0 'result char) count)
-                          (setq ivy-completion-end (point))))
-              :history 'counsel-unicode-char-history
-              :sort t)))
-
-;;* Elisp symbols
-;;** `counsel-describe-variable'
-(defvar counsel-describe-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "C-.") #'counsel-find-symbol)
-    (define-key map (kbd "C-,") #'counsel--info-lookup-symbol)
-    map))
-
-(ivy-set-actions
- 'counsel-describe-variable
- '(("I" counsel-info-lookup-symbol "info")
-   ("d" counsel--find-symbol "definition")))
-
-(defvar counsel-describe-symbol-history nil
-  "History for `counsel-describe-variable' and `counsel-describe-function'.")
-
-(defun counsel-find-symbol ()
-  "Jump to the definition of the current symbol."
-  (interactive)
-  (ivy-exit-with-action #'counsel--find-symbol))
-
-(defun counsel--info-lookup-symbol ()
-  "Lookup the current symbol in the info docs."
-  (interactive)
-  (ivy-exit-with-action #'counsel-info-lookup-symbol))
-
-(defun counsel--find-symbol (x)
-  "Find symbol definition that corresponds to string X."
-  (with-ivy-window
-    (with-no-warnings
-      (ring-insert find-tag-marker-ring (point-marker)))
-    (let ((full-name (get-text-property 0 'full-name x)))
-      (if full-name
-          (find-library full-name)
-        (let ((sym (read x)))
-          (cond ((and (eq (ivy-state-caller ivy-last)
-                          'counsel-describe-variable)
-                      (boundp sym))
-                 (find-variable sym))
-                ((fboundp sym)
-                 (find-function sym))
-                ((boundp sym)
-                 (find-variable sym))
-                ((or (featurep sym)
-                     (locate-library
-                      (prin1-to-string sym)))
-                 (find-library
-                  (prin1-to-string sym)))
-                (t
-                 (error "Couldn't find definition of %s"
-                        sym))))))))
-
-(define-obsolete-function-alias 'counsel-symbol-at-point
-    'ivy-thing-at-point "0.7.0")
-
-(defun counsel-variable-list ()
-  "Return the list of all currently bound variables."
-  (let (cands)
-    (mapatoms
-     (lambda (vv)
-       (when (or (get vv 'variable-documentation)
-                 (and (boundp vv) (not (keywordp vv))))
-         (push (symbol-name vv) cands))))
-    (delete "" cands)))
-
-(defun counsel-describe-variable-transformer (var)
-  "Propertize VAR if it's a custom variable."
-  (if (custom-variable-p (intern var))
-      (ivy-append-face var 'ivy-highlight-face)
-    var))
-
-(ivy-set-display-transformer
- 'counsel-describe-variable 'counsel-describe-variable-transformer)
-
-;;;###autoload
-(defun counsel-describe-variable ()
-  "Forward to `describe-variable'.
-
-Variables declared using `defcustom' are highlighted according to
-`ivy-highlight-face'."
-  (interactive)
-  (let ((enable-recursive-minibuffers t))
-    (ivy-read
-     "Describe variable: "
-     (counsel-variable-list)
-     :keymap counsel-describe-map
-     :preselect (ivy-thing-at-point)
-     :history 'counsel-describe-symbol-history
-     :require-match t
-     :sort t
-     :action (lambda (x)
-               (describe-variable
-                (intern x)))
-     :caller 'counsel-describe-variable)))
-
-;;** `counsel-describe-function'
-(ivy-set-actions
- 'counsel-describe-function
- '(("I" counsel-info-lookup-symbol "info")
-   ("d" counsel--find-symbol "definition")))
-
-(defun counsel-describe-function-transformer (function-name)
-  "Propertize FUNCTION-NAME if it's an interactive function."
-  (if (commandp (intern function-name))
-      (ivy-append-face function-name 'ivy-highlight-face)
-    function-name))
-
-(ivy-set-display-transformer
- 'counsel-describe-function 'counsel-describe-function-transformer)
-
-;;;###autoload
-(defun counsel-describe-function ()
-  "Forward to `describe-function'.
-
-Interactive functions \(i.e., commands) are highlighted according
-to `ivy-highlight-face'."
-  (interactive)
-  (let ((enable-recursive-minibuffers t))
-    (ivy-read "Describe function: "
-              (let (cands)
-                (mapatoms
-                 (lambda (x)
-                   (when (fboundp x)
-                     (push (symbol-name x) cands))))
-                cands)
-              :keymap counsel-describe-map
-              :preselect (ivy-thing-at-point)
-              :history 'counsel-describe-symbol-history
-              :require-match t
-              :sort t
-              :action (lambda (x)
-                        (describe-function
-                         (intern x)))
-              :caller 'counsel-describe-function)))
-
-;;** `counsel-set-variable'
-(defvar counsel-set-variable-history nil
-  "Store history for `counsel-set-variable'.")
-
-(defun counsel-read-setq-expression (sym)
-  "Read and eval a setq expression for SYM."
-  (setq this-command 'eval-expression)
-  (let* ((minibuffer-completing-symbol t)
-         (sym-value (symbol-value sym))
-         (expr (minibuffer-with-setup-hook
-                   (lambda ()
-                     (add-function :before-until (local 'eldoc-documentation-function)
-                                   #'elisp-eldoc-documentation-function)
-                     (add-hook 'completion-at-point-functions #'elisp-completion-at-point nil t)
-                     (run-hooks 'eval-expression-minibuffer-setup-hook)
-                     (goto-char (minibuffer-prompt-end))
-                     (forward-char 6)
-                     (insert (format "%S " sym)))
-                 (read-from-minibuffer "Eval: "
-                                       (format
-                                        (if (and sym-value (consp sym-value))
-                                            "(setq '%S)"
-                                          "(setq %S)")
-                                        sym-value)
-                                       read-expression-map t
-                                       'read-expression-history))))
-    (eval-expression expr)))
-
-(defun counsel--setq-doconst (x)
-  "Return a cons of description and value for X.
-X is an item of a radio- or choice-type defcustom."
-  (let (y)
-    (when (and (listp x)
-               (consp (setq y (last x))))
-      (unless (equal y '(function))
-        (setq x (car y))
-        (cons (prin1-to-string x)
-              (if (symbolp x)
-                  (list 'quote x)
-                x))))))
-
-;;;###autoload
-(defun counsel-set-variable ()
-  "Set a variable, with completion.
-
-When the selected variable is a `defcustom' with the type boolean
-or radio, offer completion of all possible values.
-
-Otherwise, offer a variant of `eval-expression', with the initial
-input corresponding to the chosen variable."
-  (interactive)
-  (let ((sym (intern
-              (ivy-read "Variable: "
-                        (counsel-variable-list)
-                        :preselect (ivy-thing-at-point)
-                        :history 'counsel-set-variable-history)))
-        sym-type
-        cands)
-    (if (and (boundp sym)
-             (setq sym-type (get sym 'custom-type))
-             (cond
-               ((and (consp sym-type)
-                     (memq (car sym-type) '(choice radio)))
-                (setq cands (delq nil (mapcar #'counsel--setq-doconst (cdr sym-type)))))
-               ((eq sym-type 'boolean)
-                (setq cands '(("nil" . nil) ("t" . t))))
-               (t nil)))
-        (let* ((sym-val (symbol-value sym))
-               ;; Escape '%' chars if present
-               (sym-val-str (replace-regexp-in-string "%" "%%" (format "%s" sym-val)))
-               (res (ivy-read (format "Set (%S <%s>): " sym sym-val-str)
-                              cands
-                              :preselect (prin1-to-string sym-val))))
-          (when res
-            (setq res
-                  (if (assoc res cands)
-                      (cdr (assoc res cands))
-                    (read res)))
-            (set sym (if (and (listp res) (eq (car res) 'quote))
-                         (cadr res)
-                       res))))
-      (unless (boundp sym)
-        (set sym nil))
-      (counsel-read-setq-expression sym))))
-
-;;** `counsel-info-lookup-symbol'
-(defvar info-lookup-mode)
-(declare-function info-lookup->completions "info-look")
-(declare-function info-lookup->mode-value "info-look")
-(declare-function info-lookup-select-mode "info-look")
-(declare-function info-lookup-change-mode "info-look")
-(declare-function info-lookup "info-look")
-
-;;;###autoload
-(defun counsel-info-lookup-symbol (symbol &optional mode)
-  "Forward to (`info-lookup-symbol' SYMBOL MODE) with ivy completion."
-  (interactive
-   (progn
-     (require 'info-look)
-     (let* ((topic 'symbol)
-            (mode (cond (current-prefix-arg
-                         (info-lookup-change-mode topic))
-                        ((info-lookup->mode-value
-                          topic (info-lookup-select-mode))
-                         info-lookup-mode)
-                        ((info-lookup-change-mode topic))))
-            (completions (info-lookup->completions topic mode))
-            (enable-recursive-minibuffers t)
-            (value (ivy-read
-                    "Describe symbol: "
-                    (mapcar #'car completions)
-                    :preselect (ivy-thing-at-point)
-                    :sort t)))
-       (list value info-lookup-mode))))
-  (require 'info-look)
-  (info-lookup 'symbol symbol mode))
-
-;;** `counsel-M-x'
-(ivy-set-actions
- 'counsel-M-x
- '(("d" counsel--find-symbol "definition")
-   ("h" (lambda (x) (describe-function (intern x))) "help")))
-
-(ivy-set-display-transformer
- 'counsel-M-x
- 'counsel-M-x-transformer)
-
-;;;###autoload
-(defun counsel-file-register ()
-  "Search file in register.
-
-You cannot use Emacs' normal register commands to create file
-registers.  Instead you must use the `set-register' function like
-so: `(set-register ?i \"/home/eric/.emacs.d/init.el\")'.  Now you
-can use `C-x r j i' to open that file."
-  (interactive)
-  (ivy-read "File Register: "
-            ;; Use the `register-alist' variable to filter out file
-            ;; registers.  Each entry for a file registar will have the
-            ;; following layout:
-            ;;
-            ;;     (NUMBER 'file . "string/path/to/file")
-            ;;
-            ;; So we go through each entry and see if the `cadr' is
-            ;; `eq' to the symbol `file'.  If so then add the filename
-            ;; (`cddr') which `ivy-read' will use for its choices.
-            (mapcar (lambda (register-alist-entry)
-                      (if (eq 'file (cadr register-alist-entry))
-                          (cddr register-alist-entry)))
-                      register-alist)
-            :sort t
-            :require-match t
-            :history 'counsel-file-register
-            :caller 'counsel-file-register
-            :action (lambda (register-file)
-                      (with-ivy-window (find-file register-file)))))
-
-(ivy-set-actions
- 'counsel-file-register
- '(("j" find-file-other-window "other window")))
-
-(declare-function bookmark-all-names "bookmark")
-(declare-function bookmark-location "bookmark")
-
-(defcustom counsel-bookmark-avoid-dired nil
-  "If non-nil, open directory bookmarks with `counsel-find-file'.
-By default `counsel-bookmark' opens a dired buffer for directories."
-  :type 'boolean
-  :group 'ivy)
-
-;;;###autoload
-(defun counsel-bookmark ()
-  "Forward to `bookmark-jump' or `bookmark-set' if bookmark doesn't exist."
-  (interactive)
-  (require 'bookmark)
-  (ivy-read "Create or jump to bookmark: "
-            (bookmark-all-names)
-            :action (lambda (x)
-                      (cond ((and counsel-bookmark-avoid-dired
-                                  (member x (bookmark-all-names))
-                                  (file-directory-p (bookmark-location x)))
-                             (with-ivy-window
-                               (let ((default-directory (bookmark-location x)))
-                                 (counsel-find-file))))
-                            ((member x (bookmark-all-names))
-                             (with-ivy-window
-                               (bookmark-jump x)))
-                            (t
-                             (bookmark-set x))))
-            :caller 'counsel-bookmark))
-
-(ivy-set-actions
- 'counsel-bookmark
- '(("d" bookmark-delete "delete")
-   ("e" bookmark-rename "edit")))
-
-(defun counsel-M-x-transformer (cmd)
-  "Return CMD appended with the corresponding binding in the current window."
-  (let ((binding (substitute-command-keys (format "\\[%s]" cmd))))
-    (setq binding (replace-regexp-in-string "C-x 6" "<f2>" binding))
-    (if (string-match "^M-x" binding)
-        cmd
-      (format "%s (%s)"
-              cmd (propertize binding 'face 'font-lock-keyword-face)))))
-
-(defvar smex-initialized-p)
-(defvar smex-ido-cache)
-(declare-function smex-initialize "ext:smex")
-(declare-function smex-detect-new-commands "ext:smex")
-(declare-function smex-update "ext:smex")
-(declare-function smex-rank "ext:smex")
-
-(defun counsel--M-x-prompt ()
-  "String for `M-x' plus the string representation of `current-prefix-arg'."
-  (if (not current-prefix-arg)
-      "M-x "
-    (concat
-     (if (eq current-prefix-arg '-)
-         "- "
-       (if (integerp current-prefix-arg)
-           (format "%d " current-prefix-arg)
-         (if (= (car current-prefix-arg) 4)
-             "C-u "
-           (format "%d " (car current-prefix-arg)))))
-     "M-x ")))
-
-(defvar counsel-M-x-history nil
-  "History for `counsel-M-x'.")
-
-;;;###autoload
-(defun counsel-M-x (&optional initial-input)
-  "Ivy version of `execute-extended-command'.
-Optional INITIAL-INPUT is the initial input in the minibuffer."
-  (interactive)
-  (let* ((cands obarray)
-         (pred 'commandp)
-         (sort t))
-    (when (require 'smex nil 'noerror)
-      (unless smex-initialized-p
-        (smex-initialize))
-      (when (smex-detect-new-commands)
-        (smex-update))
-      (setq cands smex-ido-cache)
-      (setq pred nil)
-      (setq sort nil))
-    ;; When `counsel-M-x' returns, `last-command' would be set to
-    ;; `counsel-M-x' because :action hasn't been invoked yet.
-    ;; Instead, preserve the old value of `this-command'.
-    (setq this-command last-command)
-    (setq real-this-command real-last-command)
-    (ivy-read (counsel--M-x-prompt) cands
-              :predicate pred
-              :require-match t
-              :history 'counsel-M-x-history
-              :action
-              (lambda (cmd)
-                (when (featurep 'smex)
-                  (smex-rank (intern cmd)))
-                (let ((prefix-arg current-prefix-arg))
-                  (setq real-this-command
-                        (setq this-command (intern cmd)))
-                  (command-execute (intern cmd) 'record)))
-              :sort sort
-              :keymap counsel-describe-map
-              :initial-input initial-input
-              :caller 'counsel-M-x)))
-
-;;** `counsel-load-library'
-(defun counsel-library-candidates ()
-  "Return a list of completion candidates for `counsel-load-library'."
-  (interactive)
-  (let ((dirs load-path)
-        (suffix (concat (regexp-opt '(".el" ".el.gz") t) "\\'"))
-        (cands (make-hash-table :test #'equal))
-        short-name
-        old-val
-        dir-parent
-        res)
-    (dolist (dir dirs)
-      (when (file-directory-p dir)
-        (dolist (file (file-name-all-completions "" dir))
-          (when (string-match suffix file)
-            (unless (string-match "pkg.elc?$" file)
-              (setq short-name (substring file 0 (match-beginning 0)))
-              (if (setq old-val (gethash short-name cands))
-                  (progn
-                    ;; assume going up directory once will resolve name clash
-                    (setq dir-parent (counsel-directory-parent (cdr old-val)))
-                    (puthash short-name
-                             (cons
-                              (counsel-string-compose dir-parent (car old-val))
-                              (cdr old-val))
-                             cands)
-                    (setq dir-parent (counsel-directory-parent dir))
-                    (puthash (concat dir-parent short-name)
-                             (cons
-                              (propertize
-                               (counsel-string-compose
-                                dir-parent short-name)
-                               'full-name (expand-file-name file dir))
-                              dir)
-                             cands))
-                (puthash short-name
-                         (cons (propertize
-                                short-name
-                                'full-name (expand-file-name file dir))
-                               dir) cands)))))))
-    (maphash (lambda (_k v) (push (car v) res)) cands)
-    (nreverse res)))
-
-;;;###autoload
-(defun counsel-load-library ()
-  "Load a selected the Emacs Lisp library.
-The libraries are offered from `load-path'."
-  (interactive)
-  (let ((cands (counsel-library-candidates)))
-    (ivy-read "Load library: " cands
-              :action (lambda (x)
-                        (load-library
-                         (get-text-property 0 'full-name x)))
-              :keymap counsel-describe-map)))
-
-(ivy-set-actions
- 'counsel-load-library
- '(("d" counsel--find-symbol "definition")))
-
-;;** `counsel-find-library'
-;;;###autoload
-(defun counsel-find-library ()
-  "Visit a selected the Emacs Lisp library.
-The libraries are offered from `load-path'."
-  (interactive)
-  (let ((cands (counsel-library-candidates)))
-    (ivy-read "Find library: " cands
-              :action #'counsel--find-symbol
-              :keymap counsel-describe-map)))
-
-;;** `counsel-load-theme'
-(declare-function powerline-reset "ext:powerline")
-
-(defun counsel-load-theme-action (x)
-  "Disable current themes and load theme X."
-  (condition-case nil
-      (progn
-        (mapc #'disable-theme custom-enabled-themes)
-        (load-theme (intern x) t)
-        (when (fboundp 'powerline-reset)
-          (powerline-reset)))
-    (error "Problem loading theme %s" x)))
-
-;;;###autoload
-(defun counsel-load-theme ()
-  "Forward to `load-theme'.
-Usable with `ivy-resume', `ivy-next-line-and-call' and
-`ivy-previous-line-and-call'."
-  (interactive)
-  (ivy-read "Load custom theme: "
-            (mapcar 'symbol-name
-                    (custom-available-themes))
-            :action #'counsel-load-theme-action
-            :caller 'counsel-load-theme))
-
-;;** `counsel-descbinds'
-(ivy-set-actions
- 'counsel-descbinds
- '(("d" counsel-descbinds-action-find "definition")
-   ("I" counsel-descbinds-action-info "info")))
-
-(defvar counsel-descbinds-history nil
-  "History for `counsel-descbinds'.")
-
-(defun counsel--descbinds-cands (&optional prefix buffer)
-  "Get key bindings starting with PREFIX in BUFFER.
-See `describe-buffer-bindings' for further information."
-  (let ((buffer (or buffer (current-buffer)))
-        (re-exclude (regexp-opt
-                     '("<vertical-line>" "<bottom-divider>" "<right-divider>"
-                       "<mode-line>" "<C-down-mouse-2>" "<left-fringe>"
-                       "<right-fringe>" "<header-line>"
-                       "<vertical-scroll-bar>" "<horizontal-scroll-bar>")))
-        res)
-    (with-temp-buffer
-      (let ((indent-tabs-mode t))
-        (describe-buffer-bindings buffer prefix))
-      (goto-char (point-min))
-      ;; Skip the "Key translations" section
-      (re-search-forward "")
-      (forward-char 1)
-      (while (not (eobp))
-        (when (looking-at "^\\([^\t\n]+\\)[\t ]*\\(.*\\)$")
-          (let ((key (match-string 1))
-                (fun (match-string 2))
-                cmd)
-            (unless (or (member fun '("??" "self-insert-command"))
-                        (string-match re-exclude key)
-                        (not (or (commandp (setq cmd (intern-soft fun)))
-                                 (member fun '("Prefix Command")))))
-              (push
-               (cons (format
-                      "%-15s %s"
-                      (propertize key 'face 'font-lock-builtin-face)
-                      fun)
-                     (cons key cmd))
-               res))))
-        (forward-line 1)))
-    (nreverse res)))
-
-(defun counsel-descbinds-action-describe (x)
-  "Describe function of candidate X.
-See `describe-function' for further information."
-  (let ((cmd (cddr x)))
-    (describe-function cmd)))
-
-(defun counsel-descbinds-action-find (x)
-  "Find symbol definition of candidate X.
-See `counsel--find-symbol' for further information."
-  (let ((cmd (cddr x)))
-    (counsel--find-symbol (symbol-name cmd))))
-
-(defun counsel-descbinds-action-info (x)
-  "Display symbol definition of candidate X, as found in the relevant manual.
-See `info-lookup-symbol' for further information."
-  (let ((cmd (cddr x)))
-    (counsel-info-lookup-symbol (symbol-name cmd))))
-
-;;;###autoload
-(defun counsel-descbinds (&optional prefix buffer)
-  "Show a list of all defined keys and their definitions.
-If non-nil, show only bindings that start with PREFIX.
-BUFFER defaults to the current one."
-  (interactive)
-  (ivy-read "Bindings: " (counsel--descbinds-cands prefix buffer)
-            :action #'counsel-descbinds-action-describe
-            :history 'counsel-descbinds-history
-            :caller 'counsel-descbinds))
-;;** `counsel-describe-face'
-(defun counsel-describe-face ()
-  "Completion for `describe-face'."
-  (interactive)
-  (let (cands)
-    (mapatoms
-     (lambda (s)
-       (if (facep s)
-           (push (symbol-name s) cands))))
-    (ivy-read "Face: " cands
-              :preselect (symbol-name (face-at-point t))
-              :action #'describe-face)))
-;;* Git
-;;** `counsel-git'
-(defvar counsel-git-cmd "git ls-files --full-name --"
-  "Command for `counsel-git'.")
-
-(defvar counsel--git-dir nil
-  "Store the base git directory.")
-
-(ivy-set-actions
- 'counsel-git
- '(("j" find-file-other-window "other window")
-   ("x" counsel-find-file-extern "open externally")))
-
-(defun counsel-locate-git-root ()
-  "Locate the root of the git repository containing the current buffer."
-  (or (locate-dominating-file default-directory ".git")
-      (error "Not in a git repository")))
-
-;;;###autoload
-(defun counsel-git (&optional initial-input)
-  "Find file in the current Git repository.
-INITIAL-INPUT can be given as the initial minibuffer input."
-  (interactive)
-  (counsel-require-program (car (split-string counsel-git-cmd)))
-  (ivy-set-prompt 'counsel-git counsel-prompt-function)
-  (setq counsel--git-dir (expand-file-name
-                          (counsel-locate-git-root)))
-  (let* ((default-directory counsel--git-dir)
-         (cands (split-string
-                 (shell-command-to-string counsel-git-cmd)
-                 "\n"
-                 t)))
-    (ivy-read "Find file" cands
-              :initial-input initial-input
-              :action #'counsel-git-action
-              :caller 'counsel-git)))
-
-(defun counsel-git-action (x)
-  "Find file X in current Git repository."
-  (with-ivy-window
-    (let ((default-directory counsel--git-dir))
-      (find-file x))))
-
-;;** `counsel-git-grep'
-(defvar counsel-git-grep-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "C-l") 'ivy-call-and-recenter)
-    (define-key map (kbd "M-q") 'counsel-git-grep-query-replace)
-    (define-key map (kbd "C-c C-m") 'counsel-git-grep-switch-cmd)
-    map))
-
-(ivy-set-occur 'counsel-git-grep 'counsel-git-grep-occur)
-(ivy-set-display-transformer 'counsel-git-grep 'counsel-git-grep-transformer)
-
-(defvar counsel-git-grep-cmd-default "git --no-pager grep --full-name -n --no-color -i -e \"%s\""
-  "Initial command for `counsel-git-grep'.")
-
-(defvar counsel-git-grep-cmd nil
-  "Store the command for `counsel-git-grep'.")
-
-(defvar counsel--git-grep-count nil
-  "Store the line count in current repository.")
-
-(defvar counsel-git-grep-history nil
-  "History for `counsel-git-grep'.")
-
-(defvar counsel-git-grep-cmd-history
-  (list counsel-git-grep-cmd-default)
-  "History for `counsel-git-grep' shell commands.")
-
-(defcustom counsel-grep-post-action-hook nil
-  "Hook that runs after the point moves to the next candidate.
-Typical value: '(recenter)."
-  :type 'hook
-  :group 'ivy)
-
-(defun counsel-prompt-function-dir ()
-  "Return prompt appended with the parent directory."
-  (ivy-add-prompt-count
-   (let ((directory counsel--git-dir))
-     (format "%s [%s]: "
-             (ivy-state-prompt ivy-last)
-             (let ((dir-list (eshell-split-path directory)))
-               (if (> (length dir-list) 3)
-                   (apply #'concat
-                          (append '("...")
-                                  (cl-subseq dir-list (- (length dir-list) 3))))
-                 directory))))))
-
-(defcustom counsel-git-grep-skip-counting-lines nil
-  "If non-nil, don't count lines before grepping ina git repository."
-  :type 'boolean
-  :group 'ivy)
-
-(defun counsel-git-grep-function (string &optional _pred &rest _unused)
-  "Grep in the current git repository for STRING."
-  (if (and (or counsel-git-grep-skip-counting-lines (> counsel--git-grep-count 20000))
-           (< (length string) 3))
-      (counsel-more-chars 3)
-    (let* ((default-directory counsel--git-dir)
-           (cmd (format counsel-git-grep-cmd
-                        (setq ivy--old-re (ivy--regex string t)))))
-      (if (and (not counsel-git-grep-skip-counting-lines) (<= counsel--git-grep-count 20000))
-          (split-string (shell-command-to-string cmd) "\n" t)
-        (counsel--gg-candidates (ivy--regex string))
-        nil))))
-
-(defun counsel-git-grep-action (x)
-  "Go to occurrence X in current Git repository."
-  (when (string-match "\\`\\(.*?\\):\\([0-9]+\\):\\(.*\\)\\'" x)
-    (with-ivy-window
-      (let ((file-name (match-string-no-properties 1 x))
-            (line-number (match-string-no-properties 2 x)))
-        (find-file (expand-file-name file-name counsel--git-dir))
-        (goto-char (point-min))
-        (forward-line (1- (string-to-number line-number)))
-        (re-search-forward (ivy--regex ivy-text t) (line-end-position) t)
-        (swiper--ensure-visible)
-        (run-hooks 'counsel-grep-post-action-hook)
-        (unless (eq ivy-exit 'done)
-          (swiper--cleanup)
-          (swiper--add-overlays (ivy--regex ivy-text)))))))
-
-(defun counsel-git-grep-matcher (regexp candidates)
-  "Return REGEXP matching CANDIDATES for `counsel-git-grep'."
-  (or (and (equal regexp ivy--old-re)
-           ivy--old-cands)
-      (prog1
-          (setq ivy--old-cands
-                (cl-remove-if-not
-                 (lambda (x)
-                   (ignore-errors
-                     (when (string-match "^[^:]+:[^:]+:" x)
-                       (setq x (substring x (match-end 0)))
-                       (if (stringp regexp)
-                           (string-match regexp x)
-                         (let ((res t))
-                           (dolist (re regexp)
-                             (setq res
-                                   (and res
-                                        (ignore-errors
-                                          (if (cdr re)
-                                              (string-match (car re) x)
-                                            (not (string-match (car re) x)))))))
-                           res)))))
-                 candidates))
-        (setq ivy--old-re regexp))))
-
-(defun counsel-git-grep-transformer (str)
-  "Higlight file and line number in STR."
-  (when (string-match "\\`\\([^:]+\\):\\([^:]+\\):" str)
-    (set-text-properties (match-beginning 1)
-                         (match-end 1)
-                         '(face compilation-info)
-                         str)
-    (set-text-properties (match-beginning 2)
-                         (match-end 2)
-                         '(face compilation-line-number)
-                         str))
-  str)
-
-(defvar counsel-git-grep-projects-alist nil
-  "An alist of project directory to \"git-grep\" command.
-Allows to automatically use a custom \"git-grep\" command for all
-files in a project.")
-
-(defun counsel--git-grep-cmd-and-proj (cmd)
-  (let ((dd (expand-file-name default-directory))
-        proj)
-    (cond
-      ((stringp cmd))
-      (cmd
-       (if (setq proj
-                 (cl-find-if
-                  (lambda (x)
-                    (string-match (car x) dd))
-                  counsel-git-grep-projects-alist))
-           (setq cmd (cdr proj))
-         (setq cmd
-               (ivy-read "cmd: " counsel-git-grep-cmd-history
-                         :history 'counsel-git-grep-cmd-history
-                         :re-builder #'ivy--regex))
-         (setq counsel-git-grep-cmd-history
-               (delete-dups counsel-git-grep-cmd-history))))
-      (t
-       (setq cmd counsel-git-grep-cmd-default)))
-    (cons proj cmd)))
-
-;;;###autoload
-(defun counsel-git-grep (&optional cmd initial-input)
-  "Grep for a string in the current git repository.
-When CMD is a string, use it as a \"git grep\" command.
-When CMD is non-nil, prompt for a specific \"git grep\" command.
-INITIAL-INPUT can be given as the initial minibuffer input."
-  (interactive "P")
-  (ivy-set-prompt 'counsel-git-grep counsel-prompt-function)
-  (let ((proj-and-cmd (counsel--git-grep-cmd-and-proj cmd))
-        proj)
-    (setq proj (car proj-and-cmd))
-    (setq counsel-git-grep-cmd (cdr proj-and-cmd))
-    (counsel-require-program (car (split-string counsel-git-grep-cmd)))
-    (setq counsel--git-dir (if proj
-                               (car proj)
-                             (counsel-locate-git-root)))
-    (unless (or proj counsel-git-grep-skip-counting-lines)
-      (setq counsel--git-grep-count
-            (if (eq system-type 'windows-nt)
-                0
-              (counsel--gg-count "" t))))
-    (let ((collection-function
-           (if proj
-               #'counsel-git-grep-proj-function
-             #'counsel-git-grep-function))
-          (unwind-function
-           (if proj
-               (lambda ()
-                 (counsel-delete-process)
-                 (swiper--cleanup))
-             (lambda ()
-               (swiper--cleanup)))))
-      (ivy-read "git grep" collection-function
-                :initial-input initial-input
-                :matcher #'counsel-git-grep-matcher
-                :dynamic-collection (or proj counsel-git-grep-skip-counting-lines (> counsel--git-grep-count 20000))
-                :keymap counsel-git-grep-map
-                :action #'counsel-git-grep-action
-                :unwind unwind-function
-                :history 'counsel-git-grep-history
-                :caller 'counsel-git-grep))))
-
-(defun counsel-git-grep-proj-function (str)
-  "Grep for STR in the current git repository."
-  (if (< (length str) 3)
-      (counsel-more-chars 3)
-    (let ((regex (setq ivy--old-re
-                       (ivy--regex str t))))
-      (counsel--async-command (format counsel-git-grep-cmd regex))
-      nil)))
-
-(defun counsel-git-grep-switch-cmd ()
-  "Set `counsel-git-grep-cmd' to a different value."
-  (interactive)
-  (setq counsel-git-grep-cmd
-        (ivy-read "cmd: " counsel-git-grep-cmd-history
-                  :history 'counsel-git-grep-cmd-history))
-  (setq counsel-git-grep-cmd-history
-        (delete-dups counsel-git-grep-cmd-history))
-  (unless (ivy-state-dynamic-collection ivy-last)
-    (setq ivy--all-candidates
-          (all-completions "" 'counsel-git-grep-function))))
-
-(defvar counsel-gg-state nil
-  "The current state of candidates / count sync.")
-
-(defun counsel--gg-candidates (regex)
-  "Return git grep candidates for REGEX."
-  (setq counsel-gg-state -2)
-  (counsel--gg-count regex)
-  (let* ((default-directory counsel--git-dir)
-         (counsel-gg-process " *counsel-gg*")
-         (proc (get-process counsel-gg-process))
-         (buff (get-buffer counsel-gg-process)))
-    (when proc
-      (delete-process proc))
-    (when buff
-      (kill-buffer buff))
-    (setq proc (start-process-shell-command
-                counsel-gg-process
-                counsel-gg-process
-                (concat
-                 (format counsel-git-grep-cmd regex)
-                 " | head -n 200")))
-    (set-process-sentinel
-     proc
-     #'counsel--gg-sentinel)))
-
-(defun counsel--gg-sentinel (process event)
-  "Sentinel function for a `counsel-git-grep' PROCESS.
-EVENT is a string describing the change."
-  (if (member event '("finished\n"
-                      "exited abnormally with code 141\n"))
-      (progn
-        (with-current-buffer (process-buffer process)
-          (setq ivy--all-candidates
-                (or (split-string (buffer-string) "\n" t)
-                    '("")))
-          (setq ivy--old-cands ivy--all-candidates))
-        (when (= 0 (cl-incf counsel-gg-state))
-          (ivy--exhibit)))
-    (if (string= event "exited abnormally with code 1\n")
-        (progn
-          (setq ivy--all-candidates '("Error"))
-          (setq ivy--old-cands ivy--all-candidates)
-          (ivy--exhibit)))))
-
-(defun counsel--gg-count (regex &optional no-async)
-  "Count the number of results matching REGEX in `counsel-git-grep'.
-The command to count the matches is called asynchronously.
-If NO-ASYNC is non-nil, do it synchronously instead."
-  (let ((default-directory counsel--git-dir)
-        (cmd
-         (concat
-          (format
-           (replace-regexp-in-string
-            "--full-name" "-c"
-            counsel-git-grep-cmd)
-           ;; "git grep -i -c '%s'"
-           (replace-regexp-in-string
-            "-" "\\\\-"
-            (replace-regexp-in-string "'" "''" regex)))
-          " | sed 's/.*:\\(.*\\)/\\1/g' | awk '{s+=$1} END {print s}'"))
-        (counsel-ggc-process " *counsel-gg-count*"))
-    (if no-async
-        (string-to-number (shell-command-to-string cmd))
-      (let ((proc (get-process counsel-ggc-process))
-            (buff (get-buffer counsel-ggc-process)))
-        (when proc
-          (delete-process proc))
-        (when buff
-          (kill-buffer buff))
-        (setq proc (start-process-shell-command
-                    counsel-ggc-process
-                    counsel-ggc-process
-                    cmd))
-        (set-process-sentinel
-         proc
-         #'(lambda (process event)
-             (when (string= event "finished\n")
-               (with-current-buffer (process-buffer process)
-                 (setq ivy--full-length (string-to-number (buffer-string))))
-               (when (= 0 (cl-incf counsel-gg-state))
-                 (ivy--exhibit)))))))))
-
-(defun counsel-git-grep-occur ()
-  "Generate a custom occur buffer for `counsel-git-grep'.
-When REVERT is non-nil, regenerate the current *ivy-occur* buffer."
-  (unless (eq major-mode 'ivy-occur-grep-mode)
-    (ivy-occur-grep-mode)
-    (setq default-directory counsel--git-dir))
-  (setq ivy-text
-        (and (string-match "\"\\(.*\\)\"" (buffer-name))
-             (match-string 1 (buffer-name))))
-  (let* ((regex (funcall ivy--regex-function ivy-text))
-         (positive-pattern (replace-regexp-in-string
-                            ;; git-grep can't handle .*?
-                            "\\.\\*\\?" ".*"
-                            (if (stringp regex) regex (caar regex))))
-         (negative-patterns
-          (mapconcat (lambda (x)
-                       (and (null (cdr x))
-                            (format "| grep -v %s" (car x))))
-                     regex
-                     " "))
-         (cmd (concat (format counsel-git-grep-cmd positive-pattern) negative-patterns))
-         cands)
-    (setq cands (split-string
-                 (shell-command-to-string cmd)
-                 "\n"
-                 t))
-    ;; Need precise number of header lines for `wgrep' to work.
-    (insert (format "-*- mode:grep; default-directory: %S -*-\n\n\n"
-                    default-directory))
-    (insert (format "%d candidates:\n" (length cands)))
-    (ivy--occur-insert-lines
-     (mapcar
-      (lambda (cand) (concat "./" cand))
-      cands))))
-
-(defun counsel-git-grep-query-replace ()
-  "Start `query-replace' with string to replace from last search string."
-  (interactive)
-  (if (null (window-minibuffer-p))
-      (user-error
-       "Should only be called in the minibuffer through `counsel-git-grep-map'")
-    (let* ((enable-recursive-minibuffers t)
-           (from (ivy--regex ivy-text))
-           (to (query-replace-read-to from "Query replace" t)))
-      (ivy-exit-with-action
-       (lambda (_)
-         (let (done-buffers)
-           (dolist (cand ivy--old-cands)
-             (when (string-match "\\`\\(.*?\\):\\([0-9]+\\):\\(.*\\)\\'" cand)
-               (with-ivy-window
-                 (let ((file-name (match-string-no-properties 1 cand)))
-                   (setq file-name (expand-file-name file-name counsel--git-dir))
-                   (unless (member file-name done-buffers)
-                     (push file-name done-buffers)
-                     (find-file file-name)
-                     (goto-char (point-min)))
-                   (perform-replace from to t t nil)))))))))))
-
-;;** `counsel-git-stash'
-(defun counsel-git-stash-kill-action (x)
-  "Add git stash command to kill ring.
-The git command applies the stash entry where candidate X was found in."
-  (when (string-match "\\([^:]+\\):" x)
-    (kill-new (message (format "git stash apply %s" (match-string 1 x))))))
-
-;;;###autoload
-(defun counsel-git-stash ()
-  "Search through all available git stashes."
-  (interactive)
-  (setq counsel--git-dir (counsel-locate-git-root))
-  (let ((cands (split-string (shell-command-to-string
-                              "IFS=$'\n'
-for i in `git stash list --format=\"%gd\"`; do
-    git stash show -p $i | grep -H --label=\"$i\" \"$1\"
-done") "\n" t)))
-    (ivy-read "git stash: " cands
-              :action 'counsel-git-stash-kill-action
-              :caller 'counsel-git-stash)))
-
-;;** `counsel-git-log'
-(defvar counsel-git-log-cmd "GIT_PAGER=cat git log --grep '%s'"
-  "Command used for \"git log\".")
-
-(defvar counsel-git-log-split-string-re "\ncommit "
-  "The `split-string' separates when split output of `counsel-git-log-cmd'.")
-
-(defun counsel-git-log-function (input)
-  "Search for INPUT in git log."
-  (if (< (length input) 3)
-      (counsel-more-chars 3)
-    ;; `counsel--yank-pop-format-function' uses this
-    (setq ivy--old-re (funcall ivy--regex-function input))
-    (counsel--async-command
-     ;; "git log --grep" likes to have groups quoted e.g. \(foo\).
-     ;; But it doesn't like the non-greedy ".*?".
-     (format counsel-git-log-cmd
-             (replace-regexp-in-string "\\.\\*\\?" ".*"
-                                       (ivy-re-to-str ivy--old-re))))
-    nil))
-
-(defun counsel-git-log-action (x)
-  "Add candidate X to kill ring."
-  (message "%S" (kill-new x)))
-
-(defcustom counsel-yank-pop-truncate-radius 2
-  "When non-nil, truncate the display of long strings."
-  :type 'integer
-  :group 'ivy)
-
-;;** `counsel-git-change-worktree'
-(autoload 'string-trim-right "subr-x")
-(defun counsel-git-change-worktree-action (git-root-dir tree)
-  "Find the corresponding file in the worktree located at tree.
-The current buffer is assumed to be in a subdirectory of GIT-ROOT-DIR.
-TREE is the selected candidate."
-  (let* ((new-root-dir (counsel-git-worktree-parse-root tree))
-         (tree-filename (file-relative-name (buffer-file-name) git-root-dir))
-         (file-name (expand-file-name tree-filename new-root-dir)))
-    (find-file file-name)))
-
-(defun counsel-git-worktree-list ()
-  "List worktrees in the git repository containing the current buffer."
-  (setq counsel--git-dir (counsel-locate-git-root))
-  (let ((cmd-output (shell-command-to-string "git worktree list")))
-    (delete "" (split-string (string-trim-right cmd-output) "\n"))))
-
-(defun counsel-git-worktree-parse-root (tree)
-  "Return worktree from candidate TREE."
-  (substring tree 0 (string-match " " tree)))
-
-(defun counsel-git-close-worktree-files-action (root-dir)
-  "Close all buffers from the worktree located at ROOT-DIR."
-  (setq root-dir (counsel-git-worktree-parse-root root-dir))
-  (save-excursion
-    (dolist (buf (buffer-list))
-      (set-buffer buf)
-      (and buffer-file-name
-           (string= "." (file-relative-name root-dir (counsel-locate-git-root)))
-           (kill-buffer buf)))))
-
-(ivy-set-actions
- 'counsel-git-change-worktree
- '(("k" counsel-git-close-worktree-files-action "kill all")))
-
-;;;###autoload
-(defun counsel-git-change-worktree ()
-  "Find the file corresponding to the current buffer on a different worktree."
-  (interactive)
-  (setq counsel--git-dir (counsel-locate-git-root))
-  (ivy-read "Select worktree: "
-            (or (cl-delete counsel--git-dir (counsel-git-worktree-list)
-                           :key #'counsel-git-worktree-parse-root :test #'string=)
-                (error "No other worktrees!"))
-            :action (lambda (tree) (counsel-git-change-worktree-action counsel--git-dir tree))
-            :require-match t
-            :caller 'counsel-git-change-worktree))
-
-;;** `counsel-git-checkout'
-(defun counsel-git-checkout-action (branch)
-  "Call the \"git checkout BRANCH\" command.
-
-BRANCH is a string whose first word designates the command argument."
-  (shell-command
-   (format "git checkout %s" (substring branch 0 (string-match " " branch)))))
-
-(defun counsel-git-branch-list ()
-  "List branches in the git repository containing the current buffer.
-
-Does not list the currently checked out one."
-  (setq counsel--git-dir (counsel-locate-git-root))
-  (let ((cmd-output (shell-command-to-string "git branch -vv --all")))
-    (cl-mapcan
-     (lambda (str)
-       (when (string-prefix-p " " str)
-         (list (substring str (string-match "[^[:blank:]]" str)))))
-     (split-string (string-trim-right cmd-output) "\n"))))
-
-;;;###autoload
-(defun counsel-git-checkout ()
-  "Call the \"git checkout\" command."
-  (interactive)
-  (ivy-read "Checkout branch: " (counsel-git-branch-list)
-            :action #'counsel-git-checkout-action
-            :caller 'counsel-git-checkout))
-
-;;;###autoload
-(defun counsel-git-log ()
-  "Call the \"git log --grep\" shell command."
-  (interactive)
-  (let ((counsel-async-split-string-re counsel-git-log-split-string-re)
-        (counsel-async-ignore-re "^[ \n]*$")
-        (counsel-yank-pop-truncate-radius 5)
-        (ivy-format-function #'counsel--yank-pop-format-function)
-        (ivy-height 4))
-    (ivy-read "Grep log: " #'counsel-git-log-function
-              :dynamic-collection t
-              :action #'counsel-git-log-action
-              :unwind #'counsel-delete-process
-              :caller 'counsel-git-log)))
-
-;;* File
-;;** `counsel-find-file'
-(defvar counsel-find-file-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "C-DEL") 'counsel-up-directory)
-    (define-key map (kbd "C-<backspace>") 'counsel-up-directory)
-    map))
-
-(add-to-list 'ivy-ffap-url-functions 'counsel-github-url-p)
-(add-to-list 'ivy-ffap-url-functions 'counsel-emacs-url-p)
-(add-to-list 'ivy-ffap-url-functions 'counsel-url-expand)
-(defun counsel-find-file-cd-bookmark-action (_)
-  "Reset `counsel-find-file' from selected directory."
-  (ivy-read "cd: "
-            (progn
-              (ivy--virtual-buffers)
-              (delete-dups
-               (mapcar (lambda (x) (file-name-directory (cdr x)))
-                       ivy--virtual-buffers)))
-            :action (lambda (x)
-                      (let ((default-directory (file-name-directory x)))
-                        (counsel-find-file)))))
-
-(defcustom counsel-root-command "sudo"
-  "Command to gain root privileges."
-  :type 'string
-  :group 'ivy)
-
-(defun counsel-find-file-as-root (x)
-  "Find file X with root privileges."
-  (counsel-require-program counsel-root-command)
-  (let* ((host (file-remote-p x 'host))
-         (file-name (format "/%s:%s:%s"
-                            counsel-root-command
-                            (or host "")
-                            (expand-file-name
-                             (if host
-                                 (file-remote-p x 'localname)
-                               x)))))
-    ;; If the current buffer visits the same file we are about to open,
-    ;; replace the current buffer with the new one.
-    (if (eq (current-buffer) (get-file-buffer x))
-        (find-alternate-file file-name)
-      (find-file file-name))))
-
-(ivy-set-actions
- 'counsel-find-file
- '(("j" find-file-other-window "other window")
-   ("b" counsel-find-file-cd-bookmark-action "cd bookmark")
-   ("x" counsel-find-file-extern "open externally")
-   ("r" counsel-find-file-as-root "open as root")))
-
-(defcustom counsel-find-file-at-point nil
-  "When non-nil, add file-at-point to the list of candidates."
-  :type 'boolean
-  :group 'ivy)
-
-(defcustom counsel-find-file-ignore-regexp nil
-  "A regexp of files to ignore while in `counsel-find-file'.
-These files are un-ignored if `ivy-text' matches them.  The
-common way to show all files is to start `ivy-text' with a dot.
-
-Example value: \"\\(?:\\`[#.]\\)\\|\\(?:[#~]\\'\\)\".  This will hide
-temporary and lock files.
-\\<ivy-minibuffer-map>
-Choosing the dotfiles option, \"\\`\\.\", might be convenient,
-since you can still access the dotfiles if your input starts with
-a dot. The generic way to toggle ignored files is \\[ivy-toggle-ignore],
-but the leading dot is a lot faster."
-  :group 'ivy
-  :type `(choice
-          (const :tag "None" nil)
-          (const :tag "Dotfiles" "\\`\\.")
-          (const :tag "Ignored Extensions"
-                 ,(regexp-opt completion-ignored-extensions))
-          (regexp :tag "Regex")))
-
-(defun counsel--find-file-matcher (regexp candidates)
-  "Return REGEXP matching CANDIDATES.
-Skip some dotfiles unless `ivy-text' requires them."
-  (let ((res (ivy--re-filter regexp candidates)))
-    (if (or (null ivy-use-ignore)
-            (null counsel-find-file-ignore-regexp)
-            (string-match "\\`\\." ivy-text))
-        res
-      (or (cl-remove-if
-           (lambda (x)
-             (and
-              (string-match counsel-find-file-ignore-regexp x)
-              (not (member x ivy-extra-directories))))
-           res)
-          res))))
-
-(declare-function ffap-guesser "ffap")
-
-(defvar counsel-find-file-speedup-remote t
-  "Speed up opening remote files by disabling `find-file-hook' for them.")
-
-;;;###autoload
-(defun counsel-find-file (&optional initial-input)
-  "Forward to `find-file'.
-When INITIAL-INPUT is non-nil, use it in the minibuffer during completion."
-  (interactive)
-  (ivy-read "Find file: " 'read-file-name-internal
-            :matcher #'counsel--find-file-matcher
-            :initial-input initial-input
-            :action
-            (lambda (x)
-              (with-ivy-window
-                (if (and counsel-find-file-speedup-remote
-                         (file-remote-p ivy--directory))
-                    (let ((find-file-hook nil))
-                      (find-file (expand-file-name x ivy--directory)))
-                  (find-file (expand-file-name x ivy--directory)))))
-            :preselect (when counsel-find-file-at-point
-                         (require 'ffap)
-                         (let ((f (ffap-guesser)))
-                           (when f (expand-file-name f))))
-            :require-match 'confirm-after-completion
-            :history 'file-name-history
-            :keymap counsel-find-file-map
-            :caller 'counsel-find-file))
-
-(defun counsel-up-directory ()
-  "Go to the parent directory preselecting the current one."
-  (interactive)
-  (let ((dir-file-name
-         (directory-file-name (expand-file-name ivy--directory))))
-    (ivy--cd (file-name-directory dir-file-name))
-    (setf (ivy-state-preselect ivy-last)
-          (file-name-as-directory (file-name-nondirectory dir-file-name)))))
-
-(defun counsel-at-git-issue-p ()
-  "When point is at an issue in a Git-versioned file, return the issue string."
-  (and (looking-at "#[0-9]+")
-       (or
-        (eq (vc-backend (buffer-file-name)) 'Git)
-        (or
-         (memq major-mode '(magit-commit-mode))
-         (bound-and-true-p magit-commit-mode)))
-       (match-string-no-properties 0)))
-
-(defun counsel-github-url-p ()
-  "Return a Github issue URL at point."
-  (counsel-require-program "git")
-  (let ((url (counsel-at-git-issue-p)))
-    (when url
-      (let ((origin (shell-command-to-string
-                     "git remote get-url origin"))
-            user repo)
-        (cond ((string-match "\\`git@github.com:\\([^/]+\\)/\\(.*\\)\\.git$"
-                             origin)
-               (setq user (match-string 1 origin))
-               (setq repo (match-string 2 origin)))
-              ((string-match "\\`https://github.com/\\([^/]+\\)/\\(.*\\)$"
-                             origin)
-               (setq user (match-string 1 origin))
-               (setq repo (match-string 2 origin))))
-        (when user
-          (setq url (format "https://github.com/%s/%s/issues/%s"
-                            user repo (substring url 1))))))))
-
-(defun counsel-emacs-url-p ()
-  "Return a Debbugs issue URL at point."
-  (counsel-require-program "git")
-  (let ((url (counsel-at-git-issue-p)))
-    (when url
-      (let ((origin (shell-command-to-string
-                     "git remote get-url origin")))
-        (when (string-match "git.sv.gnu.org:/srv/git/emacs.git" origin)
-          (format "http://debbugs.gnu.org/cgi/bugreport.cgi?bug=%s"
-                  (substring url 1)))))))
-
-(defvar counsel-url-expansions-alist nil
-  "Map of regular expressions to expansions.
-
-This variable should take the form of a list of (REGEXP . FORMAT)
-pairs.
-
-`counsel-url-expand' will expand the word at point according to
-FORMAT for the first matching REGEXP.  FORMAT can be either a
-string or a function.  If it is a string, it will be used as the
-format string for the `format' function, with the word at point
-as the next argument.  If it is a function, it will be called
-with the word at point as the sole argument.
-
-For example, a pair of the form:
-  '(\"\\`BSERV-[[:digit:]]+\\'\" . \"https://jira.atlassian.com/browse/%s\")
-will expand to URL `https://jira.atlassian.com/browse/BSERV-100'
-when the word at point is BSERV-100.
-
-If the format element is a function, more powerful
-transformations are possible.  As an example,
-  '(\"\\`issue\\([[:digit:]]+\\)\\'\" .
-    (lambda (word)
-      (concat \"http://debbugs.gnu.org/cgi/bugreport.cgi?bug=\"
-              (match-string 1 word))))
-trims the \"issue\" prefix from the word at point before creating the URL.")
-
-(defun counsel-url-expand ()
-  "Expand word at point using `counsel-url-expansions-alist'.
-The first pair in the list whose regexp matches the word at point
-will be expanded according to its format.  This function is
-intended to be used in `ivy-ffap-url-functions' to browse the
-result as a URL."
-  (let ((word-at-point (current-word)))
-    (cl-some
-     (lambda (pair)
-       (let ((regexp (car pair))
-             (formatter (cdr pair)))
-         (when (string-match regexp word-at-point)
-           (if (functionp formatter)
-               (funcall formatter word-at-point)
-             (format formatter word-at-point)))))
-     counsel-url-expansions-alist)))
-
-;;** `counsel-recentf'
-(defvar recentf-list)
-(declare-function recentf-mode "recentf")
-
-;;;###autoload
-(defun counsel-recentf ()
-  "Find a file on `recentf-list'."
-  (interactive)
-  (require 'recentf)
-  (recentf-mode)
-  (ivy-read "Recentf: " (mapcar #'substring-no-properties recentf-list)
-            :action (lambda (f)
-                      (with-ivy-window
-                       (find-file f)))
-            :caller 'counsel-recentf))
-(ivy-set-actions
- 'counsel-recentf
- '(("j" find-file-other-window "other window")
-   ("x" counsel-find-file-extern "open externally")))
-
-;;** `counsel-locate'
-(defcustom counsel-locate-cmd (cond ((eq system-type 'darwin)
-                                     'counsel-locate-cmd-noregex)
-                                    ((and (eq system-type 'windows-nt)
-                                          (executable-find "es.exe"))
-                                     'counsel-locate-cmd-es)
-                                    (t
-                                     'counsel-locate-cmd-default))
-  "The function for producing a locate command string from the input.
-
-The function takes a string - the current input, and returns a
-string - the full shell command to run."
-  :group 'ivy
-  :type '(choice
-          (const :tag "Default" counsel-locate-cmd-default)
-          (const :tag "No regex" counsel-locate-cmd-noregex)
-          (const :tag "mdfind" counsel-locate-cmd-mdfind)
-          (const :tag "everything" counsel-locate-cmd-es)))
-
-(ivy-set-actions
- 'counsel-locate
- '(("x" counsel-locate-action-extern "xdg-open")
-   ("d" counsel-locate-action-dired "dired")))
-
-(counsel-set-async-exit-code 'counsel-locate 1 "Nothing found")
-
-(defvar counsel-locate-history nil
-  "History for `counsel-locate'.")
-
-(defun counsel-locate-action-extern (x)
-  "Use xdg-open shell command, or corresponding system command, on X."
-  (interactive (list (read-file-name "File: ")))
-  (if (and (eq system-type 'windows-nt)
-           (fboundp 'w32-shell-execute))
-      (w32-shell-execute "open" x)
-    (call-process shell-file-name nil
-                  nil nil
-                  shell-command-switch
-                  (format "%s %s"
-                          (cl-case system-type
-                            (darwin "open")
-                            (t "xdg-open"))
-                          (shell-quote-argument x)))))
-
-(defalias 'counsel-find-file-extern 'counsel-locate-action-extern)
-
-(declare-function dired-jump "dired-x")
-
-(defun counsel-locate-action-dired (x)
-  "Use `dired-jump' on X."
-  (dired-jump nil x))
-
-(defun counsel-locate-cmd-default (input)
-  "Return a shell command based on INPUT."
-  (counsel-require-program "locate")
-  (format "locate -i --regex '%s'"
-          (counsel-unquote-regex-parens
-           (ivy--regex input))))
-
-(defun counsel-locate-cmd-noregex (input)
-  "Return a shell command based on INPUT."
-  (counsel-require-program "locate")
-  (format "locate -i '%s'" input))
-
-(defun counsel-locate-cmd-mdfind (input)
-  "Return a shell command based on INPUT."
-  (counsel-require-program "mdfind")
-  (format "mdfind -name '%s'" input))
-
-(defun counsel-locate-cmd-es (input)
-  "Return a shell command based on INPUT."
-  (counsel-require-program "es.exe")
-  (format "es.exe -i -r %s"
-          (counsel-unquote-regex-parens
-           (ivy--regex input t))))
-
-(defun counsel-locate-function (input)
-  "Call the \"locate\" shell command with INPUT."
-  (if (< (length input) 3)
-      (counsel-more-chars 3)
-    (counsel--async-command
-     (funcall counsel-locate-cmd input))
-    '("" "working...")))
-
-;;;###autoload
-(defun counsel-locate (&optional initial-input)
-  "Call the \"locate\" shell command.
-INITIAL-INPUT can be given as the initial minibuffer input."
-  (interactive)
-  (ivy-read "Locate: " #'counsel-locate-function
-            :initial-input initial-input
-            :dynamic-collection t
-            :history 'counsel-locate-history
-            :action (lambda (file)
-                      (with-ivy-window
-                        (when file
-                          (find-file file))))
-            :unwind #'counsel-delete-process
-            :caller 'counsel-locate))
-
-;;** `counsel-dpkg'
-;;;###autoload
-(defun counsel-dpkg ()
-  "Call the \"dpkg\" shell command."
-  (interactive)
-  (counsel-require-program "dpkg")
-  (let ((cands (mapcar
-                (lambda (x)
-                  (let ((y (split-string x "  +")))
-                    (cons (format "%-40s   %s"
-                                  (ivy--truncate-string
-                                   (nth 1 y) 40)
-                                  (nth 4 y))
-                          (mapconcat #'identity y " "))))
-                (split-string
-                 (shell-command-to-string "dpkg -l | tail -n+6") "\n" t))))
-    (ivy-read "dpkg: " cands
-              :action (lambda (x)
-                        (message (cdr x)))
-              :caller 'counsel-dpkg)))
-
-;;** `counsel-rpm'
-;;;###autoload
-(defun counsel-rpm ()
-  "Call the \"rpm\" shell command."
-  (interactive)
-  (counsel-require-program "rpm")
-  (let ((cands (mapcar
-                (lambda (x)
-                  (let ((y (split-string x "|")))
-                    (cons (format "%-40s   %s"
-                                  (ivy--truncate-string
-                                   (nth 0 y) 40)
-                                  (nth 1 y))
-                          (mapconcat #'identity y " "))))
-                (split-string
-                 (shell-command-to-string "rpm -qa --qf \"%{NAME}|%{SUMMARY}\\n\"") "\n" t))))
-    (ivy-read "rpm: " cands
-              :action (lambda (x)
-                        (message (cdr x)))
-              :caller 'counsel-rpm)))
-
-;;** File Jump and Dired Jump
-
-;;;###autoload
-(defun counsel-file-jump (&optional initial-input initial-directory)
-  "Jump to a file below the current directory.
-List all files within the current directory or any of its subdirectories.
-INITIAL-INPUT can be given as the initial minibuffer input.
-INITIAL-DIRECTORY, if non-nil, is used as the root directory for search."
-  (interactive
-   (list nil
-         (when current-prefix-arg
-           (read-directory-name "From directory: "))))
-  (counsel-require-program "find")
-  (let* ((default-directory (or initial-directory default-directory)))
-    (ivy-read "Find file: "
-              (split-string
-               (shell-command-to-string
-                (concat find-program " * -type f -not -path '*\/.git*'"))
-               "\n" t)
-              :matcher #'counsel--find-file-matcher
-              :initial-input initial-input
-              :action (lambda (x)
-                        (with-ivy-window
-                          (find-file (expand-file-name x ivy--directory))))
-              :preselect (when counsel-find-file-at-point
-                           (require 'ffap)
-                           (let ((f (ffap-guesser)))
-                             (when f (expand-file-name f))))
-              :require-match 'confirm-after-completion
-              :history 'file-name-history
-              :keymap counsel-find-file-map
-              :caller 'counsel-file-jump)))
-
-;;;###autoload
-(defun counsel-dired-jump (&optional initial-input initial-directory)
-  "Jump to a directory (in dired) below the current directory.
-List all subdirectories within the current directory.
-INITIAL-INPUT can be given as the initial minibuffer input.
-INITIAL-DIRECTORY, if non-nil, is used as the root directory for search."
-  (interactive
-   (list nil
-         (when current-prefix-arg
-           (read-directory-name "From directory: "))))
-  (counsel-require-program "find")
-  (let* ((default-directory (or initial-directory default-directory)))
-    (ivy-read "Directory: "
-              (split-string
-               (shell-command-to-string
-                (concat find-program " * -type d -not -path '*\/.git*'"))
-               "\n" t)
-              :initial-input initial-input
-              :action (lambda (d) (dired-jump nil (expand-file-name d)))
-              :caller 'counsel-dired-jump)))
-
-;;* Grep
-(defun counsel--grep-mode-occur (git-grep-dir-is-file)
-  "Generate a custom occur buffer for grep like commands.
-If GIT-GREP-DIR-IS-FILE is t, then `counsel--git-dir' is treated as a full
-path to a file rather than a directory (e.g. for `counsel-grep-occur').
-
-This function expects that the candidates have already been filtered.
-It applies no filtering to ivy--all-candidates."
-  (unless (eq major-mode 'ivy-occur-grep-mode)
-    (ivy-occur-grep-mode))
-  (let* ((directory
-          (if git-grep-dir-is-file
-              (file-name-directory counsel--git-dir)
-            counsel--git-dir))
-         (prepend
-          (if git-grep-dir-is-file
-              (concat (file-name-nondirectory counsel--git-dir) ":")
-            "")))
-    (setq default-directory directory)
-    ;; Need precise number of header lines for `wgrep' to work.
-    (insert (format "-*- mode:grep; default-directory: %S -*-\n\n\n" default-directory))
-    (insert (format "%d candidates:\n" (length ivy--all-candidates)))
-    (ivy--occur-insert-lines
-     (mapcar (lambda (cand) (concat "./" prepend cand)) ivy--all-candidates))))
-
-;;** `counsel-ag'
-(defvar counsel-ag-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "C-l") 'ivy-call-and-recenter)
-    (define-key map (kbd "M-q") 'counsel-git-grep-query-replace)
-    map))
-
-(defcustom counsel-ag-base-command "ag --nocolor --nogroup %s"
-  "Format string to use in `counsel-ag-function' to construct the command.
-The %s will be replaced by optional extra ag arguments followed by the
-regex string.  The default is \"ag --nocolor --nogroup %s\"."
-  :type 'string
-  :group 'ivy)
-
-(counsel-set-async-exit-code 'counsel-ag 1 "No matches found")
-(ivy-set-occur 'counsel-ag 'counsel-ag-occur)
-(ivy-set-display-transformer 'counsel-ag 'counsel-git-grep-transformer)
-
-(defun counsel-ag-function (string base-cmd extra-ag-args)
-  "Grep in the current directory for STRING using BASE-CMD.
-If non-nil, append EXTRA-AG-ARGS to BASE-CMD."
-  (when (null extra-ag-args)
-    (setq extra-ag-args ""))
-  (if (< (length string) 3)
-      (counsel-more-chars 3)
-    (let ((default-directory counsel--git-dir)
-          (regex (counsel-unquote-regex-parens
-                  (setq ivy--old-re
-                        (ivy--regex string)))))
-      (let* ((args-end (string-match " -- " extra-ag-args))
-             (file (if args-end
-                       (substring-no-properties extra-ag-args (+ args-end 3))
-                     ""))
-             (extra-ag-args (if args-end
-                                (substring-no-properties extra-ag-args 0 args-end)
-                              extra-ag-args))
-             (ag-cmd (format base-cmd
-                             (concat extra-ag-args
-                                     " -- "
-                                     (shell-quote-argument regex)
-                                     file))))
-        (if (file-remote-p default-directory)
-            (split-string (shell-command-to-string ag-cmd) "\n" t)
-          (counsel--async-command ag-cmd)
-          nil)))))
-
-;;;###autoload
-(defun counsel-ag (&optional initial-input initial-directory extra-ag-args ag-prompt)
-  "Grep for a string in the current directory using ag.
-INITIAL-INPUT can be given as the initial minibuffer input.
-INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
-EXTRA-AG-ARGS string, if non-nil, is appended to `counsel-ag-base-command'.
-AG-PROMPT, if non-nil, is passed as `ivy-read' prompt argument."
-  (interactive)
-  (counsel-require-program (car (split-string counsel-ag-base-command)))
-  (when current-prefix-arg
-    (setq initial-directory
-          (or initial-directory
-              (read-directory-name (concat
-                                    (car (split-string counsel-ag-base-command))
-                                    " in directory: "))))
-    (setq extra-ag-args
-          (or extra-ag-args
-              (let* ((pos (cl-position ?  counsel-ag-base-command))
-                     (command (substring-no-properties counsel-ag-base-command 0 pos))
-                     (ag-args (replace-regexp-in-string
-                               "%s" "" (substring-no-properties counsel-ag-base-command pos))))
-                (read-string (format "(%s) args:" command) ag-args)))))
-  (ivy-set-prompt 'counsel-ag counsel-prompt-function)
-  (setq counsel--git-dir (or initial-directory default-directory))
-  (ivy-read (or ag-prompt (car (split-string counsel-ag-base-command)))
-            (lambda (string)
-              (counsel-ag-function string counsel-ag-base-command extra-ag-args))
-            :initial-input initial-input
-            :dynamic-collection t
-            :keymap counsel-ag-map
-            :history 'counsel-git-grep-history
-            :action #'counsel-git-grep-action
-            :unwind (lambda ()
-                      (counsel-delete-process)
-                      (swiper--cleanup))
-            :caller 'counsel-ag))
-
-(defun counsel-ag-occur ()
-  "Generate a custom occur buffer for `counsel-ag'."
-  (counsel--grep-mode-occur nil))
-
-;;** `counsel-pt'
-(defcustom counsel-pt-base-command "pt --nocolor --nogroup -e %s"
-  "Alternative to `counsel-ag-base-command' using pt."
-  :type 'string
-  :group 'ivy)
-
-;;;###autoload
-(defun counsel-pt (&optional initial-input)
-  "Grep for a string in the current directory using pt.
-INITIAL-INPUT can be given as the initial minibuffer input.
-This uses `counsel-ag' with `counsel-pt-base-command' instead of
-`counsel-ag-base-command'."
-  (interactive)
-  (let ((counsel-ag-base-command counsel-pt-base-command))
-    (counsel-ag initial-input)))
-
-;;** `counsel-ack'
-(defcustom counsel-ack-base-command
-  (concat
-   (file-name-nondirectory
-    (or (executable-find "ack-grep") "ack"))
-   " --nocolor --nogroup %s")
-  "Alternative to `counsel-ag-base-command' using ack."
-  :type 'string
-  :group 'ivy)
-
-;;;###autoload
-(defun counsel-ack (&optional initial-input)
-  "Grep for a string in the current directory using ack.
-INITIAL-INPUT can be given as the initial minibuffer input.
-This uses `counsel-ag' with `counsel-ack-base-command' replacing
-`counsel-ag-base-command'."
-  (interactive)
-  (let ((counsel-ag-base-command counsel-ack-base-command))
-    (counsel-ag initial-input)))
-
-
-;;** `counsel-rg'
-(defcustom counsel-rg-base-command "rg -i --no-heading --line-number --color never %s ."
-  "Alternative to `counsel-ag-base-command' using ripgrep."
-  :type 'string
-  :group 'ivy)
-
-(counsel-set-async-exit-code 'counsel-rg 1 "No matches found")
-(ivy-set-occur 'counsel-rg 'counsel-rg-occur)
-(ivy-set-display-transformer 'counsel-rg 'counsel-git-grep-transformer)
-
-;;;###autoload
-(defun counsel-rg (&optional initial-input initial-directory extra-rg-args rg-prompt)
-  "Grep for a string in the current directory using rg.
-INITIAL-INPUT can be given as the initial minibuffer input.
-INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
-EXTRA-RG-ARGS string, if non-nil, is appended to `counsel-rg-base-command'.
-RG-PROMPT, if non-nil, is passed as `ivy-read' prompt argument."
-  (interactive
-   (list nil
-         (when current-prefix-arg
-           (read-directory-name (concat
-                                 (car (split-string counsel-rg-base-command))
-                                 " in directory: ")))))
-  (counsel-require-program (car (split-string counsel-rg-base-command)))
-  (ivy-set-prompt 'counsel-rg counsel-prompt-function)
-  (setq counsel--git-dir (or initial-directory
-                             (locate-dominating-file default-directory ".git")
-                             default-directory))
-  (ivy-read (or rg-prompt (car (split-string counsel-rg-base-command)))
-            (lambda (string)
-              (counsel-ag-function string counsel-rg-base-command extra-rg-args))
-            :initial-input initial-input
-            :dynamic-collection t
-            :keymap counsel-ag-map
-            :history 'counsel-git-grep-history
-            :action #'counsel-git-grep-action
-            :unwind (lambda ()
-                      (counsel-delete-process)
-                      (swiper--cleanup))
-            :caller 'counsel-rg))
-
-(defun counsel-rg-occur ()
-  "Generate a custom occur buffer for `counsel-rg'."
-  (counsel--grep-mode-occur nil))
-
-;;** `counsel-grep'
-(defcustom counsel-grep-base-command "grep -nE '%s' %s"
-  "Format string to use in `cousel-grep-function' to construct the command."
-  :type 'string
-  :group 'ivy)
-
-(defun counsel-grep-function (string)
-  "Grep in the current directory for STRING."
-  (if (< (length string) 2)
-      (counsel-more-chars 2)
-    (let ((regex (counsel-unquote-regex-parens
-                  (setq ivy--old-re
-                        (ivy--regex string)))))
-      (counsel--async-command
-       (format counsel-grep-base-command regex
-               (shell-quote-argument counsel--git-dir)))
-      nil)))
-
-(defun counsel-grep-action (x)
-  "Go to candidate X."
-  (with-ivy-window
-    (swiper--cleanup)
-    (let ((default-directory (file-name-directory counsel--git-dir))
-          file-name line-number)
-      (when (cond ((string-match "\\`\\([0-9]+\\):\\(.*\\)\\'" x)
-                   (setq file-name counsel--git-dir)
-                   (setq line-number (match-string-no-properties 1 x)))
-                  ((string-match "\\`\\([^:]+\\):\\([0-9]+\\):\\(.*\\)\\'" x)
-                   (setq file-name (match-string-no-properties 1 x))
-                   (setq line-number (match-string-no-properties 2 x)))
-                  (t nil))
-        ;; If the file buffer is already open, just get it. Prevent doing
-        ;; `find-file', as that file could have already been opened using
-        ;; `find-file-literally'.
-        (let ((buf (get-file-buffer file-name)))
-          (unless buf
-            (setq buf (find-file file-name)))
-          (with-current-buffer buf
-            (setq line-number (string-to-number line-number))
-            (if (null counsel-grep-last-line)
-                (progn
-                  (goto-char (point-min))
-                  (forward-line (1- (setq counsel-grep-last-line line-number))))
-              (forward-line (- line-number counsel-grep-last-line))
-              (setq counsel-grep-last-line line-number))
-            (re-search-forward (ivy--regex ivy-text t) (line-end-position) t)
-            (run-hooks 'counsel-grep-post-action-hook)
-            (if (eq ivy-exit 'done)
-                (swiper--ensure-visible)
-              (isearch-range-invisible (line-beginning-position)
-                                       (line-end-position))
-              (swiper--add-overlays (ivy--regex ivy-text)))))))))
-
-(defun counsel-grep-occur ()
-  "Generate a custom occur buffer for `counsel-grep'."
-  (counsel--grep-mode-occur t))
-
-(ivy-set-occur 'counsel-grep 'counsel-grep-occur)
-(counsel-set-async-exit-code 'counsel-grep 1 "")
-
-;;;###autoload
-(defun counsel-grep ()
-  "Grep for a string in the current file."
-  (interactive)
-  (counsel-require-program (car (split-string counsel-grep-base-command)))
-  (setq counsel-grep-last-line nil)
-  (setq counsel--git-dir (buffer-file-name))
-  (let ((init-point (point))
-        res)
-    (unwind-protect
-         (setq res (ivy-read "grep: " 'counsel-grep-function
-                             :dynamic-collection t
-                             :preselect (format "%d:%s"
-                                                (line-number-at-pos)
-                                                (regexp-quote
-                                                 (buffer-substring-no-properties
-                                                  (line-beginning-position)
-                                                  (line-end-position))))
-                             :history 'counsel-git-grep-history
-                             :update-fn (lambda ()
-                                          (counsel-grep-action (ivy-state-current ivy-last)))
-                             :re-builder #'ivy--regex
-                             :action #'counsel-grep-action
-                             :unwind (lambda ()
-                                       (counsel-delete-process)
-                                       (swiper--cleanup))
-                             :caller 'counsel-grep))
-      (unless res
-        (goto-char init-point)))))
-
-;;** `counsel-grep-or-swiper'
-(defcustom counsel-grep-swiper-limit 300000
-  "When the buffer is larger than this, use `counsel-grep' instead of `swiper'."
-  :type 'integer
-  :group 'ivy)
-
-(defvar counsel-compressed-file-regex
-  (progn
-    (require 'jka-compr nil t)
-    (jka-compr-build-file-regexp))
-  "Store the regex for compressed file names.")
-
-;;;###autoload
-(defun counsel-grep-or-swiper ()
-  "Call `swiper' for small buffers and `counsel-grep' for large ones."
-  (interactive)
-  (let ((fname (buffer-file-name)))
-    (if (and fname
-             (not (buffer-narrowed-p))
-             (not (ignore-errors
-                    (file-remote-p fname)))
-             (not (string-match
-                   counsel-compressed-file-regex
-                   fname))
-             (> (buffer-size)
-                (if (eq major-mode 'org-mode)
-                    (/ counsel-grep-swiper-limit 4)
-                  counsel-grep-swiper-limit)))
-        (progn
-          (when (file-writable-p fname)
-            (save-buffer))
-          (counsel-grep))
-      (swiper--ivy (swiper--candidates)))))
-
-;;** `counsel-recoll'
-(defun counsel-recoll-function (string)
-  "Run recoll for STRING."
-  (if (< (length string) 3)
-      (counsel-more-chars 3)
-    (counsel--async-command
-     (format "recoll -t -b %s"
-             (shell-quote-argument string)))
-    nil))
-
-;; This command uses the recollq command line tool that comes together
-;; with the recoll (the document indexing database) source:
-;;     http://www.lesbonscomptes.com/recoll/download.html
-;; You need to build it yourself (together with recoll):
-;;     cd ./query && make && sudo cp recollq /usr/local/bin
-;; You can try the GUI version of recoll with:
-;;     sudo apt-get install recoll
-;; Unfortunately, that does not install recollq.
-(defun counsel-recoll (&optional initial-input)
-  "Search for a string in the recoll database.
-You'll be given a list of files that match.
-Selecting a file will launch `swiper' for that file.
-INITIAL-INPUT can be given as the initial minibuffer input."
-  (interactive)
-  (counsel-require-program "recoll")
-  (ivy-read "recoll: " 'counsel-recoll-function
-            :initial-input initial-input
-            :dynamic-collection t
-            :history 'counsel-git-grep-history
-            :action (lambda (x)
-                      (when (string-match "file://\\(.*\\)\\'" x)
-                        (let ((file-name (match-string 1 x)))
-                          (find-file file-name)
-                          (unless (string-match "pdf$" x)
-                            (swiper ivy-text)))))
-            :unwind #'counsel-delete-process
-            :caller 'counsel-recoll))
-;;* Misc Emacs
-;;** `counsel-org-tag'
-(defvar counsel-org-tags nil
-  "Store the current list of tags.")
-
-(defvar org-outline-regexp)
-(defvar org-indent-mode)
-(defvar org-indent-indentation-per-level)
-(defvar org-tags-column)
-(declare-function org-get-tags-string "org")
-(declare-function org-move-to-column "org-compat")
-
-(defun counsel-org-change-tags (tags)
-  "Change tags of current org headline to TAGS."
-  (let ((current (org-get-tags-string))
-        (col (current-column))
-        level)
-    ;; Insert new tags at the correct column
-    (beginning-of-line 1)
-    (setq level (or (and (looking-at org-outline-regexp)
-                         (- (match-end 0) (point) 1))
-                    1))
-    (cond
-      ((and (equal current "") (equal tags "")))
-      ((re-search-forward
-        (concat "\\([ \t]*" (regexp-quote current) "\\)[ \t]*$")
-        (point-at-eol) t)
-       (if (equal tags "")
-           (delete-region
-            (match-beginning 0)
-            (match-end 0))
-         (goto-char (match-beginning 0))
-         (let* ((c0 (current-column))
-                ;; compute offset for the case of org-indent-mode active
-                (di (if (bound-and-true-p org-indent-mode)
-                        (* (1- org-indent-indentation-per-level) (1- level))
-                      0))
-                (p0 (if (equal (char-before) ?*) (1+ (point)) (point)))
-                (tc (+ org-tags-column (if (> org-tags-column 0) (- di) di)))
-                (c1 (max (1+ c0) (if (> tc 0) tc (- (- tc) (string-width tags)))))
-                (rpl (concat (make-string (max 0 (- c1 c0)) ?\ ) tags)))
-           (replace-match rpl t t)
-           (and c0 indent-tabs-mode (tabify p0 (point)))
-           tags)))
-      (t (error "Tags alignment failed")))
-    (org-move-to-column col)))
-
-(defun counsel-org--set-tags ()
-  "Set tags of current org headline to `counsel-org-tags'."
-  (counsel-org-change-tags
-   (if counsel-org-tags
-       (format ":%s:"
-               (mapconcat #'identity counsel-org-tags ":"))
-     "")))
-
-(defvar org-agenda-bulk-marked-entries)
-
-(declare-function org-get-at-bol "org")
-(declare-function org-agenda-error "org-agenda")
-
-(defun counsel-org-tag-action (x)
-  "Add tag X to `counsel-org-tags'.
-If X is already part of the list, remove it instead.  Quit the selection if
-X is selected by either `ivy-done', `ivy-alt-done' or `ivy-immediate-done',
-otherwise continue prompting for tags."
-  (if (member x counsel-org-tags)
-      (progn
-        (setq counsel-org-tags (delete x counsel-org-tags)))
-    (unless (equal x "")
-      (setq counsel-org-tags (append counsel-org-tags (list x)))
-      (unless (member x ivy--all-candidates)
-        (setq ivy--all-candidates (append ivy--all-candidates (list x))))))
-  (let ((prompt (counsel-org-tag-prompt)))
-    (setf (ivy-state-prompt ivy-last) prompt)
-    (setq ivy--prompt (concat "%-4d " prompt)))
-  (cond ((memq this-command '(ivy-done
-                              ivy-alt-done
-                              ivy-immediate-done))
-         (if (eq major-mode 'org-agenda-mode)
-             (if (null org-agenda-bulk-marked-entries)
-                 (let ((hdmarker (or (org-get-at-bol 'org-hd-marker)
-                                     (org-agenda-error))))
-                   (with-current-buffer (marker-buffer hdmarker)
-                     (goto-char hdmarker)
-                     (counsel-org--set-tags)))
-               (let ((add-tags (copy-sequence counsel-org-tags)))
-                 (dolist (m org-agenda-bulk-marked-entries)
-                   (with-current-buffer (marker-buffer m)
-                     (save-excursion
-                       (goto-char m)
-                       (setq counsel-org-tags
-                             (delete-dups
-                              (append (split-string (org-get-tags-string) ":" t)
-                                      add-tags)))
-                       (counsel-org--set-tags))))))
-           (counsel-org--set-tags)))
-        ((eq this-command 'ivy-call)
-         (with-selected-window (active-minibuffer-window)
-           (delete-minibuffer-contents)))))
-
-(defun counsel-org-tag-prompt ()
-  "Return prompt for `counsel-org-tag'."
-  (format "Tags (%s): "
-          (mapconcat #'identity counsel-org-tags ", ")))
-
-(defvar org-setting-tags)
-(defvar org-last-tags-completion-table)
-(defvar org-tag-persistent-alist)
-(defvar org-tag-alist)
-(defvar org-complete-tags-always-offer-all-agenda-tags)
-
-(declare-function org-at-heading-p "org")
-(declare-function org-back-to-heading "org")
-(declare-function org-get-buffer-tags "org")
-(declare-function org-global-tags-completion-table "org")
-(declare-function org-agenda-files "org")
-(declare-function org-agenda-set-tags "org-agenda")
-
-;;;###autoload
-(defun counsel-org-tag ()
-  "Add or remove tags in `org-mode'."
-  (interactive)
-  (save-excursion
-    (if (eq major-mode 'org-agenda-mode)
-        (if org-agenda-bulk-marked-entries
-            (setq counsel-org-tags nil)
-          (let ((hdmarker (or (org-get-at-bol 'org-hd-marker)
-                              (org-agenda-error))))
-            (with-current-buffer (marker-buffer hdmarker)
-              (goto-char hdmarker)
-              (setq counsel-org-tags
-                    (split-string (org-get-tags-string) ":" t)))))
-      (unless (org-at-heading-p)
-        (org-back-to-heading t))
-      (setq counsel-org-tags (split-string (org-get-tags-string) ":" t)))
-    (let ((org-setting-tags t)
-          (org-last-tags-completion-table
-           (append org-tag-persistent-alist
-                   (or org-tag-alist (org-get-buffer-tags))
-                   (and
-                    (or org-complete-tags-always-offer-all-agenda-tags
-                        (eq major-mode 'org-agenda-mode))
-                    (org-global-tags-completion-table
-                     (org-agenda-files))))))
-      (ivy-read (counsel-org-tag-prompt)
-                (lambda (str &rest _unused)
-                  (delete-dups
-                   (all-completions str 'org-tags-completion-function)))
-                :history 'org-tags-history
-                :action 'counsel-org-tag-action
-                :caller 'counsel-org-tag))))
-
-;;;###autoload
-(defun counsel-org-tag-agenda ()
-  "Set tags for the current agenda item."
-  (interactive)
-  (let ((store (symbol-function 'org-set-tags)))
-    (unwind-protect
-         (progn
-           (fset 'org-set-tags
-                 (symbol-function 'counsel-org-tag))
-           (org-agenda-set-tags nil nil))
-      (fset 'org-set-tags store))))
-
-(defcustom counsel-org-goto-display-style 'path
-  "The style for displaying headlines in `counsel-org-goto' functions.
-
-If headline, the title and the leading stars are displayed.
-
-If path, the path hierarchy is displayed.  For each entry the title is shown.
-`counsel-org-goto-separator' is used as separator between entries.
-
-If title or any other value, only the title of the headline is displayed.
-
-Use `counsel-org-goto-display-tags' and `counsel-org-goto-display-todo' to
-display tags and todo keywords respectively."
-  :type '(choice
-          (const :tag "Title only" title)
-          (const :tag "Headline" headline)
-          (const :tag "Path" path))
-  :group 'ivy)
-
-(defcustom counsel-org-goto-separator "/"
-  "Character(s) to separate path entries in `counsel-org-goto' functions.
-This variable has no effect unless `counsel-org-goto-display-style' is
-set to path."
-  :type 'string
-  :group 'ivy)
-
-(defcustom counsel-org-goto-display-tags nil
-  "If non-nil, display tags in `counsel-org-goto' functions."
-  :type 'boolean
-  :group 'ivy)
-
-(defcustom counsel-org-goto-display-todo nil
-  "If non-nil, display todo keywords in `counsel-org-goto' functions."
-  :type 'boolean
-  :group 'ivy)
-
-(defcustom counsel-org-goto-face-style nil
-  "The face used for displaying headlines in `counsel-org-goto' functions.
-
-If org, the default faces from `org-mode' are applied, i.e. org-level-1
-through org-level-8.  Note that no cycling is in effect, therefore headlines
-on levels 9 and higher will not be styled.
-
-If verbatim, the face used in the buffer is applied.  For simple headlines
-this is usually the same as org except that it depends on how much of the
-buffer has been completely loaded.  If your buffer exceeds a certain size,
-headlines are styled lazily depending on which parts of the tree are visible.
-Headlines which are not styled yet in the buffer will appear unstyled in the
-minibuffer as well.  If your headlines contain parts which are fontified
-differently than the headline itself (eg. todo keywords, tags, links) and you
-want these parts to be styled properly, verbatim is the way to go, otherwise
-you are probably better off using org instead.
-
-If custom, the faces defined in `counsel-org-goto-custom-faces' are applied.
-Note that no cycling is in effect, therefore if there is no face defined
-for a certain level, headlines on that level will not be styled.
-
-If nil or any other value, no face is applied to the headline.
-
-See `counsel-org-goto-display-tags' and `counsel-org-goto-display-todo' if
-you want to display tags and todo keywords in your headlines."
-  :type '(choice
-          (const :tag "Same as org-mode" org)
-          (const :tag "Verbatim" verbatim)
-          (const :tag "Custom" custom))
-  :group 'ivy)
-
-(defcustom counsel-org-goto-custom-faces nil
-  "Custom faces for displaying headlines in `counsel-org-goto' functions.
-
-The n-th entry is used for headlines on level n, starting with n = 1.  If
-a headline is an a level for which there is no entry in the list, it will
-not be styled.
-
-This variable has no effect unless `counsel-org-goto-face-style' is set
-to custom."
-  :type '(repeat face)
-  :group 'ivy)
-
-(declare-function org-get-heading "org")
-(declare-function org-goto-marker-or-bmk "org")
-(declare-function outline-next-heading "outline")
-
-;;;###autoload
-(defun counsel-org-goto ()
-  "Go to a different location in the current file."
-  (interactive)
-  (let ((entries (counsel-org-goto--get-headlines)))
-    (ivy-read "Goto: "
-              entries
-              :history 'counsel-org-goto-history
-              :action 'counsel-org-goto-action
-              :caller 'counsel-org-goto)))
-
-;;;###autoload
-(defun counsel-org-goto-all ()
-  "Go to a different location in any org file."
-  (interactive)
-  (let (entries)
-    (dolist (b (buffer-list))
-      (with-current-buffer b
-        (when (derived-mode-p 'org-mode)
-          (if entries
-              (nconc entries (counsel-org-goto--get-headlines))
-            (setq entries (counsel-org-goto--get-headlines))))))
-    (ivy-read "Goto: "
-              entries
-              :history 'counsel-org-goto-history
-              :action 'counsel-org-goto-action
-              :caller 'counsel-org-goto-all)))
-
-(defun counsel-org-goto-action (x)
-  "Go to headline in candidate X."
-  (org-goto-marker-or-bmk (cdr x)))
-
-(defun counsel-org-goto--get-headlines ()
-  "Get all headlines from the current org buffer."
-  (save-excursion
-    (let (entries
-          start-pos
-          stack
-          (stack-level 0))
-      (goto-char (point-min))
-      (setq start-pos (or (and (org-at-heading-p)
-                               (point))
-                          (outline-next-heading)))
-      (while start-pos
-        (let ((name (org-get-heading
-                     (not counsel-org-goto-display-tags)
-                     (not counsel-org-goto-display-todo)))
-              level)
-          (search-forward " ")
-          (setq level
-                (- (length (buffer-substring-no-properties start-pos (point)))
-                   1))
-          (cond ((eq counsel-org-goto-display-style 'path)
-                 ;; Update stack. The empty entry guards against incorrect
-                 ;; headline hierarchies e.g. a level 3 headline immediately
-                 ;; following a level 1 entry.
-                 (while (<= level stack-level)
-                   (pop stack)
-                   (cl-decf stack-level))
-                 (while (> level stack-level)
-                   (push "" stack)
-                   (cl-incf stack-level))
-                 (setf (car stack) (counsel-org-goto--add-face name level))
-                 (setq name (mapconcat
-                             #'identity
-                             (reverse stack)
-                             counsel-org-goto-separator)))
-                (t
-                 (when (eq counsel-org-goto-display-style 'headline)
-                   (setq name (concat (make-string level ?*) " " name)))
-                 (setq name (counsel-org-goto--add-face name level))))
-          (push (cons name (point-marker)) entries))
-        (setq start-pos (outline-next-heading)))
-      (nreverse entries))))
-
-(defun counsel-org-goto--add-face (name level)
-  "Add face to headline NAME on LEVEL.
-The face can be customized through `counsel-org-goto-face-style'."
-  (or (and (eq counsel-org-goto-face-style 'org)
-           (propertize
-            name
-            'face
-            (concat "org-level-" (number-to-string level))))
-      (and (eq counsel-org-goto-face-style 'verbatim)
-           name)
-      (and (eq counsel-org-goto-face-style 'custom)
-           (propertize
-            name
-            'face
-            (nth (1- level) counsel-org-goto-custom-faces)))
-      (propertize name 'face 'minibuffer-prompt)))
-
-;;** `counsel-mark-ring'
-(defun counsel--pad (string length)
-  "Pad STRING to LENGTH with spaces."
-  (let ((padding (max 0 (- length (length string)))))
-    (concat string (make-string padding ?\s))))
-
-(defun counsel-mark-ring ()
-  "Browse `mark-ring' interactively."
-  (interactive)
-  (let ((candidates
-         (with-current-buffer (current-buffer)
-           (let ((padding (length (format "%s: " (line-number-at-pos (eobp))))))
-             (save-mark-and-excursion
-              (goto-char (point-min))
-              (sort (mapcar (lambda (mark)
-                              (let* ((position (marker-position mark))
-                                     (line-number (line-number-at-pos position))
-                                     (line-marker (counsel--pad (format "%s:" line-number) padding))
-                                     (bol (point-at-bol line-number))
-                                     (eol (point-at-eol line-number))
-                                     (line (buffer-substring bol eol)))
-                                (cons (format "%s%s" line-marker line) position)))
-                            (cl-remove-duplicates mark-ring :test #'equal))
-                    (lambda (m1 m2)
-                      (< (cdr m1) (cdr m2)))))))))
-    (ivy-read "Marks: " candidates
-              :action (lambda (elem)
-                        (goto-char (cdr elem))))))
-
-;;** `counsel-package'
-(defvar package--initialized)
-(defvar package-alist)
-(defvar package-archive-contents)
-(declare-function package-installed-p "package")
-(declare-function package-delete "package")
-
-(defun counsel-package ()
-  "Install or delete packages.
-
-Packages not currently installed have a \"+\" prepended.  Selecting one
-of these will try to install it.  Currently installed packages have a
-\"-\" prepended, and selecting one of these will delete the package.
-
-Additional Actions:
-
-  \\<ivy-minibuffer-map>\\[ivy-dispatching-done] d: describe package"
-  (interactive)
-  (unless package--initialized
-    (package-initialize t))
-  (unless package-archive-contents
-    (package-refresh-contents))
-  (let ((cands (mapcar #'counsel-package-make-package-cell
-                       package-archive-contents)))
-    (ivy-read "Packages (install +pkg or delete -pkg): "
-              (cl-sort cands #'counsel--package-sort)
-              :action #'counsel-package-action
-              :initial-input "^+ "
-              :require-match t
-              :caller 'counsel-package)))
-
-(defun counsel-package-make-package-cell (pkg)
-  "Make candidate for package PKG."
-  (let* ((pkg-sym (car pkg))
-         (pkg-name (symbol-name pkg-sym)))
-    (cons (format "%s%s"
-                  (if (package-installed-p pkg-sym) "-" "+")
-                  pkg-name)
-          pkg)))
-
-(defun counsel-package-action (pkg-cons)
-  "Delete or install package in PKG-CONS."
-  (let ((pkg (cadr pkg-cons)))
-    (if (package-installed-p pkg)
-        (package-delete
-         (cadr (assoc pkg package-alist)))
-      (package-install pkg))))
-
-(defun counsel-package-action-describe (pkg-cons)
-  "Call `describe-package' for package in PKG-CONS."
-  (describe-package (cadr pkg-cons)))
-
-(declare-function package-desc-extras "package")
-
-(defun counsel-package-action-homepage (pkg-cons)
-  "Open homepage for package in PKG-CONS."
-  (let* ((desc-list (cddr pkg-cons))
-         (desc (if (listp desc-list) (car desc-list) desc-list))
-         (url (cdr (assoc :url (package-desc-extras desc)))))
-    (when url
-      (require 'browse-url)
-      (browse-url url))))
-
-(defun counsel--package-sort (a b)
-  "Sort function for `counsel-package'.
-A is the left hand side, B the right hand side."
-  (let* ((a (car a))
-         (b (car b))
-         (a-inst (equal (substring a 0 1) "+"))
-         (b-inst (equal (substring b 0 1) "+")))
-    (or (and a-inst (not b-inst))
-        (and (eq a-inst b-inst) (string-lessp a b)))))
-
-(ivy-set-actions 'counsel-package
-                 '(("d" counsel-package-action-describe "describe package")
-                   ("h" counsel-package-action-homepage "open package homepage")))
-
-;;** `counsel-tmm'
-(defvar tmm-km-list nil)
-(declare-function tmm-get-keymap "tmm")
-(declare-function tmm--completion-table "tmm")
-(declare-function tmm-get-keybind "tmm")
-
-(defun counsel-tmm-prompt (menu)
-  "Select and call an item from the MENU keymap."
-  (let (out
-        choice
-        chosen-string)
-    (setq tmm-km-list nil)
-    (map-keymap (lambda (k v) (tmm-get-keymap (cons k v))) menu)
-    (setq tmm-km-list (nreverse tmm-km-list))
-    (setq out (ivy-read "Menu bar: " (tmm--completion-table tmm-km-list)
-                        :require-match t
-                        :sort nil))
-    (setq choice (cdr (assoc out tmm-km-list)))
-    (setq chosen-string (car choice))
-    (setq choice (cdr choice))
-    (cond ((keymapp choice)
-           (counsel-tmm-prompt choice))
-          ((and choice chosen-string)
-           (setq last-command-event chosen-string)
-           (call-interactively choice)))))
-
-(defvar tmm-table-undef)
-
-;;;###autoload
-(defun counsel-tmm ()
-  "Text-mode emulation of looking and choosing from a menubar."
-  (interactive)
-  (require 'tmm)
-  (run-hooks 'menu-bar-update-hook)
-  (setq tmm-table-undef nil)
-  (counsel-tmm-prompt (tmm-get-keybind [menu-bar])))
-
-;;** `counsel-yank-pop'
-(defun counsel--yank-pop-truncate (str)
-  "Truncate STR for use in `counsel-yank-pop'."
-  (condition-case nil
-      (let* ((lines (split-string str "\n" t))
-             (n (length lines))
-             (re (ivy-re-to-str ivy--old-re))
-             (first-match (cl-position-if
-                           (lambda (s) (string-match re s))
-                           lines))
-             (beg (max 0 (- first-match
-                            counsel-yank-pop-truncate-radius)))
-             (end (min n (+ first-match
-                            counsel-yank-pop-truncate-radius
-                            1)))
-             (seq (cl-subseq lines beg end)))
-        (if (null first-match)
-            (error "Could not match %s" str)
-          (when (> beg 0)
-            (setcar seq (concat "[...] " (car seq))))
-          (when (< end n)
-            (setcar (last seq)
-                    (concat (car (last seq)) " [...]")))
-          (mapconcat #'identity seq "\n")))
-    (error str)))
-
-(defcustom counsel-yank-pop-separator "\n"
-  "Separator for the kill ring strings in `counsel-yank-pop'."
-  :group 'ivy
-  :type 'string)
-
-(defun counsel--yank-pop-format-function (cand-pairs)
-  "Transform CAND-PAIRS into a string for `counsel-yank-pop'."
-  (ivy--format-function-generic
-   (lambda (str)
-     (mapconcat
-      (lambda (s)
-        (ivy--add-face s 'ivy-current-match))
-      (split-string
-       (counsel--yank-pop-truncate str) "\n" t)
-      "\n"))
-   (lambda (str)
-     (counsel--yank-pop-truncate str))
-   cand-pairs
-   counsel-yank-pop-separator))
-
-(defun counsel-yank-pop-action (s)
-  "Insert S into the buffer, overwriting the previous yank."
-  (with-ivy-window
-    (delete-region ivy-completion-beg
-                   ivy-completion-end)
-    (insert (substring-no-properties s))
-    (setq ivy-completion-end (point))))
-
-(defun counsel-yank-pop-action-remove (s)
-  "Remove S from the kill ring."
-  (setq kill-ring (delete s kill-ring)))
-
-;;;###autoload
-(defun counsel-yank-pop ()
-  "Ivy replacement for `yank-pop'."
-  (interactive)
-  (if (eq last-command 'yank)
-      (progn
-        (setq ivy-completion-end (point))
-        (setq ivy-completion-beg
-              (save-excursion
-                (search-backward (car kill-ring))
-                (point))))
-    (setq ivy-completion-beg (point))
-    (setq ivy-completion-end (point)))
-  (let ((candidates
-         (mapcar #'ivy-cleanup-string
-                 (cl-remove-if
-                  (lambda (s)
-                    (string-match "\\`[\n[:blank:]]*\\'" s))
-                  (delete-dups kill-ring)))))
-    (let ((ivy-format-function #'counsel--yank-pop-format-function)
-          (ivy-height 5))
-      (ivy-read "kill-ring: " candidates
-                :action 'counsel-yank-pop-action
-                :caller 'counsel-yank-pop))))
-
-(ivy-set-actions
- 'counsel-yank-pop
- '(("d" counsel-yank-pop-action-remove "delete")))
-
-;;** `counsel-imenu'
-(defvar imenu-auto-rescan)
-(defvar imenu-auto-rescan-maxout)
-(declare-function imenu--subalist-p "imenu")
-(declare-function imenu--make-index-alist "imenu")
-
-(defun counsel-imenu-get-candidates-from (alist &optional prefix)
-  "Create a list of (key . value) from ALIST.
-PREFIX is used to create the key."
-  (cl-mapcan (lambda (elm)
-               (if (imenu--subalist-p elm)
-                   (counsel-imenu-get-candidates-from
-                    (cl-loop for (e . v) in (cdr elm) collect
-                         (cons e (if (integerp v) (copy-marker v) v)))
-                    ;; pass the prefix to next recursive call
-                    (concat prefix (if prefix ".") (car elm)))
-                 (let ((key (concat
-                             (when prefix
-                               (concat
-                                (propertize prefix 'face 'compilation-info)
-                                ": "))
-                             (car elm))))
-                   (list (cons key
-                               ;; create a imenu candidate here
-                               (cons key (if (overlayp (cdr elm))
-                                             (overlay-start (cdr elm))
-                                           (cdr elm))))))))
-             alist))
-
-(defvar counsel-imenu-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "C-l") 'ivy-call-and-recenter)
-    map))
-
-;;;###autoload
-(defun counsel-imenu ()
-  "Jump to a buffer position indexed by imenu."
-  (interactive)
-  (unless (featurep 'imenu)
-    (require 'imenu nil t))
-  (let* ((imenu-auto-rescan t)
-         (imenu-auto-rescan-maxout (if current-prefix-arg
-                                       (buffer-size)
-                                     imenu-auto-rescan-maxout))
-         (items (imenu--make-index-alist t))
-         (items (delete (assoc "*Rescan*" items) items)))
-    (ivy-read "imenu items:" (counsel-imenu-get-candidates-from items)
-              :preselect (thing-at-point 'symbol)
-              :require-match t
-              :action (lambda (candidate)
-                        (with-ivy-window
-                          ;; In org-mode, (imenu candidate) will expand child node
-                          ;; after jump to the candidate position
-                          (imenu (cdr candidate))))
-              :keymap counsel-imenu-map
-              :caller 'counsel-imenu)))
-
-;;** `counsel-list-processes'
-(defun counsel-list-processes-action-delete (x)
-  "Delete process X."
-  (delete-process x)
-  (setf (ivy-state-collection ivy-last)
-        (setq ivy--all-candidates
-              (delete x ivy--all-candidates))))
-
-(defun counsel-list-processes-action-switch (x)
-  "Switch to buffer of process X."
-  (let* ((proc (get-process x))
-         (buf (and proc (process-buffer proc))))
-    (if buf
-        (switch-to-buffer buf)
-      (message "Process %s doesn't have a buffer" x))))
-
-;;;###autoload
-(defun counsel-list-processes ()
-  "Offer completion for `process-list'.
-The default action deletes the selected process.
-An extra action allows to switch to the process buffer."
-  (interactive)
-  (list-processes--refresh)
-  (ivy-read "Process: " (mapcar #'process-name (process-list))
-            :require-match t
-            :action
-            '(1
-              ("o" counsel-list-processes-action-delete "kill")
-              ("s" counsel-list-processes-action-switch "switch"))
-            :caller 'counsel-list-processes))
-
-;;** `counsel-ace-link'
-(defun counsel-ace-link ()
-  "Use Ivy completion for `ace-link'."
-  (interactive)
-  (let (collection action)
-    (cond ((eq major-mode 'Info-mode)
-           (setq collection 'ace-link--info-collect)
-           (setq action 'ace-link--info-action))
-          ((eq major-mode 'help-mode)
-           (setq collection 'ace-link--help-collect)
-           (setq action 'ace-link--help-action))
-          ((eq major-mode 'woman-mode)
-           (setq collection 'ace-link--woman-collect)
-           (setq action 'ace-link--woman-action))
-          ((eq major-mode 'eww-mode)
-           (setq collection 'ace-link--eww-collect)
-           (setq action 'ace-link--eww-action))
-          ((eq major-mode 'compilation-mode)
-           (setq collection 'ace-link--eww-collect)
-           (setq action 'ace-link--compilation-action))
-          ((eq major-mode 'org-mode)
-           (setq collection 'ace-link--org-collect)
-           (setq action 'ace-link--org-action)))
-    (if (null collection)
-        (error "%S is not supported" major-mode)
-      (ivy-read "Ace-Link: " (funcall collection)
-                :action (lambda (x) (funcall action (cdr x)))
-                :require-match t
-                :caller 'counsel-ace-link))))
-;;** `counsel-expression-history'
-;;;###autoload
-(defun counsel-expression-history ()
-  "Select an element of `read-expression-history'.
-And insert it into the minibuffer.  Useful during `eval-expression'."
-  (interactive)
-  (let ((enable-recursive-minibuffers t))
-    (ivy-read "Expr: " (delete-dups read-expression-history)
-              :action #'insert)))
-
-;;** `counsel-shell-command-history'
-;;;###autoload
-(defun counsel-shell-command-history ()
-  "Browse shell command history."
-  (interactive)
-  (ivy-read "cmd: " shell-command-history
-            :action #'insert
-            :caller 'counsel-shell-command-history))
-
-;;** `counsel-esh-history'
-(defun counsel--browse-history (elements)
-  "Use Ivy to navigate through ELEMENTS."
-  (setq ivy-completion-beg (point))
-  (setq ivy-completion-end (point))
-  (ivy-read "Symbol name: "
-            (delete-dups
-             (when (> (ring-size elements) 0)
-               (ring-elements elements)))
-            :action #'ivy-completion-in-region-action))
-
-(defvar eshell-history-ring)
-
-;;;###autoload
-(defun counsel-esh-history ()
-  "Browse Eshell history."
-  (interactive)
-  (require 'em-hist)
-  (counsel--browse-history eshell-history-ring))
-
-(defvar comint-input-ring)
-
-;;;###autoload
-(defun counsel-shell-history ()
-  "Browse shell history."
-  (interactive)
-  (require 'comint)
-  (counsel--browse-history comint-input-ring))
-
-;;** `counsel-hydra-heads'
-(defvar hydra-curr-body-fn)
-(declare-function hydra-keyboard-quit "ext:hydra")
-
-(defun counsel-hydra-heads ()
-  "Call a head of the current/last hydra."
-  (interactive)
-  (let* ((base (substring
-                (prin1-to-string hydra-curr-body-fn)
-                0 -4))
-         (heads (eval (intern (concat base "heads"))))
-         (keymap (eval (intern (concat base "keymap"))))
-         (head-names
-          (mapcar (lambda (x)
-                    (cons
-                     (if (nth 2 x)
-                         (format "[%s] %S (%s)" (nth 0 x) (nth 1 x) (nth 2 x))
-                       (format "[%s] %S" (nth 0 x) (nth 1 x)))
-                     (lookup-key keymap (kbd (nth 0 x)))))
-                  heads)))
-    (ivy-read "head: " head-names
-              :action (lambda (x) (call-interactively (cdr x))))
-    (hydra-keyboard-quit)))
-;;** `counsel-semantic'
-(declare-function semantic-tag-start "tag")
-(declare-function semantic-tag-of-class-p "tag")
-(declare-function semantic-fetch-tags "semantic")
-
-(defun counsel-semantic-action (tag)
-  "Got to semantic TAG."
-  (with-ivy-window
-    (goto-char (semantic-tag-start tag))))
-
-(defun counsel-semantic ()
-  "Jump to a semantic tag in the current buffer."
-  (interactive)
-  (let ((tags
-         (mapcar
-          (lambda (tag)
-            (if (semantic-tag-of-class-p tag 'function)
-                (cons
-                 (propertize
-                  (car tag)
-                  'face 'font-lock-function-name-face)
-                 (cdr tag))
-              tag))
-          (semantic-fetch-tags))))
-    (ivy-read "tag: " tags
-              :action 'counsel-semantic-action)))
-
-;;** `counsel-outline'
-(defun counsel-outline-candidates ()
-  "Return outline candidates."
-  (let (cands)
-    (save-excursion
-      (goto-char (point-min))
-      (while (re-search-forward outline-regexp nil t)
-        (skip-chars-forward " ")
-        (push (cons (buffer-substring-no-properties
-                     (point) (line-end-position))
-                    (line-beginning-position))
-              cands))
-      (nreverse cands))))
-
-(defun counsel-outline-action (x)
-  "Go to outline X."
-  (with-ivy-window
-    (goto-char (cdr x))))
-
-(defun counsel-outline ()
-  "Jump to outline with completion."
-  (interactive)
-  (ivy-read "outline: " (counsel-outline-candidates)
-            :action #'counsel-outline-action))
-
-;;* Misc OS
-;;** `counsel-rhythmbox'
-(declare-function dbus-call-method "dbus")
-(declare-function dbus-get-property "dbus")
-
-(defun counsel-rhythmbox-play-song (song)
-  "Let Rhythmbox play SONG."
-  (let ((service "org.gnome.Rhythmbox3")
-        (path "/org/mpris/MediaPlayer2")
-        (interface "org.mpris.MediaPlayer2.Player"))
-    (dbus-call-method :session service path interface
-                      "OpenUri" (cdr song))))
-
-(defun counsel-rhythmbox-enqueue-song (song)
-  "Let Rhythmbox enqueue SONG."
-  (let ((service "org.gnome.Rhythmbox3")
-        (path "/org/gnome/Rhythmbox3/PlayQueue")
-        (interface "org.gnome.Rhythmbox3.PlayQueue"))
-    (dbus-call-method :session service path interface
-                      "AddToQueue" (cdr song))))
-
-(defvar counsel-rhythmbox-history nil
-  "History for `counsel-rhythmbox'.")
-
-(defvar counsel-rhythmbox-songs nil)
-
-(defun counsel-rhythmbox-current-song ()
-  "Return the currently playing song title."
-  (ignore-errors
-    (let* ((entry (dbus-get-property
-                   :session
-                   "org.mpris.MediaPlayer2.rhythmbox"
-                   "/org/mpris/MediaPlayer2"
-                   "org.mpris.MediaPlayer2.Player"
-                   "Metadata"))
-           (artist (caar (cadr (assoc "xesam:artist" entry))))
-           (album (cl-caadr (assoc "xesam:album" entry)))
-           (title (cl-caadr (assoc "xesam:title" entry))))
-      (format "%s - %s - %s" artist album title))))
-
-;;;###autoload
-(defun counsel-rhythmbox ()
-  "Choose a song from the Rhythmbox library to play or enqueue."
-  (interactive)
-  (require 'dbus)
-  (unless counsel-rhythmbox-songs
-    (let* ((service "org.gnome.Rhythmbox3")
-           (path "/org/gnome/UPnP/MediaServer2/Library/all")
-           (interface "org.gnome.UPnP.MediaContainer2")
-           (nb-songs (dbus-get-property
-                      :session service path interface "ChildCount")))
-      (if (not nb-songs)
-          (error "Couldn't connect to Rhythmbox")
-        (setq counsel-rhythmbox-songs
-              (mapcar (lambda (x)
-                        (cons
-                         (format
-                          "%s - %s - %s"
-                          (cl-caadr (assoc "Artist" x))
-                          (cl-caadr (assoc "Album" x))
-                          (cl-caadr (assoc "DisplayName" x)))
-                         (cl-caaadr (assoc "URLs" x))))
-                      (dbus-call-method
-                       :session service path interface "ListChildren"
-                       0 nb-songs '("*")))))))
-  (ivy-read "Rhythmbox: " counsel-rhythmbox-songs
-            :history 'counsel-rhythmbox-history
-            :preselect (counsel-rhythmbox-current-song)
-            :action
-            '(1
-              ("p" counsel-rhythmbox-play-song "Play song")
-              ("e" counsel-rhythmbox-enqueue-song "Enqueue song"))
-            :caller 'counsel-rhythmbox))
-
-;;** `counsel-linux-app'
-(defcustom counsel-linux-apps-directories
-  '("/usr/local/share/applications/" "/usr/share/applications/")
-  "Directories in which to search for applications (.desktop files)."
-  :group 'counsel
-  :type '(list directory))
-
-(defcustom counsel-linux-app-format-function 'counsel-linux-app-format-function-default
-  "Function to format Linux application names the `counsel-linux-app' menu.
-The format function will be passed the application's name, comment, and command
-as arguments."
-  :group 'counsel
-  :type '(choice
-          (const :tag "Command : Name - Comment" counsel-linux-app-format-function-default)
-          (const :tag "Name - Comment (Command)" counsel-linux-app-format-function-name-first)
-          (const :tag "Name - Comment" counsel-linux-app-format-function-name-only)
-          (const :tag "Command" counsel-linux-app-format-function-command-only)
-          (function :tag "Custom")))
-
-(defvar counsel-linux-apps-faulty nil
-  "List of faulty desktop files.")
-
-(defvar counsel--linux-apps-cache nil
-  "Cache of desktop files data.")
-
-(defvar counsel--linux-apps-cached-files nil
-  "List of cached desktop files.")
-
-(defvar counsel--linux-apps-cache-timestamp nil
-  "Time when we last updated the cached application list.")
-
-(defvar counsel--linux-apps-cache-format-function nil
-  "The function used to format the cached Linux application menu.")
-
-(defun counsel-linux-app-format-function-default (name comment exec)
-  "Default Linux application name formatter.
-NAME is the name of the application, COMMENT its comment and EXEC
-the command to launch it."
-  (format "% -45s: %s%s"
-          (propertize exec 'face 'font-lock-builtin-face)
-          name
-          (if comment
-              (concat " - " comment)
-            "")))
-
-(defun counsel-linux-app-format-function-name-first (name comment exec)
-  "Format Linux application names with the NAME (and COMMENT) first.
-EXEC is the command to launch the application."
-  (format "%s%s (%s)"
-          name
-          (if comment
-              (concat " - " comment)
-            "")
-          (propertize exec 'face 'font-lock-builtin-face)))
-
-(defun counsel-linux-app-format-function-name-only (name comment _exec)
-  "Format Linux application names with the NAME (and COMMENT) only."
-  (format "%s%s"
-          name
-          (if comment
-              (concat " - " comment)
-            "")))
-
-(defun counsel-linux-app-format-function-command-only (_name _comment exec)
-  "Display only the command EXEC when formatting Linux application names."
-  exec)
-
-(defun counsel-linux-apps-list-desktop-files ()
-  "Return an alist of all Linux applications.
-Each list entry is a pair of (desktop-name . desktop-file).
-This function always returns its elements in a stable order."
-  (let ((hash (make-hash-table :test #'equal))
-        result)
-    (dolist (dir counsel-linux-apps-directories)
-      (when (file-exists-p dir)
-        (let ((dir (file-name-as-directory dir)))
-          (dolist (file (directory-files-recursively dir ".*\\.desktop$"))
-            (let ((id (subst-char-in-string ?/ ?- (file-relative-name file dir))))
-              (unless (gethash id hash)
-                (push (cons id file) result)
-                (puthash id file hash)))))))
-    result))
-
-(defun counsel-linux-apps-parse (desktop-entries-alist)
-  "Parse the given alist of Linux desktop entries.
-Each entry in DESKTOP-ENTRIES-ALIST is a pair of ((id . file-name)).
-Any desktop entries that fail to parse are recorded in
-`counsel-linux-apps-faulty'."
-  (let (result)
-    (setq counsel-linux-apps-faulty nil)
-    (dolist (entry desktop-entries-alist result)
-      (let ((id (car entry))
-            (file (cdr entry)))
-        (with-temp-buffer
-          (insert-file-contents file)
-          (goto-char (point-min))
-          (let ((start (re-search-forward "^\\[Desktop Entry\\] *$" nil t))
-                (end (re-search-forward "^\\[" nil t))
-                name comment exec)
-            (catch 'break
-              (unless start
-                (push file counsel-linux-apps-faulty)
-                (message "Warning: File %s has no [Desktop Entry] group" file)
-                (throw 'break nil))
-
-              (goto-char start)
-              (when (re-search-forward "^\\(Hidden\\|NoDisplay\\) *= *\\(1\\|true\\) *$" end t)
-                (throw 'break nil))
-              (setq name (match-string 1))
-
-              (goto-char start)
-              (unless (re-search-forward "^Type *= *Application *$" end t)
-                (throw 'break nil))
-              (setq name (match-string 1))
-
-              (goto-char start)
-              (unless (re-search-forward "^Name *= *\\(.+\\)$" end t)
-                (push file counsel-linux-apps-faulty)
-                (message "Warning: File %s has no Name" file)
-                (throw 'break nil))
-              (setq name (match-string 1))
-
-              (goto-char start)
-              (when (re-search-forward "^Comment *= *\\(.+\\)$" end t)
-                (setq comment (match-string 1)))
-
-              (goto-char start)
-              (unless (re-search-forward "^Exec *= *\\(.+\\)$" end t)
-                ;; Don't warn because this can technically be a valid desktop file.
-                (throw 'break nil))
-              (setq exec (match-string 1))
-
-              (goto-char start)
-              (when (re-search-forward "^TryExec *= *\\(.+\\)$" end t)
-                (let ((try-exec (match-string 1)))
-                  (unless (locate-file try-exec exec-path nil #'file-executable-p)
-                    (throw 'break nil))))
-
-              (push
-               (cons (funcall counsel-linux-app-format-function name comment exec) id)
-               result))))))))
-
-(defun counsel-linux-apps-list ()
-  "Return list of all Linux desktop applications."
-  (let* ((new-desktop-alist (counsel-linux-apps-list-desktop-files))
-         (new-files (mapcar 'cdr new-desktop-alist)))
-    (unless (and
-             (eq counsel-linux-app-format-function
-                 counsel--linux-apps-cache-format-function)
-             (equal new-files counsel--linux-apps-cached-files)
-             (null (cl-find-if
-                    (lambda (file)
-                      (time-less-p
-                       counsel--linux-apps-cache-timestamp
-                       (nth 5 (file-attributes file))))
-                    new-files)))
-      (setq counsel--linux-apps-cache (counsel-linux-apps-parse new-desktop-alist)
-            counsel--linux-apps-cache-format-function counsel-linux-app-format-function
-            counsel--linux-apps-cache-timestamp (current-time)
-            counsel--linux-apps-cached-files new-files)))
-  counsel--linux-apps-cache)
-
-
-(defun counsel-linux-app-action-default (desktop-shortcut)
-  "Launch DESKTOP-SHORTCUT."
-  (setq desktop-shortcut (cdr desktop-shortcut))
-  (call-process "gtk-launch" nil nil nil desktop-shortcut))
-
-(defun counsel-linux-app-action-file (desktop-shortcut)
-  "Launch DESKTOP-SHORTCUT with a selected file."
-  (setq desktop-shortcut (cdr desktop-shortcut))
-  (let ((file (read-file-name "Open: ")))
-    (if file
-        (call-process "gtk-launch" nil nil nil desktop-shortcut file)
-      (user-error "Cancelled"))))
-
-(defun counsel-linux-app-action-open-desktop (desktop-shortcut)
-  "Open DESKTOP-SHORTCUT."
-  (setq desktop-shortcut (cdr desktop-shortcut))
-  (let ((file
-         (cdr (assoc desktop-shortcut (counsel-linux-apps-list-desktop-files)))))
-    (if file
-        (find-file file)
-      (user-error "Cancelled"))))
-
-(ivy-set-actions
- 'counsel-linux-app
- '(("f" counsel-linux-app-action-file "run on a file")
-   ("d" counsel-linux-app-action-open-desktop "open desktop file")))
-
-;;;###autoload
-(defun counsel-linux-app ()
-  "Launch a Linux desktop application, similar to Alt-<F2>."
-  (interactive)
-  (ivy-read "Run a command: " (counsel-linux-apps-list)
-            :action #'counsel-linux-app-action-default
-            :caller 'counsel-linux-app))
-
-;;** `counsel-company'
-(defvar company-candidates)
-(defvar company-point)
-(defvar company-common)
-(declare-function company-complete "ext:company")
-(declare-function company-mode "ext:company")
-(declare-function company-complete-common "ext:company")
-
-;;;###autoload
-(defun counsel-company ()
-  "Complete using `company-candidates'."
-  (interactive)
-  (company-mode 1)
-  (unless company-candidates
-    (company-complete))
-  (when company-point
-    (when (looking-back company-common (line-beginning-position))
-      (setq ivy-completion-beg (match-beginning 0))
-      (setq ivy-completion-end (match-end 0)))
-    (ivy-read "company cand: " company-candidates
-              :action #'ivy-completion-in-region-action)))
-
-;;;** `counsel-colors'
-(defun counsel-colors--best-contrast-color (color)
-  "Choose the best-contrast foreground color for a background color COLOR.
-
-Use the relative luminance formula to improve the perceived contrast.
-If the relative luminance is beyond a given threshold, in this case a
-midpoint, then the chosen color is black, otherwise is white.  This
-helps to improve the contrast and readability of a text regardless of
-the background color."
-  (let ((rgb (color-name-to-rgb color)))
-    (if rgb
-        (if (>
-             (+ (* (nth 0 rgb) 0.299)
-                (* (nth 1 rgb) 0.587)
-                (* (nth 2 rgb) 0.114))
-             0.5)
-            "#000000"
-          "#FFFFFF")
-      color)))
-
-(defun counsel-colors--update-highlight (cand)
-  "Update the highlight face for the current candidate CAND.
-
-This is necessary because the default `ivy-current-match' face
-background mask most of the colors and you can not see the current
-candidate color when is selected, which is counter-intuitive and not
-user friendly.  The default Emacs command `list-colors-display' have
-the same problem."
-  (when (> (length cand) 0)
-    (let ((color (substring-no-properties cand 26 33)))
-      (face-remap-add-relative
-       'ivy-current-match
-       :background color
-       ;; Another alternatives like use the attribute
-       ;; `distant-foreground' or the function `color-complement-hex'
-       ;; do not work well here because they use the absolute
-       ;; luminance difference between the colors, when the human eye
-       ;; does not perceive all the colors with the same brightness.
-       :foreground (counsel-colors--best-contrast-color color)))))
-
-(defun counsel-colors-action-insert-name (x)
-  "Insert the X color name."
-  (let ((color (car (split-string (substring x 0 25)))))
-    (insert color)))
-
-(defun counsel-colors-action-insert-hex (x)
-  "Insert the X color hexadecimal rgb value."
-  (let ((rgb (substring x 26 33)))
-    (insert rgb)))
-
-(defun counsel-colors-action-kill-name (x)
-  "Kill the X color name."
-  (let ((color (car (split-string (substring x 0 25)))))
-    (kill-new color)))
-
-(defun counsel-colors-action-kill-hex (x)
-  "Kill the X color hexadecimal rgb value."
-  (let ((rgb (substring x 26 33)))
-    (kill-new rgb)))
-
-;;** `counsel-colors-emacs'
-(ivy-set-actions
- 'counsel-colors-emacs
- '(("n" counsel-colors-action-insert-name "insert color name")
-   ("h" counsel-colors-action-insert-hex "insert color hexadecimal value")
-   ("N" counsel-colors-action-kill-name "kill color name")
-   ("H" counsel-colors-action-kill-hex "kill color hexadecimal value")))
-
-(defvar counsel-colors-emacs-history nil
-  "History for `counsel-colors-emacs'.")
-
-(defun counsel-colors--name-to-hex (color)
-  "Return hexadecimal rgb value of a color from his name COLOR."
-  (apply 'color-rgb-to-hex (color-name-to-rgb color)))
-
-;;;###autoload
-(defun counsel-colors-emacs ()
-  "Show a list of all supported colors for a particular frame.
-
-You can insert or kill the name or the hexadecimal rgb value of the
-selected candidate."
-  (interactive)
-  (let ((minibuffer-allow-text-properties t))
-    (ivy-read "%d Emacs color: "
-              (mapcar (lambda (x)
-                        (concat
-                         (propertize
-                          (format "%-25s" (car x))
-                          'result (car x))
-                         (propertize
-                          (format "%8s  "
-                                  (counsel-colors--name-to-hex (car x)))
-                          'face (list :foreground (car x)))
-                         (propertize
-                          (format "%10s" " ")
-                          'face (list :background (car x)))
-                         (propertize
-                          (format "  %-s" (mapconcat #'identity (cdr x) ", "))
-                          'face (list :foreground (car x)))))
-                      (list-colors-duplicates))
-              :require-match t
-              :update-fn (lambda ()
-                           (counsel-colors--update-highlight (ivy-state-current ivy-last)))
-              :action #'counsel-colors-action-insert-name
-              :history 'counsel-colors-emacs-history
-              :caller 'counsel-colors-emacs
-              :sort nil)))
-
-;;** `counsel-colors-web'
-(defvar counsel-colors--web-colors-alist
-  '(("aliceblue"            .  "#f0f8ff")
-    ("antiquewhite"         .  "#faebd7")
-    ("aqua"                 .  "#00ffff")
-    ("aquamarine"           .  "#7fffd4")
-    ("azure"                .  "#f0ffff")
-    ("beige"                .  "#f5f5dc")
-    ("bisque"               .  "#ffe4c4")
-    ("black"                .  "#000000")
-    ("blanchedalmond"       .  "#ffebcd")
-    ("blue"                 .  "#0000ff")
-    ("blueviolet"           .  "#8a2be2")
-    ("brown"                .  "#a52a2a")
-    ("burlywood"            .  "#deb887")
-    ("cadetblue"            .  "#5f9ea0")
-    ("chartreuse"           .  "#7fff00")
-    ("chocolate"            .  "#d2691e")
-    ("coral"                .  "#ff7f50")
-    ("cornflowerblue"       .  "#6495ed")
-    ("cornsilk"             .  "#fff8dc")
-    ("crimson"              .  "#dc143c")
-    ("cyan"                 .  "#00ffff")
-    ("darkblue"             .  "#00008b")
-    ("darkcyan"             .  "#008b8b")
-    ("darkgoldenrod"        .  "#b8860b")
-    ("darkgray"             .  "#a9a9a9")
-    ("darkgreen"            .  "#006400")
-    ("darkkhaki"            .  "#bdb76b")
-    ("darkmagenta"          .  "#8b008b")
-    ("darkolivegreen"       .  "#556b2f")
-    ("darkorange"           .  "#ff8c00")
-    ("darkorchid"           .  "#9932cc")
-    ("darkred"              .  "#8b0000")
-    ("darksalmon"           .  "#e9967a")
-    ("darkseagreen"         .  "#8fbc8f")
-    ("darkslateblue"        .  "#483d8b")
-    ("darkslategray"        .  "#2f4f4f")
-    ("darkturquoise"        .  "#00ced1")
-    ("darkviolet"           .  "#9400d3")
-    ("deeppink"             .  "#ff1493")
-    ("deepskyblue"          .  "#00bfff")
-    ("dimgray"              .  "#696969")
-    ("dodgerblue"           .  "#1e90ff")
-    ("firebrick"            .  "#b22222")
-    ("floralwhite"          .  "#fffaf0")
-    ("forestgreen"          .  "#228b22")
-    ("fuchsia"              .  "#ff00ff")
-    ("gainsboro"            .  "#dcdcdc")
-    ("ghostwhite"           .  "#f8f8ff")
-    ("goldenrod"            .  "#daa520")
-    ("gold"                 .  "#ffd700")
-    ("gray"                 .  "#808080")
-    ("green"                .  "#008000")
-    ("greenyellow"          .  "#adff2f")
-    ("honeydew"             .  "#f0fff0")
-    ("hotpink"              .  "#ff69b4")
-    ("indianred"            .  "#cd5c5c")
-    ("indigo"               .  "#4b0082")
-    ("ivory"                .  "#fffff0")
-    ("khaki"                .  "#f0e68c")
-    ("lavenderblush"        .  "#fff0f5")
-    ("lavender"             .  "#e6e6fa")
-    ("lawngreen"            .  "#7cfc00")
-    ("lemonchiffon"         .  "#fffacd")
-    ("lightblue"            .  "#add8e6")
-    ("lightcoral"           .  "#f08080")
-    ("lightcyan"            .  "#e0ffff")
-    ("lightgoldenrodyellow" .  "#fafad2")
-    ("lightgreen"           .  "#90ee90")
-    ("lightgrey"            .  "#d3d3d3")
-    ("lightpink"            .  "#ffb6c1")
-    ("lightsalmon"          .  "#ffa07a")
-    ("lightseagreen"        .  "#20b2aa")
-    ("lightskyblue"         .  "#87cefa")
-    ("lightslategray"       .  "#778899")
-    ("lightsteelblue"       .  "#b0c4de")
-    ("lightyellow"          .  "#ffffe0")
-    ("lime"                 .  "#00ff00")
-    ("limegreen"            .  "#32cd32")
-    ("linen"                .  "#faf0e6")
-    ("magenta"              .  "#ff00ff")
-    ("maroon"               .  "#800000")
-    ("mediumaquamarine"     .  "#66cdaa")
-    ("mediumblue"           .  "#0000cd")
-    ("mediumorchid"         .  "#ba55d3")
-    ("mediumpurple"         .  "#9370d8")
-    ("mediumseagreen"       .  "#3cb371")
-    ("mediumslateblue"      .  "#7b68ee")
-    ("mediumspringgreen"    .  "#00fa9a")
-    ("mediumturquoise"      .  "#48d1cc")
-    ("mediumvioletred"      .  "#c71585")
-    ("midnightblue"         .  "#191970")
-    ("mintcream"            .  "#f5fffa")
-    ("mistyrose"            .  "#ffe4e1")
-    ("moccasin"             .  "#ffe4b5")
-    ("navajowhite"          .  "#ffdead")
-    ("navy"                 .  "#000080")
-    ("oldlace"              .  "#fdf5e6")
-    ("olive"                .  "#808000")
-    ("olivedrab"            .  "#6b8e23")
-    ("orange"               .  "#ffa500")
-    ("orangered"            .  "#ff4500")
-    ("orchid"               .  "#da70d6")
-    ("palegoldenrod"        .  "#eee8aa")
-    ("palegreen"            .  "#98fb98")
-    ("paleturquoise"        .  "#afeeee")
-    ("palevioletred"        .  "#d87093")
-    ("papayawhip"           .  "#ffefd5")
-    ("peachpuff"            .  "#ffdab9")
-    ("peru"                 .  "#cd853f")
-    ("pink"                 .  "#ffc0cb")
-    ("plum"                 .  "#dda0dd")
-    ("powderblue"           .  "#b0e0e6")
-    ("purple"               .  "#800080")
-    ("rebeccapurple"        .  "#663399")
-    ("red"                  .  "#ff0000")
-    ("rosybrown"            .  "#bc8f8f")
-    ("royalblue"            .  "#4169e1")
-    ("saddlebrown"          .  "#8b4513")
-    ("salmon"               .  "#fa8072")
-    ("sandybrown"           .  "#f4a460")
-    ("seagreen"             .  "#2e8b57")
-    ("seashell"             .  "#fff5ee")
-    ("sienna"               .  "#a0522d")
-    ("silver"               .  "#c0c0c0")
-    ("skyblue"              .  "#87ceeb")
-    ("slateblue"            .  "#6a5acd")
-    ("slategray"            .  "#708090")
-    ("snow"                 .  "#fffafa")
-    ("springgreen"          .  "#00ff7f")
-    ("steelblue"            .  "#4682b4")
-    ("tan"                  .  "#d2b48c")
-    ("teal"                 .  "#008080")
-    ("thistle"              .  "#d8bfd8")
-    ("tomato"               .  "#ff6347")
-    ("turquoise"            .  "#40e0d0")
-    ("violet"               .  "#ee82ee")
-    ("wheat"                .  "#f5deb3")
-    ("white"                .  "#ffffff")
-    ("whitesmoke"           .  "#f5f5f5")
-    ("yellow"               .  "#ffff00")
-    ("yellowgreen"          .  "#9acd32"))
-  "These are the colors defined by the W3C consortium to use in CSS sheets.
-
-All of these colors are compatible with any common browser.  The
-colors gray, green, maroon and purple have alternative values as
-defined by the X11 standard, here they follow the W3C one.")
-
-(ivy-set-actions
- 'counsel-colors-web
- '(("n" counsel-colors-action-insert-name "insert name")
-   ("h" counsel-colors-action-insert-hex "insert hex")
-   ("N" counsel-colors-action-kill-name "kill rgb")
-   ("H" counsel-colors-action-kill-hex "kill hex")))
-
-(defvar counsel-colors-web-history nil
-  "History for `counsel-colors-web'.")
-
-;;;###autoload
-(defun counsel-colors-web ()
-  "Show a list of all W3C web colors for use in CSS.
-
-You can insert or kill the name or the hexadecimal rgb value of the
-selected candidate."
-  (interactive)
-  (let ((minibuffer-allow-text-properties t))
-    (ivy-read "%d Web color: "
-              (mapcar (lambda (x)
-                        (concat
-                         (propertize
-                          (format "%-25s" (car x)))
-                         (propertize
-                          (format "%8s  " (cdr x))
-                          'face (list :foreground (car x)))
-                         (propertize
-                          (format "%10s" " ")
-                          'face (list :background (cdr x)))))
-                      counsel-colors--web-colors-alist)
-              :require-match t
-              :action #'counsel-colors-action-insert-name
-              :update-fn (lambda ()
-                           (counsel-colors--update-highlight (ivy-state-current ivy-last)))
-              :history 'counsel-colors-web-history
-              :caller 'counsel-colors-web
-              :sort t)))
-
-
-;;** `counsel-faces'
-(defun counsel-faces-action-describe (x)
-  "Describe the face X."
-  (describe-face (intern x)))
-
-(defun counsel-faces-action-customize (x)
-  "Customize the face X."
-  (customize-face (intern x)))
-
-(ivy-set-actions
- 'counsel-faces
- '(("d" counsel-faces-action-describe "describe face")
-   ("c" counsel-faces-action-customize "customize face")
-   ("i" insert "insert face name")
-   ("k" kill-new "kill face name")))
-
-(defvar counsel-faces-history nil
-  "History for `counsel-faces'.")
-
-(defvar counsel-faces--sample-text
-  "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789"
-  "Text string to display as the sample text for `counsel-faces'.")
-
-(defvar counsel--faces-fmt nil)
-
-(defun counsel--faces-format-function (cands)
-  "Transform CANDS into a string for `counsel-faces'."
-  (ivy--format-function-generic
-   (lambda (str)
-     (concat
-      (format counsel--faces-fmt
-              (ivy--add-face str 'ivy-current-match))
-      (propertize counsel-faces--sample-text 'face (intern str))))
-   (lambda (str)
-     (concat
-      (format counsel--faces-fmt
-              str)
-      (propertize counsel-faces--sample-text 'face (intern str))))
-   cands
-   "\n"))
-
-(defun counsel-faces ()
-  "Show a list of all defined faces.
-
-You can describe, customize, insert or kill the name or selected
-candidate."
-  (interactive)
-  (let* ((minibuffer-allow-text-properties t)
-         (max-length
-          (apply #'max
-                 (mapcar
-                  (lambda (x)
-                    (length (symbol-name x)))
-                  (face-list))))
-         (counsel--faces-fmt (format "%%-%ds  " max-length))
-         (ivy-format-function #'counsel--faces-format-function))
-    (ivy-read "%d Face: " (face-list)
-              :require-match t
-              :action #'counsel-faces-action-describe
-              :history 'counsel-faces-history
-              :caller 'counsel-faces
-              :sort t)))
-
-;;** `counsel-command-history'
-(defun counsel-command-history-action-eval (cmd)
-  "Eval the command CMD."
-    (eval (read cmd)))
-
-(defun counsel-command-history-action-edit-and-eval (cmd)
-  "Edit and eval the command CMD."
-    (edit-and-eval-command "Eval: " (read cmd)))
-
-(ivy-set-actions
- 'counsel-command-history
- '(("r" counsel-command-history-action-eval           "eval command")
-   ("e" counsel-command-history-action-edit-and-eval  "edit and eval command")))
-
-(defun counsel-command-history ()
-  "Show the history of commands."
-  (interactive)
-  (ivy-read "%d Command: " (mapcar #'prin1-to-string command-history)
-          :require-match t
-          :action #'counsel-command-history-action-eval
-          :caller 'counsel-command-history))
-
-;;** `counsel-org-agenda-headlines'
-(defvar org-odd-levels-only)
-(declare-function org-set-startup-visibility "org")
-(declare-function org-show-entry "org")
-(declare-function org-map-entries "org")
-(declare-function org-heading-components "org")
-
-(defun counsel-org-agenda-headlines-action-goto (headline)
-  "Go to the `org-mode' agenda HEADLINE."
-  (find-file (nth 1 headline))
-  (org-set-startup-visibility)
-  (goto-char (nth 2 headline))
-  (org-show-entry))
-
-(ivy-set-actions
- 'counsel-org-agenda-headlines
- '(("g" counsel-org-agenda-headlines-action-goto "goto headline")))
-
-(defvar counsel-org-agenda-headlines-history nil
-  "History for `counsel-org-agenda-headlines'.")
-
-(defun counsel-org-agenda-headlines--candidates ()
-  "Return a list of completion candidates for `counsel-org-agenda-headlines'."
-  (org-map-entries
-   (lambda ()
-     (let* ((components (org-heading-components))
-            (level (make-string
-                    (if org-odd-levels-only
-                        (nth 1 components)
-                      (nth 0 components))
-                    ?*))
-            (todo (nth 2 components))
-            (priority (nth 3 components))
-            (text (nth 4 components))
-            (tags (nth 5 components)))
-       (list
-        (mapconcat
-         'identity
-         (cl-remove-if 'null
-                       (list
-                        level
-                        todo
-                        (if priority (format "[#%c]" priority))
-                        text
-                        tags))
-         " ")
-        (buffer-file-name) (point))))
-   nil
-   'agenda))
-
-;;;###autoload
-(defun counsel-org-agenda-headlines ()
-  "Choose from headers of `org-mode' files in the agenda."
-  (interactive)
-  (let ((minibuffer-allow-text-properties t))
-    (ivy-read "Org headline: "
-              (counsel-org-agenda-headlines--candidates)
-              :action #'counsel-org-agenda-headlines-action-goto
-              :history 'counsel-org-agenda-headlines-history
-              :caller 'counsel-org-agenda-headlines)))
-
-;;** `counsel-irony'
-;;;###autoload
-(defun counsel-irony ()
-  "Inline C/C++ completion using Irony."
-  (interactive)
-  (irony-completion-candidates-async 'counsel-irony-callback))
-
-(defun counsel-irony-callback (candidates)
-  "Callback function for Irony to search among CANDIDATES."
-  (interactive)
-  (let* ((symbol-bounds (irony-completion-symbol-bounds))
-         (beg (car symbol-bounds))
-         (end (cdr symbol-bounds))
-         (prefix (buffer-substring-no-properties beg end)))
-  (setq ivy-completion-beg beg
-        ivy-completion-end end)
-    (ivy-read "code: " (mapcar #'counsel-irony-annotate candidates)
-              :predicate (lambda (candidate)
-                           (string-prefix-p prefix (car candidate)))
-              :caller 'counsel-irony
-              :action 'ivy-completion-in-region-action)))
-
-(defun counsel-irony-annotate (x)
-  "Make Ivy candidate from Irony candidate X."
-  (cons (concat (car x) (irony-completion-annotation x))
-        (car x)))
-
-(add-to-list 'ivy-display-functions-alist '(counsel-irony . ivy-display-function-overlay))
-
-(declare-function irony-completion-candidates-async "ext:irony-completion")
-(declare-function irony-completion-symbol-bounds "ext:irony-completion")
-(declare-function irony-completion-annotation "ext:irony-completion")
-
-;;** `counsel-apropos'
-;;;###autoload
-(defun counsel-apropos ()
-  "Show all matching symbols.
-See `apropos' for further information about what is considered
-a symbol and how to search for them."
-  (interactive)
-  (ivy-read "Search for symbol (word list or regexp): "
-            (counsel-symbol-list)
-            :history 'counsel-apropos-history
-            :action (lambda (pattern)
-                      (when (= (length pattern) 0)
-                        (user-error "Please specify a pattern"))
-                      ;; If the user selected a candidate form the list, we use
-                      ;; a pattern which matches only the selected symbol.
-                      (if (memq this-command '(ivy-immediate-done ivy-alt-done))
-                          ;; Regexp pattern are passed verbatim, other input is
-                          ;; split into words.
-                          (if (string-equal (regexp-quote pattern) pattern)
-                              (apropos (split-string pattern "[ \t]+" t))
-                            (apropos pattern))
-                        (apropos (concat "^" pattern "$"))))
-            :caller 'counsel-apropos))
-
-(defun counsel-symbol-list ()
-  "Return a list of all symbols."
-  (let (cands)
-    (mapatoms
-     (lambda (symbol)
-       (when (or (boundp symbol) (fboundp symbol))
-         (push (symbol-name symbol) cands))))
-    (delete "" cands)))
-
-;;** `counsel-mode'
-(defvar counsel-mode-map
-  (let ((map (make-sparse-keymap)))
-    (dolist (binding
-              '((execute-extended-command . counsel-M-x)
-                (describe-bindings . counsel-descbinds)
-                (describe-function . counsel-describe-function)
-                (describe-variable . counsel-describe-variable)
-                (describe-face . counsel-describe-face)
-                (find-file . counsel-find-file)
-                (find-library . counsel-find-library)
-                (imenu . counsel-imenu)
-                (load-library . counsel-load-library)
-                (load-theme . counsel-load-theme)
-                (yank-pop . counsel-yank-pop)
-                (info-lookup-symbol . counsel-info-lookup-symbol)
-                (pop-mark . counsel-mark-ring)))
-      (define-key map (vector 'remap (car binding)) (cdr binding)))
-    map)
-  "Map for `counsel-mode'.
-Remaps built-in functions to counsel replacements.")
-
-(defcustom counsel-mode-override-describe-bindings nil
-  "Whether to override `describe-bindings' when `counsel-mode' is active."
-  :group 'ivy
-  :type 'boolean)
-
-(defun counsel-list-buffers-with-mode (mode)
-  "List all buffers with `major-mode' MODE.
-
-MODE is a symbol."
-  (save-current-buffer
-    (let (bufs)
-      (dolist (buf (buffer-list))
-        (set-buffer buf)
-        (and (equal major-mode mode)
-             (push (buffer-name buf) bufs)))
-      (nreverse bufs))))
-
-;;;###autoload
-(defun counsel-switch-to-shell-buffer ()
-  "Switch to a shell buffer, or create one."
-  (interactive)
-  (ivy-read "Switch to shell buffer: "
-            (counsel-list-buffers-with-mode 'shell-mode)
-            :action #'counsel-switch-to-buffer-or-window
-            :caller 'counsel-switch-to-shell-buffer))
-
-(defun counsel-switch-to-buffer-or-window (buffer-name)
-  "Display buffer BUFFER-NAME and select its window.
-
-This behaves as `switch-to-buffer', except when the buffer is
-already visible; in that case, select the window corresponding to
-the buffer."
-  (let ((buffer (get-buffer buffer-name)))
-    (if (not buffer)
-        (shell buffer-name)
-      (let (window-of-buffer-visible)
-        (catch 'found
-          (walk-windows (lambda (window)
-                          (and (equal (window-buffer window) buffer)
-                               (throw 'found (setq window-of-buffer-visible window))))))
-        (if window-of-buffer-visible
-            (select-window window-of-buffer-visible)
-          (switch-to-buffer buffer))))))
-
-;;;###autoload
-(define-minor-mode counsel-mode
-  "Toggle Counsel mode on or off.
-Turn Counsel mode on if ARG is positive, off otherwise. Counsel
-mode remaps built-in emacs functions that have counsel
-replacements. "
-  :group 'ivy
-  :global t
-  :keymap counsel-mode-map
-  :lighter " counsel"
-  (if counsel-mode
-      (progn
-        (when (and (fboundp 'advice-add)
-                   counsel-mode-override-describe-bindings)
-          (advice-add #'describe-bindings :override #'counsel-descbinds))
-        (define-key minibuffer-local-shell-command-map (kbd "C-r")
-          'counsel-shell-command-history)
-        (define-key read-expression-map (kbd "C-r")
-          'counsel-expression-history))
-    (when (fboundp 'advice-remove)
-      (advice-remove #'describe-bindings #'counsel-descbinds))))
-
-(provide 'counsel)
-
-;;; counsel.el ends here
.emacs.d/elpa/counsel-20170911.1121/counsel.elc
Binary file
.emacs.d/elpa/counsel-projectile-20170911.1304/counsel-projectile-autoloads.el
@@ -1,74 +0,0 @@
-;;; counsel-projectile-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "counsel-projectile" "counsel-projectile.el"
-;;;;;;  (22977 30126 563673 375000))
-;;; Generated autoloads from counsel-projectile.el
-
-(autoload 'counsel-projectile-find-file "counsel-projectile" "\
-Jump to a project's file using completion.
-
-Replacement for `projectile-find-file'.  With a prefix ARG
-invalidates the cache first.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'counsel-projectile-find-dir "counsel-projectile" "\
-Jump to a project's directory using completion.
-
-With a prefix ARG invalidates the cache first.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'counsel-projectile-switch-to-buffer "counsel-projectile" "\
-Switch to a project buffer.
-
-\(fn)" t nil)
-
-(autoload 'counsel-projectile-ag "counsel-projectile" "\
-Run an ag search in the project.
-
-\(fn &optional OPTIONS)" t nil)
-
-(autoload 'counsel-projectile-rg "counsel-projectile" "\
-Run an rg search in the project.
-
-\(fn &optional OPTIONS)" t nil)
-
-(autoload 'counsel-projectile-switch-project "counsel-projectile" "\
-Switch to a project we have visited before.
-
-Invokes the command referenced by
-`projectile-switch-project-action' on switch.
-
-\(fn)" t nil)
-
-(autoload 'counsel-projectile "counsel-projectile" "\
-Use projectile with Ivy instead of ido.
-
-With a prefix ARG invalidates the cache first.
-
-\(fn &optional ARG)" t nil)
-
-(eval-after-load 'projectile '(progn (define-key projectile-command-map (kbd "SPC") #'counsel-projectile)))
-
-(autoload 'counsel-projectile-on "counsel-projectile" "\
-Turn on counsel-projectile key bindings.
-
-\(fn)" t nil)
-
-(autoload 'counsel-projectile-off "counsel-projectile" "\
-Turn off counsel-projectile key bindings.
-
-\(fn)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; counsel-projectile-autoloads.el ends here
.emacs.d/elpa/counsel-projectile-20170911.1304/counsel-projectile-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "counsel-projectile" "20170911.1304" "Ivy integration for Projectile" '((counsel "0.8.0") (projectile "0.14.0")) :commit "20557b47a963cc5304ac2bc3ea4800c3a7da7feb" :url "https://github.com/ericdanan/counsel-projectile" :keywords '("project" "convenience"))
.emacs.d/elpa/counsel-projectile-20170911.1304/counsel-projectile.el
@@ -1,582 +0,0 @@
-;;; counsel-projectile.el --- Ivy integration for Projectile
-
-;; Copyright (C) 2016 Eric Danan
-
-;; Author: Eric Danan
-;; URL: https://github.com/ericdanan/counsel-projectile
-;; Package-Version: 20170911.1304
-;; Created: 2016-04-11
-;; Keywords: project, convenience
-;; Version: 0.1
-;; Package-Requires: ((counsel "0.8.0") (projectile "0.14.0"))
-
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; 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, 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., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-;;
-;; Projectile has native support for using ivy as its completion
-;; system.  Counsel-projectile provides further ivy integration into
-;; projectile by taking advantage of ivy's mechanism to select from a
-;; list of actions and/or apply an action without leaving the
-;; comlpetion session.  It is inspired by helm-projectile.  See the
-;; README for more details.
-;;
-;;; Code:
-
-(require 'counsel)
-(require 'projectile)
-
-;;; counsel-projectile-map
-
-(defun counsel-projectile-drop-to-switch-project ()
-  "For use in minibuffer maps.  Quit and call
-`counsel-projectile-switch-project'."
-  (interactive)
-  (ivy-quit-and-run
-   (counsel-projectile-switch-project)))
-
-(defvar counsel-projectile-drop-to-switch-project-binding "M-SPC"
-  "Key binding for `counsel-projectile-drop-to-switch-project' in
-  `counsel-projectile-map'.")
-
-(defvar counsel-projectile-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map
-      (kbd counsel-projectile-drop-to-switch-project-binding)
-      'counsel-projectile-drop-to-switch-project)
-    map)
-  "Keymap used in the minibuffer.")
-
-;;; counsel-projectile-find-file
-
-(defun counsel-projectile-find-file-action (file)
-  "Find FILE and run `projectile-find-file-hook'."
-  (find-file (projectile-expand-root file))
-  (run-hooks 'projectile-find-file-hook))
-
-(defun counsel-projectile-find-file-action-other-window (file)
-  "Find FILE in another window and run
-`projectile-find-file-hook'."
-  (find-file-other-window (projectile-expand-root file))
-  (run-hooks 'projectile-find-file-hook))
-
-(defun counsel-projectile-find-file-transformer (name)
-  "Transform non-visited file names with `ivy-virtual' face."
-  (if (not (get-file-buffer (expand-file-name name (projectile-project-root))))
-      (propertize name 'face 'ivy-virtual)
-    name))
-
-;;;###autoload
-(defun counsel-projectile-find-file (&optional arg)
-  "Jump to a project's file using completion.
-
-Replacement for `projectile-find-file'.  With a prefix ARG
-invalidates the cache first."
-  (interactive "P")
-  (projectile-maybe-invalidate-cache arg)
-  (ivy-read (projectile-prepend-project-name "Find file: ")
-            (projectile-current-project-files)
-            :matcher #'counsel--find-file-matcher
-            :require-match t
-            :keymap counsel-projectile-map
-            :action #'counsel-projectile-find-file-action
-            :caller 'counsel-projectile-find-file))
-
-(defvar counsel-projectile-find-file-actions
-  '(("j" counsel-projectile-find-file-action-other-window
-     "other window"))
-  "List of actions for `counsel-projecile-find-file'.  If
-  you modify this variable after loading counsel-projectile, then
-  you should call `ivy-set-actions' afterwards to apply your
-  changes.")
-
-(ivy-set-actions
- 'counsel-projectile-find-file
- counsel-projectile-find-file-actions)
-
-(ivy-set-display-transformer
- 'counsel-projectile-find-file
- 'counsel-projectile-find-file-transformer)
-
-;;; counsel-projectile-find-dir
-
-(defun counsel-projectile--dir-list ()
-  "Return a list of files for the current project."
-  (if projectile-find-dir-includes-top-level
-      (append '("./") (projectile-current-project-dirs))
-    (projectile-current-project-dirs)))
-
-(defun counsel-projectile-find-dir-action (dir)
-  "Visit DIR with dired and run `projectile-find-dir-hook'."
-  (dired (projectile-expand-root dir))
-  (run-hooks 'projectile-find-dir-hook))
-
-(defun counsel-projectile-find-dir-action-other-window (dir)
-  "Visit DIR with dired in another window and run
-`projectile-find-dir-hook'."
- (dired-other-window (projectile-expand-root dir))
- (run-hooks 'projectile-find-dir-hook))
-
-;;;###autoload
-(defun counsel-projectile-find-dir (&optional arg)
-  "Jump to a project's directory using completion.
-
-With a prefix ARG invalidates the cache first."
-  (interactive "P")
-  (projectile-maybe-invalidate-cache arg)
-  (ivy-read (projectile-prepend-project-name "Find dir: ")
-            (counsel-projectile--dir-list)
-            :require-match t
-            :keymap counsel-projectile-map
-            :action #'counsel-projectile-find-dir-action
-            :caller 'counsel-projectile-find-dir))
-
-(defvar counsel-projectile-find-dir-actions
-  '(("j" counsel-projectile-find-dir-action-other-window
-     "other window"))
-  "List of actions for `counsel-projecile-find-dir'.  If
-  you modify this variable after loading counsel-projectile, then
-  you should call `ivy-set-actions' afterwards to apply your
-  changes.")
-
-(ivy-set-actions
- 'counsel-projectile-find-dir
- counsel-projectile-find-dir-actions)
-
-;;; counsel-projectile-switch-to-buffer
-
-(defun counsel-projectile--buffer-list ()
-  "Get a list of project buffer names.
-
-Like `projectile-project-buffer-names', but propertize buffer
-names as in `ivy--buffer-list'."
-  (let ((buffer-names (projectile-project-buffer-names)))
-    (ivy--buffer-list "" nil
-                      (lambda (x)
-                        (member (car x) buffer-names)))))
-
-(defun counsel-projectile-switch-to-buffer-action (buffer)
-  "Switch to BUFFER."
-  (switch-to-buffer buffer nil 'force-same-window))
-
-;;;###autoload
-(defun counsel-projectile-switch-to-buffer ()
-  "Switch to a project buffer."
-  (interactive)
-  (ivy-read (projectile-prepend-project-name "Switch to buffer: ")
-            (counsel-projectile--buffer-list)
-            :matcher #'ivy--switch-buffer-matcher
-            :require-match t
-            :keymap counsel-projectile-map
-            :action #'counsel-projectile-switch-to-buffer-action
-            :caller 'counsel-projectile-switch-to-buffer))
-
-(defvar counsel-projectile-switch-to-buffer-actions
-  '(("j" switch-to-buffer-other-window
-    "other window"))
-  "List of actions for `counsel-projecile-switch-to-buffer'.  If
-  you modify this variable after loading counsel-projectile, then
-  you should call `ivy-set-actions' afterwards to apply your
-  changes.")
-
-(ivy-set-actions
- 'counsel-projectile-switch-to-buffer
- counsel-projectile-switch-to-buffer-actions)
-
-(ivy-set-display-transformer
- 'counsel-projectile-switch-to-buffer
- 'ivy-switch-buffer-transformer)
-
-;;; counsel-projectile-ag
-
-(defvar counsel-projectile-ag-initial-input nil
-  "Initial minibuffer input for `counsel-projectile-ag'.  If non-nil, it should be a form whose evaluation yields the initial input string, e.g.
-
-    (setq counsel-projectile-ag-initial-input
-          '(projectile-symbol-or-selection-at-point))
-
-or
-
-    (setq counsel-projectile-ag-initial-input 
-          '(thing-at-point 'symbol t))
-
-Note that you can always insert the value of `(ivy-thing-at-point)' by
-hitting \"M-n\" in the minibuffer.")
-
-;;;###autoload
-(defun counsel-projectile-ag (&optional options)
-  "Run an ag search in the project."
-  (interactive)
-  (if (projectile-project-p)
-      (let* ((options
-              (if current-prefix-arg
-                  (read-string "options: ")
-                options))
-             (ignored
-              (unless (eq (projectile-project-vcs) 'git)
-                ;; ag supports git ignore files
-                (append
-                 (cl-union (projectile-ignored-files-rel) grep-find-ignored-files)
-                 (cl-union (projectile-ignored-directories-rel) grep-find-ignored-directories))))
-             (options
-              (concat options " "
-                      (mapconcat (lambda (i)
-                                   (concat "--ignore " (shell-quote-argument i)))
-                                 ignored
-                                 " "))))
-        (counsel-ag (eval counsel-projectile-ag-initial-input)
-                    (projectile-project-root)
-                    options
-                    (projectile-prepend-project-name "ag")))
-    (user-error "You're not in a project")))
-
-;;; counsel-projectile-rg
-
-(defvar counsel-projectile-rg-initial-input nil
-  "Initial minibuffer input for `counsel-projectile-rg'.  See `counsel-projectile-ag-initial-input' for details.")
-
-;;;###autoload
-(defun counsel-projectile-rg (&optional options)
-  "Run an rg search in the project."
-  (interactive)
-  (if (projectile-project-p)
-      (let* ((options
-              (if current-prefix-arg
-                  (read-string "options: ")
-                options))
-             (ignored
-              (unless (eq (projectile-project-vcs) 'git)
-                ;; rg supports git ignore files
-                (append
-                 (cl-union (projectile-ignored-files-rel) grep-find-ignored-files)
-                 (cl-union (projectile-ignored-directories-rel) grep-find-ignored-directories))))
-             (options
-              (concat options " "
-                      (mapconcat (lambda (i)
-                                   (concat "--glob " (shell-quote-argument (concat "!" i))))
-                                 ignored
-                                 " "))))
-        (counsel-rg (eval counsel-projectile-rg-initial-input)
-                    (projectile-project-root)
-                    options
-                    (projectile-prepend-project-name "rg")))
-    (user-error "You're not in a project")))
-
-;;; counsel-projectile-switch-project
-
-(defun counsel-projectile-switch-project-action (project)
-  "Switch to PROJECT.
-Invokes the command referenced by `projectile-switch-project-action' on switch.
-
-This is a replacement for `projectile-switch-project-by-name'
-with a different switching mechanism: the switch-project action
-is called from a dedicated buffer rather than the initial buffer.
-Also, PROJECT's dir-local variables are loaded before calling the
-action."
-  (run-hooks 'projectile-before-switch-project-hook)
-  ;; Kill and recreate the switch buffer to get rid of any local
-  ;; variable
-  (ignore-errors (kill-buffer " *counsel-projectile*"))
-  (set-buffer (get-buffer-create " *counsel-projectile*"))
-  (setq default-directory project)
-  ;; Load the project dir-local variables into the switch buffer, so
-  ;; the action can make use of them
-  (hack-dir-local-variables-non-file-buffer)
-  (funcall projectile-switch-project-action)
-  ;; If the action relies on `ivy-read' then, after one of its
-  ;; `ivy-read' actions is executed, the current buffer will be set
-  ;; back to the initial buffer. Hence we make sure tu evaluate
-  ;; `projectile-after-switch-project-hook' from the switch buffer.
-  (with-current-buffer " *counsel-projectile*"
-    (run-hooks 'projectile-after-switch-project-hook)))
-
-(defun counsel-projectile-switch-project-action-find-file (project)
-  "Action for `counsel-projectile-switch-project' to find a
-PROJECT file."
-  (let ((projectile-switch-project-action
-         (lambda ()
-           (counsel-projectile-find-file ivy-current-prefix-arg))))
-    (counsel-projectile-switch-project-action project)))
-
-(defun counsel-projectile-switch-project-action-find-file-manually (project)
-  "Action for `counsel-projectile-switch-project' to find a
-PROJECT file manually."
-  (let ((projectile-switch-project-action
-         (lambda ()
-           (counsel-find-file project))))
-    (counsel-projectile-switch-project-action project)))
-
-(defun counsel-projectile-switch-project-action-find-dir (project)
-  "Action for `counsel-projectile-switch-project' to find a
-PROJECT directory."
-  (let ((projectile-switch-project-action
-         (lambda ()
-           (counsel-projectile-find-dir ivy-current-prefix-arg))))
-    (counsel-projectile-switch-project-action project)))
-
-(defun counsel-projectile-switch-project-action-switch-to-buffer (project)
-  "Action for `counsel-projectile-switch-project' to switch to a
-PROJECT buffer."
-  (let ((projectile-switch-project-action 'counsel-projectile-switch-to-buffer))
-    (counsel-projectile-switch-project-action project)))
-
-(defun counsel-projectile-switch-project-action-save-all-buffers (project)
-  "Action for `counsel-projectile-switch-project' to save all
-PROJECT buffers."
-  (let ((projectile-switch-project-action 'projectile-save-project-buffers))
-    (counsel-projectile-switch-project-action project)))
-
-(defun counsel-projectile-switch-project-action-kill-buffers (project)
-  "Action for `counsel-projectile-switch-project' to kill all
-PROJECT buffers."
-  (let ((projectile-switch-project-action 'projectile-kill-buffers))
-    (counsel-projectile-switch-project-action project)))
-
-(defun counsel-projectile-switch-project-action-remove-known-project (project)
-  "Action for `counsel-projectile-switch-project' to remove
-PROJECT from the list of known projects."
-  (projectile-remove-known-project project)
-  (setq ivy--all-candidates
-        (delete dir ivy--all-candidates))
-  (ivy--reset-state ivy-last))
-
-(defun counsel-projectile-switch-project-action-edit-dir-locals (project)
-  "Action for `counsel-projectile-switch-project' to edit
-PROJECT's dir-locals."
-  (let ((projectile-switch-project-action 'projectile-edit-dir-locals))
-    (counsel-projectile-switch-project-action project)))
-
-(defun counsel-projectile-switch-project-action-vc (project)
-  "Action for `counsel-projectile-switch-project' to open PROJECT
-in vc-dir / magit / monky."
-  (let ((projectile-switch-project-action 'projectile-vc))
-    (counsel-projectile-switch-project-action project)))
-
-(defun counsel-projectile-switch-project-action-run-eshell (project)
-  "Action for `counsel-projectile-switch-project' to start
-`eshell' from PROJECT's root."
-  (let ((projectile-switch-project-action 'projectile-run-eshell))
-    (counsel-projectile-switch-project-action project)))
-
-(defun counsel-projectile-switch-project-action-ag (project)
-  "Action for `counsel-projectile-switch-project' to search
-PROJECT with `ag'."
-  (let ((projectile-switch-project-action 'counsel-projectile-ag))
-    (counsel-projectile-switch-project-action project)))
-
-(defun counsel-projectile-switch-project-action-rg (project)
-  "Action for `counsel-projectile-switch-project' to search
-PROJECT with `rg'."
-  (let ((projectile-switch-project-action 'counsel-projectile-rg))
-    (counsel-projectile-switch-project-action project)))
-
-;;;###autoload
-(defun counsel-projectile-switch-project ()
-  "Switch to a project we have visited before.
-
-Invokes the command referenced by
-`projectile-switch-project-action' on switch."
-  (interactive)
-  (ivy-read (projectile-prepend-project-name "Switch to project: ")
-            projectile-known-projects
-            :preselect (and (projectile-project-p)
-                            (abbreviate-file-name (projectile-project-root)))
-            :action #'counsel-projectile-switch-project-action
-            :require-match t
-            :caller 'counsel-projectile-switch-project))
-
-(defvar counsel-projectile-switch-project-actions
-  '(("f" counsel-projectile-switch-project-action-find-file
-     "find file")
-    ("F" counsel-projectile-switch-project-action-find-file-manually
-     "find file manually")
-    ("d" counsel-projectile-switch-project-action-find-dir
-     "find directory")
-    ("b" counsel-projectile-switch-project-action-switch-to-buffer
-     "switch to buffer")
-    ("s" counsel-projectile-switch-project-action-save-all-buffers
-     "save all buffers")
-    ("k" counsel-projectile-switch-project-action-kill-buffers
-     "kill all buffers")
-    ("r" counsel-projectile-switch-project-action-remove-known-project
-     "remove from known projects")
-    ("l" counsel-projectile-switch-project-action-edit-dir-locals
-     "edit dir-locals")
-    ("g" counsel-projectile-switch-project-action-vc
-     "open in vc-dir / magit / monky")
-    ("e" counsel-projectile-switch-project-action-run-eshell
-     "start eshell")
-    ("a" counsel-projectile-switch-project-action-ag
-     "search with ag")
-    ("R" counsel-projectile-switch-project-action-rg
-     "search with rg"))
-  "List of actions for `counsel-projecile-switch-project'.  If
-  you modify this variable after loading counsel-projectile, then
-  you should call `ivy-set-actions' afterwards to apply your
-  changes.")
-
-(ivy-set-actions
- 'counsel-projectile-switch-project
- counsel-projectile-switch-project-actions)
-
-;;; counsel-projectile
-
-(defvar counsel-projectile--buffers nil
-  "Stores the list of project buffers.")
-
-(defvar counsel-projectile--non-visited-files nil
-  "Stores the list of project files that are not currently visited by a buffer.")
-
-(defun counsel-projectile--buffer-file-list ()
-  "Get a list of project buffers and files."
-  (append
-   (setq counsel-projectile--buffers
-         (counsel-projectile--buffer-list))
-   (setq counsel-projectile--non-visited-files
-         (let ((root (projectile-project-root))
-               (files (projectile-current-project-files))
-               file)
-           (dolist (buffer counsel-projectile--buffers files)
-             (when (setq file (buffer-file-name (get-buffer buffer)))
-               (delete (file-relative-name file root) files)))))))
-
-(defun counsel-projectile--matcher (regexp candidates)
-  "Return REGEXP-matching CANDIDATES.
-
-Relies on `ivy--switch-buffer-matcher' and
-`counsel--find-file-matcher'."
-  (append (ivy--switch-buffer-matcher regexp counsel-projectile--buffers)
-          (counsel--find-file-matcher regexp counsel-projectile--non-visited-files)))
-
-(defun counsel-projectile-action (name)
-  "Switch to buffer or find file named NAME."
-  (if (member name counsel-projectile--buffers)
-      (counsel-projectile-switch-to-buffer-action name)
-    (counsel-projectile-find-file-action name)))
-
-(defun counsel-projectile-action-other-window (name)
-  "Switch to buffer or find file named NAME in another window."
-  (if (member name counsel-projectile--buffers)
-      (switch-to-buffer-other-window name)
-    (counsel-projectile-find-file-action-other-window name)))
-
-(defun counsel-projectile-transformer (name)
-  "Fontifies modified, file-visiting buffers as well as non-visited files."
-  (if (member name counsel-projectile--buffers)
-      (ivy-switch-buffer-transformer name)
-    (propertize name 'face 'ivy-virtual)))
-
-;;;###autoload
-(defun counsel-projectile (&optional arg)
-  "Use projectile with Ivy instead of ido.
-
-With a prefix ARG invalidates the cache first."
-  (interactive "P")
-  (if (not (projectile-project-p))
-      (counsel-projectile-switch-project)
-    (projectile-maybe-invalidate-cache arg)
-    (ivy-read (projectile-prepend-project-name "Load buffer or file: ")
-              (counsel-projectile--buffer-file-list)
-              :matcher #'counsel-projectile--matcher
-              :require-match t
-              :keymap counsel-projectile-map
-              :action #'counsel-projectile-action
-              :caller 'counsel-projectile)))
-
-(defvar counsel-projectile-actions
-  '(("j" counsel-projectile-action-other-window
-    "other window"))
-  "List of actions for `counsel-projecile'.  If
-  you modify this variable after loading counsel-projectile, then
-  you should call `ivy-set-actions' afterwards to apply your
-  changes.")
-
-(ivy-set-actions
- 'counsel-projectile
- counsel-projectile-actions)
-
-(ivy-set-display-transformer
- 'counsel-projectile
- 'counsel-projectile-transformer)
-
-;;; key bindings
-
-;;;###autoload
-(eval-after-load 'projectile
-  '(progn
-     (define-key projectile-command-map (kbd "SPC") #'counsel-projectile)))
-
-(defun counsel-projectile-commander-bindings ()
-  (def-projectile-commander-method ?f
-    "Find file in project."
-    (counsel-projectile-find-file))
-  (def-projectile-commander-method ?d
-    "Find directory in project."
-    (counsel-projectile-find-dir))
-  (def-projectile-commander-method ?b
-    "Switch to project buffer."
-    (counsel-projectile-switch-to-buffer))
-  (def-projectile-commander-method ?A
-    "Search project files with ag."
-    (counsel-projectile-ag))
-  (def-projectile-commander-method ?s
-    "Switch project."
-    (counsel-projectile-switch-project)))
-
-(defun counsel-projectile-toggle (toggle)
-  "Toggle counsel-projectile keybindings."
-  (if (> toggle 0)
-      (progn
-        (when (eq projectile-switch-project-action #'projectile-find-file)
-          (setq projectile-switch-project-action #'counsel-projectile))
-        (define-key projectile-mode-map [remap projectile-find-file] #'counsel-projectile-find-file)
-        (define-key projectile-mode-map [remap projectile-find-dir] #'counsel-projectile-find-dir)
-        (define-key projectile-mode-map [remap projectile-switch-project] #'counsel-projectile-switch-project)
-        (define-key projectile-mode-map [remap projectile-ag] #'counsel-projectile-ag)
-        (define-key projectile-mode-map [remap projectile-switch-to-buffer] #'counsel-projectile-switch-to-buffer)
-        (counsel-projectile-commander-bindings))
-    (progn
-      (when (eq projectile-switch-project-action #'counsel-projectile)
-        (setq projectile-switch-project-action #'projectile-find-file))
-      (define-key projectile-mode-map [remap projectile-find-file] nil)
-      (define-key projectile-mode-map [remap projectile-find-dir] nil)
-      (define-key projectile-mode-map [remap projectile-switch-project] nil)
-      (define-key projectile-mode-map [remap projectile-ag] nil)
-      (define-key projectile-mode-map [remap projectile-switch-to-buffer] nil)
-      (projectile-commander-bindings))))
-
-;;;###autoload
-(defun counsel-projectile-on ()
-  "Turn on counsel-projectile key bindings."
-  (interactive)
-  (message "Turn on counsel-projectile key bindings")
-  (counsel-projectile-toggle 1))
-
-;;;###autoload
-(defun counsel-projectile-off ()
-  "Turn off counsel-projectile key bindings."
-  (interactive)
-  (message "Turn off counsel-projectile key bindings")
-  (counsel-projectile-toggle -1))
-
-
-(provide 'counsel-projectile)
-
-;;; counsel-projectile.el ends here
.emacs.d/elpa/counsel-projectile-20170911.1304/counsel-projectile.elc
Binary file
.emacs.d/elpa/dash-20170810.137/dash-autoloads.el
@@ -1,15 +0,0 @@
-;;; dash-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil nil ("dash.el") (22977 26779 166073 850000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; dash-autoloads.el ends here
.emacs.d/elpa/dash-20170810.137/dash-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "dash" "20170810.137" "A modern list library for Emacs" 'nil :commit "0df0ff1a65d54377381e50c08d88b247db44c3dd" :keywords '("lists"))
.emacs.d/elpa/dash-20170810.137/dash.el
@@ -1,2664 +0,0 @@
-;;; dash.el --- A modern list library for Emacs  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
-
-;; Author: Magnar Sveen <magnars@gmail.com>
-;; Version: 2.13.0
-;; Package-Version: 20170810.137
-;; Keywords: lists
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; A modern list api for Emacs.
-;;
-;; See documentation on https://github.com/magnars/dash.el#functions
-;;
-;; **Please note** The lexical binding in this file is not utilised at the
-;; moment. We will take full advantage of lexical binding in an upcoming 3.0
-;; release of Dash. In the meantime, we've added the pragma to avoid a bug that
-;; you can read more about in https://github.com/magnars/dash.el/issues/130.
-;;
-
-;;; Code:
-
-(defgroup dash ()
-  "Customize group for dash.el"
-  :group 'lisp
-  :prefix "dash-")
-
-(defun dash--enable-fontlock (symbol value)
-  (when value
-    (dash-enable-font-lock))
-  (set-default symbol value))
-
-(defcustom dash-enable-fontlock nil
-  "If non-nil, enable fontification of dash functions, macros and
-special values."
-  :type 'boolean
-  :set 'dash--enable-fontlock
-  :group 'dash)
-
-(defmacro !cons (car cdr)
-  "Destructive: Set CDR to the cons of CAR and CDR."
-  `(setq ,cdr (cons ,car ,cdr)))
-
-(defmacro !cdr (list)
-  "Destructive: Set LIST to the cdr of LIST."
-  `(setq ,list (cdr ,list)))
-
-(defmacro --each (list &rest body)
-  "Anaphoric form of `-each'."
-  (declare (debug (form body))
-           (indent 1))
-  (let ((l (make-symbol "list")))
-    `(let ((,l ,list)
-           (it-index 0))
-       (while ,l
-         (let ((it (car ,l)))
-           ,@body)
-         (setq it-index (1+ it-index))
-         (!cdr ,l)))))
-
-(defmacro -doto (eval-initial-value &rest forms)
-  "Eval a form, then insert that form as the 2nd argument to other forms.
-The EVAL-INITIAL-VALUE form is evaluated once. Its result is
-passed to FORMS, which are then evaluated sequentially. Returns
-the target form."
-  (declare (indent 1))
-  (let ((retval (make-symbol "value")))
-    `(let ((,retval ,eval-initial-value))
-       ,@(mapcar (lambda (form)
-                   (if (sequencep form)
-                       `(,(-first-item form) ,retval ,@(cdr form))
-                     `(funcall form ,retval)))
-                 forms)
-       ,retval)))
-
-(defun -each (list fn)
-  "Call FN with every item in LIST. Return nil, used for side-effects only."
-  (--each list (funcall fn it)))
-
-(put '-each 'lisp-indent-function 1)
-
-(defalias '--each-indexed '--each)
-
-(defun -each-indexed (list fn)
-  "Call (FN index item) for each item in LIST.
-
-In the anaphoric form `--each-indexed', the index is exposed as symbol `it-index'.
-
-See also: `-map-indexed'."
-  (--each list (funcall fn it-index it)))
-(put '-each-indexed 'lisp-indent-function 1)
-
-(defmacro --each-while (list pred &rest body)
-  "Anaphoric form of `-each-while'."
-  (declare (debug (form form body))
-           (indent 2))
-  (let ((l (make-symbol "list"))
-        (c (make-symbol "continue")))
-    `(let ((,l ,list)
-           (,c t)
-           (it-index 0))
-       (while (and ,l ,c)
-         (let ((it (car ,l)))
-           (if (not ,pred) (setq ,c nil) ,@body))
-         (setq it-index (1+ it-index))
-         (!cdr ,l)))))
-
-(defun -each-while (list pred fn)
-  "Call FN with every item in LIST while (PRED item) is non-nil.
-Return nil, used for side-effects only."
-  (--each-while list (funcall pred it) (funcall fn it)))
-
-(put '-each-while 'lisp-indent-function 2)
-
-(defmacro --dotimes (num &rest body)
-  "Repeatedly executes BODY (presumably for side-effects) with symbol `it' bound to integers from 0 through NUM-1."
-  (declare (debug (form body))
-           (indent 1))
-  (let ((n (make-symbol "num")))
-    `(let ((,n ,num)
-           (it 0))
-       (while (< it ,n)
-         ,@body
-         (setq it (1+ it))))))
-
-(defun -dotimes (num fn)
-  "Repeatedly calls FN (presumably for side-effects) passing in integers from 0 through NUM-1."
-  (--dotimes num (funcall fn it)))
-
-(put '-dotimes 'lisp-indent-function 1)
-
-(defun -map (fn list)
-  "Return a new list consisting of the result of applying FN to the items in LIST."
-  (mapcar fn list))
-
-(defmacro --map (form list)
-  "Anaphoric form of `-map'."
-  (declare (debug (form form)))
-  `(mapcar (lambda (it) ,form) ,list))
-
-(defmacro --reduce-from (form initial-value list)
-  "Anaphoric form of `-reduce-from'."
-  (declare (debug (form form form)))
-  `(let ((acc ,initial-value))
-     (--each ,list (setq acc ,form))
-     acc))
-
-(defun -reduce-from (fn initial-value list)
-  "Return the result of applying FN to INITIAL-VALUE and the
-first item in LIST, then applying FN to that result and the 2nd
-item, etc. If LIST contains no items, return INITIAL-VALUE and
-FN is not called.
-
-In the anaphoric form `--reduce-from', the accumulated value is
-exposed as symbol `acc'.
-
-See also: `-reduce', `-reduce-r'"
-  (--reduce-from (funcall fn acc it) initial-value list))
-
-(defmacro --reduce (form list)
-  "Anaphoric form of `-reduce'."
-  (declare (debug (form form)))
-  (let ((lv (make-symbol "list-value")))
-    `(let ((,lv ,list))
-       (if ,lv
-           (--reduce-from ,form (car ,lv) (cdr ,lv))
-         (let (acc it) ,form)))))
-
-(defun -reduce (fn list)
-  "Return the result of applying FN to the first 2 items in LIST,
-then applying FN to that result and the 3rd item, etc. If LIST
-contains no items, FN must accept no arguments as well, and
-reduce return the result of calling FN with no arguments. If
-LIST has only 1 item, it is returned and FN is not called.
-
-In the anaphoric form `--reduce', the accumulated value is
-exposed as symbol `acc'.
-
-See also: `-reduce-from', `-reduce-r'"
-  (if list
-      (-reduce-from fn (car list) (cdr list))
-    (funcall fn)))
-
-(defun -reduce-r-from (fn initial-value list)
-  "Replace conses with FN, nil with INITIAL-VALUE and evaluate
-the resulting expression. If LIST is empty, INITIAL-VALUE is
-returned and FN is not called.
-
-Note: this function works the same as `-reduce-from' but the
-operation associates from right instead of from left.
-
-See also: `-reduce-r', `-reduce'"
-  (if (not list) initial-value
-    (funcall fn (car list) (-reduce-r-from fn initial-value (cdr list)))))
-
-(defmacro --reduce-r-from (form initial-value list)
-  "Anaphoric version of `-reduce-r-from'."
-  (declare (debug (form form form)))
-  `(-reduce-r-from (lambda (&optional it acc) ,form) ,initial-value ,list))
-
-(defun -reduce-r (fn list)
-  "Replace conses with FN and evaluate the resulting expression.
-The final nil is ignored. If LIST contains no items, FN must
-accept no arguments as well, and reduce return the result of
-calling FN with no arguments. If LIST has only 1 item, it is
-returned and FN is not called.
-
-The first argument of FN is the new item, the second is the
-accumulated value.
-
-Note: this function works the same as `-reduce' but the operation
-associates from right instead of from left.
-
-See also: `-reduce-r-from', `-reduce'"
-  (cond
-   ((not list) (funcall fn))
-   ((not (cdr list)) (car list))
-   (t (funcall fn (car list) (-reduce-r fn (cdr list))))))
-
-(defmacro --reduce-r (form list)
-  "Anaphoric version of `-reduce-r'."
-  (declare (debug (form form)))
-  `(-reduce-r (lambda (&optional it acc) ,form) ,list))
-
-(defmacro --filter (form list)
-  "Anaphoric form of `-filter'."
-  (declare (debug (form form)))
-  (let ((r (make-symbol "result")))
-    `(let (,r)
-       (--each ,list (when ,form (!cons it ,r)))
-       (nreverse ,r))))
-
-(defun -filter (pred list)
-  "Return a new list of the items in LIST for which PRED returns a non-nil value.
-
-Alias: `-select'
-
-See also: `-keep'"
-  (--filter (funcall pred it) list))
-
-(defalias '-select '-filter)
-(defalias '--select '--filter)
-
-(defmacro --remove (form list)
-  "Anaphoric form of `-remove'."
-  (declare (debug (form form)))
-  `(--filter (not ,form) ,list))
-
-(defun -remove (pred list)
-  "Return a new list of the items in LIST for which PRED returns nil.
-
-Alias: `-reject'"
-  (--remove (funcall pred it) list))
-
-(defalias '-reject '-remove)
-(defalias '--reject '--remove)
-
-(defun -remove-first (pred list)
-  "Return a new list with the first item matching PRED removed.
-
-Alias: `-reject-first'
-
-See also: `-remove', `-map-first'"
-  (let (front)
-    (while (and list (not (funcall pred (car list))))
-      (push (car list) front)
-      (!cdr list))
-    (if list
-        (-concat (nreverse front) (cdr list))
-      (nreverse front))))
-
-(defmacro --remove-first (form list)
-  "Anaphoric form of `-remove-first'."
-  (declare (debug (form form)))
-  `(-remove-first (lambda (it) ,form) ,list))
-
-(defalias '-reject-first '-remove-first)
-(defalias '--reject-first '--remove-first)
-
-(defun -remove-last (pred list)
-  "Return a new list with the last item matching PRED removed.
-
-Alias: `-reject-last'
-
-See also: `-remove', `-map-last'"
-  (nreverse (-remove-first pred (reverse list))))
-
-(defmacro --remove-last (form list)
-  "Anaphoric form of `-remove-last'."
-  (declare (debug (form form)))
-  `(-remove-last (lambda (it) ,form) ,list))
-
-(defalias '-reject-last '-remove-last)
-(defalias '--reject-last '--remove-last)
-
-(defun -remove-item (item list)
-  "Remove all occurences of ITEM from LIST.
-
-Comparison is done with `equal'."
-  (declare (pure t) (side-effect-free t))
-  (--remove (equal it item) list))
-
-(defmacro --keep (form list)
-  "Anaphoric form of `-keep'."
-  (declare (debug (form form)))
-  (let ((r (make-symbol "result"))
-        (m (make-symbol "mapped")))
-    `(let (,r)
-       (--each ,list (let ((,m ,form)) (when ,m (!cons ,m ,r))))
-       (nreverse ,r))))
-
-(defun -keep (fn list)
-  "Return a new list of the non-nil results of applying FN to the items in LIST.
-
-If you want to select the original items satisfying a predicate use `-filter'."
-  (--keep (funcall fn it) list))
-
-(defun -non-nil (list)
-  "Return all non-nil elements of LIST."
-  (declare (pure t) (side-effect-free t))
-  (-remove 'null list))
-
-(defmacro --map-indexed (form list)
-  "Anaphoric form of `-map-indexed'."
-  (declare (debug (form form)))
-  (let ((r (make-symbol "result")))
-    `(let (,r)
-       (--each ,list
-         (!cons ,form ,r))
-       (nreverse ,r))))
-
-(defun -map-indexed (fn list)
-  "Return a new list consisting of the result of (FN index item) for each item in LIST.
-
-In the anaphoric form `--map-indexed', the index is exposed as symbol `it-index'.
-
-See also: `-each-indexed'."
-  (--map-indexed (funcall fn it-index it) list))
-
-(defmacro --map-when (pred rep list)
-  "Anaphoric form of `-map-when'."
-  (declare (debug (form form form)))
-  (let ((r (make-symbol "result")))
-    `(let (,r)
-       (--each ,list (!cons (if ,pred ,rep it) ,r))
-       (nreverse ,r))))
-
-(defun -map-when (pred rep list)
-  "Return a new list where the elements in LIST that do not match the PRED function
-are unchanged, and where the elements in LIST that do match the PRED function are mapped
-through the REP function.
-
-Alias: `-replace-where'
-
-See also: `-update-at'"
-  (--map-when (funcall pred it) (funcall rep it) list))
-
-(defalias '-replace-where '-map-when)
-(defalias '--replace-where '--map-when)
-
-(defun -map-first (pred rep list)
-  "Replace first item in LIST satisfying PRED with result of REP called on this item.
-
-See also: `-map-when', `-replace-first'"
-  (let (front)
-    (while (and list (not (funcall pred (car list))))
-      (push (car list) front)
-      (!cdr list))
-    (if list
-        (-concat (nreverse front) (cons (funcall rep (car list)) (cdr list)))
-      (nreverse front))))
-
-(defmacro --map-first (pred rep list)
-  "Anaphoric form of `-map-first'."
-  `(-map-first (lambda (it) ,pred) (lambda (it) (ignore it) ,rep) ,list))
-
-(defun -map-last (pred rep list)
-  "Replace last item in LIST satisfying PRED with result of REP called on this item.
-
-See also: `-map-when', `-replace-last'"
-  (nreverse (-map-first pred rep (reverse list))))
-
-(defmacro --map-last (pred rep list)
-  "Anaphoric form of `-map-last'."
-  `(-map-last (lambda (it) ,pred) (lambda (it) (ignore it) ,rep) ,list))
-
-(defun -replace (old new list)
-  "Replace all OLD items in LIST with NEW.
-
-Elements are compared using `equal'.
-
-See also: `-replace-at'"
-  (declare (pure t) (side-effect-free t))
-  (--map-when (equal it old) new list))
-
-(defun -replace-first (old new list)
-  "Replace the first occurence of OLD with NEW in LIST.
-
-Elements are compared using `equal'.
-
-See also: `-map-first'"
-  (declare (pure t) (side-effect-free t))
-  (--map-first (equal old it) new list))
-
-(defun -replace-last (old new list)
-  "Replace the last occurence of OLD with NEW in LIST.
-
-Elements are compared using `equal'.
-
-See also: `-map-last'"
-  (declare (pure t) (side-effect-free t))
-  (--map-last (equal old it) new list))
-
-(defmacro --mapcat (form list)
-  "Anaphoric form of `-mapcat'."
-  (declare (debug (form form)))
-  `(apply 'append (--map ,form ,list)))
-
-(defun -mapcat (fn list)
-  "Return the concatenation of the result of mapping FN over LIST.
-Thus function FN should return a list."
-  (--mapcat (funcall fn it) list))
-
-(defun -flatten (l)
-  "Take a nested list L and return its contents as a single, flat list.
-
-Note that because `nil' represents a list of zero elements (an
-empty list), any mention of nil in L will disappear after
-flattening.  If you need to preserve nils, consider `-flatten-n'
-or map them to some unique symbol and then map them back.
-
-Conses of two atoms are considered \"terminals\", that is, they
-aren't flattened further.
-
-See also: `-flatten-n'"
-  (declare (pure t) (side-effect-free t))
-  (if (and (listp l) (listp (cdr l)))
-      (-mapcat '-flatten l)
-    (list l)))
-
-(defmacro --iterate (form init n)
-  "Anaphoric version of `-iterate'."
-  (declare (debug (form form form)))
-  `(-iterate (lambda (it) ,form) ,init ,n))
-
-(defun -flatten-n (num list)
-  "Flatten NUM levels of a nested LIST.
-
-See also: `-flatten'"
-  (declare (pure t) (side-effect-free t))
-  (-last-item (--iterate (--mapcat (-list it) it) list (1+ num))))
-
-(defun -concat (&rest lists)
-  "Return a new list with the concatenation of the elements in the supplied LISTS."
-  (declare (pure t) (side-effect-free t))
-  (apply 'append lists))
-
-(defalias '-copy 'copy-sequence
-  "Create a shallow copy of LIST.
-
-\(fn LIST)")
-
-(defun -splice (pred fun list)
-  "Splice lists generated by FUN in place of elements matching PRED in LIST.
-
-FUN takes the element matching PRED as input.
-
-This function can be used as replacement for `,@' in case you
-need to splice several lists at marked positions (for example
-with keywords).
-
-See also: `-splice-list', `-insert-at'"
-  (let (r)
-    (--each list
-      (if (funcall pred it)
-          (let ((new (funcall fun it)))
-            (--each new (!cons it r)))
-        (!cons it r)))
-    (nreverse r)))
-
-(defmacro --splice (pred form list)
-  "Anaphoric form of `-splice'."
-  `(-splice (lambda (it) ,pred) (lambda (it) ,form) ,list))
-
-(defun -splice-list (pred new-list list)
-  "Splice NEW-LIST in place of elements matching PRED in LIST.
-
-See also: `-splice', `-insert-at'"
-  (-splice pred (lambda (_) new-list) list))
-
-(defmacro --splice-list (pred new-list list)
-  "Anaphoric form of `-splice-list'."
-  `(-splice-list (lambda (it) ,pred) ,new-list ,list))
-
-(defun -cons* (&rest args)
-  "Make a new list from the elements of ARGS.
-
-The last 2 members of ARGS are used as the final cons of the
-result so if the final member of ARGS is not a list the result is
-a dotted list."
-  (declare (pure t) (side-effect-free t))
-  (-reduce-r 'cons args))
-
-(defun -snoc (list elem &rest elements)
-  "Append ELEM to the end of the list.
-
-This is like `cons', but operates on the end of list.
-
-If ELEMENTS is non nil, append these to the list as well."
-  (-concat list (list elem) elements))
-
-(defmacro --first (form list)
-  "Anaphoric form of `-first'."
-  (declare (debug (form form)))
-  (let ((n (make-symbol "needle")))
-    `(let (,n)
-       (--each-while ,list (not ,n)
-         (when ,form (setq ,n it)))
-       ,n)))
-
-(defun -first (pred list)
-  "Return the first x in LIST where (PRED x) is non-nil, else nil.
-
-To get the first item in the list no questions asked, use `car'.
-
-Alias: `-find'"
-  (--first (funcall pred it) list))
-
-(defalias '-find '-first)
-(defalias '--find '--first)
-
-(defmacro --some (form list)
-  "Anaphoric form of `-some'."
-  (declare (debug (form form)))
-  (let ((n (make-symbol "needle")))
-    `(let (,n)
-       (--each-while ,list (not ,n)
-         (setq ,n ,form))
-       ,n)))
-
-(defun -some (pred list)
-  "Return (PRED x) for the first LIST item where (PRED x) is non-nil, else nil.
-
-Alias: `-any'"
-  (--some (funcall pred it) list))
-
-(defalias '-any '-some)
-(defalias '--any '--some)
-
-(defmacro --last (form list)
-  "Anaphoric form of `-last'."
-  (declare (debug (form form)))
-  (let ((n (make-symbol "needle")))
-    `(let (,n)
-       (--each ,list
-         (when ,form (setq ,n it)))
-       ,n)))
-
-(defun -last (pred list)
-  "Return the last x in LIST where (PRED x) is non-nil, else nil."
-  (--last (funcall pred it) list))
-
-(defalias '-first-item 'car
-  "Return the first item of LIST, or nil on an empty list.
-
-\(fn LIST)")
-
-;; Ensure that calls to `-first-item' are compiled to a single opcode,
-;; just like `car'.
-(put '-first-item 'byte-opcode 'byte-car)
-(put '-first-item 'byte-compile 'byte-compile-one-arg)
-
-;; TODO: emacs23 support, when dropped remove the condition
-(eval-when-compile
-  (require 'cl)
-  (if (fboundp 'gv-define-simple-setter)
-      (gv-define-simple-setter -first-item setcar)
-    (require 'cl)
-    (with-no-warnings
-      (defsetf -first-item (x) (val) `(setcar ,x ,val)))))
-
-(defun -last-item (list)
-  "Return the last item of LIST, or nil on an empty list."
-  (declare (pure t) (side-effect-free t))
-  (car (last list)))
-
-;; TODO: emacs23 support, when dropped remove the condition
-(eval-when-compile
-  (if (fboundp 'gv-define-setter)
-      (gv-define-setter -last-item (val x) `(setcar (last ,x) ,val))
-    (with-no-warnings
-      (defsetf -last-item (x) (val) `(setcar (last ,x) ,val)))))
-
-(defun -butlast (list)
-  "Return a list of all items in list except for the last."
-  ;; no alias as we don't want magic optional argument
-  (declare (pure t) (side-effect-free t))
-  (butlast list))
-
-(defmacro --count (pred list)
-  "Anaphoric form of `-count'."
-  (declare (debug (form form)))
-  (let ((r (make-symbol "result")))
-    `(let ((,r 0))
-       (--each ,list (when ,pred (setq ,r (1+ ,r))))
-       ,r)))
-
-(defun -count (pred list)
-  "Counts the number of items in LIST where (PRED item) is non-nil."
-  (--count (funcall pred it) list))
-
-(defun ---truthy? (val)
-  (declare (pure t) (side-effect-free t))
-  (not (null val)))
-
-(defmacro --any? (form list)
-  "Anaphoric form of `-any?'."
-  (declare (debug (form form)))
-  `(---truthy? (--first ,form ,list)))
-
-(defun -any? (pred list)
-  "Return t if (PRED x) is non-nil for any x in LIST, else nil.
-
-Alias: `-any-p', `-some?', `-some-p'"
-  (--any? (funcall pred it) list))
-
-(defalias '-some? '-any?)
-(defalias '--some? '--any?)
-(defalias '-any-p '-any?)
-(defalias '--any-p '--any?)
-(defalias '-some-p '-any?)
-(defalias '--some-p '--any?)
-
-(defmacro --all? (form list)
-  "Anaphoric form of `-all?'."
-  (declare (debug (form form)))
-  (let ((a (make-symbol "all")))
-    `(let ((,a t))
-       (--each-while ,list ,a (setq ,a ,form))
-       (---truthy? ,a))))
-
-(defun -all? (pred list)
-  "Return t if (PRED x) is non-nil for all x in LIST, else nil.
-
-Alias: `-all-p', `-every?', `-every-p'"
-  (--all? (funcall pred it) list))
-
-(defalias '-every? '-all?)
-(defalias '--every? '--all?)
-(defalias '-all-p '-all?)
-(defalias '--all-p '--all?)
-(defalias '-every-p '-all?)
-(defalias '--every-p '--all?)
-
-(defmacro --none? (form list)
-  "Anaphoric form of `-none?'."
-  (declare (debug (form form)))
-  `(--all? (not ,form) ,list))
-
-(defun -none? (pred list)
-  "Return t if (PRED x) is nil for all x in LIST, else nil.
-
-Alias: `-none-p'"
-  (--none? (funcall pred it) list))
-
-(defalias '-none-p '-none?)
-(defalias '--none-p '--none?)
-
-(defmacro --only-some? (form list)
-  "Anaphoric form of `-only-some?'."
-  (declare (debug (form form)))
-  (let ((y (make-symbol "yes"))
-        (n (make-symbol "no")))
-    `(let (,y ,n)
-       (--each-while ,list (not (and ,y ,n))
-         (if ,form (setq ,y t) (setq ,n t)))
-       (---truthy? (and ,y ,n)))))
-
-(defun -only-some? (pred list)
-  "Return `t` if at least one item of LIST matches PRED and at least one item of LIST does not match PRED.
-Return `nil` both if all items match the predicate or if none of the items match the predicate.
-
-Alias: `-only-some-p'"
-  (--only-some? (funcall pred it) list))
-
-(defalias '-only-some-p '-only-some?)
-(defalias '--only-some-p '--only-some?)
-
-(defun -slice (list from &optional to step)
-  "Return copy of LIST, starting from index FROM to index TO.
-
-FROM or TO may be negative.  These values are then interpreted
-modulo the length of the list.
-
-If STEP is a number, only each STEPth item in the resulting
-section is returned.  Defaults to 1."
-  (declare (pure t) (side-effect-free t))
-  (let ((length (length list))
-        (new-list nil))
-    ;; to defaults to the end of the list
-    (setq to (or to length))
-    (setq step (or step 1))
-    ;; handle negative indices
-    (when (< from 0)
-      (setq from (mod from length)))
-    (when (< to 0)
-      (setq to (mod to length)))
-
-    ;; iterate through the list, keeping the elements we want
-    (--each-while list (< it-index to)
-      (when (and (>= it-index from)
-                 (= (mod (- from it-index) step) 0))
-        (push it new-list)))
-    (nreverse new-list)))
-
-(defun -take (n list)
-  "Return a new list of the first N items in LIST, or all items if there are fewer than N.
-
-See also: `-take-last'"
-  (declare (pure t) (side-effect-free t))
-  (let (result)
-    (--dotimes n
-      (when list
-        (!cons (car list) result)
-        (!cdr list)))
-    (nreverse result)))
-
-(defun -take-last (n list)
-  "Return the last N items of LIST in order.
-
-See also: `-take'"
-  (declare (pure t) (side-effect-free t))
-  (copy-sequence (last list n)))
-
-(defalias '-drop 'nthcdr
-  "Return the tail of LIST without the first N items.
-
-See also: `-drop-last'
-
-\(fn N LIST)")
-
-(defun -drop-last (n list)
-  "Remove the last N items of LIST and return a copy.
-
-See also: `-drop'"
-  ;; No alias because we don't want magic optional argument
-  (declare (pure t) (side-effect-free t))
-  (butlast list n))
-
-(defmacro --take-while (form list)
-  "Anaphoric form of `-take-while'."
-  (declare (debug (form form)))
-  (let ((r (make-symbol "result")))
-    `(let (,r)
-       (--each-while ,list ,form (!cons it ,r))
-       (nreverse ,r))))
-
-(defun -take-while (pred list)
-  "Return a new list of successive items from LIST while (PRED item) returns a non-nil value."
-  (--take-while (funcall pred it) list))
-
-(defmacro --drop-while (form list)
-  "Anaphoric form of `-drop-while'."
-  (declare (debug (form form)))
-  (let ((l (make-symbol "list")))
-    `(let ((,l ,list))
-       (while (and ,l (let ((it (car ,l))) ,form))
-         (!cdr ,l))
-       ,l)))
-
-(defun -drop-while (pred list)
-  "Return the tail of LIST starting from the first item for which (PRED item) returns nil."
-  (--drop-while (funcall pred it) list))
-
-(defun -split-at (n list)
-  "Return a list of ((-take N LIST) (-drop N LIST)), in no more than one pass through the list."
-  (declare (pure t) (side-effect-free t))
-  (let (result)
-    (--dotimes n
-      (when list
-        (!cons (car list) result)
-        (!cdr list)))
-    (list (nreverse result) list)))
-
-(defun -rotate (n list)
-  "Rotate LIST N places to the right.  With N negative, rotate to the left.
-The time complexity is O(n)."
-  (declare (pure t) (side-effect-free t))
-  (if (> n 0)
-      (append (last list n) (butlast list n))
-    (append (-drop (- n) list) (-take (- n) list))))
-
-(defun -insert-at (n x list)
-  "Return a list with X inserted into LIST at position N.
-
-See also: `-splice', `-splice-list'"
-  (declare (pure t) (side-effect-free t))
-  (let ((split-list (-split-at n list)))
-    (nconc (car split-list) (cons x (cadr split-list)))))
-
-(defun -replace-at (n x list)
-  "Return a list with element at Nth position in LIST replaced with X.
-
-See also: `-replace'"
-  (declare (pure t) (side-effect-free t))
-  (let ((split-list (-split-at n list)))
-    (nconc (car split-list) (cons x (cdr (cadr split-list))))))
-
-(defun -update-at (n func list)
-  "Return a list with element at Nth position in LIST replaced with `(func (nth n list))`.
-
-See also: `-map-when'"
-  (let ((split-list (-split-at n list)))
-    (nconc (car split-list) (cons (funcall func (car (cadr split-list))) (cdr (cadr split-list))))))
-
-(defmacro --update-at (n form list)
-  "Anaphoric version of `-update-at'."
-  (declare (debug (form form form)))
-  `(-update-at ,n (lambda (it) ,form) ,list))
-
-(defun -remove-at (n list)
-  "Return a list with element at Nth position in LIST removed.
-
-See also: `-remove-at-indices', `-remove'"
-  (declare (pure t) (side-effect-free t))
-  (-remove-at-indices (list n) list))
-
-(defun -remove-at-indices (indices list)
-  "Return a list whose elements are elements from LIST without
-elements selected as `(nth i list)` for all i
-from INDICES.
-
-See also: `-remove-at', `-remove'"
-  (declare (pure t) (side-effect-free t))
-  (let* ((indices (-sort '< indices))
-         (diffs (cons (car indices) (-map '1- (-zip-with '- (cdr indices) indices))))
-         r)
-    (--each diffs
-      (let ((split (-split-at it list)))
-        (!cons (car split) r)
-        (setq list (cdr (cadr split)))))
-    (!cons list r)
-    (apply '-concat (nreverse r))))
-
-(defmacro --split-with (pred list)
-  "Anaphoric form of `-split-with'."
-  (declare (debug (form form)))
-  (let ((l (make-symbol "list"))
-        (r (make-symbol "result"))
-        (c (make-symbol "continue")))
-    `(let ((,l ,list)
-           (,r nil)
-           (,c t))
-       (while (and ,l ,c)
-         (let ((it (car ,l)))
-           (if (not ,pred)
-               (setq ,c nil)
-             (!cons it ,r)
-             (!cdr ,l))))
-       (list (nreverse ,r) ,l))))
-
-(defun -split-with (pred list)
-  "Return a list of ((-take-while PRED LIST) (-drop-while PRED LIST)), in no more than one pass through the list."
-  (--split-with (funcall pred it) list))
-
-(defmacro -split-on (item list)
-  "Split the LIST each time ITEM is found.
-
-Unlike `-partition-by', the ITEM is discarded from the results.
-Empty lists are also removed from the result.
-
-Comparison is done by `equal'.
-
-See also `-split-when'"
-  (declare (debug (form form)))
-  `(-split-when (lambda (it) (equal it ,item)) ,list))
-
-(defmacro --split-when (form list)
-  "Anaphoric version of `-split-when'."
-  (declare (debug (form form)))
-  `(-split-when (lambda (it) ,form) ,list))
-
-(defun -split-when (fn list)
-  "Split the LIST on each element where FN returns non-nil.
-
-Unlike `-partition-by', the \"matched\" element is discarded from
-the results.  Empty lists are also removed from the result.
-
-This function can be thought of as a generalization of
-`split-string'."
-  (let (r s)
-    (while list
-      (if (not (funcall fn (car list)))
-          (push (car list) s)
-        (when s (push (nreverse s) r))
-        (setq s nil))
-      (!cdr list))
-    (when s (push (nreverse s) r))
-    (nreverse r)))
-
-(defmacro --separate (form list)
-  "Anaphoric form of `-separate'."
-  (declare (debug (form form)))
-  (let ((y (make-symbol "yes"))
-        (n (make-symbol "no")))
-    `(let (,y ,n)
-       (--each ,list (if ,form (!cons it ,y) (!cons it ,n)))
-       (list (nreverse ,y) (nreverse ,n)))))
-
-(defun -separate (pred list)
-  "Return a list of ((-filter PRED LIST) (-remove PRED LIST)), in one pass through the list."
-  (--separate (funcall pred it) list))
-
-(defun ---partition-all-in-steps-reversed (n step list)
-  "Private: Used by -partition-all-in-steps and -partition-in-steps."
-  (when (< step 1)
-    (error "Step must be a positive number, or you're looking at some juicy infinite loops."))
-  (let ((result nil))
-    (while list
-      (!cons (-take n list) result)
-      (setq list (-drop step list)))
-    result))
-
-(defun -partition-all-in-steps (n step list)
-  "Return a new list with the items in LIST grouped into N-sized sublists at offsets STEP apart.
-The last groups may contain less than N items."
-  (declare (pure t) (side-effect-free t))
-  (nreverse (---partition-all-in-steps-reversed n step list)))
-
-(defun -partition-in-steps (n step list)
-  "Return a new list with the items in LIST grouped into N-sized sublists at offsets STEP apart.
-If there are not enough items to make the last group N-sized,
-those items are discarded."
-  (declare (pure t) (side-effect-free t))
-  (let ((result (---partition-all-in-steps-reversed n step list)))
-    (while (and result (< (length (car result)) n))
-      (!cdr result))
-    (nreverse result)))
-
-(defun -partition-all (n list)
-  "Return a new list with the items in LIST grouped into N-sized sublists.
-The last group may contain less than N items."
-  (declare (pure t) (side-effect-free t))
-  (-partition-all-in-steps n n list))
-
-(defun -partition (n list)
-  "Return a new list with the items in LIST grouped into N-sized sublists.
-If there are not enough items to make the last group N-sized,
-those items are discarded."
-  (declare (pure t) (side-effect-free t))
-  (-partition-in-steps n n list))
-
-(defmacro --partition-by (form list)
-  "Anaphoric form of `-partition-by'."
-  (declare (debug (form form)))
-  (let ((r (make-symbol "result"))
-        (s (make-symbol "sublist"))
-        (v (make-symbol "value"))
-        (n (make-symbol "new-value"))
-        (l (make-symbol "list")))
-    `(let ((,l ,list))
-       (when ,l
-         (let* ((,r nil)
-                (it (car ,l))
-                (,s (list it))
-                (,v ,form)
-                (,l (cdr ,l)))
-           (while ,l
-             (let* ((it (car ,l))
-                    (,n ,form))
-               (unless (equal ,v ,n)
-                 (!cons (nreverse ,s) ,r)
-                 (setq ,s nil)
-                 (setq ,v ,n))
-               (!cons it ,s)
-               (!cdr ,l)))
-           (!cons (nreverse ,s) ,r)
-           (nreverse ,r))))))
-
-(defun -partition-by (fn list)
-  "Apply FN to each item in LIST, splitting it each time FN returns a new value."
-  (--partition-by (funcall fn it) list))
-
-(defmacro --partition-by-header (form list)
-  "Anaphoric form of `-partition-by-header'."
-  (declare (debug (form form)))
-  (let ((r (make-symbol "result"))
-        (s (make-symbol "sublist"))
-        (h (make-symbol "header-value"))
-        (b (make-symbol "seen-body?"))
-        (n (make-symbol "new-value"))
-        (l (make-symbol "list")))
-    `(let ((,l ,list))
-       (when ,l
-         (let* ((,r nil)
-                (it (car ,l))
-                (,s (list it))
-                (,h ,form)
-                (,b nil)
-                (,l (cdr ,l)))
-           (while ,l
-             (let* ((it (car ,l))
-                    (,n ,form))
-               (if (equal ,h ,n)
-                   (when ,b
-                     (!cons (nreverse ,s) ,r)
-                     (setq ,s nil)
-                     (setq ,b nil))
-                 (setq ,b t))
-               (!cons it ,s)
-               (!cdr ,l)))
-           (!cons (nreverse ,s) ,r)
-           (nreverse ,r))))))
-
-(defun -partition-by-header (fn list)
-  "Apply FN to the first item in LIST. That is the header
-value. Apply FN to each item in LIST, splitting it each time FN
-returns the header value, but only after seeing at least one
-other value (the body)."
-  (--partition-by-header (funcall fn it) list))
-
-(defun -partition-after-pred (pred list)
-  "Partition directly after each time PRED is true on an element of LIST."
-  (when list
-    (let ((rest (-partition-after-pred pred
-                                       (cdr list))))
-      (if (funcall pred (car list))
-          ;;split after (car list)
-          (cons (list (car list))
-                rest)
-
-        ;;don't split after (car list)
-        (cons (cons (car list)
-                    (car rest))
-              (cdr rest))))))
-
-(defun -partition-before-pred (pred list)
-  "Partition directly before each time PRED is true on an element of LIST."
-  (nreverse (-map #'reverse
-                  (-partition-after-pred pred (reverse list)))))
-
-(defun -partition-after-item (item list)
-  "Partition directly after each time ITEM appears in LIST."
-  (-partition-after-pred (lambda (ele) (equal ele item))
-                         list))
-
-(defun -partition-before-item (item list)
-  "Partition directly before each time ITEM appears in LIST."
-  (-partition-before-pred (lambda (ele) (equal ele item))
-                          list))
-
-(defmacro --group-by (form list)
-  "Anaphoric form of `-group-by'."
-  (declare (debug t))
-  (let ((n (make-symbol "n"))
-        (k (make-symbol "k"))
-        (grp (make-symbol "grp")))
-    `(nreverse
-      (-map
-       (lambda (,n)
-         (cons (car ,n)
-               (nreverse (cdr ,n))))
-       (--reduce-from
-        (let* ((,k (,@form))
-               (,grp (assoc ,k acc)))
-          (if ,grp
-              (setcdr ,grp (cons it (cdr ,grp)))
-            (push
-             (list ,k it)
-             acc))
-          acc)
-        nil ,list)))))
-
-(defun -group-by (fn list)
-  "Separate LIST into an alist whose keys are FN applied to the
-elements of LIST.  Keys are compared by `equal'."
-  (--group-by (funcall fn it) list))
-
-(defun -interpose (sep list)
-  "Return a new list of all elements in LIST separated by SEP."
-  (declare (pure t) (side-effect-free t))
-  (let (result)
-    (when list
-      (!cons (car list) result)
-      (!cdr list))
-    (while list
-      (setq result (cons (car list) (cons sep result)))
-      (!cdr list))
-    (nreverse result)))
-
-(defun -interleave (&rest lists)
-  "Return a new list of the first item in each list, then the second etc."
-  (declare (pure t) (side-effect-free t))
-  (let (result)
-    (while (-none? 'null lists)
-      (--each lists (!cons (car it) result))
-      (setq lists (-map 'cdr lists)))
-    (nreverse result)))
-
-(defmacro --zip-with (form list1 list2)
-  "Anaphoric form of `-zip-with'.
-
-The elements in list1 are bound as symbol `it', the elements in list2 as symbol `other'."
-  (declare (debug (form form form)))
-  (let ((r (make-symbol "result"))
-        (l1 (make-symbol "list1"))
-        (l2 (make-symbol "list2")))
-    `(let ((,r nil)
-           (,l1 ,list1)
-           (,l2 ,list2))
-       (while (and ,l1 ,l2)
-         (let ((it (car ,l1))
-               (other (car ,l2)))
-           (!cons ,form ,r)
-           (!cdr ,l1)
-           (!cdr ,l2)))
-       (nreverse ,r))))
-
-(defun -zip-with (fn list1 list2)
-  "Zip the two lists LIST1 and LIST2 using a function FN.  This
-function is applied pairwise taking as first argument element of
-LIST1 and as second argument element of LIST2 at corresponding
-position.
-
-The anaphoric form `--zip-with' binds the elements from LIST1 as symbol `it',
-and the elements from LIST2 as symbol `other'."
-  (--zip-with (funcall fn it other) list1 list2))
-
-(defun -zip (&rest lists)
-  "Zip LISTS together.  Group the head of each list, followed by the
-second elements of each list, and so on. The lengths of the returned
-groupings are equal to the length of the shortest input list.
-
-If two lists are provided as arguments, return the groupings as a list
-of cons cells. Otherwise, return the groupings as a list of lists.
-
-Please note! This distinction is being removed in an upcoming 3.0
-release of Dash. If you rely on this behavior, use -zip-pair instead."
-  (declare (pure t) (side-effect-free t))
-  (let (results)
-    (while (-none? 'null lists)
-      (setq results (cons (mapcar 'car lists) results))
-      (setq lists (mapcar 'cdr lists)))
-    (setq results (nreverse results))
-    (if (= (length lists) 2)
-        ;; to support backward compatability, return
-        ;; a cons cell if two lists were provided
-        (--map (cons (car it) (cadr it)) results)
-      results)))
-
-(defalias '-zip-pair '-zip)
-
-(defun -zip-fill (fill-value &rest lists)
-  "Zip LISTS, with FILL-VALUE padded onto the shorter lists. The
-lengths of the returned groupings are equal to the length of the
-longest input list."
-  (declare (pure t) (side-effect-free t))
-  (apply '-zip (apply '-pad (cons fill-value lists))))
-
-(defun -unzip (lists)
-  "Unzip LISTS.
-
-This works just like `-zip' but takes a list of lists instead of
-a variable number of arguments, such that
-
-  (-unzip (-zip L1 L2 L3 ...))
-
-is identity (given that the lists are the same length).
-
-See also: `-zip'"
-  (apply '-zip lists))
-
-(defun -cycle (list)
-  "Return an infinite copy of LIST that will cycle through the
-elements and repeat from the beginning."
-  (declare (pure t) (side-effect-free t))
-  (let ((newlist (-map 'identity list)))
-    (nconc newlist newlist)))
-
-(defun -pad (fill-value &rest lists)
-  "Appends FILL-VALUE to the end of each list in LISTS such that they
-will all have the same length."
-  (let* ((annotations (-annotate 'length lists))
-         (n (-max (-map 'car annotations))))
-    (--map (append (cdr it) (-repeat (- n (car it)) fill-value)) annotations)))
-
-(defun -annotate (fn list)
-  "Return a list of cons cells where each cell is FN applied to each
-element of LIST paired with the unmodified element of LIST."
-  (-zip (-map fn list) list))
-
-(defmacro --annotate (form list)
-  "Anaphoric version of `-annotate'."
-  (declare (debug (form form)))
-  `(-annotate (lambda (it) ,form) ,list))
-
-(defun dash--table-carry (lists restore-lists &optional re)
-  "Helper for `-table' and `-table-flat'.
-
-If a list overflows, carry to the right and reset the list."
-  (while (not (or (car lists)
-                  (equal lists '(nil))))
-    (setcar lists (car restore-lists))
-    (pop (cadr lists))
-    (!cdr lists)
-    (!cdr restore-lists)
-    (when re
-      (push (nreverse (car re)) (cadr re))
-      (setcar re nil)
-      (!cdr re))))
-
-(defun -table (fn &rest lists)
-  "Compute outer product of LISTS using function FN.
-
-The function FN should have the same arity as the number of
-supplied lists.
-
-The outer product is computed by applying fn to all possible
-combinations created by taking one element from each list in
-order.  The dimension of the result is (length lists).
-
-See also: `-table-flat'"
-  (let ((restore-lists (copy-sequence lists))
-        (last-list (last lists))
-        (re (make-list (length lists) nil)))
-    (while (car last-list)
-      (let ((item (apply fn (-map 'car lists))))
-        (push item (car re))
-        (setcar lists (cdar lists)) ;; silence byte compiler
-        (dash--table-carry lists restore-lists re)))
-    (nreverse (car (last re)))))
-
-(defun -table-flat (fn &rest lists)
-  "Compute flat outer product of LISTS using function FN.
-
-The function FN should have the same arity as the number of
-supplied lists.
-
-The outer product is computed by applying fn to all possible
-combinations created by taking one element from each list in
-order.  The results are flattened, ignoring the tensor structure
-of the result.  This is equivalent to calling:
-
-  (-flatten-n (1- (length lists)) (apply '-table fn lists))
-
-but the implementation here is much more efficient.
-
-See also: `-flatten-n', `-table'"
-  (let ((restore-lists (copy-sequence lists))
-        (last-list (last lists))
-        re)
-    (while (car last-list)
-      (let ((item (apply fn (-map 'car lists))))
-        (push item re)
-        (setcar lists (cdar lists)) ;; silence byte compiler
-        (dash--table-carry lists restore-lists)))
-    (nreverse re)))
-
-(defun -partial (fn &rest args)
-  "Take a function FN and fewer than the normal arguments to FN,
-and return a fn that takes a variable number of additional ARGS.
-When called, the returned function calls FN with ARGS first and
-then additional args."
-  (apply 'apply-partially fn args))
-
-(defun -elem-index (elem list)
-  "Return the index of the first element in the given LIST which
-is equal to the query element ELEM, or nil if there is no
-such element."
-  (declare (pure t) (side-effect-free t))
-  (car (-elem-indices elem list)))
-
-(defun -elem-indices (elem list)
-  "Return the indices of all elements in LIST equal to the query
-element ELEM, in ascending order."
-  (declare (pure t) (side-effect-free t))
-  (-find-indices (-partial 'equal elem) list))
-
-(defun -find-indices (pred list)
-  "Return the indices of all elements in LIST satisfying the
-predicate PRED, in ascending order."
-  (apply 'append (--map-indexed (when (funcall pred it) (list it-index)) list)))
-
-(defmacro --find-indices (form list)
-  "Anaphoric version of `-find-indices'."
-  (declare (debug (form form)))
-  `(-find-indices (lambda (it) ,form) ,list))
-
-(defun -find-index (pred list)
-  "Take a predicate PRED and a LIST and return the index of the
-first element in the list satisfying the predicate, or nil if
-there is no such element.
-
-See also `-first'."
-  (car (-find-indices pred list)))
-
-(defmacro --find-index (form list)
-  "Anaphoric version of `-find-index'."
-  (declare (debug (form form)))
-  `(-find-index (lambda (it) ,form) ,list))
-
-(defun -find-last-index (pred list)
-  "Take a predicate PRED and a LIST and return the index of the
-last element in the list satisfying the predicate, or nil if
-there is no such element.
-
-See also `-last'."
-  (-last-item (-find-indices pred list)))
-
-(defmacro --find-last-index (form list)
-  "Anaphoric version of `-find-last-index'."
-  `(-find-last-index (lambda (it) ,form) ,list))
-
-(defun -select-by-indices (indices list)
-  "Return a list whose elements are elements from LIST selected
-as `(nth i list)` for all i from INDICES."
-  (declare (pure t) (side-effect-free t))
-  (let (r)
-    (--each indices
-      (!cons (nth it list) r))
-    (nreverse r)))
-
-(defun -select-columns (columns table)
-  "Select COLUMNS from TABLE.
-
-TABLE is a list of lists where each element represents one row.
-It is assumed each row has the same length.
-
-Each row is transformed such that only the specified COLUMNS are
-selected.
-
-See also: `-select-column', `-select-by-indices'"
-  (declare (pure t) (side-effect-free t))
-  (--map (-select-by-indices columns it) table))
-
-(defun -select-column (column table)
-  "Select COLUMN from TABLE.
-
-TABLE is a list of lists where each element represents one row.
-It is assumed each row has the same length.
-
-The single selected column is returned as a list.
-
-See also: `-select-columns', `-select-by-indices'"
-  (declare (pure t) (side-effect-free t))
-  (--mapcat (-select-by-indices (list column) it) table))
-
-(defmacro -> (x &optional form &rest more)
-  "Thread the expr through the forms. Insert X as the second item
-in the first form, making a list of it if it is not a list
-already. If there are more forms, insert the first form as the
-second item in second form, etc."
-  (declare (debug (form &rest [&or symbolp (sexp &rest form)])))
-  (cond
-   ((null form) x)
-   ((null more) (if (listp form)
-                    `(,(car form) ,x ,@(cdr form))
-                  (list form x)))
-   (:else `(-> (-> ,x ,form) ,@more))))
-
-(defmacro ->> (x &optional form &rest more)
-  "Thread the expr through the forms. Insert X 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, insert the first form as the
-last item in second form, etc."
-  (declare (debug ->))
-  (cond
-   ((null form) x)
-   ((null more) (if (listp form)
-                    `(,@form ,x)
-                  (list form x)))
-   (:else `(->> (->> ,x ,form) ,@more))))
-
-(defmacro --> (x &rest forms)
-  "Starting with the value of X, thread each expression through FORMS.
-
-Insert X at the position signified by the symbol `it' in the first
-form.  If there are more forms, insert the first form at the position
-signified by `it' in in second form, etc."
-  (declare (debug (form body)))
-  `(-as-> ,x it ,@forms))
-
-(defmacro -as-> (value variable &rest forms)
-  "Starting with VALUE, thread VARIABLE through FORMS.
-
-In the first form, bind VARIABLE to VALUE.  In the second form, bind
-VARIABLE to the result of the first form, and so forth."
-  (declare (debug (form symbolp body)))
-  (if (null forms)
-      `,value
-    `(let ((,variable ,value))
-       (-as-> ,(if (symbolp (car forms))
-                 (list (car forms) variable)
-               (car forms))
-            ,variable
-              ,@(cdr forms)))))
-
-(defmacro -some-> (x &optional form &rest more)
-  "When expr is non-nil, thread it through the first form (via `->'),
-and when that result is non-nil, through the next form, etc."
-  (declare (debug ->))
-  (if (null form) x
-    (let ((result (make-symbol "result")))
-      `(-some-> (-when-let (,result ,x)
-                  (-> ,result ,form))
-                ,@more))))
-
-(defmacro -some->> (x &optional form &rest more)
-  "When expr is non-nil, thread it through the first form (via `->>'),
-and when that result is non-nil, through the next form, etc."
-  (declare (debug ->))
-  (if (null form) x
-    (let ((result (make-symbol "result")))
-      `(-some->> (-when-let (,result ,x)
-                   (->> ,result ,form))
-                 ,@more))))
-
-(defmacro -some--> (x &optional form &rest more)
-  "When expr in non-nil, thread it through the first form (via `-->'),
-and when that result is non-nil, through the next form, etc."
-  (declare (debug ->))
-  (if (null form) x
-    (let ((result (make-symbol "result")))
-      `(-some--> (-when-let (,result ,x)
-                   (--> ,result ,form))
-                 ,@more))))
-
-(defun -grade-up (comparator list)
-  "Grade elements of LIST using COMPARATOR relation, yielding a
-permutation vector such that applying this permutation to LIST
-sorts it in ascending order."
-  ;; ugly hack to "fix" lack of lexical scope
-  (let ((comp `(lambda (it other) (funcall ',comparator (car it) (car other)))))
-    (->> (--map-indexed (cons it it-index) list)
-         (-sort comp)
-         (-map 'cdr))))
-
-(defun -grade-down (comparator list)
-  "Grade elements of LIST using COMPARATOR relation, yielding a
-permutation vector such that applying this permutation to LIST
-sorts it in descending order."
-  ;; ugly hack to "fix" lack of lexical scope
-  (let ((comp `(lambda (it other) (funcall ',comparator (car other) (car it)))))
-    (->> (--map-indexed (cons it it-index) list)
-         (-sort comp)
-         (-map 'cdr))))
-
-(defvar dash--source-counter 0
-  "Monotonic counter for generated symbols.")
-
-(defun dash--match-make-source-symbol ()
-  "Generate a new dash-source symbol.
-
-All returned symbols are guaranteed to be unique."
-  (prog1 (make-symbol (format "--dash-source-%d--" dash--source-counter))
-    (setq dash--source-counter (1+ dash--source-counter))))
-
-(defun dash--match-ignore-place-p (symbol)
-  "Return non-nil if SYMBOL is a symbol and starts with _."
-  (and (symbolp symbol)
-       (eq (aref (symbol-name symbol) 0) ?_)))
-
-(defun dash--match-cons-skip-cdr (skip-cdr source)
-  "Helper function generating idiomatic shifting code."
-  (cond
-   ((= skip-cdr 0)
-    `(pop ,source))
-   (t
-    `(prog1 ,(dash--match-cons-get-car skip-cdr source)
-       (setq ,source ,(dash--match-cons-get-cdr (1+ skip-cdr) source))))))
-
-(defun dash--match-cons-get-car (skip-cdr source)
-  "Helper function generating idiomatic code to get nth car."
-  (cond
-   ((= skip-cdr 0)
-    `(car ,source))
-   ((= skip-cdr 1)
-    `(cadr ,source))
-   (t
-    `(nth ,skip-cdr ,source))))
-
-(defun dash--match-cons-get-cdr (skip-cdr source)
-  "Helper function generating idiomatic code to get nth cdr."
-  (cond
-   ((= skip-cdr 0)
-    source)
-   ((= skip-cdr 1)
-    `(cdr ,source))
-   (t
-    `(nthcdr ,skip-cdr ,source))))
-
-(defun dash--match-cons (match-form source)
-  "Setup a cons matching environment and call the real matcher."
-  (let ((s (dash--match-make-source-symbol))
-        (n 0)
-        (m match-form))
-    (while (and (consp m)
-                (dash--match-ignore-place-p (car m)))
-      (setq n (1+ n)) (!cdr m))
-    (cond
-     ;; when we only have one pattern in the list, we don't have to
-     ;; create a temporary binding (--dash-source--) for the source
-     ;; and just use the input directly
-     ((and (consp m)
-           (not (cdr m)))
-      (dash--match (car m) (dash--match-cons-get-car n source)))
-     ;; handle other special types
-     ((> n 0)
-      (dash--match m (dash--match-cons-get-cdr n source)))
-     ;; this is the only entry-point for dash--match-cons-1, that's
-     ;; why we can't simply use the above branch, it would produce
-     ;; infinite recursion
-     (t
-      (cons (list s source) (dash--match-cons-1 match-form s))))))
-
-(defun dash--match-cons-1 (match-form source &optional props)
-  "Match MATCH-FORM against SOURCE.
-
-MATCH-FORM is a proper or improper list.  Each element of
-MATCH-FORM is either a symbol, which gets bound to the respective
-value in source or another match form which gets destructured
-recursively.
-
-If the cdr of last cons cell in the list is `nil', matching stops
-there.
-
-SOURCE is a proper or improper list."
-  (let ((skip-cdr (or (plist-get props :skip-cdr) 0)))
-    (cond
-     ((consp match-form)
-      (cond
-       ((cdr match-form)
-        (cond
-         ((and (symbolp (car match-form))
-               (memq (car match-form) '(&keys &plist &alist &hash)))
-          (dash--match-kv match-form (dash--match-cons-get-cdr skip-cdr source)))
-         ((dash--match-ignore-place-p (car match-form))
-          (dash--match-cons-1 (cdr match-form) source
-                              (plist-put props :skip-cdr (1+ skip-cdr))))
-         (t
-          (-concat (dash--match (car match-form) (dash--match-cons-skip-cdr skip-cdr source))
-                   (dash--match-cons-1 (cdr match-form) source)))))
-       (t ;; Last matching place, no need for shift
-        (dash--match (car match-form) (dash--match-cons-get-car skip-cdr source)))))
-     ((eq match-form nil)
-      nil)
-     (t ;; Handle improper lists.  Last matching place, no need for shift
-      (dash--match match-form (dash--match-cons-get-cdr skip-cdr source))))))
-
-(defun dash--vector-tail (seq start)
-  "Return the tail of SEQ starting at START."
-  (cond
-   ((vectorp seq)
-    (let* ((re-length (- (length seq) start))
-           (re (make-vector re-length 0)))
-      (--dotimes re-length (aset re it (aref seq (+ it start))))
-      re))
-   ((stringp seq)
-    (substring seq start))))
-
-(defun dash--match-vector (match-form source)
-  "Setup a vector matching environment and call the real matcher."
-  (let ((s (dash--match-make-source-symbol)))
-    (cond
-     ;; don't bind `s' if we only have one sub-pattern
-     ((= (length match-form) 1)
-      (dash--match (aref match-form 0) `(aref ,source 0)))
-     ;; if the source is a symbol, we don't need to re-bind it
-     ((symbolp source)
-      (dash--match-vector-1 match-form source))
-     ;; don't bind `s' if we only have one sub-pattern which is not ignored
-     ((let* ((ignored-places (mapcar 'dash--match-ignore-place-p match-form))
-             (ignored-places-n (length (-remove 'null ignored-places))))
-        (when (= ignored-places-n (1- (length match-form)))
-          (let ((n (-find-index 'null ignored-places)))
-            (dash--match (aref match-form n) `(aref ,source ,n))))))
-     (t
-      (cons (list s source) (dash--match-vector-1 match-form s))))))
-
-(defun dash--match-vector-1 (match-form source)
-  "Match MATCH-FORM against SOURCE.
-
-MATCH-FORM is a vector.  Each element of MATCH-FORM is either a
-symbol, which gets bound to the respective value in source or
-another match form which gets destructured recursively.
-
-If second-from-last place in MATCH-FORM is the symbol &rest, the
-next element of the MATCH-FORM is matched against the tail of
-SOURCE, starting at index of the &rest symbol.  This is
-conceptually the same as the (head . tail) match for improper
-lists, where dot plays the role of &rest.
-
-SOURCE is a vector.
-
-If the MATCH-FORM vector is shorter than SOURCE vector, only
-the (length MATCH-FORM) places are bound, the rest of the SOURCE
-is discarded."
-  (let ((i 0)
-        (l (length match-form))
-        (re))
-    (while (< i l)
-      (let ((m (aref match-form i)))
-        (push (cond
-               ((and (symbolp m)
-                     (eq m '&rest))
-                (prog1 (dash--match
-                        (aref match-form (1+ i))
-                        `(dash--vector-tail ,source ,i))
-                  (setq i l)))
-               ((and (symbolp m)
-                     ;; do not match symbols starting with _
-                     (not (eq (aref (symbol-name m) 0) ?_)))
-                (list (list m `(aref ,source ,i))))
-               ((not (symbolp m))
-                (dash--match m `(aref ,source ,i))))
-              re)
-        (setq i (1+ i))))
-    (-flatten-n 1 (nreverse re))))
-
-(defun dash--match-kv (match-form source)
-  "Setup a kv matching environment and call the real matcher.
-
-kv can be any key-value store, such as plist, alist or hash-table."
-  (let ((s (dash--match-make-source-symbol)))
-    (cond
-     ;; don't bind `s' if we only have one sub-pattern (&type key val)
-     ((= (length match-form) 3)
-      (dash--match-kv-1 (cdr match-form) source (car match-form)))
-     ;; if the source is a symbol, we don't need to re-bind it
-     ((symbolp source)
-      (dash--match-kv-1 (cdr match-form) source (car match-form)))
-     (t
-      (cons (list s source) (dash--match-kv-1 (cdr match-form) s (car match-form)))))))
-
-(defun dash--match-kv-1 (match-form source type)
-  "Match MATCH-FORM against SOURCE of type TYPE.
-
-MATCH-FORM is a proper list of the form (key1 place1 ... keyN
-placeN).  Each placeK is either a symbol, which gets bound to the
-value of keyK retrieved from the key-value store, or another
-match form which gets destructured recursively.
-
-SOURCE is a key-value store of type TYPE, which can be a plist,
-an alist or a hash table.
-
-TYPE is a token specifying the type of the key-value store.
-Valid values are &plist, &alist and &hash."
-  (-flatten-n 1 (-map
-                 (lambda (kv)
-                   (let* ((k (car kv))
-                          (v (cadr kv))
-                          (getter (cond
-                                   ((or (eq type '&plist) (eq type '&keys))
-                                    `(plist-get ,source ,k))
-                                   ((eq type '&alist)
-                                    `(cdr (assoc ,k ,source)))
-                                   ((eq type '&hash)
-                                    `(gethash ,k ,source)))))
-                     (cond
-                      ((symbolp v)
-                       (list (list v getter)))
-                      (t (dash--match v getter)))))
-                 (-partition 2 match-form))))
-
-(defun dash--match-symbol (match-form source)
-  "Bind a symbol.
-
-This works just like `let', there is no destructuring."
-  (list (list match-form source)))
-
-(defun dash--match (match-form source)
-  "Match MATCH-FORM against SOURCE.
-
-This function tests the MATCH-FORM and dispatches to specific
-matchers based on the type of the expression.
-
-Key-value stores are disambiguated by placing a token &plist,
-&alist or &hash as a first item in the MATCH-FORM."
-  (cond
-   ((symbolp match-form)
-    (dash--match-symbol match-form source))
-   ((consp match-form)
-    (cond
-     ;; Handle the "x &as" bindings first.
-     ((and (consp (cdr match-form))
-           (symbolp (car match-form))
-           (eq '&as (cadr match-form)))
-      (let ((s (car match-form)))
-        (cons (list s source)
-              (dash--match (cddr match-form) s))))
-     ((memq (car match-form) '(&keys &plist &alist &hash))
-      (dash--match-kv match-form source))
-     (t (dash--match-cons match-form source))))
-   ((vectorp match-form)
-    ;; We support the &as binding in vectors too
-    (cond
-     ((and (> (length match-form) 2)
-           (symbolp (aref match-form 0))
-           (eq '&as (aref match-form 1)))
-      (let ((s (aref match-form 0)))
-        (cons (list s source)
-              (dash--match (dash--vector-tail match-form 2) s))))
-     (t (dash--match-vector match-form source))))))
-
-(defmacro -let* (varlist &rest body)
-  "Bind variables according to VARLIST then eval BODY.
-
-VARLIST is a list of lists of the form (PATTERN SOURCE).  Each
-PATTERN is matched against the SOURCE structurally.  SOURCE is
-only evaluated once for each PATTERN.
-
-Each SOURCE can refer to the symbols already bound by this
-VARLIST.  This is useful if you want to destructure SOURCE
-recursively but also want to name the intermediate structures.
-
-See `-let' for the list of all possible patterns."
-  (declare (debug ((&rest (sexp form)) body))
-           (indent 1))
-  (let ((bindings (--mapcat (dash--match (car it) (cadr it)) varlist)))
-    `(let* ,bindings
-       ,@body)))
-
-(defmacro -let (varlist &rest body)
-  "Bind variables according to VARLIST then eval BODY.
-
-VARLIST is a list of lists of the form (PATTERN SOURCE).  Each
-PATTERN is matched against the SOURCE \"structurally\".  SOURCE
-is only evaluated once for each PATTERN.  Each PATTERN is matched
-recursively, and can therefore contain sub-patterns which are
-matched against corresponding sub-expressions of SOURCE.
-
-All the SOURCEs are evalled before any symbols are
-bound (i.e. \"in parallel\").
-
-If VARLIST only contains one (PATTERN SOURCE) element, you can
-optionally specify it using a vector and discarding the
-outer-most parens.  Thus
-
-  (-let ((PATTERN SOURCE)) ..)
-
-becomes
-
-  (-let [PATTERN SOURCE] ..).
-
-`-let' uses a convention of not binding places (symbols) starting
-with _ whenever it's possible.  You can use this to skip over
-entries you don't care about.  However, this is not *always*
-possible (as a result of implementation) and these symbols might
-get bound to undefined values.
-
-Following is the overview of supported patterns.  Remember that
-patterns can be matched recursively, so every a, b, aK in the
-following can be a matching construct and not necessarily a
-symbol/variable.
-
-Symbol:
-
-  a - bind the SOURCE to A.  This is just like regular `let'.
-
-Conses and lists:
-
-  (a) - bind `car' of cons/list to A
-
-  (a . b) - bind car of cons to A and `cdr' to B
-
-  (a b) - bind car of list to A and `cadr' to B
-
-  (a1 a2 a3  ...) - bind 0th car of list to A1, 1st to A2, 2nd to A3 ...
-
-  (a1 a2 a3 ... aN . rest) - as above, but bind the Nth cdr to REST.
-
-Vectors:
-
-  [a] - bind 0th element of a non-list sequence to A (works with
-        vectors, strings, bit arrays...)
-
-  [a1 a2 a3 ...] - bind 0th element of non-list sequence to A0, 1st to
-                   A1, 2nd to A2, ...
-                   If the PATTERN is shorter than SOURCE, the values at
-                   places not in PATTERN are ignored.
-                   If the PATTERN is longer than SOURCE, an `error' is
-                   thrown.
-
-  [a1 a2 a3 ... &rest rest] - as above, but bind the rest of
-                              the sequence to REST.  This is
-                              conceptually the same as improper list
-                              matching (a1 a2 ... aN . rest)
-
-Key/value stores:
-
-  (&plist key0 a0 ... keyN aN) - bind value mapped by keyK in the
-                                 SOURCE plist to aK.  If the
-                                 value is not found, aK is nil.
-
-  (&alist key0 a0 ... keyN aN) - bind value mapped by keyK in the
-                                 SOURCE alist to aK.  If the
-                                 value is not found, aK is nil.
-
-  (&hash key0 a0 ... keyN aN) - bind value mapped by keyK in the
-                                SOURCE hash table to aK.  If the
-                                value is not found, aK is nil.
-
-Further, special keyword &keys supports \"inline\" matching of
-plist-like key-value pairs, similarly to &keys keyword of
-`cl-defun'.
-
-  (a1 a2 ... aN &keys key1 b1 ... keyN bK)
-
-This binds N values from the list to a1 ... aN, then interprets
-the cdr as a plist (see key/value matching above).
-
-You can name the source using the syntax SYMBOL &as PATTERN.
-This syntax works with lists (proper or improper), vectors and
-all types of maps.
-
-  (list &as a b c) (list 1 2 3)
-
-binds A to 1, B to 2, C to 3 and LIST to (1 2 3).
-
-Similarly:
-
-  (bounds &as beg . end) (cons 1 2)
-
-binds BEG to 1, END to 2 and BOUNDS to (1 . 2).
-
-  (items &as first . rest) (list 1 2 3)
-
-binds FIRST to 1, REST to (2 3) and ITEMS to (1 2 3)
-
-  [vect &as _ b c] [1 2 3]
-
-binds B to 2, C to 3 and VECT to [1 2 3] (_ avoids binding as usual).
-
-  (plist &as &plist :b b) (list :a 1 :b 2 :c 3)
-
-binds B to 2 and PLIST to (:a 1 :b 2 :c 3).  Same for &alist and &hash.
-
-This is especially useful when we want to capture the result of a
-computation and destructure at the same time.  Consider the
-form (function-returning-complex-structure) returning a list of
-two vectors with two items each.  We want to capture this entire
-result and pass it to another computation, but at the same time
-we want to get the second item from each vector.  We can achieve
-it with pattern
-
-  (result &as [_ a] [_ b]) (function-returning-complex-structure)
-
-Note: Clojure programmers may know this feature as the \":as
-binding\".  The difference is that we put the &as at the front
-because we need to support improper list binding."
-  (declare (debug ([&or (&rest (sexp form))
-                        (vector [&rest [sexp form]])]
-                   body))
-           (indent 1))
-  (if (vectorp varlist)
-      `(let* ,(dash--match (aref varlist 0) (aref varlist 1))
-         ,@body)
-    (let* ((inputs (--map-indexed (list (make-symbol (format "input%d" it-index)) (cadr it)) varlist))
-           (new-varlist (--map (list (caar it) (cadr it)) (-zip varlist inputs))))
-      `(let ,inputs
-         (-let* ,new-varlist ,@body)))))
-
-(defmacro -lambda (match-form &rest body)
-  "Return a lambda which destructures its input as MATCH-FORM and executes BODY.
-
-Note that you have to enclose the MATCH-FORM in a pair of parens,
-such that:
-
-  (-lambda (x) body)
-  (-lambda (x y ...) body)
-
-has the usual semantics of `lambda'.  Furthermore, these get
-translated into normal lambda, so there is no performance
-penalty.
-
-See `-let' for the description of destructuring mechanism."
-  (declare (doc-string 2) (indent defun)
-           (debug (&define sexp
-                           [&optional stringp]
-                           [&optional ("interactive" interactive)]
-                           def-body)))
-  (cond
-   ((not (consp match-form))
-    (signal 'wrong-type-argument "match-form must be a list"))
-   ;; no destructuring, so just return regular lambda to make things faster
-   ((-all? 'symbolp match-form)
-    `(lambda ,match-form ,@body))
-   (t
-    (let* ((inputs (--map-indexed (list it (make-symbol (format "input%d" it-index))) match-form)))
-      ;; TODO: because inputs to the lambda are evaluated only once,
-      ;; -let* need not to create the extra bindings to ensure that.
-      ;; We should find a way to optimize that.  Not critical however.
-      `(lambda ,(--map (cadr it) inputs)
-         (-let* ,inputs ,@body))))))
-
-(defmacro -if-let* (vars-vals then &rest else)
-  "If all VALS evaluate to true, bind them to their corresponding
-VARS and do THEN, otherwise do ELSE. VARS-VALS should be a list
-of (VAR VAL) pairs.
-
-Note: binding is done according to `-let*'.  VALS are evaluated
-sequentially, and evaluation stops after the first nil VAL is
-encountered."
-  (declare (debug ((&rest (sexp form)) form body))
-           (indent 2))
-  (->> vars-vals
-       (--mapcat (dash--match (car it) (cadr it)))
-       (--reduce-r-from
-        (let ((var (car it))
-              (val (cadr it)))
-          `(let ((,var ,val))
-             (if ,var ,acc ,@else)))
-        then)))
-
-(defmacro -if-let (var-val then &rest else)
-  "If VAL evaluates to non-nil, bind it to VAR and do THEN,
-otherwise do ELSE.
-
-Note: binding is done according to `-let'.
-
-\(fn (VAR VAL) THEN &rest ELSE)"
-  (declare (debug ((sexp form) form body))
-           (indent 2))
-  `(-if-let* (,var-val) ,then ,@else))
-
-(defmacro --if-let (val then &rest else)
-  "If VAL evaluates to non-nil, bind it to symbol `it' and do THEN,
-otherwise do ELSE."
-  (declare (debug (form form body))
-           (indent 2))
-  `(-if-let (it ,val) ,then ,@else))
-
-(defmacro -when-let* (vars-vals &rest body)
-  "If all VALS evaluate to true, bind them to their corresponding
-VARS and execute body. VARS-VALS should be a list of (VAR VAL)
-pairs.
-
-Note: binding is done according to `-let*'.  VALS are evaluated
-sequentially, and evaluation stops after the first nil VAL is
-encountered."
-  (declare (debug ((&rest (sexp form)) body))
-           (indent 1))
-  `(-if-let* ,vars-vals (progn ,@body)))
-
-(defmacro -when-let (var-val &rest body)
-  "If VAL evaluates to non-nil, bind it to VAR and execute body.
-
-Note: binding is done according to `-let'.
-
-\(fn (VAR VAL) &rest BODY)"
-  (declare (debug ((sexp form) body))
-           (indent 1))
-  `(-if-let ,var-val (progn ,@body)))
-
-(defmacro --when-let (val &rest body)
-  "If VAL evaluates to non-nil, bind it to symbol `it' and
-execute body."
-  (declare (debug (form body))
-           (indent 1))
-  `(--if-let ,val (progn ,@body)))
-
-(defvar -compare-fn nil
-  "Tests for equality use this function or `equal' if this is nil.
-It should only be set using dynamic scope with a let, like:
-
-  (let ((-compare-fn #'=)) (-union numbers1 numbers2 numbers3)")
-
-(defun -distinct (list)
-  "Return a new list with all duplicates removed.
-The test for equality is done with `equal',
-or with `-compare-fn' if that's non-nil.
-
-Alias: `-uniq'"
-  (let (result)
-    (--each list (unless (-contains? result it) (!cons it result)))
-    (nreverse result)))
-
-(defalias '-uniq '-distinct)
-
-(defun -union (list list2)
-  "Return a new list containing the elements of LIST and elements of LIST2 that are not in LIST.
-The test for equality is done with `equal',
-or with `-compare-fn' if that's non-nil."
-  ;; We fall back to iteration implementation if the comparison
-  ;; function isn't one of `eq', `eql' or `equal'.
-  (let* ((result (reverse list))
-         ;; TODO: get rid of this dynamic variable, pass it as an
-         ;; argument instead.
-         (-compare-fn (if (bound-and-true-p -compare-fn)
-                          -compare-fn
-                        'equal)))
-    (if (memq -compare-fn '(eq eql equal))
-        (let ((ht (make-hash-table :test -compare-fn)))
-          (--each list (puthash it t ht))
-          (--each list2 (unless (gethash it ht) (!cons it result))))
-      (--each list2 (unless (-contains? result it) (!cons it result))))
-    (nreverse result)))
-
-(defun -intersection (list list2)
-  "Return a new list containing only the elements that are members of both LIST and LIST2.
-The test for equality is done with `equal',
-or with `-compare-fn' if that's non-nil."
-  (--filter (-contains? list2 it) list))
-
-(defun -difference (list list2)
-  "Return a new list with only the members of LIST that are not in LIST2.
-The test for equality is done with `equal',
-or with `-compare-fn' if that's non-nil."
-  (--filter (not (-contains? list2 it)) list))
-
-(defun -powerset (list)
-  "Return the power set of LIST."
-  (if (null list) '(())
-    (let ((last (-powerset (cdr list))))
-      (append (mapcar (lambda (x) (cons (car list) x)) last)
-              last))))
-
-(defun -permutations (list)
-  "Return the permutations of LIST."
-  (if (null list) '(())
-    (apply #'append
-           (mapcar (lambda (x)
-                     (mapcar (lambda (perm) (cons x perm))
-                             (-permutations (remove x list))))
-                   list))))
-
-(defun -contains? (list element)
-  "Return non-nil if LIST contains ELEMENT.
-
-The test for equality is done with `equal', or with `-compare-fn'
-if that's non-nil.
-
-Alias: `-contains-p'"
-  (not
-   (null
-    (cond
-     ((null -compare-fn)    (member element list))
-     ((eq -compare-fn 'eq)  (memq element list))
-     ((eq -compare-fn 'eql) (memql element list))
-     (t
-      (let ((lst list))
-        (while (and lst
-                    (not (funcall -compare-fn element (car lst))))
-          (setq lst (cdr lst)))
-        lst))))))
-
-(defalias '-contains-p '-contains?)
-
-(defun -same-items? (list list2)
-  "Return true if LIST and LIST2 has the same items.
-
-The order of the elements in the lists does not matter.
-
-Alias: `-same-items-p'"
-  (let ((length-a (length list))
-        (length-b (length list2)))
-    (and
-     (= length-a length-b)
-     (= length-a (length (-intersection list list2))))))
-
-(defalias '-same-items-p '-same-items?)
-
-(defun -is-prefix? (prefix list)
-  "Return non-nil if PREFIX is prefix of LIST.
-
-Alias: `-is-prefix-p'"
-  (declare (pure t) (side-effect-free t))
-  (--each-while list (equal (car prefix) it)
-    (!cdr prefix))
-  (not prefix))
-
-(defun -is-suffix? (suffix list)
-  "Return non-nil if SUFFIX is suffix of LIST.
-
-Alias: `-is-suffix-p'"
-  (declare (pure t) (side-effect-free t))
-  (-is-prefix? (reverse suffix) (reverse list)))
-
-(defun -is-infix? (infix list)
-  "Return non-nil if INFIX is infix of LIST.
-
-This operation runs in O(n^2) time
-
-Alias: `-is-infix-p'"
-  (declare (pure t) (side-effect-free t))
-  (let (done)
-    (while (and (not done) list)
-      (setq done (-is-prefix? infix list))
-      (!cdr list))
-    done))
-
-(defalias '-is-prefix-p '-is-prefix?)
-(defalias '-is-suffix-p '-is-suffix?)
-(defalias '-is-infix-p '-is-infix?)
-
-(defun -sort (comparator list)
-  "Sort LIST, stably, comparing elements using COMPARATOR.
-Return the sorted list.  LIST is NOT modified by side effects.
-COMPARATOR is called with two elements of LIST, and should return non-nil
-if the first element should sort before the second."
-  (sort (copy-sequence list) comparator))
-
-(defmacro --sort (form list)
-  "Anaphoric form of `-sort'."
-  (declare (debug (form form)))
-  `(-sort (lambda (it other) ,form) ,list))
-
-(defun -list (&rest args)
-  "Return a list with ARGS.
-
-If first item of ARGS is already a list, simply return ARGS.  If
-not, return a list with ARGS as elements."
-  (declare (pure t) (side-effect-free t))
-  (let ((arg (car args)))
-    (if (listp arg) arg args)))
-
-(defun -repeat (n x)
-  "Return a list with X repeated N times.
-Return nil if N is less than 1."
-  (declare (pure t) (side-effect-free t))
-  (let (ret)
-    (--dotimes n (!cons x ret))
-    ret))
-
-(defun -sum (list)
-  "Return the sum of LIST."
-  (declare (pure t) (side-effect-free t))
-  (apply '+ list))
-
-(defun -product (list)
-  "Return the product of LIST."
-  (declare (pure t) (side-effect-free t))
-  (apply '* list))
-
-(defun -max (list)
-  "Return the largest value from LIST of numbers or markers."
-  (declare (pure t) (side-effect-free t))
-  (apply 'max list))
-
-(defun -min (list)
-  "Return the smallest value from LIST of numbers or markers."
-  (declare (pure t) (side-effect-free t))
-  (apply 'min list))
-
-(defun -max-by (comparator list)
-  "Take a comparison function COMPARATOR and a LIST and return
-the greatest element of the list by the comparison function.
-
-See also combinator `-on' which can transform the values before
-comparing them."
-  (--reduce (if (funcall comparator it acc) it acc) list))
-
-(defun -min-by (comparator list)
-  "Take a comparison function COMPARATOR and a LIST and return
-the least element of the list by the comparison function.
-
-See also combinator `-on' which can transform the values before
-comparing them."
-  (--reduce (if (funcall comparator it acc) acc it) list))
-
-(defmacro --max-by (form list)
-  "Anaphoric version of `-max-by'.
-
-The items for the comparator form are exposed as \"it\" and \"other\"."
-  (declare (debug (form form)))
-  `(-max-by (lambda (it other) ,form) ,list))
-
-(defmacro --min-by (form list)
-  "Anaphoric version of `-min-by'.
-
-The items for the comparator form are exposed as \"it\" and \"other\"."
-  (declare (debug (form form)))
-  `(-min-by (lambda (it other) ,form) ,list))
-
-(defun -iterate (fun init n)
-  "Return a list of iterated applications of FUN to INIT.
-
-This means a list of form:
-
-  (init (fun init) (fun (fun init)) ...)
-
-N is the length of the returned list."
-  (if (= n 0) nil
-    (let ((r (list init)))
-      (--dotimes (1- n)
-        (push (funcall fun (car r)) r))
-      (nreverse r))))
-
-(defun -fix (fn list)
-  "Compute the (least) fixpoint of FN with initial input LIST.
-
-FN is called at least once, results are compared with `equal'."
-  (let ((re (funcall fn list)))
-    (while (not (equal list re))
-      (setq list re)
-      (setq re (funcall fn re)))
-    re))
-
-(defmacro --fix (form list)
-  "Anaphoric form of `-fix'."
-  `(-fix (lambda (it) ,form) ,list))
-
-(defun -unfold (fun seed)
-  "Build a list from SEED using FUN.
-
-This is \"dual\" operation to `-reduce-r': while -reduce-r
-consumes a list to produce a single value, `-unfold' takes a
-seed value and builds a (potentially infinite!) list.
-
-FUN should return `nil' to stop the generating process, or a
-cons (A . B), where A will be prepended to the result and B is
-the new seed."
-  (let ((last (funcall fun seed)) r)
-    (while last
-      (push (car last) r)
-      (setq last (funcall fun (cdr last))))
-    (nreverse r)))
-
-(defmacro --unfold (form seed)
-  "Anaphoric version of `-unfold'."
-  (declare (debug (form form)))
-  `(-unfold (lambda (it) ,form) ,seed))
-
-(defun -cons-pair? (con)
-  "Return non-nil if CON is true cons pair.
-That is (A . B) where B is not a list."
-  (declare (pure t) (side-effect-free t))
-  (and (listp con)
-       (not (listp (cdr con)))))
-
-(defun -cons-to-list (con)
-  "Convert a cons pair to a list with `car' and `cdr' of the pair respectively."
-  (declare (pure t) (side-effect-free t))
-  (list (car con) (cdr con)))
-
-(defun -value-to-list (val)
-  "Convert a value to a list.
-
-If the value is a cons pair, make a list with two elements, `car'
-and `cdr' of the pair respectively.
-
-If the value is anything else, wrap it in a list."
-  (declare (pure t) (side-effect-free t))
-  (cond
-   ((-cons-pair? val) (-cons-to-list val))
-   (t (list val))))
-
-(defun -tree-mapreduce-from (fn folder init-value tree)
-  "Apply FN to each element of TREE, and make a list of the results.
-If elements of TREE are lists themselves, apply FN recursively to
-elements of these nested lists.
-
-Then reduce the resulting lists using FOLDER and initial value
-INIT-VALUE. See `-reduce-r-from'.
-
-This is the same as calling `-tree-reduce-from' after `-tree-map'
-but is twice as fast as it only traverse the structure once."
-  (cond
-   ((not tree) nil)
-   ((-cons-pair? tree) (funcall fn tree))
-   ((listp tree)
-    (-reduce-r-from folder init-value (mapcar (lambda (x) (-tree-mapreduce-from fn folder init-value x)) tree)))
-   (t (funcall fn tree))))
-
-(defmacro --tree-mapreduce-from (form folder init-value tree)
-  "Anaphoric form of `-tree-mapreduce-from'."
-  (declare (debug (form form form form)))
-  `(-tree-mapreduce-from (lambda (it) ,form) (lambda (it acc) ,folder) ,init-value ,tree))
-
-(defun -tree-mapreduce (fn folder tree)
-  "Apply FN to each element of TREE, and make a list of the results.
-If elements of TREE are lists themselves, apply FN recursively to
-elements of these nested lists.
-
-Then reduce the resulting lists using FOLDER and initial value
-INIT-VALUE. See `-reduce-r-from'.
-
-This is the same as calling `-tree-reduce' after `-tree-map'
-but is twice as fast as it only traverse the structure once."
-  (cond
-   ((not tree) nil)
-   ((-cons-pair? tree) (funcall fn tree))
-   ((listp tree)
-    (-reduce-r folder (mapcar (lambda (x) (-tree-mapreduce fn folder x)) tree)))
-   (t (funcall fn tree))))
-
-(defmacro --tree-mapreduce (form folder tree)
-  "Anaphoric form of `-tree-mapreduce'."
-  (declare (debug (form form form)))
-  `(-tree-mapreduce (lambda (it) ,form) (lambda (it acc) ,folder) ,tree))
-
-(defun -tree-map (fn tree)
-  "Apply FN to each element of TREE while preserving the tree structure."
-  (cond
-   ((not tree) nil)
-   ((-cons-pair? tree) (funcall fn tree))
-   ((listp tree)
-    (mapcar (lambda (x) (-tree-map fn x)) tree))
-   (t (funcall fn tree))))
-
-(defmacro --tree-map (form tree)
-  "Anaphoric form of `-tree-map'."
-  (declare (debug (form form)))
-  `(-tree-map (lambda (it) ,form) ,tree))
-
-(defun -tree-reduce-from (fn init-value tree)
-  "Use FN to reduce elements of list TREE.
-If elements of TREE are lists themselves, apply the reduction recursively.
-
-FN is first applied to INIT-VALUE and first element of the list,
-then on this result and second element from the list etc.
-
-The initial value is ignored on cons pairs as they always contain
-two elements."
-  (cond
-   ((not tree) nil)
-   ((-cons-pair? tree) tree)
-   ((listp tree)
-    (-reduce-r-from fn init-value (mapcar (lambda (x) (-tree-reduce-from fn init-value x)) tree)))
-   (t tree)))
-
-(defmacro --tree-reduce-from (form init-value tree)
-  "Anaphoric form of `-tree-reduce-from'."
-  (declare (debug (form form form)))
-  `(-tree-reduce-from (lambda (it acc) ,form) ,init-value ,tree))
-
-(defun -tree-reduce (fn tree)
-  "Use FN to reduce elements of list TREE.
-If elements of TREE are lists themselves, apply the reduction recursively.
-
-FN is first applied to first element of the list and second
-element, then on this result and third element from the list etc.
-
-See `-reduce-r' for how exactly are lists of zero or one element handled."
-  (cond
-   ((not tree) nil)
-   ((-cons-pair? tree) tree)
-   ((listp tree)
-    (-reduce-r fn (mapcar (lambda (x) (-tree-reduce fn x)) tree)))
-   (t tree)))
-
-(defmacro --tree-reduce (form tree)
-  "Anaphoric form of `-tree-reduce'."
-  (declare (debug (form form)))
-  `(-tree-reduce (lambda (it acc) ,form) ,tree))
-
-(defun -tree-map-nodes (pred fun tree)
-  "Call FUN on each node of TREE that satisfies PRED.
-
-If PRED returns nil, continue descending down this node.  If PRED
-returns non-nil, apply FUN to this node and do not descend
-further."
-  (if (funcall pred tree)
-      (funcall fun tree)
-    (if (and (listp tree)
-             (not (-cons-pair? tree)))
-        (-map (lambda (x) (-tree-map-nodes pred fun x)) tree)
-      tree)))
-
-(defmacro --tree-map-nodes (pred form tree)
-  "Anaphoric form of `-tree-map-nodes'."
-  `(-tree-map-nodes (lambda (it) ,pred) (lambda (it) ,form) ,tree))
-
-(defun -tree-seq (branch children tree)
-  "Return a sequence of the nodes in TREE, in depth-first search order.
-
-BRANCH is a predicate of one argument that returns non-nil if the
-passed argument is a branch, that is, a node that can have children.
-
-CHILDREN is a function of one argument that returns the children
-of the passed branch node.
-
-Non-branch nodes are simply copied."
-  (cons tree
-        (when (funcall branch tree)
-          (-mapcat (lambda (x) (-tree-seq branch children x))
-                   (funcall children tree)))))
-
-(defmacro --tree-seq (branch children tree)
-  "Anaphoric form of `-tree-seq'."
-  `(-tree-seq (lambda (it) ,branch) (lambda (it) ,children) ,tree))
-
-(defun -clone (list)
-  "Create a deep copy of LIST.
-The new list has the same elements and structure but all cons are
-replaced with new ones.  This is useful when you need to clone a
-structure such as plist or alist."
-  (declare (pure t) (side-effect-free t))
-  (-tree-map 'identity list))
-
-(defun dash-enable-font-lock ()
-  "Add syntax highlighting to dash functions, macros and magic values."
-  (eval-after-load 'lisp-mode
-    '(progn
-       (let ((new-keywords '(
-                             "-each"
-                             "--each"
-                             "-each-indexed"
-                             "--each-indexed"
-                             "-each-while"
-                             "--each-while"
-                             "-dotimes"
-                             "--dotimes"
-                             "-map"
-                             "--map"
-                             "-reduce-from"
-                             "--reduce-from"
-                             "-reduce"
-                             "--reduce"
-                             "-reduce-r-from"
-                             "--reduce-r-from"
-                             "-reduce-r"
-                             "--reduce-r"
-                             "-filter"
-                             "--filter"
-                             "-select"
-                             "--select"
-                             "-remove"
-                             "--remove"
-                             "-reject"
-                             "--reject"
-                             "-remove-first"
-                             "--remove-first"
-                             "-reject-first"
-                             "--reject-first"
-                             "-remove-last"
-                             "--remove-last"
-                             "-reject-last"
-                             "--reject-last"
-                             "-remove-item"
-                             "-non-nil"
-                             "-keep"
-                             "--keep"
-                             "-map-indexed"
-                             "--map-indexed"
-                             "-splice"
-                             "--splice"
-                             "-splice-list"
-                             "--splice-list"
-                             "-map-when"
-                             "--map-when"
-                             "-replace-where"
-                             "--replace-where"
-                             "-map-first"
-                             "--map-first"
-                             "-map-last"
-                             "--map-last"
-                             "-replace"
-                             "-replace-first"
-                             "-replace-last"
-                             "-flatten"
-                             "-flatten-n"
-                             "-concat"
-                             "-mapcat"
-                             "--mapcat"
-                             "-copy"
-                             "-cons*"
-                             "-snoc"
-                             "-first"
-                             "--first"
-                             "-find"
-                             "--find"
-                             "-some"
-                             "--some"
-                             "-any"
-                             "--any"
-                             "-last"
-                             "--last"
-                             "-first-item"
-                             "-last-item"
-                             "-butlast"
-                             "-count"
-                             "--count"
-                             "-any?"
-                             "--any?"
-                             "-some?"
-                             "--some?"
-                             "-any-p"
-                             "--any-p"
-                             "-some-p"
-                             "--some-p"
-                             "-all?"
-                             "--all?"
-                             "-every?"
-                             "--every?"
-                             "-all-p"
-                             "--all-p"
-                             "-every-p"
-                             "--every-p"
-                             "-none?"
-                             "--none?"
-                             "-none-p"
-                             "--none-p"
-                             "-only-some?"
-                             "--only-some?"
-                             "-only-some-p"
-                             "--only-some-p"
-                             "-slice"
-                             "-take"
-                             "-drop"
-                             "-take-while"
-                             "--take-while"
-                             "-drop-while"
-                             "--drop-while"
-                             "-split-at"
-                             "-rotate"
-                             "-insert-at"
-                             "-replace-at"
-                             "-update-at"
-                             "--update-at"
-                             "-remove-at"
-                             "-remove-at-indices"
-                             "-split-with"
-                             "--split-with"
-                             "-split-on"
-                             "-split-when"
-                             "--split-when"
-                             "-separate"
-                             "--separate"
-                             "-partition-all-in-steps"
-                             "-partition-in-steps"
-                             "-partition-all"
-                             "-partition"
-                             "-partition-by"
-                             "--partition-by"
-                             "-partition-by-header"
-                             "--partition-by-header"
-                             "-group-by"
-                             "--group-by"
-                             "-interpose"
-                             "-interleave"
-                             "-zip-with"
-                             "--zip-with"
-                             "-zip"
-                             "-zip-fill"
-                             "-cycle"
-                             "-pad"
-                             "-annotate"
-                             "--annotate"
-                             "-table"
-                             "-table-flat"
-                             "-partial"
-                             "-elem-index"
-                             "-elem-indices"
-                             "-find-indices"
-                             "--find-indices"
-                             "-find-index"
-                             "--find-index"
-                             "-find-last-index"
-                             "--find-last-index"
-                             "-select-by-indices"
-                             "-select-columns"
-                             "-select-column"
-                             "-grade-up"
-                             "-grade-down"
-                             "->"
-                             "->>"
-                             "-->"
-                             "-when-let"
-                             "-when-let*"
-                             "--when-let"
-                             "-if-let"
-                             "-if-let*"
-                             "--if-let"
-                             "-let*"
-                             "-let"
-                             "-lambda"
-                             "-distinct"
-                             "-uniq"
-                             "-union"
-                             "-intersection"
-                             "-difference"
-                             "-contains?"
-                             "-contains-p"
-                             "-same-items?"
-                             "-same-items-p"
-                             "-is-prefix-p"
-                             "-is-prefix?"
-                             "-is-suffix-p"
-                             "-is-suffix?"
-                             "-is-infix-p"
-                             "-is-infix?"
-                             "-sort"
-                             "--sort"
-                             "-list"
-                             "-repeat"
-                             "-sum"
-                             "-product"
-                             "-max"
-                             "-min"
-                             "-max-by"
-                             "--max-by"
-                             "-min-by"
-                             "--min-by"
-                             "-iterate"
-                             "--iterate"
-                             "-fix"
-                             "--fix"
-                             "-unfold"
-                             "--unfold"
-                             "-cons-pair?"
-                             "-cons-to-list"
-                             "-value-to-list"
-                             "-tree-mapreduce-from"
-                             "--tree-mapreduce-from"
-                             "-tree-mapreduce"
-                             "--tree-mapreduce"
-                             "-tree-map"
-                             "--tree-map"
-                             "-tree-reduce-from"
-                             "--tree-reduce-from"
-                             "-tree-reduce"
-                             "--tree-reduce"
-                             "-tree-seq"
-                             "--tree-seq"
-                             "-tree-map-nodes"
-                             "--tree-map-nodes"
-                             "-clone"
-                             "-rpartial"
-                             "-juxt"
-                             "-applify"
-                             "-on"
-                             "-flip"
-                             "-const"
-                             "-cut"
-                             "-orfn"
-                             "-andfn"
-                             "-iteratefn"
-                             "-fixfn"
-                             "-prodfn"
-                             ))
-             (special-variables '(
-                                  "it"
-                                  "it-index"
-                                  "acc"
-                                  "other"
-                                  )))
-         (font-lock-add-keywords 'emacs-lisp-mode `((,(concat "\\_<" (regexp-opt special-variables 'paren) "\\_>")
-                                                     1 font-lock-variable-name-face)) 'append)
-         (font-lock-add-keywords 'emacs-lisp-mode `((,(concat "(\\s-*" (regexp-opt new-keywords 'paren) "\\_>")
-                                                     1 font-lock-keyword-face)) 'append))
-       (--each (buffer-list)
-         (with-current-buffer it
-           (when (and (eq major-mode 'emacs-lisp-mode)
-                      (boundp 'font-lock-mode)
-                      font-lock-mode)
-             (font-lock-refresh-defaults)))))))
-
-(provide 'dash)
-;;; dash.el ends here
.emacs.d/elpa/dash-20170810.137/dash.elc
Binary file
.emacs.d/elpa/dashboard-1.2.3/banners/1.txt
@@ -1,8 +0,0 @@
-
-######## ##     ##    ###     ######   ######
-##       ###   ###   ## ##   ##    ## ##    ##
-##       #### ####  ##   ##  ##       ##
-######   ## ### ## ##     ## ##        ######
-##       ##     ## ######### ##             ##
-##       ##     ## ##     ## ##    ## ##    ##
-######## ##     ## ##     ##  ######   ######
.emacs.d/elpa/dashboard-1.2.3/banners/2.txt
@@ -1,6 +0,0 @@
- _______ .___  ___.      ___       ______     _______.
-|   ____||   \/   |     /   \     /      |   /       |
-|  |__   |  \  /  |    /  ^  \   |  ,----'  |   (----`
-|   __|  |  |\/|  |   /  /_\  \  |  |        \   \
-|  |____ |  |  |  |  /  _____  \ |  `----.----)   |
-|_______||__|  |__| /__/     \__\ \______|_______/
.emacs.d/elpa/dashboard-1.2.3/banners/3.txt
@@ -1,8 +0,0 @@
- _______   _____ ______   ________  ________  ________
-|\  ___ \ |\   _ \  _   \|\   __  \|\   ____\|\   ____\
-\ \   __/|\ \  \\\__\ \  \ \  \|\  \ \  \___|\ \  \___|_
- \ \  \_|/_\ \  \\|__| \  \ \   __  \ \  \    \ \_____  \
-  \ \  \_|\ \ \  \    \ \  \ \  \ \  \ \  \____\|____|\  \
-   \ \_______\ \__\    \ \__\ \__\ \__\ \_______\____\_\  \
-    \|_______|\|__|     \|__|\|__|\|__|\|_______|\_________\
-                                                \|_________|
.emacs.d/elpa/dashboard-1.2.3/banners/emacs.png
Binary file
.emacs.d/elpa/dashboard-1.2.3/banners/logo.png
Binary file
.emacs.d/elpa/dashboard-1.2.3/dashboard-autoloads.el
@@ -1,28 +0,0 @@
-;;; dashboard-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "dashboard" "dashboard.el" (22964 2891 208736
-;;;;;;  834000))
-;;; Generated autoloads from dashboard.el
-
-(autoload 'dashboard-setup-startup-hook "dashboard" "\
-Setup post initialization hooks.
-If a command line argument is provided, assume a filename and skip displaying Dashboard
-
-\(fn)" nil nil)
-
-;;;***
-
-;;;### (autoloads nil nil ("dashboard-pkg.el" "dashboard-widgets.el")
-;;;;;;  (22964 2891 207736 809000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; dashboard-autoloads.el ends here
.emacs.d/elpa/dashboard-1.2.3/dashboard-pkg.el
@@ -1,8 +0,0 @@
-(define-package "dashboard" "1.2.3" "A startup screen extracted from Spacemacs"
-  '((emacs "24.4")
-    (page-break-lines "0.11"))
-  :url "https://github.com/rakanalh/emacs-dashboard" :keywords
-  '("startup" "screen" "tools"))
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/dashboard-1.2.3/dashboard-widgets.el
@@ -1,372 +0,0 @@
-;;; dashboard.el --- A startup screen extracted from Spacemacs
-
-;; Copyright (c) 2016 Rakan Al-Hneiti & Contributors
-;;
-;; Author: Rakan Al-Hneiti
-;; URL: https://github.com/rakanalh/emacs-dashboard
-;;
-;; This file is not part of GNU Emacs.
-;;
-;;; License: GPLv3
-;;
-;;; Commentary:
-
-;;; Code:
-
-;;
-;; Customs
-;;
-(defcustom dashboard-page-separator "\n\f\n"
-  "Separator to use between the different pages."
-  :type 'string
-  :group 'dashboard)
-
-(defconst dashboard-banners-directory
-  (concat (file-name-directory
-	   (locate-library "dashboard"))
-	   "/banners/"))
-
-(defconst dashboard-banner-official-png
-  (expand-file-name (concat dashboard-banners-directory "emacs.png"))
-  "Emacs banner image.")
-
-(defconst dashboard-banner-logo-png
-  (expand-file-name (concat dashboard-banners-directory "logo.png"))
-  "Emacs banner image.")
-
-(defconst dashboard-banner-length 75
-  "Width of a banner.")
-
-(defvar dashboard-banner-logo-title "Welcome to Emacs!"
-   "Specify the startup banner.")
-
-(defvar dashboard-startup-banner 'official
-   "Specify the startup banner.
-Default value is `official', it displays
-the Emacs logo.  `logo' displays Emacs alternative logo.
-An integer value is the index of text
-banner.  A string value must be a path to a .PNG file.
-If the value is nil then no banner is displayed.")
-
-(defvar dashboard-buffer-last-width nil
-  "Previous width of dashboard-buffer.")
-
-(defvar dashboard-item-generators  '((recents   . dashboard-insert-recents)
-                                     (bookmarks . dashboard-insert-bookmarks)
-                                     (projects  . dashboard-insert-projects)
-                                     (agenda    . dashboard-insert-agenda)))
-
-(defvar dashboard-items '((recents   . 5)
-                          (bookmarks . 5)
-                          (agenda    . 5))
-  "Association list of items to show in the startup buffer.
-Will be of the form `(list-type . list-size)`.
-If nil it is disabled.  Possible values for list-type are:
-`recents' `bookmarks' `projects'")
-
-(defvar dashboard-items-default-length 20
-  "Length used for startup lists with otherwise unspecified bounds.
-Set to nil for unbounded.")
-
-;;
-;; Generic widget helpers
-;;
-(defun dashboard-subseq (seq start end)
-  "Return the subsequence of SEQ from START to END..
-Uses `cl-subseq`, but accounts 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)))))
-
-(defmacro dashboard-insert-shortcut (shortcut-char
-				      search-label
-				      &optional no-next-line)
-  "Insert a shortcut SHORTCUT-CHAR for a given SEARCH-LABEL.
-Optionally, provide NO-NEXT-LINE to move the cursor forward a line."
-  `(define-key dashboard-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 dashboard-append (msg &optional messagebuf)
-  "Append MSG to dashboard buffer.
-If MESSAGEBUF is not nil then MSG is also written in message buffer."
-  (with-current-buffer (get-buffer-create "*dashboard*")
-    (goto-char (point-max))
-    (let ((buffer-read-only nil))
-      (insert msg))))
-
-(defun dashboard-insert-page-break ()
-  "Insert a page break line in dashboard buffer."
-  (dashboard-append dashboard-page-separator))
-
-;;
-;; BANNER
-;;
-(defun dashboard-insert-ascii-banner-centered (file)
-  "Insert banner from FILE."
-  (insert
-   (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 (/ (- dashboard-banner-length banner-width) 2)))))
-         (while (not (eobp))
-	   (insert (make-string margin ?\ ))
-           (forward-line 1))))
-     (buffer-string))))
-
-(defun dashboard-insert-image-banner (banner)
-  "Display an image BANNER."
-  (when (file-exists-p banner)
-    (let* ((title dashboard-banner-logo-title)
-           (spec (create-image banner))
-           (size (image-size spec))
-           (width (car size))
-           (left-margin (max 0 (floor (- dashboard-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 (/ (- dashboard-banner-length
-                                        (+ (length title) 1)) 2))) ?\ ))
-      (insert (format "%s\n\n" title)))))
-
-(defun dashboard-get-banner-path (index)
-  "Return the full path to banner with index INDEX."
-  (concat dashboard-banners-directory (format "%d.txt" index)))
-
-(defun dashboard-choose-banner ()
-  "Return the full path of a banner based on the dotfile value."
-  (when dashboard-startup-banner
-    (cond ((eq 'official dashboard-startup-banner)
-           (if (and (display-graphic-p) (image-type-available-p 'png))
-               dashboard-banner-official-png
-             (dashboard-get-banner-path 1)))
-	  ((eq 'logo dashboard-startup-banner)
-           (if (and (display-graphic-p) (image-type-available-p 'png))
-               dashboard-banner-logo-png
-             (dashboard-get-banner-path 1)))
-          ((integerp dashboard-startup-banner)
-           (dashboard-get-banner-path dashboard-startup-banner))
-          ((and dashboard-startup-banner
-                (image-type-available-p (intern (file-name-extension
-                                                 dashboard-startup-banner)))
-                (display-graphic-p))
-           (if (file-exists-p dashboard-startup-banner)
-               dashboard-startup-banner
-             (spacemacs-buffer/warning (format "could not find banner %s"
-                                               dashboard-startup-banner))
-             (dashboard-get-banner-path 1)))
-          (t (dashboard-get-banner-path 1)))))
-
-(defun dashboard-insert-banner ()
-  "Insert Banner at the top of the dashboard."
-  (goto-char (point-max))
-  (let ((banner (dashboard-choose-banner))
-        (buffer-read-only nil))
-    (progn
-      (when banner
-	(if (image-type-available-p (intern (file-name-extension banner)))
-            (dashboard-insert-image-banner banner)
-          (dashboard-insert-ascii-banner-centered banner))))))
-
-;;
-;; Recentf
-;;
-(defun dashboard-insert-recentf-list (list-display-name list)
-  "Render LIST-DISPLAY-NAME title and items of 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 dashboard-insert-recents (list-size)
-  "Add the list of LIST-SIZE items from recently edited files."
-  (recentf-mode)
-  (when (dashboard-insert-recentf-list
-	 "Recent Files:"
-	 (dashboard-subseq recentf-list 0 list-size))
-    (dashboard-insert-shortcut "r" "Recent Files:")))
-
-
-;;
-;; Bookmarks
-;;
-(defun dashboard-insert-bookmark-list (list-display-name list)
-  "Render LIST-DISPLAY-NAME title and bookmarks items of LIST."
-  (when (car list)
-    (insert list-display-name)
-    (mapc (lambda (el)
-            (insert "\n    ")
-            (widget-create 'push-button
-                           :action `(lambda (&rest ignore) (bookmark-jump ,el))
-                           :mouse-face 'highlight
-                           :follow-link "\C-m"
-                           :button-prefix ""
-                           :button-suffix ""
-                           :format "%[%t%]"
-                           (format "%s - %s" el (abbreviate-file-name
-                                                 (bookmark-get-filename el)))))
-          list)))
-
-(defun dashboard-insert-bookmarks (list-size)
-  "Add the list of LIST-SIZE items of bookmarks."
-  (require 'bookmark)
-  (when (dashboard-insert-bookmark-list
-	 "Bookmarks:"
-	 (dashboard-subseq (bookmark-all-names)
-			   0 list-size))
-    (dashboard-insert-shortcut "m" "Bookmarks:")))
-
-;;
-;; Projectile
-;;
-(defun dashboard-insert-project-list (list-display-name list)
-  "Render LIST-DISPLAY-NAME title and project items of LIST."
-  (when (car list)
-    (insert list-display-name)
-    (mapc (lambda (el)
-            (insert "\n    ")
-            (widget-create 'push-button
-                           :action `(lambda (&rest ignore)
-				      (projectile-switch-project-by-name ,el))
-                           :mouse-face 'highlight
-                           :follow-link "\C-m"
-                           :button-prefix ""
-                           :button-suffix ""
-                           :format "%[%t%]"
-                           (abbreviate-file-name el)))
-          list)))
-
-(defun dashboard-insert-projects (list-size)
-  "Add the list of LIST-SIZE items of projects."
-  ;; For some reason, projectile has to be loaded here
-  ;; before trying to load projects list
-  (projectile-mode)
-  (if (bound-and-true-p projectile-mode)
-      (progn
-	(projectile-load-known-projects)
-	(when (dashboard-insert-project-list
-	       "Projects:"
-	       (dashboard-subseq (projectile-relevant-known-projects)
-				 0 list-size))
-	  (dashboard-insert-shortcut "p" "Projects:")))
-    (message "Failed to load projects list")))
-
-;;
-;; Org Agenda
-;;
-(defun dashboard-insert-agenda-list (list-display-name list)
-  "Render LIST-DISPLAY-NAME title and agenda items from LIST."
-  (insert list-display-name)
-  (if (car list)
-      (mapc (lambda (el)
-              (insert "\n    ")
-              (let ((filename (nth 4 el))
-                    (lineno (nth 3 el))
-                    (title (nth 0 el)))
-                (widget-create 'push-button
-                               :action `(lambda (&rest ignore)
-                                          (let ((buffer (find-file-other-window ,filename)))
-                                            (with-current-buffer buffer
-                                              (goto-char ,lineno)
-                                              )
-                                            (switch-to-buffer buffer)))
-                               :mouse-face 'highlight
-                               :follow-link "\C-m"
-                               :button-prefix ""
-                               :button-suffix ""
-                               :format "%[%t%]"
-                               (format "%s" title)))
-              )
-            list)
-    (insert (propertize "\n    --- No items ---" 'face 'widget-button))))
-
-(defun dashboard-timestamp-to-gregorian-date (timestamp)
-  "Convert TIMESTAMP to a gregorian date.
-
-The result can be used with functions like
-`calendar-date-compare'."
-  (let ((decoded-timestamp (decode-time timestamp)))
-    (list (nth 4 decoded-timestamp)
-          (nth 3 decoded-timestamp)
-          (nth 5 decoded-timestamp))))
-
-(defun dashboard-date-due-p (timestamp &optional due-date)
-  "Check if TIMESTAMP is today or in the past.
-
-If DUE-DATE is nil, compare TIMESTAMP to today; otherwise,
-compare to the date in DUE-DATE.
-
-The time part of both TIMESTAMP and DUE-DATE is ignored, only the
-date part is considered."
-  (unless due-date
-    (setq due-date (current-time)))
-  (setq due-date (time-add due-date 86400))
-  (let* ((gregorian-date (dashboard-timestamp-to-gregorian-date timestamp))
-         (gregorian-due-date (dashboard-timestamp-to-gregorian-date due-date)))
-    (calendar-date-compare (list gregorian-date)
-                           (list gregorian-due-date))))
-
-(defun dashboard-get-agenda ()
-  "Get agenda items for today."
-  (org-compile-prefix-format 'agenda)
-  (let* ((filtered-entries nil))
-    (org-map-entries
-     (lambda ()
-       (let* ((schedule-time (org-get-scheduled-time (point)))
-             (deadline-time (org-get-deadline-time (point)))
-             (item (org-agenda-format-item
-		    (format-time-string "%Y-%m-%d" deadline-time)
-                    (org-get-heading t t)
-                    (org-outline-level)
-                    (org-get-category)
-                    (org-get-tags)
-                    t))
-             (loc (point))
-             (file (buffer-file-name)))
-         (when (and (not (org-entry-is-done-p))
-                    (or (and schedule-time (dashboard-date-due-p schedule-time))
-                        (and deadline-time (dashboard-date-due-p deadline-time))))
-           (setq filtered-entries
-                 (append filtered-entries
-                         (list (list item schedule-time deadline-time loc file)))))))
-     nil
-     'agenda)
-    filtered-entries))
-
-(defun dashboard-insert-agenda (list-size)
-  "Add the list of LIST-SIZE items of agenda."
-  (when (dashboard-insert-agenda-list "Agenda for today:"
-                                      (dashboard-get-agenda))
-    (dashboard-insert-shortcut "a" "Agenda for today:")))
-
-;; Forward declartions for optional dependency to keep check-declare happy.
-(declare-function bookmark-get-filename "ext:bookmark.el")
-(declare-function bookmark-all-names "ext:bookmark.el")
-(declare-function projectile-load-known-projects "ext:projectile.el")
-(declare-function projectile-relevant-known-projects "ext:projectile.el")
-
-(provide 'dashboard-widgets)
-;;; widgets.el ends here
.emacs.d/elpa/dashboard-1.2.3/dashboard-widgets.elc
Binary file
.emacs.d/elpa/dashboard-1.2.3/dashboard.el
@@ -1,163 +0,0 @@
-;;; dashboard.el --- A startup screen extracted from Spacemacs
-
-;; Copyright (c) 2016 Rakan Al-Hneiti & Contributors
-;;
-;; Author: Rakan Al-Hneiti
-;; URL: https://github.com/rakanalh/emacs-dashboard
-;;
-;; This file is not part of GNU Emacs.
-;;
-;;; License: GPLv3
-;;
-;; Created: October 05, 2016
-;; Modified: December 30, 2016
-;; Version: 1.2.3
-;; Keywords: startup screen tools
-;; Package-Requires: ((emacs "24.4") (page-break-lines "0.11"))
-;;; Commentary:
-
-;; An extensible Emacs dashboard, with sections for
-;; bookmarks, projectil projects, org-agenda and more.
-
-;;; Code:
-
-(require 'bookmark)
-(require 'calendar)
-(require 'org-agenda)
-(require 'page-break-lines)
-(require 'recentf)
-
-(require 'dashboard-widgets)
-
-;; Custom splash screen
-(defvar dashboard-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [tab] 'widget-forward)
-    (define-key map (kbd "C-i") 'widget-forward)
-    (define-key map [backtab] 'widget-backward)
-    (define-key map (kbd "RET") 'widget-button-press)
-    (define-key map [down-mouse-1] 'widget-button-click)
-    (define-key map (kbd "g") #'dashboard-refresh-buffer)
-    (define-key map (kbd "}") #'dashboard-next-section)
-    (define-key map (kbd "{") #'dashboard-previous-section)
-    map)
-  "Keymap for dashboard mode.")
-
-(define-derived-mode dashboard-mode special-mode "Dashboard"
-  "Dashboard major mode for startup screen.
-\\<dashboard-mode-map>
-"
-  :group 'dashboard
-  :syntax-table nil
-  :abbrev-table nil
-  (whitespace-mode -1)
-  (linum-mode -1)
-  (page-break-lines-mode 1)
-  (setq inhibit-startup-screen t)
-  (setq buffer-read-only t
-        truncate-lines t))
-
-(defgroup dashboard nil
-  "Settings that are used in the Dashboard"
-  :group 'dashboard)
-
-(defconst dashboard-buffer-name "*dashboard*"
-	  "Dashboard's buffer name.")
-
-(defvar dashboard--section-starts nil
-  "List of section starting positions")
-
-(defun dashboard-previous-section ()
-  (interactive)
-  (let ((current-section-start nil)
-        (current-position (point))
-        (previous-section-start nil))
-    (dolist (elt dashboard--section-starts)
-      (when (and current-section-start
-                 (not previous-section-start))
-        (setq previous-section-start elt))
-      (when (and (not current-section-start)
-                 (< elt current-position))
-        (setq current-section-start elt)))
-    (goto-char (if (eq current-position current-section-start)
-                   previous-section-start
-                 current-section-start))))
-
-(defun dashboard-next-section ()
-  (interactive
-   (let ((current-position (point))
-         (next-section-start nil)
-         (section-starts (reverse dashboard--section-starts)))
-     (dolist (elt section-starts)
-       (when (and (not next-section-start)
-                  (> elt current-position))
-         (setq next-section-start elt)))
-     (when next-section-start
-       (goto-char next-section-start)))))
-
-(defun dashboard-insert-startupify-lists ()
-  "Insert the list of widgets into the buffer."
-  (interactive)
-  (let ((buffer-exists (buffer-live-p (get-buffer dashboard-buffer-name)))
-        (save-line nil))
-    (when (or (not (eq dashboard-buffer-last-width (window-width)))
-              (not buffer-exists))
-      (setq dashboard-banner-length (window-width)
-            dashboard-buffer-last-width dashboard-banner-length)
-      (with-current-buffer (get-buffer-create dashboard-buffer-name)
-        (let ((buffer-read-only nil)
-              (list-separator "\n\n"))
-          (erase-buffer)
-          (dashboard-insert-banner)
-          (dashboard-insert-page-break)
-          (setq dashboard--section-starts nil)
-          (mapc (lambda (els)
-                  (let* ((el (or (car-safe els) els))
-                         (list-size
-                          (or (cdr-safe els)
-                              dashboard-items-default-length))
-                         (item-generator
-                          (cdr-safe (assoc el dashboard-item-generators))))
-                    (add-to-list 'dashboard--section-starts (point))
-                    (funcall item-generator list-size)
-                    (dashboard-insert-page-break)))
-                dashboard-items))
-        (dashboard-mode)
-        (goto-char (point-min))))))
-
-(add-hook 'window-setup-hook
-          (lambda ()
-            (add-hook 'window-configuration-change-hook 'dashboard-resize-on-hook)
-            (dashboard-resize-on-hook)))
-
-(defun dashboard-refresh-buffer ()
-  "Refresh buffer."
-  (interactive)
-  (kill-buffer dashboard-buffer-name)
-  (dashboard-insert-startupify-lists)
-  (switch-to-buffer dashboard-buffer-name))
-
-(defun dashboard-resize-on-hook ()
-  (let ((space-win (get-buffer-window dashboard-buffer-name))
-        (frame-win (frame-selected-window)))
-    (when (and space-win
-               (not (window-minibuffer-p frame-win)))
-      (with-selected-window space-win
-        (dashboard-insert-startupify-lists)))))
-
-;;;###autoload
-(defun dashboard-setup-startup-hook ()
-  "Setup post initialization hooks.
-If a command line argument is provided, assume a filename and skip displaying Dashboard"
-  (if (< (length command-line-args) 2 )
-      (progn
-	(add-hook 'after-init-hook (lambda ()
-				     ;; Display useful lists of items
-				     (dashboard-insert-startupify-lists)))
-	(add-hook 'emacs-startup-hook '(lambda ()
-					 (switch-to-buffer "*dashboard*")
-					 (goto-char (point-min))
-					 (redisplay))))))
-
-(provide 'dashboard)
-;;; dashboard.el ends here
.emacs.d/elpa/dashboard-1.2.3/dashboard.elc
Binary file
.emacs.d/elpa/diminish-20170419.1036/diminish-autoloads.el
@@ -1,57 +0,0 @@
-;;; diminish-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "diminish" "diminish.el" (22966 57819 613917
-;;;;;;  224000))
-;;; Generated autoloads from diminish.el
-
-(autoload 'diminish "diminish" "\
-Diminish mode-line display of minor mode MODE to TO-WHAT (default \"\").
-
-Interactively, enter (with completion) the name of any minor mode, followed
-on the next line by what you want it diminished to (default empty string).
-The response to neither prompt should be quoted.  However, in Lisp code,
-both args must be quoted, the first as a symbol, the second as a string,
-as in (diminish 'jiggle-mode \" Jgl\").
-
-The mode-line displays of minor modes usually begin with a space, so
-the modes' names appear as separate words on the mode line.  However, if
-you're having problems with a cramped mode line, you may choose to use single
-letters for some modes, without leading spaces.  Capitalizing them works
-best; if you then diminish some mode to \"X\" but have abbrev-mode enabled as
-well, you'll get a display like \"AbbrevX\".  This function prepends a space
-to TO-WHAT if it's > 1 char long & doesn't already begin with a space.
-
-\(fn MODE &optional TO-WHAT)" t nil)
-
-(autoload 'diminish-undo "diminish" "\
-Restore mode-line display of diminished mode MODE to its minor-mode value.
-Do nothing if the arg is a minor mode that hasn't been diminished.
-
-Interactively, enter (with completion) the name of any diminished mode (a
-mode that was formerly a minor mode on which you invoked \\[diminish]).
-To restore all diminished modes to minor status, answer `diminished-modes'.
-The response to the prompt shouldn't be quoted.  However, in Lisp code,
-the arg must be quoted as a symbol, as in (diminish-undo 'diminished-modes).
-
-\(fn MODE)" t nil)
-
-(autoload 'diminished-modes "diminish" "\
-Echo all active diminished or minor modes as if they were minor.
-The display goes in the echo area; if it's too long even for that,
-you can see the whole thing in the *Messages* buffer.
-This doesn't change the status of any modes; it just lets you see
-what diminished modes would be on the mode-line if they were still minor.
-
-\(fn)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; diminish-autoloads.el ends here
.emacs.d/elpa/diminish-20170419.1036/diminish-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "diminish" "20170419.1036" "Diminished modes are minor modes with no modeline display" 'nil :commit "d5c61a14e1a5590a65f83c099a5bd42fcadff24d" :url "https://github.com/myrjola/diminish.el" :keywords '("extensions" "diminish" "minor" "codeprose"))
.emacs.d/elpa/diminish-20170419.1036/diminish.el
@@ -1,294 +0,0 @@
-;;; diminish.el --- Diminished modes are minor modes with no modeline display
-
-;; Copyright (C) 1998 Free Software Foundation, Inc.
-
-;; Author: Will Mengarini <seldon@eskimo.com>
-;; Maintainer: Martin Yrjölä <martin.yrjola@gmail.com>
-;; URL: <https://github.com/myrjola/diminish.el>
-;; Package-Version: 20170419.1036
-;; Created: Th 19 Feb 98
-;; Version: 0.45
-;; Keywords: extensions, diminish, minor, codeprose
-
-;; 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
-;; this program; see the file LICENSE. If not, write to the write to the Free
-;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-;; 02110-1301, USA.
-
-;;; Commentary:
-
-;; Minor modes each put a word on the mode line to signify that they're
-;; active.  This can cause other displays, such as % of file that point is
-;; at, to run off the right side of the screen.  For some minor modes, such
-;; as mouse-avoidance-mode, the display is a waste of space, since users
-;; typically set the mode in their .emacs & never change it.  For other
-;; modes, such as my jiggle-mode, it's a waste because there's already a
-;; visual indication of whether the mode is in effect.
-
-;; A diminished mode is a minor mode that has had its mode line
-;; display diminished, usually to nothing, although diminishing to a
-;; shorter word or a single letter is also supported.  This package
-;; implements diminished modes.
-
-;; You can use this package either interactively or from your .emacs file.
-;; In either case, first you'll need to copy this file to a directory that
-;; appears in your load-path.  `load-path' is the name of a variable that
-;; contains a list of directories Emacs searches for files to load.
-;; To prepend another directory to load-path, put a line like
-;; (add-to-list 'load-path "c:/My_Directory") in your .emacs file.
-
-;; To create diminished modes interactively, type
-;;   M-x load-library
-;; to get a prompt like
-;;   Load library:
-;; and respond `diminish' (unquoted).  Then type
-;;   M-x diminish
-;; to get a prompt like
-;;   Diminish what minor mode:
-;; and respond with the name of some minor mode, like mouse-avoidance-mode.
-;; You'll then get this prompt:
-;;   To what mode-line display:
-;; Respond by just hitting <Enter> if you want the name of the mode
-;; completely removed from the mode line.  If you prefer, you can abbreviate
-;; the name.  If your abbreviation is 2 characters or more, such as "Av",
-;; it'll be displayed as a separate word on the mode line, just like minor
-;; modes' names.  If it's a single character, such as "V", it'll be scrunched
-;; up against the previous word, so for example if the undiminished mode line
-;; display had been "Abbrev Fill Avoid", it would become "Abbrev FillV".
-;; Multiple single-letter diminished modes will all be scrunched together.
-;; The display of undiminished modes will not be affected.
-
-;; To find out what the mode line would look like if all diminished modes
-;; were still minor, type M-x diminished-modes.  This displays in the echo
-;; area the complete list of minor or diminished modes now active, but
-;; displays them all as minor.  They remain diminished on the mode line.
-
-;; To convert a diminished mode back to a minor mode, type M-x diminish-undo
-;; to get a prompt like
-;;   Restore what diminished mode:
-;; Respond with the name of some diminished mode.  To convert all
-;; diminished modes back to minor modes, respond to that prompt
-;; with `diminished-modes' (unquoted, & note the hyphen).
-
-;; When you're responding to the prompts for mode names, you can use
-;; completion to avoid extra typing; for example, m o u SPC SPC SPC
-;; is usually enough to specify mouse-avoidance-mode.  Mode names
-;; typically end in "-mode", but for historical reasons
-;; auto-fill-mode is named by "auto-fill-function".
-
-;; To create diminished modes noninteractively in your .emacs file, put
-;; code like
-;;   (require 'diminish)
-;;   (diminish 'abbrev-mode "Abv")
-;;   (diminish 'jiggle-mode)
-;;   (diminish 'mouse-avoidance-mode "M")
-;; near the end of your .emacs file.  It should be near the end so that any
-;; minor modes your .emacs loads will already have been loaded by the time
-;; they're to be converted to diminished modes.
-
-;; To diminish a major mode, (setq mode-name "whatever") in the mode hook.
-
-;;; Epigraph:
-
-;;         "The quality of our thoughts is bordered on all sides
-;;          by our facility with language."
-;;               --J. Michael Straczynski
-
-;;; Code:
-
-(eval-when-compile (require 'cl))
-
-(defvar diminish-must-not-copy-minor-mode-alist nil
-  "Non-nil means loading diminish.el won't (copy-alist minor-mode-alist).
-Normally `minor-mode-alist' is setq to that copy on loading diminish because
-at least one of its cons cells, that for abbrev-mode, is read-only (see
-ELisp Info on \"pure storage\").  If you setq this variable to t & then
-try to diminish abbrev-mode under GNU Emacs 19.34, you'll get the error
-message \"Attempt to modify read-only object\".")
-
-(or diminish-must-not-copy-minor-mode-alist
-    (callf copy-alist minor-mode-alist))
-
-(defvar diminished-mode-alist nil
-  "The original `minor-mode-alist' value of all (diminish)ed modes.")
-
-(defvar diminish-history-symbols nil
-  "Command history for symbols of diminished modes.")
-
-(defvar diminish-history-names nil
-  "Command history for names of diminished modes.")
-
-;; When we diminish a mode, we are saying we want it to continue doing its
-;; work for us, but we no longer want to be reminded of it.  It becomes a
-;; night worker, like a janitor; it becomes an invisible man; it remains a
-;; component, perhaps an important one, sometimes an indispensable one, of
-;; the mechanism that maintains the day-people's world, but its place in
-;; their thoughts is diminished, usually to nothing.  As we grow old we
-;; diminish more and more such thoughts, such people, usually to nothing.
-
-;; "The wise man knows that to keep under is to endure."  The diminished
-;; often come to value their invisibility.  We speak--speak--of "the strong
-;; silent type", but only as a superficiality; a stereotype in a movie,
-;; perhaps, but even if an acquaintance, necessarily, by hypothesis, a
-;; distant one.  The strong silent type is actually a process.  It begins
-;; with introspection, continues with judgment, and is shaped by the
-;; discovery that these judgments are impractical to share; there is no
-;; appetite for the wisdom of the self-critical among the creatures of
-;; material appetite who dominate our world.  Their dominance's Darwinian
-;; implications reinforce the self-doubt that is the germ of higher wisdom.
-;; The thoughtful contemplate the evolutionary triumph of the predator.
-;; Gnostics deny the cosmos could be so evil; this must all be a prank; the
-;; thoughtful remain silent, invisible, self-diminished, and discover,
-;; perhaps at first in surprise, the freedom they thus gain, and grow strong.
-
-;;;###autoload
-(defun diminish (mode &optional to-what)
-  "Diminish mode-line display of minor mode MODE to TO-WHAT (default \"\").
-
-Interactively, enter (with completion) the name of any minor mode, followed
-on the next line by what you want it diminished to (default empty string).
-The response to neither prompt should be quoted.  However, in Lisp code,
-both args must be quoted, the first as a symbol, the second as a string,
-as in (diminish 'jiggle-mode \" Jgl\").
-
-The mode-line displays of minor modes usually begin with a space, so
-the modes' names appear as separate words on the mode line.  However, if
-you're having problems with a cramped mode line, you may choose to use single
-letters for some modes, without leading spaces.  Capitalizing them works
-best; if you then diminish some mode to \"X\" but have abbrev-mode enabled as
-well, you'll get a display like \"AbbrevX\".  This function prepends a space
-to TO-WHAT if it's > 1 char long & doesn't already begin with a space."
-  (interactive (list (read (completing-read
-                            "Diminish what minor mode: "
-                            (mapcar (lambda (x) (list (symbol-name (car x))))
-                                    minor-mode-alist)
-                            nil t nil 'diminish-history-symbols))
-                     (read-from-minibuffer
-                      "To what mode-line display: "
-                      nil nil nil 'diminish-history-names)))
-  (let ((minor (assq mode minor-mode-alist)))
-    (when minor
-        (progn (callf or to-what "")
-               (when (and (stringp to-what)
-                          (> (length to-what) 1))
-                 (or (= (string-to-char to-what) ?\ )
-                     (callf2 concat " " to-what)))
-               (or (assq mode diminished-mode-alist)
-                   (push (copy-sequence minor) diminished-mode-alist))
-               (setcdr minor (list to-what))))))
-
-;; But an image comes to me, vivid in its unreality, of a loon alone on his
-;; forest lake, shrieking his soul out into a canopy of stars.  Alone this
-;; afternoon in my warm city apartment, I can feel the bite of his night air,
-;; and smell his conifers.  In him there is no acceptance of diminishment.
-
-;; "I have a benevolent habit of pouring out myself to everybody,
-;;  and would even pay for a listener, and I am afraid
-;;  that the Athenians may think me too talkative."
-;;       --Socrates, in the /Euthyphro/
-
-;; I remember a news story about a retired plumber who had somehow managed to
-;; steal a military tank.  He rode it down city streets, rode over a parked
-;; car--no one was hurt--rode onto a freeway, that concrete symbol of the
-;; American spirit, or so we fancy it, shouting "Plumber Bob!  Plumber Bob!".
-;; He was shot dead by police.
-
-;;;###autoload
-(defun diminish-undo (mode)
-  "Restore mode-line display of diminished mode MODE to its minor-mode value.
-Do nothing if the arg is a minor mode that hasn't been diminished.
-
-Interactively, enter (with completion) the name of any diminished mode (a
-mode that was formerly a minor mode on which you invoked \\[diminish]).
-To restore all diminished modes to minor status, answer `diminished-modes'.
-The response to the prompt shouldn't be quoted.  However, in Lisp code,
-the arg must be quoted as a symbol, as in (diminish-undo 'diminished-modes)."
-  (interactive
-   (list (read (completing-read
-                "Restore what diminished mode: "
-                (cons (list "diminished-modes")
-                      (mapcar (lambda (x) (list (symbol-name (car x))))
-                              diminished-mode-alist))
-                nil t nil 'diminish-history-symbols))))
-  (if (eq mode 'diminished-modes)
-      (let ((diminished-modes diminished-mode-alist))
-        (while diminished-modes
-          (diminish-undo (caar diminished-modes))
-          (callf cdr diminished-modes)))
-    (let ((minor      (assq mode      minor-mode-alist))
-          (diminished (assq mode diminished-mode-alist)))
-      (or minor
-          (error "%S is not currently registered as a minor mode" mode))
-      (when diminished
-        (setcdr minor (cdr diminished))))))
-
-;; Plumber Bob was not from Seattle, my grey city, for rainy Seattle is a
-;; city of interiors, a city of the self-diminished.  When I moved here one
-;; sunny June I was delighted to find that ducks and geese were common in
-;; the streets.  But I hoped to find a loon or two, and all I found were
-;; ducks and geese.  I wondered about this; I wondered why there were no
-;; loons in Seattle; but my confusion resulted from my ignorance of the
-;; psychology of rain, which is to say my ignorance of diminished modes.
-;; What I needed, and lacked, was a way to discover they were there.
-
-;;;###autoload
-(defun diminished-modes ()
-  "Echo all active diminished or minor modes as if they were minor.
-The display goes in the echo area; if it's too long even for that,
-you can see the whole thing in the *Messages* buffer.
-This doesn't change the status of any modes; it just lets you see
-what diminished modes would be on the mode-line if they were still minor."
-  (interactive)
-  (let ((minor-modes minor-mode-alist)
-        message)
-    (while minor-modes
-      (when (symbol-value (caar minor-modes))
-        ;; This minor mode is active in this buffer
-        (let* ((mode-pair (car minor-modes))
-               (mode (car mode-pair))
-               (minor-pair (or (assq mode diminished-mode-alist) mode-pair))
-               (minor-name (cadr minor-pair)))
-          (when (symbolp minor-name)
-            ;; This minor mode uses symbol indirection in the cdr
-            (let ((symbols-seen (list minor-name)))
-              (while (and (symbolp (callf symbol-value minor-name))
-                          (not (memq minor-name symbols-seen)))
-                (push minor-name symbols-seen))))
-          (push minor-name message)))
-      (callf cdr minor-modes))
-    (setq message (mapconcat 'identity (nreverse message) ""))
-    (when (= (string-to-char message) ?\ )
-      (callf substring message 1))
-    (message "%s" message)))
-
-;; A human mind is a Black Forest of diminished modes.  Some are dangerous;
-;; most of the mind of an intimate is a secret stranger, and these diminished
-;; modes are rendered more unpredictable by their long isolation from the
-;; corrective influence of interaction with reality.  The student of history
-;; learns that this description applies to whole societies as well.  In some
-;; ways the self-diminished are better able to discern the night worker.
-;; They are rendered safer by their heightened awareness of others'
-;; diminished modes, and more congenial by the spare blandness of their own
-;; mode lines.  To some people rain is truly depressing, but others it just
-;; makes pensive, and, forcing them indoors where they may not have the
-;; luxury of solitude, teaches them to self-diminish.  That was what I had
-;; not understood when I was searching for loons among the ducks and geese.
-;; Loons come to Seattle all the time, but the ones that like it learn to be
-;; silent, learn to self-diminish, and take on the colors of ducks and geese.
-;; Now, here a dozen years, I can recognize them everywhere, standing quietly
-;; in line with the ducks and geese at the espresso counter, gazing placidly
-;; out on the world through loon-red eyes, thinking secret thoughts.
-
-(provide 'diminish)
-
-;;; diminish.el ends here
.emacs.d/elpa/diminish-20170419.1036/diminish.elc
Binary file
.emacs.d/elpa/direnv-20170717.1049/direnv-autoloads.el
@@ -1,55 +0,0 @@
-;;; direnv-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "direnv" "direnv.el" (22977 26779 767070 22000))
-;;; Generated autoloads from direnv.el
-
-(autoload 'direnv-update-environment "direnv" "\
-Update the environment for FILE-NAME.
-
-\(fn &optional FILE-NAME)" t nil)
-
-(autoload 'direnv-edit "direnv" "\
-Edit the .envrc associated with the current directory.
-
-\(fn)" t nil)
-
-(defvar direnv-mode nil "\
-Non-nil if Direnv mode is enabled.
-See the `direnv-mode' command
-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 `direnv-mode'.")
-
-(custom-autoload 'direnv-mode "direnv" nil)
-
-(autoload 'direnv-mode "direnv" "\
-Global minor mode to automatically update the environment using direnv.
-
-When this mode is active, the environment inside Emacs will be
-continuously updated to match the direnv environment for the currently
-visited (local) file.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'direnv-envrc-mode "direnv" "\
-Major mode for .envrc files as used by direnv.
-
-Since .envrc files are shell scripts, this mode inherits from sh-mode.
-\\{direnv-envrc-mode-map}
-
-\(fn)" t nil)
-
-(add-to-list 'auto-mode-alist '("\\.envrc\\'" . direnv-envrc-mode))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; direnv-autoloads.el ends here
.emacs.d/elpa/direnv-20170717.1049/direnv-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "direnv" "20170717.1049" "direnv support for emacs" '((emacs "24.4") (dash "2.13.0") (with-editor "2.5.10")) :commit "d181475192138b256e124a42660ac60ae62d11d0" :url "https://github.com/wbolster/emacs-direnv" :keywords '("direnv" "environment"))
.emacs.d/elpa/direnv-20170717.1049/direnv.el
@@ -1,218 +0,0 @@
-;;; direnv.el --- direnv support for emacs
-
-;; Author: Wouter Bolsterlee <wouter@bolsterl.ee>
-;; Version: 1.2.1
-;; Package-Version: 20170717.1049
-;; Package-Requires: ((emacs "24.4") (dash "2.13.0") (with-editor "2.5.10"))
-;; Keywords: direnv, environment
-;; URL: https://github.com/wbolster/emacs-direnv
-;;
-;; This file is not part of GNU Emacs.
-
-;;; License:
-
-;; 3-clause "new bsd"; see readme for details.
-
-;;; Commentary:
-
-;; This package provides direnv integration for Emacs.
-;; See the README for more information.
-
-;;; Code:
-
-(require 'dash)
-(require 'json)
-(require 'subr-x)
-(require 'with-editor)
-
-(defgroup direnv nil
-  "direnv integration for emacs"
-  :group 'environment
-  :prefix "direnv-")
-
-(defun direnv--detect ()
-  "Detect the direnv executable."
-  (executable-find "direnv"))
-
-(defvar direnv--output-buffer-name " *direnv*"
-  "Name of the hidden buffer used for direnv interaction.")
-
-(defvar direnv--installed (direnv--detect)
-  "Whether direnv is installed.")
-
-(defvar direnv--active-directory nil
-  "Name of the directory for which direnv has most recently ran.")
-
-(defcustom direnv-always-show-summary nil
-  "Whether to show a summary message of environment changes on every change.
-
-When nil, a summary is only shown when direnv-update-environment is called
-interactively."
-  :group 'direnv
-  :type 'boolean)
-
-(defcustom direnv-show-paths-in-summary t
-  "Whether to show directory paths in the summary message."
-  :group 'direnv
-  :type 'boolean)
-
-(defcustom direnv-use-faces-in-summary t
-  "Whether to use custom font faces in the summary message.
-
-When enabled, the summary message uses custom font faces strings
-for added, changed, and removed environment variables, which
-usually results in coloured output."
-  :group 'direnv
-  :type 'boolean)
-
-(defun direnv--export (directory)
-  "Call direnv for DIRECTORY and return the parsed result."
-  (unless direnv--installed
-    (setq direnv--installed (direnv--detect)))
-  (unless direnv--installed
-    (user-error "Could not find the direnv executable. Is exec-path correct?"))
-  (with-current-buffer (get-buffer-create direnv--output-buffer-name)
-    (erase-buffer)
-    (let* ((default-directory directory)
-           (exit-code (call-process "direnv" nil '(t t) nil "export" "json")))
-      (unless (zerop exit-code)
-        (display-buffer (current-buffer))
-        (error "Error running direnv: exit code %s; output is in buffer '%s'"
-               exit-code direnv--output-buffer-name))
-      (unless (zerop (buffer-size))
-        (goto-char (point-max))
-        (re-search-backward "^{")
-        (let ((json-key-type 'string))
-          (json-read-object))))))
-
-(defun direnv--enable ()
-  "Enable direnv mode."
-  (add-hook 'post-command-hook #'direnv--maybe-update-environment)
-  (direnv--maybe-update-environment))
-
-(defun direnv--disable ()
-  "Disable direnv mode."
-  (remove-hook 'post-command-hook #'direnv--maybe-update-environment))
-
-(defun direnv--maybe-update-environment ()
-  "Maybe update the environment."
-  (with-current-buffer (window-buffer)
-    (let* ((file-name (buffer-file-name (current-buffer)))
-           (directory-name (when file-name (file-name-directory file-name))))
-      (when (and file-name
-                 (file-directory-p directory-name)
-                 (not (string-equal direnv--active-directory directory-name))
-                 (not (file-remote-p file-name)))
-        (direnv-update-environment file-name)))))
-
-(defun direnv--maybe-enable-with-editor-mode ()
-  "Enable with-editor-mode when run via direnv-edit."
-  ;; This is a dirty hack. See https://github.com/magit/with-editor/issues/23
-  (run-at-time
-   1 nil
-   (lambda ()
-     (with-current-buffer (window-buffer)
-       (when server-buffer-clients
-         (with-editor-mode))))))
-
-(defun direnv--summarise-changes (items)
-  "Create a summary string for ITEMS."
-  (string-join
-   (--map
-    (let* ((name (car it))
-           (state (cdr it))
-           (face)
-           (prefix))
-      (pcase state
-        ('added   (setq prefix "+" face 'diff-added))
-        ('changed (setq prefix "~" face 'diff-changed))
-        ('removed (setq prefix "-" face 'diff-removed)))
-      (propertize (concat prefix name) 'face face))
-    (--sort
-     (string-lessp (symbol-name (cdr it)) (symbol-name (cdr other)))
-     (--map
-      (cons (car it)
-            (if (cdr it) (if (getenv (car it)) 'changed 'added) 'removed))
-      (--sort
-       (string-lessp (car it) (car other))
-       (--remove (string-prefix-p "DIRENV_" (car it)) items)))))
-   " "))
-
-(defun direnv--show-summary (items old-directory new-directory)
-  "Show a summary message for ITEMS.
-
-OLD-DIRECTORY and NEW-DIRECTORY are the directories before and afther
-the environment changes."
-  (let ((summary (direnv--summarise-changes items))
-        (paths (format
-                " (%s)"
-                (if (and old-directory (string-equal old-directory new-directory))
-                    new-directory
-                  (format "from %s to %s" (or old-directory "(none)") new-directory)))))
-    (when (string-empty-p summary)
-      (setq summary "no changes"))
-    (unless direnv-show-paths-in-summary
-      (setq paths ""))
-    (unless direnv-use-faces-in-summary
-      (setq summary (substring-no-properties summary)))
-    (message "direnv: %s%s" summary paths)))
-
-;;;###autoload
-(defun direnv-update-environment (&optional file-name)
-  "Update the environment for FILE-NAME."
-  (interactive)
-  (let ((file-name (or file-name buffer-file-name))
-        (old-directory direnv--active-directory))
-    (unless file-name
-      (user-error "Buffer is not visiting a file"))
-    (when (file-remote-p file-name)
-      (user-error "Cannot use direnv for remote files"))
-    (setq direnv--active-directory (file-name-directory file-name))
-    (let ((items (direnv--export direnv--active-directory)))
-      (when (or direnv-always-show-summary (called-interactively-p 'interactive))
-        (direnv--show-summary items old-directory direnv--active-directory))
-      (dolist (pair items)
-        (let ((name (car pair))
-              (value (cdr pair)))
-          (setenv name value)
-          (when (string-equal name "PATH")
-            (setq exec-path (append (parse-colon-path value) (list exec-directory)))))))))
-
-;;;###autoload
-(defun direnv-edit ()
-  "Edit the .envrc associated with the current directory."
-  (interactive)
-  (let ((display-buffer-alist
-         (cons (cons "\\*Async Shell Command\\*.*" (cons #'display-buffer-no-window nil))
-               display-buffer-alist)))
-    (with-editor-async-shell-command "direnv edit" nil nil))
-  (direnv-update-environment))
-
-;;;###autoload
-(define-minor-mode direnv-mode
-  "Global minor mode to automatically update the environment using direnv.
-
-When this mode is active, the environment inside Emacs will be
-continuously updated to match the direnv environment for the currently
-visited (local) file."
-  :global t
-  (if direnv-mode
-      (direnv--enable)
-    (direnv--disable)))
-
-;;;###autoload
-(define-derived-mode direnv-envrc-mode
-  sh-mode "envrc"
-  "Major mode for .envrc files as used by direnv.
-
-Since .envrc files are shell scripts, this mode inherits from sh-mode.
-\\{direnv-envrc-mode-map}")
-
-(add-hook 'direnv-envrc-mode-hook #'direnv--maybe-enable-with-editor-mode)
-
-;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.envrc\\'" . direnv-envrc-mode))
-
-(provide 'direnv)
-
-;;; direnv.el ends here
.emacs.d/elpa/direnv-20170717.1049/direnv.elc
Binary file
.emacs.d/elpa/doom-themes-1.2.5/doom-molokai-theme.el
@@ -1,417 +0,0 @@
-;; DOOM Molokai (inspired by molokai)
-
-(require 'doom-themes)
-
-(deftheme doom-molokai
-  "A dark theme inspired by molokai")
-
-(let ((c '((class color) (min-colors 89)))
-      (bold   doom-enable-bold)
-      (italic doom-enable-italic)
-
-      (bg             "#1D1F20")
-      (bg-l           "#222425")
-      (fg             "#D6D6D4")
-      (subtle         "#aab6c7")
-      (vsubtle        "#556172")
-
-      (black          "#000000")
-      (grey           "#C0C5CF")
-      (grey-.5        "#828284")
-      (grey-1         "#525254")
-      (grey-2         "#39393D")
-      (white          "#FFFFFF")
-      (yellow         "#E2C770")
-      (orange         "#FD971F")
-      (red            "#E74C3C")
-      (magenta        "#F92672")
-      (violet         "#9C91E4")
-      (blue           "#268BD2")
-      (blue+2         "#727280")
-      (cyan           "#66D9EF")
-      (green          "#B6E63E")
-      (green-3        "#86B20E")
-      (dark-cyan      "#8FA1B3"))
-
-  (let* ((search-bg      green)
-         (search-fg      black)
-         (search-rest-bg violet)
-         (search-rest-fg black)
-         (highlight      orange)
-         (vertical-bar   grey-2)
-         (current-line   "#1F1F1F")
-         (selection      "#535556")
-         (builtin        orange)
-         (comments       grey-1)
-         (constants      green)
-         (delimiters     "#c0c5ce")
-         (functions      cyan)
-         (keywords       magenta)
-         (methods        dark-cyan)
-         (operators      violet)
-         (type           cyan)
-         (strings        green)
-         (variables      orange)
-
-         (error-highlight red)
-
-         (linum-bg       current-line)
-         (linum-fg       "#3F3F48")
-         (linum-hl-fg    orange)
-         (linum-hl-bg    current-line)
-
-         (active-minibuffer "#404046")
-         (modeline-fg    white)
-         (modeline-fg-2  orange)
-         (modeline-fg-3  orange)
-         (modeline-fg-inactive  "#80858F")
-         (modeline-bg    grey-2)
-         (modeline-bg-2  grey-2)
-         (modeline-bg-3  grey-2)
-         (modeline-bg-inactive  current-line)
-
-         (vc-modified    grey-2)
-         (vc-added       green-3)
-         (vc-deleted     red))
-
-    (custom-theme-set-faces
-     'doom-molokai
-     ;; Doom faces
-     `(doom-default
-       ((((type graphic)) :inherit default :background ,bg-l)
-        (t                :inherit default)))
-     `(doom-hl-line
-       ((((type graphic)) :background ,bg)
-        (t                :inherit hl-line)))
-     `(doom-linum
-       ((((type graphic)) :inherit linum :background ,bg-l)
-        (t                :inherit linum)))
-     `(doom-minibuffer-active ((,c (:background ,bg-l))))
-     `(doom-nlinum-highlight  ((,c (:foreground ,linum-hl-fg :bold nil))))
-     `(doom-flycheck-error    ((,c (:underline nil :foreground ,black :background ,red))))
-     `(doom-flycheck-warning  ((,c (:underline nil :foreground ,black :background ,yellow))))
-     `(doom-flycheck-info     ((,c (:underline nil :foreground ,black :background ,green))))
-     ;; Text
-     `(default                             ((,c (:foreground ,fg :background ,bg))))
-     `(fringe                              ((,c (:background ,bg-l :foreground ,grey-1))))
-     `(cursor                              ((,c (:background ,orange))))
-     `(hl-line                             ((,c (:background ,bg-l))))
-     `(region                              ((,c (:background ,grey-2 :foreground ,white))))
-     `(highlight                           ((,c (:foreground ,yellow :inverse-video t))))
-     `(shadow                              ((,c (:foreground ,orange))))
-     `(minibuffer-prompt                   ((,c (:foreground ,orange))))
-     `(tooltip                             ((,c (:background ,grey-2 :foreground ,orange))))
-     `(error                               ((,c (:foreground ,red   ))))
-     `(warning                             ((,c (:foreground ,yellow))))
-     `(success                             ((,c (:foreground ,green ))))
-     ;; `(secondary-selection              ((,c (:background ,orange))))
-     ;; `(lazy-highlight                   ((,c (:background ,orange))))
-     ;; `(match                            ((,c (:background ,magenta))))
-     `(bold                                ((,c (:weight bold  :foreground ,white))))
-     `(italic                              ((,c (:slant italic :foreground ,subtle))))
-     `(bold-italic                         ((,c (:weight bold  :slant italic :foreground ,white))))
-     `(trailing-whitespace                 ((,c (:background "#884444"))))
-     `(whitespace-tab                      ((,c (:foreground ,grey-2))))
-     `(whitespace-newline                  ((,c (:foreground ,grey-2))))
-     `(whitespace-trailing                 ((,c (:background ,grey-2))))
-     `(vertical-border                     ((,c (:foreground ,vertical-bar :background ,vertical-bar))))
-     `(linum                               ((,c (:foreground ,linum-fg :background ,bg :bold nil))))
-     `(font-lock-builtin-face              ((,c (:foreground ,builtin))))
-     `(font-lock-comment-face              ((,c (:foreground ,comments))))
-     `(font-lock-comment-delimiter-face    ((,c (:foreground ,comments))))
-     `(font-lock-doc-face                  ((,c (:foreground ,blue+2))))
-     `(font-lock-doc-string-face           ((,c (:foreground ,blue+2))))
-     `(font-lock-constant-face             ((,c (:foreground ,constants))))
-     `(font-lock-function-name-face        ((,c (:foreground ,functions))))
-     `(font-lock-keyword-face              ((,c (:foreground ,keywords))))
-     `(font-lock-string-face               ((,c (:foreground ,strings))))
-     `(font-lock-type-face                 ((,c (:foreground ,type))))
-     `(font-lock-variable-name-face        ((,c (:foreground ,variables))))
-     `(font-lock-warning-face              ((,c (:foreground ,red))))
-     `(font-lock-negation-char-face        ((,c (:foreground ,operators :bold t))))
-     `(font-lock-preprocessor-char-face    ((,c (:foreground ,operators :bold t))))
-     `(font-lock-regexp-grouping-backslash ((,c (:foreground ,operators :bold t))))
-     `(font-lock-regexp-grouping-construct ((,c (:foreground ,operators :bold t))))
-     `(show-paren-match                    ((,c (:foreground ,magenta :inverse-video t))))
-     ;; Modeline
-     `(mode-line                           ((,c (:foreground ,modeline-fg          :background ,modeline-bg))))
-     `(mode-line-inactive                  ((,c (:foreground ,modeline-fg-inactive :background ,modeline-bg-inactive))))
-     `(mode-line-is-modified               ((,c (:foreground ,magenta :background nil :bold t))))
-     `(mode-line-buffer-file               ((,c (:foreground ,white :bold t))))
-     `(mode-line-buffer-path               ((,c (:foreground ,grey))))
-     `(mode-line-count-face                ((,c (:foreground ,black :background ,magenta))))
-     `(spaceline-flycheck-error            ((,c (:underline nil :foreground ,black :background ,red))))
-     `(spaceline-flycheck-warning          ((,c (:underline nil :foreground ,black :background ,yellow))))
-     `(spaceline-flycheck-info             ((,c (:underline nil :foreground ,black :background ,green))))
-     `(spaceline-highlight-face            ((,c (:foreground ,black :background ,highlight))))
-     `(powerline-active1                   ((,c (:foreground ,modeline-fg-2 :background ,modeline-bg-2))))
-     `(powerline-active2                   ((,c (:foreground ,modeline-fg-3 :background ,modeline-bg-3))))
-     `(powerline-inactive1                 ((,c (:foreground ,modeline-fg-inactive :background ,modeline-bg-inactive))))
-     `(powerline-inactive2                 ((,c (:foreground ,modeline-fg-inactive :background ,modeline-bg-inactive))))
-     ;; Custom (doom)
-     `(doom-modeline-buffer-path       ((,c (:foreground ,(if bold white yellow) :bold ,bold))))
-     `(doom-modeline-buffer-project    ((,c (:foreground ,fg))))
-     `(doom-modeline-buffer-modified   ((,c (:foreground ,orange))))
-     `(doom-modeline-buffer-major-mode ((,c (:foreground ,white :bold ,bold))))
-
-     `(doom-modeline-highlight     ((,c (:foreground ,orange))))
-     `(doom-modeline-panel         ((,c (:foreground ,black :background ,orange))))
-     `(doom-modeline-bar           ((,c (:background ,yellow))))
-     `(doom-modeline-eldoc-bar     ((,c (:background ,red))))
-
-     `(doom-modeline-info         ((,c (:foreground ,yellow))))
-     `(doom-modeline-warning      ((,c (:background ,green))))
-     `(doom-modeline-urgent       ((,c (:background ,red))))
-     ;; Search
-     `(isearch                             ((,c (:foreground ,search-fg :background ,search-bg))))
-     `(isearch-lazy-highlight-face         ((,c (:foreground ,search-rest-fg :background ,search-rest-bg))))
-     ;; Terminal colors
-     `(term-color-black            ((,c (:foreground ,black :background ,black))))
-     `(term-color-red              ((,c (:foreground ,red :background ,red))))
-     `(term-color-green            ((,c (:foreground ,green :background ,green))))
-     `(term-color-yellow           ((,c (:foreground ,yellow :background ,yellow))))
-     `(term-color-blue             ((,c (:foreground ,blue :background ,blue))))
-     `(term-color-magenta          ((,c (:foreground ,magenta :background ,magenta))))
-     `(term-color-cyan             ((,c (:foreground ,cyan :background ,cyan))))
-     `(term-color-white            ((,c (:foreground ,white :background ,white))))
-     ;; `window-divider'
-     `(window-divider              ((,c (:foreground ,vertical-bar))))
-     `(window-divider-first-pixel  ((,c (:foreground ,vertical-bar))))
-     `(window-divider-last-pixel   ((,c (:foreground ,vertical-bar))))
-
-     ;;
-     ;; Plugins
-     ;;
-
-     ;; Avy
-     `(avy-lead-face-0    ((,c (:background ,orange :foreground ,black))))
-     `(avy-lead-face-1    ((,c (:background ,orange :foreground ,black))))
-     `(avy-lead-face-2    ((,c (:background ,orange :foreground ,black))))
-     `(avy-lead-face      ((,c (:background ,orange :foreground ,black))))
-     ;; company-mode
-     `(company-tooltip             ((,c (:background ,black :foreground ,fg))))
-     `(company-tooltip-common      ((,c (:foreground ,orange))))
-     `(company-tooltip-search      ((,c (:foreground ,search-fg :background ,highlight))))
-     `(company-tooltip-selection   ((,c (:background ,selection))))
-     `(company-tooltip-mouse       ((,c (:background ,magenta :foreground ,bg))))
-     `(company-scrollbar-bg        ((,c (:background ,black))))
-     `(company-scrollbar-fg        ((,c (:background ,orange))))
-     `(company-preview             ((,c (:foreground ,orange))))
-     `(company-preview-common      ((,c (:foreground ,magenta :background ,grey-1))))
-     `(company-preview-search      ((,c (:inherit company-tooltip-search))))
-     ;; diff-hl
-     `(diff-hl-change              ((,c (:foreground ,vc-modified))))
-     `(diff-hl-delete              ((,c (:foreground ,vc-deleted))))
-     `(diff-hl-insert              ((,c (:foreground ,vc-added))))
-     ;; evil-mode
-     `(evil-ex-substitute-replacement ((,c (:foreground ,magenta :background ,black :bold ,bold))))
-     `(evil-search-highlight-persist-highlight-face ((,c (:background ,search-rest-bg))))
-     ;; evil-snipe
-     `(evil-snipe-first-match-face ((,c (:foreground ,search-fg :background ,search-bg))))
-     `(evil-snipe-matches-face     ((,c (:foreground ,search-bg :underline t))))
-     ;; flycheck
-     `(flycheck-error              ((,c (:underline (:style wave :color ,red)    :background ,grey-2))))
-     `(flycheck-warning            ((,c (:underline (:style wave :color ,yellow) :background ,grey-2))))
-     `(flycheck-info               ((,c (:underline (:style wave :color ,green)  :background ,grey-2))))
-     `(flyspell-incorrect          ((,c (:underline (:style wave :color ,error-highlight) :inherit unspecified))))
-     ;; jabber
-     `(jabber-activity-face ((,c (:inherit bold :foreground ,red))))
-     `(jabber-activity-personal-face ((,c (:inherit bold :foreground ,blue))))
-     `(jabber-chat-error ((,c (:inherit bold :foreground ,red))))
-     `(jabber-chat-prompt-foreign ((,c (:inherit bold :foreground ,red))))
-     `(jabber-chat-prompt-local ((,c (:inherit bold :foreground ,blue))))
-     `(jabber-chat-prompt-system ((,c (:inherit bold :foreground ,green))))
-     `(jabber-chat-text-foreign ((,c (:foreground ,fg))))
-     `(jabber-chat-text-local ((,c (:foreground ,fg))))
-     `(jabber-rare-time-face ((,c (:foreground ,green))))
-     `(jabber-roster-user-away ((,c (:foreground ,yellow))))
-     `(jabber-roster-user-chatty ((,c (:inherit bold :foreground ,green))))
-     `(jabber-roster-user-dnd ((,c (:foreground ,red))))
-     `(jabber-roster-user-error ((,c (:foreground ,red))))
-     `(jabber-roster-user-offline ((,c (:foreground ,fg))))
-     `(jabber-roster-user-online ((,c (:inherit bold :foreground ,green))))
-     `(jabber-roster-user-xa ((,c (:foreground ,cyan))))
-     ;; git-gutter
-     `(git-gutter:modified         ((,c (:foreground ,vc-modified))))
-     `(git-gutter:added            ((,c (:foreground ,vc-added))))
-     `(git-gutter:deleted          ((,c (:foreground ,vc-deleted))))
-     `(git-gutter-fr:modified      ((,c (:foreground ,vc-modified))))
-     `(git-gutter-fr:added         ((,c (:foreground ,vc-added))))
-     `(git-gutter-fr:deleted       ((,c (:foreground ,vc-deleted))))
-     `(git-gutter+-modified        ((,c (:foreground ,vc-modified :background nil))))
-     `(git-gutter+-added           ((,c (:foreground ,vc-added :background nil))))
-     `(git-gutter+-deleted         ((,c (:foreground ,vc-deleted :background nil))))
-     ;; Helm
-     `(helm-selection              ((,c (:background ,selection))))
-     `(helm-match                  ((,c (:foreground ,magenta))))
-     `(helm-source-header          ((,c (:background ,current-line :foreground ,grey-1))))
-     `(helm-swoop-target-line-face ((,c (:foreground ,highlight :inverse-video t))))
-     `(helm-ff-file              ((,c (:foreground ,grey))))
-     `(helm-ff-prefix            ((,c (:foreground ,magenta))))
-     `(helm-ff-dotted-directory  ((,c (:foreground ,grey-1))))
-     `(helm-ff-directory         ((,c (:foreground ,orange))))
-     `(helm-ff-executable        ((,c (:foreground ,white :slant italic))))
-     ;; hide-show
-     `(hs-face                     ((,c (:foreground ,comments :background ,black))))
-     `(hs-fringe-face              ((,c (:foreground ,orange))))
-     ;; highlight-{quoted,numbers,indentation}-mode
-     `(highlight-indentation-face                 ((,c (:background ,current-line))))
-     `(highlight-indentation-current-column-face  ((,c (:background ,current-line))))
-     `(highlight-quoted-symbol     ((,c (:foreground ,yellow))))
-     `(highlight-quoted-quote      ((,c (:foreground ,magenta))))
-     `(highlight-numbers-number    ((,c (:foreground ,constants))))
-     ;; indent-guide,
-     `(indent-guide-face           ((,c (:foreground "#2F2F38"))))
-     ;; ivy
-     `(ivy-current-match           ((,c (:background ,grey-2))))
-     `(ivy-minibuffer-match-face-1 ((,c (:foreground ,yellow))))
-     `(ivy-minibuffer-match-face-2 ((,c (:background ,black :foreground ,red :bold ,bold))))
-     `(ivy-minibuffer-match-face-3 ((,c (:background ,black :foreground ,red :bold ,bold))))
-     `(ivy-minibuffer-match-face-4 ((,c (:background ,black :foreground ,red :bold ,bold))))
-     `(ivy-virtual                 ((,c (:foreground ,fg))))
-     ;; neotree
-     `(neo-root-dir-face           ((,c (:foreground ,green))))
-     `(neo-file-link-face          ((,c (:foreground ,white))))
-     `(neo-dir-link-face           ((,c (:foreground ,cyan))))
-     `(neo-expand-btn-face         ((,c (:foreground ,magenta))))
-     ;; pop-tip
-     `(popup                       ((,c (:inherit tooltip))))
-     `(popup-tip-face              ((,c (:inherit tooltip))))
-     ;; rainbow-delimiters
-     `(rainbow-delimiters-depth-1-face   ((,c (:foreground ,magenta))))
-     `(rainbow-delimiters-depth-2-face   ((,c (:foreground ,orange))))
-     `(rainbow-delimiters-depth-3-face   ((,c (:foreground ,yellow))))
-     `(rainbow-delimiters-depth-4-face   ((,c (:foreground ,green))))
-     `(rainbow-delimiters-depth-5-face   ((,c (:foreground ,cyan))))
-     `(rainbow-delimiters-unmatched-face ((,c (:foreground ,red :inverse-video t))))
-     ;; re-builder
-     `(reb-match-0                 ((,c (:foreground ,orange   :inverse-video t))))
-     `(reb-match-1                 ((,c (:foreground ,magenta  :inverse-video t))))
-     `(reb-match-2                 ((,c (:foreground ,green    :inverse-video t))))
-     `(reb-match-3                 ((,c (:foreground ,yellow   :inverse-video t))))
-     ;; swiper
-     `(swiper-line-face            ((,c (:background ,blue    :foreground ,black))))
-     `(swiper-match-face-1         ((,c (:background ,black   :foreground ,grey))))
-     `(swiper-match-face-2         ((,c (:background ,orange  :foreground ,black :bold ,bold))))
-     `(swiper-match-face-3         ((,c (:background ,magenta :foreground ,black :bold ,bold))))
-     `(swiper-match-face-4         ((,c (:background ,green   :foreground ,black :bold ,bold))))
-     ;; stripe-buffer
-     `(stripe-highlight            ((,c (:inherit doom-default))))
-     ;; volatile highlights
-     `(vhl/default-face            ((,c (:background ,grey-2))))
-     ;; workgroups2
-     `(wg-current-workgroup-face   ((,c (:foreground ,black   :background ,orange))))
-     `(wg-other-workgroup-face     ((,c (:foreground ,grey-.5 :background ,current-line))))
-
-     ;;
-     ;; Language-specific
-     ;;
-
-     ;; (css|scss)-mode
-     `(css-proprietary-property ((,c (:foreground ,keywords))))
-     ;; js2-mode
-     `(js2-function-param  ((,c (:foreground ,variables))))
-     `(js2-function-call   ((,c (:foreground ,functions))))
-     `(js2-object-property ((,c (:foreground ,methods))))
-     `(js2-jsdoc-tag       ((,c (:foreground ,comments))))
-     ;; web-mode
-     `(web-mode-doctype-face           ((,c (:foreground ,comments))))
-     `(web-mode-html-tag-face          ((,c (:foreground ,methods))))
-     `(web-mode-html-tag-bracket-face  ((,c (:foreground ,methods))))
-     `(web-mode-html-attr-name-face    ((,c (:foreground ,type))))
-     `(web-mode-html-entity-face       ((,c (:foreground ,cyan :italic t))))
-     `(web-mode-block-control-face     ((,c (:foreground ,orange))))
-     ;;`(web-mode-html-tag-bracket-face  ((,c (:foreground ,operators))))
-     ;; markdown-mode
-     `(markdown-header-face           ((,c (:foreground ,orange))))
-     `(markdown-header-delimiter-face ((,c (:foreground ,orange))))
-     `(markdown-blockquote-face       ((,c (:foreground ,blue+2))))
-     `(markdown-markup-face           ((,c (:foreground ,cyan))))
-     `(markdown-inline-face           ((,c (:foreground ,cyan))))
-     `(markdown-list-face             ((,c (:foreground ,magenta))))
-     `(markdown-pre-face              ((,c (:foreground ,cyan))))
-     `(markdown-header-face-1         ((,c (:inherit markdown-header-face))))
-     `(markdown-header-face-2         ((,c (:inherit markdown-header-face))))
-     `(markdown-header-face-3         ((,c (:inherit markdown-header-face))))
-     `(markdown-header-face-4         ((,c (:inherit markdown-header-face))))
-     `(markdown-header-face-5         ((,c (:inherit markdown-header-face))))
-     `(markdown-header-face-6         ((,c (:inherit markdown-header-face))))
-     ;;`(markdown-header-rule-face       (:inherit shadow))
-     ;;`(markdown-italic-face            (:inherit italic))
-     ;;`(markdown-link-face              (:inherit shadow))
-     ;;`(markdown-link-title-face        (:inherit link))
-     ;;`(markdown-url-face               (:inherit link))
-     ;; org-mode
-     `(org-tag                      ((,c (:foreground ,yellow :bold nil))))
-     ;;`(org-ellipsis               ((,c (:inherit hs-face))))
-     `(org-hide                     ((,c (:foreground ,bg))))
-     `(org-table                    ((,c (:foreground ,cyan))))
-     `(org-quote                    ((,c (:slant italic :foreground ,grey :background ,current-line))))
-     `(org-document-info            ((,c (:foreground ,orange))))
-     `(org-document-info-keyword    ((,c (:foreground ,grey-1))))
-     `(org-meta-line                ((,c (:foreground ,vsubtle))))
-     `(org-block-begin-line         ((,c (:background ,current-line :foreground ,vsubtle))))
-     `(org-block-end-line           ((,c (:inherit org-block-begin-line))))
-     `(org-block-background         ((,c (:background ,current-line))))
-     `(org-archived                 ((,c (:foreground ,grey-.5))))
-     `(org-document-title           ((,c (:foreground ,cyan))))
-     `(org-level-1                  ((,c (:background ,current-line :foreground ,magenta   :bold ,bold))))
-     `(org-level-2                  ((,c (                          :foreground ,dark-cyan :bold ,bold))))
-     `(org-level-3                  ((,c (                          :foreground ,violet    :bold ,bold))))
-     `(org-level-4                  ((,c (                          :foreground ,green     :bold ,bold))))
-     `(org-level-5                  ((,c (                          :foreground ,yellow))))
-     `(org-level-6                  ((,c (                          :foreground ,blue+2))))
-     `(org-code                     ((,c (:foreground ,orange))))
-     `(org-verbatim                 ((,c (:foreground ,green))))
-     `(org-formula                  ((,c (:foreground ,cyan))))
-     `(org-list-dt                  ((,c (:foreground ,cyan))))
-     `(org-footnote                 ((,c (:foreground ,orange))))
-     `(org-link                     ((,c (:underline t :foreground ,cyan :bold inherit))))
-     `(org-date                     ((,c (:foreground ,violet))))
-     `(org-todo                     ((,c (:foreground ,yellow :bold inherit))))
-     `(org-done                     ((,c (:foreground ,green :bold inherit))))
-     `(org-headline-done            ((,c (:foreground ,grey-.5 :strike-through t :bold nil))))
-     `(org-special-keyword          ((,c (:foreground ,magenta))))
-     `(org-checkbox-statistics-todo ((,c (:inherit org-todo))))
-     `(org-checkbox-statistics-done ((,c (:inherit org-done))))
-     ;;; rpm-spec-mode
-     `(rpm-spec-macro-face        ((,c (:foreground ,yellow))))
-     `(rpm-spec-var-face          ((,c (:foreground ,violet))))
-     `(rpm-spec-tag-face          ((,c (:foreground ,blue))))
-     `(rpm-spec-obsolete-tag-face ((,c (:foreground ,red))))
-     `(rpm-spec-package-face      ((,c (:foreground ,orange))))
-     `(rpm-spec-dir-face          ((,c (:foreground ,green))))
-     `(rpm-spec-doc-face          ((,c (:foreground ,orange))))
-     `(rpm-spec-ghost-face        ((,c (:foreground ,(doom-lighten grey-1 0.2)))))
-     `(rpm-spec-section-face      ((,c (:foreground ,magenta))))
-     )
-
-    (custom-theme-set-variables
-     'doom-molokai
-     `(vc-annotate-color-map
-       '((20 .  ,green)
-         (40 .  ,(doom-blend yellow green (/ 1.0 3)))
-         (60 .  ,(doom-blend yellow green (/ 2.0 3)))
-         (80 .  ,yellow)
-         (100 . ,(doom-blend orange yellow (/ 1.0 3)))
-         (120 . ,(doom-blend orange yellow (/ 2.0 3)))
-         (140 . ,orange)
-         (160 . ,(doom-blend magenta orange (/ 1.0 3)))
-         (180 . ,(doom-blend magenta orange (/ 2.0 3)))
-         (200 . ,magenta)
-         (220 . ,(doom-blend red magenta (/ 1.0 3)))
-         (240 . ,(doom-blend red magenta (/ 2.0 3)))
-         (260 . ,red)
-         (280 . ,(doom-blend grey red (/ 1.0 4)))
-         (300 . ,(doom-blend grey red (/ 2.0 4)))
-         (320 . ,(doom-blend grey red (/ 3.0 4)))
-         (340 . ,grey)
-         (360 . ,grey)))
-     `(vc-annotate-very-old-color nil)
-     `(vc-annotate-background ,black))))
-
-(provide-theme 'doom-molokai)
-
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/doom-themes-1.2.5/doom-neotree.el
@@ -1,312 +0,0 @@
-;;; doom-neotree.el
-
-(unless doom--inhibit-warning
-  (message "doom-themes: loading `doom-neotree' directly is obsolete, call `doom-themes-nlinum-config' instead"))
-
-(defgroup doom-neotree nil
-  "Options for doom's neotree theme"
-  :group 'doom-themes)
-
-;;
-(defface doom-neotree-dir-face  '((t (:inherit neo-dir-link-face)))
-  "Face for directory labels."
-  :group 'doom-neotree)
-
-(defface doom-neotree-file-face '((t (:inherit neo-file-link-face)))
-  "Face for file name labels."
-  :group 'doom-neotree)
-
-;; file type faces
-(defface doom-neotree-hidden-file-face '((t (:inherit font-lock-comment-face)))
-  "Face for labels of hidden files. See `doom-neotree-file-face-re-alist'."
-  :group 'doom-neotree)
-
-(defface doom-neotree-text-file-face '((t (:inherit neo-file-link-face)))
-  "Face for labels of text/documentation files (readmes, org files, etc). See
-`doom-neotree-file-face-re-alist'."
-  :group 'doom-neotree)
-
-(defface doom-neotree-media-file-face '((t (:inherit neo-file-link-face)))
-  "Face for labels of media files. See `doom-neotree-file-face-re-alist'."
-  :group 'doom-neotree)
-
-(defface doom-neotree-data-file-face '((t (:inherit neo-file-link-face)))
-  "Face for labels of data files (json, yaml, xml, etc). See
-`doom-neotree-file-face-re-alist'."
-  :group 'doom-neotree)
-
-
-;;
-(defcustom doom-neotree-project-size 1.4
-  "What :height to display the project icon at the top at."
-  :type 'float
-  :group 'doom-neotree)
-
-(defcustom doom-neotree-folder-size 1.05
-  "What :height to display the folder icons at."
-  :type 'float
-  :group 'doom-neotree)
-
-(defcustom doom-neotree-chevron-size 0.8
-  "What :height to display the chevron icons at."
-  :type 'float
-  :group 'doom-neotree)
-
-(defcustom doom-neotree-line-spacing 2
-  "Line-spacing for neotree buffer."
-  :type 'symbol
-  :group 'doom-neotree)
-
-(define-obsolete-variable-alias 'doom-neotree-enable-file-icons 'doom-neotree-file-icons)
-(defcustom doom-neotree-file-icons 'simple
-  "The style to use for the file icons. Can be nil (disabled), non-nil (for a
-diverse iconset), or 'simple, which is closest's to Atom's style as it only
-distinguishes text, source, pdfs, images and binary files."
-  :type '(choice
-          (const :tag "A diverse array of file icons based on file type" t)
-          (const :tag "Minimalistic file icons (like Atom's)" 'simple)
-          (const :tag "Disable file icons" nil))
-  :group 'doom-neotree)
-
-(defcustom doom-neotree-enable-folder-icons t
-  "If non-nil, display folder icons next to each file. Different icons are used
-depending on whether the folder is a repo, symlink or regular folder."
-  :type 'boolean
-  :group 'doom-neotree)
-
-(defcustom doom-neotree-enable-open-chevron-icons t
-  "If non-nil, display the chevron-down icon next to each expanded folder."
-  :type 'boolean
-  :group 'doom-neotree)
-
-(defcustom doom-neotree-enable-closed-chevron-icons t
-  "If non-nil, display the chevron-right icon next to each collapsed folder."
-  :type 'boolean
-  :group 'doom-neotree)
-
-(defcustom doom-neotree-enable-variable-pitch nil
-  "If non-nil, labels will use the `doom-neotree-dir-face' and
-`doom-neotree-dir-face' faces, which inherit from the `variable-pitch' face."
-  :type 'boolean
-  :group 'doom-neotree)
-
-(defcustom doom-neotree-enable-type-colors t
-  "If non-nil, color each file/folder based on the categories determined by
-`doom-neotree-file-face-re-alist'."
-  :type 'boolean
-  :group 'doom-neotree)
-
-(defcustom doom-neotree-file-face-re-alist
-  '(("\\(/\\.[^$/]+\\|\\.\\(lock\\|resolved\\|o\\|pyc\\|elc\\)$\\|/\\(node_modules\\|vendor\\)[/$]\\)"
-     . doom-neotree-hidden-file-face)
-    ("\\(\\.\\(md\\|org\\|rst\\|log\\)\\|/[A-Z_-]+\\(\\.[a-z]+\\)?\\)$"
-     . doom-neotree-text-file-face)
-    ("\\.\\(png\\|jpe?g\\|gif\\|tiff\\|svg\\|bmp\\|mov\\|avi\\|mp[34]\\|webm\\|zip\\|tar\\(\\.gz\\)?\\|7z\\|rar\\)$"
-     . doom-neotree-media-file-face)
-    ("\\.\\([jc]son\\|\\(ya?\\|x\\|to\\)ml\\|xml\\)"
-     . doom-neotree-data-file-face))
-  "Regexps used to determine what category each file/folder belongs to, and what
-face to assign them."
-  :type '(repeat (cons (regexp :tag "Pattern")
-                       (symbol :tag "Face")))
-  :group 'doom-neotree)
-
-(defvar doom--neotree-file-re
-  `((code    . ,(concat "\\.\\(p?html?\\|xml\\|ya?ml\\|json\\|tpl\\|conf\\|erb\\|mustache\\|twig\\|ejs\\|haml\\|pug\\|jade\\)$"))
-    (media   . ,(concat "\\.\\("
-                        "png\\|jpe?g\\|gif\\|tiff\\|svg\\|bmp" ; images
-                        "\\|mov\\|avi\\|mp[34]\\|webm"         ; media
-                        "\\)$"
-                        ))
-    (archive . "\\.\\(zip\\|rar\\|7z\\|tar\\(\\.gz\\)?\\)$"))
-  "An alist mapping file type to regular expressions, used to determine what
-type of icon to display for the file if `doom-neotree-file-icons' is set to
-`simple'.")
-
-
-;;
-(defun doom--neotree-no-fringes ()
-  "Remove fringes in neotree. They get reset each time you select the neotree
-pane and are highlighted incorrectly."
-  (set-window-fringes neo-global--window 1 0))
-
-(defun doom--neotree-setup (&rest _)
-  (setq line-spacing doom-neotree-line-spacing
-        tab-width 1)
-  (when (featurep 'hl-line)
-    (set (make-local-variable 'hl-line-sticky-flag) t)
-    (hl-line-mode +1)))
-
-(defun doom--neotree-folder-icon-for (dir chevron &optional faces)
-  (let* ((path (expand-file-name dir))
-         (chevron
-          (if chevron
-              (all-the-icons-octicon
-               (format "chevron-%s" chevron)
-               :v-adjust 0.1
-               :face `(:inherit (,@faces)
-                       :family ,(all-the-icons-octicon-family)
-                       :height ,doom-neotree-chevron-size))
-            spc))
-         (icon
-          (when doom-neotree-enable-folder-icons
-            (all-the-icons-octicon
-             (cond ((file-symlink-p path) "file-symlink-directory")
-                   ((file-exists-p (format "%s/.git" path)) "file-submodule")
-                   ((all-the-icons-dir-is-submodule path) "file-submodule")
-                   (t "file-directory"))
-             :v-adjust 0
-             :face `(:inherit (,@faces)
-                     :family ,(all-the-icons-octicon-family)
-                     :height ,doom-neotree-folder-size)))))
-    (concat chevron "\t" icon)))
-
-(defun doom--neotree-file-icon-for (file-name &optional faces)
-  (cond ((eq doom-neotree-file-icons 'simple)
-         (if file-name
-             (propertize
-               (cond ((string-match-p (cdr (assq 'code doom--neotree-file-re)) file-name)
-                      (all-the-icons-octicon "file-code"))
-                     ((string-match-p (cdr (assq 'media doom--neotree-file-re)) file-name)
-                      (all-the-icons-octicon "file-media"))
-                     ((string-match-p (cdr (assq 'archive doom--neotree-file-re)) file-name)
-                      (all-the-icons-octicon "file-zip"))
-                     ((string= (or (file-name-extension file-name) "") "pdf")
-                      (all-the-icons-octicon "file-pdf"))
-                     ((file-symlink-p file-name)
-                      (all-the-icons-octicon "file-symlink-file"))
-                     ((file-executable-p file-name)
-                      (all-the-icons-octicon "file-binary"))
-                     (t
-                      (all-the-icons-octicon "file-text")))
-               'face `(:inherit (,@faces)
-                       :family ,(all-the-icons-octicon-family)
-                       :height 1.3)
-               'display '(raise 0))
-           (all-the-icons-fileicon "default")))
-        (t (all-the-icons-icon-for-file file-name))))
-
-(defun doom--neo-insert-fold-symbol (type file-name &optional faces)
-  "Custom hybrid unicode theme with leading whitespace."
-  (let ((spc "\t")
-        (vspc (propertize "  " 'face 'variable-pitch)))
-    (or (and (eq type 'open)
-             (insert
-              (concat spc
-                      (doom--neotree-folder-icon-for
-                       file-name
-                       (if doom-neotree-enable-open-chevron-icons "down")
-                       faces)
-                      vspc)))
-        (and (eq type 'close)
-             (insert
-              (concat spc
-                      (doom--neotree-folder-icon-for
-                       file-name
-                       (if doom-neotree-enable-closed-chevron-icons "right")
-                       faces)
-                      vspc)))
-        (and (eq type 'leaf)
-             (insert
-              (concat (when (or doom-neotree-enable-open-chevron-icons
-                                doom-neotree-enable-closed-chevron-icons)
-                        spc)
-                      (when doom-neotree-enable-folder-icons spc)
-                      (when doom-neotree-file-icons
-                        (concat spc (doom--neotree-file-icon-for file-name faces)))
-                      vspc))))))
-
-(defun doom--neo-get-file-face (name)
-  (when doom-neotree-enable-type-colors
-    (let ((name (concat "/" (file-relative-name name neo-buffer--start-node)))
-          case-fold-search)
-      (cdr-safe
-       (cl-find-if (lambda (re) (string-match-p (car re) name))
-                   doom-neotree-file-face-re-alist)))))
-
-(defun doom--neo-buffer--insert-root-entry (node)
-  "Pretty-print pwd in neotree"
-  (let ((project-name (file-name-nondirectory (substring node 0 (1- (length node)))))
-        (faces '(neo-root-dir-face)))
-    (when doom-neotree-enable-variable-pitch
-      (push 'variable-pitch faces))
-    (if (display-graphic-p)
-        (insert
-         (concat (propertize " " 'face `(:inherit (,@faces)))
-                 (all-the-icons-octicon "repo"
-                                        :height doom-neotree-project-size
-                                        :face 'neo-root-dir-face
-                                        :v-adjust -0.1)
-                 (propertize " " 'face 'neo-root-dir-face))))
-    (insert (propertize (concat project-name "\n") 'face `(:inherit (,@faces))))))
-
-(defun doom--neo-buffer--insert-dir-entry (node depth expanded)
-  (let ((node-short-name (neo-path--file-short-name node))
-        (faces '(doom-neotree-dir-face))
-        (add-face (doom--neo-get-file-face node)))
-    (insert-char ?\s (* (- depth 1) 2)) ; indent
-    ;; (when (memq 'char neo-vc-integration)
-    ;;   (insert-char ?\s 2))
-    (when add-face (setq faces (list add-face)))
-    ;; (when (memq 'face neo-vc-integration)
-    ;;   (push (cdr vc) faces))
-    (if (display-graphic-p)
-        (doom--neo-insert-fold-symbol (if expanded 'open 'close) node faces)
-      (neo-buffer--insert-fold-symbol (if expanded 'open 'close) node))
-    (when doom-neotree-enable-variable-pitch
-      (push 'variable-pitch faces))
-    ;;
-    (insert-button node-short-name
-                   'follow-link t
-                   'face `(:inherit (,@faces))
-                   'neo-full-path node
-                   'keymap neotree-dir-button-keymap)
-    (neo-buffer--node-list-set nil node)
-    (neo-buffer--newline-and-begin)))
-
-(defun doom--neo-buffer--insert-file-entry (node depth)
-  (let ((node-short-name (neo-path--file-short-name node))
-        ;; (vc (when neo-vc-integration (neo-vc-for-node node)))
-        (faces '(doom-neotree-file-face))
-        (add-face (doom--neo-get-file-face node)))
-    (insert-char ?\s (* (- depth 1) 2)) ; indent
-    ;; (when (memq 'char neo-vc-integration)
-    ;;   (insert-char (car vc))
-    ;;   (insert-char ?\s))
-    (when add-face (setq faces (list add-face)))
-    ;; (when (memq 'face neo-vc-integration)
-    ;;   (push (cdr vc) faces))
-    (if (display-graphic-p)
-        (doom--neo-insert-fold-symbol 'leaf node faces)
-      (neo-buffer--insert-fold-symbol 'leaf node))
-    (when doom-neotree-enable-variable-pitch
-      (push 'variable-pitch faces))
-    ;;
-    (insert-button node-short-name
-                   'follow-link t
-                   'face `(:inherit (,@faces))
-                   'neo-full-path node
-                   'keymap neotree-file-button-keymap)
-    (neo-buffer--node-list-set nil node)
-    (neo-buffer--newline-and-begin)))
-
-
-;;
-(eval-after-load "neotree"
-  (lambda ()
-    (require 'all-the-icons)
-
-    ;; Enable buffer-local hl-line and adjust line-spacing
-    (add-hook 'neo-after-create-hook 'doom--neotree-setup)
-    ;; Incompatible
-    (setq neo-vc-integration nil)
-    ;; Remove fringes in Neotree pane
-    (advice-add 'neo-global--select-window :after 'doom--neotree-no-fringes)
-    ;; Patch neotree to use `doom--neo-insert-fold-symbol'
-    (advice-add 'neo-buffer--insert-file-entry :override 'doom--neo-buffer--insert-file-entry)
-    (advice-add 'neo-buffer--insert-dir-entry  :override 'doom--neo-buffer--insert-dir-entry)
-    ;; Shorter pwd in neotree
-    (advice-add 'neo-buffer--insert-root-entry :override 'doom--neo-buffer--insert-root-entry)))
-
-(provide 'doom-neotree)
-;;; doom-neotree.el ends here
.emacs.d/elpa/doom-themes-1.2.5/doom-neotree.elc
Binary file
.emacs.d/elpa/doom-themes-1.2.5/doom-nlinum.el
@@ -1,56 +0,0 @@
-;;; doom-nlinum.el
-
-(unless doom--inhibit-warning
-  (message "doom-themes: loading doom-nlinum directly is obsolete, call `doom-themes-nlinum-config' instead"))
-
-(defvar doom--nlinum-hl-overlay nil)
-(defvar doom--nlinum-hl-line 0)
-
-(defun doom-nlinum-hl-hook ()
-  (if nlinum-mode
-      (add-hook 'post-command-hook 'doom-nlinum-hl-line nil t)
-    (remove-hook 'post-command-hook 'doom-nlinum-hl-line t)))
-
-(defun doom-nlinum-hl-line (&rest _)
-  "Highlight current line number."
-  (while-no-input
-    (let* ((pbol (line-beginning-position))
-           (peol (1+ pbol))
-           (max (point-max))
-           (lineno (string-to-number (format-mode-line "%l"))))
-      (unless (= doom--nlinum-hl-line lineno)
-        (setq doom--nlinum-hl-line lineno)
-        ;; Handle EOF case
-        (when (>= peol max)
-          (setq peol max))
-        (jit-lock-fontify-now pbol peol)
-        ;; Unhighlight previous highlight
-        (when doom--nlinum-hl-overlay
-          (let* ((disp (get-text-property 0 'display (overlay-get doom--nlinum-hl-overlay 'before-string)))
-                 (str (nth 1 disp)))
-            (put-text-property 0 (length str) 'face 'linum str)
-            (setq doom--nlinum-hl-overlay nil)
-            disp))
-        (let ((ov (cl-find-if (lambda (ov) (overlay-get ov 'nlinum))
-                              (overlays-in pbol peol))))
-          (when ov
-            (let ((str (nth 1 (get-text-property 0 'display (overlay-get ov 'before-string)))))
-              (put-text-property 0 (length str) 'face 'doom-nlinum-highlight str)
-              (setq doom--nlinum-hl-overlay ov))))))))
-
-(defun doom-nlinum-unhl-first-line ()
-  "Removes the hanging overlay hl-line sometimes leaves on the first line."
-  (ignore-errors
-    (dolist (overlay (overlays-at (point-min)))
-      (when (eq (overlay-get overlay 'face) 'hl-line)
-        (delete-overlay overlay)))))
-
-(eval-after-load "nlinum"
-  (lambda ()
-    (add-hook 'nlinum-mode-hook 'doom-nlinum-hl-hook)
-    (add-hook 'nlinum-mode-hook 'doom-nlinum-unhl-first-line)
-    (unless (bound-and-true-p global-hl-line-mode)
-      (add-hook 'nlinum-mode-hook 'hl-line-mode))))
-
-(provide 'doom-nlinum)
-;;; doom-nlinum.el ends here
.emacs.d/elpa/doom-themes-1.2.5/doom-nlinum.elc
Binary file
.emacs.d/elpa/doom-themes-1.2.5/doom-one-light-theme.el
@@ -1,14 +0,0 @@
-;; DOOM One Light (inspired by Atom One Light)
-
-(require 'doom-themes)
-
-;; (doom-init 'doom-one-light)
-
-;; TODO
-;; Nothing here yet!
-
-(provide-theme 'doom-one-light)
-
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/doom-themes-1.2.5/doom-one-theme.el
@@ -1,108 +0,0 @@
-;; DOOM One Dark (inspired by Atom One Dark)
-(require 'doom-themes)
-
-;;
-(defgroup doom-one-theme nil
-  "Options for doom-themes"
-  :group 'doom-themes)
-
-(defcustom doom-one-brighter-modeline nil
-  "If non-nil, more vivid colors will be used to style the mode-line."
-  :group 'doom-one-theme
-  :type 'boolean)
-
-(defcustom doom-one-brighter-comments nil
-  "If non-nil, comments will be highlighted in more vivid colors."
-  :group 'doom-one-theme
-  :type 'boolean)
-
-(defcustom doom-one-linum-height 1.0
-  "The :height to render line numbers with."
-  :group 'doom-one-theme
-  :type 'boolean)
-
-;;
-(def-doom-theme doom-one
-  "A dark theme inspired by Atom One Dark"
-
-  ;; name      gui       term (256)
-  ((bg         "#282c34" nil      )
-   (bg-alt     "#21242b" nil      )
-   (fg         "#bbc2cf" "#bfbfbf")
-   (fg-alt     "#5B6268" "#3d3d3d")
-   (black      "#1B2229" "black"  )
-   (light-grey fg-alt    "#525252")
-   (grey       "#3B3F46" fg-alt   )
-   (dark-grey  "#23272e" "#262626")
-   (white      "#DFDFDF" "#dfdfdf")
-   (red        "#ff6c6b" "#ff6655")
-   (orange     "#da8548" "#dd8844")
-   (green      "#98be65" "#99bb66")
-   (teal       "#4db5bd" "#44b9b1")
-   (yellow     "#ECBE7B"          )
-   (blue       "#51afef"          )
-   (dark-blue  "#1f5572"          )
-   (magenta    "#c678dd"          )
-   (violet     "#a9a1e1"          )
-   (cyan       "#46D9FF"          )
-   (dark-cyan  "#5699AF"          )
-
-   ;; face categories
-   (highlight      blue)
-   (vertical-bar   black)
-   (current-line   dark-grey "black")
-   (selection      dark-blue)
-   (builtin        magenta)
-   (comments       (if doom-one-brighter-comments dark-cyan light-grey))
-   (doc-comments   (if doom-one-brighter-comments (doom-lighten dark-cyan 0.1) (doom-lighten light-grey 0.2)))
-   (constants      violet)
-   (functions      magenta)
-   (keywords       blue)
-   (methods        cyan)
-   (operators      blue)
-   (type           yellow)
-   (strings        green)
-   (variables      white)
-   (numbers        orange)
-   (region         (doom-lighten bg 0.075))
-   (error          red)
-   (warning        yellow)
-   (success        green)
-   (vc-modified    yellow)
-   (vc-added       green)
-   (vc-deleted     red)
-
-   ;; custom categories
-   (modeline-bg     (if doom-one-brighter-modeline bg bg-alt)        "brightblack")
-   (modeline-bg-alt (if doom-one-brighter-modeline bg-alt dark-grey) "black")
-   (modeline-fg     nil)
-   (modeline-fg-alt light-grey grey))
-
-
-  ;; --- extra faces ------------------------
-  ((elscreen-tab-other-screen-face :background "#353a42" :foreground "#1e2022")
-
-   (linum :foreground (if gui (doom-lighten grey 0.1) light-grey)
-          :background bg-alt
-          :bold nil
-          :height doom-one-linum-height)
-   (doom-nlinum-highlight :foreground (doom-darken white 0.25)
-                          :distant-foreground nil
-                          :bold nil
-                          :height doom-one-linum-height)
-
-   (mode-line          :background modeline-bg     :foreground modeline-fg)
-   (mode-line-inactive :background modeline-bg-alt :foreground modeline-fg-alt)
-
-   ;; --- major-mode faces -------------------
-   ;; css-mode / scss-mode
-   (css-proprietary-property :foreground orange)
-   (css-property             :foreground green)
-   (css-selector             :foreground blue))
-
-
-  ;; --- extra variables --------------------
-  ;; ()
-  )
-
-;;; doom-one-theme.el ends here
.emacs.d/elpa/doom-themes-1.2.5/doom-one-theme.elc
Binary file
.emacs.d/elpa/doom-themes-1.2.5/doom-themes-autoloads.el
@@ -1,58 +0,0 @@
-;;; doom-themes-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "doom-themes" "doom-themes.el" (22964 3868
-;;;;;;  350661 333000))
-;;; Generated autoloads from doom-themes.el
-
-(autoload 'doom-color "doom-themes" "\
-Retrieve a specific color named NAME (a symbol) from the current DOOM theme.
-
-\(fn NAME)" nil nil)
-
-(autoload 'doom-brighten-minibuffer "doom-themes" "\
-Highlight the minibuffer whenever it is in use.
-
-\(fn)" nil nil)
-
-(autoload 'doom-buffer-mode "doom-themes" "\
-Brighten source buffers by remapping common faces (like default, hl-line and
-linum) to their doom-theme variants.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'doom-themes-neotree-config "doom-themes" "\
-Install DOOM neotree configuration.
-
-\(fn)" nil nil)
-
-(autoload 'doom-themes-nlinum-config "doom-themes" "\
-Install DOOM nlinum configuration.
-
-\(fn)" nil nil)
-
-(autoload 'doom-buffer-mode-maybe "doom-themes" "\
-Enable `doom-buffer-mode' in the current buffer, if it isn't already and the
-buffer represents a real file.
-
-\(fn)" nil nil)
-
-(when (and (boundp 'custom-theme-load-path) load-file-name) (add-to-list 'custom-theme-load-path (file-name-as-directory (file-name-directory load-file-name))))
-
-;;;***
-
-;;;### (autoloads nil nil ("doom-molokai-theme.el" "doom-neotree.el"
-;;;;;;  "doom-nlinum.el" "doom-one-light-theme.el" "doom-one-theme.el"
-;;;;;;  "doom-themes-common.el" "doom-themes-pkg.el") (22964 3868
-;;;;;;  359661 337000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; doom-themes-autoloads.el ends here
.emacs.d/elpa/doom-themes-1.2.5/doom-themes-common.el
@@ -1,625 +0,0 @@
-;;; doom-themes-common.el
-
-(defun doom-common-faces (&optional extra-faces)
-  (mapcar
-   (lambda (spec)
-     (let ((spec (or (assq (car spec) extra-faces) spec)))
-       `(list ',(car spec)
-              ,(if (listp (cadr spec))
-                   (cadr spec)
-                 `(list (list '((class color) (min-colors 89)) (list ,@(cdr spec))))))))
-   '(;; --- custom faces -----------------------
-     (doom-default           :inherit 'default :background bg)
-     (doom-minibuffer-active :background bg)
-     ;; mode-line
-     (doom-modeline-buffer-path
-      `((((background dark))  (:foreground ,(if bold white cyan) :bold ,bold))
-        (((background light)) (:foreground ,(if bold black blue) :bold ,bold))))
-     (doom-modeline-buffer-project    :foreground fg)
-     (doom-modeline-buffer-modified   :foreground error)
-     (doom-modeline-buffer-major-mode :inherit 'doom-modeline-buffer-path)
-     (doom-modeline-highlight         :foreground highlight)
-     (doom-modeline-panel             :foreground black :distant-foreground white :background highlight)
-     (doom-modeline-bar               :background highlight)
-     (doom-modeline-eldoc-bar         :background yellow)
-
-     ;; --- base faces -------------------------
-     (bold        :weight (if bold 'bold 'normal) :color white)
-     (italic      :slant  (if italic 'italic 'normal))
-     (bold-italic :inherit '(bold italic))
-
-     (default              :background bg-alt     :foreground fg)
-     (fringe               :inherit 'default      :foreground comments)
-     (region               :background region     :foreground nil :distant-foreground nil)
-     (highlight            :background highlight  :foreground black)
-     (cursor               :background highlight)
-     (shadow               :foreground light-grey)
-     (minibuffer-prompt    :foreground highlight)
-     (tooltip              :inherit 'doom-default :background bg-alt)
-     (secondary-selection  :background highlight  :foreground fg :distant-foreground bg)
-     (lazy-highlight       :background dark-blue  :foreground white)
-     (match                :foreground green      :background black :bold bold)
-     (trailing-whitespace  :background red)
-     (vertical-border
-      `((((background dark))  (:background ,black      :foreground ,black))
-        (((background light)) (:background ,light-grey :foreground ,light-grey))))
-
-     (error   :foreground error)
-     (warning :foreground warning)
-     (success :foreground success)
-
-     (font-lock-builtin-face                :foreground builtin)
-     (font-lock-comment-face                :foreground comments)
-     (font-lock-comment-delimiter-face      :foreground comments)
-     (font-lock-doc-face                    :foreground doc-comments)
-     (font-lock-doc-string-face             :foreground doc-comments)
-     (font-lock-constant-face               :foreground constants)
-     (font-lock-function-name-face          :foreground functions)
-     (font-lock-keyword-face                :foreground keywords)
-     (font-lock-string-face                 :foreground strings)
-     (font-lock-type-face                   :foreground type)
-     (font-lock-variable-name-face          :foreground variables)
-     (font-lock-warning-face                :inherit 'warning)
-     (font-lock-negation-char-face          :inherit 'bold :foreground operators)
-     (font-lock-preprocessor-face           :inherit 'bold :foreground operators)
-     (font-lock-preprocessor-char-face      :inherit 'bold :foreground operators)
-     (font-lock-regexp-grouping-backslash   :inherit 'bold :foreground operators)
-     (font-lock-regexp-grouping-construct   :inherit 'bold :foreground operators)
-
-     (mode-line          :background bg-alt :foreground fg)
-     (mode-line-inactive :background bg     :foreground fg-alt)
-     (header-line :inherit 'mode-line)
-
-
-     ;; --- built-in plugin faces --------------
-     ;; dired
-     (dired-directory :foreground builtin)
-     (dired-ignored   :foreground comments)
-
-     ;; ediff
-     (ediff-fine-diff-A    :background dark-grey :inherit 'bold)
-     (ediff-fine-diff-B    :background dark-grey :inherit 'bold)
-     (ediff-fine-diff-C    :background dark-grey :inherit 'bold)
-     (ediff-current-diff-A :background black)
-     (ediff-current-diff-B :background black)
-     (ediff-current-diff-C :background black)
-     (ediff-even-diff-A    :inherit 'hl-line)
-     (ediff-even-diff-B    :inherit 'hl-line)
-     (ediff-even-diff-C    :inherit 'hl-line)
-     (ediff-odd-diff-A     :inherit 'hl-line)
-     (ediff-odd-diff-B     :inherit 'hl-line)
-     (ediff-odd-diff-C     :inherit 'hl-line)
-
-     ;; isearch
-     (isearch :background highlight :foreground black :bold bold)
-     (isearch-lazy-highlight-face :background dark-grey)
-
-     ;; hl-line
-     (hl-line `((((background dark))  (:background ,black))
-                (((background light)) (:background ,bg-alt))))
-     (doom-hl-line :background current-line)
-
-     ;; linum
-     (linum :foreground fg-alt :background bg-alt :bold nil :distant-foreground nil)
-     (doom-linum :inherit 'linum :background bg)
-
-     ;; term
-     (term-color-black   :background black   :foreground black)
-     (term-color-red     :background red     :foreground red)
-     (term-color-green   :background green   :foreground green)
-     (term-color-yellow  :background yellow  :foreground yellow)
-     (term-color-blue    :background blue    :foreground blue)
-     (term-color-magenta :background magenta :foreground magenta)
-     (term-color-cyan    :background cyan    :foreground cyan)
-     (term-color-white   :background white   :foreground white)
-
-     ;; window-divider
-     (window-divider :foreground vertical-bar)
-     (window-divider-first-pixel  :inherit 'window-divider)
-     (window-divider-last-pixel   :inherit 'window-divider)
-
-
-     ;; --- plugin faces -----------------------
-     ;; avy
-     (avy-lead-face
-      `((((background dark))  (:background ,highlight :foreground ,black :distant-foreground ,white))
-        (((background light)) (:background ,highlight :foreground ,white :distant-foreground ,black))))
-     (avy-lead-face-0 :inherit 'avy-lead-face)
-     (avy-lead-face-1 :inherit 'avy-lead-face)
-     (avy-lead-face-2 :inherit 'avy-lead-face)
-
-     ;; company
-     (company-tooltip            :inherit 'tooltip)
-     (company-tooltip-common                           :foreground highlight)
-     (company-tooltip-search     :background highlight :foreground bg :distant-foreground fg)
-     (company-tooltip-selection  :background selection)
-     (company-tooltip-mouse      :background magenta   :foreground bg :distant-foreground fg)
-     (company-tooltip-annotation                       :foreground violet)
-     (company-scrollbar-bg       :inherit 'tooltip)
-     (company-scrollbar-fg       :background highlight)
-     (company-preview                                  :foreground highlight)
-     (company-preview-common     :background dark-grey :foreground magenta)
-     (company-preview-search     :inherit 'company-tooltip-search)
-
-     ;; diff-hl
-     (diff-hl-change :foreground vc-modified)
-     (diff-hl-delete :foreground vc-deleted)
-     (diff-hl-insert :foreground vc-added)
-
-     ;; dired+
-     (diredp-file-name              :foreground white)
-     (diredp-dir-name               :foreground white :inherit 'bold)
-     (diredp-ignored-file-name      :foreground light-grey)
-     (diredp-compressed-file-suffix :foreground light-grey)
-     (diredp-symlink                :foreground violet)
-     (diredp-dir-heading            :foreground blue  :inherit 'bold)
-     (diredp-file-suffix            :foreground violet)
-     (diredp-read-priv              :foreground magenta)
-     (diredp-write-priv             :foreground green)
-     (diredp-exec-priv              :foreground yellow)
-     (diredp-rare-priv              :foreground red   :inherit 'bold)
-     (diredp-dir-priv               :foreground blue  :inherit 'bold)
-     (diredp-no-priv                :foreground light-grey)
-     (diredp-number                 :foreground magenta)
-     (diredp-date-time              :foreground blue)
-
-     ;; dired-k
-     (dired-k-directory :foreground blue)
-
-     ;; elscreen
-     (elscreen-tab-background-face     :background bg-alt)
-     (elscreen-tab-control-face        :background bg-alt :foreground bg-alt)
-     (elscreen-tab-current-screen-face :background bg     :foreground fg)
-     (elscreen-tab-other-screen-face   :background bg-alt :foreground fg-alt)
-
-     ;; evil
-     (evil-ex-substitute-matches     :background black :foreground red   :strike-through t :bold bold)
-     (evil-ex-substitute-replacement :background black :foreground green :bold bold)
-     (evil-search-highlight-persist-highlight-face :inherit 'isearch-lazy-highlight-face)
-
-     ;; evil-mc
-     (evil-mc-cursor-default-face :background magenta :foreground black :inverse-video nil)
-     (evil-mc-region-face :inherit 'region)
-     (evil-mc-cursor-bar-face :height 1 :background magenta :foreground black)
-     (evil-mc-cursor-hbar-face :underline `(:color ,highlight))
-
-     ;; evil-snipe
-     (evil-snipe-first-match-face :foreground highlight :background dark-blue)
-     (evil-snipe-matches-face     :foreground highlight :underline t :bold bold)
-
-     ;; flycheck
-     (flycheck-error     :underline `(:style wave :color ,red))
-     (flycheck-warning   :underline `(:style wave :color ,yellow))
-     (flycheck-info      :underline `(:style wave :color ,green))
-     (flyspell-incorrect :underline `(:style wave :color ,error) :inherit 'unspecified)
-
-     ;; git-gutter
-     (git-gutter:modified :foreground vc-modified)
-     (git-gutter:added    :foreground vc-added)
-     (git-gutter:deleted  :foreground vc-deleted)
-
-     ;; git-gutter+
-     (git-gutter+-modified :foreground vc-modified :background nil)
-     (git-gutter+-added    :foreground vc-added :background nil)
-     (git-gutter+-deleted  :foreground vc-deleted :background nil)
-
-     ;; git-gutter-fringe
-     (git-gutter-fr:modified :foreground vc-modified)
-     (git-gutter-fr:added    :foreground vc-added)
-     (git-gutter-fr:deleted  :foreground vc-deleted)
-
-     ;; gnus
-     (gnus-group-mail-1           :bold bold :foreground fg)
-     (gnus-group-mail-2           :inherit 'gnus-group-mail-1)
-     (gnus-group-mail-3           :inherit 'gnus-group-mail-1)
-     (gnus-group-mail-1-empty     :foreground light-grey)
-     (gnus-group-mail-2-empty     :inherit 'gnus-group-mail-1-empty)
-     (gnus-group-mail-3-empty     :inherit 'gnus-group-mail-1-empty)
-     (gnus-group-news-1           :inherit 'gnus-group-mail-1)
-     (gnus-group-news-2           :inherit 'gnus-group-news-1)
-     (gnus-group-news-3           :inherit 'gnus-group-news-1)
-     (gnus-group-news-4           :inherit 'gnus-group-news-1)
-     (gnus-group-news-5           :inherit 'gnus-group-news-1)
-     (gnus-group-news-6           :inherit 'gnus-group-news-1)
-     (gnus-group-news-1-empty     :inherit 'gnus-group-mail-1-empty)
-     (gnus-group-news-2-empty     :inherit 'gnus-groupnews-1-empty)
-     (gnus-group-news-3-empty     :inherit 'gnus-groupnews-1-empty)
-     (gnus-group-news-4-empty     :inherit 'gnus-groupnews-1-empty)
-     (gnus-group-news-5-empty     :inherit 'gnus-groupnews-1-empty)
-     (gnus-group-news-6-empty     :inherit 'gnus-groupnews-1-empty)
-     (gnus-group-mail-low         :inherit 'gnus-group-mail-1 :bold nil)
-     (gnus-group-mail-low-empty   :inherit 'gnus-group-mail-1-empty)
-     (gnus-group-news-low         :inherit 'gnus-group-mail-1 :foreground light-grey)
-     (gnus-group-news-low-empty   :inherit 'gnus-group-news-low :bold nil)
-     (gnus-header-content         :inherit 'message-header-other)
-     (gnus-header-from            :inherit 'message-header-other)
-     (gnus-header-name            :inherit 'message-header-name)
-     (gnus-header-newsgroups      :inherit 'message-header-other)
-     (gnus-header-subject         :inherit 'message-header-subject)
-     (gnus-summary-cancelled      :foreground red :strike-through t)
-     (gnus-summary-high-ancient   :foreground (doom-lighten light-grey 0.2) :inherit 'italic)
-     (gnus-summary-high-read      :foreground (doom-lighten fg 0.2))
-     (gnus-summary-high-ticked    :foreground (doom-lighten magenta 0.2))
-     (gnus-summary-high-unread    :foreground (doom-lighten green 0.2))
-     (gnus-summary-low-ancient    :foreground (doom-darken light-grey 0.2) :inherit 'italic)
-     (gnus-summary-low-read       :foreground (doom-darken fg 0.2))
-     (gnus-summary-low-ticked     :foreground (doom-darken magenta 0.2))
-     (gnus-summary-low-unread     :foreground (doom-darken green 0.2))
-     (gnus-summary-normal-ancient :foreground light-grey :inherit 'italic)
-     (gnus-summary-normal-read    :foreground fg)
-     (gnus-summary-normal-ticked  :foreground magenta)
-     (gnus-summary-normal-unread  :foreground green :inherit 'bold)
-     (gnus-summary-selected       :foreground blue :bold bold)
-     (gnus-cite-1                 :foreground violet)
-     (gnus-cite-2                 :foreground violet)
-     (gnus-cite-3                 :foreground violet)
-     (gnus-cite-4                 :foreground green)
-     (gnus-cite-5                 :foreground green)
-     (gnus-cite-6                 :foreground green)
-     (gnus-cite-7                 :foreground magenta)
-     (gnus-cite-8                 :foreground magenta)
-     (gnus-cite-9                 :foreground magenta)
-     (gnus-cite-10                :foreground yellow)
-     (gnus-cite-11                :foreground yellow)
-     (gnus-signature              :foreground yellow)
-     (gnus-x-face                 :background light-grey :foreground fg)
-
-     ;; helm
-     (helm-selection              :background selection)
-     (helm-match                  :foreground blue :underline t)
-     (helm-source-header          :background current-line :foreground light-grey)
-     (helm-swoop-target-line-face :foreground highlight :inverse-video t)
-     (helm-ff-file                :foreground fg)
-     (helm-ff-prefix              :foreground magenta)
-     (helm-ff-dotted-directory    :foreground grey)
-     (helm-ff-directory           :foreground orange)
-     (helm-ff-executable          :foreground white :inherit 'italic)
-
-     ;; indent-guide
-     (indent-guide-face :foreground (doom-lighten bg 0.1))
-
-     ;; highlight-indentation-mode
-     (highlight-indentation-face                :background (doom-darken bg 0.1))
-     (highlight-indentation-current-column-face :background (doom-darken bg 0.1))
-     (highlight-indentation-guides-odd-face     :background bg)
-     (highlight-indentation-guides-even-face    :background (doom-darken bg 0.1))
-
-     ;; highlight-quoted-mode
-     (highlight-quoted-symbol :foreground type)
-     (highlight-quoted-quote  :foreground operators)
-
-     ;; highlight-numbers-mode
-     (highlight-numbers-number :foreground numbers)
-
-     ;; iedit
-     (iedit-occurrence :foreground magenta :bold bold :inverse-video t)
-     (iedit-read-only-occurrence :inherit 'region)
-
-     ;; ivy
-     (ivy-current-match :background (if gui dark-blue "brightblack"))
-     (ivy-minibuffer-match-face-1
-      :background black
-      :foreground (if gui (doom-lighten grey 0.1) "brightblack")
-      :bold bold)
-     (ivy-minibuffer-match-face-2 :inherit 'ivy-minibuffer-match-face-1 :foreground magenta)
-     (ivy-minibuffer-match-face-3 :inherit 'ivy-minibuffer-match-face-1 :foreground green)
-     (ivy-minibuffer-match-face-4 :inherit 'ivy-minibuffer-match-face-1 :foreground yellow)
-     (ivy-virtual :foreground fg)
-
-     ;; jabber
-     (jabber-activity-face          :foreground red   :bold bold)
-     (jabber-activity-personal-face :foreground blue  :bold bold)
-     (jabber-chat-error             :foreground red   :bold bold)
-     (jabber-chat-prompt-foreign    :foreground red   :bold bold)
-     (jabber-chat-prompt-local      :foreground blue  :bold bold)
-     (jabber-chat-prompt-system     :foreground green :bold bold)
-     (jabber-chat-text-foreign      :foreground fg)
-     (jabber-chat-text-local        :foreground fg)
-     (jabber-rare-time-face         :foreground green)
-     (jabber-roster-user-away       :foreground yellow)
-     (jabber-roster-user-chatty     :foreground green :bold bold)
-     (jabber-roster-user-dnd        :foreground red)
-     (jabber-roster-user-error      :foreground red)
-     (jabber-roster-user-offline    :foreground fg)
-     (jabber-roster-user-online     :foreground green :bold bold)
-     (jabber-roster-user-xa         :foreground cyan)
-
-     ;; multiple cursors
-     (mc/cursor-face :inherit 'cursor)
-
-     ;; neotree
-     (neo-root-dir-face   :foreground green :background bg :box `(:line-width 4 :color ,bg))
-     (neo-file-link-face  :foreground fg)
-     (neo-dir-link-face   :foreground blue)
-     (neo-expand-btn-face :foreground blue)
-     (doom-neotree-dir-face :foreground highlight)
-     (doom-neotree-file-face
-      `((((background dark))  (:foreground ,white))
-        (((background light)) (:foreground ,black))))
-     (doom-neotree-hidden-file-face
-      `((((background dark))  (:foreground ,light-grey))
-        (((background light)) (:foreground ,dark-grey))))
-     (doom-neotree-text-file-face :foreground fg)
-     (doom-neotree-data-file-face :foreground violet)
-     (doom-neotree-media-file-face :inherit 'doom-neotree-hidden-file-face)
-
-     ;; nlinum
-     (doom-nlinum-highlight :foreground fg :background bg-alt :bold nil :distant-foreground nil)
-
-     ;; popup
-     (popup-face :inherit 'tooltip)
-     (popup-selection-face :background selection)
-
-     ;; pos-tip
-     (popup          :inherit 'tooltip)
-     (popup-tip-face :inherit 'tooltip)
-
-     ;; powerline
-     (powerline-active1   :inherit 'mode-line)
-     (powerline-active2   :inherit 'mode-line)
-     (powerline-inactive1 :inherit 'mode-line-inactive)
-     (powerline-inactive2 :inherit 'mode-line-inactive)
-
-     ;; rainbow-delimiters
-     (rainbow-delimiters-depth-1-face :foreground blue)
-     (rainbow-delimiters-depth-2-face :foreground magenta)
-     (rainbow-delimiters-depth-3-face :foreground green)
-     (rainbow-delimiters-depth-4-face :foreground orange)
-     (rainbow-delimiters-depth-5-face :foreground violet)
-     (rainbow-delimiters-depth-6-face :foreground yellow)
-     (rainbow-delimiters-depth-7-face :foreground teal)
-     (rainbow-delimiters-unmatched-face  :foreground red :bold bold :inverse-video t)
-     (rainbow-delimiters-mismatched-face :inherit 'rainbow-delimiters-unmatched-face)
-
-     ;; re-builder
-     (reb-match-0 :foreground orange  :inverse-video t)
-     (reb-match-1 :foreground magenta :inverse-video t)
-     (reb-match-2 :foreground green   :inverse-video t)
-     (reb-match-3 :foreground yellow  :inverse-video t)
-
-     ;; smartparens
-     (sp-pair-overlay-face :background region)
-
-     ;; show-paren
-     (show-paren-match    :foreground red   :background black :bold bold)
-     (show-paren-mismatch :foreground black :background red   :bold bold)
-
-     ;; spaceline
-     (spaceline-highlight-face :foreground blue)
-
-     ;; stripe-buffer
-     (stripe-highlight :background bg-alt)
-
-     ;; swiper
-     (swiper-line-face    :background blue    :foreground black)
-     (swiper-match-face-1 :background black   :foreground light-grey)
-     (swiper-match-face-2 :background orange  :foreground black :bold bold)
-     (swiper-match-face-3 :background magenta :foreground black :bold bold)
-     (swiper-match-face-4 :background green   :foreground black :bold bold)
-
-     ;; tabbar
-     (tabbar-default           :foreground bg-alt :background bg-alt :height 0.9)
-     (tabbar-modified          :inherit 'tabbar-default  :foreground red :bold bold)
-     (tabbar-unselected        :inherit 'tabbar-default  :foreground grey)
-     (tabbar-selected          :inherit 'tabbar-default  :foreground fg :background bg :bold bold)
-     (tabbar-selected-modified :inherit 'tabbar-selected :foreground green)
-     (tabbar-highlight         :foreground fg :background bg-alt :inverse-video t)
-     (tabbar-button            :background (if gui bg-alt dark-grey) :foreground fg)
-     (tabbar-button-highlight  :inherit 'tabbar-button :inverse-video t)
-
-     ;; volatile-highlights
-     (vhl/default-face :background grey)
-
-     ;; wgrep
-     (wgrep-face
-      `((((background dark))  (:background ,black      :bold ,bold :foreground ,green))
-        (((background light)) (:background ,light-grey :bold ,bold :foreground ,green))))
-
-     ;; which-func
-     (which-func :foreground blue)
-
-     ;; which-key
-     (which-key-key-face                   :foreground green)
-     (which-key-group-description-face     :foreground violet)
-     (which-key-command-description-face   :foreground blue)
-     (which-key-local-map-description-face :foreground magenta)
-
-     ;; whitespace
-     (whitespace-tab      :foreground light-grey)
-     (whitespace-newline  :foreground light-grey)
-     (whitespace-trailing :inherit 'trailing-whitespace)
-     (whitespace-line     :background black :foreground red :bold bold)
-
-     ;; workgroups2
-     (wg-current-workgroup-face :foreground black      :background blue)
-     (wg-other-workgroup-face   :foreground light-grey :background current-line)
-     (wg-divider-face           :foreground grey)
-     (wg-brace-face             :foreground blue)
-
-     ;; yasnippet
-     (yas-field-highlight-face :inherit 'match)
-
-
-     ;; --- major-mode faces -------------------
-     ;; auctex (latex-mode)
-     (font-latex-bold-face         :inherit 'bold)
-     (font-latex-italic-face       :inherit 'italic)
-     (font-latex-math-face         :foreground blue)
-     (font-latex-sectioning-0-face
-      ;; org-level-1
-      `((((background dark))  (:background ,dark-grey  :bold ,bold :foreground ,blue :height 1.2))
-        (((background light)) (:background ,light-grey :bold ,bold :foreground ,blue :height 1.2))))
-     (font-latex-sectioning-1-face
-      ;; org-level-2
-      :inherit 'font-latex-sectioning-0-face :foreground violet :height 1.0)
-     (font-latex-sectioning-2-face
-      ;; org-level-3
-      `((((background dark))  (:bold ,bold :foreground ,white))
-        (((background light)) (:bold ,bold :foreground ,black))))
-     (font-latex-sectioning-3-face :inherit 'font-latex-sectioning-2-face)
-     (font-latex-sectioning-4-face :inherit 'font-latex-sectioning-2-face)
-     (font-latex-sectioning-5-face :inherit 'font-latex-sectioning-2-face)
-     (font-latex-script-char-face  :foreground dark-blue)
-     (font-latex-string-face       :inherit 'font-lock-string-face)
-     (font-latex-warning-face      :inherit 'font-lock-warning-face)
-
-     ;; jdee-mode
-     (jdee-font-lock-number-face :foreground numbers)
-     (jdee-font-lock-operator-face :foreground operators)
-     (jdee-font-lock-constant-face :inherit 'font-lock-constant-face)
-     (jdee-font-lock-constructor-face :foreground methods)
-     (jdee-font-lock-public-face :inherit 'font-lock-keyword-face)
-     (jdee-font-lock-protected-face :inherit 'font-lock-keyword-face)
-     (jdee-font-lock-private-face :inherit 'font-lock-keyword-face)
-     (jdee-font-lock-modifier-face :inherit 'font-lock-type-face)
-     (jdee-font-lock-doc-tag-face :foreground violet)
-     (jdee-font-lock-italic-face :inherit 'italic)
-     (jdee-font-lock-bold-face :inherit 'bold)
-     (jdee-font-lock-link-face :foreground blue :italic nil :underline t)
-
-     ;; js2-mode
-     (js2-function-param  :foreground variables)
-     (js2-function-call   :foreground functions)
-     (js2-object-property :foreground violet)
-     (js2-jsdoc-tag       :foreground comments)
-
-     ;; makefile-*-mode
-     (makefile-targets :foreground blue)
-
-     ;; markdown-mode
-     (markdown-header-face           :foreground red)
-     (markdown-header-delimiter-face :inherit 'markdown-header-face)
-     (markdown-metadata-key-face     :foreground red)
-     (markdown-markup-face           :foreground light-grey)
-     (markdown-pre-face              :foreground green)
-     (markdown-inline-face           :foreground cyan)
-     (markdown-list-face             :foreground red)
-     (markdown-link-face             :foreground blue    :bold nil)
-     (markdown-url-face              :foreground magenta :bold nil)
-     (markdown-header-face-1         :inherit 'markdown-header-face)
-     (markdown-header-face-2         :inherit 'markdown-header-face)
-     (markdown-header-face-3         :inherit 'markdown-header-face)
-     (markdown-header-face-4         :inherit 'markdown-header-face)
-     (markdown-header-face-5         :inherit 'markdown-header-face)
-     (markdown-header-face-6         :inherit 'markdown-header-face)
-     (markdown-italic-face           :inherit 'italic :foreground violet)
-     (markdown-bold-face             :inherit 'bold   :foreground orange)
-     ;; (markdown-header-rule-face      :inherit 'shadow)
-     ;; (markdown-markup-face           :foreground operators)
-     ;; (markdown-link-face             :inherit 'shadow)
-     ;; (markdown-link-title-face       :inherit 'link)
-     ;; (markdown-url-face              :inherit 'link)
-     ;; (markdown-blockquote-face       :foreground violet)
-
-     ;; org-mode
-     (org-level-1
-      `((((background dark))  (:background ,dark-grey  :bold ,bold :foreground ,blue :height 1.2))
-        (((background light)) (:background ,light-grey :bold ,bold :foreground ,blue :height 1.2))))
-     (org-level-2 :inherit 'org-level-1 :foreground violet :height 1.0)
-     (org-level-3
-      `((((background dark))  (:bold ,bold :foreground ,white))
-        (((background light)) (:bold ,bold :foreground ,black))))
-     (org-level-4 :inherit 'org-level-3)
-     (org-level-5 :inherit 'org-level-3)
-     (org-level-6 :inherit 'org-level-3)
-     (org-tag :foreground green :bold nil)
-     (org-priority :foreground red)
-     (org-ellipsis
-      `((((background dark))
-         (:background ,dark-grey :foreground ,light-grey :underline nil))
-        (((background light))
-         (:background ,light-grey :foreground ,dark-grey :underline nil))))
-     (org-hide :foreground bg-alt)
-     (org-table :foreground violet)
-     (org-quote
-      `((((background dark)) (:inherit 'italic :background ,dark-grey))
-        (((background light)) (:inherit 'italic :background ,light-grey))))
-     (org-document-info         :foreground builtin)
-     (org-document-title        :foreground builtin :bold bold)
-     (org-default               :inherit 'variable-pitch)
-     (org-meta-line             :foreground doc-comments)
-     (org-block-begin-line      :foreground comments :background current-line)
-     (org-block-end-line        :inherit 'org-block-begin-line)
-     (org-block-background      :background current-line)
-     (org-block                 :background current-line)
-     (org-archived              :foreground light-grey)
-     (org-code                  :foreground orange)
-     (org-verbatim              :foreground green)
-     (org-formula               :foreground cyan)
-     (org-list-dt               :foreground blue)
-     (org-footnote              :foreground orange)
-     (org-link                  :foreground green :underline t :bold 'inherit)
-     (org-date                  :foreground violet)
-     (org-todo                  :foreground blue :bold 'inherit)
-     (org-done
-      `((((background dark))  (:bold 'inherit :foreground ,light-grey))
-        (((background light)) (:bold 'inherit :foreground ,dark-grey))))
-     (org-headline-done         :foreground light-grey :bold nil)
-     (org-special-keyword       :foreground magenta)
-     (org-checkbox :inherit 'org-todo)
-     (org-checkbox-statistics-todo :inherit 'org-todo)
-     (org-checkbox-statistics-done :inherit 'org-done)
-     (message-header-name :foreground green)
-
-     ;; typescript-mode
-     (ts-object-property :inherit 'js2-object-property)
-
-     ;; rpm-spec-mode
-     (rpm-spec-macro-face        :foreground yellow)
-     (rpm-spec-var-face          :foreground violet)
-     (rpm-spec-tag-face          :foreground blue)
-     (rpm-spec-obsolete-tag-face :foreground red)
-     (rpm-spec-package-face      :foreground orange)
-     (rpm-spec-dir-face          :foreground green)
-     (rpm-spec-doc-face          :foreground orange)
-     (rpm-spec-ghost-face        :foreground comments)
-     (rpm-spec-section-face      :foreground magenta)
-
-     ;; web-mode
-     (web-mode-doctype-face           :foreground comments)
-     (web-mode-html-tag-face          :foreground methods)
-     (web-mode-html-tag-bracket-face  :foreground methods)
-     (web-mode-html-attr-name-face    :foreground type)
-     (web-mode-html-entity-face       :foreground cyan :inherit 'italic)
-     (web-mode-block-control-face     :foreground orange)
-     ;; (web-mode-html-tag-bracket-face :foreground operators)))
-     )))
-
-(defun doom-common-variables (&optional extra-vars)
-  (mapcar
-   (lambda (var)
-     (let ((var (or (assq (car var) extra-vars) var)))
-       `(list ',(car var) ,(cadr var))))
-   '((vc-annotate-color-map
-      `(list (cons 20  ,green)
-             (cons 40  ,(doom-blend yellow green (/ 1.0 3)))
-             (cons 60  ,(doom-blend yellow green (/ 2.0 3)))
-             (cons 80  ,yellow)
-             (cons 100 ,(doom-blend orange yellow (/ 1.0 3)))
-             (cons 120 ,(doom-blend orange yellow (/ 2.0 3)))
-             (cons 140 ,orange)
-             (cons 160 ,(doom-blend magenta orange (/ 1.0 3)))
-             (cons 180 ,(doom-blend magenta orange (/ 2.0 3)))
-             (cons 200 ,magenta)
-             (cons 220 ,(doom-blend red magenta (/ 1.0 3)))
-             (cons 240 ,(doom-blend red magenta (/ 2.0 3)))
-             (cons 260 ,red)
-             (cons 280 ,(doom-blend grey red (/ 1.0 4)))
-             (cons 300 ,(doom-blend grey red (/ 2.0 4)))
-             (cons 320 ,(doom-blend grey red (/ 3.0 4)))
-             (cons 340 ,light-grey)
-             (cons 360 ,light-grey)))
-     (vc-annotate-very-old-color nil)
-     (vc-annotate-background black)
-
-     (org-ellipsis "  ")
-
-     (jdee-db-spec-breakpoint-face-colors (cons black grey))
-     (jdee-db-requested-breakpoint-face-colors (cons black green))
-     (jdee-db-active-breakpoint-face-colors (cons black highlight))
-
-     (ansi-color-names-vector
-      (vector black red green yellow blue magenta cyan white)))))
-
-(provide 'doom-themes-common)
-;;; doom-themes-common.el ends here
.emacs.d/elpa/doom-themes-1.2.5/doom-themes-common.elc
Binary file
.emacs.d/elpa/doom-themes-1.2.5/doom-themes-pkg.el
@@ -1,9 +0,0 @@
-(define-package "doom-themes" "1.2.5" "a pack of themes inspired by Atom One"
-  '((emacs "24.4")
-    (all-the-icons "1.0.0")
-    (cl-lib "0.5"))
-  :url "https://github.com/hlissner/emacs-doom-theme" :keywords
-  '("dark" "blue" "atom" "one" "theme" "neotree" "nlinum" "icons"))
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/doom-themes-1.2.5/doom-themes.el
@@ -1,247 +0,0 @@
-;;; doom-themes.el --- a pack of themes inspired by Atom One
-;;
-;; Copyright (C) 2016 Henrik Lissner
-;;
-;; Author: Henrik Lissner <http://github/hlissner>
-;; Maintainer: Henrik Lissner <henrik@lissner.net>
-;; Created: May 22, 2016
-;; Modified: May 10, 2017
-;; Version: 1.2.5
-;; Keywords: dark blue atom one theme neotree nlinum icons
-;; Homepage: https://github.com/hlissner/emacs-doom-theme
-;; Package-Requires: ((emacs "24.4") (all-the-icons "1.0.0") (cl-lib "0.5"))
-;;
-;; This file is not part of GNU Emacs.
-;;
-;;; Commentary:
-;;
-;; An opinionated UI plugin/pack of themes extracted from my emacs.d, inspired
-;; by the One Dark/Light UI and syntax themes in Atom.
-;;
-;; Includes optional dimming of non-source buffers, a neotree theme with font
-;; icons, and (soon) a mode-line config.
-;;
-;; Currently available colorschemes:
-;; + doom-one: inspired by Atom One Dark
-;; + doom-dark: based on Molokai
-;;
-;; Soon to come:
-;; + doom-one-light: inspired by Atom One Light
-;; + doom-tron: doom-one, but with daylerees' Tron Legacy colorscheme
-;; + doom-peacock: doom-one, but with daylerees' Peacock colorscheme
-;;
-;;
-;; ## Configuration
-;;
-;; + global
-;;     + `doom-enable-bold` (default: `t`): if nil, bolding will be disabled
-;;     across all faces.
-;;     + `doom-enable-italic` (default: `t`): if nil, italicization will be
-;;     disabled across all faces.
-;; + doom-one
-;;     + `doom-one-brighter-modeline` (default: `nil`): If non-nil, the
-;;     mode-line background is slightly brighter.
-;;     + `doom-one-brighter-comments` (default: `nil`): If non-nil, comments
-;;     are brighter and easier to see.
-;;
-;;
-;; ## Installation
-;;
-;; 1. Install from MELPA `M-x package-install RET doom-themes`, or clone
-;;    the repo somewhere in your `load-path`.
-;;
-;; 2. If you want the neotree theme, download and install the fonts included
-;;    with all-the-icons.
-;;
-;; 3. `(require 'doom-themes)` and then load the theme you want.
-;;
-;; Example configuration:
-;;
-;;   (require 'doom-themes)
-;;   (load-theme 'doom-one t) ;; or doom-molokai, etc.
-;;
-;;   ;;; OPTIONAL
-;;   ;; brighter source buffers
-;;   (add-hook 'find-file-hook 'doom-buffer-mode)
-;;   ;; brighter minibuffer when active
-;;   (add-hook 'minibuffer-setup-hook 'doom-brighten-minibuffer)
-;;   ;; Custom neotree theme
-;;   (doom-themes-neotree-config)
-;;
-;;; Code:
-
-(require 'cl-lib)
-
-(defgroup doom-themes nil
-  "Options for doom-themes"
-  :group 'faces)
-
-(defface doom-default '((t (:inherit default)))
-  "Background face for source code windows."
-  :group 'doom-themes)
-
-(defface doom-minibuffer-active '((t (:inherit mode-line)))
-  "Face for active minibuffer. See `doom-enable-bright-minibuffer'."
-  :group 'doom-themes)
-
-(defface doom-linum '((t (:inherit linum)))
-  "Another linum face for darker windows (like popups)."
-  :group 'doom-themes)
-
-(defface doom-nlinum-highlight '((t (:inherit linum)))
-  "A face for the nlinum overlay on the current line."
-  :group 'doom-themes)
-
-(defface doom-hl-line '((t (:inherit hl-line)))
-  "A face for the current line highlight."
-  :group 'doom-themes)
-
-(defface doom-org-hide '((t (:inherit org-hide)))
-  "A face for hidden elements in org-mode. Only active if `doom-buffer-mode' is
-active."
-  :group 'doom-themes)
-
-;;
-(defcustom doom-enable-bold t
-  "If nil, bold will be disabled across all faces."
-  :group 'doom-themes
-  :type 'boolean)
-
-(defcustom doom-enable-italic t
-  "If nil, italics will be disabled across all faces."
-  :group 'doom-themes
-  :type 'boolean)
-
-;;
-(defvar doom--colors nil)
-(defvar doom--inhibit-warning nil)
-
-
-;; Color helper functions
-;; Shamelessly *borrowed* from solarized
-(defun doom-name-to-rgb (color &optional frame)
-  "Retrieves the hexidecimal string repesented the named COLOR (e.g. \"red\")
-for FRAME (defaults to the current frame)."
-  (mapcar (lambda (x) (/ x (float (car (color-values "#ffffff")))))
-          (color-values color frame)))
-
-(defun doom-blend (color1 color2 alpha)
-  "Blend two colors (hexidecimal strings) together by a coefficient ALPHA (a
-float between 0 and 1)"
-  (when (and color1 color2)
-    (apply (lambda (r g b) (format "#%02x%02x%02x" (* r 255) (* g 255) (* b 255)))
-           (cl-mapcar (lambda (it other) (+ (* alpha it) (* other (- 1 alpha))))
-                      (doom-name-to-rgb color1)
-                      (doom-name-to-rgb color2)))))
-
-(defun doom-darken (color alpha)
-  "Darken a COLOR (a hexidecimal string) by a coefficient ALPHA (a float between
-0 and 1)."
-  (doom-blend color "#000000" (- 1 alpha)))
-
-(defun doom-lighten (color alpha)
-  "Brighten a COLOR (a hexidecimal string) by a coefficient ALPHA (a float
-between 0 and 1)."
-  (doom-blend color "#FFFFFF" (- 1 alpha)))
-
-(defun doom--face-remap-add-relative (orig-fn &rest args)
-  "Ensure that other themes, functions or packages that use
-`face-remap-add-relative' (like `text-scale-set') don't undo doom's overriden
-faces."
-  (when (and (display-graphic-p) doom-buffer-mode)
-    (let ((remap (assq (nth 0 args) face-remapping-alist)))
-      (when remap (setf (nth 0 args) (cadr remap)))))
-  (apply orig-fn args))
-(advice-add 'face-remap-add-relative :around 'doom--face-remap-add-relative)
-
-(defmacro def-doom-theme (name docstring defs &optional extra-faces extra-vars)
-  "Define a DOOM theme."
-  (declare (doc-string 2))
-  (load "doom-themes-common" nil t)
-  (let ((faces (doom-common-faces extra-faces))
-        (vars (doom-common-variables extra-vars))
-        (defs (mapcar (lambda (cl)
-                        (if (> (length cl) 2)
-                            (list (car cl) `(if gui ,(nth 1 cl) ,(nth 2 cl)))
-                          cl))
-                      defs)))
-    `(let* ((gui (or (display-graphic-p) (= (tty-display-color-cells) 16777216)))
-            (bold   doom-enable-bold)
-            (italic doom-enable-italic)
-            ,@defs)
-       (setq doom--colors
-             (mapcar (lambda (x) (list (car x) (eval (cadr x)))) ',defs))
-       (deftheme ,name ,docstring)
-       (custom-theme-set-faces ',name ,@faces)
-       ,(if vars `(custom-theme-set-variables ',name ,@vars))
-       (provide-theme ',name))))
-
-;;;###autoload
-(defun doom-color (name)
-  "Retrieve a specific color named NAME (a symbol) from the current DOOM theme."
-  (nth 1 (assq name doom--colors)))
-
-;;;###autoload
-(defun doom-brighten-minibuffer ()
-  "Highlight the minibuffer whenever it is in use."
-  (with-selected-window (minibuffer-window)
-    (setq-local face-remapping-alist
-                (append face-remapping-alist '((default doom-minibuffer-active))))))
-
-(defun doom-themes-current-bg (orig-fn &rest args)
-  (if doom-buffer-mode
-      (face-background 'doom-default)
-    (apply orig-fn args)))
-(advice-add #'org-find-invisible-foreground :around #'doom-themes-current-bg)
-
-;;;###autoload
-(define-minor-mode doom-buffer-mode
-  "Brighten source buffers by remapping common faces (like default, hl-line and
-linum) to their doom-theme variants."
-  :lighter " doom"
-  :init-value nil
-  (let ((bg (face-background (if doom-buffer-mode 'doom-default 'default))))
-    ;; Don't reset remapped faces on `kill-all-local-variables'
-    (put (make-variable-buffer-local 'face-remapping-alist)
-         'permanent-local doom-buffer-mode)
-    (set-face-background 'fringe bg)
-    (when (derived-mode-p 'org-mode)
-      (set-face-foreground 'org-hide bg))
-    (if doom-buffer-mode
-        (setq face-remapping-alist
-              (append face-remapping-alist
-                      '((default doom-default)
-                        (hl-line doom-hl-line)
-                        (linum doom-linum))))
-      (mapc (lambda (key)
-              (setq face-remapping-alist
-                    (assq-delete-all key face-remapping-alist)))
-            '(default hl-line linum)))))
-
-;;;###autoload
-(defun doom-themes-neotree-config ()
-  "Install DOOM neotree configuration."
-  (let ((doom--inhibit-warning t))
-    (require 'doom-neotree)))
-
-;;;###autoload
-(defun doom-themes-nlinum-config ()
-  "Install DOOM nlinum configuration."
-  (let ((doom--inhibit-warning t))
-    (require 'doom-nlinum)))
-
-;;;###autoload
-(defun doom-buffer-mode-maybe ()
-  "Enable `doom-buffer-mode' in the current buffer, if it isn't already and the
-buffer represents a real file."
-  (when (and (not doom-buffer-mode)
-             buffer-file-name)
-    (doom-buffer-mode +1)))
-
-;;;###autoload
-(when (and (boundp 'custom-theme-load-path) load-file-name)
-  (add-to-list 'custom-theme-load-path
-               (file-name-as-directory (file-name-directory load-file-name))))
-
-(provide 'doom-themes)
-;;; doom-themes.el ends here
.emacs.d/elpa/doom-themes-1.2.5/doom-themes.elc
Binary file
.emacs.d/elpa/epl-20150517.433/epl-autoloads.el
@@ -1,15 +0,0 @@
-;;; epl-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil nil ("epl.el") (22977 30123 194706 666000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; epl-autoloads.el ends here
.emacs.d/elpa/epl-20150517.433/epl-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "epl" "20150517.433" "Emacs Package Library" '((cl-lib "0.3")) :commit "83797835f729f39b80acba4c7e83d73a2e410e26" :url "http://github.com/cask/epl" :keywords '("convenience"))
.emacs.d/elpa/epl-20150517.433/epl.el
@@ -1,695 +0,0 @@
-;;; epl.el --- Emacs Package Library -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2013-2015 Sebastian Wiesner
-;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2015 Free Software
-
-;; Author: Sebastian Wiesner <swiesner@lunaryorn.com>
-;; Maintainer: Johan Andersson <johan.rejeep@gmail.com>
-;;     Sebastian Wiesner <swiesner@lunaryorn.com>
-;; Version: 0.9-cvs
-;; Package-Version: 20150517.433
-;; Package-Requires: ((cl-lib "0.3"))
-;; Keywords: convenience
-;; URL: http://github.com/cask/epl
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; A package management library for Emacs, based on package.el.
-
-;; The purpose of this library is to wrap all the quirks and hassle of
-;; package.el into a sane API.
-
-;; The following functions comprise the public interface of this library:
-
-;;; Package directory selection
-
-;; `epl-package-dir' gets the directory of packages.
-
-;; `epl-default-package-dir' gets the default package directory.
-
-;; `epl-change-package-dir' changes the directory of packages.
-
-;;; Package system management
-
-;; `epl-initialize' initializes the package system and activates all
-;; packages.
-
-;; `epl-reset' resets the package system.
-
-;; `epl-refresh' refreshes all package archives.
-
-;; `epl-add-archive' adds a new package archive.
-
-;;; Package objects
-
-;; Struct `epl-requirement' describes a requirement of a package with `name' and
-;; `version' slots.
-
-;; `epl-requirement-version-string' gets a requirement version as string.
-
-;; Struct `epl-package' describes an installed or installable package with a
-;; `name' and some internal `description'.
-
-;; `epl-package-version' gets the version of a package.
-
-;; `epl-package-version-string' gets the version of a package as string.
-
-;; `epl-package-summary' gets the summary of a package.
-
-;; `epl-package-requirements' gets the requirements of a package.
-
-;; `epl-package-directory' gets the installation directory of a package.
-
-;; `epl-package-from-buffer' creates a package object for the package contained
-;; in the current buffer.
-
-;; `epl-package-from-file' creates a package object for a package file, either
-;; plain lisp or tarball.
-
-;; `epl-package-from-descriptor-file' creates a package object for a package
-;; description (i.e. *-pkg.el) file.
-
-;;; Package database access
-
-;; `epl-package-installed-p' determines whether a package is installed, either
-;; built-in or explicitly installed.
-
-;; `epl-package-outdated-p' determines whether a package is outdated, that is,
-;; whether a package with a higher version number is available.
-
-;; `epl-built-in-packages', `epl-installed-packages', `epl-outdated-packages'
-;; and `epl-available-packages' get all packages built-in, installed, outdated,
-;; or available for installation respectively.
-
-;; `epl-find-built-in-package', `epl-find-installed-packages' and
-;; `epl-find-available-packages' find built-in, installed and available packages
-;; by name.
-
-;; `epl-find-upgrades' finds all upgradable packages.
-
-;; `epl-built-in-p' return true if package is built-in to Emacs.
-
-;;; Package operations
-
-;; `epl-install-file' installs a package file.
-
-;; `epl-package-install' installs a package.
-
-;; `epl-package-delete' deletes a package.
-
-;; `epl-upgrade' upgrades packages.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'package)
-
-
-(unless (fboundp #'define-error)
-  ;; `define-error' for 24.3 and earlier, copied from subr.el
-  (defun define-error (name message &optional parent)
-    "Define NAME as a new error signal.
-MESSAGE is a string that will be output to the echo area if such an error
-is signaled without being caught by a `condition-case'.
-PARENT is either a signal or a list of signals from which it inherits.
-Defaults to `error'."
-    (unless parent (setq parent 'error))
-    (let ((conditions
-           (if (consp parent)
-               (apply #'append
-                      (mapcar (lambda (parent)
-                                (cons parent
-                                      (or (get parent 'error-conditions)
-                                          (error "Unknown signal `%s'" parent))))
-                              parent))
-             (cons parent (get parent 'error-conditions)))))
-      (put name 'error-conditions
-           (delete-dups (copy-sequence (cons name conditions))))
-      (when message (put name 'error-message message)))))
-
-(defsubst epl--package-desc-p (package)
-  "Whether PACKAGE is a `package-desc' object.
-
-Like `package-desc-p', but return nil, if `package-desc-p' is not
-defined as function."
-  (and (fboundp 'package-desc-p) (package-desc-p package)))
-
-
-;;; EPL errors
-(define-error 'epl-error "EPL error")
-
-(define-error 'epl-invalid-package "Invalid EPL package" 'epl-error)
-
-(define-error 'epl-invalid-package-file "Invalid EPL package file"
-  'epl-invalid-package)
-
-
-;;; Package directory
-(defun epl-package-dir ()
-  "Get the directory of packages."
-  package-user-dir)
-
-(defun epl-default-package-dir ()
-  "Get the default directory of packages."
-  (eval (car (get 'package-user-dir 'standard-value))))
-
-(defun epl-change-package-dir (directory)
-  "Change the directory of packages to DIRECTORY."
-  (setq package-user-dir directory)
-  (epl-initialize))
-
-
-;;; Package system management
-(defvar epl--load-path-before-initialize nil
-  "Remember the load path for `epl-reset'.")
-
-(defun epl-initialize (&optional no-activate)
-  "Load Emacs Lisp packages and activate them.
-
-With NO-ACTIVATE non-nil, do not activate packages."
-  (setq epl--load-path-before-initialize load-path)
-  (package-initialize no-activate))
-
-(defalias 'epl-refresh 'package-refresh-contents)
-
-(defun epl-add-archive (name url)
-  "Add a package archive with NAME and URL."
-  (add-to-list 'package-archives (cons name url)))
-
-(defun epl-reset ()
-  "Reset the package system.
-
-Clear the list of installed and available packages, the list of
-package archives and reset the package directory."
-  (setq package-alist nil
-        package-archives nil
-        package-archive-contents nil
-        load-path epl--load-path-before-initialize)
-  (when (boundp 'package-obsolete-alist) ; Legacy package.el
-    (setq package-obsolete-alist nil))
-  (epl-change-package-dir (epl-default-package-dir)))
-
-
-;;; Package structures
-(cl-defstruct (epl-requirement
-               (:constructor epl-requirement-create))
-  "Structure describing a requirement.
-
-Slots:
-
-`name' The name of the required package, as symbol.
-
-`version' The version of the required package, as version list."
-  name
-  version)
-
-(defun epl-requirement-version-string (requirement)
-  "The version of a REQUIREMENT, as string."
-  (package-version-join (epl-requirement-version requirement)))
-
-(cl-defstruct (epl-package (:constructor epl-package-create))
-  "Structure representing a package.
-
-Slots:
-
-`name' The package name, as symbol.
-
-`description' The package description.
-
-The format package description varies between package.el
-variants.  For `package-desc' variants, it is simply the
-corresponding `package-desc' object.  For legacy variants, it is
-a vector `[VERSION REQS DOCSTRING]'.
-
-Do not access `description' directly, but instead use the
-`epl-package' accessors."
-  name
-  description)
-
-(defmacro epl-package-as-description (var &rest body)
-  "Cast VAR to a package description in BODY.
-
-VAR is a symbol, bound to an `epl-package' object.  This macro
-casts this object to the `description' object, and binds the
-description to VAR in BODY."
-  (declare (indent 1))
-  (unless (symbolp var)
-    (signal 'wrong-type-argument (list #'symbolp var)))
-  `(if (epl-package-p ,var)
-       (let ((,var (epl-package-description ,var)))
-         ,@body)
-     (signal 'wrong-type-argument (list #'epl-package-p ,var))))
-
-(defsubst epl-package--package-desc-p (package)
-  "Whether the description of PACKAGE is a `package-desc'."
-  (epl--package-desc-p (epl-package-description package)))
-
-(defun epl-package-version (package)
-  "Get the version of PACKAGE, as version list."
-  (epl-package-as-description package
-    (cond
-     ((fboundp 'package-desc-version) (package-desc-version package))
-     ;; Legacy
-     ((fboundp 'package-desc-vers)
-      (let ((version (package-desc-vers package)))
-        (if (listp version) version (version-to-list version))))
-     (:else (error "Cannot get version from %S" package)))))
-
-(defun epl-package-version-string (package)
-  "Get the version from a PACKAGE, as string."
-  (package-version-join (epl-package-version package)))
-
-(defun epl-package-summary (package)
-  "Get the summary of PACKAGE, as string."
-  (epl-package-as-description package
-    (cond
-     ((fboundp 'package-desc-summary) (package-desc-summary package))
-     ((fboundp 'package-desc-doc) (package-desc-doc package)) ; Legacy
-     (:else (error "Cannot get summary from %S" package)))))
-
-(defsubst epl-requirement--from-req (req)
-  "Create a `epl-requirement' from a `package-desc' REQ."
-  (let  ((version (cadr req)))
-    (epl-requirement-create :name (car req)
-                            :version (if (listp version) version
-                                       (version-to-list version)))))
-
-(defun epl-package-requirements (package)
-  "Get the requirements of PACKAGE.
-
-The requirements are a list of `epl-requirement' objects."
-  (epl-package-as-description package
-    (mapcar #'epl-requirement--from-req (package-desc-reqs package))))
-
-(defun epl-package-directory (package)
-  "Get the directory PACKAGE is installed to.
-
-Return the absolute path of the installation directory of
-PACKAGE, or nil, if PACKAGE is not installed."
-  (cond
-   ((fboundp 'package-desc-dir)
-    (package-desc-dir (epl-package-description package)))
-   ((fboundp 'package--dir)
-    (package--dir (symbol-name (epl-package-name package))
-                  (epl-package-version-string package)))
-   (:else (error "Cannot get package directory from %S" package))))
-
-(defun epl-package-->= (pkg1 pkg2)
-  "Determine whether PKG1 is before PKG2 by version."
-  (not (version-list-< (epl-package-version pkg1)
-                       (epl-package-version pkg2))))
-
-(defun epl-package--from-package-desc (package-desc)
-  "Create an `epl-package' from a PACKAGE-DESC.
-
-PACKAGE-DESC is a `package-desc' object, from recent package.el
-variants."
-  (if (and (fboundp 'package-desc-name)
-           (epl--package-desc-p package-desc))
-      (epl-package-create :name (package-desc-name package-desc)
-                          :description package-desc)
-    (signal 'wrong-type-argument (list 'epl--package-desc-p package-desc))))
-
-(defun epl-package--parse-info (info)
-  "Parse a package.el INFO."
-  (if (epl--package-desc-p info)
-      (epl-package--from-package-desc info)
-    ;; For legacy package.el, info is a vector [NAME REQUIRES DESCRIPTION
-    ;; VERSION COMMENTARY].  We need to re-shape this vector into the
-    ;; `package-alist' format [VERSION REQUIRES DESCRIPTION] to attach it to the
-    ;; new `epl-package'.
-    (let ((name (intern (aref info 0)))
-          (info (vector (aref info 3) (aref info 1) (aref info 2))))
-      (epl-package-create :name name :description info))))
-
-(defun epl-package-from-buffer (&optional buffer)
-  "Create an `epl-package' object from BUFFER.
-
-BUFFER defaults to the current buffer.
-
-Signal `epl-invalid-package' if the buffer does not contain a
-valid package file."
-  (let ((info (with-current-buffer (or buffer (current-buffer))
-                (condition-case err
-                    (package-buffer-info)
-                  (error (signal 'epl-invalid-package (cdr err)))))))
-    (epl-package--parse-info info)))
-
-(defun epl-package-from-lisp-file (file-name)
-  "Parse the package headers the file at FILE-NAME.
-
-Return an `epl-package' object with the header metadata."
-  (with-temp-buffer
-    (insert-file-contents file-name)
-    (condition-case err
-        (epl-package-from-buffer (current-buffer))
-      ;; Attach file names to invalid package errors
-      (epl-invalid-package
-       (signal 'epl-invalid-package-file (cons file-name (cdr err))))
-      ;; Forward other errors
-      (error (signal (car err) (cdr err))))))
-
-(defun epl-package-from-tar-file (file-name)
-  "Parse the package tarball at FILE-NAME.
-
-Return a `epl-package' object with the meta data of the tarball
-package in FILE-NAME."
-  (condition-case nil
-      ;; In legacy package.el, `package-tar-file-info' takes the name of the tar
-      ;; file to parse as argument.  In modern package.el, it has no arguments
-      ;; and works on the current buffer.  Hence, we just try to call the legacy
-      ;; version, and if that fails because of a mismatch between formal and
-      ;; actual arguments, we use the modern approach.  To avoid spurious
-      ;; signature warnings by the byte compiler, we suppress warnings when
-      ;; calling the function.
-      (epl-package--parse-info (with-no-warnings
-                                 (package-tar-file-info file-name)))
-    (wrong-number-of-arguments
-     (with-temp-buffer
-       (insert-file-contents-literally file-name)
-       ;; Switch to `tar-mode' to enable extraction of the file.  Modern
-       ;; `package-tar-file-info' relies on `tar-mode', and signals an error if
-       ;; called in a buffer with a different mode.
-       (tar-mode)
-       (epl-package--parse-info (with-no-warnings
-                                  (package-tar-file-info)))))))
-
-(defun epl-package-from-file (file-name)
-  "Parse the package at FILE-NAME.
-
-Return an `epl-package' object with the meta data of the package
-at FILE-NAME."
-  (if (string-match-p (rx ".tar" string-end) file-name)
-      (epl-package-from-tar-file file-name)
-    (epl-package-from-lisp-file file-name)))
-
-(defun epl-package--parse-descriptor-requirement (requirement)
-  "Parse a REQUIREMENT in a package descriptor."
-  ;; This function is only called on legacy package.el.  On package-desc
-  ;; package.el, we just let package.el do the work.
-  (cl-destructuring-bind (name version-string) requirement
-    (list name (version-to-list version-string))))
-
-(defun epl-package-from-descriptor-file (descriptor-file)
-  "Load a `epl-package' from a package DESCRIPTOR-FILE.
-
-A package descriptor is a file defining a new package.  Its name
-typically ends with -pkg.el."
-  (with-temp-buffer
-    (insert-file-contents descriptor-file)
-    (goto-char (point-min))
-    (let ((sexp (read (current-buffer))))
-      (unless (eq (car sexp) 'define-package)
-        (error "%S is no valid package descriptor" descriptor-file))
-      (if (and (fboundp 'package-desc-from-define)
-               (fboundp 'package-desc-name))
-          ;; In Emacs snapshot, we can conveniently call a function to parse the
-          ;; descriptor
-          (let ((desc (apply #'package-desc-from-define (cdr sexp))))
-            (epl-package-create :name (package-desc-name desc)
-                                :description desc))
-        ;; In legacy package.el, we must manually deconstruct the descriptor,
-        ;; because the load function has eval's the descriptor and has a lot of
-        ;; global side-effects.
-        (cl-destructuring-bind
-            (name version-string summary requirements) (cdr sexp)
-          (epl-package-create
-           :name (intern name)
-           :description
-           (vector (version-to-list version-string)
-                   (mapcar #'epl-package--parse-descriptor-requirement
-                           ;; Strip the leading `quote' from the package list
-                           (cadr requirements))
-                   summary)))))))
-
-
-;;; Package database access
-(defun epl-package-installed-p (package)
-  "Determine whether a PACKAGE is installed.
-
-PACKAGE is either a package name as symbol, or a package object."
-  (let ((name (if (epl-package-p package)
-                  (epl-package-name package)
-                package))
-        (version (when (epl-package-p package)
-                   (epl-package-version package))))
-    (package-installed-p name version)))
-
-(defun epl--parse-built-in-entry (entry)
-  "Parse an ENTRY from the list of built-in packages.
-
-Return the corresponding `epl-package' object."
-  (if (fboundp 'package--from-builtin)
-      ;; In package-desc package.el, convert the built-in package to a
-      ;; `package-desc' and convert that to an `epl-package'
-      (epl-package--from-package-desc (package--from-builtin entry))
-    (epl-package-create :name (car entry) :description (cdr entry))))
-
-(defun epl-built-in-packages ()
-  "Get all built-in packages.
-
-Return a list of `epl-package' objects."
-  ;; This looks mighty strange, but it's the only way to force package.el to
-  ;; build the list of built-in packages.  Without this, `package--builtins'
-  ;; might be empty.
-  (package-built-in-p 'foo)
-  (mapcar #'epl--parse-built-in-entry package--builtins))
-
-(defun epl-find-built-in-package (name)
-  "Find a built-in package with NAME.
-
-NAME is a package name, as symbol.
-
-Return the built-in package as `epl-package' object, or nil if
-there is no built-in package with NAME."
-  (when (package-built-in-p name)
-    ;; We must call `package-built-in-p' *before* inspecting
-    ;; `package--builtins', because otherwise `package--builtins' might be
-    ;; empty.
-    (epl--parse-built-in-entry (assq name package--builtins))))
-
-(defun epl-package-outdated-p (package)
-  "Determine whether a PACKAGE is outdated.
-
-A package is outdated, if there is an available package with a
-higher version.
-
-PACKAGE is either a package name as symbol, or a package object.
-In the former case, test the installed or built-in package with
-the highest version number, in the later case, test the package
-object itself.
-
-Return t, if the package is outdated, or nil otherwise."
-  (let* ((package (if (epl-package-p package)
-                      package
-                    (or (car (epl-find-installed-packages package))
-                        (epl-find-built-in-package package))))
-         (available (car (epl-find-available-packages
-                          (epl-package-name package)))))
-    (and package available (version-list-< (epl-package-version package)
-                                           (epl-package-version available)))))
-
-(defun epl--parse-package-list-entry (entry)
-  "Parse a list of packages from ENTRY.
-
-ENTRY is a single entry in a package list, e.g. `package-alist',
-`package-archive-contents', etc.  Typically it is a cons cell,
-but the exact format varies between package.el versions.  This
-function tries to parse all known variants.
-
-Return a list of `epl-package' objects parsed from ENTRY."
-  (let ((descriptions (cdr entry)))
-    (cond
-     ((listp descriptions)
-      (sort (mapcar #'epl-package--from-package-desc descriptions)
-            #'epl-package-->=))
-     ;; Legacy package.el has just a single package in an entry, which is a
-     ;; standard description vector
-     ((vectorp descriptions)
-      (list (epl-package-create :name (car entry)
-                                :description descriptions)))
-     (:else (error "Cannot parse entry %S" entry)))))
-
-(defun epl-installed-packages ()
-  "Get all installed packages.
-
-Return a list of package objects."
-  (apply #'append (mapcar #'epl--parse-package-list-entry package-alist)))
-
-(defsubst epl--filter-outdated-packages (packages)
-  "Filter outdated packages from PACKAGES."
-  (let (res)
-    (dolist (package packages)
-      (when (epl-package-outdated-p package)
-        (push package res)))
-    (nreverse res)))
-
-(defun epl-outdated-packages ()
-  "Get all outdated packages, as in `epl-package-outdated-p'.
-
-Return a list of package objects."
-  (epl--filter-outdated-packages (epl-installed-packages)))
-
-(defsubst epl--find-package-in-list (name list)
-  "Find a package by NAME in a package LIST.
-
-Return a list of corresponding `epl-package' objects."
-  (let ((entry (assq name list)))
-    (when entry
-      (epl--parse-package-list-entry entry))))
-
-(defun epl-find-installed-package (name)
-  "Find the latest installed package by NAME.
-
-NAME is a package name, as symbol.
-
-Return the installed package with the highest version number as
-`epl-package' object, or nil, if no package with NAME is
-installed."
-  (car (epl-find-installed-packages name)))
-(make-obsolete 'epl-find-installed-package 'epl-find-installed-packages "0.7")
-
-(defun epl-find-installed-packages (name)
-  "Find all installed packages by NAME.
-
-NAME is a package name, as symbol.
-
-Return a list of all installed packages with NAME, sorted by
-version number in descending order.  Return nil, if there are no
-packages with NAME."
-  (epl--find-package-in-list name package-alist))
-
-(defun epl-available-packages ()
-  "Get all packages available for installation.
-
-Return a list of package objects."
-  (apply #'append (mapcar #'epl--parse-package-list-entry
-                          package-archive-contents)))
-
-(defun epl-find-available-packages (name)
-  "Find available packages for NAME.
-
-NAME is a package name, as symbol.
-
-Return a list of available packages for NAME, sorted by version
-number in descending order.  Return nil, if there are no packages
-for NAME."
-  (epl--find-package-in-list name package-archive-contents))
-
-(cl-defstruct (epl-upgrade
-               (:constructor epl-upgrade-create))
-  "Structure describing an upgradable package.
-Slots:
-
-`installed' The installed package
-
-`available' The package available for installation."
-  installed
-  available)
-
-(defun epl-find-upgrades (&optional packages)
-  "Find all upgradable PACKAGES.
-
-PACKAGES is a list of package objects to upgrade, defaulting to
-all installed packages.
-
-Return a list of `epl-upgrade' objects describing all upgradable
-packages."
-  (let ((packages (or packages (epl-installed-packages)))
-        upgrades)
-    (dolist (pkg packages)
-      (let* ((version (epl-package-version pkg))
-             (name (epl-package-name pkg))
-             ;; Find the latest available package for NAME
-             (available-pkg (car (epl-find-available-packages name)))
-             (available-version (when available-pkg
-                                  (epl-package-version available-pkg))))
-        (when (and available-version (version-list-< version available-version))
-          (push (epl-upgrade-create :installed pkg
-                                    :available available-pkg)
-                upgrades))))
-    (nreverse upgrades)))
-
-(defalias 'epl-built-in-p 'package-built-in-p)
-
-
-;;; Package operations
-
-(defalias 'epl-install-file 'package-install-file)
-
-(defun epl-package-install (package &optional force)
-  "Install a PACKAGE.
-
-PACKAGE is a `epl-package' object.  If FORCE is given and
-non-nil, install PACKAGE, even if it is already installed."
-  (when (or force (not (epl-package-installed-p package)))
-    (if (epl-package--package-desc-p package)
-        (package-install (epl-package-description package))
-      ;; The legacy API installs by name.  We have no control over versioning,
-      ;; etc.
-      (package-install (epl-package-name package)))))
-
-(defun epl-package-delete (package)
-  "Delete a PACKAGE.
-
-PACKAGE is a `epl-package' object to delete."
-  ;; package-delete allows for packages being trashed instead of fully deleted.
-  ;; Let's prevent his silly behavior
-  (let ((delete-by-moving-to-trash nil))
-    ;; The byte compiler will warn us that we are calling `package-delete' with
-    ;; the wrong number of arguments, since it can't infer that we guarantee to
-    ;; always call the correct version.  Thus we suppress all warnings when
-    ;; calling `package-delete'.  I wish there was a more granular way to
-    ;; disable just that specific warning, but it is what it is.
-    (if (epl-package--package-desc-p package)
-        (with-no-warnings
-          (package-delete (epl-package-description package)))
-      ;; The legacy API deletes by name (as string!) and version instead by
-      ;; descriptor.  Hence `package-delete' takes two arguments.  For some
-      ;; insane reason, the arguments are strings here!
-      (let ((name (symbol-name (epl-package-name package)))
-            (version (epl-package-version-string package)))
-        (with-no-warnings
-          (package-delete name version))
-        ;; Legacy package.el does not remove the deleted package
-        ;; from the `package-alist', so we do it manually here.
-        (let ((pkg (assq (epl-package-name package) package-alist)))
-          (when pkg
-            (setq package-alist (delq pkg package-alist))))))))
-
-(defun epl-upgrade (&optional packages preserve-obsolete)
-  "Upgrade PACKAGES.
-
-PACKAGES is a list of package objects to upgrade, defaulting to
-all installed packages.
-
-The old versions of the updated packages are deleted, unless
-PRESERVE-OBSOLETE is non-nil.
-
-Return a list of all performed upgrades, as a list of
-`epl-upgrade' objects."
-  (let ((upgrades (epl-find-upgrades packages)))
-    (dolist (upgrade upgrades)
-      (epl-package-install (epl-upgrade-available upgrade) 'force)
-      (unless preserve-obsolete
-        (epl-package-delete (epl-upgrade-installed upgrade))))
-    upgrades))
-
-(provide 'epl)
-
-;;; epl.el ends here
.emacs.d/elpa/epl-20150517.433/epl.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/dir
@@ -1,18 +0,0 @@
-This is the file .../info/dir, which contains the
-topmost node of the Info hierarchy, called (dir)Top.
-The first time you invoke Info you start off looking at this node.
-
-File: dir,	Node: Top	This is the top of the INFO tree
-
-  This (the Directory node) gives a menu of major topics.
-  Typing "q" exits, "?" lists all Info commands, "d" returns here,
-  "h" gives a primer for first-timers,
-  "mEmacs<Return>" visits the Emacs manual, etc.
-
-  In Emacs, you can click mouse button 2 on a menu item or cross reference
-  to select it.
-
-* Menu:
-
-Emacs
-* Evil: (evil).                 Extensible vi layer for Emacs.
.emacs.d/elpa/evil-20170904.1346/evil-autoloads.el
@@ -1,26 +0,0 @@
-;;; evil-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "evil-core" "evil-core.el" (22968 12694 941943
-;;;;;;  544000))
-;;; Generated autoloads from evil-core.el
- (autoload 'evil-mode "evil")
-
-;;;***
-
-;;;### (autoloads nil nil ("evil-command-window.el" "evil-commands.el"
-;;;;;;  "evil-common.el" "evil-digraphs.el" "evil-ex.el" "evil-integration.el"
-;;;;;;  "evil-jumps.el" "evil-macros.el" "evil-maps.el" "evil-pkg.el"
-;;;;;;  "evil-repeat.el" "evil-search.el" "evil-states.el" "evil-types.el"
-;;;;;;  "evil-vars.el" "evil.el") (22968 12694 944943 427000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; evil-autoloads.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-command-window.el
@@ -1,168 +0,0 @@
-;;; evil-command-window.el --- Evil command line window implementation
-;; Author: Emanuel Evans <emanuel.evans at gmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This provides an implementation of the vim command line window for
-;; editing and repeating past ex commands and searches.
-
-;;; Code:
-
-(require 'evil-vars)
-(require 'evil-common)
-(require 'evil-search)
-(require 'evil-ex)
-
-(defvar evil-search-module)
-
-(define-derived-mode evil-command-window-mode fundamental-mode "Evil-cmd"
-  "Major mode for the Evil command line window."
-  (auto-fill-mode 0)
-  (setq-local after-change-functions (cons 'evil-command-window-draw-prefix
-                                           after-change-functions)))
-
-(defun evil-command-window (hist cmd-key execute-fn)
-  "Open a command line window for HIST with CMD-KEY and EXECUTE-FN.
-HIST should be a list of commands.  CMD-KEY should be the string of
-the key whose history is being shown (one of \":\", \"/\", or
-\"?\").  EXECUTE-FN should be a function of one argument to
-execute on the result that the user selects."
-  (when (eq major-mode 'evil-command-window-mode)
-    (user-error "Cannot recursively open command line window"))
-  (dolist (win (window-list))
-    (when (equal (buffer-name (window-buffer win))
-                 "*Command Line*")
-      (kill-buffer (window-buffer win))
-      (delete-window win)))
-  (split-window nil
-                (unless (zerop evil-command-window-height)
-                  evil-command-window-height)
-                'above)
-  (setq evil-command-window-current-buffer (current-buffer))
-  (ignore-errors (kill-buffer "*Command Line*"))
-  (switch-to-buffer "*Command Line*")
-  (setq-local evil-command-window-execute-fn execute-fn)
-  (setq-local evil-command-window-cmd-key cmd-key)
-  (evil-command-window-mode)
-  (evil-command-window-insert-commands hist))
-
-(defun evil-command-window-ex (&optional current-command)
-  "Open a command line window for editing and executing ex commands.
-If CURRENT-COMMAND is present, it will be inserted under the
-cursor as the current command to be edited."
-  (interactive)
-  (evil-command-window (cons (or current-command "") evil-ex-history)
-                       ":"
-                       'evil-command-window-ex-execute))
-
-(defun evil-command-window-execute ()
-  "Execute the command under the cursor in the appropriate buffer.
-The local var `evil-command-window-execute-fn' determines which
-function to execute."
-  (interactive)
-  (let ((result (buffer-substring (line-beginning-position)
-                                  (line-end-position)))
-        (execute-fn evil-command-window-execute-fn)
-        (command-window (get-buffer-window)))
-    (select-window (previous-window))
-    (unless (equal evil-command-window-current-buffer (current-buffer))
-      (user-error "Originating buffer is no longer active"))
-    (kill-buffer "*Command Line*")
-    (delete-window command-window)
-    (funcall execute-fn result)
-    (setq evil-command-window-current-buffer nil)))
-
-(defun evil-command-window-ex-execute (result)
-  "Execute RESULT as an ex command in the appropriate buffer."
-  (unless (string-match-p "^ *$" result)
-    (unless (equal result (car evil-ex-history))
-      (setq evil-ex-history (cons result evil-ex-history)))
-    (let ((evil-ex-current-buffer evil-command-window-current-buffer))
-      (evil-ex-execute result))))
-
-(defun evil-command-window-search-forward ()
-  "Open a command line window for forward searches."
-  (interactive)
-  (evil-command-window (cons ""
-                             (if (eq evil-search-module 'evil-search)
-                                 evil-ex-search-history
-                               evil-search-forward-history))
-                       "/"
-                       (lambda (result)
-                         (evil-command-window-search-execute result t))))
-
-(defun evil-command-window-search-backward ()
-  "Open a command line window for backward searches."
-  (interactive)
-  (evil-command-window (cons ""
-                             (if (eq evil-search-module 'evil-search)
-                                 evil-ex-search-history
-                               evil-search-backward-history))
-                       "?"
-                       (lambda (result)
-                         (evil-command-window-search-execute result nil))))
-
-(defun evil-command-window-search-execute (result forward)
-  "Search for RESULT using FORWARD to determine direction."
-  (unless (zerop (length result))
-
-    (if (eq evil-search-module 'evil-search)
-        (progn
-          (setq evil-ex-search-pattern (evil-ex-make-search-pattern result)
-                evil-ex-search-direction (if forward 'forward 'backward))
-          (unless (equal result (car-safe evil-ex-search-history))
-            (push result evil-ex-search-history))
-          (evil-ex-search))
-      (if forward
-          (unless (equal result (car-safe evil-search-forward-history))
-            (push result evil-search-forward-history))
-        (unless (equal result (car-safe evil-search-backward-history))
-          (push result evil-search-backward-history)))
-      (evil-search result forward evil-regexp-search))))
-
-(defun evil-command-window-draw-prefix (&rest ignored)
-  "Display `evil-command-window-cmd-key' as a prefix to the current line.
-Parameters passed in through IGNORED are ignored."
-  (let ((prefix (propertize evil-command-window-cmd-key
-                            'font-lock-face 'minibuffer-prompt)))
-    (set-text-properties (line-beginning-position) (line-beginning-position 2)
-                         (list 'line-prefix prefix))))
-
-(defun evil-command-window-insert-commands (hist)
-  "Insert the commands in HIST."
-  (let ((inhibit-modification-hooks t))
-    (mapc #'(lambda (cmd) (insert cmd) (newline)) hist)
-    (reverse-region (point-min) (point-max)))
-  (let ((prefix (propertize evil-command-window-cmd-key
-                            'font-lock-face 'minibuffer-prompt)))
-    (set-text-properties (point-min) (point-max) (list 'line-prefix prefix)))
-  (goto-char (point-max))
-  (when (and (bolp) (not (bobp))) (backward-char))
-  (evil-adjust-cursor))
-
-(provide 'evil-command-window)
-
-;;; evil-command-window.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-command-window.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-commands.el
@@ -1,4453 +0,0 @@
-;;; evil-commands.el --- Evil commands and operators
-;; Author: Vegard Øye <vegard_oye at hotmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-(require 'evil-common)
-(require 'evil-digraphs)
-(require 'evil-search)
-(require 'evil-ex)
-(require 'evil-types)
-(require 'evil-command-window)
-(require 'evil-jumps)
-(require 'flyspell)
-
-;;; Motions
-
-;; Movement commands, or motions, are defined with the macro
-;; `evil-define-motion'. A motion is a command with an optional
-;; argument COUNT (interactively accessed by the code "<c>").
-;; It may specify the :type command property (e.g., :type line),
-;; which determines how it is handled by an operator command.
-;; Furthermore, the command must have the command properties
-;; :keep-visual t and :repeat motion; these are automatically
-;; set by the `evil-define-motion' macro.
-
-;;; Code:
-
-(evil-define-motion evil-forward-char (count &optional crosslines noerror)
-  "Move cursor to the right by COUNT characters.
-Movement is restricted to the current line unless CROSSLINES is non-nil.
-If NOERROR is non-nil, don't signal an error upon reaching the end
-of the line or the buffer; just return nil."
-  :type exclusive
-  (interactive "<c>" (list evil-cross-lines
-                           (evil-kbd-macro-suppress-motion-error)))
-  (cond
-   (noerror
-    (condition-case nil
-        (evil-forward-char count crosslines nil)
-      (error nil)))
-   ((not crosslines)
-    ;; for efficiency, narrow the buffer to the projected
-    ;; movement before determining the current line
-    (evil-with-restriction
-        (point)
-        (save-excursion
-          (evil-forward-char (1+ (or count 1)) t t)
-          (point))
-      (condition-case err
-          (evil-narrow-to-line
-            (evil-forward-char count t noerror))
-        (error
-         ;; Restore the previous command (this one never happend).
-         ;; Actually, this preserves the current column if the
-         ;; previous command was `evil-next-line' or
-         ;; `evil-previous-line'.
-         (setq this-command last-command)
-         (signal (car err) (cdr err))))))
-   (t
-    (evil-motion-loop (nil (or count 1))
-      (forward-char)
-      ;; don't put the cursor on a newline
-      (when (and evil-move-cursor-back
-                 (not evil-move-beyond-eol)
-                 (not (evil-visual-state-p))
-                 (not (evil-operator-state-p))
-                 (eolp) (not (eobp)) (not (bolp)))
-        (forward-char))))))
-
-(evil-define-motion evil-backward-char (count &optional crosslines noerror)
-  "Move cursor to the left by COUNT characters.
-Movement is restricted to the current line unless CROSSLINES is non-nil.
-If NOERROR is non-nil, don't signal an error upon reaching the beginning
-of the line or the buffer; just return nil."
-  :type exclusive
-  (interactive "<c>" (list evil-cross-lines
-                           (evil-kbd-macro-suppress-motion-error)))
-  (cond
-   (noerror
-    (condition-case nil
-        (evil-backward-char count crosslines nil)
-      (error nil)))
-   ((not crosslines)
-    ;; restrict movement to the current line
-    (evil-with-restriction
-        (save-excursion
-          (evil-backward-char (1+ (or count 1)) t t)
-          (point))
-        (1+ (point))
-      (condition-case err
-          (evil-narrow-to-line
-            (evil-backward-char count t noerror))
-        (error
-         ;; Restore the previous command (this one never happened).
-         ;; Actually, this preserves the current column if the
-         ;; previous command was `evil-next-line' or
-         ;; `evil-previous-line'.
-         (setq this-command last-command)
-         (signal (car err) (cdr err))))))
-   (t
-    (evil-motion-loop (nil (or count 1))
-      (backward-char)
-      ;; don't put the cursor on a newline
-      (unless (or (evil-visual-state-p) (evil-operator-state-p))
-        (evil-adjust-cursor))))))
-
-(evil-define-motion evil-next-line (count)
-  "Move the cursor COUNT lines down."
-  :type line
-  (let (line-move-visual)
-    (evil-line-move (or count 1))))
-
-(evil-define-motion evil-previous-line (count)
-  "Move the cursor COUNT lines up."
-  :type line
-  (let (line-move-visual)
-    (evil-line-move (- (or count 1)))))
-
-(evil-define-motion evil-next-visual-line (count)
-  "Move the cursor COUNT screen lines down."
-  :type exclusive
-  (let ((line-move-visual t))
-    (evil-line-move (or count 1))))
-
-(evil-define-motion evil-previous-visual-line (count)
-  "Move the cursor COUNT screen lines up."
-  :type exclusive
-  (let ((line-move-visual t))
-    (evil-line-move (- (or count 1)))))
-
-;; used for repeated commands like "dd"
-(evil-define-motion evil-line (count)
-  "Move COUNT - 1 lines down."
-  :type line
-  (let (line-move-visual)
-    ;; Catch bob and eob errors. These are caused when not moving
-    ;; point starting in the first or last line, respectively. In this
-    ;; case the current line should be selected.
-    (condition-case err
-        (evil-line-move (1- (or count 1)))
-      ((beginning-of-buffer end-of-buffer)))))
-
-(evil-define-motion evil-beginning-of-line ()
-  "Move the cursor to the beginning of the current line."
-  :type exclusive
-  (move-beginning-of-line nil))
-
-(evil-define-motion evil-end-of-line (count)
-  "Move the cursor to the end of the current line.
-If COUNT is given, move COUNT - 1 lines downward first."
-  :type inclusive
-  (move-end-of-line count)
-  (when evil-track-eol
-    (setq temporary-goal-column most-positive-fixnum
-          this-command 'next-line))
-  (unless (evil-visual-state-p)
-    (evil-adjust-cursor)
-    (when (eolp)
-      ;; prevent "c$" and "d$" from deleting blank lines
-      (setq evil-this-type 'exclusive))))
-
-(evil-define-motion evil-beginning-of-visual-line ()
-  "Move the cursor to the first character of the current screen line."
-  :type exclusive
-  (if (fboundp 'beginning-of-visual-line)
-      (beginning-of-visual-line)
-    (beginning-of-line)))
-
-(evil-define-motion evil-end-of-visual-line (count)
-  "Move the cursor to the last character of the current screen line.
-If COUNT is given, move COUNT - 1 screen lines downward first."
-  :type inclusive
-  (if (fboundp 'end-of-visual-line)
-      (end-of-visual-line count)
-    (end-of-line count)))
-
-(evil-define-motion evil-middle-of-visual-line ()
-  "Move the cursor to the middle of the current visual line."
-  :type exclusive
-  (beginning-of-visual-line)
-  (evil-with-restriction
-      nil
-      (save-excursion (end-of-visual-line) (point))
-    (move-to-column (+ (current-column)
-                       -1
-                       (/ (with-no-warnings (window-body-width)) 2)))))
-
-(evil-define-motion evil-beginning-of-line-or-digit-argument ()
-  "Move the cursor to the beginning of the current line.
-This function passes its command to `digit-argument' (usually a 0)
-if it is not the first event."
-  :type exclusive
-  (cond
-   (current-prefix-arg
-    (setq this-command #'digit-argument)
-    (call-interactively #'digit-argument))
-   (t
-    (setq this-command #'evil-beginning-of-line)
-    (call-interactively #'evil-beginning-of-line))))
-
-(evil-define-motion evil-first-non-blank ()
-  "Move the cursor to the first non-blank character of the current line."
-  :type exclusive
-  (evil-narrow-to-line (back-to-indentation)))
-
-(evil-define-motion evil-last-non-blank (count)
-  "Move the cursor to the last non-blank character of the current line.
-If COUNT is given, move COUNT - 1 lines downward first."
-  :type inclusive
-  (goto-char
-   (save-excursion
-     (evil-move-beginning-of-line count)
-     (if (re-search-forward "[ \t]*$")
-         (max (line-beginning-position)
-              (1- (match-beginning 0)))
-       (line-beginning-position)))))
-
-(evil-define-motion evil-first-non-blank-of-visual-line ()
-  "Move the cursor to the first non blank character
-of the current screen line."
-  :type exclusive
-  (evil-beginning-of-visual-line)
-  (skip-chars-forward " \t\r"))
-
-(evil-define-motion evil-next-line-first-non-blank (count)
-  "Move the cursor COUNT lines down on the first non-blank character."
-  :type line
-  (let ((this-command this-command))
-    (evil-next-line (or count 1)))
-  (evil-first-non-blank))
-
-(evil-define-motion evil-next-line-1-first-non-blank (count)
-  "Move the cursor COUNT-1 lines down on the first non-blank character."
-  :type line
-  (let ((this-command this-command))
-    (evil-next-line (1- (or count 1))))
-  (evil-first-non-blank))
-
-(evil-define-motion evil-previous-line-first-non-blank (count)
-  "Move the cursor COUNT lines up on the first non-blank character."
-  :type line
-  (let ((this-command this-command))
-    (evil-previous-line (or count 1)))
-  (evil-first-non-blank))
-
-(evil-define-motion evil-goto-line (count)
-  "Go to the first non-blank character of line COUNT.
-By default the last line."
-  :jump t
-  :type line
-  (if (null count)
-      (with-no-warnings (end-of-buffer))
-    (goto-char (point-min))
-    (forward-line (1- count)))
-  (evil-first-non-blank))
-
-(evil-define-motion evil-goto-first-line (count)
-  "Go to the first non-blank character of line COUNT.
-By default the first line."
-  :jump t
-  :type line
-  (evil-goto-line (or count 1)))
-
-(evil-define-motion evil-forward-word-begin (count &optional bigword)
-  "Move the cursor to the beginning of the COUNT-th next word.
-If BIGWORD is non-nil, move by WORDS.
-
-If this command is called in operator-pending state it behaves
-differently. If point reaches the beginning of a word on a new
-line point is moved back to the end of the previous line.
-
-If called after a change operator, i.e. cw or cW,
-`evil-want-change-word-to-end' is non-nil and point is on a word,
-then both behave like ce or cE.
-
-If point is at the end of the buffer and cannot be moved signal
-'end-of-buffer is raised.
-"
-  :type exclusive
-  (let ((thing (if bigword 'evil-WORD 'evil-word))
-        (orig (point))
-        (count (or count 1)))
-    (evil-signal-at-bob-or-eob count)
-    (cond
-     ;; default motion, beginning of next word
-     ((not (evil-operator-state-p))
-      (evil-forward-beginning thing count))
-     ;; the evil-change operator, maybe behave like ce or cE
-     ((and evil-want-change-word-to-end
-           (memq evil-this-operator evil-change-commands)
-           (< orig (or (cdr-safe (bounds-of-thing-at-point thing)) orig)))
-      ;; forward-thing moves point to the correct position because
-      ;; this is an exclusive motion
-      (forward-thing thing count))
-     ;; operator state
-     (t
-      (prog1 (evil-forward-beginning thing count)
-        ;; if we reached the beginning of a word on a new line in
-        ;; Operator-Pending state, go back to the end of the previous
-        ;; line
-        (when (and (> (line-beginning-position) orig)
-                   (looking-back "^[[:space:]]*" (line-beginning-position)))
-          ;; move cursor back as long as the line contains only
-          ;; whitespaces and is non-empty
-          (evil-move-end-of-line 0)
-          ;; skip non-empty lines containing only spaces
-          (while (and (looking-back "^[[:space:]]+$" (line-beginning-position))
-                      (not (<= (line-beginning-position) orig)))
-            (evil-move-end-of-line 0))
-          ;; but if the previous line is empty, delete this line
-          (when (bolp) (forward-char))))))))
-
-(evil-define-motion evil-forward-word-end (count &optional bigword)
-  "Move the cursor to the end of the COUNT-th next word.
-If BIGWORD is non-nil, move by WORDS."
-  :type inclusive
-  (let ((thing (if bigword 'evil-WORD 'evil-word))
-        (count (or count 1)))
-    (evil-signal-at-bob-or-eob count)
-    ;; Evil special behaviour: e or E on a one-character word in
-    ;; operator state does not move point
-    (unless (and (evil-operator-state-p)
-                 (= 1 count)
-                 (let ((bnd (bounds-of-thing-at-point thing)))
-                   (and bnd
-                        (= (car bnd) (point))
-                        (= (cdr bnd) (1+ (point)))))
-                 (looking-at "[[:word:]]"))
-      (evil-forward-end thing count))))
-
-(evil-define-motion evil-backward-word-begin (count &optional bigword)
-  "Move the cursor to the beginning of the COUNT-th previous word.
-If BIGWORD is non-nil, move by WORDS."
-  :type exclusive
-  (let ((thing (if bigword 'evil-WORD 'evil-word)))
-    (evil-signal-at-bob-or-eob (- (or count 1)))
-    (evil-backward-beginning thing count)))
-
-(evil-define-motion evil-backward-word-end (count &optional bigword)
-  "Move the cursor to the end of the COUNT-th previous word.
-If BIGWORD is non-nil, move by WORDS."
-  :type inclusive
-  (let ((thing (if bigword 'evil-WORD 'evil-word)))
-    (evil-signal-at-bob-or-eob (- (or count 1)))
-    (evil-backward-end thing count)))
-
-(evil-define-motion evil-forward-WORD-begin (count)
-  "Move the cursor to the beginning of the COUNT-th next WORD."
-  :type exclusive
-  (evil-forward-word-begin count t))
-
-(evil-define-motion evil-forward-WORD-end (count)
-  "Move the cursor to the end of the COUNT-th next WORD."
-  :type inclusive
-  (evil-forward-word-end count t))
-
-(evil-define-motion evil-backward-WORD-begin (count)
-  "Move the cursor to the beginning of the COUNT-th previous WORD."
-  :type exclusive
-  (evil-backward-word-begin count t))
-
-(evil-define-motion evil-backward-WORD-end (count)
-  "Move the cursor to the end of the COUNT-th previous WORD."
-  :type inclusive
-  (evil-backward-word-end count t))
-
-;; section movement
-(evil-define-motion evil-forward-section-begin (count)
-  "Move the cursor to the beginning of the COUNT-th next section."
-  :jump t
-  :type exclusive
-  (evil-signal-at-bob-or-eob count)
-  (evil-forward-beginning 'evil-defun count))
-
-(evil-define-motion evil-forward-section-end (count)
-  "Move the cursor to the end of the COUNT-th next section."
-  :jump t
-  :type inclusive
-  (evil-signal-at-bob-or-eob count)
-  (evil-forward-end 'evil-defun count)
-  (unless (eobp) (forward-line)))
-
-(evil-define-motion evil-backward-section-begin (count)
-  "Move the cursor to the beginning of the COUNT-th previous section."
-  :jump t
-  :type exclusive
-  (evil-signal-at-bob-or-eob (- (or count 1)))
-  (evil-backward-beginning 'evil-defun count))
-
-(evil-define-motion evil-backward-section-end (count)
-  "Move the cursor to the end of the COUNT-th previous section."
-  :jump t
-  :type inclusive
-  (evil-signal-at-bob-or-eob (- (or count 1)))
-  (end-of-line -1)
-  (evil-backward-end 'evil-defun count)
-  (unless (eobp) (forward-line)))
-
-(evil-define-motion evil-forward-sentence-begin (count)
-  "Move to the next COUNT-th beginning of a sentence or end of a paragraph."
-  :jump t
-  :type exclusive
-  (evil-signal-at-bob-or-eob count)
-  (evil-forward-nearest count
-                        #'(lambda (cnt)
-                            (evil-forward-beginning 'evil-sentence))
-                        #'evil-forward-paragraph))
-
-(evil-define-motion evil-backward-sentence-begin (count)
-  "Move to the previous COUNT-th beginning of a sentence or paragraph."
-  :jump t
-  :type exclusive
-  (evil-signal-at-bob-or-eob (- (or count 1)))
-  (evil-forward-nearest (- (or count 1))
-                        #'(lambda (cnt)
-                            (evil-backward-beginning 'evil-sentence))
-                        #'(lambda (cnt)
-                            (evil-backward-paragraph))))
-
-(evil-define-motion evil-forward-paragraph (count)
-  "Move to the end of the COUNT-th next paragraph."
-  :jump t
-  :type exclusive
-  (evil-signal-at-bob-or-eob count)
-  (evil-forward-end 'evil-paragraph count)
-  (unless (eobp) (forward-line)))
-
-(evil-define-motion evil-backward-paragraph (count)
-  "Move to the beginning of the COUNT-th previous paragraph."
-  :jump t
-  :type exclusive
-  (evil-signal-at-bob-or-eob (- (or count 1)))
-  (unless (eobp) (forward-line))
-  (evil-backward-beginning 'evil-paragraph count)
-  (unless (bobp) (forward-line -1)))
-
-(evil-define-motion evil-jump-item (count)
-  "Find the next item in this line after or under the cursor
-and jump to the corresponding one."
-  :jump t
-  :type inclusive
-  (cond
-   ;; COUNT% jumps to a line COUNT percentage down the file
-   (count
-    (goto-char
-     (evil-normalize-position
-      (let ((size (- (point-max) (point-min))))
-        (+ (point-min)
-           (if (> size 80000)
-               (* count (/ size 100))
-             (/ (* count size) 100))))))
-    (back-to-indentation)
-    (setq evil-this-type 'line))
-   ((and (evil-looking-at-start-comment t)
-         (let ((pnt (point)))
-           (forward-comment 1)
-           (or (not (bolp))
-               (prog1 nil (goto-char pnt)))))
-    (backward-char))
-   ((and (not (eolp)) (evil-looking-at-end-comment t))
-    (forward-comment -1))
-   ((and
-     (memq major-mode '(c-mode c++-mode))
-     (require 'hideif nil t)
-     (with-no-warnings
-       (let* ((hif-else-regexp (concat hif-cpp-prefix "\\(?:else\\|elif[ \t]+\\)"))
-              (hif-ifx-else-endif-regexp
-               (concat hif-ifx-regexp "\\|" hif-else-regexp "\\|" hif-endif-regexp)))
-         (cond
-          ((save-excursion (beginning-of-line) (or (hif-looking-at-ifX) (hif-looking-at-else)))
-           (hif-find-next-relevant)
-           (while (hif-looking-at-ifX)
-             (hif-ifdef-to-endif)
-             (hif-find-next-relevant))
-           t)
-          ((save-excursion (beginning-of-line) (hif-looking-at-endif))
-           (hif-endif-to-ifdef)
-           t))))))
-   (t
-    (let* ((open (point-max))
-           (close (point-max))
-           (open-pair (condition-case nil
-                          (save-excursion
-                            ;; consider the character right before eol given that
-                            ;; point may be placed there, e.g. in visual state
-                            (when (and (eolp) (not (bolp)))
-                              (backward-char))
-                            (setq open (1- (scan-lists (point) 1 -1)))
-                            (when (< open (line-end-position))
-                              (goto-char open)
-                              (forward-list)
-                              (1- (point))))
-                        (error nil)))
-           (close-pair (condition-case nil
-                           (save-excursion
-                             ;; consider the character right before eol given that
-                             ;; point may be placed there, e.g. in visual state
-                             (when (and (eolp) (not (bolp)))
-                               (backward-char))
-                             (setq close (1- (scan-lists (point) 1 1)))
-                             (when (< close (line-end-position))
-                               (goto-char (1+ close))
-                               (backward-list)
-                               (point)))
-                         (error nil))))
-      (cond
-       ((not (or open-pair close-pair))
-        ;; nothing found, check if we are inside a string
-        (let ((pnt (point))
-              (state (syntax-ppss (point)))
-              (bnd (bounds-of-thing-at-point 'evil-string)))
-          (if (not (and bnd (< (point) (cdr bnd))))
-              ;; no, then we really failed
-              (user-error "No matching item found on the current line")
-            ;; yes, go to the end of the string and try again
-            (let ((endstr (cdr bnd)))
-              (when (or (save-excursion
-                          (goto-char endstr)
-                          (let ((b (bounds-of-thing-at-point 'evil-string)))
-                            (and b (< (point) (cdr b))))) ; not at end of string
-                        (condition-case nil
-                            (progn
-                              (goto-char endstr)
-                              (evil-jump-item)
-                              nil)
-                          (error t)))
-                ;; failed again, go back to original point
-                (goto-char pnt)
-                (user-error "No matching item found on the current line"))))))
-       ((< open close) (goto-char open-pair))
-       (t (goto-char close-pair)))))))
-
-(defun evil--flyspell-overlays-in-p (beg end)
-  (let ((ovs (overlays-in beg end))
-        done)
-    (while (and ovs (not done))
-      (when (flyspell-overlay-p (car ovs))
-        (setq done t))
-      (setq ovs (cdr ovs)))
-    done))
-
-(defun evil--flyspell-overlay-at (pos forwardp)
-  (when (not forwardp)
-    (setq pos (max (1- pos) (point-min))))
-  (let ((ovs (overlays-at pos))
-        done)
-    (while (and ovs (not done))
-      (if (flyspell-overlay-p (car ovs))
-          (setq done t)
-        (setq ovs (cdr ovs))))
-    (when done
-      (car ovs))))
-
-(defun evil--flyspell-overlay-after (pos limit forwardp)
-  (let (done)
-    (while (and (if forwardp
-                    (< pos limit)
-                  (> pos limit))
-                (not done))
-      (let ((ov (evil--flyspell-overlay-at pos forwardp)))
-        (when ov
-          (setq done ov)))
-      (setq pos (if forwardp
-                    (next-overlay-change pos)
-                  (previous-overlay-change pos))))
-    done))
-
-(defun evil--next-flyspell-error (forwardp)
-  (when (evil--flyspell-overlays-in-p (point-min) (point-max))
-    (let ((pos (point))
-          limit
-          ov)
-      (when (evil--flyspell-overlay-at pos forwardp)
-        (if (/= pos (point-min))
-            (setq pos (save-excursion (goto-char pos)
-                                      (forward-word (if forwardp 1 -1))
-                                      (point)))
-          (setq pos (point-max))))
-      (setq limit (if forwardp (point-max) (point-min))
-            ov (evil--flyspell-overlay-after pos limit forwardp))
-      (if ov
-          (goto-char (overlay-start ov))
-        (when evil-search-wrap
-          (setq limit pos
-                pos (if forwardp (point-min) (point-max))
-                ov (evil--flyspell-overlay-after pos limit forwardp))
-          (when ov
-            (goto-char (overlay-start ov))))))))
-
-(evil-define-motion evil-next-flyspell-error (count)
-  "Go to the COUNT'th spelling mistake after point."
-  (interactive "p")
-  (dotimes (_ count)
-    (evil--next-flyspell-error t)))
-
-(evil-define-motion evil-prev-flyspell-error (count)
-  "Go to the COUNT'th spelling mistake preceding point."
-  (interactive "p")
-  (dotimes (_ count)
-    (evil--next-flyspell-error nil)))
-
-(evil-define-motion evil-previous-open-paren (count)
-  "Go to [count] previous unmatched '('."
-  :type exclusive
-  (evil-up-paren ?( ?) (- (or count 1))))
-
-(evil-define-motion evil-next-close-paren (count)
-  "Go to [count] next unmatched ')'."
-  :type exclusive
-  (forward-char)
-  (evil-up-paren ?( ?) (or count 1))
-  (backward-char))
-
-(evil-define-motion evil-previous-open-brace (count)
-  "Go to [count] previous unmatched '{'."
-  :type exclusive
-  (evil-up-paren ?{ ?} (- (or count 1))))
-
-(evil-define-motion evil-next-close-brace (count)
-  "Go to [count] next unmatched '}'."
-  :type exclusive
-  (forward-char)
-  (evil-up-paren ?{ ?} (or count 1))
-  (backward-char))
-
-(evil-define-motion evil-find-char (count char)
-  "Move to the next COUNT'th occurrence of CHAR."
-  :type inclusive
-  (interactive "<c><C>")
-  (setq count (or count 1))
-  (let ((fwd (> count 0)))
-    (setq evil-last-find (list #'evil-find-char char fwd))
-    (when fwd (forward-char))
-    (let ((case-fold-search nil))
-      (unless (prog1
-                  (search-forward (char-to-string char)
-                                  (unless evil-cross-lines
-                                    (if fwd
-                                        (line-end-position)
-                                      (line-beginning-position)))
-                                  t count)
-                (when fwd (backward-char)))
-        (user-error "Can't find %c" char)))))
-
-(evil-define-motion evil-find-char-backward (count char)
-  "Move to the previous COUNT'th occurrence of CHAR."
-  :type exclusive
-  (interactive "<c><C>")
-  (evil-find-char (- (or count 1)) char))
-
-(evil-define-motion evil-find-char-to (count char)
-  "Move before the next COUNT'th occurrence of CHAR."
-  :type inclusive
-  (interactive "<c><C>")
-  (unwind-protect
-      (progn
-        (evil-find-char count char)
-        (if (> (or count 1) 0)
-            (backward-char)
-          (forward-char)))
-    (setcar evil-last-find #'evil-find-char-to)))
-
-(evil-define-motion evil-find-char-to-backward (count char)
-  "Move before the previous COUNT'th occurrence of CHAR."
-  :type exclusive
-  (interactive "<c><C>")
-  (evil-find-char-to (- (or count 1)) char))
-
-(evil-define-motion evil-repeat-find-char (count)
-  "Repeat the last find COUNT times."
-  :type inclusive
-  (setq count (or count 1))
-  (if evil-last-find
-      (let ((cmd (car evil-last-find))
-            (char (nth 1 evil-last-find))
-            (fwd (nth 2 evil-last-find))
-            evil-last-find)
-        ;; ensure count is non-negative
-        (when (< count 0)
-          (setq count (- count)
-                fwd (not fwd)))
-        ;; skip next character when repeating t or T
-        (and (eq cmd #'evil-find-char-to)
-             evil-repeat-find-to-skip-next
-             (= count 1)
-             (or (and fwd (= (char-after (1+ (point))) char))
-                 (and (not fwd) (= (char-before) char)))
-             (setq count (1+ count)))
-        (funcall cmd (if fwd count (- count)) char)
-        (unless (nth 2 evil-last-find)
-          (setq evil-this-type 'exclusive)))
-    (user-error "No previous search")))
-
-(evil-define-motion evil-repeat-find-char-reverse (count)
-  "Repeat the last find COUNT times in the opposite direction."
-  :type inclusive
-  (evil-repeat-find-char (- (or count 1))))
-
-;; ceci n'est pas une pipe
-(evil-define-motion evil-goto-column (count)
-  "Go to column COUNT on the current line.
-Columns are counted from zero."
-  :type exclusive
-  (move-to-column (or count 0)))
-
-(evil-define-command evil-goto-mark (char &optional noerror)
-  "Go to the marker specified by CHAR."
-  :keep-visual t
-  :repeat nil
-  :type exclusive
-  (interactive (list (read-char)))
-  (let ((marker (evil-get-marker char)))
-    (cond
-     ((markerp marker)
-      (switch-to-buffer (marker-buffer marker))
-      (goto-char (marker-position marker)))
-     ((numberp marker)
-      (goto-char marker))
-     ((consp marker)
-      (when (or (find-buffer-visiting (car marker))
-                (and (y-or-n-p (format "Visit file %s again? "
-                                       (car marker)))
-                     (find-file (car marker))))
-        (goto-char (cdr marker))))
-     ((not noerror)
-      (user-error "Marker `%c' is not set%s" char
-                  (if (evil-global-marker-p char) ""
-                    " in this buffer"))))))
-
-(evil-define-command evil-goto-mark-line (char &optional noerror)
-  "Go to the line of the marker specified by CHAR."
-  :keep-visual t
-  :repeat nil
-  :type line
-  (interactive (list (read-char)))
-  (evil-goto-mark char noerror)
-  (evil-first-non-blank))
-
-(evil-define-motion evil-jump-backward (count)
-  "Go to older position in jump list.
-To go the other way, press \
-\\<evil-motion-state-map>\\[evil-jump-forward]."
-  (evil--jump-backward count))
-
-(evil-define-motion evil-jump-forward (count)
-  "Go to newer position in jump list.
-To go the other way, press \
-\\<evil-motion-state-map>\\[evil-jump-backward]."
-  (evil--jump-forward count))
-
-(evil-define-motion evil-jump-backward-swap (count)
-  "Go to the previous position in jump list.
-The current position is placed in the jump list."
-  (let ((pnt (point)))
-    (evil--jump-backward 1)
-    (evil-set-jump pnt)))
-
-(evil-define-motion evil-jump-to-tag (arg)
-  "Jump to tag under point.
-If called with a prefix argument, provide a prompt
-for specifying the tag."
-  :jump t
-  (interactive "P")
-  (if arg (call-interactively #'find-tag)
-    (let ((tag (funcall (or find-tag-default-function
-                            (get major-mode 'find-tag-default-function)
-                            #'find-tag-default))))
-      (unless tag (user-error "No tag candidate found around point"))
-      (find-tag tag))))
-
-(evil-define-motion evil-lookup ()
-  "Look up the keyword at point.
-Calls `evil-lookup-func'."
-  (funcall evil-lookup-func))
-
-(defun evil-ret-gen (count indent?)
-  (let* ((field  (get-char-property (point) 'field))
-         (button (get-char-property (point) 'button))
-         (doc    (get-char-property (point) 'widget-doc))
-         (widget (or field button doc)))
-    (cond
-     ((and widget
-           (fboundp 'widget-type)
-           (fboundp 'widget-button-press)
-           (or (and (symbolp widget)
-                    (get widget 'widget-type))
-               (and (consp widget)
-                    (get (widget-type widget) 'widget-type))))
-      (when (evil-operator-state-p)
-        (setq evil-inhibit-operator t))
-      (when (fboundp 'widget-button-press)
-        (widget-button-press (point))))
-     ((and (fboundp 'button-at)
-           (fboundp 'push-button)
-           (button-at (point)))
-      (when (evil-operator-state-p)
-        (setq evil-inhibit-operator t))
-      (push-button))
-     ((or (evil-emacs-state-p)
-          (and (evil-insert-state-p)
-               (not buffer-read-only)))
-      (if (not indent?)
-          (newline count)
-        (delete-horizontal-space t)
-        (newline count)
-        (indent-according-to-mode)))
-     (t
-      (evil-next-line-first-non-blank count)))))
-
-(evil-define-motion evil-ret (count)
-  "Move the cursor COUNT lines down.
-If point is on a widget or a button, click on it.
-In Insert state, insert a newline."
-  :type line
-  (evil-ret-gen count nil))
-
-(evil-define-motion evil-ret-and-indent (count)
-  "Move the cursor COUNT lines down.
-If point is on a widget or a button, click on it.
-In Insert state, insert a newline and indent."
-  :type line
-  (evil-ret-gen count t))
-
-(evil-define-motion evil-window-top (count)
-  "Move the cursor to line COUNT from the top of the window
-on the first non-blank character."
-  :jump t
-  :type line
-  (move-to-window-line (max (or count 0)
-                            (if (= (point-min) (window-start))
-                                0
-                              scroll-margin)))
-  (back-to-indentation))
-
-(evil-define-motion evil-window-middle ()
-  "Move the cursor to the middle line in the window
-on the first non-blank character."
-  :jump t
-  :type line
-  (move-to-window-line
-   (/ (1+ (save-excursion (move-to-window-line -1))) 2))
-  (back-to-indentation))
-
-(evil-define-motion evil-window-bottom (count)
-  "Move the cursor to line COUNT from the bottom of the window
-on the first non-blank character."
-  :jump t
-  :type line
-  (move-to-window-line (- (max (or count 1) (1+ scroll-margin))))
-  (back-to-indentation))
-
-;; scrolling
-(evil-define-command evil-scroll-line-up (count)
-  "Scrolls the window COUNT lines upwards."
-  :repeat nil
-  :keep-visual t
-  (interactive "p")
-  (let ((scroll-preserve-screen-position nil))
-    (scroll-down count)))
-
-(evil-define-command evil-scroll-line-down (count)
-  "Scrolls the window COUNT lines downwards."
-  :repeat nil
-  :keep-visual t
-  (interactive "p")
-  (let ((scroll-preserve-screen-position nil))
-    (scroll-up count)))
-
-(evil-define-command evil-scroll-count-reset ()
-  "Sets `evil-scroll-count' to 0.
-`evil-scroll-up' and `evil-scroll-down' will scroll
-for a half of the screen(default)."
-  :repeat nil
-  :keep-visual t
-  (interactive)
-  (setq evil-scroll-count 0))
-
-(evil-define-command evil-scroll-up (count)
-  "Scrolls the window and the cursor COUNT lines upwards.
-If COUNT is not specified the function scrolls down
-`evil-scroll-count', which is the last used count.
-If the scroll count is zero the command scrolls half the screen."
-  :repeat nil
-  :keep-visual t
-  (interactive "<c>")
-  (evil-save-column
-    (setq count (or count (max 0 evil-scroll-count)))
-    (setq evil-scroll-count count)
-    (when (= (point-min) (line-beginning-position))
-      (signal 'beginning-of-buffer nil))
-    (when (zerop count)
-      (setq count (/ (1- (window-height)) 2)))
-    (let ((xy (posn-x-y (posn-at-point))))
-      (condition-case nil
-          (progn
-            (scroll-down count)
-            (goto-char (posn-point (posn-at-x-y (car xy) (cdr xy)))))
-        (beginning-of-buffer
-         (condition-case nil
-             (with-no-warnings (previous-line count))
-           (beginning-of-buffer)))))))
-
-(evil-define-command evil-scroll-down (count)
-  "Scrolls the window and the cursor COUNT lines downwards.
-If COUNT is not specified the function scrolls down
-`evil-scroll-count', which is the last used count.
-If the scroll count is zero the command scrolls half the screen."
-  :repeat nil
-  :keep-visual t
-  (interactive "<c>")
-  (evil-save-column
-    (setq count (or count (max 0 evil-scroll-count)))
-    (setq evil-scroll-count count)
-    (when (eobp) (signal 'end-of-buffer nil))
-    (when (zerop count)
-      (setq count (/ (1- (window-height)) 2)))
-    ;; BUG #660: First check whether the eob is visible.
-    ;; In that case we do not scroll but merely move point.
-    (if (<= (point-max) (window-end))
-        (with-no-warnings (next-line count nil))
-      (let ((xy (posn-x-y (posn-at-point))))
-        (condition-case nil
-            (progn
-              (scroll-up count)
-              (let* ((wend (window-end nil t))
-                     (p (posn-at-x-y (car xy) (cdr xy)))
-                     (margin (max 0 (- scroll-margin
-                                       (cdr (posn-col-row p))))))
-                (goto-char (posn-point p))
-                ;; ensure point is not within the scroll-margin
-                (when (> margin 0)
-                  (with-no-warnings (next-line margin))
-                  (recenter scroll-margin))
-                (when (<= (point-max) wend)
-                  (save-excursion
-                    (goto-char (point-max))
-                    (recenter (- (max 1 scroll-margin)))))))
-          (end-of-buffer
-           (goto-char (point-max))
-           (recenter (- (max 1 scroll-margin)))))))))
-
-(evil-define-command evil-scroll-page-up (count)
-  "Scrolls the window COUNT pages upwards."
-  :repeat nil
-  :keep-visual t
-  (interactive "p")
-  (evil-save-column
-    (dotimes (i count)
-      (condition-case err
-          (scroll-down nil)
-        (beginning-of-buffer
-         (if (and (bobp) (zerop i))
-             (signal (car err) (cdr err))
-           (goto-char (point-min))))))))
-
-(evil-define-command evil-scroll-page-down (count)
-  "Scrolls the window COUNT pages downwards."
-  :repeat nil
-  :keep-visual t
-  (interactive "p")
-  (evil-save-column
-    (dotimes (i count)
-      (condition-case err
-          (scroll-up nil)
-        (end-of-buffer
-         (if (and (eobp) (zerop i))
-             (signal (car err) (cdr err))
-           (goto-char (point-max))))))))
-
-(evil-define-command evil-scroll-line-to-top (count)
-  "Scrolls line number COUNT (or the cursor line) to the top of the window."
-  :repeat nil
-  :keep-visual t
-  (interactive "<c>")
-  (evil-save-column
-    (let ((line (or count (line-number-at-pos (point)))))
-      (goto-char (point-min))
-      (forward-line (1- line)))
-    (recenter (1- (max 1 scroll-margin)))))
-
-(evil-define-command evil-scroll-line-to-center (count)
-  "Scrolls line number COUNT (or the cursor line) to the center of the window."
-  :repeat nil
-  :keep-visual t
-  (interactive "<c>")
-  (evil-save-column
-    (when count
-      (goto-char (point-min))
-      (forward-line (1- count)))
-    (recenter nil)))
-
-(evil-define-command evil-scroll-line-to-bottom (count)
-  "Scrolls line number COUNT (or the cursor line) to the bottom of the window."
-  :repeat nil
-  :keep-visual t
-  (interactive "<c>")
-  (evil-save-column
-    (let ((line (or count (line-number-at-pos (point)))))
-      (goto-char (point-min))
-      (forward-line (1- line)))
-    (recenter (- (max 1 scroll-margin)))))
-
-(evil-define-command evil-scroll-bottom-line-to-top (count)
-  "Scrolls the line right below the window,
-or line COUNT to the top of the window."
-  :repeat nil
-  :keep-visual t
-  (interactive "<c>")
-  (if count
-      (progn
-        (goto-char (point-min))
-        (forward-line (1- count)))
-    (goto-char (window-end))
-    (evil-move-cursor-back))
-  (recenter (1- (max 0 scroll-margin)))
-  (evil-first-non-blank))
-
-(evil-define-command evil-scroll-top-line-to-bottom (count)
-  "Scrolls the line right below the window,
-or line COUNT to the top of the window."
-  :repeat nil
-  :keep-visual t
-  (interactive "<c>")
-  (if count
-      (progn
-        (goto-char (point-min))
-        (forward-line (1- count)))
-    (goto-char (window-start)))
-  (recenter (- (max 1 scroll-margin)))
-  (evil-first-non-blank))
-
-(evil-define-command evil-scroll-left (count)
-  "Scrolls the window COUNT half-screenwidths to the left."
-  :repeat nil
-  :keep-visual t
-  (interactive "p")
-  (evil-with-hproject-point-on-window
-    (scroll-right (* count (/ (window-width) 2)))))
-
-(evil-define-command evil-scroll-right (count)
-  "Scrolls the window COUNT half-screenwidths to the right."
-  :repeat nil
-  :keep-visual t
-  (interactive "p")
-  (evil-with-hproject-point-on-window
-    (scroll-left (* count (/ (window-width) 2)))))
-
-(evil-define-command evil-scroll-column-left (count)
-  "Scrolls the window COUNT columns to the left."
-  :repeat nil
-  :keep-visual t
-  (interactive "p")
-  (evil-with-hproject-point-on-window
-    (scroll-right count)))
-
-(evil-define-command evil-scroll-column-right (count)
-  "Scrolls the window COUNT columns to the right."
-  :repeat nil
-  :keep-visual t
-  (interactive "p")
-  (evil-with-hproject-point-on-window
-    (scroll-left count)))
-
-;;; Text objects
-
-;; Text objects are defined with `evil-define-text-object'. In Visual
-;; state, they modify the current selection; in Operator-Pending
-;; state, they return a pair of buffer positions. Outer text objects
-;; are bound in the keymap `evil-outer-text-objects-map', and inner
-;; text objects are bound in `evil-inner-text-objects-map'.
-;;
-;; Common text objects like words, WORDS, paragraphs and sentences are
-;; defined via a corresponding move-function. This function must have
-;; the following properties:
-;;
-;;   1. Take exactly one argument, the count.
-;;   2. When the count is positive, move point forward to the first
-;;      character after the end of the next count-th object.
-;;   3. When the count is negative, move point backward to the first
-;;      character of the count-th previous object.
-;;   4. If point is placed on the first character of an object, the
-;;      backward motion does NOT count that object.
-;;   5. If point is placed on the last character of an object, the
-;;      forward motion DOES count that object.
-;;   6. The return value is "count left", i.e., in forward direction
-;;      count is decreased by one for each successful move and in
-;;      backward direction count is increased by one for each
-;;      successful move, returning the final value of count.
-;;      Therefore, if the complete move is successful, the return
-;;      value is 0.
-;;
-;; A useful macro in this regard is `evil-motion-loop', which quits
-;; when point does not move further and returns the count difference.
-;; It also provides a "unit value" of 1 or -1 for use in each
-;; iteration. For example, a hypothetical "foo-bar" move could be
-;; written as such:
-;;
-;;     (defun foo-bar (count)
-;;       (evil-motion-loop (var count)
-;;         (forward-foo var) ; `var' is 1 or -1 depending on COUNT
-;;         (forward-bar var)))
-;;
-;; If "forward-foo" and "-bar" didn't accept negative arguments,
-;; we could choose their backward equivalents by inspecting `var':
-;;
-;;     (defun foo-bar (count)
-;;       (evil-motion-loop (var count)
-;;         (cond
-;;          ((< var 0)
-;;           (backward-foo 1)
-;;           (backward-bar 1))
-;;          (t
-;;           (forward-foo 1)
-;;           (forward-bar 1)))))
-;;
-;; After a forward motion, point has to be placed on the first
-;; character after some object, unless no motion was possible at all.
-;; Similarly, after a backward motion, point has to be placed on the
-;; first character of some object. This implies that point should
-;; NEVER be moved to eob or bob, unless an object ends or begins at
-;; eob or bob. (Usually, Emacs motions always move as far as possible.
-;; But we want to use the motion-function to identify certain objects
-;; in the buffer, and thus exact movement to object boundaries is
-;; required.)
-
-(evil-define-text-object evil-a-word (count &optional beg end type)
-  "Select a word."
-  (evil-select-an-object 'evil-word beg end type count))
-
-(evil-define-text-object evil-inner-word (count &optional beg end type)
-  "Select inner word."
-  (evil-select-inner-object 'evil-word beg end type count))
-
-(evil-define-text-object evil-a-WORD (count &optional beg end type)
-  "Select a WORD."
-  (evil-select-an-object 'evil-WORD beg end type count))
-
-(evil-define-text-object evil-inner-WORD (count &optional beg end type)
-  "Select inner WORD."
-  (evil-select-inner-object 'evil-WORD beg end type count))
-
-(evil-define-text-object evil-a-symbol (count &optional beg end type)
-  "Select a symbol."
-  (evil-select-an-object 'evil-symbol beg end type count))
-
-(evil-define-text-object evil-inner-symbol (count &optional beg end type)
-  "Select inner symbol."
-  (evil-select-inner-object 'evil-symbol beg end type count))
-
-(evil-define-text-object evil-a-sentence (count &optional beg end type)
-  "Select a sentence."
-  (evil-select-an-object 'evil-sentence beg end type count))
-
-(evil-define-text-object evil-inner-sentence (count &optional beg end type)
-  "Select inner sentence."
-  (evil-select-inner-object 'evil-sentence beg end type count))
-
-(evil-define-text-object evil-a-paragraph (count &optional beg end type)
-  "Select a paragraph."
-  :type line
-  (evil-select-an-object 'evil-paragraph beg end type count t))
-
-(evil-define-text-object evil-inner-paragraph (count &optional beg end type)
-  "Select inner paragraph."
-  :type line
-  (evil-select-inner-object 'evil-paragraph beg end type count t))
-
-(evil-define-text-object evil-a-paren (count &optional beg end type)
-  "Select a parenthesis."
-  :extend-selection nil
-  (evil-select-paren ?( ?) beg end type count t))
-
-(evil-define-text-object evil-inner-paren (count &optional beg end type)
-  "Select inner parenthesis."
-  :extend-selection nil
-  (evil-select-paren ?( ?) beg end type count))
-
-(evil-define-text-object evil-a-bracket (count &optional beg end type)
-  "Select a square bracket."
-  :extend-selection nil
-  (evil-select-paren ?\[ ?\] beg end type count t))
-
-(evil-define-text-object evil-inner-bracket (count &optional beg end type)
-  "Select inner square bracket."
-  :extend-selection nil
-  (evil-select-paren ?\[ ?\] beg end type count))
-
-(evil-define-text-object evil-a-curly (count &optional beg end type)
-  "Select a curly bracket (\"brace\")."
-  :extend-selection nil
-  (evil-select-paren ?{ ?} beg end type count t))
-
-(evil-define-text-object evil-inner-curly (count &optional beg end type)
-  "Select inner curly bracket (\"brace\")."
-  :extend-selection nil
-  (evil-select-paren ?{ ?} beg end type count))
-
-(evil-define-text-object evil-an-angle (count &optional beg end type)
-  "Select an angle bracket."
-  :extend-selection nil
-  (evil-select-paren ?< ?> beg end type count t))
-
-(evil-define-text-object evil-inner-angle (count &optional beg end type)
-  "Select inner angle bracket."
-  :extend-selection nil
-  (evil-select-paren ?< ?> beg end type count))
-
-(evil-define-text-object evil-a-single-quote (count &optional beg end type)
-  "Select a single-quoted expression."
-  :extend-selection t
-  (evil-select-quote ?' beg end type count t))
-
-(evil-define-text-object evil-inner-single-quote (count &optional beg end type)
-  "Select inner single-quoted expression."
-  :extend-selection nil
-  (evil-select-quote ?' beg end type count))
-
-(evil-define-text-object evil-a-double-quote (count &optional beg end type)
-  "Select a double-quoted expression."
-  :extend-selection t
-  (evil-select-quote ?\" beg end type count t))
-
-(evil-define-text-object evil-inner-double-quote (count &optional beg end type)
-  "Select inner double-quoted expression."
-  :extend-selection nil
-  (evil-select-quote ?\" beg end type count))
-
-(evil-define-text-object evil-a-back-quote (count &optional beg end type)
-  "Select a back-quoted expression."
-  :extend-selection t
-  (evil-select-quote ?\` beg end type count t))
-
-(evil-define-text-object evil-inner-back-quote (count &optional beg end type)
-  "Select inner back-quoted expression."
-  :extend-selection nil
-  (evil-select-quote ?\` beg end type count))
-
-(evil-define-text-object evil-a-tag (count &optional beg end type)
-  "Select a tag block."
-  :extend-selection nil
-  (evil-select-xml-tag beg end type count t))
-
-(evil-define-text-object evil-inner-tag (count &optional beg end type)
-  "Select inner tag block."
-  :extend-selection nil
-  (evil-select-xml-tag beg end type count))
-
-(evil-define-text-object evil-next-match (count &optional beg end type)
-  "Select next match."
-  (unless (and (boundp 'evil-search-module)
-               (eq evil-search-module 'evil-search))
-    (user-error "next-match text objects only work with Evil search module."))
-  (let ((pnt (point)))
-    (cond
-     ((eq evil-ex-search-direction 'forward)
-      (unless (eobp) (forward-char))
-      (evil-ex-search-previous 1)
-      (when (and (<= evil-ex-search-match-beg pnt)
-                 (> evil-ex-search-match-end pnt)
-                 (not (evil-visual-state-p)))
-        (setq count (1- count)))
-      (if (> count 0) (evil-ex-search-next count)))
-     (t
-      (unless (eobp) (forward-char))
-      (evil-ex-search-next count))))
-  ;; active visual state if command is executed in normal state
-  (when (evil-normal-state-p)
-    (evil-visual-select evil-ex-search-match-beg evil-ex-search-match-end 'inclusive +1 t))
-  (list evil-ex-search-match-beg evil-ex-search-match-end))
-
-(evil-define-text-object evil-previous-match (count &optional beg end type)
-  "Select next match."
-  (unless (and (boundp 'evil-search-module)
-               (eq evil-search-module 'evil-search))
-    (user-error "previous-match text objects only work with Evil search module."))
-  (let ((evil-ex-search-direction
-         (if (eq evil-ex-search-direction 'backward)
-             'forward
-           'backward)))
-    (evil-next-match count beg end type)))
-
-;;; Operator commands
-
-(evil-define-operator evil-yank (beg end type register yank-handler)
-  "Saves the characters in motion into the kill-ring."
-  :move-point nil
-  :repeat nil
-  (interactive "<R><x><y>")
-  (let ((evil-was-yanked-without-register
-         (and evil-was-yanked-without-register (not register))))
-    (cond
-     ((and (fboundp 'cua--global-mark-active)
-           (fboundp 'cua-copy-region-to-global-mark)
-           (cua--global-mark-active))
-      (cua-copy-region-to-global-mark beg end))
-     ((eq type 'block)
-      (evil-yank-rectangle beg end register yank-handler))
-     ((eq type 'line)
-      (evil-yank-lines beg end register yank-handler))
-     (t
-      (evil-yank-characters beg end register yank-handler)))))
-
-(evil-define-operator evil-yank-line (beg end type register)
-  "Saves whole lines into the kill-ring."
-  :motion evil-line
-  :move-point nil
-  (interactive "<R><x>")
-  (when (evil-visual-state-p)
-    (unless (memq type '(line block))
-      (let ((range (evil-expand beg end 'line)))
-        (setq beg (evil-range-beginning range)
-              end (evil-range-end range)
-              type (evil-type range))))
-    (evil-exit-visual-state))
-  (evil-yank beg end type register))
-
-(evil-define-operator evil-delete (beg end type register yank-handler)
-  "Delete text from BEG to END with TYPE.
-Save in REGISTER or in the kill-ring with YANK-HANDLER."
-  (interactive "<R><x><y>")
-  (unless register
-    (let ((text (filter-buffer-substring beg end)))
-      (unless (string-match-p "\n" text)
-        ;; set the small delete register
-        (evil-set-register ?- text))))
-  (let ((evil-was-yanked-without-register nil))
-    (evil-yank beg end type register yank-handler))
-  (cond
-   ((eq type 'block)
-    (evil-apply-on-block #'delete-region beg end nil))
-   ((and (eq type 'line)
-         (= end (point-max))
-         (or (= beg end)
-             (/= (char-before end) ?\n))
-         (/= beg (point-min))
-         (=  (char-before beg) ?\n))
-    (delete-region (1- beg) end))
-   (t
-    (delete-region beg end)))
-  ;; place cursor on beginning of line
-  (when (and (called-interactively-p 'any)
-             (eq type 'line))
-    (evil-first-non-blank)))
-
-(evil-define-operator evil-delete-line (beg end type register yank-handler)
-  "Delete to end of line."
-  :motion nil
-  :keep-visual t
-  (interactive "<R><x>")
-  ;; act linewise in Visual state
-  (let* ((beg (or beg (point)))
-         (end (or end beg)))
-    (when (evil-visual-state-p)
-      (unless (memq type '(line block))
-        (let ((range (evil-expand beg end 'line)))
-          (setq beg (evil-range-beginning range)
-                end (evil-range-end range)
-                type (evil-type range))))
-      (evil-exit-visual-state))
-    (cond
-     ((eq type 'block)
-      ;; equivalent to $d, i.e., we use the block-to-eol selection and
-      ;; call `evil-delete'. In this case we fake the call to
-      ;; `evil-end-of-line' by setting `temporary-goal-column' and
-      ;; `last-command' appropriately as `evil-end-of-line' would do.
-      (let ((temporary-goal-column most-positive-fixnum)
-            (last-command 'next-line))
-        (evil-delete beg end 'block register yank-handler)))
-     ((eq type 'line)
-      (evil-delete beg end type register yank-handler))
-     (t
-      (evil-delete beg (line-end-position) type register yank-handler)))))
-
-(evil-define-operator evil-delete-whole-line
-  (beg end type register yank-handler)
-  "Delete whole line."
-  :motion evil-line
-  (interactive "<R><x>")
-  (evil-delete beg end type register yank-handler))
-
-(evil-define-operator evil-delete-char (beg end type register)
-  "Delete next character."
-  :motion evil-forward-char
-  (interactive "<R><x>")
-  (evil-delete beg end type register))
-
-(evil-define-operator evil-delete-backward-char (beg end type register)
-  "Delete previous character."
-  :motion evil-backward-char
-  (interactive "<R><x>")
-  (evil-delete beg end type register))
-
-(evil-define-command evil-delete-backward-char-and-join (count)
-  "Delete previous character and join lines.
-If point is at the beginning of a line then the current line will
-be joined with the previous line if and only if
-`evil-backspace-join-lines'."
-  (interactive "p")
-  (if (or evil-backspace-join-lines (not (bolp)))
-      (call-interactively 'delete-backward-char)
-    (user-error "Beginning of line")))
-
-(evil-define-command evil-delete-backward-word ()
-  "Delete previous word."
-  (if (and (bolp) (not (bobp)))
-      (progn
-        (unless evil-backspace-join-lines (user-error "Beginning of line"))
-        (delete-char -1))
-    (delete-region (max
-                    (save-excursion
-                      (evil-backward-word-begin)
-                      (point))
-                    (line-beginning-position))
-                   (point))))
-
-(defun evil-ex-delete-or-yank (should-delete beg end type register count yank-handler)
-  "Execute evil-delete or evil-yank on the given region.
-If SHOULD-DELETE is t, evil-delete will be executed, otherwise
-evil-yank.
-The region specified by BEG and END will be adjusted if COUNT is
-given."
-  (when count
-    ;; with COUNT, the command should go the end of the region and delete/yank
-    ;; COUNT lines from there
-    (setq beg (save-excursion
-                (goto-char end)
-                (forward-line -1)
-                (point))
-          end (save-excursion
-                (goto-char end)
-                (point-at-bol count))
-          type 'line))
-  (funcall (if should-delete 'evil-delete 'evil-yank) beg end type register yank-handler))
-
-(evil-define-operator evil-ex-delete (beg end type register count yank-handler)
-  "The Ex delete command.
-\[BEG,END]delete [REGISTER] [COUNT]"
-  (interactive "<R><xc/><y>")
-  (evil-ex-delete-or-yank t beg end type register count yank-handler))
-
-(evil-define-operator evil-ex-yank (beg end type register count yank-handler)
-  "The Ex yank command.
-\[BEG,END]yank [REGISTER] [COUNT]"
-  (interactive "<R><xc/><y>")
-  (evil-ex-delete-or-yank nil beg end type register count yank-handler))
-
-(evil-define-operator evil-change
-  (beg end type register yank-handler delete-func)
-  "Change text from BEG to END with TYPE.
-Save in REGISTER or the kill-ring with YANK-HANDLER.
-DELETE-FUNC is a function for deleting text, default `evil-delete'.
-If TYPE is `line', insertion starts on an empty line.
-If TYPE is `block', the inserted text in inserted at each line
-of the block."
-  (interactive "<R><x><y>")
-  (let ((delete-func (or delete-func #'evil-delete))
-        (nlines (1+ (evil-count-lines beg end)))
-        (opoint (save-excursion
-                  (goto-char beg)
-                  (line-beginning-position))))
-    (unless (eq evil-want-fine-undo t)
-      (evil-start-undo-step))
-    (funcall delete-func beg end type register yank-handler)
-    (cond
-     ((eq type 'line)
-      (if ( = opoint (point))
-          (evil-open-above 1)
-        (evil-open-below 1)))
-     ((eq type 'block)
-      (evil-insert 1 nlines))
-     (t
-      (evil-insert 1)))))
-
-(evil-define-operator evil-change-line (beg end type register yank-handler)
-  "Change to end of line."
-  :motion evil-end-of-line
-  (interactive "<R><x><y>")
-  (evil-change beg end type register yank-handler #'evil-delete-line))
-
-(evil-define-operator evil-change-whole-line
-  (beg end type register yank-handler)
-  "Change whole line."
-  :motion evil-line
-  (interactive "<R><x>")
-  (evil-change beg end type register yank-handler #'evil-delete-whole-line))
-
-(evil-define-command evil-copy (beg end address)
-  "Copy lines in BEG END below line given by ADDRESS."
-  :motion evil-line
-  (interactive "<r><addr>")
-  (goto-char (point-min))
-  (forward-line address)
-  (let* ((txt (buffer-substring-no-properties beg end))
-         (len (length txt)))
-    ;; ensure text consists of complete lines
-    (when (or (zerop len) (/= (aref txt (1- len)) ?\n))
-      (setq txt (concat txt "\n")))
-    (when (and (eobp) (not (bolp))) (newline)) ; incomplete last line
-    (insert txt)
-    (forward-line -1)))
-
-(evil-define-command evil-move (beg end address)
-  "Move lines in BEG END below line given by ADDRESS."
-  :motion evil-line
-  (interactive "<r><addr>")
-  (goto-char (point-min))
-  (forward-line address)
-  (let* ((m (set-marker (make-marker) (point)))
-         (txt (buffer-substring-no-properties beg end))
-         (len (length txt)))
-    (delete-region beg end)
-    (goto-char m)
-    (set-marker m nil)
-    ;; ensure text consists of complete lines
-    (when (or (zerop len) (/= (aref txt (1- len)) ?\n))
-      (setq txt (concat txt "\n")))
-    (when (and (eobp) (not (bolp))) (newline)) ; incomplete last line
-    (when (evil-visual-state-p)
-      (move-marker evil-visual-mark (point)))
-    (insert txt)
-    (forward-line -1)
-    (when (evil-visual-state-p)
-      (move-marker evil-visual-point (point)))))
-
-(evil-define-operator evil-substitute (beg end type register)
-  "Change a character."
-  :motion evil-forward-char
-  (interactive "<R><x>")
-  (evil-change beg end type register))
-
-(evil-define-operator evil-upcase (beg end type)
-  "Convert text to upper case."
-  (if (eq type 'block)
-      (evil-apply-on-block #'evil-upcase beg end nil)
-    (upcase-region beg end)))
-
-(evil-define-operator evil-downcase (beg end type)
-  "Convert text to lower case."
-  (if (eq type 'block)
-      (evil-apply-on-block #'evil-downcase beg end nil)
-    (downcase-region beg end)))
-
-(evil-define-operator evil-invert-case (beg end type)
-  "Invert case of text."
-  (let (char)
-    (if (eq type 'block)
-        (evil-apply-on-block #'evil-invert-case beg end nil)
-      (save-excursion
-        (goto-char beg)
-        (while (< beg end)
-          (setq char (following-char))
-          (delete-char 1 nil)
-          (if (eq (upcase char) char)
-              (insert-char (downcase char) 1)
-            (insert-char (upcase char) 1))
-          (setq beg (1+ beg)))))))
-
-(evil-define-operator evil-invert-char (beg end type)
-  "Invert case of character."
-  :motion evil-forward-char
-  (if (eq type 'block)
-      (evil-apply-on-block #'evil-invert-case beg end nil)
-    (evil-invert-case beg end)
-    (when evil-this-motion
-      (goto-char end)
-      (when (and evil-cross-lines
-                 evil-move-cursor-back
-                 (not evil-move-beyond-eol)
-                 (not (evil-visual-state-p))
-                 (not (evil-operator-state-p))
-                 (eolp) (not (eobp)) (not (bolp)))
-        (forward-char)))))
-
-(evil-define-operator evil-rot13 (beg end type)
-  "ROT13 encrypt text."
-  (if (eq type 'block)
-      (evil-apply-on-block #'evil-rot13 beg end nil)
-    (rot13-region beg end)))
-
-(evil-define-operator evil-join (beg end)
-  "Join the selected lines."
-  :motion evil-line
-  (let ((count (count-lines beg end)))
-    (when (> count 1)
-      (setq count (1- count)))
-    (goto-char beg)
-    (dotimes (var count)
-      (join-line 1))))
-
-(evil-define-operator evil-join-whitespace (beg end)
-  "Join the selected lines without changing whitespace.
-\\<evil-normal-state-map>Like \\[evil-join], \
-but doesn't insert or remove any spaces."
-  :motion evil-line
-  (let ((count (count-lines beg end)))
-    (when (> count 1)
-      (setq count (1- count)))
-    (goto-char beg)
-    (dotimes (var count)
-      (evil-move-end-of-line 1)
-      (unless (eobp)
-        (delete-char 1)))))
-
-(evil-define-operator evil-ex-join (beg end &optional count bang)
-  "Join the selected lines with optional COUNT and BANG."
-  (interactive "<r><a><!>")
-  (if (and count (not (string-match-p "^[1-9][0-9]*$" count)))
-      (user-error "Invalid count")
-    (let ((join-fn (if bang 'evil-join-whitespace 'evil-join)))
-      (cond
-       ((not count)
-        ;; without count - just join the given region
-        (funcall join-fn beg end))
-       (t
-        ;; emulate vim's :join when count is given - start from the
-        ;; end of the region and join COUNT lines from there
-        (let* ((count-num (string-to-number count))
-               (beg-adjusted (save-excursion
-                               (goto-char end)
-                               (forward-line -1)
-                               (point)))
-               (end-adjusted (save-excursion
-                               (goto-char end)
-                               (point-at-bol count-num))))
-          (funcall join-fn beg-adjusted end-adjusted)))))))
-
-(evil-define-operator evil-fill (beg end)
-  "Fill text."
-  :move-point nil
-  :type line
-  (save-excursion
-    (condition-case nil
-        (fill-region beg end)
-      (error nil))))
-
-(evil-define-operator evil-fill-and-move (beg end)
-  "Fill text and move point to the end of the filled region."
-  :move-point nil
-  :type line
-  (let ((marker (make-marker)))
-    (move-marker marker (1- end))
-    (condition-case nil
-        (progn
-          (fill-region beg end)
-          (goto-char marker)
-          (evil-first-non-blank))
-      (error nil))))
-
-(evil-define-operator evil-indent (beg end)
-  "Indent text."
-  :move-point nil
-  :type line
-  (if (and (= beg (line-beginning-position))
-           (= end (line-beginning-position 2)))
-      ;; since some Emacs modes can only indent one line at a time,
-      ;; implement "==" as a call to `indent-according-to-mode'
-      (indent-according-to-mode)
-    (goto-char beg)
-    (indent-region beg end))
-  ;; We also need to tabify or untabify the leading white characters
-  (when evil-indent-convert-tabs
-    (let* ((beg-line (line-number-at-pos beg))
-           (end-line (line-number-at-pos end))
-           (ln beg-line)
-           (convert-white (if indent-tabs-mode 'tabify 'untabify)))
-      (save-excursion
-        (while (<= ln end-line)
-          (goto-char (point-min))
-          (forward-line (- ln 1))
-          (back-to-indentation)
-          ;; Whether tab or space should be used is determined by indent-tabs-mode
-          (funcall convert-white (line-beginning-position) (point))
-          (setq ln (1+ ln)))))
-    (back-to-indentation)))
-
-(evil-define-operator evil-indent-line (beg end)
-  "Indent the line."
-  :motion evil-line
-  (evil-indent beg end))
-
-(evil-define-operator evil-shift-left (beg end &optional count preserve-empty)
-  "Shift text from BEG to END to the left.
-The text is shifted to the nearest multiple of `evil-shift-width'
-\(the rounding can be disabled by setting `evil-shift-round').
-If PRESERVE-EMPTY is non-nil, lines that contain only spaces are
-indented, too, otherwise they are ignored.  The relative column
-of point is preserved if this function is not called
-interactively. Otherwise, if the function is called as an
-operator, point is moved to the first non-blank character.
-See also `evil-shift-right'."
-  :type line
-  (interactive "<r><vc>")
-  (evil-shift-right beg end (- (or count 1)) preserve-empty))
-
-(evil-define-operator evil-shift-right (beg end &optional count preserve-empty)
-  "Shift text from BEG to END to the right.
-The text is shifted to the nearest multiple of `evil-shift-width'
-\(the rounding can be disabled by setting `evil-shift-round').
-If PRESERVE-EMPTY is non-nil, lines that contain only spaces are
-indented, too, otherwise they are ignored.  The relative column
-of point is preserved if this function is not called
-interactively. Otherwise, if the function is called as an
-operator, point is moved to the first non-blank character.
-See also `evil-shift-left'."
-  :type line
-  (interactive "<r><vc>")
-  (setq count (or count 1))
-  (let ((beg (set-marker (make-marker) beg))
-        (end (set-marker (make-marker) end))
-        (pnt-indent (current-column))
-        first-shift) ; shift of first line
-    (save-excursion
-      (goto-char beg)
-      (while (< (point) end)
-        (let* ((indent (current-indentation))
-               (new-indent
-                (max 0
-                     (if (not evil-shift-round)
-                         (+ indent (* count evil-shift-width))
-                       (* (+ (/ indent evil-shift-width)
-                             count
-                             (cond
-                              ((> count 0) 0)
-                              ((zerop (mod indent evil-shift-width)) 0)
-                              (t 1)))
-                          evil-shift-width)))))
-          (unless first-shift
-            (setq first-shift (- new-indent indent)))
-          (when (or preserve-empty
-                    (save-excursion
-                      (skip-chars-forward " \t")
-                      (not (eolp))))
-            (indent-to new-indent 0))
-          (delete-region (point) (progn (skip-chars-forward " \t") (point)))
-          (forward-line 1))))
-    ;; assuming that point is in the first line, adjust its position
-    (if (called-interactively-p 'any)
-        (evil-first-non-blank)
-      (move-to-column (max 0 (+ pnt-indent first-shift))))))
-
-(evil-define-command evil-shift-right-line (count)
-  "Shift the current line COUNT times to the right.
-The text is shifted to the nearest multiple of
-`evil-shift-width'. Like `evil-shift-right' but always works on
-the current line."
-  (interactive "<c>")
-  (evil-shift-right (line-beginning-position) (line-beginning-position 2) count t))
-
-(evil-define-command evil-shift-left-line (count)
-  "Shift the current line COUNT times to the left.
-The text is shifted to the nearest multiple of
-`evil-shift-width'. Like `evil-shift-left' but always works on
-the current line."
-  (interactive "<c>")
-  (evil-shift-left (line-beginning-position) (line-beginning-position 2) count t))
-
-(evil-define-operator evil-align-left (beg end type &optional width)
-  "Right-align lines in the region at WIDTH columns.
-The default for width is the value of `fill-column'."
-  :motion evil-line
-  :type line
-  (interactive "<R><a>")
-  (evil-justify-lines beg end 'left (if width
-                                        (string-to-number width)
-                                      0)))
-
-(evil-define-operator evil-align-right (beg end type &optional width)
-  "Right-align lines in the region at WIDTH columns.
-The default for width is the value of `fill-column'."
-  :motion evil-line
-  :type line
-  (interactive "<R><a>")
-  (evil-justify-lines beg end 'right (if width
-                                         (string-to-number width)
-                                       fill-column)))
-
-(evil-define-operator evil-align-center (beg end type &optional width)
-  "Centers lines in the region between WIDTH columns.
-The default for width is the value of `fill-column'."
-  :motion evil-line
-  :type line
-  (interactive "<R><a>")
-  (evil-justify-lines beg end 'center (if width
-                                          (string-to-number width)
-                                        fill-column)))
-
-(evil-define-operator evil-replace (beg end type char)
-  "Replace text from BEG to END with CHAR."
-  :motion evil-forward-char
-  (interactive "<R>"
-               (unwind-protect
-                   (let ((evil-force-cursor 'replace))
-                     (evil-refresh-cursor)
-                     (list (evil-read-key)))
-                 (evil-refresh-cursor)))
-  (when char
-    (if (eq type 'block)
-        (save-excursion
-          (evil-apply-on-rectangle
-           #'(lambda (begcol endcol char)
-               (let ((maxcol (evil-column (line-end-position))))
-                 (when (< begcol maxcol)
-                   (setq endcol (min endcol maxcol))
-                   (let ((beg (evil-move-to-column begcol nil t))
-                         (end (evil-move-to-column endcol nil t)))
-                     (delete-region beg end)
-                     (insert (make-string (- endcol begcol) char))))))
-           beg end char))
-      (goto-char beg)
-      (cond
-       ((eq char ?\n)
-        (delete-region beg end)
-        (newline)
-        (when evil-auto-indent
-          (indent-according-to-mode)))
-       (t
-        (while (< (point) end)
-          (if (eq (char-after) ?\n)
-              (forward-char)
-            (delete-char 1)
-            (insert-char char 1)))
-        (goto-char (max beg (1- end))))))))
-
-(evil-define-command evil-paste-before
-  (count &optional register yank-handler)
-  "Pastes the latest yanked text before the cursor position.
-The return value is the yanked text."
-  :suppress-operator t
-  (interactive "P<x>")
-  (if (evil-visual-state-p)
-      (evil-visual-paste count register)
-    (evil-with-undo
-      (let* ((text (if register
-                       (evil-get-register register)
-                     (current-kill 0)))
-             (yank-handler (or yank-handler
-                               (when (stringp text)
-                                 (car-safe (get-text-property
-                                            0 'yank-handler text)))))
-             (opoint (point)))
-        (when text
-          (if (functionp yank-handler)
-              (let ((evil-paste-count count)
-                    ;; for non-interactive use
-                    (this-command #'evil-paste-before))
-                (push-mark opoint t)
-                (insert-for-yank text))
-            ;; no yank-handler, default
-            (when (vectorp text)
-              (setq text (evil-vector-to-string text)))
-            (set-text-properties 0 (length text) nil text)
-            (push-mark opoint t)
-            (dotimes (i (or count 1))
-              (insert-for-yank text))
-            (setq evil-last-paste
-                  (list #'evil-paste-before
-                        count
-                        opoint
-                        opoint    ; beg
-                        (point))) ; end
-            (evil-set-marker ?\[ opoint)
-            (evil-set-marker ?\] (1- (point)))
-            (when (and evil-move-cursor-back
-                       (> (length text) 0))
-              (backward-char))))
-        ;; no paste-pop after pasting from a register
-        (when register
-          (setq evil-last-paste nil))
-        (and (> (length text) 0) text)))))
-
-(evil-define-command evil-paste-after
-  (count &optional register yank-handler)
-  "Pastes the latest yanked text behind point.
-The return value is the yanked text."
-  :suppress-operator t
-  (interactive "P<x>")
-  (if (evil-visual-state-p)
-      (evil-visual-paste count register)
-    (evil-with-undo
-      (let* ((text (if register
-                       (evil-get-register register)
-                     (current-kill 0)))
-             (yank-handler (or yank-handler
-                               (when (stringp text)
-                                 (car-safe (get-text-property
-                                            0 'yank-handler text)))))
-             (opoint (point)))
-        (when text
-          (if (functionp yank-handler)
-              (let ((evil-paste-count count)
-                    ;; for non-interactive use
-                    (this-command #'evil-paste-after))
-                (insert-for-yank text))
-            ;; no yank-handler, default
-            (when (vectorp text)
-              (setq text (evil-vector-to-string text)))
-            (set-text-properties 0 (length text) nil text)
-            (unless (eolp) (forward-char))
-            (push-mark (point) t)
-            ;; TODO: Perhaps it is better to collect a list of all
-            ;; (point . mark) pairs to undo the yanking for COUNT > 1.
-            ;; The reason is that this yanking could very well use
-            ;; `yank-handler'.
-            (let ((beg (point)))
-              (dotimes (i (or count 1))
-                (insert-for-yank text))
-              (setq evil-last-paste
-                    (list #'evil-paste-after
-                          count
-                          opoint
-                          beg       ; beg
-                          (point))) ; end
-              (evil-set-marker ?\[ beg)
-              (evil-set-marker ?\] (1- (point)))
-              (when (evil-normal-state-p)
-                (evil-move-cursor-back)))))
-        (when register
-          (setq evil-last-paste nil))
-        (and (> (length text) 0) text)))))
-
-(evil-define-command evil-visual-paste (count &optional register)
-  "Paste over Visual selection."
-  :suppress-operator t
-  (interactive "P<x>")
-  ;; evil-visual-paste is typically called from evil-paste-before or
-  ;; evil-paste-after, but we have to mark that the paste was from
-  ;; visual state
-  (setq this-command 'evil-visual-paste)
-  (let* ((text (if register
-                   (evil-get-register register)
-                 (current-kill 0)))
-         (yank-handler (car-safe (get-text-property
-                                  0 'yank-handler text)))
-         new-kill
-         paste-eob)
-    (evil-with-undo
-      (let* ((kill-ring (list (current-kill 0)))
-             (kill-ring-yank-pointer kill-ring))
-        (when (evil-visual-state-p)
-          (evil-visual-rotate 'upper-left)
-          ;; if we replace the last buffer line that does not end in a
-          ;; newline, we use `evil-paste-after' because `evil-delete'
-          ;; will move point to the line above
-          (when (and (= evil-visual-end (point-max))
-                     (/= (char-before (point-max)) ?\n))
-            (setq paste-eob t))
-          (evil-delete evil-visual-beginning evil-visual-end
-                       (evil-visual-type))
-          (when (and (eq yank-handler #'evil-yank-line-handler)
-                     (not (eq (evil-visual-type) 'line))
-                     (not (= evil-visual-end (point-max))))
-            (insert "\n"))
-          (evil-normal-state)
-          (setq new-kill (current-kill 0))
-          (current-kill 1))
-        (if paste-eob
-            (evil-paste-after count register)
-          (evil-paste-before count register)))
-      (when evil-kill-on-visual-paste
-        (kill-new new-kill))
-      ;; mark the last paste as visual-paste
-      (setq evil-last-paste
-            (list (nth 0 evil-last-paste)
-                  (nth 1 evil-last-paste)
-                  (nth 2 evil-last-paste)
-                  (nth 3 evil-last-paste)
-                  (nth 4 evil-last-paste)
-                  t)))))
-
-(defun evil-paste-from-register (register)
-  "Paste from REGISTER."
-  (interactive
-   (let ((overlay (make-overlay (point) (point)))
-         (string "\""))
-     (unwind-protect
-         (progn
-           ;; display " in the buffer while reading register
-           (put-text-property 0 1 'face 'minibuffer-prompt string)
-           (put-text-property 0 1 'cursor t string)
-           (overlay-put overlay 'after-string string)
-           (list (or evil-this-register (read-char))))
-       (delete-overlay overlay))))
-  (when (evil-paste-before nil register t)
-    ;; go to end of pasted text
-    (unless (eobp)
-      (forward-char))))
-
-(defun evil-paste-last-insertion ()
-  "Paste last insertion."
-  (interactive)
-  (evil-paste-from-register ?.))
-
-(evil-define-command evil-use-register (register)
-  "Use REGISTER for the next command."
-  :keep-visual t
-  :repeat ignore
-  (interactive "<C>")
-  (setq evil-this-register register))
-
-(defvar evil-macro-buffer nil
-  "The buffer that has been active on macro recording.")
-
-(defun evil-abort-macro ()
-  "Abort macro recording when the buffer is changed.
-Macros are aborted when the the current buffer
-is changed during macro recording."
-  (unless (or (minibufferp) (eq (current-buffer) evil-macro-buffer))
-    (remove-hook 'post-command-hook #'evil-abort-macro)
-    (end-kbd-macro)
-    (message "Abort macro recording (changed buffer)")))
-
-(evil-define-command evil-record-macro (register)
-  "Record a keyboard macro into REGISTER.
-If REGISTER is :, /, or ?, the corresponding command line window
-will be opened instead."
-  :keep-visual t
-  :suppress-operator t
-  (interactive
-   (list (unless (and evil-this-macro defining-kbd-macro)
-           (or evil-this-register (evil-read-key)))))
-  (cond
-   ((eq register ?\C-g)
-    (keyboard-quit))
-   ((and evil-this-macro defining-kbd-macro)
-    (remove-hook 'post-command-hook #'evil-abort-macro)
-    (setq evil-macro-buffer nil)
-    (condition-case nil
-        (end-kbd-macro)
-      (error nil))
-    (when last-kbd-macro
-      (when (member last-kbd-macro '("" []))
-        (setq last-kbd-macro nil))
-      (evil-set-register evil-this-macro last-kbd-macro))
-    (setq evil-this-macro nil))
-   ((eq register ?:)
-    (evil-command-window-ex))
-   ((eq register ?/)
-    (evil-command-window-search-forward))
-   ((eq register ??)
-    (evil-command-window-search-backward))
-   ((or (and (>= register ?0) (<= register ?9))
-        (and (>= register ?a) (<= register ?z))
-        (and (>= register ?A) (<= register ?Z)))
-    (when defining-kbd-macro (end-kbd-macro))
-    (setq evil-this-macro register)
-    (evil-set-register evil-this-macro nil)
-    (start-kbd-macro nil)
-    (setq evil-macro-buffer (current-buffer))
-    (add-hook 'post-command-hook #'evil-abort-macro))
-   (t (error "Invalid register"))))
-
-(evil-define-command evil-execute-macro (count macro)
-  "Execute keyboard macro MACRO, COUNT times.
-When called with a non-numerical prefix \
-\(such as \\[universal-argument]),
-COUNT is infinite. MACRO is read from a register
-when called interactively."
-  :keep-visual t
-  :suppress-operator t
-  (interactive
-   (let (count macro register)
-     (setq count (if current-prefix-arg
-                     (if (numberp current-prefix-arg)
-                         current-prefix-arg
-                       0) 1)
-           register (or evil-this-register (read-char)))
-     (cond
-      ((or (and (eq register ?@) (eq evil-last-register ?:))
-           (eq register ?:))
-       (setq macro (lambda () (evil-ex-repeat nil))
-             evil-last-register ?:))
-      ((eq register ?@)
-       (unless evil-last-register
-         (user-error "No previously executed keyboard macro."))
-       (setq macro (evil-get-register evil-last-register t)))
-      (t
-       (setq macro (evil-get-register register t)
-             evil-last-register register)))
-     (list count macro)))
-  (cond
-   ((functionp macro)
-    (evil-repeat-abort)
-    (dotimes (i (or count 1))
-      (funcall macro)))
-   ((or (and (not (stringp macro))
-             (not (vectorp macro)))
-        (member macro '("" [])))
-    ;; allow references to currently empty registers
-    ;; when defining macro
-    (unless evil-this-macro
-      (user-error "No previous macro")))
-   (t
-    (condition-case err
-        (evil-with-single-undo
-          (execute-kbd-macro macro count))
-      ;; enter Normal state if the macro fails
-      (error
-       (evil-normal-state)
-       (evil-normalize-keymaps)
-       (signal (car err) (cdr err)))))))
-
-;;; Visual commands
-
-(evil-define-motion evil-visual-restore ()
-  "Restore previous selection."
-  (let* ((point (point))
-         (mark (or (mark t) point))
-         (dir evil-visual-direction)
-         (type (evil-visual-type))
-         range)
-    (unless (evil-visual-state-p)
-      (cond
-       ;; No previous selection.
-       ((or (null evil-visual-selection)
-            (null evil-visual-mark)
-            (null evil-visual-point)))
-       ;; If the type was one-to-one, it is preferable to infer
-       ;; point and mark from the selection's boundaries. The reason
-       ;; is that a destructive operation may displace the markers
-       ;; inside the selection.
-       ((evil-type-property type :one-to-one)
-        (setq range (evil-contract-range (evil-visual-range))
-              mark (evil-range-beginning range)
-              point (evil-range-end range))
-        (when (< dir 0)
-          (evil-swap mark point)))
-       ;; If the type wasn't one-to-one, we have to restore the
-       ;; selection on the basis of the previous point and mark.
-       (t
-        (setq mark evil-visual-mark
-              point evil-visual-point)))
-      (evil-visual-make-selection mark point type t))))
-
-(evil-define-motion evil-visual-exchange-corners ()
-  "Rearrange corners in Visual Block mode.
-
-        M---+           +---M
-        |   |    <=>    |   |
-        +---P           P---+
-
-For example, if mark is in the upper left corner and point
-in the lower right, this function puts mark in the upper right
-corner and point in the lower left."
-  (cond
-   ((eq evil-visual-selection 'block)
-    (let* ((point (point))
-           (mark (or (mark t) point))
-           (point-col (evil-column point))
-           (mark-col (evil-column mark))
-           (mark (save-excursion
-                   (goto-char mark)
-                   (evil-move-to-column point-col)
-                   (point)))
-           (point (save-excursion
-                    (goto-char point)
-                    (evil-move-to-column mark-col)
-                    (point))))
-      (evil-visual-refresh mark point)))
-   (t
-    (evil-exchange-point-and-mark)
-    (evil-visual-refresh))))
-
-(evil-define-command evil-visual-rotate (corner &optional beg end type)
-  "In Visual Block selection, put point in CORNER.
-Corner may be one of `upper-left', `upper-right', `lower-left'
-and `lower-right':
-
-        upper-left +---+ upper-right
-                   |   |
-        lower-left +---+ lower-right
-
-When called interactively, the selection is rotated blockwise."
-  :keep-visual t
-  (interactive
-   (let ((corners '(upper-left upper-right lower-right lower-left)))
-     (list (or (cadr (memq (evil-visual-block-corner) corners))
-               'upper-left))))
-  (let* ((beg (or beg (point)))
-         (end (or end (mark t) beg))
-         (type (or type evil-this-type))
-         range)
-    (cond
-     ((memq type '(rectangle block))
-      (setq range (evil-block-rotate beg end :corner corner)
-            beg (pop range)
-            end (pop range))
-      (unless (eq corner (evil-visual-block-corner corner beg end))
-        (evil-swap beg end))
-      (goto-char beg)
-      (when (evil-visual-state-p)
-        (evil-move-mark end)
-        (evil-visual-refresh nil nil nil :corner corner)))
-     ((memq corner '(upper-right lower-right))
-      (goto-char (max beg end))
-      (when (evil-visual-state-p)
-        (evil-move-mark (min beg end))))
-     (t
-      (goto-char (min beg end))
-      (when (evil-visual-state-p)
-        (evil-move-mark (max beg end)))))))
-
-;;; Insertion commands
-
-(defun evil-insert (count &optional vcount skip-empty-lines)
-  "Switch to Insert state just before point.
-The insertion will be repeated COUNT times and repeated once for
-the next VCOUNT - 1 lines starting at the same column.
-If SKIP-EMPTY-LINES is non-nil, the insertion will not be performed
-on lines on which the insertion point would be after the end of the
-lines.  This is the default behaviour for Visual-state insertion."
-  (interactive
-   (list (prefix-numeric-value current-prefix-arg)
-         (and (evil-visual-state-p)
-              (memq (evil-visual-type) '(line block))
-              (save-excursion
-                (let ((m (mark)))
-                  ;; go to upper-left corner temporarily so
-                  ;; `count-lines' yields accurate results
-                  (evil-visual-rotate 'upper-left)
-                  (prog1 (count-lines evil-visual-beginning evil-visual-end)
-                    (set-mark m)))))
-         (evil-visual-state-p)))
-  (if (and (called-interactively-p 'any)
-           (evil-visual-state-p))
-      (cond
-       ((eq (evil-visual-type) 'line)
-        (evil-visual-rotate 'upper-left)
-        (evil-insert-line count vcount))
-       ((eq (evil-visual-type) 'block)
-        (let ((column (min (evil-column evil-visual-beginning)
-                           (evil-column evil-visual-end))))
-          (evil-visual-rotate 'upper-left)
-          (move-to-column column t)
-          (evil-insert count vcount skip-empty-lines)))
-       (t
-        (evil-visual-rotate 'upper-left)
-        (evil-insert count vcount skip-empty-lines)))
-    (setq evil-insert-count count
-          evil-insert-lines nil
-          evil-insert-vcount (and vcount
-                                  (> vcount 1)
-                                  (list (line-number-at-pos)
-                                        (current-column)
-                                        vcount))
-          evil-insert-skip-empty-lines skip-empty-lines)
-    (evil-insert-state 1)))
-
-(defun evil-append (count &optional vcount skip-empty-lines)
-  "Switch to Insert state just after point.
-The insertion will be repeated COUNT times and repeated once for
-the next VCOUNT - 1 lines starting at the same column.  If
-SKIP-EMPTY-LINES is non-nil, the insertion will not be performed
-on lines on which the insertion point would be after the end of
-the lines."
-  (interactive
-   (list (prefix-numeric-value current-prefix-arg)
-         (and (evil-visual-state-p)
-              (memq (evil-visual-type) '(line block))
-              (save-excursion
-                (let ((m (mark)))
-                  ;; go to upper-left corner temporarily so
-                  ;; `count-lines' yields accurate results
-                  (evil-visual-rotate 'upper-left)
-                  (prog1 (count-lines evil-visual-beginning evil-visual-end)
-                    (set-mark m)))))))
-  (if (and (called-interactively-p 'any)
-           (evil-visual-state-p))
-      (cond
-       ((or (eq (evil-visual-type) 'line)
-            (and (eq (evil-visual-type) 'block)
-                 (memq last-command '(next-line previous-line))
-                 (numberp temporary-goal-column)
-                 (= temporary-goal-column most-positive-fixnum)))
-        (evil-visual-rotate 'upper-left)
-        (evil-append-line count vcount))
-       ((eq (evil-visual-type) 'block)
-        (let ((column (max (evil-column evil-visual-beginning)
-                           (evil-column evil-visual-end))))
-          (evil-visual-rotate 'upper-left)
-          (move-to-column column t)
-          (evil-insert count vcount skip-empty-lines)))
-       (t
-        (evil-visual-rotate 'lower-right)
-        (evil-append count)))
-    (unless (eolp) (forward-char))
-    (evil-insert count vcount skip-empty-lines)
-    (add-hook 'post-command-hook #'evil-maybe-remove-spaces)))
-
-(defun evil-insert-resume (count)
-  "Switch to Insert state at previous insertion point.
-The insertion will be repeated COUNT times. If called from visual
-state, only place point at the previous insertion position but do not
-switch to insert state."
-  (interactive "p")
-  (evil-goto-mark ?^ t)
-  (unless (evil-visual-state-p)
-    (evil-insert count)))
-
-(defun evil-open-above (count)
-  "Insert a new line above point and switch to Insert state.
-The insertion will be repeated COUNT times."
-  (interactive "p")
-  (unless (eq evil-want-fine-undo t)
-    (evil-start-undo-step))
-  (evil-insert-newline-above)
-  (setq evil-insert-count count
-        evil-insert-lines t
-        evil-insert-vcount nil)
-  (evil-insert-state 1)
-  (when evil-auto-indent
-    (indent-according-to-mode)))
-
-(defun evil-open-below (count)
-  "Insert a new line below point and switch to Insert state.
-The insertion will be repeated COUNT times."
-  (interactive "p")
-  (unless (eq evil-want-fine-undo t)
-    (evil-start-undo-step))
-  (push (point) buffer-undo-list)
-  (evil-insert-newline-below)
-  (setq evil-insert-count count
-        evil-insert-lines t
-        evil-insert-vcount nil)
-  (evil-insert-state 1)
-  (when evil-auto-indent
-    (indent-according-to-mode)))
-
-(defun evil-insert-line (count &optional vcount)
-  "Switch to insert state at beginning of current line.
-Point is placed at the first non-blank character on the current
-line.  The insertion will be repeated COUNT times.  If VCOUNT is
-non nil it should be number > 0. The insertion will be repeated
-in the next VCOUNT - 1 lines below the current one."
-  (interactive "p")
-  (push (point) buffer-undo-list)
-  (back-to-indentation)
-  (setq evil-insert-count count
-        evil-insert-lines nil
-        evil-insert-vcount
-        (and vcount
-             (> vcount 1)
-             (list (line-number-at-pos)
-                   #'evil-first-non-blank
-                   vcount)))
-  (evil-insert-state 1))
-
-(defun evil-append-line (count &optional vcount)
-  "Switch to Insert state at the end of the current line.
-The insertion will be repeated COUNT times.  If VCOUNT is non nil
-it should be number > 0. The insertion will be repeated in the
-next VCOUNT - 1 lines below the current one."
-  (interactive "p")
-  (evil-move-end-of-line)
-  (setq evil-insert-count count
-        evil-insert-lines nil
-        evil-insert-vcount
-        (and vcount
-             (> vcount 1)
-             (list (line-number-at-pos)
-                   #'end-of-line
-                   vcount)))
-  (evil-insert-state 1))
-
-(evil-define-command evil-insert-digraph (count)
-  "Insert COUNT digraphs."
-  :repeat change
-  (interactive "p")
-  (let ((digraph (evil-read-digraph-char 0)))
-    (insert-char digraph count)))
-
-(evil-define-command evil-ex-show-digraphs ()
-  "Shows a list of all available digraphs."
-  :repeat nil
-  (let ((columns 3))
-    (evil-with-view-list
-      :name "evil-digraphs"
-      :mode-name "Evil Digraphs"
-      :format
-      (cl-loop repeat columns
-               vconcat [("Digraph" 8 nil)
-                        ("Sequence" 16 nil)])
-      :entries
-      (let* ((digraphs (mapcar #'(lambda (digraph)
-                                   (cons (cdr digraph)
-                                         (car digraph)))
-                               (append evil-digraphs-table
-                                       evil-digraphs-table-user)))
-             (entries (cl-loop for digraph in digraphs
-                               collect `(,(concat (char-to-string (nth 1 digraph))
-                                                  (char-to-string (nth 2 digraph)))
-                                         ,(char-to-string (nth 0 digraph)))))
-             (row)
-             (rows)
-             (clength (* columns 2)))
-        (cl-loop for e in entries
-                 do
-                 (push (nth 0 e) row)
-                 (push (nth 1 e) row)
-                 (when (eq (length row) clength)
-                   (push `(nil ,(apply #'vector row)) rows)
-                   (setq row nil)))
-        rows))))
-
-(defun evil--self-insert-string (string)
-  "Insert STRING as if typed interactively."
-  (let ((chars (append string nil)))
-    (dolist (char chars)
-      (let ((last-command-event char))
-        (self-insert-command 1)))))
-
-(defun evil-copy-from-above (arg)
-  "Copy characters from preceding non-blank line.
-The copied text is inserted before point.
-ARG is the number of lines to move backward.
-See also \\<evil-insert-state-map>\\[evil-copy-from-below]."
-  (interactive
-   (cond
-    ;; if a prefix argument was given, repeat it for subsequent calls
-    ((and (null current-prefix-arg)
-          (eq last-command #'evil-copy-from-above))
-     (setq current-prefix-arg last-prefix-arg)
-     (list (prefix-numeric-value current-prefix-arg)))
-    (t
-     (list (prefix-numeric-value current-prefix-arg)))))
-  (evil--self-insert-string (evil-copy-chars-from-line arg -1)))
-
-(defun evil-copy-from-below (arg)
-  "Copy characters from following non-blank line.
-The copied text is inserted before point.
-ARG is the number of lines to move forward.
-See also \\<evil-insert-state-map>\\[evil-copy-from-above]."
-  (interactive
-   (cond
-    ((and (null current-prefix-arg)
-          (eq last-command #'evil-copy-from-below))
-     (setq current-prefix-arg last-prefix-arg)
-     (list (prefix-numeric-value current-prefix-arg)))
-    (t
-     (list (prefix-numeric-value current-prefix-arg)))))
-  (evil--self-insert-string (evil-copy-chars-from-line arg 1)))
-
-;; adapted from `copy-from-above-command' in misc.el
-(defun evil-copy-chars-from-line (n num &optional col)
-  "Return N characters from line NUM, starting at column COL.
-NUM is relative to the current line and can be negative.
-COL defaults to the current column."
-  (interactive "p")
-  (let ((col (or col (current-column))) prefix)
-    (save-excursion
-      (forward-line num)
-      (when (looking-at "[[:space:]]*$")
-        (if (< num 0)
-            (skip-chars-backward " \t\n")
-          (skip-chars-forward " \t\n")))
-      (evil-move-beginning-of-line)
-      (move-to-column col)
-      ;; if the column winds up in middle of a tab,
-      ;; return the appropriate number of spaces
-      (when (< col (current-column))
-        (if (eq (preceding-char) ?\t)
-            (let ((len (min n (- (current-column) col))))
-              (setq prefix (make-string len ?\s)
-                    n (- n len)))
-          ;; if in middle of a control char, return the whole char
-          (backward-char 1)))
-      (concat prefix
-              (buffer-substring (point)
-                                (min (line-end-position)
-                                     (+ n (point))))))))
-
-;; completion
-(evil-define-command evil-complete-next (&optional arg)
-  "Complete to the nearest following word.
-Search backward if a match isn't found.
-Calls `evil-complete-next-func'."
-  :repeat change
-  (interactive "P")
-  (if (minibufferp)
-      (funcall evil-complete-next-minibuffer-func)
-    (funcall evil-complete-next-func arg)))
-
-(evil-define-command evil-complete-previous (&optional arg)
-  "Complete to the nearest preceding word.
-Search forward if a match isn't found.
-Calls `evil-complete-previous-func'."
-  :repeat change
-  (interactive "P")
-  (if (minibufferp)
-      (funcall evil-complete-previous-minibuffer-func)
-    (funcall evil-complete-previous-func arg)))
-
-(evil-define-command evil-complete-next-line (&optional arg)
-  "Complete a whole line.
-Calls `evil-complete-next-line-func'."
-  :repeat change
-  (interactive "P")
-  (if (minibufferp)
-      (funcall evil-complete-next-minibuffer-func)
-    (funcall evil-complete-next-line-func arg)))
-
-(evil-define-command evil-complete-previous-line (&optional arg)
-  "Complete a whole line.
-Calls `evil-complete-previous-line-func'."
-  :repeat change
-  (interactive "P")
-  (if (minibufferp)
-      (funcall evil-complete-previous-minibuffer-func)
-    (funcall evil-complete-previous-line-func arg)))
-
-;;; Search
-
-(defun evil-repeat-search (flag)
-  "Called to record a search command.
-FLAG is either 'pre or 'post if the function is called before resp.
-after executing the command."
-  (cond
-   ((and (evil-operator-state-p) (eq flag 'pre))
-    (evil-repeat-record (this-command-keys))
-    (evil-clear-command-keys))
-   ((and (evil-operator-state-p) (eq flag 'post))
-    ;; The value of (this-command-keys) at this point should be the
-    ;; key-sequence that called the last command that finished the
-    ;; search, usually RET. Therefore this key-sequence will be
-    ;; recorded in the post-command of the operator. Alternatively we
-    ;; could do it here.
-    (evil-repeat-record (if evil-regexp-search
-                            (car-safe regexp-search-ring)
-                          (car-safe search-ring))))
-   (t (evil-repeat-motion flag))))
-
-(evil-define-motion evil-search-forward ()
-  (format "Search forward for user-entered text.
-Searches for regular expression if `evil-regexp-search' is t.%s"
-          (if (and (fboundp 'isearch-forward)
-                   (documentation 'isearch-forward))
-              (format "\n\nBelow is the documentation string \
-for `isearch-forward',\nwhich lists available keys:\n\n%s"
-                      (documentation 'isearch-forward)) ""))
-  :jump t
-  :type exclusive
-  :repeat evil-repeat-search
-  (evil-search-incrementally t evil-regexp-search))
-
-(evil-define-motion evil-search-backward ()
-  (format "Search backward for user-entered text.
-Searches for regular expression if `evil-regexp-search' is t.%s"
-          (if (and (fboundp 'isearch-forward)
-                   (documentation 'isearch-forward))
-              (format "\n\nBelow is the documentation string \
-for `isearch-forward',\nwhich lists available keys:\n\n%s"
-                      (documentation 'isearch-forward)) ""))
-  :jump t
-  :type exclusive
-  :repeat evil-repeat-search
-  (evil-search-incrementally nil evil-regexp-search))
-
-(evil-define-motion evil-search-next (count)
-  "Repeat the last search."
-  :jump t
-  :type exclusive
-  (let ((orig (point))
-        (search-string (if evil-regexp-search
-                           (car-safe regexp-search-ring)
-                         (car-safe search-ring))))
-    (goto-char
-     ;; Wrap in `save-excursion' so that multiple searches have no visual effect.
-     (save-excursion
-       (evil-search search-string isearch-forward evil-regexp-search)
-       (when (and (> (point) orig)
-                  (save-excursion
-                    (evil-adjust-cursor)
-                    (= (point) orig)))
-         ;; Point won't move after first attempt and `evil-adjust-cursor' takes
-         ;; effect, so start again.
-         (evil-search search-string isearch-forward evil-regexp-search))
-       (point)))
-    (when (and count (> count 1))
-      (dotimes (var (1- count))
-        (evil-search search-string isearch-forward evil-regexp-search)))))
-
-(evil-define-motion evil-search-previous (count)
-  "Repeat the last search in the opposite direction."
-  :jump t
-  :type exclusive
-  (dotimes (var (or count 1))
-    (evil-search (if evil-regexp-search
-                     (car-safe regexp-search-ring)
-                   (car-safe search-ring))
-                 (not isearch-forward) evil-regexp-search)))
-
-(evil-define-motion evil-search-word-backward (count &optional symbol)
-  "Search backward for symbol under point."
-  :jump t
-  :type exclusive
-  (interactive (list (prefix-numeric-value current-prefix-arg)
-                     evil-symbol-word-search))
-  (dotimes (var (or count 1))
-    (evil-search-word nil nil symbol)))
-
-(evil-define-motion evil-search-word-forward (count &optional symbol)
-  "Search forward for symbol under point."
-  :jump t
-  :type exclusive
-  (interactive (list (prefix-numeric-value current-prefix-arg)
-                     evil-symbol-word-search))
-  (dotimes (var (or count 1))
-    (evil-search-word t nil symbol)))
-
-(evil-define-motion evil-search-unbounded-word-backward (count &optional symbol)
-  "Search backward for symbol under point.
-The search is unbounded, i.e., the pattern is not wrapped in
-\\<...\\>."
-  :jump t
-  :type exclusive
-  (interactive (list (prefix-numeric-value current-prefix-arg)
-                     evil-symbol-word-search))
-  (dotimes (var (or count 1))
-    (evil-search-word nil t symbol)))
-
-(evil-define-motion evil-search-unbounded-word-forward (count &optional symbol)
-  "Search forward for symbol under point.
-The search is unbounded, i.e., the pattern is not wrapped in
-\\<...\\>."
-  :jump t
-  :type exclusive
-  (interactive (list (prefix-numeric-value current-prefix-arg)
-                     evil-symbol-word-search))
-  (dotimes (var (or count 1))
-    (evil-search-word t t symbol)))
-
-(evil-define-motion evil-goto-definition ()
-  "Go to definition or first occurrence of symbol under point."
-  :jump t
-  :type exclusive
-  (let* ((string (evil-find-symbol t))
-         (search (format "\\_<%s\\_>" (regexp-quote string)))
-         ientry ipos)
-    ;; load imenu if available
-    (unless (featurep 'imenu)
-      (condition-case nil
-          (require 'imenu)
-        (error nil)))
-    (if (null string)
-        (user-error "No symbol under cursor")
-      (setq isearch-forward t)
-      ;; if imenu is available, try it
-      (cond
-       ((fboundp 'imenu--make-index-alist)
-        (condition-case nil
-            (setq ientry (imenu--make-index-alist))
-          (error nil))
-        (setq ientry (assoc string ientry))
-        (setq ipos (cdr ientry))
-        (when (and (markerp ipos)
-                   (eq (marker-buffer ipos) (current-buffer)))
-          (setq ipos (marker-position ipos)))
-        (cond
-         ;; imenu found a position, so go there and
-         ;; highlight the occurrence
-         ((numberp ipos)
-          (evil-search search t t ipos))
-         ;; imenu failed, try semantic
-         ((and (fboundp 'semantic-ia-fast-jump)
-               (ignore-errors (semantic-ia-fast-jump ipos)))
-          ()) ;; noop, already jumped
-         ((fboundp 'xref-find-definitions) ;; semantic failed, try the generic func
-          (xref-find-definitions string))))
-       ;; otherwise just go to first occurrence in buffer
-       (t
-        (evil-search search t t (point-min)))))))
-
-;;; Folding
-(defun evil-fold-action (list action)
-  "Perform fold ACTION for each matching major or minor mode in LIST.
-
-ACTION will be performed for the first matching handler in LIST.  For more
-information on its features and format, see the documentation for
-`evil-fold-list'.
-
-If no matching ACTION is found in LIST, an error will signaled.
-
-Handler errors will be demoted, so a problem in one handler will (hopefully)
-not interfere with another."
-  (if (null list)
-      (user-error
-       "Folding is not supported for any of these major/minor modes")
-    (let* ((modes (caar list)))
-      (if (evil--mode-p modes)
-          (let* ((actions (cdar list))
-                 (fn      (plist-get actions action)))
-            (when fn
-              (with-demoted-errors (funcall fn))))
-        (evil-fold-action (cdr list) action)))))
-
-(defun evil--mode-p (modes)
-  "Determines whether any symbol in MODES represents the current
-buffer's major mode or any of its minors."
-  (unless (eq modes '())
-    (let ((mode (car modes)))
-      (or (eq major-mode mode)
-          (and (boundp mode) (symbol-value mode))
-          (evil--mode-p (cdr modes))))))
-
-(evil-define-command evil-toggle-fold ()
-  "Open or close a fold under point.
-See also `evil-open-fold' and `evil-close-fold'."
-  (evil-fold-action evil-fold-list :toggle))
-
-(evil-define-command evil-open-folds ()
-  "Open all folds.
-See also `evil-close-folds'."
-  (evil-fold-action evil-fold-list :open-all))
-
-(evil-define-command evil-close-folds ()
-  "Close all folds.
-See also `evil-open-folds'."
-  (evil-fold-action evil-fold-list :close-all))
-
-(evil-define-command evil-open-fold ()
-  "Open fold at point.
-See also `evil-close-fold'."
-  (evil-fold-action evil-fold-list :open))
-
-(evil-define-command evil-open-fold-rec ()
-  "Open fold at point recursively.
-See also `evil-open-fold' and `evil-close-fold'."
-  (evil-fold-action evil-fold-list :open-rec))
-
-(evil-define-command evil-close-fold ()
-  "Close fold at point.
-See also `evil-open-fold'."
-  (evil-fold-action evil-fold-list :close))
-
-;;; Ex
-
-(evil-define-operator evil-write (beg end type file-or-append &optional bang)
-  "Save the current buffer, from BEG to END, to FILE-OR-APPEND.
-If FILE-OR-APPEND is of the form \">> FILE\", append to FILE
-instead of overwriting.  The current buffer's filename is not
-changed unless it has no associated file and no region is
-specified.  If the file already exists and the BANG argument is
-non-nil, it is overwritten without confirmation."
-  :motion nil
-  :move-point nil
-  :type line
-  :repeat nil
-  (interactive "<R><fsh><!>")
-  (let* ((append-and-filename (evil-extract-append file-or-append))
-         (append (car append-and-filename))
-         (filename (cdr append-and-filename))
-         (bufname (buffer-file-name (buffer-base-buffer))))
-    (when (zerop (length filename))
-      (setq filename bufname))
-    (cond
-     ((zerop (length filename))
-      (user-error "Please specify a file name for the buffer"))
-     ;; execute command on region
-     ((eq (aref filename 0) ?!)
-      (shell-command-on-region beg end (substring filename 1)))
-     ;; with region or append, always save to file without resetting
-     ;; modified flag
-     ((or append (and beg end))
-      (write-region beg end filename append nil nil (not (or append bang))))
-     ;; no current file
-     ((null bufname)
-      (write-file filename (not bang)))
-     ;; save current buffer to its file
-     ((string= filename bufname)
-      (if (not bang) (save-buffer) (write-file filename)))
-     ;; save to another file
-     (t
-      (write-region nil nil filename
-                    nil (not bufname) nil
-                    (not bang))))))
-
-(evil-define-command evil-write-all (bang)
-  "Saves all buffers visiting a file.
-If BANG is non nil then read-only buffers are saved, too,
-otherwise they are skipped. "
-  :repeat nil
-  :move-point nil
-  (interactive "<!>")
-  (if bang
-      (save-some-buffers t)
-    ;; save only buffer that are not read-only and
-    ;; that are visiting a file
-    (save-some-buffers t
-                       #'(lambda ()
-                           (and (not buffer-read-only)
-                                (buffer-file-name))))))
-
-(evil-define-command evil-save (filename &optional bang)
-  "Save the current buffer to FILENAME.
-Changes the file name of the current buffer to FILENAME.  If no
-FILENAME is given, the current file name is used."
-  :repeat nil
-  :move-point nil
-  (interactive "<f><!>")
-  (when (zerop (length filename))
-    (setq filename (buffer-file-name (buffer-base-buffer))))
-  (write-file filename (not bang)))
-
-(evil-define-command evil-edit (file &optional bang)
-  "Open FILE.
-If no FILE is specified, reload the current buffer from disk."
-  :repeat nil
-  (interactive "<f><!>")
-  (if file
-      (find-file file)
-    (revert-buffer bang (or bang (not (buffer-modified-p))) t)))
-
-(evil-define-command evil-read (count file)
-  "Inserts the contents of FILE below the current line or line COUNT."
-  :repeat nil
-  :move-point nil
-  (interactive "P<fsh>")
-  (when (and file (not (zerop (length file))))
-    (when count (goto-char (point-min)))
-    (when (or (not (zerop (forward-line (or count 1))))
-              (not (bolp)))
-      (insert "\n"))
-    (if (/= (aref file 0) ?!)
-        (let ((result (insert-file-contents file)))
-          (save-excursion
-            (forward-char (cadr result))
-            (unless (bolp) (insert "\n"))))
-      (shell-command (substring file 1) t)
-      (save-excursion
-        (goto-char (mark))
-        (unless (bolp) (insert "\n"))))))
-
-(evil-define-command evil-show-files ()
-  "Shows the file-list.
-The same as `buffer-menu', but shows only buffers visiting
-files."
-  :repeat nil
-  (buffer-menu 1))
-
-(evil-define-command evil-goto-error (count)
-  "Go to error number COUNT.
-
-If no COUNT supplied, move to the current error.
-
-Acts like `first-error' other than when given no counts, goes
-to the current error instead of the first, like in Vim's :cc
-command."
-  :repeat nil
-  (interactive "<c>")
-  (if count
-      (first-error (if (eql 0 count) 1 count))
-    (next-error 0)))
-
-(evil-define-command evil-buffer (buffer)
-  "Switches to another buffer."
-  :repeat nil
-  (interactive "<b>")
-  (cond
-   ;; no buffer given, switch to "other" buffer
-   ((null buffer) (switch-to-buffer (other-buffer)))
-   ;; we are given the name of an existing buffer
-   ((get-buffer buffer) (switch-to-buffer buffer))
-   ;; try to complete the buffer
-   ((let ((all-buffers (internal-complete-buffer buffer nil t)))
-      (when (= (length all-buffers) 1)
-        (switch-to-buffer (car all-buffers)))))
-   (t
-    (when (y-or-n-p
-           (format "No buffer with name \"%s\" exists. Create new buffer? "
-                   buffer))
-      (switch-to-buffer buffer)))))
-
-(evil-define-command evil-next-buffer (&optional count)
-  "Goes to the `count'-th next buffer in the buffer list."
-  :repeat nil
-  (interactive "p")
-  (dotimes (i (or count 1))
-    (next-buffer)))
-
-(evil-define-command evil-prev-buffer (&optional count)
-  "Goes to the `count'-th prev buffer in the buffer list."
-  :repeat nil
-  (interactive "p")
-  (dotimes (i (or count 1))
-    (previous-buffer)))
-
-(evil-define-command evil-delete-buffer (buffer &optional bang)
-  "Deletes a buffer.
-All windows currently showing this buffer will be closed except
-for the last window in each frame."
-  (interactive "<b><!>")
-  (with-current-buffer (or buffer (current-buffer))
-    (when bang
-      (set-buffer-modified-p nil)
-      (dolist (process (process-list))
-        (when (eq (process-buffer process) (current-buffer))
-          (set-process-query-on-exit-flag process nil))))
-    ;; get all windows that show this buffer
-    (let ((wins (get-buffer-window-list (current-buffer) nil t)))
-      ;; if the buffer which was initiated by emacsclient,
-      ;; call `server-edit' from server.el to avoid
-      ;; "Buffer still has clients" message
-      (if (and (fboundp 'server-edit)
-               (boundp 'server-buffer-clients)
-               server-buffer-clients)
-          (server-edit)
-        (kill-buffer nil))
-      ;; close all windows that showed this buffer
-      (mapc #'(lambda (w)
-                (condition-case nil
-                    (delete-window w)
-                  (error nil)))
-            wins))))
-
-(evil-define-command evil-quit (&optional force)
-  "Closes the current window, current frame, Emacs.
-If the current frame belongs to some client the client connection
-is closed."
-  :repeat nil
-  (interactive "<!>")
-  (condition-case nil
-      (delete-window)
-    (error
-     (if (and (boundp 'server-buffer-clients)
-              (fboundp 'server-edit)
-              (fboundp 'server-buffer-done)
-              server-buffer-clients)
-         (if force
-             (server-buffer-done (current-buffer))
-           (server-edit))
-       (condition-case nil
-           (delete-frame)
-         (error
-          (if force
-              (kill-emacs)
-            (save-buffers-kill-emacs))))))))
-
-(evil-define-command evil-quit-all (&optional bang)
-  "Exits Emacs, asking for saving."
-  :repeat nil
-  (interactive "<!>")
-  (if (null bang)
-      (save-buffers-kill-terminal)
-    (let ((proc (frame-parameter (selected-frame) 'client)))
-      (if proc
-          (with-no-warnings
-            (server-delete-client proc))
-        (dolist (process (process-list))
-          (set-process-query-on-exit-flag process nil))
-        (kill-emacs)))))
-
-(evil-define-command evil-quit-all-with-error-code (&optional force)
-  "Exits Emacs without saving, returning an non-zero error code.
-The FORCE argument is only there for compatibility and is ignored.
-This function fails with an error if Emacs is run in server mode."
-  :repeat nil
-  (interactive "<!>")
-  (if (and (boundp 'server-buffer-clients)
-           (fboundp 'server-edit)
-           (fboundp 'server-buffer-done)
-           server-buffer-clients)
-      (user-error "Cannot exit client process with error code.")
-    (kill-emacs 1)))
-
-(evil-define-command evil-save-and-quit ()
-  "Save all buffers and exit Emacs."
-  (save-buffers-kill-terminal t))
-
-(evil-define-command evil-save-and-close (file &optional bang)
-  "Saves the current buffer and closes the window."
-  :repeat nil
-  (interactive "<f><!>")
-  (evil-write nil nil nil file bang)
-  (evil-quit))
-
-(evil-define-command evil-save-modified-and-close (file &optional bang)
-  "Saves the current buffer and closes the window."
-  :repeat nil
-  (interactive "<f><!>")
-  (when (buffer-modified-p)
-    (evil-write nil nil nil file bang))
-  (evil-quit))
-
-(evil-define-operator evil-shell-command
-  (beg end type command &optional previous)
-  "Execute a shell command.
-If BEG, END and TYPE is specified, COMMAND is executed on the region,
-which is replaced with the command's output. Otherwise, the
-output is displayed in its own buffer. If PREVIOUS is non-nil,
-the previous shell command is executed instead."
-  (interactive "<R><sh><!>")
-  (if (not (evil-ex-p))
-      (let ((evil-ex-initial-input
-             (if (and beg
-                      (not (evil-visual-state-p))
-                      (not current-prefix-arg))
-                 (let ((range (evil-range beg end type)))
-                   (evil-contract-range range)
-                   ;; TODO: this is not exactly the same as Vim, which
-                   ;; uses .,+count as range. However, this is easier
-                   ;; to achieve with the current implementation and
-                   ;; the very inconvenient range interface.
-                   ;;
-                   ;; TODO: the range interface really needs some
-                   ;; rework!
-                   (format
-                    "%d,%d!"
-                    (line-number-at-pos (evil-range-beginning range))
-                    (line-number-at-pos (evil-range-end range))))
-               "!")))
-        (call-interactively 'evil-ex))
-    (when command
-      (setq command (evil-ex-replace-special-filenames command)))
-    (if (zerop (length command))
-        (when previous (setq command evil-previous-shell-command))
-      (setq evil-previous-shell-command command))
-    (cond
-     ((zerop (length command))
-      (if previous (user-error "No previous shell command")
-        (user-error "No shell command")))
-     (evil-ex-range
-      (if (not evil-display-shell-error-in-message)
-          (shell-command-on-region beg end command nil t)
-        (let ((output-buffer (generate-new-buffer " *temp*"))
-              (error-buffer (generate-new-buffer " *temp*")))
-          (unwind-protect
-              (if (zerop (shell-command-on-region beg end
-                                                  command
-                                                  output-buffer nil
-                                                  error-buffer))
-                  (progn
-                    (delete-region beg end)
-                    (insert-buffer-substring output-buffer)
-                    (goto-char beg)
-                    (evil-first-non-blank))
-                (display-message-or-buffer error-buffer))
-            (kill-buffer output-buffer)
-            (kill-buffer error-buffer)))))
-     (t
-      (shell-command command)))))
-
-(evil-define-command evil-make (arg)
-  "Call a build command in the current directory.
-If ARG is nil this function calls `recompile', otherwise it calls
-`compile' passing ARG as build command."
-  (interactive "<sh>")
-  (if (and (fboundp 'recompile)
-           (not arg))
-      (recompile)
-    (compile arg)))
-
-;; TODO: escape special characters (currently only \n) ... perhaps
-;; there is some Emacs function doing this?
-(evil-define-command evil-show-registers ()
-  "Shows the contents of all registers."
-  :repeat nil
-  (evil-with-view-list
-    :name "evil-registers"
-    :mode-name "Evil Registers"
-    :format
-    [("Register" 10 nil)
-     ("Value" 1000 nil)]
-    :entries
-    (cl-loop for (key . val) in (evil-register-list)
-             collect `(nil [,(char-to-string key)
-                            ,(or (and val
-                                      (stringp val)
-                                      (replace-regexp-in-string "\n" "^J" val))
-                                 "")]))))
-
-(evil-define-command evil-show-marks (mrks)
-  "Shows all marks.
-If MRKS is non-nil it should be a string and only registers
-corresponding to the characters of this string are shown."
-  :repeat nil
-  (interactive "<a>")
-  ;; To get markers and positions, we can't rely on 'global-mark-ring'
-  ;; provided by Emacs (although it will be much simpler and faster),
-  ;; because 'global-mark-ring' does not store mark characters, but
-  ;; only buffer name and position. Instead, 'evil-markers-alist' is
-  ;; used; this is list maintained by Evil for each buffer.
-  (let ((all-markers
-         ;; get global and local marks
-         (append (cl-remove-if (lambda (m)
-                                 (or (evil-global-marker-p (car m))
-                                     (not (markerp (cdr m)))))
-                               evil-markers-alist)
-                 (cl-remove-if (lambda (m)
-                                 (or (not (evil-global-marker-p (car m)))
-                                     (not (markerp (cdr m)))))
-                               (default-value 'evil-markers-alist)))))
-    (when mrks
-      (setq mrks (string-to-list mrks))
-      (setq all-markers (cl-delete-if (lambda (m)
-                                        (not (member (car m) mrks)))
-                                      all-markers)))
-    ;; map marks to list of 4-tuples (char row col file)
-    (setq all-markers
-          (mapcar (lambda (m)
-                    (with-current-buffer (marker-buffer (cdr m))
-                      (save-excursion
-                        (goto-char (cdr m))
-                        (list (car m)
-                              (line-number-at-pos (point))
-                              (current-column)
-                              (buffer-name)))))
-                  all-markers))
-    (evil-with-view-list
-      :name "evil-marks"
-      :mode-name "Evil Marks"
-      :format [("Mark" 8 nil)
-               ("Line" 8 nil)
-               ("Column" 8 nil)
-               ("Buffer" 1000 nil)]
-      :entries (cl-loop for m in (sort all-markers (lambda (a b) (< (car a) (car b))))
-                        collect `(nil [,(char-to-string (nth 0 m))
-                                       ,(number-to-string (nth 1 m))
-                                       ,(number-to-string (nth 2 m))
-                                       (,(nth 3 m))]))
-      :select-action #'evil--show-marks-select-action)))
-
-(defun evil--show-marks-select-action (entry)
-  (kill-buffer)
-  (switch-to-buffer (car (elt entry 3)))
-  (evil-goto-mark (string-to-char (elt entry 0))))
-
-(evil-define-command evil-delete-marks (marks &optional force)
-  "Delete all marks.
-MARKS is a string denoting all marks to be deleted. Mark names are
-either single characters or a range of characters in the form A-Z.
-
-If FORCE is non-nil all local marks except 0-9 are removed.
-"
-  (interactive "<a><!>")
-  (cond
-   ;; delete local marks except 0-9
-   (force
-    (setq evil-markers-alist
-          (cl-delete-if (lambda (m)
-                          (not (and (>= (car m) ?0) (<= (car m) ?9))))
-                        evil-markers-alist)))
-   (t
-    (let ((i 0)
-          (n (length marks))
-          delmarks)
-      (while (< i n)
-        (cond
-         ;; skip spaces
-         ((= (aref marks i) ?\ ) (cl-incf i))
-         ;; ranges of marks
-         ((and (< (+ i 2) n)
-               (= (aref marks (1+ i)) ?-)
-               (or (and (>= (aref marks i) ?a)
-                        (<= (aref marks i) ?z)
-                        (>= (aref marks (+ 2 i)) ?a)
-                        (<= (aref marks (+ 2 i)) ?z))
-                   (and (>= (aref marks i) ?A)
-                        (<= (aref marks i) ?Z)
-                        (>= (aref marks (+ 2 i)) ?A)
-                        (<= (aref marks (+ 2 i)) ?Z))))
-          (let ((m (aref marks i)))
-            (while (<= m (aref marks (+ 2 i)))
-              (push m delmarks)
-              (cl-incf m)))
-          (cl-incf i 2))
-         ;; single marks
-         (t
-          (push (aref marks i) delmarks)
-          (cl-incf i))))
-      ;; now remove all marks
-      (setq evil-markers-alist
-            (cl-delete-if (lambda (m) (member (car m) delmarks))
-                          evil-markers-alist))
-      (set-default 'evil-markers-alist
-                   (cl-delete-if (lambda (m) (member (car m) delmarks))
-                                 (default-value 'evil-markers-alist)))))))
-
-(eval-when-compile (require 'ffap))
-(evil-define-command evil-find-file-at-point-with-line ()
-  "Opens the file at point and goes to line-number."
-  (require 'ffap)
-  (let ((fname (with-no-warnings (ffap-file-at-point))))
-    (if fname
-        (let ((line
-               (save-excursion
-                 (goto-char (cadr ffap-string-at-point-region))
-                 (and (re-search-backward ":\\([0-9]+\\)\\="
-                                          (line-beginning-position) t)
-                      (string-to-number (match-string 1))))))
-          (with-no-warnings (ffap-other-window))
-          (when line
-            (goto-char (point-min))
-            (forward-line (1- line))))
-      (user-error "File does not exist."))))
-
-(evil-ex-define-argument-type state
-  "Defines an argument type which can take state names."
-  :collection
-  (lambda (arg predicate flag)
-    (let ((completions
-           (append '("nil")
-                   (mapcar #'(lambda (state)
-                               (format "%s" (car state)))
-                           evil-state-properties))))
-      (when arg
-        (cond
-         ((eq flag nil)
-          (try-completion arg completions predicate))
-         ((eq flag t)
-          (all-completions arg completions predicate))
-         ((eq flag 'lambda)
-          (test-completion arg completions predicate))
-         ((eq (car-safe flag) 'boundaries)
-          (cons 'boundaries
-                (completion-boundaries arg
-                                       completions
-                                       predicate
-                                       (cdr flag)))))))))
-
-(evil-define-interactive-code "<state>"
-  "A valid evil state."
-  :ex-arg state
-  (list (when (and (evil-ex-p) evil-ex-argument)
-          (intern evil-ex-argument))))
-
-;; TODO: should we merge this command with `evil-set-initial-state'?
-(evil-define-command evil-ex-set-initial-state (state)
-  "Set the initial state for the current major mode to STATE.
-This is the state the buffer comes up in. See `evil-set-initial-state'."
-  :repeat nil
-  (interactive "<state>")
-  (if (not (or (assq state evil-state-properties)
-               (null state)))
-      (user-error "State %s cannot be set as initial Evil state" state)
-    (let ((current-initial-state (evil-initial-state major-mode)))
-      (unless (eq current-initial-state state)
-        ;; only if we selected a new mode
-        (when (y-or-n-p (format "Major-mode `%s' has initial mode `%s'. \
-Change to `%s'? "
-                                major-mode
-                                (or current-initial-state "DEFAULT")
-                                (or state "DEFAULT")))
-          (evil-set-initial-state major-mode state)
-          (when (y-or-n-p "Save setting in customization file? ")
-            (dolist (s (list current-initial-state state))
-              (when s
-                (let ((var (intern (format "evil-%s-state-modes" s))))
-                  (customize-save-variable var (symbol-value var)))))))))))
-
-(evil-define-command evil-force-normal-state ()
-  "Switch to normal state without recording current command."
-  :repeat abort
-  :suppress-operator t
-  (evil-normal-state))
-
-(evil-define-motion evil-ex-search-next (count)
-  "Goes to the next occurrence."
-  :jump t
-  :type exclusive
-  (evil-ex-search count))
-
-(evil-define-motion evil-ex-search-previous (count)
-  "Goes the the previous occurrence."
-  :jump t
-  :type exclusive
-  (let ((evil-ex-search-direction
-         (if (eq evil-ex-search-direction 'backward) 'forward 'backward)))
-    (evil-ex-search count)))
-
-(defun evil-repeat-ex-search (flag)
-  "Called to record a search command.
-FLAG is either 'pre or 'post if the function is called before
-resp.  after executing the command."
-  (cond
-   ((and (evil-operator-state-p) (eq flag 'pre))
-    (evil-repeat-record (this-command-keys))
-    (evil-clear-command-keys))
-   ((and (evil-operator-state-p) (eq flag 'post))
-    ;; The value of (this-command-keys) at this point should be the
-    ;; key-sequence that called the last command that finished the
-    ;; search, usually RET. Therefore this key-sequence will be
-    ;; recorded in the post-command of the operator. Alternatively we
-    ;; could do it here.
-    (evil-repeat-record (evil-ex-pattern-regex evil-ex-search-pattern)))
-   (t (evil-repeat-motion flag))))
-
-(evil-define-motion evil-ex-search-forward (count)
-  "Starts a forward search."
-  :jump t
-  :type exclusive
-  :repeat evil-repeat-ex-search
-  (evil-ex-start-search 'forward count))
-
-(evil-define-motion evil-ex-search-backward (count)
-  "Starts a forward search."
-  :jump t
-  :repeat evil-repeat-ex-search
-  (evil-ex-start-search 'backward count))
-
-(evil-define-motion evil-ex-search-word-forward (count &optional symbol)
-  "Search for the next occurrence of word under the cursor."
-  :jump t
-  :type exclusive
-  (interactive (list (prefix-numeric-value current-prefix-arg)
-                     evil-symbol-word-search))
-  (evil-ex-start-word-search nil 'forward count symbol))
-
-(evil-define-motion evil-ex-search-word-backward (count &optional symbol)
-  "Search for the next occurrence of word under the cursor."
-  :jump t
-  :type exclusive
-  (interactive (list (prefix-numeric-value current-prefix-arg)
-                     evil-symbol-word-search))
-  (evil-ex-start-word-search nil 'backward count symbol))
-
-(evil-define-motion evil-ex-search-unbounded-word-forward (count &optional symbol)
-  "Search for the next occurrence of word under the cursor."
-  :jump t
-  :type exclusive
-  (interactive (list (prefix-numeric-value current-prefix-arg)
-                     evil-symbol-word-search))
-  (evil-ex-start-word-search t 'forward count symbol))
-
-(evil-define-motion evil-ex-search-unbounded-word-backward (count &optional symbol)
-  "Search for the next occurrence of word under the cursor."
-  :jump t
-  :type exclusive
-  (interactive (list (prefix-numeric-value current-prefix-arg)
-                     evil-symbol-word-search))
-  (evil-ex-start-word-search t 'backward count symbol))
-
-(evil-define-operator evil-ex-substitute
-  (beg end pattern replacement flags)
-  "The Ex substitute command.
-\[BEG,END]substitute/PATTERN/REPLACEMENT/FLAGS"
-  :repeat nil
-  :jump t
-  :move-point nil
-  :motion evil-line
-  (interactive "<r><s/>")
-  (evil-ex-nohighlight)
-  (unless pattern
-    (user-error "No pattern given"))
-  (setq replacement (or replacement ""))
-  (setq evil-ex-last-was-search nil)
-  (let* ((flags (append flags nil))
-         (count-only (memq ?n flags))
-         (confirm (and (memq ?c flags) (not count-only)))
-         (case-fold-search (evil-ex-pattern-ignore-case pattern))
-         (case-replace case-fold-search)
-         (evil-ex-substitute-regex (evil-ex-pattern-regex pattern))
-         (evil-ex-substitute-nreplaced 0)
-         (evil-ex-substitute-last-point (point))
-         (whole-line (evil-ex-pattern-whole-line pattern))
-         (evil-ex-substitute-overlay (make-overlay (point) (point)))
-         (evil-ex-substitute-hl (evil-ex-make-hl 'evil-ex-substitute))
-         (orig-point-marker (move-marker (make-marker) (point)))
-         (end-marker (move-marker (make-marker) end))
-         zero-length-match
-         match-contains-newline
-         transient-mark-mode)
-    (setq evil-ex-substitute-pattern pattern
-          evil-ex-substitute-replacement replacement
-          evil-ex-substitute-flags flags
-          isearch-string evil-ex-substitute-regex)
-    (isearch-update-ring evil-ex-substitute-regex t)
-    (unwind-protect
-        (progn
-          (evil-ex-hl-change 'evil-ex-substitute pattern)
-          (overlay-put evil-ex-substitute-overlay 'face 'isearch)
-          (overlay-put evil-ex-substitute-overlay 'priority 1001)
-          (goto-char beg)
-          (catch 'exit-search
-            (while (re-search-forward evil-ex-substitute-regex end-marker t)
-              (let ((match-str (match-string 0))
-                    (match-beg (move-marker (make-marker) (match-beginning 0)))
-                    (match-end (move-marker (make-marker) (match-end 0)))
-                    (match-data (match-data)))
-                (goto-char match-beg)
-                (setq match-contains-newline (string-match-p "\n" match-str))
-                (setq zero-length-match (= match-beg match-end))
-                (when (and (string= "^" evil-ex-substitute-regex)
-                           (= (point) end-marker))
-                  ;; The range (beg end) includes the final newline which means
-                  ;; end-marker is on one line down. With the regex "^" the
-                  ;; beginning of this last line will be matched which we don't
-                  ;; want, so we abort here.
-                  (throw 'exit-search t))
-                (if confirm
-                    (let ((prompt
-                           (format "Replace %s with %s (y/n/a/q/l/^E/^Y)? "
-                                   match-str
-                                   (evil-match-substitute-replacement
-                                    evil-ex-substitute-replacement
-                                    (not case-replace))))
-                          response)
-                      (move-overlay evil-ex-substitute-overlay match-beg match-end)
-                      (catch 'exit-read-char
-                        (while (setq response (read-char prompt))
-                          (when (member response '(?y ?a ?l))
-                            (unless count-only
-                              (set-match-data match-data)
-                              (evil-replace-match evil-ex-substitute-replacement
-                                                  (not case-replace)))
-                            (setq evil-ex-substitute-last-point (point))
-                            (setq evil-ex-substitute-nreplaced
-                                  (1+ evil-ex-substitute-nreplaced))
-                            (evil-ex-hl-set-region 'evil-ex-substitute
-                                                   (save-excursion
-                                                     (forward-line)
-                                                     (point))
-                                                   (evil-ex-hl-get-max
-                                                    'evil-ex-substitute)))
-                          (cl-case response
-                            ((?y ?n) (throw 'exit-read-char t))
-                            (?a (setq confirm nil)
-                                (throw 'exit-read-char t))
-                            ((?q ?l ?\C-\[) (throw 'exit-search t))
-                            (?\C-e (evil-scroll-line-down 1))
-                            (?\C-y (evil-scroll-line-up 1))))))
-                  (setq evil-ex-substitute-nreplaced
-                        (1+ evil-ex-substitute-nreplaced))
-                  (unless count-only
-                    (set-match-data match-data)
-                    (evil-replace-match evil-ex-substitute-replacement
-                                        (not case-replace)))
-                  (setq evil-ex-substitute-last-point (point)))
-                (goto-char match-end)
-                (cond ((and (not whole-line)
-                            (not match-contains-newline))
-                       (forward-line)
-                       ;; forward-line just moves to the end of the line on the
-                       ;; last line of the buffer.
-                       (when (or (eobp)
-                                 (> (point) end-marker))
-                         (throw 'exit-search t)))
-                      ;; For zero-length matches check to see if point won't
-                      ;; move next time. This is a problem when matching the
-                      ;; regexp "$" because we can enter an infinite loop,
-                      ;; repeatedly matching the same character
-                      ((and zero-length-match
-                            (let ((pnt (point)))
-                              (save-excursion
-                                (and
-                                 (re-search-forward
-                                  evil-ex-substitute-regex end-marker t)
-                                 (= pnt (point))))))
-                       (if (or (eobp)
-                               (= (point) end-marker))
-                           (throw 'exit-search t)
-                         (forward-char))))))))
-      (evil-ex-delete-hl 'evil-ex-substitute)
-      (delete-overlay evil-ex-substitute-overlay))
-
-    (if count-only
-        (goto-char orig-point-marker)
-      (goto-char evil-ex-substitute-last-point))
-
-    (move-marker orig-point-marker nil)
-    (move-marker end-marker nil)
-
-    (message "%s %d occurrence%s"
-             (if count-only "Found" "Replaced")
-             evil-ex-substitute-nreplaced
-             (if (/= evil-ex-substitute-nreplaced 1) "s" ""))
-    (evil-first-non-blank)))
-
-(evil-define-operator evil-ex-repeat-substitute
-  (beg end flags)
-  "Repeat last substitute command.
-This is the same as :s//~/"
-  :repeat nil
-  :jump t
-  :move-point nil
-  :motion evil-line
-  (interactive "<r><a>")
-  (apply #'evil-ex-substitute beg end
-         (evil-ex-get-substitute-info (concat "//~/" flags))))
-
-(evil-define-operator evil-ex-repeat-substitute-with-flags
-  (beg end flags)
-  "Repeat last substitute command with last flags.
-This is the same as :s//~/&"
-  :repeat nil
-  :jump t
-  :move-point nil
-  :motion evil-line
-  (interactive "<r><a>")
-  (apply #'evil-ex-substitute beg end
-         (evil-ex-get-substitute-info (concat "//~/&" flags))))
-
-(evil-define-operator evil-ex-repeat-substitute-with-search
-  (beg end flags)
-  "Repeat last substitute command with last search pattern.
-This is the same as :s//~/r"
-  :repeat nil
-  :jump t
-  :move-point nil
-  :motion evil-line
-  (interactive "<r><a>")
-  (apply #'evil-ex-substitute beg end
-         (evil-ex-get-substitute-info (concat "//~/r" flags))))
-
-(evil-define-operator evil-ex-repeat-substitute-with-search-and-flags
-  (beg end flags)
-  "Repeat last substitute command with last search pattern and last flags.
-This is the same as :s//~/&r"
-  :repeat nil
-  :jump t
-  :move-point nil
-  :motion evil-line
-  (interactive "<r><a>")
-  (apply #'evil-ex-substitute beg end
-         (evil-ex-get-substitute-info (concat "//~/&r" flags))))
-
-(evil-define-operator evil-ex-repeat-global-substitute ()
-  "Repeat last substitute command on the whole buffer.
-This is the same as :%s//~/&"
-  :repeat nil
-  :jump t
-  :move-point nil
-  :motion evil-line
-  (interactive)
-  (apply #'evil-ex-substitute (point-min) (point-max)
-         (evil-ex-get-substitute-info (concat "//~/&"))))
-
-(evil-define-operator evil-ex-global
-  (beg end pattern command &optional invert)
-  "The Ex global command.
-\[BEG,END]global[!]/PATTERN/COMMAND"
-  :motion mark-whole-buffer
-  :move-point nil
-  (interactive "<r><g/><!>")
-  (unless pattern
-    (user-error "No pattern given"))
-  (unless command
-    (user-error "No command given"))
-  ;; TODO: `evil-ex-make-substitute-pattern' should be executed so
-  ;; :substitute can re-use :global's pattern depending on its `r'
-  ;; flag. This isn't supported currently but should be simple to add
-  (evil-with-single-undo
-    (let ((case-fold-search
-           (eq (evil-ex-regex-case pattern 'smart) 'insensitive))
-          match markers)
-      (when (and pattern command)
-        (setq isearch-string pattern)
-        (isearch-update-ring pattern t)
-        (goto-char beg)
-        (evil-move-beginning-of-line)
-        (while (< (point) end)
-          (setq match (re-search-forward pattern (line-end-position) t))
-          (when (or (and match (not invert))
-                    (and invert (not match)))
-            (push (move-marker (make-marker)
-                               (or (and match (match-beginning 0))
-                                   (line-beginning-position)))
-                  markers))
-          (forward-line))
-        (setq markers (nreverse markers))
-        (unwind-protect
-            (dolist (marker markers)
-              (goto-char marker)
-              (evil-ex-eval command))
-          ;; ensure that all markers are deleted afterwards,
-          ;; even in the event of failure
-          (dolist (marker markers)
-            (set-marker marker nil)))))))
-
-(evil-define-operator evil-ex-global-inverted
-  (beg end pattern command &optional invert)
-  "The Ex vglobal command.
-\[BEG,END]vglobal/PATTERN/COMMAND"
-  :motion mark-whole-buffer
-  :move-point nil
-  (interactive "<r><g/><!>")
-  (evil-ex-global beg end pattern command (not invert)))
-
-(evil-define-operator evil-ex-normal (beg end commands)
-  "The Ex normal command.
-Execute the argument as normal command on each line in the
-range. The given argument is passed straight to
-`execute-kbd-macro'.  The default is the current line."
-  :motion evil-line
-  (interactive "<r><a>")
-  (evil-with-single-undo
-    (let (markers evil-ex-current-buffer prefix-arg current-prefix-arg)
-      (goto-char beg)
-      (while
-          (and (< (point) end)
-               (progn
-                 (push (move-marker (make-marker) (line-beginning-position))
-                       markers)
-                 (and (= (forward-line) 0) (bolp)))))
-      (setq markers (nreverse markers))
-      (deactivate-mark)
-      (evil-force-normal-state)
-      ;; replace ^[ by escape
-      (setq commands
-            (vconcat
-             (mapcar #'(lambda (ch) (if (equal ch ?) 'escape ch))
-                     (append commands nil))))
-      (dolist (marker markers)
-        (goto-char marker)
-        (condition-case nil
-            (execute-kbd-macro commands)
-          (error nil))
-        (evil-force-normal-state)
-        (set-marker marker nil)))))
-
-(evil-define-command evil-goto-char (position)
-  "Go to POSITION in the buffer.
-Default position is the beginning of the buffer."
-  (interactive "p")
-  (let ((position (evil-normalize-position
-                   (or position (point-min)))))
-    (goto-char position)))
-
-(evil-define-operator evil-ex-line-number (beg end)
-  "Print the last line number."
-  :motion mark-whole-buffer
-  :move-point nil
-  (interactive "<r>")
-  (message "%d" (count-lines (point-min) end)))
-
-(evil-define-command evil-show-file-info ()
-  "Shows basic file information."
-  (let* ((nlines   (count-lines (point-min) (point-max)))
-         (curr     (line-number-at-pos (point)))
-         (perc     (if (> nlines 0)
-                       (format "%d%%" (* (/ (float curr) (float nlines)) 100.0))
-                     "No lines in buffer"))
-         (file     (buffer-file-name (buffer-base-buffer)))
-         (writable (and file (file-writable-p file)))
-         (readonly (if (and file (not writable)) "[readonly] " "")))
-    (if file
-        (message "\"%s\" %d %slines --%s--" file nlines readonly perc)
-      (message "%d lines --%s--" nlines perc))))
-
-(evil-define-operator evil-ex-sort (beg end &optional options reverse)
-  "The Ex sort command.
-\[BEG,END]sort[!] [i][u]
-The following additional options are supported:
-
-  * i   ignore case
-  * u   remove duplicate lines
-
-The 'bang' argument means to sort in reverse order."
-  :motion mark-whole-buffer
-  :move-point nil
-  (interactive "<r><a><!>")
-  (let ((beg (copy-marker beg))
-        (end (copy-marker end))
-        sort-fold-case uniq)
-    (dolist (opt (append options nil))
-      (cond
-       ((eq opt ?i) (setq sort-fold-case t))
-       ((eq opt ?u) (setq uniq t))
-       (t (user-error "Unsupported sort option: %c" opt))))
-    (sort-lines reverse beg end)
-    (when uniq
-      (let (line prev-line)
-        (goto-char beg)
-        (while (and (< (point) end) (not (eobp)))
-          (setq line (buffer-substring-no-properties
-                      (line-beginning-position)
-                      (line-end-position)))
-          (if (and (stringp prev-line)
-                   (eq t (compare-strings line nil nil
-                                          prev-line nil nil
-                                          sort-fold-case)))
-              (delete-region (progn (forward-line 0) (point))
-                             (progn (forward-line 1) (point)))
-            (setq prev-line line)
-            (forward-line 1)))))
-    (goto-char beg)
-    (set-marker beg nil)
-    (set-marker end nil)))
-
-;;; Window navigation
-
-(defun evil-resize-window (new-size &optional horizontal)
-  "Set the current window's width or height to NEW-SIZE.
-If HORIZONTAL is non-nil the width of the window is changed,
-otherwise its height is changed."
-  (let ((count (- new-size (if horizontal (window-width) (window-height)))))
-    (if (>= emacs-major-version 24)
-        (enlarge-window count horizontal)
-      (let ((wincfg (current-window-configuration))
-            (nwins (length (window-list)))
-            (inhibit-redisplay t))
-        (catch 'done
-          (save-window-excursion
-            (while (not (zerop count))
-              (if (> count 0)
-                  (progn
-                    (enlarge-window 1 horizontal)
-                    (setq count (1- count)))
-                (progn
-                  (shrink-window 1 horizontal)
-                  (setq count (1+ count))))
-              (if (= nwins (length (window-list)))
-                  (setq wincfg (current-window-configuration))
-                (throw 'done t)))))
-        (set-window-configuration wincfg)))))
-
-(defun evil-get-buffer-tree (wintree)
-  "Extracts the buffer tree from a given window tree WINTREE."
-  (if (consp wintree)
-      (cons (car wintree) (mapcar #'evil-get-buffer-tree (cddr wintree)))
-    (window-buffer wintree)))
-
-(defun evil-restore-window-tree (win tree)
-  "Restore the given buffer-tree layout as subwindows of WIN.
-TREE is the tree layout to be restored.
-A tree layout is either a buffer or a list of the form (DIR TREE ...),
-where DIR is t for horizontal split and nil otherwise. All other
-elements of the list are tree layouts itself."
-  (if (bufferp tree)
-      (set-window-buffer win tree)
-    ;; if tree is buffer list with one buffer only, do not split
-    ;; anymore
-    (if (not (cddr tree))
-        (evil-restore-window-tree win (cadr tree))
-      ;; tree is a regular list, split recursively
-      (let ((newwin (split-window win nil (not (car tree)))))
-        (evil-restore-window-tree win (cadr tree))
-        (evil-restore-window-tree newwin (cons (car tree) (cddr tree)))))))
-
-(defun evil-alternate-buffer (&optional window)
-  "Return the last buffer WINDOW has displayed other than the
-current one (equivalent to Vim's alternate buffer).
-
-Returns the first item in `window-prev-buffers' that isn't
-`window-buffer' of WINDOW."
-  ;; If the last buffer visited has been killed, then `window-prev-buffers'
-  ;; returns a list with `current-buffer' at the head, we account for this
-  ;; possibility.
-  (let* ((prev-buffers (window-prev-buffers))
-         (head (car prev-buffers)))
-    (if (eq (car head) (window-buffer window))
-        (cadr prev-buffers)
-      head)))
-
-(evil-define-command evil-switch-to-windows-last-buffer ()
-  "Switch to current windows last open buffer."
-  :repeat nil
-  (let ((previous-place (evil-alternate-buffer)))
-    (when previous-place
-      (switch-to-buffer (car previous-place))
-      (goto-char (car (last previous-place))))))
-
-(evil-define-command evil-window-delete ()
-  "Deletes the current window.
-If `evil-auto-balance-windows' is non-nil then all children of
-the deleted window's parent window are rebalanced."
-  (let ((p (window-parent)))
-    (delete-window)
-    (when evil-auto-balance-windows
-      ;; balance-windows raises an error if the parent does not have
-      ;; any further children (then rebalancing is not necessary anyway)
-      (condition-case nil
-          (balance-windows p)
-        (error)))))
-
-(evil-define-command evil-window-split (&optional count file)
-  "Splits the current window horizontally, COUNT lines height,
-editing a certain FILE. The new window will be created below
-when `evil-split-window-below' is non-nil. If COUNT and
-`evil-auto-balance-windows' are both non-nil then all children
-of the parent of the splitted window are rebalanced."
-  :repeat nil
-  (interactive "P<f>")
-  (split-window (selected-window) count
-                (if evil-split-window-below 'above 'below))
-  (when (and (not count) evil-auto-balance-windows)
-    (balance-windows (window-parent)))
-  (when file
-    (evil-edit file)))
-
-(evil-define-command evil-window-vsplit (&optional count file)
-  "Splits the current window vertically, COUNT columns width,
-editing a certain FILE. The new window will be created to the
-right when `evil-vsplit-window-right' is non-nil. If COUNT and
-`evil-auto-balance-windows'are both non-nil then all children
-of the parent of the splitted window are rebalanced."
-  :repeat nil
-  (interactive "P<f>")
-  (split-window (selected-window) count
-                (if evil-vsplit-window-right 'left 'right))
-  (when (and (not count) evil-auto-balance-windows)
-    (balance-windows (window-parent)))
-  (when file
-    (evil-edit file)))
-
-(evil-define-command evil-split-buffer (buffer)
-  "Splits window and switches to another buffer."
-  :repeat nil
-  (interactive "<b>")
-  (evil-window-split)
-  (evil-buffer buffer))
-
-(evil-define-command evil-split-next-buffer (&optional count)
-  "Splits the window and goes to the COUNT-th next buffer in the buffer list."
-  :repeat nil
-  (interactive "p")
-  (evil-window-split)
-  (evil-next-buffer count))
-
-(evil-define-command evil-split-prev-buffer (&optional count)
-  "Splits window and goes to the COUNT-th prev buffer in the buffer list."
-  :repeat nil
-  (interactive "p")
-  (evil-window-split)
-  (evil-prev-buffer count))
-
-(evil-define-command evil-window-left (count)
-  "Move the cursor to new COUNT-th window left of the current one."
-  :repeat nil
-  (interactive "p")
-  (dotimes (i count)
-    (windmove-left)))
-
-(evil-define-command evil-window-right (count)
-  "Move the cursor to new COUNT-th window right of the current one."
-  :repeat nil
-  (interactive "p")
-  (dotimes (i count)
-    (windmove-right)))
-
-(evil-define-command evil-window-up (count)
-  "Move the cursor to new COUNT-th window above the current one."
-  :repeat nil
-  (interactive "p")
-  (dotimes (i (or count 1))
-    (windmove-up)))
-
-(evil-define-command evil-window-down (count)
-  "Move the cursor to new COUNT-th window below the current one."
-  :repeat nil
-  (interactive "p")
-  (dotimes (i (or count 1))
-    (windmove-down)))
-
-(evil-define-command evil-window-bottom-right ()
-  "Move the cursor to bottom-right window."
-  :repeat nil
-  (let ((last-sibling (frame-root-window)))
-    (while (and last-sibling (not (window-live-p last-sibling)))
-      (setq last-sibling (window-last-child last-sibling)))
-    (when last-sibling
-      (select-window last-sibling))))
-
-(evil-define-command evil-window-top-left ()
-  "Move the cursor to top-left window."
-  :repeat nil
-  (let ((first-child (window-child (frame-root-window))))
-    (while (and first-child (not (window-live-p first-child)))
-      (setq first-child (window-child first-child)))
-    (when first-child
-      (select-window
-       first-child))))
-
-(evil-define-command evil-window-mru ()
-  "Move the cursor to the previous (last accessed) buffer in another window.
-More precisely, it selects the most recently used buffer that is
-shown in some other window, preferably of the current frame, and
-is different from the current one."
-  :repeat nil
-  (catch 'done
-    (dolist (buf (buffer-list (selected-frame)))
-      (let ((win (get-buffer-window buf)))
-        (when (and (not (eq buf (current-buffer)))
-                   win
-                   (not (eq win (selected-window))))
-          (select-window win)
-          (throw 'done nil))))))
-
-(evil-define-command evil-window-next (count)
-  "Move the cursor to the next window in the cyclic order.
-With COUNT go to the count-th window in the order starting from
-top-left."
-  :repeat nil
-  (interactive "<c>")
-  (if (not count)
-      (select-window (next-window))
-    (evil-window-top-left)
-    (other-window (1- count))))
-
-(evil-define-command evil-window-prev (count)
-  "Move the cursor to the previous window in the cyclic order.
-With COUNT go to the count-th window in the order starting from
-top-left."
-  :repeat nil
-  (interactive "<c>")
-  (if (not count)
-      (select-window (previous-window))
-    (evil-window-top-left)
-    (other-window (1- count))))
-
-(evil-define-command evil-window-new (count file)
-  "Splits the current window horizontally
-and opens a new buffer or edits a certain FILE."
-  :repeat nil
-  (interactive "P<f>")
-  (let ((new-window (split-window (selected-window) count
-                                  (if evil-split-window-below 'below 'above))))
-    (when (and (not count) evil-auto-balance-windows)
-      (balance-windows (window-parent)))
-    (if file
-        (evil-edit file)
-      (let ((buffer (generate-new-buffer "*new*")))
-        (set-window-buffer new-window buffer)
-        (select-window new-window)
-        (with-current-buffer buffer
-          (funcall (default-value 'major-mode)))))))
-
-(evil-define-command evil-window-vnew (count file)
-  "Splits the current window vertically
-and opens a new buffer name or edits a certain FILE."
-  :repeat nil
-  (interactive "P<f>")
-  (let ((new-window (split-window (selected-window) count
-                                  (if evil-vsplit-window-right 'right 'left))))
-    (when (and (not count) evil-auto-balance-windows)
-      (balance-windows (window-parent)))
-    (if file
-        (evil-edit file)
-      (let ((buffer (generate-new-buffer "*new*")))
-        (set-window-buffer new-window buffer)
-        (select-window new-window)
-        (with-current-buffer buffer
-          (funcall (default-value 'major-mode)))))))
-
-(evil-define-command evil-buffer-new (count file)
-  "Creates a new buffer replacing the current window, optionally
-   editing a certain FILE"
-  :repeat nil
-  (interactive "P<f>")
-  (if file
-      (evil-edit file)
-    (let ((buffer (generate-new-buffer "*new*")))
-      (set-window-buffer nil buffer)
-      (with-current-buffer buffer
-        (funcall (default-value 'major-mode))))))
-
-(evil-define-command evil-window-increase-height (count)
-  "Increase current window height by COUNT."
-  :repeat nil
-  (interactive "p")
-  (evil-resize-window (+ (window-height) count)))
-
-(evil-define-command evil-window-decrease-height (count)
-  "Decrease current window height by COUNT."
-  :repeat nil
-  (interactive "p")
-  (evil-resize-window (- (window-height) count)))
-
-(evil-define-command evil-window-increase-width (count)
-  "Increase current window width by COUNT."
-  :repeat nil
-  (interactive "p")
-  (evil-resize-window (+ (window-width) count) t))
-
-(evil-define-command evil-window-decrease-width (count)
-  "Decrease current window width by COUNT."
-  :repeat nil
-  (interactive "p")
-  (evil-resize-window (- (window-width) count) t))
-
-(evil-define-command evil-window-set-height (count)
-  "Sets the height of the current window to COUNT."
-  :repeat nil
-  (interactive "<c>")
-  (evil-resize-window (or count (frame-height)) nil))
-
-(evil-define-command evil-window-set-width (count)
-  "Sets the width of the current window to COUNT."
-  :repeat nil
-  (interactive "<c>")
-  (evil-resize-window (or count (frame-width)) t))
-
-(evil-define-command evil-ex-resize (arg)
-  "The ex :resize command.
-
-If ARG is a signed positive integer, increase the current window
-height by ARG.
-
-If ARG is a signed negative integer, decrease the current window
-height by ARG.
-
-If ARG is a positive integer without explicit sign, set the current
-window height to ARG.
-
-If ARG is empty, maximize the current window height."
-  (interactive "<a>")
-  (if (or (not arg) (= 0 (length arg)))
-      (evil-window-set-height nil)
-    (let ((n (string-to-number arg)))
-      (if (> n 0)
-          (if (= ?+ (aref arg 0))
-              (evil-window-increase-height n)
-            (evil-window-set-height n))
-        (evil-window-decrease-height (- n))))))
-
-(evil-define-command evil-window-rotate-upwards ()
-  "Rotates the windows according to the currenty cyclic ordering."
-  :repeat nil
-  (let ((wlist (window-list))
-        (blist (mapcar #'(lambda (w) (window-buffer w))
-                       (window-list))))
-    (setq blist (append (cdr blist) (list (car blist))))
-    (while (and wlist blist)
-      (set-window-buffer (car wlist) (car blist))
-      (setq wlist (cdr wlist)
-            blist (cdr blist)))
-    (select-window (car (last (window-list))))))
-
-(evil-define-command evil-window-rotate-downwards ()
-  "Rotates the windows according to the currenty cyclic ordering."
-  :repeat nil
-  (let ((wlist (window-list))
-        (blist (mapcar #'(lambda (w) (window-buffer w))
-                       (window-list))))
-    (setq blist (append (last blist) blist))
-    (while (and wlist blist)
-      (set-window-buffer (car wlist) (car blist))
-      (setq wlist (cdr wlist)
-            blist (cdr blist)))
-    (select-window (cadr (window-list)))))
-
-(evil-define-command evil-window-move-very-top ()
-  "Closes the current window, splits the upper-left one horizontally
-and redisplays the current buffer there."
-  :repeat nil
-  (unless (one-window-p)
-    (save-excursion
-      (let ((b (current-buffer)))
-        (delete-window)
-        (let ((btree (evil-get-buffer-tree (car (window-tree)))))
-          (delete-other-windows)
-          (let ((newwin (selected-window))
-                (subwin (split-window)))
-            (evil-restore-window-tree subwin btree)
-            (set-window-buffer newwin b)
-            (select-window newwin)))))
-    (balance-windows)))
-
-(evil-define-command evil-window-move-far-left ()
-  "Closes the current window, splits the upper-left one vertically
-and redisplays the current buffer there."
-  :repeat nil
-  (unless (one-window-p)
-    (save-excursion
-      (let ((b (current-buffer)))
-        (delete-window)
-        (let ((btree (evil-get-buffer-tree (car (window-tree)))))
-          (delete-other-windows)
-          (let ((newwin (selected-window))
-                (subwin (split-window-horizontally)))
-            (evil-restore-window-tree subwin btree)
-            (set-window-buffer newwin b)
-            (select-window newwin)))))
-    (balance-windows)))
-
-(evil-define-command evil-window-move-far-right ()
-  "Closes the current window, splits the lower-right one vertically
-and redisplays the current buffer there."
-  :repeat nil
-  (unless (one-window-p)
-    (save-excursion
-      (let ((b (current-buffer)))
-        (delete-window)
-        (let ((btree (evil-get-buffer-tree (car (window-tree)))))
-          (delete-other-windows)
-          (let ((subwin (selected-window))
-                (newwin (split-window-horizontally)))
-            (evil-restore-window-tree subwin btree)
-            (set-window-buffer newwin b)
-            (select-window newwin)))))
-    (balance-windows)))
-
-(evil-define-command evil-window-move-very-bottom ()
-  "Closes the current window, splits the lower-right one horizontally
-and redisplays the current buffer there."
-  :repeat nil
-  (unless (one-window-p)
-    (save-excursion
-      (let ((b (current-buffer)))
-        (delete-window)
-        (let ((btree (evil-get-buffer-tree (car (window-tree)))))
-          (delete-other-windows)
-          (let ((subwin (selected-window))
-                (newwin (split-window)))
-            (evil-restore-window-tree subwin btree)
-            (set-window-buffer newwin b)
-            (select-window newwin)))))
-    (balance-windows)))
-
-;;; Mouse handling
-
-;; Large parts of this code are taken from mouse.el which is
-;; distributed with GNU Emacs
-(defun evil-mouse-drag-region (start-event)
-  "Set the region to the text that the mouse is dragged over.
-Highlight the drag area as you move the mouse.
-This must be bound to a button-down mouse event.
-
-If the click is in the echo area, display the `*Messages*' buffer.
-
-START-EVENT should be the event that started the drag."
-  (interactive "e")
-  ;; Give temporary modes such as isearch a chance to turn off.
-  (run-hooks 'mouse-leave-buffer-hook)
-  (evil-mouse-drag-track start-event t))
-(evil-set-command-property 'evil-mouse-drag-region :keep-visual t)
-
-(defun evil-mouse-drag-track (start-event &optional
-                                          do-mouse-drag-region-post-process)
-  "Track mouse drags by highlighting area between point and cursor.
-The region will be defined with mark and point.
-DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by
-`mouse-drag-region'."
-  (mouse-minibuffer-check start-event)
-  (setq mouse-selection-click-count-buffer (current-buffer))
-  (deactivate-mark)
-  (let* ((scroll-margin 0) ; Avoid margin scrolling (Bug#9541).
-         (original-window (selected-window))
-         ;; We've recorded what we needed from the current buffer and
-         ;; window, now let's jump to the place of the event, where things
-         ;; are happening.
-         (_ (mouse-set-point start-event))
-         (echo-keystrokes 0)
-         (start-posn (event-start start-event))
-         (start-point (posn-point start-posn))
-         (start-window (posn-window start-posn))
-         (start-window-start (window-start start-window))
-         (start-hscroll (window-hscroll start-window))
-         (bounds (window-edges start-window))
-         (make-cursor-line-fully-visible nil)
-         (top (nth 1 bounds))
-         (bottom (if (window-minibuffer-p start-window)
-                     (nth 3 bounds)
-                   ;; Don't count the mode line.
-                   (1- (nth 3 bounds))))
-         (on-link (and mouse-1-click-follows-link
-                       (or mouse-1-click-in-non-selected-windows
-                           (eq start-window original-window))
-                       ;; Use start-point before the intangibility
-                       ;; treatment, in case we click on a link inside an
-                       ;; intangible text.
-                       (mouse-on-link-p start-posn)))
-         (click-count (1- (event-click-count start-event)))
-         (remap-double-click (and on-link
-                                  (eq mouse-1-click-follows-link 'double)
-                                  (= click-count 1)))
-         ;; Suppress automatic hscrolling, because that is a nuisance
-         ;; when setting point near the right fringe (but see below).
-         (auto-hscroll-mode-saved auto-hscroll-mode)
-         (auto-hscroll-mode nil)
-         event end end-point)
-
-    (setq mouse-selection-click-count click-count)
-    ;; In case the down click is in the middle of some intangible text,
-    ;; use the end of that text, and put it in START-POINT.
-    (if (< (point) start-point)
-        (goto-char start-point))
-    (setq start-point (point))
-    (if remap-double-click
-        (setq click-count 0))
-
-    (setq click-count (mod click-count 4))
-
-    ;; activate correct visual state
-    (let ((range (evil-mouse-start-end start-point start-point click-count)))
-      (set-mark (nth 0 range))
-      (goto-char (nth 1 range)))
-
-    (cond
-     ((= click-count 0)
-      (when (evil-visual-state-p) (evil-exit-visual-state)))
-     ((= click-count 1)
-      (evil-visual-char)
-      (evil-visual-post-command))
-     ((= click-count 2)
-      (evil-visual-line)
-      (evil-visual-post-command))
-     ((= click-count 3)
-      (evil-visual-block)
-      (evil-visual-post-command)))
-
-    ;; Track the mouse until we get a non-movement event.
-    (track-mouse
-      (while (progn
-               (setq event (read-event))
-               (or (mouse-movement-p event)
-                   (memq (car-safe event) '(switch-frame select-window))))
-        (unless (evil-visual-state-p)
-          (cond
-           ((= click-count 0) (evil-visual-char))
-           ((= click-count 1) (evil-visual-char))
-           ((= click-count 2) (evil-visual-line))
-           ((= click-count 3) (evil-visual-block))))
-
-        (evil-visual-pre-command)
-        (unless (memq (car-safe event) '(switch-frame select-window))
-          ;; Automatic hscrolling did not occur during the call to
-          ;; `read-event'; but if the user subsequently drags the
-          ;; mouse, go ahead and hscroll.
-          (let ((auto-hscroll-mode auto-hscroll-mode-saved))
-            (redisplay))
-          (setq end (event-end event)
-                end-point (posn-point end))
-          (if (and (eq (posn-window end) start-window)
-                   (integer-or-marker-p end-point))
-              (evil-mouse--drag-set-mark-and-point start-point
-                                                   end-point click-count)
-            (let ((mouse-row (cdr (cdr (mouse-position)))))
-              (cond
-               ((null mouse-row))
-               ((< mouse-row top)
-                (mouse-scroll-subr start-window (- mouse-row top)
-                                   nil start-point))
-               ((>= mouse-row bottom)
-                (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
-                                   nil start-point))))))
-        (evil-visual-post-command)))
-
-    ;; Handle the terminating event if possible.
-    (when (consp event)
-      ;; Ensure that point is on the end of the last event.
-      (when (and (setq end-point (posn-point (event-end event)))
-                 (eq (posn-window end) start-window)
-                 (integer-or-marker-p end-point)
-                 (/= start-point end-point))
-        (evil-mouse--drag-set-mark-and-point start-point
-                                             end-point click-count))
-
-      ;; Find its binding.
-      (let* ((fun (key-binding (vector (car event))))
-             (do-multi-click (and (> (event-click-count event) 0)
-                                  (functionp fun)
-                                  (not (memq fun '(mouse-set-point
-                                                   mouse-set-region))))))
-        (if (and (or (/= (mark) (point))
-                     (= click-count 1) ; word selection
-                     (and (memq (evil-visual-type) '(line block))))
-                 (not do-multi-click))
-
-            ;; If point has moved, finish the drag.
-            (let (last-command this-command)
-              (and mouse-drag-copy-region
-                   do-mouse-drag-region-post-process
-                   (let (deactivate-mark)
-                     (evil-visual-expand-region)
-                     (copy-region-as-kill (mark) (point))
-                     (evil-visual-contract-region))))
-
-          ;; If point hasn't moved, run the binding of the
-          ;; terminating up-event.
-          (if do-multi-click
-              (goto-char start-point)
-            (deactivate-mark))
-          (when (and (functionp fun)
-                     (= start-hscroll (window-hscroll start-window))
-                     ;; Don't run the up-event handler if the window
-                     ;; start changed in a redisplay after the
-                     ;; mouse-set-point for the down-mouse event at
-                     ;; the beginning of this function.  When the
-                     ;; window start has changed, the up-mouse event
-                     ;; contains a different position due to the new
-                     ;; window contents, and point is set again.
-                     (or end-point
-                         (= (window-start start-window)
-                            start-window-start)))
-            (when (and on-link
-                       (= start-point (point))
-                       (evil-mouse--remap-link-click-p start-event event))
-              ;; If we rebind to mouse-2, reselect previous selected
-              ;; window, so that the mouse-2 event runs in the same
-              ;; situation as if user had clicked it directly.  Fixes
-              ;; the bug reported by juri@jurta.org on 2005-12-27.
-              (if (or (vectorp on-link) (stringp on-link))
-                  (setq event (aref on-link 0))
-                (select-window original-window)
-                (setcar event 'mouse-2)
-                ;; If this mouse click has never been done by the
-                ;; user, it doesn't have the necessary property to be
-                ;; interpreted correctly.
-                (put 'mouse-2 'event-kind 'mouse-click)))
-            (push event unread-command-events)))))))
-
-;; This function is a plain copy of `mouse--drag-set-mark-and-point',
-;; which is only available in Emacs 24
-(defun evil-mouse--drag-set-mark-and-point (start click click-count)
-  (let* ((range (evil-mouse-start-end start click click-count))
-         (beg (nth 0 range))
-         (end (nth 1 range)))
-    (cond ((eq (mark) beg)
-           (goto-char end))
-          ((eq (mark) end)
-           (goto-char beg))
-          ((< click (mark))
-           (set-mark end)
-           (goto-char beg))
-          (t
-           (set-mark beg)
-           (goto-char end)))))
-
-;; This function is a plain copy of `mouse--remap-link-click-p',
-;; which is only available in Emacs 23
-(defun evil-mouse--remap-link-click-p (start-event end-event)
-  (or (and (eq mouse-1-click-follows-link 'double)
-           (= (event-click-count start-event) 2))
-      (and
-       (not (eq mouse-1-click-follows-link 'double))
-       (= (event-click-count start-event) 1)
-       (= (event-click-count end-event) 1)
-       (or (not (integerp mouse-1-click-follows-link))
-           (let ((t0 (posn-timestamp (event-start start-event)))
-                 (t1 (posn-timestamp (event-end   end-event))))
-             (and (integerp t0) (integerp t1)
-                  (if (> mouse-1-click-follows-link 0)
-                      (<= (- t1 t0) mouse-1-click-follows-link)
-                    (< (- t0 t1) mouse-1-click-follows-link))))))))
-
-(defun evil-mouse-start-end (start end mode)
-  "Return a list of region bounds based on START and END according to MODE.
-If MODE is not 1 then set point to (min START END), mark to (max
-START END).  If MODE is 1 then set point to start of word at (min
-START END), mark to end of word at (max START END)."
-  (evil-sort start end)
-  (setq mode (mod mode 4))
-  (if (/= mode 1) (list start end)
-    (list
-     (save-excursion
-       (goto-char (min (point-max) (1+ start)))
-       (if (zerop (forward-thing evil-mouse-word -1))
-           (let ((bpnt (point)))
-             (forward-thing evil-mouse-word +1)
-             (if (> (point) start) bpnt (point)))
-         (point-min)))
-     (save-excursion
-       (goto-char end)
-       (1-
-        (if (zerop (forward-thing evil-mouse-word +1))
-            (let ((epnt (point)))
-              (forward-thing evil-mouse-word -1)
-              (if (<= (point) end) epnt (point)))
-          (point-max)))))))
-
-;;; State switching
-
-(evil-define-command evil-exit-emacs-state (&optional buffer message)
-  "Exit Emacs state.
-Changes the state to the previous state, or to Normal state
-if the previous state was Emacs state."
-  :keep-visual t
-  :suppress-operator t
-  (interactive '(nil t))
-  (with-current-buffer (or buffer (current-buffer))
-    (when (evil-emacs-state-p)
-      (evil-change-to-previous-state buffer message)
-      (when (evil-emacs-state-p)
-        (evil-normal-state (and message 1))))))
-
-(defun evil-execute-in-normal-state ()
-  "Execute the next command in Normal state."
-  (interactive)
-  (evil-delay '(not (memq this-command
-                          '(evil-execute-in-normal-state
-                            evil-use-register
-                            digit-argument
-                            negative-argument
-                            universal-argument
-                            universal-argument-minus
-                            universal-argument-more
-                            universal-argument-other-key)))
-      `(progn
-         (with-current-buffer ,(current-buffer)
-           (evil-change-state ',evil-state)
-           (setq evil-move-cursor-back ',evil-move-cursor-back)))
-    'post-command-hook)
-  (setq evil-move-cursor-back nil)
-  (evil-normal-state)
-  (evil-echo "Switched to Normal state for the next command ..."))
-
-(defun evil-stop-execute-in-emacs-state ()
-  (when (and (not (eq this-command #'evil-execute-in-emacs-state))
-             (not (minibufferp)))
-    (remove-hook 'post-command-hook 'evil-stop-execute-in-emacs-state)
-    (when (buffer-live-p evil-execute-in-emacs-state-buffer)
-      (with-current-buffer evil-execute-in-emacs-state-buffer
-        (if (and (eq evil-previous-state 'visual)
-                 (not (use-region-p)))
-            (progn
-              (evil-change-to-previous-state)
-              (evil-exit-visual-state))
-          (evil-change-to-previous-state))))
-    (setq evil-execute-in-emacs-state-buffer nil)))
-
-(evil-define-command evil-execute-in-emacs-state ()
-  "Execute the next command in Emacs state."
-  (add-hook 'post-command-hook #'evil-stop-execute-in-emacs-state t)
-  (setq evil-execute-in-emacs-state-buffer (current-buffer))
-  (cond
-   ((evil-visual-state-p)
-    (let ((mrk (mark))
-          (pnt (point)))
-      (evil-emacs-state)
-      (set-mark mrk)
-      (goto-char pnt)))
-   (t
-    (evil-emacs-state)))
-  (evil-echo "Switched to Emacs state for the next command ..."))
-
-(defun evil-exit-visual-and-repeat (event)
-  "Exit insert state and repeat event.
-This special command should be used if some command called from
-visual state should actually be called in normal-state.  The main
-reason for doing this is that the repeat system should *not*
-record the visual state information for some command.  This
-command should be bound to exactly the same event in visual state
-as the original command is bound in normal state.  EVENT is the
-event that triggered the execution of this command."
-  (interactive "e")
-  (when (evil-visual-state-p)
-    (evil-exit-visual-state)
-    (push event unread-command-events)))
-(evil-declare-ignore-repeat 'evil-exit-visual-and-repeat)
-
-(provide 'evil-commands)
-
-;;; evil-commands.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-commands.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-common.el
@@ -1,3875 +0,0 @@
-;;; evil-common.el --- Common functions and utilities
-;; Author: Vegard Øye <vegard_oye at hotmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-(require 'evil-vars)
-(require 'evil-digraphs)
-(require 'rect)
-(require 'thingatpt)
-(eval-when-compile (require 'cl))
-
-;;; Code:
-
-(declare-function evil-visual-state-p "evil-states")
-(declare-function evil-visual-restore "evil-states")
-(declare-function evil-motion-state "evil-states")
-(declare-function evil-ex-p "evil-ex")
-(declare-function evil-set-jump "evil-jumps")
-
-(condition-case nil
-    (require 'windmove)
-  (error
-   (message "evil: Could not load `windmove', \
-window commands not available.")
-   nil))
-
-;;; Compatibility with different Emacs versions
-
-(defmacro evil-called-interactively-p ()
-  "Wrapper for `called-interactively-p'.
-In older versions of Emacs, `called-interactively-p' takes
-no arguments.  In Emacs 23.2 and newer, it takes one argument."
-  (called-interactively-p 'any))
-(make-obsolete 'evil-called-interactively-p
-               "please use (called-interactively-p 'any) instead."
-               "Git commit 222b791")
-
-;; macro helper
-(eval-and-compile
-  (defun evil-unquote (exp)
-    "Return EXP unquoted."
-    (while (eq (car-safe exp) 'quote)
-      (setq exp (cadr exp)))
-    exp))
-
-(defun evil-delay (condition form hook &optional append local name)
-  "Execute FORM when CONDITION becomes true, checking with HOOK.
-NAME specifies the name of the entry added to HOOK. If APPEND is
-non-nil, the entry is appended to the hook. If LOCAL is non-nil,
-the buffer-local value of HOOK is modified."
-  (if (and (not (booleanp condition)) (eval condition))
-      (eval form)
-    (let* ((name (or name (format "evil-delay-form-in-%s" hook)))
-           (fun (make-symbol name))
-           (condition (or condition t)))
-      (fset fun `(lambda (&rest args)
-                   (when ,condition
-                     (remove-hook ',hook #',fun ',local)
-                     ,form)))
-      (put fun 'permanent-local-hook t)
-      (add-hook hook fun append local))))
-(put 'evil-delay 'lisp-indent-function 2)
-
-;;; List functions
-
-(defun evil-add-to-alist (list-var key val &rest elements)
-  "Add the assocation of KEY and VAL to the value of LIST-VAR.
-If the list already contains an entry for KEY, update that entry;
-otherwise add at the end of the list."
-  (let ((tail (symbol-value list-var)))
-    (while (and tail (not (equal (car-safe (car-safe tail)) key)))
-      (setq tail (cdr tail)))
-    (if tail
-        (setcar tail (cons key val))
-      (set list-var (append (symbol-value list-var)
-                            (list (cons key val)))))
-    (if elements
-        (apply #'evil-add-to-alist list-var elements)
-      (symbol-value list-var))))
-
-;; custom version of `delete-if'
-(defun evil-filter-list (predicate list &optional pointer)
-  "Delete by side-effect all items satisfying PREDICATE in LIST.
-Stop when reaching POINTER.  If the first item satisfies PREDICATE,
-there is no way to remove it by side-effect; therefore, write
-\(setq foo (evil-filter-list 'predicate foo)) to be sure of
-changing the value of `foo'."
-  (let ((tail list) elt head)
-    (while (and tail (not (eq tail pointer)))
-      (setq elt (car tail))
-      (cond
-       ((funcall predicate elt)
-        (setq tail (cdr tail))
-        (if head
-            (setcdr head tail)
-          (setq list tail)))
-       (t
-        (setq head tail
-              tail (cdr tail)))))
-    list))
-
-(defun evil-member-if (predicate list &optional pointer)
-  "Find the first item satisfying PREDICATE in LIST.
-Stop when reaching POINTER, which should point at a link
-in the list."
-  (let (elt)
-    (catch 'done
-      (while (and (consp list) (not (eq list pointer)))
-        (setq elt (car list))
-        (if (funcall predicate elt)
-            (throw 'done elt)
-          (setq list (cdr list)))))))
-
-(defun evil-member-recursive-if (predicate tree)
-  "Find the first item satisfying PREDICATE in TREE."
-  (cond
-   ((funcall predicate tree)
-    tree)
-   ((listp tree)
-    (catch 'done
-      (dolist (elt tree)
-        (when (setq elt (evil-member-recursive-if predicate elt))
-          (throw 'done elt)))))))
-
-(defun evil-concat-lists (&rest sequences)
-  "Concatenate lists, removing duplicates.
-Elements are compared with `eq'."
-  (let (result)
-    (dolist (sequence sequences)
-      (dolist (elt sequence)
-        (add-to-list 'result elt nil #'eq)))
-    (nreverse result)))
-
-(defun evil-concat-alists (&rest sequences)
-  "Concatenate association lists, removing duplicates.
-An alist is a list of cons cells (KEY . VALUE) where each key
-may occur only once. Later values overwrite earlier values."
-  (let (result)
-    (dolist (sequence sequences)
-      (dolist (elt sequence)
-        (setq result (assq-delete-all (car-safe elt) result))
-        (push elt result)))
-    (nreverse result)))
-
-(defun evil-concat-plists (&rest sequences)
-  "Concatenate property lists, removing duplicates.
-A property list is a list (:KEYWORD1 VALUE1 :KEYWORD2 VALUE2...)
-where each keyword may occur only once. Later values overwrite
-earlier values."
-  (let (result)
-    (dolist (sequence sequences result)
-      (while sequence
-        (setq result
-              (plist-put result (pop sequence) (pop sequence)))))))
-
-(defun evil-concat-keymap-alists (&rest sequences)
-  "Concatenate keymap association lists, removing duplicates.
-A keymap alist is a list of cons cells (VAR . MAP) where each keymap
-may occur only once, but where the variables may be repeated
-\(e.g., (VAR . MAP1) (VAR . MAP2) is allowed). The order matters,
-with the highest priority keymaps being listed first."
-  (let (result)
-    (dolist (sequence sequences)
-      (dolist (elt sequence)
-        (unless (rassq (cdr-safe elt) result)
-          (push elt result))))
-    (nreverse result)))
-
-(defun evil-plist-delete (prop plist)
-  "Delete by side effect the property PROP from PLIST.
-If PROP is the first property in PLIST, there is no way
-to remove it by side-effect; therefore, write
-\(setq foo (evil-plist-delete :prop foo)) to be sure of
-changing the value of `foo'."
-  (let ((tail plist) elt head)
-    (while tail
-      (setq elt (car tail))
-      (cond
-       ((eq elt prop)
-        (setq tail (cdr (cdr tail)))
-        (if head
-            (setcdr (cdr head) tail)
-          (setq plist tail)))
-       (t
-        (setq head tail
-              tail (cdr (cdr tail))))))
-    plist))
-
-(defun evil-get-property (alist key &optional prop)
-  "Return property PROP for KEY in ALIST.
-ALIST is an association list with entries of the form
-\(KEY . PLIST), where PLIST is a property list.
-If PROP is nil, return all properties for KEY.
-If KEY is t, return an association list of keys
-and their PROP values."
-  (cond
-   ((null prop)
-    (cdr (assq key alist)))
-   ((eq key t)
-    (let (result val)
-      (dolist (entry alist result)
-        (setq key (car entry)
-              val (cdr entry))
-        (when (plist-member val prop)
-          (setq val (plist-get val prop))
-          (push (cons key val) result)))))
-   (t
-    (plist-get (cdr (assq key alist)) prop))))
-
-(defun evil-put-property (alist-var key prop val &rest properties)
-  "Set PROP to VAL for KEY in ALIST-VAR.
-ALIST-VAR points to an association list with entries of the form
-\(KEY . PLIST), where PLIST is a property list storing PROP and VAL."
-  (set alist-var
-       (let* ((alist (symbol-value alist-var))
-              (plist (cdr (assq key alist))))
-         (setq plist (plist-put plist prop val))
-         (when properties
-           (setq plist (evil-concat-plists plist properties)
-                 val (car (last properties))))
-         (setq alist (assq-delete-all key alist))
-         (push (cons key plist) alist)))
-  val)
-
-(defun evil-state-property (state prop &optional value)
-  "Return the value of property PROP for STATE.
-PROP is a keyword as used by `evil-define-state'.
-STATE is the state's symbolic name.
-If VALUE is non-nil and the value is a variable,
-return the value of that variable."
-  (let ((val (evil-get-property evil-state-properties state prop)))
-    (if (and value (symbolp val) (boundp val))
-        (symbol-value val)
-      val)))
-
-(defmacro evil-swap (this that &rest vars)
-  "Swap the values of variables THIS and THAT.
-If three or more arguments are given, the values are rotated.
-E.g., (evil-swap A B C) sets A to B, B to C, and C to A."
-  `(progn
-     (setq ,this (prog1 ,that
-                   (setq ,that ,this)))
-     ,@(when vars
-         `((evil-swap ,that ,@vars)))))
-
-(defmacro evil-sort (min max &rest vars)
-  "Place the smallest value in MIN and the largest in MAX.
-If three or more arguments are given, place the smallest
-value in the first argument and the largest in the last,
-sorting in between."
-  (let ((sorted (make-symbol "sortvar")))
-    `(let ((,sorted (sort (list ,min ,max ,@vars) '<)))
-       (setq ,min (pop ,sorted)
-             ,max (pop ,sorted)
-             ,@(apply #'append
-                      (mapcar #'(lambda (var)
-                                  (list var `(pop ,sorted)))
-                              vars))))))
-
-(defun evil-vector-to-string (vector)
-  "Turns vector into a string, changing <escape> to '\\e'"
-  (mapconcat (lambda (c)
-               (if (equal c 'escape)
-                   "\e"
-                 (make-string 1 c)))
-             vector
-             ""))
-
-;;; Command properties
-
-(defmacro evil-define-command (command &rest body)
-  "Define a command COMMAND.
-
-\(fn COMMAND (ARGS...) DOC [[KEY VALUE]...] BODY...)"
-  (declare (indent defun)
-           (debug (&define name
-                           [&optional lambda-list]
-                           [&optional stringp]
-                           [&rest keywordp sexp]
-                           [&optional ("interactive" [&rest form])]
-                           def-body)))
-  (let ((interactive '(interactive))
-        arg args doc doc-form key keys)
-    ;; collect arguments
-    (when (listp (car-safe body))
-      (setq args (pop body)))
-    ;; collect docstring
-    (when (> (length body) 1)
-      (if (eq (car-safe (car-safe body)) 'format)
-          (setq doc-form (pop body))
-        (when (stringp (car-safe body))
-          (setq doc (pop body)))))
-    ;; collect keywords
-    (setq keys (plist-put keys :repeat t))
-    (while (keywordp (car-safe body))
-      (setq key (pop body)
-            arg (pop body))
-      (unless nil ; TODO: add keyword check
-        (setq keys (plist-put keys key arg))))
-    ;; collect `interactive' form
-    (when (and body (consp (car body))
-               (eq (car (car body)) 'interactive))
-      (let* ((iform (pop body))
-             (result (apply #'evil-interactive-form (cdr iform)))
-             (form (car result))
-             (attrs (cdr result)))
-        (setq interactive `(interactive ,form)
-              keys (evil-concat-plists keys attrs))))
-    `(progn
-       ;; the compiler does not recognize `defun' inside `let'
-       ,(when (and command body)
-          `(defun ,command ,args
-             ,@(when doc `(,doc))
-             ,interactive
-             ,@body))
-       ,(when (and command doc-form)
-          `(put ',command 'function-documentation ,doc-form))
-       ;; set command properties for symbol or lambda function
-       (let ((func ',(if (and (null command) body)
-                         `(lambda ,args
-                            ,interactive
-                            ,@body)
-                       command)))
-         (apply #'evil-set-command-properties func ',keys)
-         func))))
-
-;; If no Evil properties are defined for the command, several parts of
-;; Evil apply certain default rules; e.g., the repeat system decides
-;; whether the command is repeatable by monitoring buffer changes.
-(defun evil-has-command-property-p (command property)
-  "Whether COMMAND has Evil PROPERTY.
-See also `evil-has-command-properties-p'."
-  (plist-member (evil-get-command-properties command) property))
-
-(defun evil-has-command-properties-p (command)
-  "Whether Evil properties are defined for COMMAND.
-See also `evil-has-command-property-p'."
-  (and (evil-get-command-properties command) t))
-
-(defun evil-get-command-property (command property &optional default)
-  "Return the value of Evil PROPERTY of COMMAND.
-If the command does not have the property, return DEFAULT.
-See also `evil-get-command-properties'."
-  (if (evil-has-command-property-p command property)
-      (evil-get-property evil-command-properties command property)
-    default))
-
-(defun evil-get-command-properties (command)
-  "Return all Evil properties of COMMAND.
-See also `evil-get-command-property'."
-  (evil-get-property evil-command-properties command))
-
-(defun evil-set-command-property (command property value)
-  "Set PROPERTY to VALUE for COMMAND.
-To set multiple properties at once, see
-`evil-set-command-properties' and `evil-add-command-properties'."
-  (evil-put-property 'evil-command-properties command property value))
-(defalias 'evil-put-command-property 'evil-set-command-property)
-
-(defun evil-add-command-properties (command &rest properties)
-  "Add PROPERTIES to COMMAND.
-PROPERTIES should be a property list.
-To replace all properties at once, use `evil-set-command-properties'."
-  (apply #'evil-put-property
-         'evil-command-properties command properties))
-
-(defun evil-set-command-properties (command &rest properties)
-  "Replace all of COMMAND's properties with PROPERTIES.
-PROPERTIES should be a property list.
-This erases all previous properties; to only add properties,
-use `evil-set-command-property'."
-  (setq evil-command-properties
-        (assq-delete-all command evil-command-properties))
-  (when properties
-    (apply #'evil-add-command-properties command properties)))
-
-(defun evil-remove-command-properties (command &rest properties)
-  "Remove PROPERTIES from COMMAND.
-PROPERTIES should be a list of properties (:PROP1 :PROP2 ...).
-If PROPERTIES is the empty list, all properties are removed."
-  (let (plist)
-    (when properties
-      (setq plist (evil-get-command-properties command))
-      (dolist (property properties)
-        (setq plist (evil-plist-delete property plist))))
-    (apply #'evil-set-command-properties command plist)))
-
-(defun evil-yank-handler (&optional motion)
-  "Return the yank handler for MOTION.
-MOTION defaults to the current motion."
-  (setq motion (or motion evil-this-motion))
-  (evil-get-command-property motion :yank-handler))
-
-(defun evil-declare-motion (command)
-  "Declare COMMAND to be a movement function.
-This ensures that it behaves correctly in Visual state."
-  (evil-add-command-properties command :keep-visual t :repeat 'motion))
-
-(defun evil-declare-repeat (command)
-  "Declare COMMAND to be repeatable."
-  (evil-add-command-properties command :repeat t))
-
-(defun evil-declare-not-repeat (command)
-  "Declare COMMAND to be nonrepeatable."
-  (evil-add-command-properties command :repeat nil))
-
-(defun evil-declare-ignore-repeat (command)
-  "Declare COMMAND to be nonrepeatable."
-  (evil-add-command-properties command :repeat 'ignore))
-
-(defun evil-declare-change-repeat (command)
-  "Declare COMMAND to be repeatable by buffer changes."
-  (evil-add-command-properties command :repeat 'change))
-
-(defun evil-declare-insert-at-point-repeat (command)
-  "Declare COMMAND to be repeatable by buffer changes."
-  (evil-add-command-properties command :repeat 'insert-at-point))
-
-(defun evil-declare-abort-repeat (command)
-  "Declare COMMAND to be nonrepeatable."
-  (evil-add-command-properties command :repeat 'abort))
-
-(defun evil-delimited-arguments (string &optional num)
-  "Parse STRING as a sequence of delimited arguments.
-Returns a list of NUM strings, or as many arguments as
-the string contains. The first non-blank character is
-taken to be the delimiter. If some arguments are missing
-from STRING, the resulting list is padded with nil values.
-Two delimiters following directly after each other gives
-an empty string."
-  (save-match-data
-    (let ((string (or string ""))
-          (count (or num -1)) (idx 0)
-          argument delim match result)
-      (when (string-match "^[[:space:]]*\\([^[:space:]]\\)" string)
-        (setq delim (match-string 1 string)
-              argument (format "%s\\(\\(?:[\\].\\|[^%s]\\)*\\)"
-                               (regexp-quote delim)
-                               delim))
-        (while (and (/= count 0) (string-match argument string idx))
-          (setq match (match-string 1 string)
-                idx (match-end 1)
-                count (1- count))
-          (when (= count 0)
-            (unless (save-match-data
-                      (string-match
-                       (format "%s[[:space:]]*$" delim) string idx))
-              (setq match (substring string (match-beginning 1)))))
-          (unless (and (zerop (length match))
-                       (zerop (length (substring string idx))))
-            (push match result))))
-      (when (and num (< (length result) num))
-        (dotimes (i (- num (length result)))
-          (push nil result)))
-      (nreverse result))))
-
-(defun evil-concat-charsets (&rest sets)
-  "Concatenate character sets.
-A character set is the part between [ and ] in a regular expression.
-If any character set is complemented, the result is also complemented."
-  (let ((bracket "") (complement "") (hyphen "") result)
-    (save-match-data
-      (dolist (set sets)
-        (when (string-match "^\\^" set)
-          (setq set (substring set 1)
-                complement "^"))
-        (when (string-match "^]" set)
-          (setq set (substring set 1)
-                bracket "]"))
-        (when (string-match "^-" set)
-          (setq set (substring set 1)
-                hyphen "-"))
-        (setq result (concat result set)))
-      (format "%s%s%s%s" complement bracket hyphen result))))
-
-;;; Key sequences
-
-(defun evil-keypress-parser (&optional input)
-  "Read from keyboard or INPUT and build a command description.
-Returns (CMD COUNT), where COUNT is the numeric prefix argument.
-Both COUNT and CMD may be nil."
-  (let (count negative)
-    (when input (setq unread-command-events (append input unread-command-events)))
-    (catch 'done
-      (while t
-        (let ((seq (read-key-sequence "")))
-          (when seq
-            (let ((cmd (key-binding seq)))
-              (cond
-               ((null cmd) (throw 'done (list nil nil)))
-               ((arrayp cmd) ; keyboard macro, recursive call
-                (let ((cmd (evil-keypress-parser cmd)))
-                  (throw 'done
-                         (list (car cmd)
-                               (if (or count (cadr cmd))
-                                   (list (car cmd) (* (or count 1)
-                                                      (or (cadr cmd) 1))))))))
-               ((or (eq cmd #'digit-argument)
-                    (and (eq cmd 'evil-digit-argument-or-evil-beginning-of-line)
-                         count))
-                (let* ((event (aref seq (- (length seq) 1)))
-                       (char (or (when (characterp event) event)
-                                 (when (symbolp event)
-                                   (get event 'ascii-character))))
-                       (digit (if (or (characterp char) (integerp char))
-                                  (- (logand char ?\177) ?0))))
-                  (setq count (+ (* 10 (or count 0)) digit))))
-               ((eq cmd #'negative-argument)
-                (setq negative (not negative)))
-               (t
-                (throw 'done (list cmd
-                                   (and count
-                                        (* count
-                                           (if negative -1 1))))))))))))))
-
-(defun evil-read-key (&optional prompt)
-  "Read a key from the keyboard.
-Translates it according to the input method."
-  (let ((old-global-map (current-global-map))
-        (new-global-map (make-sparse-keymap))
-        (overriding-terminal-local-map nil)
-        (overriding-local-map evil-read-key-map)
-        seq char cmd)
-    (unwind-protect
-        (condition-case nil
-            (progn
-              (define-key new-global-map [menu-bar]
-                (lookup-key global-map [menu-bar]))
-              (define-key new-global-map [tool-bar]
-                (lookup-key global-map [tool-bar]))
-              (add-to-list 'new-global-map
-                           (make-char-table 'display-table
-                                            'self-insert-command) t)
-              (use-global-map new-global-map)
-              (setq seq (read-key-sequence prompt nil t)
-                    char (aref seq 0)
-                    cmd (key-binding seq))
-              (while (arrayp cmd)
-                (setq char (aref cmd 0)
-                      cmd (key-binding cmd)))
-              (cond
-               ((eq cmd 'self-insert-command)
-                char)
-               (cmd
-                (call-interactively cmd))
-               (t
-                (user-error "No replacement character typed"))))
-          (quit
-           (when (fboundp 'evil-repeat-abort)
-             (evil-repeat-abort))
-           (signal 'quit nil)))
-      (use-global-map old-global-map))))
-
-(defun evil-read-quoted-char ()
-  "Command that calls `read-quoted-char'.
-This command can be used wherever `read-quoted-char' is required
-as a command. Its main use is in the `evil-read-key-map'."
-  (interactive)
-  (read-quoted-char))
-
-(defun evil-read-digraph-char (&optional hide-chars)
-  "Read two keys from keyboard forming a digraph.
-This function creates an overlay at (point), hiding the next
-HIDE-CHARS characters. HIDE-CHARS defaults to 1."
-  (interactive)
-  (let (char1 char2 string overlay)
-    (unwind-protect
-        (progn
-          (setq overlay (make-overlay (point)
-                                      (min (point-max)
-                                           (+ (or hide-chars 1)
-                                              (point)))))
-          (overlay-put overlay 'invisible t)
-          ;; create overlay prompt
-          (setq string "?")
-          (put-text-property 0 1 'face 'minibuffer-prompt string)
-          ;; put cursor at (i.e., right before) the prompt
-          (put-text-property 0 1 'cursor t string)
-          (overlay-put overlay 'after-string string)
-          (setq char1 (read-key))
-          (setq string (string char1))
-          (put-text-property 0 1 'face 'minibuffer-prompt string)
-          (put-text-property 0 1 'cursor t string)
-          (overlay-put overlay 'after-string string)
-          (setq char2 (read-key)))
-      (delete-overlay overlay))
-    (or (evil-digraph (list char1 char2))
-        ;; use the last character if undefined
-        char2)))
-
-(defun evil-read-motion (&optional motion count type modifier)
-  "Read a MOTION, motion COUNT and motion TYPE from the keyboard.
-The type may be overridden with MODIFIER, which may be a type
-or a Visual selection as defined by `evil-define-visual-selection'.
-Return a list (MOTION COUNT [TYPE])."
-  (let ((modifiers '((evil-visual-char . char)
-                     (evil-visual-line . line)
-                     (evil-visual-block . block)))
-        command prefix)
-    (setq evil-this-type-modified nil)
-    (unless motion
-      (while (progn
-               (setq command (evil-keypress-parser)
-                     motion (pop command)
-                     prefix (pop command))
-               (when prefix
-                 (if count
-                     (setq count (string-to-number
-                                  (concat (number-to-string count)
-                                          (number-to-string prefix))))
-                   (setq count prefix)))
-               ;; if the command is a type modifier, read more
-               (when (rassq motion evil-visual-alist)
-                 (setq modifier
-                       (or modifier
-                           (car (rassq motion evil-visual-alist))))))))
-    (when modifier
-      (setq type (or type (evil-type motion 'exclusive)))
-      (cond
-       ((eq modifier 'char)
-        ;; TODO: this behavior could be less hard-coded
-        (if (eq type 'exclusive)
-            (setq type 'inclusive)
-          (setq type 'exclusive)))
-       (t
-        (setq type modifier)))
-      (setq evil-this-type-modified type))
-    (list motion count type)))
-
-(defun evil-mouse-events-p (keys)
-  "Returns non-nil iff KEYS contains a mouse event."
-  (catch 'done
-    (dotimes (i (length keys))
-      (when (or (and (fboundp 'mouse-event-p)
-                     (mouse-event-p (aref keys i)))
-                (mouse-movement-p (aref keys i)))
-        (throw 'done t)))
-    nil))
-
-(defun evil-extract-count (keys)
-  "Splits the key-sequence KEYS into prefix-argument and the rest.
-Returns the list (PREFIX CMD SEQ REST), where PREFIX is the
-prefix count, CMD the command to be executed, SEQ the subsequence
-calling CMD, and REST is all remaining events in the
-key-sequence. PREFIX and REST may be nil if they do not exist.
-If a command is bound to some keyboard macro, it is expanded
-recursively."
-  (catch 'done
-    (let* ((len (length keys))
-           (beg 0)
-           (end 1)
-           (found-prefix nil))
-      (while (and (<= end len))
-        (let ((cmd (key-binding (substring keys beg end))))
-          (cond
-           ((memq cmd '(undefined nil))
-            (user-error "No command bound to %s" (substring keys beg end)))
-           ((arrayp cmd) ; keyboard macro, replace command with macro
-            (setq keys (vconcat (substring keys 0 beg)
-                                cmd
-                                (substring keys end))
-                  end (1+ beg)
-                  len (length keys)))
-           ((functionp cmd)
-            (if (or (memq cmd '(digit-argument negative-argument))
-                    (and found-prefix
-                         (evil-get-command-property
-                          cmd :digit-argument-redirection)))
-                ;; skip those commands
-                (setq found-prefix t ; found at least one prefix argument
-                      beg end
-                      end (1+ end))
-              ;; a real command, finish
-              (throw 'done
-                     (list (unless (zerop beg)
-                             (string-to-number
-                              (concat (substring keys 0 beg))))
-                           cmd
-                           (substring keys beg end)
-                           (when (< end len)
-                             (substring keys end))))))
-           (t ; append a further event
-            (setq end (1+ end))))))
-      (user-error "Key sequence contains no complete binding"))))
-
-(defmacro evil-redirect-digit-argument (map keys target)
-  "Bind a wrapper function calling TARGET or `digit-argument'.
-MAP is a keymap for binding KEYS to the wrapper for TARGET.
-The wrapper only calls `digit-argument' if a prefix-argument
-has already been started; otherwise TARGET is called."
-  (let* ((target (eval target))
-         (wrapper (intern (format "evil-digit-argument-or-%s"
-                                  target))))
-    `(progn
-       (define-key ,map ,keys ',wrapper)
-       (evil-define-command ,wrapper ()
-         :digit-argument-redirection ,target
-         :keep-visual t
-         :repeat nil
-         (interactive)
-         (cond
-          (current-prefix-arg
-           (setq this-command #'digit-argument)
-           (call-interactively #'digit-argument))
-          (t
-           (let ((target (or (command-remapping #',target)
-                             #',target)))
-             (setq this-command target)
-             (call-interactively target))))))))
-
-(defun evil-extract-append (file-or-append)
-  "Return an (APPEND . FILENAME) pair based on FILE-OR-APPEND.
-FILE-OR-APPEND should either be a filename or a \">> FILE\"
-directive.  APPEND will be t if FILE-OR-APPEND is an append
-directive and nil otherwise.  FILENAME will be the extracted
-filename."
-  (if (and (stringp file-or-append)
-           (string-match "\\(>> *\\)" file-or-append))
-      (cons t (substring file-or-append(match-end 1)))
-    (cons nil file-or-append)))
-
-(defun evil-set-keymap-prompt (map prompt)
-  "Set the prompt-string of MAP to PROMPT."
-  (delq (keymap-prompt map) map)
-  (when prompt
-    (setcdr map (cons prompt (cdr map)))))
-
-(defun evil-lookup-key (map key)
-  "Returns non-nil value if KEY is bound in MAP."
-  (let ((definition (lookup-key map key)))
-    (if (numberp definition) ; in-band error
-        nil
-      definition)))
-
-;;; Display
-
-(defun evil-set-cursor (specs)
-  "Change the cursor's apperance according to SPECS.
-SPECS may be a cursor type as per `cursor-type', a color
-string as passed to `set-cursor-color', a zero-argument
-function for changing the cursor, or a list of the above."
-  (unless (and (listp specs)
-               (null (cdr-safe (last specs))))
-    (setq specs (list specs)))
-  (dolist (spec specs)
-    (cond
-     ((functionp spec)
-      (condition-case nil
-          (funcall spec)
-        (error nil)))
-     ((stringp spec)
-      (evil-set-cursor-color spec))
-     (t
-      (setq cursor-type spec)))))
-
-(defun evil-set-cursor-color (color)
-  "Set the cursor color to COLOR."
-  (unless (equal (frame-parameter nil 'cursor-color) color)
-    ;; `set-cursor-color' forces a redisplay, so only
-    ;; call it when the color actually changes
-    (set-cursor-color color)))
-
-(defun evil-refresh-cursor (&optional state buffer)
-  "Refresh the cursor for STATE in BUFFER.
-BUFFER defaults to the current buffer.  If STATE is nil the
-cursor type is either `evil-force-cursor' or the current state."
-  (when (and (boundp 'evil-local-mode) evil-local-mode)
-    (let* ((state (or state evil-force-cursor evil-state 'normal))
-           (default (or evil-default-cursor t))
-           (cursor (evil-state-property state :cursor t))
-           (color (or (and (stringp cursor) cursor)
-                      (and (listp cursor)
-                           (evil-member-if #'stringp cursor))
-                      (frame-parameter nil 'cursor-color))))
-      (with-current-buffer (or buffer (current-buffer))
-        ;; if both STATE and `evil-default-cursor'
-        ;; specify a color, don't set it twice
-        (when (and color (listp default))
-          (setq default (evil-filter-list #'stringp default)))
-        (evil-set-cursor default)
-        (evil-set-cursor cursor)))))
-
-(defmacro evil-save-cursor (&rest body)
-  "Save the current cursor; execute BODY; restore the cursor."
-  (declare (indent defun)
-           (debug t))
-  `(let ((cursor cursor-type)
-         (color (frame-parameter (selected-frame) 'cursor-color))
-         (inhibit-quit t))
-     (unwind-protect
-         (progn ,@body)
-       (evil-set-cursor cursor)
-       (evil-set-cursor color))))
-
-(defun evil-echo (string &rest args)
-  "Display an unlogged message in the echo area.
-That is, the message is not logged in the *Messages* buffer.
-\(To log the message, just use `message'.)"
-  (unless evil-no-display
-    (let (message-log-max)
-      (apply #'message string args))))
-
-(defun evil-echo-area-save ()
-  "Save the current echo area in `evil-echo-area-message'."
-  (setq evil-echo-area-message (current-message)))
-
-(defun evil-echo-area-restore ()
-  "Restore the echo area from `evil-echo-area-message'.
-Does not restore if `evil-write-echo-area' is non-nil."
-  (unless evil-write-echo-area
-    (if evil-echo-area-message
-        (message "%s" evil-echo-area-message)
-      (message nil)))
-  (setq evil-echo-area-message nil
-        evil-write-echo-area nil))
-
-;; toggleable version of `with-temp-message'
-(defmacro evil-save-echo-area (&rest body)
-  "Save the echo area; execute BODY; restore the echo area.
-Intermittent messages are not logged in the *Messages* buffer."
-  (declare (indent defun)
-           (debug t))
-  `(let ((inhibit-quit t)
-         evil-echo-area-message
-         evil-write-echo-area)
-     (unwind-protect
-         (progn
-           (evil-echo-area-save)
-           ,@body)
-       (evil-echo-area-restore))))
-
-(defmacro evil-without-display (&rest body)
-  "Execute BODY without Evil displays.
-Inhibits echo area messages, mode line updates and cursor changes."
-  (declare (indent defun)
-           (debug t))
-  `(let ((evil-no-display t))
-     ,@body))
-
-(defun evil-num-visible-lines ()
-  "Returns the number of currently visible lines."
-  (- (window-height) 1))
-
-(defun evil-count-lines (beg end)
-  "Return absolute line-number-difference betweeen `beg` and `end`.
-This should give the same results no matter where on the line `beg`
-and `end` are."
-  (if (= beg end)
-      0
-    (let* ((last (max beg end))
-           (end-at-bol (save-excursion (goto-char last)
-                                       (bolp))))
-      (if end-at-bol
-          (count-lines beg end)
-        (1- (count-lines beg end))))))
-
-;;; Movement
-
-(defun evil-normalize-position (pos)
-  "Return POS if it does not exceed the buffer boundaries.
-If POS is less than `point-min', return `point-min'.
-Is POS is more than `point-max', return `point-max'.
-If POS is a marker, return its position."
-  (cond
-   ((not (number-or-marker-p pos))
-    pos)
-   ((< pos (point-min))
-    (point-min))
-   ((> pos (point-max))
-    (point-max))
-   ((markerp pos)
-    (marker-position pos))
-   (t
-    pos)))
-
-(defmacro evil-save-goal-column (&rest body)
-  "Restores the goal column after execution of BODY.
-See also `evil-save-column'."
-  (declare (indent defun)
-           (debug t))
-  `(let ((goal-column goal-column)
-         (temporary-goal-column temporary-goal-column))
-     ,@body))
-
-(defmacro evil-save-column (&rest body)
-  "Restores the column after execution of BODY.
-See also `evil-save-goal-column'."
-  (declare (indent defun)
-           (debug t))
-  `(let ((col (current-column)))
-     (evil-save-goal-column
-       ,@body
-       (move-to-column col))))
-
-(defun evil-narrow (beg end)
-  "Restrict the buffer to BEG and END.
-BEG or END may be nil, specifying a one-sided restriction including
-`point-min' or `point-max'. See also `evil-with-restriction.'"
-  (setq beg (or (evil-normalize-position beg) (point-min)))
-  (setq end (or (evil-normalize-position end) (point-max)))
-  (narrow-to-region beg end))
-
-(defmacro evil-with-restriction (beg end &rest body)
-  "Execute BODY with the buffer narrowed to BEG and END.
-BEG or END may be nil as passed to `evil-narrow'; this creates
-a one-sided restriction."
-  (declare (indent 2)
-           (debug t))
-  `(save-restriction
-     (let ((evil-restriction-stack
-            (cons (cons (point-min) (point-max)) evil-restriction-stack)))
-       (evil-narrow ,beg ,end)
-       ,@body)))
-
-(defmacro evil-without-restriction (&rest body)
-  "Execute BODY with the top-most narrowing removed.
-This works only if the previous narrowing has been generated by
-`evil-with-restriction'."
-  (declare (indent defun)
-           (debug t))
-  `(save-restriction
-     (widen)
-     (narrow-to-region (car (car evil-restriction-stack))
-                       (cdr (car evil-restriction-stack)))
-     (let ((evil-restriction-stack (cdr evil-restriction-stack)))
-       ,@body)))
-
-(defmacro evil-narrow-to-field (&rest body)
-  "Narrow to the current field."
-  (declare (indent defun)
-           (debug t))
-  `(evil-with-restriction (field-beginning) (field-end)
-     ,@body))
-
-(defun evil-move-beginning-of-line (&optional arg)
-  "Move to the beginning of the line as displayed.
-Like `move-beginning-of-line', but retains the goal column."
-  (evil-save-goal-column
-    (move-beginning-of-line arg)
-    (beginning-of-line)))
-
-(defun evil-move-end-of-line (&optional arg)
-  "Move to the end of the line as displayed.
-Like `move-end-of-line', but retains the goal column."
-  (evil-save-goal-column
-    (move-end-of-line arg)
-    (end-of-line)))
-
-(defun evil-adjust-cursor (&optional force)
-  "Move point one character back if at the end of a non-empty line.
-This behavior is contingent on the variable `evil-move-cursor-back';
-use the FORCE parameter to override it."
-  (when (and (eolp)
-             (not evil-move-beyond-eol)
-             (not (bolp))
-             (= (point)
-                (save-excursion
-                  (evil-move-end-of-line)
-                  (point))))
-    (evil-move-cursor-back force)))
-
-(defun evil-move-cursor-back (&optional force)
-  "Move point one character back within the current line.
-Contingent on the variable `evil-move-cursor-back' or the FORCE
-argument. Honors field boundaries, i.e., constrains the movement
-to the current field as recognized by `line-beginning-position'."
-  (when (or evil-move-cursor-back force)
-    (unless (or (= (point) (line-beginning-position))
-                (and (boundp 'visual-line-mode)
-                     visual-line-mode
-                     (= (point) (save-excursion
-                                  (beginning-of-visual-line)
-                                  (point)))))
-      (backward-char))))
-
-(defun evil-line-position (line &optional column)
-  "Return the position of LINE.
-If COLUMN is specified, return its position on the line.
-A negative number means the end of the line."
-  (save-excursion
-    (when (fboundp 'evil-goto-line)
-      (evil-goto-line line))
-    (if (numberp column)
-        (if (< column 0)
-            (beginning-of-line 2)
-          (move-to-column column))
-      (beginning-of-line))
-    (point)))
-
-(defun evil-column (&optional pos)
-  "Return the horizontal position of POS.
-POS defaults to point."
-  (save-excursion
-    (when pos
-      (goto-char pos))
-    (current-column)))
-
-(defun evil-move-to-column (column &optional dir force)
-  "Move point to column COLUMN in the current line.
-Places point at left of the tab character (at the right if DIR
-is non-nil) and returns point."
-  (interactive "p")
-  (move-to-column column force)
-  (unless force
-    (when (or (not dir) (and (numberp dir) (< dir 1)))
-      (when (> (current-column) column)
-        (evil-move-cursor-back))))
-  (point))
-
-(defmacro evil-loop (spec &rest body)
-  "Loop with countdown variable.
-Evaluate BODY with VAR counting down from COUNT to 0.
-COUNT can be negative, in which case VAR counts up instead.
-The return value is the value of VAR when the loop
-terminates, which is 0 if the loop completes successfully.
-RESULT specifies a variable for storing this value.
-
-\(fn (VAR COUNT [RESULT]) BODY...)"
-  (declare (indent defun)
-           (debug dolist))
-  (let* ((i (make-symbol "loopvar"))
-         (var (pop spec))
-         (count (pop spec))
-         (result (pop spec)))
-    (setq var (or (unless (eq var result) var) i)
-          result (or result var))
-    `(let ((,var ,count))
-       (setq ,result ,var)
-       (while (/= ,var 0)
-         ,@body
-         (if (> ,var 0)
-             (setq ,var (1- ,var))
-           (setq ,var (1+ ,var)))
-         (setq ,result ,var))
-       ,var)))
-
-;;; Motions
-
-(defmacro evil-motion-loop (spec &rest body)
-  "Loop a certain number of times.
-Evaluate BODY repeatedly COUNT times with VAR bound to 1 or -1,
-depending on the sign of COUNT. RESULT, if specified, holds
-the number of unsuccessful iterations, which is 0 if the loop
-completes successfully. This is also the return value.
-
-Each iteration must move point; if point does not change,
-the loop immediately quits. See also `evil-loop'.
-
-\(fn (VAR COUNT [RESULT]) BODY...)"
-  (declare (indent defun)
-           (debug ((symbolp form &optional symbolp) body)))
-  (let* ((var (or (pop spec) (make-symbol "unitvar")))
-         (countval (or (pop spec) 0))
-         (result (pop spec))
-         (i (make-symbol "loopvar"))
-         (count (make-symbol "countvar"))
-         (done (make-symbol "donevar"))
-         (orig (make-symbol "origvar")))
-    `(let* ((,count ,countval)
-            (,var (if (< ,count 0) -1 1)))
-       (catch ',done
-         (evil-loop (,i ,count ,result)
-           (let ((,orig (point)))
-             ,@body
-             (when (= (point) ,orig)
-               (throw ',done ,i))))))))
-
-(defmacro evil-signal-without-movement (&rest body)
-  "Catches errors provided point moves within this scope."
-  (declare (indent defun)
-           (debug t))
-  `(let ((p (point)))
-     (condition-case err
-         (progn ,@body)
-       (error
-        (when (= p (point))
-          (signal (car err) (cdr err)))))))
-
-(defun evil-signal-at-bob-or-eob (&optional count)
-  "Signals error if `point' is at boundaries.
-If `point' is at bob and COUNT is negative this function signal
-'beginning-of-buffer. If `point' is at eob and COUNT is positive
-this function singal 'end-of-buffer. This function should be used
-in motions. COUNT defaults to 1."
-  (setq count (or count 1))
-  (cond
-   ((< count 0) (evil-signal-at-bob))
-   ((> count 0) (evil-signal-at-eob))))
-
-(defun evil-signal-at-bob ()
-  "Signals 'beginning-of-buffer if `point' is at bob.
-This function should be used in backward motions. If `point' is at
-bob so that no further backward motion is possible the error
-'beginning-of-buffer is raised."
-  (when (bobp) (signal 'beginning-of-buffer nil)))
-
-(defun evil-signal-at-eob ()
-  "Signals 'end-of-buffer if `point' is at eob.
-This function should be used in forward motions. If `point' is close
-to eob so that no further forward motion is possible the error
-'end-of-buffer is raised. This is the case if `point' is at
-`point-max' or if is one position before `point-max',
-`evil-move-cursor-back' is non-nil and `point' is not at the end
-of a line. The latter is necessary because `point' cannot be
-moved to `point-max' if `evil-move-cursor-back' is non-nil and
-the last line in the buffer is not empty."
-  (when (or (eobp)
-            (and (not (eolp))
-                 evil-move-cursor-back
-                 (save-excursion (forward-char) (eobp))))
-    (signal 'end-of-buffer nil)))
-
-(defmacro evil-with-hproject-point-on-window (&rest body)
-  "Project point after BODY to current window.
-If point is on a position left or right of the current window
-then it is moved to the left and right boundary of the window,
-respectively. If `auto-hscroll-mode' is non-nil then the left and
-right positions are increased or decreased, respectively, by
-`horizontal-margin' so that no automatic scrolling occurs."
-  (declare (indent defun)
-           (debug t))
-  (let ((diff (make-symbol "diff"))
-        (left (make-symbol "left"))
-        (right (make-symbol "right")))
-    `(let ((,diff (if auto-hscroll-mode (1+ hscroll-margin) 0))
-           auto-hscroll-mode)
-       ,@body
-       (let* ((,left (+ (window-hscroll) ,diff))
-              (,right (+ (window-hscroll) (window-width) (- ,diff) -1)))
-         (move-to-column (min (max (current-column) ,left) ,right))))))
-
-(defun evil-goto-min (&rest positions)
-  "Go to the smallest position in POSITIONS.
-Non-numerical elements are ignored.
-See also `evil-goto-max'."
-  (when (setq positions (evil-filter-list
-                         #'(lambda (elt)
-                             (not (number-or-marker-p elt)))
-                         positions))
-    (goto-char (apply #'min positions))))
-
-(defun evil-goto-max (&rest positions)
-  "Go to the largest position in POSITIONS.
-Non-numerical elements are ignored.
-See also `evil-goto-min'."
-  (when (setq positions (evil-filter-list
-                         #'(lambda (elt)
-                             (not (number-or-marker-p elt)))
-                         positions))
-    (goto-char (apply #'max positions))))
-
-(defun evil-forward-not-thing (thing &optional count)
-  "Move point to the end or beginning of the complement of THING."
-  (evil-motion-loop (dir (or count 1))
-    (let (bnd)
-      (cond
-       ((> dir 0)
-        (while (and (setq bnd (bounds-of-thing-at-point thing))
-                    (< (point) (cdr bnd)))
-          (goto-char (cdr bnd)))
-        ;; no thing at (point)
-        (if (zerop (forward-thing thing))
-            ;; now at the end of the next thing
-            (let ((bnd (bounds-of-thing-at-point thing)))
-              (if (or (< (car bnd) (point))    ; end of a thing
-                      (= (car bnd) (cdr bnd))) ; zero width thing
-                  (goto-char (car bnd))
-                ;; beginning of yet another thing, go back
-                (forward-thing thing -1)))
-          (goto-char (point-max))))
-       (t
-        (while (and (not (bobp))
-                    (or (backward-char) t)
-                    (setq bnd (bounds-of-thing-at-point thing))
-                    (< (point) (cdr bnd)))
-          (goto-char (car bnd)))
-        ;; either bob or no thing at point
-        (goto-char
-         (if (and (not (bobp))
-                  (zerop (forward-thing thing -1))
-                  (setq bnd (bounds-of-thing-at-point thing)))
-             (cdr bnd)
-           (point-min))))))))
-
-(defun evil-bounds-of-not-thing-at-point (thing &optional which)
-  "Returns the bounds of a complement of THING at point.
-If there is a THING at point nil is returned.  Otherwise if WHICH
-is nil or 0 a cons cell (BEG . END) is returned. If WHICH is
-negative the beginning is returned. If WHICH is positive the END
-is returned."
-  (let ((pnt (point)))
-    (let ((beg (save-excursion
-                 (and (zerop (forward-thing thing -1))
-                      (forward-thing thing))
-                 (if (> (point) pnt) (point-min) (point))))
-          (end (save-excursion
-                 (and (zerop (forward-thing thing))
-                      (forward-thing thing -1))
-                 (if (< (point) pnt) (point-max) (point)))))
-      (when (and (<= beg (point)) (<= (point) end) (< beg end))
-        (cond
-         ((or (not which) (zerop which)) (cons beg end))
-         ((< which 0) beg)
-         ((> which 0) end))))))
-
-(defun evil-forward-nearest (count &rest forwards)
-  "Moves point forward to the first of several motions.
-FORWARDS is a list of forward motion functions (i.e. each moves
-point forward to the next end of a text object (if passed a +1)
-or backward to the preceeding beginning of a text object (if
-passed a -1)). This function calls each of these functions once
-and moves point to the nearest of the resulting positions. If
-COUNT is positive point is moved forward COUNT times, if negative
-point is moved backward -COUNT times."
-  (evil-motion-loop (dir (or count 1))
-    (let ((pnt (point))
-          (nxt (if (> dir 0) (point-max) (point-min))))
-      (dolist (fwd forwards)
-        (goto-char pnt)
-        (condition-case nil
-            (evil-with-restriction
-                (and (< dir 0)
-                     (save-excursion
-                       (goto-char nxt)
-                       (line-beginning-position 0)))
-                (and (> dir 0)
-                     (save-excursion
-                       (goto-char nxt)
-                       (line-end-position 2)))
-              (if (and (zerop (funcall fwd dir))
-                       (/= (point) pnt)
-                       (or (and (> dir 0) (< (point) nxt))
-                           (and (< dir 0) (> (point) nxt))))
-                  (setq nxt (point))))
-          (error)))
-      (goto-char nxt))))
-
-(defun bounds-of-evil-string-at-point (&optional state)
-  "Return the bounds of a string at point.
-If STATE is given it used a parsing state at point."
-  (save-excursion
-    (let ((state (or state (syntax-ppss))))
-      (and (nth 3 state)
-           (cons (nth 8 state)
-                 (and (parse-partial-sexp (point)
-                                          (point-max)
-                                          nil
-                                          nil
-                                          state
-                                          'syntax-table)
-                      (point)))))))
-(put 'evil-string 'bounds-of-thing-at-point #'bounds-of-evil-string-at-point)
-
-(defun bounds-of-evil-comment-at-point ()
-  "Return the bounds of a string at point."
-  (save-excursion
-    (let ((state (syntax-ppss)))
-      (and (nth 4 state)
-           (cons (nth 8 state)
-                 (and (parse-partial-sexp (point)
-                                          (point-max)
-                                          nil
-                                          nil
-                                          state
-                                          'syntax-table)
-                      (point)))))))
-(put 'evil-comment 'bounds-of-thing-at-point #'bounds-of-evil-comment-at-point)
-
-;; The purpose of this function is the provide line motions which
-;; preserve the column. This is how `previous-line' and `next-line'
-;; work, but unfortunately the behaviour is hard-coded: if and only if
-;; the last command was `previous-line' or `next-line', the column is
-;; preserved. Furthermore, in contrast to Vim, when we cannot go
-;; further, those motions move point to the beginning resp. the end of
-;; the line (we never want point to leave its column). The code here
-;; comes from simple.el, and I hope it will work in future.
-(defun evil-line-move (count &optional noerror)
-  "A wrapper for line motions which conserves the column.
-Signals an error at buffer boundaries unless NOERROR is non-nil."
-  (cond
-   (noerror
-    (condition-case nil
-        (evil-line-move count)
-      (error nil)))
-   (t
-    (evil-signal-without-movement
-      (setq this-command (if (>= count 0)
-                             #'next-line
-                           #'previous-line))
-      (let ((opoint (point)))
-        (condition-case err
-            (with-no-warnings
-              (funcall this-command (abs count)))
-          ((beginning-of-buffer end-of-buffer)
-           (let ((col (or goal-column
-                          (if (consp temporary-goal-column)
-                              (car temporary-goal-column)
-                            temporary-goal-column))))
-             (if line-move-visual
-                 (vertical-motion (cons col 0))
-               (line-move-finish col opoint (< count 0)))
-             ;; Maybe we should just `ding'?
-             (signal (car err) (cdr err))))))))))
-
-(defun evil-forward-syntax (syntax &optional count)
-  "Move point to the end or beginning of a sequence of characters in
-SYNTAX.
-Stop on reaching a character not in SYNTAX."
-  (let ((notsyntax (if (= (aref syntax 0) ?^)
-                       (substring syntax 1)
-                     (concat "^" syntax))))
-    (evil-motion-loop (dir (or count 1))
-      (cond
-       ((< dir 0)
-        (skip-syntax-backward notsyntax)
-        (skip-syntax-backward syntax))
-       (t
-        (skip-syntax-forward notsyntax)
-        (skip-syntax-forward syntax))))))
-
-(defun evil-forward-chars (chars &optional count)
-  "Move point to the end or beginning of a sequence of CHARS.
-CHARS is a character set as inside [...] in a regular expression."
-  (let ((notchars (if (= (aref chars 0) ?^)
-                      (substring chars 1)
-                    (concat "^" chars))))
-    (evil-motion-loop (dir (or count 1))
-      (cond
-       ((< dir 0)
-        (skip-chars-backward notchars)
-        (skip-chars-backward chars))
-       (t
-        (skip-chars-forward notchars)
-        (skip-chars-forward chars))))))
-
-(defun evil-up-block (beg end &optional count)
-  "Move point to the end or beginning of text enclosed by BEG and END.
-BEG and END should be regular expressions matching the opening
-and closing delimiters, respectively. If COUNT is greater than
-zero point is moved forward otherwise it is moved
-backwards. Whenever an opening delimiter is found the COUNT is
-increased by one, if a closing delimiter is found the COUNT is
-decreased by one. The motion stops when COUNT reaches zero. The
-match-data reflects the last successful match (that caused COUNT
-to reach zero). The behaviour of this functions is similar to
-`up-list'."
-  (let* ((count (or count 1))
-         (forwardp (> count 0))
-         (dir (if forwardp +1 -1)))
-    (catch 'done
-      (while (not (zerop count))
-        (let* ((pnt (point))
-               (cl (save-excursion
-                     (and (re-search-forward (if forwardp end beg) nil t dir)
-                          (or (/= pnt (point))
-                              (progn
-                                ;; zero size match, repeat search from
-                                ;; the next position
-                                (forward-char dir)
-                                (re-search-forward (if forwardp end beg) nil t dir)))
-                          (point))))
-               (match (match-data t))
-               (op (save-excursion
-                     (and (not (equal beg end))
-                          (re-search-forward (if forwardp beg end) cl t dir)
-                          (or (/= pnt (point))
-                              (progn
-                                ;; zero size match, repeat search from
-                                ;; the next position
-                                (forward-char dir)
-                                (re-search-forward (if forwardp beg end) cl t dir)))
-                          (point)))))
-          (cond
-           ((not cl)
-            (goto-char (if forwardp (point-max) (point-min)))
-            (set-match-data nil)
-            (throw 'done count))
-           (t
-            (if op
-                (progn
-                  (setq count (if forwardp (1+ count) (1- count)))
-                  (goto-char op))
-              (setq count (if forwardp (1- count) (1+ count)))
-              (if (zerop count) (set-match-data match))
-              (goto-char cl))))))
-      0)))
-
-(defun evil-up-paren (open close &optional count)
-  "Move point to the end or beginning of balanced parentheses.
-OPEN and CLOSE should be characters identifying the opening and
-closing parenthesis, respectively. If COUNT is greater than zero
-point is moved forward otherwise it is moved backwards. Whenever
-an opening delimiter is found the COUNT is increased by one, if a
-closing delimiter is found the COUNT is decreased by one. The
-motion stops when COUNT reaches zero. The match-data reflects the
-last successful match (that caused COUNT to reach zero)."
-  ;; Always use the default `forward-sexp-function'. This is important
-  ;; for modes that use a custom one like `python-mode'.
-  ;; (addresses #364)
-  (let (forward-sexp-function)
-    (with-syntax-table (copy-syntax-table (syntax-table))
-      (modify-syntax-entry open (format "(%c" close))
-      (modify-syntax-entry close (format ")%c" open))
-      (let ((rest (evil-motion-loop (dir count)
-                    (let ((pnt (point)))
-                      (condition-case nil
-                          (cond
-                           ((> dir 0)
-                            (while (progn
-                                     (up-list dir)
-                                     (/= (char-before) close))))
-                           (t
-                            (while (progn
-                                     (up-list dir)
-                                     (/= (char-after) open)))))
-                        (error (goto-char pnt)))))))
-        (cond
-         ((= rest count) (set-match-data nil))
-         ((> count 0) (set-match-data (list (1- (point)) (point))))
-         (t (set-match-data (list (point) (1+ (point))))))
-        rest))))
-
-(defun evil-up-xml-tag (&optional count)
-  "Move point to the end or beginning of balanced xml tags.
-OPEN and CLOSE should be characters identifying the opening and
-closing parenthesis, respectively. If COUNT is greater than zero
-point is moved forward otherwise it is moved backwards. Whenever
-an opening delimiter is found the COUNT is increased by one, if a
-closing delimiter is found the COUNT is decreased by one. The
-motion stops when COUNT reaches zero. The match-data reflects the
-last successful match (that caused COUNT to reach zero)."
-  (let* ((dir (if (> (or count 1) 0) +1 -1))
-         (count (abs (or count 1)))
-         (match (> count 0))
-         (op (if (> dir 0) 1 2))
-         (cl (if (> dir 0) 2 1))
-         (orig (point))
-         pnt tags match)
-    (catch 'done
-      (while (> count 0)
-        ;; find the previous opening tag
-        (while
-            (and (setq match
-                       (re-search-forward
-                        "<\\([^/ >]+\\)\\(?:[^\"/>]\\|\"[^\"]*\"\\)*?>\\|</\\([^>]+?\\)>"
-                        nil t dir))
-                 (cond
-                  ((match-beginning op)
-                   (push (match-string op) tags))
-                  ((null tags) nil) ; free closing tag
-                  ((and (< dir 0)
-                        (string= (car tags) (match-string cl)))
-                   ;; in backward direction we only accept matching
-                   ;; tags. If the current tag is a free opener
-                   ;; without matching closing tag, the subsequents
-                   ;; test will make us ignore this tag
-                   (pop tags))
-                  ((and (> dir 0))
-                   ;; non matching openers are considered free openers
-                   (while (and tags
-                               (not (string= (car tags)
-                                             (match-string cl))))
-                     (pop tags))
-                   (pop tags)))))
-        (unless (setq match (and match (match-data t)))
-          (setq match nil)
-          (throw 'done count))
-        ;; found closing tag, look for corresponding opening tag
-        (cond
-         ((> dir 0)
-          (setq pnt (match-end 0))
-          (goto-char (match-beginning 0)))
-         (t
-          (setq pnt (match-beginning 0))
-          (goto-char (match-end 0))))
-        (let* ((tag (match-string cl))
-               (refwd (concat "<\\(/\\)?"
-                              (regexp-quote tag)
-                              "\\(?:>\\| \\(?:[^\"/>]\\|\"[^\"]*\"\\)*?>\\)"))
-               (cnt 1))
-          (while (and (> cnt 0) (re-search-backward refwd nil t dir))
-            (setq cnt (+ cnt (if (match-beginning 1) dir (- dir)))))
-          (if (zerop cnt) (setq count (1- count) tags nil))
-          (goto-char pnt)))
-      (if (> count 0)
-          (set-match-data nil)
-        (set-match-data match)
-        (goto-char (if (> dir 0) (match-end 0) (match-beginning 0)))))
-    ;; if not found, set to point-max/point-min
-    (unless (zerop count)
-      (set-match-data nil)
-      (goto-char (if (> dir 0) (point-max) (point-min)))
-      (if (/= (point) orig) (setq count (1- count))))
-    (* dir count)))
-
-(defun evil-forward-quote (quote &optional count)
-  "Move point to the end or beginning of a string.
-QUOTE is the character delimiting the string. If COUNT is greater
-than zero point is moved forward otherwise it is moved
-backwards."
-  (let (reset-parser)
-    (with-syntax-table (copy-syntax-table (syntax-table))
-      (unless (= (char-syntax quote) ?\")
-        (modify-syntax-entry quote "\"")
-        (setq reset-parser t))
-      ;; global parser state is out of state, use local one
-      (let* ((pnt (point))
-             (state (save-excursion
-                      (beginning-of-defun)
-                      (parse-partial-sexp (point) pnt nil nil (syntax-ppss))))
-             (bnd (bounds-of-evil-string-at-point state)))
-        (when (and bnd (< (point) (cdr bnd)))
-          ;; currently within a string
-          (if (> count 0)
-              (progn
-                (goto-char (cdr bnd))
-                (setq count (1- count)))
-            (goto-char (car bnd))
-            (setq count (1+ count))))
-        ;; forward motions work with local parser state
-        (cond
-         ((> count 0)
-          ;; no need to reset global parser state because we only use
-          ;; the local one
-          (setq reset-parser nil)
-          (catch 'done
-            (while (and (> count 0) (not (eobp)))
-              (setq state (parse-partial-sexp (point) (point-max)
-                                              nil
-                                              nil
-                                              state
-                                              'syntax-table))
-              (cond
-               ((nth 3 state)
-                (setq bnd (bounds-of-thing-at-point 'evil-string))
-                (goto-char (cdr bnd))
-                (setq count (1- count)))
-               ((eobp) (goto-char pnt) (throw 'done nil))))))
-         ((< count 0)
-          ;; need to update global cache because of backward motion
-          (setq reset-parser (and reset-parser (point)))
-          (save-excursion
-            (beginning-of-defun)
-            (syntax-ppss-flush-cache (point)))
-          (catch 'done
-            (while (and (< count 0) (not (bobp)))
-              (setq pnt (point))
-              (while (and (not (bobp))
-                          (or (eobp) (/= (char-after) quote)))
-                (backward-char))
-              (cond
-               ((setq bnd (bounds-of-thing-at-point 'evil-string))
-                (goto-char (car bnd))
-                (setq count (1+ count)))
-               ((bobp) (goto-char pnt) (throw 'done nil))
-               (t (backward-char))))))
-         (t (setq reset-parser nil)))))
-    (when reset-parser
-      ;; reset global cache
-      (save-excursion
-        (goto-char reset-parser)
-        (beginning-of-defun)
-        (syntax-ppss-flush-cache (point))))
-    count))
-
-;;; Thing-at-point motion functions for Evil text objects and motions
-(defun forward-evil-empty-line (&optional count)
-  "Move forward COUNT empty lines."
-  (setq count (or count 1))
-  (cond
-   ((> count 0)
-    (while (and (> count 0) (not (eobp)))
-      (when (and (bolp) (eolp))
-        (setq count (1- count)))
-      (forward-line 1)))
-   (t
-    (while (and (< count 0) (not (bobp))
-                (zerop (forward-line -1)))
-      (when (and (bolp) (eolp))
-        (setq count (1+ count))))))
-  count)
-
-(defun forward-evil-space (&optional count)
-  "Move forward COUNT whitespace sequences [[:space:]]+."
-  (evil-forward-chars "[:space:]" count))
-
-(defun forward-evil-word (&optional count)
-  "Move forward COUNT words.
-Moves point COUNT words forward or (- COUNT) words backward if
-COUNT is negative. Point is placed after the end of the word (if
-forward) or at the first character of the word (if backward). A
-word is a sequence of word characters matching
-\[[:word:]] (recognized by `forward-word'), a sequence of
-non-whitespace non-word characters '[^[:word:]\\n\\r\\t\\f ]', or
-an empty line matching ^$."
-  (evil-forward-nearest
-   count
-   #'(lambda (&optional cnt)
-       (let ((word-separating-categories evil-cjk-word-separating-categories)
-             (word-combining-categories evil-cjk-word-combining-categories)
-             (pnt (point)))
-         (forward-word cnt)
-         (if (= pnt (point)) cnt 0)))
-   #'(lambda (&optional cnt)
-       (evil-forward-chars "^[:word:]\n\r\t\f " cnt))
-   #'forward-evil-empty-line))
-
-(defun forward-evil-WORD (&optional count)
-  "Move forward COUNT \"WORDS\".
-Moves point COUNT WORDS forward or (- COUNT) WORDS backward if
-COUNT is negative. Point is placed after the end of the WORD (if
-forward) or at the first character of the WORD (if backward). A
-WORD is a sequence of non-whitespace characters
-'[^\\n\\r\\t\\f ]', or an empty line matching ^$."
-  (evil-forward-nearest count
-                        #'(lambda (&optional cnt)
-                            (evil-forward-chars "^\n\r\t\f " cnt))
-                        #'forward-evil-empty-line))
-
-(defun forward-evil-symbol (&optional count)
-  "Move forward COUNT symbols.
-Moves point COUNT symbols forward or (- COUNT) symbols backward
-if COUNT is negative. Point is placed after the end of the
-symbol (if forward) or at the first character of the symbol (if
-backward). A symbol is either determined by `forward-symbol', or
-is a sequence of characters not in the word, symbol or whitespace
-syntax classes."
-  (evil-forward-nearest
-   count
-   #'(lambda (&optional cnt)
-       (evil-forward-syntax "^w_->" cnt))
-   #'(lambda (&optional cnt)
-       (let ((pnt (point)))
-         (forward-symbol cnt)
-         (if (= pnt (point)) cnt 0)))
-   #'forward-evil-empty-line))
-
-(defun forward-evil-defun (&optional count)
-  "Move forward COUNT defuns.
-Moves point COUNT defuns forward or (- COUNT) defuns backward
-if COUNT is negative.  A defun is defined by
-`beginning-of-defun' and `end-of-defun' functions."
-  (evil-motion-loop (dir (or count 1))
-    (if (> dir 0) (end-of-defun) (beginning-of-defun))))
-
-(defun forward-evil-sentence (&optional count)
-  "Move forward COUNT sentences.
-Moves point COUNT sentences forward or (- COUNT) sentences
-backward if COUNT is negative.  This function is the same as
-`forward-sentence' but returns the number of sentences that could
-NOT be moved over."
-  (evil-motion-loop (dir (or count 1))
-    (condition-case nil
-        (forward-sentence dir)
-      (error))))
-
-(defun forward-evil-paragraph (&optional count)
-  "Move forward COUNT paragraphs.
-Moves point COUNT paragraphs forward or (- COUNT) paragraphs backward
-if COUNT is negative.  A paragraph is defined by
-`start-of-paragraph-text' and `forward-paragraph' functions."
-  (evil-motion-loop (dir (or count 1))
-    (cond
-     ((> dir 0) (forward-paragraph))
-     ((not (bobp)) (start-of-paragraph-text) (beginning-of-line)))))
-
-(defvar evil-forward-quote-char ?\"
-  "The character to be used by `forward-evil-quote'.")
-
-(defun forward-evil-quote (&optional count)
-  "Move forward COUNT strings.
-The quotation character is specified by the global variable
-`evil-forward-quote-char'. This character is passed to
-`evil-forward-quote'."
-  (evil-forward-quote evil-forward-quote-char count))
-
-(defun forward-evil-quote-simple (&optional count)
-  "Move forward COUNT strings.
-The quotation character is specified by the global variable
-`evil-forward-quote-char'. This functions uses Vim's rules
-parsing from the beginning of the current line for quotation
-characters. It should only be used when looking for strings
-within comments and buffer *must* be narrowed to the comment."
-  (let ((dir (if (> (or count 1) 0) 1 -1))
-        (ch evil-forward-quote-char)
-        (pnt (point))
-        (cnt 0))
-    (beginning-of-line)
-    ;; count number of quotes before pnt
-    (while (< (point) pnt)
-      (when (= (char-after) ch)
-        (setq cnt (1+ cnt)))
-      (forward-char))
-    (setq cnt (- (* 2 (abs count)) (mod cnt 2)))
-    (cond
-     ((> dir 0)
-      (while (and (not (eolp)) (not (zerop cnt)))
-        (when (= (char-after) ch) (setq cnt (1- cnt)))
-        (forward-char))
-      (when (not (zerop cnt)) (goto-char (point-max))))
-     (t
-      (while (and (not (bolp)) (not (zerop cnt)))
-        (when (= (char-before) ch) (setq cnt (1- cnt)))
-        (forward-char -1))
-      (when (not (zerop cnt)) (goto-char (point-min)))))
-    (/ cnt 2)))
-
-;;; Motion functions
-(defun evil-forward-beginning (thing &optional count)
-  "Move forward to beginning of THING.
-The motion is repeated COUNT times."
-  (setq count (or count 1))
-  (if (< count 0)
-      (forward-thing thing count)
-    (let ((bnd (bounds-of-thing-at-point thing))
-          rest)
-      (when (and bnd (< (point) (cdr bnd)))
-        (goto-char (cdr bnd)))
-      (condition-case nil
-          (when (zerop (setq rest (forward-thing thing count)))
-            (when (and (bounds-of-thing-at-point thing)
-                       (not (bobp))
-                       ;; handle final empty line
-                       (not (and (bolp) (eobp))))
-              (forward-char -1))
-            (beginning-of-thing thing))
-        (error))
-      rest)))
-
-(defun evil-backward-beginning (thing &optional count)
-  "Move backward to beginning of THING.
-The motion is repeated COUNT times. This is the same as calling
-`evil-backward-beginning' with -COUNT."
-  (evil-forward-beginning thing (- (or count 1))))
-
-(defun evil-forward-end (thing &optional count)
-  "Move forward to end of THING.
-The motion is repeated COUNT times."
-  (setq count (or count 1))
-  (cond
-   ((> count 0)
-    (unless (eobp) (forward-char))
-    (prog1 (forward-thing thing count)
-      (unless (bobp) (forward-char -1))))
-   (t
-    (let ((bnd (bounds-of-thing-at-point thing))
-          rest)
-      (when (and bnd (< (point) (cdr bnd) ))
-        (goto-char (car bnd)))
-      (condition-case nil
-          (when (zerop (setq rest (forward-thing thing count)))
-            (end-of-thing thing)
-            (forward-char -1))
-        (error))
-      rest))))
-
-(defun evil-backward-end (thing &optional count)
-  "Move backward to end of THING.
-The motion is repeated COUNT times. This is the same as calling
-`evil-backward-end' with -COUNT."
-  (evil-forward-end thing (- (or count 1))))
-
-(defun evil-forward-word (&optional count)
-  "Move by words.
-Moves point COUNT words forward or (- COUNT) words backward if
-COUNT is negative. This function is the same as `forward-word'
-but returns the number of words by which point could *not* be
-moved."
-  (setq count (or count 1))
-  (let* ((dir (if (>= count 0) +1 -1))
-         (count (abs count)))
-    (while (and (> count 0)
-                (forward-word dir))
-      (setq count (1- count)))
-    count))
-
-(defun evil-in-comment-p (&optional pos)
-  "Checks if POS is within a comment according to current syntax.
-If POS is nil, (point) is used. The return value is the beginning
-position of the comment."
-  (setq pos (or pos (point)))
-  (let ((chkpos
-         (cond
-          ((eobp) pos)
-          ((= (char-syntax (char-after)) ?<) (1+ pos))
-          ((and (not (zerop (logand (car (syntax-after (point)))
-                                    (lsh 1 16))))
-                (not (zerop (logand (or (car (syntax-after (1+ (point)))) 0)
-                                    (lsh 1 17)))))
-           (+ pos 2))
-          ((and (not (zerop (logand (car (syntax-after (point)))
-                                    (lsh 1 17))))
-                (not (zerop (logand (or (car (syntax-after (1- (point)))) 0)
-                                    (lsh 1 16)))))
-           (1+ pos))
-          (t pos))))
-    (let ((syn (save-excursion (syntax-ppss chkpos))))
-      (and (nth 4 syn) (nth 8 syn)))))
-
-(defun evil-looking-at-start-comment (&optional move)
-  "Returns t if point is at the start of a comment.
-point must be on one of the opening characters of a block comment
-according to the current syntax table. Futhermore these
-characters must been parsed as opening characters, i.e. they
-won't be considered as comment starters inside a string or
-possibly another comment. Point is moved to the first character
-of the comment opener if MOVE is non-nil."
-  (cond
-   ;; one character opener
-   ((= (char-syntax (char-after)) ?<)
-    (equal (point) (evil-in-comment-p (1+ (point)))))
-   ;; two character opener on first char
-   ((and (not (zerop (logand (car (syntax-after (point)))
-                             (lsh 1 16))))
-         (not (zerop (logand (or (car (syntax-after (1+ (point)))) 0)
-                             (lsh 1 17)))))
-    (equal (point) (evil-in-comment-p (+ 2 (point)))))
-   ;; two character opener on second char
-   ((and (not (zerop (logand (car (syntax-after (point)))
-                             (lsh 1 17))))
-         (not (zerop (logand (or (car (syntax-after (1- (point)))) 0)
-                             (lsh 1 16)))))
-    (and (equal (1- (point)) (evil-in-comment-p (1+ (point))))
-         (prog1 t (when move (backward-char)))))))
-
-(defun evil-looking-at-end-comment (&optional move)
-  "Returns t if point is at the end of a comment.
-point must be on one of the opening characters of a block comment
-according to the current syntax table. Futhermore these
-characters must been parsed as opening characters, i.e. they
-won't be considered as comment starters inside a string or
-possibly another comment. Point is moved right after the comment
-closer if MOVE is non-nil."
-  (cond
-   ;; one char closer
-   ((= (char-syntax (char-after)) ?>)
-    (and (evil-in-comment-p) ; in comment
-         (not (evil-in-comment-p (1+ (point))))
-         (prog1 t (when move (forward-char)))))
-   ;; two char closer on first char
-   ((and (not (zerop (logand (car (syntax-after (point)))
-                             (lsh 1 18))))
-         (not (zerop (logand (or (car (syntax-after (1+ (point)))) 0)
-                             (lsh 1 19)))))
-    (and (evil-in-comment-p)
-         (not (evil-in-comment-p (+ (point) 2)))
-         (prog1 t (when move (forward-char 2)))))
-   ;; two char closer on second char
-   ((and (not (zerop (logand (car (syntax-after (point)))
-                             (lsh 1 19))))
-         (not (zerop (logand (or (car (syntax-after (1- (point)))) 0)
-                             (lsh 1 18)))))
-    (and (evil-in-comment-p)
-         (not (evil-in-comment-p (1+ (point))))
-         (prog1 t (when move (forward-char)))))))
-
-(defun evil-insert-newline-above ()
-  "Inserts a new line above point and places point in that line
-with regard to indentation."
-  (evil-narrow-to-field
-    (evil-move-beginning-of-line)
-    (insert "\n")
-    (forward-line -1)
-    (back-to-indentation)))
-
-(defun evil-insert-newline-below ()
-  "Inserts a new line below point and places point in that line
-with regard to indentation."
-  (evil-narrow-to-field
-    (evil-move-end-of-line)
-    (insert "\n")
-    (back-to-indentation)))
-
-;;; Markers
-
-(defun evil-global-marker-p (char)
-  "Whether CHAR denotes a global marker."
-  (or (and (>= char ?A) (<= char ?Z))
-      (assq char (default-value 'evil-markers-alist))))
-
-(defun evil-set-marker (char &optional pos advance)
-  "Set the marker denoted by CHAR to position POS.
-POS defaults to the current position of point.
-If ADVANCE is t, the marker advances when inserting text at it;
-otherwise, it stays behind."
-  (interactive (list (read-char)))
-  (catch 'done
-    (let ((marker (evil-get-marker char t)) alist)
-      (unless (markerp marker)
-        (cond
-         ((and marker (symbolp marker) (boundp marker))
-          (set marker (or (symbol-value marker) (make-marker)))
-          (setq marker (symbol-value marker)))
-         ((eq marker 'evil-jump-backward-swap)
-          (evil-set-jump)
-          (throw 'done nil))
-         ((functionp marker)
-          (user-error "Cannot set special marker `%c'" char))
-         ((evil-global-marker-p char)
-          (setq alist (default-value 'evil-markers-alist)
-                marker (make-marker))
-          (evil-add-to-alist 'alist char marker)
-          (setq-default evil-markers-alist alist))
-         (t
-          (setq marker (make-marker))
-          (evil-add-to-alist 'evil-markers-alist char marker))))
-      (add-hook 'kill-buffer-hook #'evil-swap-out-markers nil t)
-      (set-marker-insertion-type marker advance)
-      (set-marker marker (or pos (point))))))
-
-(defun evil-get-marker (char &optional raw)
-  "Return the marker denoted by CHAR.
-This is either a marker object as returned by `make-marker',
-a number, a cons cell (FILE . POS) with FILE being a string
-and POS a number, or nil. If RAW is non-nil, then the
-return value may also be a variable, a movement function,
-or a marker object pointing nowhere."
-  (let ((marker (if (evil-global-marker-p char)
-                    (cdr-safe (assq char (default-value
-                                           'evil-markers-alist)))
-                  (cdr-safe (assq char evil-markers-alist)))))
-    (save-excursion
-      (if raw
-          marker
-        (when (and (symbolp marker) (boundp marker))
-          (setq marker (symbol-value marker)))
-        (when (functionp marker)
-          (funcall marker)
-          (setq marker (point)))
-        (when (markerp marker)
-          (if (eq (marker-buffer marker) (current-buffer))
-              (setq marker (marker-position marker))
-            (setq marker (and (marker-buffer marker) marker))))
-        (when (or (numberp marker)
-                  (markerp marker)
-                  (and (consp marker)
-                       (stringp (car marker))
-                       (numberp (cdr marker))))
-          marker)))))
-
-(defun evil-swap-out-markers ()
-  "Turn markers into file references when the buffer is killed."
-  (and buffer-file-name
-       (dolist (entry evil-markers-alist)
-         (and (markerp (cdr entry))
-              (eq (marker-buffer (cdr entry)) (current-buffer))
-              (setcdr entry (cons buffer-file-name
-                                  (marker-position (cdr entry))))))))
-(put 'evil-swap-out-markers 'permanent-local-hook t)
-
-(defun evil-get-register (register &optional noerror)
-  "Return contents of REGISTER.
-Signal an error if empty, unless NOERROR is non-nil.
-
-The following special registers are supported.
-  \"  the unnamed register
-  *  the clipboard contents
-  +  the clipboard contents
-  <C-w> the word at point (ex mode only)
-  <C-a> the WORD at point (ex mode only)
-  <C-o> the symbol at point (ex mode only)
-  <C-f> the current file at point (ex mode only)
-  %  the current file name (read only)
-  #  the alternate file name (read only)
-  /  the last search pattern (read only)
-  :  the last command line (read only)
-  .  the last inserted text (read only)
-  -  the last small (less than a line) delete
-  _  the black hole register
-  =  the expression register (read only)"
-  (condition-case err
-      (when (characterp register)
-        (or (cond
-             ((eq register ?\")
-              (current-kill 0))
-             ((and (<= ?1 register) (<= register ?9))
-              (let ((reg (- register ?1)))
-                (and (< reg (length kill-ring))
-                     (current-kill reg t))))
-             ((memq register '(?* ?+))
-              ;; the following code is modified from
-              ;; `x-selection-value-internal'
-              (let ((what (if (eq register ?*) 'PRIMARY 'CLIPBOARD))
-                    (request-type (or (and (boundp 'x-select-request-type)
-                                           x-select-request-type)
-                                      '(UTF8_STRING COMPOUNT_TEXT STRING)))
-                    text)
-                (unless (consp request-type)
-                  (setq request-type (list request-type)))
-                (while (and request-type (not text))
-                  (condition-case nil
-                      (setq text (x-get-selection what (pop request-type)))
-                    (error nil)))
-                (when text
-                  (remove-text-properties 0 (length text) '(foreign-selection nil) text))
-                text))
-             ((eq register ?\C-W)
-              (unless (evil-ex-p)
-                (user-error "Register <C-w> only available in ex state"))
-              (with-current-buffer evil-ex-current-buffer
-                (thing-at-point 'evil-word)))
-             ((eq register ?\C-A)
-              (unless (evil-ex-p)
-                (user-error "Register <C-a> only available in ex state"))
-              (with-current-buffer evil-ex-current-buffer
-                (thing-at-point 'evil-WORD)))
-             ((eq register ?\C-O)
-              (unless (evil-ex-p)
-                (user-error "Register <C-o> only available in ex state"))
-              (with-current-buffer evil-ex-current-buffer
-                (thing-at-point 'evil-symbol)))
-             ((eq register ?\C-F)
-              (unless (evil-ex-p)
-                (user-error "Register <C-f> only available in ex state"))
-              (with-current-buffer evil-ex-current-buffer
-                (thing-at-point 'filename)))
-             ((eq register ?%)
-              (or (buffer-file-name (and (evil-ex-p)
-                                         (minibufferp)
-                                         evil-ex-current-buffer))
-                  (user-error "No file name")))
-             ((= register ?#)
-              (or (with-current-buffer (other-buffer) (buffer-file-name))
-                  (user-error "No file name")))
-             ((eq register ?/)
-              (or (car-safe
-                   (or (and (boundp 'evil-search-module)
-                            (eq evil-search-module 'evil-search)
-                            evil-ex-search-history)
-                       (and isearch-regexp regexp-search-ring)
-                       search-ring))
-                  (user-error "No previous regular expression")))
-             ((eq register ?:)
-              (or (car-safe evil-ex-history)
-                  (user-error "No previous command line")))
-             ((eq register ?.)
-              evil-last-insertion)
-             ((eq register ?-)
-              evil-last-small-deletion)
-             ((eq register ?=)
-              (let* ((enable-recursive-minibuffers t)
-                     (result (eval (car (read-from-string (read-string "="))))))
-                (cond
-                 ((or (stringp result)
-                      (numberp result)
-                      (symbolp result))
-                  (prin1-to-string result))
-                 ((sequencep result)
-                  (mapconcat #'prin1-to-string result "\n"))
-                 (t (user-error "Using %s as a string" (type-of result))))))
-             ((eq register ?_) ; the black hole register
-              "")
-             (t
-              (setq register (downcase register))
-              (get-register register)))
-            (user-error "Register `%c' is empty" register)))
-    (error (unless err (signal (car err) (cdr err))))))
-
-(defun evil-set-register (register text)
-  "Set the contents of register REGISTER to TEXT.
-If REGISTER is an upcase character then text is appended to that
-register instead of replacing its content."
-  (cond
-   ((not (characterp register))
-    (user-error "Invalid register"))
-   ;; don't allow modification of read-only registers
-   ((member register '(?: ?. ?%))
-    (user-error "Can't modify read-only register"))
-   ((eq register ?\")
-    (kill-new text))
-   ((and (<= ?1 register) (<= register ?9))
-    (if (null kill-ring)
-        (kill-new text)
-      (let ((kill-ring-yank-pointer kill-ring-yank-pointer)
-            interprogram-paste-function
-            interprogram-cut-function)
-        (current-kill (- register ?1))
-        (setcar kill-ring-yank-pointer text))))
-   ((eq register ?*)
-    (x-set-selection 'PRIMARY text))
-   ((eq register ?+)
-    (x-set-selection 'CLIPBOARD text))
-   ((eq register ?-)
-    (setq evil-last-small-deletion text))
-   ((eq register ?_) ; the black hole register
-    nil)
-   ((and (<= ?A register) (<= register ?Z))
-    (setq register (downcase register))
-    (let ((content (get-register register)))
-      (cond
-       ((not content)
-        (set-register register text))
-       ((or (text-property-not-all 0 (length content)
-                                   'yank-handler nil
-                                   content)
-            (text-property-not-all 0 (length text)
-                                   'yank-handler nil
-                                   text))
-        ;; some non-trivial yank-handler -> always switch to line handler
-        ;; ensure complete lines
-        (when (and (> (length content) 0)
-                   (/= (aref content (1- (length content))) ?\n))
-          (setq content (concat content "\n")))
-        (when (and (> (length text) 0)
-                   (/= (aref text (1- (length text))) ?\n))
-          (setq text (concat text "\n")))
-        (setq text (concat content text))
-        (remove-list-of-text-properties 0 (length text) '(yank-handler) text)
-        (setq text (propertize text 'yank-handler '(evil-yank-line-handler)))
-        (set-register register text))
-       (t
-        (set-register register (concat content text))))))
-   (t
-    (set-register register text))))
-
-(defun evil-register-list ()
-  "Returns an alist of all registers"
-  (sort (append (mapcar #'(lambda (reg)
-                            (cons reg (evil-get-register reg t)))
-                        '(?\" ?* ?+ ?% ?# ?/ ?: ?. ?-
-                              ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9))
-                register-alist nil)
-        #'(lambda (reg1 reg2) (< (car reg1) (car reg2)))))
-
-(defsubst evil-kbd-macro-suppress-motion-error ()
-  "Returns non-nil if a motion error should be suppressed.
-Whether the motion error should be suppressed depends on the
-variable `evil-kbd-macro-suppress-motion-error'."
-  (or (and defining-kbd-macro
-           (memq evil-kbd-macro-suppress-motion-error '(t record)))
-      (and executing-kbd-macro
-           (memq evil-kbd-macro-suppress-motion-error '(t replay)))))
-
-;;; Region
-
-;; `set-mark' does too much at once
-(defun evil-move-mark (pos)
-  "Set buffer's mark to POS.
-If POS is nil, delete the mark."
-  (when pos
-    (setq pos (evil-normalize-position pos)))
-  (set-marker (mark-marker) pos))
-
-(defun evil-save-transient-mark-mode ()
-  "Save Transient Mark mode and make it buffer-local.
-Any changes to Transient Mark mode are now local to the current
-buffer, until `evil-restore-transient-mark-mode' is called.
-
-Variables pertaining to Transient Mark mode are listed in
-`evil-transient-vars', and their values are stored in
-`evil-transient-vals'."
-  (dolist (var evil-transient-vars)
-    (when (and (boundp var)
-               (not (assq var evil-transient-vals)))
-      (push (list var (symbol-value var)
-                  (and (assq var (buffer-local-variables)) t))
-            evil-transient-vals)
-      (make-variable-buffer-local var)
-      (put var 'permanent-local t))))
-
-(defun evil-restore-transient-mark-mode ()
-  "Restore Transient Mark mode.
-This presupposes that `evil-save-transient-mark-mode' has been
-called earlier. If Transient Mark mode was disabled before but
-enabled in the meantime, this function disables it; if it was
-enabled before but disabled in the meantime, this function
-enables it.
-
-The earlier settings of Transient Mark mode are stored in
-`evil-transient-vals'."
-  (let (entry local var val)
-    (while (setq entry (pop evil-transient-vals))
-      (setq var (pop entry)
-            val (pop entry)
-            local (pop entry))
-      (unless local
-        (kill-local-variable var))
-      (unless (equal (symbol-value var) val)
-        (if (fboundp var)
-            (funcall var (if val 1 -1))
-          (setq var val))))))
-
-(defun evil-save-mark ()
-  "Save the current mark, including whether it is transient.
-See also `evil-restore-mark'."
-  (unless evil-visual-previous-mark
-    (setq evil-visual-previous-mark (mark t))
-    (evil-save-transient-mark-mode)))
-
-(defun evil-restore-mark ()
-  "Restore the mark, including whether it was transient.
-See also `evil-save-mark'."
-  (when evil-visual-previous-mark
-    (evil-restore-transient-mark-mode)
-    (evil-move-mark evil-visual-previous-mark)
-    (setq evil-visual-previous-mark nil)))
-
-;; In theory, an active region implies Transient Mark mode, and
-;; disabling Transient Mark mode implies deactivating the region.
-;; In practice, Emacs never clears `mark-active' except in Transient
-;; Mark mode, so we define our own toggle functions to make things
-;; more predictable.
-(defun evil-transient-mark (&optional arg)
-  "Toggle Transient Mark mode.
-Ensure that the region is properly deactivated.
-Enable with positive ARG, disable with negative ARG."
-  (unless (numberp arg)
-    (setq arg (if transient-mark-mode -1 1)))
-  (cond
-   ((< arg 1)
-    (evil-active-region -1)
-    ;; Transient Mark mode cannot be disabled
-    ;; while CUA mode is enabled
-    (when (fboundp 'cua-mode)
-      (cua-mode -1))
-    (when transient-mark-mode
-      (transient-mark-mode -1)))
-   (t
-    (unless transient-mark-mode
-      (evil-active-region -1)
-      (transient-mark-mode 1)))))
-
-(defun evil-active-region (&optional arg)
-  "Toggle active region.
-Ensure that Transient Mark mode is properly enabled.
-Enable with positive ARG, disable with negative ARG."
-  (unless (numberp arg)
-    (setq arg (if (region-active-p) -1 1)))
-  (cond
-   ((and (< arg 1))
-    (when (or transient-mark-mode mark-active)
-      (setq mark-active nil
-            deactivate-mark nil)
-      (when (boundp 'cua--explicit-region-start)
-        (setq cua--explicit-region-start nil))
-      (run-hooks 'deactivate-mark-hook)))
-   (t
-    (evil-transient-mark 1)
-    (when deactivate-mark
-      (setq deactivate-mark nil))
-    (unless (mark t)
-      (evil-move-mark (point)))
-    (unless (region-active-p)
-      (set-mark (mark t)))
-    (when (boundp 'cua--explicit-region-start)
-      (setq cua--explicit-region-start t)))))
-
-(defmacro evil-with-transient-mark-mode (&rest body)
-  "Execute BODY with Transient Mark mode.
-Then restore Transient Mark mode to its previous setting."
-  (declare (indent defun)
-           (debug t))
-  `(let ((inhibit-quit t)
-         evil-transient-vals)
-     (unwind-protect
-         (progn
-           (evil-save-transient-mark-mode)
-           (evil-transient-mark 1)
-           ,@body)
-       (evil-restore-transient-mark-mode))))
-
-(defmacro evil-with-active-region (beg end &rest body)
-  "Execute BODY with an active region from BEG to END."
-  (declare (indent 2)
-           (debug t))
-  `(let ((beg ,beg) (end ,end)
-         evil-transient-vals)
-     (evil-with-transient-mark-mode
-       (save-excursion
-         (evil-active-region 1)
-         (evil-move-mark beg)
-         (goto-char end)
-         ,@body))))
-
-(defun evil-exchange-point-and-mark ()
-  "Exchange point and mark without activating the region."
-  (let* ((point (point))
-         (mark  (or (mark t) point)))
-    (set-marker (mark-marker) point)
-    (goto-char mark)))
-
-(defun evil-apply-on-block (func beg end pass-columns &rest args)
-  "Call FUNC for each line of a block selection.
-The selection is specified by the region BEG and END.  FUNC must
-take at least two arguments, the beginning and end of each
-line. If PASS-COLUMNS is non-nil, these values are the columns,
-otherwise tey are buffer positions. Extra arguments to FUNC may
-be passed via ARGS."
-  (let ((eol-col (and (memq last-command '(next-line previous-line))
-                      (numberp temporary-goal-column)
-                      temporary-goal-column))
-        startcol startpt endcol endpt)
-    (save-excursion
-      (goto-char beg)
-      (setq startcol (current-column))
-      (beginning-of-line)
-      (setq startpt (point))
-      (goto-char end)
-      (setq endcol (current-column))
-      (forward-line 1)
-      (setq endpt (point-marker))
-      ;; ensure the start column is the left one.
-      (evil-sort startcol endcol)
-      ;; maybe find maximal column
-      (when eol-col
-        (setq eol-col 0)
-        (goto-char startpt)
-        (while (< (point) endpt)
-          (setq eol-col (max eol-col
-                             (evil-column (line-end-position))))
-          (forward-line 1))
-        (setq endcol (max endcol
-                          (min eol-col
-                               (1+ (min (1- most-positive-fixnum)
-                                        (truncate temporary-goal-column)))))))
-      ;; start looping over lines
-      (goto-char startpt)
-      (while (< (point) endpt)
-        (if pass-columns
-            (apply func startcol endcol args)
-          (apply func
-                 (save-excursion (evil-move-to-column startcol))
-                 (save-excursion (evil-move-to-column endcol t))
-                 args))
-        (forward-line 1)))))
-
-(defun evil-apply-on-rectangle (function start end &rest args)
-  "Like `apply-on-rectangle' but maybe extends to eol.
-If `temporary-goal-column' is set to a big number, then the
-region of each line is extended to the end of each line. The end
-column is set to the maximal column in all covered lines."
-  (apply #'evil-apply-on-block function start end t args))
-
-;;; Insertion
-
-(defun evil-concat-ranges (ranges)
-  "Concatenate RANGES.
-RANGES must be a list of ranges.  They must be ordered so that
-successive ranges share their boundaries.  The return value is a
-single range of disjoint union of the ranges or nil if the
-disjoint union is not a single range."
-  (let ((range (car-safe ranges)) (ranges (cdr ranges)) r)
-    (while (and range (setq r (car-safe ranges)))
-      (setq range
-            (cond ((and (= (cdr r) (car range))) (cons (car r) (cdr range)))
-                  ((and (= (cdr range) (car r))) (cons (car range) (cdr r)))))
-      (setq ranges (cdr ranges)))
-    range))
-
-(defun evil-track-last-insertion (beg end len)
-  "Track the last insertion range and its text.
-The insertion range is stored as a pair of buffer positions in
-`evil-current-insertion'. If a subsequent change is compatible,
-then the current range is modified, otherwise it is replaced by a
-new range. Compatible changes are changes that do not create a
-disjoin range."
-  ;; deletion
-  (when (> len 0)
-    (if (and evil-current-insertion
-             (>= beg (car evil-current-insertion))
-             (<= (+ beg len) (cdr evil-current-insertion)))
-        (setcdr evil-current-insertion
-                (- (cdr evil-current-insertion) len))
-      (setq evil-current-insertion nil)))
-  ;; insertion
-  (if (and evil-current-insertion
-           (>= beg (car evil-current-insertion))
-           (<= beg (cdr evil-current-insertion)))
-      (setcdr evil-current-insertion
-              (+ (- end beg)
-                 (cdr evil-current-insertion)))
-    (setq evil-current-insertion (cons beg end))))
-(put 'evil-track-last-insertion 'permanent-local-hook t)
-
-(defun evil-start-track-last-insertion ()
-  "Start tracking the last insertion."
-  (setq evil-current-insertion nil)
-  (add-hook 'after-change-functions #'evil-track-last-insertion nil t))
-
-(defun evil-stop-track-last-insertion ()
-  "Stop tracking the last insertion.
-The tracked insertion is set to `evil-last-insertion'."
-  (setq evil-last-insertion
-        (and evil-current-insertion
-             ;; Check whether the insertion range is a valid buffer
-             ;; range.  If a buffer modification is done from within
-             ;; another change hook or modification-hook (yasnippet
-             ;; does this using overlay modification-hooks), then the
-             ;; insertion information may be invalid. There is no way
-             ;; to detect this situation, but at least we should
-             ;; ensure that no error occurs (see bug #272).
-             (>= (car evil-current-insertion) (point-min))
-             (<= (cdr evil-current-insertion) (point-max))
-             (buffer-substring-no-properties (car evil-current-insertion)
-                                             (cdr evil-current-insertion))))
-  (remove-hook 'after-change-functions #'evil-track-last-insertion t))
-
-;;; Paste
-
-(defun evil-yank-characters (beg end &optional register yank-handler)
-  "Saves the characters defined by the region BEG and END in the kill-ring."
-  (let ((text (filter-buffer-substring beg end)))
-    (when yank-handler
-      (setq text (propertize text 'yank-handler (list yank-handler))))
-    (when register
-      (evil-set-register register text))
-    (when evil-was-yanked-without-register
-      (evil-set-register ?0 text)) ; "0 register contains last yanked text
-    (unless (eq register ?_)
-      (kill-new text))))
-
-(defun evil-yank-lines (beg end &optional register yank-handler)
-  "Saves the lines in the region BEG and END into the kill-ring."
-  (let* ((text (filter-buffer-substring beg end))
-         (yank-handler (list (or yank-handler
-                                 #'evil-yank-line-handler)
-                             nil
-                             t)))
-    ;; Ensure the text ends with a newline. This is required
-    ;; if the deleted lines were the last lines in the buffer.
-    (when (or (zerop (length text))
-              (/= (aref text (1- (length text))) ?\n))
-      (setq text (concat text "\n")))
-    (setq text (propertize text 'yank-handler yank-handler))
-    (when register
-      (evil-set-register register text))
-    (when evil-was-yanked-without-register
-      (evil-set-register ?0 text)) ; "0 register contains last yanked text
-    (unless (eq register ?_)
-      (kill-new text))))
-
-(defun evil-yank-rectangle (beg end &optional register yank-handler)
-  "Saves the rectangle defined by region BEG and END into the kill-ring."
-  (let ((lines (list nil)))
-    (evil-apply-on-rectangle #'extract-rectangle-line beg end lines)
-    ;; We remove spaces from the beginning and the end of the next.
-    ;; Spaces are inserted explicitly in the yank-handler in order to
-    ;; NOT insert lines full of spaces.
-    (setq lines (nreverse (cdr lines)))
-    ;; `text' is used as default insert text when pasting this rectangle
-    ;; in another program, e.g., using the X clipboard.
-    (let* ((yank-handler (list (or yank-handler
-                                   #'evil-yank-block-handler)
-                               lines
-                               t
-                               'evil-delete-yanked-rectangle))
-           (text (propertize (mapconcat #'identity lines "\n")
-                             'yank-handler yank-handler)))
-      (when register
-        (evil-set-register register text))
-      (when evil-was-yanked-without-register
-        (evil-set-register ?0 text)) ; "0 register contains last yanked text
-      (unless (eq register ?_)
-        (kill-new text)))))
-
-(defun evil-yank-line-handler (text)
-  "Inserts the current text linewise."
-  (let ((text (apply #'concat (make-list (or evil-paste-count 1) text)))
-        (opoint (point)))
-    (remove-list-of-text-properties
-     0 (length text) yank-excluded-properties text)
-    (cond
-     ((eq this-command 'evil-paste-before)
-      (evil-move-beginning-of-line)
-      (evil-move-mark (point))
-      (insert text)
-      (setq evil-last-paste
-            (list 'evil-paste-before
-                  evil-paste-count
-                  opoint
-                  (mark t)
-                  (point)))
-      (evil-set-marker ?\[ (mark))
-      (evil-set-marker ?\] (1- (point)))
-      (evil-exchange-point-and-mark)
-      (back-to-indentation))
-     ((eq this-command 'evil-paste-after)
-      (evil-move-end-of-line)
-      (evil-move-mark (point))
-      (insert "\n")
-      (insert text)
-      (evil-set-marker ?\[ (1+ (mark)))
-      (evil-set-marker ?\] (1- (point)))
-      (delete-char -1) ; delete the last newline
-      (setq evil-last-paste
-            (list 'evil-paste-after
-                  evil-paste-count
-                  opoint
-                  (mark t)
-                  (point)))
-      (evil-move-mark (1+ (mark t)))
-      (evil-exchange-point-and-mark)
-      (back-to-indentation))
-     (t
-      (insert text)))))
-
-(defun evil-yank-block-handler (lines)
-  "Inserts the current text as block."
-  (let ((count (or evil-paste-count 1))
-        (col (if (eq this-command 'evil-paste-after)
-                 (1+ (current-column))
-               (current-column)))
-        (current-line (line-number-at-pos (point)))
-        (opoint (point))
-        epoint)
-    (dolist (line lines)
-      ;; concat multiple copies according to count
-      (setq line (apply #'concat (make-list count line)))
-      ;; strip whitespaces at beginning and end
-      (string-match "^ *\\(.*?\\) *$" line)
-      (let ((text (match-string 1 line))
-            (begextra (match-beginning 1))
-            (endextra (- (match-end 0) (match-end 1))))
-        ;; maybe we have to insert a new line at eob
-        (while (< (line-number-at-pos (point))
-                  current-line)
-          (goto-char (point-max))
-          (insert "\n"))
-        (setq current-line (1+ current-line))
-        ;; insert text unless we insert an empty line behind eol
-        (unless (and (< (evil-column (line-end-position)) col)
-                     (zerop (length text)))
-          ;; if we paste behind eol, it may be sufficient to insert tabs
-          (if (< (evil-column (line-end-position)) col)
-              (move-to-column (+ col begextra) t)
-            (move-to-column col t)
-            (insert (make-string begextra ? )))
-          (remove-list-of-text-properties 0 (length text)
-                                          yank-excluded-properties text)
-          (insert text)
-          (unless (eolp)
-            ;; text follows, so we have to insert spaces
-            (insert (make-string endextra ? )))
-          (setq epoint (point)))
-        (forward-line 1)))
-    (setq evil-last-paste
-          (list this-command
-                evil-paste-count
-                opoint
-                (length lines)                   ; number of rows
-                (* count (length (car lines))))) ; number of colums
-    (evil-set-marker ?\[ opoint)
-    (evil-set-marker ?\] (1- epoint))
-    (goto-char opoint)
-    (when (and (eq this-command 'evil-paste-after)
-               (not (eolp)))
-      (forward-char))))
-
-(defun evil-delete-yanked-rectangle (nrows ncols)
-  "Special function to delete the block yanked by a previous paste command."
-  (let ((opoint (point))
-        (col (if (eq last-command 'evil-paste-after)
-                 (1+ (current-column))
-               (current-column))))
-    (dotimes (i nrows)
-      (delete-region (save-excursion
-                       (move-to-column col)
-                       (point))
-                     (save-excursion
-                       (move-to-column (+ col ncols))
-                       (point)))
-      (unless (eobp) (forward-line)))
-    (goto-char opoint)))
-
-;; TODO: if undoing is disabled in the current buffer, paste-pop won't
-;; work. Although this is probably not a big problem, because usually
-;; buffers where `evil-paste-pop' may be useful have undoing enabled.
-;; A solution would be to temporarily enable undo when pasting and
-;; store the undo information in a special variable that does not
-;; interfere with `buffer-undo-list'.
-(defun evil-paste-pop (count)
-  "Replace the just-yanked stretch of killed text with a different stretch.
-This command is allowed only immediatly after a `yank',
-`evil-paste-before', `evil-paste-after' or `evil-paste-pop'.
-This command uses the same paste command as before, i.e., when
-used after `evil-paste-after' the new text is also yanked using
-`evil-paste-after', used with the same paste-count argument.
-
-The COUNT argument inserts the COUNTth previous kill.  If COUNT
-is negative this is a more recent kill."
-  (interactive "p")
-  (unless (memq last-command
-                '(evil-paste-after
-                  evil-paste-before
-                  evil-visual-paste))
-    (user-error "Previous command was not an evil-paste: %s" last-command))
-  (unless evil-last-paste
-    (user-error "Previous paste command used a register"))
-  (evil-undo-pop)
-  (goto-char (nth 2 evil-last-paste))
-  (setq this-command (nth 0 evil-last-paste))
-  ;; use temporary kill-ring, so the paste cannot modify it
-  (let ((kill-ring (list (current-kill
-                          (if (and (> count 0) (nth 5 evil-last-paste))
-                              ;; if was visual paste then skip the
-                              ;; text that has been replaced
-                              (1+ count)
-                            count))))
-        (kill-ring-yank-pointer kill-ring))
-    (when (eq last-command 'evil-visual-paste)
-      (let ((evil-no-display t))
-        (evil-visual-restore)))
-    (funcall (nth 0 evil-last-paste) (nth 1 evil-last-paste))
-    ;; if this was a visual paste, then mark the last paste as NOT
-    ;; being the first visual paste
-    (when (eq last-command 'evil-visual-paste)
-      (setcdr (nthcdr 4 evil-last-paste) nil))))
-
-(defun evil-paste-pop-next (count)
-  "Same as `evil-paste-pop' but with negative argument."
-  (interactive "p")
-  (evil-paste-pop (- count)))
-
-;;; Interactive forms
-
-(defun evil-match-interactive-code (interactive &optional pos)
-  "Match an interactive code at position POS in string INTERACTIVE.
-Returns the first matching entry in `evil-interactive-alist', or nil."
-  (let ((length (length interactive))
-        (pos (or pos 0)))
-    (catch 'done
-      (dolist (entry evil-interactive-alist)
-        (let* ((string (car entry))
-               (end (+ (length string) pos)))
-          (when (and (<= end length)
-                     (string= string
-                              (substring interactive pos end)))
-            (throw 'done entry)))))))
-
-(defun evil-concatenate-interactive-forms (&rest forms)
-  "Concatenate interactive list expressions FORMS.
-Returns a single expression where successive expressions
-are joined, if possible."
-  (let (result)
-    (when forms
-      (while (cdr forms)
-        (cond
-         ((null (car forms))
-          (pop forms))
-         ((and (eq (car (car forms)) 'list)
-               (eq (car (cadr forms)) 'list))
-          (setq forms (cons (append (car forms)
-                                    (cdr (cadr forms)))
-                            (cdr (cdr forms)))))
-         (t
-          (push (pop forms) result))))
-      (when (car forms)
-        (push (pop forms) result))
-      (setq result (nreverse result))
-      (cond
-       ((null result))
-       ((null (cdr result))
-        (car result))
-       (t
-        `(append ,@result))))))
-
-(defun evil-interactive-string (string)
-  "Evaluate the interactive string STRING.
-The string may contain extended interactive syntax.
-The return value is a cons cell (FORM . PROPERTIES),
-where FORM is a single list-expression to be passed to
-a standard `interactive' statement, and PROPERTIES is a
-list of command properties as passed to `evil-define-command'."
-  (let ((length (length string))
-        (pos 0)
-        code expr forms match plist prompt properties)
-    (while (< pos length)
-      (if (eq (aref string pos) ?\n)
-          (setq pos (1+ pos))
-        (setq match (evil-match-interactive-code string pos))
-        (if (null match)
-            (user-error "Unknown interactive code: `%s'"
-                        (substring string pos))
-          (setq code (car match)
-                expr (car (cdr match))
-                plist (cdr (cdr match))
-                pos (+ pos (length code)))
-          (when (functionp expr)
-            (setq prompt
-                  (substring string pos
-                             (or (string-match "\n" string pos)
-                                 length))
-                  pos (+ pos (length prompt))
-                  expr `(funcall ,expr ,prompt)))
-          (setq forms (append forms (list expr))
-                properties (append properties plist)))))
-    (cons `(append ,@forms) properties)))
-
-(defun evil-interactive-form (&rest args)
-  "Evaluate interactive forms ARGS.
-The return value is a cons cell (FORM . PROPERTIES),
-where FORM is a single list-expression to be passed to
-a standard `interactive' statement, and PROPERTIES is a
-list of command properties as passed to `evil-define-command'."
-  (let (forms properties)
-    (dolist (arg args)
-      (if (not (stringp arg))
-          (setq forms (append forms (list arg)))
-        (setq arg (evil-interactive-string arg)
-              forms (append forms (cdr (car arg)))
-              properties (append properties (cdr arg)))))
-    (cons (apply #'evil-concatenate-interactive-forms forms)
-          properties)))
-
-;;; Types
-
-(defun evil-type (object &optional default)
-  "Return the type of OBJECT, or DEFAULT if none."
-  (let (type)
-    (cond
-     ((overlayp object)
-      (setq type (overlay-get object :type)))
-     ((evil-range-p object)
-      (setq type (nth 2 object)))
-     ((listp object)
-      (setq type (plist-get object :type)))
-     ((commandp object)
-      (setq type (evil-get-command-property object :type)))
-     ((symbolp object)
-      (setq type (get object 'type))))
-    (setq type (or type default))
-    (and (evil-type-p type) type)))
-
-(defun evil-set-type (object type)
-  "Set the type of OBJECT to TYPE.
-For example, (evil-set-type 'next-line 'line)
-will make `line' the type of the `next-line' command."
-  (cond
-   ((overlayp object)
-    (overlay-put object :type type))
-   ((evil-range-p object)
-    (evil-set-range-type object type))
-   ((listp object)
-    (plist-put object :type type))
-   ((commandp object)
-    (evil-set-command-property object :type type))
-   ((symbolp object)
-    (put object 'type type)))
-  object)
-
-(defun evil-type-property (type prop)
-  "Return property PROP for TYPE."
-  (evil-get-property evil-type-properties type prop))
-
-(defun evil-type-p (sym)
-  "Whether SYM is the name of a type."
-  (assq sym evil-type-properties))
-
-(defun evil-expand (beg end type &rest properties)
-  "Expand BEG and END as TYPE with PROPERTIES.
-Returns a list (BEG END TYPE PROPERTIES ...), where the tail
-may contain a property list."
-  (apply #'evil-transform
-         ;; don't expand if already expanded
-         (unless (plist-get properties :expanded) :expand)
-         beg end type properties))
-
-(defun evil-contract (beg end type &rest properties)
-  "Contract BEG and END as TYPE with PROPERTIES.
-Returns a list (BEG END TYPE PROPERTIES ...), where the tail
-may contain a property list."
-  (apply #'evil-transform :contract beg end type properties))
-
-(defun evil-normalize (beg end type &rest properties)
-  "Normalize BEG and END as TYPE with PROPERTIES.
-Returns a list (BEG END TYPE PROPERTIES ...), where the tail
-may contain a property list."
-  (apply #'evil-transform :normalize beg end type properties))
-
-(defun evil-transform (transform beg end type &rest properties)
-  "Apply TRANSFORM on BEG and END with PROPERTIES.
-Returns a list (BEG END TYPE PROPERTIES ...), where the tail
-may contain a property list. If TRANSFORM is undefined,
-return positions unchanged."
-  (let* ((type (or type (evil-type properties)))
-         (transform (when (and type transform)
-                      (evil-type-property type transform))))
-    (if transform
-        (apply transform beg end properties)
-      (apply #'evil-range beg end type properties))))
-
-(defun evil-describe (beg end type &rest properties)
-  "Return description of BEG and END with PROPERTIES.
-If no description is available, return the empty string."
-  (let* ((type (or type (evil-type properties)))
-         (properties (plist-put properties :type type))
-         (describe (evil-type-property type :string)))
-    (or (when describe
-          (apply describe beg end properties))
-        "")))
-
-;;; Ranges
-
-(defun evil-range (beg end &optional type &rest properties)
-  "Return a list (BEG END [TYPE] PROPERTIES...).
-BEG and END are buffer positions (numbers or markers),
-TYPE is a type as per `evil-type-p', and PROPERTIES is
-a property list."
-  (let ((beg (evil-normalize-position beg))
-        (end (evil-normalize-position end)))
-    (when (and (numberp beg) (numberp end))
-      (append (list (min beg end) (max beg end))
-              (when (evil-type-p type)
-                (list type))
-              properties))))
-
-(defun evil-range-p (object)
-  "Whether OBJECT is a range."
-  (and (listp object)
-       (>= (length object) 2)
-       (numberp (nth 0 object))
-       (numberp (nth 1 object))))
-
-(defun evil-range-beginning (range)
-  "Return beginning of RANGE."
-  (when (evil-range-p range)
-    (let ((beg (evil-normalize-position (nth 0 range)))
-          (end (evil-normalize-position (nth 1 range))))
-      (min beg end))))
-
-(defun evil-range-end (range)
-  "Return end of RANGE."
-  (when (evil-range-p range)
-    (let ((beg (evil-normalize-position (nth 0 range)))
-          (end (evil-normalize-position (nth 1 range))))
-      (max beg end))))
-
-(defun evil-range-properties (range)
-  "Return properties of RANGE."
-  (when (evil-range-p range)
-    (if (evil-type range)
-        (nthcdr 3 range)
-      (nthcdr 2 range))))
-
-(defun evil-copy-range (range)
-  "Return a copy of RANGE."
-  (copy-sequence range))
-
-(defun evil-set-range (range &optional beg end type &rest properties)
-  "Set RANGE to have beginning BEG and end END.
-The TYPE and additional PROPERTIES may also be specified.
-If an argument is nil, it's not used; the previous value is retained.
-See also `evil-set-range-beginning', `evil-set-range-end',
-`evil-set-range-type' and `evil-set-range-properties'."
-  (when (evil-range-p range)
-    (let ((beg (or (evil-normalize-position beg)
-                   (evil-range-beginning range)))
-          (end (or (evil-normalize-position end)
-                   (evil-range-end range)))
-          (type (or type (evil-type range)))
-          (plist (evil-range-properties range)))
-      (evil-sort beg end)
-      (setq plist (evil-concat-plists plist properties))
-      (evil-set-range-beginning range beg)
-      (evil-set-range-end range end)
-      (evil-set-range-type range type)
-      (evil-set-range-properties range plist)
-      range)))
-
-(defun evil-set-range-beginning (range beg &optional copy)
-  "Set RANGE's beginning to BEG.
-If COPY is non-nil, return a copy of RANGE."
-  (when copy
-    (setq range (evil-copy-range range)))
-  (setcar range beg)
-  range)
-
-(defun evil-set-range-end (range end &optional copy)
-  "Set RANGE's end to END.
-If COPY is non-nil, return a copy of RANGE."
-  (when copy
-    (setq range (evil-copy-range range)))
-  (setcar (cdr range) end)
-  range)
-
-(defun evil-set-range-type (range type &optional copy)
-  "Set RANGE's type to TYPE.
-If COPY is non-nil, return a copy of RANGE."
-  (when copy
-    (setq range (evil-copy-range range)))
-  (if type
-      (setcdr (cdr range)
-              (cons type (evil-range-properties range)))
-    (setcdr (cdr range) (evil-range-properties range)))
-  range)
-
-(defun evil-set-range-properties (range properties &optional copy)
-  "Set RANGE's properties to PROPERTIES.
-If COPY is non-nil, return a copy of RANGE."
-  (when copy
-    (setq range (evil-copy-range range)))
-  (if (evil-type range)
-      (setcdr (cdr (cdr range)) properties)
-    (setcdr (cdr range) properties))
-  range)
-
-(defun evil-range-union (range1 range2 &optional type)
-  "Return the union of the ranges RANGE1 and RANGE2.
-If the ranges have conflicting types, use RANGE1's type.
-This can be overridden with TYPE."
-  (when (and (evil-range-p range1)
-             (evil-range-p range2))
-    (evil-range (min (evil-range-beginning range1)
-                     (evil-range-beginning range2))
-                (max (evil-range-end range1)
-                     (evil-range-end range2))
-                (or type
-                    (evil-type range1)
-                    (evil-type range2)))))
-
-(defun evil-subrange-p (range1 range2)
-  "Whether RANGE1 is contained within RANGE2."
-  (and (evil-range-p range1)
-       (evil-range-p range2)
-       (<= (evil-range-beginning range2)
-           (evil-range-beginning range1))
-       (>= (evil-range-end range2)
-           (evil-range-end range1))))
-
-(defun evil-select-inner-object (thing beg end type &optional count line)
-  "Return an inner text object range of COUNT objects.
-If COUNT is positive, return objects following point; if COUNT is
-negative, return objects preceding point.  FORWARD is a function
-which moves to the end of an object, and BACKWARD is a function
-which moves to the beginning.  If one is unspecified, the other
-is used with a negative argument.  THING is a symbol understood
-by thing-at-point. BEG, END and TYPE specify the current
-selection. If LINE is non-nil, the text object should be
-linewise, otherwise it is character wise."
-  (let* ((count (or count 1))
-         (bnd (or (let ((b (bounds-of-thing-at-point thing)))
-                    (and b (< (point) (cdr b)) b))
-                  (evil-bounds-of-not-thing-at-point thing))))
-    ;; check if current object is selected
-    (when (or (not beg) (not end)
-              (> beg (car bnd))
-              (< end (cdr bnd))
-              (and (eq type 'inclusive)
-                   (= (1+ beg) end))) ; empty region does not count
-      (when (or (not beg) (< (car bnd) beg)) (setq beg (car bnd)))
-      (when (or (not end) (> (cdr bnd) end)) (setq end (cdr bnd)))
-      (setq count (if (> count 0) (1- count) (1+ count))))
-    (goto-char (if (< count 0) beg end))
-    (evil-forward-nearest count
-                          #'(lambda (cnt) (forward-thing thing cnt))
-                          #'(lambda (cnt) (evil-forward-not-thing thing cnt)))
-    (evil-range (if (>= count 0) beg (point))
-                (if (< count 0) end (point))
-                (if line 'line type)
-                :expanded t)))
-
-(defun evil-select-an-object (thing beg end type count &optional line)
-  "Return an outer text object range of COUNT objects.
-If COUNT is positive, return objects following point; if COUNT is
-negative, return objects preceding point.  FORWARD is a function
-which moves to the end of an object, and BACKWARD is a function
-which moves to the beginning.  If one is unspecified, the other
-is used with a negative argument.  THING is a symbol understood
-by thing-at-point. BEG, END and TYPE specify the current
-selection. If LINE is non-nil, the text object should be
-linewise, otherwise it is character wise."
-  (let* ((dir (if (> (or count 1) 0) +1 -1))
-         (count (abs (or count 1)))
-         (objbnd (let ((b (bounds-of-thing-at-point thing)))
-                   (and b (< (point) (cdr b)) b)))
-         (bnd (or objbnd (evil-bounds-of-not-thing-at-point thing)))
-         addcurrent other)
-    ;; check if current object is not selected
-    (when (or (not beg) (not end)
-              (> beg (car bnd))
-              (< end (cdr bnd))
-              (and (eq type 'inclusive)
-                   (= (1+ beg) end))) ; empty region does not count
-      ;; if not, enlarge selection
-      (when (or (not beg) (< (car bnd) beg)) (setq beg (car bnd)))
-      (when (or (not end) (> (cdr bnd) end)) (setq end (cdr bnd)))
-      (if objbnd (setq addcurrent t)))
-    ;; make other and (point) reflect the selection
-    (cond
-     ((> dir 0) (goto-char end) (setq other beg))
-     (t (goto-char beg) (setq other end)))
-    (cond
-     ;; do nothing more than only current is selected
-     ((not (and (= beg (car bnd)) (= end (cdr bnd)))))
-     ;; current match is thing, add whitespace
-     (objbnd
-      (let ((wsend (evil-with-restriction
-                       ;; restrict to current line if we do non-line selection
-                       (and (not line) (line-beginning-position))
-                       (and (not line) (line-end-position))
-                     (evil-bounds-of-not-thing-at-point thing dir))))
-        (cond
-         (wsend
-          ;; add whitespace at end
-          (goto-char wsend)
-          (setq addcurrent t))
-         (t
-          ;; no whitespace at end, try beginning
-          (save-excursion
-            (goto-char other)
-            (setq wsend
-                  (evil-with-restriction
-                      ;; restrict to current line if we do non-line selection
-                      (and (not line) (line-beginning-position))
-                      (and (not line) (line-end-position))
-                    (evil-bounds-of-not-thing-at-point thing (- dir))))
-            (when wsend (setq other wsend addcurrent t)))))))
-     ;; current match is whitespace, add thing
-     (t
-      (forward-thing thing dir)
-      (setq addcurrent t)))
-    ;; possibly count current object as selection
-    (if addcurrent (setq count (1- count)))
-    ;; move
-    (dotimes (var count)
-      (let ((wsend (evil-bounds-of-not-thing-at-point thing dir)))
-        (if (and wsend (/= wsend (point)))
-            ;; start with whitespace
-            (forward-thing thing dir)
-          ;; start with thing
-          (forward-thing thing dir)
-          (setq wsend (evil-bounds-of-not-thing-at-point thing dir))
-          (when wsend (goto-char wsend)))))
-    ;; return range
-    (evil-range (if (> dir 0) other (point))
-                (if (< dir 0) other (point))
-                (if line 'line type)
-                :expanded t)))
-
-(defun evil--get-block-range (op cl selection-type)
-  "Return the exclusive range of a visual selection.
-OP and CL are pairs of buffer positions for the opening and
-closing delimiter of a range. SELECTION-TYPE is the desired type
-of selection.  It is a symbol that determines which parts of the
-block are selected.  If it is 'inclusive or t the returned range
-is \(cons (car OP) (cdr CL)). If it is 'exclusive or nil the
-returned range is (cons (cdr OP) (car CL)).  If it is
-'exclusive-line the returned range will skip whitespace at the
-end of the line of OP and at the beginning of the line of CL."
-  (cond
-   ((memq selection-type '(inclusive t)) (cons (car op) (cdr cl)))
-   ((memq selection-type '(exclusive nil)) (cons (cdr op) (car cl)))
-   ((eq selection-type 'exclusive-line)
-    (let ((beg (cdr op))
-          (end (car cl)))
-      (save-excursion
-        (goto-char beg)
-        (when (and (eolp) (not (eobp)))
-          (setq beg (line-beginning-position 2)))
-        (goto-char end)
-        (skip-chars-backward " \t")
-        (when (bolp)
-          (setq end (point))
-          (goto-char beg)
-          (when (and (not (bolp)) (< beg end))
-            (setq end (1- end)))))
-      (cons beg end)))
-   (t
-    (user-error "Unknown selection-type %s" selection-type))))
-
-(defun evil-select-block (thing beg end type count
-                                &optional
-                                selection-type
-                                countcurrent
-                                fixedscan)
-  "Return a range (BEG END) of COUNT delimited text objects.
-BEG END TYPE are the currently selected (visual) range.  The
-delimited object must be given by THING-up function (see
-`evil-up-block').
-
-SELECTION-TYPE is symbol that determines which parts of the block
-are selected.  If it is 'inclusive or t OPEN and CLOSE are
-included in the range. If it is 'exclusive or nil the delimiters
-are not contained. If it is 'exclusive-line the delimiters are
-not included as well as adjacent whitespace until the beginning
-of the next line or the end of the previous line. If the
-resulting selection consists of complete lines only and visual
-state is not active, the returned selection is linewise.
-
-If COUNTCURRENT is non-nil an objected is counted if the current
-selection matches that object exactly.
-
-Usually scanning for the surrounding block starts at (1+ beg)
-and (1- end). If this might fail due to the behavior of THING
-then FIXEDSCAN can be set to t. In this case the scan starts at
-BEG and END. One example where this might fail is if BEG and END
-are the delimiters of a string or comment."
-  (save-excursion
-    (save-match-data
-      (let* ((orig-beg beg)
-             (orig-end end)
-             (beg (or beg (point)))
-             (end (or end (point)))
-             (count (abs (or count 1)))
-             op cl op-end cl-end)
-        ;; We always assume at least one selected character.
-        (if (= beg end) (setq end (1+ end)))
-        ;; We scan twice: starting at (1+ beg) forward and at (1- end)
-        ;; backward. The resulting selection is the smaller one.
-        (goto-char (if fixedscan beg (1+ beg)))
-        (when (and (zerop (funcall thing +1)) (match-beginning 0))
-          (setq cl (cons (match-beginning 0) (match-end 0)))
-          (goto-char (car cl))
-          (when (and (zerop (funcall thing -1)) (match-beginning 0))
-            (setq op (cons (match-beginning 0) (match-end 0)))))
-        ;; start scanning from end
-        (goto-char (if fixedscan end (1- end)))
-        (when (and (zerop (funcall thing -1)) (match-beginning 0))
-          (setq op-end (cons (match-beginning 0) (match-end 0)))
-          (goto-char (cdr op-end))
-          (when (and (zerop (funcall thing +1)) (match-beginning 0))
-            (setq cl-end (cons (match-beginning 0) (match-end 0)))))
-        ;; Bug #607: use the tightest selection that contains the
-        ;; original selection. If non selection contains the original,
-        ;; use the larger one.
-        (cond
-         ((and (not op) (not cl-end))
-          (error "No surrounding delimiters found"))
-         ((or (not op) ; first not found
-              (and cl-end ; second found
-                   (>= (car op-end) (car op)) ; second smaller
-                   (<= (cdr cl-end) (cdr cl))
-                   (<= (car op-end) beg)      ; second contains orig
-                   (>= (cdr cl-end) end)))
-          (setq op op-end cl cl-end)))
-        (setq op-end op cl-end cl) ; store copy
-        ;; if the current selection contains the surrounding
-        ;; delimiters, they do not count as new selection
-        (let ((cnt (if (and orig-beg orig-end (not countcurrent))
-                       (let ((sel (evil--get-block-range op cl selection-type)))
-                         (if (and (<= orig-beg (car sel))
-                                  (>= orig-end (cdr sel)))
-                             count
-                           (1- count)))
-                     (1- count))))
-          ;; starting from the innermost surrounding delimiters
-          ;; increase selection
-          (when (> cnt 0)
-            (setq op (progn
-                       (goto-char (car op-end))
-                       (funcall thing (- cnt))
-                       (if (match-beginning 0)
-                           (cons (match-beginning 0) (match-end 0))
-                         op))
-                  cl (progn
-                       (goto-char (cdr cl-end))
-                       (funcall thing cnt)
-                       (if (match-beginning 0)
-                           (cons (match-beginning 0) (match-end 0))
-                         cl)))))
-        (let ((sel (evil--get-block-range op cl selection-type)))
-          (setq op (car sel)
-                cl (cdr sel)))
-        (cond
-         ((and (equal op orig-beg) (equal cl orig-end)
-               (or (not countcurrent)
-                   (and countcurrent (/= count 1))))
-          (error "No surrounding delimiters found"))
-         ((save-excursion
-            (and (not (evil-visual-state-p))
-                 (eq type 'inclusive)
-                 (progn (goto-char op) (bolp))
-                 (progn (goto-char cl) (bolp))))
-          (evil-range op cl 'line :expanded t))
-         (t
-          (evil-range op cl type :expanded t)))))))
-
-(defun evil-select-paren (open close beg end type count &optional inclusive)
-  "Return a range (BEG END) of COUNT delimited text objects.
-OPEN and CLOSE specify the opening and closing delimiter,
-respectively. BEG END TYPE are the currently selected (visual)
-range.  If INCLUSIVE is non-nil, OPEN and CLOSE are included in
-the range; otherwise they are excluded.
-
-The types of OPEN and CLOSE specify which kind of THING is used
-for parsing with `evil-select-block'. If OPEN and CLOSE are
-characters `evil-up-paren' is used. Otherwise OPEN and CLOSE
-must be regular expressions and `evil-up-block' is used.
-
-If the selection is exclusive, whitespace at the end or at the
-beginning of the selection until the end-of-line or beginning-of-line
-is ignored."
-  ;; we need special linewise exclusive selection
-  (unless inclusive (setq inclusive 'exclusive-line))
-  (cond
-   ((and (characterp open) (characterp close))
-    (let ((thing #'(lambda (&optional cnt)
-                     (evil-up-paren open close cnt)))
-          (bnd (or (bounds-of-thing-at-point 'evil-string)
-                   (bounds-of-thing-at-point 'evil-comment)
-                   ;; If point is at the opening quote of a string,
-                   ;; this must be handled as if point is within the
-                   ;; string, i.e. the selection must be extended
-                   ;; around the string. Otherwise
-                   ;; `evil-select-block' might do the wrong thing
-                   ;; because it accidentally moves point inside the
-                   ;; string (for inclusive selection) when looking
-                   ;; for the current surrounding block. (re #364)
-                   (and (= (point) (or beg (point)))
-                        (save-excursion
-                          (goto-char (1+ (or beg (point))))
-                          (or (bounds-of-thing-at-point 'evil-string)
-                              (bounds-of-thing-at-point 'evil-comment)))))))
-      (if (not bnd)
-          (evil-select-block thing beg end type count inclusive)
-        (or (evil-with-restriction (car bnd) (cdr bnd)
-              (condition-case nil
-                  (evil-select-block thing beg end type count inclusive)
-                (error nil)))
-            (save-excursion
-              (setq beg (or beg (point))
-                    end (or end (point)))
-              (goto-char (car bnd))
-              (let ((extbeg (min beg (car bnd)))
-                    (extend (max end (cdr bnd))))
-                (evil-select-block thing
-                                   extbeg extend
-                                   type
-                                   count
-                                   inclusive
-                                   (or (< extbeg beg) (> extend end))
-                                   t)))))))
-   (t
-    (evil-select-block #'(lambda (&optional cnt)
-                           (evil-up-block open close cnt))
-                       beg end type count inclusive))))
-
-(defun evil-select-quote-thing (thing beg end type count &optional inclusive)
-  "Selection THING as if it described a quoted object.
-THING is typically either 'evil-quote or 'evil-chars. This
-function is called from `evil-select-quote'."
-  (save-excursion
-    (let* ((count (or count 1))
-           (dir (if (> count 0) 1 -1))
-           (bnd (let ((b (bounds-of-thing-at-point thing)))
-                  (and b (< (point) (cdr b)) b)))
-           contains-string
-           addcurrent
-           wsboth)
-      (if inclusive (setq inclusive t)
-        (when (= (abs count) 2)
-          (setq count dir)
-          (setq inclusive 'quote-only))
-        ;; never extend with exclusive selection
-        (setq beg nil end nil))
-      ;; check if the previously selected range does not contain a
-      ;; string
-      (unless (and beg end
-                   (save-excursion
-                     (goto-char (if (> dir 0) beg end))
-                     (forward-thing thing dir)
-                     (and (<= beg (point)) (< (point) end))))
-        ;; if so forget the range
-        (setq beg nil end nil))
-      ;; check if there is a current object, if not fetch one
-      (when (not bnd)
-        (unless (and (zerop (forward-thing thing dir))
-                     (setq bnd (bounds-of-thing-at-point thing)))
-          (error "No quoted string found"))
-        (if (> dir 0)
-            (setq end (point))
-          (setq beg (point)))
-        (setq addcurrent t))
-      ;; check if current object is not selected
-      (when (or (not beg) (not end) (> beg (car bnd)) (< end (cdr bnd)))
-        ;; if not, enlarge selection
-        (when (or (not beg) (< (car bnd) beg)) (setq beg (car bnd)))
-        (when (or (not end) (> (cdr bnd) end)) (setq end (cdr bnd)))
-        (setq addcurrent t wsboth t))
-      ;; maybe count current element
-      (when addcurrent
-        (setq count (if (> dir 0) (1- count) (1+ count))))
-      ;; enlarge selection
-      (goto-char (if (> dir 0) end beg))
-      (when (and (not addcurrent)
-                 (= count (forward-thing thing count)))
-        (error "No quoted string found"))
-      (if (> dir 0) (setq end (point)) (setq beg (point)))
-      ;; add whitespace
-      (cond
-       ((not inclusive) (setq beg (1+ beg) end (1- end)))
-       ((not (eq inclusive 'quote-only))
-        ;; try to add whitespace in forward direction
-        (goto-char (if (> dir 0) end beg))
-        (if (setq bnd (bounds-of-thing-at-point 'evil-space))
-            (if (> dir 0) (setq end (cdr bnd)) (setq beg (car bnd)))
-          ;; if not found try backward direction
-          (goto-char (if (> dir 0) beg end))
-          (if (and wsboth (setq bnd (bounds-of-thing-at-point 'evil-space)))
-              (if (> dir 0) (setq beg (car bnd)) (setq end (cdr bnd)))))))
-      (evil-range beg end
-                  ;; HACK: fixes #583
-                  ;; When not in visual state, an empty range is
-                  ;; possible. However, this cannot be achieved with
-                  ;; inclusive ranges, hence we use exclusive ranges
-                  ;; in this case. In visual state the range must be
-                  ;; inclusive because otherwise the selection would
-                  ;; be wrong.
-                  (if (evil-visual-state-p) 'inclusive 'exclusive)
-                  :expanded t))))
-
-(defun evil-select-quote (quote beg end type count &optional inclusive)
-  "Return a range (BEG END) of COUNT quoted text objects.
-QUOTE specifies the quotation delimiter. BEG END TYPE are the
-currently selected (visual) range.
-
-If INCLUSIVE is nil the previous selection is ignore. If there is
-quoted string at point this object will be selected, otherwise
-the following (if (> COUNT 0)) or preceeding object (if (< COUNT
-0)) is selected. If (/= (abs COUNT) 2) the delimiting quotes are not
-contained in the range, otherwise they are contained in the range.
-
-If INCLUSIVE is non-nil the selection depends on the previous
-selection. If the currently selection contains at least one
-character that is contained in a quoted string then the selection
-is extended, otherwise it is thrown away. If there is a
-non-selected object at point then this object is added to the
-selection. Otherwise the selection is extended to the
-following (if (> COUNT 0)) or preceeding object (if (< COUNT
-0)). Any whitespace following (or preceeding if (< COUNT 0)) the
-new selection is added to the selection. If no such whitespace
-exists and the selection contains only one quoted string then the
-preceeding (or following) whitespace is added to the range. "
-  (let ((evil-forward-quote-char quote))
-    (or (let ((bnd (or (bounds-of-thing-at-point 'evil-comment)
-                       (bounds-of-thing-at-point 'evil-string))))
-          (when (and bnd (< (point) (cdr bnd))
-                     (/= (char-after (car bnd)) quote)
-                     (/= (char-before (cdr bnd)) quote))
-            (evil-with-restriction (car bnd) (cdr bnd)
-              (condition-case nil
-                  (evil-select-quote-thing 'evil-quote-simple
-                                           beg end type
-                                           count
-                                           inclusive)
-                (error nil)))))
-        (let ((evil-forward-quote-char quote))
-          (evil-select-quote-thing 'evil-quote
-                                   beg end type
-                                   count
-                                   inclusive)))))
-
-(defun evil-select-xml-tag (beg end type &optional count inclusive)
-  "Return a range (BEG END) of COUNT matching XML tags.
-If INCLUSIVE is non-nil, the tags themselves are included
-from the range."
-  (cond
-   ((and (not inclusive) (= (abs (or count 1)) 1))
-    (let ((rng (evil-select-block #'evil-up-xml-tag beg end type count nil t)))
-      (if (or (and beg (= beg (evil-range-beginning rng))
-                   end (= end (evil-range-end rng)))
-              (= (evil-range-beginning rng) (evil-range-end rng)))
-          (evil-select-block #'evil-up-xml-tag beg end type count t)
-        rng)))
-   (t
-    (evil-select-block #'evil-up-xml-tag beg end type count inclusive))))
-
-(defun evil-expand-range (range &optional copy)
-  "Expand RANGE according to its type.
-Return a new range if COPY is non-nil."
-  (when copy
-    (setq range (evil-copy-range range)))
-  (unless (plist-get (evil-range-properties range) :expanded)
-    (setq range (evil-transform-range :expand range)))
-  range)
-
-(defun evil-contract-range (range &optional copy)
-  "Contract RANGE according to its type.
-Return a new range if COPY is non-nil."
-  (evil-transform-range :contract range copy))
-
-(defun evil-normalize-range (range &optional copy)
-  "Normalize RANGE according to its type.
-Return a new range if COPY is non-nil."
-  (evil-transform-range :normalize range copy))
-
-(defun evil-transform-range (transform range &optional copy)
-  "Apply TRANSFORM to RANGE according to its type.
-Return a new range if COPY is non-nil."
-  (when copy
-    (setq range (evil-copy-range range)))
-  (when (evil-type range)
-    (apply #'evil-set-range range
-           (apply #'evil-transform transform range)))
-  range)
-
-(defun evil-describe-range (range)
-  "Return description of RANGE.
-If no description is available, return the empty string."
-  (apply #'evil-describe range))
-
-;;; Undo
-
-(defun evil-start-undo-step (&optional continue)
-  "Start a undo step.
-All following buffer modifications are grouped together as a
-single action. If CONTINUE is non-nil, preceding modifications
-are included. The step is terminated with `evil-end-undo-step'."
-  (when (and (listp buffer-undo-list)
-             (not evil-in-single-undo))
-    (if evil-undo-list-pointer
-        (evil-refresh-undo-step)
-      (unless (or continue (null (car-safe buffer-undo-list)))
-        (undo-boundary))
-      (setq evil-undo-list-pointer (or buffer-undo-list t)))))
-
-(defun evil-end-undo-step (&optional continue)
-  "End a undo step started with `evil-start-undo-step'.
-Adds an undo boundary unless CONTINUE is specified."
-  (when (and evil-undo-list-pointer
-             (not evil-in-single-undo))
-    (evil-refresh-undo-step)
-    (unless (or continue (null (car-safe buffer-undo-list)))
-      (undo-boundary))
-    (setq evil-undo-list-pointer nil)))
-
-(defun evil-refresh-undo-step ()
-  "Refresh `buffer-undo-list' entries for current undo step.
-Undo boundaries until `evil-undo-list-pointer' are removed to
-make the entries undoable as a single action. See
-`evil-start-undo-step'."
-  (when evil-undo-list-pointer
-    (setq buffer-undo-list
-          (evil-filter-list #'null buffer-undo-list evil-undo-list-pointer))
-    (setq evil-undo-list-pointer (or buffer-undo-list t))))
-
-(defmacro evil-with-undo (&rest body)
-  "Execute BODY with enabled undo.
-If undo is disabled in the current buffer, the undo information
-is stored in `evil-temporary-undo' instead of `buffer-undo-list'."
-  (declare (indent defun)
-           (debug t))
-  `(unwind-protect
-       (let (buffer-undo-list)
-         (prog1
-             (progn ,@body)
-           (setq evil-temporary-undo buffer-undo-list)
-           ;; ensure evil-temporary-undo starts with exactly one undo
-           ;; boundary marker, i.e. nil
-           (unless (null (car-safe evil-temporary-undo))
-             (push nil evil-temporary-undo))))
-     (unless (eq buffer-undo-list t)
-       ;; undo is enabled, so update the global buffer undo list
-       (setq buffer-undo-list
-             ;; prepend new undos (if there are any)
-             (if (cdr evil-temporary-undo)
-                 (nconc evil-temporary-undo buffer-undo-list)
-               buffer-undo-list)
-             evil-temporary-undo nil))))
-
-(defmacro evil-with-single-undo (&rest body)
-  "Execute BODY as a single undo step."
-  (declare (indent defun)
-           (debug t))
-  `(let (evil-undo-list-pointer)
-     (evil-with-undo
-       (unwind-protect
-           (progn
-             (evil-start-undo-step)
-             (let ((evil-in-single-undo t))
-               ,@body))
-         (evil-end-undo-step)))))
-
-(defun evil-undo-pop ()
-  "Undo the last buffer change.
-Removes the last undo information from `buffer-undo-list'.
-If undo is disabled in the current buffer, use the information
-in `evil-temporary-undo' instead."
-  (let ((paste-undo (list nil)))
-    (let ((undo-list (if (eq buffer-undo-list t)
-                         evil-temporary-undo
-                       buffer-undo-list)))
-      (when (or (not undo-list) (car undo-list))
-        (user-error "Can't undo previous change"))
-      (while (and undo-list (null (car undo-list)))
-        (pop undo-list)) ; remove nil
-      (while (and undo-list (car undo-list))
-        (push (pop undo-list) paste-undo))
-      (let ((buffer-undo-list (nreverse paste-undo)))
-        (evil-save-echo-area
-          (undo)))
-      (if (eq buffer-undo-list t)
-          (setq evil-temporary-undo nil)
-        (setq buffer-undo-list undo-list)))))
-
-;;; Search
-(defun evil-transform-regexp (regexp replacements-alist)
-  (let ((pos 0) result)
-    (replace-regexp-in-string
-     "\\\\+[^\\\\]"
-     #'(lambda (txt)
-         (let* ((b (match-beginning 0))
-                (e (match-end 0))
-                (ch (aref txt (1- e)))
-                (repl (assoc ch replacements-alist)))
-           (if (and repl (zerop (mod (length txt) 2)))
-               (concat (substring txt b (- e 2))
-                       (cdr repl))
-             txt)))
-     regexp nil t)))
-
-(defun evil-transform-magic (str magic quote transform &optional start)
-  "Transforms STR with magic characters.
-MAGIC is a regexp that matches all potential magic
-characters. Each occurence of CHAR as magic character within str
-is replaced by the result of calling the associated TRANSFORM
-function. TRANSFORM is a function taking two arguments, the
-character to be transformed and the rest of string after the
-character. The function should return a triple (REPLACEMENT REST
-. STOP) where REPLACEMENT is the replacement and REST is the rest
-of the string that has not been transformed. If STOP is non-nil
-then the substitution stops immediately.  The replacement starts
-at position START, everything before that position is returned
-literally.  The result is a pair (RESULT . REST). RESULT is a
-list containing the transformed parts in order. If two
-subsequents parts are both strings, they are concatenated. REST
-is the untransformed rest string (usually \"\" but may be more if
-TRANSFORM stopped the substitution). Which characters are
-considered as magic characters (i.e. the transformation happens
-if the character is NOT preceeded by a backslash) is determined
-by `evil-magic'. The special tokens \\v, \\V, \\m and \\M have
-always a special meaning (like in Vim) and should not be
-contained in TRANSFORMS, otherwise their meaning is overwritten.
-
-The parameter QUOTE is a quoting function applied to literal
-transformations, usually `regexp-quote' or `replace-quote'."
-  (save-match-data
-    (let ((regexp (concat "\\(?:\\`\\|[^\\]\\)\\(\\\\\\(?:\\(" magic "\\)\\|\\(.\\)\\)\\|\\(" magic "\\)\\)"))
-          (magic-chars (evil-get-magic evil-magic))
-          (evil-magic evil-magic)
-          (quote (or quote #'identity))
-          result stop)
-      (while (and (not stop) str (string-match regexp str))
-        (unless (zerop (match-beginning 1))
-          (push (substring str 0 (match-beginning 1)) result))
-        (let ((char (or (match-string 2 str)
-                        (match-string 3 str)
-                        (match-string 4 str)))
-              (rest (substring str (match-end 0))))
-          (cond
-           ((match-beginning 4)
-            ;; magic character without backslash
-            (if (string-match magic-chars char)
-                ;; magic, do transform
-                (let ((trans (funcall transform (aref char 0) rest)))
-                  (push (car trans) result)
-                  (setq str (cadr trans) stop (nthcdr 2 trans)))
-              ;; non-magic, literal transformation
-              (push (funcall quote char) result)
-              (setq str rest)))
-           ((match-beginning 2)
-            ;; magic character with backslash
-            (if (not (string-match magic-chars char))
-                ;; non-magic, do transform
-                (let ((trans (funcall transform (aref char 0) rest)))
-                  (push (car trans) result)
-                  (setq str (cadr trans) stop (nthcdr 2 trans)))
-              ;; magic, literal transformation
-              (push (funcall quote char) result)
-              (setq str rest)))
-           ((memq (aref char 0) '(?m ?M ?v ?V))
-            (setq evil-magic (cdr (assq (aref char 0)
-                                        '((?m . t)
-                                          (?M . nil)
-                                          (?v . very-magic)
-                                          (?V . very-nomagic)))))
-            (setq magic-chars (evil-get-magic evil-magic))
-            (setq str rest))
-           (t
-            ;; non-magic char with backslash, literal transformation
-            (push (funcall quote char) result)
-            (setq str rest)))))
-      (cond
-       ((and str (not stop))
-        (push str result)
-        (setq str ""))
-       ((not str)
-        (setq str "")))
-      ;; concatenate subsequent strings
-      ;; note that result is in reverse order
-      (let (repl)
-        (while result
-          (cond
-           ((and (stringp (car result))
-                 (zerop (length (car result))))
-            (pop result))
-           ((and (stringp (car result))
-                 (stringp (cadr result)))
-            (setq result (cons (concat (cadr result)
-                                       (car result))
-                               (nthcdr 2 result))))
-           (t
-            (push (pop result) repl))))
-        (cons repl str)))))
-
-(defconst evil-vim-regexp-replacements
-  '((?n . "\n")           (?r . "\r")
-    (?t . "\t")           (?b . "\b")
-    (?s . "[[:space:]]")  (?S . "[^[:space:]]")
-    (?d . "[[:digit:]]")  (?D . "[^[:digit:]]")
-    (?x . "[[:xdigit:]]") (?X . "[^[:xdigit:]]")
-    (?o . "[0-7]")        (?O . "[^0-7]")
-    (?a . "[[:alpha:]]")  (?A . "[^[:alpha:]]")
-    (?l . "[a-z]")        (?L . "[^a-z]")
-    (?u . "[A-Z]")        (?U . "[^A-Z]")
-    (?y . "\\s")          (?Y . "\\S")
-    (?( . "\\(")          (?) . "\\)")
-    (?{ . "\\{")          (?} . "\\}")
-    (?[ . "[")            (?] . "]")
-    (?< . "\\<")          (?> . "\\>")
-    (?_ . "\\_")
-    (?* . "*")            (?+ . "+")
-    (?? . "?")            (?= . "?")
-    (?. . ".")
-    (?` . "`")            (?^ . "^")
-    (?$ . "$")            (?| . "\\|")))
-
-(defconst evil-regexp-magic "[][(){}<>_dDsSxXoOaAlLuUwWyY.*+?=^$`|nrtb]")
-
-(defun evil-transform-vim-style-regexp (regexp)
-  "Transforms vim-style backslash codes to Emacs regexp.
-This includes the backslash codes \\d, \\D, \\s, \\S, \\x, \\X,
-\\o, \\O, \\a, \\A, \\l, \\L, \\u, \\U and \\w, \\W. The new
-codes \\y and \\Y can be used instead of the Emacs code \\s and
-\\S which have a different meaning in Vim-style."
-  (car
-   (car
-    (evil-transform-magic
-     regexp evil-regexp-magic #'regexp-quote
-     #'(lambda (char rest)
-         (let ((repl (assoc char evil-vim-regexp-replacements)))
-           (if repl
-               (list (cdr repl) rest)
-             (list (concat "\\" (char-to-string char)) rest))))))))
-
-;;; Substitute
-
-(defun evil-downcase-first (str)
-  "Return STR with the first letter downcased."
-  (if (zerop (length str))
-      str
-    (concat (downcase (substring str 0 1))
-            (substring str 1))))
-
-(defun evil-upcase-first (str)
-  "Return STR with the first letter upcased."
-  (if (zerop (length str))
-      str
-    (concat (upcase (substring str 0 1))
-            (substring str 1))))
-
-(defun evil-get-magic (magic)
-  "Returns a regexp matching the magic characters according to MAGIC.
-Depending on the value of MAGIC the following characters are
-considered magic.
-  t             [][{}*+?.&~$^
-  nil           [][{}*+?$^
-  'very-magic   not 0-9A-Za-z_
-  'very-nomagic empty."
-  (cond
-   ((eq magic t) "[][}{*+?.&~$^]")
-   ((eq magic 'very-magic) "[^0-9A-Za-z_]")
-   ((eq magic 'very-nomagic) "\\\\")
-   (t "[][}{*+?$^]")))
-
-;; TODO: support magic characters in patterns
-(defconst evil-replacement-magic "[eElLuU0-9&#,rnbt=]"
-  "All magic characters in a replacement string")
-
-(defun evil-compile-subreplacement (to &optional start)
-  "Convert a regexp replacement TO to Lisp from START until \\e or \\E.
-Returns a pair (RESULT . REST). RESULT is a list suitable for
-`perform-replace' if necessary, the original string if not.
-REST is the unparsed remainder of TO."
-  (let ((result
-         (evil-transform-magic
-          to evil-replacement-magic #'replace-quote
-          #'(lambda (char rest)
-              (cond
-               ((eq char ?#)
-                (list '(number-to-string replace-count) rest))
-               ((eq char ?r) (list "\r" rest))
-               ((eq char ?n) (list "\n" rest))
-               ((eq char ?b) (list "\b" rest))
-               ((eq char ?t) (list "\t" rest))
-               ((memq char '(?e ?E))
-                `("" ,rest . t))
-               ((memq char '(?l ?L ?u ?U))
-                (let ((result (evil-compile-subreplacement rest))
-                      (func (cdr (assoc char
-                                        '((?l . evil-downcase-first)
-                                          (?L . downcase)
-                                          (?u . evil-upcase-first)
-                                          (?U . upcase))))))
-                  (list `(,func
-                          (replace-quote
-                           (evil-match-substitute-replacement
-                            ,(car result)
-                            (not case-replace))))
-                        (cdr result))))
-               ((eq char ?=)
-                (when (or (zerop (length rest))
-                          (not (eq (aref rest 0) ?@)))
-                  (user-error "Expected @ after \\="))
-                (when (< (length rest) 2)
-                  (user-error "Expected register after \\=@"))
-                (list (evil-get-register (aref rest 1))
-                      (substring rest 2)))
-               ((eq char ?,)
-                (let* ((obj (read-from-string rest))
-                       (result `(replace-quote ,(car obj)))
-                       (end
-                        ;; swallow a space after a symbol
-                        (if (and (or (symbolp (car obj))
-                                     ;; swallow a space after 'foo,
-                                     ;; but not after (quote foo)
-                                     (and (eq (car-safe (car obj)) 'quote)
-                                          (not (= ?\( (aref rest 0)))))
-                                 (eq (string-match " " rest (cdr obj))
-                                     (cdr obj)))
-                            (1+ (cdr obj))
-                          (cdr obj))))
-                  (list result (substring rest end))))
-               ((eq char ?0)
-                (list "\\&" rest))
-               (t
-                (list (concat "\\" (char-to-string char)) rest))))
-          start)))
-    (let ((rest (cdr result))
-          (result (car result)))
-      (replace-match-string-symbols result)
-      (cons (if (cdr result)
-                (cons 'concat result)
-              (or (car result) ""))
-            rest))))
-
-(defun evil-compile-replacement (to)
-  "Maybe convert a regexp replacement TO to Lisp.
-Returns a list suitable for `perform-replace' if necessary, the
-original string if not. Currently the following magic characters
-in replacements are supported: 0-9&#lLuUrnbt,
-The magic character , (comma) start an Emacs-lisp expression."
-  (when (stringp to)
-    (save-match-data
-      (cons 'replace-eval-replacement
-            (car (evil-compile-subreplacement to))))))
-
-(defun evil-replace-match (replacement &optional fixedcase string)
-  "Replace text match by last search with REPLACEMENT.
-If REPLACEMENT is an expression it will be evaluated to compute
-the replacement text, otherwise the function behaves as
-`replace-match'."
-  (if (stringp replacement)
-      (replace-match replacement fixedcase nil string)
-    (replace-match (funcall (car replacement)
-                            (cdr replacement)
-                            0)
-                   fixedcase nil string)))
-
-(defun evil-match-substitute-replacement (replacement &optional fixedcase string)
-  "Return REPLACEMENT as it will be inserted by `evil-replace-match'."
-  (if (stringp replacement)
-      (match-substitute-replacement replacement fixedcase nil string)
-    (match-substitute-replacement (funcall (car replacement)
-                                           (cdr replacement)
-                                           0)
-                                  fixedcase nil string)))
-
-;;; Alignment
-
-(defun evil-justify-lines (beg end justify position)
-  "Justifes all lines in a range.
-BEG and END specify the range of those lines to be
-justified. JUSTIFY is either 'left, 'right or 'center according
-to the justification type. POSITION is the maximal text width for
-right and center justification or the column at which the lines
-should be left-aligned for left justification."
-  (let ((fill-column position)
-        adaptive-fill-mode fill-prefix)
-    (evil-with-restriction
-        (save-excursion
-          (goto-char beg)
-          (line-beginning-position))
-        (save-excursion
-          (goto-char end)
-          (if (bolp)
-              (line-end-position 0)
-            (line-end-position)))
-      (goto-char (point-min))
-      (while (progn
-               (if (eq justify 'left)
-                   (indent-line-to position)
-                 (when (re-search-forward "^[[:space:]]*" nil t)
-                   (delete-region (match-beginning 0)
-                                  (match-end 0)))
-                 (justify-current-line justify nil t))
-               (and (zerop (forward-line)) (bolp))))
-      (goto-char (point-min))
-      (back-to-indentation))))
-
-;;; View helper
-
-(defvar-local evil-list-view-select-action nil)
-(put 'evil-list-view-select-action 'permanent-local t)
-
-(define-derived-mode evil-list-view-mode tabulated-list-mode
-  "Evil List View"
-  (tabulated-list-init-header)
-  (tabulated-list-print))
-
-(defun evil-list-view-goto-entry ()
-  (interactive)
-  (when (and evil-list-view-select-action
-             (not (eobp)))
-    (let* ((line (line-number-at-pos (point)))
-           (entry (elt tabulated-list-entries (1- line))))
-      (funcall evil-list-view-select-action (nth 1 entry)))))
-
-(define-key evil-list-view-mode-map (kbd "q") #'kill-this-buffer)
-(define-key evil-list-view-mode-map [follow-link] nil) ;; allows mouse-1 to be activated
-(define-key evil-list-view-mode-map [mouse-1] #'evil-list-view-goto-entry)
-(define-key evil-list-view-mode-map [return] #'evil-list-view-goto-entry)
-
-(defmacro evil-with-view-list (&rest properties)
-  "Opens new list view buffer.
-
-PROPERTIES is a property-list which supports the following properties:
-
-:name           (required)   The name of the buffer.
-:mode-name      (required)   The name for the mode line.
-:format         (required)   The value for `tabulated-list-format'.
-:entries        (required)   The value for `tabulated-list-entries'.
-:select-action  (optional)   A function for row selection.
-                             It takes in a single parameter, which is the selected row's
-                             vector value that is passed into `:entries'.
-"
-  (declare (indent defun) (debug t))
-  `(let ((bufname (concat "*" ,(plist-get properties :name) "*"))
-         (inhibit-read-only t))
-     (and (get-buffer bufname)
-          (kill-buffer bufname))
-     (let ((buf (get-buffer-create bufname)))
-       (with-current-buffer buf
-         (setq tabulated-list-format ,(plist-get properties :format))
-         (setq tabulated-list-entries ,(plist-get properties :entries))
-         (setq evil-list-view-select-action ,(plist-get properties :select-action))
-         (evil-list-view-mode)
-         (setq mode-name ,(plist-get properties :mode-name))
-         (evil-motion-state))
-       (switch-to-buffer-other-window buf))))
-
-(provide 'evil-common)
-
-;;; evil-common.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-common.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-core.el
@@ -1,1259 +0,0 @@
-;;; evil-core.el --- Core functionality
-;; Author: Vegard Øye <vegard_oye at hotmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Evil is defined as a globalized minor mode, enabled with the toggle
-;; function `evil-mode'.  This in turn enables `evil-local-mode' in
-;; every buffer, which sets up the buffer's state.
-;;
-;; Each state has its own keymaps, and these keymaps have status as
-;; "emulation keymaps" with priority over regular keymaps.  Emacs
-;; maintains the following keymap hierarchy (highest priority first):
-;;
-;;     * Overriding keymaps/overlay keymaps...
-;;     * Emulation mode keymaps...
-;;       - Evil keymaps...
-;;     * Minor mode keymaps...
-;;     * Local keymap (`local-set-key')
-;;     * Global keymap (`global-set-key')
-;;
-;; Within this hierarchy, Evil arranges the keymaps for the current
-;; state as shown below:
-;;
-;;     * Intercept keymaps...
-;;     * Local state keymap
-;;     * Minor-mode keymaps...
-;;     * Auxiliary keymaps...
-;;     * Overriding keymaps...
-;;     * Global state keymap
-;;     * Keymaps for other states...
-;;
-;; These keymaps are listed in `evil-mode-map-alist', which is listed
-;; in `emulation-mode-map-alist'.
-;;
-;; Most of the key bindings for a state are stored in its global
-;; keymap, which has a name such as `evil-normal-state-map'. (See the
-;; file evil-maps.el, which contains all the default key bindings.) A
-;; state also has a local keymap (`evil-normal-state-local-map'),
-;; which may contain user customizations for the current buffer.
-;; Furthermore, any Emacs mode may be assigned state bindings of its
-;; own by passing the mode's keymap to the function `evil-define-key'
-;; or `evil-define-minor-mode-key'. The former uses a specific map to
-;; define the key in while the latter associates the key with a
-;; particular mode. These mode-specific bindings are ultimately stored
-;; in so-called auxiliary and minor-mode keymaps respectively, which
-;; are sandwiched between the local keymap and the global keymap.
-;; Finally, the state may also activate the keymaps of other states
-;; (e.g., Normal state inherits bindings from Motion state).
-;;
-;; For integration purposes, a regular Emacs keymap may be "elevated"
-;; to emulation status by passing it to `evil-make-intercept-map' or
-;; `evil-make-overriding-map'.  An "intercept" keymap has priority over
-;; all other Evil keymaps.  (Evil uses this facility when debugging and
-;; for handling the "ESC" key in the terminal.) More common is the
-;; "overriding" keymap, which only has priority over the global state
-;; keymap.  (This is useful for adapting key-heavy modes such as Dired,
-;; where all but a few keys should be left as-is and should not be
-;; shadowed by Evil's default bindings.)
-;;
-;; States are defined with the macro `evil-define-state', which
-;; creates a command for switching to the state.  This command,
-;; for example `evil-normal-state' for Normal state, performs
-;; the following tasks:
-;;
-;;     * Setting `evil-state' to the new state.
-;;     * Refreshing the keymaps in `evil-mode-map-alist'.
-;;     * Updating the mode line.
-;;       - Normal state depends on `evil-normal-state-tag'.
-;;     * Adjusting the cursor's appearance.
-;;       - Normal state depends on `evil-normal-state-cursor'.
-;;     * Displaying a message in the echo area.
-;;       - Normal state depends on `evil-normal-state-message'.
-;;     * Running hooks.
-;;       - Normal state runs `evil-normal-state-entry-hook' when
-;;         entering, and `evil-normal-state-exit-hook' when exiting.
-;;
-;; The various properties of a state can be accessed through their
-;; respective variables, or by passing a keyword and the state's name
-;; to the `evil-state-property' function.  Evil defines the states
-;; Normal state ("normal"), Insert state ("insert"), Visual state
-;; ("visual"), Replace state ("replace"), Operator-Pending state
-;; ("operator"), Motion state ("motion") and Emacs state ("emacs").
-
-(require 'evil-common)
-
-;;; Code:
-
-(declare-function evil-emacs-state-p "evil-states")
-(declare-function evil-ex-p "evil-ex")
-(defvar evil-mode-buffers)
-
-(define-minor-mode evil-local-mode
-  "Minor mode for setting up Evil in a single buffer."
-  :init-value nil
-  (cond
-   ((evil-disabled-buffer-p)
-    ;; Don't leave the mode variable on in buffers where evil disabled, because
-    ;; functions that check this variable will get an incorrect result (e.g.,
-    ;; evil-refresh-cursor).
-    (setq evil-local-mode nil))
-   (evil-local-mode
-    (setq emulation-mode-map-alists
-          (evil-concat-lists '(evil-mode-map-alist)
-                             emulation-mode-map-alists))
-    (evil-initialize-local-keymaps)
-    ;; restore the proper value of `major-mode' in Fundamental buffers
-    (when (eq major-mode 'turn-on-evil-mode)
-      (setq major-mode 'fundamental-mode))
-    ;; The initial state is usually setup by `evil-initialize' when
-    ;; the major-mode in a buffer changes. This preliminary
-    ;; initialization is only for the case when `evil-local-mode' is
-    ;; called directly for the first time in a buffer.
-    (unless evil-state (evil-initialize-state))
-    (add-hook 'input-method-activate-hook 'evil-activate-input-method t t)
-    (add-hook 'input-method-deactivate-hook 'evil-deactivate-input-method t t)
-    (add-hook 'activate-mark-hook 'evil-visual-activate-hook nil t)
-    (add-hook 'pre-command-hook 'evil-repeat-pre-hook)
-    (add-hook 'post-command-hook 'evil-repeat-post-hook))
-   (t
-    (evil-refresh-mode-line)
-    (remove-hook 'activate-mark-hook 'evil-visual-activate-hook t)
-    (remove-hook 'input-method-activate-hook 'evil-activate-input-method t)
-    (remove-hook 'input-method-deactivate-hook 'evil-deactivate-input-method t)
-    (evil-change-state nil))))
-
-;; Make the variable permanent local.  This is particular useful in
-;; conjunction with nXhtml/mumamo because mumamo does not touch these
-;; variables.
-(put 'evil-local-mode 'permanent-local t)
-
-(defun turn-on-evil-mode (&optional arg)
-  "Turn on Evil in the current buffer."
-  (interactive)
-  (evil-local-mode (or arg 1)))
-
-(defun turn-off-evil-mode (&optional arg)
-  "Turn off Evil in the current buffer."
-  (interactive)
-  (evil-local-mode (or arg -1)))
-
-;; The function `evil-initialize' should only be used to initialize
-;; `evil-local-mode' from the globalized minor-mode `evil-mode'. It is
-;; called whenever evil is enabled in a buffer for the first time or
-;; when evil is active and the major-mode of the buffer changes. In
-;; addition to enabling `evil-local-mode' it also sets the initial
-;; evil-state according to the major-mode.
-(defun evil-initialize ()
-  "Enable Evil in the current buffer, if appropriate.
-To enable Evil globally, do (evil-mode 1)."
-  ;; TODO: option for enabling vi keys in the minibuffer
-  (unless (minibufferp)
-    (evil-local-mode 1)
-    (evil-initialize-state)))
-
-;;;###autoload (autoload 'evil-mode "evil")
-(define-globalized-minor-mode evil-mode
-  evil-local-mode evil-initialize)
-
-;; No hooks are run in Fundamental buffers, so other measures are
-;; necessary to initialize Evil in these buffers. When Evil is
-;; enabled globally, the default value of `major-mode' is set to
-;; `turn-on-evil-mode', so that Evil is enabled in Fundamental
-;; buffers as well. Then, the buffer-local value of `major-mode' is
-;; changed back to `fundamental-mode'. (Since the `evil-mode' function
-;; is created by a macro, we use `defadvice' to augment it.)
-(defadvice evil-mode (after start-evil activate)
-  "Enable Evil in Fundamental mode."
-  (if evil-mode
-      (progn
-        (when (eq (default-value 'major-mode) 'fundamental-mode)
-          ;; changed back by `evil-local-mode'
-          (setq-default major-mode 'turn-on-evil-mode))
-        (ad-enable-regexp "^evil")
-        (ad-activate-regexp "^evil")
-        (with-no-warnings (evil-esc-mode 1)))
-    (when (eq (default-value 'major-mode) 'turn-on-evil-mode)
-      (setq-default major-mode 'fundamental-mode))
-    (ad-disable-regexp "^evil")
-    (ad-update-regexp "^evil")
-    (with-no-warnings (evil-esc-mode -1))))
-
-(defun evil-change-state (state &optional message)
-  "Change the state to STATE.
-If STATE is nil, disable all states."
-  (let ((func (evil-state-property (or state evil-state) :toggle)))
-    (when (and (functionp func)
-               (or message (not (eq state evil-state))))
-      (funcall func (if state (and message 1) -1)))))
-
-(defmacro evil-save-state (&rest body)
-  "Save the current state; execute BODY; restore the state."
-  (declare (indent defun)
-           (debug t))
-  `(let* ((evil-state evil-state)
-          (evil-previous-state evil-previous-state)
-          (evil-previous-state-alist (copy-tree evil-previous-state-alist))
-          (evil-next-state evil-next-state)
-          (old-state evil-state)
-          (inhibit-quit t)
-          (buf (current-buffer)))
-     (unwind-protect
-         (progn ,@body)
-       (when (buffer-live-p buf)
-         (with-current-buffer buf
-           (evil-change-state old-state))))))
-
-(defmacro evil-with-state (state &rest body)
-  "Change to STATE and execute BODY without refreshing the display.
-Restore the previous state afterwards."
-  (declare (indent defun)
-           (debug t))
-  `(evil-without-display
-     (evil-save-state
-       (evil-change-state ',state)
-       ,@body)))
-
-(defun evil-initializing-p (&optional buffer)
-  "Whether Evil is in the process of being initialized."
-  (memq (or buffer (current-buffer)) evil-mode-buffers))
-
-(defun evil-initialize-state (&optional state buffer)
-  "Set up the initial state for BUFFER.
-BUFFER defaults to the current buffer.
-Uses STATE if specified, or calls `evil-initial-state-for-buffer'.
-See also `evil-set-initial-state'."
-  (with-current-buffer (or buffer (current-buffer))
-    (if state (evil-change-state state)
-      (evil-change-to-initial-state buffer))))
-(put 'evil-initialize-state 'permanent-local-hook t)
-
-(defun evil-initial-state-for-buffer-name (&optional name default)
-  "Return the initial Evil state to use for a buffer with name NAME.
-Matches the name against the regular expressions in
-`evil-buffer-regexps'. If none matches, returns DEFAULT."
-  (let ((name (if (stringp name) name (buffer-name name)))
-        regexp state)
-    (when (stringp name)
-      (catch 'done
-        (dolist (entry evil-buffer-regexps default)
-          (setq regexp (car entry)
-                state (cdr entry))
-          (when (string-match regexp name)
-            (throw 'done state)))))))
-
-(defun evil-disabled-buffer-p (&optional buffer)
-  "Whether Evil should be disabled in BUFFER."
-  (null (evil-initial-state-for-buffer-name buffer 'undefined)))
-
-(defun evil-initial-state-for-buffer (&optional buffer default)
-  "Return the initial Evil state to use for BUFFER.
-BUFFER defaults to the current buffer. Returns DEFAULT
-if no initial state is associated with BUFFER.
-See also `evil-initial-state'."
-  (with-current-buffer (or buffer (current-buffer))
-    (or (evil-initial-state-for-buffer-name (buffer-name))
-        (catch 'done
-          (dolist (mode minor-mode-map-alist)
-            (setq mode (car-safe mode))
-            (when (and (boundp mode) (symbol-value mode))
-              (when (setq mode (evil-initial-state mode))
-                (throw 'done mode)))))
-        (evil-initial-state major-mode)
-        default)))
-
-(defun evil-initial-state (mode &optional default)
-  "Return the Evil state to use for MODE.
-Returns DEFAULT if no initial state is associated with MODE.
-The initial state for a mode can be set with
-`evil-set-initial-state'."
-  (let (state modes)
-    (catch 'done
-      (dolist (entry (evil-state-property t :modes) default)
-        (setq state (car entry)
-              modes (symbol-value (cdr entry)))
-        (when (memq mode modes)
-          (throw 'done state))))))
-
-(defun evil-set-initial-state (mode state)
-  "Set the initial state for MODE to STATE.
-This is the state the buffer comes up in."
-  (dolist (modes (evil-state-property t :modes))
-    (setq modes (cdr-safe modes))
-    (set modes (delq mode (symbol-value modes))))
-  (when state
-    (add-to-list (evil-state-property state :modes) mode)))
-
-(evil-define-command evil-change-to-initial-state
-  (&optional buffer message)
-  "Change the state of BUFFER to its initial state.
-This is the state the buffer came up in. If Evil is not activated
-then this function does nothing."
-  :keep-visual t
-  :suppress-operator t
-  (with-current-buffer (or buffer (current-buffer))
-    (when evil-local-mode
-      (evil-change-state (evil-initial-state-for-buffer
-                          buffer (or evil-default-state 'normal))
-                         message))))
-
-(evil-define-command evil-change-to-previous-state
-  (&optional buffer message)
-  "Change the state of BUFFER to its previous state."
-  :keep-visual t
-  :repeat abort
-  :suppress-operator t
-  (with-current-buffer (or buffer (current-buffer))
-    (let ((prev-state evil-previous-state)
-          (prev-prev-state (cdr-safe (assoc evil-previous-state
-                                            evil-previous-state-alist))))
-      (evil-change-state nil)
-      (when prev-prev-state
-        (setq evil-previous-state prev-prev-state))
-      (evil-change-state (or prev-state evil-default-state 'normal)
-                         message))))
-
-;; When a buffer is created in a low-level way, it is invisible to
-;; Evil (as well as other globalized minor modes) because no hooks are
-;; run. This is appropriate since many buffers are used for throwaway
-;; purposes. Passing the buffer to `set-window-buffer' indicates
-;; otherwise, though, so advise this function to initialize Evil.
-(defadvice set-window-buffer (before evil)
-  "Initialize Evil in the displayed buffer."
-  (when evil-mode
-    (when (get-buffer (ad-get-arg 1))
-      (with-current-buffer (ad-get-arg 1)
-        (unless evil-local-mode
-          (evil-local-mode 1))))))
-
-;; Refresh cursor color.
-;; Cursor color can only be set for each frame but not for each buffer.
-(add-hook 'window-configuration-change-hook 'evil-refresh-cursor)
-(defadvice select-window (after evil activate)
-  (evil-refresh-cursor))
-
-(defun evil-generate-mode-line-tag (&optional state)
-  "Generate the evil mode-line tag for STATE."
-  (let ((tag (evil-state-property state :tag t)))
-    ;; prepare mode-line: add tooltip
-    (if (stringp tag)
-        (propertize tag
-                    'help-echo (evil-state-property state :name)
-                    'mouse-face 'mode-line-highlight)
-      tag)))
-
-(defun evil-refresh-mode-line (&optional state)
-  "Refresh mode line tag."
-  (when (listp mode-line-format)
-    (setq evil-mode-line-tag (evil-generate-mode-line-tag state))
-    ;; refresh mode line data structure
-    ;; first remove evil from mode-line
-    (setq mode-line-format (delq 'evil-mode-line-tag mode-line-format))
-    (let ((mlpos mode-line-format)
-          pred which where)
-      ;; determine before/after which symbol the tag should be placed
-      (cond
-       ((eq evil-mode-line-format 'before)
-        (setq where 'after which 'mode-line-position))
-       ((eq evil-mode-line-format 'after)
-        (setq where 'after which 'mode-line-modes))
-       ((consp evil-mode-line-format)
-        (setq where (car evil-mode-line-format)
-              which (cdr evil-mode-line-format))))
-      ;; find the cons-cell of the symbol before/after which the tag
-      ;; should be placed
-      (while (and mlpos
-                  (let ((sym (or (car-safe (car mlpos)) (car mlpos))))
-                    (not (eq which sym))))
-        (setq pred mlpos
-              mlpos (cdr mlpos)))
-      ;; put evil tag at the right position in the mode line
-      (cond
-       ((not mlpos)) ;; position not found, so do not add the tag
-       ((eq where 'before)
-        (if pred
-            (setcdr pred (cons 'evil-mode-line-tag mlpos))
-          (setq mode-line-format
-                (cons 'evil-mode-line-tag mode-line-format))))
-       ((eq where 'after)
-        (setcdr mlpos (cons 'evil-mode-line-tag (cdr mlpos)))))
-      (force-mode-line-update))))
-
-;; input methods should be disabled in non-insertion states
-(defun evil-activate-input-method ()
-  "Enable input method in states with :input-method non-nil."
-  (let (input-method-activate-hook
-        input-method-deactivate-hook)
-    (when (and evil-local-mode evil-state)
-      (setq evil-input-method current-input-method)
-      (unless (evil-state-property evil-state :input-method)
-        (deactivate-input-method)))))
-(put 'evil-activate-input-method 'permanent-local-hook t)
-
-(defun evil-deactivate-input-method ()
-  "Disable input method in all states."
-  (let (input-method-activate-hook
-        input-method-deactivate-hook)
-    (when (and evil-local-mode evil-state)
-      (setq evil-input-method nil))))
-(put 'evil-deactivate-input-method 'permanent-local-hook t)
-
-(defmacro evil-without-input-method-hooks (&rest body)
-  "Execute body with evil's activate/deactivate-input-method hooks deactivated.
-
-This allows input methods to be used in normal-state."
-  `(unwind-protect
-       (progn
-         (remove-hook 'input-method-activate-hook 'evil-activate-input-method t)
-         (remove-hook 'input-method-deactivate-hook
-                      'evil-deactivate-input-method t)
-         ,@body)
-     (progn
-       (add-hook 'input-method-activate-hook 'evil-activate-input-method nil t)
-       (add-hook 'input-method-deactivate-hook
-                 'evil-deactivate-input-method nil t))))
-
-(defadvice toggle-input-method (around evil)
-  "Refresh `evil-input-method'."
-  (cond
-   ((not evil-local-mode)
-    ad-do-it)
-   ((evil-state-property evil-state :input-method)
-    ad-do-it)
-   (t
-    (let ((current-input-method evil-input-method))
-      ad-do-it))))
-
-;; Local keymaps are implemented using buffer-local variables.
-;; However, unless a buffer-local value already exists,
-;; `define-key' acts on the variable's default (global) value.
-;; So we need to initialize the variable whenever we enter a
-;; new buffer or when the buffer-local values are reset.
-(defun evil-initialize-local-keymaps ()
-  "Initialize a buffer-local value for local keymaps as necessary.
-The initial value is that of `make-sparse-keymap'."
-  (dolist (entry evil-local-keymaps-alist)
-    (let ((mode (car entry))
-          (map  (cdr entry)))
-      (unless (and (keymapp (symbol-value map))
-                   (assq map (buffer-local-variables)))
-        (set map (make-sparse-keymap))))))
-
-(defun evil-make-overriding-map (keymap &optional state copy)
-  "Give KEYMAP precedence over the global keymap of STATE.
-The keymap will have lower precedence than custom STATE bindings.
-If STATE is nil, give it precedence over all states.
-If COPY is t, create a copy of KEYMAP and give that
-higher precedence. See also `evil-make-intercept-map'."
-  (let ((key [override-state]))
-    (if (not copy)
-        (define-key keymap key (or state 'all))
-      (unless (keymapp copy)
-        (setq copy (assq-delete-all 'menu-bar (copy-keymap keymap))))
-      (define-key copy key (or state 'all))
-      (define-key keymap key copy))))
-
-(defun evil-make-intercept-map (keymap &optional state)
-  "Give KEYMAP precedence over all Evil keymaps in STATE.
-If STATE is nil, give it precedence over all states.
-See also `evil-make-overriding-map'."
-  (let ((key [intercept-state]))
-    (define-key keymap key (or state 'all))))
-
-(defmacro evil-define-keymap (keymap doc &rest body)
-  "Define a keymap KEYMAP listed in `evil-mode-map-alist'.
-That means it will have precedence over regular keymaps.
-
-DOC is the documentation for the variable. BODY, if specified,
-is executed after toggling the mode. Optional keyword arguments
-may be specified before the body code:
-
-:mode VAR       Mode variable. If unspecified, the variable
-                is based on the keymap name.
-:local BOOLEAN  Whether the keymap should be buffer-local, that is,
-                reinitialized for each buffer.
-:func BOOLEAN   Create a toggle function even if BODY is empty.
-
-\(fn KEYMAP DOC [[KEY VAL]...] BODY...)"
-  (declare (indent defun)
-           (debug (&define name
-                           [&optional stringp]
-                           [&rest [keywordp sexp]]
-                           def-body)))
-  (let ((func t)
-        arg intercept key local mode overriding)
-    (while (keywordp (car-safe body))
-      (setq key (pop body)
-            arg (pop body))
-      (cond
-       ((eq key :mode)
-        (setq mode arg))
-       ((eq key :local)
-        (setq local arg))
-       ((eq key :func)
-        (setq func arg))
-       ((eq key :intercept)
-        (setq intercept arg))
-       ((eq key :overriding)
-        (setq overriding arg))))
-    (setq mode (or mode
-                   (intern (replace-regexp-in-string
-                            "\\(?:-\\(?:mode-\\)?\\(?:key\\)?map\\)?$"
-                            "-mode"
-                            (symbol-name keymap)))))
-    `(progn
-       (defvar ,keymap ,(unless local '(make-sparse-keymap)))
-       (unless (get ',keymap 'variable-documentation)
-         (put ',keymap 'variable-documentation ,doc))
-       (defvar ,mode nil)
-       (unless (get ',mode 'variable-documentation)
-         (put ',mode 'variable-documentation ,doc))
-       (make-variable-buffer-local ',mode)
-       (put ',mode 'permanent-local t)
-       (when ,intercept
-         (evil-make-intercept-map ,keymap))
-       (when ,overriding
-         (evil-make-overriding-map ,keymap))
-       ,@(if local
-             `((make-variable-buffer-local ',keymap)
-               (put ',keymap 'permanent-local t)
-               (evil-add-to-alist 'evil-local-keymaps-alist
-                                  ',mode ',keymap))
-           `((evil-add-to-alist 'evil-global-keymaps-alist
-                                ',mode ',keymap)
-             (evil-add-to-alist 'evil-mode-map-alist
-                                ',mode ,keymap)))
-       ,(when (or body func)
-          `(defun ,mode (&optional arg)
-             ,@(when doc `(,doc))
-             (interactive)
-             (cond
-              ((numberp arg)
-               (setq ,mode (> arg 0)))
-              (t
-               (setq ,mode (not ,mode))))
-             ,@body))
-       ',keymap)))
-
-;; The ESC -> escape translation code has been provided by Stefan
-;; Monnier in the discussion of GNU Emacs bug #13793.
-(defun evil-esc-mode (&optional arg)
-  "Toggle interception of \\e (escape).
-Enable with positive ARG and disable with negative ARG.
-
-When enabled, `evil-esc-mode' modifies the entry of \\e in
-`input-decode-map'. If such an event arrives, it is translated to
-a plain 'escape event if no further event occurs within
-`evil-esc-delay' seconds. Otherwise no translation happens and
-the ESC prefix map (i.e. the map originally bound to \\e in
-`input-decode-map`) is returned."
-  (cond
-   ((or (null arg) (eq arg 0))
-    (evil-esc-mode (if evil-esc-mode -1 +1)))
-   ((> arg 0)
-    (unless evil-esc-mode
-      (setq evil-esc-mode t)
-      (add-hook 'after-make-frame-functions #'evil-init-esc)
-      (mapc #'evil-init-esc (frame-list))))
-   ((< arg 0)
-    (when evil-esc-mode
-      (remove-hook 'after-make-frame-functions #'evil-init-esc)
-      (mapc #'evil-deinit-esc (frame-list))
-      (setq evil-esc-mode nil)))))
-
-(defun evil-init-esc (frame)
-  "Update `input-decode-map' in terminal."
-  (with-selected-frame frame
-    (let ((term (frame-terminal frame)))
-      (when (and
-             (or (eq evil-intercept-esc 'always)
-                 (and evil-intercept-esc
-                      (eq (terminal-live-p term) t))) ; only patch tty
-             (not (terminal-parameter term 'evil-esc-map)))
-        (let ((evil-esc-map (lookup-key input-decode-map [?\e])))
-          (set-terminal-parameter term 'evil-esc-map evil-esc-map)
-          (define-key input-decode-map [?\e]
-            `(menu-item "" ,evil-esc-map :filter ,#'evil-esc)))))))
-
-(defun evil-deinit-esc (frame)
-  "Restore `input-decode-map' in terminal."
-  (with-selected-frame frame
-    (let ((term (frame-terminal frame)))
-      (when (terminal-live-p term)
-        (let ((evil-esc-map (terminal-parameter term 'evil-esc-map)))
-          (when evil-esc-map
-            (define-key input-decode-map [?\e] evil-esc-map)
-            (set-terminal-parameter term 'evil-esc-map nil)))))))
-
-(defun evil-esc (map)
-  "Translate \\e to 'escape if no further event arrives.
-This function is used to translate a \\e event either to 'escape
-or to the standard ESC prefix translation map. If \\e arrives,
-this function waits for `evil-esc-delay' seconds for another
-event. If no other event arrives, the event is translated to
-'escape, otherwise it is translated to the standard ESC prefix
-map stored in `input-decode-map'. If `evil-inhibit-esc' is
-non-nil or if evil is in emacs state, the event is always
-translated to the ESC prefix.
-
-The translation to 'escape happens only if the current command
-has indeed been triggered by \\e. In other words, this will only
-happen when the keymap is accessed from `read-key-sequence'. In
-particular, if it is access from `define-key' the returned
-mapping will always be the ESC prefix map."
-  (if (and (not evil-inhibit-esc)
-           (or evil-local-mode (evil-ex-p)
-               (active-minibuffer-window))
-           (not (evil-emacs-state-p))
-           (let ((keys (this-single-command-keys)))
-             (and (> (length keys) 0)
-                  (= (aref keys (1- (length keys))) ?\e)))
-           (sit-for evil-esc-delay))
-      (prog1 [escape]
-        (when defining-kbd-macro
-          (end-kbd-macro)
-          (setq last-kbd-macro (vconcat last-kbd-macro [escape]))
-          (start-kbd-macro t t)))
-    map))
-
-(defun evil-state-p (sym)
-  "Whether SYM is the name of a state."
-  (assq sym evil-state-properties))
-
-(defun evil-state-keymaps (state &rest excluded)
-  "Return a keymap alist of keymaps activated by STATE.
-If STATE references other states in its :enable property,
-these states are recursively processed and added to the list.
-\(The EXCLUDED argument is an internal safeguard against
-infinite recursion, keeping track of processed states.)"
-  (let* ((state (or state evil-state))
-         (enable (evil-state-property state :enable))
-         (map (cons
-               (evil-state-property state :mode)
-               (evil-state-property state :keymap t)))
-         (local-map (cons
-                     (evil-state-property state :local)
-                     (evil-state-property state :local-keymap t)))
-         (minor-mode-maps (evil-state-minor-mode-keymaps state))
-         (aux-maps (evil-state-auxiliary-keymaps state))
-         (overriding-maps
-          (evil-state-overriding-keymaps state))
-         (intercept-maps
-          (evil-state-intercept-keymaps state))
-         (result `(,intercept-maps))
-         (remove-duplicates (null excluded)))
-    (unless (memq state enable)
-      (setq enable (cons state enable)))
-    ;; process STATE's :enable property
-    (dolist (entry enable)
-      (cond
-       ((memq entry excluded))
-       ;; the keymaps for STATE
-       ((eq entry state)
-        (setq result `(,@result
-                       (,local-map)
-                       ,minor-mode-maps
-                       ,aux-maps
-                       ,overriding-maps
-                       (,map)))
-        (push state excluded))
-       ;; the keymaps for another state: call `evil-state-keymaps'
-       ;; recursively, but keep track of processed states
-       ((evil-state-p entry)
-        (setq result `(,@result
-                       ,(apply #'evil-state-keymaps entry excluded))))
-       ;; a single keymap
-       ((or (keymapp entry)
-            (and (keymapp (symbol-value entry))
-                 (setq entry (symbol-value entry)))
-            (setq entry (evil-keymap-for-mode entry)))
-        (setq result `(,@result
-                       ((,(evil-mode-for-keymap entry t) .
-                         ,entry)))))))
-    ;; postpone the expensive filtering of duplicates to the top level
-    (if remove-duplicates
-        (apply #'evil-concat-keymap-alists result)
-      (apply #'append result))))
-
-(defun evil-normalize-keymaps (&optional state)
-  "Create a buffer-local value for `evil-mode-map-alist'.
-This is a keymap alist, determined by the current state
-\(or by STATE if specified)."
-  (let ((state (or state evil-state))
-        (excluded '(nil t))
-        map mode temp)
-    ;; initialize buffer-local keymaps as necessary
-    (evil-initialize-local-keymaps)
-    ;; deactivate keymaps of previous state
-    (dolist (entry evil-mode-map-alist)
-      (setq mode (car-safe entry)
-            map (cdr-safe entry))
-      ;; don't deactivate overriding keymaps;
-      ;; they are toggled by their associated mode
-      (if (or (memq mode excluded)
-              (evil-intercept-keymap-p map)
-              (evil-overriding-keymap-p map)
-              (evil-auxiliary-keymap-p map)
-              (evil-minor-mode-keymap-p map))
-          (push mode excluded)
-        (when (and (fboundp mode) (symbol-value mode))
-          (funcall mode -1))
-        (set mode nil)))
-    (setq evil-mode-map-alist nil)
-    ;; activate keymaps of current state
-    (when state
-      (setq temp (evil-state-keymaps state))
-      (dolist (entry temp)
-        (setq mode (car entry)
-              map (cdr entry))
-        (unless (or (and (boundp mode) (symbol-value mode))
-                    ;; the minor-mode keymaps include modes that are not
-                    ;; necessarily active
-                    (evil-minor-mode-keymap-p map))
-          (when (fboundp mode)
-            (funcall mode 1))
-          (set mode t))
-        ;; refresh the keymap in case it has changed
-        ;; (e.g., `evil-operator-shortcut-map' is
-        ;; reset on toggling)
-        (if (or (memq mode excluded)
-                (evil-intercept-keymap-p map)
-                (evil-overriding-keymap-p map)
-                (evil-auxiliary-keymap-p map)
-                (evil-minor-mode-keymap-p map))
-            (push mode excluded)
-          (setcdr entry (or (evil-keymap-for-mode mode) map))))
-      ;; update `evil-mode-map-alist'
-      (setq evil-mode-map-alist temp))))
-
-(defun evil-mode-for-keymap (keymap &optional default)
-  "Return the minor mode associated with KEYMAP.
-Returns DEFAULT if no mode is found.
-See also `evil-keymap-for-mode'."
-  (let ((map (if (keymapp keymap) keymap (symbol-value keymap)))
-        (var (when (symbolp keymap) keymap)))
-    ;; Check Evil variables first for speed purposes.
-    ;; If all else fails, check `minor-mode-map-alist'.
-    (or (when var
-          (or (car (rassq var evil-global-keymaps-alist))
-              (car (rassq var evil-local-keymaps-alist))))
-        (car (rassq map (mapcar #'(lambda (e)
-                                    ;; from (MODE-VAR . MAP-VAR)
-                                    ;; to (MODE-VAR . MAP)
-                                    (cons (car-safe e)
-                                          (symbol-value (cdr-safe e))))
-                                (append evil-global-keymaps-alist
-                                        evil-local-keymaps-alist))))
-        (car (rassq map minor-mode-map-alist))
-        default)))
-
-(defun evil-keymap-for-mode (mode &optional variable)
-  "Return the keymap associated with MODE.
-Return the keymap variable if VARIABLE is non-nil.
-See also `evil-mode-for-keymap'."
-  (let* ((var (or (cdr (assq mode evil-global-keymaps-alist))
-                  (cdr (assq mode evil-local-keymaps-alist))))
-         (map (or (symbol-value var)
-                  (cdr (assq mode minor-mode-map-alist)))))
-    (if variable var map)))
-
-(defun evil-state-auxiliary-keymaps (state)
-  "Return a keymap alist of auxiliary keymaps for STATE."
-  (let ((state (or state evil-state))
-        aux result)
-    (dolist (map (current-active-maps) result)
-      (when (setq aux (evil-get-auxiliary-keymap map state))
-        (push (cons (evil-mode-for-keymap map t) aux) result)))
-    (nreverse result)))
-
-(defun evil-state-minor-mode-keymaps (state)
-  "Return a keymap alist of minor-mode keymaps for STATE."
-  (let* ((state (or state evil-state))
-         (state-entry (assq state evil-minor-mode-keymaps-alist)))
-    (when state-entry
-      (cdr state-entry))))
-
-(defun evil-state-overriding-keymaps (&optional state)
-  "Return a keymap alist of overriding keymaps for STATE."
-  (let* ((state (or state evil-state))
-         result)
-    (dolist (map (current-active-maps))
-      (when (setq map (evil-overriding-keymap-p map state))
-        (push (cons (evil-mode-for-keymap map t) map) result)))
-    (nreverse result)))
-
-(defun evil-state-intercept-keymaps (&optional state)
-  "Return a keymap alist of intercept keymaps for STATE."
-  (let* ((state (or state evil-state))
-         result)
-    (dolist (map (current-active-maps))
-      (when (setq map (evil-intercept-keymap-p map state))
-        (push (cons (evil-mode-for-keymap map t) map) result)))
-    (setq result (nreverse result))
-    result))
-
-(defun evil-set-auxiliary-keymap (map state &optional aux)
-  "Set the auxiliary keymap for MAP in STATE to AUX.
-If AUX is nil, create a new auxiliary keymap."
-  (unless (keymapp aux)
-    (setq aux (make-sparse-keymap)))
-  (unless (evil-auxiliary-keymap-p aux)
-    (evil-set-keymap-prompt
-     aux (format "Auxiliary keymap for %s"
-                 (or (evil-state-property state :name)
-                     (format "%s state" state)))))
-  (define-key map
-    (vconcat (list (intern (format "%s-state" state)))) aux)
-  aux)
-(put 'evil-set-auxiliary-keymap 'lisp-indent-function 'defun)
-
-(defun evil-get-auxiliary-keymap (map state &optional create ignore-parent)
-  "Get the auxiliary keymap for MAP in STATE.
-If CREATE is non-nil, create an auxiliary keymap
-if MAP does not have one. If CREATE and
-IGNORE-PARENT are non-nil then a new auxiliary
-keymap is created even if the parent of MAP has
-one already."
-  (when state
-    (let* ((key (vconcat (list (intern (format "%s-state" state)))))
-           (parent-aux (when (and ignore-parent
-                                  (keymap-parent map)
-                                  state)
-                         (lookup-key (keymap-parent map) key)))
-           (aux (if state (lookup-key map key) map)))
-      (cond
-       ((and ignore-parent
-             (equal parent-aux aux)
-             create)
-        (evil-set-auxiliary-keymap map state))
-       ((evil-auxiliary-keymap-p aux)
-        aux)
-       (create
-        (evil-set-auxiliary-keymap map state))))))
-
-(defun evil-get-minor-mode-keymap (state mode)
-  "Get the auxiliary keymap for MODE in STATE, creating one if it
-does not already exist."
-  (let ((state-entry (assq state evil-minor-mode-keymaps-alist)))
-    (if (and state-entry
-             (assq mode state-entry))
-        (cdr (assq mode state-entry))
-      (let ((map (make-sparse-keymap)))
-        (evil-set-keymap-prompt
-         map (format "Minor-mode keymap for %s in %s"
-                     (symbol-name mode)
-                     (or (evil-state-property state :name)
-                         (format "%s state" state))))
-        (if state-entry
-            (setcdr state-entry
-                    (append (list (cons mode map)) (cdr state-entry)))
-          (push (cons state (list (cons mode map)))
-                evil-minor-mode-keymaps-alist))
-        map))))
-
-(defun evil-auxiliary-keymap-p (map)
-  "Whether MAP is an auxiliary keymap."
-  (and (keymapp map)
-       (string-match "Auxiliary keymap"
-                     (or (keymap-prompt map) "")) t))
-
-(defun evil-minor-mode-keymap-p (map)
-  "Whether MAP is a minor-mode keymap."
-  (and (keymapp map)
-       (string-match "Minor-mode keymap"
-                     (or (keymap-prompt map) "")) t))
-
-(defun evil-intercept-keymap-p (map &optional state)
-  "Whether MAP is an intercept keymap for STATE.
-If STATE is nil, it means any state."
-  (let ((entry (and (keymapp map)
-                    (lookup-key map [intercept-state]))))
-    (cond
-     ((null entry)
-      nil)
-     ((null state)
-      map)
-     ((eq entry state)
-      map)
-     ((eq entry 'all)
-      map))))
-
-(defun evil-overriding-keymap-p (map &optional state)
-  "Whether MAP is an overriding keymap for STATE.
-If STATE is nil, it means any state."
-  (let ((entry (and (keymapp map)
-                    (lookup-key map [override-state]))))
-    (cond
-     ((null entry)
-      nil)
-     ((keymapp entry)
-      (evil-overriding-keymap-p entry state))
-     ((null state)
-      map)
-     ((eq entry state)
-      map)
-     ((eq entry 'all)
-      map))))
-
-(defun evil-intercept-keymap-state (map)
-  "Return the state for the intercept keymap MAP.
-A return value of t means all states."
-  (let ((state (lookup-key map [intercept-state] map)))
-    (cond
-     ((keymapp state)
-      (evil-intercept-keymap-state state))
-     ((eq state 'all)
-      t)
-     (t
-      state))))
-
-(defun evil-overriding-keymap-state (map)
-  "Return the state for the overriding keymap MAP.
-A return value of t means all states."
-  (let ((state (lookup-key map [override-state] map)))
-    (cond
-     ((keymapp state)
-      (evil-overriding-keymap-state state))
-     ((eq state 'all)
-      t)
-     (t
-      state))))
-
-(defmacro evil-define-key (state keymap key def &rest bindings)
-  "Create a STATE binding from KEY to DEF for KEYMAP.
-STATE is one of `normal', `insert', `visual', `replace',
-`operator', `motion', `emacs', or a list of one or more of
-these. The remaining arguments are like those of
-`define-key'. For example:
-
-    (evil-define-key 'normal foo-map \"a\" 'bar)
-
-This creates a binding from \"a\" to `bar' in Normal state,
-which is active whenever `foo-map' is active. It is possible
-to specify multiple bindings at once:
-
-    (evil-define-key 'normal foo-map
-      \"a\" 'bar
-      \"b\" 'foo)
-
-If foo-map has not been initialized yet, this macro adds an entry
-to `after-load-functions', delaying execution as necessary."
-  (declare (indent defun))
-  `(evil-delay ',(if (symbolp keymap)
-                     `(and (boundp ',keymap) (keymapp ,keymap))
-                   `(keymapp ,keymap))
-       '(evil-define-key* ,state ,keymap ,key ,def ,@bindings)
-     'after-load-functions t nil
-     (format "evil-define-key-in-%s"
-             ',(if (symbolp keymap) keymap 'keymap))))
-(defalias 'evil-declare-key 'evil-define-key)
-
-(defun evil-define-key* (state keymap key def &rest bindings)
-  "Create a STATE binding from KEY to DEF for KEYMAP.
-STATE is one of `normal', `insert', `visual', `replace',
-`operator', `motion', `emacs', or a list of one or more of these.
-
-The use is identical to `evil-define-key' with the exception that
-this is a function and not a macro (and so will not be expanded
-when compiled which can have unintended
-consequences). `evil-define-key*' also does not defer any
-bindings like `evil-define-key' does using `evil-delay'. This
-allows errors in the bindings to be caught immediately, and makes
-its behavior more predictable."
-  (let ((aux-maps
-         (cond ((listp state)
-                (mapcar
-                 (lambda (st)
-                   (evil-get-auxiliary-keymap keymap st t))
-                 state))
-               (state
-                (list (evil-get-auxiliary-keymap keymap state t)))
-               (t
-                (list keymap)))))
-    (while key
-      (dolist (map aux-maps)
-        (define-key map key def))
-      (setq key (pop bindings)
-            def (pop bindings)))
-    ;; ensure the prompt string comes first
-    (dolist (map aux-maps)
-      (evil-set-keymap-prompt map (keymap-prompt map)))))
-
-(defun evil-define-minor-mode-key (state mode key def &rest bindings)
-  "Similar to `evil-define-key' but the bindings are associated
-with the minor-mode symbol MODE instead of a particular map.
-Associating bindings with a mode symbol instead of a map allows
-evil to use Emacs' built-in mechanisms to enable the bindings
-automatically when MODE is active without relying on calling
-`evil-normalize-keymaps'. Another less significant difference is
-that the bindings can be created immediately, because this
-function only uses the symbol MODE and does not rely on its
-value.
-
-See `evil-define-key' for the usage of STATE, KEY, DEF and
-BINDINGS."
-  (declare (indent defun))
-  (let ((map (evil-get-minor-mode-keymap state mode)))
-    (while key
-      (define-key map key def)
-      (setq key (pop bindings)
-            def (pop bindings)))))
-
-(defmacro evil-add-hjkl-bindings (keymap &optional state &rest bindings)
-  "Add \"h\", \"j\", \"k\", \"l\" bindings to KEYMAP in STATE.
-Add additional BINDINGS if specified."
-  (declare (indent defun))
-  `(evil-define-key ,state ,keymap
-     "h" (lookup-key evil-motion-state-map "h")
-     "j" (lookup-key evil-motion-state-map "j")
-     "k" (lookup-key evil-motion-state-map "k")
-     "l" (lookup-key evil-motion-state-map "l")
-     ":" (lookup-key evil-motion-state-map ":")
-     ,@bindings))
-
-;; may be useful for programmatic purposes
-(defun evil-global-set-key (state key def)
-  "Bind KEY to DEF in STATE."
-  (define-key (evil-state-property state :keymap t) key def))
-
-(defun evil-local-set-key (state key def)
-  "Bind KEY to DEF in STATE in the current buffer."
-  (define-key (evil-state-property state :local-keymap t) key def))
-
-;; Advise these functions as they may activate an overriding keymap or
-;; a keymap with state bindings; if so, refresh `evil-mode-map-alist'.
-(defadvice use-global-map (after evil activate)
-  "Refresh Evil keymaps."
-  (evil-normalize-keymaps))
-
-(defadvice use-local-map (after evil activate)
-  "Refresh Evil keymaps."
-  (evil-normalize-keymaps))
-
-(defmacro evil-define-state (state doc &rest body)
-  "Define an Evil state STATE.
-DOC is a general description and shows up in all docstrings;
-the first line of the string should be the full name of the state.
-Then follows one or more optional keywords:
-
-:tag STRING             Mode line indicator.
-:message STRING         Echo area message when changing to STATE.
-:cursor SPEC            Cursor to use in STATE.
-:entry-hook LIST        Hooks run when changing to STATE.
-:exit-hook LIST         Hooks run when changing from STATE.
-:enable LIST            List of other states and modes enabled by STATE.
-:suppress-keymap FLAG   If FLAG is non-nil, makes `evil-suppress-map'
-                        the parent of the global map of STATE,
-                        effectively disabling bindings to
-                        `self-insert-command'.
-
-Following the keywords is optional code to be executed each time
-the state is enabled or disabled. For example:
-
-    (evil-define-state test
-      \"Test state.\"
-      :tag \"<T> \"
-      (setq test-var t))
-
-The global keymap of this state will be `evil-test-state-map',
-the local keymap will be `evil-test-state-local-map', and so on.
-
-\(fn STATE DOC [[KEY VAL]...] BODY...)"
-  (declare (indent defun)
-           (debug (&define name
-                           [&optional stringp]
-                           [&rest [keywordp sexp]]
-                           def-body)))
-  (let* ((name (and (string-match "^\\(.+\\)\\(\\(?:.\\|\n\\)*\\)" doc)
-                    (match-string 1 doc)))
-         (doc (match-string 2 doc))
-         (name (and (string-match "^\\(.+?\\)\\.?$" name)
-                    (match-string 1 name)))
-         (doc (if (or (null doc) (string= doc "")) ""
-                (format "\n%s" doc)))
-         (toggle (intern (format "evil-%s-state" state)))
-         (mode (intern (format "%s-minor-mode" toggle)))
-         (keymap (intern (format "%s-map" toggle)))
-         (local (intern (format "%s-local-minor-mode" toggle)))
-         (local-keymap (intern (format "%s-local-map" toggle)))
-         (tag (intern (format "%s-tag" toggle)))
-         (message (intern (format "%s-message" toggle)))
-         (cursor (intern (format "%s-cursor" toggle)))
-         (entry-hook (intern (format "%s-entry-hook" toggle)))
-         (exit-hook (intern (format "%s-exit-hook" toggle)))
-         (modes (intern (format "%s-modes" toggle)))
-         (predicate (intern (format "%s-p" toggle)))
-         arg cursor-value enable entry-hook-value exit-hook-value
-         input-method key message-value suppress-keymap tag-value)
-    ;; collect keywords
-    (while (keywordp (car-safe body))
-      (setq key (pop body)
-            arg (pop body))
-      (cond
-       ((eq key :tag)
-        (setq tag-value arg))
-       ((eq key :message)
-        (setq message-value arg))
-       ((eq key :cursor)
-        (setq cursor-value arg))
-       ((eq key :entry-hook)
-        (setq entry-hook-value arg)
-        (unless (listp entry-hook-value)
-          (setq entry-hook-value (list entry-hook-value))))
-       ((eq key :exit-hook)
-        (setq exit-hook-value arg)
-        (unless (listp exit-hook-value)
-          (setq exit-hook-value (list entry-hook-value))))
-       ((eq key :enable)
-        (setq enable arg))
-       ((eq key :input-method)
-        (setq input-method arg))
-       ((eq key :suppress-keymap)
-        (setq suppress-keymap arg))))
-
-    ;; macro expansion
-    `(progn
-       ;; Save the state's properties in `evil-state-properties' for
-       ;; runtime lookup. Among other things, this information is used
-       ;; to determine what keymaps should be activated by the state
-       ;; (and, when processing :enable, what keymaps are activated by
-       ;; other states). We cannot know this at compile time because
-       ;; it depends on the current buffer and its active keymaps
-       ;; (to which we may have assigned state bindings), as well as
-       ;; states whose definitions may not have been processed yet.
-       (evil-put-property
-        'evil-state-properties ',state
-        :name ',name
-        :toggle ',toggle
-        :mode (defvar ,mode nil
-                ,(format "Non-nil if %s is enabled.
-Use the command `%s' to change this variable." name toggle))
-        :keymap (defvar ,keymap (make-sparse-keymap)
-                  ,(format "Keymap for %s." name))
-        :local (defvar ,local nil
-                 ,(format "Non-nil if %s is enabled.
-Use the command `%s' to change this variable." name toggle))
-        :local-keymap (defvar ,local-keymap nil
-                        ,(format "Buffer-local keymap for %s." name))
-        :tag (defvar ,tag ,tag-value
-               ,(format "Mode line tag for %s." name))
-        :message (defvar ,message ,message-value
-                   ,(format "Echo area message for %s." name))
-        :cursor (defvar ,cursor ',cursor-value
-                  ,(format "Cursor for %s.
-May be a cursor type as per `cursor-type', a color string as passed
-to `set-cursor-color', a zero-argument function for changing the
-cursor, or a list of the above." name))
-        :entry-hook (defvar ,entry-hook nil
-                      ,(format "Hooks to run when entering %s." name))
-        :exit-hook (defvar ,exit-hook nil
-                     ,(format "Hooks to run when exiting %s." name))
-        :modes (defvar ,modes nil
-                 ,(format "Modes that should come up in %s." name))
-        :input-method ',input-method
-        :predicate ',predicate
-        :enable ',enable)
-
-       ,@(when suppress-keymap
-           `((set-keymap-parent ,keymap evil-suppress-map)))
-
-       (dolist (func ',entry-hook-value)
-         (add-hook ',entry-hook func))
-
-       (dolist (func ',exit-hook-value)
-         (add-hook ',exit-hook func))
-
-       (defun ,predicate (&optional state)
-         ,(format "Whether the current state is %s.
-\(That is, whether `evil-state' is `%s'.)" name state)
-         (and evil-local-mode
-              (eq (or state evil-state) ',state)))
-
-       ;; define state function
-       (defun ,toggle (&optional arg)
-         ,(format "Enable %s. Disable with negative ARG.
-If ARG is nil, don't display a message in the echo area.%s" name doc)
-         (interactive)
-         (cond
-          ((and (numberp arg) (< arg 1))
-           (setq evil-previous-state evil-state
-                 evil-state nil)
-           (let ((evil-state ',state))
-             (run-hooks ',exit-hook)
-             (setq evil-state nil)
-             (evil-normalize-keymaps)
-             ,@body))
-          (t
-           (unless evil-local-mode
-             (evil-local-mode 1))
-           (let ((evil-next-state ',state)
-                 input-method-activate-hook
-                 input-method-deactivate-hook)
-             (evil-change-state nil)
-             (setq evil-state ',state)
-             (evil-add-to-alist 'evil-previous-state-alist
-                                ',state evil-previous-state)
-             (let ((evil-state ',state))
-               (evil-normalize-keymaps)
-               (if ',input-method
-                   (activate-input-method evil-input-method)
-                 ;; BUG #475: Deactivate the current input method only
-                 ;; if there is a function to deactivate it, otherwise
-                 ;; an error would be raised. This strange situation
-                 ;; should not arise in general and there should
-                 ;; probably be a better way to handle this situation.
-                 (if deactivate-current-input-method-function
-                     (deactivate-input-method)))
-               (unless evil-no-display
-                 (evil-refresh-cursor ',state)
-                 (evil-refresh-mode-line ',state)
-                 (when (called-interactively-p 'any)
-                   (redisplay)))
-               ,@body
-               (run-hooks ',entry-hook)
-               (when (and evil-echo-state
-                          arg (not evil-no-display) ,message)
-                 (if (functionp ,message)
-                     (funcall ,message)
-                   (evil-echo "%s" ,message))))))))
-
-       (evil-set-command-property ',toggle :keep-visual t)
-       (evil-set-command-property ',toggle :suppress-operator t)
-
-       (evil-define-keymap ,keymap nil
-         :mode ,mode
-         :func nil)
-
-       (evil-define-keymap ,local-keymap nil
-         :mode ,local
-         :local t
-         :func nil)
-
-       ',state)))
-
-(provide 'evil-core)
-
-;;; evil-core.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-core.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-digraphs.el
@@ -1,1729 +0,0 @@
-;;; evil-digraphs.el --- Digraphs
-
-;; Author: Vegard Øye <vegard_oye at hotmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-(require 'evil-vars)
-
-;;; Code:
-
-(defgroup evil-digraphs nil
-  "Digraph support based on RFC 1345."
-  :group 'evil
-  :prefix "evil-digraph-")
-
-(defcustom evil-digraphs-table-user nil
-  "List of user-defined digraphs.
-Entries have the form ((?CHAR1 ?CHAR2) . ?DIGRAPH).  That is,
-a cons cell of the digraph and its character replacement,
-where the digraph is a list of two characters.
-See also `evil-digraphs-table'."
-  :type '(alist :key-type (list character character)
-                :value-type character)
-  :require 'evil-digraphs
-  :group 'evil-digraphs)
-
-(defconst evil-digraphs-table
-  '(((?N ?U) . ?\x00)
-    ((?S ?H) . ?\x01)
-    ((?S ?X) . ?\x02)
-    ((?E ?X) . ?\x03)
-    ((?E ?T) . ?\x04)
-    ((?E ?Q) . ?\x05)
-    ((?A ?K) . ?\x06)
-    ((?B ?L) . ?\x07)
-    ((?B ?S) . ?\x08)
-    ((?H ?T) . ?\x09)
-    ((?L ?F) . ?\x0a)
-    ((?V ?T) . ?\x0b)
-    ((?F ?F) . ?\x0c)
-    ((?C ?R) . ?\x0d)
-    ((?S ?O) . ?\x0e)
-    ((?S ?I) . ?\x0f)
-    ((?D ?L) . ?\x10)
-    ((?D ?1) . ?\x11)
-    ((?D ?2) . ?\x12)
-    ((?D ?3) . ?\x13)
-    ((?D ?4) . ?\x14)
-    ((?N ?K) . ?\x15)
-    ((?S ?Y) . ?\x16)
-    ((?E ?B) . ?\x17)
-    ((?C ?N) . ?\x18)
-    ((?E ?M) . ?\x19)
-    ((?S ?B) . ?\x1a)
-    ((?E ?C) . ?\x1b)
-    ((?F ?S) . ?\x1c)
-    ((?G ?S) . ?\x1d)
-    ((?R ?S) . ?\x1e)
-    ((?U ?S) . ?\x1f)
-    ((?S ?P) . ?\x20)
-    ((?N ?b) . ?\x23)
-    ((?D ?O) . ?\x24)
-    ((?A ?t) . ?\x40)
-    ((?< ?\() . ?\x5b)
-    ((?/ ?/) . ?\x5c)
-    ((?\) ?>) . ?\x5d)
-    ((?' ?>) . ?\x5e)
-    ((?' ?!) . ?\x60)
-    ((?\( ?!) . ?\x7b)
-    ((?! ?!) . ?\x7c)
-    ((?! ?\)) . ?\x7d)
-    ((?' ??) . ?\x7e)
-    ((?D ?T) . ?\x7f)
-    ((?P ?A) . ?\x80)
-    ((?H ?O) . ?\x81)
-    ((?B ?H) . ?\x82)
-    ((?N ?H) . ?\x83)
-    ((?I ?N) . ?\x84)
-    ((?N ?L) . ?\x85)
-    ((?S ?A) . ?\x86)
-    ((?E ?S) . ?\x87)
-    ((?H ?S) . ?\x88)
-    ((?H ?J) . ?\x89)
-    ((?V ?S) . ?\x8a)
-    ((?P ?D) . ?\x8b)
-    ((?P ?U) . ?\x8c)
-    ((?R ?I) . ?\x8d)
-    ((?S ?2) . ?\x8e)
-    ((?S ?3) . ?\x8f)
-    ((?D ?C) . ?\x90)
-    ((?P ?1) . ?\x91)
-    ((?P ?2) . ?\x92)
-    ((?T ?S) . ?\x93)
-    ((?C ?C) . ?\x94)
-    ((?M ?W) . ?\x95)
-    ((?S ?G) . ?\x96)
-    ((?E ?G) . ?\x97)
-    ((?S ?S) . ?\x98)
-    ((?G ?C) . ?\x99)
-    ((?S ?C) . ?\x9a)
-    ((?C ?I) . ?\x9b)
-    ((?S ?T) . ?\x9c)
-    ((?O ?C) . ?\x9d)
-    ((?P ?M) . ?\x9e)
-    ((?A ?C) . ?\x9f)
-    ((?N ?S) . ?\xa0)
-    ((?! ?I) . ?\xa1)
-    ((?C ?t) . ?\xa2)
-    ((?P ?d) . ?\xa3)
-    ((?C ?u) . ?\xa4)
-    ((?Y ?e) . ?\xa5)
-    ((?B ?B) . ?\xa6)
-    ((?S ?E) . ?\xa7)
-    ((?' ?:) . ?\xa8)
-    ((?C ?o) . ?\xa9)
-    ((?- ?a) . ?\xaa)
-    ((?< ?<) . ?\xab)
-    ((?N ?O) . ?\xac)
-    ((?- ?-) . ?\xad)
-    ((?R ?g) . ?\xae)
-    ((?' ?m) . ?\xaf)
-    ((?D ?G) . ?\xb0)
-    ((?+ ?-) . ?\xb1)
-    ((?2 ?S) . ?\xb2)
-    ((?3 ?S) . ?\xb3)
-    ((?' ?') . ?\xb4)
-    ((?M ?y) . ?\xb5)
-    ((?P ?I) . ?\xb6)
-    ((?. ?M) . ?\xb7)
-    ((?' ?,) . ?\xb8)
-    ((?1 ?S) . ?\xb9)
-    ((?- ?o) . ?\xba)
-    ((?> ?>) . ?\xbb)
-    ((?1 ?4) . ?\xbc)
-    ((?1 ?2) . ?\xbd)
-    ((?3 ?4) . ?\xbe)
-    ((?? ?I) . ?\xbf)
-    ((?A ?!) . ?\xc0)
-    ((?A ?') . ?\xc1)
-    ((?A ?>) . ?\xc2)
-    ((?A ??) . ?\xc3)
-    ((?A ?:) . ?\xc4)
-    ((?A ?A) . ?\xc5)
-    ((?A ?E) . ?\xc6)
-    ((?C ?,) . ?\xc7)
-    ((?E ?!) . ?\xc8)
-    ((?E ?') . ?\xc9)
-    ((?E ?>) . ?\xca)
-    ((?E ?:) . ?\xcb)
-    ((?I ?!) . ?\xcc)
-    ((?I ?') . ?\xcd)
-    ((?I ?>) . ?\xce)
-    ((?I ?:) . ?\xcf)
-    ((?D ?-) . ?\xd0)
-    ((?N ??) . ?\xd1)
-    ((?O ?!) . ?\xd2)
-    ((?O ?') . ?\xd3)
-    ((?O ?>) . ?\xd4)
-    ((?O ??) . ?\xd5)
-    ((?O ?:) . ?\xd6)
-    ((?* ?X) . ?\xd7)
-    ((?O ?/) . ?\xd8)
-    ((?U ?!) . ?\xd9)
-    ((?U ?') . ?\xda)
-    ((?U ?>) . ?\xdb)
-    ((?U ?:) . ?\xdc)
-    ((?Y ?') . ?\xdd)
-    ((?T ?H) . ?\xde)
-    ((?s ?s) . ?\xdf)
-    ((?a ?!) . ?\xe0)
-    ((?a ?') . ?\xe1)
-    ((?a ?>) . ?\xe2)
-    ((?a ??) . ?\xe3)
-    ((?a ?:) . ?\xe4)
-    ((?a ?a) . ?\xe5)
-    ((?a ?e) . ?\xe6)
-    ((?c ?,) . ?\xe7)
-    ((?e ?!) . ?\xe8)
-    ((?e ?') . ?\xe9)
-    ((?e ?>) . ?\xea)
-    ((?e ?:) . ?\xeb)
-    ((?i ?!) . ?\xec)
-    ((?i ?') . ?\xed)
-    ((?i ?>) . ?\xee)
-    ((?i ?:) . ?\xef)
-    ((?d ?-) . ?\xf0)
-    ((?n ??) . ?\xf1)
-    ((?o ?!) . ?\xf2)
-    ((?o ?') . ?\xf3)
-    ((?o ?>) . ?\xf4)
-    ((?o ??) . ?\xf5)
-    ((?o ?:) . ?\xf6)
-    ((?- ?:) . ?\xf7)
-    ((?o ?/) . ?\xf8)
-    ((?u ?!) . ?\xf9)
-    ((?u ?') . ?\xfa)
-    ((?u ?>) . ?\xfb)
-    ((?u ?:) . ?\xfc)
-    ((?y ?') . ?\xfd)
-    ((?t ?h) . ?\xfe)
-    ((?y ?:) . ?\xff)
-    ((?A ?-) . ?\x0100)
-    ((?a ?-) . ?\x0101)
-    ((?A ?\() . ?\x0102)
-    ((?a ?\() . ?\x0103)
-    ((?A ?\;) . ?\x0104)
-    ((?a ?\;) . ?\x0105)
-    ((?C ?') . ?\x0106)
-    ((?c ?') . ?\x0107)
-    ((?C ?>) . ?\x0108)
-    ((?c ?>) . ?\x0109)
-    ((?C ?.) . ?\x010a)
-    ((?c ?.) . ?\x010b)
-    ((?C ?<) . ?\x010c)
-    ((?c ?<) . ?\x010d)
-    ((?D ?<) . ?\x010e)
-    ((?d ?<) . ?\x010f)
-    ((?D ?/) . ?\x0110)
-    ((?d ?/) . ?\x0111)
-    ((?E ?-) . ?\x0112)
-    ((?e ?-) . ?\x0113)
-    ((?E ?\() . ?\x0114)
-    ((?e ?\() . ?\x0115)
-    ((?E ?.) . ?\x0116)
-    ((?e ?.) . ?\x0117)
-    ((?E ?\;) . ?\x0118)
-    ((?e ?\;) . ?\x0119)
-    ((?E ?<) . ?\x011a)
-    ((?e ?<) . ?\x011b)
-    ((?G ?>) . ?\x011c)
-    ((?g ?>) . ?\x011d)
-    ((?G ?\() . ?\x011e)
-    ((?g ?\() . ?\x011f)
-    ((?G ?.) . ?\x0120)
-    ((?g ?.) . ?\x0121)
-    ((?G ?,) . ?\x0122)
-    ((?g ?,) . ?\x0123)
-    ((?H ?>) . ?\x0124)
-    ((?h ?>) . ?\x0125)
-    ((?H ?/) . ?\x0126)
-    ((?h ?/) . ?\x0127)
-    ((?I ??) . ?\x0128)
-    ((?i ??) . ?\x0129)
-    ((?I ?-) . ?\x012a)
-    ((?i ?-) . ?\x012b)
-    ((?I ?\() . ?\x012c)
-    ((?i ?\() . ?\x012d)
-    ((?I ?\;) . ?\x012e)
-    ((?i ?\;) . ?\x012f)
-    ((?I ?.) . ?\x0130)
-    ((?i ?.) . ?\x0131)
-    ((?I ?J) . ?\x0132)
-    ((?i ?j) . ?\x0133)
-    ((?J ?>) . ?\x0134)
-    ((?j ?>) . ?\x0135)
-    ((?K ?,) . ?\x0136)
-    ((?k ?,) . ?\x0137)
-    ((?k ?k) . ?\x0138)
-    ((?L ?') . ?\x0139)
-    ((?l ?') . ?\x013a)
-    ((?L ?,) . ?\x013b)
-    ((?l ?,) . ?\x013c)
-    ((?L ?<) . ?\x013d)
-    ((?l ?<) . ?\x013e)
-    ((?L ?.) . ?\x013f)
-    ((?l ?.) . ?\x0140)
-    ((?L ?/) . ?\x0141)
-    ((?l ?/) . ?\x0142)
-    ((?N ?') . ?\x0143)
-    ((?n ?') . ?\x0144)
-    ((?N ?,) . ?\x0145)
-    ((?n ?,) . ?\x0146)
-    ((?N ?<) . ?\x0147)
-    ((?n ?<) . ?\x0148)
-    ((?' ?n) . ?\x0149)
-    ((?N ?G) . ?\x014a)
-    ((?n ?g) . ?\x014b)
-    ((?O ?-) . ?\x014c)
-    ((?o ?-) . ?\x014d)
-    ((?O ?\() . ?\x014e)
-    ((?o ?\() . ?\x014f)
-    ((?O ?\") . ?\x0150)
-    ((?o ?\") . ?\x0151)
-    ((?O ?E) . ?\x0152)
-    ((?o ?e) . ?\x0153)
-    ((?R ?') . ?\x0154)
-    ((?r ?') . ?\x0155)
-    ((?R ?,) . ?\x0156)
-    ((?r ?,) . ?\x0157)
-    ((?R ?<) . ?\x0158)
-    ((?r ?<) . ?\x0159)
-    ((?S ?') . ?\x015a)
-    ((?s ?') . ?\x015b)
-    ((?S ?>) . ?\x015c)
-    ((?s ?>) . ?\x015d)
-    ((?S ?,) . ?\x015e)
-    ((?s ?,) . ?\x015f)
-    ((?S ?<) . ?\x0160)
-    ((?s ?<) . ?\x0161)
-    ((?T ?,) . ?\x0162)
-    ((?t ?,) . ?\x0163)
-    ((?T ?<) . ?\x0164)
-    ((?t ?<) . ?\x0165)
-    ((?T ?/) . ?\x0166)
-    ((?t ?/) . ?\x0167)
-    ((?U ??) . ?\x0168)
-    ((?u ??) . ?\x0169)
-    ((?U ?-) . ?\x016a)
-    ((?u ?-) . ?\x016b)
-    ((?U ?\() . ?\x016c)
-    ((?u ?\() . ?\x016d)
-    ((?U ?0) . ?\x016e)
-    ((?u ?0) . ?\x016f)
-    ((?U ?\") . ?\x0170)
-    ((?u ?\") . ?\x0171)
-    ((?U ?\;) . ?\x0172)
-    ((?u ?\;) . ?\x0173)
-    ((?W ?>) . ?\x0174)
-    ((?w ?>) . ?\x0175)
-    ((?Y ?>) . ?\x0176)
-    ((?y ?>) . ?\x0177)
-    ((?Y ?:) . ?\x0178)
-    ((?Z ?') . ?\x0179)
-    ((?z ?') . ?\x017a)
-    ((?Z ?.) . ?\x017b)
-    ((?z ?.) . ?\x017c)
-    ((?Z ?<) . ?\x017d)
-    ((?z ?<) . ?\x017e)
-    ((?O ?9) . ?\x01a0)
-    ((?o ?9) . ?\x01a1)
-    ((?O ?I) . ?\x01a2)
-    ((?o ?i) . ?\x01a3)
-    ((?y ?r) . ?\x01a6)
-    ((?U ?9) . ?\x01af)
-    ((?u ?9) . ?\x01b0)
-    ((?Z ?/) . ?\x01b5)
-    ((?z ?/) . ?\x01b6)
-    ((?E ?D) . ?\x01b7)
-    ((?A ?<) . ?\x01cd)
-    ((?a ?<) . ?\x01ce)
-    ((?I ?<) . ?\x01cf)
-    ((?i ?<) . ?\x01d0)
-    ((?O ?<) . ?\x01d1)
-    ((?o ?<) . ?\x01d2)
-    ((?U ?<) . ?\x01d3)
-    ((?u ?<) . ?\x01d4)
-    ((?A ?1) . ?\x01de)
-    ((?a ?1) . ?\x01df)
-    ((?A ?7) . ?\x01e0)
-    ((?a ?7) . ?\x01e1)
-    ((?A ?3) . ?\x01e2)
-    ((?a ?3) . ?\x01e3)
-    ((?G ?/) . ?\x01e4)
-    ((?g ?/) . ?\x01e5)
-    ((?G ?<) . ?\x01e6)
-    ((?g ?<) . ?\x01e7)
-    ((?K ?<) . ?\x01e8)
-    ((?k ?<) . ?\x01e9)
-    ((?O ?\;) . ?\x01ea)
-    ((?o ?\;) . ?\x01eb)
-    ((?O ?1) . ?\x01ec)
-    ((?o ?1) . ?\x01ed)
-    ((?E ?Z) . ?\x01ee)
-    ((?e ?z) . ?\x01ef)
-    ((?j ?<) . ?\x01f0)
-    ((?G ?') . ?\x01f4)
-    ((?g ?') . ?\x01f5)
-    ((?\; ?S) . ?\x02bf)
-    ((?' ?<) . ?\x02c7)
-    ((?' ?\() . ?\x02d8)
-    ((?' ?.) . ?\x02d9)
-    ((?' ?0) . ?\x02da)
-    ((?' ?\;) . ?\x02db)
-    ((?' ?\") . ?\x02dd)
-    ((?A ?%) . ?\x0386)
-    ((?E ?%) . ?\x0388)
-    ((?Y ?%) . ?\x0389)
-    ((?I ?%) . ?\x038a)
-    ((?O ?%) . ?\x038c)
-    ((?U ?%) . ?\x038e)
-    ((?W ?%) . ?\x038f)
-    ((?i ?3) . ?\x0390)
-    ((?A ?*) . ?\x0391)
-    ((?B ?*) . ?\x0392)
-    ((?G ?*) . ?\x0393)
-    ((?D ?*) . ?\x0394)
-    ((?E ?*) . ?\x0395)
-    ((?Z ?*) . ?\x0396)
-    ((?Y ?*) . ?\x0397)
-    ((?H ?*) . ?\x0398)
-    ((?I ?*) . ?\x0399)
-    ((?K ?*) . ?\x039a)
-    ((?L ?*) . ?\x039b)
-    ((?M ?*) . ?\x039c)
-    ((?N ?*) . ?\x039d)
-    ((?C ?*) . ?\x039e)
-    ((?O ?*) . ?\x039f)
-    ((?P ?*) . ?\x03a0)
-    ((?R ?*) . ?\x03a1)
-    ((?S ?*) . ?\x03a3)
-    ((?T ?*) . ?\x03a4)
-    ((?U ?*) . ?\x03a5)
-    ((?F ?*) . ?\x03a6)
-    ((?X ?*) . ?\x03a7)
-    ((?Q ?*) . ?\x03a8)
-    ((?W ?*) . ?\x03a9)
-    ((?J ?*) . ?\x03aa)
-    ((?V ?*) . ?\x03ab)
-    ((?a ?%) . ?\x03ac)
-    ((?e ?%) . ?\x03ad)
-    ((?y ?%) . ?\x03ae)
-    ((?i ?%) . ?\x03af)
-    ((?u ?3) . ?\x03b0)
-    ((?a ?*) . ?\x03b1)
-    ((?b ?*) . ?\x03b2)
-    ((?g ?*) . ?\x03b3)
-    ((?d ?*) . ?\x03b4)
-    ((?e ?*) . ?\x03b5)
-    ((?z ?*) . ?\x03b6)
-    ((?y ?*) . ?\x03b7)
-    ((?h ?*) . ?\x03b8)
-    ((?i ?*) . ?\x03b9)
-    ((?k ?*) . ?\x03ba)
-    ((?l ?*) . ?\x03bb)
-    ((?m ?*) . ?\x03bc)
-    ((?n ?*) . ?\x03bd)
-    ((?c ?*) . ?\x03be)
-    ((?o ?*) . ?\x03bf)
-    ((?p ?*) . ?\x03c0)
-    ((?r ?*) . ?\x03c1)
-    ((?* ?s) . ?\x03c2)
-    ((?s ?*) . ?\x03c3)
-    ((?t ?*) . ?\x03c4)
-    ((?u ?*) . ?\x03c5)
-    ((?f ?*) . ?\x03c6)
-    ((?x ?*) . ?\x03c7)
-    ((?q ?*) . ?\x03c8)
-    ((?w ?*) . ?\x03c9)
-    ((?j ?*) . ?\x03ca)
-    ((?v ?*) . ?\x03cb)
-    ((?o ?%) . ?\x03cc)
-    ((?u ?%) . ?\x03cd)
-    ((?w ?%) . ?\x03ce)
-    ((?' ?G) . ?\x03d8)
-    ((?, ?G) . ?\x03d9)
-    ((?T ?3) . ?\x03da)
-    ((?t ?3) . ?\x03db)
-    ((?M ?3) . ?\x03dc)
-    ((?m ?3) . ?\x03dd)
-    ((?K ?3) . ?\x03de)
-    ((?k ?3) . ?\x03df)
-    ((?P ?3) . ?\x03e0)
-    ((?p ?3) . ?\x03e1)
-    ((?' ?%) . ?\x03f4)
-    ((?j ?3) . ?\x03f5)
-    ((?I ?O) . ?\x0401)
-    ((?D ?%) . ?\x0402)
-    ((?G ?%) . ?\x0403)
-    ((?I ?E) . ?\x0404)
-    ((?D ?S) . ?\x0405)
-    ((?I ?I) . ?\x0406)
-    ((?Y ?I) . ?\x0407)
-    ((?J ?%) . ?\x0408)
-    ((?L ?J) . ?\x0409)
-    ((?N ?J) . ?\x040a)
-    ((?T ?s) . ?\x040b)
-    ((?K ?J) . ?\x040c)
-    ((?V ?%) . ?\x040e)
-    ((?D ?Z) . ?\x040f)
-    ((?A ?=) . ?\x0410)
-    ((?B ?=) . ?\x0411)
-    ((?V ?=) . ?\x0412)
-    ((?G ?=) . ?\x0413)
-    ((?D ?=) . ?\x0414)
-    ((?E ?=) . ?\x0415)
-    ((?Z ?%) . ?\x0416)
-    ((?Z ?=) . ?\x0417)
-    ((?I ?=) . ?\x0418)
-    ((?J ?=) . ?\x0419)
-    ((?K ?=) . ?\x041a)
-    ((?L ?=) . ?\x041b)
-    ((?M ?=) . ?\x041c)
-    ((?N ?=) . ?\x041d)
-    ((?O ?=) . ?\x041e)
-    ((?P ?=) . ?\x041f)
-    ((?R ?=) . ?\x0420)
-    ((?S ?=) . ?\x0421)
-    ((?T ?=) . ?\x0422)
-    ((?U ?=) . ?\x0423)
-    ((?F ?=) . ?\x0424)
-    ((?H ?=) . ?\x0425)
-    ((?C ?=) . ?\x0426)
-    ((?C ?%) . ?\x0427)
-    ((?S ?%) . ?\x0428)
-    ((?S ?c) . ?\x0429)
-    ((?= ?\") . ?\x042a)
-    ((?Y ?=) . ?\x042b)
-    ((?% ?\") . ?\x042c)
-    ((?J ?E) . ?\x042d)
-    ((?J ?U) . ?\x042e)
-    ((?J ?A) . ?\x042f)
-    ((?a ?=) . ?\x0430)
-    ((?b ?=) . ?\x0431)
-    ((?v ?=) . ?\x0432)
-    ((?g ?=) . ?\x0433)
-    ((?d ?=) . ?\x0434)
-    ((?e ?=) . ?\x0435)
-    ((?z ?%) . ?\x0436)
-    ((?z ?=) . ?\x0437)
-    ((?i ?=) . ?\x0438)
-    ((?j ?=) . ?\x0439)
-    ((?k ?=) . ?\x043a)
-    ((?l ?=) . ?\x043b)
-    ((?m ?=) . ?\x043c)
-    ((?n ?=) . ?\x043d)
-    ((?o ?=) . ?\x043e)
-    ((?p ?=) . ?\x043f)
-    ((?r ?=) . ?\x0440)
-    ((?s ?=) . ?\x0441)
-    ((?t ?=) . ?\x0442)
-    ((?u ?=) . ?\x0443)
-    ((?f ?=) . ?\x0444)
-    ((?h ?=) . ?\x0445)
-    ((?c ?=) . ?\x0446)
-    ((?c ?%) . ?\x0447)
-    ((?s ?%) . ?\x0448)
-    ((?s ?c) . ?\x0449)
-    ((?= ?') . ?\x044a)
-    ((?y ?=) . ?\x044b)
-    ((?% ?') . ?\x044c)
-    ((?j ?e) . ?\x044d)
-    ((?j ?u) . ?\x044e)
-    ((?j ?a) . ?\x044f)
-    ((?i ?o) . ?\x0451)
-    ((?d ?%) . ?\x0452)
-    ((?g ?%) . ?\x0453)
-    ((?i ?e) . ?\x0454)
-    ((?d ?s) . ?\x0455)
-    ((?i ?i) . ?\x0456)
-    ((?y ?i) . ?\x0457)
-    ((?j ?%) . ?\x0458)
-    ((?l ?j) . ?\x0459)
-    ((?n ?j) . ?\x045a)
-    ((?t ?s) . ?\x045b)
-    ((?k ?j) . ?\x045c)
-    ((?v ?%) . ?\x045e)
-    ((?d ?z) . ?\x045f)
-    ((?Y ?3) . ?\x0462)
-    ((?y ?3) . ?\x0463)
-    ((?O ?3) . ?\x046a)
-    ((?o ?3) . ?\x046b)
-    ((?F ?3) . ?\x0472)
-    ((?f ?3) . ?\x0473)
-    ((?V ?3) . ?\x0474)
-    ((?v ?3) . ?\x0475)
-    ((?C ?3) . ?\x0480)
-    ((?c ?3) . ?\x0481)
-    ((?G ?3) . ?\x0490)
-    ((?g ?3) . ?\x0491)
-    ((?A ?+) . ?\x05d0)
-    ((?B ?+) . ?\x05d1)
-    ((?G ?+) . ?\x05d2)
-    ((?D ?+) . ?\x05d3)
-    ((?H ?+) . ?\x05d4)
-    ((?W ?+) . ?\x05d5)
-    ((?Z ?+) . ?\x05d6)
-    ((?X ?+) . ?\x05d7)
-    ((?T ?j) . ?\x05d8)
-    ((?J ?+) . ?\x05d9)
-    ((?K ?%) . ?\x05da)
-    ((?K ?+) . ?\x05db)
-    ((?L ?+) . ?\x05dc)
-    ((?M ?%) . ?\x05dd)
-    ((?M ?+) . ?\x05de)
-    ((?N ?%) . ?\x05df)
-    ((?N ?+) . ?\x05e0)
-    ((?S ?+) . ?\x05e1)
-    ((?E ?+) . ?\x05e2)
-    ((?P ?%) . ?\x05e3)
-    ((?P ?+) . ?\x05e4)
-    ((?Z ?j) . ?\x05e5)
-    ((?Z ?J) . ?\x05e6)
-    ((?Q ?+) . ?\x05e7)
-    ((?R ?+) . ?\x05e8)
-    ((?S ?h) . ?\x05e9)
-    ((?T ?+) . ?\x05ea)
-    ((?, ?+) . ?\x060c)
-    ((?\; ?+) . ?\x061b)
-    ((?? ?+) . ?\x061f)
-    ((?H ?') . ?\x0621)
-    ((?a ?M) . ?\x0622)
-    ((?a ?H) . ?\x0623)
-    ((?w ?H) . ?\x0624)
-    ((?a ?h) . ?\x0625)
-    ((?y ?H) . ?\x0626)
-    ((?a ?+) . ?\x0627)
-    ((?b ?+) . ?\x0628)
-    ((?t ?m) . ?\x0629)
-    ((?t ?+) . ?\x062a)
-    ((?t ?k) . ?\x062b)
-    ((?g ?+) . ?\x062c)
-    ((?h ?k) . ?\x062d)
-    ((?x ?+) . ?\x062e)
-    ((?d ?+) . ?\x062f)
-    ((?d ?k) . ?\x0630)
-    ((?r ?+) . ?\x0631)
-    ((?z ?+) . ?\x0632)
-    ((?s ?+) . ?\x0633)
-    ((?s ?n) . ?\x0634)
-    ((?c ?+) . ?\x0635)
-    ((?d ?d) . ?\x0636)
-    ((?t ?j) . ?\x0637)
-    ((?z ?H) . ?\x0638)
-    ((?e ?+) . ?\x0639)
-    ((?i ?+) . ?\x063a)
-    ((?+ ?+) . ?\x0640)
-    ((?f ?+) . ?\x0641)
-    ((?q ?+) . ?\x0642)
-    ((?k ?+) . ?\x0643)
-    ((?l ?+) . ?\x0644)
-    ((?m ?+) . ?\x0645)
-    ((?n ?+) . ?\x0646)
-    ((?h ?+) . ?\x0647)
-    ((?w ?+) . ?\x0648)
-    ((?j ?+) . ?\x0649)
-    ((?y ?+) . ?\x064a)
-    ((?: ?+) . ?\x064b)
-    ((?\" ?+) . ?\x064c)
-    ((?= ?+) . ?\x064d)
-    ((?/ ?+) . ?\x064e)
-    ((?' ?+) . ?\x064f)
-    ((?1 ?+) . ?\x0650)
-    ((?3 ?+) . ?\x0651)
-    ((?0 ?+) . ?\x0652)
-    ((?a ?S) . ?\x0670)
-    ((?p ?+) . ?\x067e)
-    ((?v ?+) . ?\x06a4)
-    ((?g ?f) . ?\x06af)
-    ((?0 ?a) . ?\x06f0)
-    ((?1 ?a) . ?\x06f1)
-    ((?2 ?a) . ?\x06f2)
-    ((?3 ?a) . ?\x06f3)
-    ((?4 ?a) . ?\x06f4)
-    ((?5 ?a) . ?\x06f5)
-    ((?6 ?a) . ?\x06f6)
-    ((?7 ?a) . ?\x06f7)
-    ((?8 ?a) . ?\x06f8)
-    ((?9 ?a) . ?\x06f9)
-    ((?B ?.) . ?\x1e02)
-    ((?b ?.) . ?\x1e03)
-    ((?B ?_) . ?\x1e06)
-    ((?b ?_) . ?\x1e07)
-    ((?D ?.) . ?\x1e0a)
-    ((?d ?.) . ?\x1e0b)
-    ((?D ?_) . ?\x1e0e)
-    ((?d ?_) . ?\x1e0f)
-    ((?D ?,) . ?\x1e10)
-    ((?d ?,) . ?\x1e11)
-    ((?F ?.) . ?\x1e1e)
-    ((?f ?.) . ?\x1e1f)
-    ((?G ?-) . ?\x1e20)
-    ((?g ?-) . ?\x1e21)
-    ((?H ?.) . ?\x1e22)
-    ((?h ?.) . ?\x1e23)
-    ((?H ?:) . ?\x1e26)
-    ((?h ?:) . ?\x1e27)
-    ((?H ?,) . ?\x1e28)
-    ((?h ?,) . ?\x1e29)
-    ((?K ?') . ?\x1e30)
-    ((?k ?') . ?\x1e31)
-    ((?K ?_) . ?\x1e34)
-    ((?k ?_) . ?\x1e35)
-    ((?L ?_) . ?\x1e3a)
-    ((?l ?_) . ?\x1e3b)
-    ((?M ?') . ?\x1e3e)
-    ((?m ?') . ?\x1e3f)
-    ((?M ?.) . ?\x1e40)
-    ((?m ?.) . ?\x1e41)
-    ((?N ?.) . ?\x1e44)
-    ((?n ?.) . ?\x1e45)
-    ((?N ?_) . ?\x1e48)
-    ((?n ?_) . ?\x1e49)
-    ((?P ?') . ?\x1e54)
-    ((?p ?') . ?\x1e55)
-    ((?P ?.) . ?\x1e56)
-    ((?p ?.) . ?\x1e57)
-    ((?R ?.) . ?\x1e58)
-    ((?r ?.) . ?\x1e59)
-    ((?R ?_) . ?\x1e5e)
-    ((?r ?_) . ?\x1e5f)
-    ((?S ?.) . ?\x1e60)
-    ((?s ?.) . ?\x1e61)
-    ((?T ?.) . ?\x1e6a)
-    ((?t ?.) . ?\x1e6b)
-    ((?T ?_) . ?\x1e6e)
-    ((?t ?_) . ?\x1e6f)
-    ((?V ??) . ?\x1e7c)
-    ((?v ??) . ?\x1e7d)
-    ((?W ?!) . ?\x1e80)
-    ((?w ?!) . ?\x1e81)
-    ((?W ?') . ?\x1e82)
-    ((?w ?') . ?\x1e83)
-    ((?W ?:) . ?\x1e84)
-    ((?w ?:) . ?\x1e85)
-    ((?W ?.) . ?\x1e86)
-    ((?w ?.) . ?\x1e87)
-    ((?X ?.) . ?\x1e8a)
-    ((?x ?.) . ?\x1e8b)
-    ((?X ?:) . ?\x1e8c)
-    ((?x ?:) . ?\x1e8d)
-    ((?Y ?.) . ?\x1e8e)
-    ((?y ?.) . ?\x1e8f)
-    ((?Z ?>) . ?\x1e90)
-    ((?z ?>) . ?\x1e91)
-    ((?Z ?_) . ?\x1e94)
-    ((?z ?_) . ?\x1e95)
-    ((?h ?_) . ?\x1e96)
-    ((?t ?:) . ?\x1e97)
-    ((?w ?0) . ?\x1e98)
-    ((?y ?0) . ?\x1e99)
-    ((?A ?2) . ?\x1ea2)
-    ((?a ?2) . ?\x1ea3)
-    ((?E ?2) . ?\x1eba)
-    ((?e ?2) . ?\x1ebb)
-    ((?E ??) . ?\x1ebc)
-    ((?e ??) . ?\x1ebd)
-    ((?I ?2) . ?\x1ec8)
-    ((?i ?2) . ?\x1ec9)
-    ((?O ?2) . ?\x1ece)
-    ((?o ?2) . ?\x1ecf)
-    ((?U ?2) . ?\x1ee6)
-    ((?u ?2) . ?\x1ee7)
-    ((?Y ?!) . ?\x1ef2)
-    ((?y ?!) . ?\x1ef3)
-    ((?Y ?2) . ?\x1ef6)
-    ((?y ?2) . ?\x1ef7)
-    ((?Y ??) . ?\x1ef8)
-    ((?y ??) . ?\x1ef9)
-    ((?\; ?') . ?\x1f00)
-    ((?, ?') . ?\x1f01)
-    ((?\; ?!) . ?\x1f02)
-    ((?, ?!) . ?\x1f03)
-    ((?? ?\;) . ?\x1f04)
-    ((?? ?,) . ?\x1f05)
-    ((?! ?:) . ?\x1f06)
-    ((?? ?:) . ?\x1f07)
-    ((?1 ?N) . ?\x2002)
-    ((?1 ?M) . ?\x2003)
-    ((?3 ?M) . ?\x2004)
-    ((?4 ?M) . ?\x2005)
-    ((?6 ?M) . ?\x2006)
-    ((?1 ?T) . ?\x2009)
-    ((?1 ?H) . ?\x200a)
-    ((?- ?1) . ?\x2010)
-    ((?- ?N) . ?\x2013)
-    ((?- ?M) . ?\x2014)
-    ((?- ?3) . ?\x2015)
-    ((?! ?2) . ?\x2016)
-    ((?= ?2) . ?\x2017)
-    ((?' ?6) . ?\x2018)
-    ((?' ?9) . ?\x2019)
-    ((?. ?9) . ?\x201a)
-    ((?9 ?') . ?\x201b)
-    ((?\" ?6) . ?\x201c)
-    ((?\" ?9) . ?\x201d)
-    ((?: ?9) . ?\x201e)
-    ((?9 ?\") . ?\x201f)
-    ((?/ ?-) . ?\x2020)
-    ((?/ ?=) . ?\x2021)
-    ((?. ?.) . ?\x2025)
-    ((?% ?0) . ?\x2030)
-    ((?1 ?') . ?\x2032)
-    ((?2 ?') . ?\x2033)
-    ((?3 ?') . ?\x2034)
-    ((?1 ?\") . ?\x2035)
-    ((?2 ?\") . ?\x2036)
-    ((?3 ?\") . ?\x2037)
-    ((?C ?a) . ?\x2038)
-    ((?< ?1) . ?\x2039)
-    ((?> ?1) . ?\x203a)
-    ((?: ?X) . ?\x203b)
-    ((?' ?-) . ?\x203e)
-    ((?/ ?f) . ?\x2044)
-    ((?0 ?S) . ?\x2070)
-    ((?4 ?S) . ?\x2074)
-    ((?5 ?S) . ?\x2075)
-    ((?6 ?S) . ?\x2076)
-    ((?7 ?S) . ?\x2077)
-    ((?8 ?S) . ?\x2078)
-    ((?9 ?S) . ?\x2079)
-    ((?+ ?S) . ?\x207a)
-    ((?- ?S) . ?\x207b)
-    ((?= ?S) . ?\x207c)
-    ((?\( ?S) . ?\x207d)
-    ((?\) ?S) . ?\x207e)
-    ((?n ?S) . ?\x207f)
-    ((?0 ?s) . ?\x2080)
-    ((?1 ?s) . ?\x2081)
-    ((?2 ?s) . ?\x2082)
-    ((?3 ?s) . ?\x2083)
-    ((?4 ?s) . ?\x2084)
-    ((?5 ?s) . ?\x2085)
-    ((?6 ?s) . ?\x2086)
-    ((?7 ?s) . ?\x2087)
-    ((?8 ?s) . ?\x2088)
-    ((?9 ?s) . ?\x2089)
-    ((?+ ?s) . ?\x208a)
-    ((?- ?s) . ?\x208b)
-    ((?= ?s) . ?\x208c)
-    ((?\( ?s) . ?\x208d)
-    ((?\) ?s) . ?\x208e)
-    ((?L ?i) . ?\x20a4)
-    ((?P ?t) . ?\x20a7)
-    ((?W ?=) . ?\x20a9)
-    ((?= ?e) . ?\x20ac)
-    ((?E ?u) . ?\x20ac)
-    ((?o ?C) . ?\x2103)
-    ((?c ?o) . ?\x2105)
-    ((?o ?F) . ?\x2109)
-    ((?N ?0) . ?\x2116)
-    ((?P ?O) . ?\x2117)
-    ((?R ?x) . ?\x211e)
-    ((?S ?M) . ?\x2120)
-    ((?T ?M) . ?\x2122)
-    ((?O ?m) . ?\x2126)
-    ((?A ?O) . ?\x212b)
-    ((?1 ?3) . ?\x2153)
-    ((?2 ?3) . ?\x2154)
-    ((?1 ?5) . ?\x2155)
-    ((?2 ?5) . ?\x2156)
-    ((?3 ?5) . ?\x2157)
-    ((?4 ?5) . ?\x2158)
-    ((?1 ?6) . ?\x2159)
-    ((?5 ?6) . ?\x215a)
-    ((?1 ?8) . ?\x215b)
-    ((?3 ?8) . ?\x215c)
-    ((?5 ?8) . ?\x215d)
-    ((?7 ?8) . ?\x215e)
-    ((?1 ?R) . ?\x2160)
-    ((?2 ?R) . ?\x2161)
-    ((?3 ?R) . ?\x2162)
-    ((?4 ?R) . ?\x2163)
-    ((?5 ?R) . ?\x2164)
-    ((?6 ?R) . ?\x2165)
-    ((?7 ?R) . ?\x2166)
-    ((?8 ?R) . ?\x2167)
-    ((?9 ?R) . ?\x2168)
-    ((?a ?R) . ?\x2169)
-    ((?b ?R) . ?\x216a)
-    ((?c ?R) . ?\x216b)
-    ((?1 ?r) . ?\x2170)
-    ((?2 ?r) . ?\x2171)
-    ((?3 ?r) . ?\x2172)
-    ((?4 ?r) . ?\x2173)
-    ((?5 ?r) . ?\x2174)
-    ((?6 ?r) . ?\x2175)
-    ((?7 ?r) . ?\x2176)
-    ((?8 ?r) . ?\x2177)
-    ((?9 ?r) . ?\x2178)
-    ((?a ?r) . ?\x2179)
-    ((?b ?r) . ?\x217a)
-    ((?c ?r) . ?\x217b)
-    ((?< ?-) . ?\x2190)
-    ((?- ?!) . ?\x2191)
-    ((?- ?>) . ?\x2192)
-    ((?- ?v) . ?\x2193)
-    ((?< ?>) . ?\x2194)
-    ((?U ?D) . ?\x2195)
-    ((?< ?=) . ?\x21d0)
-    ((?= ?>) . ?\x21d2)
-    ((?= ?=) . ?\x21d4)
-    ((?F ?A) . ?\x2200)
-    ((?d ?P) . ?\x2202)
-    ((?T ?E) . ?\x2203)
-    ((?/ ?0) . ?\x2205)
-    ((?D ?E) . ?\x2206)
-    ((?N ?B) . ?\x2207)
-    ((?\( ?-) . ?\x2208)
-    ((?- ?\)) . ?\x220b)
-    ((?* ?P) . ?\x220f)
-    ((?+ ?Z) . ?\x2211)
-    ((?- ?2) . ?\x2212)
-    ((?- ?+) . ?\x2213)
-    ((?* ?-) . ?\x2217)
-    ((?O ?b) . ?\x2218)
-    ((?S ?b) . ?\x2219)
-    ((?R ?T) . ?\x221a)
-    ((?0 ?\() . ?\x221d)
-    ((?0 ?0) . ?\x221e)
-    ((?- ?L) . ?\x221f)
-    ((?- ?V) . ?\x2220)
-    ((?P ?P) . ?\x2225)
-    ((?A ?N) . ?\x2227)
-    ((?O ?R) . ?\x2228)
-    ((?\( ?U) . ?\x2229)
-    ((?\) ?U) . ?\x222a)
-    ((?I ?n) . ?\x222b)
-    ((?D ?I) . ?\x222c)
-    ((?I ?o) . ?\x222e)
-    ((?. ?:) . ?\x2234)
-    ((?: ?.) . ?\x2235)
-    ((?: ?R) . ?\x2236)
-    ((?: ?:) . ?\x2237)
-    ((?? ?1) . ?\x223c)
-    ((?C ?G) . ?\x223e)
-    ((?? ?-) . ?\x2243)
-    ((?? ?=) . ?\x2245)
-    ((?? ?2) . ?\x2248)
-    ((?= ??) . ?\x224c)
-    ((?H ?I) . ?\x2253)
-    ((?! ?=) . ?\x2260)
-    ((?= ?3) . ?\x2261)
-    ((?= ?<) . ?\x2264)
-    ((?> ?=) . ?\x2265)
-    ((?< ?*) . ?\x226a)
-    ((?* ?>) . ?\x226b)
-    ((?! ?<) . ?\x226e)
-    ((?! ?>) . ?\x226f)
-    ((?\( ?C) . ?\x2282)
-    ((?\) ?C) . ?\x2283)
-    ((?\( ?_) . ?\x2286)
-    ((?\) ?_) . ?\x2287)
-    ((?0 ?.) . ?\x2299)
-    ((?0 ?2) . ?\x229a)
-    ((?- ?T) . ?\x22a5)
-    ((?. ?P) . ?\x22c5)
-    ((?: ?3) . ?\x22ee)
-    ((?. ?3) . ?\x22ef)
-    ((?E ?h) . ?\x2302)
-    ((?< ?7) . ?\x2308)
-    ((?> ?7) . ?\x2309)
-    ((?7 ?<) . ?\x230a)
-    ((?7 ?>) . ?\x230b)
-    ((?N ?I) . ?\x2310)
-    ((?\( ?A) . ?\x2312)
-    ((?T ?R) . ?\x2315)
-    ((?I ?u) . ?\x2320)
-    ((?I ?l) . ?\x2321)
-    ((?< ?/) . ?\x2329)
-    ((?/ ?>) . ?\x232a)
-    ((?V ?s) . ?\x2423)
-    ((?1 ?h) . ?\x2440)
-    ((?3 ?h) . ?\x2441)
-    ((?2 ?h) . ?\x2442)
-    ((?4 ?h) . ?\x2443)
-    ((?1 ?j) . ?\x2446)
-    ((?2 ?j) . ?\x2447)
-    ((?3 ?j) . ?\x2448)
-    ((?4 ?j) . ?\x2449)
-    ((?1 ?.) . ?\x2488)
-    ((?2 ?.) . ?\x2489)
-    ((?3 ?.) . ?\x248a)
-    ((?4 ?.) . ?\x248b)
-    ((?5 ?.) . ?\x248c)
-    ((?6 ?.) . ?\x248d)
-    ((?7 ?.) . ?\x248e)
-    ((?8 ?.) . ?\x248f)
-    ((?9 ?.) . ?\x2490)
-    ((?h ?h) . ?\x2500)
-    ((?H ?H) . ?\x2501)
-    ((?v ?v) . ?\x2502)
-    ((?V ?V) . ?\x2503)
-    ((?3 ?-) . ?\x2504)
-    ((?3 ?_) . ?\x2505)
-    ((?3 ?!) . ?\x2506)
-    ((?3 ?/) . ?\x2507)
-    ((?4 ?-) . ?\x2508)
-    ((?4 ?_) . ?\x2509)
-    ((?4 ?!) . ?\x250a)
-    ((?4 ?/) . ?\x250b)
-    ((?d ?r) . ?\x250c)
-    ((?d ?R) . ?\x250d)
-    ((?D ?r) . ?\x250e)
-    ((?D ?R) . ?\x250f)
-    ((?d ?l) . ?\x2510)
-    ((?d ?L) . ?\x2511)
-    ((?D ?l) . ?\x2512)
-    ((?L ?D) . ?\x2513)
-    ((?u ?r) . ?\x2514)
-    ((?u ?R) . ?\x2515)
-    ((?U ?r) . ?\x2516)
-    ((?U ?R) . ?\x2517)
-    ((?u ?l) . ?\x2518)
-    ((?u ?L) . ?\x2519)
-    ((?U ?l) . ?\x251a)
-    ((?U ?L) . ?\x251b)
-    ((?v ?r) . ?\x251c)
-    ((?v ?R) . ?\x251d)
-    ((?V ?r) . ?\x2520)
-    ((?V ?R) . ?\x2523)
-    ((?v ?l) . ?\x2524)
-    ((?v ?L) . ?\x2525)
-    ((?V ?l) . ?\x2528)
-    ((?V ?L) . ?\x252b)
-    ((?d ?h) . ?\x252c)
-    ((?d ?H) . ?\x252f)
-    ((?D ?h) . ?\x2530)
-    ((?D ?H) . ?\x2533)
-    ((?u ?h) . ?\x2534)
-    ((?u ?H) . ?\x2537)
-    ((?U ?h) . ?\x2538)
-    ((?U ?H) . ?\x253b)
-    ((?v ?h) . ?\x253c)
-    ((?v ?H) . ?\x253f)
-    ((?V ?h) . ?\x2542)
-    ((?V ?H) . ?\x254b)
-    ((?F ?D) . ?\x2571)
-    ((?B ?D) . ?\x2572)
-    ((?T ?B) . ?\x2580)
-    ((?L ?B) . ?\x2584)
-    ((?F ?B) . ?\x2588)
-    ((?l ?B) . ?\x258c)
-    ((?R ?B) . ?\x2590)
-    ((?. ?S) . ?\x2591)
-    ((?: ?S) . ?\x2592)
-    ((?? ?S) . ?\x2593)
-    ((?f ?S) . ?\x25a0)
-    ((?O ?S) . ?\x25a1)
-    ((?R ?O) . ?\x25a2)
-    ((?R ?r) . ?\x25a3)
-    ((?R ?F) . ?\x25a4)
-    ((?R ?Y) . ?\x25a5)
-    ((?R ?H) . ?\x25a6)
-    ((?R ?Z) . ?\x25a7)
-    ((?R ?K) . ?\x25a8)
-    ((?R ?X) . ?\x25a9)
-    ((?s ?B) . ?\x25aa)
-    ((?S ?R) . ?\x25ac)
-    ((?O ?r) . ?\x25ad)
-    ((?U ?T) . ?\x25b2)
-    ((?u ?T) . ?\x25b3)
-    ((?P ?R) . ?\x25b6)
-    ((?T ?r) . ?\x25b7)
-    ((?D ?t) . ?\x25bc)
-    ((?d ?T) . ?\x25bd)
-    ((?P ?L) . ?\x25c0)
-    ((?T ?l) . ?\x25c1)
-    ((?D ?b) . ?\x25c6)
-    ((?D ?w) . ?\x25c7)
-    ((?L ?Z) . ?\x25ca)
-    ((?0 ?m) . ?\x25cb)
-    ((?0 ?o) . ?\x25ce)
-    ((?0 ?M) . ?\x25cf)
-    ((?0 ?L) . ?\x25d0)
-    ((?0 ?R) . ?\x25d1)
-    ((?S ?n) . ?\x25d8)
-    ((?I ?c) . ?\x25d9)
-    ((?F ?d) . ?\x25e2)
-    ((?B ?d) . ?\x25e3)
-    ((?* ?2) . ?\x2605)
-    ((?* ?1) . ?\x2606)
-    ((?< ?H) . ?\x261c)
-    ((?> ?H) . ?\x261e)
-    ((?0 ?u) . ?\x263a)
-    ((?0 ?U) . ?\x263b)
-    ((?S ?U) . ?\x263c)
-    ((?F ?m) . ?\x2640)
-    ((?M ?l) . ?\x2642)
-    ((?c ?S) . ?\x2660)
-    ((?c ?H) . ?\x2661)
-    ((?c ?D) . ?\x2662)
-    ((?c ?C) . ?\x2663)
-    ((?M ?d) . ?\x2669)
-    ((?M ?8) . ?\x266a)
-    ((?M ?2) . ?\x266b)
-    ((?M ?b) . ?\x266d)
-    ((?M ?x) . ?\x266e)
-    ((?M ?X) . ?\x266f)
-    ((?O ?K) . ?\x2713)
-    ((?X ?X) . ?\x2717)
-    ((?- ?X) . ?\x2720)
-    ((?I ?S) . ?\x3000)
-    ((?, ?_) . ?\x3001)
-    ((?. ?_) . ?\x3002)
-    ((?+ ?\") . ?\x3003)
-    ((?+ ?_) . ?\x3004)
-    ((?* ?_) . ?\x3005)
-    ((?\; ?_) . ?\x3006)
-    ((?0 ?_) . ?\x3007)
-    ((?< ?+) . ?\x300a)
-    ((?> ?+) . ?\x300b)
-    ((?< ?') . ?\x300c)
-    ((?> ?') . ?\x300d)
-    ((?< ?\") . ?\x300e)
-    ((?> ?\") . ?\x300f)
-    ((?\( ?\") . ?\x3010)
-    ((?\) ?\") . ?\x3011)
-    ((?= ?T) . ?\x3012)
-    ((?= ?_) . ?\x3013)
-    ((?\( ?') . ?\x3014)
-    ((?\) ?') . ?\x3015)
-    ((?\( ?I) . ?\x3016)
-    ((?\) ?I) . ?\x3017)
-    ((?- ??) . ?\x301c)
-    ((?A ?5) . ?\x3041)
-    ((?a ?5) . ?\x3042)
-    ((?I ?5) . ?\x3043)
-    ((?i ?5) . ?\x3044)
-    ((?U ?5) . ?\x3045)
-    ((?u ?5) . ?\x3046)
-    ((?E ?5) . ?\x3047)
-    ((?e ?5) . ?\x3048)
-    ((?O ?5) . ?\x3049)
-    ((?o ?5) . ?\x304a)
-    ((?k ?a) . ?\x304b)
-    ((?g ?a) . ?\x304c)
-    ((?k ?i) . ?\x304d)
-    ((?g ?i) . ?\x304e)
-    ((?k ?u) . ?\x304f)
-    ((?g ?u) . ?\x3050)
-    ((?k ?e) . ?\x3051)
-    ((?g ?e) . ?\x3052)
-    ((?k ?o) . ?\x3053)
-    ((?g ?o) . ?\x3054)
-    ((?s ?a) . ?\x3055)
-    ((?z ?a) . ?\x3056)
-    ((?s ?i) . ?\x3057)
-    ((?z ?i) . ?\x3058)
-    ((?s ?u) . ?\x3059)
-    ((?z ?u) . ?\x305a)
-    ((?s ?e) . ?\x305b)
-    ((?z ?e) . ?\x305c)
-    ((?s ?o) . ?\x305d)
-    ((?z ?o) . ?\x305e)
-    ((?t ?a) . ?\x305f)
-    ((?d ?a) . ?\x3060)
-    ((?t ?i) . ?\x3061)
-    ((?d ?i) . ?\x3062)
-    ((?t ?U) . ?\x3063)
-    ((?t ?u) . ?\x3064)
-    ((?d ?u) . ?\x3065)
-    ((?t ?e) . ?\x3066)
-    ((?d ?e) . ?\x3067)
-    ((?t ?o) . ?\x3068)
-    ((?d ?o) . ?\x3069)
-    ((?n ?a) . ?\x306a)
-    ((?n ?i) . ?\x306b)
-    ((?n ?u) . ?\x306c)
-    ((?n ?e) . ?\x306d)
-    ((?n ?o) . ?\x306e)
-    ((?h ?a) . ?\x306f)
-    ((?b ?a) . ?\x3070)
-    ((?p ?a) . ?\x3071)
-    ((?h ?i) . ?\x3072)
-    ((?b ?i) . ?\x3073)
-    ((?p ?i) . ?\x3074)
-    ((?h ?u) . ?\x3075)
-    ((?b ?u) . ?\x3076)
-    ((?p ?u) . ?\x3077)
-    ((?h ?e) . ?\x3078)
-    ((?b ?e) . ?\x3079)
-    ((?p ?e) . ?\x307a)
-    ((?h ?o) . ?\x307b)
-    ((?b ?o) . ?\x307c)
-    ((?p ?o) . ?\x307d)
-    ((?m ?a) . ?\x307e)
-    ((?m ?i) . ?\x307f)
-    ((?m ?u) . ?\x3080)
-    ((?m ?e) . ?\x3081)
-    ((?m ?o) . ?\x3082)
-    ((?y ?A) . ?\x3083)
-    ((?y ?a) . ?\x3084)
-    ((?y ?U) . ?\x3085)
-    ((?y ?u) . ?\x3086)
-    ((?y ?O) . ?\x3087)
-    ((?y ?o) . ?\x3088)
-    ((?r ?a) . ?\x3089)
-    ((?r ?i) . ?\x308a)
-    ((?r ?u) . ?\x308b)
-    ((?r ?e) . ?\x308c)
-    ((?r ?o) . ?\x308d)
-    ((?w ?A) . ?\x308e)
-    ((?w ?a) . ?\x308f)
-    ((?w ?i) . ?\x3090)
-    ((?w ?e) . ?\x3091)
-    ((?w ?o) . ?\x3092)
-    ((?n ?5) . ?\x3093)
-    ((?v ?u) . ?\x3094)
-    ((?\" ?5) . ?\x309b)
-    ((?0 ?5) . ?\x309c)
-    ((?* ?5) . ?\x309d)
-    ((?+ ?5) . ?\x309e)
-    ((?a ?6) . ?\x30a1)
-    ((?A ?6) . ?\x30a2)
-    ((?i ?6) . ?\x30a3)
-    ((?I ?6) . ?\x30a4)
-    ((?u ?6) . ?\x30a5)
-    ((?U ?6) . ?\x30a6)
-    ((?e ?6) . ?\x30a7)
-    ((?E ?6) . ?\x30a8)
-    ((?o ?6) . ?\x30a9)
-    ((?O ?6) . ?\x30aa)
-    ((?K ?a) . ?\x30ab)
-    ((?G ?a) . ?\x30ac)
-    ((?K ?i) . ?\x30ad)
-    ((?G ?i) . ?\x30ae)
-    ((?K ?u) . ?\x30af)
-    ((?G ?u) . ?\x30b0)
-    ((?K ?e) . ?\x30b1)
-    ((?G ?e) . ?\x30b2)
-    ((?K ?o) . ?\x30b3)
-    ((?G ?o) . ?\x30b4)
-    ((?S ?a) . ?\x30b5)
-    ((?Z ?a) . ?\x30b6)
-    ((?S ?i) . ?\x30b7)
-    ((?Z ?i) . ?\x30b8)
-    ((?S ?u) . ?\x30b9)
-    ((?Z ?u) . ?\x30ba)
-    ((?S ?e) . ?\x30bb)
-    ((?Z ?e) . ?\x30bc)
-    ((?S ?o) . ?\x30bd)
-    ((?Z ?o) . ?\x30be)
-    ((?T ?a) . ?\x30bf)
-    ((?D ?a) . ?\x30c0)
-    ((?T ?i) . ?\x30c1)
-    ((?D ?i) . ?\x30c2)
-    ((?T ?U) . ?\x30c3)
-    ((?T ?u) . ?\x30c4)
-    ((?D ?u) . ?\x30c5)
-    ((?T ?e) . ?\x30c6)
-    ((?D ?e) . ?\x30c7)
-    ((?T ?o) . ?\x30c8)
-    ((?D ?o) . ?\x30c9)
-    ((?N ?a) . ?\x30ca)
-    ((?N ?i) . ?\x30cb)
-    ((?N ?u) . ?\x30cc)
-    ((?N ?e) . ?\x30cd)
-    ((?N ?o) . ?\x30ce)
-    ((?H ?a) . ?\x30cf)
-    ((?B ?a) . ?\x30d0)
-    ((?P ?a) . ?\x30d1)
-    ((?H ?i) . ?\x30d2)
-    ((?B ?i) . ?\x30d3)
-    ((?P ?i) . ?\x30d4)
-    ((?H ?u) . ?\x30d5)
-    ((?B ?u) . ?\x30d6)
-    ((?P ?u) . ?\x30d7)
-    ((?H ?e) . ?\x30d8)
-    ((?B ?e) . ?\x30d9)
-    ((?P ?e) . ?\x30da)
-    ((?H ?o) . ?\x30db)
-    ((?B ?o) . ?\x30dc)
-    ((?P ?o) . ?\x30dd)
-    ((?u ?R) . ?\x2515)
-    ((?U ?r) . ?\x2516)
-    ((?U ?R) . ?\x2517)
-    ((?u ?l) . ?\x2518)
-    ((?u ?L) . ?\x2519)
-    ((?U ?l) . ?\x251a)
-    ((?U ?L) . ?\x251b)
-    ((?v ?r) . ?\x251c)
-    ((?v ?R) . ?\x251d)
-    ((?V ?r) . ?\x2520)
-    ((?V ?R) . ?\x2523)
-    ((?v ?l) . ?\x2524)
-    ((?v ?L) . ?\x2525)
-    ((?V ?l) . ?\x2528)
-    ((?V ?L) . ?\x252b)
-    ((?d ?h) . ?\x252c)
-    ((?d ?H) . ?\x252f)
-    ((?D ?h) . ?\x2530)
-    ((?D ?H) . ?\x2533)
-    ((?u ?h) . ?\x2534)
-    ((?u ?H) . ?\x2537)
-    ((?U ?h) . ?\x2538)
-    ((?U ?H) . ?\x253b)
-    ((?v ?h) . ?\x253c)
-    ((?v ?H) . ?\x253f)
-    ((?V ?h) . ?\x2542)
-    ((?V ?H) . ?\x254b)
-    ((?F ?D) . ?\x2571)
-    ((?B ?D) . ?\x2572)
-    ((?T ?B) . ?\x2580)
-    ((?L ?B) . ?\x2584)
-    ((?F ?B) . ?\x2588)
-    ((?l ?B) . ?\x258c)
-    ((?R ?B) . ?\x2590)
-    ((?. ?S) . ?\x2591)
-    ((?: ?S) . ?\x2592)
-    ((?? ?S) . ?\x2593)
-    ((?f ?S) . ?\x25a0)
-    ((?O ?S) . ?\x25a1)
-    ((?R ?O) . ?\x25a2)
-    ((?R ?r) . ?\x25a3)
-    ((?R ?F) . ?\x25a4)
-    ((?R ?Y) . ?\x25a5)
-    ((?R ?H) . ?\x25a6)
-    ((?R ?Z) . ?\x25a7)
-    ((?R ?K) . ?\x25a8)
-    ((?R ?X) . ?\x25a9)
-    ((?s ?B) . ?\x25aa)
-    ((?S ?R) . ?\x25ac)
-    ((?O ?r) . ?\x25ad)
-    ((?U ?T) . ?\x25b2)
-    ((?u ?T) . ?\x25b3)
-    ((?P ?R) . ?\x25b6)
-    ((?T ?r) . ?\x25b7)
-    ((?D ?t) . ?\x25bc)
-    ((?d ?T) . ?\x25bd)
-    ((?P ?L) . ?\x25c0)
-    ((?T ?l) . ?\x25c1)
-    ((?D ?b) . ?\x25c6)
-    ((?D ?w) . ?\x25c7)
-    ((?L ?Z) . ?\x25ca)
-    ((?0 ?m) . ?\x25cb)
-    ((?0 ?o) . ?\x25ce)
-    ((?0 ?M) . ?\x25cf)
-    ((?0 ?L) . ?\x25d0)
-    ((?0 ?R) . ?\x25d1)
-    ((?S ?n) . ?\x25d8)
-    ((?I ?c) . ?\x25d9)
-    ((?F ?d) . ?\x25e2)
-    ((?B ?d) . ?\x25e3)
-    ((?* ?2) . ?\x2605)
-    ((?* ?1) . ?\x2606)
-    ((?< ?H) . ?\x261c)
-    ((?> ?H) . ?\x261e)
-    ((?0 ?u) . ?\x263a)
-    ((?0 ?U) . ?\x263b)
-    ((?S ?U) . ?\x263c)
-    ((?F ?m) . ?\x2640)
-    ((?M ?l) . ?\x2642)
-    ((?c ?S) . ?\x2660)
-    ((?c ?H) . ?\x2661)
-    ((?c ?D) . ?\x2662)
-    ((?c ?C) . ?\x2663)
-    ((?M ?d) . ?\x2669)
-    ((?M ?8) . ?\x266a)
-    ((?M ?2) . ?\x266b)
-    ((?M ?b) . ?\x266d)
-    ((?M ?x) . ?\x266e)
-    ((?M ?X) . ?\x266f)
-    ((?O ?K) . ?\x2713)
-    ((?X ?X) . ?\x2717)
-    ((?- ?X) . ?\x2720)
-    ((?I ?S) . ?\x3000)
-    ((?, ?_) . ?\x3001)
-    ((?. ?_) . ?\x3002)
-    ((?+ ?\") . ?\x3003)
-    ((?+ ?_) . ?\x3004)
-    ((?* ?_) . ?\x3005)
-    ((?\; ?_) . ?\x3006)
-    ((?0 ?_) . ?\x3007)
-    ((?< ?+) . ?\x300a)
-    ((?> ?+) . ?\x300b)
-    ((?< ?') . ?\x300c)
-    ((?> ?') . ?\x300d)
-    ((?< ?\") . ?\x300e)
-    ((?> ?\") . ?\x300f)
-    ((?\( ?\") . ?\x3010)
-    ((?\) ?\") . ?\x3011)
-    ((?= ?T) . ?\x3012)
-    ((?= ?_) . ?\x3013)
-    ((?\( ?') . ?\x3014)
-    ((?\) ?') . ?\x3015)
-    ((?\( ?I) . ?\x3016)
-    ((?\) ?I) . ?\x3017)
-    ((?- ??) . ?\x301c)
-    ((?A ?5) . ?\x3041)
-    ((?a ?5) . ?\x3042)
-    ((?I ?5) . ?\x3043)
-    ((?i ?5) . ?\x3044)
-    ((?U ?5) . ?\x3045)
-    ((?u ?5) . ?\x3046)
-    ((?E ?5) . ?\x3047)
-    ((?e ?5) . ?\x3048)
-    ((?O ?5) . ?\x3049)
-    ((?o ?5) . ?\x304a)
-    ((?k ?a) . ?\x304b)
-    ((?g ?a) . ?\x304c)
-    ((?k ?i) . ?\x304d)
-    ((?g ?i) . ?\x304e)
-    ((?k ?u) . ?\x304f)
-    ((?g ?u) . ?\x3050)
-    ((?k ?e) . ?\x3051)
-    ((?g ?e) . ?\x3052)
-    ((?k ?o) . ?\x3053)
-    ((?g ?o) . ?\x3054)
-    ((?s ?a) . ?\x3055)
-    ((?z ?a) . ?\x3056)
-    ((?s ?i) . ?\x3057)
-    ((?z ?i) . ?\x3058)
-    ((?s ?u) . ?\x3059)
-    ((?z ?u) . ?\x305a)
-    ((?s ?e) . ?\x305b)
-    ((?z ?e) . ?\x305c)
-    ((?s ?o) . ?\x305d)
-    ((?z ?o) . ?\x305e)
-    ((?t ?a) . ?\x305f)
-    ((?d ?a) . ?\x3060)
-    ((?t ?i) . ?\x3061)
-    ((?d ?i) . ?\x3062)
-    ((?t ?U) . ?\x3063)
-    ((?t ?u) . ?\x3064)
-    ((?d ?u) . ?\x3065)
-    ((?t ?e) . ?\x3066)
-    ((?d ?e) . ?\x3067)
-    ((?t ?o) . ?\x3068)
-    ((?d ?o) . ?\x3069)
-    ((?n ?a) . ?\x306a)
-    ((?n ?i) . ?\x306b)
-    ((?n ?u) . ?\x306c)
-    ((?n ?e) . ?\x306d)
-    ((?n ?o) . ?\x306e)
-    ((?h ?a) . ?\x306f)
-    ((?b ?a) . ?\x3070)
-    ((?p ?a) . ?\x3071)
-    ((?h ?i) . ?\x3072)
-    ((?b ?i) . ?\x3073)
-    ((?p ?i) . ?\x3074)
-    ((?h ?u) . ?\x3075)
-    ((?b ?u) . ?\x3076)
-    ((?p ?u) . ?\x3077)
-    ((?h ?e) . ?\x3078)
-    ((?b ?e) . ?\x3079)
-    ((?p ?e) . ?\x307a)
-    ((?h ?o) . ?\x307b)
-    ((?b ?o) . ?\x307c)
-    ((?p ?o) . ?\x307d)
-    ((?m ?a) . ?\x307e)
-    ((?m ?i) . ?\x307f)
-    ((?m ?u) . ?\x3080)
-    ((?m ?e) . ?\x3081)
-    ((?m ?o) . ?\x3082)
-    ((?y ?A) . ?\x3083)
-    ((?y ?a) . ?\x3084)
-    ((?y ?U) . ?\x3085)
-    ((?y ?u) . ?\x3086)
-    ((?y ?O) . ?\x3087)
-    ((?y ?o) . ?\x3088)
-    ((?r ?a) . ?\x3089)
-    ((?r ?i) . ?\x308a)
-    ((?r ?u) . ?\x308b)
-    ((?r ?e) . ?\x308c)
-    ((?r ?o) . ?\x308d)
-    ((?w ?A) . ?\x308e)
-    ((?w ?a) . ?\x308f)
-    ((?w ?i) . ?\x3090)
-    ((?w ?e) . ?\x3091)
-    ((?w ?o) . ?\x3092)
-    ((?n ?5) . ?\x3093)
-    ((?v ?u) . ?\x3094)
-    ((?\" ?5) . ?\x309b)
-    ((?0 ?5) . ?\x309c)
-    ((?* ?5) . ?\x309d)
-    ((?+ ?5) . ?\x309e)
-    ((?a ?6) . ?\x30a1)
-    ((?A ?6) . ?\x30a2)
-    ((?i ?6) . ?\x30a3)
-    ((?I ?6) . ?\x30a4)
-    ((?u ?6) . ?\x30a5)
-    ((?U ?6) . ?\x30a6)
-    ((?e ?6) . ?\x30a7)
-    ((?E ?6) . ?\x30a8)
-    ((?o ?6) . ?\x30a9)
-    ((?O ?6) . ?\x30aa)
-    ((?K ?a) . ?\x30ab)
-    ((?G ?a) . ?\x30ac)
-    ((?K ?i) . ?\x30ad)
-    ((?G ?i) . ?\x30ae)
-    ((?K ?u) . ?\x30af)
-    ((?G ?u) . ?\x30b0)
-    ((?K ?e) . ?\x30b1)
-    ((?G ?e) . ?\x30b2)
-    ((?K ?o) . ?\x30b3)
-    ((?G ?o) . ?\x30b4)
-    ((?S ?a) . ?\x30b5)
-    ((?Z ?a) . ?\x30b6)
-    ((?S ?i) . ?\x30b7)
-    ((?Z ?i) . ?\x30b8)
-    ((?S ?u) . ?\x30b9)
-    ((?Z ?u) . ?\x30ba)
-    ((?S ?e) . ?\x30bb)
-    ((?Z ?e) . ?\x30bc)
-    ((?S ?o) . ?\x30bd)
-    ((?Z ?o) . ?\x30be)
-    ((?T ?a) . ?\x30bf)
-    ((?D ?a) . ?\x30c0)
-    ((?T ?i) . ?\x30c1)
-    ((?D ?i) . ?\x30c2)
-    ((?T ?U) . ?\x30c3)
-    ((?T ?u) . ?\x30c4)
-    ((?D ?u) . ?\x30c5)
-    ((?T ?e) . ?\x30c6)
-    ((?D ?e) . ?\x30c7)
-    ((?T ?o) . ?\x30c8)
-    ((?D ?o) . ?\x30c9)
-    ((?N ?a) . ?\x30ca)
-    ((?N ?i) . ?\x30cb)
-    ((?N ?u) . ?\x30cc)
-    ((?N ?e) . ?\x30cd)
-    ((?N ?o) . ?\x30ce)
-    ((?H ?a) . ?\x30cf)
-    ((?B ?a) . ?\x30d0)
-    ((?P ?a) . ?\x30d1)
-    ((?H ?i) . ?\x30d2)
-    ((?B ?i) . ?\x30d3)
-    ((?P ?i) . ?\x30d4)
-    ((?H ?u) . ?\x30d5)
-    ((?B ?u) . ?\x30d6)
-    ((?P ?u) . ?\x30d7)
-    ((?H ?e) . ?\x30d8)
-    ((?B ?e) . ?\x30d9)
-    ((?P ?e) . ?\x30da)
-    ((?H ?o) . ?\x30db)
-    ((?B ?o) . ?\x30dc)
-    ((?P ?o) . ?\x30dd)
-    ((?M ?a) . ?\x30de)
-    ((?M ?i) . ?\x30df)
-    ((?M ?u) . ?\x30e0)
-    ((?M ?e) . ?\x30e1)
-    ((?M ?o) . ?\x30e2)
-    ((?Y ?A) . ?\x30e3)
-    ((?Y ?a) . ?\x30e4)
-    ((?Y ?U) . ?\x30e5)
-    ((?Y ?u) . ?\x30e6)
-    ((?Y ?O) . ?\x30e7)
-    ((?Y ?o) . ?\x30e8)
-    ((?R ?a) . ?\x30e9)
-    ((?R ?i) . ?\x30ea)
-    ((?R ?u) . ?\x30eb)
-    ((?R ?e) . ?\x30ec)
-    ((?R ?o) . ?\x30ed)
-    ((?W ?A) . ?\x30ee)
-    ((?W ?a) . ?\x30ef)
-    ((?W ?i) . ?\x30f0)
-    ((?W ?e) . ?\x30f1)
-    ((?W ?o) . ?\x30f2)
-    ((?N ?6) . ?\x30f3)
-    ((?V ?u) . ?\x30f4)
-    ((?K ?A) . ?\x30f5)
-    ((?K ?E) . ?\x30f6)
-    ((?V ?a) . ?\x30f7)
-    ((?V ?i) . ?\x30f8)
-    ((?V ?e) . ?\x30f9)
-    ((?V ?o) . ?\x30fa)
-    ((?. ?6) . ?\x30fb)
-    ((?- ?6) . ?\x30fc)
-    ((?* ?6) . ?\x30fd)
-    ((?+ ?6) . ?\x30fe)
-    ((?b ?4) . ?\x3105)
-    ((?p ?4) . ?\x3106)
-    ((?m ?4) . ?\x3107)
-    ((?f ?4) . ?\x3108)
-    ((?d ?4) . ?\x3109)
-    ((?t ?4) . ?\x310a)
-    ((?n ?4) . ?\x310b)
-    ((?l ?4) . ?\x310c)
-    ((?g ?4) . ?\x310d)
-    ((?k ?4) . ?\x310e)
-    ((?h ?4) . ?\x310f)
-    ((?j ?4) . ?\x3110)
-    ((?q ?4) . ?\x3111)
-    ((?x ?4) . ?\x3112)
-    ((?z ?h) . ?\x3113)
-    ((?c ?h) . ?\x3114)
-    ((?s ?h) . ?\x3115)
-    ((?r ?4) . ?\x3116)
-    ((?z ?4) . ?\x3117)
-    ((?c ?4) . ?\x3118)
-    ((?s ?4) . ?\x3119)
-    ((?a ?4) . ?\x311a)
-    ((?o ?4) . ?\x311b)
-    ((?e ?4) . ?\x311c)
-    ((?a ?i) . ?\x311e)
-    ((?e ?i) . ?\x311f)
-    ((?a ?u) . ?\x3120)
-    ((?o ?u) . ?\x3121)
-    ((?a ?n) . ?\x3122)
-    ((?e ?n) . ?\x3123)
-    ((?a ?N) . ?\x3124)
-    ((?e ?N) . ?\x3125)
-    ((?e ?r) . ?\x3126)
-    ((?i ?4) . ?\x3127)
-    ((?u ?4) . ?\x3128)
-    ((?i ?u) . ?\x3129)
-    ((?v ?4) . ?\x312a)
-    ((?n ?G) . ?\x312b)
-    ((?g ?n) . ?\x312c)
-    ((?1 ?c) . ?\x3220)
-    ((?2 ?c) . ?\x3221)
-    ((?3 ?c) . ?\x3222)
-    ((?4 ?c) . ?\x3223)
-    ((?5 ?c) . ?\x3224)
-    ((?6 ?c) . ?\x3225)
-    ((?7 ?c) . ?\x3226)
-    ((?8 ?c) . ?\x3227)
-    ((?9 ?c) . ?\x3228)
-    ((?\s ?\s) . ?\xe000)
-    ((?/ ?c) . ?\xe001)
-    ((?U ?A) . ?\xe002)
-    ((?U ?B) . ?\xe003)
-    ((?\" ?3) . ?\xe004)
-    ((?\" ?1) . ?\xe005)
-    ((?\" ?!) . ?\xe006)
-    ((?\" ?') . ?\xe007)
-    ((?\" ?>) . ?\xe008)
-    ((?\" ??) . ?\xe009)
-    ((?\" ?-) . ?\xe00a)
-    ((?\" ?\() . ?\xe00b)
-    ((?\" ?.) . ?\xe00c)
-    ((?\" ?:) . ?\xe00d)
-    ((?\" ?0) . ?\xe00e)
-    ((?\" ?\") . ?\xe00f)
-    ((?\" ?<) . ?\xe010)
-    ((?\" ?,) . ?\xe011)
-    ((?\" ?\;) . ?\xe012)
-    ((?\" ?_) . ?\xe013)
-    ((?\" ?=) . ?\xe014)
-    ((?\" ?/) . ?\xe015)
-    ((?\" ?i) . ?\xe016)
-    ((?\" ?d) . ?\xe017)
-    ((?\" ?p) . ?\xe018)
-    ((?\; ?\;) . ?\xe019)
-    ((?, ?,) . ?\xe01a)
-    ((?b ?3) . ?\xe01b)
-    ((?C ?i) . ?\xe01c)
-    ((?f ?\() . ?\xe01d)
-    ((?e ?d) . ?\xe01e)
-    ((?a ?m) . ?\xe01f)
-    ((?p ?m) . ?\xe020)
-    ((?F ?l) . ?\xe023)
-    ((?G ?F) . ?\xe024)
-    ((?> ?V) . ?\xe025)
-    ((?! ?*) . ?\xe026)
-    ((?? ?*) . ?\xe027)
-    ((?J ?<) . ?\xe028)
-    ((?f ?f) . ?\xfb00)
-    ((?f ?i) . ?\xfb01)
-    ((?f ?l) . ?\xfb02)
-    ((?f ?t) . ?\xfb05)
-    ((?s ?t) . ?\xfb06)
-    ((?~ ?!) . ?\x00a1)
-    ((?c ?|) . ?\x00a2)
-    ((?$ ?$) . ?\x00a3)
-    ((?o ?x) . ?\x00a4)
-    ((?Y ?-) . ?\x00a5)
-    ((?| ?|) . ?\x00a6)
-    ((?c ?O) . ?\x00a9)
-    ((?- ?,) . ?\x00ac)
-    ((?- ?=) . ?\x00af)
-    ((?~ ?o) . ?\x00b0)
-    ((?2 ?2) . ?\x00b2)
-    ((?3 ?3) . ?\x00b3)
-    ((?p ?p) . ?\x00b6)
-    ((?~ ?.) . ?\x00b7)
-    ((?1 ?1) . ?\x00b9)
-    ((?~ ??) . ?\x00bf)
-    ((?A ?`) . ?\x00c0)
-    ((?A ?^) . ?\x00c2)
-    ((?A ?~) . ?\x00c3)
-    ((?A ?\") . ?\x00c4)
-    ((?A ?@) . ?\x00c5)
-    ((?E ?`) . ?\x00c8)
-    ((?E ?^) . ?\x00ca)
-    ((?E ?\") . ?\x00cb)
-    ((?I ?`) . ?\x00cc)
-    ((?I ?^) . ?\x00ce)
-    ((?I ?\") . ?\x00cf)
-    ((?N ?~) . ?\x00d1)
-    ((?O ?`) . ?\x00d2)
-    ((?O ?^) . ?\x00d4)
-    ((?O ?~) . ?\x00d5)
-    ((?/ ?\\) . ?\x00d7)
-    ((?U ?`) . ?\x00d9)
-    ((?U ?^) . ?\x00db)
-    ((?I ?p) . ?\x00de)
-    ((?a ?`) . ?\x00e0)
-    ((?a ?^) . ?\x00e2)
-    ((?a ?~) . ?\x00e3)
-    ((?a ?\") . ?\x00e4)
-    ((?a ?@) . ?\x00e5)
-    ((?e ?`) . ?\x00e8)
-    ((?e ?^) . ?\x00ea)
-    ((?e ?\") . ?\x00eb)
-    ((?i ?`) . ?\x00ec)
-    ((?i ?^) . ?\x00ee)
-    ((?n ?~) . ?\x00f1)
-    ((?o ?`) . ?\x00f2)
-    ((?o ?^) . ?\x00f4)
-    ((?o ?~) . ?\x00f5)
-    ((?u ?`) . ?\x00f9)
-    ((?u ?^) . ?\x00fb)
-    ((?y ?\") . ?\x00ff))
-  "Table of default digraphs.
-This includes all digraphs defined in RFC 1345,
-as well as miscellaneous digraphs for multi-byte characters.
-See also `evil-digraphs-table-user'.")
-
-(defun evil-digraph (digraph)
-  "Convert DIGRAPH to character or list representation.
-If DIGRAPH is a list (CHAR1 CHAR2), return the corresponding character;
-if DIGRAPH is a character, return the corresponding list.
-Searches in `evil-digraphs-table-user' and `evil-digraphs-table'."
-  (if (listp digraph)
-      (let* ((char1 (car digraph))
-             (char2 (cadr digraph)))
-        (or (cdr (assoc (list char1 char2) evil-digraphs-table-user))
-            (cdr (assoc (list char1 char2) evil-digraphs-table))
-            (unless (eq char1 char2)
-              (or (cdr (assoc (list char2 char1) evil-digraphs-table-user))
-                  (cdr (assoc (list char2 char1) evil-digraphs-table))))))
-    (or (car (rassoc digraph evil-digraphs-table-user))
-        (car (rassoc digraph evil-digraphs-table)))))
-
-(provide 'evil-digraphs)
-
-;;; evil-digraphs.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-digraphs.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-ex.el
@@ -1,1157 +0,0 @@
-;;; evil-ex.el --- Ex-mode
-
-;; Author: Frank Fischer <frank fischer at mathematik.tu-chemnitz.de>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Ex is implemented as an extensible minilanguage, whose grammar
-;; is stored in `evil-ex-grammar'.  Ex commands are defined with
-;; `evil-ex-define-cmd', which creates a binding from a string
-;; to an interactive function.  It is also possible to define key
-;; sequences which execute a command immediately when entered:
-;; such shortcuts go in `evil-ex-map'.
-;;
-;; To provide buffer and filename completion, as well as interactive
-;; feedback, Ex defines the concept of an argument handler, specified
-;; with `evil-ex-define-argument-type'.  In the case of the
-;; substitution command (":s/foo/bar"), the handler incrementally
-;; highlights matches in the buffer as the substitution is typed.
-
-(require 'evil-common)
-(require 'evil-states)
-(require 'shell)
-
-;;; Code:
-
-(defconst evil-ex-grammar
-  '((expression
-     (count command argument #'evil-ex-call-command)
-     ((\? range) command argument #'evil-ex-call-command)
-     (line #'evil-goto-line)
-     (sexp #'eval-expression))
-    (count
-     number)
-    (command #'evil-ex-parse-command)
-    (binding
-     "[~&*@<>=:]+\\|[[:alpha:]-]+\\|!")
-    (emacs-binding
-     "[[:alpha:]-][[:alnum:][:punct:]-]+")
-    (bang
-     (\? (! space) "!" #'$1))
-    (argument
-     ((\? space) (\? "\\(?:.\\|\n\\)+") #'$2))
-    (range
-     ("%" #'(evil-ex-full-range))
-     (line ";" line #'(let ((tmp1 $1))
-                        (save-excursion
-                          (goto-line tmp1)
-                          (evil-ex-range tmp1 $3))))
-     (line "," line #'(evil-ex-range $1 $3))
-     (line #'(evil-ex-range $1 nil))
-     ("`" "[-a-zA-Z_<>']" ",`" "[-a-zA-Z_<>']"
-      #'(evil-ex-char-marker-range $2 $4)))
-    (line
-     (base (\? offset) search (\? offset)
-           #'(let ((tmp (evil-ex-line $1 $2)))
-               (save-excursion
-                 (goto-line tmp)
-                 (evil-ex-line $3 $4))))
-     ((\? base) offset search (\? offset)
-      #'(let ((tmp (evil-ex-line $1 $2)))
-          (save-excursion
-            (goto-line tmp)
-            (evil-ex-line $3 $4))))
-     (base (\? offset) #'evil-ex-line)
-     ((\? base) offset #'evil-ex-line))
-    (base
-     number
-     marker
-     search
-     ("\\^" #'(evil-ex-first-line))
-     ("\\$" #'(evil-ex-last-line))
-     ("\\." #'(evil-ex-current-line)))
-    (offset
-     (+ signed-number #'+))
-    (marker
-     ("'" "[-a-zA-Z_<>']" #'(evil-ex-marker $2)))
-    (search
-     forward
-     backward
-     next
-     prev
-     subst)
-    (forward
-     ("/" "\\(?:[\\].\\|[^/,; ]\\)+" (! "/")
-      #'(evil-ex-re-fwd $2))
-     ("/" "\\(?:[\\].\\|[^/]\\)+" "/"
-      #'(evil-ex-re-fwd $2)))
-    (backward
-     ("\\?" "\\(?:[\\].\\|[^?,; ]\\)+" (! "\\?")
-      #'(evil-ex-re-bwd $2))
-     ("\\?" "\\(?:[\\].\\|[^?]\\)+" "\\?"
-      #'(evil-ex-re-bwd $2)))
-    (next
-     "\\\\/" #'(evil-ex-prev-search))
-    (prev
-     "\\\\\\?" #'(evil-ex-prev-search))
-    (subst
-     "\\\\&" #'(evil-ex-prev-search))
-    (signed-number
-     (sign (\? number) #'evil-ex-signed-number))
-    (sign
-     "\\+\\|-" #'intern)
-    (number
-     "[0-9]+" #'string-to-number)
-    (space
-     "[ ]+")
-    (sexp
-     "(.*)" #'(car-safe (read-from-string $1))))
-  "Grammar for Ex.
-An association list of syntactic symbols and their definitions.
-The first entry is the start symbol.  A symbol's definition may
-reference other symbols, but the grammar cannot contain
-left recursion.  See `evil-parser' for a detailed explanation
-of the syntax.")
-
-(defvar evil-ex-echo-overlay nil
-  "Overlay used for displaying info messages during ex.")
-
-(defun evil-ex-p ()
-  "Whether Ex is currently active."
-  (and evil-ex-current-buffer t))
-
-(evil-define-command evil-ex (&optional initial-input)
-  "Enter an Ex command.
-The ex command line is initialized with the value of
-INITIAL-INPUT. If the command is called interactively the initial
-input depends on the current state. If the current state is
-normal state and no count argument is given then the initial
-input is empty. If a prefix count is given the initial input is
-.,.+count. If the current state is visual state then the initial
-input is the visual region '<,'> or `<,`>. If the value of the
-global variable `evil-ex-initial-input' is non-nil, its content
-is appended to the line."
-  :keep-visual t
-  :repeat abort
-  (interactive
-   (list
-    (let ((s (concat
-              (cond
-               ((and (evil-visual-state-p)
-                     evil-ex-visual-char-range
-                     (memq (evil-visual-type) '(inclusive exclusive)))
-                "`<,`>")
-               ((evil-visual-state-p)
-                "'<,'>")
-               (current-prefix-arg
-                (let ((arg (prefix-numeric-value current-prefix-arg)))
-                  (cond ((< arg 0) (setq arg (1+ arg)))
-                        ((> arg 0) (setq arg (1- arg))))
-                  (if (= arg 0) '(".")
-                    (format ".,.%+d" arg)))))
-              evil-ex-initial-input)))
-      (and (> (length s) 0) s))))
-  (let ((evil-ex-current-buffer (current-buffer))
-        (evil-ex-previous-command (unless initial-input
-                                    (car-safe evil-ex-history)))
-        evil-ex-argument-handler
-        evil-ex-info-string
-        result)
-    (minibuffer-with-setup-hook
-        #'evil-ex-setup
-      (setq result
-            (read-from-minibuffer
-             ":"
-             (or initial-input
-                 (and evil-ex-previous-command
-                      (propertize evil-ex-previous-command 'face 'shadow)))
-             evil-ex-completion-map
-             nil
-             'evil-ex-history
-             evil-ex-previous-command
-             t)))
-    (evil-ex-execute result)))
-
-(defun evil-ex-execute (result)
-  "Execute RESULT as an ex command on `evil-ex-current-buffer'."
-  ;; empty input means repeating the previous command
-  (when (zerop (length result))
-    (setq result evil-ex-previous-command))
-  ;; parse data
-  (evil-ex-update nil nil nil result)
-  ;; execute command
-  (unless (zerop (length result))
-    (if evil-ex-expression
-        (eval evil-ex-expression)
-      (user-error "Ex: syntax error"))))
-
-(defun evil-ex-delete-backward-char ()
-  "Close the minibuffer if it is empty.
-Otherwise behaves like `delete-backward-char'."
-  (interactive)
-  (call-interactively
-   (if (zerop (length (minibuffer-contents)))
-       #'abort-recursive-edit
-     #'delete-backward-char)))
-
-(defun evil-ex-abort ()
-  "Cancel ex state when another buffer is selected."
-  (unless (minibufferp)
-    (abort-recursive-edit)))
-
-(defun evil-ex-setup ()
-  "Initialize Ex minibuffer.
-This function registers several hooks that are used for the
-interactive actions during ex state."
-  (add-hook 'post-command-hook #'evil-ex-abort)
-  (add-hook 'after-change-functions #'evil-ex-update nil t)
-  (add-hook 'minibuffer-exit-hook #'evil-ex-teardown)
-  (when evil-ex-previous-command
-    (add-hook 'pre-command-hook #'evil-ex-remove-default))
-  (remove-hook 'minibuffer-setup-hook #'evil-ex-setup)
-  (with-no-warnings
-    (make-variable-buffer-local 'completion-at-point-functions))
-  (setq completion-at-point-functions
-        '(evil-ex-command-completion-at-point
-          evil-ex-argument-completion-at-point)))
-(put 'evil-ex-setup 'permanent-local-hook t)
-
-(defun evil-ex-teardown ()
-  "Deinitialize Ex minibuffer.
-Clean up everything set up by `evil-ex-setup'."
-  (remove-hook 'post-command-hook #'evil-ex-abort)
-  (remove-hook 'minibuffer-exit-hook #'evil-ex-teardown)
-  (remove-hook 'after-change-functions #'evil-ex-update t)
-  (when evil-ex-argument-handler
-    (let ((runner (evil-ex-argument-handler-runner
-                   evil-ex-argument-handler)))
-      (when runner
-        (funcall runner 'stop)))))
-(put 'evil-ex-teardown 'permanent-local-hook t)
-
-(defun evil-ex-remove-default ()
-  "Remove the default text shown in the ex minibuffer.
-When ex starts, the previous command is shown enclosed in
-parenthesis. This function removes this text when the first key
-is pressed."
-  (when (and (not (eq this-command 'exit-minibuffer))
-             (/= (minibuffer-prompt-end) (point-max)))
-    (if (eq this-command 'evil-ex-delete-backward-char)
-        (setq this-command 'ignore))
-    (delete-minibuffer-contents))
-  (remove-hook 'pre-command-hook #'evil-ex-remove-default))
-(put 'evil-ex-remove-default 'permanent-local-hook t)
-
-(defun evil-ex-update (&optional beg end len string)
-  "Update Ex variables when the minibuffer changes.
-This function is usually called from `after-change-functions'
-hook. If BEG is non-nil (which is the case when called from
-`after-change-functions'), then an error description is shown
-in case of incomplete or unknown commands."
-  (let* ((prompt (minibuffer-prompt-end))
-         (string (or string (buffer-substring prompt (point-max))))
-         arg bang cmd count expr func handler range tree type)
-    (cond
-     ((and (eq this-command #'self-insert-command)
-           (commandp (setq cmd (lookup-key evil-ex-map string))))
-      (setq evil-ex-expression `(call-interactively #',cmd))
-      (when (minibufferp)
-        (exit-minibuffer)))
-     (t
-      (setq cmd nil)
-      ;; store the buffer position of each character
-      ;; as the `ex-index' text property
-      (dotimes (i (length string))
-        (add-text-properties
-         i (1+ i) (list 'ex-index (+ i prompt)) string))
-      (with-current-buffer evil-ex-current-buffer
-        (setq tree (evil-ex-parse string t)
-              expr (evil-ex-parse string))
-        (when (eq (car-safe expr) 'evil-ex-call-command)
-          (setq count (eval (nth 1 expr))
-                cmd (eval (nth 2 expr))
-                arg (eval (nth 3 expr))
-                range (cond
-                       ((evil-range-p count)
-                        count)
-                       ((numberp count)
-                        (evil-ex-range count count)))
-                bang (and (save-match-data (string-match ".!$" cmd)) t))))
-      (setq evil-ex-tree tree
-            evil-ex-expression expr
-            evil-ex-range range
-            evil-ex-cmd cmd
-            evil-ex-bang bang
-            evil-ex-argument arg)
-      ;; test the current command
-      (when (and cmd (minibufferp))
-        (setq func (evil-ex-completed-binding cmd t))
-        (cond
-         ;; update argument-handler
-         (func
-          (when (setq type (evil-get-command-property
-                            func :ex-arg))
-            (setq handler (cdr-safe
-                           (assoc type
-                                  evil-ex-argument-types))))
-          (unless (eq handler evil-ex-argument-handler)
-            (let ((runner (and evil-ex-argument-handler
-                               (evil-ex-argument-handler-runner
-                                evil-ex-argument-handler))))
-              (when runner (funcall runner 'stop)))
-            (setq evil-ex-argument-handler handler)
-            (let ((runner (and evil-ex-argument-handler
-                               (evil-ex-argument-handler-runner
-                                evil-ex-argument-handler))))
-              (when runner (funcall runner 'start evil-ex-argument))))
-          (let ((runner (and evil-ex-argument-handler
-                             (evil-ex-argument-handler-runner
-                              evil-ex-argument-handler))))
-            (when runner (funcall runner 'update evil-ex-argument))))
-         (beg
-          ;; show error message only when called from `after-change-functions'
-          (let ((n (length (all-completions cmd (evil-ex-completion-table)))))
-            (cond
-             ((> n 1) (evil-ex-echo "Incomplete command"))
-             ((= n 0) (evil-ex-echo "Unknown command")))))))))))
-(put 'evil-ex-update 'permanent-local-hook t)
-
-(defun evil-ex-echo (string &rest args)
-  "Display a message after the current Ex command."
-  (with-selected-window (minibuffer-window)
-    (with-current-buffer (window-buffer (minibuffer-window))
-      (unless (or evil-no-display
-                  (zerop (length string)))
-        (let ((string (format " [%s]" (apply #'format string args)))
-              (ov (or evil-ex-echo-overlay
-                      (setq evil-ex-echo-overlay (make-overlay (point-min) (point-max) nil t t))))
-              after-change-functions before-change-functions)
-          (put-text-property 0 (length string) 'face 'evil-ex-info string)
-          ;; The following 'trick' causes point to be shown before the
-          ;; message instead behind. It is shamelessly stolen from the
-          ;; implementation of `minibuffer-message`.
-          (put-text-property 0 1 'cursor t string)
-          (move-overlay ov (point-max) (point-max))
-          (overlay-put ov 'after-string string)
-          (add-hook 'pre-command-hook #'evil--ex-remove-echo-overlay nil t))))))
-
-(defun evil--ex-remove-echo-overlay ()
-  "Remove echo overlay from ex minibuffer."
-  (when evil-ex-echo-overlay
-    (delete-overlay evil-ex-echo-overlay)
-    (setq evil-ex-echo-overlay nil))
-  (remove-hook 'pre-command-hook 'evil--ex-remove-echo-overlay t))
-
-(defun evil-ex-completion ()
-  "Completes the current ex command or argument."
-  (interactive)
-  (let (after-change-functions)
-    (evil-ex-update)
-    (completion-at-point)
-    (remove-text-properties (minibuffer-prompt-end) (point-max) '(face nil evil))))
-
-(defun evil-ex-command-completion-at-point ()
-  (let ((context (evil-ex-syntactic-context (1- (point)))))
-    (when (memq 'command context)
-      (let ((beg (or (get-text-property 0 'ex-index evil-ex-cmd)
-                     (point)))
-            (end (1+ (or (get-text-property (1- (length evil-ex-cmd))
-                                            'ex-index
-                                            evil-ex-cmd)
-                         (1- (point))))))
-        (list beg end (evil-ex-completion-table))))))
-
-(defun evil-ex-completion-table ()
-  (cond
-   ((eq evil-ex-complete-emacs-commands nil)
-    #'evil-ex-command-collection)
-   ((eq evil-ex-complete-emacs-commands 'in-turn)
-    (completion-table-in-turn
-     #'evil-ex-command-collection
-     #'(lambda (str pred flag)
-         (completion-table-with-predicate
-          obarray #'commandp t str pred flag))))
-   (t
-    #'(lambda (str pred flag)
-        (evil-completion-table-concat
-         #'evil-ex-command-collection
-         #'(lambda (str pred flag)
-             (completion-table-with-predicate
-              obarray #'commandp t str pred flag))
-         str pred flag)))))
-
-(defun evil-completion-table-concat (table1 table2 string pred flag)
-  (cond
-   ((eq flag nil)
-    (let ((result1 (try-completion string table1 pred))
-          (result2 (try-completion string table2 pred)))
-      (cond
-       ((null result1) result2)
-       ((null result2) result1)
-       ((and (eq result1 t) (eq result2 t)) t)
-       (t result1))))
-   ((eq flag t)
-    (delete-dups
-     (append (all-completions string table1 pred)
-             (all-completions string table2 pred))))
-   ((eq flag 'lambda)
-    (and (or (eq t (test-completion string table1 pred))
-             (eq t (test-completion string table2 pred)))
-         t))
-   ((eq (car-safe flag) 'boundaries)
-    (or (completion-boundaries string table1 pred (cdr flag))
-        (completion-boundaries string table2 pred (cdr flag))))
-   ((eq flag 'metadata)
-    '(metadata (display-sort-function . evil-ex-sort-completions)))))
-
-(defun evil-ex-sort-completions (completions)
-  (sort completions
-        #'(lambda (str1 str2)
-            (let ((p1 (eq 'evil-ex-commands (get-text-property 0 'face str1)))
-                  (p2 (eq 'evil-ex-commands (get-text-property 0 'face str2))))
-              (if (equal p1 p2)
-                  (string< str1 str2)
-                p1)))))
-
-(defun evil-ex-command-collection (cmd predicate flag)
-  "Called to complete a command."
-  (let (commands)
-    ;; append ! to all commands that may take a bang argument
-    (dolist (cmd (mapcar #'car evil-ex-commands))
-      (push cmd commands)
-      (if (evil-ex-command-force-p cmd)
-          (push (concat cmd "!") commands)))
-    (when (eq evil-ex-complete-emacs-commands t)
-      (setq commands
-            (mapcar #'(lambda (str) (propertize str 'face 'evil-ex-commands))
-                    commands)))
-    (cond
-     ((eq flag nil) (try-completion cmd commands predicate))
-     ((eq flag t) (all-completions cmd commands predicate))
-     ((eq flag 'lambda) (test-completion cmd commands))
-     ((eq (car-safe flag) 'boundaries)
-      `(boundaries 0 . ,(length (cdr flag)))))))
-
-(defun evil-ex-argument-completion-at-point ()
-  (let ((context (evil-ex-syntactic-context (1- (point)))))
-    (when (memq 'argument context)
-      (let* ((beg (or (and evil-ex-argument
-                           (get-text-property 0 'ex-index evil-ex-argument))
-                      (point)))
-             (end (1+ (or (and evil-ex-argument
-                               (get-text-property (1- (length evil-ex-argument))
-                                                  'ex-index
-                                                  evil-ex-argument))
-                          (1- (point)))))
-             (binding (evil-ex-completed-binding evil-ex-cmd))
-             (arg-type (evil-get-command-property binding :ex-arg))
-             (arg-handler (assoc arg-type evil-ex-argument-types))
-             (completer (and arg-handler
-                             (evil-ex-argument-handler-completer
-                              (cdr arg-handler)))))
-        (when completer
-          (if (eq (car completer) 'collection)
-              (list beg end (cdr completer))
-            (save-restriction
-              (narrow-to-region beg (point-max))
-              (funcall (cdr completer)))))))))
-
-(defun evil-ex-define-cmd (cmd function)
-  "Binds the function FUNCTION to the command CMD."
-  (save-match-data
-    (if (string-match "^[^][]*\\(\\[\\(.*\\)\\]\\)[^][]*$" cmd)
-        (let ((abbrev (replace-match "" nil t cmd 1))
-              (full (replace-match "\\2" nil nil cmd 1)))
-          (evil-add-to-alist 'evil-ex-commands full function)
-          (evil-add-to-alist 'evil-ex-commands abbrev full))
-      (evil-add-to-alist 'evil-ex-commands cmd function))))
-
-(defun evil-ex-make-argument-handler (runner completer)
-  (list runner completer))
-
-(defun evil-ex-argument-handler-runner (arg-handler)
-  (car arg-handler))
-
-(defun evil-ex-argument-handler-completer (arg-handler)
-  (cadr arg-handler))
-
-(defmacro evil-ex-define-argument-type (arg-type doc &rest body)
-  "Defines a new handler for argument-type ARG-TYPE.
-DOC is the documentation string. It is followed by a list of
-keywords and function:
-
-:collection COLLECTION
-
-  A collection for completion as required by `all-completions'.
-
-:completion-at-point FUNC
-
-  Function to be called to initialize a potential
-  completion. FUNC must match the requirements as described for
-  the variable `completion-at-point-functions'. When FUNC is
-  called the minibuffer content is narrowed to exactly match the
-  argument.
-
-:runner FUNC
-
-  Function to be called when the type of the current argument
-  changes or when the content of this argument changes. This
-  function should take one obligatory argument FLAG followed by
-  an optional argument ARG. FLAG is one of three symbol 'start,
-  'stop or 'update. When the argument type is recognized for the
-  first time and this handler is started the FLAG is 'start. If
-  the argument type changes to something else or ex state
-  finished the handler FLAG is 'stop. If the content of the
-  argument has changed FLAG is 'update. If FLAG is either 'start
-  or 'update then ARG is the current value of this argument. If
-  FLAG is 'stop then arg is nil."
-  (declare (indent defun)
-           (debug (&define name
-                           [&optional stringp]
-                           [&rest [keywordp function-form]])))
-  (unless (stringp doc) (push doc body))
-  (let (runner completer)
-    (while (keywordp (car-safe body))
-      (let ((key (pop body))
-            (func (pop body)))
-        (cond
-         ((eq key :runner)
-          (setq runner func))
-         ((eq key :collection)
-          (setq completer (cons 'collection func)))
-         ((eq key :completion-at-point)
-          (setq completer (cons 'completion-at-point func))))))
-    `(eval-and-compile
-       (evil-add-to-alist
-        'evil-ex-argument-types
-        ',arg-type
-        '(,runner ,completer)))))
-
-(evil-ex-define-argument-type file
-  "Handles a file argument."
-  :collection read-file-name-internal)
-
-(evil-ex-define-argument-type buffer
-  "Called to complete a buffer name argument."
-  :collection internal-complete-buffer)
-
-(declare-function shell-completion-vars "shell" ())
-
-(defun evil-ex-init-shell-argument-completion (flag &optional arg)
-  "Prepares the current minibuffer for completion of shell commands.
-This function must be called from the :runner function of some
-argument handler that requires shell completion."
-  (when (and (eq flag 'start)
-             (not evil-ex-shell-argument-initialized))
-    (set (make-local-variable 'evil-ex-shell-argument-initialized) t)
-    (cond
-     ;; Emacs 24
-     ((fboundp 'comint-completion-at-point)
-      (shell-completion-vars))
-     (t
-      (set (make-local-variable 'minibuffer-default-add-function)
-           'minibuffer-default-add-shell-commands)))
-    (setq completion-at-point-functions
-          '(evil-ex-command-completion-at-point
-            evil-ex-argument-completion-at-point))))
-
-(define-obsolete-function-alias
-  'evil-ex-shell-command-completion-at-point
-  'comint-completion-at-point)
-
-(evil-ex-define-argument-type shell
-  "Shell argument type, supports completion."
-  :completion-at-point comint-completion-at-point
-  :runner evil-ex-init-shell-argument-completion)
-
-(defun evil-ex-file-or-shell-command-completion-at-point ()
-  (if (and (< (point-min) (point-max))
-           (= (char-after (point-min)) ?!))
-      (save-restriction
-        (narrow-to-region (1+ (point-min)) (point-max))
-        (comint-completion-at-point))
-    (list (point-min) (point-max) #'read-file-name-internal)))
-
-(evil-ex-define-argument-type file-or-shell
-  "File or shell argument type.
-If the current argument starts with a ! the rest of the argument
-is considered a shell command, otherwise a file-name. Completion
-works accordingly."
-  :completion-at-point evil-ex-file-or-shell-command-completion-at-point
-  :runner evil-ex-init-shell-argument-completion)
-
-(defun evil-ex-binding (command &optional noerror)
-  "Returns the final binding of COMMAND."
-  (save-match-data
-    (let ((binding command))
-      (when binding
-        (string-match "^\\(.+?\\)\\!?$" binding)
-        (setq binding (match-string 1 binding))
-        (while (progn
-                 (setq binding (cdr (assoc binding evil-ex-commands)))
-                 (stringp binding)))
-        (unless binding
-          (setq binding (intern command)))
-        (if (commandp binding)
-            ;; check for remaps
-            (or (command-remapping binding) binding)
-          (unless noerror
-            (user-error "Unknown command: `%s'" command)))))))
-
-(defun evil-ex-completed-binding (command &optional noerror)
-  "Returns the final binding of the completion of COMMAND."
-  (let ((completion (try-completion command evil-ex-commands)))
-    (evil-ex-binding (if (eq completion t) command
-                       (or completion command))
-                     noerror)))
-
-;;; TODO: extensions likes :p :~ <cfile> ...
-(defun evil-ex-replace-special-filenames (file-name)
-  "Replace special symbols in FILE-NAME.
-Replaces % by the current file-name,
-Replaces # by the alternate file-name in FILE-NAME."
-  (let ((current-fname (buffer-file-name))
-        (alternate-fname (and (other-buffer)
-                              (buffer-file-name (other-buffer)))))
-    (when current-fname
-      (setq file-name
-            (replace-regexp-in-string "\\(^\\|[^\\\\]\\)\\(%\\)"
-                                      current-fname file-name
-                                      t t 2)))
-    (when alternate-fname
-      (setq file-name
-            (replace-regexp-in-string "\\(^\\|[^\\\\]\\)\\(#\\)"
-                                      alternate-fname file-name
-                                      t t 2)))
-    (setq file-name
-          (replace-regexp-in-string "\\\\\\([#%]\\)"
-                                    "\\1" file-name t)))
-  file-name)
-
-(defun evil-ex-file-arg ()
-  "Returns the current Ex argument as a file name.
-This function interprets special file names like # and %."
-  (unless (or (null evil-ex-argument)
-              (zerop (length evil-ex-argument)))
-    (evil-ex-replace-special-filenames evil-ex-argument)))
-
-(defun evil-ex-repeat (count)
-  "Repeats the last ex command."
-  (interactive "P")
-  (when count
-    (goto-char (point-min))
-    (forward-line (1- count)))
-  (let ((evil-ex-current-buffer (current-buffer))
-        (hist evil-ex-history))
-    (while hist
-      (let ((evil-ex-last-cmd (pop hist)))
-        (when evil-ex-last-cmd
-          (evil-ex-update nil nil nil evil-ex-last-cmd)
-          (let ((binding (evil-ex-binding evil-ex-cmd)))
-            (unless (eq binding #'evil-ex-repeat)
-              (setq hist nil)
-              (if evil-ex-expression
-                  (eval evil-ex-expression)
-                (user-error "Ex: syntax error")))))))))
-
-(defun evil-ex-call-command (range command argument)
-  "Execute the given command COMMAND."
-  (let* ((count (when (numberp range) range))
-         (range (when (evil-range-p range) range))
-         (bang (and (save-match-data (string-match ".!$" command)) t))
-         (evil-ex-point (point))
-         (evil-ex-range
-          (or range (and count (evil-ex-range count count))))
-         (evil-ex-command (evil-ex-completed-binding command))
-         (evil-ex-bang (and bang t))
-         (evil-ex-argument (copy-sequence argument))
-         (evil-this-type (evil-type evil-ex-range))
-         (current-prefix-arg count)
-         (prefix-arg current-prefix-arg))
-    (when (stringp evil-ex-argument)
-      (set-text-properties
-       0 (length evil-ex-argument) nil evil-ex-argument))
-    (let ((buf (current-buffer)))
-      (unwind-protect
-          (cond
-           ((not evil-ex-range)
-            (setq this-command evil-ex-command)
-            (run-hooks 'pre-command-hook)
-            (call-interactively evil-ex-command)
-            (run-hooks 'post-command-hook))
-           (t
-            ;; set visual selection to match the region if an explicit
-            ;; range has been specified
-            (let ((ex-range (evil-copy-range evil-ex-range))
-                  beg end)
-              (evil-expand-range ex-range)
-              (setq beg (evil-range-beginning ex-range)
-                    end (evil-range-end ex-range))
-              (evil-sort beg end)
-              (setq this-command evil-ex-command)
-              (run-hooks 'pre-command-hook)
-              (set-mark end)
-              (goto-char beg)
-              (activate-mark)
-              (call-interactively evil-ex-command)
-              (run-hooks 'post-command-hook))))
-        (when (buffer-live-p buf)
-          (with-current-buffer buf
-            (deactivate-mark)))))))
-
-(defun evil-ex-line (base &optional offset)
-  "Return the line number of BASE plus OFFSET."
-  (+ (or base (line-number-at-pos))
-     (or offset 0)))
-
-(defun evil-ex-first-line ()
-  "Return the line number of the first line."
-  (line-number-at-pos (point-min)))
-
-(defun evil-ex-current-line ()
-  "Return the line number of the current line."
-  (line-number-at-pos (point)))
-
-(defun evil-ex-last-line ()
-  "Return the line number of the last line."
-  (save-excursion
-    (goto-char (point-max))
-    (when (bolp)
-      (forward-line -1))
-    (line-number-at-pos)))
-
-(defun evil-ex-range (beg-line &optional end-line)
-  "Returns the first and last position of the current range."
-  (evil-range
-   (evil-line-position beg-line)
-   (evil-line-position (or end-line beg-line) -1)
-   'line
-   :expanded t))
-
-(defun evil-ex-full-range ()
-  "Return a range encompassing the whole buffer."
-  (evil-range (point-min) (point-max) 'line))
-
-(defun evil-ex-marker (marker)
-  "Return MARKER's line number in the current buffer.
-Signal an error if MARKER is in a different buffer."
-  (when (stringp marker)
-    (setq marker (aref marker 0)))
-  (setq marker (evil-get-marker marker))
-  (if (numberp marker)
-      (line-number-at-pos marker)
-    (user-error "Ex does not support markers in other files")))
-
-(defun evil-ex-char-marker-range (beg end)
-  (when (stringp beg) (setq beg (aref beg 0)))
-  (when (stringp end) (setq end (aref end 0)))
-  (setq beg (evil-get-marker beg)
-        end (evil-get-marker end))
-  (if (and (numberp beg) (numberp end))
-      (evil-expand-range
-       (evil-range beg end
-                   (if (evil-visual-state-p)
-                       (evil-visual-type)
-                     'inclusive)))
-    (user-error "Ex does not support markers in other files")))
-
-(defun evil-ex-re-fwd (pattern)
-  "Search forward for PATTERN.
-Returns the line number of the match."
-  (condition-case err
-      (save-match-data
-        (save-excursion
-          (set-text-properties 0 (length pattern) nil pattern)
-          (evil-move-end-of-line)
-          (and (re-search-forward pattern nil t)
-               (line-number-at-pos (1- (match-end 0))))))
-    (invalid-regexp
-     (evil-ex-echo (cadr err))
-     nil)))
-
-(defun evil-ex-re-bwd (pattern)
-  "Search backward for PATTERN.
-Returns the line number of the match."
-  (condition-case err
-      (save-match-data
-        (save-excursion
-          (set-text-properties 0 (length pattern) nil pattern)
-          (evil-move-beginning-of-line)
-          (and (re-search-backward pattern nil t)
-               (line-number-at-pos (match-beginning 0)))))
-    (invalid-regexp
-     (evil-ex-echo (cadr err))
-     nil)))
-
-(defun evil-ex-prev-search ()
-  (error "Previous search not yet implemented"))
-
-(defun evil-ex-signed-number (sign &optional number)
-  "Return a signed number like -3 and +1.
-NUMBER defaults to 1."
-  (funcall sign (or number 1)))
-
-(defun evil-ex-eval (string &optional start)
-  "Evaluate STRING as an Ex command.
-START is the start symbol, which defaults to `expression'."
-  ;; disable the mark before executing, otherwise the visual region
-  ;; may be used as operator range instead of the ex-range
-  (let ((form (evil-ex-parse string nil start))
-        transient-mark-mode deactivate-mark)
-    (eval form)))
-
-(defun evil-ex-parse (string &optional syntax start)
-  "Parse STRING as an Ex expression and return an evaluation tree.
-If SYNTAX is non-nil, return a syntax tree instead.
-START is the start symbol, which defaults to `expression'."
-  (let* ((start (or start (car-safe (car-safe evil-ex-grammar))))
-         (match (evil-parser
-                 string start evil-ex-grammar t syntax)))
-    (car-safe match)))
-
-(defun evil-ex-parse-command (string)
-  "Parse STRING as an Ex binding."
-  (let ((result (evil-parser string 'binding evil-ex-grammar))
-        bang command)
-    (when result
-      (setq command (car-safe result)
-            string (cdr-safe result))
-      ;; check whether the parsed command is followed by a slash or
-      ;; number and the part before it is not a known ex binding
-      (when (and (> (length string) 0)
-                 (string-match-p "^[/[:digit:]]" string)
-                 (not (evil-ex-binding command t)))
-        ;; if this is the case, assume the slash or number and all
-        ;; following symbol characters form an (Emacs-)command
-        (setq result (evil-parser (concat command string)
-                                  'emacs-binding
-                                  evil-ex-grammar)
-              command (car-safe result)
-              string (cdr-safe result)))
-      ;; parse a following "!" as bang only if
-      ;; the command has the property :ex-bang t
-      (when (evil-ex-command-force-p command)
-        (setq result (evil-parser string 'bang evil-ex-grammar)
-              bang (or (car-safe result) "")
-              string (cdr-safe result)
-              command (concat command bang)))
-      (cons command string))))
-
-(defun evil-ex-command-force-p (command)
-  "Whether COMMAND accepts the bang argument."
-  (let ((binding (evil-ex-completed-binding command t)))
-    (when binding
-      (evil-get-command-property binding :ex-bang))))
-
-(defun evil-flatten-syntax-tree (tree)
-  "Find all paths from the root of TREE to its leaves.
-TREE is a syntax tree, i.e., all its leave nodes are strings.
-The `nth' element in the result is the syntactic context
-for the corresponding string index (counted from zero)."
-  (let* ((result nil)
-         (traverse nil)
-         (traverse
-          #'(lambda (tree path)
-              (if (stringp tree)
-                  (dotimes (char (length tree))
-                    (push path result))
-                (let ((path (cons (car tree) path)))
-                  (dolist (subtree (cdr tree))
-                    (funcall traverse subtree path)))))))
-    (funcall traverse tree nil)
-    (nreverse result)))
-
-(defun evil-ex-syntactic-context (&optional pos)
-  "Return the syntactical context of the character at POS.
-POS defaults to the current position of point."
-  (let* ((contexts (evil-flatten-syntax-tree evil-ex-tree))
-         (length (length contexts))
-         (pos (- (or pos (point)) (minibuffer-prompt-end))))
-    (when (>= pos length)
-      (setq pos (1- length)))
-    (when (< pos 0)
-      (setq pos 0))
-    (when contexts
-      (nth pos contexts))))
-
-(defun evil-parser (string symbol grammar &optional greedy syntax)
-  "Parse STRING as a SYMBOL in GRAMMAR.
-If GREEDY is non-nil, the whole of STRING must match.
-If the parse succeeds, the return value is a cons cell
-\(RESULT . TAIL), where RESULT is a parse tree and TAIL is
-the remainder of STRING. Otherwise, the return value is nil.
-
-GRAMMAR is an association list of symbols and their definitions.
-A definition is either a list of production rules, which are
-tried in succession, or a #'-quoted function, which is called
-to parse the input.
-
-A production rule can be one of the following:
-
-    nil matches the empty string.
-    A regular expression matches a substring.
-    A symbol matches a production for that symbol.
-    (X Y) matches X followed by Y.
-    (\\? X) matches zero or one of X.
-    (* X) matches zero or more of X.
-    (+ X) matches one or more of X.
-    (& X) matches X, but does not consume.
-    (! X) matches anything but X, but does not consume.
-
-Thus, a simple grammar may look like:
-
-    ((plus \"\\\\+\")           ; plus <- \"+\"
-     (minus \"-\")            ; minus <- \"-\"
-     (operator plus minus)) ; operator <- plus / minus
-
-All input-consuming rules have a value. A regular expression evaluates
-to the text matched, while a list evaluates to a list of values.
-The value of a list may be overridden with a semantic action, which is
-specified with a #'-quoted expression at the end:
-
-    (X Y #'foo)
-
-The value of this rule is the result of calling foo with the values
-of X and Y as arguments. Alternatively, the function call may be
-specified explicitly:
-
-    (X Y #'(foo $1 $2))
-
-Here, $1 refers to X and $2 refers to Y. $0 refers to the whole list.
-Dollar expressions can also be used directly:
-
-    (X Y #'$1)
-
-This matches X followed by Y, but ignores the value of Y;
-the value of the list is the same as the value of X.
-
-If the SYNTAX argument is non-nil, then all semantic actions
-are ignored, and a syntax tree is constructed instead. The
-syntax tree obeys the property that all the leave nodes are
-parts of the input string. Thus, by traversing the syntax tree,
-one can determine how each character was parsed.
-
-The following symbols have reserved meanings within a grammar:
-`\\?', `*', `+', `&', `!', `function', `alt', `seq' and nil."
-  (let ((string (or string ""))
-        func pair result rules tail)
-    (cond
-     ;; epsilon
-     ((member symbol '("" nil))
-      (setq pair (cons (if syntax "" nil) string)))
-     ;; token
-     ((stringp symbol)
-      (save-match-data
-        (when (or (eq (string-match symbol string) 0)
-                  ;; ignore leading whitespace
-                  (and (eq (string-match "^[ \f\t\n\r\v]+" string) 0)
-                       (eq (match-end 0)
-                           (string-match
-                            symbol string (match-end 0)))))
-          (setq result (match-string 0 string)
-                tail (substring string (match-end 0))
-                pair (cons result tail))
-          (when (and syntax pair)
-            (setq result (substring string 0
-                                    (- (length string)
-                                       (length tail))))
-            (setcar pair result)))))
-     ;; symbol
-     ((symbolp symbol)
-      (let ((context symbol))
-        (setq rules (cdr-safe (assq symbol grammar)))
-        (setq pair (evil-parser string `(alt ,@rules)
-                                grammar greedy syntax))
-        (when (and syntax pair)
-          (setq result (car pair))
-          (if (and (listp result) (sequencep (car result)))
-              (setq result `(,symbol ,@result))
-            (setq result `(,symbol ,result)))
-          (setcar pair result))))
-     ;; function
-     ((eq (car-safe symbol) 'function)
-      (setq symbol (cadr symbol)
-            pair (funcall symbol string))
-      (when (and syntax pair)
-        (setq tail (or (cdr pair) "")
-              result (substring string 0
-                                (- (length string)
-                                   (length tail))))
-        (setcar pair result)))
-     ;; list
-     ((listp symbol)
-      (setq rules symbol
-            symbol (car-safe rules))
-      (if (memq symbol '(& ! \? * + alt seq))
-          (setq rules (cdr rules))
-        (setq symbol 'seq))
-      (when (and (memq symbol '(+ alt seq))
-                 (> (length rules) 1))
-        (setq func (car (last rules)))
-        (if (eq (car-safe func) 'function)
-            (setq rules (delq func (copy-sequence rules))
-                  func (cadr func))
-          (setq func nil)))
-      (cond
-       ;; positive lookahead
-       ((eq symbol '&)
-        (when (evil-parser string rules grammar greedy syntax)
-          (setq pair (evil-parser string nil grammar nil syntax))))
-       ;; negative lookahead
-       ((eq symbol '!)
-        (unless (evil-parser string rules grammar greedy syntax)
-          (setq pair (evil-parser string nil grammar nil syntax))))
-       ;; zero or one
-       ((eq symbol '\?)
-        (setq rules (if (> (length rules) 1)
-                        `(alt ,rules nil)
-                      `(alt ,@rules nil))
-              pair (evil-parser string rules grammar greedy syntax)))
-       ;; zero or more
-       ((eq symbol '*)
-        (setq rules `(alt (+ ,@rules) nil)
-              pair (evil-parser string rules grammar greedy syntax)))
-       ;; one or more
-       ((eq symbol '+)
-        (let (current results)
-          (catch 'done
-            (while (setq current (evil-parser
-                                  string rules grammar nil syntax))
-              (setq result (car-safe current)
-                    tail (or (cdr-safe current) "")
-                    results (append results (if syntax result
-                                              (cdr-safe result))))
-              ;; stop if stuck
-              (if (equal string tail)
-                  (throw 'done nil)
-                (setq string tail))))
-          (when results
-            (setq func (or func 'list)
-                  pair (cons results tail)))))
-       ;; alternatives
-       ((eq symbol 'alt)
-        (catch 'done
-          (dolist (rule rules)
-            (when (setq pair (evil-parser
-                              string rule grammar greedy syntax))
-              (throw 'done pair)))))
-       ;; sequence
-       (t
-        (setq func (or func 'list))
-        (let ((last (car-safe (last rules)))
-              current results rule)
-          (catch 'done
-            (while rules
-              (setq rule (pop rules)
-                    current (evil-parser string rule grammar
-                                         (when greedy
-                                           (null rules))
-                                         syntax))
-              (cond
-               ((null current)
-                (setq results nil)
-                (throw 'done nil))
-               (t
-                (setq result (car-safe current)
-                      tail (cdr-safe current))
-                (unless (memq (car-safe rule) '(& !))
-                  (if (and syntax
-                           (or (null result)
-                               (and (listp result)
-                                    (listp rule)
-                                    ;; splice in single-element
-                                    ;; (\? ...) expressions
-                                    (not (and (eq (car-safe rule) '\?)
-                                              (eq (length rule) 2))))))
-                      (setq results (append results result))
-                    (setq results (append results (list result)))))
-                (setq string (or tail ""))))))
-          (when results
-            (setq pair (cons results tail))))))
-      ;; semantic action
-      (when (and pair func (not syntax))
-        (setq result (car pair))
-        (let* ((dexp
-                #'(lambda (obj)
-                    (when (symbolp obj)
-                      (let ((str (symbol-name obj)))
-                        (save-match-data
-                          (when (string-match "\\$\\([0-9]+\\)" str)
-                            (string-to-number (match-string 1 str))))))))
-               ;; traverse a tree for dollar expressions
-               (dval nil)
-               (dval
-                #'(lambda (obj)
-                    (if (listp obj)
-                        (mapcar dval obj)
-                      (let ((num (funcall dexp obj)))
-                        (if num
-                            (if (not (listp result))
-                                result
-                              (if (eq num 0)
-                                  `(list ,@result)
-                                (nth (1- num) result)))
-                          obj))))))
-          (cond
-           ((null func)
-            (setq result nil))
-           ;; lambda function
-           ((eq (car-safe func) 'lambda)
-            (if (memq symbol '(+ seq))
-                (setq result `(funcall ,func ,@result))
-              (setq result `(funcall ,func ,result))))
-           ;; string replacement
-           ((or (stringp func) (stringp (car-safe func)))
-            (let* ((symbol (or (car-safe (cdr-safe func))
-                               (and (boundp 'context) context)
-                               (car-safe (car-safe grammar))))
-                   (string (if (stringp func) func (car-safe func))))
-              (setq result (car-safe (evil-parser string symbol grammar
-                                                  greedy syntax)))))
-           ;; dollar expression
-           ((funcall dexp func)
-            (setq result (funcall dval func)))
-           ;; function call
-           ((listp func)
-            (setq result (funcall dval func)))
-           ;; symbol
-           (t
-            (if (memq symbol '(+ seq))
-                (setq result `(,func ,@result))
-              (setq result `(,func ,result))))))
-        (setcar pair result))))
-    ;; weed out incomplete matches
-    (when pair
-      (if (not greedy) pair
-        (if (null (cdr pair)) pair
-          ;; ignore trailing whitespace
-          (when (save-match-data (string-match "^[ \f\t\n\r\v]*$" (cdr pair)))
-            (unless syntax (setcdr pair nil))
-            pair))))))
-
-(provide 'evil-ex)
-
-;;; evil-ex.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-ex.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-integration.el
@@ -1,573 +0,0 @@
-;;; evil-integration.el --- Integrate Evil with other modules
-
-;; Author: Vegard Øye <vegard_oye at hotmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-(require 'evil-maps)
-(require 'evil-core)
-(require 'evil-macros)
-(require 'evil-types)
-(require 'evil-repeat)
-
-;;; Code:
-
-;;; Evilize some commands
-
-;; unbound keys should be ignored
-(evil-declare-ignore-repeat 'undefined)
-
-(mapc #'(lambda (cmd)
-          (evil-set-command-property cmd :keep-visual t)
-          (evil-declare-not-repeat cmd))
-      '(digit-argument
-        negative-argument
-        universal-argument
-        universal-argument-minus
-        universal-argument-more
-        universal-argument-other-key))
-(mapc #'evil-declare-not-repeat
-      '(what-cursor-position))
-(mapc #'evil-declare-change-repeat
-      '(dabbrev-expand
-        hippie-expand
-        quoted-insert))
-(mapc #'evil-declare-abort-repeat
-      '(balance-windows
-        eval-expression
-        execute-extended-command
-        exit-minibuffer
-        compile
-        delete-window
-        delete-other-windows
-        find-file-at-point
-        ffap-other-window
-        recompile
-        redo
-        save-buffer
-        split-window
-        split-window-horizontally
-        split-window-vertically
-        undo
-        undo-tree-redo
-        undo-tree-undo))
-
-(evil-set-type #'previous-line 'line)
-(evil-set-type #'next-line 'line)
-
-(dolist (cmd '(keyboard-quit keyboard-escape-quit))
-  (evil-set-command-property cmd :suppress-operator t))
-
-;;; Mouse
-(evil-declare-insert-at-point-repeat 'mouse-yank-primary)
-(evil-declare-insert-at-point-repeat 'mouse-yank-secondary)
-
-;;; key-binding
-
-;; Calling `keyboard-quit' should cancel repeat
-(defadvice keyboard-quit (before evil activate)
-  (when (fboundp 'evil-repeat-abort)
-    (evil-repeat-abort)))
-
-;; etags-select
-;; FIXME: probably etags-select should be recomended in docs
-(eval-after-load 'etags-select
-  '(progn
-     (define-key evil-motion-state-map "g]" 'etags-select-find-tag-at-point)))
-
-;;; Buffer-menu
-
-(evil-add-hjkl-bindings Buffer-menu-mode-map 'motion)
-
-;; dictionary.el
-
-(evil-add-hjkl-bindings dictionary-mode-map 'motion
-  "?" 'dictionary-help        ; "h"
-  "C-o" 'dictionary-previous) ; "l"
-
-;;; Dired
-
-(eval-after-load 'dired
-  '(progn
-     ;; use the standard Dired bindings as a base
-     (defvar dired-mode-map)
-     (evil-make-overriding-map dired-mode-map 'normal)
-     (evil-add-hjkl-bindings dired-mode-map 'normal
-       "J" 'dired-goto-file                   ; "j"
-       "K" 'dired-do-kill-lines               ; "k"
-       "r" 'dired-do-redisplay                ; "l"
-       ;; ":d", ":v", ":s", ":e"
-       ";" (lookup-key dired-mode-map ":"))))
-
-(eval-after-load 'wdired
-  '(progn
-     (add-hook 'wdired-mode-hook #'evil-change-to-initial-state)
-     (defadvice wdired-change-to-dired-mode (after evil activate)
-       (evil-change-to-initial-state nil t))))
-
-;;; ELP
-
-(eval-after-load 'elp
-  '(defadvice elp-results (after evil activate)
-     (evil-motion-state)))
-
-;;; ERT
-
-(evil-add-hjkl-bindings ert-results-mode-map 'motion)
-
-;;; Info
-
-(evil-add-hjkl-bindings Info-mode-map 'motion
-  "0" 'evil-digit-argument-or-evil-beginning-of-line
-  (kbd "\M-h") 'Info-help   ; "h"
-  "\C-t" 'Info-history-back ; "l"
-  "\C-o" 'Info-history-back
-  " " 'Info-scroll-up
-  "\C-]" 'Info-follow-nearest-node
-  (kbd "DEL") 'Info-scroll-down)
-
-;;; Parentheses
-
-(defadvice show-paren-function (around evil disable)
-  "Match parentheses in Normal state."
-  (if (if (memq 'not evil-highlight-closing-paren-at-point-states)
-          (memq evil-state evil-highlight-closing-paren-at-point-states)
-        (not (memq evil-state evil-highlight-closing-paren-at-point-states)))
-      ad-do-it
-    (let ((pos (point)) syntax narrow)
-      (setq pos
-            (catch 'end
-              (dotimes (var (1+ (* 2 evil-show-paren-range)))
-                (if (zerop (mod var 2))
-                    (setq pos (+ pos var))
-                  (setq pos (- pos var)))
-                (setq syntax (syntax-class (syntax-after pos)))
-                (cond
-                 ((eq syntax 4)
-                  (setq narrow pos)
-                  (throw 'end pos))
-                 ((eq syntax 5)
-                  (throw 'end (1+ pos)))))))
-      (if pos
-          (save-excursion
-            (goto-char pos)
-            (save-restriction
-              (when narrow
-                (narrow-to-region narrow (point-max)))
-              ad-do-it))
-        ;; prevent the preceding pair from being highlighted
-        (dolist (ov '(show-paren--overlay
-                      show-paren--overlay-1
-                      show-paren-overlay
-                      show-paren-overlay-1))
-          (let ((ov (and (boundp ov) (symbol-value ov))))
-            (when (overlayp ov) (delete-overlay ov))))))))
-
-;;; Speedbar
-
-(evil-add-hjkl-bindings speedbar-key-map 'motion
-  "h" 'backward-char
-  "j" 'speedbar-next
-  "k" 'speedbar-prev
-  "l" 'forward-char
-  "i" 'speedbar-item-info
-  "r" 'speedbar-refresh
-  "u" 'speedbar-up-directory
-  "o" 'speedbar-toggle-line-expansion
-  (kbd "RET") 'speedbar-edit-line)
-
-;; Ibuffer
-(eval-after-load 'ibuffer
-  '(progn
-     (defvar ibuffer-mode-map)
-     (evil-make-overriding-map ibuffer-mode-map 'normal)
-     (evil-define-key 'normal ibuffer-mode-map
-       "j" 'evil-next-line
-       "k" 'evil-previous-line
-       "RET" 'ibuffer-visit-buffer)))
-
-;;; Undo tree
-(when (and (require 'undo-tree nil t)
-           (fboundp 'global-undo-tree-mode))
-  (global-undo-tree-mode 1))
-
-(eval-after-load 'undo-tree
-  '(with-no-warnings
-     (defun evil-turn-on-undo-tree-mode ()
-       "Enable `undo-tree-mode' if evil is enabled.
-This function enables `undo-tree-mode' when Evil is activated in
-some buffer, but only if `global-undo-tree-mode' is also
-activated."
-       (when (and (boundp 'global-undo-tree-mode)
-                  global-undo-tree-mode)
-         (turn-on-undo-tree-mode)))
-
-     (add-hook 'evil-local-mode-hook #'evil-turn-on-undo-tree-mode)
-
-     (defadvice undo-tree-visualize (after evil activate)
-       "Initialize Evil in the visualization buffer."
-       (when evil-local-mode
-         (evil-initialize-state)))
-
-     (when (fboundp 'undo-tree-visualize)
-       (evil-ex-define-cmd "undol[ist]" 'undo-tree-visualize)
-       (evil-ex-define-cmd "ul" 'undo-tree-visualize))
-
-     (when (boundp 'undo-tree-visualizer-mode-map)
-       (define-key undo-tree-visualizer-mode-map
-         [remap evil-backward-char] 'undo-tree-visualize-switch-branch-left)
-       (define-key undo-tree-visualizer-mode-map
-         [remap evil-forward-char] 'undo-tree-visualize-switch-branch-right)
-       (define-key undo-tree-visualizer-mode-map
-         [remap evil-next-line] 'undo-tree-visualize-redo)
-       (define-key undo-tree-visualizer-mode-map
-         [remap evil-previous-line] 'undo-tree-visualize-undo)
-       (define-key undo-tree-visualizer-mode-map
-         [remap evil-ret] 'undo-tree-visualizer-set))
-
-     (when (boundp 'undo-tree-visualizer-selection-mode-map)
-       (define-key undo-tree-visualizer-selection-mode-map
-         [remap evil-backward-char] 'undo-tree-visualizer-select-left)
-       (define-key undo-tree-visualizer-selection-mode-map
-         [remap evil-forward-char] 'undo-tree-visualizer-select-right)
-       (define-key undo-tree-visualizer-selection-mode-map
-         [remap evil-next-line] 'undo-tree-visualizer-select-next)
-       (define-key undo-tree-visualizer-selection-mode-map
-         [remap evil-previous-line] 'undo-tree-visualizer-select-previous)
-       (define-key undo-tree-visualizer-selection-mode-map
-         [remap evil-ret] 'undo-tree-visualizer-set))))
-
-;;; Auto-complete
-(eval-after-load 'auto-complete
-  '(progn
-     (evil-add-command-properties 'auto-complete :repeat 'evil-ac-repeat)
-     (evil-add-command-properties 'ac-complete :repeat 'evil-ac-repeat)
-     (evil-add-command-properties 'ac-expand :repeat 'evil-ac-repeat)
-     (evil-add-command-properties 'ac-next :repeat 'ignore)
-     (evil-add-command-properties 'ac-previous :repeat 'ignore)
-
-     (defvar evil-ac-prefix-len nil
-       "The length of the prefix of the current item to be completed.")
-
-     (defvar ac-prefix)
-     (defun evil-ac-repeat (flag)
-       "Record the changes for auto-completion."
-       (cond
-        ((eq flag 'pre)
-         (setq evil-ac-prefix-len (length ac-prefix))
-         (evil-repeat-start-record-changes))
-        ((eq flag 'post)
-         ;; Add change to remove the prefix
-         (evil-repeat-record-change (- evil-ac-prefix-len)
-                                    ""
-                                    evil-ac-prefix-len)
-         ;; Add change to insert the full completed text
-         (evil-repeat-record-change
-          (- evil-ac-prefix-len)
-          (buffer-substring-no-properties (- evil-repeat-pos
-                                             evil-ac-prefix-len)
-                                          (point))
-          0)
-         ;; Finish repeation
-         (evil-repeat-finish-record-changes))))))
-
-;;; Company
-(eval-after-load 'company
-  '(progn
-     (mapc #'evil-declare-change-repeat
-           '(company-complete-mouse
-             company-complete-number
-             company-complete-selection
-             company-complete-common))
-
-     (mapc #'evil-declare-ignore-repeat
-           '(company-abort
-             company-select-next
-             company-select-previous
-             company-select-next-or-abort
-             company-select-previous-or-abort
-             company-select-mouse
-             company-show-doc-buffer
-             company-show-location
-             company-search-candidates
-             company-filter-candidates))))
-
-;; Eval last sexp
-(cond
- ((version< emacs-version "25")
-  (defadvice preceding-sexp (around evil activate)
-    "In normal-state or motion-state, last sexp ends at point."
-    (if (and (not evil-move-beyond-eol)
-             (or (evil-normal-state-p) (evil-motion-state-p)))
-        (save-excursion
-          (unless (or (eobp) (eolp)) (forward-char))
-          ad-do-it)
-      ad-do-it))
-
-  (defadvice pp-last-sexp (around evil activate)
-    "In normal-state or motion-state, last sexp ends at point."
-    (if (and (not evil-move-beyond-eol)
-             (or (evil-normal-state-p) (evil-motion-state-p)))
-        (save-excursion
-          (unless (or (eobp) (eolp)) (forward-char))
-          ad-do-it)
-      ad-do-it)))
- (t
-  (defun evil--preceding-sexp (command &rest args)
-    "In normal-state or motion-state, last sexp ends at point."
-    (if (and (not evil-move-beyond-eol)
-             (or (evil-normal-state-p) (evil-motion-state-p)))
-        (save-excursion
-          (unless (or (eobp) (eolp)) (forward-char))
-          (apply command args))
-      (apply command args)))
-
-  (advice-add 'elisp--preceding-sexp :around 'evil--preceding-sexp '((name . evil)))
-  (advice-add 'pp-last-sexp          :around 'evil--preceding-sexp '((name . evil)))))
-
-;; Show key
-(defadvice quail-show-key (around evil activate)
-  "Temporarily go to Emacs state"
-  (evil-with-state emacs ad-do-it))
-
-(defadvice describe-char (around evil activate)
-  "Temporarily go to Emacs state"
-  (evil-with-state emacs ad-do-it))
-
-;; ace-jump-mode
-(declare-function 'ace-jump-char-mode "ace-jump-mode")
-(declare-function 'ace-jump-word-mode "ace-jump-mode")
-(declare-function 'ace-jump-line-mode "ace-jump-mode")
-
-(defvar evil-ace-jump-active nil)
-
-(defmacro evil-enclose-ace-jump-for-motion (&rest body)
-  "Enclose ace-jump to make it suitable for motions.
-This includes restricting `ace-jump-mode' to the current window
-in visual and operator state, deactivating visual updates, saving
-the mark and entering `recursive-edit'."
-  (declare (indent defun)
-           (debug t))
-  `(let ((old-mark (mark))
-         (ace-jump-mode-scope
-          (if (and (not (memq evil-state '(visual operator)))
-                   (boundp 'ace-jump-mode-scope))
-              ace-jump-mode-scope
-            'window)))
-     (remove-hook 'pre-command-hook #'evil-visual-pre-command t)
-     (remove-hook 'post-command-hook #'evil-visual-post-command t)
-     (unwind-protect
-         (let ((evil-ace-jump-active 'prepare))
-           (add-hook 'ace-jump-mode-end-hook
-                     #'evil-ace-jump-exit-recursive-edit)
-           ,@body
-           (when evil-ace-jump-active
-             (setq evil-ace-jump-active t)
-             (recursive-edit)))
-       (remove-hook 'post-command-hook
-                    #'evil-ace-jump-exit-recursive-edit)
-       (remove-hook 'ace-jump-mode-end-hook
-                    #'evil-ace-jump-exit-recursive-edit)
-       (if (evil-visual-state-p)
-           (progn
-             (add-hook 'pre-command-hook #'evil-visual-pre-command nil t)
-             (add-hook 'post-command-hook #'evil-visual-post-command nil t)
-             (set-mark old-mark))
-         (push-mark old-mark)))))
-
-(eval-after-load 'ace-jump-mode
-  `(defadvice ace-jump-done (after evil activate)
-     (when evil-ace-jump-active
-       (add-hook 'post-command-hook #'evil-ace-jump-exit-recursive-edit))))
-
-(defun evil-ace-jump-exit-recursive-edit ()
-  "Exit a recursive edit caused by an evil jump."
-  (cond
-   ((eq evil-ace-jump-active 'prepare)
-    (setq evil-ace-jump-active nil))
-   (evil-ace-jump-active
-    (remove-hook 'post-command-hook #'evil-ace-jump-exit-recursive-edit)
-    (exit-recursive-edit))))
-
-(evil-define-motion evil-ace-jump-char-mode (count)
-  "Jump visually directly to a char using ace-jump."
-  :type inclusive
-  (evil-without-repeat
-    (let ((pnt (point))
-          (buf (current-buffer)))
-      (evil-enclose-ace-jump-for-motion
-        (call-interactively 'ace-jump-char-mode))
-      ;; if we jump backwards, motion type is exclusive, analogously
-      ;; to `evil-find-char-backward'
-      (when (and (equal buf (current-buffer))
-                 (< (point) pnt))
-        (setq evil-this-type
-              (cond
-               ((eq evil-this-type 'exclusive) 'inclusive)
-               ((eq evil-this-type 'inclusive) 'exclusive)))))))
-
-(evil-define-motion evil-ace-jump-char-to-mode (count)
-  "Jump visually to the char in front of a char using ace-jump."
-  :type inclusive
-  (evil-without-repeat
-    (let ((pnt (point))
-          (buf (current-buffer)))
-      (evil-enclose-ace-jump-for-motion
-        (call-interactively 'ace-jump-char-mode))
-      (if (and (equal buf (current-buffer))
-               (< (point) pnt))
-          (progn
-            (or (eobp) (forward-char))
-            (setq evil-this-type
-                  (cond
-                   ((eq evil-this-type 'exclusive) 'inclusive)
-                   ((eq evil-this-type 'inclusive) 'exclusive))))
-        (backward-char)))))
-
-(evil-define-motion evil-ace-jump-line-mode (count)
-  "Jump visually to the beginning of a line using ace-jump."
-  :type line
-  :repeat abort
-  (evil-without-repeat
-    (evil-enclose-ace-jump-for-motion
-      (call-interactively 'ace-jump-line-mode))))
-
-(evil-define-motion evil-ace-jump-word-mode (count)
-  "Jump visually to the beginning of a word using ace-jump."
-  :type exclusive
-  :repeat abort
-  (evil-without-repeat
-    (evil-enclose-ace-jump-for-motion
-      (call-interactively 'ace-jump-word-mode))))
-
-(define-key evil-motion-state-map [remap ace-jump-char-mode] #'evil-ace-jump-char-mode)
-(define-key evil-motion-state-map [remap ace-jump-line-mode] #'evil-ace-jump-line-mode)
-(define-key evil-motion-state-map [remap ace-jump-word-mode] #'evil-ace-jump-word-mode)
-
-;;; avy
-(declare-function 'avy-goto-word-or-subword-1 "avy")
-(declare-function 'avy-goto-line "avy")
-(declare-function 'avy-goto-char "avy")
-(declare-function 'avy-goto-char-2 "avy")
-(declare-function 'avy-goto-char-2-above "avy")
-(declare-function 'avy-goto-char-2-below "avy")
-(declare-function 'avy-goto-char-in-line "avy")
-(declare-function 'avy-goto-word-0 "avy")
-(declare-function 'avy-goto-word-1 "avy")
-(declare-function 'avy-goto-word-1-above "avy")
-(declare-function 'avy-goto-word-1-below "avy")
-(declare-function 'avy-goto-subword-0 "avy")
-(declare-function 'avy-goto-subword-1 "avy")
-(declare-function 'avy-goto-char-timer "avy")
-
-(defmacro evil-enclose-avy-for-motion (&rest body)
-  "Enclose avy to make it suitable for motions.
-Based on `evil-enclose-ace-jump-for-motion'."
-  (declare (indent defun)
-           (debug t))
-  `(let ((avy-all-windows
-          (if (and (not (memq evil-state '(visual operator)))
-                   (boundp 'avy-all-windows))
-              avy-all-windows
-            nil)))
-     ,@body))
-
-(defmacro evil-define-avy-motion (command type)
-  (declare (indent defun)
-           (debug t))
-  (let ((name (intern (format "evil-%s" command))))
-    `(evil-define-motion ,name (_count)
-       ,(format "Evil motion for `%s'." command)
-       :type ,type
-       :jump t
-       :repeat abort
-       (evil-without-repeat
-         (evil-enclose-avy-for-motion
-           (call-interactively ',command))))))
-
-;; define evil-avy-* motion commands for avy-* commands
-(evil-define-avy-motion avy-goto-word-or-subword-1 exclusive)
-(evil-define-avy-motion avy-goto-line line)
-(evil-define-avy-motion avy-goto-char inclusive)
-(evil-define-avy-motion avy-goto-char-2 inclusive)
-(evil-define-avy-motion avy-goto-char-2-above inclusive)
-(evil-define-avy-motion avy-goto-char-2-below inclusive)
-(evil-define-avy-motion avy-goto-char-in-line inclusive)
-(evil-define-avy-motion avy-goto-char-timer inclusive)
-(evil-define-avy-motion avy-goto-word-0 exclusive)
-(evil-define-avy-motion avy-goto-word-1 exclusive)
-(evil-define-avy-motion avy-goto-word-1-above exclusive)
-(evil-define-avy-motion avy-goto-word-1-below exclusive)
-(evil-define-avy-motion avy-goto-subword-0 exclusive)
-(evil-define-avy-motion avy-goto-subword-1 exclusive)
-
-;; remap avy-* commands to evil-avy-* commands
-(dolist (command '(avy-goto-word-or-subword-1
-                   avy-goto-line
-                   avy-goto-char
-                   avy-goto-char-2
-                   avy-goto-char-2-above
-                   avy-goto-char-2-below
-                   avy-goto-char-in-line
-                   avy-goto-char-timer
-                   avy-goto-word-0
-                   avy-goto-word-1
-                   avy-goto-word-1-above
-                   avy-goto-word-1-below
-                   avy-goto-subword-0
-                   avy-goto-subword-1))
-  (define-key evil-motion-state-map
-    (vector 'remap command) (intern-soft (format "evil-%s" command))))
-
-;;; nXhtml/mumamo
-;; ensure that mumamo does not toggle evil through its globalized mode
-(eval-after-load 'mumamo
-  '(with-no-warnings
-     (push 'evil-mode-cmhh mumamo-change-major-mode-no-nos)))
-
-;;; ag.el
-(eval-after-load 'ag
-  '(progn
-     (defvar ag-mode-map)
-     (add-to-list 'evil-motion-state-modes 'ag-mode)
-     (evil-add-hjkl-bindings ag-mode-map 'motion)))
-
-;; visual-line-mode integration
-(when evil-respect-visual-line-mode
-  (let ((swaps '((evil-next-line . evil-next-visual-line)
-                 (evil-previous-line . evil-previous-visual-line)
-                 (evil-beginning-of-line . evil-beginning-of-visual-line)
-                 (evil-end-of-line . evil-end-of-visual-line))))
-    (dolist (swap swaps)
-      (define-key visual-line-mode-map (vector 'remap (car swap)) (cdr swap))
-      (define-key visual-line-mode-map (vector 'remap (cdr swap)) (car swap)))))
-
-(provide 'evil-integration)
-
-;;; abbrev.el
-(when evil-want-abbrev-expand-on-insert-exit
-  (eval-after-load 'abbrev
-    '(add-hook 'evil-insert-state-exit-hook 'expand-abbrev)))
-
-;;; evil-integration.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-integration.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-jumps.el
@@ -1,314 +0,0 @@
-;;; evil-jumps.el --- Jump list implementation
-
-;; Author: Bailey Ling <bling at live.ca>
-
-;; Version: 1.2.10
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-(require 'cl-lib)
-(require 'evil-core)
-(require 'evil-states)
-
-;;; Code:
-
-(defgroup evil-jumps nil
-  "Evil jump list configuration options."
-  :prefix "evil-jumps"
-  :group 'evil)
-
-(defcustom evil-jumps-cross-buffers t
-  "When non-nil, the jump commands can cross borders between buffers, otherwise the jump commands act only within the current buffer."
-  :type 'boolean
-  :group 'evil-jumps)
-
-(defcustom evil-jumps-max-length 100
-  "The maximum number of jumps to keep track of."
-  :type 'integer
-  :group 'evil-jumps)
-
-(defcustom evil-jumps-pre-jump-hook nil
-  "Hooks to run just before jumping to a location in the jump list."
-  :type 'hook
-  :group 'evil-jumps)
-
-(defcustom evil-jumps-post-jump-hook nil
-  "Hooks to run just after jumping to a location in the jump list."
-  :type 'hook
-  :group 'evil-jumps)
-
-(defcustom evil-jumps-ignored-file-patterns '("COMMIT_EDITMSG$" "TAGS$")
-  "A list of pattern regexps to match on the file path to exclude from being included in the jump list."
-  :type '(repeat string)
-  :group 'evil-jumps)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defvar savehist-additional-variables)
-
-(defvar evil--jumps-jumping nil)
-
-(eval-when-compile (defvar evil--jumps-debug nil))
-
-(defvar evil--jumps-buffer-targets "\\*\\(new\\|scratch\\)\\*"
-  "Regexp to match against `buffer-name' to determine whether it's a valid jump target.")
-
-(defvar evil--jumps-window-jumps (make-hash-table)
-  "Hashtable which stores all jumps on a per window basis.")
-
-(defvar evil-jumps-history nil
-  "History of `evil-mode' jumps that are persisted with `savehist'.")
-
-(cl-defstruct evil-jumps-struct
-  ring
-  (idx -1))
-
-(defmacro evil--jumps-message (format &rest args)
-  (when evil--jumps-debug
-    `(with-current-buffer (get-buffer-create "*evil-jumps*")
-       (goto-char (point-max))
-       (insert (apply #'format ,format ',args) "\n"))))
-
-(defun evil--jumps-get-current (&optional window)
-  (unless window
-    (setq window (frame-selected-window)))
-  (let* ((jump-struct (gethash window evil--jumps-window-jumps)))
-    (unless jump-struct
-      (setq jump-struct (make-evil-jumps-struct))
-      (puthash window jump-struct evil--jumps-window-jumps))
-    jump-struct))
-
-(defun evil--jumps-get-jumps (struct)
-  (let ((ring (evil-jumps-struct-ring struct)))
-    (unless ring
-      (setq ring (make-ring evil-jumps-max-length))
-      (setf (evil-jumps-struct-ring struct) ring))
-    ring))
-
-(defun evil--jumps-get-window-jump-list ()
-  (let ((struct (evil--jumps-get-current)))
-    (evil--jumps-get-jumps struct)))
-
-(defun evil--jumps-savehist-load ()
-  (add-to-list 'savehist-additional-variables 'evil-jumps-history)
-  (let ((ring (make-ring evil-jumps-max-length)))
-    (cl-loop for jump in (reverse evil-jumps-history)
-             do (ring-insert ring jump))
-    (setf (evil-jumps-struct-ring (evil--jumps-get-current)) ring))
-  (add-hook 'savehist-save-hook #'evil--jumps-savehist-sync)
-  (remove-hook 'savehist-mode-hook #'evil--jumps-savehist-load))
-
-(defun evil--jumps-savehist-sync ()
-  "Updates the printable value of window jumps for `savehist'."
-  (setq evil-jumps-history
-        (cl-remove-if-not #'identity
-                          (mapcar #'(lambda (jump)
-                                      (let* ((mark (car jump))
-                                             (pos (if (markerp mark)
-                                                      (marker-position mark)
-                                                    mark))
-                                             (file-name (cadr jump)))
-                                        (if (and (not (file-remote-p file-name))
-                                                 (file-exists-p file-name)
-                                                 pos)
-                                            (list pos file-name)
-                                          nil)))
-                                  (ring-elements (evil--jumps-get-window-jump-list))))))
-
-(defun evil--jumps-jump (idx shift)
-  (let ((target-list (evil--jumps-get-window-jump-list)))
-    (evil--jumps-message "jumping from %s by %s" idx shift)
-    (evil--jumps-message "target list = %s" target-list)
-    (setq idx (+ idx shift))
-    (let* ((current-file-name (or (buffer-file-name) (buffer-name)))
-           (size (ring-length target-list)))
-      (unless evil-jumps-cross-buffers
-        ;; skip jump marks pointing to other buffers
-        (while (and (< idx size) (>= idx 0)
-                    (not (string= current-file-name
-                                  (let* ((place (ring-ref target-list idx))
-                                         (pos (car place)))
-                                    (cadr place)))))
-          (setq idx (+ idx shift))))
-      (when (and (< idx size) (>= idx 0))
-        ;; actual jump
-        (run-hooks 'evil-jumps-pre-jump-hook)
-        (let* ((place (ring-ref target-list idx))
-               (pos (car place))
-               (file-name (cadr place)))
-          (setq evil--jumps-jumping t)
-          (if (string-match-p evil--jumps-buffer-targets file-name)
-              (switch-to-buffer file-name)
-            (find-file file-name))
-          (setq evil--jumps-jumping nil)
-          (goto-char pos)
-          (setf (evil-jumps-struct-idx (evil--jumps-get-current)) idx)
-          (run-hooks 'evil-jumps-post-jump-hook))))))
-
-(defun evil--jumps-push ()
-  "Pushes the current cursor/file position to the jump list."
-  (let ((target-list (evil--jumps-get-window-jump-list)))
-    (let ((file-name (buffer-file-name))
-          (buffer-name (buffer-name))
-          (current-pos (point-marker))
-          (first-pos nil)
-          (first-file-name nil)
-          (excluded nil))
-      (when (and (not file-name)
-                 (string-match-p evil--jumps-buffer-targets buffer-name))
-        (setq file-name buffer-name))
-      (when file-name
-        (dolist (pattern evil-jumps-ignored-file-patterns)
-          (when (string-match-p pattern file-name)
-            (setq excluded t)))
-        (unless excluded
-          (unless (ring-empty-p target-list)
-            (setq first-pos (car (ring-ref target-list 0)))
-            (setq first-file-name (car (cdr (ring-ref target-list 0)))))
-          (unless (and (equal first-pos current-pos)
-                       (equal first-file-name file-name))
-            (evil--jumps-message "pushing %s on %s" current-pos file-name)
-            (ring-insert target-list `(,current-pos ,file-name))))))
-    (evil--jumps-message "%s %s"
-                         (selected-window)
-                         (and (not (ring-empty-p target-list))
-                              (ring-ref target-list 0)))))
-
-(evil-define-command evil-show-jumps ()
-  "Display the contents of the jump list."
-  :repeat nil
-  (evil-with-view-list
-    :name "evil-jumps"
-    :mode "Evil Jump List"
-    :format [("Jump" 5 nil)
-             ("Marker" 8 nil)
-             ("File/text" 1000 t)]
-    :entries (let* ((jumps (evil--jumps-savehist-sync))
-                    (count 0))
-               (cl-loop for jump in jumps
-                        collect `(nil [,(number-to-string (cl-incf count))
-                                       ,(number-to-string (car jump))
-                                       (,(cadr jump))])))
-    :select-action #'evil--show-jumps-select-action))
-
-(defun evil--show-jumps-select-action (jump)
-  (let ((position (string-to-number (elt jump 1)))
-        (file (car (elt jump 2))))
-    (kill-buffer)
-    (switch-to-buffer (find-file file))
-    (goto-char position)))
-
-(defun evil-set-jump (&optional pos)
-  "Set jump point at POS.
-POS defaults to point."
-  (unless (or (region-active-p) (evil-visual-state-p))
-    (push-mark pos t))
-
-  (unless evil--jumps-jumping
-    ;; clear out intermediary jumps when a new one is set
-    (let* ((struct (evil--jumps-get-current))
-           (target-list (evil--jumps-get-jumps struct))
-           (idx (evil-jumps-struct-idx struct)))
-      (cl-loop repeat idx
-               do (ring-remove target-list))
-      (setf (evil-jumps-struct-idx struct) -1))
-    (evil--jumps-push)))
-
-(defun evil--jump-backward (count)
-  (let ((count (or count 1)))
-    (evil-motion-loop (nil count)
-      (let* ((struct (evil--jumps-get-current))
-             (idx (evil-jumps-struct-idx struct)))
-        (evil--jumps-message "jumping back %s" idx)
-        (when (= idx -1)
-          (setq idx 0)
-          (setf (evil-jumps-struct-idx struct) 0)
-          (evil--jumps-push))
-        (evil--jumps-jump idx 1)))))
-
-(defun evil--jump-forward (count)
-  (let ((count (or count 1)))
-    (evil-motion-loop (nil count)
-      (let* ((struct (evil--jumps-get-current))
-             (idx (evil-jumps-struct-idx struct)))
-        (when (= idx -1)
-          (setq idx 0)
-          (setf (evil-jumps-struct-idx struct) 0)
-          (evil--jumps-push))
-          (evil--jumps-jump idx -1)))))
-
-(defun evil--jumps-window-configuration-hook (&rest args)
-  (let* ((window-list (window-list-1 nil nil t))
-         (existing-window (selected-window))
-         (new-window (previous-window)))
-    (when (and (not (eq existing-window new-window))
-               (> (length window-list) 1))
-      (let* ((target-jump-struct (evil--jumps-get-current new-window))
-             (target-jump-count (ring-length (evil--jumps-get-jumps target-jump-struct))))
-        (if (not (ring-empty-p (evil--jumps-get-jumps target-jump-struct)))
-            (evil--jumps-message "target window %s already has %s jumps" new-window target-jump-count)
-          (evil--jumps-message "new target window detected; copying %s to %s" existing-window new-window)
-          (let* ((source-jump-struct (evil--jumps-get-current existing-window))
-                 (source-list (evil--jumps-get-jumps source-jump-struct)))
-            (when (= (ring-length (evil--jumps-get-jumps target-jump-struct)) 0)
-              (setf (evil-jumps-struct-idx target-jump-struct) (evil-jumps-struct-idx source-jump-struct))
-              (setf (evil-jumps-struct-ring target-jump-struct) (ring-copy source-list)))))))
-    ;; delete obsolete windows
-    (maphash (lambda (key val)
-               (unless (member key window-list)
-                 (evil--jumps-message "removing %s" key)
-                 (remhash key evil--jumps-window-jumps)))
-             evil--jumps-window-jumps)))
-
-(defun evil--jump-hook (&optional command)
-  "Set jump point if COMMAND has a non-nil :jump property."
-  (setq command (or command this-command))
-  (when (evil-get-command-property command :jump)
-    (evil-set-jump)))
-
-(defadvice switch-to-buffer (before evil-jumps activate)
-  (evil-set-jump))
-
-(defadvice split-window-internal (before evil-jumps activate)
-  (evil-set-jump))
-
-(defadvice find-tag-noselect (before evil-jumps activate)
-  (evil-set-jump))
-
-(if (bound-and-true-p savehist-loaded)
-    (evil--jumps-savehist-load)
-  (add-hook 'savehist-mode-hook #'evil--jumps-savehist-load))
-
-(add-hook 'evil-local-mode-hook
-          (lambda ()
-            (if evil-local-mode
-                (progn
-                  (add-hook 'pre-command-hook #'evil--jump-hook nil t)
-                  (add-hook 'next-error-hook #'evil-set-jump nil t)
-                  (add-hook 'window-configuration-change-hook #'evil--jumps-window-configuration-hook nil t))
-              (progn
-                (remove-hook 'pre-command-hook #'evil--jump-hook t)
-                (remove-hook 'next-error-hook #'evil-set-jump t)
-                (remove-hook 'window-configuration-change-hook #'evil--jumps-window-configuration-hook t)))))
-
-(provide 'evil-jumps)
-
-;;; evil-jumps.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-jumps.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-macros.el
@@ -1,777 +0,0 @@
-;;; evil-macros.el --- Macros
-
-;; Author: Vegard Øye <vegard_oye at hotmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-(require 'evil-common)
-(require 'evil-states)
-(require 'evil-repeat)
-
-;;; Code:
-
-(declare-function evil-ex-p "evil-ex")
-
-;; set some error codes
-(put 'beginning-of-line 'error-conditions '(beginning-of-line error))
-(put 'beginning-of-line 'error-message "Beginning of line")
-(put 'end-of-line 'error-conditions '(end-of-line error))
-(put 'end-of-line 'error-message "End of line")
-
-(defun evil-motion-range (motion &optional count type)
-  "Execute a motion and return the buffer positions.
-The return value is a list (BEG END TYPE)."
-  (let ((opoint   (point))
-        (omark    (mark t))
-        (omactive (and (boundp 'mark-active) mark-active))
-        (obuffer  (current-buffer))
-        (evil-motion-marker (move-marker (make-marker) (point)))
-        range)
-    (evil-with-transient-mark-mode
-      (evil-narrow-to-field
-        (unwind-protect
-            (let ((current-prefix-arg count)
-                  ;; Store type in global variable `evil-this-type'.
-                  ;; If necessary, motions can change their type
-                  ;; during execution by setting this variable.
-                  (evil-this-type
-                   (or type (evil-type motion 'exclusive))))
-              (condition-case err
-                  (let ((repeat-type (evil-repeat-type motion t)))
-                    (if (functionp repeat-type)
-                        (funcall repeat-type 'pre))
-                    (unless (with-local-quit
-                              (setq range (call-interactively motion))
-                              t)
-                      (evil-repeat-abort)
-                      (setq quit-flag t))
-                    (if (functionp repeat-type)
-                        (funcall repeat-type 'post)))
-                (error (prog1 nil
-                         (evil-repeat-abort)
-                         ;; some operators depend on succeeding
-                         ;; motions, in particular for
-                         ;; `evil-forward-char' (e.g., used by
-                         ;; `evil-substitute'), therefore we let
-                         ;; end-of-line and end-of-buffer pass
-                         (if (not (memq (car err) '(end-of-line end-of-buffer)))
-                             (signal (car err) (cdr err))
-                           (message (error-message-string err))))))
-              (cond
-               ;; the motion returned a range
-               ((evil-range-p range))
-               ;; the motion made a Visual selection
-               ((evil-visual-state-p)
-                (setq range (evil-visual-range)))
-               ;; the motion made an active region
-               ((region-active-p)
-                (setq range (evil-range (region-beginning)
-                                        (region-end)
-                                        evil-this-type)))
-               ;; default: range from previous position to current
-               (t
-                (setq range (evil-expand-range
-                             (evil-normalize evil-motion-marker
-                                             (point)
-                                             evil-this-type)))))
-              (unless (or (null type) (eq (evil-type range) type))
-                (evil-set-type range type)
-                (evil-expand-range range))
-              (evil-set-range-properties range nil)
-              range)
-          ;; restore point and mark like `save-excursion',
-          ;; but only if the motion hasn't disabled the operator
-          (unless evil-inhibit-operator
-            (set-buffer obuffer)
-            (evil-move-mark omark)
-            (goto-char opoint))
-          ;; delete marker so it doesn't slow down editing
-          (move-marker evil-motion-marker nil))))))
-
-(defmacro evil-define-motion (motion args &rest body)
-  "Define an motion command MOTION.
-
-\(fn MOTION (COUNT ARGS...) DOC [[KEY VALUE]...] BODY...)"
-  (declare (indent defun)
-           (debug (&define name lambda-list
-                           [&optional stringp]
-                           [&rest keywordp sexp]
-                           [&optional ("interactive" [&rest form])]
-                           def-body)))
-  (let (arg doc interactive key keys type)
-    (when args
-      (setq args `(&optional ,@(delq '&optional args))
-            ;; the count is either numerical or nil
-            interactive '("<c>")))
-    ;; collect docstring
-    (when (and (> (length body) 1)
-               (or (eq (car-safe (car-safe body)) 'format)
-                   (stringp (car-safe body))))
-      (setq doc (pop body)))
-    ;; collect keywords
-    (setq keys (plist-put keys :repeat 'motion))
-    (while (keywordp (car-safe body))
-      (setq key (pop body)
-            arg (pop body)
-            keys (plist-put keys key arg)))
-    ;; collect `interactive' specification
-    (when (eq (car-safe (car-safe body)) 'interactive)
-      (setq interactive (cdr (pop body))))
-    ;; macro expansion
-    `(progn
-       ;; refresh echo area in Eldoc mode
-       (when ',motion
-         (eval-after-load 'eldoc
-           '(and (fboundp 'eldoc-add-command)
-                 (eldoc-add-command ',motion))))
-       (evil-define-command ,motion (,@args)
-         ,@(when doc `(,doc))          ; avoid nil before `interactive'
-         ,@keys
-         :keep-visual t
-         (interactive ,@interactive)
-         ,@body))))
-
-(defmacro evil-narrow-to-line (&rest body)
-  "Narrow BODY to the current line.
-BODY will signal the errors 'beginning-of-line or 'end-of-line
-upon reaching the beginning or end of the current line.
-
-\(fn [[KEY VAL]...] BODY...)"
-  (declare (indent defun)
-           (debug t))
-  `(let* ((range (evil-expand (point) (point) 'line))
-          (beg (evil-range-beginning range))
-          (end (evil-range-end range))
-          (min (point-min))
-          (max (point-max)))
-     (when (save-excursion (goto-char end) (bolp))
-       (setq end (max beg (1- end))))
-     ;; don't include the newline in Normal state
-     (when (and evil-move-cursor-back
-                (not evil-move-beyond-eol)
-                (not (evil-visual-state-p))
-                (not (evil-operator-state-p)))
-       (setq end (max beg (1- end))))
-     (evil-with-restriction beg end
-       (evil-signal-without-movement
-         (condition-case err
-             (progn ,@body)
-           (beginning-of-buffer
-            (if (= beg min)
-                (signal (car err) (cdr err))
-              (signal 'beginning-of-line nil)))
-           (end-of-buffer
-            (if (= end max)
-                (signal (car err) (cdr err))
-              (signal 'end-of-line nil))))))))
-
-;; we don't want line boundaries to trigger the debugger
-;; when `debug-on-error' is t
-(add-to-list 'debug-ignored-errors "^Beginning of line$")
-(add-to-list 'debug-ignored-errors "^End of line$")
-
-(defun evil-eobp (&optional pos)
-  "Whether point is at end-of-buffer with regard to end-of-line."
-  (save-excursion
-    (when pos (goto-char pos))
-    (cond
-     ((eobp))
-     ;; the rest only pertains to Normal state
-     ((not (evil-normal-state-p))
-      nil)
-     ;; at the end of the last line
-     ((eolp)
-      (forward-char)
-      (eobp))
-     ;; at the last character of the last line
-     (t
-      (forward-char)
-      (cond
-       ((eobp))
-       ((eolp)
-        (forward-char)
-        (eobp)))))))
-
-(defun evil-move-beginning (count forward &optional backward)
-  "Move to the beginning of the COUNT next object.
-If COUNT is negative, move to the COUNT previous object.
-FORWARD is a function which moves to the end of the object, and
-BACKWARD is a function which moves to the beginning.
-If one is unspecified, the other is used with a negative argument."
-  (let* ((count (or count 1))
-         (backward (or backward
-                       #'(lambda (count)
-                           (funcall forward (- count)))))
-         (forward (or forward
-                      #'(lambda (count)
-                          (funcall backward (- count)))))
-         (opoint (point)))
-    (cond
-     ((< count 0)
-      (when (bobp)
-        (signal 'beginning-of-buffer nil))
-      (unwind-protect
-          (evil-motion-loop (nil count count)
-            (funcall backward 1))
-        (unless (zerop count)
-          (goto-char (point-min)))))
-     ((> count 0)
-      (when (evil-eobp)
-        (signal 'end-of-buffer nil))
-      ;; Do we need to move past the current object?
-      (when (<= (save-excursion
-                  (funcall forward 1)
-                  (funcall backward 1)
-                  (point))
-                opoint)
-        (setq count (1+ count)))
-      (unwind-protect
-          (evil-motion-loop (nil count count)
-            (funcall forward 1))
-        (if (zerop count)
-            ;; go back to beginning of object
-            (funcall backward 1)
-          (goto-char (point-max)))))
-     (t
-      count))))
-
-(defun evil-move-end (count forward &optional backward inclusive)
-  "Move to the end of the COUNT next object.
-If COUNT is negative, move to the COUNT previous object.
-FORWARD is a function which moves to the end of the object, and
-BACKWARD is a function which moves to the beginning.
-If one is unspecified, the other is used with a negative argument.
-If INCLUSIVE is non-nil, then point is placed at the last character
-of the object; otherwise it is placed at the end of the object."
-  (let* ((count (or count 1))
-         (backward (or backward
-                       #'(lambda (count)
-                           (funcall forward (- count)))))
-         (forward (or forward
-                      #'(lambda (count)
-                          (funcall backward (- count)))))
-         (opoint (point)))
-    (cond
-     ((< count 0)
-      (when (bobp)
-        (signal 'beginning-of-buffer nil))
-      ;; Do we need to move past the current object?
-      (when (>= (save-excursion
-                  (funcall backward 1)
-                  (funcall forward 1)
-                  (point))
-                (if inclusive
-                    (1+ opoint)
-                  opoint))
-        (setq count (1- count)))
-      (unwind-protect
-          (evil-motion-loop (nil count count)
-            (funcall backward 1))
-        (if (not (zerop count))
-            (goto-char (point-min))
-          ;; go to end of object
-          (funcall forward 1)
-          (when inclusive
-            (unless (bobp) (backward-char)))
-          (when (or (evil-normal-state-p)
-                    (evil-motion-state-p))
-            (evil-adjust-cursor t)))))
-     ((> count 0)
-      (when (evil-eobp)
-        (signal 'end-of-buffer nil))
-      (when inclusive
-        (forward-char))
-      (unwind-protect
-          (evil-motion-loop (nil count count)
-            (funcall forward 1))
-        (if (not (zerop count))
-            (goto-char (point-max))
-          (when inclusive
-            (unless (bobp) (backward-char)))
-          (when (or (evil-normal-state-p)
-                    (evil-motion-state-p))
-            (evil-adjust-cursor t)))))
-     (t
-      count))))
-
-(defun evil-text-object-make-linewise (range)
-  "Turn the text object selection RANGE to linewise.
-The selection is adjusted in a sensible way so that the selected
-lines match the user intent. In particular, whitespace-only parts
-at the first and last lines are omitted. This function returns
-the new range."
-  ;; Bug #607
-  ;; If new type is linewise and the selection of the
-  ;; first line consists of whitespace only, the
-  ;; beginning is moved to the start of the next line. If
-  ;; the selections of the last line consists of
-  ;; whitespace only, the end is moved to the end of the
-  ;; previous line.
-  (if (eq (evil-type range) 'line)
-      range
-    (let ((expanded (plist-get (evil-range-properties range) :expanded))
-          (newrange (evil-expand-range range t)))
-      (save-excursion
-        ;; skip whitespace at the beginning
-        (goto-char (evil-range-beginning newrange))
-        (skip-chars-forward " \t")
-        (when (and (not (bolp)) (eolp))
-          (evil-set-range-beginning newrange (1+ (point))))
-        ;; skip whitepsace at the end
-        (goto-char (evil-range-end newrange))
-        (skip-chars-backward " \t")
-        (when (and (not (eolp)) (bolp))
-          (evil-set-range-end newrange (1- (point))))
-        ;; only modify range if result is not empty
-        (if (> (evil-range-beginning newrange)
-               (evil-range-end newrange))
-            range
-          (unless expanded
-            (evil-contract-range newrange))
-          newrange)))))
-
-(defmacro evil-define-text-object (object args &rest body)
-  "Define a text object command OBJECT.
-BODY should return a range (BEG END) to the right of point
-if COUNT is positive, and to the left of it if negative.
-
-\(fn OBJECT (COUNT) DOC [[KEY VALUE]...] BODY...)"
-  (declare (indent defun)
-           (debug (&define name lambda-list
-                           [&optional stringp]
-                           [&rest keywordp sexp]
-                           def-body)))
-  (let* ((args (delq '&optional args))
-         (count (or (pop args) 'count))
-         (args (when args `(&optional ,@args)))
-         (interactive '((interactive "<c><v>")))
-         arg doc key keys)
-    ;; collect docstring
-    (when (stringp (car-safe body))
-      (setq doc (pop body)))
-    ;; collect keywords
-    (setq keys (plist-put keys :extend-selection t))
-    (while (keywordp (car-safe body))
-      (setq key (pop body)
-            arg (pop body)
-            keys (plist-put keys key arg)))
-    ;; interactive
-    (when (eq (car-safe (car-safe body)) 'interactive)
-      (setq interactive (list (pop body))))
-    ;; macro expansion
-    `(evil-define-motion ,object (,count ,@args)
-       ,@(when doc `(,doc))
-       ,@keys
-       ,@interactive
-       (setq ,count (or ,count 1))
-       (when (/= ,count 0)
-         (let ((type (evil-type ',object evil-visual-char))
-               (extend (and (evil-visual-state-p)
-                            (evil-get-command-property
-                             ',object :extend-selection
-                             ',(plist-get keys :extend-selection))))
-               (dir evil-visual-direction)
-               mark point range selection)
-           (cond
-            ;; Visual state: extend the current selection
-            ((and (evil-visual-state-p)
-                  (called-interactively-p 'any))
-             ;; if we are at the beginning of the Visual selection,
-             ;; go to the left (negative COUNT); if at the end,
-             ;; go to the right (positive COUNT)
-             (setq dir evil-visual-direction
-                   ,count (* ,count dir))
-             (setq range (progn ,@body))
-             (when (evil-range-p range)
-               (setq range (evil-expand-range range))
-               (evil-set-type range (evil-type range type))
-               (setq range (evil-contract-range range))
-               ;; the beginning is mark and the end is point
-               ;; unless the selection goes the other way
-               (setq mark  (evil-range-beginning range)
-                     point (evil-range-end range)
-                     type  (evil-type
-                            (if evil-text-object-change-visual-type
-                                range
-                              (evil-visual-range))))
-               (when (and (eq type 'line)
-                          (not (eq type (evil-type range))))
-                 (let ((newrange (evil-text-object-make-linewise range)))
-                   (setq mark (evil-range-beginning newrange)
-                         point (evil-range-end newrange))))
-               (when (< dir 0)
-                 (evil-swap mark point))
-               ;; select the union
-               (evil-visual-make-selection mark point type)))
-            ;; not Visual state: return a pair of buffer positions
-            (t
-             (setq range (progn ,@body))
-             (unless (evil-range-p range)
-               (setq ,count (- ,count)
-                     range (progn ,@body)))
-             (when (evil-range-p range)
-               (setq selection (evil-range (point) (point) type))
-               (if extend
-                   (setq range (evil-range-union range selection))
-                 (evil-set-type range (evil-type range type)))
-               ;; possibly convert to linewise
-               (when (eq evil-this-type-modified 'line)
-                 (setq range (evil-text-object-make-linewise range)))
-               (evil-set-range-properties range nil)
-               range))))))))
-
-(defmacro evil-define-operator (operator args &rest body)
-  "Define an operator command OPERATOR.
-
-\(fn OPERATOR (BEG END ARGS...) DOC [[KEY VALUE]...] BODY...)"
-  (declare (indent defun)
-           (debug (&define name lambda-list
-                           [&optional stringp]
-                           [&rest keywordp sexp]
-                           [&optional ("interactive" [&rest form])]
-                           def-body)))
-  (let* ((args (delq '&optional args))
-         (interactive (if (> (length args) 2) '("<R>") '("<r>")))
-         (args (if (> (length args) 2)
-                   `(,(nth 0 args) ,(nth 1 args)
-                     &optional ,@(nthcdr 2 args))
-                 args))
-         arg doc key keys visual)
-    ;; collect docstring
-    (when (and (> (length body) 1)
-               (or (eq (car-safe (car-safe body)) 'format)
-                   (stringp (car-safe body))))
-      (setq doc (pop body)))
-    ;; collect keywords
-    (setq keys (plist-put keys :move-point t))
-    (while (keywordp (car-safe body))
-      (setq key (pop body)
-            arg (pop body))
-      (cond
-       ((eq key :keep-visual)
-        (setq visual arg))
-       (t
-        (setq keys (plist-put keys key arg)))))
-    ;; collect `interactive' specification
-    (when (eq (car-safe (car-safe body)) 'interactive)
-      (setq interactive (cdr-safe (pop body))))
-    ;; transform extended interactive specs
-    (setq interactive (apply #'evil-interactive-form interactive))
-    (setq keys (evil-concat-plists keys (cdr-safe interactive))
-          interactive (car-safe interactive))
-    ;; macro expansion
-    `(evil-define-command ,operator ,args
-       ,@(when doc `(,doc))
-       ,@keys
-       :keep-visual t
-       :suppress-operator t
-       (interactive
-        (let* ((evil-operator-range-motion
-                (when (evil-has-command-property-p ',operator :motion)
-                  ;; :motion nil is equivalent to :motion undefined
-                  (or (evil-get-command-property ',operator :motion)
-                      #'undefined)))
-               (evil-operator-range-type
-                (evil-get-command-property ',operator :type))
-               (orig (point))
-               evil-operator-range-beginning
-               evil-operator-range-end
-               evil-inhibit-operator)
-          (setq evil-inhibit-operator-value nil
-                evil-this-operator this-command)
-          (prog1 ,interactive
-            (setq orig (point)
-                  evil-inhibit-operator-value evil-inhibit-operator)
-            (if ,visual
-                (when (evil-visual-state-p)
-                  (evil-visual-expand-region))
-              (when (or (evil-visual-state-p) (region-active-p))
-                (setq deactivate-mark t)))
-            (cond
-             ((evil-visual-state-p)
-              (evil-visual-rotate 'upper-left))
-             ((evil-get-command-property ',operator :move-point)
-              (goto-char (or evil-operator-range-beginning orig)))
-             (t
-              (goto-char orig))))))
-       (unwind-protect
-           (let ((evil-inhibit-operator evil-inhibit-operator-value))
-             (unless (and evil-inhibit-operator
-                          (called-interactively-p 'any))
-               ,@body))
-         (setq evil-inhibit-operator-value nil)))))
-
-;; this is used in the `interactive' specification of an operator command
-(defun evil-operator-range (&optional return-type)
-  "Read a motion from the keyboard and return its buffer positions.
-The return value is a list (BEG END), or (BEG END TYPE) if
-RETURN-TYPE is non-nil."
-  (let ((motion (or evil-operator-range-motion
-                    (when (evil-ex-p) 'evil-line)))
-        (type evil-operator-range-type)
-        (range (evil-range (point) (point)))
-        command count modifier)
-    (setq evil-this-type-modified nil)
-    (evil-save-echo-area
-      (cond
-       ;; Ex mode
-       ((and (evil-ex-p) evil-ex-range)
-        (setq range evil-ex-range))
-       ;; Visual selection
-       ((and (not (evil-ex-p)) (evil-visual-state-p))
-        (setq range (evil-visual-range)))
-       ;; active region
-       ((and (not (evil-ex-p)) (region-active-p))
-        (setq range (evil-range (region-beginning)
-                                (region-end)
-                                (or evil-this-type 'exclusive))))
-       (t
-        ;; motion
-        (evil-save-state
-          (unless motion
-            (evil-change-state 'operator)
-            ;; Make linewise operator shortcuts. E.g., "d" yields the
-            ;; shortcut "dd", and "g?" yields shortcuts "g??" and "g?g?".
-            (let ((keys (nth 2 (evil-extract-count (this-command-keys)))))
-              (setq keys (listify-key-sequence keys))
-              (dotimes (var (length keys))
-                (define-key evil-operator-shortcut-map
-                  (vconcat (nthcdr var keys)) 'evil-line)))
-            ;; read motion from keyboard
-            (setq command (evil-read-motion motion)
-                  motion (nth 0 command)
-                  count (nth 1 command)
-                  type (or type (nth 2 command))))
-          (cond
-           ((eq motion #'undefined)
-            (setq range (if return-type '(nil nil nil) '(nil nil))
-                  motion nil))
-           ((or (null motion) ; keyboard-quit
-                (evil-get-command-property motion :suppress-operator))
-            (when (fboundp 'evil-repeat-abort)
-              (evil-repeat-abort))
-            (setq quit-flag t
-                  motion nil))
-           (evil-repeat-count
-            (setq count evil-repeat-count
-                  ;; only the first operator's count is overwritten
-                  evil-repeat-count nil))
-           ((or count current-prefix-arg)
-            ;; multiply operator count and motion count together
-            (setq count
-                  (* (prefix-numeric-value count)
-                     (prefix-numeric-value current-prefix-arg)))))
-          (when motion
-            (let ((evil-state 'operator)
-                  mark-active)
-              ;; calculate motion range
-              (setq range (evil-motion-range
-                           motion
-                           count
-                           type))))
-          ;; update global variables
-          (setq evil-this-motion motion
-                evil-this-motion-count count
-                type (evil-type range type)
-                evil-this-type type))))
-      (when (evil-range-p range)
-        (unless (or (null type) (eq (evil-type range) type))
-          (evil-contract-range range)
-          (evil-set-type range type)
-          (evil-expand-range range))
-        (evil-set-range-properties range nil)
-        (unless return-type
-          (evil-set-type range nil))
-        (setq evil-operator-range-beginning (evil-range-beginning range)
-              evil-operator-range-end (evil-range-end range)
-              evil-operator-range-type (evil-type range)))
-      range)))
-
-(defmacro evil-define-type (type doc &rest body)
-  "Define type TYPE.
-DOC is a general description and shows up in all docstrings.
-It is followed by a list of keywords and functions:
-
-:expand FUNC     Expansion function. This function should accept
-                 two positions in the current buffer, BEG and END,
-                 and return a pair of expanded buffer positions.
-:contract FUNC   The opposite of :expand, optional.
-:one-to-one BOOL Whether expansion is one-to-one. This means that
-                 :expand followed by :contract always returns the
-                 original range.
-:normalize FUNC  Normalization function, optional. This function should
-                 accept two unexpanded positions and adjust them before
-                 expansion. May be used to deal with buffer boundaries.
-:string FUNC     Description function. This takes two buffer positions
-                 and returns a human-readable string, for example,
-                 \"2 lines\".
-
-If further keywords and functions are specified, they are assumed to
-be transformations on buffer positions, like :expand and :contract.
-
-\(fn TYPE DOC [[KEY FUNC]...])"
-  (declare (indent defun)
-           (debug (&define name
-                           [&optional stringp]
-                           [&rest [keywordp function-form]])))
-  (let (args defun-forms func key name plist string sym val)
-    ;; standard values
-    (setq plist (plist-put plist :one-to-one t))
-    ;; keywords
-    (while (keywordp (car-safe body))
-      (setq key (pop body)
-            val (pop body))
-      (if (plist-member plist key) ; not a function
-          (setq plist (plist-put plist key val))
-        (setq func val
-              sym (intern (replace-regexp-in-string
-                           "^:" "" (symbol-name key)))
-              name (intern (format "evil-%s-%s" type sym))
-              args (car (cdr-safe func))
-              string (car (cdr (cdr-safe func)))
-              string (if (stringp string)
-                         (format "%s\n\n" string) "")
-              plist (plist-put plist key `',name))
-        (add-to-list
-         'defun-forms
-         (cond
-          ((eq key :string)
-           `(defun ,name (beg end &rest properties)
-              ,(format "Return size of %s from BEG to END \
-with PROPERTIES.\n\n%s%s" type string doc)
-              (let ((beg (evil-normalize-position beg))
-                    (end (evil-normalize-position end))
-                    (type ',type)
-                    plist range)
-                (when (and beg end)
-                  (save-excursion
-                    (evil-sort beg end)
-                    (unless (plist-get properties :expanded)
-                      (setq range (apply #'evil-expand
-                                         beg end type properties)
-                            beg (evil-range-beginning range)
-                            end (evil-range-end range)
-                            type (evil-type range type)
-                            plist (evil-range-properties range))
-                      (setq properties
-                            (evil-concat-plists properties plist)))
-                    (or (apply #',func beg end
-                               (when ,(> (length args) 2)
-                                 properties))
-                        ""))))))
-          (t
-           `(defun ,name (beg end &rest properties)
-              ,(format "Perform %s transformation on %s from BEG to END \
-with PROPERTIES.\n\n%s%s" sym type string doc)
-              (let ((beg (evil-normalize-position beg))
-                    (end (evil-normalize-position end))
-                    (type ',type)
-                    plist range)
-                (when (and beg end)
-                  (save-excursion
-                    (evil-sort beg end)
-                    (when (memq ,key '(:expand :contract))
-                      (setq properties
-                            (plist-put properties
-                                       :expanded
-                                       ,(eq key :expand))))
-                    (setq range (or (apply #',func beg end
-                                           (when ,(> (length args) 2)
-                                             properties))
-                                    (apply #'evil-range
-                                           beg end type properties))
-                          beg (evil-range-beginning range)
-                          end (evil-range-end range)
-                          type (evil-type range type)
-                          plist (evil-range-properties range))
-                    (setq properties
-                          (evil-concat-plists properties plist))
-                    (apply #'evil-range beg end type properties)))))))
-         t)))
-    ;; :one-to-one requires both or neither of :expand and :contract
-    (when (plist-get plist :expand)
-      (setq plist (plist-put plist :one-to-one
-                             (and (plist-get plist :contract)
-                                  (plist-get plist :one-to-one)))))
-    `(progn
-       (evil-put-property 'evil-type-properties ',type ,@plist)
-       ,@defun-forms
-       ',type)))
-
-(defmacro evil-define-interactive-code (code &rest body)
-  "Define an interactive code.
-PROMPT, if given, is the remainder of the interactive string
-up to the next newline. Command properties may be specified
-via KEY-VALUE pairs. BODY should evaluate to a list of values.
-
-\(fn CODE (PROMPT) [[KEY VALUE]...] BODY...)"
-  (declare (indent defun))
-  (let* ((args (when (and (> (length body) 1)
-                          (listp (car-safe body)))
-                 (pop body)))
-         (doc (when (stringp (car-safe body)) (pop body)))
-         func properties)
-    (while (keywordp (car-safe body))
-      (setq properties
-            (append properties (list (pop body) (pop body)))))
-    (cond
-     (args
-      (setq func `(lambda ,args
-                    ,@(when doc `(,doc))
-                    ,@body)))
-     ((> (length body) 1)
-      (setq func `(progn ,@body)))
-     (t
-      (setq func (car body))))
-    `(eval-and-compile
-       (let* ((code ,code)
-              (entry (assoc code evil-interactive-alist))
-              (value (cons ',func ',properties)))
-         (if entry
-             (setcdr entry value)
-           (push (cons code value) evil-interactive-alist))
-         code))))
-
-;;; Highlighting
-
-(when (fboundp 'font-lock-add-keywords)
-  (font-lock-add-keywords
-   'emacs-lisp-mode
-   ;; Match all `evil-define-' forms except `evil-define-key'.
-   ;; (In the interests of speed, this expression is incomplete
-   ;; and does not match all three-letter words.)
-   '(("(\\(evil-\\(?:ex-\\)?define-\
-\\(?:[^ k][^ e][^ y]\\|[-[:word:]]\\{4,\\}\\)\\)\
-\\>[ \f\t\n\r\v]*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
-      (1 font-lock-keyword-face)
-      (2 font-lock-function-name-face nil t))
-     ("(\\(evil-\\(?:delay\\|narrow\\|signal\\|save\\|with\\(?:out\\)?\\)\
-\\(?:-[-[:word:]]+\\)?\\)\\>\[ \f\t\n\r\v]+"
-      1 font-lock-keyword-face)
-     ("(\\(evil-\\(?:[-[:word:]]\\)*loop\\)\\>[ \f\t\n\r\v]+"
-      1 font-lock-keyword-face))))
-
-(provide 'evil-macros)
-
-;;; evil-macros.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-macros.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-maps.el
@@ -1,559 +0,0 @@
-;;; evil-maps.el --- Default keymaps
-
-;; Author: Vegard Øye <vegard_oye at hotmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-(require 'evil-states)
-(require 'evil-ex)
-(require 'evil-commands)
-(require 'evil-command-window)
-(require 'evil-common)
-
-;;; Code:
-
-;;; Normal state
-
-(define-key evil-normal-state-map "a" 'evil-append)
-(define-key evil-normal-state-map "A" 'evil-append-line)
-(define-key evil-normal-state-map "c" 'evil-change)
-(define-key evil-normal-state-map "C" 'evil-change-line)
-(define-key evil-normal-state-map "d" 'evil-delete)
-(define-key evil-normal-state-map "D" 'evil-delete-line)
-(define-key evil-normal-state-map "i" 'evil-insert)
-(define-key evil-normal-state-map (kbd "<insert>") 'evil-insert)
-(define-key evil-normal-state-map (kbd "<insertchar>") 'evil-insert)
-(define-key evil-normal-state-map "I" 'evil-insert-line)
-(define-key evil-normal-state-map "J" 'evil-join)
-(define-key evil-normal-state-map "m" 'evil-set-marker)
-(define-key evil-normal-state-map "o" 'evil-open-below)
-(define-key evil-normal-state-map "O" 'evil-open-above)
-(define-key evil-normal-state-map "p" 'evil-paste-after)
-(define-key evil-normal-state-map "P" 'evil-paste-before)
-(define-key evil-normal-state-map "q" 'evil-record-macro)
-(define-key evil-normal-state-map "r" 'evil-replace)
-(define-key evil-normal-state-map "R" 'evil-replace-state)
-(define-key evil-normal-state-map "s" 'evil-substitute)
-(define-key evil-normal-state-map "S" 'evil-change-whole-line)
-(define-key evil-normal-state-map "x" 'evil-delete-char)
-(define-key evil-normal-state-map "X" 'evil-delete-backward-char)
-(define-key evil-normal-state-map [deletechar] 'evil-delete-char)
-(define-key evil-normal-state-map "y" 'evil-yank)
-(define-key evil-normal-state-map "Y" 'evil-yank-line)
-(define-key evil-normal-state-map "&" 'evil-ex-repeat-substitute)
-(define-key evil-normal-state-map "g&" 'evil-ex-repeat-global-substitute)
-(define-key evil-normal-state-map "g8" 'what-cursor-position)
-(define-key evil-normal-state-map "ga" 'what-cursor-position)
-(define-key evil-normal-state-map "gi" 'evil-insert-resume)
-(define-key evil-normal-state-map "gJ" 'evil-join-whitespace)
-(define-key evil-normal-state-map "gq" 'evil-fill-and-move)
-(define-key evil-normal-state-map "gw" 'evil-fill)
-(define-key evil-normal-state-map "gu" 'evil-downcase)
-(define-key evil-normal-state-map "gU" 'evil-upcase)
-(define-key evil-normal-state-map "gf" 'find-file-at-point)
-(define-key evil-normal-state-map "gF" 'evil-find-file-at-point-with-line)
-(define-key evil-normal-state-map "g?" 'evil-rot13)
-(define-key evil-normal-state-map "g~" 'evil-invert-case)
-(define-key evil-normal-state-map "zo" 'evil-open-fold)
-(define-key evil-normal-state-map "zO" 'evil-open-fold-rec)
-(define-key evil-normal-state-map "zc" 'evil-close-fold)
-(define-key evil-normal-state-map "za" 'evil-toggle-fold)
-(define-key evil-normal-state-map "zr" 'evil-open-folds)
-(define-key evil-normal-state-map "zm" 'evil-close-folds)
-(define-key evil-normal-state-map "z=" 'ispell-word)
-(define-key evil-normal-state-map "\C-n" 'evil-paste-pop-next)
-(define-key evil-normal-state-map "\C-p" 'evil-paste-pop)
-(define-key evil-normal-state-map "\C-t" 'pop-tag-mark)
-(define-key evil-normal-state-map (kbd "C-.") 'evil-repeat-pop)
-(define-key evil-normal-state-map (kbd "M-.") 'evil-repeat-pop-next)
-(define-key evil-normal-state-map "." 'evil-repeat)
-(define-key evil-normal-state-map "@" 'evil-execute-macro)
-(define-key evil-normal-state-map "\"" 'evil-use-register)
-(define-key evil-normal-state-map "~" 'evil-invert-char)
-(define-key evil-normal-state-map "=" 'evil-indent)
-(define-key evil-normal-state-map "<" 'evil-shift-left)
-(define-key evil-normal-state-map ">" 'evil-shift-right)
-(define-key evil-normal-state-map "ZZ" 'evil-save-modified-and-close)
-(define-key evil-normal-state-map "ZQ" 'evil-quit)
-(define-key evil-normal-state-map (kbd "DEL") 'evil-backward-char)
-(define-key evil-normal-state-map [escape] 'evil-force-normal-state)
-(define-key evil-normal-state-map [remap cua-paste-pop] 'evil-paste-pop)
-(define-key evil-normal-state-map [remap yank-pop] 'evil-paste-pop)
-
-;; go to last change
-(define-key evil-normal-state-map "g;" 'goto-last-change)
-(define-key evil-normal-state-map "g," 'goto-last-change-reverse)
-
-;; undo
-(define-key evil-normal-state-map "u" 'undo)
-(define-key evil-normal-state-map "\C-r" 'redo)
-
-;; window commands
-(define-prefix-command 'evil-window-map)
-(define-key evil-window-map "b" 'evil-window-bottom-right)
-(define-key evil-window-map "c" 'evil-window-delete)
-(define-key evil-window-map "h" 'evil-window-left)
-(define-key evil-window-map "H" 'evil-window-move-far-left)
-(define-key evil-window-map "j" 'evil-window-down)
-(define-key evil-window-map "J" 'evil-window-move-very-bottom)
-(define-key evil-window-map "k" 'evil-window-up)
-(define-key evil-window-map "K" 'evil-window-move-very-top)
-(define-key evil-window-map "l" 'evil-window-right)
-(define-key evil-window-map "L" 'evil-window-move-far-right)
-(define-key evil-window-map "n" 'evil-window-new)
-(define-key evil-window-map "o" 'delete-other-windows)
-(define-key evil-window-map "p" 'evil-window-mru)
-(define-key evil-window-map "q" 'evil-quit)
-(define-key evil-window-map "r" 'evil-window-rotate-downwards)
-(define-key evil-window-map "R" 'evil-window-rotate-upwards)
-(define-key evil-window-map "s" 'evil-window-split)
-(define-key evil-window-map "S" 'evil-window-split)
-(define-key evil-window-map "t" 'evil-window-top-left)
-(define-key evil-window-map "v" 'evil-window-vsplit)
-(define-key evil-window-map "w" 'evil-window-next)
-(define-key evil-window-map "W" 'evil-window-prev)
-(define-key evil-window-map "+" 'evil-window-increase-height)
-(define-key evil-window-map "-" 'evil-window-decrease-height)
-(define-key evil-window-map "_" 'evil-window-set-height)
-(define-key evil-window-map "<" 'evil-window-decrease-width)
-(define-key evil-window-map ">" 'evil-window-increase-width)
-(define-key evil-window-map "=" 'balance-windows)
-(define-key evil-window-map "|" 'evil-window-set-width)
-(define-key evil-window-map "\C-b" 'evil-window-bottom-right)
-(define-key evil-window-map "\C-c" 'evil-window-delete)
-(define-key evil-window-map (kbd "C-S-h") 'evil-window-move-far-left)
-(define-key evil-window-map (kbd "C-S-j") 'evil-window-move-very-bottom)
-(define-key evil-window-map (kbd "C-S-k") 'evil-window-move-very-top)
-(define-key evil-window-map (kbd "C-S-l") 'evil-window-move-far-right)
-(define-key evil-window-map "\C-n" 'evil-window-new)
-(define-key evil-window-map "\C-o" 'delete-other-windows)
-(define-key evil-window-map "\C-p" 'evil-window-mru)
-(define-key evil-window-map "\C-r" 'evil-window-rotate-downwards)
-(define-key evil-window-map (kbd "C-S-r") 'evil-window-rotate-upwards)
-(define-key evil-window-map "\C-s" 'evil-window-split)
-(define-key evil-window-map (kbd "C-S-s") 'evil-window-split)
-(define-key evil-window-map "\C-t" 'evil-window-top-left)
-(define-key evil-window-map "\C-v" 'evil-window-vsplit)
-(define-key evil-window-map "\C-w" 'evil-window-next)
-(define-key evil-window-map (kbd "C-S-W") 'evil-window-prev)
-(define-key evil-window-map "\C-_" 'evil-window-set-height)
-(define-key evil-window-map "\C-f" 'ffap-other-window)
-
-;;; Motion state
-
-;; "0" is a special command when called first
-(evil-redirect-digit-argument evil-motion-state-map "0" 'evil-beginning-of-line)
-(define-key evil-motion-state-map "1" 'digit-argument)
-(define-key evil-motion-state-map "2" 'digit-argument)
-(define-key evil-motion-state-map "3" 'digit-argument)
-(define-key evil-motion-state-map "4" 'digit-argument)
-(define-key evil-motion-state-map "5" 'digit-argument)
-(define-key evil-motion-state-map "6" 'digit-argument)
-(define-key evil-motion-state-map "7" 'digit-argument)
-(define-key evil-motion-state-map "8" 'digit-argument)
-(define-key evil-motion-state-map "9" 'digit-argument)
-(define-key evil-motion-state-map "b" 'evil-backward-word-begin)
-(define-key evil-motion-state-map "B" 'evil-backward-WORD-begin)
-(define-key evil-motion-state-map "e" 'evil-forward-word-end)
-(define-key evil-motion-state-map "E" 'evil-forward-WORD-end)
-(define-key evil-motion-state-map "f" 'evil-find-char)
-(define-key evil-motion-state-map "F" 'evil-find-char-backward)
-(define-key evil-motion-state-map "G" 'evil-goto-line)
-(define-key evil-motion-state-map "h" 'evil-backward-char)
-(define-key evil-motion-state-map "H" 'evil-window-top)
-(define-key evil-motion-state-map "j" 'evil-next-line)
-(define-key evil-motion-state-map "k" 'evil-previous-line)
-(define-key evil-motion-state-map "l" 'evil-forward-char)
-(define-key evil-motion-state-map " " 'evil-forward-char)
-(define-key evil-motion-state-map "K" 'evil-lookup)
-(define-key evil-motion-state-map "L" 'evil-window-bottom)
-(define-key evil-motion-state-map "M" 'evil-window-middle)
-(define-key evil-motion-state-map "n" 'evil-search-next)
-(define-key evil-motion-state-map "N" 'evil-search-previous)
-(define-key evil-motion-state-map "t" 'evil-find-char-to)
-(define-key evil-motion-state-map "T" 'evil-find-char-to-backward)
-(define-key evil-motion-state-map "w" 'evil-forward-word-begin)
-(define-key evil-motion-state-map "W" 'evil-forward-WORD-begin)
-(define-key evil-motion-state-map "y" 'evil-yank)
-(define-key evil-motion-state-map "Y" 'evil-yank-line)
-(define-key evil-motion-state-map "gd" 'evil-goto-definition)
-(define-key evil-motion-state-map "ge" 'evil-backward-word-end)
-(define-key evil-motion-state-map "gE" 'evil-backward-WORD-end)
-(define-key evil-motion-state-map "gg" 'evil-goto-first-line)
-(define-key evil-motion-state-map "gj" 'evil-next-visual-line)
-(define-key evil-motion-state-map "gk" 'evil-previous-visual-line)
-(define-key evil-motion-state-map "g0" 'evil-beginning-of-visual-line)
-(define-key evil-motion-state-map "g_" 'evil-last-non-blank)
-(define-key evil-motion-state-map "g^" 'evil-first-non-blank-of-visual-line)
-(define-key evil-motion-state-map "gm" 'evil-middle-of-visual-line)
-(define-key evil-motion-state-map "g$" 'evil-end-of-visual-line)
-(define-key evil-motion-state-map "g\C-]" 'find-tag)
-(define-key evil-motion-state-map "{" 'evil-backward-paragraph)
-(define-key evil-motion-state-map "}" 'evil-forward-paragraph)
-(define-key evil-motion-state-map "#" 'evil-search-word-backward)
-(define-key evil-motion-state-map "g#" 'evil-search-unbounded-word-backward)
-(define-key evil-motion-state-map "$" 'evil-end-of-line)
-(define-key evil-motion-state-map "%" 'evil-jump-item)
-(define-key evil-motion-state-map "`" 'evil-goto-mark)
-(define-key evil-motion-state-map "'" 'evil-goto-mark-line)
-(define-key evil-motion-state-map "(" 'evil-backward-sentence-begin)
-(define-key evil-motion-state-map ")" 'evil-forward-sentence-begin)
-(define-key evil-motion-state-map "]]" 'evil-forward-section-begin)
-(define-key evil-motion-state-map "][" 'evil-forward-section-end)
-(define-key evil-motion-state-map "[[" 'evil-backward-section-begin)
-(define-key evil-motion-state-map "[]" 'evil-backward-section-end)
-(define-key evil-motion-state-map "[(" 'evil-previous-open-paren)
-(define-key evil-motion-state-map "])" 'evil-next-close-paren)
-(define-key evil-motion-state-map "[{" 'evil-previous-open-brace)
-(define-key evil-motion-state-map "]}" 'evil-next-close-brace)
-(define-key evil-motion-state-map "]s" 'evil-next-flyspell-error)
-(define-key evil-motion-state-map "[s" 'evil-prev-flyspell-error)
-(define-key evil-motion-state-map "*" 'evil-search-word-forward)
-(define-key evil-motion-state-map "g*" 'evil-search-unbounded-word-forward)
-(define-key evil-motion-state-map "," 'evil-repeat-find-char-reverse)
-(define-key evil-motion-state-map "/" 'evil-search-forward)
-(define-key evil-motion-state-map ";" 'evil-repeat-find-char)
-(define-key evil-motion-state-map "?" 'evil-search-backward)
-(define-key evil-motion-state-map "|" 'evil-goto-column)
-(define-key evil-motion-state-map "^" 'evil-first-non-blank)
-(define-key evil-motion-state-map "+" 'evil-next-line-first-non-blank)
-(define-key evil-motion-state-map "_" 'evil-next-line-1-first-non-blank)
-(define-key evil-motion-state-map "-" 'evil-previous-line-first-non-blank)
-(define-key evil-motion-state-map "\C-w" 'evil-window-map)
-(define-key evil-motion-state-map (kbd "C-6") 'evil-switch-to-windows-last-buffer)
-(define-key evil-motion-state-map "\C-]" 'evil-jump-to-tag)
-(define-key evil-motion-state-map (kbd "C-b") 'evil-scroll-page-up)
-(define-key evil-motion-state-map (kbd "C-d") 'evil-scroll-down)
-(define-key evil-motion-state-map (kbd "C-e") 'evil-scroll-line-down)
-(define-key evil-motion-state-map (kbd "C-f") 'evil-scroll-page-down)
-(define-key evil-motion-state-map (kbd "C-o") 'evil-jump-backward)
-(define-key evil-motion-state-map (kbd "C-y") 'evil-scroll-line-up)
-(define-key evil-motion-state-map (kbd "RET") 'evil-ret)
-(define-key evil-motion-state-map "\\" 'evil-execute-in-emacs-state)
-(define-key evil-motion-state-map "z^" 'evil-scroll-top-line-to-bottom)
-(define-key evil-motion-state-map "z+" 'evil-scroll-bottom-line-to-top)
-(define-key evil-motion-state-map "zt" 'evil-scroll-line-to-top)
-;; TODO: z RET has an advanced form taking an count before the RET
-;; but this requires again a special state with a single command
-;; bound to RET
-(define-key evil-motion-state-map (vconcat "z" [return]) "zt^")
-(define-key evil-motion-state-map (kbd "z RET") (vconcat "z" [return]))
-(define-key evil-motion-state-map "zz" 'evil-scroll-line-to-center)
-(define-key evil-motion-state-map "z." "zz^")
-(define-key evil-motion-state-map "zb" 'evil-scroll-line-to-bottom)
-(define-key evil-motion-state-map "z-" "zb^")
-(define-key evil-motion-state-map "v" 'evil-visual-char)
-(define-key evil-motion-state-map "V" 'evil-visual-line)
-(define-key evil-motion-state-map "\C-v" 'evil-visual-block)
-(define-key evil-motion-state-map "gv" 'evil-visual-restore)
-(define-key evil-motion-state-map (kbd "C-^") 'evil-buffer)
-(define-key evil-motion-state-map [left] 'evil-backward-char)
-(define-key evil-motion-state-map [right] 'evil-forward-char)
-(define-key evil-motion-state-map [up] 'evil-previous-line)
-(define-key evil-motion-state-map [down] 'evil-next-line)
-(define-key evil-motion-state-map "zl" 'evil-scroll-column-right)
-(define-key evil-motion-state-map [?z right] "zl")
-(define-key evil-motion-state-map "zh" 'evil-scroll-column-left)
-(define-key evil-motion-state-map [?z left] "zh")
-(define-key evil-motion-state-map "zL" 'evil-scroll-right)
-(define-key evil-motion-state-map "zH" 'evil-scroll-left)
-(define-key evil-motion-state-map
-  (read-kbd-macro evil-toggle-key) 'evil-emacs-state)
-
-;; text objects
-(define-key evil-outer-text-objects-map "w" 'evil-a-word)
-(define-key evil-outer-text-objects-map "W" 'evil-a-WORD)
-(define-key evil-outer-text-objects-map "s" 'evil-a-sentence)
-(define-key evil-outer-text-objects-map "p" 'evil-a-paragraph)
-(define-key evil-outer-text-objects-map "b" 'evil-a-paren)
-(define-key evil-outer-text-objects-map "(" 'evil-a-paren)
-(define-key evil-outer-text-objects-map ")" 'evil-a-paren)
-(define-key evil-outer-text-objects-map "[" 'evil-a-bracket)
-(define-key evil-outer-text-objects-map "]" 'evil-a-bracket)
-(define-key evil-outer-text-objects-map "B" 'evil-a-curly)
-(define-key evil-outer-text-objects-map "{" 'evil-a-curly)
-(define-key evil-outer-text-objects-map "}" 'evil-a-curly)
-(define-key evil-outer-text-objects-map "<" 'evil-an-angle)
-(define-key evil-outer-text-objects-map ">" 'evil-an-angle)
-(define-key evil-outer-text-objects-map "'" 'evil-a-single-quote)
-(define-key evil-outer-text-objects-map "\"" 'evil-a-double-quote)
-(define-key evil-outer-text-objects-map "`" 'evil-a-back-quote)
-(define-key evil-outer-text-objects-map "t" 'evil-a-tag)
-(define-key evil-outer-text-objects-map "o" 'evil-a-symbol)
-(define-key evil-inner-text-objects-map "w" 'evil-inner-word)
-(define-key evil-inner-text-objects-map "W" 'evil-inner-WORD)
-(define-key evil-inner-text-objects-map "s" 'evil-inner-sentence)
-(define-key evil-inner-text-objects-map "p" 'evil-inner-paragraph)
-(define-key evil-inner-text-objects-map "b" 'evil-inner-paren)
-(define-key evil-inner-text-objects-map "(" 'evil-inner-paren)
-(define-key evil-inner-text-objects-map ")" 'evil-inner-paren)
-(define-key evil-inner-text-objects-map "[" 'evil-inner-bracket)
-(define-key evil-inner-text-objects-map "]" 'evil-inner-bracket)
-(define-key evil-inner-text-objects-map "B" 'evil-inner-curly)
-(define-key evil-inner-text-objects-map "{" 'evil-inner-curly)
-(define-key evil-inner-text-objects-map "}" 'evil-inner-curly)
-(define-key evil-inner-text-objects-map "<" 'evil-inner-angle)
-(define-key evil-inner-text-objects-map ">" 'evil-inner-angle)
-(define-key evil-inner-text-objects-map "'" 'evil-inner-single-quote)
-(define-key evil-inner-text-objects-map "\"" 'evil-inner-double-quote)
-(define-key evil-inner-text-objects-map "`" 'evil-inner-back-quote)
-(define-key evil-inner-text-objects-map "t" 'evil-inner-tag)
-(define-key evil-inner-text-objects-map "o" 'evil-inner-symbol)
-(define-key evil-motion-state-map "gn" 'evil-next-match)
-(define-key evil-motion-state-map "gN" 'evil-previous-match)
-
-(when evil-want-C-i-jump
-  (define-key evil-motion-state-map (kbd "C-i") 'evil-jump-forward))
-
-(when evil-want-C-u-scroll
-  (define-key evil-motion-state-map (kbd "C-u") 'evil-scroll-up))
-
-;;; Visual state
-
-(define-key evil-visual-state-map "A" 'evil-append)
-(define-key evil-visual-state-map "I" 'evil-insert)
-(define-key evil-visual-state-map "o" 'exchange-point-and-mark)
-(define-key evil-visual-state-map "O" 'evil-visual-exchange-corners)
-(define-key evil-visual-state-map "R" 'evil-change)
-(define-key evil-visual-state-map "u" 'evil-downcase)
-(define-key evil-visual-state-map "U" 'evil-upcase)
-(define-key evil-visual-state-map "z=" 'ispell-word)
-(define-key evil-visual-state-map "a" evil-outer-text-objects-map)
-(define-key evil-visual-state-map "i" evil-inner-text-objects-map)
-(define-key evil-visual-state-map (kbd "<insert>") 'undefined)
-(define-key evil-visual-state-map (kbd "<insertchar>") 'undefined)
-(define-key evil-visual-state-map [remap evil-repeat] 'undefined)
-(define-key evil-visual-state-map [escape] 'evil-exit-visual-state)
-
-;;; Operator-Pending state
-
-(define-key evil-operator-state-map "a" evil-outer-text-objects-map)
-(define-key evil-operator-state-map "i" evil-inner-text-objects-map)
-;; (define-key evil-operator-state-map [escape] 'keyboard-quit)
-
-;;; Insert state
-
-(defvar evil-insert-state-bindings
-  `(("\C-v" . quoted-insert)
-    ("\C-k" . evil-insert-digraph)
-    ("\C-o" . evil-execute-in-normal-state)
-    ("\C-r" . evil-paste-from-register)
-    ("\C-y" . evil-copy-from-above)
-    ("\C-e" . evil-copy-from-below)
-    ("\C-n" . evil-complete-next)
-    ("\C-p" . evil-complete-previous)
-    ("\C-x\C-n" . evil-complete-next-line)
-    ("\C-x\C-p" . evil-complete-previous-line)
-    ("\C-t" . evil-shift-right-line)
-    ("\C-d" . evil-shift-left-line)
-    ("\C-a" . evil-paste-last-insertion)
-    ([remap delete-backward-char] . evil-delete-backward-char-and-join)
-    ,(if evil-want-C-w-delete
-         '("\C-w" . evil-delete-backward-word)
-       '("\C-w" . evil-window-map))
-    ([mouse-2] . mouse-yank-primary))
-  "Evil's bindings for insert state (for
-`evil-insert-state-map'), excluding <delete>, <escape>, and
-`evil-toggle-key'.")
-
-(defun evil-update-insert-state-bindings (&optional _option-name remove force)
-  "Update bindings in `evil-insert-state-map'.
-If no arguments are given add the bindings specified in
-`evil-insert-state-bindings'. If REMOVE is non nil, remove only
-these bindings. Unless FORCE is non nil, this will not
-overwriting existing bindings, which means bindings will not be
-added if one already exists for a key and only default bindings
-are removed.
-
-Note that <delete>, <escape> and `evil-toggle-key' are not
-included in `evil-insert-state-bindings' by default."
-  (interactive)
-  (dolist (binding evil-insert-state-bindings)
-    (cond
-     ((and remove
-           (or force
-               ;; Only remove if the default binding has not changed
-               (eq (evil-lookup-key evil-insert-state-map (car binding))
-                   (cdr binding))))
-      (define-key evil-insert-state-map (car binding) nil))
-     ((and (null remove)
-           (or force
-               ;; Check to see that nothing is bound here before adding
-               (not (evil-lookup-key evil-insert-state-map (car binding)))))
-      (define-key evil-insert-state-map (car binding) (cdr binding))))))
-
-(define-key evil-insert-state-map [delete] 'delete-char)
-(define-key evil-insert-state-map [escape] 'evil-normal-state)
-(define-key evil-insert-state-map
-  (read-kbd-macro evil-toggle-key) 'evil-emacs-state)
-
-;;; Replace state
-
-(define-key evil-replace-state-map (kbd "DEL") 'evil-replace-backspace)
-(define-key evil-replace-state-map [escape] 'evil-normal-state)
-
-;;; Emacs state
-
-(define-key evil-emacs-state-map
-  (read-kbd-macro evil-toggle-key) 'evil-exit-emacs-state)
-
-(when evil-want-C-w-in-emacs-state
-  (define-key evil-emacs-state-map "\C-w" 'evil-window-map))
-
-;;; Mouse
-(define-key evil-motion-state-map [down-mouse-1] 'evil-mouse-drag-region)
-(define-key evil-visual-state-map [mouse-2] 'evil-exit-visual-and-repeat)
-(define-key evil-normal-state-map [mouse-2] 'mouse-yank-primary)
-
-;; Ex
-(define-key evil-motion-state-map ":" 'evil-ex)
-(define-key evil-motion-state-map "!" 'evil-shell-command)
-
-(evil-ex-define-cmd "e[dit]" 'evil-edit)
-(evil-ex-define-cmd "w[rite]" 'evil-write)
-(evil-ex-define-cmd "wa[ll]" 'evil-write-all)
-(evil-ex-define-cmd "sav[eas]" 'evil-save)
-(evil-ex-define-cmd "r[ead]" 'evil-read)
-(evil-ex-define-cmd "b[uffer]" 'evil-buffer)
-(evil-ex-define-cmd "bn[ext]" 'evil-next-buffer)
-(evil-ex-define-cmd "bp[revious]" 'evil-prev-buffer)
-(evil-ex-define-cmd "bN[ext]" "bprevious")
-(evil-ex-define-cmd "sb[uffer]" 'evil-split-buffer)
-(evil-ex-define-cmd "sbn[ext]" 'evil-split-next-buffer)
-(evil-ex-define-cmd "sbp[revious]" 'evil-split-prev-buffer)
-(evil-ex-define-cmd "sbN[ext]" "sbprevious")
-(evil-ex-define-cmd "buffers" 'buffer-menu)
-(evil-ex-define-cmd "files" 'evil-show-files)
-(evil-ex-define-cmd "ls" "buffers")
-
-(evil-ex-define-cmd "c[hange]" 'evil-change)
-(evil-ex-define-cmd "co[py]" 'evil-copy)
-(evil-ex-define-cmd "t" "copy")
-(evil-ex-define-cmd "m[ove]" 'evil-move)
-(evil-ex-define-cmd "d[elete]" 'evil-ex-delete)
-(evil-ex-define-cmd "y[ank]" 'evil-ex-yank)
-(evil-ex-define-cmd "go[to]" 'evil-goto-char)
-(evil-ex-define-cmd "j[oin]" 'evil-ex-join)
-(evil-ex-define-cmd "le[ft]" 'evil-align-left)
-(evil-ex-define-cmd "ri[ght]" 'evil-align-right)
-(evil-ex-define-cmd "ce[nter]" 'evil-align-center)
-(evil-ex-define-cmd "sp[lit]" 'evil-window-split)
-(evil-ex-define-cmd "vs[plit]" 'evil-window-vsplit)
-(evil-ex-define-cmd "new" 'evil-window-new)
-(evil-ex-define-cmd "ene[w]" 'evil-buffer-new)
-(evil-ex-define-cmd "vne[w]" 'evil-window-vnew)
-(evil-ex-define-cmd "clo[se]" 'evil-window-delete)
-(evil-ex-define-cmd "on[ly]" 'delete-other-windows)
-(evil-ex-define-cmd "q[uit]" 'evil-quit)
-(evil-ex-define-cmd "wq" 'evil-save-and-close)
-(evil-ex-define-cmd "quita[ll]" 'evil-quit-all)
-(evil-ex-define-cmd "qa[ll]" "quitall")
-(evil-ex-define-cmd "cq[uit]" 'evil-quit-all-with-error-code)
-(evil-ex-define-cmd "wqa[ll]" 'evil-save-and-quit)
-(evil-ex-define-cmd "xa[ll]" "wqall")
-(evil-ex-define-cmd "x[it]" 'evil-save-modified-and-close)
-(evil-ex-define-cmd "exi[t]" 'evil-save-modified-and-close)
-(evil-ex-define-cmd "bd[elete]" 'evil-delete-buffer)
-(evil-ex-define-cmd "bw[ipeout]" 'evil-delete-buffer)
-(evil-ex-define-cmd "g[lobal]" 'evil-ex-global)
-(evil-ex-define-cmd "v[global]" 'evil-ex-global-inverted)
-(evil-ex-define-cmd "norm[al]" 'evil-ex-normal)
-(evil-ex-define-cmd "s[ubstitute]" 'evil-ex-substitute)
-(evil-ex-define-cmd "&" 'evil-ex-repeat-substitute)
-(evil-ex-define-cmd "&&" 'evil-ex-repeat-substitute-with-flags)
-(evil-ex-define-cmd "~" 'evil-ex-repeat-substitute-with-search)
-(evil-ex-define-cmd "~&" 'evil-ex-repeat-substitute-with-search-and-flags)
-(evil-ex-define-cmd "registers" 'evil-show-registers)
-(evil-ex-define-cmd "marks" 'evil-show-marks)
-(evil-ex-define-cmd "delm[arks]" 'evil-delete-marks)
-(evil-ex-define-cmd "ju[mps]" 'evil-show-jumps)
-(evil-ex-define-cmd "noh[lsearch]" 'evil-ex-nohighlight)
-(evil-ex-define-cmd "f[ile]" 'evil-show-file-info)
-(evil-ex-define-cmd "<" 'evil-shift-left)
-(evil-ex-define-cmd ">" 'evil-shift-right)
-(evil-ex-define-cmd "=" 'evil-ex-line-number)
-(evil-ex-define-cmd "!" 'evil-shell-command)
-(evil-ex-define-cmd "@:" 'evil-ex-repeat)
-(evil-ex-define-cmd "mak[e]" 'evil-make)
-(evil-ex-define-cmd "cc" 'evil-goto-error)
-(evil-ex-define-cmd "cfir[st]" 'first-error)
-(evil-ex-define-cmd "cr[ewind]" 'first-error)
-(evil-ex-define-cmd "cn[ext]" 'next-error)
-(evil-ex-define-cmd "cp[revious]" 'previous-error)
-(evil-ex-define-cmd "set-initial-state" 'evil-ex-set-initial-state)
-(evil-ex-define-cmd "show-digraphs" 'evil-ex-show-digraphs)
-(evil-ex-define-cmd "sor[t]" 'evil-ex-sort)
-(evil-ex-define-cmd "res[ize]" 'evil-ex-resize)
-
-;; search command line
-(define-key evil-ex-search-keymap "\d" #'evil-ex-delete-backward-char)
-(define-key evil-ex-search-keymap "\C-r" 'evil-paste-from-register)
-(define-key evil-ex-search-keymap "\C-n" 'next-history-element)
-(define-key evil-ex-search-keymap "\C-p" 'previous-history-element)
-
-;; ex command line
-(define-key evil-ex-completion-map "\d" #'evil-ex-delete-backward-char)
-(define-key evil-ex-completion-map "\t" #'evil-ex-completion)
-(define-key evil-ex-completion-map [tab] #'evil-ex-completion)
-(define-key evil-ex-completion-map [remap completion-at-point] #'evil-ex-completion)
-(define-key evil-ex-completion-map "\C-a" 'evil-ex-completion)
-(define-key evil-ex-completion-map "\C-b" 'move-beginning-of-line)
-(define-key evil-ex-completion-map "\C-c" 'abort-recursive-edit)
-(define-key evil-ex-completion-map "\C-d" 'evil-ex-completion)
-(define-key evil-ex-completion-map "\C-g" 'abort-recursive-edit)
-(define-key evil-ex-completion-map "\C-k" 'evil-insert-digraph)
-(define-key evil-ex-completion-map "\C-l" 'evil-ex-completion)
-(define-key evil-ex-completion-map "\C-p" #'previous-complete-history-element)
-(define-key evil-ex-completion-map "\C-r" 'evil-paste-from-register)
-(define-key evil-ex-completion-map "\C-n" #'next-complete-history-element)
-(define-key evil-ex-completion-map "\C-u" 'evil-delete-whole-line)
-(define-key evil-ex-completion-map "\C-v" #'quoted-insert)
-(define-key evil-ex-completion-map "\C-w" 'backward-kill-word)
-(define-key evil-ex-completion-map [escape] 'abort-recursive-edit)
-(define-key evil-ex-completion-map [S-left] 'backward-word)
-(define-key evil-ex-completion-map [S-right] 'forward-word)
-(define-key evil-ex-completion-map [up] 'previous-complete-history-element)
-(define-key evil-ex-completion-map [down] 'next-complete-history-element)
-(define-key evil-ex-completion-map [prior] 'previous-history-element)
-(define-key evil-ex-completion-map [next] 'next-history-element)
-(define-key evil-ex-completion-map [return] 'exit-minibuffer)
-(define-key evil-ex-completion-map (kbd "RET") 'exit-minibuffer)
-
-;; evil-read-key
-(define-key evil-read-key-map (kbd "ESC") #'keyboard-quit)
-(define-key evil-read-key-map (kbd "C-]") #'keyboard-quit)
-(define-key evil-read-key-map (kbd "C-q") #'evil-read-quoted-char)
-(define-key evil-read-key-map (kbd "C-v") #'evil-read-quoted-char)
-(define-key evil-read-key-map (kbd "C-k") #'evil-read-digraph-char)
-(define-key evil-read-key-map "\r" "\n")
-
-;; command line window
-(evil-define-key 'normal
-  evil-command-window-mode-map (kbd "RET") 'evil-command-window-execute)
-(evil-define-key 'insert
-  evil-command-window-mode-map (kbd "RET") 'evil-command-window-execute)
-
-(provide 'evil-maps)
-
-;;; evil-maps.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-maps.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-pkg.el
@@ -1,8 +0,0 @@
-(define-package "evil" "20170904.1346" "Extensible Vi layer for Emacs."
-  '((emacs "24.1")
-    (undo-tree "0.6.3")
-    (goto-chg "1.6")
-    (cl-lib "0.5")))
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/evil-20170904.1346/evil-repeat.el
@@ -1,638 +0,0 @@
-;;; evil-repeat.el --- Repeat system
-
-;; Author: Frank Fischer <frank.fischer at mathematik.tu-chemnitz.de>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; A repeat begins when leaving Normal state; it ends when re-entering
-;; Normal state. The diagram below shows possible routes between
-;; Normal state (N), Insert state (I), Visual state (V),
-;; Operator-Pending state (O) and Replace state (R). (Emacs state
-;; is an exception: nothing is repeated in that state.)
-;;                              ___
-;;                             /   \
-;;                             | R |
-;;                             \___/
-;;                             ^   |
-;;                             |   |
-;;               ___           |___V           ___
-;;              /   \ <------- /   \ -------> /   \
-;;              | V |          | N |          | O |
-;;              \___/ -------> \___/ <------- \___/
-;;                  |          |   ^          |
-;;                  |          |   |          |
-;;                  |          V___|          |
-;;                  |          /   \          |
-;;                  +--------> | I | <--------+
-;;                             \___/
-;;
-;; The recording of a repeat is started in one of two cases: Either a
-;; command is about being executed (in pre-command-hook) or normal
-;; state is exited. The recording is stopped whenever a command has
-;; being completed and evil is in normal state afterwards. Therefore,
-;; a non-inserting command in normal-state is recorded as a single
-;; repeat unit. In contrast, if the command leaves normal state and
-;; starts insert-state, all commands that are executed until
-;; insert-state is left and normal state is reactivated are recorded
-;; together in one repeat unit. In other words, a repeat unit consists
-;; of all commands that are executed starting and ending in normal
-;; state.
-;;
-;; Not all commands are recorded. There are several commands that are
-;; completely ignored and other commands that even abort the currently
-;; active recording, e.g., commands that change the current buffer.
-;;
-;; During recording the repeat information is appended to the variable
-;; `evil-repeat-info', which is cleared when the recording
-;; starts. This accumulated repeat information is put into the
-;; `evil-repeat-ring' when the recording is finished. The dot command,
-;; `\[evil-repeat]' (`evil-repeat') replays the most recent entry in
-;; the ring, preceeding repeats can be replayed using
-;; `\[evil-repeat-pop]' (`evil-repeat-pop').
-;;
-;; Repeat information can be stored in almost arbitrary form. How the
-;; repeat information for each single command is recored is determined
-;; by the :repeat property of the command. This property has the
-;; following interpretation:
-;;
-;; t         record commands by storing the key-sequence that invoked it
-;; nil       ignore this command completely
-;; ignore    synonym to nil
-;; motion    command is recorded by storing the key-sequence but only in
-;;           insert state, otherwise it is ignored.
-;; abort     stop recording of repeat information immediately
-;; change    record commands by storing buffer changes
-;; SYMBOL    if SYMBOL is contained as key in `evil-repeat-types'
-;;           call the corresponding (function-)value, otherwise
-;;           call the function associated with SYMBOL. In both
-;;           cases the function should take exactly one argument
-;;           which is either 'pre or 'post depending on whether
-;;           the function is called before or after the execution
-;;           of the command.
-;;
-;; Therefore, using a certain SYMBOL one can write specific repeation
-;; functions for each command.
-;;
-;; Each value of ring `evil-repeat-info', i.e., each single repeat
-;; information must be one of the following two possibilities:
-;; If element is a sequence, it is regarded as a key-sequence to
-;; be repeated. Otherwise the element must be a list
-;; (FUNCTION PARAMS ...) which will be called using
-;; (apply FUNCTION PARAMS) whenever this repeat is being executed.
-;;
-;; A user supplied repeat function can use the functions
-;; `evil-record-repeat' to append further repeat-information of the
-;; form described above to `evil-repeat-info'. See the implementation
-;; of `evil-repeat-keystrokes' and `evil-repeat-changes' for examples.
-;; Those functions are called in different situations before and after
-;; the execution of a command. Each function should take one argument
-;; which can be either 'pre, 'post, 'pre-operator or 'post-operator
-;; specifying when the repeat function has been called. If the command
-;; is a usual command the function is called with 'pre before the
-;; command is executed and with 'post after the command has been
-;; executed.
-;;
-;; The repeat information is executed with `evil-execute-repeat-info',
-;; which passes key-sequence elements to `execute-kbd-macro' and
-;; executes other elements as defined above.  A special version is
-;; `evil-execute-repeat-info-with-count'.  This function works as
-;; `evil-execute-repeat-info', but replaces the count of the first
-;; command. This is done by parsing the key-sequence, ignoring all
-;; calls to `digit-prefix-argument' and `negative-argument', and
-;; prepending the count as a string to the vector of the remaining
-;; key-sequence.
-
-(require 'evil-states)
-
-;;; Code:
-
-(declare-function evil-visual-state-p "evil-visual")
-(declare-function evil-visual-range "evil-visual")
-(declare-function evil-visual-char "evil-visual")
-(declare-function evil-visual-line "evil-visual")
-(declare-function evil-visual-block "evil-visual")
-
-(defmacro evil-without-repeat (&rest body)
-  (declare (indent defun)
-           (debug t))
-  `(let ((pre-command-hook (remq 'evil-repeat-pre-hook pre-command-hook))
-         (post-command-hook (remq 'evil-repeat-post-hook post-command-hook)))
-     ,@body
-     (evil-repeat-abort)))
-
-(defsubst evil-repeat-recording-p ()
-  "Returns non-nil iff a recording is in progress."
-  (eq evil-recording-repeat t))
-
-(defun evil-repeat-start ()
-  "Start recording a new repeat into `evil-repeat-info'."
-  (evil-repeat-reset t)
-  (evil-repeat-record-buffer)
-  (when (evil-visual-state-p)
-    (let* ((range (evil-visual-range))
-           (beg (evil-range-beginning range))
-           (end (1- (evil-range-end range)))
-           (nfwdlines (evil-count-lines beg end)))
-      (evil-repeat-record
-       (cond
-        ((eq evil-visual-selection 'char)
-         (list #'evil-repeat-visual-char
-               nfwdlines
-               (- end
-                  (if (zerop nfwdlines)
-                      beg
-                    (save-excursion
-                      (goto-char end)
-                      (line-beginning-position))))))
-        ((eq evil-visual-selection 'line)
-         (list #'evil-repeat-visual-line nfwdlines))
-        ((eq evil-visual-selection 'block)
-         (list #'evil-repeat-visual-block
-               nfwdlines
-               (abs (- (evil-column beg) (evil-column end))))))))))
-
-(defun evil-repeat-stop ()
-  "Stop recording a repeat.
-Update `evil-repeat-ring' with the accumulated changes
-in `evil-repeat-info' and clear variables."
-  (unwind-protect
-      (when (evil-repeat-recording-p)
-        (setq evil-repeat-info
-              (evil-normalize-repeat-info evil-repeat-info))
-        (when (and evil-repeat-info evil-repeat-ring)
-          (ring-insert evil-repeat-ring evil-repeat-info)))
-    (evil-repeat-reset nil)))
-
-(defun evil-repeat-abort ()
-  "Abort current repeation."
-  (evil-repeat-reset 'abort))
-
-(defun evil-repeat-reset (flag)
-  "Clear all repeat recording variables.
-Set `evil-recording-repeat' to FLAG."
-  (setq evil-recording-repeat flag
-        evil-repeat-info nil
-        evil-repeat-buffer nil))
-
-(defsubst evil-repeat-record-position (&optional pos)
-  "Set `evil-repeat-pos' to POS or point."
-  (setq evil-repeat-pos (or pos (point))))
-
-(defun evil-repeat-record-buffer ()
-  "Set `evil-repeat-buffer' to the current buffer."
-  (unless (minibufferp)
-    (setq evil-repeat-buffer (current-buffer))))
-
-(defmacro evil-save-repeat-info (&rest body)
-  "Execute BODY, protecting the values of repeat variables."
-  (declare (indent defun)
-           (debug t))
-  `(let (evil-repeat-ring
-         evil-recording-repeat
-         evil-recording-current-command
-         evil-repeat-info
-         evil-repeat-changes
-         evil-repeat-pos
-         evil-repeat-keys
-         evil-repeat-buffer
-         this-command
-         last-command)
-     ,@body))
-
-(defun evil-repeat-different-buffer-p (&optional strict)
-  "Whether the buffer has changed in a repeat.
-If STRICT is non-nil, returns t if the previous buffer
-is unknown; otherwise returns t only if the previous
-buffer is known and different from the current buffer."
-  (and (or (buffer-live-p evil-repeat-buffer) strict)
-       (not (minibufferp))
-       (not (eq (current-buffer) evil-repeat-buffer))))
-
-(defun evil-repeat-type (command &optional default)
-  "Return the :repeat property of COMMAND.
-If COMMAND doesn't have this property, return DEFAULT."
-  (when (functionp command) ; ignore keyboard macros
-    (let* ((type (evil-get-command-property command :repeat default))
-           (repeat-type (assq type evil-repeat-types)))
-      (if repeat-type (cdr repeat-type) type))))
-
-(defun evil-repeat-force-abort-p (repeat-type)
-  "Returns non-nil iff the current command should abort the recording of repeat information."
-  (or (evil-repeat-different-buffer-p)           ; ... buffer changed
-      (eq repeat-type 'abort)                    ; ... explicitely forced
-      (eq evil-recording-repeat 'abort)          ; ... already aborted
-      (evil-emacs-state-p)                       ; ... in Emacs state
-      (and (evil-mouse-events-p (this-command-keys))  ; ... mouse events
-           (eq repeat-type nil))
-      (minibufferp)))                            ; ... minibuffer activated
-
-(defun evil-repeat-record (info)
-  "Add INFO to the end of `evil-repeat-info'."
-  (when (evil-repeat-recording-p)
-    (setq evil-repeat-info (nconc evil-repeat-info (list info)))))
-
-;; called from `evil-normal-state-exit-hook'
-(defun evil-repeat-start-hook ()
-  "Record a new repeat when exiting Normal state.
-Does not record in Emacs state or if the current command
-has :repeat nil."
-  (when (and (eq (evil-repeat-type this-command t) t)
-             (not (evil-emacs-state-p)))
-    (evil-repeat-start)))
-
-;; called from `pre-command-hook'
-(defun evil-repeat-pre-hook ()
-  "Prepare the current command for recording the repeation."
-  (when evil-local-mode
-    (let ((repeat-type (evil-repeat-type this-command t)))
-      (cond
-       ;; abort the repeat
-       ((evil-repeat-force-abort-p repeat-type)
-        ;; We mark the current record as being aborted, because there
-        ;; may be further pre-hooks following before the post-hook is
-        ;; called.
-        (evil-repeat-abort))
-       ;; ignore those commands completely
-       ((null repeat-type))
-       ;; record command
-       (t
-        ;; In normal-state or visual state, each command is a single
-        ;; repeation, therefore start a new repeation.
-        (when (or (evil-normal-state-p)
-                  (evil-visual-state-p))
-          (evil-repeat-start))
-        (setq evil-recording-current-command t)
-        (funcall repeat-type 'pre))))))
-(put 'evil-repeat-pre-hook 'permanent-local-hook t)
-
-;; called from `post-command-hook'
-(defun evil-repeat-post-hook ()
-  "Finish recording of repeat-information for the current-command."
-  (when (and evil-local-mode evil-recording-repeat)
-    (let ((repeat-type (evil-repeat-type this-command t)))
-      (cond
-       ;; abort the repeat
-       ((evil-repeat-force-abort-p repeat-type)
-        ;; The command has been aborted but is complete, so just reset
-        ;; the recording state.
-        (evil-repeat-reset nil))
-       ;; ignore if command should not be recorded or the current
-       ;; command is not being recorded
-       ((or (null repeat-type)
-            (not evil-recording-current-command)))
-       ;; record command
-       (t
-        (funcall repeat-type 'post)
-        ;; In normal state, the repeat sequence is complete, so record it.
-        (when (evil-normal-state-p)
-          (evil-repeat-stop)))))
-    ;; done with recording the current command
-    (setq evil-recording-current-command nil)))
-(put 'evil-repeat-post-hook 'permanent-local-hook t)
-
-(defun evil-clear-command-keys ()
-  "Clear `this-command-keys' and all information about the current command keys.
-Calling this function prevents further recording of the keys that
-invoked the current command"
-  (clear-this-command-keys t)
-  (setq evil-repeat-keys ""))
-
-(defun evil-this-command-keys (&optional post-cmd)
-  "Version of `this-command-keys' with finer control over prefix args."
-  (let ((arg (if post-cmd current-prefix-arg prefix-arg)))
-    (vconcat
-     (when (and (numberp arg)
-                ;; Only add prefix if no repeat info recorded yet
-                (null evil-repeat-info))
-       (string-to-vector (number-to-string arg)))
-     (this-single-command-keys))))
-
-(defun evil-repeat-keystrokes (flag)
-  "Repeation recording function for commands that are repeated by keystrokes."
-  (cond
-   ((eq flag 'pre)
-    (when evil-this-register
-      (evil-repeat-record
-       `(set evil-this-register ,evil-this-register)))
-    (setq evil-repeat-keys (evil-this-command-keys)))
-   ((eq flag 'post)
-    (evil-repeat-record (if (zerop (length (evil-this-command-keys t)))
-                            evil-repeat-keys
-                          (evil-this-command-keys t)))
-    ;; erase commands keys to prevent double recording
-    (evil-clear-command-keys))))
-
-(defun evil-repeat-motion (flag)
-  "Repeation for motions. Motions are recorded by keystroke but only in insert state."
-  (when (memq evil-state '(insert replace))
-    (evil-repeat-keystrokes flag)))
-
-(defun evil-repeat-changes (flag)
-  "Repeation recording function for commands that are repeated by buffer changes."
-  (cond
-   ((eq flag 'pre)
-    (add-hook 'after-change-functions #'evil-repeat-change-hook nil t)
-    (evil-repeat-start-record-changes))
-   ((eq flag 'post)
-    (remove-hook 'after-change-functions #'evil-repeat-change-hook t)
-    (evil-repeat-finish-record-changes))))
-
-;; called from the `after-change-functions' hook
-(defun evil-repeat-change-hook (beg end length)
-  "Record change information for current command."
-  (let ((repeat-type (evil-repeat-type this-command t)))
-    (when (and (evil-repeat-recording-p)
-               (eq repeat-type 'evil-repeat-changes)
-               (not (evil-emacs-state-p))
-               (not (evil-repeat-different-buffer-p t))
-               evil-state)
-      (unless (evil-repeat-recording-p)
-        (evil-repeat-start))
-      (evil-repeat-record-change (- beg evil-repeat-pos)
-                                 (buffer-substring beg end)
-                                 length))))
-(put 'evil-repeat-change-hook 'permanent-local-hook t)
-
-(defun evil-repeat-record-change (relpos ins ndel)
-  "Record the current buffer changes during a repeat.
-If CHANGE is specified, it is added to `evil-repeat-changes'."
-  (when (evil-repeat-recording-p)
-    (setq evil-repeat-changes
-          (nconc evil-repeat-changes (list (list relpos ins ndel))))))
-
-(defun evil-repeat-start-record-changes ()
-  "Starts the recording of a new set of buffer changes."
-  (setq evil-repeat-changes nil)
-  (evil-repeat-record-position))
-
-(defun evil-repeat-finish-record-changes ()
-  "Finishes the recording of buffer changes and records them as repeat."
-  (when (evil-repeat-recording-p)
-    (evil-repeat-record `(evil-execute-change
-                          ,evil-repeat-changes
-                          ,(- (point) evil-repeat-pos)))
-    (setq evil-repeat-changes nil)))
-
-(defun evil-repeat-insert-at-point (flag)
-  "Repeation recording function for commands that insert text in region.
-This records text insertion when a command inserts some text in a
-buffer between (point) and (mark)."
-  (cond
-   ((eq flag 'pre)
-    (add-hook 'after-change-functions #'evil-repeat-insert-at-point-hook nil t))
-   ((eq flag 'post)
-    (remove-hook 'after-change-functions #'evil-repeat-insert-at-point-hook t))))
-
-(defun evil-repeat-insert-at-point-hook (beg end length)
-  (let ((repeat-type (evil-repeat-type this-command t)))
-    (when (and (evil-repeat-recording-p)
-               (eq repeat-type 'evil-repeat-insert-at-point)
-               (not (evil-emacs-state-p))
-               (not (evil-repeat-different-buffer-p t))
-               evil-state)
-      (setq evil-repeat-pos beg)
-      (evil-repeat-record (list 'insert (buffer-substring beg end))))))
-(put 'evil-repeat-insert-at-point-hook 'permanent-local-hook t)
-
-(defun evil-normalize-repeat-info (repeat-info)
-  "Concatenate consecutive arrays in REPEAT-INFO.
-Returns a single array."
-  (let* ((result (cons nil nil))
-         (result-last result)
-         cur cur-last)
-    (dolist (rep repeat-info)
-      (cond
-       ((null rep))
-       ((arrayp rep)
-        (setq rep (listify-key-sequence rep))
-        (cond
-         (cur
-          (setcdr cur-last (cons rep nil))
-          (setq cur-last (cdr cur-last)))
-         (t
-          (setq cur (cons rep nil))
-          (setq cur-last cur))))
-       (t
-        (when cur
-          (setcdr result-last (cons (apply #'vconcat cur) nil))
-          (setq result-last (cdr result-last))
-          (setq cur nil))
-        (setcdr result-last (cons rep nil))
-        (setq result-last (cdr result-last)))))
-    (when cur
-      (setcdr result-last (cons (apply #'vconcat cur) nil)))
-    (cdr result)))
-
-(defun evil-repeat-visual-char (nfwdlines nfwdchars)
-  "Restores a character visual selection.
-If the selection is in a single line, the restored visual
-selection covers the same number of characters. If the selection
-covers several lines, the restored selection covers the same
-number of lines and the same number of characters in the last
-line as the original selection."
-  (evil-visual-char)
-  (when (> nfwdlines 0)
-    (forward-line nfwdlines))
-  (forward-char nfwdchars))
-
-(defun evil-repeat-visual-line (nfwdlines)
-  "Restores a character visual selection.
-If the selection is in a single line, the restored visual
-selection covers the same number of characters. If the selection
-covers several lines, the restored selection covers the same
-number of lines and the same number of characters in the last
-line as the original selection."
-  (evil-visual-line)
-  (forward-line nfwdlines))
-
-(defun evil-repeat-visual-block (nfwdlines nfwdchars)
-  "Restores a character visual selection.
-If the selection is in a single line, the restored visual
-selection covers the same number of characters. If the selection
-covers several lines, the restored selection covers the same
-number of lines and the same number of characters in the last
-line as the original selection."
-  (evil-visual-block)
-  (let ((col (current-column)))
-    (forward-line nfwdlines)
-    (move-to-column (+ col nfwdchars) t)))
-
-(defun evil-execute-change (changes rel-point)
-  "Executes as list of changes.
-
-CHANGES is a list of triples (REL-BEG INSERT-TEXT NDEL).
-REL-BEG is the relative position (to point) where the change
-takes place. INSERT-TEXT is the text to be inserted at that
-position and NDEL the number of characters to be deleted at that
-position before insertion.
-
-REL-POINT is the relative position to point before the changed
-where point should be placed after all changes."
-  (evil-save-repeat-info
-    (let ((point (point)))
-      (dolist (change changes)
-        (goto-char (+ point (nth 0 change)))
-        (delete-char (nth 2 change))
-        (insert (nth 1 change)))
-      (goto-char (+ point rel-point)))))
-
-(defun evil-execute-repeat-info (repeat-info)
-  "Executes a repeat-information REPEAT-INFO."
-  (evil-save-repeat-info
-    (dolist (rep repeat-info)
-      (cond
-       ((or (arrayp rep) (stringp rep))
-        (let ((input-method current-input-method)
-              (evil-input-method nil))
-          (deactivate-input-method)
-          (unwind-protect
-              (execute-kbd-macro rep)
-            (activate-input-method input-method))))
-       ((consp rep)
-        (when (and (= 3 (length rep))
-                   (eq (nth 0 rep) 'set)
-                   (eq (nth 1 rep) 'evil-this-register)
-                   (>= (nth 2 rep) ?0)
-                   (< (nth 2 rep) ?9))
-          (setcar (nthcdr 2 rep) (1+ (nth 2 rep))))
-        (apply (car rep) (cdr rep)))
-       (t
-        (error "Unexpected repeat-info: %S" rep))))))
-
-;; TODO: currently we prepend the replacing count before the
-;; key-sequence that calls the command. Can we use direct
-;; modification of prefix-arg instead? Does it work in
-;; conjunction with `execute-kbd-macro'?
-(defun evil-execute-repeat-info-with-count (count repeat-info)
-  "Repeat the repeat-information REPEAT-INFO with the count of
-the first command replaced by COUNT. The count is replaced if
-and only if COUNT is non-nil."
-  (evil-save-repeat-info
-    (cond
-     ;; do nothing (zero repeating)
-     ((and count (zerop count)))
-     ;; replace count
-     (count
-      (let ((evil-repeat-count count)
-            done)
-        (while (and repeat-info
-                    (arrayp (car repeat-info))
-                    (not done))
-          (let* ((count-and-cmd (evil-extract-count (pop repeat-info))))
-            (push (vconcat (number-to-string count)
-                           (nth 2 count-and-cmd)
-                           (nth 3 count-and-cmd))
-                  repeat-info)
-            (setq done t)))
-        (evil-execute-repeat-info repeat-info)))
-     ;; repeat with original count
-     (t
-      (evil-execute-repeat-info repeat-info)))))
-
-(evil-define-command evil-repeat (count &optional save-point)
-  "Repeat the last editing command with count replaced by COUNT.
-If SAVE-POINT is non-nil, do not move point."
-  :repeat ignore
-  :suppress-operator t
-  (interactive (list current-prefix-arg
-                     (not evil-repeat-move-cursor)))
-  (cond
-   ((null evil-repeat-ring)
-    (error "Already executing repeat"))
-   (save-point
-    (save-excursion
-      (evil-repeat count)))
-   (t
-    (unwind-protect
-        (let ((confirm-kill-emacs t)
-              (kill-buffer-hook
-               (cons #'(lambda ()
-                         (user-error "Cannot delete buffer in repeat command"))
-                     kill-buffer-hook))
-              (undo-pointer buffer-undo-list))
-          (evil-with-single-undo
-            (setq evil-last-repeat (list (point) count undo-pointer))
-            (evil-execute-repeat-info-with-count
-             count (ring-ref evil-repeat-ring 0))))
-      (evil-normal-state)))))
-
-;; TODO: the same issue concering disabled undos as for `evil-paste-pop'
-(evil-define-command evil-repeat-pop (count &optional save-point)
-  "Replace the just repeated command with a previously executed command.
-Only allowed after `evil-repeat', `evil-repeat-pop' or
-`evil-repeat-pop-next'. Uses the same repeat count that
-was used for the first repeat.
-
-The COUNT argument inserts the COUNT-th previous kill.
-If COUNT is negative, this is a more recent kill."
-  :repeat nil
-  :suppress-operator t
-  (interactive (list (prefix-numeric-value current-prefix-arg)
-                     (not evil-repeat-move-cursor)))
-  (cond
-   ((not (and (eq last-command #'evil-repeat)
-              evil-last-repeat))
-    (user-error "Previous command was not evil-repeat: %s" last-command))
-   (save-point
-    (save-excursion
-      (evil-repeat-pop count)))
-   (t
-    (unless (eq buffer-undo-list (nth 2 evil-last-repeat))
-      (evil-undo-pop))
-    (goto-char (car evil-last-repeat))
-    ;; rotate the repeat-ring
-    (while (> count 0)
-      (when evil-repeat-ring
-        (ring-insert-at-beginning evil-repeat-ring
-                                  (ring-remove evil-repeat-ring 0)))
-      (setq count (1- count)))
-    (while (< count 0)
-      (when evil-repeat-ring
-        (ring-insert evil-repeat-ring
-                     (ring-remove evil-repeat-ring)))
-      (setq count (1+ count)))
-    (setq this-command #'evil-repeat)
-    (evil-repeat (cadr evil-last-repeat)))))
-
-(evil-define-command evil-repeat-pop-next (count &optional save-point)
-  "Same as `evil-repeat-pop', but with negative COUNT."
-  :repeat nil
-  :suppress-operator t
-  (interactive (list (prefix-numeric-value current-prefix-arg)
-                     (not evil-repeat-move-cursor)))
-  (evil-repeat-pop (- count) save-point))
-
-(defadvice read-key-sequence (before evil activate)
-  "Record `this-command-keys' before it is reset."
-  (when (and (evil-repeat-recording-p)
-             evil-recording-current-command)
-    (let ((repeat-type (evil-repeat-type this-command t)))
-      (if (functionp repeat-type)
-          (funcall repeat-type 'post)))))
-
-(provide 'evil-repeat)
-
-;;; evil-repeat.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-repeat.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-search.el
@@ -1,1294 +0,0 @@
-;;; evil-search.el --- Search and substitute
-
-;; Author: Vegard Øye <vegard_oye at hotmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-(require 'evil-core)
-(require 'evil-common)
-(require 'evil-ex)
-
-;;; Code:
-
-(defun evil-select-search-module (option module)
-  "Change the search module according to MODULE.
-If MODULE is `isearch', then Emacs' isearch module is used.
-If MODULE is `evil-search', then Evil's own interactive
-search module is used."
-  (let ((search-functions
-         '(forward
-           backward
-           word-forward
-           word-backward
-           unbounded-word-forward
-           unbounded-word-backward
-           next
-           previous)))
-    (dolist (fun search-functions)
-      (let ((isearch (intern (format "evil-search-%s" fun)))
-            (evil-search (intern (format "evil-ex-search-%s" fun))))
-        (if (eq module 'isearch)
-            (substitute-key-definition
-             evil-search isearch evil-motion-state-map)
-          (substitute-key-definition
-           isearch evil-search evil-motion-state-map)))))
-  (set-default option module))
-
-;; this customization is here because it requires
-;; the knowledge of `evil-select-search-mode'
-(defcustom evil-search-module 'isearch
-  "The search module to be used."
-  :type '(radio (const :tag "Emacs built-in isearch." :value isearch)
-                (const :tag "Evil interactive search." :value evil-search))
-  :group 'evil
-  :set 'evil-select-search-module
-  :initialize 'evil-custom-initialize-pending-reset)
-
-(defun evil-push-search-history (string forward)
-  "Push STRING into the appropriate search history (determined by FORWARD)."
-  (let* ((history-var (if forward
-                          'evil-search-forward-history
-                        'evil-search-backward-history))
-         (history (symbol-value history-var)))
-    (unless (equal (car-safe history) string)
-      (set history-var (cons string history)))))
-
-(defun evil-search-incrementally (forward regexp-p)
-  "Search incrementally for user-entered text."
-  (let ((evil-search-prompt (evil-search-prompt forward))
-        (isearch-search-fun-function 'evil-isearch-function)
-        (point (point))
-        search-nonincremental-instead)
-    (setq isearch-forward forward)
-    (evil-save-echo-area
-      (evil-without-input-method-hooks
-       ;; set the input method locally rather than globally to ensure that
-       ;; isearch clears the input method when it's finished
-       (setq current-input-method evil-input-method)
-       (if forward
-           (isearch-forward regexp-p)
-         (isearch-backward regexp-p))
-       (evil-push-search-history isearch-string forward)
-       (setq current-input-method nil))
-      (when (/= (point) point)
-        ;; position the point at beginning of the match only if the call to
-        ;; `isearch' has really moved the point. `isearch' doesn't move the
-        ;; point only if "C-g" is hit twice to exit the search, in which case we
-        ;; shouldn't move the point either.
-        (when (and forward isearch-other-end)
-          (goto-char isearch-other-end))
-        (when (and (eq point (point))
-                   (not (string= isearch-string "")))
-          (if forward
-              (isearch-repeat-forward)
-            (isearch-repeat-backward))
-          (isearch-exit)
-          (when (and forward isearch-other-end)
-            (goto-char isearch-other-end)))
-        (evil-flash-search-pattern
-         (evil-search-message isearch-string forward))))))
-
-(defun evil-flash-search-pattern (string &optional all)
-  "Flash last search matches for duration of `evil-flash-delay'.
-If ALL is non-nil, flash all matches. STRING is a message
-to display in the echo area."
-  (let ((lazy-highlight-initial-delay 0)
-        (isearch-search-fun-function 'evil-isearch-function)
-        (isearch-case-fold-search case-fold-search)
-        (disable #'(lambda (&optional arg) (evil-flash-hook t))))
-    (when evil-flash-timer
-      (cancel-timer evil-flash-timer))
-    (unless (or (null string)
-                (string= string ""))
-      (evil-echo-area-save)
-      (evil-echo "%s" string)
-      (isearch-highlight (match-beginning 0) (match-end 0))
-      (when all
-        (setq isearch-lazy-highlight-wrapped nil
-              isearch-lazy-highlight-start (point)
-              isearch-lazy-highlight-end (point))
-        (isearch-lazy-highlight-new-loop)
-        (unless isearch-lazy-highlight-overlays
-          (isearch-lazy-highlight-update)))
-      (add-hook 'pre-command-hook #'evil-flash-hook nil t)
-      (add-hook 'evil-operator-state-exit-hook #'evil-flash-hook nil t)
-      (add-hook 'pre-command-hook #'evil-clean-isearch-overlays nil t)
-      (setq evil-flash-timer
-            (run-at-time evil-flash-delay nil disable)))))
-
-(defun evil-clean-isearch-overlays ()
-  "Clean isearch overlays unless `this-command' is search."
-  (remove-hook 'pre-command-hook #'evil-clean-isearch-overlays t)
-  (unless (memq this-command
-                '(evil-search-backward
-                  evil-search-forward
-                  evil-search-next
-                  evil-search-previous
-                  evil-search-word-backward
-                  evil-search-word-forward))
-    (isearch-clean-overlays)))
-(put 'evil-clean-isearch-overlays 'permanent-local-hook t)
-
-(defun evil-flash-hook (&optional force)
-  "Disable hightlighting if `this-command' is not search.
-Disable anyway if FORCE is t."
-  (when (or force
-            ;; to avoid flicker, don't disable highlighting
-            ;; if the next command is also a search command
-            (not (memq this-command
-                       '(evil-search-backward
-                         evil-search-forward
-                         evil-search-next
-                         evil-search-previous
-                         evil-search-word-backward
-                         evil-search-word-forward))))
-    (evil-echo-area-restore)
-    (isearch-dehighlight)
-    (setq isearch-lazy-highlight-last-string nil)
-    (lazy-highlight-cleanup t)
-    (when evil-flash-timer
-      (cancel-timer evil-flash-timer)))
-  (remove-hook 'pre-command-hook #'evil-flash-hook t)
-  (remove-hook 'evil-operator-state-exit-hook #'evil-flash-hook t))
-(put 'evil-flash-hook 'permanent-local-hook t)
-
-(defun evil-search-function (&optional forward regexp-p wrap)
-  "Return a search function.
-If FORWARD is nil, search backward, otherwise forward.
-If REGEXP-P is non-nil, the input is a regular expression.
-If WRAP is non-nil, the search wraps around the top or bottom
-of the buffer."
-  `(lambda (string &optional bound noerror count)
-     (let ((start (point))
-           (search-fun ',(if regexp-p
-                             (if forward
-                                 're-search-forward
-                               're-search-backward)
-                           (if forward
-                               'search-forward
-                             'search-backward)))
-           result)
-       (setq result (funcall search-fun string bound
-                             ,(if wrap t 'noerror) count))
-       (when (and ,wrap (null result))
-         (goto-char ,(if forward '(point-min) '(point-max)))
-         (unwind-protect
-             (setq result (funcall search-fun string bound noerror count))
-           (unless result
-             (goto-char start))))
-       result)))
-
-(defun evil-isearch-function ()
-  "Return a search function for use with isearch.
-Based on `isearch-regexp' and `isearch-forward'."
-  (evil-search-function isearch-forward evil-regexp-search evil-search-wrap))
-
-(defun evil-search (string forward &optional regexp-p start)
-  "Search for STRING and highlight matches.
-If FORWARD is nil, search backward, otherwise forward.
-If REGEXP-P is non-nil, STRING is taken to be a regular expression.
-START is the position to search from; if unspecified, it is
-one more than the current position."
-  (when (and (stringp string)
-             (not (string= string "")))
-    (let* ((orig (point))
-           (start (or start
-                      (if forward
-                          (min (point-max) (1+ orig))
-                        orig)))
-           (isearch-regexp regexp-p)
-           (isearch-forward forward)
-           (case-fold-search
-            (unless (and search-upper-case
-                         (not (isearch-no-upper-case-p string nil)))
-              case-fold-search))
-           (search-func (evil-search-function
-                         forward regexp-p evil-search-wrap)))
-      ;; no text properties, thank you very much
-      (set-text-properties 0 (length string) nil string)
-      ;; position to search from
-      (goto-char start)
-      (setq isearch-string string)
-      (isearch-update-ring string regexp-p)
-      (condition-case nil
-          (funcall search-func string)
-        (search-failed
-         (goto-char orig)
-         (user-error "\"%s\": %s not found"
-                     string (if regexp-p "pattern" "string"))))
-      ;; handle opening and closing of invisible area
-      (cond
-       ((boundp 'isearch-filter-predicates)
-        (dolist (pred isearch-filter-predicates)
-          (funcall pred (match-beginning 0) (match-end 0))))
-       ((boundp 'isearch-filter-predicate)
-        (funcall isearch-filter-predicate (match-beginning 0) (match-end 0))))
-      ;; always position point at the beginning of the match
-      (goto-char (match-beginning 0))
-      ;; determine message for echo area
-      (cond
-       ((and forward (< (point) start))
-        (setq string "Search wrapped around BOTTOM of buffer"))
-       ((and (not forward) (> (point) start))
-        (setq string "Search wrapped around TOP of buffer"))
-       (t
-        (setq string (evil-search-message string forward))))
-      (evil-flash-search-pattern string t))))
-
-(defun evil-search-word (forward unbounded symbol)
-  "Search for word near point.
-If FORWARD is nil, search backward, otherwise forward. If SYMBOL
-is non-nil then the functions searches for the symbol at point,
-otherwise for the word at point."
-  (let ((string (car-safe regexp-search-ring))
-        (move (if forward #'forward-char #'backward-char))
-        (end (if forward #'eobp #'bobp)))
-    (setq isearch-forward forward)
-    (cond
-     ((and (memq last-command
-                 '(evil-search-word-forward
-                   evil-search-word-backward))
-           (stringp string)
-           (not (string= string "")))
-      (evil-search string forward t))
-     (t
-      (setq string (evil-find-thing forward (if symbol 'symbol 'evil-word)))
-      (cond
-       ((null string)
-        (user-error "No word under point"))
-       (unbounded
-        (setq string (regexp-quote string)))
-       (t
-        (setq string
-              (format (if symbol "\\_<%s\\_>" "\\<%s\\>")
-                      (regexp-quote string)))))
-      (evil-push-search-history string forward)
-      (evil-search string forward t)))))
-
-(defun evil-find-thing (forward thing)
-  "Return THING near point as a string.
-THING should be a symbol understood by `thing-at-point',
-e.g. 'symbol or 'word.  If FORWARD is nil, search backward,
-otherwise forward.  Returns nil if nothing is found."
-  (let ((move (if forward #'forward-char #'backward-char))
-        (end (if forward #'eobp #'bobp))
-        string)
-    (save-excursion
-      (setq string (thing-at-point thing))
-      ;; if there's nothing under point, go forwards
-      ;; (or backwards) to find it
-      (while (and (null string) (not (funcall end)))
-        (funcall move)
-        (setq string (thing-at-point thing)))
-      (when (stringp string)
-        (set-text-properties 0 (length string) nil string))
-      (when (> (length string) 0)
-        string))))
-
-(defun evil-find-word (forward)
-  "Return word near point as a string.
-If FORWARD is nil, search backward, otherwise forward.  Returns
-nil if nothing is found."
-  (evil-find-thing forward 'word))
-
-(defun evil-find-symbol (forward)
-  "Return word near point as a string.
-If FORWARD is nil, search backward, otherwise forward.  Returns
-nil if nothing is found."
-  (evil-find-thing forward 'symbol))
-
-(defun evil-search-prompt (forward)
-  "Return the search prompt for the given direction."
-  (if forward "/" "?"))
-
-(defun evil-search-message (string forward)
-  "Prefix STRING with the search prompt."
-  (format "%s%s" (evil-search-prompt forward) string))
-
-(defadvice isearch-message-prefix (around evil activate)
-  "Use `evil-search-prompt'."
-  (if evil-search-prompt
-      (setq ad-return-value evil-search-prompt)
-    ad-do-it))
-
-(defadvice isearch-delete-char (around evil activate)
-  "Exit search if no search string."
-  (cond
-   ((and evil-search-prompt (string= isearch-string ""))
-    (let (search-nonincremental-instead)
-      (setq isearch-success nil)
-      (isearch-exit)))
-   (t
-    ad-do-it)))
-
-(defadvice isearch-lazy-highlight-search (around evil activate)
-  "Never wrap the search in this context."
-  (let (evil-search-wrap)
-    ad-do-it))
-
-;;; Ex search
-
-(defun evil-ex-regex-without-case (re)
-  "Return the regular expression without all occurrences of \\c and \\C."
-  (evil-transform-regexp re '((?c . "") (?C . ""))))
-
-(defun evil-ex-regex-case (re default-case)
-  "Return the case as implied by \\c or \\C in regular expression RE.
-If \\c appears anywhere in the pattern, the pattern is case
-insensitive. If \\C appears, the pattern is case sensitive.
-Only the first occurrence of \\c or \\C is used, all others are
-ignored. If neither \\c nor \\C appears in the pattern, the case
-specified by DEFAULT-CASE is used. DEFAULT-CASE should be either
-`sensitive', `insensitive' or `smart'. In the latter case, the pattern
-will be case-sensitive if and only if it contains an upper-case
-letter, otherwise it will be case-insensitive."
-  (cond
-   ((string-match "\\(?:^\\|[^\\\\]\\)\\(?:\\\\\\\\\\)*\\\\\\([cC]\\)" re)
-    (if (eq (aref (match-string 1 re) 0) ?c) 'insensitive 'sensitive))
-   ((eq default-case 'smart)
-    (if (isearch-no-upper-case-p re t)
-        'insensitive
-      'sensitive))
-   (t default-case)))
-
-;; a pattern
-(defun evil-ex-make-substitute-pattern (regexp flags)
-  "Creates a PATTERN for substitution with FLAGS.
-This function respects the values of `evil-ex-substitute-case'
-and `evil-ex-substitute-global'."
-  (evil-ex-make-pattern regexp
-                        (cond
-                         ((memq ?i flags) 'insensitive)
-                         ((memq ?I flags) 'sensitive)
-                         ((not evil-ex-substitute-case)
-                          evil-ex-search-case)
-                         (t evil-ex-substitute-case))
-                        (or (and evil-ex-substitute-global
-                                 (not (memq ?g flags)))
-                            (and (not evil-ex-substitute-global)
-                                 (memq ?g flags)))))
-
-(defun evil-ex-make-search-pattern (regexp)
-  "Creates a PATTERN for search.
-This function respects the values of `evil-ex-search-case'."
-  (evil-ex-make-pattern regexp evil-ex-search-case t))
-
-(defun evil-ex-make-pattern (regexp case whole-line)
-  "Create a new search pattern.
-REGEXP is the regular expression to be searched for. CASE should
-be either 'sensitive, 'insensitive for case-sensitive and
-case-insensitive search, respectively, or anything else.  In the
-latter case the pattern is smart-case, i.e. it is automatically
-sensitive of the pattern contains one upper case letter,
-otherwise it is insensitive.  The input REGEXP is considered a
-Vim-style regular expression if `evil-ex-search-vim-style-regexp'
-is non-nil, in which case it is transformed to an Emacs style
-regular expression (i.e. certain backslash-codes are
-transformed. Otherwise REGEXP must be an Emacs style regular
-expression and is not transformed."
-  (let ((re (evil-ex-regex-without-case regexp))
-        (ignore-case (eq (evil-ex-regex-case regexp case) 'insensitive)))
-    ;; possibly transform regular expression from vim-style to
-    ;; Emacs-style.
-    (if evil-ex-search-vim-style-regexp
-        (setq re (evil-transform-vim-style-regexp re))
-      ;; Even for Emacs regular expressions we translate certain
-      ;; whitespace sequences
-      (setq re (evil-transform-regexp re
-                                      '((?t . "\t")
-                                        (?n . "\n")
-                                        (?r . "\r")))))
-    (list re ignore-case whole-line)))
-
-(defun evil-ex-pattern-regex (pattern)
-  "Return the regular expression of a search PATTERN."
-  (nth 0 pattern))
-
-(defun evil-ex-pattern-ignore-case (pattern)
-  "Return t if and only if PATTERN should ignore case."
-  (nth 1 pattern))
-
-(defun evil-ex-pattern-whole-line (pattern)
-  "Return t if and only if PATTERN should match all occurences of a line.
-Otherwise PATTERN matches only the first occurence."
-  (nth 2 pattern))
-
-;; Highlight
-(defun evil-ex-make-hl (name &rest args)
-  "Create a new highlight object with name NAME and properties ARGS.
-The following properties are supported:
-:face The face to be used for the highlighting overlays.
-:win The window in which the highlighting should be shown.
-     Note that the highlight will be visible in all windows showing
-     the corresponding buffer, but only the matches visible in the
-     specified window will actually be highlighted. If :win is nil,
-     the matches in all windows will be highlighted.
-:min The minimal buffer position for highlighted matches.
-:max The maximal buffer position for highlighted matches.
-:match-hook A hook to be called once for each highlight.
-            The hook must take two arguments, the highlight and
-            the overlay for that highlight.
-:update-hook A hook called once after updating the highlighting
-             with two arguments, the highlight and a message string
-             describing the current match status."
-  (unless (symbolp name)
-    (user-error "Expected symbol as name of highlight"))
-  (let ((face 'evil-ex-lazy-highlight)
-        (win (selected-window))
-        min max match-hook update-hook)
-    (while args
-      (let ((key (pop args))
-            (val (pop args)))
-        (cond
-         ((eq key :face) (setq face val))
-         ((eq key :win)  (setq win val))
-         ((eq key :min)  (setq min val))
-         ((eq key :max)  (setq max val))
-         ((eq key :match-hook) (setq match-hook val))
-         ((eq key :update-hook) (setq update-hook val))
-         (t (user-error "Unexpected keyword: %s" key)))))
-    (when (assoc name evil-ex-active-highlights-alist)
-      (evil-ex-delete-hl name))
-    (when (null evil-ex-active-highlights-alist)
-      (add-hook 'window-scroll-functions
-                #'evil-ex-hl-update-highlights-scroll nil t)
-      (add-hook 'window-size-change-functions
-                #'evil-ex-hl-update-highlights-resize nil))
-    (push (cons name (vector name
-                             nil
-                             face
-                             win
-                             min
-                             max
-                             match-hook
-                             update-hook
-                             nil))
-          evil-ex-active-highlights-alist)))
-
-(defun evil-ex-hl-name (hl)
-  "Return the name of the highlight HL."
-  (aref hl 0))
-
-(defun evil-ex-hl-pattern (hl)
-  "Return the pattern of the highlight HL."
-  (aref hl 1))
-
-(defun evil-ex-hl-set-pattern (hl pattern)
-  "Set the pattern of the highlight HL to PATTERN."
-  (aset hl 1 pattern))
-
-(defun evil-ex-hl-face (hl)
-  "Return the face of the highlight HL."
-  (aref hl 2))
-
-(defun evil-ex-hl-window (hl)
-  "Return the window of the highlight HL."
-  (aref hl 3))
-
-(defun evil-ex-hl-min (hl)
-  "Return the minimal buffer position of the highlight HL."
-  (aref hl 4))
-
-(defun evil-ex-hl-set-min (hl min)
-  "Set the minimal buffer position of the highlight HL to MIN."
-  (aset hl 4 min))
-
-(defun evil-ex-hl-max (hl)
-  "Return the maximal buffer position of the highlight HL."
-  (aref hl 5))
-
-(defun evil-ex-hl-set-max (hl max)
-  "Set the minimal buffer position of the highlight HL to MAX."
-  (aset hl 5 max))
-
-(defun evil-ex-hl-match-hook (hl)
-  "Return the match-hook of the highlight HL."
-  (aref hl 6))
-
-(defun evil-ex-hl-update-hook (hl)
-  "Return the update-hook of the highlight HL."
-  (aref hl 7))
-
-(defun evil-ex-hl-overlays (hl)
-  "Return the list of active overlays of the highlight HL."
-  (aref hl 8))
-
-(defun evil-ex-hl-set-overlays (hl overlays)
-  "Set the list of active overlays of the highlight HL to OVERLAYS."
-  (aset hl 8 overlays))
-
-(defun evil-ex-delete-hl (name)
-  "Remove the highlighting object with a certain NAME."
-  (let ((hl (cdr-safe (assoc name evil-ex-active-highlights-alist))))
-    (when hl
-      (mapc #'delete-overlay (evil-ex-hl-overlays hl))
-      (setq evil-ex-active-highlights-alist
-            (assq-delete-all name evil-ex-active-highlights-alist))
-      (evil-ex-hl-update-highlights))
-    (when (null evil-ex-active-highlights-alist)
-      (remove-hook 'window-scroll-functions
-                   #'evil-ex-hl-update-highlights-scroll t)
-      (remove-hook 'window-size-change-functions
-                   #'evil-ex-hl-update-highlights-resize))))
-
-(defun evil-ex-hl-active-p (name)
-  "Whether the highlight with a certain NAME is active."
-  (and (assoc name evil-ex-active-highlights-alist) t))
-
-(defun evil-ex-hl-change (name pattern)
-  "Set the regular expression of highlight NAME to PATTERN."
-  (let ((hl (cdr-safe (assoc name evil-ex-active-highlights-alist))))
-    (when hl
-      (evil-ex-hl-set-pattern hl
-                              (if (zerop (length pattern))
-                                  nil
-                                pattern))
-      (evil-ex-hl-idle-update))))
-
-(defun evil-ex-hl-set-region (name beg end &optional type)
-  "Set minimal and maximal position of highlight NAME to BEG and END."
-  (let ((hl (cdr-safe (assoc name evil-ex-active-highlights-alist))))
-    (when hl
-      (evil-ex-hl-set-min hl beg)
-      (evil-ex-hl-set-max hl end)
-      (evil-ex-hl-idle-update))))
-
-(defun evil-ex-hl-get-max (name)
-  "Return the maximal position of the highlight with name NAME."
-  (let ((hl (cdr-safe (assoc name evil-ex-active-highlights-alist))))
-    (and hl (evil-ex-hl-max hl))))
-
-(defun evil-ex-hl-update-highlights ()
-  "Update the overlays of all active highlights."
-  (dolist (hl (mapcar #'cdr evil-ex-active-highlights-alist))
-    (let* ((old-ovs (evil-ex-hl-overlays hl))
-           new-ovs
-           (pattern (evil-ex-hl-pattern hl))
-           (case-fold-search (evil-ex-pattern-ignore-case pattern))
-           (case-replace case-fold-search)
-           (face (evil-ex-hl-face hl))
-           (match-hook (evil-ex-hl-match-hook hl))
-           result)
-      (if pattern
-          ;; collect all visible ranges
-          (let (ranges sranges)
-            (dolist (win (if (eq evil-ex-interactive-search-highlight
-                                 'all-windows)
-                             (get-buffer-window-list (current-buffer) nil t)
-                           (list (evil-ex-hl-window hl))))
-              (let ((beg (max (window-start win)
-                              (or (evil-ex-hl-min hl) (point-min))))
-                    (end (min (window-end win)
-                              (or (evil-ex-hl-max hl) (point-max)))))
-                (when (< beg end)
-                  (push (cons beg end) ranges))))
-            (setq ranges
-                  (sort ranges #'(lambda (r1 r2) (< (car r1) (car r2)))))
-            (while ranges
-              (let ((r1 (pop ranges))
-                    (r2 (pop ranges)))
-                (cond
-                 ;; last range
-                 ((null r2)
-                  (push r1 sranges))
-                 ;; ranges overlap, union
-                 ((>= (cdr r1) (car r2))
-                  (push (cons (car r1)
-                              (max (cdr r1) (cdr r2)))
-                        ranges))
-                 ;; ranges distinct
-                 (t
-                  (push r1 sranges)
-                  (push r2 ranges)))))
-
-            ;; run through all ranges
-            (condition-case lossage
-                (save-match-data
-                  (dolist (r sranges)
-                    (let ((beg (car r))
-                          (end (cdr r)))
-                      (save-excursion
-                        (goto-char beg)
-                        ;; set the overlays for the current highlight,
-                        ;; reusing old overlays (if possible)
-                        (while (and (not (eobp))
-                                    (evil-ex-search-find-next-pattern pattern)
-                                    (<= (match-end 0) end)
-                                    (not (and (= (match-end 0) end)
-                                              (string= (evil-ex-pattern-regex pattern)
-                                                       "^"))))
-                          (let ((ov (or (pop old-ovs) (make-overlay 0 0))))
-                            (move-overlay ov (match-beginning 0) (match-end 0))
-                            (overlay-put ov 'face face)
-                            (overlay-put ov 'evil-ex-hl (evil-ex-hl-name hl))
-                            (overlay-put ov 'priority 1000)
-                            (push ov new-ovs)
-                            (when match-hook (funcall match-hook hl ov)))
-                          (cond
-                           ((and (not (evil-ex-pattern-whole-line pattern))
-                                 (not (string-match-p "\n" (buffer-substring-no-properties
-                                                            (match-beginning 0)
-                                                            (match-end 0)))))
-                            (forward-line))
-                           ((= (match-beginning 0) (match-end 0))
-                            (forward-char))
-                           (t (goto-char (match-end 0))))))))
-                  (mapc #'delete-overlay old-ovs)
-                  (evil-ex-hl-set-overlays hl new-ovs)
-                  (if (or (null pattern) new-ovs)
-                      (setq result t)
-                    ;; Maybe the match could just not be found somewhere else?
-                    (save-excursion
-                      (goto-char (or (evil-ex-hl-min hl) (point-min)))
-                      (if (and (evil-ex-search-find-next-pattern pattern)
-                               (< (match-end 0) (or (evil-ex-hl-max hl)
-                                                    (point-max))))
-                          (setq result (format "Match in line %d"
-                                               (line-number-at-pos
-                                                (match-beginning 0))))
-                        (setq result "No match")))))
-
-              (invalid-regexp
-               (setq result (cadr lossage)))
-
-              (search-failed
-               (setq result (nth 2 lossage)))
-
-              (error
-               (setq result (format "%s" (cadr lossage))))
-
-              (user-error
-               (setq result (format "%s" (cadr lossage))))))
-        ;; no pattern, remove all highlights
-        (mapc #'delete-overlay old-ovs)
-        (evil-ex-hl-set-overlays hl new-ovs))
-      (when (evil-ex-hl-update-hook hl)
-        (funcall (evil-ex-hl-update-hook hl) hl result)))))
-
-(defun evil-ex-search-find-next-pattern (pattern &optional direction)
-  "Look for the next occurrence of PATTERN in a certain DIRECTION.
-Note that this function ignores the whole-line property of PATTERN."
-  (setq direction (or direction 'forward))
-  (let ((case-fold-search (evil-ex-pattern-ignore-case pattern)))
-    (cond
-     ((eq direction 'forward)
-      (re-search-forward (evil-ex-pattern-regex pattern) nil t))
-     ((eq direction 'backward)
-      (let* ((pnt (point))
-             (ret (re-search-backward (evil-ex-pattern-regex pattern) nil t))
-             (m (and ret (match-data))))
-        (if ret
-            (forward-char)
-          (goto-char (point-min)))
-        (let ((fwdret
-               (re-search-forward (evil-ex-pattern-regex pattern) nil t)))
-          (cond
-           ((and fwdret (< (match-beginning 0) pnt))
-            (setq ret fwdret)
-            (goto-char (match-beginning 0)))
-           (ret
-            (set-match-data m)
-            (goto-char (match-beginning 0)))
-           (t
-            (goto-char pnt)
-            ret)))))
-     (t
-      (user-error "Unknown search direction: %s" direction)))))
-
-(defun evil-ex-hl-idle-update ()
-  "Triggers the timer to update the highlights in the current buffer."
-  (when (and evil-ex-interactive-search-highlight
-             evil-ex-active-highlights-alist)
-    (when evil-ex-hl-update-timer
-      (cancel-timer evil-ex-hl-update-timer))
-    (setq evil-ex-hl-update-timer
-          (run-at-time evil-ex-hl-update-delay nil
-                       #'evil-ex-hl-do-update-highlight
-                       (current-buffer)))))
-
-(defun evil-ex-hl-do-update-highlight (&optional buffer)
-  "Timer function for updating the highlights."
-  (when (buffer-live-p buffer)
-    (with-current-buffer buffer
-      (evil-ex-hl-update-highlights)))
-  (setq evil-ex-hl-update-timer nil))
-
-(defun evil-ex-hl-update-highlights-scroll (win beg)
-  "Update highlights after scrolling in some window."
-  (with-current-buffer (window-buffer win)
-    (evil-ex-hl-idle-update)))
-(put 'evil-ex-hl-update-highlights-scroll 'permanent-local-hook t)
-
-(defun evil-ex-hl-update-highlights-resize (frame)
-  "Update highlights after resizing a window."
-  (let ((buffers (delete-dups (mapcar #'window-buffer (window-list frame)))))
-    (dolist (buf buffers)
-      (with-current-buffer buf
-        (evil-ex-hl-idle-update)))))
-(put 'evil-ex-hl-update-highlights-resize 'permanent-local-hook t)
-
-;; interactive search
-(defun evil-ex-search-activate-highlight (pattern)
-  "Activate highlighting of the search pattern set to PATTERN.
-This function does nothing if `evil-ex-search-interactive' or
-`evil-ex-search-highlight-all' is nil. "
-  (when (and evil-ex-search-interactive evil-ex-search-highlight-all)
-    (with-current-buffer (or evil-ex-current-buffer (current-buffer))
-      (unless (evil-ex-hl-active-p 'evil-ex-search)
-        (evil-ex-make-hl 'evil-ex-search
-                         :win (minibuffer-selected-window)))
-      (if pattern
-          (evil-ex-hl-change 'evil-ex-search pattern)))))
-
-(defun evil-ex-search (&optional count)
-  "Search forward or backward COUNT times for the current ex search pattern.
-The search pattern is determined by `evil-ex-search-pattern' and
-the direcion is determined by `evil-ex-search-direction'."
-  (setq evil-ex-search-start-point (point)
-        evil-ex-last-was-search t
-        count (or count 1))
-  (let ((orig (point))
-        wrapped)
-    (dotimes (i (or count 1))
-      (when (eq evil-ex-search-direction 'forward)
-        (unless (eobp) (forward-char))
-        ;; maybe skip end-of-line
-        (when (and evil-move-cursor-back (eolp) (not (eobp)))
-          (forward-char)))
-      (let ((res (evil-ex-find-next nil nil (not evil-search-wrap))))
-        (cond
-         ((not res)
-          (goto-char orig)
-          (signal 'search-failed
-                  (list (evil-ex-pattern-regex evil-ex-search-pattern))))
-         ((eq res 'wrapped) (setq wrapped t)))))
-    (if wrapped
-        (let (message-log-max)
-          (message "Search wrapped")))
-    (goto-char (match-beginning 0))
-    (setq evil-ex-search-match-beg (match-beginning 0)
-          evil-ex-search-match-end (match-end 0))
-    (evil-ex-search-goto-offset evil-ex-search-offset)
-    (evil-ex-search-activate-highlight evil-ex-search-pattern)))
-
-(defun evil-ex-find-next (&optional pattern direction nowrap)
-  "Search for the next occurrence of the PATTERN in DIRECTION.
-PATTERN must be created using `evil-ex-make-pattern', DIRECTION
-is either 'forward or 'backward. If NOWRAP is non nil, the search
-does not wrap at buffer boundaries. Furthermore this function
-only searches invisible text if `search-invisible' is t. If
-PATTERN is not specified the current global pattern
-`evil-ex-search-pattern' and if DIRECTION is not specified the
-current global direction `evil-ex-search-direction' is used.
-This function returns t if the search was successful, nil if it
-was unsuccessful and 'wrapped if the search was successful but
-has been wrapped at the buffer boundaries."
-  (setq pattern (or pattern evil-ex-search-pattern)
-        direction (or direction evil-ex-search-direction))
-  (unless (and pattern (evil-ex-pattern-regex pattern))
-    (signal 'search-failed (list "No search pattern")))
-  (catch 'done
-    (let (wrapped)
-      (while t
-        (let ((search-result (evil-ex-search-find-next-pattern pattern
-                                                               direction)))
-          (cond
-           ((and search-result
-                 (or (eq search-invisible t)
-                     (not (isearch-range-invisible
-                           (match-beginning 0) (match-end 0)))))
-            ;; successful search and not invisible
-            (throw 'done (if wrapped 'wrapped t)))
-           ((not search-result)
-            ;; unsuccessful search
-            (if nowrap
-                (throw 'done nil)
-              (setq nowrap t
-                    wrapped t)
-              (goto-char (if (eq direction 'forward)
-                             (point-min)
-                           (point-max)))))))))))
-
-(defun evil-ex-search-update (pattern offset beg end message)
-  "Update the highlighting and info-message for the search pattern.
-PATTERN is the search pattern and OFFSET the associated offset.
-BEG and END specifiy the current match, MESSAGE is the info
-message to be shown. This function does nothing if
-`evil-ex-search-interactive' is nil."
-  (when evil-ex-search-interactive
-    (cond
-     ((and beg end)
-      ;; update overlay
-      (if evil-ex-search-overlay
-          (move-overlay evil-ex-search-overlay beg end)
-        (setq evil-ex-search-overlay
-              (make-overlay beg end))
-        (overlay-put evil-ex-search-overlay 'priority 1001)
-        (overlay-put evil-ex-search-overlay 'face 'evil-ex-search))
-      ;; move point
-      (goto-char beg)
-      (evil-ex-search-goto-offset offset)
-      ;; update highlights
-      (when evil-ex-search-highlight-all
-        (evil-ex-hl-change 'evil-ex-search pattern)))
-     (t
-      ;; no match
-      (when evil-ex-search-overlay
-        ;; remove overlay
-        (delete-overlay evil-ex-search-overlay)
-        (setq evil-ex-search-overlay nil))
-      ;; no highlights
-      (when evil-ex-search-highlight-all
-        (evil-ex-hl-change 'evil-ex-search nil))
-      ;; and go to initial position
-      (goto-char evil-ex-search-start-point)))
-    (when (stringp message)
-      (evil-ex-echo "%s" message))))
-
-(defun evil-ex-search-start-session ()
-  "Initialize Ex for interactive search."
-  (remove-hook 'minibuffer-setup-hook #'evil-ex-search-start-session)
-  (add-hook 'after-change-functions #'evil-ex-search-update-pattern nil t)
-  (add-hook 'minibuffer-exit-hook #'evil-ex-search-stop-session)
-  (evil-ex-search-activate-highlight nil))
-(put 'evil-ex-search-start-session 'permanent-local-hook t)
-
-(defun evil-ex-search-stop-session ()
-  "Stop interactive search."
-  (with-current-buffer evil-ex-current-buffer
-    ;; TODO: This is a bad fix to remove duplicates. The duplicates
-    ;;       exist because `isearch-range-invisible' may add a single
-    ;;       overlay multiple times if we are in an unlucky situation
-    ;;       of overlapping overlays. This happens in our case because
-    ;;       of the overlays that are used for (lazy) highlighting.
-    ;;       Perhaps it would be better to disable those overlays
-    ;;       temporarily before calling `isearch-range-invisible'.
-    (setq isearch-opened-overlays (delete-dups isearch-opened-overlays))
-    (isearch-clean-overlays))
-  (remove-hook 'minibuffer-exit-hook #'evil-ex-search-stop-session)
-  (remove-hook 'after-change-functions #'evil-ex-search-update-pattern t)
-  (when evil-ex-search-overlay
-    (delete-overlay evil-ex-search-overlay)
-    (setq evil-ex-search-overlay nil)))
-(put 'evil-ex-search-stop-session 'permanent-local-hook t)
-
-(defun evil-ex-split-search-pattern (pattern direction)
-  "Split PATTERN in regexp, offset and next-pattern parts.
-Returns a triple (regexp  offset next-search)."
-  (save-match-data
-    (if (or (and (eq direction 'forward)
-                 (string-match "\\(?:^\\|[^\\\\]\\)\\(?:\\\\\\\\\\)*\\(/\\([^;]*\\)\\(?:;\\([/?].*\\)?\\)?\\)?$"
-                               pattern))
-            (and (eq direction 'backward)
-                 (string-match "\\(?:^\\|[^\\\\]\\)\\(?:\\\\\\\\\\)*\\(\\?\\([^;]*\\)\\(?:;\\([/?].*\\)?\\)?\\)?$"
-                               pattern)))
-        (list (substring pattern 0 (match-beginning 1))
-              (match-string 2 pattern)
-              (match-string 3 pattern))
-      (list pattern nil nil))))
-
-(defun evil-ex-search-full-pattern (pattern-string count direction)
-  "Search for a full search pattern PATTERN-STRING in DIRECTION.
-This function split PATTERN-STRING in
-pattern/offset/;next-pattern parts and performs the search in
-DIRECTION which must be either 'forward or 'backward. The first
-search is repeated COUNT times. If the pattern part of
-PATTERN-STRING is empty, the last global pattern stored in
-`evil-ex-search-pattern' is used instead if in addition the
-offset part is nil (i.e. no pattern/offset separator), the last
-global offset stored in `evil-ex-search-offset' is used as
-offset. The current match data will correspond to the last
-successful match.  This function returns a triple (RESULT PATTERN
-OFFSET) where RESULT is
-
-  t              the search has been successful without wrap
-  'wrap          the search has been successful with wrap
-  'empty-pattern the last pattern has been empty
-  nil            the search has not been successful
-
-and PATTERN and OFFSET are the last pattern and offset this
-function searched for. Note that this function does not handle
-any error conditions."
-  (setq count (or count 1))
-  (catch 'done
-    (while t
-      (let* ((res (evil-ex-split-search-pattern pattern-string direction))
-             (pat (pop res))
-             (offset (pop res))
-             (next-pat (pop res)))
-        ;; use last pattern of no new pattern has been specified
-        (if (not (zerop (length pat)))
-            (setq pat (evil-ex-make-search-pattern pat))
-          (setq pat evil-ex-search-pattern
-                offset (or offset evil-ex-search-offset)))
-        (when (zerop (length pat))
-          (throw 'done (list 'empty-pattern pat offset)))
-        (let (search-result)
-          (while (> count 0)
-            (let ((result (evil-ex-find-next pat direction
-                                             (not evil-search-wrap))))
-              (if (not result) (setq search-result nil count 0)
-                (setq search-result
-                      (if (or (eq result 'wrap)
-                              (eq search-result 'wrap))
-                          'wrap t)
-                      count (1- count)))))
-          (cond
-           ;; search failed
-           ((not search-result) (throw 'done (list nil pat offset)))
-           ;; no next pattern, search complete
-           ((zerop (length next-pat))
-            (evil-ex-search-goto-offset offset)
-            (throw 'done (list search-result pat offset)))
-           ;; next pattern but empty
-           ((= 1 (length next-pat))
-            (evil-ex-search-goto-offset offset)
-            (throw 'done (list 'empty-pattern pat offset)))
-           ;; next non-empty pattern, next search iteration
-           (t
-            (evil-ex-search-goto-offset offset)
-            (setq count 1
-                  pattern-string (substring next-pat 1)
-                  direction (if (= (aref next-pat 0) ?/)
-                                'forward
-                              'backward)))))))))
-
-(defun evil-ex-search-update-pattern (beg end range)
-  "Update the current search pattern."
-  (save-match-data
-    (let ((pattern-string (minibuffer-contents)))
-      (with-current-buffer evil-ex-current-buffer
-        (with-selected-window (minibuffer-selected-window)
-          (goto-char (1+ evil-ex-search-start-point))
-          (condition-case err
-              (let* ((result (evil-ex-search-full-pattern pattern-string
-                                                          (or evil-ex-search-count 1)
-                                                          evil-ex-search-direction))
-                     (success (pop result))
-                     (pattern (pop result))
-                     (offset (pop result)))
-                (cond
-                 ((eq success 'wrap)
-                  (evil-ex-search-update pattern offset
-                                         (match-beginning 0) (match-end 0)
-                                         "Wrapped"))
-                 ((eq success 'empty-pattern)
-                  (evil-ex-search-update nil nil nil nil nil))
-                 (success
-                  (evil-ex-search-update pattern offset
-                                         (match-beginning 0) (match-end 0)
-                                         nil))
-                 (t
-                  (evil-ex-search-update nil nil
-                                         nil nil
-                                         "search failed"))))
-            (invalid-regexp
-             (evil-ex-search-update nil nil nil nil (cadr err)))
-            (error
-             (evil-ex-search-update nil nil nil nil (format "%s" err)))))))))
-(put 'evil-ex-search-update-pattern 'permanent-local-hook t)
-
-(defun evil-ex-search-exit ()
-  "Exit interactive search, keeping lazy highlighting active."
-  (interactive)
-  (evil-ex-search-stop-session)
-  (exit-minibuffer))
-
-(defun evil-ex-search-abort ()
-  "Abort interactive search, disabling lazy highlighting."
-  (interactive)
-  (evil-ex-search-stop-session)
-  (evil-ex-delete-hl 'evil-ex-search)
-  (abort-recursive-edit))
-
-(defun evil-ex-search-goto-offset (offset)
-  "Move point according to search OFFSET and set `evil-this-type' accordingly.
-This function assumes that the current match data represents the
-current search result."
-  (unless (zerop (length offset))
-    (let ((beg (match-beginning 0))
-          (end (match-end 0)))
-      (save-match-data
-        (unless
-            (string-match
-             "^\\([esb]\\)?\\(\\([-+]\\)?\\([0-9]*\\)\\)$"
-             offset)
-          (user-error "Invalid search offset: %s" offset))
-        (let ((count (if (= (match-beginning 4) (match-end 4))
-                         (cond
-                          ((not (match-beginning 3)) 0)
-                          ((= (aref offset (match-beginning 3)) ?+) +1)
-                          (t -1))
-                       (string-to-number (match-string 2 offset)))))
-          (cond
-           ((not (match-beginning 1))
-            (setq evil-this-type 'line)
-            (forward-line count))
-           ((= (aref offset (match-beginning 1)) ?e)
-            (goto-char (+ end count -1))
-            (setq evil-this-type 'inclusive))
-           ((memq (aref offset (match-beginning 1)) '(?s ?b))
-            (goto-char (+ beg count))
-            (setq evil-this-type 'inclusive))))))))
-
-(defun evil-ex-search-setup ()
-  "Hook to initialize the minibuffer for ex search."
-  (add-hook 'pre-command-hook #'evil-ex-remove-default))
-
-(defun evil-ex-start-search (direction count)
-  "Start a new search in a certain DIRECTION."
-  ;; store buffer and window where the search started
-  (let ((evil-ex-current-buffer (current-buffer)))
-    (setq evil-ex-search-count count
-          evil-ex-search-direction direction
-          evil-ex-search-start-point (point)
-          evil-ex-last-was-search t)
-    (progn
-      ;; ensure minibuffer is initialized accordingly
-      (add-hook 'minibuffer-setup-hook #'evil-ex-search-start-session)
-      ;; read the search string
-      (let* ((minibuffer-local-map evil-ex-search-keymap)
-             (search-string
-              (condition-case err
-                  (minibuffer-with-setup-hook
-                      #'evil-ex-search-setup
-                    (read-string (if (eq evil-ex-search-direction 'forward)
-                                     "/" "?")
-                                 (and evil-ex-search-history
-                                      (propertize
-                                       (car evil-ex-search-history)
-                                       'face 'shadow))
-                                 'evil-ex-search-history))
-                (quit
-                 (evil-ex-search-stop-session)
-                 (evil-ex-delete-hl 'evil-ex-search)
-                 (goto-char evil-ex-search-start-point)
-                 (signal (car err) (cdr err))))))
-        ;; pattern entered successful
-        (goto-char (1+ evil-ex-search-start-point))
-        (let* ((result
-                (evil-ex-search-full-pattern search-string
-                                             evil-ex-search-count
-                                             evil-ex-search-direction))
-               (success (pop result))
-               (pattern (pop result))
-               (offset (pop result)))
-          (setq evil-ex-search-pattern pattern
-                evil-ex-search-offset offset)
-          (cond
-           ((memq success '(t wrap))
-            (goto-char (match-beginning 0))
-            (setq evil-ex-search-match-beg (match-beginning 0)
-                  evil-ex-search-match-end (match-end 0))
-            (evil-ex-search-goto-offset offset)
-            (evil-push-search-history search-string (eq direction 'forward))
-            (unless evil-ex-search-persistent-highlight
-              (evil-ex-delete-hl 'evil-ex-search)))
-           (t
-            (goto-char evil-ex-search-start-point)
-            (evil-ex-delete-hl 'evil-ex-search)
-            (signal 'search-failed (list search-string)))))))))
-
-(defun evil-ex-start-word-search (unbounded direction count &optional symbol)
-  "Search for the symbol under point.
-The search matches the COUNT-th occurrence of the word.  If the
-UNBOUNDED argument is nil, the search matches only at symbol
-boundaries, otherwise it matches anywhere.  The DIRECTION
-argument should be either `forward' or `backward', determining
-the search direction. If SYMBOL is non-nil then the functions
-searches for the symbol at point, otherwise for the word at
-point."
-  (let ((string (evil-find-thing (eq direction 'forward)
-                                 (if symbol 'symbol 'word))))
-    (if (null string)
-        (user-error "No word under point")
-      (let ((regex (if unbounded
-                       (regexp-quote string)
-                     (format (if symbol "\\_<%s\\_>" "\\<%s\\>")
-                             (regexp-quote string)))))
-        (setq evil-ex-search-count count
-              evil-ex-search-direction direction
-              evil-ex-search-pattern
-              (evil-ex-make-search-pattern regex)
-              evil-ex-search-offset nil
-              evil-ex-last-was-search t)
-        ;; update search history unless this pattern equals the
-        ;; previous pattern
-        (unless (equal (car-safe evil-ex-search-history) regex)
-          (push regex evil-ex-search-history))
-        (evil-push-search-history regex (eq direction 'forward)))
-      (evil-ex-delete-hl 'evil-ex-search)
-      (when (fboundp 'evil-ex-search-next)
-        (evil-ex-search-next count)))))
-
-;; substitute
-(evil-ex-define-argument-type substitution
-  "A substitution pattern argument /pattern/replacement/flags.
-This handler highlights the pattern of the current substitution."
-  :runner
-  (lambda (flag &optional arg)
-    (with-selected-window (minibuffer-selected-window)
-      (with-current-buffer evil-ex-current-buffer
-        (cond
-         ((eq flag 'start)
-          (evil-ex-make-hl
-           'evil-ex-substitute
-           :face 'evil-ex-substitute-matches
-           :update-hook #'evil-ex-pattern-update-ex-info
-           :match-hook (and evil-ex-substitute-interactive-replace
-                            #'evil-ex-pattern-update-replacement))
-          (setq flag 'update))
-
-         ((eq flag 'stop)
-          (evil-ex-delete-hl 'evil-ex-substitute))))
-
-      (when (and (eq flag 'update)
-                 evil-ex-substitute-highlight-all
-                 (not (zerop (length arg))))
-        (condition-case lossage
-            (let* ((result (evil-ex-get-substitute-info arg t))
-                   (pattern (pop result))
-                   (replacement (pop result))
-                   (range (or (evil-copy-range evil-ex-range)
-                              (evil-range (line-beginning-position)
-                                          (line-end-position)
-                                          'line
-                                          :expanded t))))
-              (setq evil-ex-substitute-current-replacement replacement)
-              (evil-expand-range range)
-              (evil-ex-hl-set-region 'evil-ex-substitute
-                                     (evil-range-beginning range)
-                                     (evil-range-end range))
-              (evil-ex-hl-change 'evil-ex-substitute pattern))
-          (end-of-file
-           (evil-ex-pattern-update-ex-info nil
-                                           "incomplete replacement"))
-          (user-error
-           (evil-ex-pattern-update-ex-info nil
-                                           (format "%s" lossage))))))))
-
-(defun evil-ex-pattern-update-ex-info (hl result)
-  "Update the Ex info string."
-  (when (stringp result)
-    (evil-ex-echo "%s" result)))
-
-(defun evil-ex-pattern-update-replacement (hl overlay)
-  "Update the replacement display."
-  (when (fboundp 'match-substitute-replacement)
-    (let ((fixedcase (not case-replace))
-          repl)
-      (setq repl (if evil-ex-substitute-current-replacement
-                     (evil-match-substitute-replacement
-                      evil-ex-substitute-current-replacement
-                      fixedcase)
-                   ""))
-      (put-text-property 0 (length repl)
-                         'face 'evil-ex-substitute-replacement
-                         repl)
-      (overlay-put overlay 'after-string repl))))
-
-(defun evil-ex-parse-global (string)
-  "Parse STRING as a global argument."
-  (let* ((args (evil-delimited-arguments string 2))
-         (pattern (nth 0 args))
-         (command (nth 1 args)))
-    ;; use last pattern if none given
-    (when (zerop (length pattern))
-      (setq pattern
-            (cond
-             ((and (eq evil-search-module 'evil-search) evil-ex-search-pattern)
-              (evil-ex-pattern-regex evil-ex-search-pattern))
-             ((and (eq evil-search-module 'isearch) (not (zerop (length isearch-string))))
-              isearch-string)
-             (t (user-error "No previous pattern")))))
-    (list pattern command)))
-
-(defun evil-ex-get-substitute-info (string &optional implicit-r)
-  "Returns the substitution info of command line STRING.
-This function returns a three-element list \(PATTERN REPLACEMENT
-FLAGS) consisting of the substitution parts of STRING. PATTERN is
-a ex-pattern (see `evil-ex-make-pattern') and REPLACEMENT in a
-compiled replacement expression (see `evil-compile-replacement').
-The information returned is the actual substitution information
-w.r.t. to special situations like empty patterns or repetition of
-previous substitution commands. If IMPLICIT-R is non-nil, then
-the flag 'r' is assumed, i.e. in the case of an empty pattern the
-last search pattern is used. This will be used when called from
-a :substitute command with arguments."
-  (let (pattern replacement flags)
-    (cond
-     ((or (null string) (string-match "^[a-zA-Z]" string))
-      ;; starts with letter so there is no pattern because the
-      ;; separator must not be a letter repeat last substitute
-      (setq replacement evil-ex-substitute-replacement)
-      ;; flags are everything that is not a white space
-      (when (and string (string-match "[^[:space:]]+" string))
-        (setq flags (match-string 0 string))))
-     (t
-      (let ((args (evil-delimited-arguments string 3)))
-        (setq pattern (pop args)
-              replacement (pop args)
-              flags (pop args))
-        ;; if replacment equals "~" use previous replacement
-        (if (equal replacement "~")
-            (setq replacement evil-ex-substitute-replacement)
-          (setq replacement (evil-compile-replacement replacement)))
-        ;; append implicit "r" flag if required
-        (when (and implicit-r (not (memq ?r (append flags nil))))
-          (setq flags (concat flags "r"))))))
-    ;; if flags equals "&" add previous flags
-    (if (and (not (zerop (length flags)))
-             (= (aref flags 0) ?&))
-        (setq flags (append (substring flags 1)
-                            evil-ex-substitute-flags))
-      (setq flags (append flags nil)))
-    ;; if no pattern, use previous pattern, either search or
-    ;; substitute pattern depending on `evil-ex-last-was-search' and
-    ;; the r flag
-    (when (zerop (length pattern))
-      (setq pattern
-            (if (eq evil-search-module 'evil-search)
-                (if (and evil-ex-last-was-search (memq ?r flags))
-                    (and evil-ex-search-pattern
-                         (evil-ex-pattern-regex evil-ex-search-pattern))
-                  (and evil-ex-substitute-pattern
-                       (evil-ex-pattern-regex evil-ex-substitute-pattern)))
-              (if (eq case-fold-search t)
-                  isearch-string
-                (concat isearch-string "\\C")))
-            flags (remq ?r flags)))
-    ;; generate pattern
-    (when pattern
-      (setq pattern (evil-ex-make-substitute-pattern pattern flags)))
-    (list pattern replacement flags)))
-
-(defun evil-ex-nohighlight ()
-  "Disable the active search highlightings."
-  (interactive)
-  (evil-ex-delete-hl 'evil-ex-substitute)
-  (evil-ex-delete-hl 'evil-ex-search))
-
-(provide 'evil-search)
-
-;;; evil-search.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-search.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-states.el
@@ -1,905 +0,0 @@
-;;; evil-states.el --- States
-
-;; Author: Vegard Øye <vegard_oye at hotmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-(require 'evil-core)
-
-;;; Code:
-
-;;; Normal state
-
-(evil-define-state normal
-  "Normal state.
-AKA \"Command\" state."
-  :tag " <N> "
-  :enable (motion)
-  :exit-hook (evil-repeat-start-hook)
-  (cond
-   ((evil-normal-state-p)
-    (overwrite-mode -1)
-    (add-hook 'post-command-hook #'evil-normal-post-command nil t))
-   (t
-    (remove-hook 'post-command-hook #'evil-normal-post-command t))))
-
-(defun evil-normal-post-command (&optional command)
-  "Reset command loop variables in Normal state.
-Also prevent point from reaching the end of the line.
-If the region is activated, enter Visual state."
-  (unless (or (evil-initializing-p)
-              (null this-command))
-    (setq command (or command this-command))
-    (when (evil-normal-state-p)
-      (setq evil-this-type nil
-            evil-this-operator nil
-            evil-this-motion nil
-            evil-this-motion-count nil
-            evil-inhibit-operator nil
-            evil-inhibit-operator-value nil)
-      (unless (memq command '(evil-use-register
-                              digit-argument
-                              negative-argument
-                              universal-argument
-                              universal-argument-minus
-                              universal-argument-more
-                              universal-argument-other-key))
-        (setq evil-this-register nil))
-      (evil-adjust-cursor))))
-(put 'evil-normal-post-command 'permanent-local-hook t)
-
-;;; Insert state
-
-(defun evil-maybe-remove-spaces (&optional do-remove)
-  "Remove space from newly opened empty line.
-This function removes (indentation) spaces that have been
-inserted by opening a new empty line. The behavior depends on the
-variable `evil-maybe-remove-spaces'. If this variable is nil the
-function does nothing. Otherwise the behavior depends on
-DO-REMOVE.  If DO-REMOVE is non-nil the spaces are
-removed. Otherwise `evil-maybe-remove-spaces' is set to nil
-unless the last command opened yet another new line.
-
-This function should be added as a post-command-hook to track
-commands opening a new line."
-  (cond
-   ((not evil-maybe-remove-spaces)
-    (remove-hook 'post-command-hook #'evil-maybe-remove-spaces))
-   (do-remove
-    (when (save-excursion
-            (beginning-of-line)
-            (looking-at "^\\s-*$"))
-      (delete-region (line-beginning-position)
-                     (line-end-position)))
-    (setq evil-maybe-remove-spaces nil)
-    (remove-hook 'post-command-hook #'evil-maybe-remove-spaces))
-   ((not (memq this-command
-               '(evil-open-above
-                 evil-open-below
-                 evil-append
-                 evil-append-line
-                 newline
-                 newline-and-indent
-                 indent-and-newline)))
-    (setq evil-maybe-remove-spaces nil)
-    (remove-hook 'post-command-hook #'evil-maybe-remove-spaces))))
-
-(evil-define-state insert
-  "Insert state."
-  :tag " <I> "
-  :cursor (bar . 2)
-  :message "-- INSERT --"
-  :entry-hook (evil-start-track-last-insertion)
-  :exit-hook (evil-cleanup-insert-state evil-stop-track-last-insertion)
-  :input-method t
-  (cond
-   ((evil-insert-state-p)
-    (add-hook 'post-command-hook #'evil-maybe-remove-spaces)
-    (add-hook 'pre-command-hook #'evil-insert-repeat-hook)
-    (setq evil-maybe-remove-spaces t)
-    (unless (eq evil-want-fine-undo t)
-      (evil-start-undo-step)))
-   (t
-    (remove-hook 'post-command-hook #'evil-maybe-remove-spaces)
-    (remove-hook 'pre-command-hook #'evil-insert-repeat-hook)
-    (evil-maybe-remove-spaces t)
-    (setq evil-insert-repeat-info evil-repeat-info)
-    (evil-set-marker ?^ nil t)
-    (unless (eq evil-want-fine-undo t)
-      (evil-end-undo-step))
-    (when evil-move-cursor-back
-      (when (or (evil-normal-state-p evil-next-state)
-                (evil-motion-state-p evil-next-state))
-        (evil-move-cursor-back))))))
-
-(defun evil-insert-repeat-hook ()
-  "Record insertion keys in `evil-insert-repeat-info'."
-  (setq evil-insert-repeat-info (last evil-repeat-info))
-  (remove-hook 'pre-command-hook #'evil-insert-repeat-hook))
-(put 'evil-insert-repeat-hook 'permanent-local-hook t)
-
-(defun evil-cleanup-insert-state ()
-  "Called when Insert state is about to be exited.
-Handles the repeat-count of the insertion command."
-  (when evil-insert-count
-    (dotimes (i (1- evil-insert-count))
-      (when evil-insert-lines
-        (evil-insert-newline-below)
-        (when evil-auto-indent
-          (indent-according-to-mode)))
-      (when (fboundp 'evil-execute-repeat-info)
-        (evil-execute-repeat-info
-         (cdr evil-insert-repeat-info)))))
-  (when evil-insert-vcount
-    (let ((buffer-invisibility-spec buffer-invisibility-spec))
-      ;; make all lines hidden by hideshow temporarily visible
-      (when (listp buffer-invisibility-spec)
-        (setq buffer-invisibility-spec
-              (evil-filter-list
-               #'(lambda (x)
-                   (or (eq x 'hs)
-                       (eq (car-safe x) 'hs)))
-               buffer-invisibility-spec)))
-      (let ((line (nth 0 evil-insert-vcount))
-            (col (nth 1 evil-insert-vcount))
-            (vcount (nth 2 evil-insert-vcount)))
-        (save-excursion
-          (dotimes (v (1- vcount))
-            (goto-char (point-min))
-            (forward-line (+ line v))
-            (when (or (not evil-insert-skip-empty-lines)
-                      (not (integerp col))
-                      (save-excursion
-                        (evil-move-end-of-line)
-                        (>= (current-column) col)))
-              (if (integerp col)
-                  (move-to-column col t)
-                (funcall col))
-              (dotimes (i (or evil-insert-count 1))
-                (when (fboundp 'evil-execute-repeat-info)
-                  (evil-execute-repeat-info
-                   (cdr evil-insert-repeat-info)))))))))))
-
-;;; Visual state
-
-;; Visual selections are implemented in terms of types, and are
-;; compatible with the Emacs region. This is achieved by "translating"
-;; the region to the selected text right before a command is executed.
-;; If the command is a motion, the translation is postponed until a
-;; non-motion command is invoked (distinguished by the :keep-visual
-;; command property).
-;;
-;; Visual state activates the region, enabling Transient Mark mode if
-;; not already enabled. This is only temporay: if Transient Mark mode
-;; was disabled before entering Visual state, it is disabled when
-;; exiting Visual state. This allows Visual state to harness the
-;; "transient" behavior of many commands without overriding the user's
-;; preferences in other states.
-
-(defmacro evil-define-visual-selection (selection doc &rest body)
-  "Define a Visual selection SELECTION.
-Creates a command evil-visual-SELECTION for enabling the selection.
-DOC is the function's documentation string. The following keywords
-may be specified in BODY:
-
-:message STRING         Status message when enabling the selection.
-:type TYPE              Type to use (defaults to SELECTION).
-
-Following the keywords is optional code which is executed each time
-the selection is enabled.
-
-\(fn SELECTION DOC [[KEY VAL]...] BODY...)"
-  (declare (indent defun)
-           (debug (&define name stringp
-                           [&rest keywordp sexp]
-                           def-body)))
-  (let* ((name (intern (format "evil-visual-%s" selection)))
-         (message (intern (format "%s-message" name)))
-         (type selection)
-         arg key string)
-    ;; collect keywords
-    (while (keywordp (car-safe body))
-      (setq key (pop body)
-            arg (pop body))
-      (cond
-       ((eq key :message)
-        (setq string arg))
-       ((eq key :type)
-        (setq type arg))))
-    ;; macro expansion
-    `(progn
-       (add-to-list 'evil-visual-alist (cons ',selection ',name))
-       (defvar ,name ',type ,(format "*%s" doc))
-       (defvar ,message ,string ,doc)
-       (evil-define-command ,name (&optional mark point type message)
-         ,@(when doc `(,doc))
-         :keep-visual t
-         :repeat nil
-         (interactive
-          (list nil nil
-                (if (and (evil-visual-state-p)
-                         (eq evil-visual-selection ',selection))
-                    'exit ,name) t))
-         (if (eq type 'exit)
-             (evil-exit-visual-state)
-           (setq type (or type ,name)
-                 evil-visual-selection ',selection)
-           (evil-visual-make-region mark point type message)
-           ,@body))
-       ',selection)))
-
-(evil-define-visual-selection char
-  "Characterwise selection."
-  :type inclusive
-  :message "-- VISUAL --")
-
-(evil-define-visual-selection line
-  "Linewise selection."
-  :message "-- VISUAL LINE --")
-
-(evil-define-visual-selection block
-  "Blockwise selection."
-  :message "-- VISUAL BLOCK --"
-  (evil-transient-mark -1)
-  ;; refresh the :corner property
-  (setq evil-visual-properties
-        (plist-put evil-visual-properties :corner
-                   (evil-visual-block-corner 'upper-left))))
-
-(evil-define-state visual
-  "Visual state."
-  :tag " <V> "
-  :enable (motion normal)
-  :message 'evil-visual-message
-  (cond
-   ((evil-visual-state-p)
-    (evil-save-transient-mark-mode)
-    (setq select-active-regions nil)
-    (cond
-     ((region-active-p)
-      (if (< (evil-visual-direction) 0)
-          (evil-visual-select (region-beginning) (region-end)
-                              evil-visual-char
-                              (evil-visual-direction))
-        (evil-visual-make-selection (mark t) (point)
-                                    evil-visual-char))
-      (evil-visual-highlight))
-     (t
-      (evil-visual-make-region (point) (point) evil-visual-char)))
-    (add-hook 'pre-command-hook #'evil-visual-pre-command nil t)
-    (add-hook 'post-command-hook #'evil-visual-post-command nil t)
-    (add-hook 'deactivate-mark-hook #'evil-visual-deactivate-hook nil t))
-   (t
-    ;; Postpone deactivation of region if next state is Insert.
-    ;; This gives certain insertion commands (auto-pairing characters,
-    ;; for example) an opportunity to access the region.
-    (if (and (eq evil-next-state 'insert)
-             (eq evil-visual-selection 'char))
-        (add-hook 'evil-normal-state-entry-hook
-                  #'evil-visual-deactivate-hook nil t)
-      (evil-visual-deactivate-hook))
-    (setq evil-visual-region-expanded nil)
-    (remove-hook 'pre-command-hook #'evil-visual-pre-command t)
-    (remove-hook 'post-command-hook #'evil-visual-post-command t)
-    (remove-hook 'deactivate-mark-hook #'evil-visual-deactivate-hook t)
-    (evil-visual-highlight -1))))
-
-(defun evil-visual-pre-command (&optional command)
-  "Run before each COMMAND in Visual state.
-Expand the region to the selection unless COMMAND is a motion."
-  (when (evil-visual-state-p)
-    (setq command (or command this-command))
-    (when evil-visual-x-select-timer
-      (cancel-timer evil-visual-x-select-timer))
-    (unless (evil-get-command-property command :keep-visual)
-      (evil-visual-update-x-selection)
-      (evil-visual-expand-region
-       ;; exclude final newline from linewise selection
-       ;; unless the command has real need of it
-       (and (eq (evil-visual-type) 'line)
-            (evil-get-command-property command :exclude-newline))))))
-
-(put 'evil-visual-pre-command 'permanent-local-hook t)
-
-(defun evil-visual-post-command (&optional command)
-  "Run after each COMMAND in Visual state.
-If COMMAND is a motion, refresh the selection;
-otherwise exit Visual state."
-  (when (evil-visual-state-p)
-    (setq command (or command this-command))
-    (if (or quit-flag
-            (eq command #'keyboard-quit)
-            ;; Is `mark-active' nil for an unexpanded region?
-            deactivate-mark
-            (and (not evil-visual-region-expanded)
-                 (not (region-active-p))
-                 (not (eq evil-visual-selection 'block))))
-        (progn
-          (evil-exit-visual-state)
-          (evil-adjust-cursor))
-      (if evil-visual-region-expanded
-          (evil-visual-contract-region)
-        (evil-visual-refresh))
-      (setq evil-visual-x-select-timer
-            (run-with-idle-timer evil-visual-x-select-timeout nil
-                                 #'evil-visual-update-x-selection
-                                 (current-buffer)))
-      (evil-visual-highlight))))
-(put 'evil-visual-post-command 'permanent-local-hook t)
-
-(defun evil-visual-update-x-selection (&optional buffer)
-  "Update the X selection with the current visual region."
-  (let ((buf (or buffer (current-buffer))))
-    (when (buffer-live-p buf)
-      (with-current-buffer buf
-        (when (and (evil-visual-state-p)
-                   (fboundp 'x-select-text)
-                   (or (not (boundp 'ns-initialized))
-                       (with-no-warnings ns-initialized))
-                   (not (eq evil-visual-selection 'block)))
-          (x-select-text (buffer-substring-no-properties
-                          evil-visual-beginning
-                          evil-visual-end)))))))
-
-(defun evil-visual-activate-hook (&optional command)
-  "Enable Visual state if the region is activated."
-  (unless (evil-visual-state-p)
-    (evil-delay nil
-        ;; the activation may only be momentary, so re-check
-        ;; in `post-command-hook' before entering Visual state
-        '(unless (or (evil-visual-state-p)
-                     (evil-insert-state-p)
-                     (evil-emacs-state-p))
-           (when (and (region-active-p)
-                      (not deactivate-mark))
-             (evil-visual-state)))
-      'post-command-hook nil t
-      "evil-activate-visual-state")))
-(put 'evil-visual-activate-hook 'permanent-local-hook t)
-
-(defun evil-visual-deactivate-hook (&optional command)
-  "Deactivate the region and restore Transient Mark mode."
-  (setq command (or command this-command))
-  (remove-hook 'deactivate-mark-hook
-               #'evil-visual-deactivate-hook t)
-  (remove-hook 'evil-normal-state-entry-hook
-               #'evil-visual-deactivate-hook t)
-  (cond
-   ((and (evil-visual-state-p) command
-         (not (evil-get-command-property command :keep-visual)))
-    (setq evil-visual-region-expanded nil)
-    (evil-exit-visual-state))
-   ((not (evil-visual-state-p))
-    (evil-active-region -1)
-    (evil-restore-transient-mark-mode))))
-(put 'evil-visual-deactivate-hook 'permanent-local-hook t)
-
-(evil-define-command evil-exit-visual-state (&optional later buffer)
-  "Exit from Visual state to the previous state.
-If LATER is non-nil, exit after the current command."
-  :keep-visual t
-  :repeat abort
-  (with-current-buffer (or buffer (current-buffer))
-    (when (evil-visual-state-p)
-      (if later
-          (setq deactivate-mark t)
-        (when evil-visual-region-expanded
-          (evil-visual-contract-region))
-        (evil-change-to-previous-state)))))
-
-(defun evil-visual-message (&optional selection)
-  "Create an echo area message for SELECTION.
-SELECTION is a kind of selection as defined by
-`evil-define-visual-selection', such as `char', `line'
-or `block'."
-  (let (message)
-    (setq selection (or selection evil-visual-selection))
-    (when selection
-      (setq message
-            (symbol-value (intern (format "evil-visual-%s-message"
-                                          selection))))
-      (cond
-       ((functionp message)
-        (funcall message))
-       ((stringp message)
-        (evil-echo "%s" message))))))
-
-(defun evil-visual-select (beg end &optional type dir message)
-  "Create a Visual selection of type TYPE from BEG to END.
-Point and mark are positioned so that the resulting selection
-has the specified boundaries. If DIR is negative, point precedes mark,
-otherwise it succedes it. To specify point and mark directly,
-use `evil-visual-make-selection'."
-  (let* ((range (evil-contract beg end type))
-         (mark (evil-range-beginning range))
-         (point (evil-range-end range))
-         (dir (or dir 1)))
-    (when (< dir 0)
-      (evil-swap mark point))
-    (evil-visual-make-selection mark point type message)))
-
-(defun evil-visual-make-selection (mark point &optional type message)
-  "Create a Visual selection with point at POINT and mark at MARK.
-The boundaries of the selection are inferred from these
-and the current TYPE. To specify the boundaries and infer
-mark and point, use `evil-visual-select' instead."
-  (let* ((selection (evil-visual-selection-for-type type))
-         (func (evil-visual-selection-function selection))
-         (prev (and (evil-visual-state-p) evil-visual-selection))
-         (mark (evil-normalize-position mark))
-         (point (evil-normalize-position point))
-         (state evil-state))
-    (unless (evil-visual-state-p)
-      (evil-visual-state))
-    (setq evil-visual-selection selection)
-    (funcall func mark point type
-             ;; signal a message when changing the selection
-             (when (or (not (evil-visual-state-p state))
-                       (not (eq selection prev)))
-               message))))
-
-(defun evil-visual-make-region (mark point &optional type message)
-  "Create an active region from MARK to POINT.
-If TYPE is given, also set the Visual type.
-If MESSAGE is given, display it in the echo area."
-  (interactive)
-  (let* ((point (evil-normalize-position
-                 (or point (point))))
-         (mark (evil-normalize-position
-                (or mark
-                    (when (or (evil-visual-state-p)
-                              (region-active-p))
-                      (mark t))
-                    point))))
-    (unless (evil-visual-state-p)
-      (evil-visual-state))
-    (evil-active-region 1)
-    (setq evil-visual-region-expanded nil)
-    (evil-visual-refresh mark point type)
-    (cond
-     ((null evil-echo-state))
-     ((stringp message)
-      (evil-echo "%s" message))
-     (message
-      (cond
-       ((stringp evil-visual-state-message)
-        (evil-echo "%s" evil-visual-state-message))
-       ((functionp evil-visual-state-message)
-        (funcall evil-visual-state-message)))))))
-
-(defun evil-visual-expand-region (&optional exclude-newline)
-  "Expand the region to the Visual selection.
-If EXCLUDE-NEWLINE is non-nil and the selection ends with a newline,
-exclude that newline from the region."
-  (when (and (evil-visual-state-p)
-             (not evil-visual-region-expanded))
-    (let ((mark evil-visual-beginning)
-          (point evil-visual-end))
-      (when (< evil-visual-direction 0)
-        (evil-swap mark point))
-      (setq evil-visual-region-expanded t)
-      (evil-visual-refresh mark point)
-      (when (and exclude-newline
-                 (save-excursion
-                   (goto-char evil-visual-end)
-                   (and (bolp) (not (bobp)))))
-        (if (< evil-visual-direction 0)
-            (evil-move-mark (max point (1- (mark))))
-          (goto-char (max mark (1- (point)))))))))
-
-(defun evil-visual-contract-region ()
-  "The inverse of `evil-visual-expand-region'.
-Create a Visual selection that expands to the current region."
-  (evil-visual-refresh)
-  (setq evil-visual-region-expanded nil)
-  (evil-visual-refresh evil-visual-mark evil-visual-point))
-
-(defun evil-visual-refresh (&optional mark point type &rest properties)
-  "Refresh point, mark and Visual variables.
-Refreshes `evil-visual-beginning', `evil-visual-end',
-`evil-visual-mark', `evil-visual-point', `evil-visual-selection',
-`evil-visual-direction', `evil-visual-properties' and `evil-this-type'."
-  (let* ((point (or point (point)))
-         (mark (or mark (mark t) point))
-         (dir (evil-visual-direction))
-         (type (or type (evil-visual-type evil-visual-selection)
-                   (evil-visual-type)))
-         range)
-    (evil-move-mark mark)
-    (goto-char point)
-    (setq evil-visual-beginning
-          (or evil-visual-beginning
-              (let ((marker (make-marker)))
-                (move-marker marker (min point mark))))
-          evil-visual-end
-          (or evil-visual-end
-              (let ((marker (make-marker)))
-                (set-marker-insertion-type marker t)
-                (move-marker marker (max point mark))))
-          evil-visual-mark
-          (or evil-visual-mark
-              (let ((marker (make-marker)))
-                (move-marker marker mark)))
-          evil-visual-point
-          (or evil-visual-point
-              (let ((marker (make-marker)))
-                (move-marker marker point))))
-    (setq evil-visual-properties
-          (evil-concat-plists evil-visual-properties properties))
-    (cond
-     (evil-visual-region-expanded
-      (setq type (or (evil-visual-type) type))
-      (move-marker evil-visual-beginning (min point mark))
-      (move-marker evil-visual-end (max point mark))
-      ;; if the type is one-to-one, we can safely refresh
-      ;; the unexpanded positions as well
-      (when (evil-type-property type :one-to-one)
-        (setq range (apply #'evil-contract point mark type
-                           evil-visual-properties)
-              mark (evil-range-beginning range)
-              point (evil-range-end range))
-        (when (< dir 0)
-          (evil-swap mark point))
-        (move-marker evil-visual-mark mark)
-        (move-marker evil-visual-point point)))
-     (t
-      (setq range (apply #'evil-expand point mark type
-                         evil-visual-properties)
-            type (evil-type range type))
-      (move-marker evil-visual-beginning (evil-range-beginning range))
-      (move-marker evil-visual-end (evil-range-end range))
-      (move-marker evil-visual-mark mark)
-      (move-marker evil-visual-point point)))
-    (setq evil-visual-direction dir
-          evil-this-type type)))
-
-(defun evil-visual-highlight (&optional arg)
-  "Highlight Visual selection, depending on the Visual type.
-With negative ARG, disable highlighting."
-  (cond
-   ((and (numberp arg) (< arg 1))
-    (when evil-visual-overlay
-      (delete-overlay evil-visual-overlay)
-      (setq evil-visual-overlay nil))
-    (when evil-visual-block-overlays
-      (mapc #'delete-overlay evil-visual-block-overlays)
-      (setq evil-visual-block-overlays nil)))
-   ((eq evil-visual-selection 'block)
-    (when evil-visual-overlay
-      (evil-visual-highlight -1))
-    (evil-visual-highlight-block
-     evil-visual-beginning
-     evil-visual-end))
-   (t
-    (when evil-visual-block-overlays
-      (evil-visual-highlight -1))
-    (if evil-visual-overlay
-        (move-overlay evil-visual-overlay
-                      evil-visual-beginning evil-visual-end)
-      (setq evil-visual-overlay
-            (make-overlay evil-visual-beginning evil-visual-end)))
-    (overlay-put evil-visual-overlay 'face 'region)
-    (overlay-put evil-visual-overlay 'priority 99))))
-
-(defun evil-visual-highlight-block (beg end &optional overlays)
-  "Highlight rectangular region from BEG to END.
-Do this by putting an overlay on each line within the rectangle.
-Each overlay extends across all the columns of the rectangle.
-Reuse overlays where possible to prevent flicker."
-  (let* ((point (point))
-         (mark (or (mark t) point))
-         (overlays (or overlays 'evil-visual-block-overlays))
-         (old (symbol-value overlays))
-         (eol-col (and (memq this-command '(next-line previous-line))
-                       (numberp temporary-goal-column)
-                       (1+ (min (round temporary-goal-column)
-                                (1- most-positive-fixnum)))))
-         beg-col end-col new nlines overlay window-beg window-end)
-    (save-excursion
-      ;; calculate the rectangular region represented by BEG and END,
-      ;; but put BEG in the upper-left corner and END in the
-      ;; lower-right if not already there
-      (setq beg-col (evil-column beg)
-            end-col (evil-column end))
-      (when (>= beg-col end-col)
-        (if (= beg-col end-col)
-            (setq end-col (1+ end-col))
-          (evil-sort beg-col end-col))
-        (setq beg (save-excursion
-                    (goto-char beg)
-                    (evil-move-to-column beg-col))
-              end (save-excursion
-                    (goto-char end)
-                    (evil-move-to-column end-col 1))))
-      ;; update end column with eol-col (extension to eol).
-      (when (and eol-col (> eol-col end-col))
-        (setq end-col eol-col))
-      ;; force a redisplay so we can do reliable window
-      ;; BEG/END calculations
-      (sit-for 0)
-      (setq window-beg (max (window-start) beg)
-            window-end (min (window-end) (1+ end))
-            nlines (count-lines window-beg
-                                (min window-end (point-max))))
-      ;; iterate over those lines of the rectangle which are
-      ;; visible in the currently selected window
-      (goto-char window-beg)
-      (dotimes (i nlines)
-        (let (before after row-beg row-end)
-          ;; beginning of row
-          (evil-move-to-column beg-col)
-          (when (< (current-column) beg-col)
-            ;; prepend overlay with virtual spaces if unable to
-            ;; move directly to the first column
-            (setq before
-                  (propertize
-                   (make-string
-                    (- beg-col (current-column)) ?\ )
-                   'face
-                   (or (get-text-property (1- (point)) 'face)
-                       'default))))
-          (setq row-beg (point))
-          ;; end of row
-          (evil-move-to-column end-col)
-          (when (and (not (eolp))
-                     (< (current-column) end-col))
-            ;; append overlay with virtual spaces if unable to
-            ;; move directly to the last column
-            (setq after
-                  (propertize
-                   (make-string
-                    (if (= (point) row-beg)
-                        (- end-col beg-col)
-                      (- end-col (current-column)))
-                    ?\ ) 'face 'region))
-            ;; place cursor on one of the virtual spaces
-            (if (= point row-beg)
-                (put-text-property
-                 0 (min (length after) 1)
-                 'cursor t after)
-              (put-text-property
-               (max 0 (1- (length after))) (length after)
-               'cursor t after)))
-          (setq row-end (min (point) (line-end-position)))
-          ;; trim old leading overlays
-          (while (and old
-                      (setq overlay (car old))
-                      (< (overlay-start overlay) row-beg)
-                      (/= (overlay-end overlay) row-end))
-            (delete-overlay overlay)
-            (setq old (cdr old)))
-          ;; reuse an overlay if possible, otherwise create one
-          (cond
-           ((and old (setq overlay (car old))
-                 (or (= (overlay-start overlay) row-beg)
-                     (= (overlay-end overlay) row-end)))
-            (move-overlay overlay row-beg row-end)
-            (overlay-put overlay 'before-string before)
-            (overlay-put overlay 'after-string after)
-            (setq new (cons overlay new)
-                  old (cdr old)))
-           (t
-            (setq overlay (make-overlay row-beg row-end))
-            (overlay-put overlay 'before-string before)
-            (overlay-put overlay 'after-string after)
-            (setq new (cons overlay new)))))
-        (forward-line 1))
-      ;; display overlays
-      (dolist (overlay new)
-        (overlay-put overlay 'face 'region)
-        (overlay-put overlay 'priority 99))
-      ;; trim old overlays
-      (dolist (overlay old)
-        (delete-overlay overlay))
-      (set overlays (nreverse new)))))
-
-(defun evil-visual-range ()
-  "Return the Visual selection as a range.
-This is a list (BEG END TYPE PROPERTIES...), where BEG is the
-beginning of the selection, END is the end of the selection,
-TYPE is the selection's type, and PROPERTIES is a property list
-of miscellaneous selection attributes."
-  (apply #'evil-range
-         evil-visual-beginning evil-visual-end
-         (evil-visual-type)
-         :expanded t
-         evil-visual-properties))
-
-(defun evil-visual-direction ()
-  "Return direction of Visual selection.
-The direction is -1 if point precedes mark and 1 otherwise.
-See also the variable `evil-visual-direction', which holds
-the direction of the last selection."
-  (let* ((point (point))
-         (mark (or (mark t) point)))
-    (if (< point mark) -1 1)))
-
-(defun evil-visual-type (&optional selection)
-  "Return the type of the Visual selection.
-If SELECTION is specified, return the type of that instead."
-  (if (and (null selection) (evil-visual-state-p))
-      (or evil-this-type (evil-visual-type evil-visual-selection))
-    (setq selection (or selection evil-visual-selection))
-    (symbol-value (cdr-safe (assq selection evil-visual-alist)))))
-
-(defun evil-visual-goto-end ()
-  "Go to the last line of the Visual selection.
-This position may differ from `evil-visual-end' depending on
-the selection type, and is contained in the selection."
-  (let ((range (evil-contract-range (evil-visual-range))))
-    (goto-char (evil-range-end range))))
-
-(defun evil-visual-alist ()
-  "Return an association list from types to selection symbols."
-  (mapcar #'(lambda (e)
-              (cons (symbol-value (cdr-safe e)) (cdr-safe e)))
-          evil-visual-alist))
-
-(defun evil-visual-selection-function (selection)
-  "Return a selection function for TYPE.
-Default to `evil-visual-make-region'."
-  (or (cdr-safe (assq selection evil-visual-alist))
-      ;; generic selection function
-      'evil-visual-make-region))
-
-(defun evil-visual-selection-for-type (type)
-  "Return a Visual selection for TYPE."
-  (catch 'done
-    (dolist (selection evil-visual-alist)
-      (when (eq (symbol-value (cdr selection)) type)
-        (throw 'done (car selection))))))
-
-(defun evil-visual-block-corner (&optional corner point mark)
-  "Block corner corresponding to POINT, with MARK in opposite corner.
-Depending on POINT and MARK, the return value is `upper-left',
-`upper-right', `lower-left' or `lower-right':
-
-        upper-left +---+ upper-right
-                   |   |
-        lower-left +---+ lower-right
-
-One-column or one-row blocks are ambiguous. In such cases,
-the horizontal or vertical component of CORNER is used.
-CORNER defaults to `upper-left'."
-  (let* ((point (or point (point)))
-         (mark (or mark (mark t)))
-         (corner (symbol-name
-                  (or corner
-                      (and (overlayp evil-visual-overlay)
-                           (overlay-get evil-visual-overlay
-                                        :corner))
-                      'upper-left)))
-         (point-col (evil-column point))
-         (mark-col (evil-column mark))
-         horizontal vertical)
-    (cond
-     ((= point-col mark-col)
-      (setq horizontal
-            (or (and (string-match "left\\|right" corner)
-                     (match-string 0 corner))
-                "left")))
-     ((< point-col mark-col)
-      (setq horizontal "left"))
-     ((> point-col mark-col)
-      (setq horizontal "right")))
-    (cond
-     ((= (line-number-at-pos point)
-         (line-number-at-pos mark))
-      (setq vertical
-            (or (and (string-match "upper\\|lower" corner)
-                     (match-string 0 corner))
-                "upper")))
-     ((< point mark)
-      (setq vertical "upper"))
-     ((> point mark)
-      (setq vertical "lower")))
-    (intern (format "%s-%s" vertical horizontal))))
-
-;;; Operator-Pending state
-
-(evil-define-state operator
-  "Operator-Pending state."
-  :tag " <O> "
-  :cursor evil-half-cursor
-  :enable (evil-operator-shortcut-map operator motion normal))
-
-(evil-define-keymap evil-operator-shortcut-map
-  "Keymap for Operator-Pending shortcuts like \"dd\" and \"gqq\"."
-  :local t
-  (setq evil-operator-shortcut-map (make-sparse-keymap))
-  (evil-initialize-local-keymaps))
-
-;; the half-height "Operator-Pending cursor" cannot be specified
-;; as a static `cursor-type' value, since its height depends on
-;; the current font size
-(defun evil-half-cursor ()
-  "Change cursor to a half-height box.
-\(This is really just a thick horizontal bar.)"
-  (let ((height (/ (window-pixel-height) (* (window-height) 2))))
-    (setq cursor-type (cons 'hbar height))))
-
-;;; Replace state
-
-(evil-define-state replace
-  "Replace state."
-  :tag " <R> "
-  :cursor hbar
-  :message "-- REPLACE --"
-  :input-method t
-  (cond
-   ((evil-replace-state-p)
-    (overwrite-mode 1)
-    (add-hook 'pre-command-hook #'evil-replace-pre-command nil t)
-    (unless (eq evil-want-fine-undo t)
-      (evil-start-undo-step)))
-   (t
-    (overwrite-mode -1)
-    (remove-hook 'pre-command-hook #'evil-replace-pre-command t)
-    (unless (eq evil-want-fine-undo t)
-      (evil-end-undo-step))
-    (when evil-move-cursor-back
-      (evil-move-cursor-back))))
-  (setq evil-replace-alist nil))
-
-(defun evil-replace-pre-command ()
-  "Remember the character under point."
-  (when (evil-replace-state-p)
-    (unless (assq (point) evil-replace-alist)
-      (add-to-list 'evil-replace-alist
-                   (cons (point)
-                         (unless (eolp)
-                           (char-after)))))))
-(put 'evil-replace-pre-command 'permanent-local-hook t)
-
-(defun evil-replace-backspace ()
-  "Restore character under cursor."
-  (interactive)
-  (let (char)
-    (backward-char)
-    (when (assq (point) evil-replace-alist)
-      (setq char (cdr (assq (point) evil-replace-alist)))
-      (save-excursion
-        (delete-char 1)
-        (when char
-          (insert char))))))
-
-;;; Motion state
-
-(evil-define-state motion
-  "Motion state."
-  :tag " <M> "
-  :suppress-keymap t)
-
-;;; Emacs state
-
-(evil-define-state emacs
-  "Emacs state."
-  :tag " <E> "
-  :message "-- EMACS --"
-  :input-method t
-  :intercept-esc nil)
-
-(provide 'evil-states)
-
-;;; evil-states.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-states.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-types.el
@@ -1,424 +0,0 @@
-;;; evil-types.el --- Type system
-
-;; Author: Vegard Øye <vegard_oye at hotmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; A type defines a transformation on a pair of buffer positions.
-;; Types are used by Visual state (character/line/block selection)
-;; and Operator-Pending state (character/line/block motions).
-;;
-;; The basic transformation is "expansion". For example, the `line'
-;; type "expands" a pair of positions to whole lines by moving the
-;; first position to the beginning of the line and the last position
-;; to the end of the line. That expanded selection is what the rest
-;; of Emacs sees and acts on.
-;;
-;; An optional transformation is "contraction", which is the opposite
-;; of expansion. If the transformation is one-to-one, expansion
-;; followed by contraction always returns the original range.
-;; (The `line' type is not one-to-one, as it may expand multiple
-;; positions to the same lines.)
-;;
-;; Another optional transformation is "normalization", which takes
-;; two unexpanded positions and adjusts them before expansion.
-;; This is useful for cleaning up "invalid" positions.
-;;
-;; Types are defined at the end of this file using the macro
-;; `evil-define-type'.
-
-(require 'evil-common)
-(require 'evil-macros)
-
-;;; Code:
-
-;;; Type definitions
-
-(evil-define-type exclusive
-  "Return the positions unchanged, with some exceptions.
-If the end position is at the beginning of a line, then:
-
-* If the beginning position is at or before the first non-blank
-  character on the line, return `line' (expanded).
-
-* Otherwise, move the end position to the end of the previous
-  line and return `inclusive' (expanded)."
-  :normalize (lambda (beg end)
-               (cond
-                ((progn
-                   (goto-char end)
-                   (and (/= beg end) (bolp)))
-                 (setq end (max beg (1- end)))
-                 (cond
-                  ((progn
-                     (goto-char beg)
-                     (looking-back "^[ \f\t\v]*" (line-beginning-position)))
-                   (evil-expand beg end 'line))
-                  (t
-                   (unless evil-cross-lines
-                     (setq end (max beg (1- end))))
-                   (evil-expand beg end 'inclusive))))
-                (t
-                 (evil-range beg end))))
-  :string (lambda (beg end)
-            (let ((width (- end beg)))
-              (format "%s character%s" width
-                      (if (= width 1) "" "s")))))
-
-(evil-define-type inclusive
-  "Include the character under point.
-If the end position is at the beginning of a line or the end of a
-line and `evil-want-visual-char-semi-exclusive', then:
-
-* If in visual state return `exclusive' (expanded)."
-  :expand (lambda (beg end)
-            (if (and evil-want-visual-char-semi-exclusive
-                     (evil-visual-state-p)
-                     (< beg end)
-                     (save-excursion
-                       (goto-char end)
-                       (or (bolp) (eolp))))
-                (evil-range beg end 'exclusive)
-              (evil-range beg (1+ end))))
-  :contract (lambda (beg end)
-              (evil-range beg (max beg (1- end))))
-  :normalize (lambda (beg end)
-               (goto-char end)
-               (when (eq (char-after) ?\n)
-                 (setq end (max beg (1- end))))
-               (evil-range beg end))
-  :string (lambda (beg end)
-            (let ((width (- end beg)))
-              (format "%s character%s" width
-                      (if (= width 1) "" "s")))))
-
-(evil-define-type line
-  "Include whole lines."
-  :one-to-one nil
-  :expand (lambda (beg end)
-            (evil-range
-             (progn
-               (goto-char beg)
-               (min (line-beginning-position)
-                    (progn
-                      ;; move to beginning of line as displayed
-                      (evil-move-beginning-of-line)
-                      (line-beginning-position))))
-             (progn
-               (goto-char end)
-               (max (line-beginning-position 2)
-                    (progn
-                      ;; move to end of line as displayed
-                      (evil-move-end-of-line)
-                      (line-beginning-position 2))))))
-  :contract (lambda (beg end)
-              (evil-range beg (max beg (1- end))))
-  :string (lambda (beg end)
-            (let ((height (count-lines beg end)))
-              (format "%s line%s" height
-                      (if (= height 1) "" "s")))))
-
-(evil-define-type block
-  "Like `inclusive', but for rectangles:
-the last column is included."
-  :expand (lambda (beg end &rest properties)
-            (let ((beg-col (evil-column beg))
-                  (end-col (evil-column end))
-                  (corner (plist-get properties :corner)))
-              ;; Since blocks are implemented as a pair of buffer
-              ;; positions, expansion is restricted to what the buffer
-              ;; allows. In the case of a one-column block, there are
-              ;; two ways to expand it (either move the upper corner
-              ;; beyond the lower corner, or the lower beyond the
-              ;; upper), so try out both possibilities when
-              ;; encountering the end of the line.
-              (cond
-               ((= beg-col end-col)
-                (goto-char end)
-                (cond
-                 ((eolp)
-                  (goto-char beg)
-                  (if (eolp)
-                      (evil-range beg end)
-                    (evil-range (1+ beg) end)))
-                 ((memq corner '(lower-right upper-right right))
-                  (evil-range (1+ beg) end))
-                 (t
-                  (evil-range beg (1+ end)))))
-               ((< beg-col end-col)
-                (goto-char end)
-                (if (eolp)
-                    (evil-range beg end)
-                  (evil-range beg (1+ end))))
-               (t
-                (goto-char beg)
-                (if (eolp)
-                    (evil-range beg end)
-                  (evil-range (1+ beg) end))))))
-  :contract (lambda (beg end)
-              (let ((beg-col (evil-column beg))
-                    (end-col (evil-column end)))
-                (if (> beg-col end-col)
-                    (evil-range (1- beg) end)
-                  (evil-range beg (max beg (1- end))))))
-  :string (lambda (beg end)
-            (let ((height (count-lines
-                           beg
-                           (progn
-                             (goto-char end)
-                             (if (and (bolp) (not (eobp)))
-                                 (1+ end)
-                               end))))
-                  (width (abs (- (evil-column beg)
-                                 (evil-column end)))))
-              (format "%s row%s and %s column%s"
-                      height
-                      (if (= height 1) "" "s")
-                      width
-                      (if (= width 1) "" "s"))))
-  :rotate (lambda (beg end &rest properties)
-            "Rotate block according to :corner property.
-:corner can be one of `upper-left',``upper-right', `lower-left'
-and `lower-right'."
-            (let ((left  (evil-column beg))
-                  (right (evil-column end))
-                  (corner (or (plist-get properties :corner)
-                              'upper-left)))
-              (evil-sort left right)
-              (goto-char beg)
-              (if (memq corner '(upper-right lower-left))
-                  (move-to-column right)
-                (move-to-column left))
-              (setq beg (point))
-              (goto-char end)
-              (if (memq corner '(upper-right lower-left))
-                  (move-to-column left)
-                (move-to-column right))
-              (setq end (point))
-              (setq properties (plist-put properties
-                                          :corner corner))
-              (apply #'evil-range beg end properties))))
-
-(evil-define-type rectangle
-  "Like `exclusive', but for rectangles:
-the last column is excluded."
-  :expand (lambda (beg end)
-            ;; select at least one column
-            (if (= (evil-column beg) (evil-column end))
-                (evil-expand beg end 'block)
-              (evil-range beg end 'block))))
-
-;;; Standard interactive codes
-
-(evil-define-interactive-code "*"
-  "Signal error if the buffer is read-only."
-  (when buffer-read-only
-    (signal 'buffer-read-only nil)))
-
-(evil-define-interactive-code "b" (prompt)
-  "Name of existing buffer."
-  (list (read-buffer prompt (current-buffer) t)))
-
-(evil-define-interactive-code "c"
-  "Read character."
-  (list (read-char)))
-
-(evil-define-interactive-code "p"
-  "Prefix argument converted to number."
-  (list (prefix-numeric-value current-prefix-arg)))
-
-(evil-define-interactive-code "P"
-  "Prefix argument in raw form."
-  (list current-prefix-arg))
-
-;;; Custom interactive codes
-
-(evil-define-interactive-code "<c>"
-  "Count."
-  (list (when current-prefix-arg
-          (prefix-numeric-value
-           current-prefix-arg))))
-
-(evil-define-interactive-code "<vc>"
-  "Count, but only in visual state.
-This should be used by an operator taking a count. In normal
-state the count should not be handled by the operator but by the
-motion that defines the operator's range. In visual state the
-range is specified by the visual region and the count is not used
-at all. Thus in the case the operator may use the count
-directly."
-  (list (when (and (evil-visual-state-p) current-prefix-arg)
-          (prefix-numeric-value
-           current-prefix-arg))))
-
-(evil-define-interactive-code "<C>"
-  "Character read through `evil-read-key'."
-  (list
-   (if (evil-operator-state-p)
-       (evil-without-restriction (evil-read-key))
-     (evil-read-key))))
-
-(evil-define-interactive-code "<r>"
-  "Untyped motion range (BEG END)."
-  (evil-operator-range))
-
-(evil-define-interactive-code "<R>"
-  "Typed motion range (BEG END TYPE)."
-  (evil-operator-range t))
-
-(evil-define-interactive-code "<v>"
-  "Typed motion range of visual range(BEG END TYPE).
-If visual state is inactive then those values are nil."
-  (if (evil-visual-state-p)
-      (let ((range (evil-visual-range)))
-        (list (car range)
-              (cadr range)
-              (evil-type range)))
-    (list nil nil nil)))
-
-(evil-define-interactive-code "<x>"
-  "Current register."
-  (list evil-this-register))
-
-(evil-define-interactive-code "<y>"
-  "Current yank-handler."
-  (list (evil-yank-handler)))
-
-(evil-define-interactive-code "<a>"
-  "Ex argument."
-  :ex-arg t
-  (list (when (evil-ex-p) evil-ex-argument)))
-
-(evil-define-interactive-code "<f>"
-  "Ex file argument."
-  :ex-arg file
-  (list (when (evil-ex-p) (evil-ex-file-arg))))
-
-(evil-define-interactive-code "<b>"
-  "Ex buffer argument."
-  :ex-arg buffer
-  (list (when (evil-ex-p) evil-ex-argument)))
-
-(evil-define-interactive-code "<sh>"
-  "Ex shell command argument."
-  :ex-arg shell
-  (list (when (evil-ex-p) evil-ex-argument)))
-
-(evil-define-interactive-code "<fsh>"
-  "Ex file or shell command argument."
-  :ex-arg file-or-shell
-  (list (when (evil-ex-p) evil-ex-argument)))
-
-(evil-define-interactive-code "<sym>"
-  "Ex symbolic argument."
-  :ex-arg sym
-  (list (when (and (evil-ex-p) evil-ex-argument)
-          (intern evil-ex-argument))))
-
-(evil-define-interactive-code "<addr>"
-  "Ex line number."
-  (list
-   (and (evil-ex-p)
-        (let ((expr (evil-ex-parse  evil-ex-argument)))
-          (if (eq (car expr) 'evil-goto-line)
-              (save-excursion
-                (goto-char evil-ex-point)
-                (eval (cadr expr)))
-            (user-error "Invalid address"))))))
-
-(evil-define-interactive-code "<!>"
-  "Ex bang argument."
-  :ex-bang t
-  (list (when (evil-ex-p) evil-ex-bang)))
-
-(evil-define-interactive-code "</>"
-  "Ex delimited argument."
-  (when (evil-ex-p)
-    (evil-delimited-arguments evil-ex-argument)))
-
-(evil-define-interactive-code "<g/>"
-  "Ex global argument."
-  (when (evil-ex-p)
-    (evil-ex-parse-global evil-ex-argument)))
-
-(evil-define-interactive-code "<s/>"
-  "Ex substitution argument."
-  :ex-arg substitution
-  (when (evil-ex-p)
-    (evil-ex-get-substitute-info evil-ex-argument t)))
-
-(evil-define-interactive-code "<xc/>"
-  "Ex register and count argument, both optional.
-Can be used for commands such as :delete [REGISTER] [COUNT] where the
-command can be called with either zero, one or two arguments. When the
-argument is one, if it's numeric it's treated as a COUNT, otherwise -
-REGISTER"
-  (when (evil-ex-p)
-    (evil-ex-get-optional-register-and-count evil-ex-argument)))
-
-(defun evil-ex-get-optional-register-and-count (string)
-  "Parse STRING as an ex arg with both optional REGISTER and COUNT.
-Returns a list (REGISTER COUNT)."
-  (let* ((split-args (split-string (or string "")))
-         (arg-count (length split-args))
-         (arg0 (car split-args))
-         (arg1 (cadr split-args))
-         (number-regex "^-?[1-9][0-9]*$")
-         (register nil)
-         (count nil))
-    (cond
-     ;; :command REGISTER or :command COUNT
-     ((= arg-count 1)
-      (if (string-match-p number-regex arg0)
-          (setq count arg0)
-        (setq register arg0)))
-     ;; :command REGISTER COUNT
-     ((eq arg-count 2)
-      (setq register arg0
-            count arg1))
-     ;; more than 2 args aren't allowed
-     ((> arg-count 2)
-      (user-error "Invalid use")))
-
-    ;; if register is given, check it's valid
-    (when register
-      (unless (= (length register) 1)
-        (user-error "Invalid register"))
-      (setq register (string-to-char register)))
-
-    ;; if count is given, check it's valid
-    (when count
-      (unless (string-match-p number-regex count)
-        (user-error "Invalid count"))
-      (setq count (string-to-number count))
-      (unless (> count 0)
-        (user-error "Invalid count")))
-
-    (list register count)))
-
-(provide 'evil-types)
-
-;;; evil-types.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-types.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil-vars.el
@@ -1,1854 +0,0 @@
-;;; evil-vars.el --- Settings and variables
-
-;; Author: Vegard Øye <vegard_oye at hotmail.com>
-;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
-;; Version: 1.2.12
-
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Code:
-
-(declare-function evil-add-command-properties "evil-common"
-                  (command &rest properties))
-(declare-function evil-update-insert-state-bindings "evil-maps"
-                  (&optional _option-name remove force))
-
-;;; Hooks
-
-(defvar evil-after-load-hook nil
-  "Functions to be run when loading of evil is finished.
-This hook can be used the execute some initialization routines
-when evil is completely loaded.")
-
-;;; Initialization
-
-(defvar evil-pending-custom-initialize nil
-  "A list of pending initializations for custom variables.
-Each element is a triple (FUNC VAR VALUE). When evil is
-completely loaded then the functions (funcall FUNC VAR VALUE) is
-called for each element. FUNC should be a function suitable for
-the :initialize property of `defcustom'.")
-
-(defun evil-custom-initialize-pending-reset (var value)
-  "Add a pending customization with `custom-initialize-reset'."
-  (push (list 'custom-initialize-reset var value)
-        evil-pending-custom-initialize))
-
-(defun evil-run-pending-custom-initialize ()
-  "Executes the pending initializations.
-See `evil-pending-custom-initialize'."
-  (dolist (init evil-pending-custom-initialize)
-    (apply (car init) (cdr init)))
-  (remove-hook 'evil-after-load-hook 'evil-run-pending-custom-initialize))
-(add-hook 'evil-after-load-hook 'evil-run-pending-custom-initialize)
-
-;;; Setters
-
-(defun evil-set-toggle-key (key)
-  "Set `evil-toggle-key' to KEY.
-KEY must be readable by `read-kbd-macro'."
-  (let ((old-key (read-kbd-macro
-                  (if (boundp 'evil-toggle-key)
-                      evil-toggle-key
-                    "C-z")))
-        (key (read-kbd-macro key)))
-    (with-no-warnings
-      (dolist (pair '((evil-motion-state-map evil-emacs-state)
-                      (evil-insert-state-map evil-emacs-state)
-                      (evil-emacs-state-map evil-exit-emacs-state)))
-        (when (boundp (car pair))
-          (let ((map (symbol-value (car pair)))
-                (fun (cadr pair)))
-            (when (keymapp map)
-              (define-key map key fun)
-              (define-key map old-key nil))))))))
-
-(defun evil-set-custom-state-maps (var pending-var key make newlist)
-  "Changes the list of special keymaps.
-VAR         is the variable containing the list of keymaps.
-PENDING-VAR is the variable containing the list of the currently pending
-            keymaps.
-KEY         the special symbol to be stored in the keymaps.
-MAKE        the creation function of the special keymaps.
-NEWLIST     the list of new special keymaps."
-  (set-default pending-var newlist)
-  (when (default-boundp var)
-    (dolist (map (default-value var))
-      (when (and (boundp (car map))
-                 (keymapp (default-value (car map))))
-        (define-key (default-value (car map)) (vector key) nil))))
-  (set-default var newlist)
-  (evil-update-pending-maps))
-
-(defun evil-update-pending-maps (&optional file)
-  "Tries to set pending special keymaps.
-This function should be called from an `after-load-functions'
-hook."
-  (let ((maps '((evil-make-overriding-map . evil-pending-overriding-maps)
-                (evil-make-intercept-map . evil-pending-intercept-maps))))
-    (while maps
-      (let* ((map (pop maps))
-             (make (car map))
-             (pending-var (cdr map))
-             (pending (symbol-value pending-var))
-             newlist)
-        (while pending
-          (let* ((map (pop pending))
-                 (kmap (and (boundp (car map))
-                            (keymapp (symbol-value (car map)))
-                            (symbol-value (car map))))
-                 (state (cdr map)))
-            (if kmap
-                (funcall make kmap state)
-              (push map newlist))))
-        (set-default pending-var newlist)))))
-
-(defun evil-set-visual-newline-commands (var value)
-  "Set the value of `evil-visual-newline-commands'.
-Setting this variable changes the properties of the appropriate
-commands."
-  (with-no-warnings
-    (when (default-boundp var)
-      (dolist (cmd (default-value var))
-        (evil-set-command-property cmd :exclude-newline nil)))
-    (set-default var value)
-    (dolist (cmd (default-value var))
-      (evil-set-command-property cmd :exclude-newline t))))
-
-(defun evil-set-custom-motions (var values)
-  "Sets the list of motion commands."
-  (with-no-warnings
-    (when (default-boundp var)
-      (dolist (motion (default-value var))
-        (evil-add-command-properties motion :keep-visual nil :repeat nil)))
-    (set-default var values)
-    (mapc #'evil-declare-motion (default-value var))))
-
-;;; Customization group
-
-(defgroup evil nil
-  "Extensible vi layer."
-  :group 'emulations
-  :prefix 'evil-)
-
-(defcustom evil-auto-indent t
-  "Whether to auto-indent when entering Insert state."
-  :type  'boolean
-  :group 'evil)
-(make-variable-buffer-local 'evil-auto-indent)
-
-(defcustom evil-shift-width 4
-  "The offset used by \\<evil-normal-state-map>\\[evil-shift-right] \
-and \\[evil-shift-left]."
-  :type 'integer
-  :group 'evil)
-(make-variable-buffer-local 'evil-shift-width)
-
-(defcustom evil-shift-round t
-  "Whether \\<evil-normal-state-map>\\[evil-shift-right] \
-and \\[evil-shift-left] round to the nearest multiple \
-of `evil-shift-width'."
-  :type 'boolean
-  :group 'evil)
-(make-variable-buffer-local 'evil-shift-round)
-
-(defcustom evil-indent-convert-tabs t
-  "If non-nil `evil-indent' converts between leading tabs and spaces.
-  Whether tabs are converted to spaces or vice versa depends on the
-  value of `indent-tabs-mode'."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-default-cursor t
-  "The default cursor.
-May be a cursor type as per `cursor-type', a color string as passed
-to `set-cursor-color', a zero-argument function for changing the
-cursor, or a list of the above."
-  :type '(set symbol (cons symbol symbol) string function)
-  :group 'evil)
-
-(defvar evil-force-cursor nil
-  "Overwrite the current states default cursor.")
-
-(defcustom evil-repeat-move-cursor t
-  "Whether \"\\<evil-normal-state-map>\\[evil-repeat]\" \
-moves the cursor."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-cross-lines nil
-  "Whether motions may cross newlines."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-backspace-join-lines t
-  "Whether backward delete in insert state may join lines."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-move-cursor-back t
-  "Whether the cursor is moved backwards when exiting Insert state."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-move-beyond-eol nil
-  "Whether the cursor is allowed to move past the last character of \
-a line."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-respect-visual-line-mode nil
-  "Whether to remap movement commands when `visual-line-mode' is active.
-This variable must be set before evil is loaded. The commands
-swapped are
-
-`evil-next-line'         <-> `evil-next-visual-line'
-`evil-previous-line'     <-> `evil-previous-visual-line'
-`evil-beginning-of-line' <-> `evil-beginning-of-visual-line'
-`evil-end-of-line'       <-> `evil-end-of-visual-line'"
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-repeat-find-to-skip-next t
-  "Whether a repeat of t or T should skip an adjacent character."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-kbd-macro-suppress-motion-error nil
-  "Whether left/right motions signal errors during keyboard-macro definition.
-If this variable is set to non-nil, then the function
-`evil-forward-char' and `evil-backward-char' do not signal
-`end-of-line' or `beginning-of-line' errors when a keyboard macro
-is being defined and/or it is being executed. This may be desired
-because such an error would cause the macro definition/execution
-being terminated."
-  :type '(radio (const :tag "No" :value nil)
-                (const :tag "Record" :value record)
-                (const :tag "Replay" :value replay)
-                (const :tag "Both" :value t))
-  :group 'evil)
-
-(defcustom evil-track-eol t
-  "If non-nil line moves after a call to `evil-end-of-line' stay at eol.
-This is analogous to `track-eol' but deals with the end-of-line
-interpretation of evil."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-mode-line-format 'before
-  "The position of the mode line tag.
-Either a symbol or a cons-cell. If it is a symbol it should be
-one of 'before, 'after or 'nil. 'before means the tag is
-placed before the mode-list, 'after means it is placed after the
-mode-list, and 'nil means no mode line tag. If it is a cons cell
-it should have the form (WHERE . WHICH) where WHERE is either
-'before or 'after and WHICH is a symbol in
-`mode-line-format'. The tag is then placed right before or after
-that symbol."
-  :type '(radio :value 'before
-                (const before)
-                (const after)
-                (cons :tag "Next to symbol"
-                      (choice :value after
-                              (const before)
-                              (const after))
-                      symbol))
-  :group 'evil)
-
-(defcustom evil-mouse-word 'evil-word
-  "The thing-at-point symbol for double click selection.
-The double-click starts visual state in a special word selection
-mode. This symbol is used to determine the words to be
-selected. Possible values are 'evil-word or
-'evil-WORD."
-  :type 'symbol
-  :group 'evil)
-
-(defcustom evil-bigword "^ \t\r\n"
-  "The characters to be considered as a big word.
-This should be a regexp set without the enclosing []."
-  :type 'string
-  :group 'evil)
-(make-variable-buffer-local 'evil-bigword)
-
-(defcustom evil-want-fine-undo nil
-  "Whether actions like \"cw\" are undone in several steps.
-There are three possible choices. \"No\" means all changes made
-during insert state including a possible delete after a change
-operation are collected in a single undo step. If \"Yes\" is
-selected, undo steps are determined according to Emacs heuristics
-and no attempt is made to further aggregate changes.
-
-As of 1.2.13, the option \"fine\" is ignored and means the same
-thing as \"No\". It used to be the case that fine would only try
-to merge the first two changes in an insert operation. For
-example, merging the delete and first insert operation after
-\"cw\", but this option was removed because it did not work
-consistently."
-  :type '(radio (const :tag "No" :value nil)
-                (const :tag "Fine (obsolete)" :value fine)
-                (const :tag "Yes" :value t))
-  :group 'evil)
-
-(defcustom evil-regexp-search t
-  "Whether to use regular expressions for searching."
-  :type  'boolean
-  :group 'evil)
-
-(defcustom evil-search-wrap t
-  "Whether search wraps around."
-  :type  'boolean
-  :group 'evil)
-
-(defcustom evil-flash-delay 2
-  "Time in seconds to flash search matches."
-  :type  'number
-  :group 'evil)
-
-(defcustom evil-fold-level 0
-  "Default fold level."
-  :type  'integer
-  :group 'evil)
-
-(defcustom evil-auto-balance-windows t
-  "If non-nil creating/deleting a window causes a rebalance."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-split-window-below nil
-  "If non-nil split windows are created below."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-vsplit-window-right nil
-  "If non-nil vsplit windows are created to the right."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-esc-delay 0.01
-  "Time in seconds to wait for another key after ESC."
-  :type 'number
-  :group 'evil)
-
-(defvar evil-esc-mode nil
-  "Non-nil if `evil-esc-mode' is enabled.")
-
-(defvar evil-esc-map nil
-  "Original ESC prefix map in `input-decode-map'.
-Used by `evil-esc-mode'.")
-
-(defvar evil-inhibit-esc nil
-  "If non-nil, the \\e event will never be translated to 'escape.")
-
-(defcustom evil-intercept-esc 'always
-  "Whether evil should intercept the ESC key.
-In terminal, a plain ESC key and a meta-key-sequence both
-generate the same event. In order to distinguish both evil
-modifies `input-decode-map'. This is necessary in terminal but
-not in X mode. However, the terminal ESC is equivalent to C-[, so
-if you want to use C-[ instead of ESC in X, then Evil must
-intercept the ESC event in X, too. This variable determines when
-Evil should intercept the event."
-  :type '(radio (const :tag "Never" :value nil)
-                (const :tag "In terminal only" :value t)
-                (const :tag "Always" :value always))
-  :group 'evil)
-
-(defcustom evil-show-paren-range 0
-  "The minimal distance between point and a parenthesis
-which causes the parenthesis to be highlighted."
-  :type 'integer
-  :group 'evil)
-
-(defcustom evil-ex-hl-update-delay 0.02
-  "Time in seconds of idle before updating search highlighting.
-Setting this to a period shorter than that of keyboard's repeat
-rate allows highlights to update while scrolling."
-  :type 'number
-  :group 'evil)
-
-(defcustom evil-highlight-closing-paren-at-point-states
-  '(not emacs insert replace)
-  "The states in which the closing parenthesis at point should be highlighted.
-All states listed here highlight the closing parenthesis at
-point (which is Vim default behavior), all others highlight the
-parenthesis before point (which is Emacs default behavior). If
-this list contains the symbol 'not then its meaning is inverted,
-i.e., all states listed here highlight the closing parenthesis
-before point."
-  :type '(repeat symbol)
-  :group 'evil)
-
-(defcustom evil-kill-on-visual-paste t
-  "Whether `evil-visual-paste' adds the replaced text to the kill
-ring, making it the default for the next paste. The default, t,
-replicates the default vim behavior."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-want-C-i-jump t
-  "Whether \"C-i\" jumps forward like in Vim."
-  :type 'boolean
-  :group 'evil
-  :set #'(lambda (sym value)
-           (set-default sym value)
-           (when (boundp 'evil-motion-state-map)
-             (cond
-              ((and (not value)
-                    (eq (lookup-key evil-motion-state-map (kbd "C-i"))
-                        'evil-jump-forward))
-               (define-key evil-motion-state-map (kbd "C-i") nil))
-              ((and value
-                    (not (lookup-key evil-motion-state-map (kbd "C-i"))))
-               (define-key evil-motion-state-map (kbd "C-i") 'evil-jump-forward))))))
-
-(defcustom evil-want-C-u-scroll nil
-  "Whether \"C-u\" scrolls like in Vim."
-  :type 'boolean
-  :group 'evil
-  :set #'(lambda (sym value)
-           (set-default sym value)
-           (when (boundp 'evil-motion-state-map)
-             (cond
-              ((and (not value)
-                    (eq (lookup-key evil-motion-state-map (kbd "C-u"))
-                        'evil-scroll-up))
-               (define-key evil-motion-state-map (kbd "C-u") nil))
-              ((and value
-                    (not (lookup-key evil-motion-state-map (kbd "C-u"))))
-               (define-key evil-motion-state-map (kbd "C-u") 'evil-scroll-up))))))
-
-(defcustom evil-want-C-d-scroll t
-  "Whether \"C-d\" scrolls like in Vim."
-  :type 'boolean
-  :group 'evil
-  :set #'(lambda (sym value)
-           (set-default sym value)
-           (when (boundp 'evil-motion-state-map)
-             (cond
-              ((and (not value)
-                    (eq (lookup-key evil-motion-state-map (kbd "C-d"))
-                        'evil-scroll-down))
-               (define-key evil-motion-state-map (kbd "C-d") nil))
-              ((and value
-                    (not (lookup-key evil-motion-state-map (kbd "C-d"))))
-               (define-key evil-motion-state-map (kbd "C-d") 'evil-scroll-down))))))
-
-(defcustom evil-want-C-w-delete t
-  "Whether \"C-w\" deletes a word in Insert state."
-  :type 'boolean
-  :group 'evil
-  :set #'(lambda (sym value)
-           (set-default sym value)
-           (when (boundp 'evil-insert-state-map)
-             (cond
-              ((and (not value)
-                    (eq (lookup-key evil-insert-state-map (kbd "C-w"))
-                        'evil-delete-backward-word))
-               (define-key evil-insert-state-map (kbd "C-w") 'evil-window-map))
-              ((and value
-                    (eq (lookup-key evil-insert-state-map (kbd "C-w"))
-                        'evil-window-map))
-               (define-key evil-insert-state-map (kbd "C-w") 'evil-delete-backward-word))))))
-
-(defcustom evil-want-C-w-in-emacs-state nil
-  "Whether \"C-w\" prefixes windows commands in Emacs state."
-  :type 'boolean
-  :group 'evil
-  :set #'(lambda (sym value)
-           (set-default sym value)
-           (when (boundp 'evil-emacs-state-map)
-             (cond
-              ((and (not value)
-                    (eq (lookup-key evil-emacs-state-map (kbd "C-w"))
-                        'evil-window-map))
-               (define-key evil-emacs-state-map (kbd "C-w") nil))
-              ((and value
-                    (not (lookup-key evil-emacs-state-map (kbd "C-w"))))
-               (define-key evil-emacs-state-map (kbd "C-w") 'evil-window-map))))))
-
-(defcustom evil-want-change-word-to-end t
-  "Whether \"cw\" behaves like \"ce\"."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-want-Y-yank-to-eol nil
-  "Whether \"Y\" yanks to the end of the line.
-The default behavior is to yank the whole line."
-  :group 'evil
-  :type 'boolean
-  :initialize #'evil-custom-initialize-pending-reset
-  :set #'(lambda (sym value)
-           (evil-add-command-properties
-            'evil-yank-line
-            :motion (if value 'evil-end-of-line 'evil-line))))
-
-(defcustom evil-disable-insert-state-bindings nil
-  "Whether insert state bindings should be used. Excludes
-bindings for escape, delete and `evil-toggle-key'."
-  :group 'evil
-  :type 'boolean
-  :initialize #'evil-custom-initialize-pending-reset
-  :set #'evil-update-insert-state-bindings)
-
-(defcustom evil-echo-state t
-  "Whether to signal the current state in the echo area."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-complete-all-buffers t
-  "Whether completion looks for matches in all buffers."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-complete-next-func
-  #'(lambda (arg)
-      (require 'dabbrev)
-      (let ((dabbrev-search-these-buffers-only
-             (unless evil-complete-all-buffers
-               (list (current-buffer))))
-            dabbrev-case-distinction)
-        (condition-case nil
-            (if (eq last-command this-command)
-                (dabbrev-expand nil)
-              (dabbrev-expand (- (abs (or arg 1)))))
-          (error (dabbrev-expand nil)))))
-  "Completion function used by \
-\\<evil-insert-state-map>\\[evil-complete-next]."
-  :type 'function
-  :group 'evil)
-
-(defcustom evil-complete-previous-func
-  #'(lambda (arg)
-      (require 'dabbrev)
-      (let ((dabbrev-search-these-buffers-only
-             (unless evil-complete-all-buffers
-               (list (current-buffer))))
-            dabbrev-case-distinction)
-        (dabbrev-expand arg)))
-  "Completion function used by \
-\\<evil-insert-state-map>\\[evil-complete-previous]."
-  :type 'function
-  :group 'evil)
-
-(defcustom evil-complete-next-minibuffer-func 'minibuffer-complete
-  "Minibuffer completion function used by \
-\\<evil-insert-state-map>\\[evil-complete-next]."
-  :type 'function
-  :group 'evil)
-
-(defcustom evil-complete-previous-minibuffer-func 'minibuffer-complete
-  "Minibuffer completion function used by \
-\\<evil-insert-state-map>\\[evil-complete-previous]."
-  :type 'function
-  :group 'evil)
-
-(defcustom evil-complete-next-line-func
-  #'(lambda (arg)
-      (let ((hippie-expand-try-functions-list
-             '(try-expand-line
-               try-expand-line-all-buffers)))
-        (hippie-expand arg)))
-  "Minibuffer completion function used by \
-\\<evil-insert-state-map>\\[evil-complete-next-line]."
-  :type 'function
-  :group 'evil)
-
-(defcustom evil-complete-previous-line-func
-  evil-complete-next-line-func
-  "Minibuffer completion function used by \
-\\<evil-insert-state-map>\\[evil-complete-previous-line]."
-  :type 'function
-  :group 'evil)
-
-(defcustom evil-lookup-func #'woman
-  "Lookup function used by \
-\"\\<evil-motion-state-map>\\[evil-lookup]\"."
-  :type 'function
-  :group 'evil)
-
-(defcustom evil-toggle-key "C-z"
-  "The key used to change to and from Emacs state.
-Must be readable by `read-kbd-macro'. For example: \"C-z\"."
-  :type 'string
-  :group 'evil
-  :set #'(lambda (sym value)
-           (evil-set-toggle-key value)
-           (set-default sym value)))
-
-(defcustom evil-default-state 'normal
-  "The default state.
-This is the state a mode comes up in when it is not listed
-in `evil-emacs-state-modes', `evil-insert-state-modes' or
-`evil-motion-state-modes'. The value may be one of `normal',
-`insert', `visual', `replace', `operator', `motion' and
-`emacs'."
-  :type  'symbol
-  :group 'evil)
-
-(defcustom evil-buffer-regexps
-  '(("^ \\*load\\*" . nil))
-  "Regular expression determining the initial state for a buffer.
-Entries have the form (REGEXP . STATE), where REGEXP is a regular
-expression matching the buffer's name and STATE is one of `normal',
-`insert', `visual', `replace', `operator', `motion', `emacs' and nil.
-If STATE is nil, Evil is disabled in the buffer."
-  :type '(alist :key-type string :value-type symbol)
-  :group 'evil)
-
-(defcustom evil-emacs-state-modes
-  '(archive-mode
-    bbdb-mode
-    biblio-selection-mode
-    bookmark-bmenu-mode
-    bookmark-edit-annotation-mode
-    browse-kill-ring-mode
-    bzr-annotate-mode
-    calc-mode
-    cfw:calendar-mode
-    completion-list-mode
-    Custom-mode
-    custom-theme-choose-mode
-    debugger-mode
-    delicious-search-mode
-    desktop-menu-blist-mode
-    desktop-menu-mode
-    doc-view-mode
-    dvc-bookmarks-mode
-    dvc-diff-mode
-    dvc-info-buffer-mode
-    dvc-log-buffer-mode
-    dvc-revlist-mode
-    dvc-revlog-mode
-    dvc-status-mode
-    dvc-tips-mode
-    ediff-mode
-    ediff-meta-mode
-    efs-mode
-    Electric-buffer-menu-mode
-    emms-browser-mode
-    emms-mark-mode
-    emms-metaplaylist-mode
-    emms-playlist-mode
-    ess-help-mode
-    etags-select-mode
-    fj-mode
-    gc-issues-mode
-    gdb-breakpoints-mode
-    gdb-disassembly-mode
-    gdb-frames-mode
-    gdb-locals-mode
-    gdb-memory-mode
-    gdb-registers-mode
-    gdb-threads-mode
-    gist-list-mode
-    git-commit-mode
-    git-rebase-mode
-    gnus-article-mode
-    gnus-browse-mode
-    gnus-group-mode
-    gnus-server-mode
-    gnus-summary-mode
-    google-maps-static-mode
-    ibuffer-mode
-    jde-javadoc-checker-report-mode
-    magit-cherry-mode
-    magit-diff-mode
-    magit-log-mode
-    magit-log-select-mode
-    magit-popup-mode
-    magit-popup-sequence-mode
-    magit-process-mode
-    magit-reflog-mode
-    magit-refs-mode
-    magit-revision-mode
-    magit-stash-mode
-    magit-stashes-mode
-    magit-status-mode
-    ;; Obsolete as of Magit v2.1.0
-    magit-mode
-    magit-branch-manager-mode
-    magit-commit-mode
-    magit-key-mode
-    magit-rebase-mode
-    magit-wazzup-mode
-    ;; end obsolete
-    mh-folder-mode
-    monky-mode
-    mu4e-main-mode
-    mu4e-headers-mode
-    mu4e-view-mode
-    notmuch-hello-mode
-    notmuch-search-mode
-    notmuch-show-mode
-    occur-mode
-    org-agenda-mode
-    package-menu-mode
-    pdf-outline-buffer-mode
-    pdf-view-mode
-    proced-mode
-    rcirc-mode
-    rebase-mode
-    recentf-dialog-mode
-    reftex-select-bib-mode
-    reftex-select-label-mode
-    reftex-toc-mode
-    sldb-mode
-    slime-inspector-mode
-    slime-thread-control-mode
-    slime-xref-mode
-    sr-buttons-mode
-    sr-mode
-    sr-tree-mode
-    sr-virtual-mode
-    tar-mode
-    tetris-mode
-    tla-annotate-mode
-    tla-archive-list-mode
-    tla-bconfig-mode
-    tla-bookmarks-mode
-    tla-branch-list-mode
-    tla-browse-mode
-    tla-category-list-mode
-    tla-changelog-mode
-    tla-follow-symlinks-mode
-    tla-inventory-file-mode
-    tla-inventory-mode
-    tla-lint-mode
-    tla-logs-mode
-    tla-revision-list-mode
-    tla-revlog-mode
-    tla-tree-lint-mode
-    tla-version-list-mode
-    twittering-mode
-    urlview-mode
-    vc-annotate-mode
-    vc-dir-mode
-    vc-git-log-view-mode
-    vc-hg-log-view-mode
-    vc-svn-log-view-mode
-    vm-mode
-    vm-summary-mode
-    w3m-mode
-    wab-compilation-mode
-    xgit-annotate-mode
-    xgit-changelog-mode
-    xgit-diff-mode
-    xgit-revlog-mode
-    xhg-annotate-mode
-    xhg-log-mode
-    xhg-mode
-    xhg-mq-mode
-    xhg-mq-sub-mode
-    xhg-status-extra-mode)
-  "Modes that should come up in Emacs state."
-  :type  '(repeat symbol)
-  :group 'evil)
-
-(defcustom evil-insert-state-modes
-  '(comint-mode
-    erc-mode
-    eshell-mode
-    geiser-repl-mode
-    gud-mode
-    inferior-apl-mode
-    inferior-caml-mode
-    inferior-emacs-lisp-mode
-    inferior-j-mode
-    inferior-python-mode
-    inferior-scheme-mode
-    inferior-sml-mode
-    internal-ange-ftp-mode
-    prolog-inferior-mode
-    reb-mode
-    shell-mode
-    slime-repl-mode
-    term-mode
-    wdired-mode)
-  "Modes that should come up in Insert state."
-  :type  '(repeat symbol)
-  :group 'evil)
-
-(defcustom evil-motion-state-modes
-  '(apropos-mode
-    Buffer-menu-mode
-    calendar-mode
-    color-theme-mode
-    command-history-mode
-    compilation-mode
-    dictionary-mode
-    ert-results-mode
-    help-mode
-    Info-mode
-    Man-mode
-    speedbar-mode
-    undo-tree-visualizer-mode
-    woman-mode)
-  "Modes that should come up in Motion state."
-  :type  '(repeat symbol)
-  :group 'evil)
-
-(defvar evil-pending-overriding-maps nil
-  "An alist of pending overriding maps.")
-
-(defvar evil-pending-intercept-maps nil
-  "An alist of pending intercept maps.")
-
-(defcustom evil-overriding-maps
-  '((Buffer-menu-mode-map . nil)
-    (color-theme-mode-map . nil)
-    (comint-mode-map . nil)
-    (compilation-mode-map . nil)
-    (grep-mode-map . nil)
-    (dictionary-mode-map . nil)
-    (ert-results-mode-map . motion)
-    (Info-mode-map . motion)
-    (speedbar-key-map . nil)
-    (speedbar-file-key-map . nil)
-    (speedbar-buffers-key-map . nil))
-  "Keymaps that should override Evil maps.
-Entries have the form (MAP-VAR . STATE), where MAP-VAR is
-a keymap variable and STATE is the state whose bindings
-should be overridden. If STATE is nil, all states are
-overridden."
-  :type '(alist :key-type symbol :value-type symbol)
-  :group 'evil
-  :set #'(lambda (var values)
-           (evil-set-custom-state-maps 'evil-overriding-maps
-                                       'evil-pending-overriding-maps
-                                       'override-state
-                                       'evil-make-overriding-map
-                                       values))
-  :initialize 'evil-custom-initialize-pending-reset)
-
-(add-hook 'after-load-functions #'evil-update-pending-maps)
-
-(defcustom evil-intercept-maps
-  '((edebug-mode-map . nil))
-  "Keymaps that should intercept Evil maps.
-Entries have the form (MAP-VAR . STATE), where MAP-VAR is
-a keymap variable and STATE is the state whose bindings
-should be intercepted. If STATE is nil, all states are
-intercepted."
-  :type '(alist :key-type symbol :value-type symbol)
-  :group 'evil
-  :set #'(lambda (var values)
-           (evil-set-custom-state-maps 'evil-intercept-maps
-                                       'evil-pending-intercept-maps
-                                       'intercept-state
-                                       'evil-make-intercept-map
-                                       values))
-  :initialize 'evil-custom-initialize-pending-reset)
-
-(defcustom evil-motions
-  '(back-to-indentation
-    backward-char
-    backward-list
-    backward-paragraph
-    backward-sentence
-    backward-sexp
-    backward-up-list
-    backward-word
-    beginning-of-buffer
-    beginning-of-defun
-    beginning-of-line
-    beginning-of-visual-line
-    c-beginning-of-defun
-    c-end-of-defun
-    diff-file-next
-    diff-file-prev
-    diff-hunk-next
-    diff-hunk-prev
-    down-list
-    end-of-buffer
-    end-of-defun
-    end-of-line
-    end-of-visual-line
-    exchange-point-and-mark
-    forward-char
-    forward-list
-    forward-paragraph
-    forward-sentence
-    forward-sexp
-    forward-word
-    goto-last-change
-    ibuffer-backward-line
-    ibuffer-forward-line
-    isearch-abort
-    isearch-cancel
-    isearch-complete
-    isearch-del-char
-    isearch-delete-char
-    isearch-edit-string
-    isearch-exit
-    isearch-highlight-regexp
-    isearch-occur
-    isearch-other-control-char
-    isearch-other-meta-char
-    isearch-printing-char
-    isearch-query-replace
-    isearch-query-replace-regexp
-    isearch-quote-char
-    isearch-repeat-backward
-    isearch-repeat-forward
-    isearch-ring-advance
-    isearch-ring-retreat
-    isearch-toggle-case-fold
-    isearch-toggle-input-method
-    isearch-toggle-regexp
-    isearch-toggle-specified-input-method
-    isearch-toggle-word
-    isearch-yank-char
-    isearch-yank-kill
-    isearch-yank-line
-    isearch-yank-word-or-char
-    keyboard-quit
-    left-char
-    left-word
-    mouse-drag-region
-    mouse-save-then-kill
-    mouse-set-point
-    mouse-set-region
-    mwheel-scroll
-    move-beginning-of-line
-    move-end-of-line
-    next-error
-    next-line
-    paredit-backward
-    paredit-backward-down
-    paredit-backward-up
-    paredit-forward
-    paredit-forward-down
-    paredit-forward-up
-    pop-global-mark
-    pop-tag-mark
-    pop-to-mark-command
-    previous-error
-    previous-line
-    right-char
-    right-word
-    scroll-down
-    scroll-down-command
-    scroll-up
-    scroll-up-command
-    sgml-skip-tag-backward
-    sgml-skip-tag-forward
-    up-list)
-  "Non-Evil commands to initialize to motions."
-  :type  '(repeat symbol)
-  :group 'evil
-  :set 'evil-set-custom-motions
-  :initialize 'evil-custom-initialize-pending-reset)
-
-(defcustom evil-visual-newline-commands
-  '(LaTeX-section
-    TeX-font)
-  "Commands excluding the trailing newline of a Visual Line selection.
-These commands work better without this newline."
-  :type  '(repeat symbol)
-  :group 'evil
-  :set 'evil-set-visual-newline-commands
-  :initialize 'evil-custom-initialize-pending-reset)
-
-(defcustom evil-want-visual-char-semi-exclusive nil
-  "Visual character selection to beginning/end of line is exclusive.
-If non nil then an inclusive visual character selection which
-ends at the beginning or end of a line is turned into an
-exclusive selection. Thus if the selected (inclusive) range ends
-at the beginning of a line it is changed to not include the first
-character of that line, and if the selected range ends at the end
-of a line it is changed to not include the newline character of
-that line."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-text-object-change-visual-type t
-  "Text objects change the current visual state type.
-If non-nil then a text-object changes the type of the visual state to
-its default selection type (e.g. a word object always changes to
-charwise visual state). Otherwise the current visual state type is
-preserved."
-  :type 'boolean
-  :group 'evil)
-
-(defgroup evil-cjk nil
-  "CJK support"
-  :prefix "evil-cjk-"
-  :group 'evil)
-
-(defcustom evil-cjk-emacs-word-boundary nil
-  "Determine word boundary exactly the same way as Emacs does."
-  :type 'boolean
-  :group 'evil-cjk)
-
-(defcustom evil-cjk-word-separating-categories
-  '(;; Kanji
-    (?C . ?H) (?C . ?K) (?C . ?k) (?C . ?A) (?C . ?G)
-    ;; Hiragana
-    (?H . ?C) (?H . ?K) (?H . ?k) (?H . ?A) (?H . ?G)
-    ;; Katakana
-    (?K . ?C) (?K . ?H) (?K . ?k) (?K . ?A) (?K . ?G)
-    ;; half-width Katakana
-    (?k . ?C) (?k . ?H) (?k . ?K) ; (?k . ?A) (?k . ?G)
-    ;; full-width alphanumeric
-    (?A . ?C) (?A . ?H) (?A . ?K) ; (?A . ?k) (?A . ?G)
-    ;; full-width Greek
-    (?G . ?C) (?G . ?H) (?G . ?K) ; (?G . ?k) (?G . ?A)
-    )
-  "List of pair (cons) of categories to determine word boundary
-used in `evil-cjk-word-boundary-p'. See the documentation of
-`word-separating-categories'. Use `describe-categories' to see
-the list of categories."
-  :type '((character . character))
-  :group 'evil-cjk)
-
-(defcustom evil-cjk-word-combining-categories
-  '(;; default value in word-combining-categories
-    (nil . ?^) (?^ . nil)
-    ;; Roman
-    (?r . ?k) (?r . ?A) (?r . ?G)
-    ;; half-width Katakana
-    (?k . ?r) (?k . ?A) (?k . ?G)
-    ;; full-width alphanumeric
-    (?A . ?r) (?A . ?k) (?A . ?G)
-    ;; full-width Greek
-    (?G . ?r) (?G . ?k) (?G . ?A)
-    )
-  "List of pair (cons) of categories to determine word boundary
-used in `evil-cjk-word-boundary-p'. See the documentation of
-`word-combining-categories'. Use `describe-categories' to see the
-list of categories."
-  :type '((character . character))
-  :group 'evil-cjk)
-
-(defcustom evil-ex-complete-emacs-commands 'in-turn
-  "TAB-completion for Emacs commands in ex command line.
-This variable determines when Emacs commands are considered for
-completion, always, never, or only if no Evil ex command is
-available for completion."
-  :group 'evil
-  :type '(radio (const :tag "Only if no ex-command." :value in-turn)
-                (const :tag "Never" :value nil)
-                (const :tag "Always" :value t)))
-
-(defface evil-ex-commands '(( nil
-                              :underline t
-                              :slant italic))
-  "Face for the evil command in completion in ex mode."
-  :group 'evil)
-
-(defface evil-ex-info '(( ((supports :slant))
-                          :slant italic
-                          :foreground "red"))
-  "Face for the info message in ex mode."
-  :group 'evil)
-
-(defcustom evil-ex-visual-char-range nil
-  "Type of default ex range in visual char state.
-If non-nil the default range when starting an ex command from
-character visual state is `<,`> otherwise it is '<,'>. In the
-first case the ex command will be passed a region covering only
-the visual selection. In the second case the passed region will
-be extended to contain full lines."
-  :group 'evil
-  :type 'boolean)
-
-;; Searching
-(defcustom evil-symbol-word-search nil
-  "If nil then * and # search for words otherwise for symbols."
-  :group 'evil
-  :type 'boolean)
-(make-variable-buffer-local 'evil-symbol-word-search)
-
-(defcustom evil-magic t
-  "Meaning which characters in a pattern are magic.
-The meaning of those values is the same as in Vim. Note that it
-only has influence if the evil search module is chosen in
-`evil-search-module'."
-  :group 'evil
-  :type '(radio (const :tag "Very magic." :value very-magic)
-                (const :tag "Magic" :value t)
-                (const :tag "Nomagic" :value nil)
-                (const :tag "Very nomagic" :value very-nomagic)))
-
-(defcustom evil-ex-search-vim-style-regexp nil
-  "If non-nil Vim-style backslash codes are supported in search patterns.
-See `evil-transform-vim-style-regexp' for the supported backslash
-codes.  Note that this only affects the search command if
-`evil-search-module' is set to 'evil-search. The isearch module
-always uses plain Emacs regular expressions."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-ex-interactive-search-highlight 'all-windows
-  "Determine in which windows the interactive highlighting should be shown."
-  :type '(radio (const :tag "All windows." all-windows)
-                (const :tag "Selected window." selected-window)
-                (const :tag "Disable highlighting." nil))
-  :group 'evil)
-
-(defcustom evil-ex-search-persistent-highlight t
-  "If non-nil matches remain highlighted when the search ends."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-ex-search-case 'smart
-  "The case behaviour of the search command.
-Smart case means that the pattern is case sensitive if and only
-if it contains an upper case letter, otherwise it is case
-insensitive."
-  :type '(radio (const :tag "Case sensitive." sensitive)
-                (const :tag "Case insensitive." insensitive)
-                (const :tag "Smart case." smart))
-  :group 'evil)
-
-(defcustom evil-ex-substitute-case nil
-  "The case behaviour of the search command.
-Smart case means that the pattern is case sensitive if and only
-if it contains an upper case letter, otherwise it is case
-insensitive. If nil then the setting of `evil-ex-search-case' is
-used."
-  :type '(radio (const :tag "Same as interactive search." nil)
-                (const :tag "Case sensitive." sensitive)
-                (const :tag "Case insensitive." insensitive)
-                (const :tag "Smart case." smart))
-  :group 'evil)
-
-(defcustom evil-ex-search-interactive t
-  "If t search is interactive."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-ex-search-highlight-all t
-  "If t and interactive search is enabled, all matches are
-highlighted."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-ex-substitute-highlight-all t
-  "If t all matches for the substitute pattern are highlighted."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-ex-substitute-interactive-replace t
-  "If t and substitute patterns are highlighted,
-the replacement is shown interactively."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-ex-substitute-global nil
-  "If non-nil substitute patterns are global by default.
-Usually (if this variable is nil) a substitution works only on
-the first match of a pattern in a line unless the 'g' flag is
-given, in which case the substitution happens on all matches in a
-line. If this option is non-nil, this behaviour is reversed: the
-substitution works on all matches unless the 'g' pattern is
-specified, then is works only on the first match."
-  :type  'boolean
-  :group 'evil)
-
-(defface evil-ex-search '((t :inherit isearch))
-  "Face for interactive search."
-  :group 'evil)
-
-(defface evil-ex-lazy-highlight '((t :inherit lazy-highlight))
-  "Face for highlighting all matches in interactive search."
-  :group 'evil)
-
-(defface evil-ex-substitute-matches '((t :inherit lazy-highlight))
-  "Face for interactive substitute matches."
-  :group 'evil)
-
-(defface evil-ex-substitute-replacement '((((supports :underline))
-                                           :underline t
-                                           :foreground "red"))
-  "Face for interactive replacement text."
-  :group 'evil)
-
-(defcustom evil-command-window-height 8
-  "Height (in lines) of the command line window.
-Set to 0 to use the default height for `split-window'."
-  :type 'integer
-  :group 'evil)
-
-(defcustom evil-display-shell-error-in-message nil
-  "Show error output of a shell command in the error buffer.
-If this variable is non-nil the error output of a shell command
-goes to the messages buffer instead of being mixed with the
-regular output. This happens only if the exit status of the
-command is non-zero."
-  :type 'boolean
-  :group 'evil)
-
-(defcustom evil-want-abbrev-expand-on-insert-exit t
-  "If non-nil abbrevs will be expanded when leaving Insert state
-like in Vim. This variable is read only on load."
-  :type 'boolean
-  :group 'evil)
-
-;;; Variables
-
-(defmacro evil-define-local-var (symbol &optional initvalue docstring)
-  "Define SYMBOL as permanent buffer local variable, and return SYMBOL.
-The parameters are the same as for `defvar', but the variable
-SYMBOL is made permanent buffer local."
-  (declare (indent defun)
-           (debug (symbolp &optional form stringp)))
-  `(progn
-     (defvar ,symbol ,initvalue ,docstring)
-     (make-variable-buffer-local ',symbol)
-     (put ',symbol 'permanent-local t)))
-
-(evil-define-local-var evil-scroll-count 0
-  "Holds last used prefix for `evil-scroll-up'
-and `evil-scroll-down'.
-Determines how many lines should be scrolled.
-Default value is 0 - scroll half the screen.")
-
-(evil-define-local-var evil-state nil
-  "The current Evil state.
-To change the state, use `evil-change-state'
-or call the state function (e.g., `evil-normal-state').")
-
-;; these may be used inside `evil-define-state'
-(evil-define-local-var evil-next-state nil
-  "The Evil state being switched to.")
-
-(evil-define-local-var evil-previous-state-alist nil
-  "For Each evil state the Evil state being switched from.")
-
-(evil-define-local-var evil-previous-state nil
-  "The Evil state being switched from.")
-
-(defvar evil-execute-in-emacs-state-buffer nil
-  "The buffer of the latest `evil-execute-in-emacs-state'.
-When this command is being executed the current buffer is stored
-in this variable. This is necessary in case the Emacs-command to
-be called changes the current buffer.")
-
-(evil-define-local-var evil-mode-line-tag nil
-  "Mode-Line indicator for the current state.")
-(put 'evil-mode-line-tag 'risky-local-variable t)
-
-(defvar evil-global-keymaps-alist nil
-  "Association list of keymap variables.
-Entries have the form (MODE . KEYMAP), where KEYMAP
-is the variable containing the keymap for MODE.")
-
-(defvar evil-local-keymaps-alist nil
-  "Association list of keymap variables that must be
-reinitialized in each buffer. Entries have the form
-\(MODE . KEYMAP), where KEYMAP is the variable containing
-the keymap for MODE.")
-
-(defvar evil-minor-mode-keymaps-alist nil
-  "Association list of evil states to minor-mode keymap alists.
-Entries have the form (STATE . MODE-MAP-ALIST), where
-MODE-MAP-ALIST is an alist taking the form of
-`minor-mode-map-alist'.")
-
-(defvar evil-state-properties nil
-  "Specifications made by `evil-define-state'.
-Entries have the form (STATE . PLIST), where PLIST is a property
-list specifying various aspects of the state. To access a property,
-use `evil-state-property'.")
-
-(evil-define-local-var evil-mode-map-alist nil
-  "Association list of keymaps to use for Evil modes.
-Elements have the form (MODE . KEYMAP), with the first keymaps
-having higher priority.")
-
-(defvar evil-command-properties nil
-  "Specifications made by `evil-define-command'.")
-
-(defvar evil-change-commands '(evil-change)
-  "Commands that wrap or replace `evil-change'.
-This list exists to apply an inconsistency with vim's change command
-to commands that wrap or redefine it. See emacs-evil/evil#916.")
-
-(defvar evil-transient-vars '(cua-mode transient-mark-mode select-active-regions)
-  "List of variables pertaining to Transient Mark mode.")
-
-(defvar evil-transient-vals nil
-  "Association list of old values for Transient Mark mode variables.
-Entries have the form (VARIABLE VALUE LOCAL), where LOCAL is
-whether the variable was previously buffer-local.")
-
-(evil-define-local-var evil-no-display nil
-  "If non-nil, various Evil displays are inhibited.
-Use the macro `evil-without-display' to set this variable.")
-
-(defvar evil-type-properties nil
-  "Specifications made by `evil-define-type'.
-Entries have the form (TYPE . PLIST), where PLIST is a property
-list specifying functions for handling the type: expanding it,
-describing it, etc.")
-
-(defvar evil-interactive-alist nil
-  "Association list of Evil-specific interactive codes.")
-
-(evil-define-local-var evil-motion-marker nil
-  "Marker for storing the starting position of a motion.")
-
-(evil-define-local-var evil-this-type nil
-  "Current motion type.")
-
-(evil-define-local-var evil-this-type-modified nil
-  "Non-nil iff current motion type has been modified by the user.
-If the type has been modified, this variable contains the new
-type.")
-
-(evil-define-local-var evil-this-register nil
-  "Current register.")
-
-(evil-define-local-var evil-this-macro nil
-  "Current macro register.")
-
-(evil-define-local-var evil-this-operator nil
-  "Current operator.")
-
-(evil-define-local-var evil-this-motion nil
-  "Current motion.")
-
-(evil-define-local-var evil-this-motion-count nil
-  "Current motion count.")
-
-(defvar evil-last-register nil
-  "The last executed register.")
-
-(defvar evil-inhibit-operator nil
-  "Inhibit current operator.
-If an operator calls a motion and the motion sets this variable
-to t, the operator code is not executed.")
-
-(defvar evil-inhibit-operator-value nil
-  "This variable is used to transfer the value
-of `evil-inhibit-operator' from one local scope to another.")
-
-;; used by `evil-define-operator'
-(defvar evil-operator-range-beginning nil
-  "Beginning of `evil-operator-range'.")
-
-(defvar evil-operator-range-end nil
-  "End of `evil-operator-range'.")
-
-(defvar evil-operator-range-type nil
-  "Type of `evil-operator-range'.")
-
-(defvar evil-operator-range-motion nil
-  "Motion of `evil-operator-range'.")
-
-(defvar evil-restriction-stack nil
-  "List of previous restrictions.
-Using `evil-with-restriction' stores the previous values of
-`point-min' and `point-max' as a pair in this list.")
-
-(evil-define-local-var evil-markers-alist
-  '((?\( . evil-backward-sentence)
-    (?\) . evil-forward-sentence)
-    (?{ . evil-backward-paragraph)
-    (?} . evil-forward-paragraph)
-    (?' . evil-jump-backward-swap)
-    (?` . evil-jump-backward-swap)
-    (?< . evil-visual-beginning)
-    (?> . evil-visual-goto-end)
-    (?. . (lambda ()
-            (let (last-command)
-              (goto-last-change nil)))))
-  "Association list for markers.
-Entries have the form (CHAR . DATA), where CHAR is the marker's
-name and DATA is either a marker object as returned by `make-marker',
-a variable, a movement function, or a cons cell (STRING NUMBER),
-where STRING is a file path and NUMBER is a buffer position.
-The global value of this variable holds markers available from
-every buffer, while the buffer-local value holds markers available
-only in the current buffer.")
-
-(defconst evil-suppress-map (make-keymap)
-  "Full keymap disabling default bindings to `self-insert-command'.")
-(suppress-keymap evil-suppress-map t)
-
-(defvar evil-read-key-map (make-sparse-keymap)
-  "Keymap active during `evil-read-key'.
-This keymap can be used to bind some commands during the
-execution of `evil-read-key' which is usually used to read a
-character argument for some commands, e.g. `evil-replace'.")
-
-;; TODO: customize size of ring
-(defvar evil-repeat-ring (make-ring 10)
-  "A ring of repeat-informations to repeat the last command.")
-
-(defvar evil-repeat-types
-  '((t . evil-repeat-keystrokes)
-    (change . evil-repeat-changes)
-    (motion . evil-repeat-motion)
-    (insert-at-point . evil-repeat-insert-at-point)
-    (ignore . nil))
-  "An alist of defined repeat-types.")
-
-(defvar evil-recording-repeat nil
-  "Whether we are recording a repeat.")
-
-(defvar evil-recording-current-command nil
-  "Whether we are recording the current command for repeat.")
-
-(defvar evil-repeat-changes nil
-  "Accumulated buffer changes for changed-based commands.")
-
-(defvar evil-repeat-info nil
-  "Information accumulated during current repeat.")
-
-(defvar evil-repeat-buffer nil
-  "The buffer in which the repeat started.
-If the buffer is changed, the repeat is cancelled.")
-
-(defvar evil-repeat-pos nil
-  "The position of point at the beginning of an change-tracking
-  editing command.")
-
-(defvar evil-repeat-keys nil
-  "The keys that invoked the current command.")
-
-(defvar evil-last-repeat nil
-  "Information about the latest repeat command.
-This is a list of three elements (POINT COUNT UNDO-POINTER),
-where POINT is the position of point before the latest repeat,
-COUNT the count-argument of the latest repeat command and
-UNDO-POINTER the head of the undo-list before the last command
-has been repeated.")
-
-(defvar evil-repeat-count nil
-  "The explicit count when repeating a command.")
-
-(defvar evil-maybe-remove-spaces nil
-  "Flag to determine if newly inserted spaces should be removed.
-See the function `evil-maybe-remove-spaces'.")
-
-(evil-define-local-var evil-insert-count nil
-  "The explicit count passed to an command starting Insert state.")
-
-(evil-define-local-var evil-insert-vcount nil
-  "The information about the number of following lines the
-insertion should be repeated. This is list (LINE COLUMN COUNT)
-where LINE is the line-number where the original insertion
-started and COLUMN is either a number or function determining the
-column where the repeated insertions should take place. COUNT is
-number of repeats (including the original insertion).")
-
-(defvar evil-insert-skip-empty-lines nil
-  "Non-nil of the current insertion should not take place on
-  lines at which the insertion point is behind the end of the
-  line.")
-
-(evil-define-local-var evil-insert-lines nil
-  "Non-nil if the current insertion command is a line-insertion
-command o or O.")
-
-(evil-define-local-var evil-insert-repeat-info nil
-  "Repeat information accumulated during an insertion.")
-
-(evil-define-local-var evil-replace-alist nil
-  "Association list of characters overwritten in Replace state.
-The format is (POS . CHAR).")
-
-(evil-define-local-var evil-echo-area-message nil
-  "Previous value of `current-message'.")
-
-(defvar evil-write-echo-area nil
-  "If set to t inside `evil-save-echo-area', then the echo area
-is not restored.")
-
-(defvar evil-last-find nil
-  "A pair (FUNCTION . CHAR) describing the lastest character
-  search command.")
-
-(defvar evil-last-paste nil
-  "Information about the latest paste.
-This should be a list (CMD COUNT POINT BEG END FIRSTVISUAL) where
-CMD is the last paste-command (`evil-paste-before',
-`evil-paste-after' or `evil-visual-paste'), COUNT is the repeat
-count of the paste, POINT is the position of point before the
-paste, BEG end END are the region of the inserted
-text. FIRSTVISUAL is t if and only if the previous command was
-the first visual paste (i.e. before any paste-pop).")
-
-(evil-define-local-var evil-last-undo-entry nil
-  "Information about the latest undo entry in the buffer.
-This should be a pair (OBJ . CONS) where OBJ is the entry as an
-object, and CONS is a copy of the entry.")
-
-(evil-define-local-var evil-current-insertion nil
-  "Information about the latest insertion in insert state.
-This should be a pair (BEG . END) that describes the
-buffer-region of the newly inserted text.")
-
-(defvar evil-last-insertion nil
-  "The last piece of inserted text.")
-
-(defvar evil-last-small-deletion nil
-  "The last piece of deleted text.
-The text should be less than a line.")
-
-(defvar evil-was-yanked-without-register t
-  "Whether text being saved to the numbered-register ring was
-not deleted and not yanked to a specific register.")
-
-(defvar evil-paste-count nil
-  "The count argument of the current paste command.")
-
-(defvar evil-temporary-undo nil
-  "When undo is disabled in current buffer.
-Certain commands depending on undo use this variable
-instead of `buffer-undo-list'.")
-
-(evil-define-local-var evil-undo-list-pointer nil
-  "Everything up to this mark is united in the undo-list.")
-
-(defvar evil-in-single-undo nil
-  "Set to non-nil if the current undo steps are connected.")
-
-(defvar evil-flash-timer nil
-  "Timer for flashing search results.")
-
-(defvar evil-search-prompt nil
-  "String to use for search prompt.")
-
-(defvar evil-search-forward-history nil
-  "History of forward searches.")
-
-(defvar evil-search-backward-history nil
-  "History of backward searches.")
-
-(defvar evil-inner-text-objects-map (make-sparse-keymap)
-  "Keymap for inner text objects.")
-
-(defvar evil-outer-text-objects-map (make-sparse-keymap)
-  "Keymap for outer text objects.")
-
-(defvar evil-window-map (make-sparse-keymap)
-  "Keymap for window-related commands.")
-
-(evil-define-local-var evil-input-method nil
-  "Input method used in Insert state and Emacs state.")
-
-;;; Visual state
-
-(evil-define-local-var evil-visual-beginning nil
-  "The beginning of the Visual selection, a marker.")
-
-(evil-define-local-var evil-visual-end nil
-  "The end of the Visual selection, a marker.")
-
-(evil-define-local-var evil-visual-point nil
-  "The position of point in Visual state, a marker.")
-
-(evil-define-local-var evil-visual-mark nil
-  "The position of mark in Visual state, a marker.")
-
-(evil-define-local-var evil-visual-previous-mark nil
-  "The position of mark before Visual state, a marker.")
-
-(evil-define-local-var evil-visual-selection nil
-  "The kind of Visual selection.
-This is a selection as defined by `evil-define-visual-selection'.")
-
-;; we could infer the direction by comparing `evil-visual-mark'
-;; and `evil-visual-point', but destructive operations may
-;; displace the markers
-(evil-define-local-var evil-visual-direction 0
-  "Whether point follows mark in Visual state.
-Negative if point precedes mark, otherwise positive.
-See also the function `evil-visual-direction'.")
-
-(evil-define-local-var evil-visual-properties nil
-  "Property list of miscellaneous Visual properties.")
-
-(evil-define-local-var evil-visual-region-expanded nil
-  "Whether the region matches the Visual selection.
-That is, whether the positions of point and mark have been
-expanded to coincide with the selection's boundaries.
-This makes the selection available to functions acting
-on Emacs' region.")
-
-(evil-define-local-var evil-visual-overlay nil
-  "Overlay for highlighting the Visual selection.
-Not used for blockwise selections, in which case
-see `evil-visual-block-overlays'.")
-
-(evil-define-local-var evil-visual-block-overlays nil
-  "Overlays for Visual Block selection, one for each line.
-They are reused to minimize flicker.")
-
-(defvar evil-visual-alist nil
-  "Association list of Visual selection functions.
-Elements have the form (NAME . FUNCTION).")
-
-(evil-define-local-var evil-visual-x-select-timer nil
-  "Timer for updating the X selection in visual state.")
-
-(defvar evil-visual-x-select-timeout 0.1
-  "Time in seconds for the update of the X selection.")
-
-(declare-function origami-open-all-nodes "origami.el")
-(declare-function origami-close-all-nodes "origami.el")
-(declare-function origami-toggle-node "origami.el")
-(declare-function origami-open-node "origami.el")
-(declare-function origami-open-node-recursively "origami.el")
-(declare-function origami-close-node "origami.el")
-
-(defvar evil-fold-list
-  `(((hs-minor-mode)
-     :open-all   hs-show-all
-     :close-all  hs-hide-all
-     :toggle     hs-toggle-hiding
-     :open       hs-show-block
-     :open-rec   nil
-     :close      hs-hide-block)
-    ((hide-ifdef-mode)
-     :open-all   show-ifdefs
-     :close-all  hide-ifdefs
-     :toggle     nil
-     :open       show-ifdef-block
-     :open-rec   nil
-     :close      hide-ifdef-block)
-    ((outline-mode
-      outline-minor-mode
-      org-mode
-      markdown-mode)
-     :open-all   show-all
-     :close-all  ,(lambda ()
-                    (with-no-warnings (hide-sublevels 1)))
-     :toggle     outline-toggle-children
-     :open       ,(lambda ()
-                    (with-no-warnings
-                      (show-entry)
-                      (show-children)))
-     :open-rec   show-subtree
-     :close      hide-subtree)
-    ((origami-mode)
-     :open-all   ,(lambda () (origami-open-all-nodes (current-buffer)))
-     :close-all  ,(lambda () (origami-close-all-nodes (current-buffer)))
-     :toggle     ,(lambda () (origami-toggle-node (current-buffer) (point)))
-     :open       ,(lambda () (origami-open-node (current-buffer) (point)))
-     :open-rec   ,(lambda () (origami-open-node-recursively (current-buffer) (point)))
-     :close      ,(lambda () (origami-close-node (current-buffer) (point)))))
-  "Actions to be performed for various folding operations.
-
-The value should be a list of fold handlers, were a fold handler has
-the format:
-
-  ((MODES) PROPERTIES)
-
-MODES acts as a predicate, containing the symbols of all major or
-minor modes for which the handler should match.  For example:
-
-  '((outline-minor-mode org-mode) ...)
-
-would match for either outline-minor-mode or org-mode, even though the
-former is a minor mode and the latter is a major.
-
-PROPERTIES specifies possible folding actions and the functions to be
-applied in the event of a match on one (or more) of the MODES; the
-supported properties are:
-
-  - `:open-all'
-    Open all folds.
-  - `:close-all'
-    Close all folds.
-  - `:toggle'
-    Toggle the display of the fold at point.
-  - `:open'
-    Open the fold at point.
-  - `:open-rec'
-    Open the fold at point recursively.
-  - `:close'
-    Close the fold at point.
-
-Each value must be a function.  A value of `nil' will cause the action
-to be ignored for that respective handler.  For example:
-
-  `((org-mode)
-     :close-all  nil
-     :open       ,(lambda ()
-                    (show-entry)
-                    (show-children))
-     :close      hide-subtree)
-
-would ignore `:close-all' actions and invoke the provided functions on
-`:open' or `:close'.")
-
-;;; Ex
-
-(defvar evil-ex-map (make-sparse-keymap)
-  "Keymap for Ex.
-Key sequences bound in this map are immediately executed.")
-
-(defvar evil-ex-completion-map (make-sparse-keymap)
-  "Completion keymap for Ex.")
-
-(defvar evil-ex-initial-input nil
-  "Additional initial content of the ex command line.
-This content of this variable is appended to the ex command line
-if ex is started interactively.")
-
-(defvar evil-ex-shell-argument-initialized nil
-  "This variable is set to t if shell command completion has been initialized.
-See `evil-ex-init-shell-argument-completion'.")
-
-(defvar evil-ex-commands nil
-  "Association list of command bindings and functions.")
-
-(defvar evil-ex-history nil
-  "History of Ex commands.")
-
-(defvar evil-ex-current-buffer nil
-  "The buffer from which Ex was started.")
-
-(defvar evil-ex-expression nil
-  "The evaluation tree.")
-
-(defvar evil-ex-tree nil
-  "The syntax tree.")
-
-(defvar evil-ex-command nil
-  "The current Ex command.")
-
-(defvar evil-ex-previous-command nil
-  "The previously executed Ex command.")
-
-(defvar evil-ex-cmd nil
-  "The current Ex command string.")
-
-(defvar evil-ex-point nil
-  "The position of `point' when the ex command has been called.")
-
-(defvar evil-ex-range nil
-  "The current range of the Ex command.")
-
-(defvar evil-ex-bang nil
-  "The \"!\" argument of the current Ex command.")
-
-(defvar evil-ex-argument nil
-  "The current argument of the Ex command.")
-
-(defvar evil-ex-argument-handler nil
-  "The argument handler for the current Ex command.")
-
-(defvar evil-ex-argument-types nil
-  "Association list of argument handlers.")
-
-(defvar evil-previous-shell-command nil
-  "The last shell command.")
-
-;; Searching
-(defvar evil-ex-search-history nil
-  "The history for the search command.")
-
-(defvar evil-ex-search-direction nil
-  "The direction of the current search, either 'forward or 'backward.")
-
-(defvar evil-ex-search-count nil
-  "The count if the current search.")
-
-(defvar evil-ex-search-start-point nil
-  "The point where the search started.")
-
-(defvar evil-ex-search-overlay nil
-  "The overlay for the current search result.")
-
-(defvar evil-ex-search-pattern nil
-  "The last search pattern.")
-
-(defvar evil-ex-search-offset nil
-  "The last search offset.")
-
-(defvar evil-ex-search-match-beg nil
-  "The beginning position of the last match.")
-
-(defvar evil-ex-search-match-end nil
-  "The end position of the last match.")
-
-(defvar evil-ex-substitute-pattern nil
-  "The last substitute pattern.")
-
-(defvar evil-ex-substitute-replacement nil
-  "The last substitute replacement.")
-
-(defvar evil-ex-substitute-flags nil
-  "The last substitute flags.")
-
-(defvar evil-ex-substitute-current-replacement nil
-  "The actual replacement.")
-
-(defvar evil-ex-last-was-search nil
-  "Non-nil if the previous was a search.
-Otherwise the previous command is assumed as substitute.")
-
-;;; Command line window
-
-(defvar evil-command-window-current-buffer nil
-  "The buffer from which the command line window was called.")
-
-(evil-define-local-var evil-command-window-execute-fn nil
-  "The command to execute when exiting the command line window.")
-
-(evil-define-local-var evil-command-window-cmd-key nil
-  "The key for the command that opened the command line window (:, /, or ?).")
-
-;; The lazy-highlighting framework.
-(evil-define-local-var evil-ex-active-highlights-alist nil
-  "An alist of currently active highlights.")
-
-(evil-define-local-var evil-ex-hl-update-timer nil
-  "Time used for updating highlights.")
-
-(defvar evil-ex-search-keymap (make-sparse-keymap)
-  "Keymap used in ex-search-mode.")
-(set-keymap-parent evil-ex-search-keymap minibuffer-local-map)
-
-(defconst evil-version
-  (eval-when-compile
-    (with-temp-buffer
-      (let ((dir (file-name-directory (or load-file-name
-                                          byte-compile-current-file))))
-        ;; git repository
-        (if (and (file-exists-p (concat dir "/.git"))
-                 (ignore-errors
-                   (zerop (call-process "git" nil '(t nil) nil
-                                        "rev-parse"
-                                        "--short" "HEAD"))))
-            (progn
-              (goto-char (point-min))
-              (concat "evil-git-"
-                      (buffer-substring (point-min)
-                                        (line-end-position))))
-          ;; no repo, use plain version
-          "1.2.12"))))
-  "The current version of Evil")
-
-(defun evil-version ()
-  (interactive)
-  (message "Evil version %s" evil-version))
-
-(provide 'evil-vars)
-
-;;; evil-vars.el ends here
.emacs.d/elpa/evil-20170904.1346/evil-vars.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil.el
@@ -1,146 +0,0 @@
-;;; evil.el --- extensible vi layer
-
-;; The following list of authors was kept up to date until the beginning of
-;; 2017, when evil moved under new maintainers. For authors since then, please
-;; consult the git logs.
-
-;;      Alessandro Piras <laynor at gmail.com>
-;;      Alexander Baier <alexander.baier at mailbox.org>
-;;      Antono Vasiljev <antono.vasiljev at gmail.com>
-;;      Bailey Ling <bling at live.ca>
-;;      Barry O'Reilly <gundaetiapo at gmail.com>
-;;      Christoph Lange <langec at web.de>
-;;      Daniel Reiter <danieltreiter at gmail.com>
-;;      Eivind Fonn <evfonn at gmail.com>
-;;      Emanuel Evans <emanuel.evans at gmail.com>
-;;      Eric Siegel <siegel.eric at gmail.com>
-;;      Eugene Yaremenko <w3techplayground at gmail.com>
-;;      Frank Fischer <frank-fischer at shadow-soft.de>
-;;      Frank Terbeck <ft at bewatermyfriend.org>
-;;      Gordon Gustafson <gordon3.14 at gmail.com>
-;;      Herbert Jones <jones.herbert at gmail.com>
-;;      Jonas Bernoulli <jonas at bernoul.li>
-;;      Jonathan Claggett <jclaggett at lonocloud.com>
-;;      José A. Romero L. <escherdragon at gmail.com>
-;;      Justin Burkett <justin at burkett.cc>
-;;      Lars Andersen <expez at expez.com>
-;;      Lintaro Ina <tarao.gnn at gmail.com>
-;;      Lukasz Wrzosek <wrzoski at mail.com>
-;;      Marian Schubert <maio at netsafe.cz>
-;;      Matthew Malcomson <>
-;;      Michael Markert <markert.michael at googlemail.com>
-;;      Mike Gerwitz <mikegerwitz at gnu.org>
-;;      Nikolai Weibull <now at bitwi.se>
-;;      phaebz <phaebz at gmail.com>
-;;      ralesi <scio62 at gmail.com>
-;;      Rodrigo Setti <rodrigosetti at gmail.com>
-;;      Sanel Zukan <sanelz at gmail.com>
-;;      Sarah Brofeldt <sarah at thinkmonster.(none)>
-;;      Simon Hafner <hafnersimon at gmail.com>
-;;      Stefan Wehr <mail at stefanwehr.de>
-;;      Sune Simonsen <sune.simonsen at jayway.com>
-;;      Thomas Hisch <thomas at opentech.at>
-;;      Tim Harper <timcharper at gmail.com>
-;;      Tom Willemse <tom at ryuslash.org>
-;;      Trevor Murphy <trevor.m.murphy at gmail.com>
-;;      Ulrich Müller <ulm at gentoo.org>
-;;      Vasilij Schneidermann <v.schneidermann at gmail.com>
-;;      Vegard Øye <vegard_oye at hotmail.com>
-;;      Winfred Lu <winfred.lu at gmail.com>
-;;      Wolfgang Jenkner <wjenkner at inode.at>
-;;      Xiao Hanyu <xiaohanyu1988 at gmail.com>
-;;      York Zhao <yzhao at telecor.com>
-
-;; Maintainers: The emacs-evil team. <https://github.com/orgs/emacs-evil/people>
-;;      To get in touch, please use the bug tracker or the
-;;      mailing list (see below).
-;; Created: 2011-03-01
-;; Version: 1.2.12
-;; Keywords: emulation, vim
-;; URL: https://github.com/emacs-evil/evil
-;;      Repository: https://github.com/emacs-evil/evil.git
-;;      EmacsWiki: http://www.emacswiki.org/emacs/Evil
-;; Bug tracker: https://github.com/emacs-evil/evil/issues
-;;      If you have bug reports, suggestions or patches, please
-;;      create an issue at the bug tracker (open for everyone).
-;;      Other discussions (tips, extensions) go to the mailing list.
-;; Mailing list: <implementations-list at lists.ourproject.org>
-;;      Subscribe: http://tinyurl.com/implementations-list
-;;      Newsgroup: nntp://news.gmane.org/gmane.emacs.vim-emulation
-;;      Archives: http://dir.gmane.org/gmane.emacs.vim-emulation
-;;      You don't have to subscribe to post; we usually reply
-;;      within a few days and CC our replies back to you.
-;;
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; This file is part of Evil.
-;;
-;; Evil 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.
-;;
-;; Evil 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 Evil.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Evil is an extensible vi layer for Emacs. It emulates the main
-;; features of Vim, and provides facilities for writing custom
-;; extensions.
-;;
-;; Evil lives in a Git repository. To obtain Evil, do
-;;
-;;      git clone git://github.com/emacs-evil/evil.git
-;;
-;; Move Evil to ~/.emacs.d/evil (or somewhere else in the `load-path').
-;; Then add the following lines to ~/.emacs:
-;;
-;;      (add-to-list 'load-path "~/.emacs.d/evil")
-;;      (require 'evil)
-;;      (evil-mode 1)
-;;
-;; Evil requires undo-tree.el for linear undo and undo branches:
-;;
-;;      http://www.emacswiki.org/emacs/UndoTree
-;;
-;; Otherwise, Evil uses regular Emacs undo.
-;;
-;; Evil requires `goto-last-change' and `goto-last-change-reverse'
-;; function for the corresponding motions g; g, as well as the
-;; last-change-register `.'. One package providing these functions is
-;; goto-chg.el:
-;;
-;;     http://www.emacswiki.org/emacs/GotoChg
-;;
-;; Without this package the corresponding motions will raise an error.
-
-;;; Code:
-
-(require 'evil-vars)
-(require 'evil-common)
-(require 'evil-core)
-(require 'evil-states)
-(require 'evil-repeat)
-(require 'evil-macros)
-(require 'evil-search)
-(require 'evil-ex)
-(require 'evil-digraphs)
-(require 'evil-types)
-(require 'evil-commands)
-(require 'evil-jumps)
-(require 'evil-maps)
-(require 'evil-integration)
-
-(run-hooks 'evil-after-load-hook)
-
-(provide 'evil)
-
-;;; evil.el ends here
.emacs.d/elpa/evil-20170904.1346/evil.elc
Binary file
.emacs.d/elpa/evil-20170904.1346/evil.info
@@ -1,1215 +0,0 @@
-This is evil.info, produced by makeinfo version 5.2 from evil.texi.
-
-This manual is for Evil (version 0.1 of 2011-07-30), an extensible vi
-layer for Emacs.
-
-   Copyright � 2011 Frank Fischer and Vegard �ye.
-
-     Permission is granted to copy, distribute and/or modify this
-     document under the terms of the GNU Free Documentation License,
-     Version 1.3 or any later version published by the Free Software
-     Foundation; with no Invariant Sections, no Front-Cover Texts, and
-     no Back-Cover Texts.  A copy of the license is included in the
-     section entitled "GNU Free Documentation License".
-
-   The Evil team thanks everyone at gmane.emacs.vim-emulation for their
-feedback and contributions.
-INFO-DIR-SECTION Emacs
-START-INFO-DIR-ENTRY
-* Evil: (evil). Extensible vi layer for Emacs.
-END-INFO-DIR-ENTRY
-
-
-File: evil.info,  Node: Top,  Next: Overview,  Prev: (dir),  Up: (dir)
-
-Evil
-****
-
-This is the manual for Evil, an extensible vi layer for Emacs.
-
-* Menu:
-
-* Overview::
-* Settings::
-* Keymaps::
-* Hooks::
-* Macros::
-* Other internals::
-* GNU Free Documentation License::
-
-
-File: evil.info,  Node: Overview,  Next: Settings,  Up: Top
-
-1 Overview
-**********
-
-Evil is an extensible vi layer for Emacs.  It emulates the main features
-of Vim,(1) turning Emacs into a modal editor.  Like Emacs in general,
-Evil is extensible in Emacs Lisp.
-
-* Menu:
-
-* Installation::
-* Modes and states::
-
-   ---------- Footnotes ----------
-
-   (1) Vim is the most popular version of "vi", a modal text editor with
-many implementations.  Vim also adds some functions of its own, like
-Visual selection and text objects.  For more information, see:
-<http://www.vim.org/>
-
-
-File: evil.info,  Node: Installation,  Next: Modes and states,  Up: Overview
-
-1.1 Installation
-================
-
-Evil lives in a Git repository.  To download Evil, do:
-
-     git clone https://github.com/emacs-evil/evil.git
-
-Move Evil to '~/.emacs.d/evil'.  Then add the following lines to
-'~/.emacs':
-
-     (add-to-list 'load-path "~/.emacs.d/evil")
-     (require 'evil)
-     (evil-mode 1)
-
-Evil requires 'undo-tree.el' to provide linear undo and undo branches.
-It is available from EmacsWiki.(1)  (A copy of 'undo-tree.el' is also
-included in the Git repository.)
-
-   ---------- Footnotes ----------
-
-   (1) <http://www.emacswiki.org/emacs/UndoTree>
-
-
-File: evil.info,  Node: Modes and states,  Prev: Installation,  Up: Overview
-
-1.2 Modes and states
-====================
-
-The next time Emacs is started, it will come up in "Normal state",
-denoted by '<N>' on the mode line.  This is where the main vi bindings
-are defined.  Note that you can always disable Normal state with 'C-z',
-which switches to an "Emacs state" (denoted by '<E>') in which vi keys
-are completely disabled.  Press 'C-z' again to switch back to Normal
-state.
-
-   Evil uses the term "state" for what is called a "mode" in vi, since
-"mode" already has its own meaning in Emacs.  Evil defines a number of
-states, such as Normal state ('<N>'), Insert state ('<I>'), Visual state
-('<V>'), Replace state ('<R>'), Operator-Pending state ('<O>'), Motion
-state ('<M>') and Emacs state ('<E>').  Each state has its own keymaps
-and customization variables.
-
-   Meanwhile, a "mode" in Emacs is a set of key bindings for editing a
-certain sort of text, like 'emacs-lisp-mode' for Emacs Lisp.  Modes may
-include custom bindings for Evil states.
-
-
-File: evil.info,  Node: Settings,  Next: Keymaps,  Prev: Overview,  Up: Top
-
-2 Settings
-**********
-
-Evil's behavior can be adjusted by setting various variables.  The
-current values may be inspected by doing 'M-x customize-group RET evil
-RET'.
-
-   To change the value of a variable, add a 'setq' form to '~/.emacs',
-preferably before Evil is loaded:(1)
-
-     (setq evil-shift-width 8)
-     ;; Load Evil
-     (require 'evil) ...
-
-Note that if a variable is buffer-local, you must use 'setq-default'
-instead of 'setq' to change its global value.
-
- -- Variable: evil-auto-indent
-     Whether the current line is indented when entering Insert state.
-     If 't' (the default), then the line is indented.  If 'nil', then
-     the line is not indented.  Buffer-local.
-
- -- Variable: evil-shift-width
-     The number of columns a line is shifted by the commands '>' and
-     '<'.
-
- -- Variable: evil-repeat-move-cursor
-     If 't' (the default), then repeating a command with '.' may change
-     the position of the cursor.  If 'nil', then the original position
-     is preserved.
-
- -- Variable: evil-find-skip-newlines
-     If 't', then 'f', 'F', 't' and 'T' may skip over newlines to find a
-     character.  If 'nil' (the default), then they are restricted to the
-     current line.
-
- -- Variable: evil-move-cursor-back
-     If 't' (the default), then the cursor moves backwards when exiting
-     Insert state.  If 'nil', then the cursor does not move.
-
- -- Variable: evil-want-fine-undo
-     If 't', then a change-based action like 'cw' may be undone in
-     several steps.  If 'nil' (the default), then it is undone in one
-     step.
-
- -- Variable: evil-regexp-search
-     If 't' (the default), then '/' and '?' use regular expressions for
-     searching.  If 'nil', they use plain text.
-
- -- Variable: evil-search-wrap
-     If 't' (the default), then '/' and '?' wrap the search around the
-     buffer.  If 'nil', then they stop at buffer boundaries.
-
- -- Variable: evil-flash-delay
-     The number of seconds to flash search matches when pressing 'n' and
-     'N'.
-
- -- Variable: evil-want-C-i-jump
-     If 't' (the default), then 'C-i' jumps forwards in the jump list.
-     If 'nil', then 'C-i' inserts a tab.
-
- -- Variable: evil-want-C-u-scroll
-     If 't', then 'C-u' scrolls the buffer.  If 'nil' (the default),
-     then 'C-u' begins a numeric prefix argument.
-
-* Menu:
-
-* The cursor::
-* The initial state::
-
-   ---------- Footnotes ----------
-
-   (1) Strictly speaking, the order only matters if the variable affects
-the way Evil is loaded.  This is the case with some of the 'evil-want-'
-variables.
-
-
-File: evil.info,  Node: The cursor,  Next: The initial state,  Up: Settings
-
-2.1 The cursor
-==============
-
-A state may change the cursor's appearance.  The cursor settings are
-stored in the variables below, which may contain a cursor type as per
-the 'cursor-type' variable, a color string as passed to the
-'set-cursor-color' function, a zero-argument function for changing the
-cursor, or a list of the above.  For example, the following changes the
-cursor in Replace state to a red box:
-
-     (setq evil-replace-state-cursor '("red" box))
-
-If the state does not specify a cursor, 'evil-default-cursor' is used.
-
- -- Variable: evil-default-cursor
-     The default cursor.
-
- -- Variable: evil-normal-state-cursor
-     The cursor for Normal state.
-
- -- Variable: evil-insert-state-cursor
-     The cursor for Insert state.
-
- -- Variable: evil-visual-state-cursor
-     The cursor for Visual state.
-
- -- Variable: evil-replace-state-cursor
-     The cursor for Replace state.
-
- -- Variable: evil-operator-state-cursor
-     The cursor for Operator-Pending state.
-
- -- Variable: evil-motion-state-cursor
-     The cursor for Motion state.
-
- -- Variable: evil-emacs-state-cursor
-     The cursor for Emacs state.
-
-
-File: evil.info,  Node: The initial state,  Prev: The cursor,  Up: Settings
-
-2.2 The initial state
-=====================
-
-By default, a new buffer comes up in Normal state.  This can be changed
-with the function 'evil-set-initial-state'.
-
- -- Function: evil-set-initial-state mode state
-     Set the initial state for a buffer in which MODE is active to
-     STATE.  MODE should be a major mode such as 'text-mode', although
-     minor modes work as well.
-
-
-File: evil.info,  Node: Keymaps,  Next: Hooks,  Prev: Settings,  Up: Top
-
-3 Keymaps
-*********
-
-Evil's key bindings are stored in a number of keymaps.  Each state has a
-"global keymap", where the default key bindings for the state are
-stored.  For example, the global keymap for Normal state is
-'evil-normal-state-map', and the key bindings in this map are seen in
-all buffers that are currently in Normal state.
-
-   Keymaps are modified with the Emacs function 'define-key':
-
-     (define-key evil-normal-state-map "w" 'foo)
-
-This binds the key 'w' to the command 'foo' in Normal state.  The file
-'evil-maps.el' contains all the key bindings.
-
- -- Variable: evil-normal-state-map
-     The global keymap for Normal state.
-
- -- Variable: evil-insert-state-map
-     The global keymap for Insert state.
-
- -- Variable: evil-visual-state-map
-     The global keymap for Visual state.
-
- -- Variable: evil-replace-state-map
-     The global keymap for Replace state.
-
- -- Variable: evil-operator-state-map
-     The global keymap for Operator-Pending state.
-
- -- Variable: evil-motion-state-map
-     The global keymap for Motion state.
-
-Each state also has a "buffer-local keymap", which is specific to the
-current buffer and has precedence over the global keymap.  These maps
-may be changed from a mode hook.
-
- -- Variable: evil-normal-state-local-map
-     Buffer-local keymap for Normal state.
-
- -- Variable: evil-insert-state-local-map
-     Buffer-local keymap for Insert state.
-
- -- Variable: evil-visual-state-local-map
-     Buffer-local keymap for Visual state.
-
- -- Variable: evil-replace-state-local-map
-     Buffer-local keymap for Replace state.
-
- -- Variable: evil-operator-state-local-map
-     Buffer-local keymap for Operator-Pending state.
-
- -- Variable: evil-motion-state-local-map
-     Buffer-local keymap for Motion state.
-
-* Menu:
-
-* 'evil-define-key'::
-
-
-File: evil.info,  Node: 'evil-define-key',  Up: Keymaps
-
-3.1 'evil-define-key'
-=====================
-
-Finally, Evil provides the function 'evil-define-key' for adding state
-bindings to a regular keymap.
-
- -- Function: evil-define-key state keymap key def
-     In KEYMAP, create a binding from KEY to DEF in STATE.  STATE is one
-     of 'normal', 'insert', 'visual', 'replace', 'operator' and
-     'motion'.  The other parameters are like those of 'define-key'.
-
-'evil-define-key' can be used to augment existing modes with state
-bindings, as well as create packages for custom bindings.  For example,
-the following will create a minor mode 'foo-mode' with Normal state
-bindings for the keys 'w' and 'e':
-
-     (define-minor-mode foo-mode
-       "Foo mode."
-       :keymap (make-sparse-keymap))
-
-     (evil-define-key 'normal foo-mode-map "w" 'bar)
-     (evil-define-key 'normal foo-mode-map "e" 'baz)
-
-This minor mode can then be enabled in any buffers where the custom
-bindings are desired:
-
-     (add-hook 'text-mode-hook 'foo-mode) ; enable alongside 'text-mode'
-
-If the minor mode is put into its own file 'foo.el' with a '(provide
-'foo)' statement, it becomes an Emacs package.
-
-
-File: evil.info,  Node: Hooks,  Next: Macros,  Prev: Keymaps,  Up: Top
-
-4 Hooks
-*******
-
-A "hook" is a list of functions to execute.  Hooks are modified with the
-Emacs function 'add-hook'.  Evil provides entry and exit hooks for all
-of its states.
-
- -- Variable: evil-normal-state-entry-hook
-     Run when entering Normal state.
-
- -- Variable: evil-normal-state-exit-hook
-     Run when exiting Normal state.
-
- -- Variable: evil-insert-state-entry-hook
-     Run when entering Insert state.
-
- -- Variable: evil-insert-state-exit-hook
-     Run when exiting Insert state.
-
- -- Variable: evil-visual-state-entry-hook
-     Run when entering Visual state.
-
- -- Variable: evil-visual-state-exit-hook
-     Run when exiting Visual state.
-
- -- Variable: evil-replace-state-entry-hook
-     Run when entering Replace state.
-
- -- Variable: evil-replace-state-exit-hook
-     Run when exiting Replace state.
-
- -- Variable: evil-operator-state-entry-hook
-     Run when entering Operator-Pending state.
-
- -- Variable: evil-operator-state-exit-hook
-     Run when exiting Operator-Pending state.
-
- -- Variable: evil-motion-state-entry-hook
-     Run when entering Motion state.
-
- -- Variable: evil-motion-state-exit-hook
-     Run when exiting Motion state.
-
-When these hooks are run, the variables 'evil-next-state' and
-'evil-previous-state' hold information about the states being switched
-to and from.
-
- -- Variable: evil-next-state
-     The state being switched to.
-
- -- Variable: evil-previous-state
-     The state being switched from.
-
-
-File: evil.info,  Node: Macros,  Next: Other internals,  Prev: Hooks,  Up: Top
-
-5 Macros
-********
-
-Evil is implemented in terms of reusable macros.  Package writers can
-use these to define new commands.
-
-* Menu:
-
-* Motions::
-* Operators::
-* Text objects::
-* Types::
-* States::
-
-
-File: evil.info,  Node: Motions,  Next: Operators,  Up: Macros
-
-5.1 Motions
-===========
-
-A "motion" is a command which moves the cursor, such as 'w' and 'e'.
-Motions are defined with the macro 'evil-define-motion'.  Motions not
-defined in this way should be declared with 'evil-declare-motion'.
-
- -- Function: evil-declare-motion command
-     Declare COMMAND to be a motion.  This ensures that it works
-     properly in Visual state.
-
- -- Macro: evil-define-motion motion (count args...) doc keyword-args...
-          body...
-     Define a movement command MOTION.  A motion can have any number of
-     arguments, but the first argument, if any, has a predefined meaning
-     as the COUNT.  It is a positive or negative number, or 'nil'.  The
-     argument list is followed by the documentation string DOC, which is
-     followed by optional keyword arguments:
-
-     ':type TYPE'
-          The TYPE determines how the motion works after an operator.
-          If TYPE is 'inclusive', then the ending position is included
-          in the motion range.  If TYPE is 'line', then the range is
-          expanded to linewise positions.  If TYPE is 'block', then the
-          range is blockwise.  The default is 'exclusive', which means
-          that the range is used as-is.
-
-     ':jump JUMP'
-          If JUMP is 't', then the previous position is stored in the
-          jump list so it can be restored with 'C-o'.  The default is
-          'nil'.
-
-     The keyword arguments are followed by the BODY, which is where the
-     motion's behavior is defined.  For instance:
-
-          (evil-define-motion foo-forward (count)
-            "Move to the right by COUNT characters."
-            :type inclusive
-            (forward-char (or count 1)))
-
-     For more examples, you can view the source code for any command
-     with 'C-h k'.  For instance, 'evil-goto-line' may be viewed by
-     typing 'C-h k G' and following the file link.
-
-
-File: evil.info,  Node: Operators,  Next: Text objects,  Prev: Motions,  Up: Macros
-
-5.2 Operators
-=============
-
-An "operator" is a command which acts on the text moved over by a
-motion, such as 'c', 'd' and 'y'.  Operators are defined with the macro
-'evil-define-operator'.
-
- -- Macro: evil-define-operator operator (beg end type args...) doc
-          keyword-args... body...
-     Define an operator command OPERATOR.  An operator must have at
-     least two or three arguments, which have predefined meanings.  BEG
-     is the beginning position, END is the ending position, and TYPE, if
-     given, is the type of the motion range.  The argument list is
-     followed by the documentation string DOC, which is followed by
-     optional keyword arguments:
-
-     ':type TYPE'
-          Make the input range be a certain TYPE.  For example, an
-          operator which only works with whole lines may set TYPE to
-          'line'.
-
-     ':motion MOTION'
-          Use the motion MOTION instead of reading one from the
-          keyboard.  This does not affect the behavior in Visual state,
-          where the selection boundaries are used instead.
-
-     ':repeat REPEAT'
-          If REPEAT is 't' (the default), then '.' will repeat the
-          operator.  If REPEAT is 'nil', then the operator will not be
-          repeated.
-
-     ':move-point MOVE-POINT'
-          If MOVE-POINT is 't' (the default), then the cursor is
-          positioned at the beginning of the range.  If MOVE-POINT is
-          'nil', then the original position is preserved.
-
-     ':keep-visual KEEP-VISUAL'
-          If KEEP-VISUAL is 't', then the selection is not disabled when
-          the operator is run in Visual state; it is up to the operator
-          to do this.  The default is 'nil', which means that Visual
-          state is exited automatically.
-
-     The keyword arguments are followed by the BODY, which is where the
-     operator's actions on BEG and END are defined.  For example,
-     'evil-rot13', which is bound to 'g?' and performs ROT13 encryption
-     on the text, may be defined as:
-
-          (evil-define-operator evil-rot13 (beg end)
-            "ROT13 encrypt text."
-            (rot13-region beg end))
-
-     Pressing 'g?w' will encrypt a word by calling 'rot13-region' on the
-     text moved over by the 'w' motion.
-
-
-File: evil.info,  Node: Text objects,  Next: Types,  Prev: Operators,  Up: Macros
-
-5.3 Text objects
-================
-
-A "text object" is a special kind of motion which sets a beginning
-position as well as an ending position, such as 'iw' and 'a('.  In
-Visual state, text objects alter both ends of the selection.  Text
-objects are defined with the macro 'evil-define-text-object'.
-
- -- Macro: evil-define-text-object object (count args...) doc
-          keyword-args... body...
-     Define a text object OBJECT.  The first argument has a predefined
-     meaning as the COUNT: it is a positive or negative number.  The
-     argument list is followed by the documentation string DOC, which is
-     followed by optional keyword arguments:
-
-     ':type TYPE'
-          Use the type TYPE after an operator.  In Visual state, this is
-          the type of the selection.
-
-     ':extend-selection EXTEND-SELECTION'
-          If EXTEND-SELECTION is 't' (the default), then the text object
-          always enlarges the current selection.  If 'nil', then the
-          object replaces the selection.
-
-     The keyword arguments are followed by the BODY, which should
-     evaluate to a list '(BEG END)' of two positions in the buffer.  For
-     example, a text object which selects three characters following the
-     current position could be defined as:
-
-          (evil-define-text-object foo (count)
-            "Select three characters."
-            (list (point) (+ (point) 3)))
-
-Evil provides several functions which return a list of positions, for
-use in the definition of a text object.  These functions follow the rule
-that a positive COUNT selects text after the current position, while a
-negative COUNT selects text before it.
-
- -- Function: evil-inner-object-range count forward backward
-     Return a text range '(BEG END)' of COUNT "inner" text objects
-     (e.g., 'iw', 'is').  FORWARD is a function which moves to the end
-     of an object, and BACKWARD is a function which moves to the
-     beginning.
-
- -- Function: evil-an-object-range count forward backward
-     Return a text range '(BEG END)' of COUNT text objects with
-     whitespace (e.g., 'aw', 'as').  FORWARD is a function which moves
-     to the end of an object, and BACKWARD is a function which moves to
-     the beginning.
-
- -- Function: evil-paren-range count open close &optional exclusive
-     Return a text range '(BEG END)' of COUNT delimited blocks (e.g.,
-     'i(', 'a(').  OPEN and CLOSE are characters.  If EXCLUSIVE is
-     non-nil, then the delimiters are excluded from the range.  This
-     function uses Emacs' syntax table and is only applicable for
-     single-character delimiters; use 'evil-regexp-range' to match
-     multiple characters.
-
- -- Function: evil-regexp-range count open close &optional exclusive
-     Return a text range '(BEG END)' of COUNT delimited blocks (e.g.,
-     'it', 'at').  OPEN and CLOSE are regular expressions.  If EXCLUSIVE
-     is non-nil, then the delimiters are excluded from the range.
-
-
-File: evil.info,  Node: Types,  Next: States,  Prev: Text objects,  Up: Macros
-
-5.4 Types
-=========
-
-A "type" is a transformation on a pair of buffer positions.  Evil
-defines the types 'exclusive', 'inclusive', 'line' and 'block', which
-are used for motion ranges and Visual selection.  Types are defined with
-the macro 'evil-define-type'.
-
- -- Macro: evil-define-type type doc keyword-args...
-     Define a type TYPE, described by the documentation string DOC.
-     Then follows keyword arguments:
-
-     ':expand EXPAND'
-          A function which takes two buffer positions and returns a list
-          '(BEG END)' of expanded positions.
-
-     ':contract CONTRACT'
-          A function which takes two expanded buffer positions and
-          returns a list '(BEG END)' of unexpanded positions.  Optional.
-
-     ':normalize NORMALIZE'
-          A function which takes two unexpanded buffer positions and
-          returns a list '(BEG END)' of adjusted positions.  Optional.
-
-     ':injective INJECTIVE'
-          If 't' (the default), then expansion is one-to-one - i.e.,
-          EXPAND followed by CONTRACT always returns the original
-          positions.  If 'nil', then several positions may expand to the
-          same (for example, the 'line' type is one-to-many as it
-          expands to the containing lines).
-
-     Further keywords and functions may be specified.  These are
-     understood to be transformations on buffer positions, like EXPAND
-     and CONTRACT.
-
-
-File: evil.info,  Node: States,  Prev: Types,  Up: Macros
-
-5.5 States
-==========
-
-States are defined with the macro 'evil-define-state'.  The macro
-defines the necessary hooks, keymaps and variables for a state, as well
-as a toggle function 'evil-STATE-state' for entering the state, and a
-predicate function 'evil-STATE-state-p' which returns 't' when the state
-is active, and 'nil' otherwise.
-
- -- Macro: evil-define-state state doc keyword-args... body...
-     Define an Evil state STATE, described by the documentation string
-     DOC.  Then follows optional keyword arguments:
-
-     ':tag TAG'
-          Mode line indicitor, e.g., '"<T>"'.
-     ':message MESSAGE'
-          String shown in the echo area.
-     ':cursor CURSOR'
-          Cursor specification.
-     ':enable ENABLE'
-          List of other modes and states to enable.  A state may enable
-          another state's keymaps in addition to its own.
-
-     This is followed the BODY, which is executed whenever the state is
-     enabled or disabled.  The state's predicate function may be used to
-     distinguish between the two.
-
-
-File: evil.info,  Node: Other internals,  Next: GNU Free Documentation License,  Prev: Macros,  Up: Top
-
-6 Other internals
-*****************
-
-* Menu:
-
-* Command properties::
-
-
-File: evil.info,  Node: Command properties,  Up: Other internals
-
-6.1 Command properties
-======================
-
-Evil defines "command properties" to store information about commands,
-such as whether they should be repeated.  A command property is a
-':KEYWORD' with an associated value, e.g., ':repeat nil'.
-
- -- Function: evil-add-command-properties command &rest properties
-     Add PROPERTIES to COMMAND.  The properties should be specified as a
-     list of keywords and values:
-
-          (evil-add-command-properties 'my-command :repeat t)
-
- -- Function: evil-set-command-properties command &rest properties
-     Like 'evil-add-command-properties', but resets all previous
-     properties.
-
- -- Function: evil-get-command-property command property
-     Return the value of a command property.
-
- -- Macro: evil-define-command command (args...) doc keyword-args...
-          body...
-     Define a command with command properties KEYWORD-ARGS.
-
-For setting repeat properties, Evil provides the following functions:
-
- -- Function: evil-declare-repeat command
-     Declare COMMAND to be repeatable.
-
- -- Function: evil-declare-not-repeat command
-     Declare COMMAND to be nonrepeatable.
-
- -- Function: evil-declare-change-repeat command
-     Declare COMMAND to be repeatable by buffer changes rather than
-     keystrokes.
-
-
-File: evil.info,  Node: GNU Free Documentation License,  Prev: Other internals,  Up: Top
-
-Appendix A GNU Free Documentation License
-*****************************************
-
-                     Version 1.3, 3 November 2008
-
-     Copyright � 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
-     <http://fsf.org/>
-
-     Everyone is permitted to copy and distribute verbatim copies
-     of this license document, but changing it is not allowed.
-
-  0. PREAMBLE
-
-     The purpose of this License is to make a manual, textbook, or other
-     functional and useful document "free" in the sense of freedom: to
-     assure everyone the effective freedom to copy and redistribute it,
-     with or without modifying it, either commercially or
-     noncommercially.  Secondarily, this License preserves for the
-     author and publisher a way to get credit for their work, while not
-     being considered responsible for modifications made by others.
-
-     This License is a kind of "copyleft", which means that derivative
-     works of the document must themselves be free in the same sense.
-     It complements the GNU General Public License, which is a copyleft
-     license designed for free software.
-
-     We have designed this License in order to use it for manuals for
-     free software, because free software needs free documentation: a
-     free program should come with manuals providing the same freedoms
-     that the software does.  But this License is not limited to
-     software manuals; it can be used for any textual work, regardless
-     of subject matter or whether it is published as a printed book.  We
-     recommend this License principally for works whose purpose is
-     instruction or reference.
-
-  1. APPLICABILITY AND DEFINITIONS
-
-     This License applies to any manual or other work, in any medium,
-     that contains a notice placed by the copyright holder saying it can
-     be distributed under the terms of this License.  Such a notice
-     grants a world-wide, royalty-free license, unlimited in duration,
-     to use that work under the conditions stated herein.  The
-     "Document", below, refers to any such manual or work.  Any member
-     of the public is a licensee, and is addressed as "you".  You accept
-     the license if you copy, modify or distribute the work in a way
-     requiring permission under copyright law.
-
-     A "Modified Version" of the Document means any work containing the
-     Document or a portion of it, either copied verbatim, or with
-     modifications and/or translated into another language.
-
-     A "Secondary Section" is a named appendix or a front-matter section
-     of the Document that deals exclusively with the relationship of the
-     publishers or authors of the Document to the Document's overall
-     subject (or to related matters) and contains nothing that could
-     fall directly within that overall subject.  (Thus, if the Document
-     is in part a textbook of mathematics, a Secondary Section may not
-     explain any mathematics.)  The relationship could be a matter of
-     historical connection with the subject or with related matters, or
-     of legal, commercial, philosophical, ethical or political position
-     regarding them.
-
-     The "Invariant Sections" are certain Secondary Sections whose
-     titles are designated, as being those of Invariant Sections, in the
-     notice that says that the Document is released under this License.
-     If a section does not fit the above definition of Secondary then it
-     is not allowed to be designated as Invariant.  The Document may
-     contain zero Invariant Sections.  If the Document does not identify
-     any Invariant Sections then there are none.
-
-     The "Cover Texts" are certain short passages of text that are
-     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
-     that says that the Document is released under this License.  A
-     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
-     be at most 25 words.
-
-     A "Transparent" copy of the Document means a machine-readable copy,
-     represented in a format whose specification is available to the
-     general public, that is suitable for revising the document
-     straightforwardly with generic text editors or (for images composed
-     of pixels) generic paint programs or (for drawings) some widely
-     available drawing editor, and that is suitable for input to text
-     formatters or for automatic translation to a variety of formats
-     suitable for input to text formatters.  A copy made in an otherwise
-     Transparent file format whose markup, or absence of markup, has
-     been arranged to thwart or discourage subsequent modification by
-     readers is not Transparent.  An image format is not Transparent if
-     used for any substantial amount of text.  A copy that is not
-     "Transparent" is called "Opaque".
-
-     Examples of suitable formats for Transparent copies include plain
-     ASCII without markup, Texinfo input format, LaTeX input format,
-     SGML or XML using a publicly available DTD, and standard-conforming
-     simple HTML, PostScript or PDF designed for human modification.
-     Examples of transparent image formats include PNG, XCF and JPG.
-     Opaque formats include proprietary formats that can be read and
-     edited only by proprietary word processors, SGML or XML for which
-     the DTD and/or processing tools are not generally available, and
-     the machine-generated HTML, PostScript or PDF produced by some word
-     processors for output purposes only.
-
-     The "Title Page" means, for a printed book, the title page itself,
-     plus such following pages as are needed to hold, legibly, the
-     material this License requires to appear in the title page.  For
-     works in formats which do not have any title page as such, "Title
-     Page" means the text near the most prominent appearance of the
-     work's title, preceding the beginning of the body of the text.
-
-     The "publisher" means any person or entity that distributes copies
-     of the Document to the public.
-
-     A section "Entitled XYZ" means a named subunit of the Document
-     whose title either is precisely XYZ or contains XYZ in parentheses
-     following text that translates XYZ in another language.  (Here XYZ
-     stands for a specific section name mentioned below, such as
-     "Acknowledgements", "Dedications", "Endorsements", or "History".)
-     To "Preserve the Title" of such a section when you modify the
-     Document means that it remains a section "Entitled XYZ" according
-     to this definition.
-
-     The Document may include Warranty Disclaimers next to the notice
-     which states that this License applies to the Document.  These
-     Warranty Disclaimers are considered to be included by reference in
-     this License, but only as regards disclaiming warranties: any other
-     implication that these Warranty Disclaimers may have is void and
-     has no effect on the meaning of this License.
-
-  2. VERBATIM COPYING
-
-     You may copy and distribute the Document in any medium, either
-     commercially or noncommercially, provided that this License, the
-     copyright notices, and the license notice saying this License
-     applies to the Document are reproduced in all copies, and that you
-     add no other conditions whatsoever to those of this License.  You
-     may not use technical measures to obstruct or control the reading
-     or further copying of the copies you make or distribute.  However,
-     you may accept compensation in exchange for copies.  If you
-     distribute a large enough number of copies you must also follow the
-     conditions in section 3.
-
-     You may also lend copies, under the same conditions stated above,
-     and you may publicly display copies.
-
-  3. COPYING IN QUANTITY
-
-     If you publish printed copies (or copies in media that commonly
-     have printed covers) of the Document, numbering more than 100, and
-     the Document's license notice requires Cover Texts, you must
-     enclose the copies in covers that carry, clearly and legibly, all
-     these Cover Texts: Front-Cover Texts on the front cover, and
-     Back-Cover Texts on the back cover.  Both covers must also clearly
-     and legibly identify you as the publisher of these copies.  The
-     front cover must present the full title with all words of the title
-     equally prominent and visible.  You may add other material on the
-     covers in addition.  Copying with changes limited to the covers, as
-     long as they preserve the title of the Document and satisfy these
-     conditions, can be treated as verbatim copying in other respects.
-
-     If the required texts for either cover are too voluminous to fit
-     legibly, you should put the first ones listed (as many as fit
-     reasonably) on the actual cover, and continue the rest onto
-     adjacent pages.
-
-     If you publish or distribute Opaque copies of the Document
-     numbering more than 100, you must either include a machine-readable
-     Transparent copy along with each Opaque copy, or state in or with
-     each Opaque copy a computer-network location from which the general
-     network-using public has access to download using public-standard
-     network protocols a complete Transparent copy of the Document, free
-     of added material.  If you use the latter option, you must take
-     reasonably prudent steps, when you begin distribution of Opaque
-     copies in quantity, to ensure that this Transparent copy will
-     remain thus accessible at the stated location until at least one
-     year after the last time you distribute an Opaque copy (directly or
-     through your agents or retailers) of that edition to the public.
-
-     It is requested, but not required, that you contact the authors of
-     the Document well before redistributing any large number of copies,
-     to give them a chance to provide you with an updated version of the
-     Document.
-
-  4. MODIFICATIONS
-
-     You may copy and distribute a Modified Version of the Document
-     under the conditions of sections 2 and 3 above, provided that you
-     release the Modified Version under precisely this License, with the
-     Modified Version filling the role of the Document, thus licensing
-     distribution and modification of the Modified Version to whoever
-     possesses a copy of it.  In addition, you must do these things in
-     the Modified Version:
-
-       A. Use in the Title Page (and on the covers, if any) a title
-          distinct from that of the Document, and from those of previous
-          versions (which should, if there were any, be listed in the
-          History section of the Document).  You may use the same title
-          as a previous version if the original publisher of that
-          version gives permission.
-
-       B. List on the Title Page, as authors, one or more persons or
-          entities responsible for authorship of the modifications in
-          the Modified Version, together with at least five of the
-          principal authors of the Document (all of its principal
-          authors, if it has fewer than five), unless they release you
-          from this requirement.
-
-       C. State on the Title page the name of the publisher of the
-          Modified Version, as the publisher.
-
-       D. Preserve all the copyright notices of the Document.
-
-       E. Add an appropriate copyright notice for your modifications
-          adjacent to the other copyright notices.
-
-       F. Include, immediately after the copyright notices, a license
-          notice giving the public permission to use the Modified
-          Version under the terms of this License, in the form shown in
-          the Addendum below.
-
-       G. Preserve in that license notice the full lists of Invariant
-          Sections and required Cover Texts given in the Document's
-          license notice.
-
-       H. Include an unaltered copy of this License.
-
-       I. Preserve the section Entitled "History", Preserve its Title,
-          and add to it an item stating at least the title, year, new
-          authors, and publisher of the Modified Version as given on the
-          Title Page.  If there is no section Entitled "History" in the
-          Document, create one stating the title, year, authors, and
-          publisher of the Document as given on its Title Page, then add
-          an item describing the Modified Version as stated in the
-          previous sentence.
-
-       J. Preserve the network location, if any, given in the Document
-          for public access to a Transparent copy of the Document, and
-          likewise the network locations given in the Document for
-          previous versions it was based on.  These may be placed in the
-          "History" section.  You may omit a network location for a work
-          that was published at least four years before the Document
-          itself, or if the original publisher of the version it refers
-          to gives permission.
-
-       K. For any section Entitled "Acknowledgements" or "Dedications",
-          Preserve the Title of the section, and preserve in the section
-          all the substance and tone of each of the contributor
-          acknowledgements and/or dedications given therein.
-
-       L. Preserve all the Invariant Sections of the Document, unaltered
-          in their text and in their titles.  Section numbers or the
-          equivalent are not considered part of the section titles.
-
-       M. Delete any section Entitled "Endorsements".  Such a section
-          may not be included in the Modified Version.
-
-       N. Do not retitle any existing section to be Entitled
-          "Endorsements" or to conflict in title with any Invariant
-          Section.
-
-       O. Preserve any Warranty Disclaimers.
-
-     If the Modified Version includes new front-matter sections or
-     appendices that qualify as Secondary Sections and contain no
-     material copied from the Document, you may at your option designate
-     some or all of these sections as invariant.  To do this, add their
-     titles to the list of Invariant Sections in the Modified Version's
-     license notice.  These titles must be distinct from any other
-     section titles.
-
-     You may add a section Entitled "Endorsements", provided it contains
-     nothing but endorsements of your Modified Version by various
-     parties--for example, statements of peer review or that the text
-     has been approved by an organization as the authoritative
-     definition of a standard.
-
-     You may add a passage of up to five words as a Front-Cover Text,
-     and a passage of up to 25 words as a Back-Cover Text, to the end of
-     the list of Cover Texts in the Modified Version.  Only one passage
-     of Front-Cover Text and one of Back-Cover Text may be added by (or
-     through arrangements made by) any one entity.  If the Document
-     already includes a cover text for the same cover, previously added
-     by you or by arrangement made by the same entity you are acting on
-     behalf of, you may not add another; but you may replace the old
-     one, on explicit permission from the previous publisher that added
-     the old one.
-
-     The author(s) and publisher(s) of the Document do not by this
-     License give permission to use their names for publicity for or to
-     assert or imply endorsement of any Modified Version.
-
-  5. COMBINING DOCUMENTS
-
-     You may combine the Document with other documents released under
-     this License, under the terms defined in section 4 above for
-     modified versions, provided that you include in the combination all
-     of the Invariant Sections of all of the original documents,
-     unmodified, and list them all as Invariant Sections of your
-     combined work in its license notice, and that you preserve all
-     their Warranty Disclaimers.
-
-     The combined work need only contain one copy of this License, and
-     multiple identical Invariant Sections may be replaced with a single
-     copy.  If there are multiple Invariant Sections with the same name
-     but different contents, make the title of each such section unique
-     by adding at the end of it, in parentheses, the name of the
-     original author or publisher of that section if known, or else a
-     unique number.  Make the same adjustment to the section titles in
-     the list of Invariant Sections in the license notice of the
-     combined work.
-
-     In the combination, you must combine any sections Entitled
-     "History" in the various original documents, forming one section
-     Entitled "History"; likewise combine any sections Entitled
-     "Acknowledgements", and any sections Entitled "Dedications".  You
-     must delete all sections Entitled "Endorsements."
-
-  6. COLLECTIONS OF DOCUMENTS
-
-     You may make a collection consisting of the Document and other
-     documents released under this License, and replace the individual
-     copies of this License in the various documents with a single copy
-     that is included in the collection, provided that you follow the
-     rules of this License for verbatim copying of each of the documents
-     in all other respects.
-
-     You may extract a single document from such a collection, and
-     distribute it individually under this License, provided you insert
-     a copy of this License into the extracted document, and follow this
-     License in all other respects regarding verbatim copying of that
-     document.
-
-  7. AGGREGATION WITH INDEPENDENT WORKS
-
-     A compilation of the Document or its derivatives with other
-     separate and independent documents or works, in or on a volume of a
-     storage or distribution medium, is called an "aggregate" if the
-     copyright resulting from the compilation is not used to limit the
-     legal rights of the compilation's users beyond what the individual
-     works permit.  When the Document is included in an aggregate, this
-     License does not apply to the other works in the aggregate which
-     are not themselves derivative works of the Document.
-
-     If the Cover Text requirement of section 3 is applicable to these
-     copies of the Document, then if the Document is less than one half
-     of the entire aggregate, the Document's Cover Texts may be placed
-     on covers that bracket the Document within the aggregate, or the
-     electronic equivalent of covers if the Document is in electronic
-     form.  Otherwise they must appear on printed covers that bracket
-     the whole aggregate.
-
-  8. TRANSLATION
-
-     Translation is considered a kind of modification, so you may
-     distribute translations of the Document under the terms of section
-     4.  Replacing Invariant Sections with translations requires special
-     permission from their copyright holders, but you may include
-     translations of some or all Invariant Sections in addition to the
-     original versions of these Invariant Sections.  You may include a
-     translation of this License, and all the license notices in the
-     Document, and any Warranty Disclaimers, provided that you also
-     include the original English version of this License and the
-     original versions of those notices and disclaimers.  In case of a
-     disagreement between the translation and the original version of
-     this License or a notice or disclaimer, the original version will
-     prevail.
-
-     If a section in the Document is Entitled "Acknowledgements",
-     "Dedications", or "History", the requirement (section 4) to
-     Preserve its Title (section 1) will typically require changing the
-     actual title.
-
-  9. TERMINATION
-
-     You may not copy, modify, sublicense, or distribute the Document
-     except as expressly provided under this License.  Any attempt
-     otherwise to copy, modify, sublicense, or distribute it is void,
-     and will automatically terminate your rights under this License.
-
-     However, if you cease all violation of this License, then your
-     license from a particular copyright holder is reinstated (a)
-     provisionally, unless and until the copyright holder explicitly and
-     finally terminates your license, and (b) permanently, if the
-     copyright holder fails to notify you of the violation by some
-     reasonable means prior to 60 days after the cessation.
-
-     Moreover, your license from a particular copyright holder is
-     reinstated permanently if the copyright holder notifies you of the
-     violation by some reasonable means, this is the first time you have
-     received notice of violation of this License (for any work) from
-     that copyright holder, and you cure the violation prior to 30 days
-     after your receipt of the notice.
-
-     Termination of your rights under this section does not terminate
-     the licenses of parties who have received copies or rights from you
-     under this License.  If your rights have been terminated and not
-     permanently reinstated, receipt of a copy of some or all of the
-     same material does not give you any rights to use it.
-
-  10. FUTURE REVISIONS OF THIS LICENSE
-
-     The Free Software Foundation may publish new, revised versions of
-     the GNU Free Documentation License from time to time.  Such new
-     versions will be similar in spirit to the present version, but may
-     differ in detail to address new problems or concerns.  See
-     <http://www.gnu.org/copyleft/>.
-
-     Each version of the License is given a distinguishing version
-     number.  If the Document specifies that a particular numbered
-     version of this License "or any later version" applies to it, you
-     have the option of following the terms and conditions either of
-     that specified version or of any later version that has been
-     published (not as a draft) by the Free Software Foundation.  If the
-     Document does not specify a version number of this License, you may
-     choose any version ever published (not as a draft) by the Free
-     Software Foundation.  If the Document specifies that a proxy can
-     decide which future versions of this License can be used, that
-     proxy's public statement of acceptance of a version permanently
-     authorizes you to choose that version for the Document.
-
-  11. RELICENSING
-
-     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
-     World Wide Web server that publishes copyrightable works and also
-     provides prominent facilities for anybody to edit those works.  A
-     public wiki that anybody can edit is an example of such a server.
-     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
-     site means any set of copyrightable works thus published on the MMC
-     site.
-
-     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
-     license published by Creative Commons Corporation, a not-for-profit
-     corporation with a principal place of business in San Francisco,
-     California, as well as future copyleft versions of that license
-     published by that same organization.
-
-     "Incorporate" means to publish or republish a Document, in whole or
-     in part, as part of another Document.
-
-     An MMC is "eligible for relicensing" if it is licensed under this
-     License, and if all works that were first published under this
-     License somewhere other than this MMC, and subsequently
-     incorporated in whole or in part into the MMC, (1) had no cover
-     texts or invariant sections, and (2) were thus incorporated prior
-     to November 1, 2008.
-
-     The operator of an MMC Site may republish an MMC contained in the
-     site under CC-BY-SA on the same site at any time before August 1,
-     2009, provided the MMC is eligible for relicensing.
-
-ADDENDUM: How to use this License for your documents
-====================================================
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and license
-notices just after the title page:
-
-       Copyright (C)  YEAR  YOUR NAME.
-       Permission is granted to copy, distribute and/or modify this document
-       under the terms of the GNU Free Documentation License, Version 1.3
-       or any later version published by the Free Software Foundation;
-       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
-       Texts.  A copy of the license is included in the section entitled ``GNU
-       Free Documentation License''.
-
-   If you have Invariant Sections, Front-Cover Texts and Back-Cover
-Texts, replace the "with...Texts."  line with this:
-
-         with the Invariant Sections being LIST THEIR TITLES, with
-         the Front-Cover Texts being LIST, and with the Back-Cover Texts
-         being LIST.
-
-   If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-   If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of free
-software license, such as the GNU General Public License, to permit
-their use in free software.
-
-
-
-Tag Table:
-Node: Top819
-Node: Overview1092
-Ref: Overview-Footnote-11440
-Node: Installation1668
-Ref: Installation-Footnote-12272
-Node: Modes and states2322
-Node: Settings3375
-Ref: Settings-Footnote-15826
-Node: The cursor5983
-Node: The initial state7188
-Node: Keymaps7647
-Node: 'evil-define-key'9511
-Node: Hooks10697
-Node: Macros12219
-Node: Motions12499
-Node: Operators14436
-Node: Text objects16769
-Node: Types19782
-Node: States21264
-Node: Other internals22363
-Node: Command properties22540
-Node: GNU Free Documentation License23867
-
-End Tag Table
-
-
-Local Variables:
-coding: iso-8859-1
-End:
.emacs.d/elpa/evil-20170904.1346/fdl-1.3.info
@@ -1,484 +0,0 @@
-This is fdl-1.3.info, produced by makeinfo version 5.2 from
-fdl-1.3.texi.
-
-                     Version 1.3, 3 November 2008
-
-     Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
-     <http://fsf.org/>
-
-     Everyone is permitted to copy and distribute verbatim copies
-     of this license document, but changing it is not allowed.
-
-  0. PREAMBLE
-
-     The purpose of this License is to make a manual, textbook, or other
-     functional and useful document "free" in the sense of freedom: to
-     assure everyone the effective freedom to copy and redistribute it,
-     with or without modifying it, either commercially or
-     noncommercially.  Secondarily, this License preserves for the
-     author and publisher a way to get credit for their work, while not
-     being considered responsible for modifications made by others.
-
-     This License is a kind of "copyleft", which means that derivative
-     works of the document must themselves be free in the same sense.
-     It complements the GNU General Public License, which is a copyleft
-     license designed for free software.
-
-     We have designed this License in order to use it for manuals for
-     free software, because free software needs free documentation: a
-     free program should come with manuals providing the same freedoms
-     that the software does.  But this License is not limited to
-     software manuals; it can be used for any textual work, regardless
-     of subject matter or whether it is published as a printed book.  We
-     recommend this License principally for works whose purpose is
-     instruction or reference.
-
-  1. APPLICABILITY AND DEFINITIONS
-
-     This License applies to any manual or other work, in any medium,
-     that contains a notice placed by the copyright holder saying it can
-     be distributed under the terms of this License.  Such a notice
-     grants a world-wide, royalty-free license, unlimited in duration,
-     to use that work under the conditions stated herein.  The
-     "Document", below, refers to any such manual or work.  Any member
-     of the public is a licensee, and is addressed as "you".  You accept
-     the license if you copy, modify or distribute the work in a way
-     requiring permission under copyright law.
-
-     A "Modified Version" of the Document means any work containing the
-     Document or a portion of it, either copied verbatim, or with
-     modifications and/or translated into another language.
-
-     A "Secondary Section" is a named appendix or a front-matter section
-     of the Document that deals exclusively with the relationship of the
-     publishers or authors of the Document to the Document's overall
-     subject (or to related matters) and contains nothing that could
-     fall directly within that overall subject.  (Thus, if the Document
-     is in part a textbook of mathematics, a Secondary Section may not
-     explain any mathematics.)  The relationship could be a matter of
-     historical connection with the subject or with related matters, or
-     of legal, commercial, philosophical, ethical or political position
-     regarding them.
-
-     The "Invariant Sections" are certain Secondary Sections whose
-     titles are designated, as being those of Invariant Sections, in the
-     notice that says that the Document is released under this License.
-     If a section does not fit the above definition of Secondary then it
-     is not allowed to be designated as Invariant.  The Document may
-     contain zero Invariant Sections.  If the Document does not identify
-     any Invariant Sections then there are none.
-
-     The "Cover Texts" are certain short passages of text that are
-     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
-     that says that the Document is released under this License.  A
-     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
-     be at most 25 words.
-
-     A "Transparent" copy of the Document means a machine-readable copy,
-     represented in a format whose specification is available to the
-     general public, that is suitable for revising the document
-     straightforwardly with generic text editors or (for images composed
-     of pixels) generic paint programs or (for drawings) some widely
-     available drawing editor, and that is suitable for input to text
-     formatters or for automatic translation to a variety of formats
-     suitable for input to text formatters.  A copy made in an otherwise
-     Transparent file format whose markup, or absence of markup, has
-     been arranged to thwart or discourage subsequent modification by
-     readers is not Transparent.  An image format is not Transparent if
-     used for any substantial amount of text.  A copy that is not
-     "Transparent" is called "Opaque".
-
-     Examples of suitable formats for Transparent copies include plain
-     ASCII without markup, Texinfo input format, LaTeX input format,
-     SGML or XML using a publicly available DTD, and standard-conforming
-     simple HTML, PostScript or PDF designed for human modification.
-     Examples of transparent image formats include PNG, XCF and JPG.
-     Opaque formats include proprietary formats that can be read and
-     edited only by proprietary word processors, SGML or XML for which
-     the DTD and/or processing tools are not generally available, and
-     the machine-generated HTML, PostScript or PDF produced by some word
-     processors for output purposes only.
-
-     The "Title Page" means, for a printed book, the title page itself,
-     plus such following pages as are needed to hold, legibly, the
-     material this License requires to appear in the title page.  For
-     works in formats which do not have any title page as such, "Title
-     Page" means the text near the most prominent appearance of the
-     work's title, preceding the beginning of the body of the text.
-
-     The "publisher" means any person or entity that distributes copies
-     of the Document to the public.
-
-     A section "Entitled XYZ" means a named subunit of the Document
-     whose title either is precisely XYZ or contains XYZ in parentheses
-     following text that translates XYZ in another language.  (Here XYZ
-     stands for a specific section name mentioned below, such as
-     "Acknowledgements", "Dedications", "Endorsements", or "History".)
-     To "Preserve the Title" of such a section when you modify the
-     Document means that it remains a section "Entitled XYZ" according
-     to this definition.
-
-     The Document may include Warranty Disclaimers next to the notice
-     which states that this License applies to the Document.  These
-     Warranty Disclaimers are considered to be included by reference in
-     this License, but only as regards disclaiming warranties: any other
-     implication that these Warranty Disclaimers may have is void and
-     has no effect on the meaning of this License.
-
-  2. VERBATIM COPYING
-
-     You may copy and distribute the Document in any medium, either
-     commercially or noncommercially, provided that this License, the
-     copyright notices, and the license notice saying this License
-     applies to the Document are reproduced in all copies, and that you
-     add no other conditions whatsoever to those of this License.  You
-     may not use technical measures to obstruct or control the reading
-     or further copying of the copies you make or distribute.  However,
-     you may accept compensation in exchange for copies.  If you
-     distribute a large enough number of copies you must also follow the
-     conditions in section 3.
-
-     You may also lend copies, under the same conditions stated above,
-     and you may publicly display copies.
-
-  3. COPYING IN QUANTITY
-
-     If you publish printed copies (or copies in media that commonly
-     have printed covers) of the Document, numbering more than 100, and
-     the Document's license notice requires Cover Texts, you must
-     enclose the copies in covers that carry, clearly and legibly, all
-     these Cover Texts: Front-Cover Texts on the front cover, and
-     Back-Cover Texts on the back cover.  Both covers must also clearly
-     and legibly identify you as the publisher of these copies.  The
-     front cover must present the full title with all words of the title
-     equally prominent and visible.  You may add other material on the
-     covers in addition.  Copying with changes limited to the covers, as
-     long as they preserve the title of the Document and satisfy these
-     conditions, can be treated as verbatim copying in other respects.
-
-     If the required texts for either cover are too voluminous to fit
-     legibly, you should put the first ones listed (as many as fit
-     reasonably) on the actual cover, and continue the rest onto
-     adjacent pages.
-
-     If you publish or distribute Opaque copies of the Document
-     numbering more than 100, you must either include a machine-readable
-     Transparent copy along with each Opaque copy, or state in or with
-     each Opaque copy a computer-network location from which the general
-     network-using public has access to download using public-standard
-     network protocols a complete Transparent copy of the Document, free
-     of added material.  If you use the latter option, you must take
-     reasonably prudent steps, when you begin distribution of Opaque
-     copies in quantity, to ensure that this Transparent copy will
-     remain thus accessible at the stated location until at least one
-     year after the last time you distribute an Opaque copy (directly or
-     through your agents or retailers) of that edition to the public.
-
-     It is requested, but not required, that you contact the authors of
-     the Document well before redistributing any large number of copies,
-     to give them a chance to provide you with an updated version of the
-     Document.
-
-  4. MODIFICATIONS
-
-     You may copy and distribute a Modified Version of the Document
-     under the conditions of sections 2 and 3 above, provided that you
-     release the Modified Version under precisely this License, with the
-     Modified Version filling the role of the Document, thus licensing
-     distribution and modification of the Modified Version to whoever
-     possesses a copy of it.  In addition, you must do these things in
-     the Modified Version:
-
-       A. Use in the Title Page (and on the covers, if any) a title
-          distinct from that of the Document, and from those of previous
-          versions (which should, if there were any, be listed in the
-          History section of the Document).  You may use the same title
-          as a previous version if the original publisher of that
-          version gives permission.
-
-       B. List on the Title Page, as authors, one or more persons or
-          entities responsible for authorship of the modifications in
-          the Modified Version, together with at least five of the
-          principal authors of the Document (all of its principal
-          authors, if it has fewer than five), unless they release you
-          from this requirement.
-
-       C. State on the Title page the name of the publisher of the
-          Modified Version, as the publisher.
-
-       D. Preserve all the copyright notices of the Document.
-
-       E. Add an appropriate copyright notice for your modifications
-          adjacent to the other copyright notices.
-
-       F. Include, immediately after the copyright notices, a license
-          notice giving the public permission to use the Modified
-          Version under the terms of this License, in the form shown in
-          the Addendum below.
-
-       G. Preserve in that license notice the full lists of Invariant
-          Sections and required Cover Texts given in the Document's
-          license notice.
-
-       H. Include an unaltered copy of this License.
-
-       I. Preserve the section Entitled "History", Preserve its Title,
-          and add to it an item stating at least the title, year, new
-          authors, and publisher of the Modified Version as given on the
-          Title Page.  If there is no section Entitled "History" in the
-          Document, create one stating the title, year, authors, and
-          publisher of the Document as given on its Title Page, then add
-          an item describing the Modified Version as stated in the
-          previous sentence.
-
-       J. Preserve the network location, if any, given in the Document
-          for public access to a Transparent copy of the Document, and
-          likewise the network locations given in the Document for
-          previous versions it was based on.  These may be placed in the
-          "History" section.  You may omit a network location for a work
-          that was published at least four years before the Document
-          itself, or if the original publisher of the version it refers
-          to gives permission.
-
-       K. For any section Entitled "Acknowledgements" or "Dedications",
-          Preserve the Title of the section, and preserve in the section
-          all the substance and tone of each of the contributor
-          acknowledgements and/or dedications given therein.
-
-       L. Preserve all the Invariant Sections of the Document, unaltered
-          in their text and in their titles.  Section numbers or the
-          equivalent are not considered part of the section titles.
-
-       M. Delete any section Entitled "Endorsements".  Such a section
-          may not be included in the Modified Version.
-
-       N. Do not retitle any existing section to be Entitled
-          "Endorsements" or to conflict in title with any Invariant
-          Section.
-
-       O. Preserve any Warranty Disclaimers.
-
-     If the Modified Version includes new front-matter sections or
-     appendices that qualify as Secondary Sections and contain no
-     material copied from the Document, you may at your option designate
-     some or all of these sections as invariant.  To do this, add their
-     titles to the list of Invariant Sections in the Modified Version's
-     license notice.  These titles must be distinct from any other
-     section titles.
-
-     You may add a section Entitled "Endorsements", provided it contains
-     nothing but endorsements of your Modified Version by various
-     parties--for example, statements of peer review or that the text
-     has been approved by an organization as the authoritative
-     definition of a standard.
-
-     You may add a passage of up to five words as a Front-Cover Text,
-     and a passage of up to 25 words as a Back-Cover Text, to the end of
-     the list of Cover Texts in the Modified Version.  Only one passage
-     of Front-Cover Text and one of Back-Cover Text may be added by (or
-     through arrangements made by) any one entity.  If the Document
-     already includes a cover text for the same cover, previously added
-     by you or by arrangement made by the same entity you are acting on
-     behalf of, you may not add another; but you may replace the old
-     one, on explicit permission from the previous publisher that added
-     the old one.
-
-     The author(s) and publisher(s) of the Document do not by this
-     License give permission to use their names for publicity for or to
-     assert or imply endorsement of any Modified Version.
-
-  5. COMBINING DOCUMENTS
-
-     You may combine the Document with other documents released under
-     this License, under the terms defined in section 4 above for
-     modified versions, provided that you include in the combination all
-     of the Invariant Sections of all of the original documents,
-     unmodified, and list them all as Invariant Sections of your
-     combined work in its license notice, and that you preserve all
-     their Warranty Disclaimers.
-
-     The combined work need only contain one copy of this License, and
-     multiple identical Invariant Sections may be replaced with a single
-     copy.  If there are multiple Invariant Sections with the same name
-     but different contents, make the title of each such section unique
-     by adding at the end of it, in parentheses, the name of the
-     original author or publisher of that section if known, or else a
-     unique number.  Make the same adjustment to the section titles in
-     the list of Invariant Sections in the license notice of the
-     combined work.
-
-     In the combination, you must combine any sections Entitled
-     "History" in the various original documents, forming one section
-     Entitled "History"; likewise combine any sections Entitled
-     "Acknowledgements", and any sections Entitled "Dedications".  You
-     must delete all sections Entitled "Endorsements."
-
-  6. COLLECTIONS OF DOCUMENTS
-
-     You may make a collection consisting of the Document and other
-     documents released under this License, and replace the individual
-     copies of this License in the various documents with a single copy
-     that is included in the collection, provided that you follow the
-     rules of this License for verbatim copying of each of the documents
-     in all other respects.
-
-     You may extract a single document from such a collection, and
-     distribute it individually under this License, provided you insert
-     a copy of this License into the extracted document, and follow this
-     License in all other respects regarding verbatim copying of that
-     document.
-
-  7. AGGREGATION WITH INDEPENDENT WORKS
-
-     A compilation of the Document or its derivatives with other
-     separate and independent documents or works, in or on a volume of a
-     storage or distribution medium, is called an "aggregate" if the
-     copyright resulting from the compilation is not used to limit the
-     legal rights of the compilation's users beyond what the individual
-     works permit.  When the Document is included in an aggregate, this
-     License does not apply to the other works in the aggregate which
-     are not themselves derivative works of the Document.
-
-     If the Cover Text requirement of section 3 is applicable to these
-     copies of the Document, then if the Document is less than one half
-     of the entire aggregate, the Document's Cover Texts may be placed
-     on covers that bracket the Document within the aggregate, or the
-     electronic equivalent of covers if the Document is in electronic
-     form.  Otherwise they must appear on printed covers that bracket
-     the whole aggregate.
-
-  8. TRANSLATION
-
-     Translation is considered a kind of modification, so you may
-     distribute translations of the Document under the terms of section
-     4.  Replacing Invariant Sections with translations requires special
-     permission from their copyright holders, but you may include
-     translations of some or all Invariant Sections in addition to the
-     original versions of these Invariant Sections.  You may include a
-     translation of this License, and all the license notices in the
-     Document, and any Warranty Disclaimers, provided that you also
-     include the original English version of this License and the
-     original versions of those notices and disclaimers.  In case of a
-     disagreement between the translation and the original version of
-     this License or a notice or disclaimer, the original version will
-     prevail.
-
-     If a section in the Document is Entitled "Acknowledgements",
-     "Dedications", or "History", the requirement (section 4) to
-     Preserve its Title (section 1) will typically require changing the
-     actual title.
-
-  9. TERMINATION
-
-     You may not copy, modify, sublicense, or distribute the Document
-     except as expressly provided under this License.  Any attempt
-     otherwise to copy, modify, sublicense, or distribute it is void,
-     and will automatically terminate your rights under this License.
-
-     However, if you cease all violation of this License, then your
-     license from a particular copyright holder is reinstated (a)
-     provisionally, unless and until the copyright holder explicitly and
-     finally terminates your license, and (b) permanently, if the
-     copyright holder fails to notify you of the violation by some
-     reasonable means prior to 60 days after the cessation.
-
-     Moreover, your license from a particular copyright holder is
-     reinstated permanently if the copyright holder notifies you of the
-     violation by some reasonable means, this is the first time you have
-     received notice of violation of this License (for any work) from
-     that copyright holder, and you cure the violation prior to 30 days
-     after your receipt of the notice.
-
-     Termination of your rights under this section does not terminate
-     the licenses of parties who have received copies or rights from you
-     under this License.  If your rights have been terminated and not
-     permanently reinstated, receipt of a copy of some or all of the
-     same material does not give you any rights to use it.
-
-  10. FUTURE REVISIONS OF THIS LICENSE
-
-     The Free Software Foundation may publish new, revised versions of
-     the GNU Free Documentation License from time to time.  Such new
-     versions will be similar in spirit to the present version, but may
-     differ in detail to address new problems or concerns.  See
-     <http://www.gnu.org/copyleft/>.
-
-     Each version of the License is given a distinguishing version
-     number.  If the Document specifies that a particular numbered
-     version of this License "or any later version" applies to it, you
-     have the option of following the terms and conditions either of
-     that specified version or of any later version that has been
-     published (not as a draft) by the Free Software Foundation.  If the
-     Document does not specify a version number of this License, you may
-     choose any version ever published (not as a draft) by the Free
-     Software Foundation.  If the Document specifies that a proxy can
-     decide which future versions of this License can be used, that
-     proxy's public statement of acceptance of a version permanently
-     authorizes you to choose that version for the Document.
-
-  11. RELICENSING
-
-     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
-     World Wide Web server that publishes copyrightable works and also
-     provides prominent facilities for anybody to edit those works.  A
-     public wiki that anybody can edit is an example of such a server.
-     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
-     site means any set of copyrightable works thus published on the MMC
-     site.
-
-     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
-     license published by Creative Commons Corporation, a not-for-profit
-     corporation with a principal place of business in San Francisco,
-     California, as well as future copyleft versions of that license
-     published by that same organization.
-
-     "Incorporate" means to publish or republish a Document, in whole or
-     in part, as part of another Document.
-
-     An MMC is "eligible for relicensing" if it is licensed under this
-     License, and if all works that were first published under this
-     License somewhere other than this MMC, and subsequently
-     incorporated in whole or in part into the MMC, (1) had no cover
-     texts or invariant sections, and (2) were thus incorporated prior
-     to November 1, 2008.
-
-     The operator of an MMC Site may republish an MMC contained in the
-     site under CC-BY-SA on the same site at any time before August 1,
-     2009, provided the MMC is eligible for relicensing.
-
-ADDENDUM: How to use this License for your documents
-====================================================
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and license
-notices just after the title page:
-
-       Copyright (C)  YEAR  YOUR NAME.
-       Permission is granted to copy, distribute and/or modify this document
-       under the terms of the GNU Free Documentation License, Version 1.3
-       or any later version published by the Free Software Foundation;
-       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
-       Texts.  A copy of the license is included in the section entitled ``GNU
-       Free Documentation License''.
-
-   If you have Invariant Sections, Front-Cover Texts and Back-Cover
-Texts, replace the "with...Texts."  line with this:
-
-         with the Invariant Sections being LIST THEIR TITLES, with
-         the Front-Cover Texts being LIST, and with the Back-Cover Texts
-         being LIST.
-
-   If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-   If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of free
-software license, such as the GNU General Public License, to permit
-their use in free software.
-
-
-
-Tag Table:
-
-End Tag Table
.emacs.d/elpa/evil-20170904.1346/macros.info
@@ -1,7 +0,0 @@
-This is macros.info, produced by makeinfo version 5.2 from macros.texi.
-
-
-
-Tag Table:
-
-End Tag Table
.emacs.d/elpa/evil-20170904.1346/version.info
@@ -1,8 +0,0 @@
-This is version.info, produced by makeinfo version 5.2 from
-version.texi.
-
-
-
-Tag Table:
-
-End Tag Table
.emacs.d/elpa/evil-indent-textobject-20130831.1519/evil-indent-textobject-autoloads.el
@@ -1,19 +0,0 @@
-;;; evil-indent-textobject-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "evil-indent-textobject" "evil-indent-textobject.el"
-;;;;;;  (22968 13521 188620 887000))
-;;; Generated autoloads from evil-indent-textobject.el
-
-(eval-after-load 'evil '(progn (autoload 'evil-indent-i-indent "evil-indent-textobject" nil t) (autoload 'evil-indent-a-indent "evil-indent-textobject" nil t) (autoload 'evil-indent-a-indent-lines "evil-indent-textobject" nil t) (define-key evil-inner-text-objects-map "i" 'evil-indent-i-indent) (define-key evil-outer-text-objects-map "i" 'evil-indent-a-indent) (define-key evil-outer-text-objects-map "I" 'evil-indent-a-indent-lines)))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; evil-indent-textobject-autoloads.el ends here
.emacs.d/elpa/evil-indent-textobject-20130831.1519/evil-indent-textobject-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "evil-indent-textobject" "20130831.1519" "evil textobjects based on indentation" '((evil "0")) :commit "70a1154a531b7cfdbb9a31d6922482791e20a3a7" :url "http://github.com/cofi/evil-indent-textobject" :keywords '("convenience" "evil"))
.emacs.d/elpa/evil-indent-textobject-20130831.1519/evil-indent-textobject.el
@@ -1,125 +0,0 @@
-;;; evil-indent-textobject.el --- evil textobjects based on indentation
-
-;; Copyright (C) 2013 Michael Markert
-;; Author: Michael Markert <markert.michael@gmail.com>
-;; Created: 2013-08-31
-;; Version: 0.2
-;; Package-Version: 20130831.1519
-;; Keywords: convenience evil
-;; URL: http://github.com/cofi/evil-indent-textobject
-;; Package-Requires: ((evil "0"))
-;;
-;; 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 2 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 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 new textobjects:
-;;;
-;;; ii - Inner Indentation: the surrounding textblock with the same indentation
-;;; ai - Above and Indentation: ii + the line above with a different indentation
-;;; aI - Above and Indentation+: ai + the line below with a different indentation
-;;;
-;;; With | representing the cursor:
-;;;
-;;; (while (not done)
-;;;   (messa|ge "All work and no play makes Jack a dull boy."))
-;;; (1+ 41)
-;;;
-;;; - vii will select the line with message
-;;; - vai will select the whole while loop
-;;; - vaI will select the whole fragment
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'evil)
-
-(defun evil-indent--current-indentation ()
-  "Return the indentation of the current line.
-Moves point."
-  (buffer-substring-no-properties (point-at-bol)
-                                  (progn (back-to-indentation)
-                                         (point))))
-
-(defun evil-indent--same-indent-range (&optional point)
-  "Return the point at the begin and end of the text block with the same indentation.
-If `point' is supplied and non-nil it will return the begin and
-end of the block surrounding point."
-  (save-excursion
-    (when point
-      (goto-char point))
-    (let ((start (point))
-          (indent (evil-indent--current-indentation))
-          begin end)
-      (loop while (and (/= (point) (point-min))
-                       (string= (evil-indent--current-indentation) indent))
-            do (progn
-                 (setq begin (point-at-bol))
-                 (forward-line -1)))
-      (goto-char start)
-      (loop while (and (/= (point) (point-max))
-                       (string= (evil-indent--current-indentation) indent))
-            do (progn
-                 (setq end (point-at-eol))
-                 (forward-line 1)))
-      (list begin end))))
-
-(evil-define-text-object evil-indent-a-indent (&optional count beg end type)
-  "Text object describing the block with the same indentation as
-the current line and the line above."
-  :type line
-  (let ((range (evil-indent--same-indent-range)))
-    (evil-range (save-excursion
-                  (goto-char (first (evil-indent--same-indent-range)))
-                  (forward-line -1)
-                  (point-at-bol))
-                (second range) 'line)))
-
-(evil-define-text-object evil-indent-a-indent-lines (&optional count beg end type)
-  "Text object describing the block with the same indentation as
-the current line and the lines above and below."
-  :type line
-  (let ((range (evil-indent--same-indent-range)))
-    (evil-range (save-excursion
-                  (goto-char (first range))
-                  (forward-line -1)
-                  (point-at-bol))
-                (save-excursion
-                  (goto-char (second range))
-                  (forward-line 1)
-                  (point-at-eol)) 'line)))
-
-(evil-define-text-object evil-indent-i-indent (&optional count beg end type)
-  "Text object describing the block with the same indentation as
-the current line."
-  :type line
-  (let ((range (evil-indent--same-indent-range)))
-    (evil-range (first range) (second range) 'line)))
-
-;;;###autoload
-(eval-after-load 'evil
-  '(progn
-     (autoload 'evil-indent-i-indent "evil-indent-textobject" nil t)
-     (autoload 'evil-indent-a-indent "evil-indent-textobject" nil t)
-     (autoload 'evil-indent-a-indent-lines "evil-indent-textobject" nil t)
-     (define-key evil-inner-text-objects-map "i" 'evil-indent-i-indent)
-     (define-key evil-outer-text-objects-map "i" 'evil-indent-a-indent)
-     (define-key evil-outer-text-objects-map "I" 'evil-indent-a-indent-lines)))
-
-(provide 'evil-indent-textobject)
-;;; evil-indent-textobject.el ends here
.emacs.d/elpa/evil-indent-textobject-20130831.1519/evil-indent-textobject.elc
Binary file
.emacs.d/elpa/evil-surround-20170910.1952/evil-surround-autoloads.el
@@ -1,70 +0,0 @@
-;;; evil-surround-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "evil-surround" "evil-surround.el" (22968 13502
-;;;;;;  622816 101000))
-;;; Generated autoloads from evil-surround.el
-
-(autoload 'evil-surround-delete "evil-surround" "\
-Delete the surrounding delimiters represented by CHAR.
-Alternatively, the text to delete can be represented with
-the overlays OUTER and INNER, where OUTER includes the delimiters
-and INNER excludes them. The intersection (i.e., difference)
-between these overlays is what is deleted.
-
-\(fn CHAR &optional OUTER INNER)" t nil)
-
-(autoload 'evil-surround-change "evil-surround" "\
-Change the surrounding delimiters represented by CHAR.
-Alternatively, the text to delete can be represented with the
-overlays OUTER and INNER, which are passed to `evil-surround-delete'.
-
-\(fn CHAR &optional OUTER INNER)" t nil)
-
-(autoload 'evil-surround-mode "evil-surround" "\
-Buffer-local minor mode to emulate surround.vim.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'turn-on-evil-surround-mode "evil-surround" "\
-Enable evil-surround-mode in the current buffer.
-
-\(fn)" nil nil)
-
-(autoload 'turn-off-evil-surround-mode "evil-surround" "\
-Disable evil-surround-mode in the current buffer.
-
-\(fn)" nil nil)
-
-(defvar global-evil-surround-mode nil "\
-Non-nil if Global Evil-Surround mode is enabled.
-See the `global-evil-surround-mode' command
-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-evil-surround-mode'.")
-
-(custom-autoload 'global-evil-surround-mode "evil-surround" nil)
-
-(autoload 'global-evil-surround-mode "evil-surround" "\
-Toggle Evil-Surround mode in all buffers.
-With prefix ARG, enable Global Evil-Surround mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
-
-Evil-Surround mode is enabled in all buffers where
-`turn-on-evil-surround-mode' would do it.
-See `evil-surround-mode' for more information on Evil-Surround mode.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; evil-surround-autoloads.el ends here
.emacs.d/elpa/evil-surround-20170910.1952/evil-surround-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "evil-surround" "20170910.1952" "emulate surround.vim from Vim" '((evil "1.2.12")) :commit "7839abe0e04740e2928a6b799557d1b16460fa5f" :keywords '("emulation" "vi" "evil"))
.emacs.d/elpa/evil-surround-20170910.1952/evil-surround.el
@@ -1,385 +0,0 @@
-;;; evil-surround.el --- emulate surround.vim from Vim
-
-;; Copyright (C) 2010 - 2017 Tim Harper
-
-;; Licensed under the same terms as Emacs (GPLv3)
-
-;;
-;; Author: Tim Harper <timcharper at gmail dot com>
-;;      Vegard Øye <vegard_oye at hotmail dot com>
-;; Current Maintainer: ninrod (github.com/ninrod)
-;; Created: July 23 2011
-;; Version: 0.1
-;; Package-Version: 20170910.1952
-;; Package-Requires: ((evil "1.2.12"))
-;; Mailing list: <implementations-list at lists.ourproject.org>
-;;      Subscribe: http://tinyurl.com/implementations-list
-;;      Newsgroup: nntp://news.gmane.org/gmane.emacs.vim-emulation
-;;      Archives: http://dir.gmane.org/gmane.emacs.vim-emulation
-;; Keywords: emulation, vi, evil
-;;
-;; This file is not part of GNU Emacs.
-
-;;; Commentary:
-
-;; This package emulates surround.vim by Tim Pope.
-;; The functionality is wrapped into a minor mode. To enable
-;; it globally, add the following lines to ~/.emacs:
-;;
-;;     (require 'evil-surround)
-;;     (global-evil-surround-mode 1)
-;;
-;; Alternatively, you can enable evil-surround-mode along a major mode
-;; by adding `turn-on-evil-surround-mode' to the mode hook.
-;;
-;; This package uses Evil as its vi layer. It is available from:
-;;
-;;     https://github.com/emacs-evil/evil
-
-;;; Code:
-
-(require 'evil)
-
-(defgroup surround nil
-  "surround.vim for Emacs"
-  :prefix "surround-"
-  :group 'evil)
-
-(defcustom evil-surround-pairs-alist
-  '((?\( . ("( " . " )"))
-    (?\[ . ("[ " . " ]"))
-    (?\{ . ("{ " . " }"))
-
-    (?\) . ("(" . ")"))
-    (?\] . ("[" . "]"))
-    (?\} . ("{" . "}"))
-
-    (?# . ("#{" . "}"))
-    (?b . ("(" . ")"))
-    (?B . ("{" . "}"))
-    (?> . ("<" . ">"))
-    (?t . evil-surround-read-tag)
-    (?< . evil-surround-read-tag)
-    (?f . evil-surround-function))
-  "Association list of surround items.
-Each item is of the form (TRIGGER . (LEFT . RIGHT)), all strings.
-Alternatively, a function can be put in place of (LEFT . RIGHT).
-This only affects inserting pairs, not deleting or changing them."
-  :group 'surround
-  :type '(alist
-          :key-type (character :tag "Key")
-          :value-type (choice
-                       (cons (string :tag "Opening") (string :tag "Closing"))
-                       (function :tag "Function"))))
-(make-variable-buffer-local 'evil-surround-pairs-alist)
-
-(defcustom evil-surround-operator-alist
-  '((evil-change . change)
-    (evil-delete . delete))
-  "Association list of operators to their fundamental operation.
-Each item is of the form (OPERATOR . OPERATION)."
-  :group 'surround
-  :type '(repeat (cons (symbol :tag "Operator")
-                       (symbol :tag "Operation"))))
-
-(defvar evil-surround-read-tag-map
-  (let ((map (copy-keymap minibuffer-local-map)))
-    (define-key map ">" 'exit-minibuffer)
-    map)
-  "Keymap used by `evil-surround-read-tag'.")
-
-(defun evil-surround-function ()
-  "Read a functionname from the minibuffer and wrap selection in function call"
-  (let ((fname (read-from-minibuffer "" "" )))
-    (cons (format "%s(" (or fname ""))
-          ")")))
-
-(defun evil-surround-read-tag ()
-  "Read a XML tag from the minibuffer."
-  (let* ((input (read-from-minibuffer "<" "" evil-surround-read-tag-map))
-         (match (string-match "\\([0-9a-z-]+\\)\\(.*?\\)[>]*$" input))
-         (tag  (match-string 1 input))
-         (rest (match-string 2 input)))
-    (cons (format "<%s%s>" (or tag "") (or rest ""))
-          (format "</%s>" (or tag "")))))
-
-(defun evil-surround-valid-char-p (char)
-  "Returns whether CHAR is a valid surround char or not."
-  (not (memq char '(?\C-\[ ?\C-?))))
-
-(defun evil-surround-pair (char)
-  "Return the evil-surround pair of char.
-This is a cons cell (LEFT . RIGHT), both strings."
-  (let ((pair (assoc-default char evil-surround-pairs-alist)))
-    (cond
-     ((functionp pair)
-      (funcall pair))
-
-     ((consp pair)
-      pair)
-
-     (t
-      (cons (format "%c" char) (format "%c" char))))))
-
-(defun evil-surround-outer-overlay (char)
-  "Return outer overlay for the delimited range represented by CHAR.
-This overlay includes the delimiters.
-See also `evil-surround-inner-overlay'."
-  (let ((outer (lookup-key evil-outer-text-objects-map (string char))))
-    (when (functionp outer)
-      (setq outer (funcall outer))
-      (when (evil-range-p outer)
-        (evil-surround-trim-whitespace-from-range outer "[[:space:]]")
-        (setq outer (make-overlay (evil-range-beginning outer)
-                                  (evil-range-end outer)
-                                  nil nil t))))))
-
-(defun evil-surround-trim-whitespace-from-range (range &optional regexp)
-  "Given an evil-range, trim whitespace around range by shrinking the range such that it neither begins nor ends with whitespace. Does not modify the buffer."
-  (let ((regexp (or regexp "[ \f\t\n\r\v]")))
-    (save-excursion
-      (save-match-data
-        (goto-char (evil-range-beginning range))
-        (while (looking-at regexp) (forward-char))
-        (evil-set-range-beginning range (point))
-        (goto-char (evil-range-end range))
-        (while (looking-back regexp) (backward-char))
-        (evil-set-range-end range (point))))))
-
-(defun evil-surround-inner-overlay (char)
-  "Return inner overlay for the delimited range represented by CHAR.
-This overlay excludes the delimiters.
-See also `evil-surround-outer-overlay'."
-  (let ((inner (lookup-key evil-inner-text-objects-map (string char))))
-    (when (functionp inner)
-      (setq inner (funcall inner))
-      (when (evil-range-p inner)
-        (when (eq (char-syntax char) ?\()
-          (evil-surround-trim-whitespace-from-range inner "[[:space:]]"))
-        (setq inner (make-overlay (evil-range-beginning inner)
-                                  (evil-range-end inner)
-                                  nil nil t))))))
-
-(evil-define-motion evil-surround-line (count)
-  "Move COUNT - 1 lines down but return exclusive character motion."
-  :type exclusive
-  (let ((beg (line-beginning-position)))
-    (evil-line count)
-    (end-of-line)
-    (let ((range (evil-range beg (point) 'exclusive)))
-      (evil-expand-range range)
-      range)))
-
-;;;###autoload
-(defun evil-surround-delete (char &optional outer inner)
-  "Delete the surrounding delimiters represented by CHAR.
-Alternatively, the text to delete can be represented with
-the overlays OUTER and INNER, where OUTER includes the delimiters
-and INNER excludes them. The intersection (i.e., difference)
-between these overlays is what is deleted."
-  (interactive "c")
-  (cond
-   ((and outer inner)
-    (delete-region (overlay-start outer) (overlay-start inner))
-    (delete-region (overlay-end inner) (overlay-end outer))
-    (goto-char (overlay-start outer)))
-   (t
-    ;; no overlays specified: create them on the basis of CHAR
-    ;; and delete after use
-    (let* ((outer (evil-surround-outer-overlay char))
-           (inner (evil-surround-inner-overlay char)))
-      (unwind-protect
-          (when (and outer inner)
-            (evil-surround-delete char outer inner))
-        (when outer (delete-overlay outer))
-        (when inner (delete-overlay inner)))))))
-
-;;;###autoload
-(defun evil-surround-change (char &optional outer inner)
-  "Change the surrounding delimiters represented by CHAR.
-Alternatively, the text to delete can be represented with the
-overlays OUTER and INNER, which are passed to `evil-surround-delete'."
-  (interactive "c")
-  (cond
-   ((and outer inner)
-    (evil-surround-delete char outer inner)
-    (let ((key (read-char)))
-      (evil-surround-region (overlay-start outer)
-                            (overlay-end outer)
-                            nil (if (evil-surround-valid-char-p key) key char))))
-   (t
-    (let* ((outer (evil-surround-outer-overlay char))
-           (inner (evil-surround-inner-overlay char)))
-      (unwind-protect
-          (when (and outer inner)
-            (evil-surround-change char outer inner))
-        (when outer (delete-overlay outer))
-        (when inner (delete-overlay inner)))))))
-
-(defun evil-surround-interactive-setup ()
-  (setq evil-inhibit-operator t)
-     (list (assoc-default evil-this-operator
-                          evil-surround-operator-alist)))
-
-(defun evil-surround-setup-surround-line-operators ()
-  (define-key evil-operator-shortcut-map "s" 'evil-surround-line)
-  (define-key evil-operator-shortcut-map "S" 'evil-surround-line))
-
-(defun evil-surround-column-at (pos)
-  (save-excursion (goto-char pos) (current-column)))
-
-(defun evil-surround-block (beg end char)
-  "Surrounds a block selection with a character, as if `evil-surround-region'
-were called on each segment in each line. This skips lines where EOL < BEG's
-column."
-  (let ((beg-col (evil-surround-column-at beg))
-        (end-col (evil-surround-column-at end)))
-    (evil-apply-on-block
-     (lambda (ibeg iend)
-       (unless (< (evil-surround-column-at ibeg) (min beg-col end-col))
-         (evil-surround-region ibeg iend t char)))
-     beg end nil)))
-
-(defun evil-surround-call-with-repeat (callback)
-  "Record keystrokes to repeat surround-region operator and it's motion.
-This is necessary because `evil-yank' operator is not repeatable (:repeat nil)"
-  (evil-repeat-start)
-  (evil-repeat-record "y")
-  (evil-repeat-record (this-command-keys))
-  (call-interactively callback)
-  (evil-repeat-keystrokes 'post)
-  (evil-repeat-stop))
-
-;; Dispatcher function in Operator-Pending state.
-;; "cs" calls `evil-surround-change', "ds" calls `evil-surround-delete',
-;; and "ys" calls `evil-surround-region'.
-(evil-define-command evil-surround-edit (operation)
-  "Edit the surrounding delimiters represented by CHAR.
-If OPERATION is `change', call `evil-surround-change'.
-if OPERATION is `delete', call `evil-surround-delete'.
-Otherwise call `evil-surround-region'."
-  (interactive (evil-surround-interactive-setup))
-  (cond
-   ((eq operation 'change)
-    (call-interactively 'evil-surround-change))
-   ((eq operation 'delete)
-    (call-interactively 'evil-surround-delete))
-   (t
-    (evil-surround-setup-surround-line-operators)
-    (evil-surround-call-with-repeat 'evil-surround-region))))
-
-(evil-define-command evil-Surround-edit (operation)
-  "Like evil-surround-edit, but for surrounding with additional new-lines.
-
-It does nothing for change / delete."
-  (interactive (evil-surround-interactive-setup))
-  (cond
-   ((eq operation 'change) nil)
-   ((eq operation 'delete) nil)
-   (t
-    (evil-surround-setup-surround-line-operators)
-    (evil-surround-call-with-repeat 'evil-Surround-region))))
-
-(evil-define-operator evil-surround-region (beg end type char &optional force-new-line)
-  "Surround BEG and END with CHAR.
-
-When force-new-line is true, and region type is not line, the
-following: (vertical bars indicate region start/end points)
-
-   do |:thing|
-
-Becomes this:
-
-   do {
-     :thing
-   }"
-
-  (interactive "<R>c")
-  (when (evil-surround-valid-char-p char)
-    (let* ((overlay (make-overlay beg end nil nil t))
-           (pair (or (and (boundp 'pair) pair) (evil-surround-pair char)))
-           (open (car pair))
-           (close (cdr pair))
-           (beg-pos (overlay-start overlay)))
-      (unwind-protect
-          (progn
-            (goto-char beg-pos)
-            (cond ((eq type 'block)
-                   (evil-surround-block beg end char))
-
-                  ((eq type 'line)
-                   (setq force-new-line
-                         (or force-new-line
-                             ;; Force newline if not invoked from an operator, e.g. VS)
-                             (eq evil-this-operator 'evil-surround-region)
-                             ;; Or on multi-line operator surrounds (like 'ysj]')
-                             (/= (line-number-at-pos) (line-number-at-pos (1- end)))))
-
-                   (back-to-indentation)
-                   (setq beg-pos (point))
-                   (insert open)
-                   (when force-new-line (newline-and-indent))
-                   (goto-char (overlay-end overlay))
-                   (if force-new-line
-                       (when (eobp)
-                         (newline-and-indent))
-                     (backward-char)
-                     (evil-last-non-blank)
-                     (forward-char))
-                   (insert close)
-                   (when (or force-new-line
-                             (/= (line-number-at-pos) (line-number-at-pos beg-pos)))
-                     (indent-region beg-pos (point))
-                     (newline-and-indent)))
-
-                  (force-new-line
-                   (insert open)
-                   (newline-and-indent)
-                   (let ((pt (point)))
-                     (goto-char (overlay-end overlay))
-                     (newline-and-indent)
-                     (insert close)
-                     (indent-region pt (point))))
-
-                  (t
-                   (insert open)
-                   (goto-char (overlay-end overlay))
-                   (insert close)))
-            (goto-char beg-pos))
-        (delete-overlay overlay)))))
-
-(evil-define-operator evil-Surround-region (beg end type char)
-  "Call surround-region, toggling force-new-line"
-  (interactive "<R>c")
-  (evil-surround-region beg end type char t))
-
-;;;###autoload
-(define-minor-mode evil-surround-mode
-  "Buffer-local minor mode to emulate surround.vim."
-  :keymap (make-sparse-keymap)
-  (evil-normalize-keymaps))
-
-;;;###autoload
-(defun turn-on-evil-surround-mode ()
-  "Enable evil-surround-mode in the current buffer."
-  (evil-surround-mode 1))
-
-;;;###autoload
-(defun turn-off-evil-surround-mode ()
-  "Disable evil-surround-mode in the current buffer."
-  (evil-surround-mode -1))
-
-;;;###autoload
-(define-globalized-minor-mode global-evil-surround-mode
-  evil-surround-mode turn-on-evil-surround-mode
-  "Global minor mode to emulate surround.vim.")
-
-(evil-define-key 'operator evil-surround-mode-map "s" 'evil-surround-edit)
-(evil-define-key 'operator evil-surround-mode-map "S" 'evil-Surround-edit)
-
-(evil-define-key 'visual evil-surround-mode-map "S" 'evil-surround-region)
-(evil-define-key 'visual evil-surround-mode-map "gS" 'evil-Surround-region)
-
-(provide 'evil-surround)
-
-;;; evil-surround.el ends here
.emacs.d/elpa/evil-surround-20170910.1952/evil-surround.elc
Binary file
.emacs.d/elpa/exec-path-from-shell-20170508.4/exec-path-from-shell-autoloads.el
@@ -1,44 +0,0 @@
-;;; exec-path-from-shell-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "exec-path-from-shell" "exec-path-from-shell.el"
-;;;;;;  (22966 56208 696591 848000))
-;;; Generated autoloads from exec-path-from-shell.el
-
-(autoload 'exec-path-from-shell-copy-envs "exec-path-from-shell" "\
-Set the environment variables with NAMES from the user's shell.
-
-As a special case, if the variable is $PATH, then `exec-path' and
-`eshell-path-env' are also set appropriately.  The result is an alist,
-as described by `exec-path-from-shell-getenvs'.
-
-\(fn NAMES)" nil nil)
-
-(autoload 'exec-path-from-shell-copy-env "exec-path-from-shell" "\
-Set the environment variable $NAME from the user's shell.
-
-As a special case, if the variable is $PATH, then `exec-path' and
-`eshell-path-env' are also set appropriately.  Return the value
-of the environment variable.
-
-\(fn NAME)" t nil)
-
-(autoload 'exec-path-from-shell-initialize "exec-path-from-shell" "\
-Initialize environment from the user's shell.
-
-The values of all the environment variables named in
-`exec-path-from-shell-variables' are set from the corresponding
-values used in the user's shell.
-
-\(fn)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; exec-path-from-shell-autoloads.el ends here
.emacs.d/elpa/exec-path-from-shell-20170508.4/exec-path-from-shell-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "exec-path-from-shell" "20170508.4" "Get environment variables such as $PATH from the shell" 'nil :commit "5e355fbc50913d1ffe48bf86df0bcecd8b369ffb" :url "https://github.com/purcell/exec-path-from-shell" :keywords '("environment"))
.emacs.d/elpa/exec-path-from-shell-20170508.4/exec-path-from-shell.el
@@ -1,270 +0,0 @@
-;;; exec-path-from-shell.el --- Get environment variables such as $PATH from the shell
-
-;; Copyright (C) 2012-2014 Steve Purcell
-
-;; Author: Steve Purcell <steve@sanityinc.com>
-;; Keywords: environment
-;; URL: https://github.com/purcell/exec-path-from-shell
-;; Package-Version: 20170508.4
-;; Package-X-Original-Version: 0
-
-;; This file is not part of GNU Emacs.
-
-;; 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 3 of the License, 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 this file.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; On OS X (and perhaps elsewhere) the $PATH environment variable and
-;; `exec-path' used by a windowed Emacs instance will usually be the
-;; system-wide default path, rather than that seen in a terminal
-;; window.
-
-;; This library allows the user to set Emacs' `exec-path' and $PATH
-;; from the shell path, so that `shell-command', `compile' and the
-;; like work as expected.
-
-;; It also allows other environment variables to be retrieved from the
-;; shell, so that Emacs will see the same values you get in a terminal.
-
-;; If you use a non-POSIX-standard shell like "tcsh" or "fish", your
-;; shell will be asked to execute "sh" as a subshell in order to print
-;; out the variables in a format which can be reliably parsed.  "sh"
-;; must be a POSIX-compliant shell in this case.
-
-;; Note that shell variables which have not been exported as
-;; environment variables (e.g. using the "export" keyword) may not be
-;; visible to `exec-path-from-shell'.
-
-;; Installation:
-
-;; ELPA packages are available on Marmalade and MELPA.  Alternatively,
-;; place this file on a directory in your `load-path', and explicitly
-;; require it.
-
-;; Usage:
-;;
-;;     (require 'exec-path-from-shell) ;; if not using the ELPA package
-;;     (exec-path-from-shell-initialize)
-;;
-;; Customize `exec-path-from-shell-variables' to modify the list of
-;; variables imported.
-;;
-;; If you use your Emacs config on other platforms, you can instead
-;; make initialization conditional as follows:
-;;
-;;     (when (memq window-system '(mac ns))
-;;       (exec-path-from-shell-initialize))
-;;
-;; Alternatively, you can use `exec-path-from-shell-copy-envs' or
-;; `exec-path-from-shell-copy-env' directly, e.g.
-;;
-;;     (exec-path-from-shell-copy-env "PYTHONPATH")
-
-;;; Code:
-
-(defgroup exec-path-from-shell nil
-  "Make Emacs use shell-defined values for $PATH etc."
-  :prefix "exec-path-from-shell-"
-  :group 'environment)
-
-(defcustom exec-path-from-shell-variables
-  '("PATH" "MANPATH")
-  "List of environment variables which are copied from the shell."
-  :type '(repeat (string :tag "Environment variable"))
-  :group 'exec-path-from-shell)
-
-(defcustom exec-path-from-shell-check-startup-files t
-  "If non-nil, warn if variables are being set in the wrong shell startup files.
-Environment variables should be set in .profile or .zshenv rather than
-.bashrc or .zshrc."
-  :type 'boolean
-  :group 'exec-path-from-shell)
-
-(defcustom exec-path-from-shell-shell-name nil
-  "If non-nil, use this shell executable.
-Otherwise, use either `shell-file-name' (if set), or the value of
-the SHELL environment variable."
-  :type '(choice
-          (file :tag "Shell executable")
-          (const :tag "Use `shell-file-name' or $SHELL" nil))
-  :group 'exec-path-from-shell)
-
-(defvar exec-path-from-shell-debug nil
-  "Display debug info when non-nil.")
-
-(defun exec-path-from-shell--double-quote (s)
-  "Double-quote S, escaping any double-quotes already contained in it."
-  (concat "\"" (replace-regexp-in-string "\"" "\\\\\"" s) "\""))
-
-(defun exec-path-from-shell--shell ()
-  "Return the shell to use.
-See documentation for `exec-path-from-shell-shell-name'."
-  (or
-   exec-path-from-shell-shell-name
-   shell-file-name
-   (getenv "SHELL")
-   (error "SHELL environment variable is unset")))
-
-(defcustom exec-path-from-shell-arguments
-  (if (string-match-p "t?csh$" (exec-path-from-shell--shell))
-      (list "-d")
-    (list "-l" "-i"))
-  "Additional arguments to pass to the shell.
-
-The default value denotes an interactive login shell."
-  :type '(repeat (string :tag "Shell argument"))
-  :group 'exec-path-from-shell)
-
-(defun exec-path-from-shell--debug (msg &rest args)
-  "Print MSG and ARGS like `message', but only if debug output is enabled."
-  (when exec-path-from-shell-debug
-    (apply 'message msg args)))
-
-(defun exec-path-from-shell--standard-shell-p (shell)
-  "Return non-nil iff the shell supports the standard ${VAR-default} syntax."
-  (not (string-match "\\(fish\\|t?csh\\)$" shell)))
-
-(defun exec-path-from-shell-printf (str &optional args)
-  "Return the result of printing STR in the user's shell.
-
-Executes the shell as interactive login shell.
-
-STR is inserted literally in a single-quoted argument to printf,
-and may therefore contain backslashed escape sequences understood
-by printf.
-
-ARGS is an optional list of args which will be inserted by printf
-in place of any % placeholders in STR.  ARGS are not automatically
-shell-escaped, so they may contain $ etc."
-  (let* ((printf-bin (or (executable-find "printf") "printf"))
-         (printf-command
-          (concat printf-bin
-                  " '__RESULT\\000" str "\\000__RESULT' "
-                  (mapconcat #'exec-path-from-shell--double-quote args " ")))
-         (shell (exec-path-from-shell--shell))
-         (shell-args (append exec-path-from-shell-arguments
-                             (list "-c"
-                                   (if (exec-path-from-shell--standard-shell-p shell)
-                                       printf-command
-                                     (concat "sh -c " (shell-quote-argument printf-command)))))))
-    (with-temp-buffer
-      (exec-path-from-shell--debug "Invoking shell %s with args %S" shell shell-args)
-      (let ((exit-code (apply #'call-process shell nil t nil shell-args)))
-        (exec-path-from-shell--debug "Shell printed: %S" (buffer-string))
-        (unless (zerop exit-code)
-          (error "Non-zero exit code from shell %s invoked with args %S.  Output was:\n%S"
-                 shell shell-args (buffer-string))))
-      (goto-char (point-min))
-      (if (re-search-forward "__RESULT\0\\(.*\\)\0__RESULT" nil t)
-          (match-string 1)
-        (error "Expected printf output from shell, but got: %S" (buffer-string))))))
-
-(defun exec-path-from-shell-getenvs (names)
-  "Get the environment variables with NAMES from the user's shell.
-
-Execute the shell according to `exec-path-from-shell-arguments'.
-The result is a list of (NAME . VALUE) pairs."
-  (let* ((random-default (md5 (format "%s%s%s" (emacs-pid) (random) (current-time))))
-         (dollar-names (mapcar (lambda (n) (format "${%s-%s}" n random-default)) names))
-         (values (split-string (exec-path-from-shell-printf
-                                (mapconcat #'identity (make-list (length names) "%s") "\\000")
-                                dollar-names) "\0")))
-    (let (result)
-      (while names
-        (prog1
-            (let ((value (car values)))
-              (push (cons (car names)
-                          (unless (string-equal random-default value)
-                            value))
-                    result))
-          (setq values (cdr values)
-                names (cdr names))))
-      result)))
-
-(defun exec-path-from-shell-getenv (name)
-  "Get the environment variable NAME from the user's shell.
-
-Execute the shell as interactive login shell, have it output the
-variable of NAME and return this output as string."
-  (cdr (assoc name (exec-path-from-shell-getenvs (list name)))))
-
-(defun exec-path-from-shell-setenv (name value)
-  "Set the value of environment var NAME to VALUE.
-Additionally, if NAME is \"PATH\" then also set corresponding
-variables such as `exec-path'."
-  (setenv name value)
-  (when (string-equal "PATH" name)
-    (setq eshell-path-env value
-          exec-path (append (parse-colon-path value) (list exec-directory)))))
-
-;;;###autoload
-(defun exec-path-from-shell-copy-envs (names)
-  "Set the environment variables with NAMES from the user's shell.
-
-As a special case, if the variable is $PATH, then `exec-path' and
-`eshell-path-env' are also set appropriately.  The result is an alist,
-as described by `exec-path-from-shell-getenvs'."
-  (let ((pairs (exec-path-from-shell-getenvs names)))
-    (when exec-path-from-shell-check-startup-files
-      (exec-path-from-shell--maybe-warn-about-startup-files pairs))
-    (mapc (lambda (pair)
-            (exec-path-from-shell-setenv (car pair) (cdr pair)))
-          pairs)))
-
-(defun exec-path-from-shell--maybe-warn-about-startup-files (pairs)
-  "Warn the user if the value of PAIRS seems to depend on interactive shell startup files."
-  (let ((without-minus-i (remove "-i" exec-path-from-shell-arguments)))
-    ;; If the user is using "-i", we warn them if it is necessary.
-    (unless (eq exec-path-from-shell-arguments without-minus-i)
-      (let* ((exec-path-from-shell-arguments without-minus-i)
-             (alt-pairs (exec-path-from-shell-getenvs (mapcar 'car pairs)))
-             different)
-        (dolist (pair pairs)
-          (unless (equal pair (assoc (car pair) alt-pairs))
-            (push (car pair) different)))
-        (when different
-          (message "You appear to be setting environment variables %S in your .bashrc or .zshrc: those files are only read by interactive shells, so you should instead set environment variables in startup files like .profile, .bash_profile or .zshenv.  Refer to your shell's man page for more info.  Customize `exec-path-from-shell-arguments' to remove \"-i\" when done, or disable `exec-path-from-shell-check-startup-files' to disable this message." different))))))
-
-;;;###autoload
-(defun exec-path-from-shell-copy-env (name)
-  "Set the environment variable $NAME from the user's shell.
-
-As a special case, if the variable is $PATH, then `exec-path' and
-`eshell-path-env' are also set appropriately.  Return the value
-of the environment variable."
-  (interactive "sCopy value of which environment variable from shell? ")
-  (cdar (exec-path-from-shell-copy-envs (list name))))
-
-;;;###autoload
-(defun exec-path-from-shell-initialize ()
-  "Initialize environment from the user's shell.
-
-The values of all the environment variables named in
-`exec-path-from-shell-variables' are set from the corresponding
-values used in the user's shell."
-  (interactive)
-  (exec-path-from-shell-copy-envs exec-path-from-shell-variables))
-
-
-(provide 'exec-path-from-shell)
-
-;; Local Variables:
-;; coding: utf-8
-;; indent-tabs-mode: nil
-;; mangle-whitespace: t
-;; require-final-newline: t
-;; checkdoc-minor-mode: t
-;; End:
-
-;;; exec-path-from-shell.el ends here
.emacs.d/elpa/exec-path-from-shell-20170508.4/exec-path-from-shell.elc
Binary file
.emacs.d/elpa/font-lock+-20170222.1755/font-lock+-autoloads.el
@@ -1,15 +0,0 @@
-;;; font-lock+-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil nil ("font-lock+.el") (22964 3865 757660 190000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; font-lock+-autoloads.el ends here
.emacs.d/elpa/font-lock+-20170222.1755/font-lock+-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "font-lock+" "20170222.1755" "Enhancements to standard library `font-lock.el'." 'nil :url "https://www.emacswiki.org/emacs/download/font-lock%2b.el" :keywords '("languages" "faces" "highlighting"))
.emacs.d/elpa/font-lock+-20170222.1755/font-lock+.el
@@ -1,425 +0,0 @@
-;;; font-lock+.el --- Enhancements to standard library `font-lock.el'.
-;;
-;; Filename: font-lock+.el
-;; Description: Enhancements to standard library `font-lock.el'.
-;; Author: Drew Adams
-;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com")
-;; Copyright (C) 2007-2017, Drew Adams, all rights reserved.
-;; Created: Sun Mar 25 15:21:07 2007
-;; Version: 0
-;; Package-Version: 20170222.1755
-;; Package-Requires: ()
-;; Last-Updated: Wed Feb 22 17:55:28 2017 (-0800)
-;;           By: dradams
-;;     Update #: 216
-;; URL: https://www.emacswiki.org/emacs/download/font-lock%2b.el
-;; Doc URL: http://www.emacswiki.org/HighlightLibrary
-;; Keywords: languages, faces, highlighting
-;; Compatibility: GNU Emacs: 22.x, 23.x, 24.x, 25.x
-;;
-;; Features that might be required by this library:
-;;
-;;   `font-lock', `syntax'.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;;    Enhancements to standard library `font-lock.el'.
-;;
-;;  This library tells font lock to ignore any text that has the text
-;;  property `font-lock-ignore'.  This means, in particular, that font
-;;  lock will not erase or otherwise interfere with highlighting that
-;;  you apply using library `highlight.el'.
-;;
-;;  Load this library after standard library `font-lock.el' (which
-;;  should be preloaded).  Put this in your Emacs init file (~/.emacs):
-;;
-;;    (require 'font-lock+)
-;;
-;;
-;;  Non-interactive functions defined here:
-;;
-;;    `put-text-property-unless-ignore'.
-;;
-;;
-;;  ***** NOTE: The following functions defined in `font-lock.el'
-;;              have been REDEFINED HERE:
-;;
-;;    `font-lock-append-text-property', `font-lock-apply-highlight',
-;;    `font-lock-apply-syntactic-highlight',
-;;    `font-lock-default-unfontify-region',
-;;    `font-lock-fillin-text-property',
-;;    `font-lock-fontify-anchored-keywords',
-;;    `font-lock-fontify-keywords-region',
-;;    `font-lock-fontify-syntactically-region',
-;;    `font-lock-prepend-text-property'.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Change Log:
-;;
-;; 2014/08/30 dadams
-;;     Require cl.el when compile, for incf.
-;;     Load font-lock.el[c] when compile, for macro save-buffer-state.
-;;     font-lock-(prepend|append)-text-property:
-;;       Update for Emacs 24: Canonicalize old forms.
-;;     font-lock-fontify-syntactically-region: Updated for Emacs 24.
-;; 2014/08/28 dadams
-;;     put-text-property-unless-ignore: Use next-single-property-change.
-;; 2007/03/25 dadams
-;;     Created.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; 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 this program; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
-;; Floor, Boston, MA 02110-1301, USA.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Code:
-
-(require 'font-lock)
-
-(eval-when-compile
-  (require 'cl) ;; incf
-  (load-library "font-lock")) ;; Macro save-buffer-state
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defun put-text-property-unless-ignore (start end property value &optional object)
-  "`put-text-property', but ignore text with property `font-lock-ignore'."
-  (let ((here  (min start end))
-        (end1  (max start end))
-        chg)
-    (while (< here end1)
-      (setq chg  (next-single-property-change here 'font-lock-ignore object end1))
-      (unless (get-text-property here 'font-lock-ignore object)
-        (put-text-property here chg property value object))
-      (setq here  chg))))
-
-
-;; REPLACES ORIGINAL in `font-lock.el'.
-;;
-;; Don't unfontify any text that has property `font-lock-ignore'.
-;;
-(defun font-lock-default-unfontify-region (beg end)
-  "Unfontify from BEG to END, except text with property `font-lock-ignore'."
-  (let ((here  (min beg end))
-        (end1  (max beg end))
-        chg)
-    (while (< here end1)
-      (setq chg  (next-single-property-change here 'font-lock-ignore nil end1))
-      (unless (get-text-property here 'font-lock-ignore)
-        (remove-list-of-text-properties
-         here chg (append font-lock-extra-managed-props
-                          (if font-lock-syntactic-keywords
-                              '(syntax-table face font-lock-multiline)
-                            '(face font-lock-multiline)))))
-      (setq here  chg))))
-
-
-;; REPLACES ORIGINAL in `font-lock.el'.
-;;
-;; Use `put-text-property-unless-ignore' instead of `put-text-property'.
-;;
-(defun font-lock-prepend-text-property (start end prop value &optional object)
-  "Prepend to one property of the text from START to END.
-Arguments PROP and VALUE specify the property and value to prepend to the value
-already in place.  The resulting property values are always lists.
-Optional argument OBJECT is the string or buffer containing the text."
-  (let ((val  (if (listp value) value (list value)))
-        next prev)
-    (while (/= start end)
-      (setq next  (next-single-property-change start prop object end)
-            prev  (get-text-property start prop object))
-      ;; Canonicalize old forms of face property.
-      (and (memq prop '(face font-lock-face))  (listp prev)
-	   (or (keywordp (car prev))  (memq (car prev)
-                                            '(foreground-color background-color)))
-	   (setq prev  (list prev)))
-      (put-text-property-unless-ignore start next prop
-                                       (append val (if (listp prev) prev (list prev)))
-                                       object)
-      (setq start  next))))
-
-
-;; REPLACES ORIGINAL in `font-lock.el'.
-;;
-;; Use `put-text-property-unless-ignore' instead of `put-text-property'.
-;;
-(defun font-lock-append-text-property (start end prop value &optional object)
-  "Append to one property of the text from START to END.
-Arguments PROP and VALUE specify the property and value to append to the value
-already in place.  The resulting property values are always lists.
-Optional argument OBJECT is the string or buffer containing the text."
-  (let ((val  (if (listp value) value (list value)))
-        next prev)
-    (while (/= start end)
-      (setq next  (next-single-property-change start prop object end)
-            prev  (get-text-property start prop object))
-      ;; Canonicalize old forms of face property.
-      (and (memq prop '(face font-lock-face))  (listp prev)
-	   (or (keywordp (car prev))  (memq (car prev)
-                                            '(foreground-color background-color)))
-	   (setq prev (list prev)))
-      (put-text-property-unless-ignore start next prop
-                                       (append (if (listp prev) prev (list prev)) val)
-                                       object)
-      (setq start  next))))
-
-
-;; REPLACES ORIGINAL in `font-lock.el'.
-;;
-;; Use `put-text-property-unless-ignore' instead of `put-text-property'.
-;;
-(defun font-lock-fillin-text-property (start end prop value &optional object)
-  "Fill in one property of the text from START to END.
-Arguments PROP and VALUE specify the property and value to put where none are
-already in place.  Therefore existing property values are not overwritten.
-Optional argument OBJECT is the string or buffer containing the text."
-  (let ((start  (text-property-any start end prop nil object))
-        next)
-    (while start
-      (setq next  (next-single-property-change start prop object end))
-      (put-text-property-unless-ignore start next prop value object)
-      (setq start  (text-property-any next end prop nil object)))))
-
-
-;; REPLACES ORIGINAL in `font-lock.el'.
-;;
-;; Use `put-text-property-unless-ignore' instead of `put-text-property'.
-;;
-(defun font-lock-apply-syntactic-highlight (highlight)
-  "Apply HIGHLIGHT following a match.
-HIGHLIGHT should be of the form MATCH-HIGHLIGHT,
-see `font-lock-syntactic-keywords'."
-  (let* ((match     (nth 0 highlight))
-         (start     (match-beginning match)) (end (match-end match))
-         (value     (nth 1 highlight))
-         (override  (nth 2 highlight)))
-    (if (not start)
-        ;; No match but we might not signal an error.
-        (or (nth 3 highlight)
-            (error "No match %d in highlight %S" match highlight))
-      (when (and (consp value)  (not (numberp (car value)))) (setq value  (eval value)))
-      (when (stringp value) (setq value  (string-to-syntax value)))
-      ;; Flush the syntax-cache.  I believe this is not necessary for
-      ;; font-lock's use of syntax-ppss, but I'm not 100% sure and it can
-      ;; still be necessary for other users of syntax-ppss anyway.
-      (syntax-ppss-after-change-function start)
-      (cond
-        ((not override)
-         ;; Cannot override existing fontification.
-         (or (text-property-not-all start end 'syntax-table nil)
-             (put-text-property-unless-ignore start end 'syntax-table value)))
-        ((eq override t)
-         ;; Override existing fontification.
-         (put-text-property-unless-ignore start end 'syntax-table value))
-        ((eq override 'keep)
-         ;; Keep existing fontification.
-         (font-lock-fillin-text-property start end 'syntax-table value))))))
-
-
-;; REPLACES ORIGINAL in `font-lock.el'.
-;;
-;; Use `put-text-property-unless-ignore' instead of `put-text-property'.
-;;
-;; (Parameter PPSS is used by Emacs 22 and 23, but not by Emacs 24.)
-;;
-(defun font-lock-fontify-syntactically-region (start end &optional loudly ppss)
-  "Put proper face on each string and comment between START and END.
-START should be at the beginning of a line."
-  (when (fboundp 'syntax-propertize)    ; Emacs 24+.
-    (syntax-propertize end)) ; Apply any needed syntax-table properties.
-  (let ((comment-end-regexp  (or font-lock-comment-end-skip
-                                 (regexp-quote (replace-regexp-in-string
-                                                "^ *" "" comment-end))))
-        (state               (or ppss  (syntax-ppss start))) ; Find the `start' state.
-        face beg)
-    (when loudly (message "Fontifying %s... (syntactically...)" (buffer-name)))
-    (while (progn ; Find each interesting place between here and `end'.
-             (when (or (nth 3 state)  (nth 4 state))
-               (setq face   (funcall font-lock-syntactic-face-function state)
-                     beg    (max (nth 8 state) start)
-                     state  (parse-partial-sexp (point) end nil nil state
-                                                'syntax-table))
-               (when face (put-text-property-unless-ignore beg (point) 'face face))
-               (when (and (eq face 'font-lock-comment-face)
-                          (or font-lock-comment-start-skip  comment-start-skip))
-                 ;; Find the comment delimiters
-                 ;; and use font-lock-comment-delimiter-face for them.
-                 (save-excursion
-                   (goto-char beg)
-                   (when (looking-at (or font-lock-comment-start-skip
-                                         comment-start-skip))
-                     (put-text-property-unless-ignore
-                      beg (match-end 0) 'face font-lock-comment-delimiter-face)))
-                 (when (looking-back comment-end-regexp (point-at-bol) t)
-                   (put-text-property-unless-ignore (match-beginning 0) (point) 'face
-                                                    font-lock-comment-delimiter-face))))
-             (< (point) end))
-      (setq state  (parse-partial-sexp (point) end nil nil state 'syntax-table)))))
-
-
-;; REPLACES ORIGINAL in `font-lock.el'.
-;;
-;; 1. Use `put-text-property-unless-ignore' instead of `put-text-property'.
-;; 2. Use `defun' instead of `defsubst', since we don't want to reproduce whole library.
-;;
-(defun font-lock-apply-highlight (highlight)
-  "Apply HIGHLIGHT following a match.
-HIGHLIGHT should be of the form MATCH-HIGHLIGHT, see `font-lock-keywords'."
-  (let* ((match     (nth 0 highlight))
-         (start     (match-beginning match)) (end (match-end match))
-         (override  (nth 2 highlight)))
-    (if (not start)
-        ;; No match but we might not signal an error.
-        (or (nth 3 highlight)  (error "No match %d in highlight %S" match highlight))
-      (let ((val  (eval (nth 1 highlight))))
-        (when (eq (car-safe val) 'face)
-          (add-text-properties start end (cddr val))
-          (setq val  (cadr val)))
-        (cond ((not (or val  (eq override t)))
-               ;; If `val' is nil, don't do anything.  It is important to do it
-               ;; explicitly, because when adding nil via things like
-               ;; font-lock-append-text-property, the property is actually
-               ;; changed from <face> to (<face>) which is undesirable.  --Stef
-               nil)
-              ((not override)
-               ;; Cannot override existing fontification.
-               (unless (text-property-not-all start end 'face nil)
-                 (put-text-property-unless-ignore start end 'face val)))
-              ((eq override t)
-               ;; Override existing fontification.
-               (put-text-property-unless-ignore start end 'face val))
-              ((eq override 'prepend)
-               ;; Prepend to existing fontification.
-               (font-lock-prepend-text-property start end 'face val))
-              ((eq override 'append)
-               ;; Append to existing fontification.
-               (font-lock-append-text-property start end 'face val))
-              ((eq override 'keep)
-               ;; Keep existing fontification.
-               (font-lock-fillin-text-property start end 'face val)))))))
-
-
-;; REPLACES ORIGINAL in `font-lock.el'.
-;;
-;; 1. Use `put-text-property-unless-ignore' instead of `put-text-property'.
-;; 2. Use `defun' instead of `defsubst', since we don't want to reproduce whole library.
-;;
-(defun font-lock-fontify-anchored-keywords (keywords limit)
-  "Fontify according to KEYWORDS until LIMIT.
-KEYWORDS should be of the form MATCH-ANCHORED, see `font-lock-keywords',
-LIMIT can be modified by the value of its PRE-MATCH-FORM."
-  (let ((matcher          (nth 0 keywords))
-        (lowdarks         (nthcdr 3 keywords))
-        (lead-start       (match-beginning 0))
-        (pre-match-value  (eval (nth 1 keywords))) ; Evaluate PRE-MATCH-FORM.
-        highlights)
-    ;; Set LIMIT to value of PRE-MATCH-FORM or the end of line.
-    (if (not (and (numberp pre-match-value)  (> pre-match-value (point))))
-        (setq limit  (line-end-position))
-      (setq limit  pre-match-value)
-      (when (and font-lock-multiline  (>= limit (line-beginning-position 2)))
-        ;; this is a multiline anchored match
-        ;; (setq font-lock-multiline  t)
-        (put-text-property-unless-ignore (if (= limit (line-beginning-position 2))
-                                             (1- limit)
-                                           (min lead-start (point)))
-                                         limit
-                                         'font-lock-multiline t)))
-    (save-match-data
-      ;; Find an occurrence of `matcher' before `limit'.
-      (while (and (< (point) limit)  (if (stringp matcher)
-                                         (re-search-forward matcher limit t)
-                                       (funcall matcher limit)))
-        ;; Apply each highlight to this instance of `matcher'.
-        (setq highlights  lowdarks)
-        (while highlights
-          (font-lock-apply-highlight (car highlights))
-          (setq highlights  (cdr highlights)))))
-    ;; Evaluate POST-MATCH-FORM.
-    (eval (nth 2 keywords))))
-
-
-;; REPLACES ORIGINAL in `font-lock.el'.
-;;
-;; Use `put-text-property-unless-ignore' instead of `put-text-property'.
-;;
-(defun font-lock-fontify-keywords-region (start end &optional loudly)
-  "Fontify according to `font-lock-keywords' between START and END.
-START should be at the beginning of a line.
-LOUDLY, if non-nil, allows progress-meter bar."
-  (unless (eq (car font-lock-keywords) t)
-    (setq font-lock-keywords  (font-lock-compile-keywords font-lock-keywords)))
-  (let ((case-fold-search  font-lock-keywords-case-fold-search)
-        (keywords          (cddr font-lock-keywords))
-        (bufname           (buffer-name))
-        (count 0)
-        (pos               (make-marker))
-        keyword matcher highlights)
-    ;;
-    ;; Fontify each item in `font-lock-keywords' from `start' to `end'.
-    (while keywords
-      (when loudly
-        (message "Fontifying %s... (regexps..%s)" bufname (make-string (incf count)
-                                                                       ?.)))
-      ;;
-      ;; Find an occurrence of `matcher' from `start' to `end'.
-      (setq keyword  (car keywords) matcher (car keyword))
-      (goto-char start)
-      (while (and (< (point) end)
-                  (if (stringp matcher)
-                      (re-search-forward matcher end t)
-                    (funcall matcher end))
-                  ;; Beware empty string matches since they will
-                  ;; loop indefinitely.
-                  (or (> (point) (match-beginning 0))  (progn (forward-char 1) t)))
-        (when (and font-lock-multiline
-                   (>= (point) (save-excursion (goto-char (match-beginning 0))
-                                               (forward-line 1) (point))))
-          ;; this is a multiline regexp match
-          ;; (setq font-lock-multiline  t)
-          (put-text-property-unless-ignore (if (= (point)
-                                                  (save-excursion
-                                                    (goto-char (match-beginning 0))
-                                                    (forward-line 1) (point)))
-                                               (1- (point))
-                                             (match-beginning 0))
-                                           (point)
-                                           'font-lock-multiline t))
-        ;; Apply each highlight to this instance of `matcher', which may be
-        ;; specific highlights or more keywords anchored to `matcher'.
-        (setq highlights  (cdr keyword))
-        (while highlights
-          (if (numberp (car (car highlights)))
-              (font-lock-apply-highlight (car highlights))
-            (set-marker pos (point))
-            (font-lock-fontify-anchored-keywords (car highlights) end)
-            ;; Ensure forward progress.  `pos' is a marker because anchored
-            ;; keyword may add/delete text (this happens e.g. in grep.el).
-            (when (< (point) pos) (goto-char pos)))
-          (setq highlights  (cdr highlights))))
-      (setq keywords  (cdr keywords)))
-    (set-marker pos nil)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(provide 'font-lock+)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; font-lock+.el ends here
.emacs.d/elpa/font-lock+-20170222.1755/font-lock+.elc
Binary file
.emacs.d/elpa/general-20170708.104/elpa.el
@@ -1,4 +0,0 @@
-(setq package-user-dir
-      (expand-file-name (format ".cask/%s/elpa" emacs-version)))
-(package-initialize)
-(add-to-list 'load-path default-directory)
.emacs.d/elpa/general-20170708.104/elpa.elc
Binary file
.emacs.d/elpa/general-20170708.104/general-autoloads.el
@@ -1,171 +0,0 @@
-;;; general-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "general" "general.el" (22977 30634 481071
-;;;;;;  188000))
-;;; Generated autoloads from general.el
-
-(autoload 'general-define-key "general" "\
-The primary key definition function provided by general.
-
-PREFIX corresponds to a prefix key and defaults to none. STATES corresponds to
-the evil state(s) to bind the keys in. Non-evil users should not set STATES.
-When STATES is non-nil, `evil-define-key' will be used. Otherwise `define-key'
-will be used. Evil users may also want to leave STATES nil and set KEYMAPS to
-a keymap such as `evil-normal-state-map' for global mappings. KEYMAPS defaults
-to `global-map'. Note that STATES and KEYMAPS can either be a list or a single
-symbol. If any keymap does not exist, the keybindings will be deferred until
-the keymap does exist, so using `eval-after-load' is not necessary with this
-function.
-
-If NON-NORMAL-PREFIX is specified, this prefix will be used for emacs and insert
-state keybindings instead of PREFIX. This argument will only have an effect if
-'insert and/or 'emacs is one of the STATES or if 'evil-insert-state-map and/or
-'evil-emacs-state-map is one of the KEYMAPS. Alternatively, GLOBAL-PREFIX can be
-used with PREFIX and/or NON-NORMAL-PREFIX to bind keys in all states under a
-specified prefix. Like with NON-NORMAL-PREFIX, GLOBAL-PREFIX will prevent PREFIX
-from applying to insert and emacs states. Note that these keywords are only
-useful for evil users.
-
-INFIX can be used to append a string to all of the specified prefixes. This is
-potentially useful when you are using GLOBAL-PREFIX and/or NON-NORMAL-PREFIX so
-that you can sandwich keys in between all the prefixes and the specified keys in
-MAPS. This may be particularly useful if you are using default prefixes in a
-wrapper so that you can add to them without needing to re-specify all of them.
-If none of the other prefix arguments are specified, INFIX will have no effect.
-
-If PREFIX-COMMAND is specified, a prefix keymap/command will be created using
-`define-prefix-command' as long as the symbol specified is not already bound (to
-ensure that an existing prefix keymap is not overwritten if the
-`general-define-key' function is re-evaluated). All prefixes will then be bound
-to PREFIX-COMMAND. PREFIX-MAP and PREFIX-NAME can additionally be specified and
-are used as the last two arguments to `define-prefix-command'.
-
-Unlike with normal key definitions functions, the keymaps in KEYMAPS should be
-quoted (this makes it easy to check if there is only one keymap instead of a
-list of keymaps).
-
-MAPS will be recorded for later use with `general-describe-keybindings'.
-
-\(fn &rest MAPS &key (PREFIX general-default-prefix) (NON-NORMAL-PREFIX general-default-non-normal-prefix) (GLOBAL-PREFIX general-default-global-prefix) INFIX PREFIX-COMMAND PREFIX-MAP PREFIX-NAME (STATES general-default-states) (KEYMAPS general-default-keymaps) PREDICATE PACKAGE MAJOR-MODE &allow-other-keys)" nil nil)
-
-(autoload 'general-create-definer "general" "\
-A helper macro to create key definitions functions.
-This allows the creation of key definition functions that
-will use a certain keymap, evil state, and/or prefix key by default.
-NAME will be the function name and ARGS are the keyword arguments that
-are intended to be the defaults.
-
-\(fn NAME &rest ARGS)" nil t)
-
-(autoload 'general-emacs-define-key "general" "\
-A wrapper for `general-define-key' that is similar to `define-key'.
-It has a positional argument for KEYMAPS. It acts the same as
-`general-define-key', and ARGS can contain keyword arguments in addition to
-keybindings. This can basically act as a drop-in replacement for `define-key',
-and unlike with `general-define-key', if KEYMAPS is a single keymap, it does
-not need to be quoted.
-
-\(fn KEYMAPS &rest ARGS)" nil t)
-
-(function-put 'general-emacs-define-key 'lisp-indent-function '1)
-
-(autoload 'general-evil-define-key "general" "\
-A wrapper for `general-define-key' that is similar to `evil-define-key'.
-It has positional arguments for STATES and KEYMAPS. It acts the same as
-`general-define-key', and ARGS can contain keyword arguments in addition to
-keybindings. This can basically act as a drop-in replacement for
-`evil-define-key', and unlike with `general-define-key', if KEYMAPS is a single
-keymap, it does not need to be quoted.
-
-\(fn STATES KEYMAPS &rest ARGS)" nil t)
-
-(function-put 'general-evil-define-key 'lisp-indent-function '2)
-
-(autoload 'general-describe-keybindings "general" "\
-Show all keys that have been bound with general in an org buffer.
-Any local keybindings will be shown first followed by global keybindings.
-
-\(fn)" t nil)
-
-(autoload 'general-simulate-keys "general" "\
-Create a function to simulate KEYS.
-If EMACS-STATE is non-nil, execute the keys in emacs state. Otherwise simulate
-the keys in the current context (will work without evil). KEYS should be a
-string  given in `kbd' notation. It an also be a list of a single command
-followed by a string of the keys to simulate after calling that command. If
-DOCSTRING is given, it will replace the automatically generated docstring. If
-NAME is given, it will replace the automatically generated function name. NAME
-should not be quoted.
-
-\(fn KEYS &optional EMACS-STATE DOCSTRING NAME)" nil t)
-
-(autoload 'general-key-dispatch "general" "\
-Create a function that will run FALLBACK-COMMAND or a command from MAPS.
-MAPS consists of <key> <command> pairs. If a key in MAPS is matched, the
-corresponding command will be run. Otherwise FALLBACK-COMMAND will be run with
-the unmatched keys. So, for example, if \"ab\" was pressed, and \"ab\" is not
-one of the key sequences from MAPS, the FALLBACK-COMMAND will be run followed by
-the simulated keypresses of \"ab\". Prefix arguments will still work regardless
-of which command is run. This is useful for binding under non-prefix keys. For
-example, this can be used to redefine a sequence like \"cw\" or \"cow\" in evil
-but still have \"c\" work as `evil-change'. If TIMEOUT is specified,
-FALLBACK-COMMAND will also be run in the case that the user does not press the
-next key within the TIMEOUT (e.g. 0.5).
-
-NAME and DOCSTRING are optional keyword arguments. They can be used to replace
-the automatically generated name and docstring for the created function and are
-potentially useful if you want to create multiple, different commands using the
-same FALLBACK-COMMAND (e.g. `self-insert-command').
-
-When INHERIT-KEYMAP is specified, all the keybindings from that keymap will be
-inherited in MAPS.
-
-WHICH-KEY can also be specified, in which case the description WHICH-KEY will
-replace the command name in the which-key popup. Note that this requires a
-version of which-key from after 2016-11-21.
-
-\(fn FALLBACK-COMMAND &rest MAPS &key TIMEOUT INHERIT-KEYMAP NAME DOCSTRING WHICH-KEY &allow-other-keys)" nil t)
-
-(function-put 'general-key-dispatch 'lisp-indent-function '1)
-
-(autoload 'general-create-vim-definer "general" "\
-A helper function to create vim-like wrappers over `general-define-key'.
-The function created will be called NAME and will have the keymaps default to
-KEYMAPS or the states default to STATES. If DEFAULT-TO-STATES is non-nil,
-:states STATES will be used. Otherwise :keymaps KEYMAPS will be used. This can
-be overriden later by setting the global `general-vim-definer-default'
-option.
-
-\(fn NAME KEYMAPS &optional STATES DEFAULT-TO-STATES)" nil t)
-
-(autoload 'general-create-dual-vim-definer "general" "\
-Like `general-create-vim-definer', create a \"vim definer\" called NAME.
-Only the short names in the STATES list need to be specified, but this will only
-work for valid evil states.
-
-\(fn NAME STATES &optional DEFAULT-TO-STATES)" nil t)
-
-(autoload 'general-evil-setup "general" "\
-Set up some basic equivalents for vim mapping functions.
-This creates global key definition functions for the evil states.
-Specifying SHORT-NAMES as non-nil will create non-prefixed function
-aliases such as `nmap' for `general-nmap'.
-
-\(fn &optional SHORT-NAMES DEFAULT-TO-STATES)" nil t)
-
-;;;***
-
-;;;### (autoloads nil nil ("elpa.el" "general-pkg.el") (22977 30634
-;;;;;;  483071 174000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; general-autoloads.el ends here
.emacs.d/elpa/general-20170708.104/general-pkg.el
@@ -1,7 +0,0 @@
-(define-package "general" "20170708.104" "Convenience wrappers for keybindings."
-  '((cl-lib "0.5"))
-  :url "https://github.com/noctuid/general.el" :keywords
-  '("vim" "evil" "leader" "keybindings" "keys"))
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/general-20170708.104/general.el
@@ -1,1088 +0,0 @@
-;;; general.el --- Convenience wrappers for keybindings.
-
-;; Author: Fox Kiester <noct@openmailbox.org>
-;; URL: https://github.com/noctuid/general.el
-;; Created: February 17, 2016
-;; Keywords: vim, evil, leader, keybindings, keys
-;; Package-Requires: ((cl-lib "0.5"))
-;; Version: 0.1
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;; This package provides convenient wrappers for more succinctly defining
-;; keybindings. It allows defining multiple keys at once, specifying an
-;; arbitrary number of named prefix keys to be used in key definitions,
-;; implicitly wrapping key strings with (kbd ...), and more. It provides a
-;; single function for standard emacs key definitions as well as evil key
-;; definitions for any evil state and any keymap. It also provides a setup
-;; function to generate "nmap", "vmap", etc. keybinding functions for evil.
-
-;; For more information see the README in the online repository.
-
-;;; Code:
-(require 'cl-lib)
-
-(defgroup general nil
-  "Gives convenient wrappers for key definitions."
-  :group 'convenience
-  :prefix 'general-)
-
-(defcustom general-implicit-kbd t
-  "Whether to implicitly wrap a (kbd) around keybindings.
-This applies to the prefix key as well."
-  :group 'general
-  :type 'boolean)
-
-(defcustom general-default-prefix nil
-  "The default prefix key sequence to use."
-  :group 'general
-  :type 'string)
-
-(defcustom general-default-non-normal-prefix nil
-  "The default prefix key sequence to use for the 'emacs and 'insert states.
-Note that this setting is only useful for evil-users and will only have an
-effect when binding keys in the 'emacs and/or 'insert states or in the
-'evil-insert-state-map and/or 'evil-emacs-state-map keymaps. When this is not
-specified, `general-default-prefix' will be the default prefix for any states
-and keymaps. If this is specified `general-default-prefix' or the arg to :prefix
-will not be used when binding keys in the insert and emacs states."
-  :group 'general
-  :type 'string)
-
-(defcustom general-default-global-prefix nil
-  "The default prefix key sequence to use for all evil states.
-This setting is only useful for evil users. Note that like with
-`general-default-non-normal-prefix', if this or :global-prefix is specified,
-`general-default-prefix' or the arg to :prefix will not be used for binding
-keys in the insert and emacs states. If you don't need a different or extra
-prefix for one or both state types (insert and emacs vs. the other states),
-just use `general-default-prefix'/:prefix by itself."
-  :group 'general
-  :type 'string)
-
-(define-widget 'general-state 'lazy
-  "General's evil state type."
-  :type '(choice
-          (const :tag "Normal state" normal)
-          (const :tag "Insert state" insert)
-          (const :tag "Visual state" visual)
-          (const :tag "Replace state" replace)
-          (const :tag "Operator state" operator)
-          (const :tag "Motion state" motion)
-          (const :tag "Emacs state" emacs)
-          (const :tag "Use define-key not evil-define-key" nil)))
-
-(defcustom general-default-states nil
-  "The default evil state(s) to make mappings in.
-Non-evil users should keep this nil."
-  :group 'general
-  :type '(choice general-state
-                 (set general-state)))
-
-(define-widget 'general-keymap 'lazy
-  "General's keymap type."
-  :type '(choice
-          (const :tag "Global keymap" global)
-          (const :tag "Buffer local keymap" local)
-          symbol))
-
-(defcustom general-default-keymaps 'global
-  "The default keymap(s) to bind keys in."
-  :group 'general
-  :type '(choice general-keymap
-                 (repeat general-keymap)))
-
-(defcustom general-vim-definer-default nil
-  "Whether set the states or keymaps in a `general-create-vim-definer' function.
-If nil, use the default from when the function was created. If 'keymaps, set the
-default keymaps. If 'states, set the default states."
-  :group 'general
-  :type '(choice
-          (const :tag "Default to setting :keymaps" keymaps)
-          (const :tag "Default to setting :states" states)
-          (const :tag "Use the initial default" nil)))
-
-(defvar general-keybindings nil
-  "Holds all the keybindings created with `general-define-key' (and wrappers).
-This is an alist of a keymap to an alist of a state to keybindings.")
-
-(defvar general-local-keybindings nil
-  "Holds all the local keybindings created with `general-define-key'.
-This is an alist of a state to keybindings.")
-(make-variable-buffer-local 'general-local-keybindings)
-
-;;; Helpers
-(defun general--concat (nokbd &rest keys)
-  "Concatenate the strings in KEYS.
-If `general-implicit-kbd' is non-nil, interleave the strings in KEYS with
-spaces; unless NOKBD is non-nil, apply (kbd ...) to the result. If
-`general-implicit-kbd' is nil, just concatenate the keys."
-  (setq keys (remove nil keys))
-  (if general-implicit-kbd
-      (let ((keys (mapconcat #'identity keys " ")))
-        (if nokbd
-            keys
-          (kbd keys)))
-    (apply #'concat keys)))
-
-(defun general--apply-prefix-and-kbd (prefix maps)
-  "Prepend the PREFIX sequence to all the keys that are strings in MAPS.
-Also apply (kbd ...) to key and definition strings if `general-implicit-kbd' is
-non-nil."
-  (setq prefix (or prefix ""))
-  (cl-loop for (key def) on maps by 'cddr
-           collect (if (stringp key)
-                       (general--concat nil prefix key)
-                     ;; don't touch vectors
-                     key)
-           and collect def))
-
-;; http://endlessparentheses.com/define-context-aware-keys-in-emacs.html
-(defun general--maybe-apply-predicate (predicate def)
-  "Apply PREDICATE to DEF.
-If PREDICATE is nil just return DEF."
-  (if predicate
-      `(menu-item
-        "" nil
-        :filter (lambda (&optional _)
-                  (when ,predicate
-                    ',def)))
-    def))
-
-(defun general--remove-keys (maps keys)
-  "Return a list of MAPS with the mappings for KEYS removed."
-  (cl-loop for (key def) on maps by 'cddr
-           unless (member key keys)
-           collect key
-           and collect def))
-
-(defun general--record-keybindings (keymap state maps)
-  "For KEYMAP and STATE, add MAPS to `general-keybindings'.
-If KEYMAP is \"local\", add MAPS to `general-local-keybindings.' For non-evil
-keybindings, STATE will be nil. Duplicate keys will be replaced with the new
-ones."
-  (let ((keys (cl-loop for (key def) on maps by 'cddr
-                       collect key)))
-    (cond ((eq keymap 'local)
-           (unless (assq state general-local-keybindings)
-             (add-to-list 'general-local-keybindings (list state)))
-           (let ((state-cons (assq state general-local-keybindings)))
-             (setcdr state-cons
-                     (append
-                      ;; remove old duplicate keys
-                      (general--remove-keys (cdr state-cons) keys)
-                      maps))))
-          (t
-           (unless (assq keymap general-keybindings)
-             (add-to-list 'general-keybindings (list keymap)))
-           (unless (assq state (assq keymap general-keybindings))
-             (setcdr (assq keymap general-keybindings)
-                     (append (cdr (assq keymap general-keybindings))
-                             (list (list state)))))
-           (let ((state-cons (assq state (assq keymap general-keybindings))))
-             (setcdr state-cons
-                     (append (general--remove-keys (cdr state-cons) keys)
-                             maps)))))))
-
-;; don't force non-evil user to require evil for one function (this is evil-delay)
-(defun general--delay (condition form hook &optional append local name)
-  "Execute FORM when CONDITION becomes true, checking with HOOK.
-NAME specifies the name of the entry added to HOOK. If APPEND is
-non-nil, the entry is appended to the hook. If LOCAL is non-nil,
-the buffer-local value of HOOK is modified."
-  (declare (indent 2))
-  (if (and (not (booleanp condition)) (eval condition))
-      (eval form)
-    (let* ((name (or name (format "general-delay-form-in-%s" hook)))
-           (fun (make-symbol name))
-           (condition (or condition t)))
-      (fset fun `(lambda (&rest args)
-                   (when ,condition
-                     (remove-hook ',hook #',fun ',local)
-                     ,form)))
-      (put fun 'permanent-local-hook t)
-      (add-hook hook fun append local))))
-
-(defun general--evil-keymap-for-state (state &optional text-object)
-  "Return a symbol corresponding to the global evil keymap for STATE.
-If TEXT-OBJECT is non-nil, STATE should be 'inner or 'outer and a symbol for the
-corresponding global evil text object keymap will be returned."
-  (intern (concat "evil-" (symbol-name state)
-                  (if text-object
-                      "-text-objects-map"
-                    "-state-map"))))
-
-;;; Extended Key Definition Language
-(defvar general-extended-def-keywords '(:which-key)
-  "Extra keywords that are valid in an extended definition.")
-
-(defun general-extended-def-:which-key (_state _keymap key def kargs)
-  "Add a which-key description for KEY.
-If :major-mode is specified in DEF, add the description for that major mode. KEY
-should not be in the kbd format (kbd should have already been run on it)."
-  (eval-after-load 'which-key
-    `(let ((doc (cl-getf ',def :which-key))
-           (major-mode (or (cl-getf ',def :major-mode)
-                           (cl-getf ',kargs :major-mode)))
-           (key (key-description ',key)))
-       (if major-mode
-           (which-key-add-major-mode-key-based-replacements major-mode
-             key doc)
-         (which-key-add-key-based-replacements key doc)))))
-
-(defun general--maybe-autoload-keymap (state keymap def kargs)
-  "Return either a keymap or a function that serves as an \"autoloaded\" keymap.
-A created function will bind the keys it was invoked with in STATE and KEYMAP to
-the keymap specified in DEF with :keymap and then act as if it was originally
-bound to that keymap (subsequent keys will be looked up in the keymap). KARGS or
-DEF should contain the package in which the keymap is created (as specified
-with :package). If the keymap already exists, it will simply be returned."
-  (let ((bind-to-keymap (cl-getf def :keymap))
-        (package (or (cl-getf def :package)
-                     (cl-getf kargs :package))))
-    (if (boundp bind-to-keymap)
-        (symbol-value bind-to-keymap)
-      (unless package
-        (error "In order to \"autoload\" a keymap, :package must be specified"))
-      `(lambda ()
-         (interactive)
-         (unless (or (featurep ',package)
-                     (require ',package nil t))
-           (error (concat "Failed to load package: " (symbol-name ',package))))
-         (unless (and (boundp ',bind-to-keymap)
-                      (keymapp (symbol-value ',bind-to-keymap)))
-           (error (format "A keymap called %s is not defined in the %s package"
-                          ',bind-to-keymap ',package)))
-         (let ((keys (this-command-keys))
-               (general-implicit-kbd nil))
-           (general-define-key :states ',state
-                               :keymaps ',keymap
-             keys ,bind-to-keymap)
-           (setq prefix-arg current-prefix-arg
-                 unread-command-events
-                 (mapcar (lambda (ev) (cons t ev))
-                         (listify-key-sequence keys))))))))
-
-(defun general--parse-def (state keymap key def kargs)
-  "Rewrite DEF into a valid definition.
-This function will execute the actions specified in an extended definition and
-apply a predicate if there is one."
-  (cond ((and (listp def)
-              (not (keymapp def))
-              ;; lambda
-              (not (functionp def))
-              (not (eq (car def) 'menu-item)))
-         (unless (keywordp (car def))
-           (setq def (cons :command def)))
-         (dolist (keyword general-extended-def-keywords)
-           (when (cl-getf def keyword)
-             (funcall (intern (concat "general-extended-def-"
-                                      (symbol-name keyword)))
-                      state keymap key def kargs)))
-         (cond ((cl-getf def :ignore)
-                ;; just for side effects (e.g. which-key description for prefix)
-                ;; return something that isn't a valid definition
-                :ignore)
-               ((cl-getf def :keymap)
-                ;; bind or autoload
-                (general--maybe-autoload-keymap state keymap def kargs))
-               (t
-                (general--maybe-apply-predicate (or (cl-getf def :predicate)
-                                                    (cl-getf kargs :predicate))
-                                                (cl-getf def :command)))))
-        (t
-         ;; not and extended definition
-         (general--maybe-apply-predicate (cl-getf kargs :predicate) def))))
-
-(defun general--parse-maps (state keymap maps kargs)
-  "Rewrite MAPS so that the definitions are bindable.
-This includes possibly parsing extended definitions or applying a prefix."
-  (cl-loop for (key def) on maps by 'cddr
-           do (setq def (general--parse-def state keymap key def kargs))
-           unless (eq def :ignore)
-           collect key
-           and collect (if (and general-implicit-kbd
-                                (stringp def))
-                           (kbd def)
-                         def)))
-
-;;; define-key and evil-define-key Wrappers
-;; TODO better way to do this?
-;; https://www.reddit.com/r/emacs/comments/1582uo/bufferlocalsetkey_set_a_key_in_one_buffer_only/
-(defvar general--blm nil)
-
-(defun general--generate-keymap-name (sym)
-  "Generate a map name from SYM."
-  (symbol-value (intern (concat (symbol-name sym) "-map"))))
-
-(defun general--emacs-local-set-key (key func)
-  "Bind KEY to FUNC for the current buffer only using a minor mode."
-  (if general--blm
-      (define-key (general--generate-keymap-name general--blm) key func)
-    (let* ((mode-name-loc (cl-gensym "general-blm")))
-      (eval `(define-minor-mode ,mode-name-loc nil nil nil (make-sparse-keymap)))
-      (setq-local general--blm mode-name-loc)
-      (funcall mode-name-loc 1)
-      (define-key (general--generate-keymap-name general--blm) key func))))
-
-;; this works but will make it so that keys defined for the major mode will no longer affect
-;; (use-local-map (copy-keymap (current-local-map)))
-;; (local-set-key (kbd "C-c y") 'helm-apropos)
-
-(defun general--emacs-define-key (keymap &rest maps)
-  "Wrapper for `define-key' and general's `general--emacs-local-set-key'.
-KEYMAP determines which keymap the MAPS will be defined in. When KEYMAP is
-is 'local, the MAPS will be bound only in the current buffer. MAPS is any
-number of paired keys and commands"
-  (declare (indent 1))
-  (while (not (cl-endp maps))
-    (if (eq keymap 'local)
-        (general--emacs-local-set-key (pop maps) (pop maps))
-      (define-key keymap (pop maps) (pop maps)))))
-
-(defun general--evil-define-key (state keymap &rest maps)
-  "A wrapper for `evil-define-key' and `evil-local-set-key'.
-STATE is the evil state to bind the keys in. `evil-local-set-key' is used when
-KEYMAP is 'local. MAPS is any number of keys and commands to bind."
-  (declare (indent defun))
-  (eval-after-load 'evil
-    `(let ((maps ',maps)
-           (keymap ',keymap)
-           (state ',state))
-       (while maps
-         (if (eq keymap 'local)
-             ;; has no &rest
-             (evil-local-set-key state (pop maps) (pop maps))
-           (evil-define-key* state keymap (pop maps) (pop maps)))))))
-
-(defun general--define-key
-    (states keymap maps non-normal-maps global-maps kargs)
-  "A helper function for `general-define-key'.
-Choose based on STATES and KEYMAP which of MAPS, NON-NORMAL-MAPS, and
-GLOBAL-MAPS to use for the keybindings. This function will rewrite extended
-definitions, add predicates when applicable, and then choose the base function
-to bind the keys with (depending on whether STATES is non-nil)."
-  (cl-macrolet ((defkeys (maps)
-                  `(let ((maps (general--parse-maps state keymap ,maps kargs))
-                         (keymap keymap))
-                     (general--record-keybindings keymap state maps)
-                     (setq keymap (cond ((eq keymap 'local)
-                                         'local)
-                                        ((eq keymap 'global)
-                                         (current-global-map))
-                                        (t
-                                         (symbol-value keymap))))
-                     (if state
-                         (apply #'general--evil-define-key state keymap maps)
-                       (apply #'general--emacs-define-key keymap maps))))
-                (def-pick-maps (non-normal-p)
-                  `(progn
-                     (cond ((and non-normal-maps ,non-normal-p)
-                            (defkeys non-normal-maps))
-                           ((and global-maps ,non-normal-p))
-                           (t
-                            (defkeys maps)))
-                     (defkeys global-maps))))
-    (if states
-        (dolist (state states)
-          (def-pick-maps (memq state '(insert emacs))))
-      (let (state)
-        (def-pick-maps (memq keymap '(evil-insert-state-map
-                                      evil-emacs-state-map)))))))
-
-;;; Functions With Keyword Arguments
-;;;###autoload
-(cl-defun general-define-key
-    (&rest maps &key
-           (prefix general-default-prefix)
-           (non-normal-prefix general-default-non-normal-prefix)
-           (global-prefix general-default-global-prefix)
-           infix
-           prefix-command
-           prefix-map
-           prefix-name
-           (states general-default-states)
-           (keymaps general-default-keymaps)
-           predicate
-           ;; for extended definitions only
-           package
-           major-mode
-           &allow-other-keys)
-  "The primary key definition function provided by general.
-
-PREFIX corresponds to a prefix key and defaults to none. STATES corresponds to
-the evil state(s) to bind the keys in. Non-evil users should not set STATES.
-When STATES is non-nil, `evil-define-key' will be used. Otherwise `define-key'
-will be used. Evil users may also want to leave STATES nil and set KEYMAPS to
-a keymap such as `evil-normal-state-map' for global mappings. KEYMAPS defaults
-to `global-map'. Note that STATES and KEYMAPS can either be a list or a single
-symbol. If any keymap does not exist, the keybindings will be deferred until
-the keymap does exist, so using `eval-after-load' is not necessary with this
-function.
-
-If NON-NORMAL-PREFIX is specified, this prefix will be used for emacs and insert
-state keybindings instead of PREFIX. This argument will only have an effect if
-'insert and/or 'emacs is one of the STATES or if 'evil-insert-state-map and/or
-'evil-emacs-state-map is one of the KEYMAPS. Alternatively, GLOBAL-PREFIX can be
-used with PREFIX and/or NON-NORMAL-PREFIX to bind keys in all states under a
-specified prefix. Like with NON-NORMAL-PREFIX, GLOBAL-PREFIX will prevent PREFIX
-from applying to insert and emacs states. Note that these keywords are only
-useful for evil users.
-
-INFIX can be used to append a string to all of the specified prefixes. This is
-potentially useful when you are using GLOBAL-PREFIX and/or NON-NORMAL-PREFIX so
-that you can sandwich keys in between all the prefixes and the specified keys in
-MAPS. This may be particularly useful if you are using default prefixes in a
-wrapper so that you can add to them without needing to re-specify all of them.
-If none of the other prefix arguments are specified, INFIX will have no effect.
-
-If PREFIX-COMMAND is specified, a prefix keymap/command will be created using
-`define-prefix-command' as long as the symbol specified is not already bound (to
-ensure that an existing prefix keymap is not overwritten if the
-`general-define-key' function is re-evaluated). All prefixes will then be bound
-to PREFIX-COMMAND. PREFIX-MAP and PREFIX-NAME can additionally be specified and
-are used as the last two arguments to `define-prefix-command'.
-
-Unlike with normal key definitions functions, the keymaps in KEYMAPS should be
-quoted (this makes it easy to check if there is only one keymap instead of a
-list of keymaps).
-
-MAPS will be recorded for later use with `general-describe-keybindings'."
-  (let (non-normal-prefix-maps
-        global-prefix-maps
-        kargs)
-    ;; remove keyword arguments from rest var
-    (setq maps
-          (cl-loop for (key value) on maps by 'cddr
-                   if (keywordp key)
-                   do (progn (push key kargs)
-                             (push value kargs))
-                   else
-                   collect key
-                   and collect value))
-    ;; order matters for duplicates
-    (setq kargs (nreverse kargs))
-    ;; don't force the user to wrap a single state or keymap in a list
-    ;; luckily nil is a list
-    (unless (listp states)
-      (setq states (list states)))
-    (unless (listp keymaps)
-      (setq keymaps (list keymaps)))
-    (when (and prefix-command
-               (not (boundp prefix-command)))
-      (define-prefix-command prefix-command prefix-map prefix-name))
-    ;; TODO reduce code reduction here
-    (when non-normal-prefix
-      (setq non-normal-prefix-maps
-            (general--apply-prefix-and-kbd
-             (general--concat t non-normal-prefix infix) maps))
-      (when prefix-command
-        (push prefix-command non-normal-prefix-maps)
-        (push (if general-implicit-kbd
-                  (kbd non-normal-prefix)
-                non-normal-prefix)
-              non-normal-prefix-maps)))
-    (when global-prefix
-      (setq global-prefix-maps
-            (general--apply-prefix-and-kbd
-             (general--concat t global-prefix infix) maps))
-      (when prefix-command
-        (push prefix-command global-prefix-maps)
-        (push (if general-implicit-kbd
-                  (kbd global-prefix)
-                global-prefix)
-              global-prefix-maps)))
-    ;; last so not applying prefix twice
-    (setq maps (general--apply-prefix-and-kbd
-                (general--concat t prefix infix) maps))
-    (when prefix-command
-      (push prefix-command maps)
-      (push (if general-implicit-kbd
-                (kbd prefix)
-              prefix)
-            maps))
-    (dolist (keymap keymaps)
-      (when (memq keymap '(insert emacs normal visual operator motion replace))
-        (setq keymap (general--evil-keymap-for-state keymap)))
-      (when (memq keymap '(inner outer))
-        (setq keymap (general--evil-keymap-for-state keymap t)))
-      (general--delay `(or (memq ',keymap '(local global))
-                           (and (boundp ',keymap)
-                                (keymapp ,keymap)))
-          `(general--define-key ',states
-                                ',keymap
-                                ',maps
-                                ',non-normal-prefix-maps
-                                ',global-prefix-maps
-                                ',kargs)
-        'after-load-functions t nil
-        (format "general-define-key-in-%s" keymap)))))
-
-;;;###autoload
-(defmacro general-create-definer (name &rest args)
-  "A helper macro to create key definitions functions.
-This allows the creation of key definition functions that
-will use a certain keymap, evil state, and/or prefix key by default.
-NAME will be the function name and ARGS are the keyword arguments that
-are intended to be the defaults."
-  `(defun ,name (&rest args)
-     ;; can still override keywords afterwards
-     (apply #'general-define-key (append args (list ,@args)))))
-
-;;;###autoload
-(defmacro general-emacs-define-key (keymaps &rest args)
-  "A wrapper for `general-define-key' that is similar to `define-key'.
-It has a positional argument for KEYMAPS. It acts the same as
-`general-define-key', and ARGS can contain keyword arguments in addition to
-keybindings. This can basically act as a drop-in replacement for `define-key',
-and unlike with `general-define-key', if KEYMAPS is a single keymap, it does
-not need to be quoted."
-  (declare (indent 1))
-  `(general-define-key ,@args
-                       :keymaps (if (symbolp ',keymaps)
-                                    ',keymaps
-                                  ,keymaps)))
-
-;;;###autoload
-(defmacro general-evil-define-key (states keymaps &rest args)
-  "A wrapper for `general-define-key' that is similar to `evil-define-key'.
-It has positional arguments for STATES and KEYMAPS. It acts the same as
-`general-define-key', and ARGS can contain keyword arguments in addition to
-keybindings. This can basically act as a drop-in replacement for
-`evil-define-key', and unlike with `general-define-key', if KEYMAPS is a single
-keymap, it does not need to be quoted."
-  (declare (indent 2))
-  `(general-define-key ,@args
-                       :states ,states
-                       :keymaps (if (symbolp ',keymaps)
-                                    ',keymaps
-                                  ,keymaps)))
-;;; Displaying Keybindings
-(defun general--print-keybind-table (maps)
-  "Print an org table for MAPS."
-  (princ "|key|command|\n|-+-|\n")
-  (cl-loop for (key command) on maps by 'cddr
-           do (princ (format "|=%s=|~%s~|\n" (key-description key) command)))
-  (princ "\n"))
-
-(defun general--print-state-heading (state-cons)
-  "Print a table and possibly a heading for STATE-CONS."
-  (let ((state (car state-cons))
-        (maps (cdr state-cons)))
-    (unless (null state)
-      (princ (capitalize (concat "** " (symbol-name state) " State\n"))))
-    (general--print-keybind-table maps)))
-
-(defun general--print-keymap-heading (keymap-cons)
-  "Print headings and tables for KEYMAP-CONS."
-  (let ((keymap (car keymap-cons))
-        (state-conses (cdr keymap-cons)))
-    (princ (capitalize (concat "* " (symbol-name keymap) " Keybindings\n")))
-    (let ((no-evil-state-cons (assq nil state-conses)))
-      ;; non-evil keybindings go first
-      (when no-evil-state-cons
-        (general--print-state-heading no-evil-state-cons)
-        (setq state-conses (assq-delete-all nil state-conses)))
-      (dolist (state-cons state-conses)
-        (general--print-state-heading state-cons)))))
-
-;;;###autoload
-(defun general-describe-keybindings ()
-  "Show all keys that have been bound with general in an org buffer.
-Any local keybindings will be shown first followed by global keybindings."
-  (interactive)
-  (with-output-to-temp-buffer "*General Keybindings*"
-    (let* ((keybindings (copy-alist general-keybindings))
-           (global-keybinds (assq 'global keybindings))
-           (global-evil-keymaps
-            '(evil-insert-state-map
-              evil-emacs-state-map
-              evil-normal-state-map
-              evil-visual-state-map
-              evil-motion-state-map
-              evil-operators-state-map
-              evil-outer-text-objects-map
-              evil-inner-text-objects-map
-              evil-replace-state-map
-              evil-ex-search-keymap
-              evil-ex-completion-map
-              evil-command-window-mode-map
-              evil-window-map))
-           (global-evil-keybinds
-            (cl-loop for keymap-cons in keybindings
-                     when (memq (car keymap-cons) global-evil-keymaps)
-                     append (list keymap-cons)))
-           (local-keybindings (copy-alist general-local-keybindings)))
-      (when local-keybindings
-        (general--print-keymap-heading (cons 'local local-keybindings)))
-      (when global-keybinds
-        (general--print-keymap-heading global-keybinds)
-        (setq keybindings (assq-delete-all 'global keybindings)))
-      (when global-evil-keybinds
-        (dolist (keymap-cons global-evil-keybinds)
-          (general--print-keymap-heading keymap-cons)
-          (setq keybindings (assq-delete-all (car keymap-cons) keybindings))))
-      (dolist (keymap-cons keybindings)
-        (general--print-keymap-heading keymap-cons))))
-  (with-current-buffer "*General Keybindings*"
-    (let ((org-startup-folded 'showall))
-      (org-mode))
-    (read-only-mode -1)
-    (while (progn
-             (while (progn
-                      (forward-line)
-                      (org-at-heading-p)))
-             (org-table-align)
-             (outline-next-heading)))
-    (goto-char (point-min))
-    (read-only-mode)))
-
-;;; Functions/Macros to Aid Key Definition
-;; https://emacs.stackexchange.com/questions/6037/emacs-bind-key-to-prefix/13432#13432
-;; altered to allow execution in a emacs state
-;; and to create a named function with a docstring
-;; also properly handles more edge cases like correctly adding evil repeat info
-
-(defvar general--last-simulate nil)
-
-;;;###autoload
-(defmacro general-simulate-keys (keys &optional emacs-state docstring name)
-  "Create a function to simulate KEYS.
-If EMACS-STATE is non-nil, execute the keys in emacs state. Otherwise simulate
-the keys in the current context (will work without evil). KEYS should be a
-string  given in `kbd' notation. It an also be a list of a single command
-followed by a string of the keys to simulate after calling that command. If
-DOCSTRING is given, it will replace the automatically generated docstring. If
-NAME is given, it will replace the automatically generated function name. NAME
-should not be quoted."
-  (let* ((command (when (listp keys)
-                    (car keys)))
-         (keys (if (listp keys)
-                   (cadr keys)
-                 keys))
-         (name (or name
-                   (intern (concat
-                            (format "general-simulate-%s"
-                                    (if command
-                                        (eval command)
-                                      ""))
-                            (when command
-                              "-")
-                            (replace-regexp-in-string " " "_" keys)
-                            (when emacs-state
-                              "-in-emacs-state"))))))
-    `(progn
-       (eval-after-load 'evil
-         '(evil-set-command-property #',name :repeat 'general--simulate-repeat))
-       (defun ,name
-           ()
-         ,(or docstring
-              (concat "Simulate '" keys "' in " (if emacs-state
-                                                    "emacs state."
-                                                  "the current context.")))
-         (interactive)
-         (when ,emacs-state
-           ;; so don't have to redefine evil-stop-execute-in-emacs-state
-           (setq this-command #'evil-execute-in-emacs-state)
-           (let ((evil-no-display t))
-             (evil-execute-in-emacs-state)))
-         (let ((command ,command)
-               (invoked-keys (this-command-keys))
-               (keys (kbd ,keys)))
-           (setq prefix-arg current-prefix-arg)
-           (setq unread-command-events
-                 (mapcar (lambda (ev) (cons t ev))
-                         (listify-key-sequence keys)))
-           (when command
-             (let ((this-command command))
-               (call-interactively command)))
-           (setq general--last-simulate `(:command ,(or command ',name)
-                                          :invoked-keys ,invoked-keys
-                                          :keys ,keys)))))))
-
-(defun general--repeat-abort-p (repeat-prop)
-  "Return t if repeat recording should be aborted based on REPEAT-PROP."
-  (or (memq repeat-prop (list nil 'abort 'ignore))
-      (and (eq repeat-prop 'motion)
-           (not (memq evil-state '(insert replace))))))
-
-(defun general--simulate-repeat (flag)
-  "Modified version of `evil-repeat-keystrokes'.
-It ensures that no simulated keys are recorded. Only the keys used to invoke the
-general-simulate-... command are recorded. This function also ensures that the
-repeat is aborted when it should be."
-  (when (eq flag 'post)
-    ;; remove simulated keys
-    (setq evil-repeat-info (butlast evil-repeat-info))
-    (let* ((command (cl-getf general--last-simulate :command))
-           (repeat-prop (evil-get-command-property command :repeat t))
-           (record-keys (cl-getf general--last-simulate :invoked-keys)))
-      (if (and command
-               (general--repeat-abort-p repeat-prop))
-          (evil-repeat-abort)
-        (evil-repeat-record record-keys)
-        (evil-clear-command-keys)))))
-
-(defvar general--last-dispatch nil)
-
-;;;###autoload
-(cl-defmacro general-key-dispatch
-    (fallback-command &rest maps
-                      &key timeout inherit-keymap name docstring
-                      which-key
-                      &allow-other-keys)
-  "Create a function that will run FALLBACK-COMMAND or a command from MAPS.
-MAPS consists of <key> <command> pairs. If a key in MAPS is matched, the
-corresponding command will be run. Otherwise FALLBACK-COMMAND will be run with
-the unmatched keys. So, for example, if \"ab\" was pressed, and \"ab\" is not
-one of the key sequences from MAPS, the FALLBACK-COMMAND will be run followed by
-the simulated keypresses of \"ab\". Prefix arguments will still work regardless
-of which command is run. This is useful for binding under non-prefix keys. For
-example, this can be used to redefine a sequence like \"cw\" or \"cow\" in evil
-but still have \"c\" work as `evil-change'. If TIMEOUT is specified,
-FALLBACK-COMMAND will also be run in the case that the user does not press the
-next key within the TIMEOUT (e.g. 0.5).
-
-NAME and DOCSTRING are optional keyword arguments. They can be used to replace
-the automatically generated name and docstring for the created function and are
-potentially useful if you want to create multiple, different commands using the
-same FALLBACK-COMMAND (e.g. `self-insert-command').
-
-When INHERIT-KEYMAP is specified, all the keybindings from that keymap will be
-inherited in MAPS.
-
-WHICH-KEY can also be specified, in which case the description WHICH-KEY will
-replace the command name in the which-key popup. Note that this requires a
-version of which-key from after 2016-11-21."
-  (declare (indent 1))
-  (let ((name (or name (intern (format "general-dispatch-%s"
-                                       (eval fallback-command)))))
-        ;; remove keyword arguments from maps
-        (maps (cl-loop for (key value) on maps by 'cddr
-                       unless (keywordp key)
-                       collect key
-                       and collect value)))
-    `(progn
-       (eval-after-load 'evil
-         '(evil-set-command-property #',name :repeat 'general--dispatch-repeat))
-       (when ,which-key
-         (eval-after-load 'which-key
-           (lambda ()
-             (when (boundp 'which-key-replacement-alist)
-               (push '((nil . ,(symbol-name name))
-                       nil . ,which-key)
-                     which-key-replacement-alist)))))
-       ;; TODO list all of the bound keys in the docstring
-       (defun ,name ()
-         ,(or docstring (format (concat "Run %s or something else based"
-                                        "on the next keypresses.")
-                                (eval fallback-command)))
-         (interactive)
-         (let ((map (make-sparse-keymap))
-               (invoked-keys (this-command-keys))
-               (timeout ,timeout)
-               (inherit-keymap ,inherit-keymap)
-               matched-command
-               fallback
-               char
-               timed-out-p)
-           (when inherit-keymap
-             (set-keymap-parent map inherit-keymap))
-           (if general-implicit-kbd
-               (general--emacs-define-key map
-                 ,@(general--apply-prefix-and-kbd nil maps))
-             (general--emacs-define-key map ,@maps))
-           (while (progn
-                    (if timeout
-                        (with-timeout (timeout (setq timed-out-p t))
-                          (setq char (concat char (char-to-string (read-char)))))
-                      (setq char (concat char (char-to-string (read-char)))))
-                    (and (not timed-out-p)
-                         (keymapp (lookup-key map char)))))
-           (setq prefix-arg current-prefix-arg)
-           (cond
-            ((and (not timed-out-p)
-                  (setq matched-command (lookup-key map char)))
-             ;; necessary for evil-this-operator checks because
-             ;; evil-define-operator sets evil-this-operator to this-command
-             (let ((this-command matched-command))
-               (call-interactively matched-command)))
-            (t
-             (setq fallback t
-                   matched-command ,fallback-command)
-             ;; have to do this in "reverse" order (call command 2nd)
-             (setq unread-command-events (listify-key-sequence char))
-             (let ((this-command ,fallback-command))
-               (call-interactively ,fallback-command))))
-           (setq general--last-dispatch `(:command ,matched-command
-                                          :invoked-keys ,invoked-keys
-                                          :keys ,char
-                                          :fallback ,fallback)))))))
-
-(defvar general--repeat-info nil
-  "Used for debugging repeat behavior for `general-key-dispatch'.")
-
-(defun general--dispatch-repeat (flag)
-  "Modified version of `evil-repeat-keystrokes'.
-It will remove extra keys that would be added in a general-dispatch-... command
-with the default `evil-repeat-keystrokes' and ensures that the repeat is
-aborted when it should be."
-  (cond
-   ((eq flag 'pre)
-    (when evil-this-register
-      (evil-repeat-record
-       `(set evil-this-register ,evil-this-register))))
-   ((eq flag 'post)
-    (let* ((command (cl-getf general--last-dispatch :command))
-           (repeat-prop (evil-get-command-property command :repeat t))
-           (fallback (cl-getf general--last-dispatch :fallback))
-           (invoked-keys (cl-getf general--last-dispatch :invoked-keys))
-           (keys (cl-getf general--last-dispatch :keys))
-           (old-repeat-info (cl-copy-list evil-repeat-info))
-           (reversed-repeat-info (reverse evil-repeat-info))
-           count
-           next-repeat-item)
-      (while (and (stringp (setq next-repeat-item (car reversed-repeat-info)))
-                  (string-match "^[0-9]+$" next-repeat-item))
-        ;; need to rely on evil-repeat-info to get counts
-        ;; evil counts will appear as last items, e.g. ("c3" "3" "3")
-        ;; this will work even if the user binds digits in the dispatch command
-        ;; as long as the key to invoke the dispatch command is not also a digit
-        ;; (the 3 in "c3" is the only duplicate)
-        (push (pop reversed-repeat-info) count))
-      (setq evil-repeat-info (if (= (length count) 0)
-                                 (butlast evil-repeat-info)
-                               (nreverse (cdr reversed-repeat-info))))
-      ;; for debugging purposes only
-      (setq general--repeat-info
-            (list :invoked-keys invoked-keys :keys keys
-                  :this-command-keys (this-command-keys)
-                  :old-evil-repeat-info old-repeat-info
-                  :evil-repeat-info (cl-copy-list evil-repeat-info)
-                  :count count))
-      (if (general--repeat-abort-p repeat-prop)
-          (evil-repeat-abort)
-        (evil-repeat-record
-         (cond
-          (fallback
-           (concat invoked-keys (apply #'concat count) (this-command-keys)))
-          (t
-           (concat invoked-keys
-                   keys
-                   (unless (or (string= (concat invoked-keys keys)
-                                        (this-command-keys))
-                               (eq (evil-get-command-property command :repeat)
-                                   'general--simulate-repeat))
-                     ;; (this-command-keys) will contain the text object if the
-                     ;; matched command is an operator
-                     (concat count (this-command-keys)))))))
-        (evil-clear-command-keys))))))
-
-(cl-defmacro general-predicate-dispatch
-    (fallback-def &rest defs
-                  &key docstring
-                  &allow-other-keys)
-  (declare (indent 1))
-  "Create a menu item that will run FALLBACK-DEF or a definition from DEFS.
-DEFS consists of <predicate> <definition> pairs. Binding this menu-item to a key
-will cause that key to act as the corresponding definition (a command, keymap,
-etc) for the first matched predicate. If no predicate is matched FALLBACK-DEF
-will be run. When FALLBACK-DEF is nil and no predicates are matched, the keymap
-with the next highest precedence for the pressed key will be checked. DOCSTRING
-can be specified as a description for the menu item."
-  ;; remove keyword arguments from defs
-  (let ((defs (cl-loop for (key value) on defs by 'cddr
-                       unless (keywordp key)
-                       collect (list key value))))
-    `'(menu-item
-       ,(or docstring "") nil
-       :filter (lambda (&optional _)
-                 (cond ,@(mapcar (lambda (pred-def)
-                                   `(,(car pred-def) ,(cadr pred-def)))
-                                 defs)
-                       (t ,fallback-def))))))
-
-;;; Optional Setup
-;;;###autoload
-(defmacro general-create-vim-definer
-    (name keymaps &optional states default-to-states)
-  "A helper function to create vim-like wrappers over `general-define-key'.
-The function created will be called NAME and will have the keymaps default to
-KEYMAPS or the states default to STATES. If DEFAULT-TO-STATES is non-nil,
-:states STATES will be used. Otherwise :keymaps KEYMAPS will be used. This can
-be overriden later by setting the global `general-vim-definer-default'
-option."
-  `(defun ,name (&rest args)
-     ,(format "A wrapper function over `general-define-key'.
-
-It has one the following defaults depending on `general-vim-definer-default':
-:keymaps
-%s
-
-:states
-%s
-
-When `general-vim-definer-default' is nil, default to setting %s.
-(If the default :states is nil, :keymaps will be used no matter what.)"
-              keymaps states
-              (if default-to-states
-                  ":states"
-                ":keymaps"))
-     ;; can still override keywords afterwards
-     (let ((default-to-states
-             (cond ((eq general-vim-definer-default 'states)
-                    t)
-                   ((eq general-vim-definer-default 'keymaps)
-                    nil)
-                   (t
-                    ,default-to-states))))
-       (apply #'general-define-key
-              (append args (if (and default-to-states ,states)
-                               (list :states ,states)
-                             (list :keymaps ,keymaps)))))))
-
-;;;###autoload
-(defmacro general-create-dual-vim-definer
-    (name states &optional default-to-states)
-  "Like `general-create-vim-definer', create a \"vim definer\" called NAME.
-Only the short names in the STATES list need to be specified, but this will only
-work for valid evil states."
-  `(general-create-vim-definer
-    ,name
-    ;; could alternatively just do ,states (difference is the docstring)
-    ',(let ((states (eval states)))
-        (if (listp states)
-            (mapcar #'general--evil-keymap-for-state states)
-          (general--evil-keymap-for-state states)))
-    ,states
-    ,default-to-states))
-
-;;;###autoload
-(defmacro general-evil-setup (&optional short-names default-to-states)
-  "Set up some basic equivalents for vim mapping functions.
-This creates global key definition functions for the evil states.
-Specifying SHORT-NAMES as non-nil will create non-prefixed function
-aliases such as `nmap' for `general-nmap'."
-  `(progn
-     (general-create-dual-vim-definer general-imap 'insert ,default-to-states)
-     (general-create-dual-vim-definer general-emap 'emacs ,default-to-states)
-     (general-create-dual-vim-definer general-nmap 'normal ,default-to-states)
-     (general-create-dual-vim-definer general-vmap 'visual ,default-to-states)
-     (general-create-dual-vim-definer general-omap 'operator ,default-to-states)
-     (general-create-dual-vim-definer general-mmap 'motion ,default-to-states)
-     (general-create-dual-vim-definer general-rmap 'replace ,default-to-states)
-     ;; these two don't have corresponding states
-     (general-create-vim-definer general-otomap 'evil-outer-text-objects-map)
-     (general-create-vim-definer general-itomap 'evil-inner-text-objects-map)
-     (general-create-dual-vim-definer general-iemap
-                                      '(insert emacs)
-                                      ,default-to-states)
-     (general-create-dual-vim-definer general-nvmap
-                                      '(normal visual)
-                                      ,default-to-states)
-     (general-create-vim-definer general-tomap
-                                 '(evil-outer-text-objects-map
-                                   evil-inner-text-objects-map))
-     (when ,short-names
-       (defalias 'imap #'general-imap)
-       (defalias 'emap #'general-emap)
-       (defalias 'nmap #'general-nmap)
-       (defalias 'vmap #'general-vmap)
-       (defalias 'omap #'general-omap)
-       (defalias 'mmap #'general-mmap)
-       (defalias 'rmap #'general-rmap)
-       (defalias 'otomap #'general-otomap)
-       (defalias 'itomap #'general-itomap)
-       (defalias 'iemap #'general-iemap)
-       (defalias 'nvmap #'general-nvmap)
-       (defalias 'tomap #'general-tomap))))
-
-;;; Use-package Integration
-(eval-after-load 'use-package
-  (lambda ()
-    (setq use-package-keywords
-          ;; should go in the same location as :bind
-          ;; adding to end may not cause problems, but see issue #22
-          (cl-loop for item in use-package-keywords
-                   if (eq item :bind-keymap*)
-                   collect :bind-keymap* and collect :general
-                   else
-                   ;; don't add duplicates
-                   unless (eq item :general)
-                   collect item))
-    (defun use-package-normalize/:general (_name _keyword args)
-      args)
-    (defun use-package-handler/:general (name _keyword arglists rest state)
-      (let* ((sanitized-arglist
-              ;; combine arglists into one without function names or
-              ;; positional arguments
-              (let (result
-                    first)
-                (dolist (arglist arglists result)
-                  (setq first (car arglist))
-                  (cond ((eq first 'general-evil-define-key)
-                         (setq arglist (cl-cdddr arglist)))
-                        ((eq first 'general-emacs-define-key)
-                         (setq arglist (cddr arglist)))
-                        ((cl-oddp (length arglist))
-                         ;; normal wrapper
-                         (setq arglist (cdr arglist))))
-                  (setq result (append result arglist)))))
-             (commands
-              (cl-loop for (key def) on sanitized-arglist by 'cddr
-                       when (and (not (keywordp key))
-                                 (not (null def))
-                                 (ignore-errors
-                                   (setq def (eval def))
-                                   (or (symbolp def)
-                                       (when (and (symbolp (car def))
-                                                  (not (keywordp (car def)))
-                                                  (not (memq
-                                                        (car def)
-                                                        '(menu-item lambda)))
-                                                  (not (keymapp def)))
-                                         (setq def (car def)))
-                                       (setq def (cl-getf def :command)))))
-                       collect def)))
-        (use-package-concat
-         (use-package-process-keywords name
-           (use-package-sort-keywords
-            (use-package-plist-maybe-put rest :defer t))
-           (use-package-plist-append state :commands commands))
-         `((ignore ,@(mapcar (lambda (arglist)
-                               (let ((first (car arglist)))
-                                 (if (or (eq first 'general-emacs-define-key)
-                                         (eq first 'general-evil-define-key)
-                                         (cl-oddp (length arglist)))
-                                     `(,@arglist :package ',name)
-                                   `(general-define-key ,@arglist
-                                                        :package ',name))))
-                             arglists))))))))
-
-;;; Key-chord "Integration"
-(defun general-chord (keys)
-  "Rewrite the string KEYS into a valid key-chord vector."
-  ;; taken straight from key-chord.el
-  (if (/= 2 (length keys))
-      (error "Key-chord keys must have two elements"))
-  ;; Exotic chars in a string are >255 but define-key wants 128..255 for those
-  (let ((key1 (logand 255 (aref keys 0)))
-        (key2 (logand 255 (aref keys 1))))
-    (vector 'key-chord key1 key2)))
-
-(provide 'general)
-;;; general.el ends here
.emacs.d/elpa/general-20170708.104/general.elc
Binary file
.emacs.d/elpa/git-annex-20170417.1653/git-annex-autoloads.el
@@ -1,15 +0,0 @@
-;;; git-annex-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil nil ("git-annex.el") (22985 22858 482324 383000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; git-annex-autoloads.el ends here
.emacs.d/elpa/git-annex-20170417.1653/git-annex-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "git-annex" "20170417.1653" "Mode for easy editing of git-annex'd files" 'nil :commit "22b7161adcd144f88681b9b904972cea42b27fca" :url "https://github.com/jwiegley/git-annex-el" :keywords '("files" "data" "git" "annex"))
.emacs.d/elpa/git-annex-20170417.1653/git-annex.el
@@ -1,189 +0,0 @@
-;;; git-annex.el --- Mode for easy editing of git-annex'd files
-
-;; Copyright (C) 2012 John Wiegley
-
-;; Author: John Wiegley <jwiegley@gmail.com>
-;; Created: 20 Oct 2012
-;; Version: 1.1
-;; Package-Version: 20170417.1653
-;; Keywords: files data git annex
-;; X-URL: https://github.com/jwiegley/git-annex-el
-
-;; 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:
-
-;; Typing C-x C-q in an annexed file buffer causes Emacs to run "git annex
-;; edit".  When the buffer is killed Emacs will run "git annex add && git
-;; commit -m Updated".
-;;
-;; Dired has been extended to not show Annex symlinks, but instead to color
-;; annexed files green (and preserve the "l" in the file modes).  You have the
-;; following commands available in dired-mode on all marked files (or the
-;; current file):
-;;
-;;     @ a    Add file to Git annex
-;;     @ e    Edit an annexed file
-
-;;; Code:
-
-(eval-when-compile
-  (require 'dired nil t)	      ; for variable dired-mode-map
-  (require 'dired-aux nil t)	      ; for function dired-relist-file
-  (require 'cl))
-
-(defgroup git-annex nil
-  "Mode for easy editing of git-annex'd files"
-  :group 'files)
-
-(defcustom git-annex-commit t
-  "If not nil, git-annex command will commit by default.
-
-otherwise you will have to commit by hand."
-  :type 'boolean)
-
-(defsubst git-annex (&rest args)
-  (apply #'call-process "git" nil nil nil "annex" args))
-
-(defun git-annex-add-file ()
-  (git-annex "add" (file-relative-name buffer-file-name default-directory))
-  (when git-annex-commit
-    (call-process "git" nil nil nil "commit" "-m" "Updated")))
-
-(defun git-annex--toggle-unlock ()
-  (when (string=
-		 (vc-backend buffer-file-name)
-		 "Git"
-		 )
-	  (when (and buffer-file-name buffer-read-only
-				 (file-symlink-p buffer-file-name))
-		(let ((target (nth 0 (file-attributes buffer-file-name))))
-		  (assert (stringp target))
-		  (when (string-match "\\.git/annex/" target)
-			(call-process "git" nil nil nil "annex" "edit"
-						  (file-relative-name buffer-file-name default-directory))
-			(let ((here (point-marker)))
-			  (unwind-protect
-				  (revert-buffer nil t t)
-				(goto-char here)))
-			(add-hook 'kill-buffer-hook 'git-annex-add-file nil t)
-			(setq buffer-read-only t))))
-	(when (and buffer-file-name (not buffer-read-only)
-			   (not (file-symlink-p buffer-file-name)))
-	  (let ((cur (current-buffer))
-			(name buffer-file-name)
-			(result))
-		(with-temp-buffer
-		  (call-process "git" nil t nil "diff-files" "--diff-filter=T" "-G^[./]*\\.git/annex/objects/" "--name-only" "--" (file-relative-name name default-directory))
-		  (setq result (buffer-string)))
-		(unless (string= result "")
-		  (git-annex-add-file)
-		  (let ((here (point-marker)))
-			(unwind-protect
-				(revert-buffer nil t t)
-			  (goto-char here)))
-		(setq buffer-read-only nil)))))
-  )
-
-(defadvice toggle-read-only (before git-annex-edit-file activate)
-  (git-annex--toggle-unlock))
-
-(defadvice read-only-mode (before git-annex-edit-file activate)
-  (git-annex--toggle-unlock))
-
-(defface git-annex-dired-annexed-available
-  '((((class color) (background dark))
-     (:foreground "dark green"))
-    (((class color) (background light))
-     (:foreground "dark green")))
-  "Face used to highlight git-annex'd files."
-  :group 'git-annex)
-
-(defface git-annex-dired-annexed-unavailable
-  '((((class color) (background dark))
-     (:foreground "firebrick"))
-    (((class color) (background light))
-     (:foreground "firebrick")))
-  "Face used to highlight git-annex'd files."
-  :group 'git-annex)
-
-(defvar git-annex-dired-annexed-available 'git-annex-dired-annexed-available
-  "Face name used to highlight available git-annex'd files.")
-(defvar git-annex-dired-annexed-unavailable 'git-annex-dired-annexed-unavailable
-  "Face name used to highlight unavailable git-annex'd files.")
-(defvar git-annex-dired-annexed-invisible
-  '(face git-annex-dired-annexed-available invisible t)
-  "Face name used to hide a git-annex'd file's annex path.")
-
-(defun git-annex-lookup-file (limit)
-  (and (re-search-forward " -> \\(.*\\.git/annex/.+\\)" limit t)
-       (file-exists-p
-        (expand-file-name (match-string 1) (dired-current-directory)))))
-
-(eval-after-load "dired"
-  '(progn
-     (add-to-list 'dired-font-lock-keywords
-                  (list " -> .*\\.git/annex/"
-                        '("\\(.+\\)\\( -> .+\\)" (dired-move-to-filename) nil
-                          (1 git-annex-dired-annexed-unavailable)
-                          (2 git-annex-dired-annexed-invisible))))
-     (add-to-list 'dired-font-lock-keywords
-                  (list 'git-annex-lookup-file
-                        '("\\(.+\\)\\( -> .+\\)" (dired-move-to-filename) nil
-                          (1 git-annex-dired-annexed-available)
-                          (2 git-annex-dired-annexed-invisible))))))
-
-(defvar git-annex-dired-map
-  (let ((map (make-keymap)))
-    (define-key map "a" 'git-annex-dired-add-files)
-    (define-key map "d" 'git-annex-dired-drop-files)
-    (define-key map "e" 'git-annex-dired-edit-files)
-    (define-key map "g" 'git-annex-dired-get-files)
-    map)
-  "Git-annex keymap for `dired-mode' buffers.")
-
-(add-hook 'dired-mode-hook
-          (lambda () (define-key dired-mode-map "@" git-annex-dired-map)))
-
-(defun git-annex-dired--apply (command file-list)
-  (let ((here (point)))
-    (unwind-protect
-        (mapc #'(lambda (file)
-                  (git-annex command file)
-                  (dired-relist-file (expand-file-name file)))
-              file-list)
-      (goto-char here))))
-
-(defmacro git-annex-dired-do-to-files (cmd msg &optional commit-after)
-  `(defun ,(intern (concat "git-annex-dired-" cmd "-files"))
-     (file-list &optional arg)
-     (interactive
-      (let ((files (dired-get-marked-files t current-prefix-arg)))
-        (list files current-prefix-arg)))
-     (git-annex-dired--apply ,cmd file-list)
-     (let ((msg (format ,msg (length file-list))))
-       ,(if commit-after
-            `(when git-annex-commit (call-process "git" nil nil nil "commit" "-m" msg)))
-       (message msg))))
-
-(git-annex-dired-do-to-files "add" "Annex: updated %d file(s)" t)
-(git-annex-dired-do-to-files "drop" "Annex: dropped %d file(s)")
-(git-annex-dired-do-to-files "edit" "Annex: unlocked %d file(s) for editing")
-(git-annex-dired-do-to-files "get" "Annex: got %d file(s)")
-
-(provide 'git-annex)
-
-;;; git-annex.el ends here
.emacs.d/elpa/git-annex-20170417.1653/git-annex.elc
Binary file
.emacs.d/elpa/git-commit-20170914.258/git-commit-autoloads.el
@@ -1,43 +0,0 @@
-;;; git-commit-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "git-commit" "git-commit.el" (22985 22838 193510
-;;;;;;  852000))
-;;; Generated autoloads from git-commit.el
-
-(defvar global-git-commit-mode t "\
-Non-nil if Global Git-Commit mode is enabled.
-See the `global-git-commit-mode' command
-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-git-commit-mode'.")
-
-(custom-autoload 'global-git-commit-mode "git-commit" nil)
-
-(autoload 'global-git-commit-mode "git-commit" "\
-Edit Git commit messages.
-This global mode arranges for `git-commit-setup' to be called
-when a Git commit message file is opened.  That usually happens
-when Git uses the Emacsclient as $GIT_EDITOR to have the user
-provide such a commit message.
-
-\(fn &optional ARG)" t nil)
-
-(defconst git-commit-filename-regexp "/\\(\\(\\(COMMIT\\|NOTES\\|PULLREQ\\|TAG\\)_EDIT\\|MERGE_\\|\\)MSG\\|\\(BRANCH\\|EDIT\\)_DESCRIPTION\\)\\'")
-
-(autoload 'git-commit-setup "git-commit" "\
-
-
-\(fn)" nil nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; git-commit-autoloads.el ends here
.emacs.d/elpa/git-commit-20170914.258/git-commit-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "git-commit" "20170914.258" "Edit Git commit messages" '((emacs "24.4") (dash "20170810") (with-editor "20170817")) :commit "746f2361ba5e0299f05a7878e530da2c7c8f749b" :url "https://github.com/magit/magit" :keywords '("git" "tools" "vc"))
.emacs.d/elpa/git-commit-20170914.258/git-commit.el
@@ -1,754 +0,0 @@
-;;; git-commit.el --- Edit Git commit messages  -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Authors: Jonas Bernoulli <jonas@bernoul.li>
-;;	Sebastian Wiesner <lunaryorn@gmail.com>
-;;	Florian Ragwitz <rafl@debian.org>
-;;	Marius Vollmer <marius.vollmer@gmail.com>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Package-Requires: ((emacs "24.4") (dash "20170810") (with-editor "20170817"))
-;; Package-Version: 20170914.258
-;; Keywords: git tools vc
-;; Homepage: https://github.com/magit/magit
-
-;; This file is not part of GNU Emacs.
-
-;; 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 3, 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 this file.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package assists the user in writing good Git commit messages.
-
-;; While Git allows for the message to be provided on the command
-;; line, it is preferable to tell Git to create the commit without
-;; actually passing it a message.  Git then invokes the `$GIT_EDITOR'
-;; (or if that is undefined `$EDITOR') asking the user to provide the
-;; message by editing the file ".git/COMMIT_EDITMSG" (or another file
-;; in that directory, e.g. ".git/MERGE_MSG" for merge commits).
-
-;; When `global-git-commit-mode' is enabled, which it is by default,
-;; then opening such a file causes the features described below, to
-;; be enabled in that buffer.  Normally this would be done using a
-;; major-mode but to allow the use of any major-mode, as the user sees
-;; fit, it is done here by running a setup function, which among other
-;; things turns on the preferred major-mode, by default `text-mode'.
-
-;; Git waits for the `$EDITOR' to finish and then either creates the
-;; commit using the contents of the file as commit message, or, if the
-;; editor process exited with a non-zero exit status, aborts without
-;; creating a commit.  Unfortunately Emacsclient (which is what Emacs
-;; users should be using as `$EDITOR' or at least as `$GIT_EDITOR')
-;; does not differentiate between "successfully" editing a file and
-;; aborting; not out of the box that is.
-
-;; By making use of the `with-editor' package this package provides
-;; both ways of finish an editing session.  In either case the file
-;; is saved, but Emacseditor's exit code differs.
-;;
-;;   C-c C-c  Finish the editing session successfully by returning
-;;            with exit code 0.  Git then creates the commit using
-;;            the message it finds in the file.
-;;
-;;   C-c C-k  Aborts the edit editing session by returning with exit
-;;            code 1.  Git then aborts the commit.
-
-;; Aborting the commit does not cause the message to be lost, but
-;; relying solely on the file not being tampered with is risky.  This
-;; package additionally stores all aborted messages for the duration
-;; of the current session (i.e. until you close Emacs).  To get back
-;; an aborted message use M-p and M-n while editing a message.
-;;
-;;   M-p      Replace the buffer contents with the previous message
-;;            from the message ring.  Of course only after storing
-;;            the current content there too.
-;;
-;;   M-n      Replace the buffer contents with the next message from
-;;            the message ring, after storing the current content.
-
-;; Some support for pseudo headers as used in some projects is
-;; provided by these commands:
-;;
-;;   C-c C-s  Insert a Signed-off-by header.
-;;   C-c C-a  Insert a Acked-by header.
-;;   C-c C-m  Insert a Modified-by header.
-;;   C-c C-t  Insert a Tested-by header.
-;;   C-c C-r  Insert a Reviewed-by header.
-;;   C-c C-o  Insert a Cc header.
-;;   C-c C-p  Insert a Reported-by header.
-;;   C-c M-s  Insert a Suggested-by header.
-
-;; When Git requests a commit message from the user, it does so by
-;; having her edit a file which initially contains some comments,
-;; instructing her what to do, and providing useful information, such
-;; as which files were modified.  These comments, even when left
-;; intact by the user, do not become part of the commit message.  This
-;; package ensures these comments are propertizes as such and further
-;; prettifies them by using different faces for various parts, such as
-;; files.
-
-;; Finally this package highlights style errors, like lines that are
-;; too long, or when the second line is not empty.  It may even nag
-;; you when you attempt to finish the commit without having fixed
-;; these issues.  The style checks and many other settings can easily
-;; be configured:
-;;
-;;   M-x customize-group RET git-commit RET
-
-;;; Code:
-;;;; Dependencies
-
-(require 'dash)
-(require 'log-edit)
-(require 'magit-utils nil t)
-(require 'ring)
-(require 'server)
-(require 'with-editor)
-
-(eval-when-compile (require 'recentf))
-
-;;;; Declarations
-
-(defvar flyspell-generic-check-word-predicate)
-(defvar font-lock-beg)
-(defvar font-lock-end)
-
-(declare-function magit-expand-git-file-name 'magit-git)
-
-;;; Options
-;;;; Variables
-
-(defgroup git-commit nil
-  "Edit Git commit messages."
-  :prefix "git-commit-"
-  :link '(info-link "(magit)Editing Commit Messages")
-  :group 'tools)
-
-;;;###autoload
-(define-minor-mode global-git-commit-mode
-  "Edit Git commit messages.
-This global mode arranges for `git-commit-setup' to be called
-when a Git commit message file is opened.  That usually happens
-when Git uses the Emacsclient as $GIT_EDITOR to have the user
-provide such a commit message."
-  :group 'git-commit
-  :type 'boolean
-  :global t
-  :init-value t
-  :initialize (lambda (symbol exp)
-                (custom-initialize-default symbol exp)
-                (when global-git-commit-mode
-                  (add-hook 'find-file-hook 'git-commit-setup-check-buffer)))
-  (if global-git-commit-mode
-      (add-hook  'find-file-hook 'git-commit-setup-check-buffer)
-    (remove-hook 'find-file-hook 'git-commit-setup-check-buffer)))
-
-(defcustom git-commit-major-mode 'text-mode
-  "Major mode used to edit Git commit messages.
-The major mode configured here is turned on by the minor mode
-`git-commit-mode'."
-  :group 'git-commit
-  :type '(choice (function-item text-mode)
-                 (const :tag "No major mode")))
-
-(defcustom git-commit-setup-hook
-  '(git-commit-save-message
-    git-commit-setup-changelog-support
-    git-commit-turn-on-auto-fill
-    git-commit-propertize-diff
-    with-editor-usage-message)
-  "Hook run at the end of `git-commit-setup'."
-  :group 'git-commit
-  :type 'hook
-  :get (and (featurep 'magit-utils) 'magit-hook-custom-get)
-  :options '(git-commit-save-message
-             git-commit-setup-changelog-support
-             git-commit-turn-on-auto-fill
-             git-commit-turn-on-flyspell
-             git-commit-propertize-diff
-             bug-reference-mode
-             with-editor-usage-message))
-
-(defcustom git-commit-finish-query-functions
-  '(git-commit-check-style-conventions)
-  "List of functions called to query before performing commit.
-
-The commit message buffer is current while the functions are
-called.  If any of them returns nil, then the commit is not
-performed and the buffer is not killed.  The user should then
-fix the issue and try again.
-
-The functions are called with one argument.  If it is non-nil,
-then that indicates that the user used a prefix argument to
-force finishing the session despite issues.  Functions should
-usually honor this wish and return non-nil."
-  :options '(git-commit-check-style-conventions)
-  :type 'hook
-  :group 'git-commit)
-
-(defcustom git-commit-style-convention-checks '(non-empty-second-line)
-  "List of checks performed by `git-commit-check-style-conventions'.
-Valid members are `non-empty-second-line' and `overlong-summary-line'.
-That function is a member of `git-commit-finish-query-functions'."
-  :options '(non-empty-second-line overlong-summary-line)
-  :type '(list :convert-widget custom-hook-convert-widget)
-  :group 'git-commit)
-
-(defcustom git-commit-summary-max-length 68
-  "Column beyond which characters in the summary lines are highlighted.
-
-The highlighting indicates that the summary is getting too long
-by some standards.  It does in no way imply that going over the
-limit a few characters or in some cases even many characters is
-anything that deserves shaming.  It's just a friendly reminder
-that if you can make the summary shorter, then you might want
-to consider doing so."
-  :group 'git-commit
-  :safe 'numberp
-  :type 'number)
-
-(defcustom git-commit-fill-column nil
-  "Override `fill-column' in commit message buffers.
-
-If this is non-nil, then it should be an integer.  If that is the
-case and the buffer-local value of `fill-column' is not already
-set by the time `git-commit-turn-on-auto-fill' is called as a
-member of `git-commit-setup-hook', then that function sets the
-buffer-local value of `fill-column' to the value of this option.
-
-This option exists mostly for historic reasons.  If you are not
-already using it, then you probably shouldn't start doing so."
-  :group 'git-commit
-  :safe 'numberp
-  :type '(choice (const :tag "use regular fill-column")
-                 number))
-
-(make-obsolete-variable 'git-commit-fill-column 'fill-column
-                        "Magit 2.11.0" 'set)
-
-(defcustom git-commit-known-pseudo-headers
-  '("Signed-off-by" "Acked-by" "Modified-by" "Cc"
-    "Suggested-by" "Reported-by" "Tested-by" "Reviewed-by")
-  "A list of Git pseudo headers to be highlighted."
-  :group 'git-commit
-  :safe (lambda (val) (and (listp val) (-all-p 'stringp val)))
-  :type '(repeat string))
-
-;;;; Faces
-
-(defgroup git-commit-faces nil
-  "Faces used for highlighting Git commit messages."
-  :prefix "git-commit-"
-  :group 'git-commit
-  :group 'faces)
-
-(defface git-commit-summary
-  '((t :inherit font-lock-type-face))
-  "Face used for the summary in commit messages."
-  :group 'git-commit-faces)
-
-(defface git-commit-overlong-summary
-  '((t :inherit font-lock-warning-face))
-  "Face used for the tail of overlong commit message summaries."
-  :group 'git-commit-faces)
-
-(defface git-commit-nonempty-second-line
-  '((t :inherit font-lock-warning-face))
-  "Face used for non-whitespace on the second line of commit messages."
-  :group 'git-commit-faces)
-
-(defface git-commit-note
-  '((t :inherit font-lock-string-face))
-  "Face used for notes in commit messages."
-  :group 'git-commit-faces)
-
-(defface git-commit-pseudo-header
-  '((t :inherit font-lock-string-face))
-  "Font used for pseudo headers in commit messages."
-  :group 'git-commit-faces)
-
-(defface git-commit-known-pseudo-header
-  '((t :inherit font-lock-keyword-face))
-  "Face used for the keywords of known pseudo headers in commit messages."
-  :group 'git-commit-faces)
-
-(defface git-commit-comment-branch
-  '((t :inherit font-lock-variable-name-face))
-  "Face used for branch names in commit message comments."
-  :group 'git-commit-faces)
-
-(defface git-commit-comment-detached
-  '((t :inherit git-commit-comment-branch))
-  "Face used for detached `HEAD' in commit message comments."
-  :group 'git-commit-faces)
-
-(defface git-commit-comment-heading
-  '((t :inherit git-commit-known-pseudo-header))
-  "Face used for headings in commit message comments."
-  :group 'git-commit-faces)
-
-(defface git-commit-comment-file
-  '((t :inherit git-commit-pseudo-header))
-  "Face used for file names in commit message comments."
-  :group 'git-commit-faces)
-
-(defface git-commit-comment-action
-  '((t :inherit git-commit-comment-branch))
-  "Face used for actions in commit message comments."
-  :group 'git-commit-faces)
-
-;;; Keymap
-
-(defvar git-commit-mode-map
-  (let ((map (make-sparse-keymap)))
-    (cond ((featurep 'jkl)
-           (define-key map (kbd "M-i") 'git-commit-prev-message)
-           (define-key map (kbd "M-k") 'git-commit-next-message))
-          (t
-           (define-key map (kbd "M-p") 'git-commit-prev-message)
-           (define-key map (kbd "M-n") 'git-commit-next-message)
-           ;; Old bindings to avoid confusion
-           (define-key map (kbd "C-c C-x a") 'git-commit-ack)
-           (define-key map (kbd "C-c C-x i") 'git-commit-suggested)
-           (define-key map (kbd "C-c C-x m") 'git-commit-modified)
-           (define-key map (kbd "C-c C-x o") 'git-commit-cc)
-           (define-key map (kbd "C-c C-x p") 'git-commit-reported)
-           (define-key map (kbd "C-c C-x r") 'git-commit-review)
-           (define-key map (kbd "C-c C-x s") 'git-commit-signoff)
-           (define-key map (kbd "C-c C-x t") 'git-commit-test)))
-    (define-key map (kbd "C-c C-a") 'git-commit-ack)
-    (define-key map (kbd "C-c C-i") 'git-commit-suggested)
-    (define-key map (kbd "C-c C-m") 'git-commit-modified)
-    (define-key map (kbd "C-c C-o") 'git-commit-cc)
-    (define-key map (kbd "C-c C-p") 'git-commit-reported)
-    (define-key map (kbd "C-c C-r") 'git-commit-review)
-    (define-key map (kbd "C-c C-s") 'git-commit-signoff)
-    (define-key map (kbd "C-c C-t") 'git-commit-test)
-    (define-key map (kbd "C-c M-s") 'git-commit-save-message)
-    map)
-  "Key map used by `git-commit-mode'.")
-
-;;; Menu
-
-(require 'easymenu)
-(easy-menu-define git-commit-mode-menu git-commit-mode-map
-  "Git Commit Mode Menu"
-  '("Commit"
-    ["Previous" git-commit-prev-message t]
-    ["Next" git-commit-next-message t]
-    "-"
-    ["Ack" git-commit-ack :active t
-     :help "Insert an 'Acked-by' header"]
-    ["Sign-Off" git-commit-signoff :active t
-     :help "Insert a 'Signed-off-by' header"]
-    ["Modified-by" git-commit-modified :active t
-     :help "Insert a 'Modified-by' header"]
-    ["Tested-by" git-commit-test :active t
-     :help "Insert a 'Tested-by' header"]
-    ["Reviewed-by" git-commit-review :active t
-     :help "Insert a 'Reviewed-by' header"]
-    ["CC" git-commit-cc t
-     :help "Insert a 'Cc' header"]
-    ["Reported" git-commit-reported :active t
-     :help "Insert a 'Reported-by' header"]
-    ["Suggested" git-commit-suggested t
-     :help "Insert a 'Suggested-by' header"]
-    "-"
-    ["Save" git-commit-save-message t]
-    ["Cancel" with-editor-cancel t]
-    ["Commit" with-editor-finish t]))
-
-;;; Hooks
-
-;;;###autoload
-(defconst git-commit-filename-regexp "/\\(\
-\\(\\(COMMIT\\|NOTES\\|PULLREQ\\|TAG\\)_EDIT\\|MERGE_\\|\\)MSG\
-\\|\\(BRANCH\\|EDIT\\)_DESCRIPTION\\)\\'")
-
-(eval-after-load 'recentf
-  '(add-to-list 'recentf-exclude git-commit-filename-regexp))
-
-(add-to-list 'with-editor-file-name-history-exclude git-commit-filename-regexp)
-
-(defun git-commit-setup-font-lock-in-buffer ()
-  (and buffer-file-name
-       (string-match-p git-commit-filename-regexp buffer-file-name)
-       (git-commit-setup-font-lock)))
-
-(add-hook 'after-change-major-mode-hook 'git-commit-setup-font-lock-in-buffer)
-
-(defun git-commit-setup-check-buffer ()
-  (and buffer-file-name
-       (string-match-p git-commit-filename-regexp buffer-file-name)
-       (git-commit-setup)))
-
-;;;###autoload
-(defun git-commit-setup ()
-  ;; cygwin git will pass a cygwin path (/cygdrive/c/foo/.git/...),
-  ;; try to handle this in window-nt Emacs.
-  (--when-let
-      (and (eq system-type 'windows-nt)
-           (not (file-accessible-directory-p default-directory))
-           (if (require 'magit-git nil t)
-               ;; Emacs prepends a "c:".
-               (magit-expand-git-file-name (substring buffer-file-name 2))
-             ;; Fallback if we can't load `magit-git'.
-             (and (string-match "\\`[a-z]:/\\(cygdrive/\\)?\\([a-z]\\)/\\(.*\\)"
-                                buffer-file-name)
-                  (concat (match-string 2 buffer-file-name) ":/"
-                          (match-string 3 buffer-file-name)))))
-    (when (file-accessible-directory-p (file-name-directory it))
-      (find-alternate-file it)))
-  (when git-commit-major-mode
-    (let ((auto-mode-alist (list (cons (concat "\\`"
-                                               (regexp-quote buffer-file-name)
-                                               "\\'")
-                                       git-commit-major-mode))))
-      (normal-mode t)))
-  (setq with-editor-show-usage nil)
-  (with-editor-mode 1)
-  (add-hook 'with-editor-finish-query-functions
-            'git-commit-finish-query-functions nil t)
-  (add-hook 'with-editor-pre-finish-hook
-            'git-commit-save-message nil t)
-  (add-hook 'with-editor-pre-cancel-hook
-            'git-commit-save-message nil t)
-  (setq with-editor-cancel-message
-        'git-commit-cancel-message)
-  (make-local-variable 'log-edit-comment-ring-index)
-  (git-commit-mode 1)
-  (git-commit-setup-font-lock)
-  (when (boundp 'save-place)
-    (setq save-place nil))
-  (save-excursion
-    (goto-char (point-min))
-    (when (looking-at "\\`\\(\\'\\|\n[^\n]\\)")
-      (open-line 1)))
-  (run-hooks 'git-commit-setup-hook)
-  (set-buffer-modified-p nil))
-
-(defun git-commit-setup-font-lock ()
-  (let ((table (make-syntax-table (syntax-table))))
-    (when comment-start
-      (modify-syntax-entry (string-to-char comment-start) "." table))
-    (modify-syntax-entry ?#  "." table)
-    (modify-syntax-entry ?\" "." table)
-    (modify-syntax-entry ?\' "." table)
-    (modify-syntax-entry ?`  "." table)
-    (set-syntax-table table))
-  (setq-local comment-start
-              (or (ignore-errors
-                    (car (process-lines "git" "config" "core.commentchar")))
-                  "#"))
-  (setq-local comment-start-skip (format "^%s+[\s\t]*" comment-start))
-  (setq-local comment-end-skip "\n")
-  (setq-local comment-use-syntax nil)
-  (setq-local font-lock-multiline t)
-  (add-hook 'font-lock-extend-region-functions
-            #'git-commit-extend-region-summary-line
-            t t)
-  (font-lock-add-keywords nil (git-commit-mode-font-lock-keywords) t))
-
-(define-minor-mode git-commit-mode
-  "Auxiliary minor mode used when editing Git commit messages.
-This mode is only responsible for setting up some key bindings.
-Don't use it directly, instead enable `global-git-commit-mode'."
-  :lighter "")
-
-(put 'git-commit-mode 'permanent-local t)
-
-(defun git-commit-setup-changelog-support ()
-  "Treat ChangeLog entries as paragraphs."
-  (setq-local paragraph-start (concat paragraph-start "\\|\\*\\|(")))
-
-(defun git-commit-turn-on-auto-fill ()
-  "Unconditionally turn on Auto Fill mode.
-If `git-commit-fill-column' is non-nil, and `fill-column'
-doesn't already have a buffer-local value, then set that
-to `git-commit-fill-column'."
-  (when (and (numberp git-commit-fill-column)
-             (not (local-variable-p 'fill-column)))
-    (setq fill-column git-commit-fill-column))
-  (setq-local comment-auto-fill-only-comments nil)
-  (turn-on-auto-fill))
-
-(defun git-commit-turn-on-flyspell ()
-  "Unconditionally turn on Flyspell mode.
-Also prevent comments from being checked and
-finally check current non-comment text."
-  (require 'flyspell)
-  (turn-on-flyspell)
-  (setq flyspell-generic-check-word-predicate
-        'git-commit-flyspell-verify)
-  (flyspell-buffer))
-
-(defun git-commit-flyspell-verify ()
-  (not (= (char-after (line-beginning-position)) ?#)))
-
-(defun git-commit-finish-query-functions (force)
-  (run-hook-with-args-until-failure
-   'git-commit-finish-query-functions force))
-
-(defun git-commit-check-style-conventions (force)
-  "Check for violations of certain basic style conventions.
-
-For each violation ask the user if she wants to proceed anyway.
-Option `git-commit-check-style-conventions' controls which
-conventions are checked."
-  (or force
-      (save-excursion
-        (goto-char (point-min))
-        (re-search-forward (git-commit-summary-regexp) nil t)
-        (if (equal (match-string 1) "")
-            t ; Just try; we don't know whether --allow-empty-message was used.
-          (and (or (not (memq 'overlong-summary-line
-                              git-commit-style-convention-checks))
-                   (equal (match-string 2) "")
-                   (y-or-n-p "Summary line is too long.  Commit anyway? "))
-               (or (not (memq 'non-empty-second-line
-                              git-commit-style-convention-checks))
-                   (not (match-string 3))
-                   (y-or-n-p "Second line is not empty.  Commit anyway? ")))))))
-
-(defun git-commit-cancel-message ()
-  (message
-   (concat "Commit canceled"
-           (and (memq 'git-commit-save-message with-editor-pre-cancel-hook)
-                ".  Message saved to `log-edit-comment-ring'"))))
-
-;;; History
-
-(defun git-commit-prev-message (arg)
-  "Cycle backward through message history, after saving current message.
-With a numeric prefix ARG, go back ARG comments."
-  (interactive "*p")
-  (when (and (git-commit-save-message) (> arg 0))
-    (setq log-edit-comment-ring-index
-          (log-edit-new-comment-index
-           arg (ring-length log-edit-comment-ring))))
-  (save-restriction
-    (goto-char (point-min))
-    (narrow-to-region (point)
-                      (if (re-search-forward (concat "^" comment-start))
-                          (max 1 (- (point) 2))
-                        (point-max)))
-    (log-edit-previous-comment arg)))
-
-(defun git-commit-next-message (arg)
-  "Cycle forward through message history, after saving current message.
-With a numeric prefix ARG, go forward ARG comments."
-  (interactive "*p")
-  (git-commit-prev-message (- arg)))
-
-(defun git-commit-save-message ()
-  "Save current message to `log-edit-comment-ring'."
-  (interactive)
-  (--when-let (git-commit-buffer-message)
-    (unless (ring-member log-edit-comment-ring it)
-      (ring-insert log-edit-comment-ring it))))
-
-(defun git-commit-buffer-message ()
-  (let ((flush (concat "^" comment-start))
-        (str (buffer-substring-no-properties (point-min) (point-max))))
-    (with-temp-buffer
-      (insert str)
-      (goto-char (point-min))
-      (when (re-search-forward (concat flush " -+ >8 -+$") nil t)
-        (delete-region (point-at-bol) (point-max)))
-      (goto-char (point-min))
-      (flush-lines flush)
-      (goto-char (point-max))
-      (unless (eq (char-before) ?\n)
-        (insert ?\n))
-      (setq str (buffer-string)))
-    (unless (string-match "\\`[ \t\n\r]*\\'" str)
-      (when (string-match "\\`\n\\{2,\\}" str)
-        (setq str (replace-match "\n" t t str)))
-      (when (string-match "\n\\{2,\\}\\'" str)
-        (setq str (replace-match "\n" t t str)))
-      str)))
-
-;;; Headers
-
-(defun git-commit-ack (name mail)
-  "Insert a header acknowledging that you have looked at the commit."
-  (interactive (git-commit-self-ident))
-  (git-commit-insert-header "Acked-by" name mail))
-
-(defun git-commit-modified (name mail)
-  "Insert a header to signal that you have modified the commit."
-  (interactive (git-commit-self-ident))
-  (git-commit-insert-header "Modified-by" name mail))
-
-(defun git-commit-review (name mail)
-  "Insert a header acknowledging that you have reviewed the commit."
-  (interactive (git-commit-self-ident))
-  (git-commit-insert-header "Reviewed-by" name mail))
-
-(defun git-commit-signoff (name mail)
-  "Insert a header to sign off the commit."
-  (interactive (git-commit-self-ident))
-  (git-commit-insert-header "Signed-off-by" name mail))
-
-(defun git-commit-test (name mail)
-  "Insert a header acknowledging that you have tested the commit."
-  (interactive (git-commit-self-ident))
-  (git-commit-insert-header "Tested-by" name mail))
-
-(defun git-commit-cc (name mail)
-  "Insert a header mentioning someone who might be interested."
-  (interactive (git-commit-read-ident))
-  (git-commit-insert-header "Cc" name mail))
-
-(defun git-commit-reported (name mail)
-  "Insert a header mentioning the person who reported the issue."
-  (interactive (git-commit-read-ident))
-  (git-commit-insert-header "Reported-by" name mail))
-
-(defun git-commit-suggested (name mail)
-  "Insert a header mentioning the person who suggested the change."
-  (interactive (git-commit-read-ident))
-  (git-commit-insert-header "Suggested-by" name mail))
-
-(defun git-commit-self-ident ()
-  (list (or (getenv "GIT_AUTHOR_NAME")
-            (getenv "GIT_COMMITTER_NAME")
-            (ignore-errors (car (process-lines "git" "config" "user.name")))
-            user-full-name
-            (read-string "Name: "))
-        (or (getenv "GIT_AUTHOR_EMAIL")
-            (getenv "GIT_COMMITTER_EMAIL")
-            (getenv "EMAIL")
-            (ignore-errors (car (process-lines "git" "config" "user.email")))
-            (read-string "Email: "))))
-
-(defun git-commit-read-ident ()
-  (list (read-string "Name: ")
-        (read-string "Email: ")))
-
-(defun git-commit-insert-header (header name email)
-  (setq header (format "%s: %s <%s>" header name email))
-  (save-excursion
-    (goto-char (point-max))
-    (cond ((re-search-backward "^[-a-zA-Z]+: [^<]+? <[^>]+>" nil t)
-           (end-of-line)
-           (insert ?\n header)
-           (unless (= (char-after) ?\n)
-             (insert ?\n)))
-          (t
-           (while (re-search-backward (concat "^" comment-start) nil t))
-           (unless (looking-back "\n\n" nil)
-             (insert ?\n))
-           (insert header ?\n)))
-    (unless (or (eobp) (= (char-after) ?\n))
-      (insert ?\n))))
-
-;;; Font-Lock
-
-(defconst git-commit-comment-headings
-  '("Changes to be committed:"
-    "Untracked files:"
-    "Changed but not updated:"
-    "Changes not staged for commit:"
-    "Unmerged paths:"))
-
-(defun git-commit-summary-regexp ()
-  (concat
-   ;; Leading empty lines and comments
-   (format "\\`\\(?:^\\(?:\\s-*\\|%s.*\\)\n\\)*" comment-start)
-   ;; Summary line
-   (format "\\(.\\{0,%d\\}\\)\\(.*\\)" git-commit-summary-max-length)
-   ;; Non-empty non-comment second line
-   (format "\\(?:\n%s\\|\n\\(.+\\)\\)?" comment-start)))
-
-(defun git-commit-extend-region-summary-line ()
-  "Identify the multiline summary-regexp construct.
-Added to `font-lock-extend-region-functions'."
-  (save-excursion
-    (save-match-data
-      (goto-char (point-min))
-      (when (looking-at (git-commit-summary-regexp))
-        (let ((summary-beg (match-beginning 0))
-              (summary-end (match-end 0)))
-          (when (or (< summary-beg font-lock-beg summary-end)
-                    (< summary-beg font-lock-end summary-end))
-            (setq font-lock-beg (min font-lock-beg summary-beg))
-            (setq font-lock-end (max font-lock-end summary-end))))))))
-
-(defun git-commit-mode-font-lock-keywords ()
-  `(;; Comments
-    (,(format "^%s.*" comment-start)
-     (0 'font-lock-comment-face))
-    (,(format "^%s On branch \\(.*\\)" comment-start)
-     (1 'git-commit-comment-branch t))
-    (,(format "^%s Not currently on any branch." comment-start)
-     (1 'git-commit-comment-detached t))
-    (,(format "^%s %s" comment-start
-              (regexp-opt git-commit-comment-headings t))
-     (1 'git-commit-comment-heading t))
-    (,(format "^%s\t\\(?:\\([^:\n]+\\):\\s-+\\)?\\(.*\\)" comment-start)
-     (1 'git-commit-comment-action t t)
-     (2 'git-commit-comment-file t))
-    ;; Pseudo headers
-    (,(format "^\\(%s:\\)\\( .*\\)"
-              (regexp-opt git-commit-known-pseudo-headers))
-     (1 'git-commit-known-pseudo-header)
-     (2 'git-commit-pseudo-header))
-    ("^[-a-zA-Z]+: [^<]+? <[^>]+>"
-     (0 'git-commit-pseudo-header))
-    ;; Summary
-    (,(git-commit-summary-regexp)
-     (1 'git-commit-summary t))
-    ;; - Note (overrides summary)
-    ("\\[.+?\\]"
-     (0 'git-commit-note t))
-    ;; - Non-empty second line (overrides summary and note)
-    (,(git-commit-summary-regexp)
-     (2 'git-commit-overlong-summary t t)
-     (3 'git-commit-nonempty-second-line t t))))
-
-(defun git-commit-propertize-diff ()
-  (save-excursion
-    (goto-char (point-min))
-    (when (re-search-forward "^diff --git" nil t)
-      (beginning-of-line)
-      (let ((buffer (current-buffer)))
-        (insert
-         (with-temp-buffer
-           (insert
-            (with-current-buffer buffer
-              (prog1 (buffer-substring-no-properties (point) (point-max))
-                (delete-region (point) (point-max)))))
-           (let ((diff-default-read-only nil))
-             (diff-mode))
-           (let (font-lock-verbose font-lock-support-mode)
-             (if (fboundp 'font-lock-ensure)
-                 (font-lock-ensure)
-               (with-no-warnings
-                 (font-lock-fontify-buffer))))
-           (let (next (pos (point-min)))
-             (while (setq next (next-single-property-change pos 'face))
-               (put-text-property pos next 'font-lock-face
-                                  (get-text-property pos 'face))
-               (setq pos next))
-             (put-text-property pos (point-max) 'font-lock-face
-                                (get-text-property pos 'face)))
-           (buffer-string)))))))
-
-(provide 'git-commit)
-;;; git-commit.el ends here
.emacs.d/elpa/git-commit-20170914.258/git-commit.elc
Binary file
.emacs.d/elpa/gnupg/pubring.kbx
Binary file
.emacs.d/elpa/gnupg/pubring.kbx~
Binary file
.emacs.d/elpa/gnupg/trustdb.gpg
Binary file
.emacs.d/elpa/go-mode-20170726.555/go-mode-autoloads.el
@@ -1,104 +0,0 @@
-;;; go-mode-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "go-mode" "go-mode.el" (22977 29282 365026
-;;;;;;  225000))
-;;; Generated autoloads from go-mode.el
-
-(autoload 'go-mode "go-mode" "\
-Major mode for editing Go source text.
-
-This mode provides (not just) basic editing capabilities for
-working with Go code. It offers almost complete syntax
-highlighting, indentation that is almost identical to gofmt and
-proper parsing of the buffer content to allow features such as
-navigation by function, manipulation of comments or detection of
-strings.
-
-In addition to these core features, it offers various features to
-help with writing Go code. You can directly run buffer content
-through gofmt, read godoc documentation from within Emacs, modify
-and clean up the list of package imports or interact with the
-Playground (uploading and downloading pastes).
-
-The following extra functions are defined:
-
-- `gofmt'
-- `godoc' and `godoc-at-point'
-- `go-import-add'
-- `go-remove-unused-imports'
-- `go-goto-arguments'
-- `go-goto-docstring'
-- `go-goto-function'
-- `go-goto-function-name'
-- `go-goto-imports'
-- `go-goto-return-values'
-- `go-goto-method-receiver'
-- `go-play-buffer' and `go-play-region'
-- `go-download-play'
-- `godef-describe' and `godef-jump'
-- `go-coverage'
-- `go-set-project'
-- `go-reset-gopath'
-
-If you want to automatically run `gofmt' before saving a file,
-add the following hook to your emacs configuration:
-
-\(add-hook 'before-save-hook #'gofmt-before-save)
-
-If you want to use `godef-jump' instead of etags (or similar),
-consider binding godef-jump to `M-.', which is the default key
-for `find-tag':
-
-\(add-hook 'go-mode-hook (lambda ()
-                          (local-set-key (kbd \"M-.\") #'godef-jump)))
-
-Please note that godef is an external dependency. You can install
-it with
-
-go get github.com/rogpeppe/godef
-
-
-If you're looking for even more integration with Go, namely
-on-the-fly syntax checking, auto-completion and snippets, it is
-recommended that you look at flycheck
-\(see URL `https://github.com/flycheck/flycheck') or flymake in combination
-with goflymake (see URL `https://github.com/dougm/goflymake'), gocode
-\(see URL `https://github.com/nsf/gocode'), go-eldoc
-\(see URL `github.com/syohex/emacs-go-eldoc') and yasnippet-go
-\(see URL `https://github.com/dominikh/yasnippet-go')
-
-\(fn)" t nil)
-
-(add-to-list 'auto-mode-alist (cons "\\.go\\'" 'go-mode))
-
-(autoload 'gofmt-before-save "go-mode" "\
-Add this to .emacs to run gofmt on the current buffer when saving:
-\(add-hook 'before-save-hook 'gofmt-before-save).
-
-Note that this will cause ‘go-mode’ to get loaded the first time
-you save any file, kind of defeating the point of autoloading.
-
-\(fn)" t nil)
-
-(autoload 'godoc "go-mode" "\
-Show Go documentation for QUERY, much like \\<go-mode-map>\\[man].
-
-\(fn QUERY)" t nil)
-
-(autoload 'go-download-play "go-mode" "\
-Download a paste from the playground and insert it in a Go buffer.
-Tries to look for a URL at point.
-
-\(fn URL)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; go-mode-autoloads.el ends here
.emacs.d/elpa/go-mode-20170726.555/go-mode-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "go-mode" "20170726.555" "Major mode for the Go programming language" 'nil :commit "99b06da201afb91e8db0c525c0f3c3590fd92fa6" :url "https://github.com/dominikh/go-mode.el" :keywords '("languages" "go"))
.emacs.d/elpa/go-mode-20170726.555/go-mode.el
@@ -1,2014 +0,0 @@
-;;; go-mode.el --- Major mode for the Go programming language
-
-;;; Commentary:
-
-;; Copyright 2013 The go-mode Authors.  All rights reserved.
-;; Use of this source code is governed by a BSD-style
-;; license that can be found in the LICENSE file.
-
-;; Author: The go-mode Authors
-;; Version: 1.5.0
-;; Package-Version: 20170726.555
-;; Keywords: languages go
-;; URL: https://github.com/dominikh/go-mode.el
-;;
-;; This file is not part of GNU Emacs.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'compile)
-(require 'etags)
-(require 'ffap)
-(require 'find-file)
-(require 'ring)
-(require 'url)
-(require 'xref nil :noerror)  ; xref is new in Emacs 25.1
-
-
-(eval-when-compile
-  (defmacro go--forward-word (&optional arg)
-   (if (fboundp 'forward-word-strictly)
-       `(forward-word-strictly ,arg)
-     `(forward-word ,arg))))
-
-(defun go--delete-whole-line (&optional arg)
-  "Delete the current line without putting it in the `kill-ring'.
-Derived from function `kill-whole-line'.  ARG is defined as for that
-function."
-  (setq arg (or arg 1))
-  (if (and (> arg 0)
-           (eobp)
-           (save-excursion (forward-visible-line 0) (eobp)))
-      (signal 'end-of-buffer nil))
-  (if (and (< arg 0)
-           (bobp)
-           (save-excursion (end-of-visible-line) (bobp)))
-      (signal 'beginning-of-buffer nil))
-  (cond ((zerop arg)
-         (delete-region (progn (forward-visible-line 0) (point))
-                        (progn (end-of-visible-line) (point))))
-        ((< arg 0)
-         (delete-region (progn (end-of-visible-line) (point))
-                        (progn (forward-visible-line (1+ arg))
-                               (unless (bobp)
-                                 (backward-char))
-                               (point))))
-        (t
-         (delete-region (progn (forward-visible-line 0) (point))
-                        (progn (forward-visible-line arg) (point))))))
-
-(defun go-goto-opening-parenthesis (&optional _legacy-unused)
-  "Move up one level of parentheses."
-  ;; The old implementation of go-goto-opening-parenthesis had an
-  ;; optional argument to speed up the function.  It didn't change the
-  ;; function's outcome.
-
-  ;; Silently fail if there's no matching opening parenthesis.
-  (condition-case nil
-      (backward-up-list)
-    (scan-error nil)))
-
-
-(defconst go-dangling-operators-regexp "[^-]-\\|[^+]\\+\\|[/*&><.=|^]")
-(defconst go--max-dangling-operator-length 2
-  "The maximum length of dangling operators.
-This must be at least the length of the longest string matched by
-‘go-dangling-operators-regexp.’, and must be updated whenever
-that constant is changed.")
-
-(defconst go-identifier-regexp "[[:word:][:multibyte:]]+")
-(defconst go-type-name-no-prefix-regexp "\\(?:[[:word:][:multibyte:]]+\\.\\)?[[:word:][:multibyte:]]+")
-(defconst go-qualified-identifier-regexp (concat go-identifier-regexp "\\." go-identifier-regexp))
-(defconst go-label-regexp go-identifier-regexp)
-(defconst go-type-regexp "[[:word:][:multibyte:]*]+")
-(defconst go-func-regexp (concat "\\_<func\\_>\\s *\\(" go-identifier-regexp "\\)"))
-(defconst go-func-meth-regexp (concat
-                               "\\_<func\\_>\\s *\\(?:(\\s *"
-                               "\\(" go-identifier-regexp "\\s +\\)?" go-type-regexp
-                               "\\s *)\\s *\\)?\\("
-                               go-identifier-regexp
-                               "\\)("))
-
-(defconst go-builtins
-  '("append" "cap"   "close"   "complex" "copy"
-    "delete" "imag"  "len"     "make"    "new"
-    "panic"  "print" "println" "real"    "recover")
-  "All built-in functions in the Go language.  Used for font locking.")
-
-(defconst go-mode-keywords
-  '("break"    "default"     "func"   "interface" "select"
-    "case"     "defer"       "go"     "map"       "struct"
-    "chan"     "else"        "goto"   "package"   "switch"
-    "const"    "fallthrough" "if"     "range"     "type"
-    "continue" "for"         "import" "return"    "var")
-  "All keywords in the Go language.  Used for font locking.")
-
-(defconst go-constants '("nil" "true" "false" "iota"))
-(defconst go-type-name-regexp (concat "\\(?:[*(]\\)*\\(\\(?:" go-identifier-regexp "\\.\\)?" go-identifier-regexp "\\)"))
-
-;; Maximum number of identifiers that can be highlighted as type names
-;; in one function type/declaration.
-(defconst go--font-lock-func-param-num-groups 16)
-
-(defvar go-dangling-cache)
-(defvar go-godoc-history nil)
-(defvar go--coverage-current-file-name)
-
-(defgroup go nil
-  "Major mode for editing Go code."
-  :link '(url-link "https://github.com/dominikh/go-mode.el")
-  :group 'languages)
-
-(defgroup go-cover nil
-  "Options specific to `cover`."
-  :group 'go)
-
-(defgroup godoc nil
-  "Options specific to `godoc'."
-  :group 'go)
-
-(defcustom go-fontify-function-calls t
-  "Fontify function and method calls if this is non-nil."
-  :type 'boolean
-  :group 'go)
-
-(defcustom go-mode-hook nil
-  "Hook called by `go-mode'."
-  :type 'hook
-  :group 'go)
-
-(defcustom go-command "go"
-  "The 'go' command.
-Some users have multiple Go development trees and invoke the 'go'
-tool via a wrapper that sets GOROOT and GOPATH based on the
-current directory.  Such users should customize this variable to
-point to the wrapper script."
-  :type 'string
-  :group 'go)
-
-(defcustom gofmt-command "gofmt"
-  "The 'gofmt' command.
-Some users may replace this with 'goimports'
-from https://golang.org/x/tools/cmd/goimports."
-  :type 'string
-  :group 'go)
-
-(defcustom gofmt-args nil
-  "Additional arguments to pass to gofmt."
-  :type '(repeat string)
-  :group 'go)
-
-(defcustom gofmt-show-errors 'buffer
-  "Where to display gofmt error output.
-It can either be displayed in its own buffer, in the echo area, or not at all.
-
-Please note that Emacs outputs to the echo area when writing
-files and will overwrite gofmt's echo output if used from inside
-a `before-save-hook'."
-  :type '(choice
-          (const :tag "Own buffer" buffer)
-          (const :tag "Echo area" echo)
-          (const :tag "None" nil))
-  :group 'go)
-
-(defcustom godef-command "godef"
-  "The 'godef' command."
-  :type 'string
-  :group 'go)
-
-(defcustom go-other-file-alist
-  '(("_test\\.go\\'" (".go"))
-    ("\\.go\\'" ("_test.go")))
-  "See the documentation of `ff-other-file-alist' for details."
-  :type '(repeat (list regexp (choice (repeat string) function)))
-  :group 'go)
-
-(defcustom go-packages-function 'go-packages-native
-  "Function called by `go-packages' to determine the list of available packages.
-This is used in e.g. tab completion in `go-import-add'.
-
-This package provides two functions: `go-packages-native' uses
-elisp to find all .a files in all /pkg/ directories.
-`go-packages-go-list' uses 'go list all' to determine all Go
-packages.  `go-packages-go-list' generally produces more accurate
-results, but can be slower than `go-packages-native'."
-  :type 'function
-  :package-version '(go-mode . 1.4.0)
-  :group 'go)
-
-(defcustom go-guess-gopath-functions (list #'go-godep-gopath
-                                           #'go-wgo-gopath
-                                           #'go-gb-gopath
-                                           #'go-plain-gopath)
-  "Functions to call in sequence to detect a project's GOPATH.
-
-The functions in this list will be called one after another,
-until a function returns non-nil.  The order of the functions in
-this list is important, as some project layouts may superficially
-look like others.  For example, a subset of wgo projects look like
-gb projects.  That's why we need to detect wgo first, to avoid
-mis-identifying them as gb projects."
-  :type '(repeat function)
-  :group 'go)
-
-(defcustom godoc-command "go doc"
-  "Which executable to use for `godoc'.
-This can either be 'godoc' or 'go doc', both as an absolute path
-or an executable in PATH."
-  :type 'string
-  :group 'go)
-
-(defcustom godoc-and-godef-command "godoc"
-  "Which executable to use for `godoc' in `godoc-and-godef-command'.
-Must be 'godoc' and not 'go doc' and can be an absolute path or
-an executable in PATH."
-  :type 'string
-  :group 'go)
-
-(defcustom godoc-use-completing-read nil
-  "Provide auto-completion for godoc.
-Only really desirable when using `godoc' instead of `go doc'."
-  :type 'boolean
-  :group 'godoc)
-
-(defcustom godoc-at-point-function #'godoc-and-godef
-  "Function to call to display the documentation for an
-identifier at a given position.
-
-This package provides two functions: `godoc-and-godef' uses a
-combination of godef and godoc to find the documentation.  This
-approach has several caveats.  See its documentation for more
-information.  The second function, `godoc-gogetdoc' uses an
-additional tool that correctly determines the documentation for
-any identifier.  It provides better results than
-`godoc-and-godef'."
-  :type 'function
-  :group 'godoc)
-
-(defun godoc-and-godef (point)
-  "Use a combination of godef and godoc to guess the documentation at POINT.
-
-Due to a limitation in godoc, it is not possible to differentiate
-between functions and methods, which may cause `godoc-at-point'
-to display more documentation than desired.  Furthermore, it
-doesn't work on package names or variables.
-
-Consider using ‘godoc-gogetdoc’ instead for more accurate results."
-  (condition-case nil
-      (let* ((output (godef--call point))
-             (file (car output))
-             (name-parts (split-string (cadr output) " "))
-             (first (car name-parts)))
-        (if (not (godef--successful-p file))
-            (message "%s" (godef--error file))
-          (go--godoc (format "%s %s"
-                         (file-name-directory file)
-                         (if (or (string= first "type") (string= first "const"))
-                             (cadr name-parts)
-                           (car name-parts)))
-                    godoc-and-godef-command)))
-    (file-error (message "Could not run godef binary"))))
-
-(defun godoc-gogetdoc (point)
-  "Use the gogetdoc tool to find the documentation for an identifier at POINT.
-
-You can install gogetdoc with 'go get -u github.com/zmb3/gogetdoc'."
-  (if (not (buffer-file-name (go--coverage-origin-buffer)))
-      ;; TODO: gogetdoc supports unsaved files, but not introducing
-      ;; new artifical files, so this limitation will stay for now.
-      (error "Cannot use gogetdoc on a buffer without a file name"))
-  (let ((posn (format "%s:#%d" (shell-quote-argument (file-truename buffer-file-name)) (1- (position-bytes point))))
-        (out (godoc--get-buffer "<at point>")))
-  (with-current-buffer (get-buffer-create "*go-gogetdoc-input*")
-    (setq buffer-read-only nil)
-    (erase-buffer)
-    (go--insert-modified-files)
-    (call-process-region (point-min) (point-max) "gogetdoc" nil out nil
-                         "-modified"
-                         (format "-pos=%s" posn)))
-  (with-current-buffer out
-    (goto-char (point-min))
-    (godoc-mode)
-    (display-buffer (current-buffer) t))))
-
-(defun go--kill-new-message (url)
-  "Make URL the latest kill and print a message."
-  (kill-new url)
-  (message "%s" url))
-
-(defcustom go-play-browse-function 'go--kill-new-message
-  "Function to call with the Playground URL.
-See `go-play-region' for more details."
-  :type '(choice
-          (const :tag "Nothing" nil)
-          (const :tag "Kill + Message" go--kill-new-message)
-          (const :tag "Browse URL" browse-url)
-          (function :tag "Call function"))
-  :group 'go)
-
-(defcustom go-coverage-display-buffer-func 'display-buffer-reuse-window
-  "How `go-coverage' should display the coverage buffer.
-See `display-buffer' for a list of possible functions."
-  :type 'function
-  :group 'go-cover)
-
-(defface go-coverage-untracked
-  '((t (:foreground "#505050")))
-  "Coverage color of untracked code."
-  :group 'go-cover)
-
-(defface go-coverage-0
-  '((t (:foreground "#c00000")))
-  "Coverage color for uncovered code."
-  :group 'go-cover)
-(defface go-coverage-1
-  '((t (:foreground "#808080")))
-  "Coverage color for covered code with weight 1."
-  :group 'go-cover)
-(defface go-coverage-2
-  '((t (:foreground "#748c83")))
-  "Coverage color for covered code with weight 2."
-  :group 'go-cover)
-(defface go-coverage-3
-  '((t (:foreground "#689886")))
-  "Coverage color for covered code with weight 3."
-  :group 'go-cover)
-(defface go-coverage-4
-  '((t (:foreground "#5ca489")))
-  "Coverage color for covered code with weight 4."
-  :group 'go-cover)
-(defface go-coverage-5
-  '((t (:foreground "#50b08c")))
-  "Coverage color for covered code with weight 5."
-  :group 'go-cover)
-(defface go-coverage-6
-  '((t (:foreground "#44bc8f")))
-  "Coverage color for covered code with weight 6."
-  :group 'go-cover)
-(defface go-coverage-7
-  '((t (:foreground "#38c892")))
-  "Coverage color for covered code with weight 7."
-  :group 'go-cover)
-(defface go-coverage-8
-  '((t (:foreground "#2cd495")))
-  "Coverage color for covered code with weight 8.
-For mode=set, all covered lines will have this weight."
-  :group 'go-cover)
-(defface go-coverage-9
-  '((t (:foreground "#20e098")))
-  "Coverage color for covered code with weight 9."
-  :group 'go-cover)
-(defface go-coverage-10
-  '((t (:foreground "#14ec9b")))
-  "Coverage color for covered code with weight 10."
-  :group 'go-cover)
-(defface go-coverage-covered
-  '((t (:foreground "#2cd495")))
-  "Coverage color of covered code."
-  :group 'go-cover)
-
-(defvar go-mode-syntax-table
-  (let ((st (make-syntax-table)))
-    (modify-syntax-entry ?+  "." st)
-    (modify-syntax-entry ?-  "." st)
-    (modify-syntax-entry ?%  "." st)
-    (modify-syntax-entry ?&  "." st)
-    (modify-syntax-entry ?|  "." st)
-    (modify-syntax-entry ?^  "." st)
-    (modify-syntax-entry ?!  "." st)
-    (modify-syntax-entry ?=  "." st)
-    (modify-syntax-entry ?<  "." st)
-    (modify-syntax-entry ?>  "." st)
-    (modify-syntax-entry ?/  ". 124b" st)
-    (modify-syntax-entry ?*  ". 23" st)
-    (modify-syntax-entry ?\n "> b" st)
-    (modify-syntax-entry ?\" "\"" st)
-    (modify-syntax-entry ?\' "\"" st)
-    (modify-syntax-entry ?`  "\"" st)
-    (modify-syntax-entry ?\\ "\\" st)
-    ;; TODO make _ a symbol constituent now that xemacs is gone
-    (modify-syntax-entry ?_  "w" st)
-
-    st)
-  "Syntax table for Go mode.")
-
-(defun go--build-font-lock-keywords ()
-  ;; we cannot use 'symbols in regexp-opt because GNU Emacs <24
-  ;; doesn't understand that
-  (append
-   `((go--match-func
-      ,@(mapcar (lambda (x) `(,x font-lock-type-face))
-                (number-sequence 1 go--font-lock-func-param-num-groups)))
-     (,(concat "\\_<" (regexp-opt go-mode-keywords t) "\\_>") . font-lock-keyword-face)
-     (,(concat "\\(\\_<" (regexp-opt go-builtins t) "\\_>\\)[[:space:]]*(") 1 font-lock-builtin-face)
-     (,(concat "\\_<" (regexp-opt go-constants t) "\\_>") . font-lock-constant-face)
-     (,go-func-regexp 1 font-lock-function-name-face)) ;; function (not method) name
-
-   (if go-fontify-function-calls
-       `((,(concat "\\(" go-identifier-regexp "\\)[[:space:]]*(") 1 font-lock-function-name-face) ;; function call/method name
-         (,(concat "[^[:word:][:multibyte:]](\\(" go-identifier-regexp "\\))[[:space:]]*(") 1 font-lock-function-name-face)) ;; bracketed function call
-     `((,go-func-meth-regexp 2 font-lock-function-name-face))) ;; method name
-
-   `(
-     ("\\(`[^`]*`\\)" 1 font-lock-multiline) ;; raw string literal, needed for font-lock-syntactic-keywords
-     (,(concat "\\_<type\\_>[[:space:]]+\\([^[:space:](]+\\)") 1 font-lock-type-face) ;; types
-     (,(concat "\\_<type\\_>[[:space:]]+" go-identifier-regexp "[[:space:]]*" go-type-name-regexp) 1 font-lock-type-face) ;; types
-     (,(concat "[^[:word:][:multibyte:]]\\[\\([[:digit:]]+\\|\\.\\.\\.\\)?\\]" go-type-name-regexp) 2 font-lock-type-face) ;; Arrays/slices
-     (,(concat "\\(" go-identifier-regexp "\\)" "{") 1 font-lock-type-face)
-     (,(concat "\\_<map\\_>\\[[^]]+\\]" go-type-name-regexp) 1 font-lock-type-face) ;; map value type
-     (,(concat "\\_<map\\_>\\[" go-type-name-regexp) 1 font-lock-type-face) ;; map key type
-     (,(concat "\\_<chan\\_>[[:space:]]*\\(?:<-[[:space:]]*\\)?" go-type-name-regexp) 1 font-lock-type-face) ;; channel type
-     (,(concat "\\_<\\(?:new\\|make\\)\\_>\\(?:[[:space:]]\\|)\\)*(" go-type-name-regexp) 1 font-lock-type-face) ;; new/make type
-     ;; TODO do we actually need this one or isn't it just a function call?
-     (,(concat "\\.\\s *(" go-type-name-regexp) 1 font-lock-type-face) ;; Type conversion
-     ;; Like the original go-mode this also marks compound literal
-     ;; fields. There, it was marked as to fix, but I grew quite
-     ;; accustomed to it, so it'll stay for now.
-     (,(concat "^[[:space:]]*\\(" go-label-regexp "\\)[[:space:]]*:\\(\\S.\\|$\\)") 1 font-lock-constant-face) ;; Labels and compound literal fields
-     (,(concat "\\_<\\(goto\\|break\\|continue\\)\\_>[[:space:]]*\\(" go-label-regexp "\\)") 2 font-lock-constant-face)))) ;; labels in goto/break/continue
-
-(let ((m (define-prefix-command 'go-goto-map)))
-  (define-key m "a" #'go-goto-arguments)
-  (define-key m "d" #'go-goto-docstring)
-  (define-key m "f" #'go-goto-function)
-  (define-key m "i" #'go-goto-imports)
-  (define-key m "m" #'go-goto-method-receiver)
-  (define-key m "n" #'go-goto-function-name)
-  (define-key m "r" #'go-goto-return-values))
-
-(defvar go-mode-map
-  (let ((m (make-sparse-keymap)))
-    (unless (boundp 'electric-indent-chars)
-        (define-key m "}" #'go-mode-insert-and-indent)
-        (define-key m ")" #'go-mode-insert-and-indent))
-    (define-key m (kbd "C-c C-a") #'go-import-add)
-    (define-key m (kbd "C-c C-j") #'godef-jump)
-    (define-key m (kbd "C-x 4 C-c C-j") #'godef-jump-other-window)
-    (define-key m (kbd "C-c C-d") #'godef-describe)
-    (define-key m (kbd "C-c C-f") 'go-goto-map)
-    m)
-  "Keymap used by ‘go-mode’.")
-
-(easy-menu-define go-mode-menu go-mode-map
-  "Menu for Go mode."
-  '("Go"
-    ["Describe Expression"   godef-describe t]
-    ["Jump to Definition"    godef-jump t]
-    "---"
-    ["Add Import"            go-import-add t]
-    ["Remove Unused Imports" go-remove-unused-imports t]
-    ["Go to Imports"         go-goto-imports t]
-    "---"
-    ("Playground"
-     ["Send Buffer"          go-play-buffer t]
-     ["Send Region"          go-play-region t]
-     ["Download"             go-download-play t])
-    "---"
-    ["Coverage"              go-coverage t]
-    ["Gofmt"                 gofmt t]
-    ["Godoc"                 godoc t]
-    "---"
-    ["Customize Mode"        (customize-group 'go) t]))
-
-(defun go-mode-insert-and-indent (key)
-  "Invoke the global binding of KEY, then reindent the line."
-
-  (interactive (list (this-command-keys)))
-  (call-interactively (lookup-key (current-global-map) key))
-  (indent-according-to-mode))
-
-(defmacro go-paren-level ()
-  `(car (syntax-ppss)))
-
-(defmacro go-in-string-or-comment-p ()
-  `(nth 8 (syntax-ppss)))
-
-(defmacro go-in-string-p ()
-  `(nth 3 (syntax-ppss)))
-
-(defmacro go-in-comment-p ()
-  `(nth 4 (syntax-ppss)))
-
-(defmacro go-goto-beginning-of-string-or-comment ()
-  `(goto-char (nth 8 (syntax-ppss))))
-
-(defun go--backward-irrelevant (&optional stop-at-string)
-  "Skip backwards over any characters that are irrelevant for
-indentation and related tasks.
-
-It skips over whitespace, comments, cases and labels and, if
-STOP-AT-STRING is not true, over strings."
-
-  (let (pos (start-pos (point)))
-    (skip-chars-backward "\n\s\t")
-    (if (and (save-excursion (beginning-of-line) (go-in-string-p))
-             (= (char-before) ?`)
-             (not stop-at-string))
-        (backward-char))
-    (if (and (go-in-string-p)
-             (not stop-at-string))
-        (go-goto-beginning-of-string-or-comment))
-    (if (looking-back "\\*/" (line-beginning-position))
-        (backward-char))
-    (if (go-in-comment-p)
-        (go-goto-beginning-of-string-or-comment))
-    (setq pos (point))
-    (beginning-of-line)
-    (if (or (looking-at (concat "^" go-label-regexp ":"))
-            (looking-at "^[[:space:]]*\\(case .+\\|default\\):"))
-        (end-of-line 0)
-      (goto-char pos))
-    (if (/= start-pos (point))
-        (go--backward-irrelevant stop-at-string))
-    (/= start-pos (point))))
-
-(defun go--buffer-narrowed-p ()
-  "Return non-nil if the current buffer is narrowed."
-  (/= (buffer-size)
-      (- (point-max)
-         (point-min))))
-
-(defun go-previous-line-has-dangling-op-p ()
-  "Return non-nil if the current line is a continuation line."
-  (let* ((cur-line (line-number-at-pos))
-         (val (gethash cur-line go-dangling-cache 'nope)))
-    (if (or (go--buffer-narrowed-p) (equal val 'nope))
-        (save-excursion
-          (beginning-of-line)
-          (go--backward-irrelevant t)
-          (setq val (looking-back go-dangling-operators-regexp
-                                  (- (point) go--max-dangling-operator-length)))
-          (if (not (go--buffer-narrowed-p))
-              (puthash cur-line val go-dangling-cache))))
-    val))
-
-(defun go--at-function-definition ()
-  "Return non-nil if point is on the opening curly brace of a
-function definition.
-
-We do this by first calling (beginning-of-defun), which will take
-us to the start of *some* function.  We then look for the opening
-curly brace of that function and compare its position against the
-curly brace we are checking.  If they match, we return non-nil."
-  (if (= (char-after) ?\{)
-      (save-excursion
-        (let ((old-point (point))
-              start-nesting)
-          (beginning-of-defun)
-          (when (looking-at "func ")
-            (setq start-nesting (go-paren-level))
-            (skip-chars-forward "^{")
-            (while (> (go-paren-level) start-nesting)
-              (forward-char)
-              (skip-chars-forward "^{") 0)
-            (if (and (= (go-paren-level) start-nesting) (= old-point (point)))
-                t))))))
-
-(defun go--indentation-for-opening-parenthesis ()
-  "Return the semantic indentation for the current opening parenthesis.
-
-If point is on an opening curly brace and said curly brace
-belongs to a function declaration, the indentation of the func
-keyword will be returned.  Otherwise the indentation of the
-current line will be returned."
-  (save-excursion
-    (if (go--at-function-definition)
-        (progn
-          (beginning-of-defun)
-          (current-indentation))
-      (current-indentation))))
-
-(defun go-indentation-at-point ()
-  (save-excursion
-    (let (start-nesting)
-      (back-to-indentation)
-      (setq start-nesting (go-paren-level))
-
-      (cond
-       ((go-in-string-p)
-        (current-indentation))
-       ((looking-at "[])}]")
-        (go-goto-opening-parenthesis)
-        (if (go-previous-line-has-dangling-op-p)
-            (- (current-indentation) tab-width)
-          (go--indentation-for-opening-parenthesis)))
-       ((progn (go--backward-irrelevant t)
-               (looking-back go-dangling-operators-regexp
-                             (- (point) go--max-dangling-operator-length)))
-        ;; only one nesting for all dangling operators in one operation
-        (if (go-previous-line-has-dangling-op-p)
-            (current-indentation)
-          (+ (current-indentation) tab-width)))
-       ((zerop (go-paren-level))
-        0)
-       ((progn (go-goto-opening-parenthesis) (< (go-paren-level) start-nesting))
-        (if (go-previous-line-has-dangling-op-p)
-            (current-indentation)
-          (+ (go--indentation-for-opening-parenthesis) tab-width)))
-       (t
-        (current-indentation))))))
-
-(defun go-mode-indent-line ()
-  (interactive)
-  (let (indent
-        shift-amt
-        (pos (- (point-max) (point)))
-        (point (point))
-        (beg (line-beginning-position)))
-    (back-to-indentation)
-    (if (go-in-string-or-comment-p)
-        (goto-char point)
-      (setq indent (go-indentation-at-point))
-      (if (looking-at (concat go-label-regexp ":\\([[:space:]]*/.+\\)?$\\|case .+:\\|default:"))
-          (cl-decf indent tab-width))
-      (setq shift-amt (- indent (current-column)))
-      (if (zerop shift-amt)
-          nil
-        (delete-region beg (point))
-        (indent-to indent))
-      ;; If initial point was within line's indentation,
-      ;; position after the indentation.  Else stay at same point in text.
-      (if (> (- (point-max) pos) (point))
-          (goto-char (- (point-max) pos))))))
-
-(defun go-beginning-of-defun (&optional count)
-  (unless (bolp)
-    (end-of-line))
-  (setq count (or count 1))
-  (let (first failure)
-    (dotimes (i (abs count))
-      (setq first t)
-      (while (and (not failure)
-                  (or first (go-in-string-or-comment-p)))
-        (if (>= count 0)
-            (progn
-              (go--backward-irrelevant)
-              (if (not (re-search-backward go-func-meth-regexp nil t))
-                  (setq failure t)))
-          (if (looking-at go-func-meth-regexp)
-              (forward-char))
-          (if (not (re-search-forward go-func-meth-regexp nil t))
-              (setq failure t)))
-        (setq first nil)))
-    (if (< count 0)
-        (beginning-of-line))
-    (not failure)))
-
-(defun go-end-of-defun ()
-  (let (orig-level)
-    ;; It can happen that we're not placed before a function by emacs
-    (if (not (looking-at "func"))
-        (go-beginning-of-defun -1))
-    ;; Find the { that starts the function, i.e., the next { that isn't
-    ;; preceded by struct or interface, or a comment or struct tag.  BUG:
-    ;; breaks if there's a comment between the struct/interface keyword and
-    ;; bracket, like this:
-    ;;
-    ;;     struct /* why? */ {
-    (while (progn
-      (skip-chars-forward "^{")
-      (forward-char)
-      (or (go-in-string-or-comment-p)
-          (looking-back "\\(struct\\|interface\\)\\s-*{"
-                        (line-beginning-position)))))
-    (setq orig-level (go-paren-level))
-    (while (>= (go-paren-level) orig-level)
-      (skip-chars-forward "^}")
-      (forward-char))))
-
-(defun go--find-enclosing-parentheses (position)
-  "Return points of outermost '(' and ')' surrounding POSITION if
-such parentheses exist.
-
-If outermost '(' exists but ')' does not, it returns the next blank
-line or end-of-buffer position instead of the position of the closing
-parenthesis.
-
-If the starting parenthesis is not found, it returns (POSITION
-POSITION)."
-  (save-excursion
-    (let (beg end)
-      (goto-char position)
-      (while (> (go-paren-level) 0)
-        (re-search-backward "[(\\[{]" nil t)
-        (when (looking-at "(")
-          (setq beg (point))))
-      (if (null beg)
-          (list position position)
-        (goto-char position)
-        (while (and (> (go-paren-level) 0)
-                    (search-forward ")" nil t)))
-        (when (> (go-paren-level) 0)
-          (unless (re-search-forward "^[[:space:]]*$" nil t)
-            (goto-char (point-max))))
-        (list beg (point))))))
-
-(defun go--search-next-comma (end)
-  "Search forward from point for a comma whose nesting level is
-the same as point.  If it reaches the end of line or a closing
-parenthesis before a comma, it stops at it."
-  (let ((orig-level (go-paren-level)))
-    (while (and (< (point) end)
-                (or (looking-at "[^,)\n]")
-                    (> (go-paren-level) orig-level)))
-      (forward-char))
-    (when (and (looking-at ",")
-               (< (point) (1- end)))
-      (forward-char))))
-
-(defun go--looking-at-keyword ()
-  (and (looking-at (concat "\\(" go-identifier-regexp "\\)"))
-       (member (match-string 1) go-mode-keywords)))
-
-(defun go--match-func (end)
-  "Search for identifiers used as type names from a function
-parameter list, and set the identifier positions as the results
-of last search.  Return t if search succeeded."
-  (when (re-search-forward "\\_<func\\_>" end t)
-    (let ((regions (go--match-func-type-names end)))
-      (if (null regions)
-          ;; Nothing to highlight. This can happen if the current func
-          ;; is "func()". Try next one.
-          (go--match-func end)
-        ;; There are something to highlight. Set those positions as
-        ;; last search results.
-        (setq regions (go--filter-match-data regions end))
-        (when regions
-          (set-match-data (go--make-match-data regions))
-          t)))))
-
-(defun go--match-func-type-names (end)
-  (cond
-   ;; Function declaration (e.g. "func foo(")
-   ((looking-at (concat "[[:space:]\n]*" go-identifier-regexp "[[:space:]\n]*("))
-    (goto-char (match-end 0))
-    (nconc (go--match-parameter-list end)
-           (go--match-function-result end)))
-   ;; Method declaration, function literal, or function type
-   ((looking-at "[[:space:]]*(")
-    (goto-char (match-end 0))
-    (let ((regions (go--match-parameter-list end)))
-      ;; Method declaration (e.g. "func (x y) foo(")
-      (when (looking-at (concat "[[:space:]]*" go-identifier-regexp "[[:space:]\n]*("))
-        (goto-char (match-end 0))
-        (setq regions (nconc regions (go--match-parameter-list end))))
-      (nconc regions (go--match-function-result end))))))
-
-(defun go--parameter-list-type (end)
-  "Return `present' if the parameter list has names, or `absent' if not.
-Assumes point is at the beginning of a parameter list, just
-after '('."
-  (save-excursion
-    (skip-chars-forward "[:space:]\n" end)
-    (cond ((> (point) end)
-           nil)
-          ((looking-at (concat go-identifier-regexp "[[:space:]\n]*,"))
-           (goto-char (match-end 0))
-           (go--parameter-list-type end))
-          ((or (looking-at go-qualified-identifier-regexp)
-               (looking-at (concat go-type-name-no-prefix-regexp "[[:space:]\n]*\\(?:)\\|\\'\\)"))
-               (go--looking-at-keyword)
-               (looking-at "[*\\[]\\|\\.\\.\\.\\|\\'"))
-           'absent)
-          (t 'present))))
-
-(defconst go--opt-dotdotdot-regexp "\\(?:\\.\\.\\.\\)?")
-(defconst go--parameter-type-regexp
-  (concat go--opt-dotdotdot-regexp "[[:space:]*\n]*\\(" go-type-name-no-prefix-regexp "\\)[[:space:]\n]*\\([,)]\\|\\'\\)"))
-(defconst go--func-type-in-parameter-list-regexp
-  (concat go--opt-dotdotdot-regexp "[[:space:]*\n]*\\(\\_<func\\_>" "\\)"))
-
-(defun go--match-parameters-common (identifier-regexp end)
-  (let ((acc ())
-        (start -1))
-    (while (progn (skip-chars-forward "[:space:]\n" end)
-                  (and (not (looking-at "\\(?:)\\|\\'\\)"))
-                       (< start (point))
-                       (<= (point) end)))
-      (setq start (point))
-      (cond
-       ((looking-at (concat identifier-regexp go--parameter-type-regexp))
-        (setq acc (nconc acc (list (match-beginning 1) (match-end 1))))
-        (goto-char (match-beginning 2)))
-       ((looking-at (concat identifier-regexp go--func-type-in-parameter-list-regexp))
-        (goto-char (match-beginning 1))
-        (setq acc (nconc acc (go--match-func-type-names end)))
-        (go--search-next-comma end))
-       (t
-        (go--search-next-comma end))))
-    (when (and (looking-at ")")
-               (< (point) end))
-      (forward-char))
-    acc))
-
-(defun go--match-parameters-with-identifier-list (end)
-  (go--match-parameters-common
-   (concat go-identifier-regexp "[[:space:]\n]+")
-   end))
-
-(defun go--match-parameters-without-identifier-list (end)
-  (go--match-parameters-common "" end))
-
-(defun go--filter-match-data (regions end)
-  "Remove points from REGIONS if they are beyond END.
-REGIONS are a list whose size is multiple of 2.  Element 2n is beginning of a
-region and 2n+1 is end of it.
-
-This function is used to make sure we don't override end point
-that `font-lock-mode' gave to us."
-  (when regions
-    (let* ((vec (vconcat regions))
-           (i 0)
-           (len (length vec)))
-      (while (and (< i len)
-                  (<= (nth i regions) end)
-                  (<= (nth (1+ i) regions) end))
-        (setq i (+ i 2)))
-      (cond ((= i len)
-             regions)
-            ((zerop i)
-             nil)
-            (t
-             (butlast regions (- (length regions) i)))))))
-
-(defun go--make-match-data (regions)
-  (let ((deficit (- (* 2 go--font-lock-func-param-num-groups)
-                    (length regions))))
-    (when (> deficit 0)
-      (let ((last (car (last regions))))
-        (setq regions (nconc regions (make-list deficit last))))))
-  `(,(car regions) ,@(last regions) ,@regions))
-
-(defun go--match-parameter-list (end)
-  "Return a list of identifier positions that are used as type
-names in a function parameter list, assuming point is at the
-beginning of a parameter list.  Return nil if the text after
-point does not look like a parameter list.
-
-Set point to end of closing parenthesis on success.
-
-In Go, the names must either all be present or all be absent
-within a list of parameters.
-
-Parsing a parameter list is a little bit complicated because we
-have to scan through the parameter list to determine whether or
-not the list has names. Until a type name is found or reaching
-end of a parameter list, we are not sure which form the parameter
-list is.
-
-For example, X and Y are type names in a parameter list \"(X,
-Y)\" but are parameter names in \"(X, Y int)\". We cannot say if
-X is a type name until we see int after Y.
-
-Note that even \"(int, float T)\" is a valid parameter
-list. Builtin type names are not reserved words. In this example,
-int and float are parameter names and only T is a type name.
-
-In this function, we first scan the parameter list to see if the
-list has names, and then handle it accordingly."
-  (let ((name (go--parameter-list-type end)))
-    (cond ((eq name 'present)
-           (go--match-parameters-with-identifier-list end))
-          ((eq name 'absent)
-           (go--match-parameters-without-identifier-list end))
-          (t nil))))
-
-(defun go--match-function-result (end)
-  "Return a list of identifier positions that are used as type
-names in a function result, assuming point is at the beginning of
-a result.
-
-Function result is a unparenthesized type or a parameter list."
-  (cond ((and (looking-at (concat "[[:space:]*]*\\(" go-type-name-no-prefix-regexp "\\)"))
-              (not (member (match-string 1) go-mode-keywords)))
-         (list (match-beginning 1) (match-end 1)))
-        ((looking-at "[[:space:]]*(")
-         (goto-char (match-end 0))
-         (go--match-parameter-list end))
-        (t nil)))
-
-(defun go--reset-dangling-cache-before-change (&optional _beg _end)
-  "Reset `go-dangling-cache'.
-
-This is intended to be called from `before-change-functions'."
-  (setq go-dangling-cache (make-hash-table :test 'eql)))
-
-;;;###autoload
-(define-derived-mode go-mode prog-mode "Go"
-  "Major mode for editing Go source text.
-
-This mode provides (not just) basic editing capabilities for
-working with Go code. It offers almost complete syntax
-highlighting, indentation that is almost identical to gofmt and
-proper parsing of the buffer content to allow features such as
-navigation by function, manipulation of comments or detection of
-strings.
-
-In addition to these core features, it offers various features to
-help with writing Go code. You can directly run buffer content
-through gofmt, read godoc documentation from within Emacs, modify
-and clean up the list of package imports or interact with the
-Playground (uploading and downloading pastes).
-
-The following extra functions are defined:
-
-- `gofmt'
-- `godoc' and `godoc-at-point'
-- `go-import-add'
-- `go-remove-unused-imports'
-- `go-goto-arguments'
-- `go-goto-docstring'
-- `go-goto-function'
-- `go-goto-function-name'
-- `go-goto-imports'
-- `go-goto-return-values'
-- `go-goto-method-receiver'
-- `go-play-buffer' and `go-play-region'
-- `go-download-play'
-- `godef-describe' and `godef-jump'
-- `go-coverage'
-- `go-set-project'
-- `go-reset-gopath'
-
-If you want to automatically run `gofmt' before saving a file,
-add the following hook to your emacs configuration:
-
-\(add-hook 'before-save-hook #'gofmt-before-save)
-
-If you want to use `godef-jump' instead of etags (or similar),
-consider binding godef-jump to `M-.', which is the default key
-for `find-tag':
-
-\(add-hook 'go-mode-hook (lambda ()
-                          (local-set-key (kbd \"M-.\") #'godef-jump)))
-
-Please note that godef is an external dependency. You can install
-it with
-
-go get github.com/rogpeppe/godef
-
-
-If you're looking for even more integration with Go, namely
-on-the-fly syntax checking, auto-completion and snippets, it is
-recommended that you look at flycheck
-\(see URL `https://github.com/flycheck/flycheck') or flymake in combination
-with goflymake \(see URL `https://github.com/dougm/goflymake'), gocode
-\(see URL `https://github.com/nsf/gocode'), go-eldoc
-\(see URL `github.com/syohex/emacs-go-eldoc') and yasnippet-go
-\(see URL `https://github.com/dominikh/yasnippet-go')"
-
-  ;; Font lock
-  (set (make-local-variable 'font-lock-defaults)
-       '(go--build-font-lock-keywords))
-
-  ;; Indentation
-  (set (make-local-variable 'indent-line-function) #'go-mode-indent-line)
-
-  ;; Comments
-  (set (make-local-variable 'comment-start) "// ")
-  (set (make-local-variable 'comment-end)   "")
-  (set (make-local-variable 'comment-use-syntax) t)
-  (set (make-local-variable 'comment-start-skip) "\\(//+\\|/\\*+\\)\\s *")
-
-  (set (make-local-variable 'beginning-of-defun-function) #'go-beginning-of-defun)
-  (set (make-local-variable 'end-of-defun-function) #'go-end-of-defun)
-
-  (set (make-local-variable 'parse-sexp-lookup-properties) t)
-  (set (make-local-variable 'syntax-propertize-function) #'go-propertize-syntax)
-
-  (if (boundp 'electric-indent-chars)
-      (set (make-local-variable 'electric-indent-chars) '(?\n ?} ?\))))
-
-  (set (make-local-variable 'compilation-error-screen-columns) nil)
-
-  (set (make-local-variable 'go-dangling-cache) (make-hash-table :test 'eql))
-  (add-hook 'before-change-functions #'go--reset-dangling-cache-before-change t t)
-
-  ;; ff-find-other-file
-  (setq ff-other-file-alist 'go-other-file-alist)
-
-  (setq imenu-generic-expression
-        '(("type" "^type *\\([^ \t\n\r\f]*\\)" 1)
-          ("func" "^func *\\(.*\\) {" 1)))
-  (imenu-add-to-menubar "Index")
-
-  ;; Go style
-  (setq indent-tabs-mode t)
-
-  ;; Handle unit test failure output in compilation-mode
-  ;;
-  ;; Note that we add our entry to the beginning of
-  ;; compilation-error-regexp-alist. In older versions of Emacs, the
-  ;; list was processed from the end, and we would've wanted to add
-  ;; ours last. But at some point this changed, and now the list is
-  ;; processed from the beginning. It's important that our entry comes
-  ;; before gnu, because gnu matches go test output, but includes the
-  ;; leading whitespace in the file name.
-  ;;
-  ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2001-12/msg00674.html
-  ;; documents the old, reverseed order.
-  (when (and (boundp 'compilation-error-regexp-alist)
-             (boundp 'compilation-error-regexp-alist-alist))
-    (add-to-list 'compilation-error-regexp-alist 'go-test)
-    (add-to-list 'compilation-error-regexp-alist-alist
-                 '(go-test . ("^\t+\\([^()\t\n]+\\):\\([0-9]+\\):? .*$" 1 2)) t)))
-
-;;;###autoload
-(add-to-list 'auto-mode-alist (cons "\\.go\\'" 'go-mode))
-
-(defun go--apply-rcs-patch (patch-buffer)
-  "Apply an RCS-formatted diff from PATCH-BUFFER to the current buffer."
-  (let ((target-buffer (current-buffer))
-        ;; Relative offset between buffer line numbers and line numbers
-        ;; in patch.
-        ;;
-        ;; Line numbers in the patch are based on the source file, so
-        ;; we have to keep an offset when making changes to the
-        ;; buffer.
-        ;;
-        ;; Appending lines decrements the offset (possibly making it
-        ;; negative), deleting lines increments it. This order
-        ;; simplifies the forward-line invocations.
-        (line-offset 0))
-    (save-excursion
-      (with-current-buffer patch-buffer
-        (goto-char (point-min))
-        (while (not (eobp))
-          (unless (looking-at "^\\([ad]\\)\\([0-9]+\\) \\([0-9]+\\)")
-            (error "Invalid rcs patch or internal error in go--apply-rcs-patch"))
-          (forward-line)
-          (let ((action (match-string 1))
-                (from (string-to-number (match-string 2)))
-                (len  (string-to-number (match-string 3))))
-            (cond
-             ((equal action "a")
-              (let ((start (point)))
-                (forward-line len)
-                (let ((text (buffer-substring start (point))))
-                  (with-current-buffer target-buffer
-                    (cl-decf line-offset len)
-                    (goto-char (point-min))
-                    (forward-line (- from len line-offset))
-                    (insert text)))))
-             ((equal action "d")
-              (with-current-buffer target-buffer
-                (go--goto-line (- from line-offset))
-                (cl-incf line-offset len)
-                (go--delete-whole-line len)))
-             (t
-              (error "Invalid rcs patch or internal error in go--apply-rcs-patch")))))))))
-
-(defun gofmt--is-goimports-p ()
-  (string-equal (file-name-base gofmt-command) "goimports"))
-
-(defun gofmt ()
-  "Format the current buffer according to the formatting tool.
-
-The tool used can be set via ‘gofmt-command` (default: gofmt) and additional
-arguments can be set as a list via ‘gofmt-args`."
-  (interactive)
-  (let ((tmpfile (make-temp-file "gofmt" nil ".go"))
-        (patchbuf (get-buffer-create "*Gofmt patch*"))
-        (errbuf (if gofmt-show-errors (get-buffer-create "*Gofmt Errors*")))
-        (coding-system-for-read 'utf-8)
-        (coding-system-for-write 'utf-8)
-        our-gofmt-args)
-
-    (unwind-protect
-        (save-restriction
-          (widen)
-          (if errbuf
-              (with-current-buffer errbuf
-                (setq buffer-read-only nil)
-                (erase-buffer)))
-          (with-current-buffer patchbuf
-            (erase-buffer))
-
-          (write-region nil nil tmpfile)
-
-          (when (and (gofmt--is-goimports-p) buffer-file-name)
-            (setq our-gofmt-args
-                  (append our-gofmt-args
-                          ;; srcdir, despite its name, supports
-                          ;; accepting a full path, and some features
-                          ;; of goimports rely on knowing the full
-                          ;; name.
-                          (list "-srcdir" (file-truename buffer-file-name)))))
-          (setq our-gofmt-args (append our-gofmt-args
-                                       gofmt-args
-                                       (list "-w" tmpfile)))
-          (message "Calling gofmt: %s %s" gofmt-command our-gofmt-args)
-          ;; We're using errbuf for the mixed stdout and stderr output. This
-          ;; is not an issue because gofmt -w does not produce any stdout
-          ;; output in case of success.
-          (if (zerop (apply #'call-process gofmt-command nil errbuf nil our-gofmt-args))
-              (progn
-                (if (zerop (call-process-region (point-min) (point-max) "diff" nil patchbuf nil "-n" "-" tmpfile))
-                    (message "Buffer is already gofmted")
-                  (go--apply-rcs-patch patchbuf)
-                  (message "Applied gofmt"))
-                (if errbuf (gofmt--kill-error-buffer errbuf)))
-            (message "Could not apply gofmt")
-            (if errbuf (gofmt--process-errors (buffer-file-name) tmpfile errbuf))))
-
-      (kill-buffer patchbuf)
-      (delete-file tmpfile))))
-
-
-(defun gofmt--process-errors (filename tmpfile errbuf)
-  (with-current-buffer errbuf
-    (if (eq gofmt-show-errors 'echo)
-        (progn
-          (message "%s" (buffer-string))
-          (gofmt--kill-error-buffer errbuf))
-      ;; Convert the gofmt stderr to something understood by the compilation mode.
-      (goto-char (point-min))
-      (if (save-excursion
-            (save-match-data
-              (search-forward "flag provided but not defined: -srcdir" nil t)))
-          (insert "Your version of goimports is too old and doesn't support vendoring. Please update goimports!\n\n"))
-      (insert "gofmt errors:\n")
-      (let ((truefile
-             (if (gofmt--is-goimports-p)
-                 (concat (file-name-directory filename) (file-name-nondirectory tmpfile))
-               tmpfile)))
-        (while (search-forward-regexp (concat "^\\(" (regexp-quote truefile) "\\):") nil t)
-          (replace-match (file-name-nondirectory filename) t t nil 1)))
-      (compilation-mode)
-      (display-buffer errbuf))))
-
-(defun gofmt--kill-error-buffer (errbuf)
-  (let ((win (get-buffer-window errbuf)))
-    (if win
-        (quit-window t win)
-      (kill-buffer errbuf))))
-
-;;;###autoload
-(defun gofmt-before-save ()
-  "Add this to .emacs to run gofmt on the current buffer when saving:
-\(add-hook 'before-save-hook 'gofmt-before-save).
-
-Note that this will cause ‘go-mode’ to get loaded the first time
-you save any file, kind of defeating the point of autoloading."
-
-  (interactive)
-  (when (eq major-mode 'go-mode) (gofmt)))
-
-(defun godoc--read-query ()
-  "Read a godoc query from the minibuffer."
-  (if godoc-use-completing-read
-      (completing-read "godoc; "
-                       (go-packages) nil nil nil 'go-godoc-history)
-    (read-from-minibuffer "godoc: " nil nil nil 'go-godoc-history)))
-
-(defun godoc--get-buffer (query)
-  "Get an empty buffer for a godoc QUERY."
-  (let* ((buffer-name (concat "*godoc " query "*"))
-         (buffer (get-buffer buffer-name)))
-    ;; Kill the existing buffer if it already exists.
-    (when buffer (kill-buffer buffer))
-    (get-buffer-create buffer-name)))
-
-(defun godoc--buffer-sentinel (proc event)
-  "Sentinel function run when godoc command completes."
-  (with-current-buffer (process-buffer proc)
-    (cond ((string= event "finished\n")  ;; Successful exit.
-           (goto-char (point-min))
-           (godoc-mode)
-           (display-buffer (current-buffer) t))
-          ((/= (process-exit-status proc) 0)  ;; Error exit.
-           (let ((output (buffer-string)))
-             (kill-buffer (current-buffer))
-             (message (concat "godoc: " output)))))))
-
-(define-derived-mode godoc-mode special-mode "Godoc"
-  "Major mode for showing Go documentation."
-  (view-mode-enter))
-
-;;;###autoload
-(defun godoc (query)
-  "Show Go documentation for QUERY, much like \\<go-mode-map>\\[man]."
-  (interactive (list (godoc--read-query)))
-  (go--godoc query godoc-command))
-
-(defun go--godoc (query command)
-  (unless (string= query "")
-    (set-process-sentinel
-     (start-process-shell-command "godoc" (godoc--get-buffer query)
-                                  (concat command " " query))
-     'godoc--buffer-sentinel)
-    nil))
-
-(defun godoc-at-point (point)
-  "Show Go documentation for the identifier at POINT.
-
-It uses `godoc-at-point-function' to look up the documentation."
-  (interactive "d")
-  (funcall godoc-at-point-function point))
-
-(defun go-goto-imports ()
-  "Move point to the block of imports.
-
-If using
-
-  import (
-    \"foo\"
-    \"bar\"
-  )
-
-it will move point directly behind the last import.
-
-If using
-
-  import \"foo\"
-  import \"bar\"
-
-it will move point to the next line after the last import.
-
-If no imports can be found, point will be moved after the package
-declaration."
-  (interactive)
-  ;; FIXME if there's a block-commented import before the real
-  ;; imports, we'll jump to that one.
-
-  ;; Generally, this function isn't very forgiving. it'll bark on
-  ;; extra whitespace. It works well for clean code.
-  (let ((old-point (point)))
-    (goto-char (point-min))
-    (cond
-     ((re-search-forward "^import ()" nil t)
-      (backward-char 1)
-      'block-empty)
-     ((re-search-forward "^import ([^)]+)" nil t)
-      (backward-char 2)
-      'block)
-     ((re-search-forward "\\(^import \\([^\"]+ \\)?\"[^\"]+\"\n?\\)+" nil t)
-      'single)
-     ((re-search-forward "^[[:space:]\n]*package .+?\n" nil t)
-      (message "No imports found, moving point after package declaration")
-      'none)
-     (t
-      (goto-char old-point)
-      (message "No imports or package declaration found. Is this really a Go file?")
-      'fail))))
-
-(defun go-play-buffer ()
-  "Like `go-play-region', but acts on the entire buffer."
-  (interactive)
-  (go-play-region (point-min) (point-max)))
-
-(defun go-play-region (start end)
-  "Send the region between START and END to the Playground.
-If non-nil `go-play-browse-function' is called with the
-Playground URL."
-  (interactive "r")
-  (let* ((url-request-method "POST")
-         (url-request-extra-headers
-          '(("Content-Type" . "application/x-www-form-urlencoded")))
-         (url-request-data
-          (encode-coding-string
-           (buffer-substring-no-properties start end)
-           'utf-8))
-         (content-buf (url-retrieve
-                       "https://play.golang.org/share"
-                       (lambda (arg)
-                         (cond
-                          ((equal :error (car arg))
-                           (signal 'go-play-error (cdr arg)))
-                          (t
-                           (re-search-forward "\n\n")
-                           (let ((url (format "https://play.golang.org/p/%s"
-                                              (buffer-substring (point) (point-max)))))
-                             (when go-play-browse-function
-                               (funcall go-play-browse-function url)))))))))))
-
-;;;###autoload
-(defun go-download-play (url)
-  "Download a paste from the playground and insert it in a Go buffer.
-Tries to look for a URL at point."
-  (interactive (list (read-from-minibuffer "Playground URL: " (ffap-url-p (ffap-string-at-point 'url)))))
-  (with-current-buffer
-      (let ((url-request-method "GET") url-request-data url-request-extra-headers)
-        (url-retrieve-synchronously (concat url ".go")))
-    (let ((buffer (generate-new-buffer (concat (car (last (split-string url "/"))) ".go"))))
-      (goto-char (point-min))
-      (re-search-forward "\n\n")
-      (copy-to-buffer buffer (point) (point-max))
-      (kill-buffer)
-      (with-current-buffer buffer
-        (go-mode)
-        (switch-to-buffer buffer)))))
-
-(defun go-propertize-syntax (start end)
-  (save-excursion
-    (goto-char start)
-    (while (search-forward "\\" end t)
-      (put-text-property (1- (point)) (point) 'syntax-table (if (= (char-after) ?`) '(1) '(9))))))
-
-(defun go-import-add (arg import)
-  "Add a new IMPORT to the list of imports.
-
-When called with a prefix ARG asks for an alternative name to
-import the package as.
-
-If no list exists yet, one will be created if possible.
-
-If an identical import has been commented, it will be
-uncommented, otherwise a new import will be added."
-
-  ;; - If there's a matching `// import "foo"`, uncomment it
-  ;; - If we're in an import() block and there's a matching `"foo"`, uncomment it
-  ;; - Otherwise add a new import, with the appropriate syntax
-  (interactive
-   (list
-    current-prefix-arg
-    (replace-regexp-in-string "^[\"']\\|[\"']$" "" (completing-read "Package: " (go-packages)))))
-  (save-excursion
-    (let (as line import-start)
-      (if arg
-          (setq as (read-from-minibuffer "Import as: ")))
-      (if as
-          (setq line (format "%s \"%s\"" as import))
-        (setq line (format "\"%s\"" import)))
-
-      (goto-char (point-min))
-      (if (re-search-forward (concat "^[[:space:]]*//[[:space:]]*import " line "$") nil t)
-          (uncomment-region (line-beginning-position) (line-end-position))
-        (cl-case (go-goto-imports)
-          ('fail (message "Could not find a place to add import."))
-          ('block-empty
-           (insert "\n\t" line "\n"))
-          ('block
-              (save-excursion
-                (re-search-backward "^import (")
-                (setq import-start (point)))
-            (if (re-search-backward (concat "^[[:space:]]*//[[:space:]]*" line "$")  import-start t)
-                (uncomment-region (line-beginning-position) (line-end-position))
-              (insert "\n\t" line)))
-          ('single (insert "import " line "\n"))
-          ('none (insert "\nimport (\n\t" line "\n)\n")))))))
-
-(defun go-root-and-paths ()
-  (let* ((output (process-lines go-command "env" "GOROOT" "GOPATH"))
-         (root (car output))
-         (paths (split-string (cadr output) path-separator)))
-    (cons root paths)))
-
-(defun go--string-prefix-p (s1 s2 &optional ignore-case)
-  "Return non-nil if S1 is a prefix of S2.
-If IGNORE-CASE is non-nil, the comparison is case-insensitive."
-  (eq t (compare-strings s1 nil nil
-                         s2 0 (length s1) ignore-case)))
-
-(defun go--directory-dirs (dir)
-  "Recursively return all subdirectories in DIR."
-  (if (file-directory-p dir)
-      (let ((dir (directory-file-name dir))
-            (dirs '())
-            (files (directory-files dir nil nil t)))
-        (dolist (file files)
-          (unless (member file '("." ".."))
-            (let ((file (concat dir "/" file)))
-              (if (file-directory-p file)
-                  (setq dirs (append (cons file
-                                           (go--directory-dirs file))
-                                     dirs))))))
-        dirs)
-    '()))
-
-
-(defun go-packages ()
-  (funcall go-packages-function))
-
-(defun go-packages-native ()
-  "Return a list of all installed Go packages.
-It looks for archive files in /pkg/."
-  (sort
-   (delete-dups
-    (cl-mapcan
-     (lambda (topdir)
-       (let ((pkgdir (concat topdir "/pkg/")))
-         (cl-mapcan (lambda (dir)
-                   (mapcar (lambda (file)
-                             (let ((sub (substring file (length pkgdir) -2)))
-                               (unless (or (go--string-prefix-p "obj/" sub) (go--string-prefix-p "tool/" sub))
-                                 (mapconcat #'identity (cdr (split-string sub "/")) "/"))))
-                           (if (file-directory-p dir)
-                               (directory-files dir t "\\.a$"))))
-                 (if (file-directory-p pkgdir)
-                     (go--directory-dirs pkgdir)))))
-     (go-root-and-paths)))
-   #'string<))
-
-(defun go-packages-go-list ()
-  "Return a list of all Go packages, using `go list'."
-  (process-lines go-command "list" "-e" "all"))
-
-(defun go-unused-imports-lines ()
-  (reverse (remove nil
-                   (mapcar
-                    (lambda (line)
-                      (when (string-match "^\\(.+\\):\\([[:digit:]]+\\): imported and not used: \".+\".*$" line)
-                        (let ((error-file-name (match-string 1 line))
-                              (error-line-num (match-string 2 line)))
-                          (if (string= (file-truename error-file-name) (file-truename buffer-file-name))
-                              (string-to-number error-line-num)))))
-                    (split-string (shell-command-to-string
-                                   (concat go-command
-                                           (if (string-match "_test\\.go$" buffer-file-truename)
-                                               " test -c"
-                                             (concat " build -o " null-device))
-                                           " -gcflags=-e"
-                                           " "
-                                           (shell-quote-argument (file-truename buffer-file-name)))) "\n")))))
-
-(defun go-remove-unused-imports (arg)
-  "Remove all unused imports.
-If ARG is non-nil, unused imports will be commented, otherwise
-they will be removed completely."
-  (interactive "P")
-  (save-excursion
-    (let ((cur-buffer (current-buffer)) flymake-state lines)
-      (when (boundp 'flymake-mode)
-        (setq flymake-state flymake-mode)
-        (flymake-mode-off))
-      (save-some-buffers nil (lambda () (equal cur-buffer (current-buffer))))
-      (if (buffer-modified-p)
-          (message "Cannot operate on unsaved buffer")
-        (setq lines (go-unused-imports-lines))
-        (dolist (import lines)
-          (go--goto-line import)
-          (beginning-of-line)
-          (if arg
-              (comment-region (line-beginning-position) (line-end-position))
-            (go--delete-whole-line)))
-        (message "Removed %d imports" (length lines)))
-      (if flymake-state (flymake-mode-on)))))
-
-(defun godef--find-file-line-column (specifier other-window)
-  "Given a file name in the format of `filename:line:column',
-visit FILENAME and go to line LINE and column COLUMN."
-  (if (not (string-match "\\(.+\\):\\([0-9]+\\):\\([0-9]+\\)" specifier))
-      ;; We've only been given a directory name
-      (funcall (if other-window #'find-file-other-window #'find-file) specifier)
-    (let ((filename (match-string 1 specifier))
-          (line (string-to-number (match-string 2 specifier)))
-          (column (string-to-number (match-string 3 specifier))))
-      (funcall (if other-window #'find-file-other-window #'find-file) filename)
-      (go--goto-line line)
-      (beginning-of-line)
-      (forward-char (1- column))
-      (if (buffer-modified-p)
-          (message "Buffer is modified, file position might not have been correct")))))
-
-(defun godef--call (point)
-  "Call godef, acquiring definition position and expression
-description at POINT."
-  (if (not (buffer-file-name (go--coverage-origin-buffer)))
-      (error "Cannot use godef on a buffer without a file name")
-    (let ((outbuf (generate-new-buffer "*godef*"))
-          (coding-system-for-read 'utf-8)
-          (coding-system-for-write 'utf-8))
-      (prog2
-          (call-process-region (point-min)
-                               (point-max)
-                               godef-command
-                               nil
-                               outbuf
-                               nil
-                               "-i"
-                               "-t"
-                               "-f"
-                               (file-truename (buffer-file-name (go--coverage-origin-buffer)))
-                               "-o"
-                               ;; Emacs point and byte positions are 1-indexed.
-                               (number-to-string (1- (position-bytes point))))
-          (with-current-buffer outbuf
-            (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n"))
-        (kill-buffer outbuf)))))
-
-(defun godef--successful-p (output)
-  (not (or (string= "-" output)
-           (string= "godef: no identifier found" output)
-           (go--string-prefix-p "godef: no declaration found for " output)
-           (go--string-prefix-p "error finding import path for " output))))
-
-(defun godef--error (output)
-  (cond
-   ((godef--successful-p output)
-    nil)
-   ((string= "-" output)
-    "godef: expression is not defined anywhere")
-   (t
-    output)))
-
-(defun godef-describe (point)
-  "Describe the expression at POINT."
-  (interactive "d")
-  (condition-case nil
-      (let ((description (cdr (butlast (godef--call point) 1))))
-        (if (not description)
-            (message "No description found for expression at point")
-          (message "%s" (mapconcat #'identity description "\n"))))
-    (file-error (message "Could not run godef binary"))))
-
-(defun godef-jump (point &optional other-window)
-  "Jump to the definition of the expression at POINT."
-  (interactive "d")
-  (condition-case nil
-      (let ((file (car (godef--call point))))
-        (if (not (godef--successful-p file))
-            (message "%s" (godef--error file))
-          (push-mark)
-          (if (eval-when-compile (fboundp 'xref-push-marker-stack))
-              ;; TODO: Integrate this facility with XRef.
-              (xref-push-marker-stack)
-            (ring-insert find-tag-marker-ring (point-marker)))
-          (godef--find-file-line-column file other-window)))
-    (file-error (message "Could not run godef binary"))))
-
-(defun godef-jump-other-window (point)
-  (interactive "d")
-  (godef-jump point t))
-
-(defun go--goto-line (line)
-  (goto-char (point-min))
-  (forward-line (1- line)))
-
-(defun go--line-column-to-point (line column)
-  (save-excursion
-    (go--goto-line line)
-    (forward-char (1- column))
-    (point)))
-
-(cl-defstruct go--covered
-  start-line start-column end-line end-column covered count)
-
-(defun go--coverage-file ()
-  "Return the coverage file to use, either by reading it from the
-current coverage buffer or by prompting for it."
-  (if (boundp 'go--coverage-current-file-name)
-      go--coverage-current-file-name
-    (read-file-name "Coverage file: " nil nil t)))
-
-(defun go--coverage-origin-buffer ()
-  "Return the buffer to base the coverage on."
-  (or (buffer-base-buffer) (current-buffer)))
-
-(defun go--coverage-face (count divisor)
-  "Return the intensity face for COUNT when using DIVISOR
-to scale it to a range [0,10].
-
-DIVISOR scales the absolute cover count to values from 0 to 10.
-For DIVISOR = 0 the count will always translate to 8."
-  (let* ((norm (cond
-                ((= count 0)
-                 -0.1) ;; Uncovered code, set to -0.1 so n becomes 0.
-                ((= divisor 0)
-                 0.8) ;; covermode=set, set to 0.8 so n becomes 8.
-                (t
-                 (/ (log count) divisor))))
-         (n (1+ (floor (* norm 9))))) ;; Convert normalized count [0,1] to intensity [0,10]
-    (concat "go-coverage-" (number-to-string n))))
-
-(defun go--coverage-make-overlay (range divisor)
-  "Create a coverage overlay for a RANGE of covered/uncovered code.
-Use DIVISOR to scale absolute counts to a [0,10] scale."
-  (let* ((count (go--covered-count range))
-         (face (go--coverage-face count divisor))
-         (ov (make-overlay (go--line-column-to-point (go--covered-start-line range)
-                                                     (go--covered-start-column range))
-                           (go--line-column-to-point (go--covered-end-line range)
-                                                     (go--covered-end-column range)))))
-
-    (overlay-put ov 'face face)
-    (overlay-put ov 'help-echo (format "Count: %d" count))))
-
-(defun go--coverage-clear-overlays ()
-  "Remove existing overlays and put a single untracked overlay
-over the entire buffer."
-  (remove-overlays)
-  (overlay-put (make-overlay (point-min) (point-max))
-               'face
-               'go-coverage-untracked))
-
-(defun go--coverage-parse-file (coverage-file file-name)
-  "Parse COVERAGE-FILE and extract coverage information and
-divisor for FILE-NAME."
-  (let (ranges
-        (max-count 0))
-    (with-temp-buffer
-      (insert-file-contents coverage-file)
-      (go--goto-line 2) ;; Skip over mode
-      (while (not (eobp))
-        (let* ((parts (split-string (buffer-substring (point-at-bol) (point-at-eol)) ":"))
-               (file (car parts))
-               (rest (split-string (nth 1 parts) "[., ]")))
-
-          (cl-destructuring-bind
-              (start-line start-column end-line end-column num count)
-              (mapcar #'string-to-number rest)
-
-            (when (string= (file-name-nondirectory file) file-name)
-              (if (> count max-count)
-                  (setq max-count count))
-              (push (make-go--covered :start-line start-line
-                                      :start-column start-column
-                                      :end-line end-line
-                                      :end-column end-column
-                                      :covered (/= count 0)
-                                      :count count)
-                    ranges)))
-
-          (forward-line)))
-
-      (list ranges (if (> max-count 0) (log max-count) 0)))))
-
-(defun go-coverage (&optional coverage-file)
-  "Open a clone of the current buffer and overlay it with
-coverage information gathered via go test -coverprofile=COVERAGE-FILE.
-
-If COVERAGE-FILE is nil, it will either be inferred from the
-current buffer if it's already a coverage buffer, or be prompted
-for."
-  (interactive)
-  (let* ((cur-buffer (current-buffer))
-         (origin-buffer (go--coverage-origin-buffer))
-         (gocov-buffer-name (concat (buffer-name origin-buffer) "<gocov>"))
-         (coverage-file (or coverage-file (go--coverage-file)))
-         (ranges-and-divisor (go--coverage-parse-file
-                              coverage-file
-                              (file-name-nondirectory (buffer-file-name origin-buffer))))
-         (cov-mtime (nth 5 (file-attributes coverage-file)))
-         (cur-mtime (nth 5 (file-attributes (buffer-file-name origin-buffer)))))
-
-    (if (< (float-time cov-mtime) (float-time cur-mtime))
-        (message "Coverage file is older than the source file."))
-
-    (with-current-buffer (or (get-buffer gocov-buffer-name)
-                             (make-indirect-buffer origin-buffer gocov-buffer-name t))
-      (set (make-local-variable 'go--coverage-current-file-name) coverage-file)
-
-      (save-excursion
-        (go--coverage-clear-overlays)
-        (dolist (range (car ranges-and-divisor))
-          (go--coverage-make-overlay range (cadr ranges-and-divisor))))
-
-      (if (not (eq cur-buffer (current-buffer)))
-          (display-buffer (current-buffer) `(,go-coverage-display-buffer-func))))))
-
-(defun go-goto-function (&optional arg)
-  "Go to the function defintion (named or anonymous) surrounding point.
-
-If we are on a docstring, follow the docstring down.
-If no function is found, assume that we are at the top of a file
-and search forward instead.
-
-If point is looking at the func keyword of an anonymous function,
-go to the surrounding function.
-
-If ARG is non-nil, anonymous functions are ignored."
-  (interactive "P")
-  (let ((p (point)))
-    (cond
-     ((save-excursion
-        (beginning-of-line)
-        (looking-at "^//"))
-      ;; In case we are looking at the docstring, move on forward until we are
-      ;; not anymore
-      (beginning-of-line)
-      (while (looking-at "^//")
-        (forward-line 1))
-      ;; If we are still not looking at a function, retry by calling self again.
-      (when (not (looking-at "\\<func\\>"))
-        (go-goto-function arg)))
-
-     ;; If we're already looking at an anonymous func, look for the
-     ;; surrounding function.
-     ((and (looking-at "\\<func\\>")
-           (not (looking-at "^func\\>")))
-      (re-search-backward "\\<func\\>" nil t))
-
-     ((not (looking-at "\\<func\\>"))
-      ;; If point is on the "func" keyword, step back a word and retry
-      (if (string= (symbol-name (symbol-at-point)) "func")
-          (backward-word)
-        ;; If we are not looking at the beginning of a function line, do a regexp
-        ;; search backwards
-        (re-search-backward "\\<func\\>" nil t))
-
-      ;; If nothing is found, assume that we are at the top of the file and
-      ;; should search forward instead.
-      (when (not (looking-at "\\<func\\>"))
-        (re-search-forward "\\<func\\>" nil t)
-        (go--forward-word -1))
-
-      ;; If we have landed at an anonymous function, it is possible that we
-      ;; were not inside it but below it. If we were not inside it, we should
-      ;; go to the containing function.
-      (while (and (not (go--in-function-p p))
-                  (not (looking-at "^func\\>")))
-        (go-goto-function arg)))))
-
-  (cond
-   ((go-in-comment-p)
-    ;; If we are still in a comment, redo the call so that we get out of it.
-    (go-goto-function arg))
-
-   ((and (looking-at "\\<func(") arg)
-    ;; If we are looking at an anonymous function and a prefix argument has
-    ;; been supplied, redo the call so that we skip the anonymous function.
-    (go-goto-function arg))))
-
-(defun go--goto-opening-curly-brace ()
-  ;; Find the { that starts the function, i.e., the next { that isn't
-  ;; preceded by struct or interface, or a comment or struct tag.  BUG:
-  ;; breaks if there's a comment between the struct/interface keyword and
-  ;; bracket, like this:
-  ;;
-  ;;     struct /* why? */ {
-  (go--goto-return-values)
-  (while (progn
-           (skip-chars-forward "^{")
-           (forward-char)
-           (or (go-in-string-or-comment-p)
-               (looking-back "\\(struct\\|interface\\)\\s-*{"
-                             (line-beginning-position)))))
-  (backward-char))
-
-(defun go--in-function-p (compare-point)
-  "Return t if COMPARE-POINT lies inside the function immediately surrounding point."
-  (save-excursion
-    (when (not (looking-at "\\<func\\>"))
-      (go-goto-function))
-    (let ((start (point)))
-      (go--goto-opening-curly-brace)
-
-      (unless (looking-at "{")
-        (error "Expected to be looking at opening curly brace"))
-      (forward-list 1)
-      (and (>= compare-point start)
-           (<= compare-point (point))))))
-
-(defun go-goto-function-name (&optional arg)
-  "Go to the name of the current function.
-
-If the function is a test, place point after 'Test'.
-If the function is anonymous, place point on the 'func' keyword.
-
-If ARG is non-nil, anonymous functions are skipped."
-  (interactive "P")
-  (when (not (looking-at "\\<func\\>"))
-    (go-goto-function arg))
-  ;; If we are looking at func( we are on an anonymous function and
-  ;; nothing else should be done.
-  (when (not (looking-at "\\<func("))
-    (let ((words 1)
-          (chars 1))
-      (when (looking-at "\\<func (")
-        (setq words 3
-              chars 2))
-      (go--forward-word words)
-      (forward-char chars)
-      (when (looking-at "Test")
-        (forward-char 4)))))
-
-(defun go-goto-arguments (&optional arg)
-  "Go to the arguments of the current function.
-
-If ARG is non-nil, anonymous functions are skipped."
-  (interactive "P")
-  (go-goto-function-name arg)
-  (go--forward-word 1)
-  (forward-char 1))
-
-(defun go--goto-return-values (&optional arg)
-  "Go to the declaration of return values for the current function."
-  (go-goto-arguments arg)
-  (backward-char)
-  (forward-list)
-  (forward-char))
-
-(defun go-goto-return-values (&optional arg)
-  "Go to the return value declaration of the current function.
-
-If there are multiple ones contained in a parenthesis, enter the parenthesis.
-If there is none, make space for one to be added.
-
-If ARG is non-nil, anonymous functions are skipped."
-  (interactive "P")
-  (go--goto-return-values arg)
-
-  ;; Opening parenthesis, enter it
-  (when (looking-at "(")
-    (forward-char 1))
-
-  ;; No return arguments, add space for adding
-  (when (looking-at "{")
-    (insert " ")
-    (backward-char 1)))
-
-(defun go-goto-method-receiver (&optional arg)
-  "Go to the receiver of the current method.
-
-If there is none, add parenthesis to add one.
-
-Anonymous functions cannot have method receivers, so when this is called
-interactively anonymous functions will be skipped.  If called programmatically,
-an error is raised unless ARG is non-nil."
-  (interactive "P")
-
-  (when (and (not (called-interactively-p 'interactive))
-             (not arg)
-             (go--in-anonymous-funcion-p))
-    (error "Anonymous functions cannot have method receivers"))
-
-  (go-goto-function t)  ; Always skip anonymous functions
-  (forward-char 5)
-  (when (not (looking-at "("))
-    (save-excursion
-      (insert "() ")))
-  (forward-char 1))
-
-(defun go-goto-docstring (&optional arg)
-  "Go to the top of the docstring of the current function.
-
-If there is none, add one beginning with the name of the current function.
-
-Anonymous functions do not have docstrings, so when this is called
-interactively anonymous functions will be skipped.  If called programmatically,
-an error is raised unless ARG is non-nil."
-  (interactive "P")
-
-  (when (and (not (called-interactively-p 'interactive))
-             (not arg)
-             (go--in-anonymous-funcion-p))
-    (error "Anonymous functions do not have docstrings"))
-
-  (go-goto-function t)
-  (forward-line -1)
-  (beginning-of-line)
-
-  (while (looking-at "^//")
-    (forward-line -1))
-  (forward-line 1)
-  (beginning-of-line)
-
-  (cond
-   ;; If we are looking at an empty comment, add a single space in front of it.
-   ((looking-at "^//$")
-    (forward-char 2)
-    (insert (format " %s " (go--function-name t))))
-   ;; If we are not looking at the function signature, we are looking at a docstring.
-   ;; Move to the beginning of the first word of it.
-   ((not (looking-at "^func"))
-    (forward-char 3))
-   ;; If we are still at the function signature, we should add a new docstring.
-   (t
-    (forward-line -1)
-    (newline)
-    (insert "// ")
-    (insert (go--function-name t)))))
-
-(defun go--function-name (&optional arg)
-  "Return the name of the surrounding function.
-
-If ARG is non-nil, anonymous functions will be ignored and the
-name returned will be that of the top-level function.  If ARG is
-nil and the surrounding function is anonymous, nil will be
-returned."
-  (when (or (not (go--in-anonymous-funcion-p))
-            arg)
-    (save-excursion
-      (go-goto-function-name t)
-      (symbol-name (symbol-at-point)))))
-
-(defun go--in-anonymous-funcion-p ()
-  "Return t if point is inside an anonymous function, nil otherwise."
-  (save-excursion
-    (go-goto-function)
-    (looking-at "\\<func(")))
-
-(defun go-guess-gopath (&optional buffer)
-  "Determine a suitable GOPATH for BUFFER, or the current buffer if BUFFER is nil.
-
-This function supports gb-based projects as well as Godep, in
-addition to ordinary uses of GOPATH."
-  (with-current-buffer (or buffer (current-buffer))
-    (let ((gopath (cl-some (lambda (el) (funcall el))
-                           go-guess-gopath-functions)))
-      (if gopath
-          (mapconcat
-           (lambda (el) (file-truename el))
-           gopath
-           path-separator)))))
-
-(defun go-plain-gopath ()
-  "Detect a normal GOPATH, by looking for the first `src'
-directory up the directory tree."
-  (let ((d (locate-dominating-file buffer-file-name "src")))
-    (if d
-        (list d))))
-
-(defun go-godep-gopath ()
-  "Detect a Godeps workspace by looking for Godeps/_workspace up
-the directory tree. The result is combined with that of
-`go-plain-gopath'."
-  (let* ((d (locate-dominating-file buffer-file-name "Godeps"))
-         (workspace (concat d
-                            (file-name-as-directory "Godeps")
-                            (file-name-as-directory "_workspace"))))
-    (if (and d
-             (file-exists-p workspace))
-        (list workspace
-              (locate-dominating-file buffer-file-name "src")))))
-
-(defun go-gb-gopath ()
-  "Detect a gb project."
-  (or (go--gb-vendor-gopath)
-      (go--gb-vendor-gopath-reverse)))
-
-(defun go--gb-vendor-gopath ()
-  (let* ((d (locate-dominating-file buffer-file-name "src"))
-         (vendor (concat d (file-name-as-directory "vendor"))))
-    (if (and d
-             (file-exists-p vendor))
-        (list d vendor))))
-
-(defun go--gb-vendor-gopath-reverse ()
-  (let* ((d (locate-dominating-file buffer-file-name "vendor"))
-         (src (concat d (file-name-as-directory "src"))))
-    (if (and d
-             (file-exists-p src))
-        (list d (concat d
-                        (file-name-as-directory "vendor"))))))
-
-(defun go-wgo-gopath ()
-  "Detect a wgo project."
-  (or (go--wgo-gocfg "src")
-      (go--wgo-gocfg "vendor")))
-
-(defun go--wgo-gocfg (needle)
-  (let* ((d (locate-dominating-file buffer-file-name needle))
-         (gocfg (concat d (file-name-as-directory ".gocfg"))))
-    (if (and d
-             (file-exists-p gocfg))
-        (with-temp-buffer
-          (insert-file-contents (concat gocfg "gopaths"))
-          (append
-           (mapcar (lambda (el) (concat d (file-name-as-directory el))) (split-string (buffer-string) "\n" t))
-           (list (go-original-gopath)))))))
-
-(defun go-set-project (&optional buffer)
-  "Set GOPATH based on `go-guess-gopath' for BUFFER, or the current buffer if BUFFER is nil.
-
-If go-guess-gopath returns nil, that is if it couldn't determine
-a valid value for GOPATH, GOPATH will be set to the initial value
-of when Emacs was started.
-
-This function can for example be used as a
-projectile-switch-project-hook, or simply be called manually when
-switching projects."
-  (interactive)
-  (let ((gopath (or (go-guess-gopath buffer)
-                    (go-original-gopath))))
-    (setenv "GOPATH" gopath)
-    (message "Set GOPATH to %s" gopath)))
-
-(defun go-reset-gopath ()
-  "Reset GOPATH to the value it had when Emacs started."
-  (interactive)
-  (let ((gopath (go-original-gopath)))
-    (setenv "GOPATH" gopath)
-    (message "Set GOPATH to %s" gopath)))
-
-(defun go-original-gopath ()
-  "Return the original value of GOPATH from when Emacs was started."
-  (let ((process-environment initial-environment)) (getenv "GOPATH")))
-
-(defun go--insert-modified-files ()
-  "Insert the contents of each modified Go buffer into the
-current buffer in the format specified by guru's -modified flag."
-  (mapc #'(lambda (b)
-            (and (buffer-modified-p b)
-                 (buffer-file-name b)
-                 (string= (file-name-extension (buffer-file-name b)) "go")
-                 (go--insert-modified-file (buffer-file-name b) b)))
-        (buffer-list)))
-
-(defun go--insert-modified-file (name buffer)
-  (insert (format "%s\n%d\n" name (go--buffer-size-bytes buffer)))
-  (insert-buffer-substring buffer))
-
-(defun go--buffer-size-bytes (&optional buffer)
-  (message "buffer; %s" buffer)
-  "Return the number of bytes in the current buffer.
-If BUFFER, return the number of characters in that buffer instead."
-  (with-current-buffer (or buffer (current-buffer))
-    (1- (position-bytes (point-max)))))
-
-
-(provide 'go-mode)
-
-;;; go-mode.el ends here
.emacs.d/elpa/go-mode-20170726.555/go-mode.elc
Binary file
.emacs.d/elpa/goto-chg-20131228.659/goto-chg-autoloads.el
@@ -1,50 +0,0 @@
-;;; goto-chg-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "goto-chg" "goto-chg.el" (22968 12680 41528
-;;;;;;  650000))
-;;; Generated autoloads from goto-chg.el
-
-(autoload 'goto-last-change "goto-chg" "\
-Go to the point where the last edit was made in the current buffer.
-Repeat the command to go to the second last edit, etc.
-
-To go back to more recent edit, the reverse of this command, use \\[goto-last-change-reverse]
-or precede this command with \\[universal-argument] - (minus).
-
-It does not go to the same point twice even if there has been many edits
-there. I call the minimal distance between distinguishable edits \"span\".
-Set variable `glc-default-span' to control how close is \"the same point\".
-Default span is 8.
-The span can be changed temporarily with \\[universal-argument] right before \\[goto-last-change]:
-\\[universal-argument] <NUMBER> set current span to that number,
-\\[universal-argument] (no number) multiplies span by 4, starting with default.
-The so set span remains until it is changed again with \\[universal-argument], or the consecutive
-repetition of this command is ended by any other command.
-
-When span is zero (i.e. \\[universal-argument] 0) subsequent \\[goto-last-change] visits each and
-every point of edit and a message shows what change was made there.
-In this case it may go to the same point twice.
-
-This command uses undo information. If undo is disabled, so is this command.
-At times, when undo information becomes too large, the oldest information is
-discarded. See variable `undo-limit'.
-
-\(fn ARG)" t nil)
-
-(autoload 'goto-last-change-reverse "goto-chg" "\
-Go back to more recent changes after \\[goto-last-change] have been used.
-See `goto-last-change' for use of prefix argument.
-
-\(fn ARG)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; goto-chg-autoloads.el ends here
.emacs.d/elpa/goto-chg-20131228.659/goto-chg-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "goto-chg" "20131228.659" "goto last change" 'nil :keywords '("convenience" "matching"))
.emacs.d/elpa/goto-chg-20131228.659/goto-chg.el
@@ -1,316 +0,0 @@
-;;; goto-chg.el --- goto last change
-;;--------------------------------------------------------------------
-;;
-;; Copyright (C) 2002-2008,2013 David Andersson
-;;
-;; 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 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, write to the Free
-;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-;; MA 02111-1307 USA
-;;
-;;-------------------------------------------------------------------
-;;
-;; Author: David Andersson <l.david.andersson(at)sverige.nu>
-;; Created: 16 May 2002
-;; Version: 1.6
-;; Package-Version: 20131228.659
-;; Keywords: convenience, matching
-;;
-;;; Commentary:
-;;
-;; Goto Last Change
-;;
-;; Goto the point of the most recent edit in the buffer.
-;; When repeated, goto the second most recent edit, etc.
-;; Negative argument, C-u -, for reverse direction.
-;; Works by looking into buffer-undo-list to find points of edit.
-;;
-;; You would probably like to bind this command to a key.
-;; For example in your ~/.emacs:
-;;
-;;   (require 'goto-chg)
-;;
-;;   (global-set-key [(control ?.)] 'goto-last-change)
-;;   (global-set-key [(control ?,)] 'goto-last-change-reverse)
-;;
-;; Works with emacs-19.29, 19.31, 20.3, 20.7, 21.1, 21.4, 22.1 and 23.1
-;; Works with XEmacs-20.4 and 21.4 (but see todo about `last-command' below)
-;;
-;;--------------------------------------------------------------------
-;; History
-;;
-;; Ver 1.6 2013-12-12 David Andersson
-;;    Add keywords; Cleanup comments
-;; Ver 1.5 2013-12-11 David Andersson
-;;    Autoload and document `goto-last-change-reverse'
-;; Ver 1.4 2008-09-20 David Andersson
-;;    Improved property change description; Update comments.
-;; Ver 1.3 2007-03-14 David Andersson
-;;    Added `goto-last-change-reverse'
-;; Ver 1.2 2003-04-06 David Andersson
-;;    Don't let repeating error depthen glc-probe-depth.
-;; Ver 1.1 2003-04-06 David Andersson
-;;    Zero arg describe changes. Negative arg go back.
-;;    Autoload. Remove message using nil in stead of an empty string.
-;; Ver 1.0 2002-05-18 David Andersson
-;;    Initial version
-;;
-;;--------------------------------------------------------------------
-;;
-;;todo: Rename "goto-chg.el" -> "gotochange.el" or "goto-chgs" ?
-;;todo: Rename function goto-last-change -> goto-last-edit ?
-;;todo: Rename adjective "-last-" -> "-latest-" or "-most-recent-" ?
-;;todo: There are some, maybe useful, funcs  for region undo 
-;;       in simple.el in emacs 20. Take a look.
-;;todo: Add functionality to visit changed point in text order, not only in
-;;        chronological order. (Naa, highlight-changes-mode does that).
-;;todo: Inverse indication that a change has been saved or not
-;;todo: Highlight the range of text involved in the last change?
-;;todo: See session-jump-to-last-change in session.el?
-;;todo: Unhide invisible text (e.g. outline mode) like isearch do.
-;;todo: XEmacs sets last-command to `t' after an error, so you cannot reverse
-;;        after "No furter change info". Should we bother?
-;;todo: Try distinguish "No further change info" (end of truncated undo list)
-;;        and "No further changes" (end of a complete undo list).
-;;
-;;--------------------------------------------------------------------
-
-;;; Code:
-
-(defvar glc-default-span 8 "*goto-last-change don't visit the same point twice. glc-default-span tells how far around a visited point not to visit again.")
-(defvar glc-current-span 8 "Internal for goto-last-change.\nA copy of glc-default-span or the ARG passed to goto-last-change.")
-(defvar glc-probe-depth 0 "Internal for goto-last-change.\nIt is non-zero between successive goto-last-change.")
-
-;;todo: Find begin and end of line, then use it somewhere
-
-(defun glc-center-ellipsis (str maxlen &optional ellipsis)
-  "Truncate STRING in the middle to length MAXLEN.
-If STRING is max MAXLEN just return the string.
-Optional third argument is the replacement, which defaults to \"...\"."
-  (if (<= (length str) maxlen)
-      str
-    ;; else
-    (let* ((lipsis (or ellipsis "..."))
-	   (i (/ (- maxlen (length lipsis)) 2)))
-      (concat (substring str 0 i)
-	      lipsis 
-	      (substring str (- i))))))
-
-(defun glc-adjust-pos2 (pos p1 p2 adj)
-  ;; Helper function to glc-adjust-pos
-  ;; p1, p2: interval where an edit occured
-  ;; adj: amount of text added (positive) or removed (negativ) by the edit
-  ;; Return pos if well before p1, or pos+adj if well after p2, or nil if too close
-  (cond ((<= pos (- p1 glc-current-span))
-	 pos)
-	((> pos (+ p2 glc-current-span))
-	 (+ pos adj))
-	((zerop glc-current-span)
-	 p1)
-	(t
-	 nil)))
-
-(defun glc-adjust-pos (pos e)
-  "Given POS, a buffer position before the edit E, compute and return
-the \"same\" buffer position after E happened.
-Exception: return nil if POS is closer than `glc-current-span' to the edit E.
-\nInsertion edits before POS returns a larger value.
-Deletion edits before POS returns a smaller value.
-\nThe edit E is an entry from the `buffer-undo-list'. See for details."
-  (cond ((atom e)			; nil==cmd boundary, or, num==changed pos
-	 pos)
-	((numberp (car e))		; (beg . end)==insertion
-	 (glc-adjust-pos2 pos (car e) (car e) (- (cdr e) (car e))))
-	((stringp (car e))		; (string . pos)==deletion
-	 (glc-adjust-pos2 pos (abs (cdr e)) (+ (abs (cdr e)) (length (car e))) (- (length (car e)))))
-	((null (car e))			; (nil prop val beg . end)==prop change
-	 (glc-adjust-pos2 pos (nth 3 e) (nthcdr 4 e) 0))
-	(t				; (marker . dist)==marker moved
-	 pos)))
-
-;; If recursive in stead of iterative (while), it tends to fill the call stack.
-;; (Isn't it tail optimized?)
-(defun glc-adjust-list (r)
-  "R is list of edit entries in chronological order.
-Pick the point of the first edit entry and update that point with
-the second, third, etc, edit entries. Return the final updated point,
-or nil if the point was closer than `glc-current-span' to some edit in R.
-\nR is basically a reversed slice from the buffer-undo-list."
-  (if r
-      ;; Get pos
-      (let ((pos (glc-get-pos (car r))))
-	(setq r (cdr r))
-	;; Walk back in reverse list
-	(while (and r pos)
-	  (setq pos (glc-adjust-pos pos (car r))
-		r (cdr r)))
-	pos)
-    ;; else
-    nil))
-
-(defun glc-get-pos (e)
-  "If E represents an edit, return a position value in E, the position
-where the edit took place. Return nil if E represents no real change.
-\nE is an entry in the buffer-undo-list."
-  (cond ((numberp e) e)			; num==changed position
-	((atom e) nil)			; nil==command boundary
-	((numberp (car e)) (cdr e))	; (beg . end)==insertion
-	((stringp (car e)) (abs (cdr e))) ; (string . pos)==deletion
-	((null (car e)) (nthcdr 4 e))	; (nil ...)==text property change
-	((atom (car e)) nil)		; (t ...)==file modification time
-	(t nil)))			; (marker ...)==marker moved
-
-(defun glc-get-descript (e &optional n)
-  "If E represents an edit, return a short string describing E.
-Return nil if E represents no real change.
-\nE is an entry in the buffer-undo-list."
-  (let ((nn (or (format "T-%d: " n) "")))
-    (cond ((numberp e) "New position")	; num==changed position
-	  ((atom e) nil)		; nil==command boundary
-	  ((numberp (car e))		; (beg . end)==insertion
-	   (if (and n (< n 2))
-	       (format "%sInserted %d chars \"%s\"" nn (- (cdr e) (car e)) 
-		       (glc-center-ellipsis (buffer-substring (car e) (cdr e)) 60))
-	     ;; else
-	     ;; An older insert. The inserted text cannot easily be computed.
-	     ;; Just show the char count.
-	     (format "%sInserted %d chars" nn (- (cdr e) (car e)))))
-	  ((stringp (car e))		; (string . pos)==deletion
-	   (format "%sDeleted \"%s\"" nn (glc-center-ellipsis (car e) 60)))
-	  ((null (car e))		; (nil ...)==text property change
-	   (format "%sProperty change" nn))
-	  ((atom (car e)) nil)		; (t ...)==file modification time
-	  (t nil))))			; (marker ...)==marker moved
-
-(defun glc-is-positionable (e)
-  "Return non-nil if E is an insertion, deletion or text property change.
-\nE is an entry in the buffer-undo-list."
-  (and (not (numberp e)) (glc-get-pos e)))
-
-(defun glc-is-filetime (e)
-  "Return t if E indicates a buffer became \"modified\",
-that is, it was previously saved or unchanged. Nil otherwise."
-  (and (listp e) (eq (car e) t)))
-
-;;;###autoload
-(defun goto-last-change (arg)
-"Go to the point where the last edit was made in the current buffer.
-Repeat the command to go to the second last edit, etc.
-\nTo go back to more recent edit, the reverse of this command, use \\[goto-last-change-reverse]
-or precede this command with \\[universal-argument] - (minus).
-\nIt does not go to the same point twice even if there has been many edits
-there. I call the minimal distance between distinguishable edits \"span\".
-Set variable `glc-default-span' to control how close is \"the same point\".
-Default span is 8.
-The span can be changed temporarily with \\[universal-argument] right before \\[goto-last-change]:
-\\[universal-argument] <NUMBER> set current span to that number,
-\\[universal-argument] (no number) multiplies span by 4, starting with default.
-The so set span remains until it is changed again with \\[universal-argument], or the consecutive
-repetition of this command is ended by any other command.
-\nWhen span is zero (i.e. \\[universal-argument] 0) subsequent \\[goto-last-change] visits each and
-every point of edit and a message shows what change was made there.
-In this case it may go to the same point twice.
-\nThis command uses undo information. If undo is disabled, so is this command.
-At times, when undo information becomes too large, the oldest information is
-discarded. See variable `undo-limit'."
-  (interactive "P")
-  (cond ((not (eq this-command last-command))
-	 ;; Start a glc sequence
-	 ;; Don't go to current point if last command was an obvious edit
-	 ;; (yank or self-insert, but not kill-region). Makes it easier to
-	 ;; jump back and forth when copying seleced lines.
-	 (setq glc-probe-depth (if (memq last-command '(yank self-insert-command)) 1 0)
-	       glc-direction 1
-	       glc-current-span glc-default-span)
-	 (if (< (prefix-numeric-value arg) 0)
-	     (error "Negative arg: Cannot reverse as the first operation"))))
-  (cond ((null buffer-undo-list)
-	 (error "Buffer has not been changed"))
-	((eq buffer-undo-list t)
-	 (error "No change info (undo is disabled)")))
-  (cond ((numberp arg)			; Numeric arg sets span
-	 (setq glc-current-span (abs arg)))
-	((consp arg)			; C-u's multiply previous span by 4
-	 (setq glc-current-span (* (abs (car arg)) glc-default-span))
-	 (message "Current span is %d chars" glc-current-span))) ;todo: keep message with "waiting" and "is saved"
-  (cond ((< (prefix-numeric-value arg) 0)
-	 (setq glc-direction -1))
-	(t
-	 (setq glc-direction 1)))
-  (let (rev				; Reversed (and filtered) undo list
-	pos				; The pos we look for, nil until found
-	(n 0)				; Steps in undo list (length of 'rev')
-	(l buffer-undo-list) 
-	(passed-save-entry (not (buffer-modified-p)))
-	(new-probe-depth glc-probe-depth))
-    ;; Walk back and forth in the buffer-undo-list, each time one step deeper,
-    ;; until we can walk back the whole list with a 'pos' that is not coming
-    ;; too close to another edit.
-    (while (null pos)
-      (setq new-probe-depth (+ new-probe-depth glc-direction))
-      (if (< glc-direction 0)
-	  (setq rev ()
-		n 0
-		l buffer-undo-list
-		passed-save-entry (not (buffer-modified-p))))
-      (if (< new-probe-depth 1)
-	  (error "No later change info"))
-      (if (> n 150)
-	  (message "working..."))
-      ;; Walk forward in buffer-undo-list, glc-probe-depth steps.
-      ;; Build reverse list along the way
-      (while (< n new-probe-depth)
-	(cond ((null l)
-	       ;(setq this-command t)	; Disrupt repeat sequence
-	       (error "No further change info"))
-	      ((glc-is-positionable (car l))
-	       (setq n (1+ n)
-		     rev (cons (car l) rev)))
-	      ((or passed-save-entry (glc-is-filetime (car l)))
-	       (setq passed-save-entry t)))
-	(setq l (cdr l)))
-      ;; Walk back in reverse list, from older to newer edits.
-      ;; Adjusting pos along the way.
-      (setq pos (glc-adjust-list rev)))
-    ;; Found a place not previously visited, in 'pos'.
-    ;; (An error have been issued if nothing (more) found.)
-    (if (> n 150)
-	(message nil))			; remove message "working..."
-    (if (and (= glc-current-span 0) (glc-get-descript (car rev) n))
-	(message "%s" (glc-get-descript (car rev) n))
-      ;; else
-      (if passed-save-entry
-	  (message "(This change is saved)")))
-    (setq glc-probe-depth new-probe-depth)
-    (goto-char pos)))
-
-;;;###autoload
-(defun goto-last-change-reverse (arg)
-  "Go back to more recent changes after \\[goto-last-change] have been used.
-See `goto-last-change' for use of prefix argument."
-  (interactive "P")
-  ;; Negate arg, all kinds
-  (cond ((eq arg nil)  (setq arg '-))
-	((eq arg '-)   (setq arg nil))
-	((listp arg)   (setq arg (list (- (car arg)))))
-	(t (setq arg   (- arg))))
-  ;; Make 'goto-last-change-reverse' look like 'goto-last-change'
-  (cond ((eq last-command this-command)
-	 (setq last-command 'goto-last-change)))
-  (setq this-command 'goto-last-change)
-  ;; Call 'goto-last-change' to do the job
-  (goto-last-change arg))
-
-(provide 'goto-chg)
-
-;;; goto-chg.el ends here
.emacs.d/elpa/goto-chg-20131228.659/goto-chg.elc
Binary file
.emacs.d/elpa/htmlize-20161211.1019/htmlize-autoloads.el
@@ -1,76 +0,0 @@
-;;; htmlize-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "htmlize" "htmlize.el" (22964 7393 807309 836000))
-;;; Generated autoloads from htmlize.el
-
-(autoload 'htmlize-buffer "htmlize" "\
-Convert BUFFER to HTML, preserving colors and decorations.
-
-The generated HTML is available in a new buffer, which is returned.
-When invoked interactively, the new buffer is selected in the current
-window.  The title of the generated document will be set to the buffer's
-file name or, if that's not available, to the buffer's name.
-
-Note that htmlize doesn't fontify your buffers, it only uses the
-decorations that are already present.  If you don't set up font-lock or
-something else to fontify your buffers, the resulting HTML will be
-plain.  Likewise, if you don't like the choice of colors, fix the mode
-that created them, or simply alter the faces it uses.
-
-\(fn &optional BUFFER)" t nil)
-
-(autoload 'htmlize-region "htmlize" "\
-Convert the region to HTML, preserving colors and decorations.
-See `htmlize-buffer' for details.
-
-\(fn BEG END)" t nil)
-
-(autoload 'htmlize-file "htmlize" "\
-Load FILE, fontify it, convert it to HTML, and save the result.
-
-Contents of FILE are inserted into a temporary buffer, whose major mode
-is set with `normal-mode' as appropriate for the file type.  The buffer
-is subsequently fontified with `font-lock' and converted to HTML.  Note
-that, unlike `htmlize-buffer', this function explicitly turns on
-font-lock.  If a form of highlighting other than font-lock is desired,
-please use `htmlize-buffer' directly on buffers so highlighted.
-
-Buffers currently visiting FILE are unaffected by this function.  The
-function does not change current buffer or move the point.
-
-If TARGET is specified and names a directory, the resulting file will be
-saved there instead of to FILE's directory.  If TARGET is specified and
-does not name a directory, it will be used as output file name.
-
-\(fn FILE &optional TARGET)" t nil)
-
-(autoload 'htmlize-many-files "htmlize" "\
-Convert FILES to HTML and save the corresponding HTML versions.
-
-FILES should be a list of file names to convert.  This function calls
-`htmlize-file' on each file; see that function for details.  When
-invoked interactively, you are prompted for a list of files to convert,
-terminated with RET.
-
-If TARGET-DIRECTORY is specified, the HTML files will be saved to that
-directory.  Normally, each HTML file is saved to the directory of the
-corresponding source file.
-
-\(fn FILES &optional TARGET-DIRECTORY)" t nil)
-
-(autoload 'htmlize-many-files-dired "htmlize" "\
-HTMLize dired-marked files.
-
-\(fn ARG &optional TARGET-DIRECTORY)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; htmlize-autoloads.el ends here
.emacs.d/elpa/htmlize-20161211.1019/htmlize-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "htmlize" "20161211.1019" "Convert buffer text and decorations to HTML." 'nil :commit "88e2cb6588827893d7bc619529393887c264d15a" :keywords '("hypermedia" "extensions"))
.emacs.d/elpa/htmlize-20161211.1019/htmlize.el
@@ -1,1955 +0,0 @@
-;;; htmlize.el --- Convert buffer text and decorations to HTML. -*- lexical-binding: t -*-
-
-;; Copyright (C) 1997-2003,2005,2006,2009,2011,2012,2014,2017 Hrvoje Niksic
-
-;; Author: Hrvoje Niksic <hniksic@gmail.com>
-;; Keywords: hypermedia, extensions
-;; Package-Version: 20161211.1019
-;; Version: 1.51
-
-;; 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 this program; 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 converts the buffer text and the associated
-;; decorations to HTML.  Mail to <hniksic@gmail.com> to discuss
-;; features and additions.  All suggestions are more than welcome.
-
-;; To use it, just switch to the buffer you want HTML-ized and type
-;; `M-x htmlize-buffer'.  You will be switched to a new buffer that
-;; contains the resulting HTML code.  You can edit and inspect this
-;; buffer, or you can just save it with C-x C-w.  `M-x htmlize-file'
-;; will find a file, fontify it, and save the HTML version in
-;; FILE.html, without any additional intervention.  `M-x
-;; htmlize-many-files' allows you to htmlize any number of files in
-;; the same manner.  `M-x htmlize-many-files-dired' does the same for
-;; files marked in a dired buffer.
-
-;; htmlize supports three types of HTML output, selected by setting
-;; `htmlize-output-type': `css', `inline-css', and `font'.  In `css'
-;; mode, htmlize uses cascading style sheets to specify colors; it
-;; generates classes that correspond to Emacs faces and uses <span
-;; class=FACE>...</span> to color parts of text.  In this mode, the
-;; produced HTML is valid under the 4.01 strict DTD, as confirmed by
-;; the W3C validator.  `inline-css' is like `css', except the CSS is
-;; put directly in the STYLE attribute of the SPAN element, making it
-;; possible to paste the generated HTML into existing HTML documents.
-;; In `font' mode, htmlize uses <font color="...">...</font> to
-;; colorize HTML, which is not standard-compliant, but works better in
-;; older browsers.  `css' mode is the default.
-
-;; You can also use htmlize from your Emacs Lisp code.  When called
-;; non-interactively, `htmlize-buffer' and `htmlize-region' will
-;; return the resulting HTML buffer, but will not change current
-;; buffer or move the point.  htmlize will do its best to work on
-;; non-windowing Emacs sessions but the result will be limited to
-;; colors supported by the terminal.
-
-;; htmlize aims for compatibility with Emacsen version 21 and later.
-;; Please let me know if it doesn't work on the version of XEmacs or
-;; GNU Emacs that you are using.  The package relies on the presence
-;; of CL extensions, especially for cross-emacs compatibility; please
-;; don't try to remove that dependency.  I see no practical problems
-;; with using the full power of the CL extensions, except that one
-;; might learn to like them too much.
-
-;; The latest version is available at:
-;;
-;;        <https://github.com/hniksic/emacs-htmlize>
-;;
-
-;; Thanks go to the many people who have sent reports and contributed
-;; comments, suggestions, and fixes.  They include Ron Gut, Bob
-;; Weiner, Toni Drabik, Peter Breton, Ville Skytta, Thomas Vogels,
-;; Juri Linkov, Maciek Pasternacki, and many others.
-
-;; User quotes: "You sir, are a sick, sick, _sick_ person. :)"
-;;                  -- Bill Perry, author of Emacs/W3
-
-
-;;; Code:
-
-(require 'cl)
-(eval-when-compile
-  (defvar unresolved)
-  (if (string-match "XEmacs" emacs-version)
-      (byte-compiler-options
-	(warnings (- unresolved))))
-  (defvar font-lock-auto-fontify)
-  (defvar font-lock-support-mode)
-  (defvar global-font-lock-mode))
-
-(defconst htmlize-version "1.51")
-
-(defgroup htmlize nil
-  "Convert buffer text and faces to HTML."
-  :group 'hypermedia)
-
-(defcustom htmlize-head-tags ""
-  "Additional tags to insert within HEAD of the generated document."
-  :type 'string
-  :group 'htmlize)
-
-(defcustom htmlize-output-type 'css
-  "Output type of generated HTML, one of `css', `inline-css', or `font'.
-When set to `css' (the default), htmlize will generate a style sheet
-with description of faces, and use it in the HTML document, specifying
-the faces in the actual text with <span class=\"FACE\">.
-
-When set to `inline-css', the style will be generated as above, but
-placed directly in the STYLE attribute of the span ELEMENT: <span
-style=\"STYLE\">.  This makes it easier to paste the resulting HTML to
-other documents.
-
-When set to `font', the properties will be set using layout tags
-<font>, <b>, <i>, <u>, and <strike>.
-
-`css' output is normally preferred, but `font' is still useful for
-supporting old, pre-CSS browsers, and both `inline-css' and `font' for
-easier embedding of colorized text in foreign HTML documents (no style
-sheet to carry around)."
-  :type '(choice (const css) (const inline-css) (const font))
-  :group 'htmlize)
-
-(defcustom htmlize-use-images t
-  "Whether htmlize generates `img' for images attached to buffer contents."
-  :type 'boolean
-  :group 'htmlize)
-
-(defcustom htmlize-force-inline-images nil
-  "Non-nil means generate all images inline using data URLs.
-Normally htmlize converts image descriptors with :file properties to
-relative URIs, and those with :data properties to data URIs.  With this
-flag set, the images specified as a file name are loaded into memory and
-embedded in the HTML as data URIs."
-  :type 'boolean
-  :group 'htmlize)
-
-(defcustom htmlize-max-alt-text 100
-  "Maximum size of text to use as ALT text in images.
-
-Normally when htmlize encounters text covered by the `display' property
-that specifies an image, it generates an `alt' attribute containing the
-original text.  If the text is larger than `htmlize-max-alt-text' characters,
-this will not be done."
-  :type 'integer
-  :group 'htmlize)
-
-(defcustom htmlize-transform-image 'htmlize-default-transform-image
-  "Function called to modify the image descriptor.
-
-The function is called with the image descriptor found in the buffer and
-the text the image is supposed to replace.  It should return a (possibly
-different) image descriptor property list or a replacement string to use
-instead of of the original buffer text.
-
-Returning nil is the same as returning the original text."
-  :type 'boolean
-  :group 'htmlize)
-
-(defcustom htmlize-generate-hyperlinks t
-  "Non-nil means auto-generate the links from URLs and mail addresses in buffer.
-
-This is on by default; set it to nil if you don't want htmlize to
-autogenerate such links.  Note that this option only turns off automatic
-search for contents that looks like URLs and converting them to links.
-It has no effect on whether htmlize respects the `htmlize-link' property."
-  :type 'boolean
-  :group 'htmlize)
-
-(defcustom htmlize-hyperlink-style "
-      a {
-        color: inherit;
-        background-color: inherit;
-        font: inherit;
-        text-decoration: inherit;
-      }
-      a:hover {
-        text-decoration: underline;
-      }
-"
-  "The CSS style used for hyperlinks when in CSS mode."
-  :type 'string
-  :group 'htmlize)
-
-(defcustom htmlize-replace-form-feeds t
-  "Non-nil means replace form feeds in source code with HTML separators.
-Form feeds are the ^L characters at line beginnings that are sometimes
-used to separate sections of source code.  If this variable is set to
-`t', form feed characters are replaced with the <hr> separator.  If this
-is a string, it specifies the replacement to use.  Note that <pre> is
-temporarily closed before the separator is inserted, so the default
-replacement is effectively \"</pre><hr /><pre>\".  If you specify
-another replacement, don't forget to close and reopen the <pre> if you
-want the output to remain valid HTML.
-
-If you need more elaborate processing, set this to nil and use
-htmlize-after-hook."
-  :type 'boolean
-  :group 'htmlize)
-
-(defcustom htmlize-html-charset nil
-  "The charset declared by the resulting HTML documents.
-When non-nil, causes htmlize to insert the following in the HEAD section
-of the generated HTML:
-
-  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=CHARSET\">
-
-where CHARSET is the value you've set for htmlize-html-charset.  Valid
-charsets are defined by MIME and include strings like \"iso-8859-1\",
-\"iso-8859-15\", \"utf-8\", etc.
-
-If you are using non-Latin-1 charsets, you might need to set this for
-your documents to render correctly.  Also, the W3C validator requires
-submitted HTML documents to declare a charset.  So if you care about
-validation, you can use this to prevent the validator from bitching.
-
-Needless to say, if you set this, you should actually make sure that
-the buffer is in the encoding you're claiming it is in.  (This is
-normally achieved by using the correct file coding system for the
-buffer.)  If you don't understand what that means, you should probably
-leave this option in its default setting."
-  :type '(choice (const :tag "Unset" nil)
-		 string)
-  :group 'htmlize)
-
-(defcustom htmlize-convert-nonascii-to-entities t
-  "Whether non-ASCII characters should be converted to HTML entities.
-
-When this is non-nil, characters with codes in the 128-255 range will be
-considered Latin 1 and rewritten as \"&#CODE;\".  Characters with codes
-above 255 will be converted to \"&#UCS;\", where UCS denotes the Unicode
-code point of the character.  If the code point cannot be determined,
-the character will be copied unchanged, as would be the case if the
-option were nil.
-
-When the option is nil, the non-ASCII characters are copied to HTML
-without modification.  In that case, the web server and/or the browser
-must be set to understand the encoding that was used when saving the
-buffer.  (You might also want to specify it by setting
-`htmlize-html-charset'.)
-
-Note that in an HTML entity \"&#CODE;\", CODE is always a UCS code point,
-which has nothing to do with the charset the page is in.  For example,
-\"&#169;\" *always* refers to the copyright symbol, regardless of charset
-specified by the META tag or the charset sent by the HTTP server.  In
-other words, \"&#169;\" is exactly equivalent to \"&copy;\".
-
-For most people htmlize will work fine with this option left at the
-default setting; don't change it unless you know what you're doing."
-  :type 'sexp
-  :group 'htmlize)
-
-(defcustom htmlize-ignore-face-size 'absolute
-  "Whether face size should be ignored when generating HTML.
-If this is nil, face sizes are used.  If set to t, sizes are ignored
-If set to `absolute', only absolute size specifications are ignored.
-Please note that font sizes only work with CSS-based output types."
-  :type '(choice (const :tag "Don't ignore" nil)
-		 (const :tag "Ignore all" t)
-		 (const :tag "Ignore absolute" absolute))
-  :group 'htmlize)
-
-(defcustom htmlize-css-name-prefix ""
-  "The prefix used for CSS names.
-The CSS names that htmlize generates from face names are often too
-generic for CSS files; for example, `font-lock-type-face' is transformed
-to `type'.  Use this variable to add a prefix to the generated names.
-The string \"htmlize-\" is an example of a reasonable prefix."
-  :type 'string
-  :group 'htmlize)
-
-(defcustom htmlize-use-rgb-txt t
-  "Whether `rgb.txt' should be used to convert color names to RGB.
-
-This conversion means determining, for instance, that the color
-\"IndianRed\" corresponds to the (205, 92, 92) RGB triple.  `rgb.txt'
-is the X color database that maps hundreds of color names to such RGB
-triples.  When this variable is non-nil, `htmlize' uses `rgb.txt' to
-look up color names.
-
-If this variable is nil, htmlize queries Emacs for RGB components of
-colors using `color-instance-rgb-components' and `color-values'.
-This can yield incorrect results on non-true-color displays.
-
-If the `rgb.txt' file is not found (which will be the case if you're
-running Emacs on non-X11 systems), this option is ignored."
-  :type 'boolean
-  :group 'htmlize)
-
-(defvar htmlize-face-overrides nil
-  "Overrides for face definitions.
-
-Normally face definitions are taken from Emacs settings for fonts
-in the current frame.  For faces present in this plist, the
-definitions will be used instead.  Keys in the plist are symbols
-naming the face and values are the overriding definitions.  For
-example:
-
-  (setq htmlize-face-overrides
-        '(font-lock-warning-face \"black\"
-          font-lock-function-name-face \"red\"
-          font-lock-comment-face \"blue\"
-          default (:foreground \"dark-green\" :background \"yellow\")))
-
-This variable can be also be `let' bound when running `htmlize-buffer'.")
-
-(defcustom htmlize-html-major-mode nil
-  "The mode the newly created HTML buffer will be put in.
-Set this to nil if you prefer the default (fundamental) mode."
-  :type '(radio (const :tag "No mode (fundamental)" nil)
-		 (function-item html-mode)
-		 (function :tag "User-defined major mode"))
-  :group 'htmlize)
-
-(defvar htmlize-before-hook nil
-  "Hook run before htmlizing a buffer.
-The hook functions are run in the source buffer (not the resulting HTML
-buffer).")
-
-(defvar htmlize-after-hook nil
-  "Hook run after htmlizing a buffer.
-Unlike `htmlize-before-hook', these functions are run in the generated
-HTML buffer.  You may use them to modify the outlook of the final HTML
-output.")
-
-(defvar htmlize-file-hook nil
-  "Hook run by `htmlize-file' after htmlizing a file, but before saving it.")
-
-(defvar htmlize-buffer-places)
-
-;;; Some cross-Emacs compatibility.
-
-;; I try to conditionalize on features rather than Emacs version, but
-;; in some cases checking against the version *is* necessary.
-(defconst htmlize-running-xemacs (string-match "XEmacs" emacs-version))
-
-;; We need a function that efficiently finds the next change of a
-;; property regardless of whether the change occurred because of a
-;; text property or an extent/overlay.
-(cond
- (htmlize-running-xemacs
-  (defun htmlize-next-change (pos prop &optional limit)
-    (if prop
-        (next-single-char-property-change pos prop nil (or limit (point-max)))
-      (next-property-change pos nil (or limit (point-max)))))
-  (defun htmlize-next-face-change (pos &optional limit)
-    (htmlize-next-change pos 'face limit)))
- (t
-  (defun htmlize-next-change (pos prop &optional limit)
-    (if prop
-        (next-single-char-property-change pos prop nil limit)
-      (next-char-property-change pos limit)))
-  (defun htmlize-overlay-faces-at (pos)
-    (delq nil (mapcar (lambda (o) (overlay-get o 'face)) (overlays-at pos))))
-  (defun htmlize-next-face-change (pos &optional limit)
-    ;; (htmlize-next-change pos 'face limit) would skip over entire
-    ;; overlays that specify the `face' property, even when they
-    ;; contain smaller text properties that also specify `face'.
-    ;; Emacs display engine merges those faces, and so must we.
-    (or limit
-        (setq limit (point-max)))
-    (let ((next-prop (next-single-property-change pos 'face nil limit))
-          (overlay-faces (htmlize-overlay-faces-at pos)))
-      (while (progn
-               (setq pos (next-overlay-change pos))
-               (and (< pos next-prop)
-                    (equal overlay-faces (htmlize-overlay-faces-at pos)))))
-      (setq pos (min pos next-prop))
-      ;; Additionally, we include the entire region that specifies the
-      ;; `display' property.
-      (when (get-char-property pos 'display)
-        (setq pos (next-single-char-property-change pos 'display nil limit)))
-      pos)))
- (t
-  (error "htmlize requires next-single-property-change or \
-next-single-char-property-change")))
-
-(defmacro htmlize-lexlet (&rest letforms)
-  (declare (indent 1) (debug let))
-  (if (and (boundp 'lexical-binding)
-           lexical-binding)
-      `(let ,@letforms)
-    ;; cl extensions have a macro implementing lexical let
-    `(lexical-let ,@letforms)))
-
-;; Simple overlay emulation for XEmacs
-
-(cond
- (htmlize-running-xemacs
-  (defalias 'htmlize-make-overlay 'make-extent)
-  (defalias 'htmlize-overlay-put 'set-extent-property)
-  (defalias 'htmlize-overlay-get 'extent-property)
-  (defun htmlize-overlays-in (beg end) (extent-list nil beg end))
-  (defalias 'htmlize-delete-overlay 'detach-extent))
- (t
-  (defalias 'htmlize-make-overlay 'make-overlay)
-  (defalias 'htmlize-overlay-put 'overlay-put)
-  (defalias 'htmlize-overlay-get 'overlay-get)
-  (defalias 'htmlize-overlays-in 'overlays-in)
-  (defalias 'htmlize-delete-overlay 'delete-overlay)))
-
-
-;;; Transformation of buffer text: HTML escapes, untabification, etc.
-
-(defvar htmlize-basic-character-table
-  ;; Map characters in the 0-127 range to either one-character strings
-  ;; or to numeric entities.
-  (let ((table (make-vector 128 ?\0)))
-    ;; Map characters in the 32-126 range to themselves, others to
-    ;; &#CODE entities;
-    (dotimes (i 128)
-      (setf (aref table i) (if (and (>= i 32) (<= i 126))
-			       (char-to-string i)
-			     (format "&#%d;" i))))
-    ;; Set exceptions manually.
-    (setf
-     ;; Don't escape newline, carriage return, and TAB.
-     (aref table ?\n) "\n"
-     (aref table ?\r) "\r"
-     (aref table ?\t) "\t"
-     ;; Escape &, <, and >.
-     (aref table ?&) "&amp;"
-     (aref table ?<) "&lt;"
-     (aref table ?>) "&gt;"
-     ;; Not escaping '"' buys us a measurable speedup.  It's only
-     ;; necessary to quote it for strings used in attribute values,
-     ;; which htmlize doesn't typically do.
-     ;(aref table ?\") "&quot;"
-     )
-    table))
-
-;; A cache of HTML representation of non-ASCII characters.  Depending
-;; on the setting of `htmlize-convert-nonascii-to-entities', this maps
-;; non-ASCII characters to either "&#<code>;" or "<char>" (mapconcat's
-;; mapper must always return strings).  It's only filled as characters
-;; are encountered, so that in a buffer with e.g. French text, it will
-;; only ever contain French accented characters as keys.  It's cleared
-;; on each entry to htmlize-buffer-1 to allow modifications of
-;; `htmlize-convert-nonascii-to-entities' to take effect.
-(defvar htmlize-extended-character-cache (make-hash-table :test 'eq))
-
-(defun htmlize-protect-string (string)
-  "HTML-protect string, escaping HTML metacharacters and I18N chars."
-  ;; Only protecting strings that actually contain unsafe or non-ASCII
-  ;; chars removes a lot of unnecessary funcalls and consing.
-  (if (not (string-match "[^\r\n\t -%'-;=?-~]" string))
-      string
-    (mapconcat (lambda (char)
-		 (cond
-		  ((< char 128)
-		   ;; ASCII: use htmlize-basic-character-table.
-		   (aref htmlize-basic-character-table char))
-		  ((gethash char htmlize-extended-character-cache)
-		   ;; We've already seen this char; return the cached
-		   ;; string.
-		   )
-		  ((not htmlize-convert-nonascii-to-entities)
-		   ;; If conversion to entities is not desired, always
-		   ;; copy the char literally.
-		   (setf (gethash char htmlize-extended-character-cache)
-			 (char-to-string char)))
-		  ((< char 256)
-		   ;; Latin 1: no need to call encode-char.
-		   (setf (gethash char htmlize-extended-character-cache)
-			 (format "&#%d;" char)))
-		  ((encode-char char 'ucs)
-                   ;; Must check if encode-char works for CHAR;
-                   ;; it fails for Arabic and possibly elsewhere.
-		   (setf (gethash char htmlize-extended-character-cache)
-			 (format "&#%d;" (encode-char char 'ucs))))
-		  (t
-		   ;; encode-char doesn't work for this char.  Copy it
-		   ;; unchanged and hope for the best.
-		   (setf (gethash char htmlize-extended-character-cache)
-			 (char-to-string char)))))
-	       string "")))
-
-(defun htmlize-attr-escape (string)
-  ;; Like htmlize-protect-string, but also escapes double-quoted
-  ;; strings to make it usable in attribute values.
-  (setq string (htmlize-protect-string string))
-  (if (not (string-match "\"" string))
-      string
-    (mapconcat (lambda (char)
-                 (if (eql char ?\")
-                     "&quot;"
-                   (char-to-string char)))
-               string "")))
-
-(defsubst htmlize-concat (list)
-  (if (and (consp list) (null (cdr list)))
-      ;; Don't create a new string in the common case where the list only
-      ;; consists of one element.
-      (car list)
-    (apply #'concat list)))
-
-(defun htmlize-format-link (linkprops text)
-  (let ((uri (if (stringp linkprops)
-                 linkprops
-               (plist-get linkprops :uri)))
-        (escaped-text (htmlize-protect-string text)))
-    (if uri
-        (format "<a href=\"%s\">%s</a>" (htmlize-attr-escape uri) escaped-text)
-      escaped-text)))
-
-(defun htmlize-escape-or-link (string)
-  ;; Escape STRING and/or add hyperlinks.  STRING comes from a
-  ;; `display' property.
-  (let ((pos 0) (end (length string)) outlist)
-    (while (< pos end)
-      (let* ((link (get-char-property pos 'htmlize-link string))
-             (next-link-change (next-single-property-change
-                                pos 'htmlize-link string end))
-             (chunk (substring string pos next-link-change)))
-        (push
-         (cond (link
-                (htmlize-format-link link chunk))
-               ((get-char-property 0 'htmlize-literal chunk)
-                chunk)
-               (t
-                (htmlize-protect-string chunk)))
-         outlist)
-        (setq pos next-link-change)))
-    (htmlize-concat (nreverse outlist))))
-
-(defun htmlize-display-prop-to-html (display text)
-  (let (desc)
-    (cond ((stringp display)
-           ;; Emacs ignores recursive display properties.
-           (htmlize-escape-or-link display))
-          ((not (eq (car-safe display) 'image))
-           (htmlize-protect-string text))
-          ((null (setq desc (funcall htmlize-transform-image
-                                     (cdr display) text)))
-           (htmlize-escape-or-link text))
-          ((stringp desc)
-           (htmlize-escape-or-link desc))
-          (t
-           (htmlize-generate-image desc text)))))
-
-(defun htmlize-string-to-html (string)
-  ;; Convert the string to HTML, including images attached as
-  ;; `display' property and links as `htmlize-link' property.  In a
-  ;; string without images or links, this is equivalent to
-  ;; `htmlize-protect-string'.
-  (let ((pos 0) (end (length string)) outlist)
-    (while (< pos end)
-      (let* ((display (get-char-property pos 'display string))
-             (next-display-change (next-single-property-change
-                                   pos 'display string end))
-             (chunk (substring string pos next-display-change)))
-        (push
-         (if display
-             (htmlize-display-prop-to-html display chunk)
-           (htmlize-escape-or-link chunk))
-         outlist)
-        (setq pos next-display-change)))
-    (htmlize-concat (nreverse outlist))))
-
-(defun htmlize-default-transform-image (imgprops _text)
-  "Default transformation of image descriptor to something usable in HTML.
-
-If `htmlize-use-images' is nil, the function always returns nil, meaning
-use original text.  Otherwise, it tries to find the image for images that
-specify a file name.  If `htmlize-force-inline-images' is non-nil, it also
-converts the :file attribute to :data and returns the modified property
-list."
-  (when htmlize-use-images
-    (when (plist-get imgprops :file)
-      (let ((location (plist-get (cdr (find-image (list imgprops))) :file)))
-        (when location
-          (setq imgprops (plist-put (copy-list imgprops) :file location)))))
-    (if htmlize-force-inline-images
-        (let ((location (plist-get imgprops :file))
-              data)
-          (when location
-            (with-temp-buffer
-              (condition-case nil
-                  (progn
-                    (insert-file-contents-literally location)
-                    (setq data (buffer-string)))
-                (error nil))))
-          ;; if successful, return the new plist, otherwise return
-          ;; nil, which will use the original text
-          (and data
-               (plist-put (plist-put imgprops :file nil)
-                          :data data)))
-      imgprops)))
-
-(defun htmlize-alt-text (_imgprops origtext)
-  (and (/= (length origtext) 0)
-       (<= (length origtext) htmlize-max-alt-text)
-       (not (string-match "[\0-\x1f]" origtext))
-       origtext))
-
-(defun htmlize-generate-image (imgprops origtext)
-  (let* ((alt-text (htmlize-alt-text imgprops origtext))
-         (alt-attr (if alt-text
-                       (format " alt=\"%s\"" (htmlize-attr-escape alt-text))
-                     "")))
-    (cond ((plist-get imgprops :file)
-           ;; Try to find the image in image-load-path
-           (let* ((found-props (cdr (find-image (list imgprops))))
-                  (file (or (plist-get found-props :file)
-                            (plist-get imgprops :file))))
-             (format "<img src=\"%s\"%s />"
-                     (htmlize-attr-escape (file-relative-name file))
-                     alt-attr)))
-          ((plist-get imgprops :data)
-           (format "<img src=\"data:image/%s;base64,%s\"%s />"
-                   (or (plist-get imgprops :type) "")
-                   (base64-encode-string (plist-get imgprops :data))
-                   alt-attr)))))
-
-(defconst htmlize-ellipsis "...")
-(put-text-property 0 (length htmlize-ellipsis) 'htmlize-ellipsis t htmlize-ellipsis)
-
-(defun htmlize-match-inv-spec (inv)
-  (member* inv buffer-invisibility-spec
-           :key (lambda (i)
-                  (if (symbolp i) i (car i)))))
-
-(defun htmlize-decode-invisibility-spec (invisible)
-  ;; Return t, nil, or `ellipsis', depending on how invisible text should be inserted.
-
-  (if (not (listp buffer-invisibility-spec))
-      ;; If buffer-invisibility-spec is not a list, then all
-      ;; characters with non-nil `invisible' property are visible.
-      (not invisible)
-
-    ;; Otherwise, the value of a non-nil `invisible' property can be:
-    ;; 1. a symbol -- make the text invisible if it matches
-    ;;    buffer-invisibility-spec.
-    ;; 2. a list of symbols -- make the text invisible if
-    ;;    any symbol in the list matches
-    ;;    buffer-invisibility-spec.
-    ;; If the match of buffer-invisibility-spec has a non-nil
-    ;; CDR, replace the invisible text with an ellipsis.
-    (let ((match (if (symbolp invisible)
-                     (htmlize-match-inv-spec invisible)
-                   (some #'htmlize-match-inv-spec invisible))))
-      (cond ((null match) t)
-            ((cdr-safe (car match)) 'ellipsis)
-            (t nil)))))
-
-(defun htmlize-add-before-after-strings (beg end text)
-  ;; Find overlays specifying before-string and after-string in [beg,
-  ;; pos).  If any are found, splice them into TEXT and return the new
-  ;; text.
-  (let (additions)
-    (dolist (overlay (overlays-in beg end))
-      (let ((before (overlay-get overlay 'before-string))
-            (after (overlay-get overlay 'after-string)))
-        (when after
-          (push (cons (- (overlay-end overlay) beg)
-                      after)
-                additions))
-        (when before
-          (push (cons (- (overlay-start overlay) beg)
-                      before)
-                additions))))
-    (if additions
-        (let ((textlist nil)
-              (strpos 0))
-          (dolist (add (stable-sort additions #'< :key #'car))
-            (let ((addpos (car add))
-                  (addtext (cdr add)))
-              (push (substring text strpos addpos) textlist)
-              (push addtext textlist)
-              (setq strpos addpos)))
-          (push (substring text strpos) textlist)
-          (apply #'concat (nreverse textlist)))
-      text)))
-
-(defun htmlize-copy-prop (prop beg end string)
-  ;; Copy the specified property from the specified region of the
-  ;; buffer to the target string.  We cannot rely on Emacs to copy the
-  ;; property because we want to handle properties coming from both
-  ;; text properties and overlays.
-  (let ((pos beg))
-    (while (< pos end)
-      (let ((value (get-char-property pos prop))
-            (next-change (htmlize-next-change pos prop end)))
-        (when value
-          (put-text-property (- pos beg) (- next-change beg)
-                             prop value string))
-        (setq pos next-change)))))
-
-(defun htmlize-get-text-with-display (beg end)
-  ;; Like buffer-substring-no-properties, except it copies the
-  ;; `display' property from the buffer, if found.
-  (let ((text (buffer-substring-no-properties beg end)))
-    (htmlize-copy-prop 'display beg end text)
-    (htmlize-copy-prop 'htmlize-link beg end text)
-    (unless htmlize-running-xemacs
-      (setq text (htmlize-add-before-after-strings beg end text)))
-    text))
-
-(defun htmlize-buffer-substring-no-invisible (beg end)
-  ;; Like buffer-substring-no-properties, but don't copy invisible
-  ;; parts of the region.  Where buffer-substring-no-properties
-  ;; mandates an ellipsis to be shown, htmlize-ellipsis is inserted.
-  (let ((pos beg)
-	visible-list invisible show last-show next-change)
-    ;; Iterate over the changes in the `invisible' property and filter
-    ;; out the portions where it's non-nil, i.e. where the text is
-    ;; invisible.
-    (while (< pos end)
-      (setq invisible (get-char-property pos 'invisible)
-	    next-change (htmlize-next-change pos 'invisible end)
-            show (htmlize-decode-invisibility-spec invisible))
-      (cond ((eq show t)
-	     (push (htmlize-get-text-with-display pos next-change)
-                   visible-list))
-            ((and (eq show 'ellipsis)
-                  (not (eq last-show 'ellipsis))
-                  ;; Conflate successive ellipses.
-                  (push htmlize-ellipsis visible-list))))
-      (setq pos next-change last-show show))
-    (htmlize-concat (nreverse visible-list))))
-
-(defun htmlize-trim-ellipsis (text)
-  ;; Remove htmlize-ellipses ("...") from the beginning of TEXT if it
-  ;; starts with it.  It checks for the special property of the
-  ;; ellipsis so it doesn't work on ordinary text that begins with
-  ;; "...".
-  (if (get-text-property 0 'htmlize-ellipsis text)
-      (substring text (length htmlize-ellipsis))
-    text))
-
-(defconst htmlize-tab-spaces
-  ;; A table of strings with spaces.  (aref htmlize-tab-spaces 5) is
-  ;; like (make-string 5 ?\ ), except it doesn't cons.
-  (let ((v (make-vector 32 nil)))
-    (dotimes (i (length v))
-      (setf (aref v i) (make-string i ?\ )))
-    v))
-
-(defun htmlize-untabify (text start-column)
-  "Untabify TEXT, assuming it starts at START-COLUMN."
-  (let ((column start-column)
-	(last-match 0)
-	(chunk-start 0)
-	chunks match-pos tab-size)
-    (while (string-match "[\t\n]" text last-match)
-      (setq match-pos (match-beginning 0))
-      (cond ((eq (aref text match-pos) ?\t)
-	     ;; Encountered a tab: create a chunk of text followed by
-	     ;; the expanded tab.
-	     (push (substring text chunk-start match-pos) chunks)
-	     ;; Increase COLUMN by the length of the text we've
-	     ;; skipped since last tab or newline.  (Encountering
-	     ;; newline resets it.)
-	     (incf column (- match-pos last-match))
-	     ;; Calculate tab size based on tab-width and COLUMN.
-	     (setq tab-size (- tab-width (% column tab-width)))
-	     ;; Expand the tab, carefully recreating the `display'
-	     ;; property if one was on the TAB.
-             (let ((display (get-text-property match-pos 'display text))
-                   (expanded-tab (aref htmlize-tab-spaces tab-size)))
-               (when display
-                 (put-text-property 0 tab-size 'display display expanded-tab))
-               (push expanded-tab chunks))
-	     (incf column tab-size)
-	     (setq chunk-start (1+ match-pos)))
-	    (t
-	     ;; Reset COLUMN at beginning of line.
-	     (setq column 0)))
-      (setq last-match (1+ match-pos)))
-    ;; If no chunks have been allocated, it means there have been no
-    ;; tabs to expand.  Return TEXT unmodified.
-    (if (null chunks)
-	text
-      (when (< chunk-start (length text))
-	;; Push the remaining chunk.
-	(push (substring text chunk-start) chunks))
-      ;; Generate the output from the available chunks.
-      (htmlize-concat (nreverse chunks)))))
-
-(defun htmlize-extract-text (beg end trailing-ellipsis)
-  ;; Extract buffer text, sans the invisible parts.  Then
-  ;; untabify it and escape the HTML metacharacters.
-  (let ((text (htmlize-buffer-substring-no-invisible beg end)))
-    (when trailing-ellipsis
-      (setq text (htmlize-trim-ellipsis text)))
-    ;; If TEXT ends up empty, don't change trailing-ellipsis.
-    (when (> (length text) 0)
-      (setq trailing-ellipsis
-            (get-text-property (1- (length text))
-                               'htmlize-ellipsis text)))
-    (setq text (htmlize-untabify text (current-column)))
-    (setq text (htmlize-string-to-html text))
-    (values text trailing-ellipsis)))
-
-(defun htmlize-despam-address (string)
-  "Replace every occurrence of '@' in STRING with %40.
-This is used to protect mailto links without modifying their meaning."
-  ;; Suggested by Ville Skytta.
-  (while (string-match "@" string)
-    (setq string (replace-match "%40" nil t string)))
-  string)
-
-(defun htmlize-make-tmp-overlay (beg end props)
-  (let ((overlay (htmlize-make-overlay beg end)))
-    (htmlize-overlay-put overlay 'htmlize-tmp-overlay t)
-    (while props
-      (htmlize-overlay-put overlay (pop props) (pop props)))
-    overlay))
-
-(defun htmlize-delete-tmp-overlays ()
-  (dolist (overlay (htmlize-overlays-in (point-min) (point-max)))
-    (when (htmlize-overlay-get overlay 'htmlize-tmp-overlay)
-      (htmlize-delete-overlay overlay))))
-
-(defun htmlize-make-link-overlay (beg end uri)
-  (htmlize-make-tmp-overlay beg end `(htmlize-link (:uri ,uri))))
-
-(defun htmlize-create-auto-links ()
-  "Add `htmlize-link' property to all mailto links in the buffer."
-  (save-excursion
-    (goto-char (point-min))
-    (while (re-search-forward
-            "<\\(\\(mailto:\\)?\\([-=+_.a-zA-Z0-9]+@[-_.a-zA-Z0-9]+\\)\\)>"
-            nil t)
-      (let* ((address (match-string 3))
-             (beg (match-beginning 0)) (end (match-end 0))
-             (uri (concat "mailto:" (htmlize-despam-address address))))
-        (htmlize-make-link-overlay beg end uri)))
-    (goto-char (point-min))
-    (while (re-search-forward "<\\(\\(URL:\\)?\\([a-zA-Z]+://[^;]+\\)\\)>"
-                              nil t)
-      (htmlize-make-link-overlay
-       (match-beginning 0) (match-end 0) (match-string 3)))))
-
-;; Tests for htmlize-create-auto-links:
-
-;; <mailto:hniksic@xemacs.org>
-;; <http://fly.srk.fer.hr>
-;; <URL:http://www.xemacs.org>
-;; <http://www.mail-archive.com/bbdb-info@xemacs.org/>
-;; <hniksic@xemacs.org>
-;; <xalan-dev-sc.10148567319.hacuhiucknfgmpfnjcpg-john=doe.com@xml.apache.org>
-
-(defun htmlize-shadow-form-feeds ()
-  (let ((s "\n<hr />"))
-    (put-text-property 0 (length s) 'htmlize-literal t s)
-    (let ((disp `(display ,s)))
-      (while (re-search-forward "\n\^L" nil t)
-        (htmlize-make-tmp-overlay (match-beginning 0) (match-end 0) disp)))))
-
-(defun htmlize-defang-local-variables ()
-  ;; Juri Linkov reports that an HTML-ized "Local variables" can lead
-  ;; visiting the HTML to fail with "Local variables list is not
-  ;; properly terminated".  He suggested changing the phrase to
-  ;; syntactically equivalent HTML that Emacs doesn't recognize.
-  (goto-char (point-min))
-  (while (search-forward "Local Variables:" nil t)
-    (replace-match "Local Variables&#58;" nil t)))
-  
-
-;;; Color handling.
-
-(defvar htmlize-x-library-search-path
-  `(,data-directory
-    "/etc/X11/rgb.txt"
-    "/usr/share/X11/rgb.txt"
-    ;; the remainder of this list really belongs in a museum
-    "/usr/X11R6/lib/X11/"
-    "/usr/X11R5/lib/X11/"
-    "/usr/lib/X11R6/X11/"
-    "/usr/lib/X11R5/X11/"
-    "/usr/local/X11R6/lib/X11/"
-    "/usr/local/X11R5/lib/X11/"
-    "/usr/local/lib/X11R6/X11/"
-    "/usr/local/lib/X11R5/X11/"
-    "/usr/X11/lib/X11/"
-    "/usr/lib/X11/"
-    "/usr/local/lib/X11/"
-    "/usr/X386/lib/X11/"
-    "/usr/x386/lib/X11/"
-    "/usr/XFree86/lib/X11/"
-    "/usr/unsupported/lib/X11/"
-    "/usr/athena/lib/X11/"
-    "/usr/local/x11r5/lib/X11/"
-    "/usr/lpp/Xamples/lib/X11/"
-    "/usr/openwin/lib/X11/"
-    "/usr/openwin/share/lib/X11/"))
-
-(defun htmlize-get-color-rgb-hash (&optional rgb-file)
-  "Return a hash table mapping X color names to RGB values.
-The keys in the hash table are X11 color names, and the values are the
-#rrggbb RGB specifications, extracted from `rgb.txt'.
-
-If RGB-FILE is nil, the function will try hard to find a suitable file
-in the system directories.
-
-If no rgb.txt file is found, return nil."
-  (let ((rgb-file (or rgb-file (locate-file
-				"rgb.txt"
-				htmlize-x-library-search-path)))
-	(hash nil))
-    (when rgb-file
-      (with-temp-buffer
-	(insert-file-contents rgb-file)
-	(setq hash (make-hash-table :test 'equal))
-	(while (not (eobp))
-	  (cond ((looking-at "^\\s-*\\([!#]\\|$\\)")
-		 ;; Skip comments and empty lines.
-		 )
-		((looking-at
-		  "[ \t]*\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\(.*\\)")
-		 (setf (gethash (downcase (match-string 4)) hash)
-		       (format "#%02x%02x%02x"
-			       (string-to-number (match-string 1))
-			       (string-to-number (match-string 2))
-			       (string-to-number (match-string 3)))))
-		(t
-		 (error
-		  "Unrecognized line in %s: %s"
-		  rgb-file
-		  (buffer-substring (point) (progn (end-of-line) (point))))))
-	  (forward-line 1))))
-    hash))
-
-;; Compile the RGB map when loaded.  On systems where rgb.txt is
-;; missing, the value of the variable will be nil, and rgb.txt will
-;; not be used.
-(defvar htmlize-color-rgb-hash (htmlize-get-color-rgb-hash))
-
-;;; Face handling.
-
-(defun htmlize-face-specifies-property (face prop)
-  ;; Return t if face specifies PROP, as opposed to it being inherited
-  ;; from the default face.  The problem with e.g.
-  ;; `face-foreground-instance' is that it returns an instance for
-  ;; EVERY face because every face inherits from the default face.
-  ;; However, we'd like htmlize-face-{fore,back}ground to return nil
-  ;; when called with a face that doesn't specify its own foreground
-  ;; or background.
-  (or (eq face 'default)
-      (assq 'global (specifier-spec-list (face-property face prop)))))
-
-(defun htmlize-face-color-internal (face fg)
-  ;; Used only under GNU Emacs.  Return the color of FACE, but don't
-  ;; return "unspecified-fg" or "unspecified-bg".  If the face is
-  ;; `default' and the color is unspecified, look up the color in
-  ;; frame parameters.
-  (let* ((function (if fg #'face-foreground #'face-background))
-	 (color (funcall function face nil t)))
-    (when (and (eq face 'default) (null color))
-      (setq color (cdr (assq (if fg 'foreground-color 'background-color)
-			     (frame-parameters)))))
-    (when (or (eq color 'unspecified)
-	      (equal color "unspecified-fg")
-	      (equal color "unspecified-bg"))
-      (setq color nil))
-    (when (and (eq face 'default)
-	       (null color))
-      ;; Assuming black on white doesn't seem right, but I can't think
-      ;; of anything better to do.
-      (setq color (if fg "black" "white")))
-    color))
-
-(defun htmlize-face-foreground (face)
-  ;; Return the name of the foreground color of FACE.  If FACE does
-  ;; not specify a foreground color, return nil.
-  (cond (htmlize-running-xemacs
-	 ;; XEmacs.
-	 (and (htmlize-face-specifies-property face 'foreground)
-	      (color-instance-name (face-foreground-instance face))))
-	(t
-	 ;; GNU Emacs.
-	 (htmlize-face-color-internal face t))))
-
-(defun htmlize-face-background (face)
-  ;; Return the name of the background color of FACE.  If FACE does
-  ;; not specify a background color, return nil.
-  (cond (htmlize-running-xemacs
-	 ;; XEmacs.
-	 (and (htmlize-face-specifies-property face 'background)
-	      (color-instance-name (face-background-instance face))))
-	(t
-	 ;; GNU Emacs.
-	 (htmlize-face-color-internal face nil))))
-
-;; Convert COLOR to the #RRGGBB string.  If COLOR is already in that
-;; format, it's left unchanged.
-
-(defun htmlize-color-to-rgb (color)
-  (let ((rgb-string nil))
-    (cond ((null color)
-	   ;; Ignore nil COLOR because it means that the face is not
-	   ;; specifying any color.  Hence (htmlize-color-to-rgb nil)
-	   ;; returns nil.
-	   )
-	  ((string-match "\\`#" color)
-	   ;; The color is already in #rrggbb format.
-	   (setq rgb-string color))
-	  ((and htmlize-use-rgb-txt
-		htmlize-color-rgb-hash)
-	   ;; Use of rgb.txt is requested, and it's available on the
-	   ;; system.  Use it.
-	   (setq rgb-string (gethash (downcase color) htmlize-color-rgb-hash)))
-	  (t
-	   ;; We're getting the RGB components from Emacs.
-	   (let ((rgb
-		  (if (fboundp 'color-instance-rgb-components)
-		      (mapcar (lambda (arg)
-				(/ arg 256))
-			      (color-instance-rgb-components
-			       (make-color-instance color)))
-		    (mapcar (lambda (arg)
-			      (/ arg 256))
-			    (color-values color)))))
-	     (when rgb
-	       (setq rgb-string (apply #'format "#%02x%02x%02x" rgb))))))
-    ;; If RGB-STRING is still nil, it means the color cannot be found,
-    ;; for whatever reason.  In that case just punt and return COLOR.
-    ;; Most browsers support a decent set of color names anyway.
-    (or rgb-string color)))
-
-;; We store the face properties we care about into an
-;; `htmlize-fstruct' type.  That way we only have to analyze face
-;; properties, which can be time consuming, once per each face.  The
-;; mapping between Emacs faces and htmlize-fstructs is established by
-;; htmlize-make-face-map.  The name "fstruct" refers to variables of
-;; type `htmlize-fstruct', while the term "face" is reserved for Emacs
-;; faces.
-
-(defstruct htmlize-fstruct
-  foreground				; foreground color, #rrggbb
-  background				; background color, #rrggbb
-  size					; size
-  boldp					; whether face is bold
-  italicp				; whether face is italic
-  underlinep				; whether face is underlined
-  overlinep				; whether face is overlined
-  strikep				; whether face is struck through
-  css-name				; CSS name of face
-  )
-
-(defun htmlize-face-set-from-keyword-attr (fstruct attr value)
-  ;; For ATTR and VALUE, set the equivalent value in FSTRUCT.
-  (case attr
-    (:foreground
-     (setf (htmlize-fstruct-foreground fstruct) (htmlize-color-to-rgb value)))
-    (:background
-     (setf (htmlize-fstruct-background fstruct) (htmlize-color-to-rgb value)))
-    (:height
-     (setf (htmlize-fstruct-size fstruct) value))
-    (:weight
-     (when (string-match (symbol-name value) "bold")
-       (setf (htmlize-fstruct-boldp fstruct) t)))
-    (:slant
-     (setf (htmlize-fstruct-italicp fstruct) (or (eq value 'italic)
-						 (eq value 'oblique))))
-    (:bold
-     (setf (htmlize-fstruct-boldp fstruct) value))
-    (:italic
-     (setf (htmlize-fstruct-italicp fstruct) value))
-    (:underline
-     (setf (htmlize-fstruct-underlinep fstruct) value))
-    (:overline
-     (setf (htmlize-fstruct-overlinep fstruct) value))
-    (:strike-through
-     (setf (htmlize-fstruct-strikep fstruct) value))))
-
-(defun htmlize-face-size (face)
-  ;; The size (height) of FACE, taking inheritance into account.
-  ;; Only works in Emacs 21 and later.
-  (let* ((face-list (list face))
-         (head face-list)
-         (tail face-list))
-    (while head
-      (let ((inherit (face-attribute (car head) :inherit)))
-        (cond ((listp inherit)
-               (setcdr tail (copy-list inherit))
-               (setq tail (last tail)))
-              ((eq inherit 'unspecified))
-              (t
-               (setcdr tail (list inherit))
-               (setq tail (cdr tail)))))
-      (pop head))
-    (let ((size-list
-           (loop
-            for f in face-list
-            for h = (face-attribute f :height)
-            collect (if (eq h 'unspecified) nil h))))
-      (reduce 'htmlize-merge-size (cons nil size-list)))))
-
-(defun htmlize-face-css-name (face)
-  ;; Generate the css-name property for the given face.  Emacs places
-  ;; no restrictions on the names of symbols that represent faces --
-  ;; any characters may be in the name, even control chars.  We try
-  ;; hard to beat the face name into shape, both esthetically and
-  ;; according to CSS1 specs.
-  (let ((name (downcase (symbol-name face))))
-    (when (string-match "\\`font-lock-" name)
-      ;; font-lock-FOO-face -> FOO.
-      (setq name (replace-match "" t t name)))
-    (when (string-match "-face\\'" name)
-      ;; Drop the redundant "-face" suffix.
-      (setq name (replace-match "" t t name)))
-    (while (string-match "[^-a-zA-Z0-9]" name)
-      ;; Drop the non-alphanumerics.
-      (setq name (replace-match "X" t t name)))
-    (when (string-match "\\`[-0-9]" name)
-      ;; CSS identifiers may not start with a digit.
-      (setq name (concat "X" name)))
-    ;; After these transformations, the face could come out empty.
-    (when (equal name "")
-      (setq name "face"))
-    ;; Apply the prefix.
-    (concat htmlize-css-name-prefix name)))
-
-(defun htmlize-face-to-fstruct (face)
-  "Convert Emacs face FACE to fstruct."
-  (let ((fstruct (make-htmlize-fstruct
-		  :foreground (htmlize-color-to-rgb
-			       (htmlize-face-foreground face))
-		  :background (htmlize-color-to-rgb
-			       (htmlize-face-background face)))))
-    (if htmlize-running-xemacs
-        ;; XEmacs doesn't provide a way to detect whether a face is
-        ;; bold or italic, so we need to examine the font instance.
-        (let* ((font-instance (face-font-instance face))
-               (props (font-instance-properties font-instance)))
-          (when (equalp (cdr (assq 'WEIGHT_NAME props)) "bold")
-            (setf (htmlize-fstruct-boldp fstruct) t))
-          (when (or (equalp (cdr (assq 'SLANT props)) "i")
-                    (equalp (cdr (assq 'SLANT props)) "o"))
-            (setf (htmlize-fstruct-italicp fstruct) t))
-          (setf (htmlize-fstruct-strikep fstruct)
-                (face-strikethru-p face))
-          (setf (htmlize-fstruct-underlinep fstruct)
-                (face-underline-p face)))
-      ;; GNU Emacs
-      (dolist (attr '(:weight :slant :underline :overline :strike-through))
-        (let ((value (face-attribute face attr nil t)))
-          (when (and value (not (eq value 'unspecified)))
-            (htmlize-face-set-from-keyword-attr fstruct attr value))))
-      (let ((size (htmlize-face-size face)))
-        (unless (eql size 1.0) 	; ignore non-spec
-          (setf (htmlize-fstruct-size fstruct) size))))
-    (setf (htmlize-fstruct-css-name fstruct) (htmlize-face-css-name face))
-    fstruct))
-
-(defmacro htmlize-copy-attr-if-set (attr-list dest source)
-  ;; Generate code with the following pattern:
-  ;; (progn
-  ;;   (when (htmlize-fstruct-ATTR source)
-  ;;     (setf (htmlize-fstruct-ATTR dest) (htmlize-fstruct-ATTR source)))
-  ;;   ...)
-  ;; for the given list of boolean attributes.
-  (cons 'progn
-	(loop for attr in attr-list
-	      for attr-sym = (intern (format "htmlize-fstruct-%s" attr))
-	      collect `(when (,attr-sym ,source)
-                         (setf (,attr-sym ,dest) (,attr-sym ,source))))))
-
-(defun htmlize-merge-size (merged next)
-  ;; Calculate the size of the merge of MERGED and NEXT.
-  (cond ((null merged)     next)
-	((integerp next)   next)
-	((null next)       merged)
-	((floatp merged)   (* merged next))
-	((integerp merged) (round (* merged next)))))
-
-(defun htmlize-merge-two-faces (merged next)
-  (htmlize-copy-attr-if-set
-   (foreground background boldp italicp underlinep overlinep strikep)
-   merged next)
-  (setf (htmlize-fstruct-size merged)
-	(htmlize-merge-size (htmlize-fstruct-size merged)
-			    (htmlize-fstruct-size next)))
-  merged)
-
-(defun htmlize-merge-faces (fstruct-list)
-  (cond ((null fstruct-list)
-	 ;; Nothing to do, return a dummy face.
-	 (make-htmlize-fstruct))
-	((null (cdr fstruct-list))
-	 ;; Optimize for the common case of a single face, simply
-	 ;; return it.
-	 (car fstruct-list))
-	(t
-	 (reduce #'htmlize-merge-two-faces
-		 (cons (make-htmlize-fstruct) fstruct-list)))))
-
-;; GNU Emacs 20+ supports attribute lists in `face' properties.  For
-;; example, you can use `(:foreground "red" :weight bold)' as an
-;; overlay's "face", or you can even use a list of such lists, etc.
-;; We call those "attrlists".
-;;
-;; htmlize supports attrlist by converting them to fstructs, the same
-;; as with regular faces.
-
-(defun htmlize-attrlist-to-fstruct (attrlist &optional name)
-  ;; Like htmlize-face-to-fstruct, but accepts an ATTRLIST as input.
-  (let ((fstruct (make-htmlize-fstruct)))
-    (cond ((eq (car attrlist) 'foreground-color)
-	   ;; ATTRLIST is (foreground-color . COLOR)
-	   (setf (htmlize-fstruct-foreground fstruct)
-		 (htmlize-color-to-rgb (cdr attrlist))))
-	  ((eq (car attrlist) 'background-color)
-	   ;; ATTRLIST is (background-color . COLOR)
-	   (setf (htmlize-fstruct-background fstruct)
-		 (htmlize-color-to-rgb (cdr attrlist))))
-	  (t
-	   ;; ATTRLIST is a plist.
-	   (while attrlist
-	     (let ((attr (pop attrlist))
-		   (value (pop attrlist)))
-	       (when (and value (not (eq value 'unspecified)))
-		 (htmlize-face-set-from-keyword-attr fstruct attr value))))))
-    (setf (htmlize-fstruct-css-name fstruct) (or name "custom"))
-    fstruct))
-
-(defun htmlize-decode-face-prop (prop)
-  "Turn face property PROP into a list of face-like objects."
-  ;; PROP can be a symbol naming a face, a string naming such a
-  ;; symbol, a cons (foreground-color . COLOR) or (background-color
-  ;; COLOR), a property list (:attr1 val1 :attr2 val2 ...), or a list
-  ;; of any of those.
-  ;;
-  ;; (htmlize-decode-face-prop 'face) -> (face)
-  ;; (htmlize-decode-face-prop '(face1 face2)) -> (face1 face2)
-  ;; (htmlize-decode-face-prop '(:attr "val")) -> ((:attr "val"))
-  ;; (htmlize-decode-face-prop '((:attr "val") face (foreground-color "red")))
-  ;;   -> ((:attr "val") face (foreground-color "red"))
-  ;;
-  ;; Unrecognized atoms or non-face symbols/strings are silently
-  ;; stripped away.
-  (cond ((null prop)
-         nil)
-        ((symbolp prop)
-         (and (facep prop)
-              (list prop)))
-        ((stringp prop)
-         (and (facep (intern-soft prop))
-              (list prop)))
-        ((atom prop)
-         nil)
-        ((and (symbolp (car prop))
-              (eq ?: (aref (symbol-name (car prop)) 0)))
-         (list prop))
-        ((or (eq (car prop) 'foreground-color)
-             (eq (car prop) 'background-color))
-         (list prop))
-        (t
-         (apply #'nconc (mapcar #'htmlize-decode-face-prop prop)))))
-
-(defun htmlize-get-override-fstruct (face)
-  (let* ((raw-def (plist-get htmlize-face-overrides face))
-         (def (cond ((stringp raw-def) (list :foreground raw-def))
-                    ((listp raw-def) raw-def)
-                    (t
-                     (error (format (concat "face override must be an "
-                                            "attribute list or string, got %s")
-                                    raw-def))))))
-    (and def
-         (htmlize-attrlist-to-fstruct def (symbol-name face)))))
-
-(defun htmlize-make-face-map (faces)
-  ;; Return a hash table mapping Emacs faces to htmlize's fstructs.
-  ;; The keys are either face symbols or attrlists, so the test
-  ;; function must be `equal'.
-  (let ((face-map (make-hash-table :test 'equal))
-	css-names)
-    (dolist (face faces)
-      (unless (gethash face face-map)
-	;; Haven't seen FACE yet; convert it to an fstruct and cache
-	;; it.
-	(let ((fstruct (if (symbolp face)
-                           (or (htmlize-get-override-fstruct face)
-                               (htmlize-face-to-fstruct face))
-			 (htmlize-attrlist-to-fstruct face))))
-	  (setf (gethash face face-map) fstruct)
-	  (let* ((css-name (htmlize-fstruct-css-name fstruct))
-		 (new-name css-name)
-		 (i 0))
-	    ;; Uniquify the face's css-name by using NAME-1, NAME-2,
-	    ;; etc.
-	    (while (member new-name css-names)
-	      (setq new-name (format "%s-%s" css-name (incf i))))
-	    (unless (equal new-name css-name)
-	      (setf (htmlize-fstruct-css-name fstruct) new-name))
-	    (push new-name css-names)))))
-    face-map))
-
-(defun htmlize-unstringify-face (face)
-  "If FACE is a string, return it interned, otherwise return it unchanged."
-  (if (stringp face)
-      (intern face)
-    face))
-
-(defun htmlize-faces-in-buffer ()
-  "Return a list of faces used in the current buffer.
-Under XEmacs, this returns the set of faces specified by the extents
-with the `face' property.  (This covers text properties as well.)  Under
-GNU Emacs, it returns the set of faces specified by the `face' text
-property and by buffer overlays that specify `face'."
-  (let (faces)
-    ;; Testing for (fboundp 'map-extents) doesn't work because W3
-    ;; defines `map-extents' under FSF.
-    (if htmlize-running-xemacs
-	(let (face-prop)
-	  (map-extents (lambda (extent ignored)
-			 (setq face-prop (extent-face extent)
-			       ;; FACE-PROP can be a face or a list of
-			       ;; faces.
-			       faces (if (listp face-prop)
-					 (union face-prop faces)
-				       (adjoin face-prop faces)))
-			 nil)
-		       nil
-		       ;; Specify endpoints explicitly to respect
-		       ;; narrowing.
-		       (point-min) (point-max) nil nil 'face))
-      ;; FSF Emacs code.
-      ;; Faces used by text properties.
-      (let ((pos (point-min)) face-prop next)
-	(while (< pos (point-max))
-	  (setq face-prop (get-text-property pos 'face)
-		next (or (next-single-property-change pos 'face) (point-max)))
-          (setq faces (nunion (htmlize-decode-face-prop face-prop)
-                              faces :test 'equal))
-	  (setq pos next)))
-      ;; Faces used by overlays.
-      (dolist (overlay (overlays-in (point-min) (point-max)))
-	(let ((face-prop (overlay-get overlay 'face)))
-          (setq faces (nunion (htmlize-decode-face-prop face-prop)
-                              faces :test 'equal)))))
-    faces))
-
-;; htmlize-faces-at-point returns the faces in use at point.  The
-;; faces are sorted by increasing priority, i.e. the last face takes
-;; precedence.
-;;
-;; Under XEmacs, this returns all the faces in all the extents at
-;; point.  Under GNU Emacs, this returns all the faces in the `face'
-;; property and all the faces in the overlays at point.
-
-(cond (htmlize-running-xemacs
-       (defun htmlize-faces-at-point ()
-	 (let (extent extent-list face-list face-prop)
-	   (while (setq extent (extent-at (point) nil 'face extent))
-	     (push extent extent-list))
-	   ;; extent-list is in reverse display order, meaning that
-	   ;; smallest ones come last.  That is the order we want,
-	   ;; except it can be overridden by the `priority' property.
-	   (setq extent-list (stable-sort extent-list #'<
-					  :key #'extent-priority))
-	   (dolist (extent extent-list)
-	     (setq face-prop (extent-face extent))
-	     ;; extent's face-list is in reverse order from what we
-	     ;; want, but the `nreverse' below will take care of it.
-	     (setq face-list (if (listp face-prop)
-				 (append face-prop face-list)
-			       (cons face-prop face-list))))
-	   (nreverse face-list))))
-      (t
-       (defun htmlize-faces-at-point ()
-	 (let (all-faces)
-	   ;; Faces from text properties.
-	   (let ((face-prop (get-text-property (point) 'face)))
-             ;; we need to reverse the `face' prop because we want
-             ;; more specific faces to come later
-	     (setq all-faces (nreverse (htmlize-decode-face-prop face-prop))))
-	   ;; Faces from overlays.
-	   (let ((overlays
-		  ;; Collect overlays at point that specify `face'.
-		  (delete-if-not (lambda (o)
-				   (overlay-get o 'face))
-				 (overlays-at (point))))
-		 list face-prop)
-	     ;; Sort the overlays so the smaller (more specific) ones
-	     ;; come later.  The number of overlays at each one
-	     ;; position should be very small, so the sort shouldn't
-	     ;; slow things down.
-	     (setq overlays (sort* overlays
-				   ;; Sort by ascending...
-				   #'<
-				   ;; ...overlay size.
-				   :key (lambda (o)
-					  (- (overlay-end o)
-					     (overlay-start o)))))
-	     ;; Overlay priorities, if present, override the above
-	     ;; established order.  Larger overlay priority takes
-	     ;; precedence and therefore comes later in the list.
-	     (setq overlays (stable-sort
-			     overlays
-			     ;; Reorder (stably) by acending...
-			     #'<
-			     ;; ...overlay priority.
-			     :key (lambda (o)
-				    (or (overlay-get o 'priority) 0))))
-	     (dolist (overlay overlays)
-	       (setq face-prop (overlay-get overlay 'face)
-                     list (nconc (htmlize-decode-face-prop face-prop) list)))
-	     ;; Under "Merging Faces" the manual explicitly states
-	     ;; that faces specified by overlays take precedence over
-	     ;; faces specified by text properties.
-	     (setq all-faces (nconc all-faces list)))
-	   all-faces))))
-
-;; htmlize supports generating HTML in several flavors, some of which
-;; use CSS, and others the <font> element.  We take an OO approach and
-;; define "methods" that indirect to the functions that depend on
-;; `htmlize-output-type'.  The currently used methods are `doctype',
-;; `insert-head', `body-tag', and `text-markup'.  Not all output types
-;; define all methods.
-;;
-;; Methods are called either with (htmlize-method METHOD ARGS...) 
-;; special form, or by accessing the function with
-;; (htmlize-method-function 'METHOD) and calling (funcall FUNCTION).
-;; The latter form is useful in tight loops because `htmlize-method'
-;; conses.
-
-(defmacro htmlize-method (method &rest args)
-  ;; Expand to (htmlize-TYPE-METHOD ...ARGS...).  TYPE is the value of
-  ;; `htmlize-output-type' at run time.
-  `(funcall (htmlize-method-function ',method) ,@args))
-
-(defun htmlize-method-function (method)
-  ;; Return METHOD's function definition for the current output type.
-  ;; The returned object can be safely funcalled.
-  (let ((sym (intern (format "htmlize-%s-%s" htmlize-output-type method))))
-    (indirect-function (if (fboundp sym)
-			   sym
-			 (let ((default (intern (concat "htmlize-default-"
-							(symbol-name method)))))
-			   (if (fboundp default)
-			       default
-			     'ignore))))))
-
-(defvar htmlize-memoization-table (make-hash-table :test 'equal))
-
-(defmacro htmlize-memoize (key generator)
-  "Return the value of GENERATOR, memoized as KEY.
-That means that GENERATOR will be evaluated and returned the first time
-it's called with the same value of KEY.  All other times, the cached
-\(memoized) value will be returned."
-  (let ((value (gensym)))
-    `(let ((,value (gethash ,key htmlize-memoization-table)))
-       (unless ,value
-	 (setq ,value ,generator)
-	 (setf (gethash ,key htmlize-memoization-table) ,value))
-       ,value)))
-
-;;; Default methods.
-
-(defun htmlize-default-doctype ()
-  nil					; no doc-string
-  ;; Note that the `font' output is technically invalid under this DTD
-  ;; because the DTD doesn't allow embedding <font> in <pre>.
-  "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\">"
-  )
-
-(defun htmlize-default-body-tag (face-map)
-  nil					; no doc-string
-  face-map ; shut up the byte-compiler
-  "<body>")
-
-;;; CSS based output support.
-
-;; Internal function; not a method.
-(defun htmlize-css-specs (fstruct)
-  (let (result)
-    (when (htmlize-fstruct-foreground fstruct)
-      (push (format "color: %s;" (htmlize-fstruct-foreground fstruct))
-	    result))
-    (when (htmlize-fstruct-background fstruct)
-      (push (format "background-color: %s;"
-		    (htmlize-fstruct-background fstruct))
-	    result))
-    (let ((size (htmlize-fstruct-size fstruct)))
-      (when (and size (not (eq htmlize-ignore-face-size t)))
-	(cond ((floatp size)
-	       (push (format "font-size: %d%%;" (* 100 size)) result))
-	      ((not (eq htmlize-ignore-face-size 'absolute))
-	       (push (format "font-size: %spt;" (/ size 10.0)) result)))))
-    (when (htmlize-fstruct-boldp fstruct)
-      (push "font-weight: bold;" result))
-    (when (htmlize-fstruct-italicp fstruct)
-      (push "font-style: italic;" result))
-    (when (htmlize-fstruct-underlinep fstruct)
-      (push "text-decoration: underline;" result))
-    (when (htmlize-fstruct-overlinep fstruct)
-      (push "text-decoration: overline;" result))
-    (when (htmlize-fstruct-strikep fstruct)
-      (push "text-decoration: line-through;" result))
-    (nreverse result)))
-
-(defun htmlize-css-insert-head (buffer-faces face-map)
-  (insert "    <style type=\"text/css\">\n    <!--\n")
-  (insert "      body {\n        "
-	  (mapconcat #'identity
-		     (htmlize-css-specs (gethash 'default face-map))
-		     "\n        ")
-	  "\n      }\n")
-  (dolist (face (sort* (copy-list buffer-faces) #'string-lessp
-		       :key (lambda (f)
-			      (htmlize-fstruct-css-name (gethash f face-map)))))
-    (let* ((fstruct (gethash face face-map))
-	   (cleaned-up-face-name
-	    (let ((s
-		   ;; Use `prin1-to-string' rather than `symbol-name'
-		   ;; to get the face name because the "face" can also
-		   ;; be an attrlist, which is not a symbol.
-		   (prin1-to-string face)))
-	      ;; If the name contains `--' or `*/', remove them.
-	      (while (string-match "--" s)
-		(setq s (replace-match "-" t t s)))
-	      (while (string-match "\\*/" s)
-		(setq s (replace-match "XX" t t s)))
-	      s))
-	   (specs (htmlize-css-specs fstruct)))
-      (insert "      ." (htmlize-fstruct-css-name fstruct))
-      (if (null specs)
-	  (insert " {")
-	(insert " {\n        /* " cleaned-up-face-name " */\n        "
-		(mapconcat #'identity specs "\n        ")))
-      (insert "\n      }\n")))
-  (insert htmlize-hyperlink-style
-	  "    -->\n    </style>\n"))
-
-(defun htmlize-css-text-markup (fstruct-list buffer)
-  ;; Open the markup needed to insert text colored with FACES into
-  ;; BUFFER.  Return the function that closes the markup.
-
-  ;; In CSS mode, this is easy: just nest the text in one <span
-  ;; class=...> tag for each face in FSTRUCT-LIST.
-  (dolist (fstruct fstruct-list)
-    (princ "<span class=\"" buffer)
-    (princ (htmlize-fstruct-css-name fstruct) buffer)
-    (princ "\">" buffer))
-  (htmlize-lexlet ((fstruct-list fstruct-list) (buffer buffer))
-    (lambda ()
-      (dolist (fstruct fstruct-list)
-        (ignore fstruct)                ; shut up the byte-compiler
-        (princ "</span>" buffer)))))
-
-;; `inline-css' output support.
-
-(defun htmlize-inline-css-body-tag (face-map)
-  (format "<body style=\"%s\">"
-	  (mapconcat #'identity (htmlize-css-specs (gethash 'default face-map))
-		     " ")))
-
-(defun htmlize-inline-css-text-markup (fstruct-list buffer)
-  (let* ((merged (htmlize-merge-faces fstruct-list))
-	 (style (htmlize-memoize
-		 merged
-		 (let ((specs (htmlize-css-specs merged)))
-		   (and specs
-			(mapconcat #'identity (htmlize-css-specs merged) " "))))))
-    (when style
-      (princ "<span style=\"" buffer)
-      (princ style buffer)
-      (princ "\">" buffer))
-    (htmlize-lexlet ((style style) (buffer buffer))
-      (lambda ()
-        (when style
-          (princ "</span>" buffer))))))
-
-;;; `font' tag based output support.
-
-(defun htmlize-font-body-tag (face-map)
-  (let ((fstruct (gethash 'default face-map)))
-    (format "<body text=\"%s\" bgcolor=\"%s\">"
-	    (htmlize-fstruct-foreground fstruct)
-	    (htmlize-fstruct-background fstruct))))
-       
-(defun htmlize-font-text-markup (fstruct-list buffer)
-  ;; In `font' mode, we use the traditional HTML means of altering
-  ;; presentation: <font> tag for colors, <b> for bold, <u> for
-  ;; underline, and <strike> for strike-through.
-  (let* ((merged (htmlize-merge-faces fstruct-list))
-	 (markup (htmlize-memoize
-		  merged
-		  (cons (concat
-			 (and (htmlize-fstruct-foreground merged)
-			      (format "<font color=\"%s\">" (htmlize-fstruct-foreground merged)))
-			 (and (htmlize-fstruct-boldp merged)      "<b>")
-			 (and (htmlize-fstruct-italicp merged)    "<i>")
-			 (and (htmlize-fstruct-underlinep merged) "<u>")
-			 (and (htmlize-fstruct-strikep merged)    "<strike>"))
-			(concat
-			 (and (htmlize-fstruct-strikep merged)    "</strike>")
-			 (and (htmlize-fstruct-underlinep merged) "</u>")
-			 (and (htmlize-fstruct-italicp merged)    "</i>")
-			 (and (htmlize-fstruct-boldp merged)      "</b>")
-			 (and (htmlize-fstruct-foreground merged) "</font>"))))))
-    (princ (car markup) buffer)
-    (htmlize-lexlet ((markup markup) (buffer buffer))
-      (lambda ()
-        (princ (cdr markup) buffer)))))
-
-(defun htmlize-buffer-1 ()
-  ;; Internal function; don't call it from outside this file.  Htmlize
-  ;; current buffer, writing the resulting HTML to a new buffer, and
-  ;; return it.  Unlike htmlize-buffer, this doesn't change current
-  ;; buffer or use switch-to-buffer.
-  (save-excursion
-    ;; Protect against the hook changing the current buffer.
-    (save-excursion
-      (run-hooks 'htmlize-before-hook))
-    ;; Convince font-lock support modes to fontify the entire buffer
-    ;; in advance.
-    (htmlize-ensure-fontified)
-    (clrhash htmlize-extended-character-cache)
-    (clrhash htmlize-memoization-table)
-    ;; It's important that the new buffer inherits default-directory
-    ;; from the current buffer.
-    (let ((htmlbuf (generate-new-buffer (if (buffer-file-name)
-                                            (htmlize-make-file-name
-                                             (file-name-nondirectory
-                                              (buffer-file-name)))
-                                          "*html*")))
-          (completed nil))
-      (unwind-protect
-          (let* ((buffer-faces (htmlize-faces-in-buffer))
-                 (face-map (htmlize-make-face-map (adjoin 'default buffer-faces)))
-                 (places (gensym))
-                 (title (if (buffer-file-name)
-                            (file-name-nondirectory (buffer-file-name))
-                          (buffer-name))))
-            (when htmlize-generate-hyperlinks
-              (htmlize-create-auto-links))
-            (when htmlize-replace-form-feeds
-              (htmlize-shadow-form-feeds))
-
-            ;; Initialize HTMLBUF and insert the HTML prolog.
-            (with-current-buffer htmlbuf
-              (buffer-disable-undo)
-              (insert (htmlize-method doctype) ?\n
-                      (format "<!-- Created by htmlize-%s in %s mode. -->\n"
-                              htmlize-version htmlize-output-type)
-                      "<html>\n  ")
-              (put places 'head-start (point-marker))
-              (insert "<head>\n"
-                      "    <title>" (htmlize-protect-string title) "</title>\n"
-                      (if htmlize-html-charset
-                          (format (concat "    <meta http-equiv=\"Content-Type\" "
-                                          "content=\"text/html; charset=%s\">\n")
-                                  htmlize-html-charset)
-                        "")
-                      htmlize-head-tags)
-              (htmlize-method insert-head buffer-faces face-map)
-              (insert "  </head>")
-              (put places 'head-end (point-marker))
-              (insert "\n  ")
-              (put places 'body-start (point-marker))
-              (insert (htmlize-method body-tag face-map)
-                      "\n    ")
-              (put places 'content-start (point-marker))
-              (insert "<pre>\n"))
-            (let ((text-markup
-                   ;; Get the inserter method, so we can funcall it inside
-                   ;; the loop.  Not calling `htmlize-method' in the loop
-                   ;; body yields a measurable speed increase.
-                   (htmlize-method-function 'text-markup))
-                  ;; Declare variables used in loop body outside the loop
-                  ;; because it's faster to establish `let' bindings only
-                  ;; once.
-                  next-change text face-list trailing-ellipsis
-                  fstruct-list last-fstruct-list
-                  (close-markup (lambda ())))
-              ;; This loop traverses and reads the source buffer, appending
-              ;; the resulting HTML to HTMLBUF.  This method is fast
-              ;; because: 1) it doesn't require examining the text
-              ;; properties char by char (htmlize-next-face-change is used
-              ;; to move between runs with the same face), and 2) it doesn't
-              ;; require frequent buffer switches, which are slow because
-              ;; they rebind all buffer-local vars.
-              (goto-char (point-min))
-              (while (not (eobp))
-                (setq next-change (htmlize-next-face-change (point)))
-                ;; Get faces in use between (point) and NEXT-CHANGE, and
-                ;; convert them to fstructs.
-                (setq face-list (htmlize-faces-at-point)
-                      fstruct-list (delq nil (mapcar (lambda (f)
-                                                       (gethash f face-map))
-                                                     face-list)))
-                (multiple-value-setq (text trailing-ellipsis)
-                  (htmlize-extract-text (point) next-change trailing-ellipsis))
-                ;; Don't bother writing anything if there's no text (this
-                ;; happens in invisible regions).
-                (when (> (length text) 0)
-                  ;; Open the new markup if necessary and insert the text.
-                  (when (not (equalp fstruct-list last-fstruct-list))
-                    (funcall close-markup)
-                    (setq last-fstruct-list fstruct-list
-                          close-markup (funcall text-markup fstruct-list htmlbuf)))
-                  (princ text htmlbuf))
-                (goto-char next-change))
-
-              ;; We've gone through the buffer; close the markup from
-              ;; the last run, if any.
-              (funcall close-markup))
-
-            ;; Insert the epilog and post-process the buffer.
-            (with-current-buffer htmlbuf
-              (insert "</pre>")
-              (put places 'content-end (point-marker))
-              (insert "\n  </body>")
-              (put places 'body-end (point-marker))
-              (insert "\n</html>\n")
-              (htmlize-defang-local-variables)
-              (goto-char (point-min))
-              (when htmlize-html-major-mode
-                ;; What sucks about this is that the minor modes, most notably
-                ;; font-lock-mode, won't be initialized.  Oh well.
-                (funcall htmlize-html-major-mode))
-              (set (make-local-variable 'htmlize-buffer-places)
-                   (symbol-plist places))
-              (run-hooks 'htmlize-after-hook)
-              (buffer-enable-undo))
-            (setq completed t)
-            htmlbuf)
-
-        (when (not completed)
-          (kill-buffer htmlbuf))
-        (htmlize-delete-tmp-overlays)))))
-
-;; Utility functions.
-
-(defmacro htmlize-with-fontify-message (&rest body)
-  ;; When forcing fontification of large buffers in
-  ;; htmlize-ensure-fontified, inform the user that he is waiting for
-  ;; font-lock, not for htmlize to finish.
-  `(progn
-     (if (> (buffer-size) 65536)
-	 (message "Forcing fontification of %s..."
-		  (buffer-name (current-buffer))))
-     ,@body
-     (if (> (buffer-size) 65536)
-	 (message "Forcing fontification of %s...done"
-		  (buffer-name (current-buffer))))))
-
-(defun htmlize-ensure-fontified ()
-  ;; If font-lock is being used, ensure that the "support" modes
-  ;; actually fontify the buffer.  If font-lock is not in use, we
-  ;; don't care because, except in htmlize-file, we don't force
-  ;; font-lock on the user.
-  (when (and (boundp 'font-lock-mode)
-	     font-lock-mode)
-    ;; In part taken from ps-print-ensure-fontified in GNU Emacs 21.
-    (cond
-     ((and (boundp 'jit-lock-mode)
-	   (symbol-value 'jit-lock-mode))
-      (htmlize-with-fontify-message
-       (jit-lock-fontify-now (point-min) (point-max))))
-     ((and (boundp 'lazy-lock-mode)
-	   (symbol-value 'lazy-lock-mode))
-      (htmlize-with-fontify-message
-       (lazy-lock-fontify-region (point-min) (point-max))))
-     ((and (boundp 'lazy-shot-mode)
-	   (symbol-value 'lazy-shot-mode))
-      (htmlize-with-fontify-message
-       ;; lazy-shot is amazing in that it must *refontify* the region,
-       ;; even if the whole buffer has already been fontified.  <sigh>
-       (lazy-shot-fontify-region (point-min) (point-max))))
-     ;; There's also fast-lock, but we don't need to handle specially,
-     ;; I think.  fast-lock doesn't really defer fontification, it
-     ;; just saves it to an external cache so it's not done twice.
-     )))
-
-
-;;;###autoload
-(defun htmlize-buffer (&optional buffer)
-  "Convert BUFFER to HTML, preserving colors and decorations.
-
-The generated HTML is available in a new buffer, which is returned.
-When invoked interactively, the new buffer is selected in the current
-window.  The title of the generated document will be set to the buffer's
-file name or, if that's not available, to the buffer's name.
-
-Note that htmlize doesn't fontify your buffers, it only uses the
-decorations that are already present.  If you don't set up font-lock or
-something else to fontify your buffers, the resulting HTML will be
-plain.  Likewise, if you don't like the choice of colors, fix the mode
-that created them, or simply alter the faces it uses."
-  (interactive)
-  (let ((htmlbuf (with-current-buffer (or buffer (current-buffer))
-		   (htmlize-buffer-1))))
-    (when (interactive-p)
-      (switch-to-buffer htmlbuf))
-    htmlbuf))
-
-;;;###autoload
-(defun htmlize-region (beg end)
-  "Convert the region to HTML, preserving colors and decorations.
-See `htmlize-buffer' for details."
-  (interactive "r")
-  ;; Don't let zmacs region highlighting end up in HTML.
-  (when (fboundp 'zmacs-deactivate-region)
-    (zmacs-deactivate-region))
-  (let ((htmlbuf (save-restriction
-		   (narrow-to-region beg end)
-		   (htmlize-buffer-1))))
-    (when (interactive-p)
-      (switch-to-buffer htmlbuf))
-    htmlbuf))
-
-(defun htmlize-region-for-paste (beg end)
-  "Htmlize the region and return just the HTML as a string.
-This forces the `inline-css' style and only returns the HTML body,
-but without the BODY tag.  This should make it useful for inserting
-the text to another HTML buffer."
-  (let* ((htmlize-output-type 'inline-css)
-	 (htmlbuf (htmlize-region beg end)))
-    (unwind-protect
-	(with-current-buffer htmlbuf
-	  (buffer-substring (plist-get htmlize-buffer-places 'content-start)
-			    (plist-get htmlize-buffer-places 'content-end)))
-      (kill-buffer htmlbuf))))
-
-(defun htmlize-make-file-name (file)
-  "Make an HTML file name from FILE.
-
-In its default implementation, this simply appends `.html' to FILE.
-This function is called by htmlize to create the buffer file name, and
-by `htmlize-file' to create the target file name.
-
-More elaborate transformations are conceivable, such as changing FILE's
-extension to `.html' (\"file.c\" -> \"file.html\").  If you want them,
-overload this function to do it and htmlize will comply."
-  (concat file ".html"))
-
-;; Older implementation of htmlize-make-file-name that changes FILE's
-;; extension to ".html".
-;(defun htmlize-make-file-name (file)
-;  (let ((extension (file-name-extension file))
-;	(sans-extension (file-name-sans-extension file)))
-;    (if (or (equal extension "html")
-;	    (equal extension "htm")
-;	    (equal sans-extension ""))
-;	(concat file ".html")
-;      (concat sans-extension ".html"))))
-
-;;;###autoload
-(defun htmlize-file (file &optional target)
-  "Load FILE, fontify it, convert it to HTML, and save the result.
-
-Contents of FILE are inserted into a temporary buffer, whose major mode
-is set with `normal-mode' as appropriate for the file type.  The buffer
-is subsequently fontified with `font-lock' and converted to HTML.  Note
-that, unlike `htmlize-buffer', this function explicitly turns on
-font-lock.  If a form of highlighting other than font-lock is desired,
-please use `htmlize-buffer' directly on buffers so highlighted.
-
-Buffers currently visiting FILE are unaffected by this function.  The
-function does not change current buffer or move the point.
-
-If TARGET is specified and names a directory, the resulting file will be
-saved there instead of to FILE's directory.  If TARGET is specified and
-does not name a directory, it will be used as output file name."
-  (interactive (list (read-file-name
-		      "HTML-ize file: "
-		      nil nil nil (and (buffer-file-name)
-				       (file-name-nondirectory
-					(buffer-file-name))))))
-  (let ((output-file (if (and target (not (file-directory-p target)))
-			 target
-		       (expand-file-name
-			(htmlize-make-file-name (file-name-nondirectory file))
-			(or target (file-name-directory file)))))
-	;; Try to prevent `find-file-noselect' from triggering
-	;; font-lock because we'll fontify explicitly below.
-	(font-lock-mode nil)
-	(font-lock-auto-fontify nil)
-	(global-font-lock-mode nil)
-	;; Ignore the size limit for the purposes of htmlization.
-	(font-lock-maximum-size nil)
-	;; Disable font-lock support modes.  This will only work in
-	;; more recent Emacs versions, so htmlize-buffer-1 still needs
-	;; to call htmlize-ensure-fontified.
-	(font-lock-support-mode nil))
-    (with-temp-buffer
-      ;; Insert FILE into the temporary buffer.
-      (insert-file-contents file)
-      ;; Set the file name so normal-mode and htmlize-buffer-1 pick it
-      ;; up.  Restore it afterwards so with-temp-buffer's kill-buffer
-      ;; doesn't complain about killing a modified buffer.
-      (let ((buffer-file-name file))
-	;; Set the major mode for the sake of font-lock.
-	(normal-mode)
-	(font-lock-mode 1)
-	(unless font-lock-mode
-	  ;; In GNU Emacs (font-lock-mode 1) doesn't force font-lock,
-	  ;; contrary to the documentation.  This seems to work.
-	  (font-lock-fontify-buffer))
-	;; htmlize the buffer and save the HTML.
-	(with-current-buffer (htmlize-buffer-1)
-	  (unwind-protect
-	      (progn
-		(run-hooks 'htmlize-file-hook)
-		(write-region (point-min) (point-max) output-file))
-	    (kill-buffer (current-buffer)))))))
-  ;; I haven't decided on a useful return value yet, so just return
-  ;; nil.
-  nil)
-
-;;;###autoload
-(defun htmlize-many-files (files &optional target-directory)
-  "Convert FILES to HTML and save the corresponding HTML versions.
-
-FILES should be a list of file names to convert.  This function calls
-`htmlize-file' on each file; see that function for details.  When
-invoked interactively, you are prompted for a list of files to convert,
-terminated with RET.
-
-If TARGET-DIRECTORY is specified, the HTML files will be saved to that
-directory.  Normally, each HTML file is saved to the directory of the
-corresponding source file."
-  (interactive
-   (list
-    (let (list file)
-      ;; Use empty string as DEFAULT because setting DEFAULT to nil
-      ;; defaults to the directory name, which is not what we want.
-      (while (not (equal (setq file (read-file-name
-				     "HTML-ize file (RET to finish): "
-				     (and list (file-name-directory
-						(car list)))
-				     "" t))
-			 ""))
-	(push file list))
-      (nreverse list))))
-  ;; Verify that TARGET-DIRECTORY is indeed a directory.  If it's a
-  ;; file, htmlize-file will use it as target, and that doesn't make
-  ;; sense.
-  (and target-directory
-       (not (file-directory-p target-directory))
-       (error "target-directory must name a directory: %s" target-directory))
-  (dolist (file files)
-    (htmlize-file file target-directory)))
-
-;;;###autoload
-(defun htmlize-many-files-dired (arg &optional target-directory)
-  "HTMLize dired-marked files."
-  (interactive "P")
-  (htmlize-many-files (dired-get-marked-files nil arg) target-directory))
-
-(provide 'htmlize)
-
-;; Local Variables:
-;; byte-compile-warnings: (not cl-functions lexical unresolved obsolete)
-;; End:
-
-;;; htmlize.el ends here
.emacs.d/elpa/htmlize-20161211.1019/htmlize.elc
Binary file
.emacs.d/elpa/hydra-20170903.218/hydra-autoloads.el
@@ -1,77 +0,0 @@
-;;; hydra-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "hydra" "hydra.el" (22977 29290 679943 777000))
-;;; Generated autoloads from hydra.el
-
-(autoload 'defhydra "hydra" "\
-Create a Hydra - a family of functions with prefix NAME.
-
-NAME should be a symbol, it will be the prefix of all functions
-defined here.
-
-BODY has the format:
-
-    (BODY-MAP BODY-KEY &rest BODY-PLIST)
-
-DOCSTRING will be displayed in the echo area to identify the
-Hydra.  When DOCSTRING starts with a newline, special Ruby-style
-substitution will be performed by `hydra--format'.
-
-Functions are created on basis of HEADS, each of which has the
-format:
-
-    (KEY CMD &optional HINT &rest PLIST)
-
-BODY-MAP is a keymap; `global-map' is used quite often.  Each
-function generated from HEADS will be bound in BODY-MAP to
-BODY-KEY + KEY (both are strings passed to `kbd'), and will set
-the transient map so that all following heads can be called
-though KEY only.  BODY-KEY can be an empty string.
-
-CMD is a callable expression: either an interactive function
-name, or an interactive lambda, or a single sexp (it will be
-wrapped in an interactive lambda).
-
-HINT is a short string that identifies its head.  It will be
-printed beside KEY in the echo erea if `hydra-is-helpful' is not
-nil.  If you don't even want the KEY to be printed, set HINT
-explicitly to nil.
-
-The heads inherit their PLIST from BODY-PLIST and are allowed to
-override some keys.  The keys recognized are :exit and :bind.
-:exit can be:
-
-- nil (default): this head will continue the Hydra state.
-- t: this head will stop the Hydra state.
-
-:bind can be:
-- nil: this head will not be bound in BODY-MAP.
-- a lambda taking KEY and CMD used to bind a head.
-
-It is possible to omit both BODY-MAP and BODY-KEY if you don't
-want to bind anything.  In that case, typically you will bind the
-generated NAME/body command.  This command is also the return
-result of `defhydra'.
-
-\(fn NAME BODY &optional DOCSTRING &rest HEADS)" nil t)
-
-(function-put 'defhydra 'lisp-indent-function 'defun)
-
-(function-put 'defhydra 'doc-string-elt '3)
-
-;;;***
-
-;;;### (autoloads nil nil ("hydra-examples.el" "hydra-ox.el" "hydra-pkg.el"
-;;;;;;  "lv.el") (22977 29290 682943 747000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; hydra-autoloads.el ends here
.emacs.d/elpa/hydra-20170903.218/hydra-examples.el
@@ -1,386 +0,0 @@
-;;; hydra-examples.el --- Some applications for Hydra
-
-;; Copyright (C) 2015  Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; These are the sample Hydras.
-;;
-;; If you want to use them plainly, set `hydra-examples-verbatim' to t
-;; before requiring this file. But it's probably better to only look
-;; at them and use them as templates for building your own.
-
-;;; Code:
-
-(require 'hydra)
-
-;;* Examples
-;;** Example 1: text scale
-(when (bound-and-true-p hydra-examples-verbatim)
-  (defhydra hydra-zoom (global-map "<f2>")
-    "zoom"
-    ("g" text-scale-increase "in")
-    ("l" text-scale-decrease "out")))
-
-;; This example generates three commands:
-;;
-;;     `hydra-zoom/text-scale-increase'
-;;     `hydra-zoom/text-scale-decrease'
-;;     `hydra-zoom/body'
-;;
-;; In addition, two of them are bound like this:
-;;
-;;     (global-set-key (kbd "<f2> g") 'hydra-zoom/text-scale-increase)
-;;     (global-set-key (kbd "<f2> l") 'hydra-zoom/text-scale-decrease)
-;;
-;; Note that you can substitute `global-map' with e.g. `emacs-lisp-mode-map' if you need.
-;; The functions generated will be the same, except the binding code will change to:
-;;
-;;     (define-key emacs-lisp-mode-map [f2 103]
-;;       (function hydra-zoom/text-scale-increase))
-;;     (define-key emacs-lisp-mode-map [f2 108]
-;;       (function hydra-zoom/text-scale-decrease))
-
-;;** Example 2: move window splitter
-(when (bound-and-true-p hydra-examples-verbatim)
-  (defhydra hydra-splitter (global-map "C-M-s")
-    "splitter"
-    ("h" hydra-move-splitter-left)
-    ("j" hydra-move-splitter-down)
-    ("k" hydra-move-splitter-up)
-    ("l" hydra-move-splitter-right)))
-
-;;** Example 3: jump to error
-(when (bound-and-true-p hydra-examples-verbatim)
-  (defhydra hydra-error (global-map "M-g")
-    "goto-error"
-    ("h" first-error "first")
-    ("j" next-error "next")
-    ("k" previous-error "prev")
-    ("v" recenter-top-bottom "recenter")
-    ("q" nil "quit")))
-
-;; This example introduces only one new thing: since the command
-;; passed to the "q" head is nil, it will quit the Hydra without doing
-;; anything. Heads that quit the Hydra instead of continuing are
-;; referred to as having blue :color. All the other heads have red
-;; :color, unless other is specified.
-
-;;** Example 4: toggle rarely used modes
-(when (bound-and-true-p hydra-examples-verbatim)
-  (defvar whitespace-mode nil)
-  (global-set-key
-   (kbd "C-c C-v")
-   (defhydra hydra-toggle-simple (:color blue)
-     "toggle"
-     ("a" abbrev-mode "abbrev")
-     ("d" toggle-debug-on-error "debug")
-     ("f" auto-fill-mode "fill")
-     ("t" toggle-truncate-lines "truncate")
-     ("w" whitespace-mode "whitespace")
-     ("q" nil "cancel"))))
-
-;; Note that in this case, `defhydra' returns the `hydra-toggle-simple/body'
-;; symbol, which is then passed to `global-set-key'.
-;;
-;; Another new thing is that both the keymap and the body prefix are
-;; skipped.  This means that `defhydra' will bind nothing - that's why
-;; `global-set-key' is necessary.
-;;
-;; One more new thing is that you can assign a :color to the body. All
-;; heads will inherit this color. The code above is very much equivalent to:
-;;
-;;     (global-set-key (kbd "C-c C-v a") 'abbrev-mode)
-;;     (global-set-key (kbd "C-c C-v d") 'toggle-debug-on-error)
-;;
-;; The differences are:
-;;
-;; * You get a hint immediately after "C-c C-v"
-;; * You can cancel and call a command immediately, e.g. "C-c C-v C-n"
-;;   is equivalent to "C-n" with Hydra approach, while it will error
-;;   that "C-c C-v C-n" isn't bound with the usual approach.
-
-;;** Example 5: mini-vi
-(defun hydra-vi/pre ()
-  (set-cursor-color "#e52b50"))
-
-(defun hydra-vi/post ()
-  (set-cursor-color "#ffffff"))
-
-(when (bound-and-true-p hydra-examples-verbatim)
-  (global-set-key
-   (kbd "C-z")
-   (defhydra hydra-vi (:pre hydra-vi/pre :post hydra-vi/post :color amaranth)
-     "vi"
-     ("l" forward-char)
-     ("h" backward-char)
-     ("j" next-line)
-     ("k" previous-line)
-     ("m" set-mark-command "mark")
-     ("a" move-beginning-of-line "beg")
-     ("e" move-end-of-line "end")
-     ("d" delete-region "del" :color blue)
-     ("y" kill-ring-save "yank" :color blue)
-     ("q" nil "quit")))
-  (hydra-set-property 'hydra-vi :verbosity 1))
-
-;; This example introduces :color amaranth. It's similar to red,
-;; except while you can quit red with any binding which isn't a Hydra
-;; head, you can quit amaranth only with a blue head. So you can quit
-;; this mode only with "d", "y", "q" or "C-g".
-;;
-;; Another novelty are the :pre and :post handlers. :pre will be
-;; called before each command, while :post will be called when the
-;; Hydra quits. In this case, they're used to override the cursor
-;; color while Hydra is active.
-
-;;** Example 6: selective global bind
-(when (bound-and-true-p hydra-examples-verbatim)
-  (defhydra hydra-next-error (global-map "C-x")
-    "next-error"
-    ("`" next-error "next")
-    ("j" next-error "next" :bind nil)
-    ("k" previous-error "previous" :bind nil)))
-
-;; This example will bind "C-x `" in `global-map', but it will not
-;; bind "C-x j" and "C-x k".
-;; You can still "C-x `jjk" though.
-
-;;** Example 7: toggle with Ruby-style docstring
-(defvar whitespace-mode nil)
-(defhydra hydra-toggle (:color pink)
-  "
-_a_ abbrev-mode:       %`abbrev-mode
-_d_ debug-on-error:    %`debug-on-error
-_f_ auto-fill-mode:    %`auto-fill-function
-_t_ truncate-lines:    %`truncate-lines
-_w_ whitespace-mode:   %`whitespace-mode
-
-"
-  ("a" abbrev-mode nil)
-  ("d" toggle-debug-on-error nil)
-  ("f" auto-fill-mode nil)
-  ("t" toggle-truncate-lines nil)
-  ("w" whitespace-mode nil)
-  ("q" nil "quit"))
-;; Recommended binding:
-;; (global-set-key (kbd "C-c C-v") 'hydra-toggle/body)
-
-;; Here, using e.g. "_a_" translates to "a" with proper face.
-;; More interestingly:
-;;
-;;     "foobar %`abbrev-mode" means roughly (format "foobar %S" abbrev-mode)
-;;
-;; This means that you actually see the state of the mode that you're changing.
-
-;;** Example 8: the whole menu for `Buffer-menu-mode'
-(defhydra hydra-buffer-menu (:color pink
-                             :hint nil)
-  "
-^Mark^             ^Unmark^           ^Actions^          ^Search
-^^^^^^^^-----------------------------------------------------------------                        (__)
-_m_: mark          _u_: unmark        _x_: execute       _R_: re-isearch                         (oo)
-_s_: save          _U_: unmark up     _b_: bury          _I_: isearch                      /------\\/
-_d_: delete        ^ ^                _g_: refresh       _O_: multi-occur                 / |    ||
-_D_: delete up     ^ ^                _T_: files only: % -28`Buffer-menu-files-only^^    *  /\\---/\\
-_~_: modified      ^ ^                ^ ^                ^^                                 ~~   ~~
-"
-  ("m" Buffer-menu-mark)
-  ("u" Buffer-menu-unmark)
-  ("U" Buffer-menu-backup-unmark)
-  ("d" Buffer-menu-delete)
-  ("D" Buffer-menu-delete-backwards)
-  ("s" Buffer-menu-save)
-  ("~" Buffer-menu-not-modified)
-  ("x" Buffer-menu-execute)
-  ("b" Buffer-menu-bury)
-  ("g" revert-buffer)
-  ("T" Buffer-menu-toggle-files-only)
-  ("O" Buffer-menu-multi-occur :color blue)
-  ("I" Buffer-menu-isearch-buffers :color blue)
-  ("R" Buffer-menu-isearch-buffers-regexp :color blue)
-  ("c" nil "cancel")
-  ("v" Buffer-menu-select "select" :color blue)
-  ("o" Buffer-menu-other-window "other-window" :color blue)
-  ("q" quit-window "quit" :color blue))
-;; Recommended binding:
-;; (define-key Buffer-menu-mode-map "." 'hydra-buffer-menu/body)
-
-;;** Example 9: s-expressions in the docstring
-;; You can inline s-expresssions into the docstring like this:
-(defvar dired-mode-map)
-(declare-function dired-mark "dired")
-(when (bound-and-true-p hydra-examples-verbatim)
-  (require 'dired)
-  (defhydra hydra-marked-items (dired-mode-map "")
-    "
-Number of marked items: %(length (dired-get-marked-files))
-"
-    ("m" dired-mark "mark")))
-
-;; This results in the following dynamic docstring:
-;;
-;;     (format "Number of marked items: %S\n"
-;;             (length (dired-get-marked-files)))
-;;
-;; You can use `format'-style width specs, e.g. % 10(length nil).
-
-;;** Example 10: apropos family
-(defhydra hydra-apropos (:color blue
-                         :hint nil)
-  "
-_a_propos        _c_ommand
-_d_ocumentation  _l_ibrary
-_v_ariable       _u_ser-option
-^ ^          valu_e_"
-  ("a" apropos)
-  ("d" apropos-documentation)
-  ("v" apropos-variable)
-  ("c" apropos-command)
-  ("l" apropos-library)
-  ("u" apropos-user-option)
-  ("e" apropos-value))
-;; Recommended binding:
-;; (global-set-key (kbd "C-c h") 'hydra-apropos/body)
-
-;;** Example 11: rectangle-mark-mode
-(require 'rect)
-(defhydra hydra-rectangle (:body-pre (rectangle-mark-mode 1)
-                           :color pink
-                           :post (deactivate-mark))
-  "
-  ^_k_^     _d_elete    _s_tring
-_h_   _l_   _o_k        _y_ank
-  ^_j_^     _n_ew-copy  _r_eset
-^^^^        _e_xchange  _u_ndo
-^^^^        ^ ^         _p_aste
-"
-  ("h" rectangle-backward-char nil)
-  ("l" rectangle-forward-char nil)
-  ("k" rectangle-previous-line nil)
-  ("j" rectangle-next-line nil)
-  ("e" hydra-ex-point-mark nil)
-  ("n" copy-rectangle-as-kill nil)
-  ("d" delete-rectangle nil)
-  ("r" (if (region-active-p)
-           (deactivate-mark)
-         (rectangle-mark-mode 1)) nil)
-  ("y" yank-rectangle nil)
-  ("u" undo nil)
-  ("s" string-rectangle nil)
-  ("p" kill-rectangle nil)
-  ("o" nil nil))
-
-;; Recommended binding:
-;; (global-set-key (kbd "C-x SPC") 'hydra-rectangle/body)
-
-;;** Example 12: org-agenda-view
-(defun org-agenda-cts ()
-  (and (eq major-mode 'org-agenda-mode)
-       (let ((args (get-text-property
-                    (min (1- (point-max)) (point))
-                    'org-last-args)))
-         (nth 2 args))))
-
-(defhydra hydra-org-agenda-view (:hint none)
-  "
-_d_: ?d? day        _g_: time grid=?g?  _a_: arch-trees
-_w_: ?w? week       _[_: inactive       _A_: arch-files
-_t_: ?t? fortnight  _f_: follow=?f?     _r_: clock report=?r?
-_m_: ?m? month      _e_: entry text=?e? _D_: include diary=?D?
-_y_: ?y? year       _q_: quit           _L__l__c_: log = ?l?"
-  ("SPC" org-agenda-reset-view)
-  ("d" org-agenda-day-view (if (eq 'day (org-agenda-cts)) "[x]" "[ ]"))
-  ("w" org-agenda-week-view (if (eq 'week (org-agenda-cts)) "[x]" "[ ]"))
-  ("t" org-agenda-fortnight-view (if (eq 'fortnight (org-agenda-cts)) "[x]" "[ ]"))
-  ("m" org-agenda-month-view (if (eq 'month (org-agenda-cts)) "[x]" "[ ]"))
-  ("y" org-agenda-year-view (if (eq 'year (org-agenda-cts)) "[x]" "[ ]"))
-  ("l" org-agenda-log-mode (format "% -3S" org-agenda-show-log))
-  ("L" (org-agenda-log-mode '(4)))
-  ("c" (org-agenda-log-mode 'clockcheck))
-  ("f" org-agenda-follow-mode (format "% -3S" org-agenda-follow-mode))
-  ("a" org-agenda-archives-mode)
-  ("A" (org-agenda-archives-mode 'files))
-  ("r" org-agenda-clockreport-mode (format "% -3S" org-agenda-clockreport-mode))
-  ("e" org-agenda-entry-text-mode (format "% -3S" org-agenda-entry-text-mode))
-  ("g" org-agenda-toggle-time-grid (format "% -3S" org-agenda-use-time-grid))
-  ("D" org-agenda-toggle-diary (format "% -3S" org-agenda-include-diary))
-  ("!" org-agenda-toggle-deadlines)
-  ("[" (let ((org-agenda-include-inactive-timestamps t))
-         (org-agenda-check-type t 'timeline 'agenda)
-         (org-agenda-redo)
-         (message "Display now includes inactive timestamps as well")))
-  ("q" (message "Abort") :exit t)
-  ("v" nil))
-
-;; Recommended binding:
-;; (define-key org-agenda-mode-map "v" 'hydra-org-agenda-view/body)
-
-;;* Helpers
-(require 'windmove)
-
-(defun hydra-move-splitter-left (arg)
-  "Move window splitter left."
-  (interactive "p")
-  (if (let ((windmove-wrap-around))
-        (windmove-find-other-window 'right))
-      (shrink-window-horizontally arg)
-    (enlarge-window-horizontally arg)))
-
-(defun hydra-move-splitter-right (arg)
-  "Move window splitter right."
-  (interactive "p")
-  (if (let ((windmove-wrap-around))
-        (windmove-find-other-window 'right))
-      (enlarge-window-horizontally arg)
-    (shrink-window-horizontally arg)))
-
-(defun hydra-move-splitter-up (arg)
-  "Move window splitter up."
-  (interactive "p")
-  (if (let ((windmove-wrap-around))
-        (windmove-find-other-window 'up))
-      (enlarge-window arg)
-    (shrink-window arg)))
-
-(defun hydra-move-splitter-down (arg)
-  "Move window splitter down."
-  (interactive "p")
-  (if (let ((windmove-wrap-around))
-        (windmove-find-other-window 'up))
-      (shrink-window arg)
-    (enlarge-window arg)))
-
-(defvar rectangle-mark-mode)
-(defun hydra-ex-point-mark ()
-  "Exchange point and mark."
-  (interactive)
-  (if rectangle-mark-mode
-      (rectangle-exchange-point-and-mark)
-    (let ((mk (mark)))
-      (rectangle-mark-mode 1)
-      (goto-char mk))))
-
-(provide 'hydra-examples)
-
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
-;;; hydra-examples.el ends here
.emacs.d/elpa/hydra-20170903.218/hydra-ox.el
@@ -1,127 +0,0 @@
-;;; hydra-ox.el --- Org mode export widget implemented in Hydra
-
-;; Copyright (C) 2015  Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This shows how a complex dispatch menu can be built with Hydra.
-
-;;; Code:
-
-(require 'hydra)
-(require 'org)
-(declare-function org-html-export-as-html 'ox-html)
-(declare-function org-html-export-to-html 'ox-html)
-(declare-function org-latex-export-as-latex 'ox-latex)
-(declare-function org-latex-export-to-latex 'ox-latex)
-(declare-function org-latex-export-to-pdf 'ox-latex)
-(declare-function org-ascii-export-as-ascii 'ox-ascii)
-(declare-function org-ascii-export-to-ascii 'ox-ascii)
-
-(defhydradio hydra-ox ()
-  (body-only "Export only the body.")
-  (export-scope "Export scope." [buffer subtree])
-  (async-export "When non-nil, export async.")
-  (visible-only "When non-nil, export visible only")
-  (force-publishing "Toggle force publishing"))
-
-(defhydra hydra-ox-html (:color blue)
-  "ox-html"
-  ("H" (org-html-export-as-html
-        hydra-ox/async-export
-        (eq hydra-ox/export-scope 'subtree)
-        hydra-ox/visible-only
-        hydra-ox/body-only)
-       "As HTML buffer")
-  ("h" (org-html-export-to-html
-        hydra-ox/async-export
-        (eq hydra-ox/export-scope 'subtree)
-        hydra-ox/visible-only
-        hydra-ox/body-only) "As HTML file")
-  ("o" (org-open-file
-        (org-html-export-to-html
-         hydra-ox/async-export
-         (eq hydra-ox/export-scope 'subtree)
-         hydra-ox/visible-only
-         hydra-ox/body-only)) "As HTML file and open")
-  ("b" hydra-ox/body "back")
-  ("q" nil "quit"))
-
-(defhydra hydra-ox-latex (:color blue)
-  "ox-latex"
-  ("L" org-latex-export-as-latex "As LaTeX buffer")
-  ("l" org-latex-export-to-latex "As LaTeX file")
-  ("p" org-latex-export-to-pdf "As PDF file")
-  ("o" (org-open-file (org-latex-export-to-pdf)) "As PDF file and open")
-  ("b" hydra-ox/body "back")
-  ("q" nil "quit"))
-
-(defhydra hydra-ox-text (:color blue)
-  "ox-text"
-  ("A" (org-ascii-export-as-ascii
-        nil nil nil nil
-        '(:ascii-charset ascii))
-       "As ASCII buffer")
-
-  ("a" (org-ascii-export-to-ascii
-        nil nil nil nil
-        '(:ascii-charset ascii))
-       "As ASCII file")
-  ("L" (org-ascii-export-as-ascii
-        nil nil nil nil
-        '(:ascii-charset latin1))
-       "As Latin1 buffer")
-  ("l" (org-ascii-export-to-ascii
-        nil nil nil nil
-        '(:ascii-charset latin1))
-       "As Latin1 file")
-  ("U" (org-ascii-export-as-ascii
-        nil nil nil nil
-        '(:ascii-charset utf-8))
-       "As UTF-8 buffer")
-  ("u" (org-ascii-export-to-ascii
-        nil nil nil nil
-        '(:ascii-charset utf-8))
-       "As UTF-8 file")
-  ("b" hydra-ox/body "back")
-  ("q" nil "quit"))
-
-(defhydra hydra-ox ()
-  "
-_C-b_ Body only:    % -15`hydra-ox/body-only^^^ _C-v_ Visible only:     %`hydra-ox/visible-only
-_C-s_ Export scope: % -15`hydra-ox/export-scope _C-f_ Force publishing: %`hydra-ox/force-publishing
-_C-a_ Async export: %`hydra-ox/async-export
-
-"
-  ("C-b" (hydra-ox/body-only) nil)
-  ("C-v" (hydra-ox/visible-only) nil)
-  ("C-s" (hydra-ox/export-scope) nil)
-  ("C-f" (hydra-ox/force-publishing) nil)
-  ("C-a" (hydra-ox/async-export) nil)
-  ("h" hydra-ox-html/body "Export to HTML" :exit t)
-  ("l" hydra-ox-latex/body "Export to LaTeX" :exit t)
-  ("t" hydra-ox-text/body "Export to Plain Text" :exit t)
-  ("q" nil "quit"))
-
-(define-key org-mode-map (kbd "C-c C-,") 'hydra-ox/body)
-
-(provide 'hydra-ox)
-
-;;; hydra-ox.el ends here
.emacs.d/elpa/hydra-20170903.218/hydra-ox.elc
Binary file
.emacs.d/elpa/hydra-20170903.218/hydra-pkg.el
@@ -1,7 +0,0 @@
-(define-package "hydra" "20170903.218" "Make bindings that stick around."
-  '((cl-lib "0.5"))
-  :url "https://github.com/abo-abo/hydra" :keywords
-  '("bindings"))
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/hydra-20170903.218/hydra.el
@@ -1,1404 +0,0 @@
-;;; hydra.el --- Make bindings that stick around. -*- lexical-binding: t -*-
-
-;; Copyright (C) 2015  Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-;; Maintainer: Oleh Krehel <ohwoeowho@gmail.com>
-;; URL: https://github.com/abo-abo/hydra
-;; Version: 0.14.0
-;; Keywords: bindings
-;; Package-Requires: ((cl-lib "0.5"))
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This package can be used to tie related commands into a family of
-;; short bindings with a common prefix - a Hydra.
-;;
-;; Once you summon the Hydra (through the prefixed binding), all the
-;; heads can be called in succession with only a short extension.
-;; The Hydra is vanquished once Hercules, any binding that isn't the
-;; Hydra's head, arrives.  Note that Hercules, besides vanquishing the
-;; Hydra, will still serve his orignal purpose, calling his proper
-;; command.  This makes the Hydra very seamless, it's like a minor
-;; mode that disables itself automagically.
-;;
-;; Here's an example Hydra, bound in the global map (you can use any
-;; keymap in place of `global-map'):
-;;
-;;     (defhydra hydra-zoom (global-map "<f2>")
-;;       "zoom"
-;;       ("g" text-scale-increase "in")
-;;       ("l" text-scale-decrease "out"))
-;;
-;; It allows to start a command chain either like this:
-;; "<f2> gg4ll5g", or "<f2> lgllg".
-;;
-;; Here's another approach, when you just want a "callable keymap":
-;;
-;;     (defhydra hydra-toggle (:color blue)
-;;       "toggle"
-;;       ("a" abbrev-mode "abbrev")
-;;       ("d" toggle-debug-on-error "debug")
-;;       ("f" auto-fill-mode "fill")
-;;       ("t" toggle-truncate-lines "truncate")
-;;       ("w" whitespace-mode "whitespace")
-;;       ("q" nil "cancel"))
-;;
-;; This binds nothing so far, but if you follow up with:
-;;
-;;     (global-set-key (kbd "C-c C-v") 'hydra-toggle/body)
-;;
-;; you will have bound "C-c C-v a", "C-c C-v d" etc.
-;;
-;; Knowing that `defhydra' defines e.g. `hydra-toggle/body' command,
-;; you can nest Hydras if you wish, with `hydra-toggle/body' possibly
-;; becoming a blue head of another Hydra.
-;;
-;; If you want to learn all intricacies of using `defhydra' without
-;; having to figure it all out from this source code, check out the
-;; wiki: https://github.com/abo-abo/hydra/wiki. There's a wealth of
-;; information there. Everyone is welcome to bring the existing pages
-;; up to date and add new ones.
-;;
-;; Additionally, the file hydra-examples.el serves to demo most of the
-;; functionality.
-
-;;; Code:
-;;* Requires
-(require 'cl-lib)
-(require 'lv)
-(require 'ring)
-
-(defvar hydra-curr-map nil
-  "The keymap of the current Hydra called.")
-
-(defvar hydra-curr-on-exit nil
-  "The on-exit predicate for the current Hydra.")
-
-(defvar hydra-curr-foreign-keys nil
-  "The current :foreign-keys behavior.")
-
-(defvar hydra-curr-body-fn nil
-  "The current hydra-.../body function.")
-
-(defvar hydra-deactivate nil
-  "If a Hydra head sets this to t, exit the Hydra.
-This will be done even if the head wasn't designated for exiting.")
-
-(defvar hydra-amaranth-warn-message "An amaranth Hydra can only exit through a blue head"
-  "Amaranth Warning message.  Shown when the user tries to press an unbound/non-exit key while in an amaranth head.")
-
-(defun hydra-set-transient-map (keymap on-exit &optional foreign-keys)
-  "Set KEYMAP to the highest priority.
-
-Call ON-EXIT when the KEYMAP is deactivated.
-
-FOREIGN-KEYS determines the deactivation behavior, when a command
-that isn't in KEYMAP is called:
-
-nil: deactivate KEYMAP and run the command.
-run: keep KEYMAP and run the command.
-warn: keep KEYMAP and issue a warning instead of running the command."
-  (if hydra-deactivate
-      (hydra-keyboard-quit)
-    (setq hydra-curr-map keymap)
-    (setq hydra-curr-on-exit on-exit)
-    (setq hydra-curr-foreign-keys foreign-keys)
-    (add-hook 'pre-command-hook 'hydra--clearfun)
-    (internal-push-keymap keymap 'overriding-terminal-local-map)))
-
-(defun hydra--clearfun ()
-  "Disable the current Hydra unless `this-command' is a head."
-  (unless (eq this-command 'hydra-pause-resume)
-    (when (or
-           (memq this-command '(handle-switch-frame
-                                keyboard-quit))
-           (null overriding-terminal-local-map)
-           (not (or (eq this-command
-                        (lookup-key hydra-curr-map (this-single-command-keys)))
-                    (cl-case hydra-curr-foreign-keys
-                      (warn
-                       (setq this-command 'hydra-amaranth-warn))
-                      (run
-                       t)
-                      (t nil)))))
-      (hydra-disable))))
-
-(defvar hydra--ignore nil
-  "When non-nil, don't call `hydra-curr-on-exit'.")
-
-(defvar hydra--input-method-function nil
-  "Store overridden `input-method-function' here.")
-
-(defun hydra-disable ()
-  "Disable the current Hydra."
-  (setq hydra-deactivate nil)
-  (remove-hook 'pre-command-hook 'hydra--clearfun)
-  (unless hydra--ignore
-    (if (fboundp 'remove-function)
-        (remove-function input-method-function #'hydra--imf)
-      (when hydra--input-method-function
-        (setq input-method-function hydra--input-method-function)
-        (setq hydra--input-method-function nil))))
-  (dolist (frame (frame-list))
-    (with-selected-frame frame
-      (when overriding-terminal-local-map
-        (internal-pop-keymap hydra-curr-map 'overriding-terminal-local-map))))
-  (unless hydra--ignore
-    (when hydra-curr-on-exit
-      (let ((on-exit hydra-curr-on-exit))
-        (setq hydra-curr-on-exit nil)
-        (funcall on-exit)))))
-
-(unless (fboundp 'internal-push-keymap)
-  (defun internal-push-keymap (keymap symbol)
-    (let ((map (symbol-value symbol)))
-      (unless (memq keymap map)
-        (unless (memq 'add-keymap-witness (symbol-value symbol))
-          (setq map (make-composed-keymap nil (symbol-value symbol)))
-          (push 'add-keymap-witness (cdr map))
-          (set symbol map))
-        (push keymap (cdr map))))))
-
-(unless (fboundp 'internal-pop-keymap)
-  (defun internal-pop-keymap (keymap symbol)
-    (let ((map (symbol-value symbol)))
-      (when (memq keymap map)
-        (setf (cdr map) (delq keymap (cdr map))))
-      (let ((tail (cddr map)))
-        (and (or (null tail) (keymapp tail))
-             (eq 'add-keymap-witness (nth 1 map))
-             (set symbol tail))))))
-
-(defun hydra-amaranth-warn ()
-  "Issue a warning that the current input was ignored."
-  (interactive)
-  (message hydra-amaranth-warn-message))
-
-;;* Customize
-(defgroup hydra nil
-  "Make bindings that stick around."
-  :group 'bindings
-  :prefix "hydra-")
-
-(defcustom hydra-is-helpful t
-  "When t, display a hint with possible bindings in the echo area."
-  :type 'boolean
-  :group 'hydra)
-
-(defcustom hydra-default-hint ""
-  "Default :hint property to use for heads when not specified in
-the body or the head."
-  :type 'sexp
-  :group 'hydra)
-
-(defcustom hydra-lv t
-  "When non-nil, `lv-message' (not `message') will be used to display hints."
-  :type 'boolean)
-
-(defcustom hydra-verbose nil
-  "When non-nil, hydra will issue some non essential style warnings."
-  :type 'boolean)
-
-(defcustom hydra-key-format-spec "%s"
-  "Default `format'-style specifier for _a_  syntax in docstrings.
-When nil, you can specify your own at each location like this: _ 5a_."
-  :type 'string)
-
-(defcustom hydra-doc-format-spec "%s"
-  "Default `format'-style specifier for ?a?  syntax in docstrings."
-  :type 'string)
-
-(defcustom hydra-look-for-remap nil
-  "When non-nil, hydra binding behaves as keymap binding with [remap].
-When calling a head with a simple command, hydra will lookup for a potential
-remap command according to the current active keymap and call it instead if
-found"
-  :type 'boolean)
-
-(make-obsolete-variable
- 'hydra-key-format-spec
- "Since the docstrings are aligned by hand anyway, this isn't very useful."
- "0.13.1")
-
-(defface hydra-face-red
-  '((t (:foreground "#FF0000" :bold t)))
-  "Red Hydra heads don't exit the Hydra.
-Every other command exits the Hydra."
-  :group 'hydra)
-
-(defface hydra-face-blue
-  '((((class color) (background light))
-     :foreground "#0000FF" :bold t)
-    (((class color) (background dark))
-     :foreground "#8ac6f2" :bold t))
-  "Blue Hydra heads exit the Hydra.
-Every other command exits as well.")
-
-(defface hydra-face-amaranth
-  '((t (:foreground "#E52B50" :bold t)))
-  "Amaranth body has red heads and warns on intercepting non-heads.
-Exitable only through a blue head.")
-
-(defface hydra-face-pink
-  '((t (:foreground "#FF6EB4" :bold t)))
-  "Pink body has red heads and runs intercepted non-heads.
-Exitable only through a blue head.")
-
-(defface hydra-face-teal
-  '((t (:foreground "#367588" :bold t)))
-  "Teal body has blue heads and warns on intercepting non-heads.
-Exitable only through a blue head.")
-
-;;* Fontification
-(defun hydra-add-font-lock ()
-  "Fontify `defhydra' statements."
-  (font-lock-add-keywords
-   'emacs-lisp-mode
-   '(("(\\(defhydra\\)\\_> +\\(.*?\\)\\_>"
-      (1 font-lock-keyword-face)
-      (2 font-lock-type-face))
-     ("(\\(defhydradio\\)\\_> +\\(.*?\\)\\_>"
-      (1 font-lock-keyword-face)
-      (2 font-lock-type-face)))))
-
-;;* Find Function
-(eval-after-load 'find-func
-  '(defadvice find-function-search-for-symbol
-    (around hydra-around-find-function-search-for-symbol-advice
-     (symbol type library) activate)
-    "Navigate to hydras with `find-function-search-for-symbol'."
-    ad-do-it
-    ;; The orignial function returns (cons (current-buffer) (point))
-    ;; if it found the point.
-    (unless (cdr ad-return-value)
-      (with-current-buffer (find-file-noselect library)
-        (let ((sn (symbol-name symbol)))
-          (when (and (null type)
-                     (string-match "\\`\\(hydra-[a-z-A-Z0-9]+\\)/\\(.*\\)\\'" sn)
-                     (re-search-forward (concat "(defhydra " (match-string 1 sn))
-                                        nil t))
-            (goto-char (match-beginning 0)))
-          (cons (current-buffer) (point)))))))
-
-;;* Universal Argument
-(defvar hydra-base-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [?\C-u] 'hydra--universal-argument)
-    (define-key map [?-] 'hydra--negative-argument)
-    (define-key map [?0] 'hydra--digit-argument)
-    (define-key map [?1] 'hydra--digit-argument)
-    (define-key map [?2] 'hydra--digit-argument)
-    (define-key map [?3] 'hydra--digit-argument)
-    (define-key map [?4] 'hydra--digit-argument)
-    (define-key map [?5] 'hydra--digit-argument)
-    (define-key map [?6] 'hydra--digit-argument)
-    (define-key map [?7] 'hydra--digit-argument)
-    (define-key map [?8] 'hydra--digit-argument)
-    (define-key map [?9] 'hydra--digit-argument)
-    (define-key map [kp-0] 'hydra--digit-argument)
-    (define-key map [kp-1] 'hydra--digit-argument)
-    (define-key map [kp-2] 'hydra--digit-argument)
-    (define-key map [kp-3] 'hydra--digit-argument)
-    (define-key map [kp-4] 'hydra--digit-argument)
-    (define-key map [kp-5] 'hydra--digit-argument)
-    (define-key map [kp-6] 'hydra--digit-argument)
-    (define-key map [kp-7] 'hydra--digit-argument)
-    (define-key map [kp-8] 'hydra--digit-argument)
-    (define-key map [kp-9] 'hydra--digit-argument)
-    (define-key map [kp-subtract] 'hydra--negative-argument)
-    map)
-  "Keymap that all Hydras inherit.  See `universal-argument-map'.")
-
-(defun hydra--universal-argument (arg)
-  "Forward to (`universal-argument' ARG)."
-  (interactive "P")
-  (setq prefix-arg (if (consp arg)
-                       (list (* 4 (car arg)))
-                     (if (eq arg '-)
-                         (list -4)
-                       '(4)))))
-
-(defun hydra--digit-argument (arg)
-  "Forward to (`digit-argument' ARG)."
-  (interactive "P")
-  (let* ((char (if (integerp last-command-event)
-                   last-command-event
-                 (get last-command-event 'ascii-character)))
-         (digit (- (logand char ?\177) ?0)))
-    (setq prefix-arg (cond ((integerp arg)
-                            (+ (* arg 10)
-                               (if (< arg 0)
-                                   (- digit)
-                                 digit)))
-                           ((eq arg '-)
-                            (if (zerop digit)
-                                '-
-                              (- digit)))
-                           (t
-                            digit)))))
-
-(defun hydra--negative-argument (arg)
-  "Forward to (`negative-argument' ARG)."
-  (interactive "P")
-  (setq prefix-arg (cond ((integerp arg) (- arg))
-                         ((eq arg '-) nil)
-                         (t '-))))
-
-;;* Repeat
-(defvar hydra-repeat--prefix-arg nil
-  "Prefix arg to use with `hydra-repeat'.")
-
-(defvar hydra-repeat--command nil
-  "Command to use with `hydra-repeat'.")
-
-(defun hydra-repeat (&optional arg)
-  "Repeat last command with last prefix arg.
-When ARG is non-nil, use that instead."
-  (interactive "p")
-  (if (eq arg 1)
-      (unless (string-match "hydra-repeat$" (symbol-name last-command))
-        (setq hydra-repeat--command last-command)
-        (setq hydra-repeat--prefix-arg last-prefix-arg))
-    (setq hydra-repeat--prefix-arg arg))
-  (setq current-prefix-arg hydra-repeat--prefix-arg)
-  (funcall hydra-repeat--command))
-
-;;* Misc internals
-(defun hydra--callablep (x)
-  "Test if X is callable."
-  (or (functionp x)
-      (and (consp x)
-           (memq (car x) '(function quote)))))
-
-(defun hydra--make-callable (x)
-  "Generate a callable symbol from X.
-If X is a function symbol or a lambda, return it.  Otherwise, it
-should be a single statement.  Wrap it in an interactive lambda."
-  (cond ((or (symbolp x) (functionp x))
-         x)
-        ((and (consp x) (eq (car x) 'function))
-         (cadr x))
-        (t
-         `(lambda ()
-            (interactive)
-            ,x))))
-
-(defun hydra-plist-get-default (plist prop default)
-  "Extract a value from a property list.
-PLIST is a property list, which is a list of the form
-\(PROP1 VALUE1 PROP2 VALUE2...).
-
-Return the value corresponding to PROP, or DEFAULT if PROP is not
-one of the properties on the list."
-  (if (memq prop plist)
-      (plist-get plist prop)
-    default))
-
-(defun hydra--head-property (h prop &optional default)
-  "Return for Hydra head H the value of property PROP.
-Return DEFAULT if PROP is not in H."
-  (hydra-plist-get-default (cl-cdddr h) prop default))
-
-(defun hydra--head-set-property (h prop value)
-  "In hydra Head H, set a property PROP to the value VALUE."
-  (cons (car h) (plist-put (cdr h) prop value)))
-
-(defun hydra--head-has-property (h prop)
-  "Return non nil if heads H has the property PROP."
-  (plist-member (cdr h) prop))
-
-(defun hydra--body-foreign-keys (body)
-  "Return what BODY does with a non-head binding."
-  (or
-   (plist-get (cddr body) :foreign-keys)
-   (let ((color (plist-get (cddr body) :color)))
-     (cl-case color
-       ((amaranth teal) 'warn)
-       (pink 'run)))))
-
-(defun hydra--body-exit (body)
-  "Return the exit behavior of BODY."
-  (or
-   (plist-get (cddr body) :exit)
-   (let ((color (plist-get (cddr body) :color)))
-     (cl-case color
-       ((blue teal) t)
-       (t nil)))))
-
-(defalias 'hydra--imf #'list)
-
-(defun hydra-default-pre ()
-  "Default setup that happens in each head before :pre."
-  (when (eq input-method-function 'key-chord-input-method)
-    (if (fboundp 'add-function)
-        (add-function :override input-method-function #'hydra--imf)
-      (unless hydra--input-method-function
-        (setq hydra--input-method-function input-method-function)
-        (setq input-method-function nil)))))
-
-(defvar hydra-timeout-timer (timer-create)
-  "Timer for `hydra-timeout'.")
-
-(defvar hydra-message-timer (timer-create)
-  "Timer for the hint.")
-
-(defvar hydra--work-around-dedicated t
-  "When non-nil, assume there's no bug in `pop-to-buffer'.
-`pop-to-buffer' should not select a dedicated window.")
-
-(defun hydra-keyboard-quit ()
-  "Quitting function similar to `keyboard-quit'."
-  (interactive)
-  (hydra-disable)
-  (cancel-timer hydra-timeout-timer)
-  (cancel-timer hydra-message-timer)
-  (setq hydra-curr-map nil)
-  (unless (and hydra--ignore
-               (null hydra--work-around-dedicated))
-    (if hydra-lv
-        (lv-delete-window)
-      (message "")))
-  nil)
-
-(defvar hydra-head-format "[%s]: "
-  "The formatter for each head of a plain docstring.")
-
-(defvar hydra-key-doc-function 'hydra-key-doc-function-default
-  "The function for formatting key-doc pairs.")
-
-(defun hydra-key-doc-function-default (key key-width doc doc-width)
-  "Doc"
-  (cond
-   ((equal key " ") (format (format "%%-%ds" (+ 3 key-width doc-width)) doc))
-   (t (format (format "%%%ds: %%%ds" key-width (- -1 doc-width)) key doc))))
-
-(defun hydra--to-string (x)
-  (if (stringp x)
-      x
-    (eval x)))
-
-(defun hydra--hint-heads-wocol (body heads)
-  "Generate a hint for the echo area.
-BODY, and HEADS are parameters to `defhydra'.
-Works for heads without a property :column."
-  (let (alist)
-    (dolist (h heads)
-      (let ((val (assoc (cadr h) alist))
-            (pstr (hydra-fontify-head h body)))
-        (unless (not (stringp (cl-caddr h)))
-          (if val
-              (setf (cadr val)
-                    (concat (cadr val) " " pstr))
-            (push
-             (cons (cadr h)
-                   (cons pstr (cl-caddr h)))
-             alist)))))
-    (let ((keys (nreverse (mapcar #'cdr alist)))
-          (n-cols (plist-get (cddr body) :columns))
-          res)
-      (setq res
-            (if n-cols
-                (let ((n-rows (1+ (/ (length keys) n-cols)))
-                      (max-key-len (apply #'max (mapcar (lambda (x) (length (car x))) keys)))
-                      (max-doc-len (apply #'max (mapcar (lambda (x)
-                                                          (length (hydra--to-string (cdr x)))) keys))))
-                  `(concat
-                    "\n"
-                    (mapconcat #'identity
-                               (mapcar
-                                (lambda (x)
-                                  (mapconcat
-                                   (lambda (y)
-                                     (and y
-                                          (funcall hydra-key-doc-function
-                                                   (car y)
-                                                   ,max-key-len
-                                                   (hydra--to-string (cdr y))
-                                                   ,max-doc-len))) x ""))
-                                ',(hydra--matrix keys n-cols n-rows))
-                               "\n")))
-
-
-              `(concat
-                (mapconcat
-                 (lambda (x)
-                   (let ((str (hydra--to-string (cdr x))))
-                     (format
-                      (if (> (length str) 0)
-                          (concat hydra-head-format str)
-                        "%s")
-                      (car x))))
-                 ',keys
-                 ", ")
-                ,(if keys "." ""))))
-      (if (cl-every #'stringp
-                    (mapcar 'cddr alist))
-          (eval res)
-        res))))
-
-(defun hydra--hint (body heads)
-  "Generate a hint for the echo area.
-BODY, and HEADS are parameters to `defhydra'."
-  (let* ((sorted-heads (hydra--sort-heads (hydra--normalize-heads heads)))
-         (heads-w-col (cl-remove-if-not (lambda (heads) (hydra--head-property (nth 0 heads) :column)) sorted-heads))
-         (heads-wo-col (cl-remove-if (lambda (heads) (hydra--head-property (nth 0 heads) :column)) sorted-heads)))
-    (concat (when heads-w-col
-              (concat "\n" (hydra--hint-from-matrix body (hydra--generate-matrix heads-w-col))))
-            (when heads-wo-col
-              (hydra--hint-heads-wocol body (car heads-wo-col))))))
-
-(defvar hydra-fontify-head-function nil
-  "Possible replacement for `hydra-fontify-head-default'.")
-
-(defun hydra-fontify-head-default (head body)
-  "Produce a pretty string from HEAD and BODY.
-HEAD's binding is returned as a string with a colored face."
-  (let* ((foreign-keys (hydra--body-foreign-keys body))
-         (head-exit (hydra--head-property head :exit))
-         (head-color
-          (if head-exit
-              (if (eq foreign-keys 'warn)
-                  'teal
-                'blue)
-            (cl-case foreign-keys
-              (warn 'amaranth)
-              (run 'pink)
-              (t 'red)))))
-    (when (and (null (cadr head))
-               (not head-exit))
-      (hydra--complain "nil cmd can only be blue"))
-    (propertize
-     (replace-regexp-in-string "%" "%%" (car head))
-     'face
-     (or (hydra--head-property head :face)
-         (cl-case head-color
-           (blue 'hydra-face-blue)
-           (red 'hydra-face-red)
-           (amaranth 'hydra-face-amaranth)
-           (pink 'hydra-face-pink)
-           (teal 'hydra-face-teal)
-           (t (error "Unknown color for %S" head)))))))
-
-(defun hydra-fontify-head-greyscale (head _body)
-  "Produce a pretty string from HEAD and BODY.
-HEAD's binding is returned as a string wrapped with [] or {}."
-  (format
-   (if (hydra--head-property head :exit)
-       "[%s]"
-     "{%s}") (car head)))
-
-(defun hydra-fontify-head (head body)
-  "Produce a pretty string from HEAD and BODY."
-  (funcall (or hydra-fontify-head-function 'hydra-fontify-head-default)
-           head body))
-
-(defun hydra--strip-align-markers (str)
-  "Remove ^ from STR, unless they're escaped: \\^."
-  (let ((start 0))
-    (while (setq start (string-match "\\\\?\\^" str start))
-      (if (eq (- (match-end 0) (match-beginning 0)) 2)
-          (progn
-            (setq str (replace-match "^" nil nil str))
-            (cl-incf start))
-        (setq str (replace-match "" nil nil str))))
-    str))
-
-(defvar hydra-docstring-keys-translate-alist
-  '(("↑" . "<up>")
-    ("↓" . "<down>")
-    ("→" . "<right>")
-    ("←" . "<left>")
-    ("⌫" . "DEL")
-    ("⌦" . "<deletechar>")
-    ("⏎" . "RET")))
-
-(defconst hydra-width-spec-regex " ?-?[0-9]*?"
-  "Regex for the width spec in keys and %` quoted sexps.")
-
-(defvar hydra-key-regex "\\[\\|]\\|[-[:alnum:] ~.,;:/|?<>={}*+#%@!&^↑↓←→⌫⌦⏎'`()\"$]+?"
-  "Regex for the key quoted in the docstring.")
-
-(defun hydra--format (_name body docstring heads)
-  "Generate a `format' statement from STR.
-\"%`...\" expressions are extracted into \"%S\".
-_NAME, BODY, DOCSTRING and HEADS are parameters of `defhydra'.
-The expressions can be auto-expanded according to NAME."
-  (unless (memq 'elisp--witness--lisp (mapcar #'cadr heads))
-    (setq docstring (hydra--strip-align-markers docstring))
-    (setq docstring (replace-regexp-in-string "___" "_β_" docstring))
-    (let ((rest (if (eq (plist-get (cddr body) :hint) 'none)
-                    ""
-                  (hydra--hint body heads)))
-          (start 0)
-          varlist
-          offset)
-      (while (setq start
-                   (string-match
-                    (format
-                     "\\(?:%%\\( ?-?[0-9]*s?\\)\\(`[a-z-A-Z/0-9]+\\|(\\)\\)\\|\\(?:[_?]\\(%s\\)\\(%s\\)[_?]\\)"
-                     hydra-width-spec-regex
-                     hydra-key-regex)
-                    docstring start))
-        (cond ((eq ?? (aref (match-string 0 docstring) 0))
-               (let* ((key (match-string 4 docstring))
-                      (head (assoc key heads)))
-                 (if head
-                     (progn
-                       (push (nth 2 head) varlist)
-                       (setq docstring
-                             (replace-match
-                              (or
-                               hydra-doc-format-spec
-                               (concat "%" (match-string 3 docstring) "s"))
-                              t nil docstring)))
-                   (setq start (match-end 0))
-                   (warn "Unrecognized key: ?%s?" key))))
-              ((eq ?_ (aref (match-string 0 docstring) 0))
-               (let* ((key (match-string 4 docstring))
-                      (key (if (equal key "β") "_" key))
-                      normal-key
-                      (head (or (assoc key heads)
-                                (when (setq normal-key
-                                            (cdr (assoc
-                                                  key hydra-docstring-keys-translate-alist)))
-                                  (assoc normal-key heads)))))
-                 (if head
-                     (progn
-                       (push (hydra-fontify-head (if normal-key
-                                                     (cons key (cdr head))
-                                                   head)
-                                                 body)
-                             varlist)
-                       (let ((replacement
-                              (or
-                               hydra-key-format-spec
-                               (concat "%" (match-string 3 docstring) "s"))))
-                         (setq docstring
-                               (replace-match replacement t nil docstring))
-                         (setq start (+ start (length replacement)))))
-                   (setq start (match-end 0))
-                   (warn "Unrecognized key: _%s_" key))))
-
-              (t
-               (let* ((varp (if (eq ?` (aref (match-string 2 docstring) 0)) 1 0))
-                      (spec (match-string 1 docstring))
-                      (lspec (length spec)))
-                 (setq offset
-                       (with-temp-buffer
-                         (insert (substring docstring (+ 1 start varp
-                                                         (length spec))))
-                         (goto-char (point-min))
-                         (push (read (current-buffer)) varlist)
-                         (- (point) (point-min))))
-                 (when (or (zerop lspec)
-                           (/= (aref spec (1- (length spec))) ?s))
-                   (setq spec (concat spec "S")))
-                 (setq docstring
-                       (concat
-                        (substring docstring 0 start)
-                        "%" spec
-                        (substring docstring (+ start offset 1 lspec varp))))))))
-      (if (eq ?\n (aref docstring 0))
-          `(concat (format ,(substring docstring 1) ,@(nreverse varlist))
-                   ,rest)
-        (let ((r `(replace-regexp-in-string
-                   " +$" ""
-                   (concat ,docstring ": "
-                           (replace-regexp-in-string
-                            "\\(%\\)" "\\1\\1" ,rest)))))
-          (if (stringp rest)
-              `(format ,(eval r))
-            `(format ,r)))))))
-
-(defun hydra--complain (format-string &rest args)
-  "Forward to (`message' FORMAT-STRING ARGS) unless `hydra-verbose' is nil."
-  (if hydra-verbose
-      (apply #'error format-string args)
-    (apply #'message format-string args)))
-
-(defun hydra--doc (body-key body-name heads)
-  "Generate a part of Hydra docstring.
-BODY-KEY is the body key binding.
-BODY-NAME is the symbol that identifies the Hydra.
-HEADS is a list of heads."
-  (format
-   "Create a hydra with %s body and the heads:\n\n%s\n\n%s"
-   (if body-key
-       (format "a \"%s\"" body-key)
-     "no")
-   (mapconcat
-    (lambda (x)
-      (format "\"%s\":    `%S'" (car x) (cadr x)))
-    heads ",\n")
-   (format "The body can be accessed via `%S'." body-name)))
-
-(defun hydra--call-interactively-remap-maybe (cmd)
-  "`call-interactively' the given CMD or its remapped equivalent.
-Only when `hydra-look-for-remap' is non nil."
-  (let ((remapped-cmd (if hydra-look-for-remap
-                          (command-remapping `,cmd)
-                        nil)))
-    (if remapped-cmd
-        (call-interactively `,remapped-cmd)
-      (call-interactively `,cmd))))
-
-(defun hydra--call-interactively (cmd name)
-  "Generate a `call-interactively' statement for CMD.
-Set `this-command' to NAME."
-  (if (and (symbolp name)
-           (not (memq name '(nil body))))
-      `(progn
-         (setq this-command ',name)
-         (hydra--call-interactively-remap-maybe #',cmd))
-    `(hydra--call-interactively-remap-maybe #',cmd)))
-
-(defun hydra--make-defun (name body doc head
-                          keymap body-pre body-before-exit
-                          &optional body-after-exit)
-  "Make a defun wrapper, using NAME, BODY, DOC, HEAD, and KEYMAP.
-NAME and BODY are the arguments to `defhydra'.
-DOC was generated with `hydra--doc'.
-HEAD is one of the HEADS passed to `defhydra'.
-BODY-PRE is added to the start of the wrapper.
-BODY-BEFORE-EXIT will be called before the hydra quits.
-BODY-AFTER-EXIT is added to the end of the wrapper."
-  (let ((cmd-name (hydra--head-name head name))
-        (cmd (when (car head)
-               (hydra--make-callable
-                (cadr head))))
-        (doc (if (car head)
-                 (format "%s\n\nCall the head: `%S'." doc (cadr head))
-               doc))
-        (hint (intern (format "%S/hint" name)))
-        (body-foreign-keys (hydra--body-foreign-keys body))
-        (body-timeout (plist-get body :timeout))
-        (body-idle (plist-get body :idle)))
-    `(defun ,cmd-name ()
-       ,doc
-       (interactive)
-       (hydra-default-pre)
-       ,@(when body-pre (list body-pre))
-       ,@(if (hydra--head-property head :exit)
-             `((hydra-keyboard-quit)
-               (setq hydra-curr-body-fn ',(intern (format "%S/body" name)))
-               ,@(if body-after-exit
-                     `((unwind-protect
-                            ,(when cmd
-                               (hydra--call-interactively cmd (cadr head)))
-                         ,body-after-exit))
-                   (when cmd
-                     `(,(hydra--call-interactively cmd (cadr head))))))
-           (delq
-            nil
-            `((let ((hydra--ignore ,(not (eq (cadr head) 'body))))
-                (hydra-keyboard-quit)
-                (setq hydra-curr-body-fn ',(intern (format "%S/body" name))))
-              ,(when cmd
-                 `(condition-case err
-                      ,(hydra--call-interactively cmd (cadr head))
-                    ((quit error)
-                     (message (error-message-string err))
-                     (unless hydra-lv
-                       (sit-for 0.8)))))
-              ,(if (and body-idle (eq (cadr head) 'body))
-                   `(hydra-idle-message ,body-idle ,hint ',name)
-                 `(hydra-show-hint ,hint ',name))
-              (hydra-set-transient-map
-               ,keymap
-               (lambda () (hydra-keyboard-quit) ,body-before-exit)
-               ,(when body-foreign-keys
-                  (list 'quote body-foreign-keys)))
-              ,body-after-exit
-              ,(when body-timeout
-                 `(hydra-timeout ,body-timeout))))))))
-
-(defvar hydra-props-alist nil)
-
-(defun hydra-set-property (name key val)
-  "Set hydra property.
-NAME is the symbolic name of the hydra.
-KEY and VAL are forwarded to `plist-put'."
-  (let ((entry (assoc name hydra-props-alist))
-        plist)
-    (when (null entry)
-      (add-to-list 'hydra-props-alist (list name))
-      (setq entry (assoc name hydra-props-alist)))
-    (setq plist (cdr entry))
-    (setcdr entry (plist-put plist key val))))
-
-(defun hydra-get-property (name key)
-  "Get hydra property.
-NAME is the symbolic name of the hydra.
-KEY is forwarded to `plist-get'."
-  (let ((entry (assoc name hydra-props-alist)))
-    (when entry
-      (plist-get (cdr entry) key))))
-
-(defun hydra-show-hint (hint caller)
-  (let ((verbosity (plist-get (cdr (assoc caller hydra-props-alist))
-                              :verbosity)))
-    (cond ((eq verbosity 0))
-          ((eq verbosity 1)
-           (message (eval hint)))
-          (t
-           (when hydra-is-helpful
-             (if hydra-lv
-                 (lv-message (eval hint))
-               (message (eval hint))))))))
-
-(defmacro hydra--make-funcall (sym)
-  "Transform SYM into a `funcall' to call it."
-  `(when (and ,sym (symbolp ,sym))
-     (setq ,sym `(funcall #',,sym))))
-
-(defun hydra--head-name (h name)
-  "Return the symbol for head H of hydra with NAME."
-  (let ((str (format "%S/%s" name
-                     (cond ((symbolp (cadr h))
-                            (cadr h))
-                           ((and (consp (cadr h))
-                                 (eq (cl-caadr h) 'function))
-                            (cadr (cadr h)))
-                           (t
-                            (concat "lambda-" (car h)))))))
-    (when (and (hydra--head-property h :exit)
-               (not (memq (cadr h) '(body nil))))
-      (setq str (concat str "-and-exit")))
-    (intern str)))
-
-(defun hydra--delete-duplicates (heads)
-  "Return HEADS without entries that have the same CMD part.
-In duplicate HEADS, :cmd-name is modified to whatever they duplicate."
-  (let ((ali '(((hydra-repeat . nil) . hydra-repeat)))
-        res entry)
-    (dolist (h heads)
-      (if (setq entry (assoc (cons (cadr h)
-                                   (hydra--head-property h :exit))
-                             ali))
-          (setf (cl-cdddr h) (plist-put (cl-cdddr h) :cmd-name (cdr entry)))
-        (push (cons (cons (cadr h)
-                          (hydra--head-property h :exit))
-                    (plist-get (cl-cdddr h) :cmd-name))
-              ali)
-        (push h res)))
-    (nreverse res)))
-
-(defun hydra--pad (lst n)
-  "Pad LST with nil until length N."
-  (let ((len (length lst)))
-    (if (= len n)
-        lst
-      (append lst (make-list (- n len) nil)))))
-
-(defmacro hydra-multipop (lst n)
-  "Return LST's first N elements while removing them."
-  `(if (<= (length ,lst) ,n)
-       (prog1 ,lst
-         (setq ,lst nil))
-     (prog1 ,lst
-       (setcdr
-        (nthcdr (1- ,n) (prog1 ,lst (setq ,lst (nthcdr ,n ,lst))))
-        nil))))
-
-(defun hydra--matrix (lst rows cols)
-  "Create a matrix from elements of LST.
-The matrix size is ROWS times COLS."
-  (let ((ls (copy-sequence lst))
-        res)
-    (dotimes (_c cols)
-      (push (hydra--pad (hydra-multipop ls rows) rows) res))
-    (nreverse res)))
-
-(defun hydra--cell (fstr names)
-  "Format a rectangular cell based on FSTR and NAMES.
-FSTR is a format-style string with two string inputs: one for the
-doc and one for the symbol name.
-NAMES is a list of variables."
-  (let ((len (cl-reduce
-              (lambda (acc it) (max (length (symbol-name it)) acc))
-              names
-              :initial-value 0)))
-    (mapconcat
-     (lambda (sym)
-       (if sym
-           (format fstr
-                   (documentation-property sym 'variable-documentation)
-                   (let ((name (symbol-name sym)))
-                     (concat name (make-string (- len (length name)) ?^)))
-                   sym)
-         ""))
-     names
-     "\n")))
-
-(defun hydra--vconcat (strs &optional joiner)
-  "Glue STRS vertically.  They must be the same height.
-JOINER is a function similar to `concat'."
-  (setq joiner (or joiner #'concat))
-  (mapconcat
-   (lambda (s)
-     (if (string-match " +$" s)
-         (replace-match "" nil nil s)
-       s))
-   (apply #'cl-mapcar joiner
-          (mapcar
-           (lambda (s) (split-string s "\n"))
-           strs))
-   "\n"))
-
-(defvar hydra-cell-format "% -20s %% -8`%s"
-  "The default format for docstring cells.")
-
-(defun hydra--table (names rows cols &optional cell-formats)
-  "Format a `format'-style table from variables in NAMES.
-The size of the table is ROWS times COLS.
-CELL-FORMATS are `format' strings for each column.
-If CELL-FORMATS is a string, it's used for all columns.
-If CELL-FORMATS is nil, `hydra-cell-format' is used for all columns."
-  (setq cell-formats
-        (cond ((null cell-formats)
-               (make-list cols hydra-cell-format))
-              ((stringp cell-formats)
-               (make-list cols cell-formats))
-              (t
-               cell-formats)))
-  (hydra--vconcat
-   (cl-mapcar
-    #'hydra--cell
-    cell-formats
-    (hydra--matrix names rows cols))
-   (lambda (&rest x)
-     (mapconcat #'identity x "    "))))
-
-(defun hydra-reset-radios (names)
-  "Set varibles NAMES to their defaults.
-NAMES should be defined by `defhydradio' or similar."
-  (dolist (n names)
-    (set n (aref (get n 'range) 0))))
-
-;; Following functions deal with automatic docstring table generation from :column head property
-(defun hydra--normalize-heads (heads)
-  "Ensure each head from HEADS have a property :column.
-Set it to the same value as preceding head or nil if no previous value
-was defined."
-  (let ((current-col nil))
-    (mapcar (lambda (head)
-              (if (hydra--head-has-property head :column)
-                  (setq current-col (hydra--head-property head :column)))
-              (hydra--head-set-property head :column current-col))
-            heads)))
-
-(defun hydra--sort-heads (normalized-heads)
-  "Return a list of heads with non-nil doc grouped by column property.
-Each head of NORMALIZED-HEADS must have a column property."
-  (let* ((heads-wo-nil-doc (cl-remove-if-not (lambda (head) (nth 2 head)) normalized-heads))
-         (columns-list (delete-dups (mapcar (lambda (head) (hydra--head-property head :column))
-                                            normalized-heads)))
-         (get-col-index-fun (lambda (head) (cl-position (hydra--head-property head :column)
-                                                        columns-list
-                                                        :test 'equal)))
-         (heads-sorted (cl-sort heads-wo-nil-doc (lambda (it other)
-                                                   (< (funcall get-col-index-fun it)
-                                                      (funcall get-col-index-fun other))))))
-    ;; this operation partition the sorted head list into lists of heads with same column property
-    (cl-loop for head in heads-sorted
-       for column-name = (hydra--head-property head :column)
-       with prev-column-name = (hydra--head-property (nth 0 heads-sorted) :column)
-       unless (equal prev-column-name column-name) collect heads-one-column into heads-all-columns
-       and do (setq heads-one-column nil)
-       collect head into heads-one-column
-       do (setq prev-column-name column-name)
-       finally return (append heads-all-columns (list heads-one-column)))))
-
-(defun hydra--pad-heads (heads-groups padding-head)
-  "Return a copy of HEADS-GROUPS padded where applicable with PADDING-HEAD."
-  (cl-loop for heads-group in heads-groups
-     for this-head-group-length = (length heads-group)
-     with head-group-max-length = (apply #'max (mapcar (lambda (heads) (length heads)) heads-groups))
-     if (<= this-head-group-length head-group-max-length)
-     collect (append heads-group (make-list (- head-group-max-length this-head-group-length) padding-head))
-     into balanced-heads-groups
-     else collect heads-group into balanced-heads-groups
-     finally return balanced-heads-groups))
-
-(defun hydra--generate-matrix (heads-groups)
-  "Return a copy of HEADS-GROUPS decorated with table formating information.
-Details of modification:
-2 virtual heads acting as table header were added to each heads-group.
-Each head is decorated with 2 new properties max-doc-len and max-key-len
-representing the maximum dimension of their owning group.
- Every heads-group have equal length by adding padding heads where applicable."
-  (when heads-groups
-    (cl-loop for heads-group in (hydra--pad-heads heads-groups '(" " nil " " :exit t))
-             for column-name = (hydra--head-property (nth 0 heads-group) :column)
-             for max-key-len = (apply #'max (mapcar (lambda (x) (length (car x))) heads-group))
-             for max-doc-len = (apply #'max
-                                      (length column-name)
-                                      (mapcar (lambda (x) (length (hydra--to-string (nth 2 x)))) heads-group))
-             for header-virtual-head = `(" " nil ,column-name :column ,column-name :exit t)
-             for separator-virtual-head = `(" " nil ,(make-string (+ 2 max-doc-len max-key-len) ?-) :column ,column-name :exit t)
-             for decorated-heads = (copy-tree (apply 'list header-virtual-head separator-virtual-head heads-group))
-             collect (mapcar (lambda (it)
-                               (hydra--head-set-property it :max-key-len max-key-len)
-                               (hydra--head-set-property it :max-doc-len max-doc-len))
-                             decorated-heads)
-             into decorated-heads-matrix
-             finally return decorated-heads-matrix)))
-
-(defun hydra--hint-from-matrix (body heads-matrix)
-  "Generate a formated table-style docstring according to BODY and HEADS-MATRIX.
-HEADS-MATRIX is expected to be a list of heads with following features:
-Each heads must have the same length
-Each head must have a property max-key-len and max-doc-len."
-  (when heads-matrix
-    (cl-loop with first-heads-col = (nth 0 heads-matrix)
-             with last-row-index = (- (length first-heads-col) 1)
-             for row-index from 0 to last-row-index
-             for heads-in-row = (mapcar (lambda (heads) (nth row-index heads)) heads-matrix)
-             concat (concat
-                     (replace-regexp-in-string "\s+$" ""
-                                               (mapconcat (lambda (head)
-                                                            (funcall hydra-key-doc-function
-                                                                     (hydra-fontify-head head body) ;; key
-                                                                     (hydra--head-property head :max-key-len)
-                                                                     (nth 2 head) ;; doc
-                                                                     (hydra--head-property head :max-doc-len)))
-                                                          heads-in-row "| ")) "\n")
-             into matrix-image
-             finally return matrix-image)))
-;; previous functions dealt with automatic docstring table generation from :column head property
-
-(defun hydra-idle-message (secs hint name)
-  "In SECS seconds display HINT."
-  (cancel-timer hydra-message-timer)
-  (setq hydra-message-timer (timer-create))
-  (timer-set-time hydra-message-timer
-                  (timer-relative-time (current-time) secs))
-  (timer-set-function
-   hydra-message-timer
-   (lambda ()
-     (hydra-show-hint hint name)
-     (cancel-timer hydra-message-timer)))
-  (timer-activate hydra-message-timer))
-
-(defun hydra-timeout (secs &optional function)
-  "In SECS seconds call FUNCTION, then function `hydra-keyboard-quit'.
-Cancel the previous `hydra-timeout'."
-  (cancel-timer hydra-timeout-timer)
-  (setq hydra-timeout-timer (timer-create))
-  (timer-set-time hydra-timeout-timer
-                  (timer-relative-time (current-time) secs))
-  (timer-set-function
-   hydra-timeout-timer
-   `(lambda ()
-      ,(when function
-         `(funcall ,function))
-      (hydra-keyboard-quit)))
-  (timer-activate hydra-timeout-timer))
-
-;;* Macros
-;;;###autoload
-(defmacro defhydra (name body &optional docstring &rest heads)
-  "Create a Hydra - a family of functions with prefix NAME.
-
-NAME should be a symbol, it will be the prefix of all functions
-defined here.
-
-BODY has the format:
-
-    (BODY-MAP BODY-KEY &rest BODY-PLIST)
-
-DOCSTRING will be displayed in the echo area to identify the
-Hydra.  When DOCSTRING starts with a newline, special Ruby-style
-substitution will be performed by `hydra--format'.
-
-Functions are created on basis of HEADS, each of which has the
-format:
-
-    (KEY CMD &optional HINT &rest PLIST)
-
-BODY-MAP is a keymap; `global-map' is used quite often.  Each
-function generated from HEADS will be bound in BODY-MAP to
-BODY-KEY + KEY (both are strings passed to `kbd'), and will set
-the transient map so that all following heads can be called
-though KEY only.  BODY-KEY can be an empty string.
-
-CMD is a callable expression: either an interactive function
-name, or an interactive lambda, or a single sexp (it will be
-wrapped in an interactive lambda).
-
-HINT is a short string that identifies its head.  It will be
-printed beside KEY in the echo erea if `hydra-is-helpful' is not
-nil.  If you don't even want the KEY to be printed, set HINT
-explicitly to nil.
-
-The heads inherit their PLIST from BODY-PLIST and are allowed to
-override some keys.  The keys recognized are :exit and :bind.
-:exit can be:
-
-- nil (default): this head will continue the Hydra state.
-- t: this head will stop the Hydra state.
-
-:bind can be:
-- nil: this head will not be bound in BODY-MAP.
-- a lambda taking KEY and CMD used to bind a head.
-
-It is possible to omit both BODY-MAP and BODY-KEY if you don't
-want to bind anything.  In that case, typically you will bind the
-generated NAME/body command.  This command is also the return
-result of `defhydra'."
-  (declare (indent defun) (doc-string 3))
-  (setq heads (copy-tree heads))
-  (cond ((stringp docstring))
-        ((and (consp docstring)
-              (memq (car docstring) '(hydra--table concat format)))
-         (setq docstring (concat "\n" (eval docstring))))
-        (t
-         (setq heads (cons docstring heads))
-         (setq docstring "hydra")))
-  (when (keywordp (car body))
-    (setq body (cons nil (cons nil body))))
-  (condition-case-unless-debug err
-      (let* ((keymap (copy-keymap hydra-base-map))
-             (keymap-name (intern (format "%S/keymap" name)))
-             (body-name (intern (format "%S/body" name)))
-             (body-key (cadr body))
-             (body-plist (cddr body))
-             (body-map (or (car body)
-                           (plist-get body-plist :bind)))
-             (body-pre (plist-get body-plist :pre))
-             (body-body-pre (plist-get body-plist :body-pre))
-             (body-before-exit (or (plist-get body-plist :post)
-                                   (plist-get body-plist :before-exit)))
-             (body-after-exit (plist-get body-plist :after-exit))
-             (body-inherit (plist-get body-plist :inherit))
-             (body-foreign-keys (hydra--body-foreign-keys body))
-             (body-exit (hydra--body-exit body)))
-        (dolist (base body-inherit)
-          (setq heads (append heads (copy-sequence (eval base)))))
-        (dolist (h heads)
-          (let ((len (length h)))
-            (cond ((< len 2)
-                   (error "Each head should have at least two items: %S" h))
-                  ((= len 2)
-                   (setcdr (cdr h)
-                           (list
-                            (hydra-plist-get-default
-                             body-plist :hint hydra-default-hint)))
-                   (setcdr (nthcdr 2 h) (list :exit body-exit)))
-                  (t
-                   (let ((hint (cl-caddr h)))
-                     (unless (or (null hint)
-                                 (stringp hint)
-                                 (consp hint))
-                       (let ((inherited-hint
-                              (hydra-plist-get-default
-                               body-plist :hint hydra-default-hint)))
-                         (setcdr (cdr h) (cons
-                                          (if (eq 'none inherited-hint)
-                                              nil
-                                            inherited-hint)
-                                          (cddr h))))))
-                   (let ((hint-and-plist (cddr h)))
-                     (if (null (cdr hint-and-plist))
-                         (setcdr hint-and-plist (list :exit body-exit))
-                       (let* ((plist (cl-cdddr h))
-                              (h-color (plist-get plist :color)))
-                         (if h-color
-                             (progn
-                               (plist-put plist :exit
-                                          (cl-case h-color
-                                            ((blue teal) t)
-                                            (t nil)))
-                               (cl-remf (cl-cdddr h) :color))
-                           (let ((h-exit (hydra-plist-get-default plist :exit 'default)))
-                             (plist-put plist :exit
-                                        (if (eq h-exit 'default)
-                                            body-exit
-                                          h-exit))))))))))
-          (plist-put (cl-cdddr h) :cmd-name (hydra--head-name h name))
-          (when (null (cadr h)) (plist-put (cl-cdddr h) :exit t)))
-        (let ((doc (hydra--doc body-key body-name heads))
-              (heads-nodup (hydra--delete-duplicates heads)))
-          (mapc
-           (lambda (x)
-             (define-key keymap (kbd (car x))
-               (plist-get (cl-cdddr x) :cmd-name)))
-           heads)
-          (hydra--make-funcall body-pre)
-          (hydra--make-funcall body-body-pre)
-          (hydra--make-funcall body-before-exit)
-          (hydra--make-funcall body-after-exit)
-          (when (memq body-foreign-keys '(run warn))
-            (unless (cl-some
-                     (lambda (h)
-                       (hydra--head-property h :exit))
-                     heads)
-              (error
-               "An %S Hydra must have at least one blue head in order to exit"
-               body-foreign-keys)))
-          `(progn
-             ;; create keymap
-             (set (defvar ,keymap-name
-                    nil
-                    ,(format "Keymap for %S." name))
-                  ',keymap)
-             ;; declare heads
-             (set (defvar ,(intern (format "%S/heads" name))
-                    nil
-                    ,(format "Heads for %S." name))
-                  ',(mapcar (lambda (h)
-                              (let ((j (copy-sequence h)))
-                                (cl-remf (cl-cdddr j) :cmd-name)
-                                j))
-                            heads))
-             (set
-              (defvar ,(intern (format "%S/hint" name)) nil
-                ,(format "Dynamic hint for %S." name))
-              ',(hydra--format name body docstring heads))
-             ;; create defuns
-             ,@(mapcar
-                (lambda (head)
-                  (hydra--make-defun name body doc head keymap-name
-                                     body-pre
-                                     body-before-exit
-                                     body-after-exit))
-                heads-nodup)
-             ;; free up keymap prefix
-             ,@(unless (or (null body-key)
-                           (null body-map)
-                           (hydra--callablep body-map))
-                 `((unless (keymapp (lookup-key ,body-map (kbd ,body-key)))
-                     (define-key ,body-map (kbd ,body-key) nil))))
-             ;; bind keys
-             ,@(delq nil
-                     (mapcar
-                      (lambda (head)
-                        (let ((name (hydra--head-property head :cmd-name)))
-                          (when (and (cadr head)
-                                     (or body-key body-map))
-                            (let ((bind (hydra--head-property head :bind body-map))
-                                  (final-key
-                                   (if body-key
-                                       (vconcat (kbd body-key) (kbd (car head)))
-                                     (kbd (car head)))))
-                              (cond ((null bind) nil)
-                                    ((hydra--callablep bind)
-                                     `(funcall ,bind ,final-key (function ,name)))
-                                    ((and (symbolp bind)
-                                          (if (boundp bind)
-                                              (keymapp (symbol-value bind))
-                                            t))
-                                     `(define-key ,bind ,final-key (quote ,name)))
-                                    (t
-                                     (error "Invalid :bind property `%S' for head %S" bind head)))))))
-                      heads))
-             ,(hydra--make-defun
-               name body doc '(nil body)
-               keymap-name
-               (or body-body-pre body-pre) body-before-exit
-               '(setq prefix-arg current-prefix-arg)))))
-    (error
-     (hydra--complain "Error in defhydra %S: %s" name (cdr err))
-     nil)))
-
-(defmacro defhydradio (name _body &rest heads)
-  "Create radios with prefix NAME.
-_BODY specifies the options; there are none currently.
-HEADS have the format:
-
-    (TOGGLE-NAME &optional VALUE DOC)
-
-TOGGLE-NAME will be used along with NAME to generate a variable
-name and a function that cycles it with the same name.  VALUE
-should be an array.  The first element of VALUE will be used to
-inialize the variable.
-VALUE defaults to [nil t].
-DOC defaults to TOGGLE-NAME split and capitalized."
-  (declare (indent defun))
-  `(progn
-     ,@(apply #'append
-              (mapcar (lambda (h)
-                        (hydra--radio name h))
-                      heads))
-     (defvar ,(intern (format "%S/names" name))
-       ',(mapcar (lambda (h) (intern (format "%S/%S" name (car h))))
-                 heads))))
-
-(defun hydra--radio (parent head)
-  "Generate a hydradio with PARENT from HEAD."
-  (let* ((name (car head))
-         (full-name (intern (format "%S/%S" parent name)))
-         (doc (cadr head))
-         (val (or (cl-caddr head) [nil t])))
-    `((defvar ,full-name ,(hydra--quote-maybe (aref val 0)) ,doc)
-      (put ',full-name 'range ,val)
-      (defun ,full-name ()
-        (hydra--cycle-radio ',full-name)))))
-
-(defun hydra--quote-maybe (x)
-  "Quote X if it's a symbol."
-  (cond ((null x)
-         nil)
-        ((symbolp x)
-         (list 'quote x))
-        (t
-         x)))
-
-(defun hydra--cycle-radio (sym)
-  "Set SYM to the next value in its range."
-  (let* ((val (symbol-value sym))
-         (range (get sym 'range))
-         (i 0)
-         (l (length range)))
-    (setq i (catch 'done
-              (while (< i l)
-                (if (equal (aref range i) val)
-                    (throw 'done (1+ i))
-                  (cl-incf i)))
-              (error "Val not in range for %S" sym)))
-    (set sym
-         (aref range
-               (if (>= i l)
-                   0
-                 i)))))
-
-(defvar hydra-pause-ring (make-ring 10)
-  "Ring for paused hydras.")
-
-(defun hydra-pause-resume ()
-  "Quit the current hydra and save it to the stack.
-If there's no active hydra, pop one from the stack and call its body.
-If the stack is empty, call the last hydra's body."
-  (interactive)
-  (cond (hydra-curr-map
-         (ring-insert hydra-pause-ring hydra-curr-body-fn)
-         (hydra-keyboard-quit))
-        ((zerop (ring-length hydra-pause-ring))
-         (funcall hydra-curr-body-fn))
-        (t
-         (funcall (ring-remove hydra-pause-ring 0)))))
-
-;; Local Variables:
-;; outline-regexp: ";;\\([;*]+ [^\s\t\n]\\|###autoload\\)\\|("
-;; indent-tabs-mode: nil
-;; End:
-
-(provide 'hydra)
-
-;;; hydra.el ends here
.emacs.d/elpa/hydra-20170903.218/hydra.elc
Binary file
.emacs.d/elpa/hydra-20170903.218/lv.el
@@ -1,117 +0,0 @@
-;;; lv.el --- Other echo area
-
-;; Copyright (C) 2015  Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This package provides `lv-message' intended to be used in place of
-;; `message' when semi-permanent hints are needed, in order to not
-;; interfere with Echo Area.
-;;
-;;    "Я тихо-тихо пiдглядаю,
-;;     І тiшуся собi, як бачу то,
-;;     Шо страшить i не пiдпускає,
-;;     А iншi п’ють тебе, як воду пiсок."
-;;     --  Андрій Кузьменко, L.V.
-
-;;; Code:
-
-(defgroup lv nil
-  "The other echo area."
-  :group 'minibuffer
-  :group 'hydra)
-
-(defcustom lv-use-separator nil
-  "Whether to draw a line between the LV window and the Echo Area."
-  :group 'lv
-  :type 'boolean)
-
-(defface lv-separator
-  '((((class color) (background light)) :background "grey80")
-    (((class color) (background  dark)) :background "grey30"))
-  "Face used to draw line between the lv window and the echo area.
-This is only used if option `lv-use-separator' is non-nil.
-Only the background color is significant."
-  :group 'lv)
-
-(defvar lv-wnd nil
-  "Holds the current LV window.")
-
-(defun lv-window ()
-  "Ensure that LV window is live and return it."
-  (if (window-live-p lv-wnd)
-      lv-wnd
-    (let ((ori (selected-window))
-          buf)
-      (prog1 (setq lv-wnd
-                   (select-window
-                    (let ((ignore-window-parameters t))
-                      (split-window
-                       (frame-root-window) -1 'below))))
-        (if (setq buf (get-buffer " *LV*"))
-            (switch-to-buffer buf)
-          (switch-to-buffer " *LV*")
-          (set-window-hscroll lv-wnd 0)
-          (setq window-size-fixed t)
-          (setq mode-line-format nil)
-          (setq cursor-type nil)
-          (set-window-dedicated-p lv-wnd t)
-          (set-window-parameter lv-wnd 'no-other-window t))
-        (select-window ori)))))
-
-(defvar golden-ratio-mode)
-
-(defvar lv-force-update nil
-  "When non-nil, `lv-message' will refresh even for the same string.")
-
-(defun lv-message (format-string &rest args)
-  "Set LV window contents to (`format' FORMAT-STRING ARGS)."
-  (let* ((str (apply #'format format-string args))
-         (n-lines (cl-count ?\n str))
-         deactivate-mark
-         golden-ratio-mode)
-    (with-selected-window (lv-window)
-      (unless (and (string= (buffer-string) str)
-                   (null lv-force-update))
-        (delete-region (point-min) (point-max))
-        (insert str)
-        (when (and (window-system) lv-use-separator)
-          (unless (looking-back "\n" nil)
-            (insert "\n"))
-          (insert
-           (propertize "__" 'face 'lv-separator 'display '(space :height (1)))
-           (propertize "\n" 'face 'lv-separator 'line-height t)))
-        (set (make-local-variable 'window-min-height) n-lines)
-        (setq truncate-lines (> n-lines 1))
-        (let ((window-resize-pixelwise t)
-              (window-size-fixed nil))
-          (fit-window-to-buffer nil nil 1)))
-      (goto-char (point-min)))))
-
-(defun lv-delete-window ()
-  "Delete LV window and kill its buffer."
-  (when (window-live-p lv-wnd)
-    (let ((buf (window-buffer lv-wnd)))
-      (delete-window lv-wnd)
-      (kill-buffer buf))))
-
-(provide 'lv)
-
-;;; lv.el ends here
.emacs.d/elpa/hydra-20170903.218/lv.elc
Binary file
.emacs.d/elpa/ivy-20170911.1034/colir.el
@@ -1,114 +0,0 @@
-;;; colir.el --- Color blending library -*- lexical-binding: t -*-
-
-;; Copyright (C) 2015-2017  Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-
-;; This file is part of GNU Emacs.
-
-;; 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 3, 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.
-
-;; For a full copy of the GNU General Public License
-;; see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This package solves the problem of adding a face with a background
-;; to text which may already have a background.  In all conflicting
-;; areas, instead of choosing either the original or the new
-;; background face, their blended sum is used.
-;;
-;; The blend mode functions are taken from http://en.wikipedia.org/wiki/Blend_modes.
-
-;;; Code:
-
-(require 'color)
-
-(defcustom colir-compose-method 'colir-compose-alpha
-  "Select a method to compose two color channels."
-  :type '(choice
-          (const colir-compose-alpha)
-          (const colir-compose-overlay)
-          (const colir-compose-soft-light))
-  :group 'ivy)
-
-(defun colir-compose-soft-light (a b)
-  "Compose A and B channels."
-  (if (< b 0.5)
-      (+ (* 2 a b) (* a a (- 1 b b)))
-    (+ (* 2 a (- 1 b)) (* (sqrt a) (- (* 2 b) 1)))))
-
-(defun colir-compose-overlay (a b)
-  "Compose A and B channels."
-  (if (< a 0.5)
-      (* 2 a b)
-    (- 1 (* 2 (- 1 a) (- 1 b)))))
-
-(defun colir-compose-alpha (a b &optional alpha gamma)
-  "Compose A and B channels.
-Optional argument ALPHA is a number between 0.0 and 1.0 which corresponds
-to the influence of A on the result.  Default value is 0.5.
-Optional argument GAMMA is used for gamma correction.  Default value is 2.2."
-  (setq alpha (or alpha 0.5))
-  (setq gamma (or gamma 2.2))
-  (+ (* (expt a gamma) alpha) (* (expt b gamma) (- 1 alpha))))
-
-(defun colir-blend (c1 c2)
-  "Blend the two colors C1 and C2 using `colir-compose-method'.
-C1 and C2 are triples of floats in [0.0 1.0] range."
-  (apply #'color-rgb-to-hex
-         (cl-mapcar
-          (if (eq (frame-parameter nil 'background-mode) 'dark)
-              ;; this method works nicely for dark themes
-              'colir-compose-soft-light
-            colir-compose-method)
-          c1 c2)))
-
-(defun colir-color-parse (color)
-  "Convert string COLOR to triple of floats in [0.0 1.0]."
-  (if (string-match "#\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{2\\}\\)" color)
-      (mapcar (lambda (v) (/ (string-to-number v 16) 255.0))
-              (list (match-string 1 color) (match-string 2 color) (match-string 3 color)))
-    ;; does not work properly in terminal (maps color to nearest color
-    ;; from available color palette).
-    (color-name-to-rgb color)))
-
-(defun colir-blend-face-background (start end face &optional object)
-  "Append to the face property of the text from START to END the face FACE.
-When the text already has a face with a non-plain background,
-blend it with the background of FACE.
-Optional argument OBJECT is the string or buffer containing the text.
-See also `font-lock-append-text-property'."
-  (let (next prev)
-    (while (/= start end)
-      (setq next (next-single-property-change start 'face object end))
-      (setq prev (get-text-property start 'face object))
-      (when (listp prev)
-        (setq prev (cl-find-if #'atom prev)))
-      (if (facep prev)
-          (let ((background-prev (face-background prev)))
-            (progn
-              (put-text-property
-               start next 'face
-               (if background-prev
-                   (cons `(background-color
-                           . ,(colir-blend
-                               (colir-color-parse background-prev)
-                               (colir-color-parse (face-background face nil t))))
-                         prev)
-                 (list face prev))
-               object)))
-        (put-text-property start next 'face face object))
-      (setq start next))))
-
-(provide 'colir)
-
-;;; colir.el ends here
.emacs.d/elpa/ivy-20170911.1034/colir.elc
Binary file
.emacs.d/elpa/ivy-20170911.1034/dir
@@ -1,18 +0,0 @@
-This is the file .../info/dir, which contains the
-topmost node of the Info hierarchy, called (dir)Top.
-The first time you invoke Info you start off looking at this node.
-
-File: dir,	Node: Top	This is the top of the INFO tree
-
-  This (the Directory node) gives a menu of major topics.
-  Typing "q" exits, "?" lists all Info commands, "d" returns here,
-  "h" gives a primer for first-timers,
-  "mEmacs<Return>" visits the Emacs manual, etc.
-
-  In Emacs, you can click mouse button 2 on a menu item or cross reference
-  to select it.
-
-* Menu:
-
-Emacs
-* Ivy: (ivy).                   Using Ivy for completion.
.emacs.d/elpa/ivy-20170911.1034/ivy-autoloads.el
@@ -1,135 +0,0 @@
-;;; ivy-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "ivy" "ivy.el" (22977 29291 974930 936000))
-;;; Generated autoloads from ivy.el
-
-(autoload 'ivy-resume "ivy" "\
-Resume the last completion session.
-
-\(fn)" t nil)
-
-(autoload 'ivy-read "ivy" "\
-Read a string in the minibuffer, with completion.
-
-PROMPT is a format string, normally ending in a colon and a
-space; %d anywhere in the string is replaced by the current
-number of matching candidates.  For the literal % character,
-escape it with %%. See also `ivy-count-format'.
-
-COLLECTION is either a list of strings, a function, an alist, or
-a hash table.
-
-PREDICATE is applied to filter out the COLLECTION immediately.
-This argument is for `completing-read' compat.
-
-When REQUIRE-MATCH is non-nil, only members of COLLECTION can be
-selected, i.e. custom text.
-
-If INITIAL-INPUT is not nil, then insert that input in the
-minibuffer initially.
-
-HISTORY is a name of a variable to hold the completion session
-history.
-
-KEYMAP is composed with `ivy-minibuffer-map'.
-
-If PRESELECT is not nil, then select the corresponding candidate
-out of the ones that match the INITIAL-INPUT.
-
-DEF is for compatibility with `completing-read'.
-
-UPDATE-FN is called each time the current candidate(s) is changed.
-
-When SORT is t, use `ivy-sort-functions-alist' for sorting.
-
-ACTION is a lambda function to call after selecting a result.  It
-takes a single string argument.
-
-UNWIND is a lambda function to call before exiting.
-
-RE-BUILDER is a lambda function to call to transform text into a
-regex pattern.
-
-MATCHER is to override matching.
-
-DYNAMIC-COLLECTION is a boolean to specify if the list of
-candidates is updated after each input by calling COLLECTION.
-
-CALLER is a symbol to uniquely identify the caller to `ivy-read'.
-It is used, along with COLLECTION, to determine which
-customizations apply to the current completion session.
-
-\(fn PROMPT COLLECTION &key PREDICATE REQUIRE-MATCH INITIAL-INPUT HISTORY PRESELECT DEF KEYMAP UPDATE-FN SORT ACTION UNWIND RE-BUILDER MATCHER DYNAMIC-COLLECTION CALLER)" nil nil)
-
-(autoload 'ivy-completing-read "ivy" "\
-Read a string in the minibuffer, with completion.
-
-This interface conforms to `completing-read' and can be used for
-`completing-read-function'.
-
-PROMPT is a string that normally ends in a colon and a space.
-COLLECTION is either a list of strings, an alist, an obarray, or a hash table.
-PREDICATE limits completion to a subset of COLLECTION.
-REQUIRE-MATCH is a boolean value.  See `completing-read'.
-INITIAL-INPUT is a string inserted into the minibuffer initially.
-HISTORY is a list of previously selected inputs.
-DEF is the default value.
-INHERIT-INPUT-METHOD is currently ignored.
-
-\(fn PROMPT COLLECTION &optional PREDICATE REQUIRE-MATCH INITIAL-INPUT HISTORY DEF INHERIT-INPUT-METHOD)" nil nil)
-
-(defvar ivy-mode nil "\
-Non-nil if Ivy mode is enabled.
-See the `ivy-mode' command
-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 `ivy-mode'.")
-
-(custom-autoload 'ivy-mode "ivy" nil)
-
-(autoload 'ivy-mode "ivy" "\
-Toggle Ivy mode on or off.
-Turn Ivy mode on if ARG is positive, off otherwise.
-Turning on Ivy mode sets `completing-read-function' to
-`ivy-completing-read'.
-
-Global bindings:
-\\{ivy-mode-map}
-
-Minibuffer bindings:
-\\{ivy-minibuffer-map}
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'ivy-switch-buffer "ivy" "\
-Switch to another buffer.
-
-\(fn)" t nil)
-
-(autoload 'ivy-switch-view "ivy" "\
-Switch to one of the window views stored by `ivy-push-view'.
-
-\(fn)" t nil)
-
-(autoload 'ivy-switch-buffer-other-window "ivy" "\
-Switch to another buffer in another window.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads nil nil ("colir.el" "ivy-overlay.el" "ivy-pkg.el")
-;;;;;;  (22977 29291 971930 965000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; ivy-autoloads.el ends here
.emacs.d/elpa/ivy-20170911.1034/ivy-help.org
@@ -1,138 +0,0 @@
-* Ivy Generic Help
-
-=ivy= is an Emacs incremental completion framework.
-
-- Narrow the list by typing some pattern,
-- Multiple patterns are allowed by separating with a space,
-- Select with ~C-n~ and ~C-p~, choose with ~RET~.
-
-** Help
-
-- ~C-h m~ :: Pop to this generic help buffer.
-
-** Basic Operations
-*** Key bindings for navigation
-
-- ~C-n~ (=ivy-next-line=) :: next candidate.
-- ~C-p~ (=ivy-previous-line=) :: previous candidate.
-- ~C-v~ (=ivy-scroll-up-command=) :: next page.
-- ~M-v~ (=ivy-scroll-down-command=) :: previous page.
-- ~M-<~ (=ivy-beginning-of-buffer=) :: first candidate.
-- ~M->~ (=ivy-end-of-buffer=) :: last candidate.
-
-*** Key bindings for single selection
-
-When selecting a candidate, an action is called on it. You can think
-of an action as a function that takes the selected candidate as an
-argument and does something with it.
-
-Ivy can offer several actions from which to choose. This can be
-independently composed with whether you want to end completion when
-the action is called. Depending on this, the short term is either
-"calling an action" or "exiting with action".
-
-~C-m~ or ~RET~ (=ivy-done=) - exit with the current action.
-
-~M-o~ (=ivy-dispatching-done=) - select an action and exit with it.
-
-~C-j~ (=ivy-alt-done=) - when the candidate is a directory, enter
-it. Otherwise, exit with the current action.
-
-~TAB~ (=ivy-partial-or-done=) - attempt partial completion, extending
-the current input as much as possible. ~TAB TAB~ is the same as ~C-j~.
-
-~C-M-j~ (=ivy-immediate-done=) - exit with the current action, calling
-it on the /current input/ instead of the current candidate. This is
-useful especially when creating new files or directories - often the
-input will match an existing file, which you don't want to select.
-
-~C-'~ (=ivy-avy=) - select a candidate from the current page with avy
-and exit with the current action.
-
-** Advanced Operations
-*** Key bindings for multiple selection
-
-For repeatedly applying multiple actions or acting on multiple
-candidates, Ivy does not close the minibuffer between commands. It
-keeps the minibuffer open for applying subsequent actions.
-
-Adding an extra meta key to the normal key chord invokes the special
-version of the regular commands that enables applying multiple
-actions.
-
-~C-M-m~ (=ivy-call=) is the non-exiting version of ~C-m~ (=ivy-done=).
-
-~C-M-n~ (=ivy-next-line-and-call=) combines ~C-n~ and ~C-M-m~.
-
-~C-M-p~ (=ivy-previous-line-and-call=) combines ~C-p~ and ~C-M-m~.
-
-~C-M-o~ (=ivy-dispatching-call=) is a non-exiting version of ~M-o~
-(=ivy-dispatching-done=).
-
-*** Key bindings that alter the minibuffer input
-
-~M-n~ (=ivy-next-history-element=) select the next history element or
-symbol/URL at point.
-
-~M-p~ (=ivy-previous-history-element=) select the previous history
-element.
-
-~C-r~ (=ivy-reverse-i-search=) start a recursive completion session to
-select a history element.
-
-~M-i~ (=ivy-insert-current=) insert the current candidate into the
-minibuffer. Useful for copying and renaming files, for example: ~M-i~
-to insert the original file name string, edit it, and then ~C-m~ to
-complete the renaming.
-
-~M-j~ (=ivy-yank-word=) insert the sub-word at point into the
-minibuffer.
-
-~S-SPC~ (=ivy-restrict-to-matches=) deletes the current input, and
-resets the candidates list to the currently restricted matches. This
-is how Ivy provides narrowing in successive tiers.
-
-*** Other key bindings
-
-~M-w~ (=ivy-kill-ring-save=) copies the selected candidates to the
-kill ring; when the region is active, copies the active region.
-
-*** Saving the current completion session to a buffer
-
-~C-c C-o~ (=ivy-occur=) saves the current candidates to a new buffer;
-the list is active in the new buffer.
-
-~RET~ or ~mouse-1~ in the new buffer calls the appropriate action on
-the selected candidate.
-
-Ivy has no limit on the number of active buffers like these.
-
-Ivy takes care of making these buffer names unique. It applies
-descriptive names, for example: =*ivy-occur counsel-describe-variable
-"function$*=.
-
-*** Global key bindings
-
-=ivy-resume= recalls the state of the completion session just before
-its last exit. Useful after an accidental ~C-m~ (=ivy-done=).
-Recommended global binding: ~C-c C-r~.
-
-*** Hydra in the minibuffer
-
-~C-o~ (=hydra-ivy/body=) invokes Hydra menus with key shortcuts.
-
-When in Hydra, ~C-o~ or ~i~ resumes editing.
-
-Hydra reduces key strokes, for example: ~C-n C-n C-n C-n~ is ~C-o
-jjjj~ in Hydra. Besides certain shorter keys, Hydra shows useful info
-such as case folding and the current action.
-
-Additionally, here are the keys that are otherwise not bound:
-
-- ~<~ and ~>~ adjust the height of the minibuffer.
-- ~c~ (=ivy-toggle-calling=) - toggle calling the current action each
-  time a different candidate is selected.
-- ~m~ (=ivy-toggle-fuzzy=) - toggle regex matcher.
-- ~w~ and ~s~ scroll the actions list.
-
-Minibuffer editing is disabled when Hydra is active.
.emacs.d/elpa/ivy-20170911.1034/ivy-overlay.el
@@ -1,128 +0,0 @@
-;;; ivy-overlay.el --- Overlay display functions for Ivy  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2016-2017  Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-;; Keywords: convenience
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This package allows to setup Ivy's completion at point to actually
-;; show the candidates and the input at point, instead of in the
-;; minibuffer.
-
-;;; Code:
-(defface ivy-cursor
-  '((t (:background "black"
-        :foreground "white")))
-  "Cursor face for inline completion."
-  :group 'ivy-faces)
-
-(defvar ivy--old-cursor-type t)
-
-(defvar ivy-overlay-at nil
-  "Overlay variable for `ivy-display-function-overlay'.")
-
-(defun ivy-left-pad (str width)
-  "Pad STR from left with WIDTH spaces."
-  (let ((padding (make-string width ?\ )))
-    (mapconcat (lambda (x)
-                 (setq x (concat padding x))
-                 (if (> (length x) (window-width))
-                     (concat
-                      (substring x 0 (- (window-width) 4))
-                      "...")
-                   x))
-               (split-string str "\n")
-               "\n")))
-
-(declare-function company-abort "ext:company")
-
-(defun ivy-overlay-cleanup ()
-  "Clean up after `ivy-display-function-overlay'."
-  (when (overlayp ivy-overlay-at)
-    (delete-overlay ivy-overlay-at)
-    (setq ivy-overlay-at nil))
-  (unless cursor-type
-    (setq cursor-type ivy--old-cursor-type))
-  (when (fboundp 'company-abort)
-    (company-abort)))
-
-(defun ivy-overlay-show-after (str)
-  "Display STR in an overlay at point.
-
-First, fill each line of STR with spaces to the current column.
-Then attach the overlay the character before point."
-  (if ivy-overlay-at
-      (progn
-        (move-overlay ivy-overlay-at (1- (point)) (line-end-position))
-        (overlay-put ivy-overlay-at 'invisible nil))
-    (setq ivy-overlay-at (make-overlay (1- (point)) (line-end-position)))
-    (overlay-put ivy-overlay-at 'priority 9999))
-  (overlay-put ivy-overlay-at 'display str)
-  (overlay-put ivy-overlay-at 'after-string ""))
-
-(declare-function org-current-level "org")
-(defvar org-indent-indentation-per-level)
-(defvar ivy-last)
-(defvar ivy-text)
-(defvar ivy-completion-beg)
-(declare-function ivy--get-window "ivy")
-
-(defun ivy-display-function-overlay (str)
-  "Called from the minibuffer, display STR in an overlay in Ivy window.
-Hide the minibuffer contents and cursor."
-  (if (save-selected-window
-        (select-window (ivy-state-window ivy-last))
-        (or
-         (< (- (window-width) (current-column))
-            (length (ivy-state-current ivy-last)))
-         (<= (window-height) (+ ivy-height 2))))
-      (let ((buffer-undo-list t))
-        (save-excursion
-          (forward-line 1)
-          (insert str)))
-    (add-face-text-property (minibuffer-prompt-end) (point-max)
-                            '(:foreground "white"))
-    (let ((cursor-pos (1+ (- (point) (minibuffer-prompt-end))))
-          (ivy-window (ivy--get-window ivy-last)))
-      (setq cursor-type nil)
-      (with-selected-window ivy-window
-        (when cursor-type
-          (setq ivy--old-cursor-type cursor-type))
-        (setq cursor-type nil)
-        (let ((overlay-str
-               (concat
-                (buffer-substring (max 1 (1- (point))) (point))
-                ivy-text
-                (if (eolp)
-                    " "
-                  "")
-                (buffer-substring (point) (line-end-position))
-                (ivy-left-pad
-                 str
-                 (+ (if (eq major-mode 'org-mode)
-                        (* org-indent-indentation-per-level (org-current-level))
-                      0)
-                    (save-excursion
-                      (goto-char ivy-completion-beg)
-                      (current-column)))))))
-          (add-face-text-property cursor-pos (1+ cursor-pos)
-                                  'ivy-cursor t overlay-str)
-          (ivy-overlay-show-after overlay-str))))))
-
-(provide 'ivy-overlay)
-;;; ivy-overlay.el ends here
.emacs.d/elpa/ivy-20170911.1034/ivy-overlay.elc
Binary file
.emacs.d/elpa/ivy-20170911.1034/ivy-pkg.el
@@ -1,7 +0,0 @@
-(define-package "ivy" "20170911.1034" "Incremental Vertical completYon"
-  '((emacs "24.1"))
-  :url "https://github.com/abo-abo/swiper" :keywords
-  '("matching"))
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/ivy-20170911.1034/ivy.el
@@ -1,3993 +0,0 @@
-;;; ivy.el --- Incremental Vertical completYon -*- lexical-binding: t -*-
-
-;; Copyright (C) 2015-2017  Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-;; URL: https://github.com/abo-abo/swiper
-;; Version: 0.9.1
-;; Package-Requires: ((emacs "24.1"))
-;; Keywords: matching
-
-;; This file is part of GNU Emacs.
-
-;; 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 3, 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.
-
-;; For a full copy of the GNU General Public License
-;; see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This package provides `ivy-read' as an alternative to
-;; `completing-read' and similar functions.
-;;
-;; There's no intricate code to determine the best candidate.
-;; Instead, the user can navigate to it with `ivy-next-line' and
-;; `ivy-previous-line'.
-;;
-;; The matching is done by splitting the input text by spaces and
-;; re-building it into a regex.
-;; So "for example" is transformed into "\\(for\\).*\\(example\\)".
-
-;;; Code:
-(require 'cl-lib)
-(require 'ffap)
-(require 'ivy-overlay)
-
-;;* Customization
-(defgroup ivy nil
-  "Incremental vertical completion."
-  :group 'convenience)
-
-(defgroup ivy-faces nil
-  "Font-lock faces for `ivy'."
-  :group 'ivy
-  :group 'faces)
-
-(defface ivy-current-match
-  '((((class color) (background light))
-     :background "#1a4b77" :foreground "white")
-    (((class color) (background dark))
-     :background "#65a7e2" :foreground "black"))
-  "Face used by Ivy for highlighting the current match.")
-
-(defface ivy-minibuffer-match-face-1
-  '((((class color) (background light))
-     :background "#d3d3d3")
-    (((class color) (background dark))
-     :background "#555555"))
-  "The background face for `ivy' minibuffer matches.")
-
-(defface ivy-minibuffer-match-face-2
-  '((((class color) (background light))
-     :background "#e99ce8" :weight bold)
-    (((class color) (background dark))
-     :background "#777777" :weight bold))
-  "Face for `ivy' minibuffer matches numbered 1 modulo 3.")
-
-(defface ivy-minibuffer-match-face-3
-  '((((class color) (background light))
-     :background "#bbbbff" :weight bold)
-    (((class color) (background dark))
-     :background "#7777ff" :weight bold))
-  "Face for `ivy' minibuffer matches numbered 2 modulo 3.")
-
-(defface ivy-minibuffer-match-face-4
-  '((((class color) (background light))
-     :background "#ffbbff" :weight bold)
-    (((class color) (background dark))
-     :background "#8a498a" :weight bold))
-  "Face for `ivy' minibuffer matches numbered 3 modulo 3.")
-
-(defface ivy-confirm-face
-  '((t :foreground "ForestGreen" :inherit minibuffer-prompt))
-  "Face used by Ivy for a confirmation prompt.")
-
-(defface ivy-match-required-face
-  '((t :foreground "red" :inherit minibuffer-prompt))
-  "Face used by Ivy for a match required prompt.")
-
-(defface ivy-subdir
-  '((t :inherit dired-directory))
-  "Face used by Ivy for highlighting subdirs in the alternatives.")
-
-(defface ivy-modified-buffer
-  '((t :inherit default))
-  "Face used by Ivy for highlighting modified file visiting buffers.")
-
-(defface ivy-remote
-  '((((class color) (background light))
-     :foreground "#110099")
-    (((class color) (background dark))
-     :foreground "#7B6BFF"))
-  "Face used by Ivy for highlighting remotes in the alternatives.")
-
-(defface ivy-virtual
-  '((t :inherit font-lock-builtin-face))
-  "Face used by Ivy for matching virtual buffer names.")
-
-(defface ivy-action
-  '((t :inherit font-lock-builtin-face))
-  "Face used by Ivy for displaying keys in `ivy-read-action'.")
-
-(defface ivy-highlight-face
-  '((t :inherit highlight))
-  "Face used by Ivy to highlight certain candidates.")
-
-(defface ivy-prompt-match
-  '((t :inherit ivy-current-match))
-  "Face used by Ivy for highlighting the selected prompt line.")
-
-(setcdr (assoc load-file-name custom-current-group-alist) 'ivy)
-
-(defcustom ivy-height 10
-  "Number of lines for the minibuffer window."
-  :type 'integer)
-
-(defcustom ivy-count-format "%-4d "
-  "The style to use for displaying the current candidate count for `ivy-read'.
-Set this to \"\" to suppress the count visibility.
-Set this to \"(%d/%d) \" to display both the index and the count."
-  :type '(choice
-          (const :tag "Count disabled" "")
-          (const :tag "Count matches" "%-4d ")
-          (const :tag "Count matches and show current match" "(%d/%d) ")
-          string))
-
-(defcustom ivy-add-newline-after-prompt nil
-  "When non-nil, add a newline after the `ivy-read' prompt."
-  :type 'boolean)
-
-(defcustom ivy-wrap nil
-  "When non-nil, wrap around after the first and the last candidate."
-  :type 'boolean)
-
-(defcustom ivy-display-style (unless (version< emacs-version "24.5") 'fancy)
-  "The style for formatting the minibuffer.
-
-By default, the matched strings are copied as is.
-
-The fancy display style highlights matching parts of the regexp,
-a behavior similar to `swiper'.
-
-This setting depends on `add-face-text-property' - a C function
-available as of Emacs 24.5.  Fancy style will render poorly in
-earlier versions of Emacs."
-  :type '(choice
-          (const :tag "Plain" nil)
-          (const :tag "Fancy" fancy)))
-
-(defcustom ivy-on-del-error-function 'minibuffer-keyboard-quit
-  "The handler for when `ivy-backward-delete-char' throws.
-Usually a quick exit out of the minibuffer."
-  :type 'function)
-
-(defcustom ivy-extra-directories '("../" "./")
-  "Add this to the front of the list when completing file names.
-Only \"./\" and \"../\" apply here.  They appear in reverse order."
-  :type '(repeat :tag "Dirs"
-          (choice
-           (const :tag "Parent Directory" "../")
-           (const :tag "Current Directory" "./"))))
-
-(defcustom ivy-use-virtual-buffers nil
-  "When non-nil, add recent files and bookmarks to `ivy-switch-buffer'."
-  :type 'boolean)
-
-(defcustom ivy-display-function nil
-  "Decide where to display the candidates.
-This function takes a string with the current matching candidates
-and has to display it somewhere.
-See https://github.com/abo-abo/swiper/wiki/ivy-display-function."
-  :type '(choice
-          (const :tag "Minibuffer" nil)
-          (const :tag "LV" ivy-display-function-lv)
-          (const :tag "Popup" ivy-display-function-popup)
-          (const :tag "Overlay" ivy-display-function-overlay)))
-
-(defvar ivy-display-functions-alist
-  '((ivy-completion-in-region . ivy-display-function-overlay))
-  "An alist for customizing `ivy-display-function'.")
-
-(defcustom ivy-completing-read-handlers-alist
-  '((tmm-menubar . completing-read-default)
-    (tmm-shortcut . completing-read-default)
-    (bbdb-create . ivy-completing-read-with-empty-string-def)
-    (auto-insert . ivy-completing-read-with-empty-string-def)
-    (Info-on-current-buffer . ivy-completing-read-with-empty-string-def)
-    (Info-follow-reference . ivy-completing-read-with-empty-string-def)
-    (Info-menu . ivy-completing-read-with-empty-string-def)
-    (Info-index . ivy-completing-read-with-empty-string-def)
-    (Info-virtual-index . ivy-completing-read-with-empty-string-def)
-    (info-display-manual . ivy-completing-read-with-empty-string-def)
-    (webjump . ivy-completing-read-with-empty-string-def))
-  "An alist of handlers to replace `completing-read' in `ivy-mode'."
-  :type '(alist :key-type function :value-type function))
-
-(defvar ivy-completing-read-ignore-handlers-depth -1
-  "Used to avoid infinite recursion.
-
-If `(minibuffer-depth)' equals this, `ivy-completing-read' will
-act as if `ivy-completing-read-handlers-alist' is empty.")
-
-(defvar ivy--actions-list nil
-  "A list of extra actions per command.")
-
-(defun ivy-set-actions (cmd actions)
-  "Set CMD extra exit points to ACTIONS."
-  (setq ivy--actions-list
-        (plist-put ivy--actions-list cmd actions)))
-
-(defun ivy-add-actions (cmd actions)
-  "Add CMD extra exit points to ACTIONS."
-  (setq ivy--actions-list
-        (plist-put ivy--actions-list cmd
-                   (delete-dups
-                    (append
-                     actions
-                     (plist-get ivy--actions-list cmd))))))
-
-(defvar ivy--prompts-list nil)
-
-(defun ivy-set-prompt (caller prompt-fn)
-  "Associate CALLER with PROMPT-FN.
-PROMPT-FN is a function of no arguments that returns a prompt string."
-  (setq ivy--prompts-list
-        (plist-put ivy--prompts-list caller prompt-fn)))
-
-(defvar ivy--display-transformers-list nil
-  "A list of str->str transformers per command.")
-
-(defun ivy-set-display-transformer (cmd transformer)
-  "Set CMD a displayed candidate TRANSFORMER.
-
-It's a lambda that takes a string one of the candidates in the
-collection and returns a string for display, the same candidate
-plus some extra information.
-
-This lambda is called only on the `ivy-height' candidates that
-are about to be displayed, not on the whole collection."
-  (setq ivy--display-transformers-list
-        (plist-put ivy--display-transformers-list cmd transformer)))
-
-(defvar ivy--sources-list nil
-  "A list of extra sources per command.")
-
-(defun ivy-set-sources (cmd sources)
-  "Attach to CMD a list of extra SOURCES.
-
-Each static source is a function that takes no argument and
-returns a list of strings.
-
-The (original-source) determines the position of the original
-dynamic source.
-
-Extra dynamic sources aren't supported yet.
-
-Example:
-
-    (defun small-recentf ()
-      (cl-subseq recentf-list 0 20))
-
-    (ivy-set-sources
-     'counsel-locate
-     '((small-recentf)
-       (original-source)))"
-  (setq ivy--sources-list
-        (plist-put ivy--sources-list cmd sources)))
-
-(defvar ivy-current-prefix-arg nil
-  "Prefix arg to pass to actions.
-This is a global variable that is set by ivy functions for use in
-action functions.")
-
-;;* Keymap
-(require 'delsel)
-(defvar ivy-minibuffer-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "C-m") 'ivy-done)
-    (define-key map (kbd "C-M-m") 'ivy-call)
-    (define-key map (kbd "C-j") 'ivy-alt-done)
-    (define-key map (kbd "C-M-j") 'ivy-immediate-done)
-    (define-key map (kbd "TAB") 'ivy-partial-or-done)
-    (define-key map [remap next-line] 'ivy-next-line)
-    (define-key map [remap previous-line] 'ivy-previous-line)
-    (define-key map (kbd "C-s") 'ivy-next-line-or-history)
-    (define-key map (kbd "C-r") 'ivy-reverse-i-search)
-    (define-key map (kbd "SPC") 'self-insert-command)
-    (define-key map [remap delete-backward-char] 'ivy-backward-delete-char)
-    (define-key map [remap backward-delete-char-untabify] 'ivy-backward-delete-char)
-    (define-key map [remap backward-kill-word] 'ivy-backward-kill-word)
-    (define-key map [remap delete-char] 'ivy-delete-char)
-    (define-key map [remap forward-char] 'ivy-forward-char)
-    (define-key map [remap kill-word] 'ivy-kill-word)
-    (define-key map [remap beginning-of-buffer] 'ivy-beginning-of-buffer)
-    (define-key map [remap end-of-buffer] 'ivy-end-of-buffer)
-    (define-key map (kbd "M-n") 'ivy-next-history-element)
-    (define-key map (kbd "M-p") 'ivy-previous-history-element)
-    (define-key map (kbd "C-g") 'minibuffer-keyboard-quit)
-    (define-key map [remap scroll-up-command] 'ivy-scroll-up-command)
-    (define-key map [remap scroll-down-command] 'ivy-scroll-down-command)
-    (define-key map (kbd "<next>") 'ivy-scroll-up-command)
-    (define-key map (kbd "<prior>") 'ivy-scroll-down-command)
-    (define-key map (kbd "C-v") 'ivy-scroll-up-command)
-    (define-key map (kbd "M-v") 'ivy-scroll-down-command)
-    (define-key map (kbd "C-M-n") 'ivy-next-line-and-call)
-    (define-key map (kbd "C-M-p") 'ivy-previous-line-and-call)
-    (define-key map (kbd "M-r") 'ivy-toggle-regexp-quote)
-    (define-key map (kbd "M-j") 'ivy-yank-word)
-    (define-key map (kbd "M-i") 'ivy-insert-current)
-    (define-key map (kbd "C-o") 'hydra-ivy/body)
-    (define-key map (kbd "M-o") 'ivy-dispatching-done)
-    (define-key map (kbd "C-M-o") 'ivy-dispatching-call)
-    (define-key map [remap kill-line] 'ivy-kill-line)
-    (define-key map (kbd "S-SPC") 'ivy-restrict-to-matches)
-    (define-key map [remap kill-ring-save] 'ivy-kill-ring-save)
-    (define-key map (kbd "C-'") 'ivy-avy)
-    (define-key map (kbd "C-M-a") 'ivy-read-action)
-    (define-key map (kbd "C-c C-o") 'ivy-occur)
-    (define-key map (kbd "C-c C-a") 'ivy-toggle-ignore)
-    (define-key map (kbd "C-c C-s") 'ivy-rotate-sort)
-    (define-key map [remap describe-mode] 'ivy-help)
-    map)
-  "Keymap used in the minibuffer.")
-(autoload 'hydra-ivy/body "ivy-hydra" "" t)
-
-(defvar ivy-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap switch-to-buffer]
-      'ivy-switch-buffer)
-    (define-key map [remap switch-to-buffer-other-window]
-      'ivy-switch-buffer-other-window)
-    map)
-  "Keymap for `ivy-mode'.")
-
-;;* Globals
-(cl-defstruct ivy-state
-  prompt collection
-  predicate require-match initial-input
-  history preselect keymap update-fn sort
-  ;; The frame in which `ivy-read' was called
-  frame
-  ;; The window in which `ivy-read' was called
-  window
-  ;; The buffer in which `ivy-read' was called
-  buffer
-  ;; The value of `ivy-text' to be used by `ivy-occur'
-  text
-  action
-  unwind
-  re-builder
-  matcher
-  ;; When this is non-nil, call it for each input change to get new candidates
-  dynamic-collection
-  ;; A lambda that transforms candidates only for display
-  display-transformer-fn
-  directory
-  caller
-  current
-  def)
-
-(defvar ivy-last (make-ivy-state)
-  "The last parameters passed to `ivy-read'.
-
-This should eventually become a stack so that you could use
-`ivy-read' recursively.")
-
-(defvar ivy-recursive-last nil)
-
-(defvar ivy-recursive-restore t
-  "When non-nil, restore the above state when exiting the minibuffer.
-This variable is let-bound to nil by functions that take care of
-the restoring themselves.")
-
-(defsubst ivy-set-action (action)
-  "Set the current `ivy-last' field to ACTION."
-  (setf (ivy-state-action ivy-last) action))
-
-(defun ivy-thing-at-point ()
-  "Return a string that corresponds to the current thing at point."
-  (or
-   (thing-at-point 'url)
-   (and (eq (ivy-state-collection ivy-last) 'read-file-name-internal)
-        (ffap-file-at-point))
-   (let (s)
-     (cond ((stringp (setq s (thing-at-point 'symbol)))
-            (if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)
-                (match-string 1 s)
-              s))
-           ((looking-at "(+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>")
-            (match-string-no-properties 1))
-           (t
-            "")))))
-
-(defvar ivy-history nil
-  "History list of candidates entered in the minibuffer.
-
-Maximum length of the history list is determined by the value
-of `history-length'.")
-
-(defvar ivy--directory nil
-  "Current directory when completing file names.")
-
-(defvar ivy--length 0
-  "Store the amount of viable candidates.")
-
-(defvar ivy-text ""
-  "Store the user's string as it is typed in.")
-
-(defvar ivy--index 0
-  "Store the index of the current candidate.")
-
-(defvar ivy-exit nil
-  "Store `done' if the completion was successfully selected.
-Otherwise, store nil.")
-
-(defvar ivy--all-candidates nil
-  "Store the candidates passed to `ivy-read'.")
-
-(defvar ivy--extra-candidates '((original-source))
-  "Store candidates added by the extra sources.
-
-This is an internal-use alist.  Each key is a function name, or
-original-source (which represents where the current dynamic
-candidates should go).
-
-Each value is an evaluation of the function, in case of static
-sources.  These values will subsequently be filtered on `ivy-text'.
-
-This variable is set by `ivy-read' and used by `ivy--set-candidates'.")
-
-(defcustom ivy-use-ignore-default t
-  "The default policy for user-configured candidate filtering."
-  :type '(choice
-          (const :tag "Ignore ignored always" always)
-          (const :tag "Ignore ignored when others exist" t)
-          (const :tag "Don't ignore" nil)))
-
-(defvar ivy-use-ignore t
-  "Store policy for user-configured candidate filtering.
-This may be changed dynamically by `ivy-toggle-ignore'.
-Use `ivy-use-ignore-default' for a permanent configuration.")
-
-(defvar ivy--default nil
-  "Default initial input.")
-
-(defvar ivy--prompt nil
-  "Store the format-style prompt.
-When non-nil, it should contain at least one %d.")
-
-(defvar ivy--prompt-extra ""
-  "Temporary modifications to the prompt.")
-
-(defvar ivy--old-re nil
-  "Store the old regexp.
-Either a string or a list for `ivy-re-match'.")
-
-(defvar ivy--old-cands nil
-  "Store the candidates matched by `ivy--old-re'.")
-
-(defvar ivy--regex-function 'ivy--regex
-  "Current function for building a regex.")
-
-(defvar ivy--highlight-function 'ivy--highlight-default
-  "Current function for formatting the candidates.")
-
-(defvar ivy--subexps 0
-  "Number of groups in the current `ivy--regex'.")
-
-(defvar ivy--full-length nil
-  "The total amount of candidates when :dynamic-collection is non-nil.")
-
-(defvar ivy--old-text ""
-  "Store old `ivy-text' for dynamic completion.")
-
-(defcustom ivy-case-fold-search-default 'auto
-  "The default value for `ivy-case-fold-search'."
-  :type '(choice
-          (const :tag "Auto" auto)
-          (const :tag "Always" always)
-          (const :tag "Never" nil)))
-
-(defvar ivy-case-fold-search ivy-case-fold-search-default
-  "Store the current overriding `case-fold-search'.")
-
-(defvar Info-current-file)
-
-(defun ivy-re-to-str (re)
-  (if (stringp re)
-      re
-    (caar re)))
-
-(eval-and-compile
-  (unless (fboundp 'defvar-local)
-    (defmacro defvar-local (var val &optional docstring)
-      "Define VAR as a buffer-local variable with default value VAL."
-      (declare (debug defvar) (doc-string 3))
-      (list 'progn (list 'defvar var val docstring)
-            (list 'make-variable-buffer-local (list 'quote var)))))
-  (unless (fboundp 'setq-local)
-    (defmacro setq-local (var val)
-      "Set variable VAR to value VAL in current buffer."
-      (list 'set (list 'make-local-variable (list 'quote var)) val))))
-
-(defmacro ivy-quit-and-run (&rest body)
-  "Quit the minibuffer and run BODY afterwards."
-  `(progn
-     (put 'quit 'error-message "")
-     (run-at-time nil nil
-                  (lambda ()
-                    (put 'quit 'error-message "Quit")
-                    ,@body))
-     (minibuffer-keyboard-quit)))
-
-(defun ivy-exit-with-action (action)
-  "Quit the minibuffer and call ACTION afterwards."
-  (ivy-set-action
-   `(lambda (x)
-      (funcall ',action x)
-      (ivy-set-action ',(ivy-state-action ivy-last))))
-  (setq ivy-exit 'done)
-  (exit-minibuffer))
-
-(defmacro with-ivy-window (&rest body)
-  "Execute BODY in the window from which `ivy-read' was called."
-  (declare (indent 0)
-           (debug t))
-  `(with-selected-window (ivy--get-window ivy-last)
-     ,@body))
-
-(defun ivy--done (text)
-  "Insert TEXT and exit minibuffer."
-  (insert
-   (setf (ivy-state-current ivy-last)
-         (if (and ivy--directory
-                  (not (eq (ivy-state-history ivy-last) 'grep-files-history)))
-             (expand-file-name text ivy--directory)
-           text)))
-  (setq ivy-exit 'done)
-  (exit-minibuffer))
-
-(defcustom ivy-use-selectable-prompt nil
-  "When non-nil, make the prompt line selectable like a candidate.
-
-The prompt line can be selected by calling `ivy-previous-line' when the first
-regular candidate is selected.  Both actions `ivy-done' and `ivy-alt-done',
-when called on a selected prompt, are forwarded to `ivy-immediate-done', which
-results to the same as calling `ivy-immediate-done' explicitely when a regular
-candidate is selected.
-
-Note that if `ivy-wrap' is set to t, calling `ivy-previous-line' when the
-prompt is selected wraps around to the last candidate, while calling
-`ivy-next-line' on the last candidate wraps around to the first
-candidate, not the prompt."
-  :type 'boolean)
-
-(defun ivy--prompt-selectable-p ()
-  "Return t if the prompt line is selectable."
-  (and ivy-use-selectable-prompt
-       (memq (ivy-state-require-match ivy-last)
-             '(nil confirm confirm-after-completion))))
-
-(defun ivy--prompt-selected-p ()
-  "Return t if the prompt line is selected."
-  (and (ivy--prompt-selectable-p)
-       (= ivy--index -1)))
-
-;;* Commands
-(defun ivy-done ()
-  "Exit the minibuffer with the selected candidate."
-  (interactive)
-  (if (ivy--prompt-selected-p)
-      (ivy-immediate-done)
-    (setq ivy-current-prefix-arg current-prefix-arg)
-    (delete-minibuffer-contents)
-    (cond ((or (> ivy--length 0)
-               ;; the action from `ivy-dispatching-done' may not need a
-               ;; candidate at all
-               (eq this-command 'ivy-dispatching-done))
-           (ivy--done (ivy-state-current ivy-last)))
-          ((memq (ivy-state-collection ivy-last)
-                 '(read-file-name-internal internal-complete-buffer))
-           (if (or (not (eq confirm-nonexistent-file-or-buffer t))
-                   (equal " (confirm)" ivy--prompt-extra))
-               (ivy--done ivy-text)
-             (setq ivy--prompt-extra " (confirm)")
-             (insert ivy-text)
-             (ivy--exhibit)))
-          ((memq (ivy-state-require-match ivy-last)
-                 '(nil confirm confirm-after-completion))
-           (ivy--done ivy-text))
-          (t
-           (setq ivy--prompt-extra " (match required)")
-           (insert ivy-text)
-           (ivy--exhibit)))))
-
-(defvar ivy-read-action-format-function 'ivy-read-action-format-default
-  "Function used to transform the actions list into a docstring.")
-
-(defun ivy-read-action-format-default (actions)
-  "Create a docstring from ACTIONS.
-
-ACTIONS is a list.  Each list item is a list of 3 items:
-key (a string), cmd and doc (a string)."
-  (format "%s\n%s\n"
-          (if (eq this-command 'ivy-read-action)
-              "Select action: "
-            (ivy-state-current ivy-last))
-          (mapconcat
-           (lambda (x)
-             (format "%s: %s"
-                     (propertize
-                      (car x)
-                      'face 'ivy-action)
-                     (nth 2 x)))
-           actions
-           "\n")))
-
-(defun ivy-read-action ()
-  "Change the action to one of the available ones.
-
-Return nil for `minibuffer-keyboard-quit' or wrong key during the
-selection, non-nil otherwise."
-  (interactive)
-  (let ((actions (ivy-state-action ivy-last)))
-    (if (null (ivy--actionp actions))
-        t
-      (let* ((hint (funcall ivy-read-action-format-function (cdr actions)))
-             (resize-mini-windows t)
-             (key (string (read-key hint)))
-             (action-idx (cl-position-if
-                          (lambda (x) (equal (car x) key))
-                          (cdr actions))))
-        (cond ((member key '("" ""))
-               nil)
-              ((null action-idx)
-               (message "%s is not bound" key)
-               nil)
-              (t
-               (message "")
-               (setcar actions (1+ action-idx))
-               (ivy-set-action actions)))))))
-
-(defun ivy-shrink-after-dispatching ()
-  "Shrink the window after dispatching when action list is too large."
-  (let ((window (selected-window)))
-    (window-resize window (- ivy-height (window-height window)))))
-
-(defun ivy-dispatching-done ()
-  "Select one of the available actions and call `ivy-done'."
-  (interactive)
-  (when (ivy-read-action)
-    (ivy-done))
-  (ivy-shrink-after-dispatching))
-
-(defun ivy-dispatching-call ()
-  "Select one of the available actions and call `ivy-call'."
-  (interactive)
-  (setq ivy-current-prefix-arg current-prefix-arg)
-  (let ((actions (copy-sequence (ivy-state-action ivy-last))))
-    (unwind-protect
-         (when (ivy-read-action)
-           (ivy-call))
-      (ivy-set-action actions)))
-  (ivy-shrink-after-dispatching))
-
-(defun ivy-build-tramp-name (x)
-  "Reconstruct X into a path.
-Is is a cons cell, related to `tramp-get-completion-function'."
-  (let ((user (car x))
-        (domain (cadr x)))
-    (if user
-        (concat user "@" domain)
-      domain)))
-
-(declare-function tramp-get-completion-function "tramp")
-(declare-function Info-find-node "info")
-
-(defun ivy-alt-done (&optional arg)
-  "Exit the minibuffer with the selected candidate.
-When ARG is t, exit with current text, ignoring the candidates."
-  (interactive "P")
-  (setq ivy-current-prefix-arg current-prefix-arg)
-  (cond ((or arg
-             (ivy--prompt-selected-p))
-         (ivy-immediate-done))
-        (ivy--directory
-         (ivy--directory-done))
-        ((eq (ivy-state-collection ivy-last) 'Info-read-node-name-1)
-         (if (member (ivy-state-current ivy-last) '("(./)" "(../)"))
-             (ivy-quit-and-run
-              (ivy-read "Go to file: " 'read-file-name-internal
-                        :action (lambda (x)
-                                  (Info-find-node
-                                   (expand-file-name x ivy--directory)
-                                   "Top"))))
-           (ivy-done)))
-        (t
-         (ivy-done))))
-
-(defun ivy--directory-done ()
-  "Handle exit from the minibuffer when completing file names."
-  (let (dir)
-    (cond
-      ((equal ivy-text "/sudo::")
-       (setq dir (concat ivy-text ivy--directory))
-       (ivy--cd dir)
-       (ivy--exhibit))
-      ((and
-        (> ivy--length 0)
-        (not (string= (ivy-state-current ivy-last) "./"))
-        (setq dir (ivy-expand-file-if-directory (ivy-state-current ivy-last))))
-       (ivy--cd dir)
-       (ivy--exhibit))
-      ((and (not (string= ivy-text ""))
-            (ignore-errors (file-exists-p ivy-text)))
-       (if (file-directory-p ivy-text)
-           (ivy--cd (expand-file-name
-                     (file-name-as-directory ivy-text) ivy--directory))
-         (ivy-done)))
-      ((or (and (equal ivy--directory "/")
-                (string-match "\\`[^/]+:.*:.*\\'" ivy-text))
-           (string-match "\\`/[^/]+:.*:.*\\'" ivy-text))
-       (ivy-done))
-      ((or (and (equal ivy--directory "/")
-                (cond ((string-match
-                        "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
-                        ivy-text))
-                      ((string-match
-                        "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
-                        (ivy-state-current ivy-last))
-                       (setq ivy-text (ivy-state-current ivy-last)))))
-           (string-match
-            "\\`/\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
-            ivy-text))
-       (let ((method (match-string 1 ivy-text))
-             (user (match-string 2 ivy-text))
-             (rest (match-string 3 ivy-text))
-             res)
-         (require 'tramp)
-         (dolist (x (tramp-get-completion-function method))
-           (setq res (append res (funcall (car x) (cadr x)))))
-         (setq res (delq nil res))
-         (when user
-           (dolist (x res)
-             (setcar x user)))
-         (setq res (cl-delete-duplicates res :test #'equal))
-         (let* ((old-ivy-last ivy-last)
-                (enable-recursive-minibuffers t)
-                (host (ivy-read "user@host: "
-                                (mapcar #'ivy-build-tramp-name res)
-                                :initial-input rest)))
-           (setq ivy-last old-ivy-last)
-           (when host
-             (setq ivy--directory "/")
-             (ivy--cd (concat "/" method ":" host ":"))))))
-      (t
-       (ivy-done)))))
-
-(defun ivy-expand-file-if-directory (file-name)
-  "Expand FILE-NAME as directory.
-When this directory doesn't exist, return nil."
-  (when (stringp file-name)
-    (let ((full-name
-           ;; Ignore host name must not match method "ssh"
-           (ignore-errors
-             (file-name-as-directory
-              (expand-file-name file-name ivy--directory)))))
-      (when (and full-name (file-directory-p full-name))
-        full-name))))
-
-(defcustom ivy-tab-space nil
-  "When non-nil, `ivy-partial-or-done' should insert a space."
-  :type 'boolean)
-
-(defun ivy-partial-or-done ()
-  "Complete the minibuffer text as much as possible.
-If the text hasn't changed as a result, forward to `ivy-alt-done'."
-  (interactive)
-  (if (and (eq (ivy-state-collection ivy-last) #'read-file-name-internal)
-           (or (and (equal ivy--directory "/")
-                    (string-match "\\`[^/]+:.*\\'" ivy-text))
-               (string-match "\\`/" ivy-text)))
-      (let ((default-directory ivy--directory)
-            dir)
-        (minibuffer-complete)
-        (setq ivy-text (ivy--input))
-        (when (setq dir (ivy-expand-file-if-directory ivy-text))
-          (ivy--cd dir)))
-    (or (ivy-partial)
-        (when (or (eq this-command last-command)
-                  (eq ivy--length 1))
-          (ivy-alt-done)))))
-
-(defun ivy-partial ()
-  "Complete the minibuffer text as much as possible."
-  (interactive)
-  (let* ((parts (or (split-string ivy-text " " t) (list "")))
-         (postfix (car (last parts)))
-         (case-fold-search (and ivy-case-fold-search
-                                (or (eq ivy-case-fold-search 'always)
-                                    (string= ivy-text (downcase ivy-text)))))
-         (completion-ignore-case case-fold-search)
-         (startp (string-match "^\\^" postfix))
-         (new (try-completion (if startp
-                                  (substring postfix 1)
-                                postfix)
-                              (if (ivy-state-dynamic-collection ivy-last)
-                                  ivy--all-candidates
-                                (mapcar (lambda (str)
-                                          (let ((i (string-match postfix str)))
-                                            (when i
-                                              (substring str i))))
-                                        ivy--old-cands)))))
-    (cond ((eq new t) nil)
-          ((string= new ivy-text) nil)
-          (new
-           (delete-region (minibuffer-prompt-end) (point-max))
-           (setcar (last parts)
-                   (if startp
-                       (concat "^" new)
-                     new))
-           (insert (mapconcat #'identity parts " ")
-                   (if ivy-tab-space " " ""))
-           t))))
-
-(defvar ivy-completion-beg nil
-  "Completion bounds start.")
-
-(defvar ivy-completion-end nil
-  "Completion bounds end.")
-
-(defun ivy-immediate-done ()
-  "Exit the minibuffer with current input instead of current candidate."
-  (interactive)
-  (delete-minibuffer-contents)
-  (insert (setf (ivy-state-current ivy-last)
-                (if (and ivy--directory
-                         (not (eq (ivy-state-history ivy-last)
-                                  'grep-files-history)))
-                    (expand-file-name ivy-text ivy--directory)
-                  ivy-text)))
-  (setq ivy-completion-beg ivy-completion-end)
-  (setq ivy-exit 'done)
-  (exit-minibuffer))
-
-;;;###autoload
-(defun ivy-resume ()
-  "Resume the last completion session."
-  (interactive)
-  (if (null (ivy-state-action ivy-last))
-      (user-error "The last session isn't compatible with `ivy-resume'")
-    (when (eq (ivy-state-caller ivy-last) 'swiper)
-      (switch-to-buffer (ivy-state-buffer ivy-last)))
-    (with-current-buffer (ivy-state-buffer ivy-last)
-      (let ((default-directory (ivy-state-directory ivy-last)))
-        (ivy-read
-         (ivy-state-prompt ivy-last)
-         (ivy-state-collection ivy-last)
-         :predicate (ivy-state-predicate ivy-last)
-         :require-match (ivy-state-require-match ivy-last)
-         :initial-input ivy-text
-         :history (ivy-state-history ivy-last)
-         :preselect (unless (eq (ivy-state-collection ivy-last)
-                                'read-file-name-internal)
-                      (ivy-state-current ivy-last))
-         :keymap (ivy-state-keymap ivy-last)
-         :update-fn (ivy-state-update-fn ivy-last)
-         :sort (ivy-state-sort ivy-last)
-         :action (ivy-state-action ivy-last)
-         :unwind (ivy-state-unwind ivy-last)
-         :re-builder (ivy-state-re-builder ivy-last)
-         :matcher (ivy-state-matcher ivy-last)
-         :dynamic-collection (ivy-state-dynamic-collection ivy-last)
-         :caller (ivy-state-caller ivy-last))))))
-
-(defvar-local ivy-calling nil
-  "When non-nil, call the current action when `ivy--index' changes.")
-
-(defun ivy-set-index (index)
-  "Set `ivy--index' to INDEX."
-  (setq ivy--index index)
-  (when ivy-calling
-    (ivy--exhibit)
-    (ivy-call)))
-
-(defun ivy-beginning-of-buffer ()
-  "Select the first completion candidate."
-  (interactive)
-  (ivy-set-index 0))
-
-(defun ivy-end-of-buffer ()
-  "Select the last completion candidate."
-  (interactive)
-  (ivy-set-index (1- ivy--length)))
-
-(defun ivy-scroll-up-command ()
-  "Scroll the candidates upward by the minibuffer height."
-  (interactive)
-  (ivy-set-index (min (1- (+ ivy--index ivy-height))
-                      (1- ivy--length))))
-
-(defun ivy-scroll-down-command ()
-  "Scroll the candidates downward by the minibuffer height."
-  (interactive)
-  (ivy-set-index (max (1+ (- ivy--index ivy-height))
-                      0)))
-
-(defun ivy-minibuffer-grow ()
-  "Grow the minibuffer window by 1 line."
-  (interactive)
-  (setq-local max-mini-window-height
-              (cl-incf ivy-height)))
-
-(defun ivy-minibuffer-shrink ()
-  "Shrink the minibuffer window by 1 line."
-  (interactive)
-  (unless (<= ivy-height 2)
-    (setq-local max-mini-window-height
-                (cl-decf ivy-height))
-    (window-resize (selected-window) -1)))
-
-(defun ivy-next-line (&optional arg)
-  "Move cursor vertically down ARG candidates."
-  (interactive "p")
-  (setq arg (or arg 1))
-  (let ((index (+ ivy--index arg)))
-    (if (> index (1- ivy--length))
-        (if ivy-wrap
-            (ivy-beginning-of-buffer)
-          (ivy-set-index (1- ivy--length)))
-      (ivy-set-index index))))
-
-(defun ivy-next-line-or-history (&optional arg)
-  "Move cursor vertically down ARG candidates.
-If the input is empty, select the previous history element instead."
-  (interactive "p")
-  (if (string= ivy-text "")
-      (ivy-previous-history-element 1)
-    (ivy-next-line arg)))
-
-(defun ivy-previous-line (&optional arg)
-  "Move cursor vertically up ARG candidates."
-  (interactive "p")
-  (setq arg (or arg 1))
-  (let ((index (- ivy--index arg))
-        (min-index (or (and (ivy--prompt-selectable-p) -1)
-                       0)))
-    (if (< index min-index)
-        (if ivy-wrap
-            (ivy-end-of-buffer)
-          (ivy-set-index min-index))
-      (ivy-set-index index))))
-
-(defun ivy-previous-line-or-history (arg)
-  "Move cursor vertically up ARG candidates.
-If the input is empty, select the previous history element instead."
-  (interactive "p")
-  (when (and (zerop ivy--index) (string= ivy-text ""))
-    (ivy-previous-history-element 1))
-  (ivy-previous-line arg))
-
-(defun ivy-toggle-calling ()
-  "Flip `ivy-calling'."
-  (interactive)
-  (when (setq ivy-calling (not ivy-calling))
-    (ivy-call)))
-
-(defun ivy-toggle-ignore ()
-  "Toggle user-configured candidate filtering."
-  (interactive)
-  (setq ivy-use-ignore
-        (if ivy-use-ignore
-            nil
-          (or ivy-use-ignore-default t)))
-  ;; invalidate cache
-  (setq ivy--old-cands nil))
-
-(defun ivy--get-action (state)
-  "Get the action function from STATE."
-  (let ((action (ivy-state-action state)))
-    (when action
-      (if (functionp action)
-          action
-        (cadr (nth (car action) action))))))
-
-(defun ivy--get-window (state)
-  "Get the window from STATE."
-  (if (ivy-state-p state)
-      (let ((window (ivy-state-window state)))
-        (if (window-live-p window)
-            window
-          (if (= (length (window-list)) 1)
-              (selected-window)
-            (next-window))))
-    (selected-window)))
-
-(defun ivy--actionp (x)
-  "Return non-nil when X is a list of actions."
-  (and x (listp x) (not (memq (car x) '(closure lambda)))))
-
-(defcustom ivy-action-wrap nil
-  "When non-nil, `ivy-next-action' and `ivy-prev-action' wrap."
-  :type 'boolean)
-
-(defun ivy-next-action ()
-  "When the current action is a list, scroll it forwards."
-  (interactive)
-  (let ((action (ivy-state-action ivy-last)))
-    (when (ivy--actionp action)
-      (let ((len (1- (length action)))
-            (idx (car action)))
-        (if (>= idx len)
-            (when ivy-action-wrap
-              (setf (car action) 1))
-          (cl-incf (car action)))))))
-
-(defun ivy-prev-action ()
-  "When the current action is a list, scroll it backwards."
-  (interactive)
-  (let ((action (ivy-state-action ivy-last)))
-    (when (ivy--actionp action)
-      (if (<= (car action) 1)
-          (when ivy-action-wrap
-            (setf (car action) (1- (length action))))
-        (cl-decf (car action))))))
-
-(defun ivy-action-name ()
-  "Return the name associated with the current action."
-  (let ((action (ivy-state-action ivy-last)))
-    (if (ivy--actionp action)
-        (format "[%d/%d] %s"
-                (car action)
-                (1- (length action))
-                (nth 2 (nth (car action) action)))
-      "[1/1] default")))
-
-(defvar ivy-inhibit-action nil
-  "When non-nil, `ivy-call' does nothing.
-
-Example use:
-
-    (let* ((ivy-inhibit-action t)
-          (str (counsel-locate \"lispy.el\")))
-     ;; do whatever with str - the corresponding file will not be opened
-     )")
-
-(defun ivy-recursive-restore ()
-  "Restore the above state when exiting the minibuffer.
-See variable `ivy-recursive-restore' for further information."
-  (when (and ivy-recursive-last
-             ivy-recursive-restore
-             (not (eq ivy-last ivy-recursive-last)))
-    (ivy--reset-state (setq ivy-last ivy-recursive-last))))
-
-(defun ivy-call ()
-  "Call the current action without exiting completion."
-  (interactive)
-  (unless
-      (or
-       ;; this is needed for testing in ivy-with which seems to call ivy-call
-       ;; again, and this-command is nil in that case.
-       (null this-command)
-       (memq this-command '(ivy-done
-                            ivy-alt-done
-                            ivy-dispatching-done)))
-    (setq ivy-current-prefix-arg current-prefix-arg))
-  (unless ivy-inhibit-action
-    (let ((action (ivy--get-action ivy-last)))
-      (when action
-        (let* ((collection (ivy-state-collection ivy-last))
-               (x (cond
-                    ;; Alist type.
-                    ((and (consp collection)
-                          (consp (car collection))
-                          ;; Previously, the cdr of the selected
-                          ;; candidate would be returned.  Now, the
-                          ;; whole candidate is returned.
-                          (let (idx)
-                            (if (setq idx (get-text-property
-                                           0 'idx (ivy-state-current ivy-last)))
-                                (nth idx collection)
-                              (assoc (ivy-state-current ivy-last)
-                                     collection)))))
-                    (ivy--directory
-                     (expand-file-name
-                      (ivy-state-current ivy-last)
-                      ivy--directory))
-                    ((equal (ivy-state-current ivy-last) "")
-                     ivy-text)
-                    (t
-                     (ivy-state-current ivy-last)))))
-          (if (eq action 'identity)
-              (funcall action x)
-            (select-window (ivy--get-window ivy-last))
-            (prog1 (with-current-buffer (ivy-state-buffer ivy-last)
-                     (unwind-protect (funcall action x)
-                       (ivy-recursive-restore)))
-              (unless (or (eq ivy-exit 'done)
-                          (equal (selected-window)
-                                 (active-minibuffer-window))
-                          (null (active-minibuffer-window)))
-                (select-window (active-minibuffer-window))))))))))
-
-(defun ivy-call-and-recenter ()
-  "Call action and recenter window according to the selected candidate."
-  (interactive)
-  (ivy-call)
-  (with-ivy-window
-    (recenter-top-bottom)))
-
-(defun ivy-next-line-and-call (&optional arg)
-  "Move cursor vertically down ARG candidates.
-Call the permanent action if possible."
-  (interactive "p")
-  (ivy-next-line arg)
-  (ivy--exhibit)
-  (ivy-call))
-
-(defun ivy-previous-line-and-call (&optional arg)
-  "Move cursor vertically down ARG candidates.
-Call the permanent action if possible."
-  (interactive "p")
-  (ivy-previous-line arg)
-  (ivy--exhibit)
-  (ivy-call))
-
-(defun ivy-previous-history-element (arg)
-  "Forward to `previous-history-element' with ARG."
-  (interactive "p")
-  (previous-history-element arg)
-  (ivy--cd-maybe)
-  (move-end-of-line 1)
-  (ivy--maybe-scroll-history))
-
-(defun ivy-next-history-element (arg)
-  "Forward to `next-history-element' with ARG."
-  (interactive "p")
-  (if (and (= minibuffer-history-position 0)
-           (equal ivy-text ""))
-      (progn
-        (insert ivy--default)
-        (when (and (with-ivy-window (derived-mode-p 'prog-mode))
-                   (eq (ivy-state-caller ivy-last) 'swiper)
-                   (not (file-exists-p ivy--default))
-                   (not (ffap-url-p ivy--default))
-                   (not (ivy-state-dynamic-collection ivy-last))
-                   (> (point) (minibuffer-prompt-end)))
-          (undo-boundary)
-          (insert "\\_>")
-          (goto-char (minibuffer-prompt-end))
-          (insert "\\_<")
-          (forward-char (+ 2 (length ivy--default)))))
-    (next-history-element arg))
-  (ivy--cd-maybe)
-  (move-end-of-line 1)
-  (ivy--maybe-scroll-history))
-
-(defvar ivy-ffap-url-functions nil
-  "List of functions that check if the point is on a URL.")
-
-(defun ivy--cd-maybe ()
-  "Check if the current input points to a different directory.
-If so, move to that directory, while keeping only the file name."
-  (when ivy--directory
-    (let ((input (ivy--input))
-          url)
-      (if (setq url (or (ffap-url-p input)
-                        (with-ivy-window
-                          (cl-reduce
-                           (lambda (a b)
-                             (or a (funcall b)))
-                           ivy-ffap-url-functions
-                           :initial-value nil))))
-          (ivy-exit-with-action
-           (lambda (_)
-             (funcall ffap-url-fetcher url)))
-        (setq input (expand-file-name input))
-        (let ((file (file-name-nondirectory input))
-              (dir (expand-file-name (file-name-directory input))))
-          (if (string= dir ivy--directory)
-              (progn
-                (delete-minibuffer-contents)
-                (insert file))
-            (ivy--cd dir)
-            (insert file)))))))
-
-(defun ivy--maybe-scroll-history ()
-  "If the selected history element has an index, scroll there."
-  (let ((idx (ignore-errors
-               (get-text-property
-                (minibuffer-prompt-end)
-                'ivy-index))))
-    (when idx
-      (ivy--exhibit)
-      (ivy-set-index idx))))
-
-(defun ivy--cd (dir)
-  "When completing file names, move to directory DIR."
-  (if (null ivy--directory)
-      (error "Unexpected")
-    (setq ivy--old-cands nil)
-    (setq ivy--old-re nil)
-    (ivy-set-index 0)
-    (setq ivy--all-candidates
-          (ivy--sorted-files (setq ivy--directory dir)))
-    (setq ivy-text "")
-    (delete-minibuffer-contents)))
-
-(defun ivy-backward-delete-char ()
-  "Forward to `backward-delete-char'.
-On error (read-only), call `ivy-on-del-error-function'."
-  (interactive)
-  (if (and ivy--directory (= (minibuffer-prompt-end) (point)))
-      (progn
-        (ivy--cd (file-name-directory
-                  (directory-file-name
-                   (expand-file-name
-                    ivy--directory))))
-        (ivy--exhibit))
-    (condition-case nil
-        (backward-delete-char 1)
-      (error
-       (when ivy-on-del-error-function
-         (funcall ivy-on-del-error-function))))))
-
-(defun ivy-delete-char (arg)
-  "Forward to `delete-char' ARG."
-  (interactive "p")
-  (unless (= (point) (line-end-position))
-    (delete-char arg)))
-
-(defun ivy-forward-char (arg)
-  "Forward to `forward-char' ARG."
-  (interactive "p")
-  (unless (= (point) (line-end-position))
-    (forward-char arg)))
-
-(defun ivy-kill-word (arg)
-  "Forward to `kill-word' ARG."
-  (interactive "p")
-  (unless (= (point) (line-end-position))
-    (kill-word arg)))
-
-(defun ivy-kill-line ()
-  "Forward to `kill-line'."
-  (interactive)
-  (if (eolp)
-      (kill-region (minibuffer-prompt-end) (point))
-    (kill-line)))
-
-(defun ivy-backward-kill-word ()
-  "Forward to `backward-kill-word'."
-  (interactive)
-  (if (and ivy--directory (= (minibuffer-prompt-end) (point)))
-      (progn
-        (ivy--cd (file-name-directory
-                  (directory-file-name
-                   (expand-file-name
-                    ivy--directory))))
-        (ivy--exhibit))
-    (ignore-errors
-      (let ((pt (point)))
-        (forward-word -1)
-        (delete-region (point) pt)))))
-
-(defvar ivy--regexp-quote 'regexp-quote
-  "Store the regexp quoting state.")
-
-(defun ivy-toggle-regexp-quote ()
-  "Toggle the regexp quoting."
-  (interactive)
-  (setq ivy--old-re nil)
-  (cl-rotatef ivy--regex-function ivy--regexp-quote))
-
-(defvar avy-all-windows)
-(defvar avy-action)
-(defvar avy-keys)
-(defvar avy-keys-alist)
-(defvar avy-style)
-(defvar avy-styles-alist)
-(declare-function avy--process "ext:avy")
-(declare-function avy--style-fn "ext:avy")
-
-(defcustom ivy-format-function 'ivy-format-function-default
-  "Function to transform the list of candidates into a string.
-This string is inserted into the minibuffer."
-  :type '(choice
-          (const :tag "Default" ivy-format-function-default)
-          (const :tag "Arrow prefix" ivy-format-function-arrow)
-          (const :tag "Full line" ivy-format-function-line)))
-
-(eval-after-load 'avy
-  '(add-to-list 'avy-styles-alist '(ivy-avy . pre)))
-
-(defun ivy-avy ()
-  "Jump to one of the current ivy candidates."
-  (interactive)
-  (unless (require 'avy nil 'noerror)
-    (error "Package avy isn't installed"))
-  (let* ((avy-all-windows nil)
-         (avy-keys (or (cdr (assq 'ivy-avy avy-keys-alist))
-                       avy-keys))
-         (avy-style (or (cdr (assq 'ivy-avy
-                                   avy-styles-alist))
-                        avy-style))
-         (candidate
-          (let ((candidates))
-            (save-excursion
-              (save-restriction
-                (narrow-to-region
-                 (window-start)
-                 (window-end))
-                (goto-char (point-min))
-                (forward-line)
-                (while (< (point) (point-max))
-                  (push
-                   (cons (point)
-                         (selected-window))
-                   candidates)
-                  (forward-line))))
-            (setq avy-action #'identity)
-            (avy--process
-             (nreverse candidates)
-             (avy--style-fn avy-style)))))
-    (when (number-or-marker-p candidate)
-      (goto-char candidate)
-      (when (eq ivy-format-function 'ivy-format-function-arrow)
-        (forward-char 2))
-      (ivy--done
-       (buffer-substring-no-properties
-        (point) (line-end-position))))))
-
-(defun ivy-sort-file-function-default (x y)
-  "Compare two files X and Y.
-Prioritize directories."
-  (if (get-text-property 0 'dirp x)
-      (if (get-text-property 0 'dirp y)
-          (string< x y)
-        t)
-    (if (get-text-property 0 'dirp y)
-        nil
-      (string< x y))))
-
-(declare-function ido-file-extension-lessp "ido")
-
-(defun ivy-sort-file-function-using-ido (x y)
-  "Compare two files X and Y using `ido-file-extensions-order'.
-
-This function is suitable as a replacement for
-`ivy-sort-file-function-default' in `ivy-sort-functions-alist'."
-  (if (and (bound-and-true-p ido-file-extensions-order))
-      (ido-file-extension-lessp x y)
-    (ivy-sort-file-function-default x y)))
-
-(defcustom ivy-sort-functions-alist
-  '((read-file-name-internal . ivy-sort-file-function-default)
-    (internal-complete-buffer . nil)
-    (counsel-git-grep-function . nil)
-    (Man-goto-section . nil)
-    (org-refile . nil)
-    (t . string-lessp))
-  "An alist of sorting functions for each collection function.
-Interactive functions that call completion fit in here as well.
-
-Nil means no sorting, which is useful to turn off the sorting for
-functions that have candidates in the natural buffer order, like
-`org-refile' or `Man-goto-section'.
-
-A list can be used to associate multiple sorting functions with a
-collection.  The car of the list is the current sort
-function.  This list can be rotated with `ivy-rotate-sort'.
-
-The entry associated with t is used for all fall-through cases.
-
-See also `ivy-sort-max-size'."
-  :type
-  '(alist
-    :key-type (choice
-               (const :tag "Fall-through" t)
-               (symbol :tag "Collection"))
-    :value-type (choice
-                 (const :tag "Plain sort" string-lessp)
-                 (const :tag "File sort" ivy-sort-file-function-default)
-                 (const :tag "No sort" nil)
-                 (function :tag "Custom function")
-                 (repeat (function :tag "Custom function"))))
-  :group 'ivy)
-
-(defun ivy--sort-function (collection)
-  "Retrieve sort function for COLLECTION from `ivy-sort-functions-alist'."
-  (cdr (assoc collection ivy-sort-functions-alist)))
-
-(defun ivy-rotate-sort ()
-  "Rotate through sorting functions available for current collection.
-This only has an effect if multiple sorting functions are
-specified for the current collection in
-`ivy-sort-functions-alist'."
-  (interactive)
-  (let ((cell (assoc (ivy-state-collection ivy-last) ivy-sort-functions-alist)))
-    (when (consp (cdr cell))
-      (setcdr cell `(,@(cddr cell) ,(cadr cell)))
-      (ivy--reset-state ivy-last))))
-
-(defvar ivy-index-functions-alist
-  '((swiper . ivy-recompute-index-swiper)
-    (swiper-multi . ivy-recompute-index-swiper)
-    (counsel-git-grep . ivy-recompute-index-swiper)
-    (counsel-grep . ivy-recompute-index-swiper-async)
-    (t . ivy-recompute-index-zero))
-  "An alist of index recomputing functions for each collection function.
-When the input changes, the appropriate function returns an
-integer - the index of the matched candidate that should be
-selected.")
-
-(defvar ivy-re-builders-alist
-  '((t . ivy--regex-plus))
-  "An alist of regex building functions for each collection function.
-
-Each key is (in order of priority):
-1. The actual collection function, e.g. `read-file-name-internal'.
-2. The symbol passed by :caller into `ivy-read'.
-3. `this-command'.
-4. t.
-
-Each value is a function that should take a string and return a
-valid regex or a regex sequence (see below).
-
-Possible choices: `ivy--regex', `regexp-quote',
-`ivy--regex-plus', `ivy--regex-fuzzy'.
-
-If a function returns a list, it should format like this:
-'((\"matching-regexp\" . t) (\"non-matching-regexp\") ...).
-
-The matches will be filtered in a sequence, you can mix the
-regexps that should match and that should not match as you
-like.")
-
-(defvar ivy-highlight-functions-alist
-  '((ivy--regex-ignore-order . ivy--highlight-ignore-order)
-    (ivy--regex-fuzzy . ivy--highlight-fuzzy)
-    (ivy--regex-plus . ivy--highlight-default))
-  "An alist of highlighting functions for each regex buidler function.")
-
-(defvar ivy-initial-inputs-alist
-  '((org-refile . "^")
-    (org-agenda-refile . "^")
-    (org-capture-refile . "^")
-    (counsel-M-x . "^")
-    (counsel-describe-function . "^")
-    (counsel-describe-variable . "^")
-    (man . "^")
-    (woman . "^"))
-  "Command to initial input table.")
-
-(defcustom ivy-sort-max-size 30000
-  "Sorting won't be done for collections larger than this."
-  :type 'integer)
-
-(defun ivy--sorted-files (dir)
-  "Return the list of files in DIR.
-Directories come first."
-  (let* ((default-directory dir)
-         (predicate (ivy-state-predicate ivy-last))
-         (seq (condition-case nil
-                  (all-completions "" 'read-file-name-internal)
-                (error
-                 (directory-files dir))))
-         sort-fn)
-    (if (equal dir "/")
-        seq
-      (setq seq (delete "./" (delete "../" seq)))
-      (when (eq (setq sort-fn (ivy--sort-function 'read-file-name-internal))
-                #'ivy-sort-file-function-default)
-        (setq seq (mapcar (lambda (x)
-                            (propertize x 'dirp (string-match-p "/\\'" x)))
-                          seq)))
-      (when sort-fn
-        (setq seq (cl-sort seq sort-fn)))
-      (dolist (dir ivy-extra-directories)
-        (push dir seq))
-      (if predicate
-          (cl-remove-if-not predicate seq)
-        seq))))
-
-(defvar ivy-auto-select-single-candidate nil
-  "When non-nil, auto-select the candidate if it is the only one.
-When t, it is the same as if the user were prompted and selected the candidate
-by calling the default action.  This variable has no use unless the collection
-contains a single candidate.")
-
-;;** Entry Point
-;;;###autoload
-(cl-defun ivy-read (prompt collection
-                    &key
-                      predicate require-match initial-input
-                      history preselect def keymap update-fn sort
-                      action unwind re-builder matcher
-                      dynamic-collection caller)
-  "Read a string in the minibuffer, with completion.
-
-PROMPT is a format string, normally ending in a colon and a
-space; %d anywhere in the string is replaced by the current
-number of matching candidates.  For the literal % character,
-escape it with %%. See also `ivy-count-format'.
-
-COLLECTION is either a list of strings, a function, an alist, or
-a hash table.
-
-PREDICATE is applied to filter out the COLLECTION immediately.
-This argument is for `completing-read' compat.
-
-When REQUIRE-MATCH is non-nil, only members of COLLECTION can be
-selected, i.e. custom text.
-
-If INITIAL-INPUT is not nil, then insert that input in the
-minibuffer initially.
-
-HISTORY is a name of a variable to hold the completion session
-history.
-
-KEYMAP is composed with `ivy-minibuffer-map'.
-
-If PRESELECT is not nil, then select the corresponding candidate
-out of the ones that match the INITIAL-INPUT.
-
-DEF is for compatibility with `completing-read'.
-
-UPDATE-FN is called each time the current candidate(s) is changed.
-
-When SORT is t, use `ivy-sort-functions-alist' for sorting.
-
-ACTION is a lambda function to call after selecting a result.  It
-takes a single string argument.
-
-UNWIND is a lambda function to call before exiting.
-
-RE-BUILDER is a lambda function to call to transform text into a
-regex pattern.
-
-MATCHER is to override matching.
-
-DYNAMIC-COLLECTION is a boolean to specify if the list of
-candidates is updated after each input by calling COLLECTION.
-
-CALLER is a symbol to uniquely identify the caller to `ivy-read'.
-It is used, along with COLLECTION, to determine which
-customizations apply to the current completion session."
-  (let ((extra-actions (delete-dups
-                        (append (plist-get ivy--actions-list t)
-                                (plist-get ivy--actions-list this-command)
-                                (plist-get ivy--actions-list caller)))))
-    (when extra-actions
-      (setq action
-            (cond ((functionp action)
-                   `(1
-                     ("o" ,action "default")
-                     ,@extra-actions))
-                  ((null action)
-                   `(1
-                     ("o" identity "default")
-                     ,@extra-actions))
-                  (t
-                   (delete-dups (append action extra-actions)))))))
-  (let ((extra-sources (plist-get ivy--sources-list caller)))
-    (if extra-sources
-        (progn
-          (setq ivy--extra-candidates nil)
-          (dolist (source extra-sources)
-            (cond ((equal source '(original-source))
-                   (setq ivy--extra-candidates
-                         (cons source ivy--extra-candidates)))
-                  ((null (cdr source))
-                   (setq ivy--extra-candidates
-                         (cons
-                          (list (car source) (funcall (car source)))
-                          ivy--extra-candidates))))))
-      (setq ivy--extra-candidates '((original-source)))))
-  (let ((ivy-recursive-last (and (active-minibuffer-window) ivy-last))
-        (transformer-fn
-         (plist-get ivy--display-transformers-list
-                    (or caller (and (functionp collection)
-                                    collection))))
-        (ivy-display-function
-         (unless (window-minibuffer-p)
-           (cdr (assoc caller ivy-display-functions-alist)))))
-    (setq ivy-last
-          (make-ivy-state
-           :prompt prompt
-           :collection collection
-           :predicate predicate
-           :require-match require-match
-           :initial-input initial-input
-           :history history
-           :preselect preselect
-           :keymap keymap
-           :update-fn update-fn
-           :sort sort
-           :action action
-           :frame (selected-frame)
-           :window (selected-window)
-           :buffer (current-buffer)
-           :unwind unwind
-           :re-builder re-builder
-           :matcher matcher
-           :dynamic-collection dynamic-collection
-           :display-transformer-fn transformer-fn
-           :directory default-directory
-           :caller caller
-           :def def))
-    (ivy--reset-state ivy-last)
-    (prog1
-        (unwind-protect
-             (minibuffer-with-setup-hook
-                 #'ivy--minibuffer-setup
-               (let* ((hist (or history 'ivy-history))
-                      (minibuffer-completion-table collection)
-                      (minibuffer-completion-predicate predicate)
-                      (resize-mini-windows
-                       (cond
-                         ((display-graphic-p) nil)
-                         ((null resize-mini-windows) 'grow-only)
-                         (t resize-mini-windows))))
-                 (if (and ivy-auto-select-single-candidate
-                          (= (length ivy--all-candidates) 1))
-                     (progn
-                       (setf (ivy-state-current ivy-last)
-                             (car ivy--all-candidates))
-                       (setq ivy-exit 'done))
-                   (read-from-minibuffer
-                    prompt
-                    (ivy-state-initial-input ivy-last)
-                    (make-composed-keymap keymap ivy-minibuffer-map)
-                    nil
-                    hist))
-                 (when (eq ivy-exit 'done)
-                   (let ((item (if ivy--directory
-                                   (ivy-state-current ivy-last)
-                                 ivy-text)))
-                     (unless (equal item "")
-                       (set hist (cons (propertize item 'ivy-index ivy--index)
-                                       (delete item
-                                               (cdr (symbol-value hist))))))))
-                 (ivy-state-current ivy-last)))
-          (remove-hook 'post-command-hook #'ivy--exhibit)
-          (ivy-overlay-cleanup)
-          (when (setq unwind (ivy-state-unwind ivy-last))
-            (funcall unwind))
-          (unless (eq ivy-exit 'done)
-            (ivy-recursive-restore)))
-      (ivy-call)
-      (when (> (length (ivy-state-current ivy-last)) 0)
-        (remove-text-properties 0 1 '(idx) (ivy-state-current ivy-last))))))
-
-(defun ivy--reset-state (state)
-  "Reset the ivy to STATE.
-This is useful for recursive `ivy-read'."
-  (unless (equal (selected-frame) (ivy-state-frame state))
-    (select-window (active-minibuffer-window)))
-  (let ((prompt (or (ivy-state-prompt state) ""))
-        (collection (ivy-state-collection state))
-        (predicate (ivy-state-predicate state))
-        (history (ivy-state-history state))
-        (preselect (ivy-state-preselect state))
-        (sort (ivy-state-sort state))
-        (re-builder (ivy-state-re-builder state))
-        (dynamic-collection (ivy-state-dynamic-collection state))
-        (initial-input (ivy-state-initial-input state))
-        (require-match (ivy-state-require-match state))
-        (caller (ivy-state-caller state))
-        (def (ivy-state-def state)))
-    (unless initial-input
-      (setq initial-input (cdr (assoc (or caller this-command)
-                                      ivy-initial-inputs-alist))))
-    (setq ivy--directory nil)
-    (setq ivy-case-fold-search ivy-case-fold-search-default)
-    (setq ivy--regex-function
-          (or re-builder
-              (and (functionp collection)
-                   (cdr (assoc collection ivy-re-builders-alist)))
-              (and caller
-                   (cdr (assoc caller ivy-re-builders-alist)))
-              (cdr (assoc this-command ivy-re-builders-alist))
-              (cdr (assoc t ivy-re-builders-alist))
-              'ivy--regex))
-    (setq ivy--subexps 0)
-    (setq ivy--regexp-quote 'regexp-quote)
-    (setq ivy--old-text "")
-    (setq ivy--full-length nil)
-    (setq ivy-text "")
-    (setq ivy--index 0)
-    (setq ivy-calling nil)
-    (setq ivy-use-ignore ivy-use-ignore-default)
-    (setq ivy--highlight-function
-          (or (cdr (assoc ivy--regex-function ivy-highlight-functions-alist))
-              #'ivy--highlight-default))
-    (let (coll sort-fn)
-      (cond ((eq collection 'Info-read-node-name-1)
-             (if (equal Info-current-file "dir")
-                 (setq coll
-                       (mapcar (lambda (x) (format "(%s)" x))
-                               (cl-delete-duplicates
-                                (all-completions "(" collection predicate)
-                                :test #'equal)))
-               (setq coll (all-completions "" collection predicate))))
-            ((eq collection 'read-file-name-internal)
-             (setq ivy--directory default-directory)
-             (when (and initial-input
-                        (not (equal initial-input "")))
-               (cond ((file-directory-p initial-input)
-                      (when (equal (file-name-nondirectory initial-input) "")
-                        (setf (ivy-state-preselect state) (setq preselect nil))
-                        (setf (ivy-state-def state) (setq def nil)))
-                      (setq ivy--directory initial-input)
-                      (setq initial-input nil)
-                      (when preselect
-                        (let ((preselect-directory
-                               (file-name-directory preselect)))
-                          (when (and preselect-directory
-                                     (not (equal
-                                           (expand-file-name
-                                            preselect-directory)
-                                           (expand-file-name ivy--directory))))
-                            (setf (ivy-state-preselect state)
-                                  (setq preselect nil))))))
-                     ((ignore-errors
-                        (file-exists-p (file-name-directory initial-input)))
-                      (setq ivy--directory (file-name-directory initial-input))
-                      (setf (ivy-state-preselect state)
-                            (file-name-nondirectory initial-input)))))
-             (require 'dired)
-             (when preselect
-               (let ((preselect-directory (file-name-directory preselect)))
-                 (unless (or (null preselect-directory)
-                             (string= preselect-directory
-                                      default-directory))
-                   (setq ivy--directory preselect-directory))
-                 (setf
-                  (ivy-state-preselect state)
-                  (setq preselect (file-name-nondirectory preselect)))))
-             (setq coll (ivy--sorted-files ivy--directory))
-             (when initial-input
-               (unless (or require-match
-                           (equal initial-input default-directory)
-                           (equal initial-input ""))
-                 (setq coll (cons initial-input coll)))
-               (unless (and (ivy-state-action ivy-last)
-                            (not (equal (ivy--get-action ivy-last) 'identity)))
-                 (setq initial-input nil))))
-            ((eq collection 'internal-complete-buffer)
-             (setq coll (ivy--buffer-list "" ivy-use-virtual-buffers predicate)))
-            (dynamic-collection
-             (setq coll (funcall collection ivy-text)))
-            ((and (consp collection) (listp (car collection)))
-             (if (and sort (setq sort-fn (ivy--sort-function caller)))
-                 (progn
-                   (setq sort nil)
-                   (setq coll (mapcar #'car
-                                      (cl-sort
-                                       (copy-sequence collection)
-                                       sort-fn))))
-               (setq collection
-                     (setf (ivy-state-collection ivy-last)
-                           (cl-remove-if-not predicate collection)))
-               (setq coll (all-completions "" collection)))
-             (let ((i 0))
-               (ignore-errors
-                 ;; cm can be read-only
-                 (dolist (cm coll)
-                   (add-text-properties 0 1 `(idx ,i) cm)
-                   (cl-incf i)))))
-            ((or (functionp collection)
-                 (byte-code-function-p collection)
-                 (vectorp collection)
-                 (hash-table-p collection)
-                 (and (listp collection) (symbolp (car collection))))
-             (setq coll (all-completions "" collection predicate)))
-            (t
-             (setq coll collection)))
-      (when def
-        (cond ((listp def)
-               (setq coll (cl-union def coll :test 'equal)))
-              ((member def coll))
-              (t
-               (push def coll))))
-      (when sort
-        (if (and (functionp collection)
-                 (setq sort-fn (ivy--sort-function collection)))
-            (when (not (eq collection 'read-file-name-internal))
-              (setq coll (cl-sort coll sort-fn)))
-          (when (and (not (eq history 'org-refile-history))
-                     (<= (length coll) ivy-sort-max-size)
-                     (setq sort-fn (ivy--sort-function caller)))
-            (setq coll (cl-sort (copy-sequence coll) sort-fn)))))
-      (setq coll (ivy--set-candidates coll))
-      (setq ivy--old-re nil)
-      (setq ivy--old-cands nil)
-      (when (integerp preselect)
-        (setq ivy--old-re "")
-        (ivy-set-index preselect))
-      (when initial-input
-        ;; Needed for anchor to work
-        (setq ivy--old-cands coll)
-        (setq ivy--old-cands (ivy--filter initial-input coll)))
-      (setq ivy--all-candidates coll)
-      (unless (integerp preselect)
-        (ivy-set-index (or
-                        (and dynamic-collection
-                             ivy--index)
-                        (and preselect
-                             (ivy--preselect-index
-                              preselect
-                              (if initial-input
-                                  ivy--old-cands
-                                coll)))
-                        0))))
-    (setq ivy-exit nil)
-    (setq ivy--default
-          (if (region-active-p)
-              (buffer-substring
-               (region-beginning)
-               (region-end))
-            (ivy-thing-at-point)))
-    (setq ivy--prompt (ivy-add-prompt-count prompt))
-    (setf (ivy-state-initial-input ivy-last) initial-input)))
-
-(defun ivy-add-prompt-count (prompt)
-  "Add count information to PROMPT."
-  (cond ((string-match "%.*d" prompt)
-         prompt)
-        ((null ivy-count-format)
-         (error
-          "`ivy-count-format' can't be nil.  Set it to \"\" instead"))
-        ((string-match "%d.*%d" ivy-count-format)
-         (let ((w (length (number-to-string
-                           (length ivy--all-candidates))))
-               (s (copy-sequence ivy-count-format)))
-           (string-match "%d" s)
-           (match-end 0)
-           (string-match "%d" s (match-end 0))
-           (setq s (replace-match (format "%%-%dd" w) nil nil s))
-           (string-match "%d" s)
-           (concat (replace-match (format "%%%dd" w) nil nil s)
-                   prompt)))
-        ((string-match "%.*d" ivy-count-format)
-         (concat ivy-count-format prompt))
-        (ivy--directory
-         prompt)
-        (t
-         prompt)))
-
-;;;###autoload
-(defun ivy-completing-read (prompt collection
-                            &optional predicate require-match initial-input
-                              history def inherit-input-method)
-  "Read a string in the minibuffer, with completion.
-
-This interface conforms to `completing-read' and can be used for
-`completing-read-function'.
-
-PROMPT is a string that normally ends in a colon and a space.
-COLLECTION is either a list of strings, an alist, an obarray, or a hash table.
-PREDICATE limits completion to a subset of COLLECTION.
-REQUIRE-MATCH is a boolean value.  See `completing-read'.
-INITIAL-INPUT is a string inserted into the minibuffer initially.
-HISTORY is a list of previously selected inputs.
-DEF is the default value.
-INHERIT-INPUT-METHOD is currently ignored."
-  (let ((handler
-         (when (< ivy-completing-read-ignore-handlers-depth (minibuffer-depth))
-           (assoc this-command ivy-completing-read-handlers-alist))))
-    (if handler
-        (let ((completion-in-region-function #'completion--in-region)
-              (ivy-completing-read-ignore-handlers-depth (1+ (minibuffer-depth))))
-          (funcall (cdr handler)
-                   prompt collection
-                   predicate require-match
-                   initial-input history
-                   def inherit-input-method))
-      ;; See the doc of `completing-read'.
-      (when (consp history)
-        (when (numberp (cdr history))
-          (setq initial-input (nth (1- (cdr history))
-                                   (symbol-value (car history)))))
-        (setq history (car history)))
-      (ivy-read (replace-regexp-in-string "%" "%%" prompt)
-                collection
-                :predicate predicate
-                :require-match (and collection require-match)
-                :initial-input (cond ((consp initial-input)
-                                      (car initial-input))
-                                     ((and (stringp initial-input)
-                                           (not (eq collection 'read-file-name-internal))
-                                           (string-match "\\+" initial-input))
-                                      (replace-regexp-in-string
-                                       "\\+" "\\\\+" initial-input))
-                                     (t
-                                      initial-input))
-                :preselect (if (listp def) (car def) def)
-                :def (if (listp def) (car def) def)
-                :history history
-                :keymap nil
-                :sort t
-                :caller (cond ((called-interactively-p 'any)
-                               this-command)
-                              ((and collection (symbolp collection))
-                               collection))))))
-
-(defun ivy-completing-read-with-empty-string-def
-    (prompt collection
-            &optional predicate require-match initial-input
-            history def inherit-input-method)
-  "Same as `ivy-completing-read' but with different handling of DEF.
-
-Specifically, if DEF is nil, it is treated the same as if DEF was
-the empty string. This mimics the behavior of
-`completing-read-default'. This function can therefore be used in
-place of `ivy-completing-read' for commands that rely on this
-behavior."
-  (ivy-completing-read
-   prompt collection predicate require-match initial-input
-   history (or def "") inherit-input-method))
-
-(declare-function mc/all-fake-cursors "ext:multiple-cursors-core")
-
-(defun ivy-completion-in-region-action (str)
-  "Insert STR, erasing the previous one.
-The previous string is between `ivy-completion-beg' and `ivy-completion-end'."
-  (when (consp str)
-    (setq str (cdr str)))
-  (when (stringp str)
-    (let ((fake-cursors (and (featurep 'multiple-cursors)
-                             (mc/all-fake-cursors)))
-          (pt (point))
-          (beg ivy-completion-beg)
-          (end ivy-completion-end))
-      (when ivy-completion-beg
-        (delete-region
-         ivy-completion-beg
-         ivy-completion-end))
-      (setq ivy-completion-beg
-            (move-marker (make-marker) (point)))
-      (insert (substring-no-properties str))
-      (setq ivy-completion-end
-            (move-marker (make-marker) (point)))
-      (save-excursion
-        (dolist (cursor fake-cursors)
-          (goto-char (overlay-start cursor))
-          (delete-region (+ (point) (- beg pt))
-                         (+ (point) (- end pt)))
-          (insert (substring-no-properties str))
-          ;; manually move the fake cursor
-          (move-overlay cursor (point) (1+ (point)))
-          (move-marker (overlay-get cursor 'point) (point))
-          (move-marker (overlay-get cursor 'mark) (point)))))))
-
-(defun ivy-completion-common-length (str)
-  "Return the length of the first `completions-common-part' face in STR."
-  (let ((pos 0)
-        (len (length str))
-        face-sym)
-    (while (and (<= pos len)
-                (let ((prop (or (prog1 (get-text-property
-                                        pos 'face str)
-                                  (setq face-sym 'face))
-                                (prog1 (get-text-property
-                                        pos 'font-lock-face str)
-                                  (setq face-sym 'font-lock-face)))))
-                  (not (eq 'completions-common-part
-                           (if (listp prop) (car prop) prop)))))
-      (setq pos (1+ pos)))
-    (if (< pos len)
-        (or (next-single-property-change pos face-sym str) len)
-      0)))
-
-(defun ivy-completion-in-region (start end collection &optional predicate)
-  "An Ivy function suitable for `completion-in-region-function'.
-The function completes the text between START and END using COLLECTION.
-PREDICATE (a function called with no arguments) says when to exit.
-See `completion-in-region' for further information."
-  (let* ((enable-recursive-minibuffers t)
-         (str (buffer-substring-no-properties start end))
-         (completion-ignore-case case-fold-search)
-         (comps
-          (completion-all-completions str collection predicate (- end start)))
-         (ivy--prompts-list (if (window-minibuffer-p)
-                                ivy--prompts-list
-                              '(ivy-completion-in-region (lambda nil)))))
-    (if (null comps)
-        (message "No matches")
-      (let ((len (min (ivy-completion-common-length (car comps))
-                      (length str))))
-        (nconc comps nil)
-        (setq ivy-completion-beg (- end len))
-        (setq ivy-completion-end end)
-        (if (null (cdr comps))
-            (if (string= str (car comps))
-                (message "Sole match")
-              (unless (minibuffer-window-active-p (selected-window))
-                (setf (ivy-state-window ivy-last) (selected-window)))
-              (ivy-completion-in-region-action
-               (substring-no-properties
-                (car comps))))
-          (let* ((w (1+ (floor (log (length comps) 10))))
-                 (ivy-count-format (if (string= ivy-count-format "")
-                                       ivy-count-format
-                                     (format "%%-%dd " w)))
-                 (prompt (format "(%s): " str)))
-            (and
-             (ivy-read (if (string= ivy-count-format "")
-                           prompt
-                         (replace-regexp-in-string "%" "%%" prompt))
-                       ;; remove 'completions-first-difference face
-                       (mapcar #'substring-no-properties comps)
-                       :predicate predicate
-                       :action #'ivy-completion-in-region-action
-                       :caller 'ivy-completion-in-region)
-             t)))))))
-
-(defcustom ivy-do-completion-in-region t
-  "When non-nil `ivy-mode' will set `completion-in-region-function'."
-  :type 'boolean)
-
-;;;###autoload
-(define-minor-mode ivy-mode
-  "Toggle Ivy mode on or off.
-Turn Ivy mode on if ARG is positive, off otherwise.
-Turning on Ivy mode sets `completing-read-function' to
-`ivy-completing-read'.
-
-Global bindings:
-\\{ivy-mode-map}
-
-Minibuffer bindings:
-\\{ivy-minibuffer-map}"
-  :group 'ivy
-  :global t
-  :keymap ivy-mode-map
-  :lighter " ivy"
-  (if ivy-mode
-      (progn
-        (setq completing-read-function 'ivy-completing-read)
-        (when ivy-do-completion-in-region
-          (setq completion-in-region-function 'ivy-completion-in-region)))
-    (setq completing-read-function 'completing-read-default)
-    (setq completion-in-region-function 'completion--in-region)))
-
-(defun ivy--preselect-index (preselect candidates)
-  "Return the index of PRESELECT in CANDIDATES."
-  (cond ((integerp preselect)
-         preselect)
-        ((cl-position preselect candidates :test #'equal))
-        ((stringp preselect)
-         (let ((re preselect))
-           (cl-position-if
-            (lambda (x)
-              (string-match re x))
-            candidates)))))
-
-;;* Implementation
-;;** Regex
-(defun ivy-re-match (re-seq str)
-  "Return non-nil if RE-SEQ is matched by STR.
-
-RE-SEQ is a list of (RE . MATCH-P).
-
-RE is a regular expression.
-
-MATCH-P is t when RE should match STR and nil when RE should not
-match STR.
-
-Each element of RE-SEQ must match for the function to return true.
-
-This concept is used to generalize regular expressions for
-`ivy--regex-plus' and `ivy--regex-ignore-order'."
-  (let ((res t)
-        re)
-    (while (and res (setq re (pop re-seq)))
-      (setq res
-            (if (cdr re)
-                (string-match-p (car re) str)
-              (not (string-match-p (car re) str)))))
-    res))
-
-(defvar ivy--regex-hash
-  (make-hash-table :test #'equal)
-  "Store pre-computed regex.")
-
-(defun ivy--split (str)
-  "Split STR into a list by single spaces.
-The remaining spaces stick to their left.
-This allows to \"quote\" N spaces by inputting N+1 spaces."
-  (let ((len (length str))
-        start0
-        (start1 0)
-        res s
-        match-len)
-    (while (and (string-match " +" str start1)
-                (< start1 len))
-      (if (and (> (match-beginning 0) 2)
-               (string= "[^" (substring
-                              str
-                              (- (match-beginning 0) 2)
-                              (match-beginning 0))))
-          (progn
-            (setq start1 (match-end 0))
-            (setq start0 0))
-        (setq match-len (- (match-end 0) (match-beginning 0)))
-        (if (= match-len 1)
-            (progn
-              (when start0
-                (setq start1 start0)
-                (setq start0 nil))
-              (push (substring str start1 (match-beginning 0)) res)
-              (setq start1 (match-end 0)))
-          (setq str (replace-match
-                     (make-string (1- match-len) ?\ )
-                     nil nil str))
-          (setq start0 (or start0 start1))
-          (setq start1 (1- (match-end 0))))))
-    (if start0
-        (push (substring str start0) res)
-      (setq s (substring str start1))
-      (unless (= (length s) 0)
-        (push s res)))
-    (nreverse res)))
-
-(defun ivy--regex (str &optional greedy)
-  "Re-build regex pattern from STR in case it has a space.
-When GREEDY is non-nil, join words in a greedy way."
-  (let ((hashed (unless greedy
-                  (gethash str ivy--regex-hash))))
-    (if hashed
-        (prog1 (cdr hashed)
-          (setq ivy--subexps (car hashed)))
-      (when (string-match "\\([^\\]\\|^\\)\\\\$" str)
-        (setq str (substring str 0 -1)))
-      (cdr (puthash str
-                    (let ((subs (ivy--split str)))
-                      (if (= (length subs) 1)
-                          (cons
-                           (setq ivy--subexps 0)
-                           (car subs))
-                        (cons
-                         (setq ivy--subexps (length subs))
-                         (mapconcat
-                          (lambda (x)
-                            (if (string-match "\\`\\\\([^?].*\\\\)\\'" x)
-                                x
-                              (format "\\(%s\\)" x)))
-                          subs
-                          (if greedy
-                              ".*"
-                            ".*?")))))
-                    ivy--regex-hash)))))
-
-(defun ivy--legal-regex-p (str)
-  "Return t if STR is valid regular expression."
-  (condition-case nil
-      (progn
-        (string-match-p str "")
-        t)
-    (invalid-regexp nil)))
-
-(defun ivy--regex-or-literal (str)
-  "If STR isn't a legal regex, escape it."
-  (if (ivy--legal-regex-p str) str (regexp-quote str)))
-
-(defun ivy--split-negation (str)
-  "Split STR into text before and after !.
-Don't split if it's escaped with \\!.
-
-Assumes there is at most one unescaped !."
-  (let (parts
-        (part ""))
-    (mapc
-     (lambda (char)
-       (let ((prev-char (if (zerop (length part))
-                            nil
-                          (elt part (1- (length part))))))
-         ;; Split on !, unless it's escaped.
-         (cond
-          ;; Store "\!" as "!".
-          ((and (eq char ?!) (eq prev-char ?\\))
-           (setq part (concat (substring part 0 (1- (length part)))
-                              "!")))
-          ;; Split on "!".
-          ((eq char ?!)
-           (push part parts)
-           (setq part ""))
-          ;; Otherwise, append the current character.
-          (t
-           (setq part (concat part (string char)))))))
-     str)
-    (unless (zerop (length part))
-      (push part parts))
-    (setq parts (nreverse parts))
-    ;; If we have more than unescaped !, just discard the extra parts
-    ;; rather than crashing. We can't warn or error because the
-    ;; minibuffer is already active.
-    (when (> (length parts) 2)
-      (setq parts (list (cl-first parts) (cl-second parts))))
-    parts))
-
-(defun ivy--split-spaces (str)
-  "Split STR on spaces, unless they're preceded by \\.
-No unescaped spaces are present in the output."
-  (let (parts
-        (part ""))
-    (mapc
-     (lambda (char)
-       (let ((prev-char (if (zerop (length part))
-                            nil
-                          (elt part (1- (length part))))))
-         (cond
-          ;; Store "\ " as " ".
-          ((and (eq char ?\s) (eq prev-char ?\\))
-           (setq part (concat (substring part 0 (1- (length part)))
-                              " ")))
-          ;; Split on " ".
-          ((eq char ?\s)
-           (unless (zerop (length part))
-             (push part parts))
-           (setq part ""))
-          ;; Otherwise, append the current character.
-          (t
-           (setq part (concat part (string char)))))))
-     str)
-    (unless (zerop (length part))
-      (push part parts))
-    (nreverse parts)))
-
-(defun ivy--regex-ignore-order (str)
-  "Re-build regex from STR by splitting at spaces and using ! for negation.
-
-Examples:
-foo          -> matches \"foo\"
-foo bar      -> matches if both \"foo\" and \"bar\" match (any order)
-foo !bar     -> matches if \"foo\" matches and \"bar\" does not match
-foo !bar baz -> matches if \"foo\" matches and neither \"bar\" nor \"baz\" match
-foo[a-z]     -> matches \"foo[a-z]\"
-
-Escaping examples:
-foo\!bar -> matches \"foo!bar\"
-foo\ bar -> matches \"foo bar\"
-
-If STR isn't a valid input, fall back to exact matching:
-foo[     -> matches \"foo\[\" (invalid regex, so literal [ character)
-
-Returns a list suitable for `ivy-re-match'."
-  (let* (regex-parts
-         (raw-parts (ivy--split-negation str)))
-    (dolist (part (ivy--split-spaces (car raw-parts)))
-      (push (cons (ivy--regex-or-literal part) t) regex-parts))
-    (when (cdr raw-parts)
-      (dolist (part (ivy--split-spaces (cadr raw-parts)))
-        (push (cons (ivy--regex-or-literal part) nil) regex-parts)))
-    (if regex-parts (nreverse regex-parts)
-      "")))
-
-(defun ivy--regex-plus (str)
-  "Build a regex sequence from STR.
-Spaces are wild card characters, everything before \"!\" should
-match.  Everything after \"!\" should not match."
-  (let ((parts (split-string str "!" t)))
-    (cl-case (length parts)
-      (0
-       "")
-      (1
-       (if (string= (substring str 0 1) "!")
-           (list (cons "" t)
-                 (list (ivy--regex (car parts))))
-         (ivy--regex (car parts))))
-      (2
-       (cons
-        (cons (ivy--regex (car parts)) t)
-        (mapcar #'list (split-string (cadr parts) " " t))))
-      (t (error "Unexpected: use only one !")))))
-
-(defun ivy--regex-fuzzy (str)
-  "Build a regex sequence from STR.
-Insert .* between each char."
-  (if (string-match "\\`\\(\\^?\\)\\(.*?\\)\\(\\$?\\)\\'" str)
-      (prog1
-          (concat (match-string 1 str)
-                  (mapconcat
-                   (lambda (x)
-                     (format "\\(%c\\)" x))
-                   (string-to-list (match-string 2 str))
-                   ".*?")
-                  (match-string 3 str))
-        (setq ivy--subexps (length (match-string 2 str))))
-    str))
-
-(defcustom ivy-fixed-height-minibuffer nil
-  "When non nil, fix the height of the minibuffer during ivy completion.
-This effectively sets the minimum height at this level to `ivy-height' and
-tries to ensure that it does not change depending on the number of candidates."
-  :group 'ivy
-  :type 'boolean)
-
-;;** Rest
-(defcustom ivy-truncate-lines t
-  "Minibuffer setting for `truncate-lines'."
-  :type 'boolean)
-
-(defun ivy--minibuffer-setup ()
-  "Setup ivy completion in the minibuffer."
-  (set (make-local-variable 'completion-show-inline-help) nil)
-  (set (make-local-variable 'minibuffer-default-add-function)
-       (lambda ()
-         (list ivy--default)))
-  (set (make-local-variable 'inhibit-field-text-motion) nil)
-  (when (display-graphic-p)
-    (setq truncate-lines ivy-truncate-lines))
-  (setq-local max-mini-window-height ivy-height)
-  (when (and ivy-fixed-height-minibuffer
-             (not (eq (ivy-state-caller ivy-last) 'ivy-completion-in-region)))
-    (set-window-text-height (selected-window)
-                            (+ ivy-height
-                               (if ivy-add-newline-after-prompt
-                                   1
-                                 0))))
-  (add-hook 'post-command-hook #'ivy--exhibit nil t)
-  ;; show completions with empty input
-  (ivy--exhibit))
-
-(defun ivy--input ()
-  "Return the current minibuffer input."
-  ;; assume one-line minibuffer input
-  (buffer-substring-no-properties
-   (minibuffer-prompt-end)
-   (line-end-position)))
-
-(defun ivy--cleanup ()
-  "Delete the displayed completion candidates."
-  (save-excursion
-    (goto-char (minibuffer-prompt-end))
-    (delete-region (line-end-position) (point-max))))
-
-(defun ivy-cleanup-string (str)
-  "Remove unwanted text properties from STR."
-  (remove-text-properties 0 (length str) '(field) str)
-  str)
-
-(defvar ivy-set-prompt-text-properties-function
-  'ivy-set-prompt-text-properties-default
-  "Function to set the text properties of the default ivy prompt.
-Called with two arguments, PROMPT and STD-PROPS.
-The returned value should be the updated PROMPT.")
-
-(defun ivy-set-prompt-text-properties-default (prompt std-props)
-  "Set text properties of PROMPT.
-STD-PROPS is a property list containing the default text properties."
-  (ivy--set-match-props prompt "confirm"
-                        `(face ivy-confirm-face ,@std-props))
-  (ivy--set-match-props prompt "match required"
-                        `(face ivy-match-required-face ,@std-props))
-  prompt)
-
-(defun ivy-prompt ()
-  "Return the current prompt."
-  (let ((fn (plist-get ivy--prompts-list (ivy-state-caller ivy-last))))
-    (if fn
-        (condition-case nil
-            (funcall fn)
-          (error
-           (warn "`counsel-prompt-function' should take 0 args")
-           ;; old behavior
-           (funcall fn (ivy-state-prompt ivy-last))))
-      ivy--prompt)))
-
-(defun ivy--insert-prompt ()
-  "Update the prompt according to `ivy--prompt'."
-  (when (setq ivy--prompt (ivy-prompt))
-    (unless (memq this-command '(ivy-done ivy-alt-done ivy-partial-or-done
-                                 counsel-find-symbol))
-      (setq ivy--prompt-extra ""))
-    (let (head tail)
-      (if (string-match "\\(.*\\): \\'" ivy--prompt)
-          (progn
-            (setq head (match-string 1 ivy--prompt))
-            (setq tail ": "))
-        (setq head (substring ivy--prompt 0 -1))
-        (setq tail " "))
-      (let ((inhibit-read-only t)
-            (std-props '(front-sticky t rear-nonsticky t field t read-only t))
-            (n-str
-             (concat
-              (if (and (bound-and-true-p minibuffer-depth-indicate-mode)
-                       (> (minibuffer-depth) 1))
-                  (format "[%d] " (minibuffer-depth))
-                "")
-              (concat
-               (if (string-match "%d.*%d" ivy-count-format)
-                   (format head
-                           (1+ ivy--index)
-                           (or (and (ivy-state-dynamic-collection ivy-last)
-                                    ivy--full-length)
-                               ivy--length))
-                 (format head
-                         (or (and (ivy-state-dynamic-collection ivy-last)
-                                  ivy--full-length)
-                             ivy--length)))
-               ivy--prompt-extra
-               tail)))
-            (d-str (if ivy--directory
-                       (abbreviate-file-name ivy--directory)
-                     "")))
-        (save-excursion
-          (goto-char (point-min))
-          (delete-region (point-min) (minibuffer-prompt-end))
-          (let ((len-n (length n-str))
-                (len-d (length d-str))
-                (ww (window-width)))
-            (setq n-str
-                  (cond ((> (+ len-n len-d) ww)
-                         (concat n-str "\n" d-str "\n"))
-                        ((> (+ len-n len-d (length ivy-text)) ww)
-                         (concat n-str d-str "\n"))
-                        (t
-                         (concat n-str d-str)))))
-          (when ivy-add-newline-after-prompt
-            (setq n-str (concat n-str "\n")))
-          (let ((regex (format "\\([^\n]\\{%d\\}\\)[^\n]" (window-width))))
-            (while (string-match regex n-str)
-              (setq n-str (replace-match
-                           (concat (match-string 1 n-str) "\n")
-                           nil t n-str 1))))
-          (set-text-properties 0 (length n-str)
-                               `(face minibuffer-prompt ,@std-props)
-                               n-str)
-          (setq n-str (funcall ivy-set-prompt-text-properties-function
-                               n-str std-props))
-          (insert n-str))
-        ;; Mark prompt as selected if the user moves there or it is the only
-        ;; option left.  Since the user input stays put, we have to manually
-        ;; remove the face as well.
-        (when (ivy--prompt-selectable-p)
-          (if (or (= ivy--index -1)
-                  (= ivy--length 0))
-              (add-face-text-property
-               (minibuffer-prompt-end) (line-end-position) 'ivy-prompt-match)
-            (remove-text-properties
-             (minibuffer-prompt-end) (line-end-position) '(face))))
-        ;; get out of the prompt area
-        (constrain-to-field nil (point-max))))))
-
-(defun ivy--set-match-props (str match props &optional subexp)
-  "Set text properties of STR that match MATCH to PROPS.
-SUBEXP is a number which specifies the regexp group to use.
-If nil, the text properties are applied to the whole match."
-  (when (null subexp)
-    (setq subexp 0))
-  (when (string-match match str)
-    (set-text-properties
-     (match-beginning subexp)
-     (match-end subexp)
-     props
-     str)))
-
-(defvar inhibit-message)
-
-(defun ivy--sort-maybe (collection)
-  "Sort COLLECTION if needed."
-  (let ((sort (ivy-state-sort ivy-last)))
-    (if (null sort)
-        collection
-      (let ((sort-fn (or (and (functionp sort) sort)
-                         (ivy--sort-function (ivy-state-collection ivy-last))
-                         (ivy--sort-function t))))
-        (if (functionp sort-fn)
-            (cl-sort (copy-sequence collection) sort-fn)
-          collection)))))
-
-(defcustom ivy-magic-slash-non-match-action 'ivy-magic-slash-non-match-cd-selected
-  "Action to take when a slash is added to the end of a non existing directory.
-Possible choices are 'ivy-magic-slash-non-match-cd-selected,
-'ivy-magic-slash-non-match-create, or nil"
-  :type '(choice
-          (const :tag "Use currently selected directory"
-                 ivy-magic-slash-non-match-cd-selected)
-          (const :tag "Create and use new directory"
-                 ivy-magic-slash-non-match-create)
-          (const :tag "Do nothing"
-                 nil)))
-
-(defun ivy--create-and-cd (dir)
-  "When completing file names, create directory DIR and move there."
-  (make-directory dir)
-  (ivy--cd dir))
-
-(defun ivy--magic-file-slash ()
-  "Handle slash when completing file names."
-  (when (or (and (eq this-command 'self-insert-command)
-                 (eolp))
-            (eq this-command 'ivy-partial-or-done))
-    (cond ((member ivy-text ivy--all-candidates)
-           (ivy--cd (expand-file-name ivy-text ivy--directory)))
-          ((string-match "//\\'" ivy-text)
-           (if (and default-directory
-                    (string-match "\\`[[:alpha:]]:/" default-directory))
-               (ivy--cd (match-string 0 default-directory))
-             (ivy--cd "/")))
-          ((string-match "\\`/ssh:" ivy-text)
-           (ivy--cd (file-name-directory ivy-text)))
-          ((string-match "[[:alpha:]]:/\\'" ivy-text)
-           (let ((drive-root (match-string 0 ivy-text)))
-             (when (file-exists-p drive-root)
-               (ivy--cd drive-root))))
-          ((and (file-exists-p ivy-text)
-                (not (string= ivy-text "/"))
-                (file-directory-p ivy-text))
-           (ivy--cd (expand-file-name ivy-text)))
-          ((and (or (> ivy--index 0)
-                    (= ivy--length 1)
-                    (not (string= ivy-text "/")))
-                (let ((default-directory ivy--directory))
-                  (and
-                   (not (equal (ivy-state-current ivy-last) ""))
-                   (file-directory-p (ivy-state-current ivy-last))
-                   (file-exists-p (ivy-state-current ivy-last)))))
-           (when (eq ivy-magic-slash-non-match-action 'ivy-magic-slash-non-match-cd-selected)
-             (ivy--cd
-              (expand-file-name (ivy-state-current ivy-last) ivy--directory)))
-           (when (and (eq ivy-magic-slash-non-match-action 'ivy-magic-slash-non-match-create)
-                      (not (string= ivy-text "/")))
-             (ivy--create-and-cd (expand-file-name ivy-text ivy--directory))))
-          (t
-           (when (and
-                  (eq ivy-magic-slash-non-match-action 'ivy-magic-slash-non-match-create)
-                  (not (string= ivy-text "/")))
-             (ivy--create-and-cd (expand-file-name ivy-text ivy--directory)))))))
-
-(defcustom ivy-magic-tilde t
-  "When non-nil, ~ will move home when selecting files.
-Otherwise, ~/ will move home."
-  :type 'boolean)
-
-(defun ivy--exhibit ()
-  "Insert Ivy completions display.
-Should be run via minibuffer `post-command-hook'."
-  (when (memq 'ivy--exhibit post-command-hook)
-    (let ((inhibit-field-text-motion nil))
-      (constrain-to-field nil (point-max)))
-    (setq ivy-text (ivy--input))
-    (if (ivy-state-dynamic-collection ivy-last)
-        ;; while-no-input would cause annoying
-        ;; "Waiting for process to die...done" message interruptions
-        (let ((inhibit-message t))
-          (unless (equal ivy--old-text ivy-text)
-            (while-no-input
-              (setq ivy--all-candidates
-                    (ivy--sort-maybe
-                     (funcall (ivy-state-collection ivy-last) ivy-text)))
-              (setq ivy--old-text ivy-text)))
-          (when ivy--all-candidates
-            (ivy--insert-minibuffer
-             (ivy--format ivy--all-candidates))))
-      (cond (ivy--directory
-             (cond ((or (string= "~/" ivy-text)
-                        (and (string= "~" ivy-text)
-                             ivy-magic-tilde))
-                    (ivy--cd (expand-file-name "~/")))
-                   ((string-match "/\\'" ivy-text)
-                    (ivy--magic-file-slash))))
-            ((eq (ivy-state-collection ivy-last) 'internal-complete-buffer)
-             (when (or (and (string-match "\\` " ivy-text)
-                            (not (string-match "\\` " ivy--old-text)))
-                       (and (string-match "\\` " ivy--old-text)
-                            (not (string-match "\\` " ivy-text))))
-               (setq ivy--all-candidates
-                     (if (and (> (length ivy-text) 0)
-                              (eq (aref ivy-text 0)
-                                  ?\ ))
-                         (ivy--buffer-list " ")
-                       (ivy--buffer-list "" ivy-use-virtual-buffers)))
-               (setq ivy--old-re nil))))
-      (ivy--insert-minibuffer
-       (with-current-buffer (ivy-state-buffer ivy-last)
-         (ivy--format
-          (ivy--filter ivy-text ivy--all-candidates))))
-      (setq ivy--old-text ivy-text))))
-
-(defun ivy--insert-minibuffer (text)
-  "Insert TEXT into minibuffer with appropriate cleanup."
-  (let ((resize-mini-windows nil)
-        (update-fn (ivy-state-update-fn ivy-last))
-        (old-mark (marker-position (mark-marker)))
-        deactivate-mark)
-    (ivy--cleanup)
-    (when update-fn
-      (funcall update-fn))
-    (ivy--insert-prompt)
-    ;; Do nothing if while-no-input was aborted.
-    (when (stringp text)
-      (if ivy-display-function
-          (funcall ivy-display-function text)
-        (let ((buffer-undo-list t))
-          (save-excursion
-            (forward-line 1)
-            (insert text)))))
-    (when (display-graphic-p)
-      (ivy--resize-minibuffer-to-fit))
-    ;; prevent region growing due to text remove/add
-    (when (region-active-p)
-      (set-mark old-mark))))
-
-(defun ivy--resize-minibuffer-to-fit ()
-  "Resize the minibuffer window size to fit the text in the minibuffer."
-  (unless (frame-root-window-p (minibuffer-window))
-    (with-selected-window (minibuffer-window)
-      (if (fboundp 'window-text-pixel-size)
-          (let ((text-height (cdr (window-text-pixel-size)))
-                (body-height (window-body-height nil t)))
-            (when (> text-height body-height)
-              ;; Note: the size increment needs to be at least
-              ;; frame-char-height, otherwise resizing won't do
-              ;; anything.
-              (let ((delta (max (- text-height body-height)
-                                (frame-char-height))))
-                (window-resize nil delta nil t t))))
-        (let ((text-height (count-screen-lines))
-              (body-height (window-body-height)))
-          (when (> text-height body-height)
-            (window-resize nil (- text-height body-height) nil t)))))))
-
-(declare-function colir-blend-face-background "ext:colir")
-
-(defun ivy--add-face (str face)
-  "Propertize STR with FACE.
-`font-lock-append-text-property' is used, since it's better than
-`propertize' or `add-face-text-property' in this case."
-  (require 'colir)
-  (condition-case nil
-      (progn
-        (colir-blend-face-background 0 (length str) face str)
-        (let ((foreground (face-foreground face)))
-          (when foreground
-            (add-face-text-property
-             0 (length str)
-             `(:foreground ,foreground)
-             nil
-             str))))
-    (error
-     (ignore-errors
-       (font-lock-append-text-property 0 (length str) 'face face str))))
-  str)
-
-(declare-function flx-make-string-cache "ext:flx")
-(declare-function flx-score "ext:flx")
-
-(defvar ivy--flx-cache nil)
-
-(eval-after-load 'flx
-  '(setq ivy--flx-cache (flx-make-string-cache)))
-
-(defun ivy-toggle-case-fold ()
-  "Toggle the case folding between nil and auto/always.
-
-If auto, `case-fold-search' is t, when the input is all lower case,
-otherwise nil.
-
-If always, `case-fold-search' is always t, regardless of the input.
-
-Otherwise `case-fold-search' is always nil, regardless of the input.
-
-In any completion session, the case folding starts in
-`ivy-case-fold-search-default'."
-  (interactive)
-  (setq ivy-case-fold-search
-        (if ivy-case-fold-search
-            nil
-          (or ivy-case-fold-search-default 'auto)))
-  ;; reset cache so that the candidate list updates
-  (setq ivy--old-re nil))
-
-(defun ivy--re-filter (re candidates)
-  "Return all RE matching CANDIDATES.
-RE is a list of cons cells, with a regexp car and a boolean cdr.
-When the cdr is t, the car must match.
-Otherwise, the car must not match."
-  (let ((re-list (if (stringp re) (list (cons re t)) re))
-        (res candidates))
-    (dolist (re re-list)
-      (setq res
-            (ignore-errors
-              (funcall
-               (if (cdr re)
-                   #'cl-remove-if-not
-                 #'cl-remove-if)
-               (let ((re-str (car re)))
-                 (lambda (x) (string-match re-str x)))
-               res))))
-    res))
-
-(defun ivy--filter (name candidates)
-  "Return all items that match NAME in CANDIDATES.
-CANDIDATES are assumed to be static."
-  (let ((re (funcall ivy--regex-function name)))
-    (if (and
-         ivy--old-re
-         ivy--old-cands
-         (equal re ivy--old-re))
-        ;; quick caching for "C-n", "C-p" etc.
-        ivy--old-cands
-      (let* ((re-str (if (listp re) (caar re) re))
-             (matcher (ivy-state-matcher ivy-last))
-             (case-fold-search
-              (and ivy-case-fold-search
-                   (or (eq ivy-case-fold-search 'always)
-                       (string= name (downcase name)))))
-             (cands (cond
-                      (matcher
-                       (funcall matcher re candidates))
-                      ((and ivy--old-re
-                            (stringp re)
-                            (stringp ivy--old-re)
-                            (not (string-match "\\\\" ivy--old-re))
-                            (not (equal ivy--old-re ""))
-                            (memq (cl-search
-                                   (if (string-match "\\\\)\\'" ivy--old-re)
-                                       (substring ivy--old-re 0 -2)
-                                     ivy--old-re)
-                                   re)
-                                  '(0 2)))
-                       (ignore-errors
-                         (cl-remove-if-not
-                          (lambda (x) (string-match re x))
-                          ivy--old-cands)))
-                      (t
-                       (ivy--re-filter re candidates)))))
-        (if (memq (cdr (assoc (ivy-state-caller ivy-last)
-                              ivy-index-functions-alist))
-                  '(ivy-recompute-index-swiper
-                    ivy-recompute-index-swiper-async))
-            (progn
-              (ivy--recompute-index name re-str cands)
-              (setq ivy--old-cands (ivy--sort name cands)))
-          (setq ivy--old-cands (ivy--sort name cands))
-          (ivy--recompute-index name re-str ivy--old-cands))
-        (setq ivy--old-re re)
-        ivy--old-cands))))
-
-(defun ivy--set-candidates (x)
-  "Update `ivy--all-candidates' with X."
-  (let (res)
-    (dolist (source ivy--extra-candidates)
-      (if (equal source '(original-source))
-          (if (null res)
-              (setq res x)
-            (setq res (append x res)))
-        (setq ivy--old-re nil)
-        (setq res (append
-                   (ivy--filter ivy-text (cadr source))
-                   res))))
-    (setq ivy--all-candidates res)))
-
-(defcustom ivy-sort-matches-functions-alist
-  '((t . nil)
-    (ivy-switch-buffer . ivy-sort-function-buffer))
-  "An alist of functions for sorting matching candidates.
-
-Unlike `ivy-sort-functions-alist', which is used to sort the
-whole collection only once, this alist of functions are used to
-sort only matching candidates after each change in input.
-
-The alist KEY is either a collection function or t to match
-previously unmatched collection functions.
-
-The alist VAL is a sorting function with the signature of
-`ivy--prefix-sort'."
-  :type '(alist
-          :key-type (choice
-                     (const :tag "Fall-through" t)
-                     (symbol :tag "Collection"))
-          :value-type
-          (choice
-           (const :tag "Don't sort" nil)
-           (const :tag "Put prefix matches ahead" 'ivy--prefix-sort)
-           (function :tag "Custom sort function"))))
-
-(defun ivy--sort-files-by-date (_name candidates)
-  "Re-sort CANDIDATES according to file modification date."
-  (let ((default-directory ivy--directory))
-    (cl-sort (copy-sequence candidates)
-             (lambda (f1 f2)
-               (time-less-p
-                (nth 5 (file-attributes f2))
-                (nth 5 (file-attributes f1)))))))
-
-(defvar ivy--flx-featurep (require 'flx nil 'noerror))
-
-(defun ivy--sort (name candidates)
-  "Re-sort candidates by NAME.
-All CANDIDATES are assumed to match NAME."
-  (let ((key (or (ivy-state-caller ivy-last)
-                 (when (functionp (ivy-state-collection ivy-last))
-                   (ivy-state-collection ivy-last))))
-        fun)
-    (cond ((and ivy--flx-featurep
-                (eq ivy--regex-function 'ivy--regex-fuzzy))
-           (ivy--flx-sort name candidates))
-          ((setq fun (cdr (or (assoc key ivy-sort-matches-functions-alist)
-                              (assoc t ivy-sort-matches-functions-alist))))
-           (funcall fun name candidates))
-          (t
-           candidates))))
-
-(defun ivy--prefix-sort (name candidates)
-  "Re-sort candidates by NAME.
-All CANDIDATES are assumed to match NAME.
-Prefix matches to NAME are put ahead of the list."
-  (if (or (string-match "^\\^" name) (string= name ""))
-      candidates
-    (let ((re-prefix (concat "^" (funcall ivy--regex-function name)))
-          res-prefix
-          res-noprefix)
-      (dolist (s candidates)
-        (if (string-match re-prefix s)
-            (push s res-prefix)
-          (push s res-noprefix)))
-      (nconc
-       (nreverse res-prefix)
-       (nreverse res-noprefix)))))
-
-(defvar ivy--virtual-buffers nil
-  "Store the virtual buffers alist.")
-
-(defun ivy-sort-function-buffer (name candidates)
-  "Re-sort candidates by NAME.
-CANDIDATES is a list of buffer names each containing NAME.
-Sort open buffers before virtual buffers, and prefix matches
-before substring matches."
-  (if (or (string-match "^\\^" name) (string= name ""))
-      candidates
-    (let* ((base-re (funcall ivy--regex-function name))
-           (base-re (if (consp base-re) (caar base-re) base-re))
-           (re-prefix (concat "^\\*" base-re))
-           res-prefix
-           res-noprefix
-           res-virtual-prefix
-           res-virtual-noprefix)
-      (unless (cl-find-if (lambda (s) (string-match re-prefix s)) candidates)
-        (setq re-prefix (concat "^" base-re)))
-      (dolist (s candidates)
-        (cond
-          ((and (assoc s ivy--virtual-buffers) (string-match re-prefix s))
-           (push s res-virtual-prefix))
-          ((assoc s ivy--virtual-buffers)
-           (push s res-virtual-noprefix))
-          ((string-match re-prefix s)
-           (push s res-prefix))
-          (t
-           (push s res-noprefix))))
-      (nconc
-       (nreverse res-prefix)
-       (nreverse res-noprefix)
-       (nreverse res-virtual-prefix)
-       (nreverse res-virtual-noprefix)))))
-
-(defun ivy--recompute-index (name re-str cands)
-  "Recompute index of selected candidate matching NAME.
-RE-STR is the regexp, CANDS are the current candidates."
-  (let* ((caller (ivy-state-caller ivy-last))
-         (func (or (and caller (cdr (assoc caller ivy-index-functions-alist)))
-                   (cdr (assoc t ivy-index-functions-alist))
-                   #'ivy-recompute-index-zero)))
-    (unless (eq this-command 'ivy-resume)
-      (ivy-set-index
-       (or
-        (cl-position (if (and (> (length name) 0)
-                              (eq ?^ (aref name 0)))
-                         (substring name 1)
-                       name) cands
-                       :test #'equal)
-        (and ivy--directory
-             (cl-position
-              (concat re-str "/") cands
-              :test #'equal))
-        (and (eq caller 'ivy-switch-buffer)
-             (> (length name) 0)
-             0)
-        (and (not (string= name ""))
-             (not (and ivy--flx-featurep
-                       (eq ivy--regex-function 'ivy--regex-fuzzy)
-                       (< (length cands) 200)))
-             ivy--old-cands
-             (cl-position (nth ivy--index ivy--old-cands)
-                          cands))
-        (funcall func re-str cands))))
-    (when (or (string= name "")
-              (string= name "^"))
-      (ivy-set-index
-       (or (ivy--preselect-index
-            (ivy-state-preselect ivy-last)
-            cands)
-           ivy--index)))))
-
-(defun ivy-recompute-index-swiper (_re-str cands)
-  "Recompute index of selected candidate when using `swiper'.
-CANDS are the current candidates."
-  (condition-case nil
-      (let ((tail (nthcdr ivy--index ivy--old-cands))
-            idx)
-        (if (and tail ivy--old-cands (not (equal "^" ivy--old-re)))
-            (progn
-              (while (and tail (null idx))
-                ;; Compare with eq to handle equal duplicates in cands
-                (setq idx (cl-position (pop tail) cands)))
-              (or
-               idx
-               (1- (length cands))))
-          (if ivy--old-cands
-              ivy--index
-            ;; already in ivy-state-buffer
-            (let ((n (line-number-at-pos))
-                  (res 0)
-                  (i 0))
-              (dolist (c cands)
-                (when (eq n (read (get-text-property 0 'swiper-line-number c)))
-                  (setq res i))
-                (cl-incf i))
-              res))))
-    (error 0)))
-
-(defun ivy-recompute-index-swiper-async (_re-str cands)
-  "Recompute index of selected candidate when using `swiper' asynchronously.
-CANDS are the current candidates."
-  (if (null ivy--old-cands)
-      (let ((ln (with-ivy-window
-                  (line-number-at-pos))))
-        (or
-         ;; closest to current line going forwards
-         (cl-position-if (lambda (x)
-                           (>= (string-to-number x) ln))
-                         cands)
-         ;; closest to current line going backwards
-         (1- (length cands))))
-    (let ((tail (nthcdr ivy--index ivy--old-cands))
-          idx)
-      (if (and tail ivy--old-cands (not (equal "^" ivy--old-re)))
-          (progn
-            (while (and tail (null idx))
-              ;; Compare with `equal', since the collection is re-created
-              ;; each time with `split-string'
-              (setq idx (cl-position (pop tail) cands :test #'equal)))
-            (or idx 0))
-        ivy--index))))
-
-(defun ivy-recompute-index-zero (_re-str _cands)
-  "Recompute index of selected candidate.
-This function serves as a fallback when nothing else is available."
-  0)
-
-(defcustom ivy-minibuffer-faces
-  '(ivy-minibuffer-match-face-1
-    ivy-minibuffer-match-face-2
-    ivy-minibuffer-match-face-3
-    ivy-minibuffer-match-face-4)
-  "List of `ivy' faces for minibuffer group matches."
-  :type '(repeat :tag "Faces"
-          (choice
-           (const ivy-minibuffer-match-face-1)
-           (const ivy-minibuffer-match-face-2)
-           (const ivy-minibuffer-match-face-3)
-           (const ivy-minibuffer-match-face-4)
-           (face :tag "Other face"))))
-
-(defvar ivy-flx-limit 200
-  "Used to conditionally turn off flx sorting.
-
-When the amount of matching candidates exceeds this limit, then
-no sorting is done.")
-
-(defun ivy--flx-propertize (x)
-  "X is (cons (flx-score STR ...) STR)."
-  (let ((str (copy-sequence (cdr x)))
-        (i 0)
-        (last-j -2))
-    (dolist (j (cdar x))
-      (unless (eq j (1+ last-j))
-        (cl-incf i))
-      (setq last-j j)
-      (ivy-add-face-text-property
-       j (1+ j)
-       (nth (1+ (mod (+ i 2) (1- (length ivy-minibuffer-faces))))
-            ivy-minibuffer-faces)
-       str))
-    str))
-
-(defun ivy--flx-sort (name cands)
-  "Sort according to closeness to string NAME the string list CANDS."
-  (condition-case nil
-      (let* (
-             ;; an optimized regex for fuzzy matching
-             ;; "abc" → "\\`[^a]*a[^b]*b[^c]*c"
-             (fuzzy-regex (if (= (elt name 0) ?^)
-                              (concat "^"
-                                      (regexp-quote (substring name 1 2))
-                                      (mapconcat
-                                       (lambda (x)
-                                         (setq x (string x))
-                                         (concat "[^" x "]*" (regexp-quote x)))
-                                       (substring name 2)
-                                       ""))
-                            (concat "^"
-                                    (mapconcat
-                                     (lambda (x)
-                                       (setq x (string x))
-                                       (concat "[^" x "]*" (regexp-quote x)))
-                                     name
-                                     ""))))
-
-             ;; strip off the leading "^" for flx matching
-             (flx-name (if (string-match "^\\^" name)
-                           (substring name 1)
-                         name))
-
-             (cands-left)
-             (cands-to-sort))
-
-        ;; filter out non-matching candidates
-        (dolist (cand cands)
-          (when (string-match fuzzy-regex cand)
-            (push cand cands-left)))
-
-        ;; pre-sort the candidates by length before partitioning
-        (setq cands-left (sort cands-left
-                               (lambda (c1 c2)
-                                 (< (length c1)
-                                    (length c2)))))
-
-        ;; partition the candidates into sorted and unsorted groups
-        (dotimes (_n (min (length cands-left) ivy-flx-limit))
-          (push (pop cands-left) cands-to-sort))
-
-        (append
-         ;; compute all of the flx scores in one pass and sort
-         (mapcar #'car
-                 (sort (mapcar
-                        (lambda (cand)
-                          (cons cand
-                                (car (flx-score cand
-                                                flx-name
-                                                ivy--flx-cache))))
-                        cands-to-sort)
-                       (lambda (c1 c2)
-                         ;; break ties by length
-                         (if (/= (cdr c1) (cdr c2))
-                             (> (cdr c1)
-                                (cdr c2))
-                           (< (length (car c1))
-                              (length (car c2)))))))
-
-         ;; add the unsorted candidates
-         cands-left))
-    (error
-     cands)))
-
-(defun ivy--truncate-string (str width)
-  "Truncate STR to WIDTH."
-  (if (> (string-width str) width)
-      (concat (substring str 0 (min (- width 3)
-                                    (- (length str) 3))) "...")
-    str))
-
-(defun ivy--format-function-generic (selected-fn other-fn cands separator)
-  "Transform candidates into a string for minibuffer.
-SELECTED-FN is called for the selected candidate, OTHER-FN for the others.
-Both functions take one string argument each.  CANDS is a list of candidates
-and SEPARATOR is used to join them."
-  (let ((i -1))
-    (mapconcat
-     (lambda (str)
-       (let ((curr (eq (cl-incf i) ivy--index)))
-         (if curr
-             (funcall selected-fn str)
-           (funcall other-fn str))))
-     cands
-     separator)))
-
-(defun ivy-format-function-default (cands)
-  "Transform CANDS into a string for minibuffer."
-  (ivy--format-function-generic
-   (lambda (str)
-     (ivy--add-face str 'ivy-current-match))
-   #'identity
-   cands
-   "\n"))
-
-(defun ivy-format-function-arrow (cands)
-  "Transform CANDS into a string for minibuffer."
-  (ivy--format-function-generic
-   (lambda (str)
-     (concat "> " (ivy--add-face str 'ivy-current-match)))
-   (lambda (str)
-     (concat "  " str))
-   cands
-   "\n"))
-
-(defun ivy-format-function-line (cands)
-  "Transform CANDS into a string for minibuffer."
-  (ivy--format-function-generic
-   (lambda (str)
-     (ivy--add-face (concat str "\n") 'ivy-current-match))
-   (lambda (str)
-     (concat str "\n"))
-   cands
-   ""))
-
-(defun ivy-add-face-text-property (start end face str)
-  "Add face property to the text from START to END.
-FACE is the face to apply to STR."
-  (if (fboundp 'add-face-text-property)
-      (add-face-text-property
-       start end face nil str)
-    (font-lock-append-text-property
-     start end 'face face str)))
-
-(defun ivy--highlight-ignore-order (str)
-  "Highlight STR, using the ignore-order method."
-  (when (consp ivy--old-re)
-    (let ((i 1))
-      (dolist (re ivy--old-re)
-        (when (string-match (car re) str)
-          (ivy-add-face-text-property
-           (match-beginning 0) (match-end 0)
-           (nth (1+ (mod (+ i 2) (1- (length ivy-minibuffer-faces))))
-                ivy-minibuffer-faces)
-           str))
-        (cl-incf i))))
-  str)
-
-(defun ivy--highlight-fuzzy (str)
-  "Highlight STR, using the fuzzy method."
-  (if ivy--flx-featurep
-      (let ((flx-name (if (string-match "^\\^" ivy-text)
-                          (substring ivy-text 1)
-                        ivy-text)))
-        (ivy--flx-propertize
-         (cons (flx-score str flx-name ivy--flx-cache) str)))
-    (ivy--highlight-default str)))
-
-(defun ivy--highlight-default (str)
-  "Highlight STR, using the default method."
-  (unless ivy--old-re
-    (setq ivy--old-re (funcall ivy--regex-function ivy-text)))
-  (let ((start
-         (if (and (memq (ivy-state-caller ivy-last)
-                        '(counsel-git-grep counsel-ag counsel-rg counsel-pt))
-                  (string-match "^[^:]+:[^:]+:" str))
-             (match-end 0)
-           0)))
-    (ignore-errors
-      (while (and (string-match ivy--old-re str start)
-                  (> (- (match-end 0) (match-beginning 0)) 0))
-        (setq start (match-end 0))
-        (let ((i 0))
-          (while (<= i ivy--subexps)
-            (let ((face
-                   (cond ((zerop ivy--subexps)
-                          (cadr ivy-minibuffer-faces))
-                         ((zerop i)
-                          (car ivy-minibuffer-faces))
-                         (t
-                          (nth (1+ (mod (+ i 2)
-                                        (1- (length ivy-minibuffer-faces))))
-                               ivy-minibuffer-faces)))))
-              (ivy-add-face-text-property
-               (match-beginning i) (match-end i)
-               face str))
-            (cl-incf i))))))
-  str)
-
-(defun ivy--format-minibuffer-line (str)
-  "Format line STR for use in minibuffer."
-  (if (eq ivy-display-style 'fancy)
-      (funcall ivy--highlight-function (copy-sequence str))
-    (copy-sequence str)))
-
-(ivy-set-display-transformer
- 'counsel-find-file 'ivy-read-file-transformer)
-(ivy-set-display-transformer
- 'read-file-name-internal 'ivy-read-file-transformer)
-
-(defun ivy-read-file-transformer (str)
-  "Transform candidate STR when reading files."
-  (if (string-match-p "/\\'" str)
-      (propertize str 'face 'ivy-subdir)
-    str))
-
-(defun ivy--format (cands)
-  "Return a string for CANDS suitable for display in the minibuffer.
-CANDS is a list of strings."
-  (setq ivy--length (length cands))
-  (when (>= ivy--index ivy--length)
-    (ivy-set-index (max (1- ivy--length) 0)))
-  (if (null cands)
-      (setf (ivy-state-current ivy-last) "")
-    (let* ((half-height (/ ivy-height 2))
-           (start (max 0 (- ivy--index half-height)))
-           (end (min (+ start (1- ivy-height)) ivy--length))
-           (start (max 0 (min start (- end (1- ivy-height)))))
-           (cands (cl-subseq cands start end))
-           (index (- ivy--index start))
-           transformer-fn)
-      (setf (ivy-state-current ivy-last) (copy-sequence (nth index cands)))
-      (when (setq transformer-fn (ivy-state-display-transformer-fn ivy-last))
-        (with-ivy-window
-          (with-current-buffer (ivy-state-buffer ivy-last)
-            (setq cands (mapcar transformer-fn cands)))))
-      (let* ((ivy--index index)
-             (cands (mapcar
-                     #'ivy--format-minibuffer-line
-                     cands))
-             (res (concat "\n" (funcall ivy-format-function cands))))
-        (put-text-property 0 (length res) 'read-only nil res)
-        res))))
-
-(defvar recentf-list)
-(defvar bookmark-alist)
-
-(defcustom ivy-virtual-abbreviate 'name
-  "The mode of abbreviation for virtual buffer names."
-  :type '(choice
-          (const :tag "Only name" name)
-          (const :tag "Full path" full)
-          ;; eventually, uniquify
-          ))
-(declare-function bookmark-maybe-load-default-file "bookmark")
-(declare-function bookmark-get-filename "bookmark")
-
-(defun ivy--virtual-buffers ()
-  "Adapted from `ido-add-virtual-buffers-to-list'."
-  (require 'bookmark)
-  (unless recentf-mode
-    (recentf-mode 1))
-  (let (virtual-buffers)
-    (bookmark-maybe-load-default-file)
-    (dolist (head (append
-                   (copy-sequence recentf-list)
-                   (delete "   - no file -"
-                           (delq nil (mapcar #'bookmark-get-filename
-                                             (copy-sequence bookmark-alist))))))
-      (let ((file-name (if (stringp head)
-                           head
-                         (cdr head)))
-            name)
-        (setq name
-              (if (eq ivy-virtual-abbreviate 'name)
-                  (file-name-nondirectory file-name)
-                (expand-file-name file-name)))
-        (when (equal name "")
-          (if (consp head)
-              (setq name (car head))
-            (setq name (file-name-nondirectory
-                        (directory-file-name file-name)))))
-        (and (not (equal name ""))
-             (null (get-file-buffer file-name))
-             (not (assoc name virtual-buffers))
-             (push (cons name file-name) virtual-buffers))))
-    (when virtual-buffers
-      (dolist (comp virtual-buffers)
-        (put-text-property 0 (length (car comp))
-                           'face 'ivy-virtual
-                           (car comp)))
-      (setq ivy--virtual-buffers (nreverse virtual-buffers))
-      (mapcar #'car ivy--virtual-buffers))))
-
-(defcustom ivy-ignore-buffers '("\\` ")
-  "List of regexps or functions matching buffer names to ignore."
-  :type '(repeat (choice regexp function)))
-
-(defvar ivy-switch-buffer-faces-alist '((dired-mode . ivy-subdir)
-                                        (org-mode . org-level-4))
-  "Store face customizations for `ivy-switch-buffer'.
-Each KEY is `major-mode', each VALUE is a face name.")
-
-(defun ivy--buffer-list (str &optional virtual predicate)
-  "Return the buffers that match STR.
-If VIRTUAL is non-nil, add virtual buffers.
-If optional argument PREDICATE is non-nil, use it to test each
-possible match.  See `all-completions' for further information."
-  (delete-dups
-   (append
-    (mapcar
-     (lambda (x)
-       (if (with-current-buffer x
-             (and default-directory
-                  (file-remote-p
-                   (abbreviate-file-name default-directory))))
-           (propertize x 'face 'ivy-remote)
-         (let ((face (with-current-buffer x
-                       (cdr (assoc major-mode
-                                   ivy-switch-buffer-faces-alist)))))
-           (if face
-               (propertize x 'face face)
-             x))))
-     (all-completions str 'internal-complete-buffer predicate))
-    (and virtual
-         (ivy--virtual-buffers)))))
-
-(defvar ivy-views (and nil
-                       `(("ivy + *scratch* {}"
-                          (vert
-                           (file ,(expand-file-name "ivy.el"))
-                           (buffer "*scratch*")))
-                         ("swiper + *scratch* {}"
-                          (horz
-                           (file ,(expand-file-name "swiper.el"))
-                           (buffer "*scratch*")))))
-  "Store window configurations selectable by `ivy-switch-buffer'.
-
-The default value is given as an example.
-
-Each element is a list of (NAME TREE).  NAME is a string, it's
-recommended to end it with a distinctive snippet e.g. \"{}\" so
-that it's easy to distinguish the window configurations.
-
-TREE is a nested list with the following valid cars:
-- vert: split the window vertically
-- horz: split the window horizontally
-- file: open the specified file
-- buffer: open the specified buffer
-
-TREE can be nested multiple times to have mulitple window splits.")
-
-(defun ivy-default-view-name ()
-  "Return default name for new view."
-  (let* ((default-view-name
-          (concat "{} "
-                  (mapconcat #'identity
-                             (cl-sort
-                              (mapcar (lambda (w)
-                                        (with-current-buffer (window-buffer w)
-                                          (if (buffer-file-name)
-                                              (file-name-nondirectory
-                                               (buffer-file-name))
-                                            (buffer-name))))
-                                      (window-list))
-                              #'string<)
-                             " ")))
-         (view-name-re (concat "\\`"
-                               (regexp-quote default-view-name)
-                               " \\([0-9]+\\)"))
-         old-view)
-    (cond ((setq old-view
-                 (cl-find-if
-                  (lambda (x)
-                    (string-match view-name-re (car x)))
-                  ivy-views))
-           (format "%s %d"
-                   default-view-name
-                   (1+ (string-to-number
-                        (match-string 1 (car old-view))))))
-          ((assoc default-view-name ivy-views)
-           (concat default-view-name " 1"))
-          (t
-           default-view-name))))
-
-(defun ivy-push-view ()
-  "Push the current window tree on `ivy-views'.
-Currently, the split configuration (i.e. horizonal or vertical)
-and point positions are saved, but the split positions aren't.
-Use `ivy-pop-view' to delete any item from `ivy-views'."
-  (interactive)
-  (let* ((view (cl-labels
-                   ((ft (tr)
-                      (if (consp tr)
-                          (if (eq (car tr) t)
-                              (cons 'vert
-                                    (mapcar #'ft (cddr tr)))
-                            (cons 'horz
-                                  (mapcar #'ft (cddr tr))))
-                        (with-current-buffer (window-buffer tr)
-                          (cond ((buffer-file-name)
-                                 (list 'file (buffer-file-name) (point)))
-                                ((eq major-mode 'dired-mode)
-                                 (list 'file default-directory (point)))
-                                (t
-                                 (list 'buffer (buffer-name) (point))))))))
-                 (ft (car (window-tree)))))
-         (view-name (ivy-read "Name view: " nil
-                              :initial-input (ivy-default-view-name))))
-    (when view-name
-      (push (list view-name view) ivy-views))))
-
-(defun ivy-pop-view-action (view)
-  "Delete VIEW from `ivy-views'."
-  (setq ivy-views (delete view ivy-views))
-  (setq ivy--all-candidates
-        (delete (car view) ivy--all-candidates))
-  (setq ivy--old-cands nil))
-
-(defun ivy-pop-view ()
-  "Delete a view to delete from `ivy-views'."
-  (interactive)
-  (ivy-read "Pop view: " ivy-views
-            :preselect (caar ivy-views)
-            :action #'ivy-pop-view-action
-            :caller 'ivy-pop-view))
-
-(defun ivy-source-views ()
-  "Return the name of the views saved in `ivy-views'."
-  (mapcar #'car ivy-views))
-
-(ivy-set-sources
- 'ivy-switch-buffer
- '((original-source)
-   (ivy-source-views)))
-
-(defun ivy-set-view-recur (view)
-  "Set VIEW recursively."
-  (cond ((eq (car view) 'vert)
-         (let* ((wnd1 (selected-window))
-                (wnd2 (split-window-vertically))
-                (views (cdr view))
-                (v (pop views)))
-           (with-selected-window wnd1
-             (ivy-set-view-recur v))
-           (while (setq v (pop views))
-             (with-selected-window wnd2
-               (ivy-set-view-recur v))
-             (when views
-               (setq wnd2 (split-window-vertically))))))
-        ((eq (car view) 'horz)
-         (let* ((wnd1 (selected-window))
-                (wnd2 (split-window-horizontally))
-                (views (cdr view))
-                (v (pop views)))
-           (with-selected-window wnd1
-             (ivy-set-view-recur v))
-           (while (setq v (pop views))
-             (with-selected-window wnd2
-               (ivy-set-view-recur v))
-             (when views
-               (setq wnd2 (split-window-horizontally))))))
-        ((eq (car view) 'file)
-         (let* ((name (nth 1 view))
-                (virtual (assoc name ivy--virtual-buffers))
-                buffer)
-           (cond ((setq buffer (get-buffer name))
-                  (switch-to-buffer buffer nil 'force-same-window))
-                 (virtual
-                  (find-file (cdr virtual)))
-                 ((file-exists-p name)
-                  (find-file name))))
-         (when (and (> (length view) 2)
-                    (numberp (nth 2 view)))
-           (goto-char (nth 2 view))))
-        ((eq (car view) 'buffer)
-         (switch-to-buffer (nth 1 view))
-         (when (and (> (length view) 2)
-                    (numberp (nth 2 view)))
-           (goto-char (nth 2 view))))
-        ((eq (car view) 'sexp)
-         (eval (nth 1 view)))))
-
-(defun ivy--switch-buffer-action (buffer)
-  "Switch to BUFFER.
-BUFFER may be a string or nil."
-  (with-ivy-window
-    (if (zerop (length buffer))
-        (switch-to-buffer
-         ivy-text nil 'force-same-window)
-      (let ((virtual (assoc buffer ivy--virtual-buffers))
-            (view (assoc buffer ivy-views)))
-        (cond ((and virtual
-                    (not (get-buffer buffer)))
-               (find-file (cdr virtual)))
-              (view
-               (delete-other-windows)
-               (let (
-                     ;; silence "Directory has changed on disk"
-                     (inhibit-message t))
-                 (ivy-set-view-recur (cadr view))))
-              (t
-               (switch-to-buffer
-                buffer nil 'force-same-window)))))))
-
-(defun ivy--switch-buffer-other-window-action (buffer)
-  "Switch to BUFFER in other window.
-BUFFER may be a string or nil."
-  (if (zerop (length buffer))
-      (switch-to-buffer-other-window ivy-text)
-    (let ((virtual (assoc buffer ivy--virtual-buffers)))
-      (if (and virtual
-               (not (get-buffer buffer)))
-          (find-file-other-window (cdr virtual))
-        (switch-to-buffer-other-window buffer)))))
-
-(defun ivy--rename-buffer-action (buffer)
-  "Rename BUFFER."
-  (let ((new-name (read-string "Rename buffer (to new name): ")))
-    (with-current-buffer buffer
-      (rename-buffer new-name))))
-
-(defvar ivy-switch-buffer-map (make-sparse-keymap))
-
-(ivy-set-actions
- 'ivy-switch-buffer
- '(("k"
-    (lambda (x)
-      (kill-buffer x)
-      (ivy--reset-state ivy-last))
-    "kill")
-   ("j"
-    ivy--switch-buffer-other-window-action
-    "other window")
-   ("r"
-    ivy--rename-buffer-action
-    "rename")))
-
-(ivy-set-actions
- t
- '(("i" (lambda (x) (insert (if (stringp x) x (car x)))) "insert")
-   ("w" (lambda (x) (kill-new (if (stringp x) x (car x)))) "copy")))
-
-(defun ivy--switch-buffer-matcher (regexp candidates)
-  "Return REGEXP matching CANDIDATES.
-Skip buffers that match `ivy-ignore-buffers'."
-  (let ((res (ivy--re-filter regexp candidates)))
-    (if (or (null ivy-use-ignore)
-            (null ivy-ignore-buffers))
-        res
-      (or (cl-remove-if
-           (lambda (buf)
-             (cl-find-if
-              (lambda (f-or-r)
-                (if (functionp f-or-r)
-                    (funcall f-or-r buf)
-                  (string-match-p f-or-r buf)))
-              ivy-ignore-buffers))
-           res)
-          (and (eq ivy-use-ignore t)
-               res)))))
-
-(ivy-set-display-transformer
- 'ivy-switch-buffer 'ivy-switch-buffer-transformer)
-(ivy-set-display-transformer
- 'internal-complete-buffer 'ivy-switch-buffer-transformer)
-
-(defun ivy-append-face (str face)
-  "Append to STR the property FACE."
-  (let ((new (copy-sequence str)))
-    (font-lock-append-text-property
-     0 (length new) 'face face new)
-    new))
-
-(defun ivy-switch-buffer-transformer (str)
-  "Transform candidate STR when switching buffers."
-  (let ((b (get-buffer str)))
-    (if (and b
-             (buffer-file-name b)
-             (buffer-modified-p b))
-        (ivy-append-face str 'ivy-modified-buffer)
-      str)))
-
-(defun ivy-switch-buffer-occur ()
-  "Occur function for `ivy-switch-buffer' using `ibuffer'."
-  (let* ((cand-regexp
-          (concat "\\(" (mapconcat #'regexp-quote ivy--old-cands "\\|") "\\)"))
-         (new-qualifier `((name . ,cand-regexp))))
-    (ibuffer nil (buffer-name) new-qualifier)))
-
-;;;###autoload
-(defun ivy-switch-buffer ()
-  "Switch to another buffer."
-  (interactive)
-  (let ((this-command 'ivy-switch-buffer))
-    (ivy-read "Switch to buffer: " 'internal-complete-buffer
-              :matcher #'ivy--switch-buffer-matcher
-              :preselect (buffer-name (other-buffer (current-buffer)))
-              :action #'ivy--switch-buffer-action
-              :keymap ivy-switch-buffer-map
-              :caller 'ivy-switch-buffer)))
-
-;;;###autoload
-(defun ivy-switch-view ()
-  "Switch to one of the window views stored by `ivy-push-view'."
-  (interactive)
-  (let ((ivy-initial-inputs-alist
-         '((ivy-switch-buffer . "{}"))))
-    (ivy-switch-buffer)))
-
-;;;###autoload
-(defun ivy-switch-buffer-other-window ()
-  "Switch to another buffer in another window."
-  (interactive)
-  (ivy-read "Switch to buffer in other window: " 'internal-complete-buffer
-            :matcher #'ivy--switch-buffer-matcher
-            :preselect (buffer-name (other-buffer (current-buffer)))
-            :action #'ivy--switch-buffer-other-window-action
-            :keymap ivy-switch-buffer-map
-            :caller 'ivy-switch-buffer-other-window))
-
-(define-obsolete-function-alias 'ivy-recentf 'counsel-recentf "0.8.0")
-
-(defun ivy-yank-word ()
-  "Pull next word from buffer into search string."
-  (interactive)
-  (let (amend)
-    (with-ivy-window
-      (let ((pt (point))
-            (le (line-end-position)))
-        (forward-word 1)
-        (if (> (point) le)
-            (goto-char pt)
-          (setq amend (buffer-substring-no-properties pt (point))))))
-    (when amend
-      (insert (replace-regexp-in-string "  +" " " amend)))))
-
-(defun ivy-kill-ring-save ()
-  "Store the current candidates into the kill ring.
-If the region is active, forward to `kill-ring-save' instead."
-  (interactive)
-  (if (region-active-p)
-      (call-interactively 'kill-ring-save)
-    (kill-new
-     (mapconcat
-      #'identity
-      ivy--old-cands
-      "\n"))))
-
-(defun ivy-insert-current ()
-  "Make the current candidate into current input.
-Don't finish completion."
-  (interactive)
-  (delete-minibuffer-contents)
-  (if (and ivy--directory
-           (string-match "/$" (ivy-state-current ivy-last)))
-      (insert (substring (ivy-state-current ivy-last) 0 -1))
-    (insert (ivy-state-current ivy-last))))
-
-(defcustom ivy--preferred-re-builders
-  '((ivy--regex-plus . "ivy")
-    (ivy--regex-ignore-order . "order")
-    (ivy--regex-fuzzy . "fuzzy"))
-  "Alist of preferred re-builders with display names.
-This list can be rotated with `ivy-rotate-preferred-builders'."
-  :type '(alist :key-type function :value-type string)
-  :group 'ivy)
-
-(defun ivy-rotate-preferred-builders ()
-  "Switch to the next re builder in `ivy--preferred-re-builders'."
-  (interactive)
-  (when ivy--preferred-re-builders
-    (setq ivy--old-re nil)
-    (setq ivy--regex-function
-          (let ((cell (assoc ivy--regex-function ivy--preferred-re-builders)))
-            (car (or (cadr (memq cell ivy--preferred-re-builders))
-                     (car ivy--preferred-re-builders)))))))
-
-(defun ivy-toggle-fuzzy ()
-  "Toggle the re builder between `ivy--regex-fuzzy' and `ivy--regex-plus'."
-  (interactive)
-  (setq ivy--old-re nil)
-  (if (eq ivy--regex-function 'ivy--regex-fuzzy)
-      (setq ivy--regex-function 'ivy--regex-plus)
-    (setq ivy--regex-function 'ivy--regex-fuzzy)))
-
-(defun ivy-reverse-i-search ()
-  "Enter a recursive `ivy-read' session using the current history.
-The selected history element will be inserted into the minibuffer."
-  (interactive)
-  (let ((enable-recursive-minibuffers t)
-        (history (symbol-value (ivy-state-history ivy-last)))
-        (old-last ivy-last)
-        (ivy-recursive-restore nil))
-    (ivy-read "Reverse-i-search: "
-              history
-              :action (lambda (x)
-                        (ivy--reset-state
-                         (setq ivy-last old-last))
-                        (delete-minibuffer-contents)
-                        (insert (substring-no-properties x))
-                        (ivy--cd-maybe)))))
-
-(defun ivy-restrict-to-matches ()
-  "Restrict candidates to current input and erase input."
-  (interactive)
-  (delete-minibuffer-contents)
-  (setq ivy--all-candidates
-        (ivy--filter ivy-text ivy--all-candidates)))
-
-;;* Occur
-(defvar-local ivy-occur-last nil
-  "Buffer-local value of `ivy-last'.
-Can't re-use `ivy-last' because using e.g. `swiper' in the same
-buffer would modify `ivy-last'.")
-
-(defvar ivy-occur-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [mouse-1] 'ivy-occur-click)
-    (define-key map (kbd "RET") 'ivy-occur-press-and-switch)
-    (define-key map (kbd "j") 'ivy-occur-next-line)
-    (define-key map (kbd "k") 'ivy-occur-previous-line)
-    (define-key map (kbd "h") 'backward-char)
-    (define-key map (kbd "l") 'forward-char)
-    (define-key map (kbd "f") 'ivy-occur-press)
-    (define-key map (kbd "g") 'ivy-occur-revert-buffer)
-    (define-key map (kbd "a") 'ivy-occur-read-action)
-    (define-key map (kbd "o") 'ivy-occur-dispatch)
-    (define-key map (kbd "c") 'ivy-occur-toggle-calling)
-    (define-key map (kbd "q") 'quit-window)
-    map)
-  "Keymap for Ivy Occur mode.")
-
-(defun ivy-occur-toggle-calling ()
-  "Toggle `ivy-calling'."
-  (interactive)
-  (if (setq ivy-calling (not ivy-calling))
-      (progn
-        (setq mode-name "Ivy-Occur [calling]")
-        (ivy-occur-press))
-    (setq mode-name "Ivy-Occur"))
-  (force-mode-line-update))
-
-(defun ivy-occur-next-line (&optional arg)
-  "Move the cursor down ARG lines.
-When `ivy-calling' isn't nil, call `ivy-occur-press'."
-  (interactive "p")
-  (forward-line arg)
-  (when ivy-calling
-    (ivy-occur-press)))
-
-(defun ivy-occur-previous-line (&optional arg)
-  "Move the cursor up ARG lines.
-When `ivy-calling' isn't nil, call `ivy-occur-press'."
-  (interactive "p")
-  (forward-line (- arg))
-  (when ivy-calling
-    (ivy-occur-press)))
-
-(define-derived-mode ivy-occur-mode fundamental-mode "Ivy-Occur"
-  "Major mode for output from \\[ivy-occur].
-
-\\{ivy-occur-mode-map}"
-  (setq-local view-read-only nil))
-
-(defvar ivy-occur-grep-mode-map
-  (let ((map (copy-keymap ivy-occur-mode-map)))
-    (define-key map (kbd "C-x C-q") 'ivy-wgrep-change-to-wgrep-mode)
-    (define-key map (kbd "C-d") 'ivy-occur-delete-candidate)
-    map)
-  "Keymap for Ivy Occur Grep mode.")
-
-(defun ivy-occur-delete-candidate ()
-  (interactive)
-  (let ((inhibit-read-only t))
-    (delete-region (line-beginning-position)
-                   (1+ (line-end-position)))))
-
-(define-derived-mode ivy-occur-grep-mode grep-mode "Ivy-Occur"
-  "Major mode for output from \\[ivy-occur].
-
-\\{ivy-occur-grep-mode-map}"
-  (setq-local view-read-only nil)
-  (when (fboundp 'wgrep-setup)
-    (wgrep-setup)))
-
-(defvar ivy--occurs-list nil
-  "A list of custom occur generators per command.")
-
-(defun ivy-set-occur (cmd occur)
-  "Assign CMD a custom OCCUR function."
-  (setq ivy--occurs-list
-        (plist-put ivy--occurs-list cmd occur)))
-
-(ivy-set-occur 'ivy-switch-buffer 'ivy-switch-buffer-occur)
-(ivy-set-occur 'ivy-switch-buffer-other-window 'ivy-switch-buffer-occur)
-
-(defun ivy--occur-insert-lines (cands)
-  "Insert CANDS into `ivy-occur' buffer."
-  (dolist (str cands)
-    (add-text-properties
-     0 (length str)
-     `(mouse-face
-       highlight
-       help-echo "mouse-1: call ivy-action")
-     str)
-    (insert str "\n"))
-  (goto-char (point-min))
-  (forward-line 4))
-
-(defun ivy-occur ()
-  "Stop completion and put the current candidates into a new buffer.
-
-The new buffer remembers current action(s).
-
-While in the *ivy-occur* buffer, selecting a candidate with RET or
-a mouse click will call the appropriate action for that candidate.
-
-There is no limit on the number of *ivy-occur* buffers."
-  (interactive)
-  (if (not (window-minibuffer-p))
-      (user-error "No completion session is active")
-    (let* ((caller (ivy-state-caller ivy-last))
-           (occur-fn (plist-get ivy--occurs-list caller))
-           (buffer
-            (generate-new-buffer
-             (format "*ivy-occur%s \"%s\"*"
-                     (if caller
-                         (concat " " (prin1-to-string caller))
-                       "")
-                     ivy-text))))
-      (with-current-buffer buffer
-        (let ((inhibit-read-only t))
-          (erase-buffer)
-          (if occur-fn
-              (funcall occur-fn)
-            (ivy-occur-mode)
-            (insert (format "%d candidates:\n" (length ivy--old-cands)))
-            (read-only-mode)
-            (ivy--occur-insert-lines
-             (mapcar
-              (lambda (cand) (concat "    " cand))
-              ivy--old-cands))))
-        (setf (ivy-state-text ivy-last) ivy-text)
-        (setq ivy-occur-last ivy-last)
-        (setq-local ivy--directory ivy--directory))
-      (ivy-exit-with-action
-       `(lambda (_) (pop-to-buffer ,buffer))))))
-
-(defun ivy-occur-revert-buffer ()
-  "Refresh the buffer making it up-to date with the collection.
-
-Currently only works for `swiper'.  In that specific case, the
-*ivy-occur* buffer becomes nearly useless as the orignal buffer
-is updated, since the line numbers no longer match.
-
-Calling this function is as if you called `ivy-occur' on the
-updated original buffer."
-  (interactive)
-  (let ((caller (ivy-state-caller ivy-occur-last))
-        (ivy-last ivy-occur-last))
-    (cond ((eq caller 'swiper)
-           (let ((buffer (ivy-state-buffer ivy-occur-last)))
-             (unless (buffer-live-p buffer)
-               (error "Buffer was killed"))
-             (let ((inhibit-read-only t))
-               (erase-buffer)
-               (funcall (plist-get ivy--occurs-list caller) t)
-               (ivy-occur-grep-mode))))
-          ((memq caller '(counsel-git-grep counsel-grep counsel-ag counsel-rg))
-           (let ((inhibit-read-only t))
-             (erase-buffer)
-             (funcall (plist-get ivy--occurs-list caller)))))
-    (setq ivy-occur-last ivy-last)))
-
-(declare-function wgrep-change-to-wgrep-mode "ext:wgrep")
-
-(defun ivy-wgrep-change-to-wgrep-mode ()
-  "Forward to `wgrep-change-to-wgrep-mode'."
-  (interactive)
-  (if (require 'wgrep nil 'noerror)
-      (wgrep-change-to-wgrep-mode)
-    (error "Package wgrep isn't installed")))
-
-(defun ivy-occur-read-action ()
-  "Select one of the available actions as the current one."
-  (interactive)
-  (let ((ivy-last ivy-occur-last))
-    (ivy-read-action)))
-
-(defun ivy-occur-dispatch ()
-  "Call one of the available actions on the current item."
-  (interactive)
-  (let* ((state-action (ivy-state-action ivy-occur-last))
-         (actions (if (symbolp state-action)
-                      state-action
-                    (copy-sequence state-action))))
-    (unwind-protect
-         (progn
-           (ivy-occur-read-action)
-           (ivy-occur-press))
-      (setf (ivy-state-action ivy-occur-last) actions))))
-
-(defun ivy-occur-click (event)
-  "Execute action for the current candidate.
-EVENT gives the mouse position."
-  (interactive "e")
-  (let ((window (posn-window (event-end event)))
-        (pos (posn-point (event-end event))))
-    (with-current-buffer (window-buffer window)
-      (goto-char pos)
-      (ivy-occur-press))))
-
-(declare-function swiper--cleanup "swiper")
-(declare-function swiper--add-overlays "swiper")
-(defvar ivy-occur-timer nil)
-(defvar counsel-grep-last-line)
-
-(defun ivy-occur-press ()
-  "Execute action for the current candidate."
-  (interactive)
-  (when (save-excursion
-          (beginning-of-line)
-          (looking-at "\\(?:./\\|    \\)\\(.*\\)$"))
-    (when (memq (ivy-state-caller ivy-occur-last)
-                '(swiper counsel-git-grep counsel-grep counsel-ag counsel-rg
-                  counsel-describe-function counsel-describe-variable))
-      (let ((window (ivy-state-window ivy-occur-last)))
-        (when (or (null (window-live-p window))
-                  (equal window (selected-window)))
-          (save-selected-window
-            (setf (ivy-state-window ivy-occur-last)
-                  (display-buffer (ivy-state-buffer ivy-occur-last)
-                                  'display-buffer-pop-up-window))))))
-    (let* ((ivy-last ivy-occur-last)
-           (ivy-text (ivy-state-text ivy-last))
-           (str (buffer-substring
-                 (match-beginning 1)
-                 (match-end 1)))
-           (coll (ivy-state-collection ivy-last))
-           (action (ivy--get-action ivy-last))
-           (ivy-exit 'done))
-      (with-ivy-window
-        (setq counsel-grep-last-line nil)
-        (with-current-buffer (ivy-state-buffer ivy-last)
-          (funcall action
-                   (if (and (consp coll)
-                            (consp (car coll)))
-                       (assoc str coll)
-                     str)))
-        (if (memq (ivy-state-caller ivy-last)
-                  '(swiper counsel-git-grep counsel-grep counsel-ag counsel-rg))
-            (with-current-buffer (window-buffer (selected-window))
-              (swiper--cleanup)
-              (swiper--add-overlays
-               (ivy--regex ivy-text)
-               (line-beginning-position)
-               (line-end-position)
-               (selected-window))
-              (when (timerp ivy-occur-timer)
-                (cancel-timer ivy-occur-timer))
-              (setq ivy-occur-timer
-                    (run-at-time 1.0 nil 'swiper--cleanup))))))))
-
-(defun ivy-occur-press-and-switch ()
-  "Execute action for the current candidate and switch window."
-  (interactive)
-  (ivy-occur-press)
-  (select-window (ivy--get-window ivy-occur-last)))
-
-(defconst ivy-help-file (let ((default-directory
-                               (if load-file-name
-                                   (file-name-directory load-file-name)
-                                 default-directory)))
-                          (if (file-exists-p "ivy-help.org")
-                              (expand-file-name "ivy-help.org")
-                            (if (file-exists-p "doc/ivy-help.org")
-                                (expand-file-name "doc/ivy-help.org"))))
-  "The file for `ivy-help'.")
-
-(defun ivy-help ()
-  "Help for `ivy'."
-  (interactive)
-  (let ((buf (get-buffer "*Ivy Help*")))
-    (unless buf
-      (setq buf (get-buffer-create "*Ivy Help*"))
-      (with-current-buffer buf
-        (insert-file-contents ivy-help-file)
-        (org-mode)
-        (view-mode)
-        (goto-char (point-min))))
-    (if (eq this-command 'ivy-help)
-        (switch-to-buffer buf)
-      (with-ivy-window
-        (pop-to-buffer buf)))
-    (view-mode)
-    (goto-char (point-min))))
-
-(provide 'ivy)
-
-;;; ivy.el ends here
.emacs.d/elpa/ivy-20170911.1034/ivy.elc
Binary file
.emacs.d/elpa/ivy-20170911.1034/ivy.info
@@ -1,1864 +0,0 @@
-This is ivy.info, produced by makeinfo version 5.2 from ivy.texi.
-
-Ivy manual, version 0.8.0
-
-   Ivy is an interactive interface for completion in Emacs.  Emacs uses
-completion mechanism in a variety of contexts: code, menus, commands,
-variables, functions, etc.  Completion entails listing, sorting,
-filtering, previewing, and applying actions on selected items.  When
-active, ‘ivy-mode’ completes the selection process by narrowing
-available choices while previewing in the minibuffer.  Selecting the
-final candidate is either through simple keyboard character inputs or
-through powerful regular expressions.
-
-   Copyright (C) 2015 Free Software Foundation, Inc.
-
-     Permission is granted to copy, distribute and/or modify this
-     document under the terms of the GNU Free Documentation License,
-     Version 1.3 or any later version published by the Free Software
-     Foundation; with no Invariant Sections, with the Front-Cover Texts
-     being “A GNU Manual,” and with the Back-Cover Texts as in (a)
-     below.  A copy of the license is included in the section entitled
-     “GNU Free Documentation License.”
-
-     (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
-     modify this GNU manual.”
-INFO-DIR-SECTION Emacs
-START-INFO-DIR-ENTRY
-* Ivy: (ivy).           Using Ivy for completion.
-END-INFO-DIR-ENTRY
-
-
-File: ivy.info,  Node: Top,  Next: Introduction,  Up: (dir)
-
-Ivy User Manual
-***************
-
-Ivy manual, version 0.8.0
-
-   Ivy is an interactive interface for completion in Emacs.  Emacs uses
-completion mechanism in a variety of contexts: code, menus, commands,
-variables, functions, etc.  Completion entails listing, sorting,
-filtering, previewing, and applying actions on selected items.  When
-active, ‘ivy-mode’ completes the selection process by narrowing
-available choices while previewing in the minibuffer.  Selecting the
-final candidate is either through simple keyboard character inputs or
-through powerful regular expressions.
-
-   Copyright (C) 2015 Free Software Foundation, Inc.
-
-     Permission is granted to copy, distribute and/or modify this
-     document under the terms of the GNU Free Documentation License,
-     Version 1.3 or any later version published by the Free Software
-     Foundation; with no Invariant Sections, with the Front-Cover Texts
-     being “A GNU Manual,” and with the Back-Cover Texts as in (a)
-     below.  A copy of the license is included in the section entitled
-     “GNU Free Documentation License.”
-
-     (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
-     modify this GNU manual.”
-
-* Menu:
-
-* Introduction::
-* Installation::
-* Getting started::
-* Key bindings::
-* Completion Styles::
-* Customization::
-* Commands::
-* API::
-* Variable Index::
-* Keystroke Index::
-
-— The Detailed Node Listing —
-
-
-Installation
-
-* Installing from Emacs Package Manager::
-* Installing from the Git repository::
-
-
-
-Getting started
-
-* Basic customization::
-
-
-Key bindings
-
-* Global key bindings::
-* Minibuffer key bindings::
-
-
-Minibuffer key bindings
-
-* Key bindings for navigation::
-* Key bindings for single selection, action, then exit minibuffer: Key bindings for single selection action then exit minibuffer.
-* Key bindings for multiple selections and actions, keep minibuffer open: Key bindings for multiple selections and actions keep minibuffer open.
-* Key bindings that alter the minibuffer input::
-* Other key bindings::
-* Hydra in the minibuffer::
-* Saving the current completion session to a buffer::
-
-Completion Styles
-
-* ivy--regex-plus::
-* ivy--regex-ignore-order::
-* ivy--regex-fuzzy::
-
-
-
-Customization
-
-* Faces::
-* Defcustoms::
-* Actions::
-* Packages::
-
-
-
-Actions
-
-* What are actions?::
-* How can different actions be called?::
-* How to modify the actions list?::
-* Example - add two actions to each command::
-* Example - define a new command with several actions::
-
-
-
-
-Example - add two actions to each command
-
-* How to undo adding the two actions::
-* How to add actions to a specific command::
-
-
-
-Example - define a new command with several actions
-
-* Test the above function with ‘ivy-occur’::
-
-Commands
-
-* File Name Completion::
-* Buffer Name Completion::
-* Counsel commands::
-
-
-
-API
-
-* Required arguments for ‘ivy-read’::
-* Optional arguments for ‘ivy-read’::
-* Example - ‘counsel-describe-function’::
-* Example - ‘counsel-locate’::
-
-
-File: ivy.info,  Node: Introduction,  Next: Installation,  Prev: Top,  Up: Top
-
-1 Introduction
-**************
-
-Ivy is for quick and easy selection from a list.  When Emacs prompts for
-a string from a list of several possible choices, Ivy springs into
-action to assist in narrowing and picking the right string from a vast
-number of choices.
-
-   Ivy strives for minimalism, simplicity, customizability and
-discoverability.
-
-Minimalism
-..........
-
-     Uncluttered minibuffer is minimalism.  Ivy shows the completion
-     defaults, the number of matches, and 10 candidate matches below the
-     input line.  Customize ‘ivy-height’ to adjust the number of
-     candidate matches displayed in the minibuffer.
-
-Simplicity
-..........
-
-     Simplicity is about Ivy’s behavior in the minibuffer.  It is also
-     about the code interface to extend Ivy’s functionality.  The
-     minibuffer area behaves as close to ‘fundamental-mode’ as possible.
-     ‘SPC’ inserts a space, for example, instead of being bound to the
-     more complex ‘minibuffer-complete-word’.  Ivy’s code uses
-     easy-to-examine global variables; avoids needless complications
-     with branch-introducing custom macros.
-
-Customizability
-...............
-
-     Customizability is about being able to use different methods and
-     interfaces of completion to tailor the selection process.  For
-     example, adding a custom display function that points to a selected
-     candidate with ‘>’, instead of highlighting the selected candidate
-     with the ‘ivy-current-match’ face (see ‘ivy-format-function’).  Or
-     take the customization of actions, say after the candidate function
-     is selected.  ‘RET’ uses ‘counsel-describe-function’ to describe
-     the function, whereas ‘M-o d’ jumps to that function’s definition
-     in the code.  The ‘M-o’ prefix can be uniformly used with
-     characters like ‘d’ to group similar actions.
-
-Discoverability
-...............
-
-     Ivy displays easily discoverable commands through the hydra
-     facility.  ‘C-o’ in the minibuffer displays a hydra menu.  It opens
-     up within an expanded minibuffer area.  Each menu item comes with
-     short documentation strings and highlighted one-key completions.
-     So discovering even seldom used keys is simply a matter of ‘C-o’ in
-     the minibuffer while in the midst of the Ivy interaction.  This
-     discoverability minimizes exiting Ivy interface for documentation
-     look-ups.
-
-
-File: ivy.info,  Node: Installation,  Next: Getting started,  Prev: Introduction,  Up: Top
-
-2 Installation
-**************
-
-Install Ivy automatically through Emacs’s package manager, or manually
-from Ivy’s development repository.
-
-   Emacs 24.3.1 is the oldest version to run Ivy.  Emacs 24.5.1 is the
-oldest version that runs Ivy with fancy faces display.
-
-* Menu:
-
-* Installing from Emacs Package Manager::
-* Installing from the Git repository::
-
-
-File: ivy.info,  Node: Installing from Emacs Package Manager,  Next: Installing from the Git repository,  Up: Installation
-
-2.1 Installing from Emacs Package Manager
-=========================================
-
-‘M-x’ ‘package-install’ ‘RET’ ‘swiper’ ‘RET’
-
-   Ivy is installed as part of ‘swiper’ package.  ‘swiper’ is available
-from two different package archives, GNU ELPA and MELPA. For the latest
-stable version, use the GNU ELPA archives using the above M-x command.
-
-   For current hourly builds, use the MELPA archives.  See the code
-below for adding MELPA to the list of package archives:
-
-     (require 'package)
-     (add-to-list 'package-archives
-                  '("melpa" . "http://melpa.org/packages/"))
-
-   After this do ‘M-x’ ‘package-refresh-contents’ ‘RET’, followed by
-‘M-x’ ‘package-install’ ‘RET’ ‘counsel’ ‘RET’.
-
-   For package manager details, see *note (emacs)Packages::.
-
-
-File: ivy.info,  Node: Installing from the Git repository,  Prev: Installing from Emacs Package Manager,  Up: Installation
-
-2.2 Installing from the Git repository
-======================================
-
-Why install from Git?
-.....................
-
-        • No need to wait for MELPA’s hourly builds
-        • Easy to revert to previous versions
-        • Contribute to Ivy’s development; send patches; pull requests
-
-Configuration steps
-...................
-
-     First clone the Swiper repository with:
-
-               cd ~/git && git clone https://github.com/abo-abo/swiper
-               cd swiper && make compile
-
-     Second, add these lines to the Emacs init file:
-
-               (add-to-list 'load-path "~/git/swiper/")
-               (require 'ivy)
-
-     Then, update the code with:
-
-               git pull
-               make
-
-
-File: ivy.info,  Node: Getting started,  Next: Key bindings,  Prev: Installation,  Up: Top
-
-3 Getting started
-*****************
-
-First enable Ivy completion everywhere:
-
-     (ivy-mode 1)
-
-   Note: ‘ivy-mode’ can be toggled on and off with ‘M-x’ ‘ivy-mode’.
-
-* Menu:
-
-* Basic customization::
-
-
-File: ivy.info,  Node: Basic customization,  Up: Getting started
-
-3.1 Basic customization
-=======================
-
-Here are some basic settings particularly useful for new Ivy users:
-
-     (setq ivy-use-virtual-buffers t)
-     (setq ivy-count-format "(%d/%d) ")
-
-   If you want, you can go without any customizations at all.  The above
-settings are the most bang for the buck in terms of customization.  So
-users that typically don’t like customize a lot are advised to look at
-these settings first.
-
-   For more advanced customizations, refer to ‘M-x describe-variable’
-documentation.
-
-
-File: ivy.info,  Node: Key bindings,  Next: Completion Styles,  Prev: Getting started,  Up: Top
-
-4 Key bindings
-**************
-
-* Menu:
-
-* Global key bindings::
-* Minibuffer key bindings::
-
-
-File: ivy.info,  Node: Global key bindings,  Next: Minibuffer key bindings,  Up: Key bindings
-
-4.1 Global key bindings
-=======================
-
-The recommended key bindings are:
-
-Ivy-based interface to standard commands
-........................................
-
-               (global-set-key (kbd "C-s") 'swiper)
-               (global-set-key (kbd "M-x") 'counsel-M-x)
-               (global-set-key (kbd "C-x C-f") 'counsel-find-file)
-               (global-set-key (kbd "<f1> f") 'counsel-describe-function)
-               (global-set-key (kbd "<f1> v") 'counsel-describe-variable)
-               (global-set-key (kbd "<f1> l") 'counsel-find-library)
-               (global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
-               (global-set-key (kbd "<f2> u") 'counsel-unicode-char)
-
-Ivy-based interface to shell and system tools
-.............................................
-
-               (global-set-key (kbd "C-c g") 'counsel-git)
-               (global-set-key (kbd "C-c j") 'counsel-git-grep)
-               (global-set-key (kbd "C-c k") 'counsel-ag)
-               (global-set-key (kbd "C-x l") 'counsel-locate)
-               (global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
-
-Ivy-resume and other commands
-.............................
-
-     ‘ivy-resume’ resumes the last Ivy-based completion.
-
-               (global-set-key (kbd "C-c C-r") 'ivy-resume)
-
-
-File: ivy.info,  Node: Minibuffer key bindings,  Prev: Global key bindings,  Up: Key bindings
-
-4.2 Minibuffer key bindings
-===========================
-
-Ivy includes several minibuffer bindings, which are defined in the
-‘ivy-minibuffer-map’ keymap variable.  The most frequently used ones are
-described here.
-
-   ‘swiper’ or ‘counsel-M-x’ add more key bindings through the ‘keymap’
-argument to ‘ivy-read’.  These keys, also active in the minibuffer, are
-described under their respective commands.
-
-   A key feature of ‘ivy-minibuffer-map’ is its full editing capability
-where the familiar ‘C-a’, ‘C-f’, ‘M-d’, ‘M-DEL’, ‘M-b’, ‘M-w’, ‘C-k’,
-‘C-y’ key bindings work the same as in ‘fundamental-mode’.
-
-* Menu:
-
-* Key bindings for navigation::
-* Key bindings for single selection, action, then exit minibuffer: Key bindings for single selection action then exit minibuffer.
-* Key bindings for multiple selections and actions, keep minibuffer open: Key bindings for multiple selections and actions keep minibuffer open.
-* Key bindings that alter the minibuffer input::
-* Other key bindings::
-* Hydra in the minibuffer::
-* Saving the current completion session to a buffer::
-
-
-File: ivy.info,  Node: Key bindings for navigation,  Next: Key bindings for single selection action then exit minibuffer,  Up: Minibuffer key bindings
-
-4.2.1 Key bindings for navigation
----------------------------------
-
-   • ‘C-n’ (‘ivy-next-line’) selects the next candidate
-   • ‘C-p’ (‘ivy-previous-line’) selects the previous candidate
-   • ‘M-<’ (‘ivy-beginning-of-buffer’) selects the first candidate
-   • ‘M->’ (‘ivy-end-of-buffer’) selects the last candidate
-   • ‘C-v’ (‘ivy-scroll-up-command’) scrolls up by ‘ivy-height’ lines
-   • ‘M-v’ (‘ivy-scroll-down-command’) scrolls down by ‘ivy-height’
-     lines
-
- -- User Option: ivy-wrap
-     Specifies the wrap-around behavior for ‘C-n’ and ‘C-p’.  When
-     ‘ivy-wrap’ is set to ‘t’, ‘ivy-next-line’ and ‘ivy-previous-line’
-     will cycle past the last and the first candidates respectively.
-
-     Warp-around behavior is off by default.
-
- -- User Option: ivy-height
-     Use this option to adjust the minibuffer height, which also affects
-     scroll size when using ‘C-v’ and ‘M-v’ key bindings.
-
-     ‘ivy-height’ is 10 lines by default.
-
-
-File: ivy.info,  Node: Key bindings for single selection action then exit minibuffer,  Next: Key bindings for multiple selections and actions keep minibuffer open,  Prev: Key bindings for navigation,  Up: Minibuffer key bindings
-
-4.2.2 Key bindings for single selection, action, then exit minibuffer
----------------------------------------------------------------------
-
-Ivy can offer several actions from which to choose which action to run.
-This "calling an action" operates on the selected candidate.  For
-example, when viewing a list of files, one action could open it for
-editing, one to view it, another to invoke a special function, and so
-on.  Custom actions can be added to this interface.  The precise action
-to call on the selected candidate can be delayed until after the
-narrowing is completed.  No need to exit the interface if unsure which
-action to run.  This delayed flexibility and customization of actions
-extends usability of lists in Emacs.
-
-‘C-m’ or ‘RET’ (‘ivy-done’)
-...........................
-
-     Calls the default action and then exits the minibuffer.
-
-‘M-o’ (‘ivy-dispatching-done’)
-..............................
-
-     Presents valid actions from which to choose.  When only one action
-     is available, there is no difference between ‘M-o’ and ‘C-m’.
-
-‘C-j’ (‘ivy-alt-done’)
-......................
-
-     When completing file names, selects the current directory candidate
-     and starts a new completion session there.  Otherwise, it is the
-     same as ‘ivy-done’.
-
-‘TAB’ (‘ivy-partial-or-done’)
-.............................
-
-     Attempts partial completion, extending current input as much as
-     possible.  ‘TAB TAB’ is the same as ‘C-j’ (‘ivy-alt-done’).
-
-     Example ERT test:
-
-               (should
-                (equal (ivy-with
-                        '(progn
-                          (ivy-read "Test: " '("can do" "can't, sorry" "other"))
-                          ivy-text)
-                        "c <tab>")
-                       "can"))
-
-‘C-M-j’ (‘ivy-immediate-done’)
-..............................
-
-     Exits with _the current input_ instead of _the current candidate_
-     (like other commands).
-
-     This is useful e.g.  when you call ‘find-file’ to create a new
-     file, but the desired name matches an existing file.  In that case,
-     using ‘C-j’ would select that existing file, which isn’t what you
-     want - use this command instead.
-
-‘C-'’ (‘ivy-avy’)
-.................
-
-     Uses avy to select one of the candidates on the current candidate
-     page.  This can often be faster than multiple ‘C-n’ or ‘C-p’
-     keystrokes followed by ‘C-m’.
-
-
-File: ivy.info,  Node: Key bindings for multiple selections and actions keep minibuffer open,  Next: Key bindings that alter the minibuffer input,  Prev: Key bindings for single selection action then exit minibuffer,  Up: Minibuffer key bindings
-
-4.2.3 Key bindings for multiple selections and actions, keep minibuffer open
-----------------------------------------------------------------------------
-
-For repeatedly applying multiple actions or acting on multiple
-candidates, Ivy does not close the minibuffer between commands.  It
-keeps the minibuffer open for applying subsequent actions.
-
-   Adding an extra meta key to the normal key chord invokes the special
-version of the regular commands that enables applying multiple actions.
-
-‘C-M-m’ (‘ivy-call’)
-....................
-
-     Is the non-exiting version of ‘C-m’ (‘ivy-done’).
-
-     Instead of closing the minibuffer, ‘C-M-m’ allows selecting another
-     candidate or another action.  For example, ‘C-M-m’ on functions
-     list invokes ‘describe-function’.  When combined with ‘C-n’,
-     function descriptions can be invoked quickly in succession.
-
-‘C-M-o’ (‘ivy-dispatching-call’)
-................................
-
-     Is the non-exiting version of ‘M-o’ (‘ivy-dispatching-done’).
-
-     For example, during the ‘counsel-rhythmbox’ completion, press
-     ‘C-M-o e’ to en-queue the selected candidate, followed by ‘C-n C-m’
-     to play the next candidate - the current action reverts to the
-     default one after ‘C-M-o’.
-
-‘C-M-n’ (‘ivy-next-line-and-call’)
-..................................
-
-     Combines ‘C-n’ and ‘C-M-m’.  Applies an action and moves to next
-     line.
-
-     Comes in handy when opening multiple files from
-     ‘counsel-find-file’, ‘counsel-git-grep’, ‘counsel-ag’,
-     ‘counsel-rg’, or ‘counsel-locate’ lists.  Just hold ‘C-M-n’ for
-     rapid-fire default action on each successive element of the list.
-
-‘C-M-p’ (‘ivy-previous-line-and-call’)
-......................................
-
-     Combines ‘C-p’ and ‘C-M-m’.
-
-     Similar to the above except it moves through the list in the other
-     direction.
-
-‘ivy-resume’
-............
-
-     Recalls the state of the completion session just before its last
-     exit.
-
-     Useful after an accidental ‘C-m’ (‘ivy-done’).
-
-
-File: ivy.info,  Node: Key bindings that alter the minibuffer input,  Next: Other key bindings,  Prev: Key bindings for multiple selections and actions keep minibuffer open,  Up: Minibuffer key bindings
-
-4.2.4 Key bindings that alter the minibuffer input
---------------------------------------------------
-
-‘M-n’ (‘ivy-next-history-element’)
-..................................
-
-     Cycles forward through the Ivy command history.
-
-     Ivy updates an internal history list after each action.  When this
-     history list is empty, ‘M-n’ inserts symbol (or URL) at point into
-     the minibuffer.
-
-‘M-p’ (‘ivy-previous-history-element’)
-......................................
-
-     Cycles forward through the Ivy command history.
-
-‘M-i’ (‘ivy-insert-current’)
-............................
-
-     Inserts the current candidate into the minibuffer.
-
-     Useful for copying and renaming files, for example: ‘M-i’ to insert
-     the original file name string, edit it, and then ‘C-m’ to complete
-     the renaming.
-
-‘M-j’ (‘ivy-yank-word’)
-.......................
-
-     Inserts the sub-word at point into the minibuffer.
-
-     This is similar to ‘C-s C-w’ with ‘isearch’.  Ivy reserves ‘C-w’
-     for ‘kill-region’.
-
-‘S-SPC’ (‘ivy-restrict-to-matches’)
-...................................
-
-     Deletes the current input, and resets the candidates list to the
-     currently restricted matches.
-
-     This is how Ivy provides narrowing in successive tiers.
-
-‘C-r’ (‘ivy-reverse-i-search’)
-..............................
-
-     Starts a recursive completion session through the command’s
-     history.
-
-     This works just like ‘C-r’ at the bash command prompt, where the
-     completion candidates are the history items.  Upon completion, the
-     selected candidate string is inserted into the minibuffer.
-
-
-File: ivy.info,  Node: Other key bindings,  Next: Hydra in the minibuffer,  Prev: Key bindings that alter the minibuffer input,  Up: Minibuffer key bindings
-
-4.2.5 Other key bindings
-------------------------
-
-‘M-w’ (‘ivy-kill-ring-save’)
-............................
-
-     Copies selected candidates to the kill ring.
-
-     Copies the region if the region is active.
-
-
-File: ivy.info,  Node: Hydra in the minibuffer,  Next: Saving the current completion session to a buffer,  Prev: Other key bindings,  Up: Minibuffer key bindings
-
-4.2.6 Hydra in the minibuffer
------------------------------
-
-‘C-o’ (‘hydra-ivy/body’)
-........................
-
-     Invokes the hydra menu with short key bindings.
-
-   When Hydra is active, minibuffer editing is disabled and menus
-display short aliases:
-
-Short   Normal      Command name
-------------------------------------------------
-‘o’     ‘C-g’       ‘keyboard-escape-quit’
-‘j’     ‘C-n’       ‘ivy-next-line’
-‘k’     ‘C-p’       ‘ivy-previous-line’
-‘h’     ‘M-<’       ‘ivy-beginning-of-buffer’
-‘l’     ‘M->’       ‘ivy-end-of-buffer’
-‘d’     ‘C-m’       ‘ivy-done’
-‘f’     ‘C-j’       ‘ivy-alt-done’
-‘g’     ‘C-M-m’     ‘ivy-call’
-‘u’     ‘C-c C-o’   ‘ivy-occur’
-
-   Hydra reduces key strokes, for example: ‘C-n C-n C-n C-n’ is ‘C-o
-jjjj’ in Hydra.
-
-   Hydra menu offers these additioanl bindings:
-
-‘c’ (‘ivy-toggle-calling’)
-..........................
-
-     Toggle calling the action after each candidate change.  It modifies
-     ‘j’ to ‘jg’, ‘k’ to ‘kg’ etc.
-
-‘m’ (‘ivy-toggle-fuzzy’)
-........................
-
-     Toggle the current regexp matcher.
-
-‘>’ (‘ivy-minibuffer-grow’)
-...........................
-
-     Increase ‘ivy-height’ for the current minibuffer.
-
-‘<’ (‘ivy-minibuffer-shrink’)
-.............................
-
-     Decrease ‘ivy-height’ for the current minibuffer.
-
-‘w’ (‘ivy-prev-action’)
-.......................
-
-     Select the previous action.
-
-‘s’ (‘ivy-next-action’)
-.......................
-
-     Select the next action.
-
-‘a’ (‘ivy-read-action’)
-.......................
-
-     Use a menu to select an action.
-
-‘C’ (‘ivy-toggle-case-fold’)
-............................
-
-     Toggle case folding (match both upper and lower case characters for
-     lower case input).
-
-
-File: ivy.info,  Node: Saving the current completion session to a buffer,  Prev: Hydra in the minibuffer,  Up: Minibuffer key bindings
-
-4.2.7 Saving the current completion session to a buffer
--------------------------------------------------------
-
-‘C-c C-o’ (‘ivy-occur’)
-.......................
-
-     Saves the current candidates to a new buffer and exits completion.
-
-   The new buffer is read-only and has a few useful bindings defined.
-
-‘RET’ or ‘j’ (‘ivy-occur-press’)
-................................
-
-     Call the current action on the selected candidate.
-
-‘mouse-1’ (‘ivy-occur-click’)
-.............................
-
-     Call the current action on the selected candidate.
-
-‘j’ (‘next-line’)
-.................
-
-     Move to next line.
-
-‘k’ (‘previous-line’)
-.....................
-
-     Move to previous line.
-
-‘a’ (‘ivy-occur-read-action’)
-.............................
-
-     Read an action and make it current for this buffer.
-
-‘o’ (‘ivy-occur-dispatch’)
-..........................
-
-     Read an action and call it on the selected candidate.
-
-‘q’ (‘quit-window’)
-...................
-
-     Bury the current buffer.
-
-   Ivy has no limit on the number of active buffers like these.
-
-   Ivy takes care of naming buffers uniquely by constructing descriptive
-names.  For example: ‘*ivy-occur counsel-describe-variable "function$*’.
-
-
-File: ivy.info,  Node: Completion Styles,  Next: Customization,  Prev: Key bindings,  Up: Top
-
-5 Completion Styles
-*******************
-
-Ivy’s completion functions rely on a regex builder - a function that
-transforms a string input to a string regex.  All current candidates
-simply have to match this regex.  Each collection can be assigned its
-own regex builder by customizing ‘ivy-re-builders-alist’.
-
-   The keys of this alist are collection names, and the values are one
-of the following:
-   • ‘ivy--regex’
-   • ‘ivy--regex-plus’
-   • ‘ivy--regex-ignore-order’
-   • ‘ivy--regex-fuzzy’
-   • ‘regexp-quote’
-
-   A catch-all key, ‘t’, applies to all collections that don’t have
-their own key.
-
-   The default is:
-
-     (setq ivy-re-builders-alist
-           '((t . ivy--regex-plus)))
-
-   This example shows a custom regex builder assigned to file name
-completion:
-
-     (setq ivy-re-builders-alist
-           '((read-file-name-internal . ivy--regex-fuzzy)
-             (t . ivy--regex-plus)))
-
-   Here, ‘read-file-name-internal’ is a function that is passed as the
-second argument to ‘completing-read’ for file name completion.
-
-   The regex builder resolves as follows (in order of priority):
-  1. ‘re-builder’ argument passed to ‘ivy-read’.
-  2. ‘collection’ argument passed to ‘ivy-read’ is a function and has an
-     entry on ‘ivy-re-builders-alist’.
-  3. ‘caller’ argument passed to ‘ivy-read’ has an entry on
-     ‘ivy-re-builders-alist’.
-  4. ‘this-command’ has an entry on ‘ivy-re-builders-alist’.
-  5. ‘t’ has an entry on ‘ivy-re-builders-alist’.
-  6. ‘ivy--regex’.
-
-* Menu:
-
-* ivy--regex-plus::
-* ivy--regex-ignore-order::
-* ivy--regex-fuzzy::
-
-
-File: ivy.info,  Node: ivy--regex-plus,  Next: ivy--regex-ignore-order,  Up: Completion Styles
-
-5.1 ivy–regex-plus
-==================
-
-‘ivy--regex-plus’ is Ivy’s default completion method.
-
-   ‘ivy--regex-plus’ matches by splitting the input by spaces and
-rebuilding it into a regex.
-
-   As the search string is typed in Ivy’s minibuffer, it is transformed
-into valid regex syntax.  If the string is ‘"for example"’, it is
-transformed into
-
-     "\\(for\\).*\\(example\\)"
-
-   which in regex terminology matches ‘"for"’ followed by a wild card
-and then ‘"example"’.  Note how Ivy uses the space character to build
-wild cards.  To match a literal white space, use an extra space.  So to
-match one space type two spaces, to match two spaces type three spaces,
-and so on.
-
-   As Ivy transforms typed characters into regex strings, it provides an
-intuitive feedback through font highlights.
-
-   Ivy supports regexp negation with ‘"!"’.  For example, ‘"define key !
-ivy quit"’ first selects everything matching ‘"define.*key"’, then
-removes everything matching ‘"ivy"’, and finally removes everything
-matching ‘"quit"’.  What remains is the final result set of the negation
-regexp.
-
-   Since Ivy treats minibuffer input as a regexp, the standard regexp
-identifiers work: ‘"^"’, ‘"$"’, ‘"\b"’ or ‘"[a-z]"’.  The exceptions are
-spaces, which translate to ‘".*"’, and ‘"!"’ that signal the beginning
-of a negation group.
-
-
-File: ivy.info,  Node: ivy--regex-ignore-order,  Next: ivy--regex-fuzzy,  Prev: ivy--regex-plus,  Up: Completion Styles
-
-5.2 ivy–regex-ignore-order
-==========================
-
-‘ivy--regex-ignore-order’ ignores the order of regexp tokens when
-searching for matching candidates.  For instance, the input ‘"for
-example"’ will match ‘"example test for"’.
-
-
-File: ivy.info,  Node: ivy--regex-fuzzy,  Prev: ivy--regex-ignore-order,  Up: Completion Styles
-
-5.3 ivy–regex-fuzzy
-===================
-
-‘ivy--regex-fuzzy’ splits each character with a wild card.  Searching
-for ‘"for"’ returns all ‘"f.*o.*r"’ matches, resulting in a large number
-of hits.  Yet some searches need these extra hits.  Ivy sorts such large
-lists using ‘flx’ package’s scoring mechanism, if it’s installed.
-
-   ‘C-o m’ toggles the current regexp builder.
-
-
-File: ivy.info,  Node: Customization,  Next: Commands,  Prev: Completion Styles,  Up: Top
-
-6 Customization
-***************
-
-* Menu:
-
-* Faces::
-* Defcustoms::
-* Actions::
-* Packages::
-
-
-File: ivy.info,  Node: Faces,  Next: Defcustoms,  Up: Customization
-
-6.1 Faces
-=========
-
-‘ivy-current-match’
-...................
-
-     Highlights the currently selected candidate.
-
-‘ivy-minibuffer-match-face-1’
-.............................
-
-     Highlights the background of the match.
-
-‘ivy-minibuffer-match-face-2’
-.............................
-
-     Highlights the first (modulo 3) matched group.
-
-‘ivy-minibuffer-match-face-3’
-.............................
-
-     Highlights the second (modulo 3) matched group.
-
-‘ivy-minibuffer-match-face-4’
-.............................
-
-     Highlights the third (modulo 3) matched group.
-
-‘ivy-confirm-face’
-..................
-
-     Highlights the "(confirm)" part of the prompt.
-
-     When ‘confirm-nonexistent-file-or-buffer’ set to ‘t’, then
-     confirming non-existent files in ‘ivy-mode’ requires an additional
-     ‘RET’.
-
-     The confirmation prompt will use this face.
-
-     For example:
-
-               (setq confirm-nonexistent-file-or-buffer t)
-
-     Then call ‘find-file’, enter "eldorado" and press ‘RET’ - the
-     prompt will be appended with "(confirm)".  Press ‘RET’ once more to
-     confirm, or any key to continue the completion.
-
-‘ivy-match-required-face’
-.........................
-
-     Highlights the "(match required)" part of the prompt.
-
-     When completions have to match available candidates and cannot take
-     random input, the "(match required)" prompt signals this
-     constraint.
-
-     For example, call ‘describe-variable’, enter "waldo" and press
-     ‘RET’ - "(match required)" is prompted.  Press any key for the
-     prompt to disappear.
-
-‘ivy-subdir’
-............
-
-     Highlights directories when completing file names.
-
-‘ivy-remote’
-............
-
-     Highlights remote files when completing file names.
-
-‘ivy-virtual’
-.............
-
-     Highlights virtual buffers when completing buffer names.
-
-     Virtual buffers correspond to bookmarks and recent files list,
-     ‘recentf’.
-
-     Enable virtual buffers with:
-
-               (setq ivy-use-virtual-buffers t)
-
-
-File: ivy.info,  Node: Defcustoms,  Next: Actions,  Prev: Faces,  Up: Customization
-
-6.2 Defcustoms
-==============
-
- -- User Option: ivy-count-format
-     A string that specifies display of number of candidates and current
-     candidate, if one exists.
-
-     The number of matching candidates by default is shown as a right-
-     padded integer value.
-
-     To disable showing the number of candidates:
-
-               (setq ivy-count-format "")
-
-     To also display the current candidate:
-
-               (setq ivy-count-format "(%d/%d) ")
-
-     The ‘format’-style switches this variable uses are described in the
-     ‘format’ documentation.
-
- -- User Option: ivy-display-style
-     Specifies highlighting candidates in the minibuffer.
-
-     The default setting is ‘'fancy’ and valid only in Emacs versions
-     24.5 or newer.
-
-     Set ‘ivy-display-style’ to ‘nil’ for a plain minibuffer.
-
- -- User Option: ivy-on-del-error-function
-     Specify what when ‘DEL’ (‘ivy-backward-delete-char’) throws.
-
-     The default behavior is to quit the completion after ‘DEL’ – a
-     handy key to invoke after mistakenly triggering a completion.
-
-
-File: ivy.info,  Node: Actions,  Next: Packages,  Prev: Defcustoms,  Up: Customization
-
-6.3 Actions
-===========
-
-* Menu:
-
-* What are actions?::
-* How can different actions be called?::
-* How to modify the actions list?::
-* Example - add two actions to each command::
-* Example - define a new command with several actions::
-
-
-File: ivy.info,  Node: What are actions?,  Next: How can different actions be called?,  Up: Actions
-
-6.3.1 What are actions?
------------------------
-
-An action is a function that is called after you select a candidate
-during completion.  This function takes a single string argument, which
-is the selected candidate.
-
-Window context when calling an action
-.....................................
-
-     Currently, the action is executed in the minibuffer window context.
-     This means e.g.  that if you call ‘insert’ the text will be
-     inserted into the minibuffer.
-
-     If you want to execute the action in the initial window from which
-     the completion started, use the ‘with-ivy-window’ wrapper macro.
-
-               (defun ivy-insert-action (x)
-                 (with-ivy-window
-                   (insert x)))
-
-
-File: ivy.info,  Node: How can different actions be called?,  Next: How to modify the actions list?,  Prev: What are actions?,  Up: Actions
-
-6.3.2 How can different actions be called?
-------------------------------------------
-
-   • ‘C-m’ (‘ivy-done’) calls the current action.
-   • ‘M-o’ (‘ivy-dispatching-done’) presents available actions for
-     selection, calls it after selection, and then exits.
-   • ‘C-M-o’ (‘ivy-dispatching-call’) presents available actions for
-     selection, calls it after selection, and then does not exit.
-
-
-File: ivy.info,  Node: How to modify the actions list?,  Next: Example - add two actions to each command,  Prev: How can different actions be called?,  Up: Actions
-
-6.3.3 How to modify the actions list?
--------------------------------------
-
-Currently, you can append any amount of your own actions to the default
-list of actions.  This can be done either for a specific command, or for
-all commands at once.
-
-   Usually, the command has only one default action.  The convention is
-to use single letters when selecting a command, and the letter ‘o’ is
-designated for the default command.  This way, ‘M-o o’ should be always
-equivalent to ‘C-m’.
-
-
-File: ivy.info,  Node: Example - add two actions to each command,  Next: Example - define a new command with several actions,  Prev: How to modify the actions list?,  Up: Actions
-
-6.3.4 Example - add two actions to each command
------------------------------------------------
-
-The first action inserts the current candidate into the Ivy window - the
-window from which ‘ivy-read’ was called.
-
-   The second action copies the current candidate to the kill ring.
-
-     (defun ivy-yank-action (x)
-       (kill-new x))
-
-     (defun ivy-copy-to-buffer-action (x)
-       (with-ivy-window
-         (insert x)))
-
-     (ivy-set-actions
-      t
-      '(("i" ivy-copy-to-buffer-action "insert")
-        ("y" ivy-yank-action "yank")))
-
-   Then in any completion session, ‘M-o y’ invokes ‘ivy-yank-action’,
-and ‘M-o i’ invokes ‘ivy-copy-to-buffer-action’.
-
-* Menu:
-
-* How to undo adding the two actions::
-* How to add actions to a specific command::
-
-
-File: ivy.info,  Node: How to undo adding the two actions,  Next: How to add actions to a specific command,  Up: Example - add two actions to each command
-
-6.3.4.1 How to undo adding the two actions
-..........................................
-
-Since ‘ivy-set-actions’ modifies the internal dictionary with new data,
-set the extra actions list to ‘nil’ by assigning ‘nil’ value to the ‘t’
-key as follows:
-
-     (ivy-set-actions t nil)
-
-
-File: ivy.info,  Node: How to add actions to a specific command,  Prev: How to undo adding the two actions,  Up: Example - add two actions to each command
-
-6.3.4.2 How to add actions to a specific command
-................................................
-
-Use the command name as the key:
-
-     (ivy-set-actions
-      'swiper
-      '(("i" ivy-copy-to-buffer-action "insert")
-        ("y" ivy-yank-action "yank")))
-
-
-File: ivy.info,  Node: Example - define a new command with several actions,  Prev: Example - add two actions to each command,  Up: Actions
-
-6.3.5 Example - define a new command with several actions
----------------------------------------------------------
-
-     (defun my-action-1 (x)
-       (message "action-1: %s" x))
-
-     (defun my-action-2 (x)
-       (message "action-2: %s" x))
-
-     (defun my-action-3 (x)
-       (message "action-3: %s" x))
-
-     (defun my-command-with-3-actions ()
-       (interactive)
-       (ivy-read "test: " '("foo" "bar" "baz")
-                 :action '(1
-                           ("o" my-action-1 "action 1")
-                           ("j" my-action-2 "action 2")
-                           ("k" my-action-3 "action 3"))))
-
-   The number 1 above is the index of the default action.  Each action
-has its own string description for easy selection.
-
-* Menu:
-
-* Test the above function with ‘ivy-occur’::
-
-
-File: ivy.info,  Node: Test the above function with ‘ivy-occur’,  Up: Example - define a new command with several actions
-
-6.3.5.1 Test the above function with ‘ivy-occur’
-................................................
-
-To examine each action with each candidate in a key-efficient way, try:
-
-   • Call ‘my-command-with-3-actions’
-   • Press ‘C-c C-o’ to close the completion window and move to an
-     ivy-occur buffer
-   • Press ‘kkk’ to move to the first candidate, since the point is most
-     likely at the end of the buffer
-   • Press ‘oo’ to call the first action
-   • Press ‘oj’ and ‘ok’ to call the second and the third actions
-   • Press ‘j’ to move to the next candidate
-   • Press ‘oo’, ‘oj’, ‘ok’
-   • Press ‘j’ to move to the next candidate
-   • and so on…
-
-
-File: ivy.info,  Node: Packages,  Prev: Actions,  Up: Customization
-
-6.4 Packages
-============
-
-‘org-mode’
-..........
-
-     ‘org-mode’ versions 8.3.3 or later obey ‘completing-read-function’
-     (which ‘ivy-mode’ sets).  Try refiling headings with similar names
-     to appreciate ‘ivy-mode’.
-
-‘magit’
-.......
-
-     Magit requires this setting for ivy completion:
-
-               (setq magit-completing-read-function 'ivy-completing-read)
-
-‘find-file-in-project’
-......................
-
-     It uses ivy by default if Ivy is installed.
-
-‘projectile’
-............
-
-     Projectile requires this setting for ivy completion:
-
-               (setq projectile-completion-system 'ivy)
-
-‘helm-make’
-...........
-
-     Helm-make requires this setting for ivy completion.
-
-               (setq helm-make-completion-method 'ivy)
-
-
-File: ivy.info,  Node: Commands,  Next: API,  Prev: Customization,  Up: Top
-
-7 Commands
-**********
-
-* Menu:
-
-* File Name Completion::
-* Buffer Name Completion::
-* Counsel commands::
-
-
-File: ivy.info,  Node: File Name Completion,  Next: Buffer Name Completion,  Up: Commands
-
-7.1 File Name Completion
-========================
-
-Since file name completion is ubiquitous, Ivy provides extra bindings
-that work here:
-
-‘C-j’ (‘ivy-alt-done’)
-......................
-
-     On a directory, restarts completion from that directory.
-
-     On a file or ‘./’, exit completion with the selected candidate.
-
-‘DEL’ (‘ivy-backward-delete-char’)
-..................................
-
-     Restart the completion in the parent directory if current input is
-     empty.
-
-‘//’ (‘self-insert-command’)
-............................
-
-     Switch to the root directory.
-
-‘~’ (‘self-insert-command’)
-...........................
-
-     Switch to the home directory.
-
-‘/’ (‘self-insert-command’)
-...........................
-
-     If the current input matches an existing directory name exactly,
-     switch the completion to that directory.
-
-‘M-r’ (‘ivy-toggle-regexp-quote’)
-.................................
-
-     Toggle between input as regexp or not.
-
-     Switch to matching literally since file names include ‘.’, which is
-     for matching any char in regexp mode.
- -- User Option: ivy-extra-directories
-     Decide if you want to see ‘../’ and ‘./’ during file name
-     completion.
-
-     Reason to remove: ‘../’ is the same as ‘DEL’.
-
-     Reason not to remove: navigate anywhere with only ‘C-n’, ‘C-p’ and
-     ‘C-j’.
-
-     Likewise, ‘./’ can be removed.
-
-Using TRAMP
-...........
-
-     From any directory, with the empty input, inputting ‘/ssh:’ and
-     pressing ‘C-j’ (or ‘RET’, which is the same thing) completes for
-     host and user names.
-
-     For ‘/ssh:user@’ input, completes the domain name.
-
-     ‘C-i’ works in a similar way to the default completion.
-
-     You can also get sudo access for the current directory by inputting
-     ‘/sudo::’ ‘RET’.  Using ‘/sudo:’ (i.e.  single colon instead of
-     double) will result in a completion session for the desired user.
-
-History
-.......
-
-     File history works the same with ‘M-p’, ‘M-n’, and ‘C-r’, but uses
-     a custom code for file name completion that cycles through files
-     previously opened.  It also works with TRAMP files.
-
-
-File: ivy.info,  Node: Buffer Name Completion,  Next: Counsel commands,  Prev: File Name Completion,  Up: Commands
-
-7.2 Buffer Name Completion
-==========================
-
- -- User Option: ivy-use-virtual-buffers
-     When non-nil, add ‘recentf-mode’ and bookmarks to
-     ‘ivy-switch-buffer’ completion candidates.
-
-     Adding this to Emacs init file:
-
-               (setq ivy-use-virtual-buffers t)
-     will add additional virtual buffers to the buffers list for recent
-     files.  Selecting such virtual buffers, which are highlighted with
-     ‘ivy-virtual’ face, will open the corresponding file.
-
-
-File: ivy.info,  Node: Counsel commands,  Prev: Buffer Name Completion,  Up: Commands
-
-7.3 Counsel commands
-====================
-
-The main advantages of ‘counsel-’ functions over their basic equivalents
-in ‘ivy-mode’ are:
-
-  1. Multi-actions and non-exiting actions work.
-  2. ‘ivy-resume’ can resume the last completion session.
-  3. Customize ‘ivy-set-actions’, ‘ivy-re-builders-alist’.
-  4. Customize individual keymaps, such as ‘counsel-describe-map’,
-     ‘counsel-git-grep-map’, or ‘counsel-find-file-map’, instead of
-     customizing ‘ivy-minibuffer-map’ that applies to all completion
-     sessions.
-
-
-File: ivy.info,  Node: API,  Next: Variable Index,  Prev: Commands,  Up: Top
-
-8 API
-*****
-
-The main (and only) entry point is the ‘ivy-read’ function.  It takes
-two required arguments and many optional arguments that can be passed by
-a key.  The optional ‘:action’ argument is highly recommended for
-features such as multi-actions, non-exiting actions, ‘ivy-occur’ and
-‘ivy-resume’.
-
-* Menu:
-
-* Required arguments for ‘ivy-read’::
-* Optional arguments for ‘ivy-read’::
-* Example - ‘counsel-describe-function’::
-* Example - ‘counsel-locate’::
-
-
-File: ivy.info,  Node: Required arguments for ‘ivy-read’,  Next: Optional arguments for ‘ivy-read’,  Up: API
-
-8.1 Required arguments for ‘ivy-read’
-=====================================
-
-‘prompt’
-........
-
-     A format string normally ending in a colon and a space.
-
-     ‘%d’ anywhere in the string is replaced by the current number of
-     matching candidates.  To use a literal ‘%’ character, escape it as
-     ‘%%’.  See also ‘ivy-count-format’.
-
-‘collection’
-............
-
-     Either a list of strings, a function, an alist or a hash table.
-
-     If a function, then it has to be compatible with ‘all-completions’.
-
-
-File: ivy.info,  Node: Optional arguments for ‘ivy-read’,  Next: Example - ‘counsel-describe-function’,  Prev: Required arguments for ‘ivy-read’,  Up: API
-
-8.2 Optional arguments for ‘ivy-read’
-=====================================
-
-‘predicate’
-...........
-
-     Is a function to filter the initial collection.  It has to be
-     compatible with ‘all-completions’.  Tip: most of the time, it’s
-     simpler to just apply this filter to the ‘collection’ argument
-     itself, e.g.  ‘(cl-remove-if-not predicate collection)’.
-
-‘require-match’
-...............
-
-     When set to a non-nil value, input must match one of the
-     candidates.  Custom input is not accepted.
-
-‘initial-input’
-...............
-
-     This string argument is included for compatibility with
-     ‘completing-read’, which inserts it into the minibuffer.
-
-     It’s recommended to use the ‘preselect’ argument instead of this.
-
-‘history’
-.........
-
-     Name of the symbol to store history.  See ‘completing-read’.
-
-‘preselect’
-...........
-
-     When set to a string value, select the first candidate matching
-     this value.
-
-     When set to an integer value, select the candidate with that index
-     value.
-
-     Every time the input becomes empty, the item corresponding to to
-     ‘preselect’ is selected.
-
-‘keymap’
-........
-
-     A keymap to be composed with ‘ivy-minibuffer-map’.  This keymap has
-     priority over ‘ivy-minibuffer-map’ and can be modified at any later
-     stage.
-
-‘update-fn’
-...........
-
-     Is the function called each time the current candidate changes.
-     This function takes no arguments and is called in the minibuffer’s
-     ‘post-command-hook’.  See ‘swiper’ for an example usage.
-
-‘sort’
-......
-
-     When non-nil, use ‘ivy-sort-functions-alist’ to sort the collection
-     as long as the collection is not larger than ‘ivy-sort-max-size’.
-
-‘action’
-........
-
-     Is the function to call after selection.  It takes a string
-     argument.
-
-‘unwind’
-........
-
-     Is the function to call before exiting completion.  It takes no
-     arguments.  This function is called even if the completion is
-     interrupted with ‘C-g’.  See ‘swiper’ for an example usage.
-
-‘re-builder’
-............
-
-     Is a function that takes a string and returns a valid regex.  See
-     ‘Completion Styles’ for details.
-
-‘matcher’
-.........
-
-     Is a function that takes a regex string and a list of strings and
-     returns a list of strings matching the regex.  Any ordinary Emacs
-     matching function will suffice, yet finely tuned matching functions
-     can be used.  See ‘counsel-find-file’ for an example usage.
-
-‘dynamic-collection’
-....................
-
-     When non-nil, ‘collection’ will be used to dynamically generate the
-     candidates each time the input changes, instead of being used once
-     statically with ‘all-completions’ to generate a list of strings.
-     See ‘counsel-locate’ for an example usage.
-
-‘caller’
-........
-
-     Is a symbol that uniquely identifies the function that called
-     ‘ivy-read’, which may be useful for further customizations.
-
-
-File: ivy.info,  Node: Example - ‘counsel-describe-function’,  Next: Example - ‘counsel-locate’,  Prev: Optional arguments for ‘ivy-read’,  Up: API
-
-8.3 Example - ‘counsel-describe-function’
-=========================================
-
-This is a typical example of a function with a non-async collection,
-which is a collection where all the strings in the collection are known
-prior to any input from the user.
-
-   Only the first two arguments (along with ‘action’) are essential -
-the rest of the arguments are for fine-tuning, and could be omitted.
-
-   The ‘action’ argument could also be omitted - but then ‘ivy-read’
-would do nothing except returning the string result, which you could
-later use yourself.  However, it’s recommended that you use the ‘action’
-argument.
-
-     (defun counsel-describe-function ()
-       "Forward to `describe-function'."
-       (interactive)
-       (ivy-read "Describe function: "
-                 (let (cands)
-                   (mapatoms
-                    (lambda (x)
-                      (when (fboundp x)
-                        (push (symbol-name x) cands))))
-                   cands)
-                 :keymap counsel-describe-map
-                 :preselect (counsel-symbol-at-point)
-                 :history 'counsel-describe-symbol-history
-                 :require-match t
-                 :sort t
-                 :action (lambda (x)
-                           (describe-function
-                            (intern x)))
-                 :caller 'counsel-describe-function))
-
-   Here are the interesting features of the above function, in the order
-that they appear:
-
-   • The ‘prompt’ argument is a simple string ending in ": ".
-   • The ‘collection’ argument evaluates to a (large) list of strings.
-   • The ‘keymap’ argument is for a custom keymap to supplement
-     ‘ivy-minibuffer-map’.
-   • The ‘preselect’ is provided by ‘counsel-symbol-at-point’, which
-     returns a symbol near the point.  Ivy then selects the first
-     candidate from the collection that matches this symbol.  To select
-     this pre-selected candidate, a ‘RET’ will suffice.  No further user
-     input is necessary.
-   • The ‘history’ argument is for keeping the history of this command
-     separate from the common history in ‘ivy-history’.
-   • The ‘require-match’ is set to ‘t’ since it doesn’t make sense to
-     call ‘describe-function’ on an un-interned symbol.
-   • The ‘sort’ argument is set to ‘t’ so choosing between similar
-     candidates becomes easier.  Sometimes, the collection size will
-     exceed ‘ivy-sort-max-size’, which is 30000 by default.  In that
-     case the sorting will not happen to avoid delays.
-
-     Adjust this variable to choose between sorting time and completion
-     start-up time.
-   • The ‘action’ argument calls ‘describe-function’ on the interned
-     selected candidate.
-   • The ‘caller’ argument identifies this completion session.  This is
-     important, since with the collection being a list of strings and
-     not a function name, the only other way for ‘ivy-read’ to identify
-     "who’s calling" and to apply the appropriate customizations is to
-     examine ‘this-command’.  But ‘this-command’ would be modified if
-     another command called ‘counsel-describe-function’.
-
-
-File: ivy.info,  Node: Example - ‘counsel-locate’,  Prev: Example - ‘counsel-describe-function’,  Up: API
-
-8.4 Example - ‘counsel-locate’
-==============================
-
-This is a typical example of a function with an async collection.  Since
-the collection function cannot pre-compute all the locatable files in
-memory within reasonable limits (time or memory), it relies on user
-input to filter the universe of possible candidates to a manageable size
-while also continuing to search asynchronously for possible candidates.
-Both the filtering and searching continues with each character change of
-the input with rapid updates to the collection presented without idle
-waiting times.  This live update will continue as long as there are
-likely candidates.  Eventually updates to the minibuffer will stop after
-user input, filtering, and searching have exhausted looking for possible
-candidates.
-
-   Async collections suit long-running shell commands, such as ‘locate’.
-With each new input, a new process starts while the old process is
-killed.  The collection is refreshed anew with each new process.
-Meanwhile the user can provide more input characters (for further
-narrowing) or select a candidate from the visible collection.
-
-     (defun counsel-locate-function (str)
-       (if (< (length str) 3)
-           (counsel-more-chars 3)
-         (counsel--async-command
-          (format "locate %s '%s'"
-                  (mapconcat #'identity counsel-locate-options " ")
-                  (counsel-unquote-regex-parens
-                   (ivy--regex str))))
-         '("" "working...")))
-
-     ;;;###autoload
-     (defun counsel-locate (&optional initial-input)
-       "Call the \"locate\" shell command.
-     INITIAL-INPUT can be given as the initial minibuffer input."
-       (interactive)
-       (ivy-read "Locate: " #'counsel-locate-function
-                 :initial-input initial-input
-                 :dynamic-collection t
-                 :history 'counsel-locate-history
-                 :action (lambda (file)
-                           (with-ivy-window
-                             (when file
-                               (find-file file))))
-                 :unwind #'counsel-delete-process
-                 :caller 'counsel-locate))
-
-   Here are the interesting features of the above functions, in the
-order that they appear:
-
-   • ‘counsel-locate-function’ takes a string argument and returns a
-     list of strings.  Note that it’s not compatible with
-     ‘all-completions’, but since we’re not using that here, might as
-     well use one argument instead of three.
-   • ‘counsel-more-chars’ is a simple function that returns e.g.  ‘'("2
-     chars more")’ asking the user for more input.
-   • ‘counsel--async-command’ is a very easy API simplification that
-     takes a single string argument suitable for
-     ‘shell-command-to-string’.  So you could prototype your function as
-     non-async using ‘shell-command-to-string’ and ‘split-string’ to
-     produce a collection, then decide that you want async and simply
-     swap in ‘counsel--async-command’.
-   • ‘counsel-locate’ is an interactive function with an optional
-     ‘initial-input’.
-   • ‘#'counsel-locate-function’ is passed as the ‘collection’ argument.
-   • ‘dynamic-collection’ is set to t, since this is an async
-     collection.
-   • ‘action’ argument uses ‘with-ivy-window’ wrapper, since we want to
-     open the selected file in the same window from which
-     ‘counsel-locate’ was called.
-   • ‘unwind’ argument is set to ‘#'counsel-delete-process’: when we
-     press ‘C-g’ we want to kill the running process created by
-     ‘counsel--async-command’.
-   • ‘caller’ argument identifies this command for easier customization.
-
-
-File: ivy.info,  Node: Variable Index,  Next: Keystroke Index,  Prev: API,  Up: Top
-
-Variable Index
-**************
-
-[index]
-* Menu:
-
-* ivy-alt-done:                          Key bindings for single selection action then exit minibuffer.
-                                                               (line 30)
-* ivy-alt-done <1>:                      File Name Completion. (line 12)
-* ivy-avy:                               Key bindings for single selection action then exit minibuffer.
-                                                               (line 64)
-* ivy-backward-delete-char:              File Name Completion. (line 19)
-* ivy-call:                              Key bindings for multiple selections and actions keep minibuffer open.
-                                                               (line 16)
-* ivy-confirm-face:                      Faces.                (line 34)
-* ivy-count-format:                      Defcustoms.           (line  6)
-* ivy-current-match:                     Faces.                (line  9)
-* ivy-dispatching-call:                  Key bindings for multiple selections and actions keep minibuffer open.
-                                                               (line 26)
-* ivy-dispatching-done:                  Key bindings for single selection action then exit minibuffer.
-                                                               (line 24)
-* ivy-display-style:                     Defcustoms.           (line 24)
-* ivy-done:                              Key bindings for single selection action then exit minibuffer.
-                                                               (line 19)
-* ivy-extra-directories:                 File Name Completion. (line 45)
-* ivy-height:                            Key bindings for navigation.
-                                                               (line 21)
-* ivy-immediate-done:                    Key bindings for single selection action then exit minibuffer.
-                                                               (line 53)
-* ivy-insert-current:                    Key bindings that alter the minibuffer input.
-                                                               (line 23)
-* ivy-kill-ring-save:                    Other key bindings.   (line  9)
-* ivy-match-required-face:               Faces.                (line 53)
-* ivy-minibuffer-grow:                   Hydra in the minibuffer.
-                                                               (line 45)
-* ivy-minibuffer-map:                    Minibuffer key bindings.
-                                                               (line  6)
-* ivy-minibuffer-match-face-1:           Faces.                (line 14)
-* ivy-minibuffer-match-face-2:           Faces.                (line 19)
-* ivy-minibuffer-match-face-3:           Faces.                (line 24)
-* ivy-minibuffer-match-face-4:           Faces.                (line 29)
-* ivy-minibuffer-shrink:                 Hydra in the minibuffer.
-                                                               (line 50)
-* ivy-next-action:                       Hydra in the minibuffer.
-                                                               (line 60)
-* ivy-next-history-element:              Key bindings that alter the minibuffer input.
-                                                               (line  9)
-* ivy-next-line-and-call:                Key bindings for multiple selections and actions keep minibuffer open.
-                                                               (line 36)
-* ivy-occur:                             Saving the current completion session to a buffer.
-                                                               (line  9)
-* ivy-occur-click:                       Saving the current completion session to a buffer.
-                                                               (line 21)
-* ivy-occur-dispatch:                    Saving the current completion session to a buffer.
-                                                               (line 41)
-* ivy-occur-press:                       Saving the current completion session to a buffer.
-                                                               (line 16)
-* ivy-occur-read-action:                 Saving the current completion session to a buffer.
-                                                               (line 36)
-* ivy-on-del-error-function:             Defcustoms.           (line 32)
-* ivy-partial-or-done:                   Key bindings for single selection action then exit minibuffer.
-                                                               (line 37)
-* ivy-prev-action:                       Hydra in the minibuffer.
-                                                               (line 55)
-* ivy-previous-history-element:          Key bindings that alter the minibuffer input.
-                                                               (line 18)
-* ivy-previous-line-and-call:            Key bindings for multiple selections and actions keep minibuffer open.
-                                                               (line 47)
-* ivy-read-action:                       Hydra in the minibuffer.
-                                                               (line 65)
-* ivy-remote:                            Faces.                (line 71)
-* ivy-restrict-to-matches:               Key bindings that alter the minibuffer input.
-                                                               (line 40)
-* ivy-resume:                            Key bindings for multiple selections and actions keep minibuffer open.
-                                                               (line 55)
-* ivy-reverse-i-search:                  Key bindings that alter the minibuffer input.
-                                                               (line 48)
-* ivy-subdir:                            Faces.                (line 66)
-* ivy-toggle-calling:                    Hydra in the minibuffer.
-                                                               (line 34)
-* ivy-toggle-case-fold:                  Hydra in the minibuffer.
-                                                               (line 70)
-* ivy-toggle-fuzzy:                      Hydra in the minibuffer.
-                                                               (line 40)
-* ivy-toggle-regexp-quote:               File Name Completion. (line 41)
-* ivy-use-virtual-buffers:               Buffer Name Completion.
-                                                               (line  6)
-* ivy-virtual:                           Faces.                (line 76)
-* ivy-wrap:                              Key bindings for navigation.
-                                                               (line 14)
-* ivy-yank-word:                         Key bindings that alter the minibuffer input.
-                                                               (line 32)
-
-
-File: ivy.info,  Node: Keystroke Index,  Prev: Variable Index,  Up: Top
-
-Keystroke Index
-***************
-
-[index]
-* Menu:
-
-* /:                                     File Name Completion. (line 35)
-* //:                                    File Name Completion. (line 25)
-* <:                                     Hydra in the minibuffer.
-                                                               (line 50)
-* >:                                     Hydra in the minibuffer.
-                                                               (line 45)
-* ~:                                     File Name Completion. (line 30)
-* a:                                     Hydra in the minibuffer.
-                                                               (line 65)
-* a <1>:                                 Saving the current completion session to a buffer.
-                                                               (line 36)
-* c:                                     Hydra in the minibuffer.
-                                                               (line 34)
-* C:                                     Hydra in the minibuffer.
-                                                               (line 70)
-* C-':                                   Key bindings for single selection action then exit minibuffer.
-                                                               (line 64)
-* C-c C-o:                               Saving the current completion session to a buffer.
-                                                               (line  9)
-* C-j:                                   Key bindings for single selection action then exit minibuffer.
-                                                               (line 30)
-* C-j <1>:                               File Name Completion. (line 12)
-* C-m:                                   Key bindings for single selection action then exit minibuffer.
-                                                               (line 19)
-* C-M-j:                                 Key bindings for single selection action then exit minibuffer.
-                                                               (line 53)
-* C-M-m:                                 Key bindings for multiple selections and actions keep minibuffer open.
-                                                               (line 16)
-* C-M-n:                                 Key bindings for multiple selections and actions keep minibuffer open.
-                                                               (line 36)
-* C-M-o:                                 Key bindings for multiple selections and actions keep minibuffer open.
-                                                               (line 26)
-* C-M-p:                                 Key bindings for multiple selections and actions keep minibuffer open.
-                                                               (line 47)
-* C-o:                                   Hydra in the minibuffer.
-                                                               (line  9)
-* C-r:                                   Key bindings that alter the minibuffer input.
-                                                               (line 48)
-* DEL:                                   File Name Completion. (line 19)
-* j:                                     Saving the current completion session to a buffer.
-                                                               (line 16)
-* j <1>:                                 Saving the current completion session to a buffer.
-                                                               (line 26)
-* k:                                     Saving the current completion session to a buffer.
-                                                               (line 31)
-* m:                                     Hydra in the minibuffer.
-                                                               (line 40)
-* M-i:                                   Key bindings that alter the minibuffer input.
-                                                               (line 23)
-* M-j:                                   Key bindings that alter the minibuffer input.
-                                                               (line 32)
-* M-n:                                   Key bindings that alter the minibuffer input.
-                                                               (line  9)
-* M-o:                                   Key bindings for single selection action then exit minibuffer.
-                                                               (line 24)
-* M-p:                                   Key bindings that alter the minibuffer input.
-                                                               (line 18)
-* M-r:                                   File Name Completion. (line 41)
-* M-w:                                   Other key bindings.   (line  9)
-* mouse-1:                               Saving the current completion session to a buffer.
-                                                               (line 21)
-* o:                                     Saving the current completion session to a buffer.
-                                                               (line 41)
-* q:                                     Saving the current completion session to a buffer.
-                                                               (line 46)
-* RET:                                   Key bindings for single selection action then exit minibuffer.
-                                                               (line 19)
-* RET <1>:                               Saving the current completion session to a buffer.
-                                                               (line 16)
-* s:                                     Hydra in the minibuffer.
-                                                               (line 60)
-* S-SPC:                                 Key bindings that alter the minibuffer input.
-                                                               (line 40)
-* TAB:                                   Key bindings for single selection action then exit minibuffer.
-                                                               (line 37)
-* w:                                     Hydra in the minibuffer.
-                                                               (line 55)
-
-
-
-Tag Table:
-Node: Top1355
-Node: Introduction4402
-Node: Installation6913
-Node: Installing from Emacs Package Manager7367
-Node: Installing from the Git repository8326
-Node: Getting started9176
-Node: Basic customization9483
-Node: Key bindings10078
-Node: Global key bindings10270
-Node: Minibuffer key bindings11658
-Node: Key bindings for navigation12890
-Node: Key bindings for single selection action then exit minibuffer14097
-Node: Key bindings for multiple selections and actions keep minibuffer open16814
-Node: Key bindings that alter the minibuffer input19206
-Node: Other key bindings21094
-Node: Hydra in the minibuffer21472
-Node: Saving the current completion session to a buffer23549
-Node: Completion Styles24961
-Node: ivy--regex-plus26719
-Node: ivy--regex-ignore-order28205
-Node: ivy--regex-fuzzy28573
-Node: Customization29070
-Node: Faces29256
-Node: Defcustoms31393
-Node: Actions32570
-Node: What are actions?32896
-Node: How can different actions be called?33729
-Node: How to modify the actions list?34300
-Node: Example - add two actions to each command34960
-Node: How to undo adding the two actions35919
-Node: How to add actions to a specific command36371
-Node: Example - define a new command with several actions36787
-Node: Test the above function with ‘ivy-occur’37730
-Node: Packages38578
-Node: Commands39436
-Node: File Name Completion39621
-Node: Buffer Name Completion41947
-Node: Counsel commands42567
-Node: API43214
-Node: Required arguments for ‘ivy-read’43791
-Node: Optional arguments for ‘ivy-read’44456
-Node: Example - ‘counsel-describe-function’47690
-Node: Example - ‘counsel-locate’51094
-Node: Variable Index54942
-Node: Keystroke Index61843
-
-End Tag Table
-
-
-Local Variables:
-coding: utf-8
-End:
.emacs.d/elpa/ivy-hydra-20170703.2350/ivy-hydra-autoloads.el
@@ -1,15 +0,0 @@
-;;; ivy-hydra-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil nil ("ivy-hydra.el") (22977 29292 681923 926000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; ivy-hydra-autoloads.el ends here
.emacs.d/elpa/ivy-hydra-20170703.2350/ivy-hydra-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "ivy-hydra" "20170703.2350" "Additional key bindings for Ivy" '((emacs "24.1") (ivy "0.9.0") (hydra "0.13.4")) :commit "ae438ff62fa3d9b98d899afc0e97c13be2148725" :url "https://github.com/abo-abo/swiper" :keywords '("completion" "matching" "bindings"))
.emacs.d/elpa/ivy-hydra-20170703.2350/ivy-hydra.el
@@ -1,116 +0,0 @@
-;;; ivy-hydra.el --- Additional key bindings for Ivy  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2015-2017  Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-;; URL: https://github.com/abo-abo/swiper
-;; Package-Version: 20170703.2350
-;; Version: 0.9.1
-;; Package-Requires: ((emacs "24.1") (ivy "0.9.0") (hydra "0.13.4"))
-;; Keywords: completion, matching, bindings
-
-;; This file is part of GNU Emacs.
-
-;; 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 3, 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.
-
-;; For a full copy of the GNU General Public License
-;; see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This package provides the `hydra-ivy/body' command, which is a
-;; quasi-prefix map, with many useful bindings.  These bindings are
-;; shorter than usual, using mostly unprefixed keys.
-
-;;; Code:
-(require 'ivy)
-(require 'hydra)
-
-(defun ivy--matcher-desc ()
-  "Return description of `ivy--regex-function'."
-  (let ((cell (assoc ivy--regex-function ivy--preferred-re-builders)))
-    (if cell
-        (cdr cell)
-      "other")))
-
-(defhydra hydra-ivy (:hint nil
-                     :color pink)
-  "
-^ ^ ^ ^ ^ ^ | ^Call^      ^ ^  | ^Cancel^ | ^Options^ | Action _w_/_s_/_a_: %-14s(ivy-action-name)
-^-^-^-^-^-^-+-^-^---------^-^--+-^-^------+-^-^-------+-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------
-^ ^ _k_ ^ ^ | _f_ollow occ_u_r | _i_nsert | _c_: calling %-5s(if ivy-calling \"on\" \"off\") _C_ase-fold: %-10`ivy-case-fold-search
-_h_ ^+^ _l_ | _d_one      ^ ^  | _o_ops   | _m_: matcher %-5s(ivy--matcher-desc)^^^^^^^^^^^^ _t_runcate: %-11`truncate-lines
-^ ^ _j_ ^ ^ | _g_o        ^ ^  | ^ ^      | _<_/_>_: shrink/grow^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _D_efinition of this menu
-"
-  ;; arrows
-  ("h" ivy-beginning-of-buffer)
-  ("j" ivy-next-line)
-  ("k" ivy-previous-line)
-  ("l" ivy-end-of-buffer)
-  ;; actions
-  ("o" keyboard-escape-quit :exit t)
-  ("C-g" keyboard-escape-quit :exit t)
-  ("i" nil)
-  ("C-o" nil)
-  ("f" ivy-alt-done :exit nil)
-  ("C-j" ivy-alt-done :exit nil)
-  ("d" ivy-done :exit t)
-  ("g" ivy-call)
-  ("C-m" ivy-done :exit t)
-  ("c" ivy-toggle-calling)
-  ("m" ivy-rotate-preferred-builders)
-  (">" ivy-minibuffer-grow)
-  ("<" ivy-minibuffer-shrink)
-  ("w" ivy-prev-action)
-  ("s" ivy-next-action)
-  ("a" ivy-read-action)
-  ("t" (setq truncate-lines (not truncate-lines)))
-  ("C" ivy-toggle-case-fold)
-  ("u" ivy-occur :exit t)
-  ("D" (ivy-exit-with-action
-        (lambda (_) (find-function 'hydra-ivy/body)))
-       :exit t))
-
-(defvar ivy-dispatching-done-columns 2
-  "Number of columns to use if the hint does not fit on one line.")
-
-(defun ivy-dispatching-done-hydra ()
-  "Select one of the available actions and call `ivy-done'."
-  (interactive)
-  (let* ((actions (ivy-state-action ivy-last))
-         (estimated-len (+ 25 (length
-                               (mapconcat
-                                (lambda (x) (format "[%s] %s" (nth 0 x) (nth 2 x)))
-                                (cdr actions) ", "))))
-         (n-columns (if (> estimated-len (window-width))
-                        ivy-dispatching-done-columns
-                      nil)))
-    (if (null (ivy--actionp actions))
-        (ivy-done)
-      (funcall
-       (eval
-        `(defhydra ivy-read-action (:color teal :columns ,n-columns)
-           "action"
-           ,@(mapcar (lambda (x)
-                       (list (nth 0 x)
-                             `(progn
-                                (ivy-set-action ',(nth 1 x))
-                                (ivy-done))
-                             (nth 2 x)))
-                     (cdr actions))
-           ("M-o" nil "back")
-           ("C-g" nil)))))))
-
-(define-key ivy-minibuffer-map (kbd "M-o") 'ivy-dispatching-done-hydra)
-
-(provide 'ivy-hydra)
-
-;;; ivy-hydra.el ends here
.emacs.d/elpa/ivy-hydra-20170703.2350/ivy-hydra.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/AUTHORS.md
@@ -1,281 +0,0 @@
-Authors
-=======
-
-The following people have contributed to Magit, including the
-libraries `git-commit.el`, `magit-popup.el`, and `with-editor.el`
-which are distributed as separate Elpa packages.
-
-For statistics see https://magit.vc/stats/authors.html.
-
-Names below are sorted alphabetically.
-
-Author
-------
-
-- Marius Vollmer <marius.vollmer@gmail.com>
-
-Maintainer
-----------
-
-- Jonas Bernoulli <jonas@bernoul.li>
-
-Developers
-----------
-
-- Kyle Meyer <kyle@kyleam.com>
-- Noam Postavsky <npostavs@users.sourceforge.net>
-
-Retired Maintainers and Developers
-----------------------------------
-
-- Nicolas Dudebout <nicolas.dudebout@gatech.edu>
-- Peter J. Weisberg <pj@irregularexpressions.net>
-- Pieter Praet <pieter@praet.org>
-- Phil Jackson <phil@shellarchive.co.uk>
-- Rémi Vanicat <vanicat@debian.org>
-- Yann Hodique <yann.hodique@gmail.com>
-
-Contributors
-------------
-
-- Aaron Culich <aculich@gmail.com>
-- Abdo Roig-Maranges <abdo.roig@gmail.com>
-- Adam Benanti <0entropy@protonmail.com>
-- Adam Porter <adam@alphapapa.net>
-- Adam Spiers <emacs@adamspiers.org>
-- Adeodato Simó <dato@net.com.org.es>
-- Ævar Arnfjörð Bjarmason <avarab@gmail.com>
-- Alan Falloon <alan.falloon@gmail.com>
-- Aleksey Uimanov <s9gf4ult@gmail.com>
-- Alexander Gramiak <fice-t@protonmail.com>
-- Alex Dunn <adunn@ucsb.edu>
-- Alexey Voinov <alexey.v.voinov@gmail.com>
-- Alex Kost <alezost@gmail.com>
-- Alex Ott <alexott@gmail.com>
-- Allen <darkfeline@felesatra.moe>
-- Allen Li <darkfeline@felesatra.moe>
-- Andreas Fuchs <asf@boinkor.net>
-- Andreas Liljeqvist <andreas.liljeqvist@robacks.se>
-- Andreas Rottmann <a.rottmann@gmx.at>
-- Andrei Chițu <andrei.chitu1@gmail.com>
-- Andrew Kirkpatrick <andrew.kirkpatrick@adelaide.edu.au>
-- Andrew Schwartzmeyer <andrew@schwartzmeyer.com>
-- Andrey Smirnov <andrew.smirnov@gmail.com>
-- Andriy Kmit' <dev@madand.net>
-- Andy Sawyer <git@pureabstract.org>
-- Barak A. Pearlmutter <barak+git@pearlmutter.net>
-- Bart Bakker <bart@thesoftwarecraft.com>
-- Basil L. Contovounesios <contovob@tcd.ie>
-- Bastian Beischer <beischer@physik.rwth-aachen.de>
-- Ben North <ben@redfrontdoor.org>
-- Ben Walton <bwalton@artsci.utoronto.ca>
-- Bradley Wright <brad@intranation.com>
-- Brandon W Maister <quodlibetor@gmail.com>
-- Brian Warner <warner@lothar.com>
-- Bryan Shell <bryan.shell@orbitz.com>
-- Carl Lieberman <liebermancarl@gmail.com>
-- Chillar Anand <anand21nanda@gmail.com>
-- Chris Bernard <cebernard@gmail.com>
-- Chris Done <chrisdone@gmail.com>
-- Chris Moore <dooglus@gmail.com>
-- Chris Ring <chris@ringthis.com>
-- Chris Shoemaker <chris@mojotech.com>
-- Christian Dietrich <christian.dietrich@informatik.uni-erlangen.de>
-- Christian Kluge <ckfrakturfreak@web.de>
-- Christopher Monsanto <chris@monsan.to>
-- Cornelius Mika <cornelius.mika@gmail.com>
-- Craig Andera <candera@wangdera.com>
-- Dale Hagglund <dale.hagglund@gmail.com>
-- Damien Cassou <damien@cassou.me>
-- Dan Erikson <derikson3@gmail.com>
-- Daniel Brockman <daniel@gointeractive.se>
-- Daniel Farina <drfarina@acm.org>
-- Daniel Hackney <dan@haxney.org>
-- Dan LaManna <dan.lamanna@gmail.com>
-- Dato Simó <dato@net.com.org.es>
-- David Abrahams <dave@boostpro.com>
-- David Hull <david.hull@openx.com>
-- David L. Rager <ragerdl@gmail.com>
-- David Wallin <david.wallin@gmail.com>
-- Dennis Paskorz <dennis@walltowall.com>
-- Divye Kapoor <divye@google.com>
-- Dominique Quatravaux <domq@google.com>
-- Duianto Vebotci <vebotci@openmailbox.org>
-- Eli Barzilay <eli@barzilay.org>
-- Eric Davis <ed@npri.org>
-- Eric Schulte <schulte.eric@gmail.com>
-- Erik Anderson <erikbpanderson@gmail.com>
-- Evgkeni Sampelnikof <esabof@gmail.com>
-- Eyal Lotem <eyal.lotem@gmail.com>
-- Fabian Wiget <fabacino@gmail.com>
-- Felix Geller <fgeller@gmail.com>
-- Feng Li <fengli@blackmagicdesign.com>
-- Florian Ragwitz <rafl@debian.org>
-- Fritz Grabo <fritz.grabo@gmail.com>
-- Geoff Shannon <geoffpshannon@gmail.com>
-- George Kadianakis <desnacked@gmail.com>
-- Graham Clark <grclark@gmail.com>
-- Graham Dobbins <gdobbins@protonmail.com>
-- Greg A. Woods <woods@planix.com>
-- Greg Lucas <greg@glucas.net>
-- Greg Sexton <gregsexton@gmail.com>
-- Guillaume Martres <smarter@ubuntu.com>
-- Hannu Koivisto <azure@iki.fi>
-- Hans-Peter Deifel <hpdeifel@gmx.de>
-- Ian Eure <ian.eure@gmail.com>
-- Ingo Lohmar <i.lohmar@gmail.com>
-- Ioan-Adrian Ratiu <adi@adirat.com>
-- Ivan Brennan <ivan.brennan@gmail.com>
-- Jan Tatarik <jan.tatarik@xing.com>
-- Jasper St. Pierre <jstpierre@mecheye.net>
-- Jeff Bellegarde <jbellegarde@whitepages.com>
-- Jeff Dairiki <dairiki@dairiki.org>
-- Jeremy Meng <yumeng@microsoft.com>
-- Jesse Alama <jesse.alama@gmail.com>
-- Joakim Jalap <JOJA@stoneridge.com>
-- Johann Klähn <kljohann@gmail.com>
-- John Mastro <john.b.mastro@gmail.com>
-- John Wiegley <johnw@newartisans.com>
-- Jonas Bernoulli <jonas@bernoul.li>
-- Jonathan Roes <jroes@jroes.net>
-- Jordan Greenberg <jordan@softwareslave.com>
-- Josiah Schwab <jschwab@gmail.com>
-- Julien Danjou <julien@danjou.info>
-- Justin Burkett <justin@burkett.cc>
-- Justin Caratzas <justin.caratzas@gmail.com>
-- Justin Guenther <jguenther@gmail.com>
-- Justin Thomas <justin.thomas1@gmail.com>
-- Kan-Ru Chen <kanru@kanru.info>
-- Keshav Kini <keshav.kini@gmail.com>
-- Kévin Le Gouguec <kevin.legouguec@gmail.com>
-- Kimberly Wolk <kimwolk@hotmail.com>
-- Kyle Meyer <kyle@kyleam.com>
-- Laurent Laffont <laurent.laffont@gmail.com>
-- Laverne Schrock <laverne@schrock.email>
-- Leandro Facchinetti <me@leafac.com>
-- Lele Gaifax <lele@metapensiero.it>
-- Leo Liu <sdl.web@gmail.com>
-- Leonardo Etcheverry <leo@kalio.net>
-- Lingchao Xin <douglarek@users.noreply.github.com>
-- Lluís Vilanova <vilanova@ac.upc.edu>
-- Loic Dachary <loic@dachary.org>
-- Luís Oliveira <luismbo@gmail.com>
-- Luke Amdor <luke.amdor@gmail.com>
-- Manuel Vázquez Acosta <mva.led@gmail.com>
-- Marcel Wolf <mwolf@ml1.net>
-- Marc Herbert <marc.herbert@gmail.com>
-- Marcin Bachry <hegel666@gmail.com>
-- Marco Craveiro <marco.craveiro@gmail.com>
-- Marco Wahl <marcowahlsoft@gmail.com>
-- Marc Sherry <msherry@gmail.com>
-- Marian Schubert <marian.schubert@gmail.com>
-- Mario Rodas <marsam@users.noreply.github.com>
-- Marius Vollmer <marius.vollmer@gmail.com>
-- Mark Hepburn <Mark.Hepburn@csiro.au>
-- Mark Karpov <markkarpov@opmbx.org>
-- Mark Oteiza <mvoteiza@udel.edu>
-- Matus Goljer <dota.keys@gmail.com>
-- Michael Fogleman <michaelwfogleman@gmail.com>
-- Michael Griffiths <mikey@cich.li>
-- Michael Heerdegen <michael_heerdegen@web.de>
-- Michal Sojka <sojkam1@fel.cvut.cz>
-- Miles Bader <miles@gnu.org>
-- Miloš Mošić <mosic.milos@gmail.com>
-- Mitchel Humpherys <mitch.special@gmail.com>
-- Moritz Bunkus <moritz@bunkus.org>
-- Natalie Weizenbaum <nex342@gmail.com>
-- Nguyễn Tuấn Anh <ubolonton@gmail.com>
-- Nic Ferier <nic@ferrier.me.uk>
-- Nick Alcock <nick.alcock@oracle.com>
-- Nick Alexander <nalexander@mozilla.com>
-- Nick Dimiduk <ndimiduk@gmail.com>
-- Nicklas Lindgren <nili@gulmohar.se>
-- Nicolas Dudebout <nicolas.dudebout@gatech.edu>
-- Nicolas Petton <nicolas@petton.fr>
-- Nicolas Richard <theonewiththeevillook@yahoo.fr>
-- Nikolay Martynov <mar.kolya@gmail.com>
-- Noam Postavsky <npostavs@users.sourceforge.net>
-- Ole Arndt <oliver.arndt@cegedim.com>
-- Oleh Krehel <ohwoeowho@gmail.com>
-- Óscar Fuentes <ofv@wanadoo.es>
-- Paul Stadig <paul@stadig.name>
-- Pavel Holejsovsky <pavel.holejsovsky@upek.com>
-- Pekka Pessi <nospam@pessi.fi>
-- Peter Eisentraut <peter@eisentraut.org>
-- Peter Jaros <peter.a.jaros@gmail.com>
-- Peter J. Weisberg <pj@irregularexpressions.net>
-- Peter Vasil <mail@petervasil.net>
-- Philippe Vaucher <philippe.vaucher@gmail.com>
-- Philipp Haselwarter <philipp@haselwarter.org>
-- Philipp Stephani <phst@google.com>
-- Philip Weaver <philip.weaver@gmail.com>
-- Phil Jackson <phil@shellarchive.co.uk>
-- Phil Sainty <phil@catalyst.net.nz>
-- Pieter Praet <pieter@praet.org>
-- Prathamesh Sonpatki <csonpatki@gmail.com>
-- rabio <rabiodev@o2.pl>
-- Radon Rosborough <radon.neon@gmail.com>
-- Rafael Laboissiere <rafael@laboissiere.net>
-- Raimon Grau <raimon@3scale.net>
-- Ramkumar Ramachandra <artagnon@gmail.com>
-- Remco van 't Veer <rwvtveer@xs4all.nl>
-- Rémi Vanicat <vanicat@debian.org>
-- René Stadler <mail@renestadler.de>
-- Richard Kim <emacs18@gmail.com>
-- Robert Boone <robo4288@gmail.com>
-- Robin Green <greenrd@greenrd.org>
-- Roger Crew <crew@cs.stanford.edu>
-- Romain Francoise <romain@orebokech.com>
-- Ron Parker <rparker@a123systems.com>
-- Roy Crihfield <rscrihf@gmail.com>
-- Rüdiger Sonderfeld <ruediger@c-plusplus.net>
-- Russell Black <black.russell@gmail.com>
-- Ryan C. Thompson <rct@thompsonclan.org>
-- Samuel Bronson <naesten@gmail.com>
-- Samuel W. Flint <swflint@flintfam.org>
-- Sanjoy Das <sanjoy@playingwithpointers.com>
-- Sean Allred <code@seanallred.com>
-- Sean Bryant <sbryant@hackinggibsons.com>
-- Sean Whitton <spwhitton@spwhitton.name>
-- Sebastian Wiesner <lunaryorn@gmail.com>
-- Sébastien Gross <seb@chezwam.org>
-- Seong-Kook Shin <cinsky@gmail.com>
-- Sergey Pashinin <sergey@pashinin.com>
-- Sergey Vinokurov <serg.foo@gmail.com>
-- Servilio Afre Puentes <afrepues@mcmaster.ca>
-- Silent Sphere <silentsphere110@gmail.com>
-- Štěpán Němec <stepnem@gmail.com>
-- Steven Chow <steve@myfreestuffapp.com>
-- Steven E. Harris <seh@panix.com>
-- Steven Thomas <sthomas314@gmail.com>
-- Steven Vancoillie <steven.vancoillie@runbox.com>
-- Steve Purcell <steve@sanityinc.com>
-- Suhail Shergill <suhailshergill@gmail.com>
-- Sylvain Rousseau <thisirs@gmail.com>
-- Syohei Yoshida <syohex@gmail.com>
-- Takafumi Arakaki <aka.tkf@gmail.com>
-- Teemu Likonen <tlikonen@iki.fi>
-- Teruki Shigitani <teruki.shigitani@gmail.com>
-- Thierry Volpiatto <thierry.volpiatto@gmail.com>
-- Thomas A Caswell <tcaswell@gmail.com>
-- Thomas Frössman <thomasf@jossystem.se>
-- Thomas Jost <thomas.jost@gmail.com>
-- Thomas Riccardi <riccardi.thomas@gmail.com>
-- Tibor Simko <tibor.simko@cern.ch>
-- Timo Juhani Lindfors <timo.lindfors@iki.fi>
-- Tim Perkins <tprk77@gmail.com>
-- Tim Wraight <tim@wraight.net>
-- Ting-Yu Lin <aethanyc@gmail.com>
-- Tom Feist <shabble@metavore.org>
-- Tunc Uzlu <bb2020@users.noreply.github.com>
-- Vineet Naik <vineet@helpshift.com>
-- Wei Huang <weih@opera.com>
-- Wilfred Hughes <me@wilfred.me.uk>
-- Win Treese <treese@acm.org>
-- Wouter Bolsterlee <wouter@bolsterl.ee>
-- Xavier Noria <fxn@hashref.com>
-- Yann Hodique <yann.hodique@gmail.com>
-- York Zhao <gtdplatform@gmail.com>
-- Yuichi Higashi <aaa707b@gmail.com>
-- Yuri Khan <yurivkhan@gmail.com>
-- Zach Latta <zach@zachlatta.com>
.emacs.d/elpa/magit-20170913.1424/COPYING
@@ -1,676 +0,0 @@
-
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
- 
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-  
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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 <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-
.emacs.d/elpa/magit-20170913.1424/dir
@@ -1,18 +0,0 @@
-This is the file .../info/dir, which contains the
-topmost node of the Info hierarchy, called (dir)Top.
-The first time you invoke Info you start off looking at this node.
-
-File: dir,	Node: Top	This is the top of the INFO tree
-
-  This (the Directory node) gives a menu of major topics.
-  Typing "q" exits, "?" lists all Info commands, "d" returns here,
-  "h" gives a primer for first-timers,
-  "mEmacs<Return>" visits the Emacs manual, etc.
-
-  In Emacs, you can click mouse button 2 on a menu item or cross reference
-  to select it.
-
-* Menu:
-
-Emacs
-* Magit: (magit).               Using Git from Emacs with Magit.
.emacs.d/elpa/magit-20170913.1424/git-rebase.el
@@ -1,582 +0,0 @@
-;;; git-rebase.el --- Edit Git rebase files  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Phil Jackson <phil@shellarchive.co.uk>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; This file is not part of GNU Emacs.
-
-;; 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 3, 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 this file.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package assists the user in editing the list of commits to be
-;; rewritten during an interactive rebase.
-
-;; When the user initiates an interactive rebase, e.g. using "r e" in
-;; a Magit buffer or on the command line using "git rebase -i REV",
-;; Git invokes the `$GIT_SEQUENCE_EDITOR' (or if that is undefined
-;; `$GIT_EDITOR' or even `$EDITOR') letting the user rearrange, drop,
-;; reword, edit, and squash commits.
-
-;; This package provides the major-mode `git-rebase-mode' which makes
-;; doing so much more fun, by making the buffer more colorful and
-;; providing the following commands:
-;;
-;;   C-c C-c  Tell Git to make it happen.
-;;   C-c C-k  Tell Git that you changed your mind, i.e. abort.
-;;
-;;   p        Move point to previous line.
-;;   n        Move point to next line.
-;;
-;;   M-p      Move the commit at point up.
-;;   M-n      Move the commit at point down.
-;;
-;;   k        Drop the commit at point.
-;;   c        Don't drop the commit at point.
-;;   r        Change the message of the commit at point.
-;;   e        Edit the commit at point.
-;;   s        Squash the commit at point, into the one above.
-;;   f        Like "s" but don't also edit the commit message.
-;;   x        Add a script to be run with the commit at point
-;;            being checked out.
-;;   z        Add noop action at point.
-;;
-;;   SPC      Show the commit at point in another buffer.
-;;   RET      Show the commit at point in another buffer and
-;;            select its window.
-;;   C-/      Undo last change.
-
-;; You should probably also read the `git-rebase' manpage.
-
-;;; Code:
-
-(require 'dash)
-(require 'easymenu)
-(require 'server)
-(require 'with-editor)
-(require 'magit)
-
-(and (require 'async-bytecomp nil t)
-     (memq 'magit (bound-and-true-p async-bytecomp-allowed-packages))
-     (fboundp 'async-bytecomp-package-mode)
-     (async-bytecomp-package-mode 1))
-
-(eval-when-compile (require 'recentf))
-
-;;; Options
-;;;; Variables
-
-(defgroup git-rebase nil
-  "Edit Git rebase sequences."
-  :link '(info-link "(magit)Editing Rebase Sequences")
-  :group 'tools)
-
-(defcustom git-rebase-auto-advance t
-  "Whether to move to next line after changing a line."
-  :group 'git-rebase
-  :type 'boolean)
-
-(defcustom git-rebase-show-instructions t
-  "Whether to show usage instructions inside the rebase buffer."
-  :group 'git-rebase
-  :type 'boolean)
-
-(defcustom git-rebase-confirm-cancel t
-  "Whether confirmation is required to cancel."
-  :group 'git-rebase
-  :type 'boolean)
-
-;;;; Faces
-
-(defgroup git-rebase-faces nil
-  "Faces used by Git-Rebase mode."
-  :group 'faces
-  :group 'git-rebase)
-
-(defface git-rebase-hash '((t (:inherit magit-hash)))
-  "Face for commit hashes."
-  :group 'git-rebase-faces)
-
-(defface git-rebase-description nil
-  "Face for commit descriptions."
-  :group 'git-rebase-faces)
-
-(defface git-rebase-killed-action
-  '((t (:inherit font-lock-comment-face :strike-through t)))
-  "Face for commented action and exec lines."
-  :group 'git-rebase-faces)
-
-(defface git-rebase-comment-hash
-  '((t (:inherit git-rebase-hash :weight bold)))
-  "Face for commit hashes in commit message comments."
-  :group 'git-rebase-faces)
-
-(defface git-rebase-comment-heading
-  '((t :inherit font-lock-keyword-face))
-  "Face for headings in rebase message comments."
-  :group 'git-commit-faces)
-
-;;; Keymaps
-
-(defvar git-rebase-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map special-mode-map)
-    (cond ((featurep 'jkl)
-           (define-key map [return]    'git-rebase-show-commit)
-           (define-key map (kbd   "i") 'git-rebase-backward-line)
-           (define-key map (kbd   "k") 'forward-line)
-           (define-key map (kbd "M-i") 'git-rebase-move-line-up)
-           (define-key map (kbd "M-k") 'git-rebase-move-line-down)
-           (define-key map (kbd   "p") 'git-rebase-pick)
-           (define-key map (kbd   ",") 'git-rebase-kill-line))
-          (t
-           (define-key map (kbd "C-m") 'git-rebase-show-commit)
-           (define-key map (kbd   "p") 'git-rebase-backward-line)
-           (define-key map (kbd   "n") 'forward-line)
-           (define-key map (kbd "M-p") 'git-rebase-move-line-up)
-           (define-key map (kbd "M-n") 'git-rebase-move-line-down)
-           (define-key map (kbd   "c") 'git-rebase-pick)
-           (define-key map (kbd   "k") 'git-rebase-kill-line)
-           (define-key map (kbd "C-k") 'git-rebase-kill-line)))
-    (define-key map (kbd "e") 'git-rebase-edit)
-    (define-key map (kbd "m") 'git-rebase-edit)
-    (define-key map (kbd "f") 'git-rebase-fixup)
-    (define-key map (kbd "q") 'undefined)
-    (define-key map (kbd "r") 'git-rebase-reword)
-    (define-key map (kbd "w") 'git-rebase-reword)
-    (define-key map (kbd "s") 'git-rebase-squash)
-    (define-key map (kbd "x") 'git-rebase-exec)
-    (define-key map (kbd "y") 'git-rebase-insert)
-    (define-key map (kbd "z") 'git-rebase-noop)
-    (define-key map (kbd "SPC")     'git-rebase-show-or-scroll-up)
-    (define-key map (kbd "DEL")     'git-rebase-show-or-scroll-down)
-    (define-key map (kbd "C-x C-t") 'git-rebase-move-line-up)
-    (define-key map [M-up]          'git-rebase-move-line-up)
-    (define-key map [M-down]        'git-rebase-move-line-down)
-    (define-key map [remap undo]    'git-rebase-undo)
-    map)
-  "Keymap for Git-Rebase mode.")
-
-(cond ((featurep 'jkl)
-       (put 'git-rebase-reword       :advertised-binding "r")
-       (put 'git-rebase-move-line-up :advertised-binding (kbd "M-i"))
-       (put 'git-rebase-kill-line    :advertised-binding ","))
-      (t
-       (put 'git-rebase-reword       :advertised-binding "r")
-       (put 'git-rebase-move-line-up :advertised-binding (kbd "M-p"))
-       (put 'git-rebase-kill-line    :advertised-binding "k")))
-
-(easy-menu-define git-rebase-mode-menu git-rebase-mode-map
-  "Git-Rebase mode menu"
-  '("Rebase"
-    ["Pick" git-rebase-pick t]
-    ["Reword" git-rebase-reword t]
-    ["Edit" git-rebase-edit t]
-    ["Squash" git-rebase-squash t]
-    ["Fixup" git-rebase-fixup t]
-    ["Kill" git-rebase-kill-line t]
-    ["Execute" git-rebase-exec t]
-    ["Move Down" git-rebase-move-line-down t]
-    ["Move Up" git-rebase-move-line-up t]
-    "---"
-    ["Cancel" with-editor-cancel t]
-    ["Finish" with-editor-finish t]))
-
-(defvar git-rebase-command-descriptions
-  '((with-editor-finish           . "tell Git to make it happen")
-    (with-editor-cancel           . "tell Git that you changed your mind, i.e. abort")
-    (git-rebase-backward-line     . "move point to previous line")
-    (forward-line                 . "move point to next line")
-    (git-rebase-move-line-up      . "move the commit at point up")
-    (git-rebase-move-line-down    . "move the commit at point down")
-    (git-rebase-show-or-scroll-up . "show the commit at point in another buffer")
-    (git-rebase-show-commit
-     . "show the commit at point in another buffer and select its window")
-    (undo                         . "undo last change")
-    (git-rebase-kill-line         . "drop the commit at point")
-    (git-rebase-insert            . "insert a line for an arbitrary commit")
-    (git-rebase-noop              . "add noop action at point")))
-
-;;; Commands
-
-(defun git-rebase-pick ()
-  "Use commit on current line."
-  (interactive)
-  (git-rebase-set-action "pick"))
-
-(defun git-rebase-reword ()
-  "Edit message of commit on current line."
-  (interactive)
-  (git-rebase-set-action "reword"))
-
-(defun git-rebase-edit ()
-  "Stop at the commit on the current line."
-  (interactive)
-  (git-rebase-set-action "edit"))
-
-(defun git-rebase-squash ()
-  "Meld commit on current line into previous commit, edit message."
-  (interactive)
-  (git-rebase-set-action "squash"))
-
-(defun git-rebase-fixup ()
-  "Meld commit on current line into previous commit, discard its message."
-  (interactive)
-  (git-rebase-set-action "fixup"))
-
-(defvar-local git-rebase-line nil)
-(defvar-local git-rebase-comment-re nil)
-
-(defun git-rebase-set-action (action)
-  (goto-char (line-beginning-position))
-  (if (and (looking-at git-rebase-line)
-           (not (string-match-p "\\(e\\|exec\\|noop\\)$" (match-string 1))))
-      (let ((inhibit-read-only t))
-        (replace-match action t t nil 1)
-        (when git-rebase-auto-advance
-          (forward-line)))
-    (ding)))
-
-(defun git-rebase-line-p (&optional pos)
-  (save-excursion
-    (when pos (goto-char pos))
-    (goto-char (line-beginning-position))
-    (looking-at-p git-rebase-line)))
-
-(defun git-rebase-region-bounds ()
-  (when (use-region-p)
-    (let ((beg (save-excursion (goto-char (region-beginning))
-                               (line-beginning-position)))
-          (end (save-excursion (goto-char (region-end))
-                               (line-end-position))))
-      (when (and (git-rebase-line-p beg)
-                 (git-rebase-line-p end))
-        (list beg (1+ end))))))
-
-(defun git-rebase-move-line-down (n)
-  "Move the current commit (or command) N lines down.
-If N is negative, move the commit up instead.  With an active
-region, move all the lines that the region touches, not just the
-current line."
-  (interactive "p")
-  (-let* (((beg end) (or (git-rebase-region-bounds)
-                         (list (line-beginning-position)
-                               (1+ (line-end-position)))))
-          (pt-offset (- (point) beg))
-          (mark-offset (and mark-active (- (mark) beg))))
-    (save-restriction
-      (narrow-to-region
-       (point-min)
-       (1+ (save-excursion
-             (goto-char (point-min))
-             (while (re-search-forward git-rebase-line nil t))
-             (point))))
-      (if (or (and (< n 0) (= beg (point-min)))
-              (and (> n 0) (= end (point-max)))
-              (> end (point-max)))
-          (ding)
-        (goto-char (if (< n 0) beg end))
-        (forward-line n)
-        (atomic-change-group
-          (let ((inhibit-read-only t))
-            (insert (delete-and-extract-region beg end)))
-          (let ((new-beg (- (point) (- end beg))))
-            (when (use-region-p)
-              (setq deactivate-mark nil)
-              (set-mark (+ new-beg mark-offset)))
-            (goto-char (+ new-beg pt-offset))))))))
-
-(defun git-rebase-move-line-up (n)
-  "Move the current commit (or command) N lines up.
-If N is negative, move the commit down instead.  With an active
-region, move all the lines that the region touches, not just the
-current line."
-  (interactive "p")
-  (git-rebase-move-line-down (- n)))
-
-(defun git-rebase-highlight-region (start end window rol)
-  (let ((inhibit-read-only t)
-        (deactivate-mark nil)
-        (bounds (git-rebase-region-bounds)))
-    (mapc #'delete-overlay magit-section-highlight-overlays)
-    (when bounds
-      (magit-section-make-overlay (car bounds) (cadr bounds)
-                                  'magit-section-heading-selection))
-    (if (and bounds (not magit-keep-region-overlay))
-        (funcall (default-value 'redisplay-unhighlight-region-function) rol)
-      (funcall (default-value 'redisplay-highlight-region-function)
-               start end window rol))))
-
-(defun git-rebase-unhighlight-region (rol)
-  (mapc #'delete-overlay magit-section-highlight-overlays)
-  (funcall (default-value 'redisplay-unhighlight-region-function) rol))
-
-(defun git-rebase-kill-line ()
-  "Kill the current action line."
-  (interactive)
-  (goto-char (line-beginning-position))
-  (when (and (looking-at git-rebase-line)
-             (not (eq (char-after) (string-to-char comment-start))))
-    (let ((inhibit-read-only t))
-      (insert comment-start)
-      (insert " "))
-    (when git-rebase-auto-advance
-      (forward-line))))
-
-(defun git-rebase-insert (rev)
-  "Read an arbitrary commit and insert it below current line."
-  (interactive (list (magit-read-branch-or-commit "Insert revision")))
-  (forward-line)
-  (--if-let (magit-rev-format "%h %s" rev)
-      (let ((inhibit-read-only t))
-        (insert "pick " it ?\n))
-    (user-error "Unknown revision")))
-
-(defun git-rebase-exec (arg)
-  "Insert a shell command to be run after the proceeding commit.
-
-If there already is such a command on the current line, then edit
-that instead.  With a prefix argument insert a new command even
-when there already is one on the current line.  With empty input
-remove the command on the current line, if any."
-  (interactive "P")
-  (let ((inhibit-read-only t) initial command)
-    (unless arg
-      (goto-char (line-beginning-position))
-      (when (looking-at (concat git-rebase-comment-re "?"
-                                "\\(e\\|exec\\) \\(.*\\)"))
-        (setq initial (match-string-no-properties 2))))
-    (setq command (read-shell-command "Execute: " initial))
-    (pcase (list command initial)
-      (`("" nil) (ding))
-      (`(""  ,_)
-       (delete-region (match-beginning 0) (1+ (match-end 0))))
-      (`(,_ nil)
-       (forward-line)
-       (insert (concat "exec " command "\n"))
-       (unless git-rebase-auto-advance
-         (forward-line -1)))
-      (_
-       (replace-match (concat "exec " command) t t)
-       (if git-rebase-auto-advance
-           (forward-line)
-         (goto-char (line-beginning-position)))))))
-
-(defun git-rebase-noop (&optional arg)
-  "Add noop action at point.
-
-If the current line already contains a a noop action, leave it
-unchanged.  If there is a commented noop action present, remove
-the comment.  Otherwise add a new noop action.  With a prefix
-argument insert a new noop action regardless what is already
-present on the current line.
-
-A noop action can be used to make git perform a rebase even if
-no commits are selected.  Without the noop action present, git
-would see an empty file and therefore do nothing."
-  (interactive "P")
-  (goto-char (line-beginning-position))
-  ;; The extra space at the end is only there to make the action
-  ;; consistent with the others (action argument). This keeps
-  ;; the regexp `git-rebase-line' from getting complicated.
-  (let ((noop-string "noop \n"))
-    (when (or arg (not (looking-at noop-string)))
-      (let ((inhibit-read-only t))
-        (if (and (not arg)
-                 (looking-at (concat comment-start noop-string)))
-            (delete-char 1)
-          (insert noop-string))))))
-
-(defun git-rebase-undo (&optional arg)
-  "Undo some previous changes.
-Like `undo' but works in read-only buffers."
-  (interactive "P")
-  (let ((inhibit-read-only t))
-    (undo arg)))
-
-(defun git-rebase--show-commit (&optional scroll)
-  (let ((disable-magit-save-buffers t))
-    (save-excursion
-      (goto-char (line-beginning-position))
-      (--if-let (and (looking-at git-rebase-line)
-                     (match-string 2))
-          (pcase scroll
-            (`up   (magit-diff-show-or-scroll-up))
-            (`down (magit-diff-show-or-scroll-down))
-            (_     (apply #'magit-show-commit it (magit-diff-arguments))))
-        (ding)))))
-
-(defun git-rebase-show-commit ()
-  "Show the commit on the current line if any."
-  (interactive)
-  (git-rebase--show-commit))
-
-(defun git-rebase-show-or-scroll-up ()
-  "Update the commit buffer for commit on current line.
-
-Either show the commit at point in the appropriate buffer, or if
-that buffer is already being displayed in the current frame and
-contains information about that commit, then instead scroll the
-buffer up."
-  (interactive)
-  (git-rebase--show-commit 'up))
-
-(defun git-rebase-show-or-scroll-down ()
-  "Update the commit buffer for commit on current line.
-
-Either show the commit at point in the appropriate buffer, or if
-that buffer is already being displayed in the current frame and
-contains information about that commit, then instead scroll the
-buffer down."
-  (interactive)
-  (git-rebase--show-commit 'down))
-
-(defun git-rebase-backward-line (&optional n)
-  "Move N lines backward (forward if N is negative).
-Like `forward-line' but go into the opposite direction."
-  (interactive "p")
-  (forward-line (- (or n 1))))
-
-;;; Mode
-
-;;;###autoload
-(define-derived-mode git-rebase-mode special-mode "Git Rebase"
-  "Major mode for editing of a Git rebase file.
-
-Rebase files are generated when you run 'git rebase -i' or run
-`magit-interactive-rebase'.  They describe how Git should perform
-the rebase.  See the documentation for git-rebase (e.g., by
-running 'man git-rebase' at the command line) for details."
-  :group 'git-rebase
-  (setq comment-start (or (magit-get "core.commentChar") "#"))
-  (setq git-rebase-comment-re (concat "^" (regexp-quote comment-start)))
-  (setq git-rebase-line
-        (concat "^\\(" (regexp-quote comment-start) "? *"
-                "\\(?:[fprse]\\|pick\\|reword\\|edit\\|squash\\|fixup\\|exec\\|noop\\)\\) "
-                "\\(?:\\([^ \n]+\\) \\(.*\\)\\)?"))
-  (setq font-lock-defaults (list (git-rebase-mode-font-lock-keywords) t t))
-  (unless git-rebase-show-instructions
-    (let ((inhibit-read-only t))
-      (flush-lines git-rebase-comment-re)))
-  (with-editor-mode 1)
-  (when git-rebase-confirm-cancel
-    (add-hook 'with-editor-cancel-query-functions
-              'git-rebase-cancel-confirm nil t))
-  (setq-local redisplay-highlight-region-function 'git-rebase-highlight-region)
-  (setq-local redisplay-unhighlight-region-function 'git-rebase-unhighlight-region)
-  (add-hook 'with-editor-pre-cancel-hook  'git-rebase-autostash-save  nil t)
-  (add-hook 'with-editor-post-cancel-hook 'git-rebase-autostash-apply nil t)
-  (setq imenu-prev-index-position-function
-        #'magit-imenu--rebase-prev-index-position-function)
-  (setq imenu-extract-index-name-function
-        #'magit-imenu--rebase-extract-index-name-function)
-  (when (boundp 'save-place)
-    (setq save-place nil)))
-
-(defun git-rebase-cancel-confirm (force)
-  (or (not (buffer-modified-p))
-      force
-      (magit-confirm 'abort-rebase "Abort this rebase")))
-
-(defun git-rebase-autostash-save ()
-  (--when-let (magit-file-line (magit-git-dir "rebase-merge/autostash"))
-    (push (cons 'stash it) with-editor-cancel-alist)))
-
-(defun git-rebase-autostash-apply ()
-  (--when-let (cdr (assq 'stash with-editor-cancel-alist))
-    (magit-stash-apply it)))
-
-(defun git-rebase-match-comment-line (limit)
-  (re-search-forward (concat git-rebase-comment-re ".*") limit t))
-
-(defun git-rebase-mode-font-lock-keywords ()
-  "Font lock keywords for Git-Rebase mode."
-  (let ((action-re "\
-\\([efprs]\\|pick\\|reword\\|edit\\|squash\\|fixup\\) \\([^ \n]+\\) \\(.*\\)"))
-    `((,(concat "^" action-re)
-       (1 'font-lock-keyword-face)
-       (2 'git-rebase-hash)
-       (3 'git-rebase-description))
-      ("^\\(exec\\) \\(.*\\)"
-       (1 'font-lock-keyword-face)
-       (2 'git-rebase-description))
-      (git-rebase-match-comment-line 0 'font-lock-comment-face)
-      (,(concat git-rebase-comment-re " *" action-re)
-       0 'git-rebase-killed-action t)
-      (,(format "^%s Rebase \\([^ ]*\\) onto \\([^ ]*\\)" comment-start)
-       (1 'git-rebase-comment-hash t)
-       (2 'git-rebase-comment-hash t))
-      (,(format "^%s \\(Commands:\\)" comment-start)
-       (1 'git-rebase-comment-heading t)))))
-
-(defun git-rebase-mode-show-keybindings ()
-  "Modify the \"Commands:\" section of the comment Git generates
-at the bottom of the file so that in place of the one-letter
-abbreviation for the command, it shows the command's keybinding.
-By default, this is the same except for the \"pick\" command."
-  (let ((inhibit-read-only t))
-    (save-excursion
-      (goto-char (point-min))
-      (when (and git-rebase-show-instructions
-                 (re-search-forward
-                  (concat git-rebase-comment-re " Commands:\n")
-                  nil t))
-        (--each git-rebase-command-descriptions
-          (insert (format "%s %-8s %s\n"
-                          comment-start
-                          (substitute-command-keys (format "\\[%s]" (car it)))
-                          (cdr it))))
-        (while (re-search-forward (concat git-rebase-comment-re
-                                          "\\(  ?\\)\\([^,],\\) \\([^ ]+\\) = ")
-                                  nil t)
-          (let ((cmd (intern (concat "git-rebase-" (match-string 3)))))
-            (if (not (fboundp cmd))
-                (delete-region (line-beginning-position) (1+ (line-end-position)))
-              (replace-match " " t t nil 1)
-              (replace-match
-               (format "%-8s"
-                       (mapconcat #'key-description
-                                  (--filter (not (eq (elt it 0) 'menu-bar))
-                                            (reverse (where-is-internal cmd)))
-                                  ", "))
-               t t nil 2))))))))
-
-(add-hook 'git-rebase-mode-hook 'git-rebase-mode-show-keybindings t)
-
-(defun git-rebase-mode-disable-before-save-hook ()
-  (set (make-local-variable 'before-save-hook) nil))
-
-(add-hook 'git-rebase-mode-hook 'git-rebase-mode-disable-before-save-hook)
-
-;;;###autoload
-(defconst git-rebase-filename-regexp "/git-rebase-todo\\'")
-;;;###autoload
-(add-to-list 'auto-mode-alist
-             (cons git-rebase-filename-regexp 'git-rebase-mode))
-
-(add-to-list 'with-editor-server-window-alist
-             (cons git-rebase-filename-regexp 'switch-to-buffer))
-
-(eval-after-load 'recentf
-  '(add-to-list 'recentf-exclude git-rebase-filename-regexp))
-
-(add-to-list 'with-editor-file-name-history-exclude git-rebase-filename-regexp)
-
-(provide 'git-rebase)
-;;; git-rebase.el ends here
.emacs.d/elpa/magit-20170913.1424/git-rebase.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-apply.el
@@ -1,598 +0,0 @@
-;;; magit-apply.el --- apply Git diffs  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements commands for applying Git diffs or parts
-;; of such a diff.  The supported "apply variants" are apply, stage,
-;; unstage, discard, and reverse - more than Git itself knows about,
-;; at least at the porcelain level.
-
-;;; Code:
-
-(require 'magit-core)
-(require 'magit-diff)
-(require 'magit-wip)
-
-;; For `magit-apply'
-(declare-function magit-am-popup 'magit-sequence)
-;; For `magit-discard-files'
-(declare-function magit-checkout-stage 'magit)
-(declare-function magit-checkout-read-stage 'magit)
-(defvar auto-revert-verbose)
-;; For `magit-stage-untracked'
-(declare-function magit-submodule-add 'magit-submodule)
-(declare-function magit-submodule-read-name-for-path 'magit-submodule)
-
-(require 'dired)
-
-;;; Options
-
-(defcustom magit-delete-by-moving-to-trash t
-  "Whether Magit uses the system's trash can.
-
-You should absolutely not disable this and also remove `discard'
-from `magit-no-confirm'.  You shouldn't do that even if you have
-all of the Magit-Wip modes enabled, because those modes do not
-track any files that are not tracked in the proper branch."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-essentials
-  :type 'boolean)
-
-(defcustom magit-unstage-committed t
-  "Whether unstaging a committed change reverts it instead.
-
-A committed change cannot be unstaged, because staging and
-unstaging are actions that are concerned with the differences
-between the index and the working tree, not with committed
-changes.
-
-If this option is non-nil (the default), then typing \"u\"
-\(`magit-unstage') on a committed change, causes it to be
-reversed in the index but not the working tree.  For more
-information see command `magit-reverse-in-index'."
-  :package-version '(magit . "2.4.1")
-  :group 'magit-commands
-  :type 'boolean)
-
-(defcustom magit-reverse-atomically nil
-  "Whether to reverse changes atomically.
-
-If some changes can be reversed while others cannot, then nothing
-is reversed if the value of this option is non-nil.  But when it
-is nil, then the changes that can be reversed are reversed and
-for the other changes diff files are created that contain the
-rejected reversals."
-  :package-version '(magit . "2.7.0")
-  :group 'magit-commands
-  :type 'boolean)
-
-;;; Commands
-;;;; Apply
-
-(defun magit-apply (&rest args)
-  "Apply the change at point to the working tree.
-With a prefix argument fallback to a 3-way merge.  Doing
-so causes the change to be applied to the index as well."
-  (interactive (and current-prefix-arg (list "--3way")))
-  (--when-let (magit-apply--get-selection)
-    (pcase (list (magit-diff-type) (magit-diff-scope))
-      (`(,(or `unstaged `staged) ,_)
-       (user-error "Change is already in the working tree"))
-      (`(untracked ,(or `file `files))
-       (magit-am-popup))
-      (`(,_ region) (magit-apply-region it args))
-      (`(,_   hunk) (magit-apply-hunk   it args))
-      (`(,_  hunks) (magit-apply-hunks  it args))
-      (`(,_   file) (magit-apply-diff   it args))
-      (`(,_  files) (magit-apply-diffs  it args)))))
-
-(defun magit-apply--section-content (section)
-  (buffer-substring-no-properties (if (eq (magit-section-type section) 'hunk)
-                                      (magit-section-start section)
-                                    (magit-section-content section))
-                                  (magit-section-end section)))
-
-(defun magit-apply-diffs (sections &rest args)
-  (setq sections (magit-apply--get-diffs sections))
-  (magit-apply-patch sections args
-                     (mapconcat
-                      (lambda (s)
-                        (concat (magit-diff-file-header s)
-                                (magit-apply--section-content s)))
-                      sections "")))
-
-(defun magit-apply-diff (section &rest args)
-  (setq section (car (magit-apply--get-diffs (list section))))
-  (magit-apply-patch section args
-                     (concat (magit-diff-file-header section)
-                             (magit-apply--section-content section))))
-
-(defun magit-apply-hunks (sections &rest args)
-  (let ((section (magit-section-parent (car sections))))
-    (when (string-match "^diff --cc" (magit-section-value section))
-      (user-error "Cannot un-/stage resolution hunks.  Stage the whole file"))
-    (magit-apply-patch section args
-                       (concat (magit-section-diff-header section)
-                               (mapconcat 'magit-apply--section-content
-                                          sections "")))))
-
-(defun magit-apply-hunk (section &rest args)
-  (when (string-match "^diff --cc" (magit-section-parent-value section))
-    (user-error "Cannot un-/stage resolution hunks.  Stage the whole file"))
-  (magit-apply-patch (magit-section-parent section) args
-                     (concat (magit-diff-file-header section)
-                             (magit-apply--section-content section))))
-
-(defun magit-apply-region (section &rest args)
-  (unless (magit-diff-context-p)
-    (user-error "Not enough context to apply region.  Increase the context"))
-  (when (string-match "^diff --cc" (magit-section-parent-value section))
-    (user-error "Cannot un-/stage resolution hunks.  Stage the whole file"))
-  (magit-apply-patch (magit-section-parent section) args
-                     (concat (magit-diff-file-header section)
-                             (magit-diff-hunk-region-patch section args))))
-
-(defun magit-apply-patch (section:s args patch)
-  (let* ((files (if (atom section:s)
-                    (list (magit-section-value section:s))
-                  (mapcar 'magit-section-value section:s)))
-         (command (symbol-name this-command))
-         (command (if (and command (string-match "^magit-\\([^-]+\\)" command))
-                      (match-string 1 command)
-                    "apply")))
-    (when (and magit-wip-before-change-mode (not inhibit-magit-refresh))
-      (magit-wip-commit-before-change files (concat " before " command)))
-    (with-temp-buffer
-      (insert patch)
-      (magit-run-git-with-input
-       "apply" args "-p0"
-       (unless (magit-diff-context-p) "--unidiff-zero")
-       "--ignore-space-change" "-"))
-    (unless inhibit-magit-refresh
-      (when magit-wip-after-apply-mode
-        (magit-wip-commit-after-apply files (concat " after " command)))
-      (magit-refresh))))
-
-(defun magit-apply--get-selection ()
-  (or (magit-region-sections 'hunk 'file)
-      (let ((section (magit-current-section)))
-        (pcase (magit-section-type section)
-          ((or `hunk `file) section)
-          ((or `staged `unstaged `untracked
-               `stashed-index `stashed-worktree `stashed-untracked)
-           (magit-section-children section))
-          (_ (user-error "Cannot apply this, it's not a change"))))))
-
-(defun magit-apply--get-diffs (sections)
-  (magit-section-case
-    ([file diffstat]
-     (--map (or (magit-get-section
-                 (append `((file . ,(magit-section-value it)))
-                         (magit-section-ident magit-root-section)))
-                (error "Cannot get required diff headers"))
-            sections))
-    (t sections)))
-
-;;;; Stage
-
-(defun magit-stage (&optional intent)
-  "Add the change at point to the staging area.
-With a prefix argument, INTENT, and an untracked file (or files)
-at point, stage the file but not its content."
-  (interactive "P")
-  (--if-let (and (derived-mode-p 'magit-mode) (magit-apply--get-selection))
-      (pcase (list (magit-diff-type) (magit-diff-scope))
-        (`(untracked     ,_) (magit-stage-untracked intent))
-        (`(unstaged  region) (magit-apply-region it "--cached"))
-        (`(unstaged    hunk) (magit-apply-hunk   it "--cached"))
-        (`(unstaged   hunks) (magit-apply-hunks  it "--cached"))
-        (`(unstaged    file) (magit-stage-1 "-u" (list (magit-section-value it))))
-        (`(unstaged   files) (magit-stage-1 "-u" (magit-region-values)))
-        (`(unstaged    list) (magit-stage-1 "-u"))
-        (`(staged        ,_) (user-error "Already staged"))
-        (`(committed     ,_) (user-error "Cannot stage committed changes"))
-        (`(undefined     ,_) (user-error "Cannot stage this change")))
-    (call-interactively 'magit-stage-file)))
-
-;;;###autoload
-(defun magit-stage-file (file)
-  "Stage all changes to FILE.
-With a prefix argument or when there is no file at point ask for
-the file to be staged.  Otherwise stage the file at point without
-requiring confirmation."
-  (interactive
-   (let* ((atpoint (magit-section-when (file)))
-          (current (magit-file-relative-name))
-          (choices (nconc (magit-unstaged-files)
-                          (magit-untracked-files)))
-          (default (car (member (or atpoint current) choices))))
-     (list (if (or current-prefix-arg (not default))
-               (magit-completing-read "Stage file" choices
-                                      nil t nil nil default)
-             default))))
-  (magit-with-toplevel
-    (magit-stage-1 nil (list file))))
-
-;;;###autoload
-(defun magit-stage-modified (&optional all)
-  "Stage all changes to files modified in the worktree.
-Stage all new content of tracked files and remove tracked files
-that no longer exist in the working tree from the index also.
-With a prefix argument also stage previously untracked (but not
-ignored) files.
-\('git add --update|--all .')."
-  (interactive (progn (unless (or (not (magit-anything-staged-p))
-                                  (magit-confirm 'stage-all-changes))
-                        (user-error "Abort"))
-                      (list current-prefix-arg)))
-  (magit-with-toplevel
-    (magit-stage-1 (if all "--all" "-u"))))
-
-(defun magit-stage-1 (arg &optional files)
-  (magit-wip-commit-before-change files " before stage")
-  (magit-run-git "add" arg (if files (cons "--" files) "."))
-  (when magit-auto-revert-mode
-    (mapc #'magit-turn-on-auto-revert-mode-if-desired files))
-  (magit-wip-commit-after-apply files " after stage"))
-
-(defun magit-stage-untracked (&optional intent)
-  (let* ((section (magit-current-section))
-         (files (pcase (magit-diff-scope)
-                  (`file  (list (magit-section-value section)))
-                  (`files (magit-region-values))
-                  (`list  (magit-untracked-files))))
-         plain repos)
-    (dolist (file files)
-      (if (and (not (file-symlink-p file))
-               (magit-git-repo-p file t))
-          (push file repos)
-        (push file plain)))
-    (magit-wip-commit-before-change files " before stage")
-    (when plain
-      (magit-run-git "add" (and intent "--intent-to-add")
-                     "--" plain)
-      (when magit-auto-revert-mode
-        (mapc #'magit-turn-on-auto-revert-mode-if-desired plain)))
-    (dolist (repo repos)
-      (save-excursion
-        (goto-char (magit-section-start
-                    (magit-get-section
-                     `((file . ,repo) (untracked) (status)))))
-        (magit-submodule-add
-         (let ((default-directory
-                 (file-name-as-directory (expand-file-name repo))))
-           (or (magit-get "remote" (or (magit-get-remote) "origin") "url")
-               (concat (file-name-as-directory ".") repo)))
-         repo
-         (magit-submodule-read-name-for-path repo))))
-    (magit-wip-commit-after-apply files " after stage")))
-
-;;;; Unstage
-
-(defun magit-unstage ()
-  "Remove the change at point from the staging area."
-  (interactive)
-  (--when-let (magit-apply--get-selection)
-    (pcase (list (magit-diff-type) (magit-diff-scope))
-      (`(untracked     ,_) (user-error "Cannot unstage untracked changes"))
-      (`(unstaged      ,_) (user-error "Already unstaged"))
-      (`(staged    region) (magit-apply-region it "--reverse" "--cached"))
-      (`(staged      hunk) (magit-apply-hunk   it "--reverse" "--cached"))
-      (`(staged     hunks) (magit-apply-hunks  it "--reverse" "--cached"))
-      (`(staged      file) (magit-unstage-1 (list (magit-section-value it))))
-      (`(staged     files) (magit-unstage-1 (magit-region-values)))
-      (`(staged      list) (magit-unstage-all))
-      (`(committed     ,_) (if magit-unstage-committed
-                               (magit-reverse-in-index)
-                             (user-error "Cannot unstage committed changes")))
-      (`(undefined     ,_) (user-error "Cannot unstage this change")))))
-
-;;;###autoload
-(defun magit-unstage-file (file)
-  "Unstage all changes to FILE.
-With a prefix argument or when there is no file at point ask for
-the file to be unstaged.  Otherwise unstage the file at point
-without requiring confirmation."
-  (interactive
-   (let* ((atpoint (magit-section-when (file)))
-          (current (magit-file-relative-name))
-          (choices (magit-staged-files))
-          (default (car (member (or atpoint current) choices))))
-     (list (if (or current-prefix-arg (not default))
-               (magit-completing-read "Unstage file" choices
-                                      nil t nil nil default)
-             default))))
-  (magit-with-toplevel
-    (magit-unstage-1 (list file))))
-
-(defun magit-unstage-1 (files)
-  (magit-wip-commit-before-change files " before unstage")
-  (if (magit-no-commit-p)
-      (magit-run-git "rm" "--cached" "--" files)
-    (magit-run-git "reset" "HEAD" "--" files))
-  (magit-wip-commit-after-apply files " after unstage"))
-
-;;;###autoload
-(defun magit-unstage-all ()
-  "Remove all changes from the staging area."
-  (interactive)
-  (when (or (and (not (magit-anything-unstaged-p))
-                 (not (magit-untracked-files)))
-            (magit-confirm 'unstage-all-changes))
-    (magit-wip-commit-before-change nil " before unstage")
-    (magit-run-git "reset" "HEAD" "--")
-    (magit-wip-commit-after-apply nil " after unstage")))
-
-;;;; Discard
-
-(defun magit-discard ()
-  "Remove the change at point."
-  (interactive)
-  (--when-let (magit-apply--get-selection)
-    (pcase (list (magit-diff-type) (magit-diff-scope))
-      (`(committed ,_) (user-error "Cannot discard committed changes"))
-      (`(undefined ,_) (user-error "Cannot discard this change"))
-      (`(,_    region) (magit-discard-region it))
-      (`(,_      hunk) (magit-discard-hunk   it))
-      (`(,_     hunks) (magit-discard-hunks  it))
-      (`(,_      file) (magit-discard-file   it))
-      (`(,_     files) (magit-discard-files  it))
-      (`(,_      list) (magit-discard-files  it)))))
-
-(defun magit-discard-region (section)
-  (when (magit-confirm 'discard "Discard region")
-    (magit-discard-apply section 'magit-apply-region)))
-
-(defun magit-discard-hunk (section)
-  (when (magit-confirm 'discard "Discard hunk")
-    (magit-discard-apply section 'magit-apply-hunk)))
-
-(defun magit-discard-apply (section apply)
-  (if (eq (magit-diff-type section) 'unstaged)
-      (funcall apply section "--reverse")
-    (if (magit-anything-unstaged-p
-         nil (if (eq (magit-section-type section) 'file)
-                 (magit-section-value section)
-               (magit-section-parent-value section)))
-        (progn (let ((inhibit-magit-refresh t))
-                 (funcall apply section "--reverse" "--cached")
-                 (funcall apply section "--reverse" "--reject"))
-               (magit-refresh))
-      (funcall apply section "--reverse" "--index"))))
-
-(defun magit-discard-hunks (sections)
-  (when (magit-confirm 'discard
-          (format "Discard %s hunks from %s"
-                  (length sections)
-                  (magit-section-parent-value (car sections))))
-    (magit-discard-apply-n sections 'magit-apply-hunks)))
-
-(defun magit-discard-apply-n (sections apply)
-  (let ((section (car sections)))
-    (if (eq (magit-diff-type section) 'unstaged)
-        (funcall apply sections "--reverse")
-      (if (magit-anything-unstaged-p
-           nil (if (eq (magit-section-type section) 'file)
-                   (magit-section-value section)
-                 (magit-section-parent-value section)))
-          (progn (let ((inhibit-magit-refresh t))
-                   (funcall apply sections "--reverse" "--cached")
-                   (funcall apply sections "--reverse" "--reject"))
-                 (magit-refresh))
-        (funcall apply sections "--reverse" "--index")))))
-
-(defun magit-discard-file (section)
-  (magit-discard-files (list section)))
-
-(defun magit-discard-files (sections)
-  (let ((auto-revert-verbose nil)
-        (type (magit-diff-type (car sections)))
-        (status (magit-file-status))
-        files delete resurrect rename discard discard-new resolve)
-    (dolist (section sections)
-      (let ((file (magit-section-value section)))
-        (push file files)
-        (pcase (cons (pcase type
-                       (`staged ?X)
-                       (`unstaged ?Y)
-                       (`untracked ?Z))
-                     (cddr (assoc file status)))
-          (`(?Z) (--each (magit-untracked-files nil file)
-                   (push it delete)))
-          ((or `(?Z ?? ??) `(?Z ?! ?!)) (push file delete))
-          ((or `(?Z ?D ? ) `(,_ ?D ?D)) (push file delete))
-          ((or `(,_ ?U ,_) `(,_ ,_ ?U)) (push file resolve))
-          (`(,_ ?A ?A)                  (push file resolve))
-          (`(?X ?M ,(or ?  ?M ?D)) (push section discard))
-          (`(?Y ,_         ?M    ) (push section discard))
-          (`(?X ?A         ?M    ) (push file discard-new))
-          (`(?X ?C         ?M    ) (push file discard-new))
-          (`(?X ?A ,(or ?     ?D)) (push file delete))
-          (`(?X ?C ,(or ?     ?D)) (push file delete))
-          (`(?X ?D ,(or ?  ?M   )) (push file resurrect))
-          (`(?Y ,_            ?D ) (push file resurrect))
-          (`(?X ?R ,(or ?  ?M ?D)) (push file rename)))))
-    (unwind-protect
-        (let ((inhibit-magit-refresh t))
-          (magit-wip-commit-before-change files " before discard")
-          (when resolve
-            (dolist (file (nreverse resolve))
-              (magit-checkout-stage file (magit-checkout-read-stage file))))
-          (magit-discard-files--resurrect (nreverse resurrect))
-          (magit-discard-files--delete    (nreverse delete) status)
-          (magit-discard-files--rename    (nreverse rename) status)
-          (magit-discard-files--discard   (nreverse discard)
-                                          (nreverse discard-new))
-          (magit-wip-commit-after-apply files " after discard"))
-      (magit-refresh))))
-
-(defun magit-discard-files--resurrect (files)
-  (when (magit-confirm-files 'resurrect files)
-    (if (eq (magit-diff-type) 'staged)
-        (magit-call-git "reset"  "--" files)
-      (magit-call-git "checkout" "--" files))))
-
-(defun magit-discard-files--delete (files status)
-  (when (if magit-delete-by-moving-to-trash
-            (magit-confirm-files 'trash files)
-          (magit-confirm-files 'delete files))
-    (let ((delete-by-moving-to-trash magit-delete-by-moving-to-trash))
-      (dolist (file files)
-        (if (memq (magit-diff-type) '(unstaged untracked))
-            (dired-delete-file file dired-recursive-deletes
-                               magit-delete-by-moving-to-trash)
-          (pcase (nth 3 (assoc file status))
-            (?  (delete-file file t)
-                (magit-call-git "rm" "--cached" "--" file))
-            (?M (let ((temp (magit-git-string "checkout-index" "--temp" file)))
-                  (string-match
-                   (format "\\(.+?\\)\t%s" (regexp-quote file)) temp)
-                  (rename-file (match-string 1 temp)
-                               (setq temp (concat file ".~{index}~")))
-                  (delete-file temp t))
-                (magit-call-git "rm" "--cached" "--force" "--" file))
-            (?D (magit-call-git "checkout" "--" file)
-                (delete-file file t)
-                (magit-call-git "rm" "--cached" "--force" "--" file))))))))
-
-(defun magit-discard-files--rename (files status)
-  (when (magit-confirm 'rename "Undo rename %s" "Undo %i renames"
-          (mapcar (lambda (file)
-                    (setq file (assoc file status))
-                    (format "%s -> %s" (cadr file) (car file)))
-                  files))
-    (dolist (file files)
-      (let ((orig (cadr (assoc file status))))
-        (if (file-exists-p file)
-            (progn
-              (--when-let (file-name-directory orig)
-                (make-directory it t))
-              (magit-call-git "mv" file orig))
-          (magit-call-git "rm" "--cached" "--" file)
-          (magit-call-git "reset" "--" orig))))))
-
-(defun magit-discard-files--discard (sections new-files)
-  (let ((files (mapcar #'magit-section-value sections)))
-    (when (magit-confirm-files
-           'discard (append files new-files)
-           (format "Discard %s changes in" (magit-diff-type)))
-      (if (eq (magit-diff-type (car sections)) 'unstaged)
-          (magit-call-git "checkout" "--" files)
-        (when new-files
-          (magit-call-git "add"   "--" new-files)
-          (magit-call-git "reset" "--" new-files))
-        (let ((binaries (magit-staged-binary-files)))
-          (when binaries
-            (setq sections
-                  (--filter (not (member (magit-section-value it) binaries))
-                            sections)))
-          (cond ((= (length sections) 1)
-                 (magit-discard-apply (car sections) 'magit-apply-diff))
-                (sections
-                 (magit-discard-apply-n sections 'magit-apply-diffs)))
-          (when binaries
-            (let ((modified (magit-unstaged-files t)))
-              (setq binaries (--separate (member it modified) binaries)))
-            (when (cadr binaries)
-              (magit-call-git "reset" "--" (cadr binaries)))
-            (when (car binaries)
-              (user-error
-               (concat
-                "Cannot discard staged changes to binary files, "
-                "which also have unstaged changes.  Unstage instead.")))))))))
-
-;;;; Reverse
-
-(defun magit-reverse (&rest args)
-  "Reverse the change at point in the working tree.
-With a prefix argument fallback to a 3-way merge.  Doing
-so causes the change to be applied to the index as well."
-  (interactive (and current-prefix-arg (list "--3way")))
-  (--when-let (magit-apply--get-selection)
-    (pcase (list (magit-diff-type) (magit-diff-scope))
-      (`(untracked ,_) (user-error "Cannot reverse untracked changes"))
-      (`(unstaged  ,_) (user-error "Cannot reverse unstaged changes"))
-      (`(,_    region) (magit-reverse-region it args))
-      (`(,_      hunk) (magit-reverse-hunk   it args))
-      (`(,_     hunks) (magit-reverse-hunks  it args))
-      (`(,_      file) (magit-reverse-file   it args))
-      (`(,_     files) (magit-reverse-files  it args))
-      (`(,_      list) (magit-reverse-files  it args)))))
-
-(defun magit-reverse-region (section args)
-  (when (magit-confirm 'reverse "Reverse region")
-    (magit-reverse-apply section 'magit-apply-region args)))
-
-(defun magit-reverse-hunk (section args)
-  (when (magit-confirm 'reverse "Reverse hunk")
-    (magit-reverse-apply section 'magit-apply-hunk args)))
-
-(defun magit-reverse-hunks (sections args)
-  (when (magit-confirm 'reverse
-          (format "Reverse %s hunks from %s"
-                  (length sections)
-                  (magit-section-parent-value (car sections))))
-    (magit-reverse-apply sections 'magit-apply-hunks args)))
-
-(defun magit-reverse-file (section args)
-  (magit-reverse-files (list section) args))
-
-(defun magit-reverse-files (sections args)
-  (-let [(binaries sections)
-         (let ((bs (magit-staged-binary-files)))
-           (--separate (member (magit-section-value it) bs) sections))]
-    (when (magit-confirm-files 'reverse (mapcar #'magit-section-value sections))
-      (if (= (length sections) 1)
-          (magit-reverse-apply (car sections) 'magit-apply-diff args)
-        (magit-reverse-apply sections 'magit-apply-diffs args)))
-    (when binaries
-      (user-error "Cannot reverse binary files"))))
-
-(defun magit-reverse-apply (section:s apply args)
-  (funcall apply section:s "--reverse" args
-           (and (not magit-reverse-atomically)
-                (not (member "--3way" args))
-                "--reject")))
-
-(defun magit-reverse-in-index (&rest args)
-  "Reverse the change at point in the index but not the working tree.
-
-Use this command to extract a change from `HEAD', while leaving
-it in the working tree, so that it can later be committed using
-a separate commit.  A typical workflow would be:
-
-0. Optionally make sure that there are no uncommitted changes.
-1. Visit the `HEAD' commit and navigate to the change that should
-   not have been included in that commit.
-2. Type \"u\" (`magit-unstage') to reverse it in the index.
-   This assumes that `magit-unstage-committed-changes' is non-nil.
-3. Type \"c e\" to extend `HEAD' with the staged changes,
-   including those that were already staged before.
-4. Optionally stage the remaining changes using \"s\" or \"S\"
-   and then type \"c c\" to create a new commit."
-  (interactive)
-  (magit-reverse (cons "--cached" args)))
-
-(provide 'magit-apply)
-;;; magit-apply.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-apply.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-autoloads.el
@@ -1,2100 +0,0 @@
-;;; magit-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "git-rebase" "git-rebase.el" (22985 22856 895338
-;;;;;;  968000))
-;;; Generated autoloads from git-rebase.el
-
-(autoload 'git-rebase-mode "git-rebase" "\
-Major mode for editing of a Git rebase file.
-
-Rebase files are generated when you run 'git rebase -i' or run
-`magit-interactive-rebase'.  They describe how Git should perform
-the rebase.  See the documentation for git-rebase (e.g., by
-running 'man git-rebase' at the command line) for details.
-
-\(fn)" t nil)
-
-(defconst git-rebase-filename-regexp "/git-rebase-todo\\'")
-
-(add-to-list 'auto-mode-alist (cons git-rebase-filename-regexp 'git-rebase-mode))
-
-;;;***
-
-;;;### (autoloads nil "magit" "magit.el" (22985 22856 914338 793000))
-;;; Generated autoloads from magit.el
- (autoload 'magit-merge-popup "magit" nil t)
-
-(autoload 'magit-merge "magit" "\
-Merge commit REV into the current branch; using default message.
-
-Unless there are conflicts or a prefix argument is used create a
-merge commit using a generic commit message and without letting
-the user inspect the result.  With a prefix argument pretend the
-merge failed to give the user the opportunity to inspect the
-merge.
-
-\(git merge --no-edit|--no-commit [ARGS] REV)
-
-\(fn REV &optional ARGS NOCOMMIT)" t nil)
-
-(autoload 'magit-merge-editmsg "magit" "\
-Merge commit REV into the current branch; and edit message.
-Perform the merge and prepare a commit message but let the user
-edit it.
-
-\(git merge --edit --no-ff [ARGS] REV)
-
-\(fn REV &optional ARGS)" t nil)
-
-(autoload 'magit-merge-nocommit "magit" "\
-Merge commit REV into the current branch; pretending it failed.
-Pretend the merge failed to give the user the opportunity to
-inspect the merge and change the commit message.
-
-\(git merge --no-commit --no-ff [ARGS] REV)
-
-\(fn REV &optional ARGS)" t nil)
-
-(autoload 'magit-merge-preview "magit" "\
-Preview result of merging REV into the current branch.
-
-\(fn REV)" t nil)
-
-(autoload 'magit-merge-abort "magit" "\
-Abort the current merge operation.
-
-\(git merge --abort)
-
-\(fn)" t nil)
- (autoload 'magit-reset-popup "magit" nil t)
-
-(autoload 'magit-reset-index "magit" "\
-Reset the index to COMMIT.
-Keep the head and working tree as-is, so if COMMIT refers to the
-head this effectively unstages all changes.
-
-\(git reset COMMIT .)
-
-\(fn COMMIT)" t nil)
-
-(autoload 'magit-reset "magit" "\
-Reset the head and index to COMMIT, but not the working tree.
-With a prefix argument also reset the working tree.
-
-\(git reset --mixed|--hard COMMIT)
-
-\(fn COMMIT &optional HARD)" t nil)
-
-(autoload 'magit-reset-head "magit" "\
-Reset the head and index to COMMIT, but not the working tree.
-
-\(git reset --mixed COMMIT)
-
-\(fn COMMIT)" t nil)
-
-(autoload 'magit-reset-soft "magit" "\
-Reset the head to COMMIT, but not the index and working tree.
-
-\(git reset --soft REVISION)
-
-\(fn COMMIT)" t nil)
-
-(autoload 'magit-reset-hard "magit" "\
-Reset the head, index, and working tree to COMMIT.
-
-\(git reset --hard REVISION)
-
-\(fn COMMIT)" t nil)
- (autoload 'magit-tag-popup "magit" nil t)
-
-(autoload 'magit-tag "magit" "\
-Create a new tag with the given NAME at REV.
-With a prefix argument annotate the tag.
-
-\(git tag [--annotate] NAME REV)
-
-\(fn NAME REV &optional ARGS)" t nil)
-
-(autoload 'magit-tag-delete "magit" "\
-Delete one or more tags.
-If the region marks multiple tags (and nothing else), then offer
-to delete those, otherwise prompt for a single tag to be deleted,
-defaulting to the tag at point.
-
-\(git tag -d TAGS)
-
-\(fn TAGS)" t nil)
- (autoload 'magit-dispatch-popup "magit" nil t)
- (autoload 'magit-run-popup "magit" nil t)
-
-(autoload 'magit-git-command "magit" "\
-Execute COMMAND asynchonously; display output.
-
-Interactively, prompt for COMMAND in the minibuffer. \"git \" is
-used as initial input, but can be deleted to run another command.
-
-With a prefix argument COMMAND is run in the top-level directory
-of the current working tree, otherwise in `default-directory'.
-
-\(fn COMMAND)" t nil)
-
-(autoload 'magit-git-command-topdir "magit" "\
-Execute COMMAND asynchonously; display output.
-
-Interactively, prompt for COMMAND in the minibuffer. \"git \" is
-used as initial input, but can be deleted to run another command.
-
-COMMAND is run in the top-level directory of the current
-working tree.
-
-\(fn COMMAND)" t nil)
-
-(autoload 'magit-shell-command "magit" "\
-Execute COMMAND asynchonously; display output.
-
-Interactively, prompt for COMMAND in the minibuffer.  With a
-prefix argument COMMAND is run in the top-level directory of
-the current working tree, otherwise in `default-directory'.
-
-\(fn COMMAND)" t nil)
-
-(autoload 'magit-shell-command-topdir "magit" "\
-Execute COMMAND asynchonously; display output.
-
-Interactively, prompt for COMMAND in the minibuffer.  COMMAND
-is run in the top-level directory of the current working tree.
-
-\(fn COMMAND)" t nil)
-
-(autoload 'magit-version "magit" "\
-Return the version of Magit currently in use.
-If optional argument PRINT-DEST is non-nil, output
-stream (interactively, the echo area, or the current buffer with
-a prefix argument), also print the used versions of Magit, Git,
-and Emacs to it.
-
-\(fn &optional PRINT-DEST)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-apply" "magit-apply.el" (22985 22856
-;;;;;;  901338 913000))
-;;; Generated autoloads from magit-apply.el
-
-(autoload 'magit-stage-file "magit-apply" "\
-Stage all changes to FILE.
-With a prefix argument or when there is no file at point ask for
-the file to be staged.  Otherwise stage the file at point without
-requiring confirmation.
-
-\(fn FILE)" t nil)
-
-(autoload 'magit-stage-modified "magit-apply" "\
-Stage all changes to files modified in the worktree.
-Stage all new content of tracked files and remove tracked files
-that no longer exist in the working tree from the index also.
-With a prefix argument also stage previously untracked (but not
-ignored) files.
-\('git add --update|--all .').
-
-\(fn &optional ALL)" t nil)
-
-(autoload 'magit-unstage-file "magit-apply" "\
-Unstage all changes to FILE.
-With a prefix argument or when there is no file at point ask for
-the file to be unstaged.  Otherwise unstage the file at point
-without requiring confirmation.
-
-\(fn FILE)" t nil)
-
-(autoload 'magit-unstage-all "magit-apply" "\
-Remove all changes from the staging area.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (22985
-;;;;;;  22856 886339 51000))
-;;; Generated autoloads from magit-autorevert.el
-
-(defvar magit-revert-buffers t)
-
-(defvar magit-auto-revert-mode (and (with-no-warnings magit-revert-buffers) (not global-auto-revert-mode) (not noninteractive)) "\
-Non-nil if Magit-Auto-Revert mode is enabled.
-See the `magit-auto-revert-mode' command
-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 `magit-auto-revert-mode'.")
-
-(custom-autoload 'magit-auto-revert-mode "magit-autorevert" nil)
-
-(autoload 'magit-auto-revert-mode "magit-autorevert" "\
-Toggle Auto-Revert mode in all buffers.
-With prefix ARG, enable Magit-Auto-Revert mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
-
-Auto-Revert mode is enabled in all buffers where
-`magit-turn-on-auto-revert-mode-if-desired' would do it.
-See `auto-revert-mode' for more information on Auto-Revert mode.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (22985 22856
-;;;;;;  900338 922000))
-;;; Generated autoloads from magit-bisect.el
- (autoload 'magit-bisect-popup "magit-bisect" nil t)
-
-(autoload 'magit-bisect-start "magit-bisect" "\
-Start a bisect session.
-
-Bisecting a bug means to find the commit that introduced it.
-This command starts such a bisect session by asking for a know
-good and a bad commit.  To move the session forward use the
-other actions from the bisect popup (\\<magit-status-mode-map>\\[magit-bisect-popup]).
-
-\(fn BAD GOOD)" t nil)
-
-(autoload 'magit-bisect-reset "magit-bisect" "\
-After bisecting, cleanup bisection state and return to original `HEAD'.
-
-\(fn)" t nil)
-
-(autoload 'magit-bisect-good "magit-bisect" "\
-While bisecting, mark the current commit as good.
-Use this after you have asserted that the commit does not contain
-the bug in question.
-
-\(fn)" t nil)
-
-(autoload 'magit-bisect-bad "magit-bisect" "\
-While bisecting, mark the current commit as bad.
-Use this after you have asserted that the commit does contain the
-bug in question.
-
-\(fn)" t nil)
-
-(autoload 'magit-bisect-skip "magit-bisect" "\
-While bisecting, skip the current commit.
-Use this if for some reason the current commit is not a good one
-to test.  This command lets Git choose a different one.
-
-\(fn)" t nil)
-
-(autoload 'magit-bisect-run "magit-bisect" "\
-Bisect automatically by running commands after each step.
-
-Unlike `git bisect run' this can be used before bisecting has
-begun.  In that case it behaves like `git bisect start; git
-bisect run'.
-
-\(fn CMDLINE &optional BAD GOOD)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-blame" "magit-blame.el" (22985 22856
-;;;;;;  912338 812000))
-;;; Generated autoloads from magit-blame.el
- (autoload 'magit-blame-popup "magit-blame" nil t)
-
-(autoload 'magit-blame "magit-blame" "\
-Display edit history of FILE up to REVISION.
-
-Interactively blame the file being visited in the current buffer.
-If the buffer visits a revision of that file, then blame up to
-that revision, otherwise blame the file's full history, including
-uncommitted changes.
-
-If Magit-Blame mode is already turned on then blame recursively, by
-visiting REVISION:FILE (using `magit-find-file'), where revision
-is the revision before the revision that added the lines at
-point.
-
-ARGS is a list of additional arguments to pass to `git blame';
-only arguments available from `magit-blame-popup' should be used.
-
-\(fn REVISION FILE &optional ARGS)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-bookmark" "magit-bookmark.el" (22985
-;;;;;;  22856 897338 949000))
-;;; Generated autoloads from magit-bookmark.el
-
-(autoload 'magit-bookmark--status-jump "magit-bookmark" "\
-Handle a Magit status BOOKMARK.
-
-\(fn BOOKMARK)" nil nil)
-
-(autoload 'magit-bookmark--status-make-record "magit-bookmark" "\
-Create a Magit status bookmark.
-
-\(fn)" nil nil)
-
-(autoload 'magit-bookmark--refs-jump "magit-bookmark" "\
-Handle a Magit refs BOOKMARK.
-
-\(fn BOOKMARK)" nil nil)
-
-(autoload 'magit-bookmark--refs-make-record "magit-bookmark" "\
-Create a Magit refs bookmark.
-
-\(fn)" nil nil)
-
-(autoload 'magit-bookmark--log-jump "magit-bookmark" "\
-Handle a Magit log BOOKMARK.
-
-\(fn BOOKMARK)" nil nil)
-
-(autoload 'magit-bookmark--log-make-record "magit-bookmark" "\
-Create a Magit log bookmark.
-
-\(fn)" nil nil)
-
-(autoload 'magit-bookmark--reflog-jump "magit-bookmark" "\
-Handle a Magit reflog BOOKMARK.
-
-\(fn BOOKMARK)" nil nil)
-
-(autoload 'magit-bookmark--reflog-make-record "magit-bookmark" "\
-Create a Magit reflog bookmark.
-
-\(fn)" nil nil)
-
-(autoload 'magit-bookmark--stashes-jump "magit-bookmark" "\
-Handle a Magit stash list BOOKMARK.
-
-\(fn BOOKMARK)" nil nil)
-
-(autoload 'magit-bookmark--stashes-make-record "magit-bookmark" "\
-Create a Magit stash list bookmark.
-
-\(fn)" nil nil)
-
-(autoload 'magit-bookmark--cherry-jump "magit-bookmark" "\
-Handle a Magit cherry BOOKMARK.
-
-\(fn BOOKMARK)" nil nil)
-
-(autoload 'magit-bookmark--cherry-make-record "magit-bookmark" "\
-Create a Magit cherry bookmark.
-
-\(fn)" nil nil)
-
-(autoload 'magit-bookmark--diff-jump "magit-bookmark" "\
-Handle a Magit diff BOOKMARK.
-
-\(fn BOOKMARK)" nil nil)
-
-(autoload 'magit-bookmark--diff-make-record "magit-bookmark" "\
-Create a Magit diff bookmark.
-
-\(fn)" nil nil)
-
-(autoload 'magit-bookmark--revision-jump "magit-bookmark" "\
-Handle a Magit revision BOOKMARK.
-
-\(fn BOOKMARK)" nil nil)
-
-(autoload 'magit-bookmark--revision-make-record "magit-bookmark" "\
-Create a Magit revision bookmark.
-
-\(fn)" nil nil)
-
-(autoload 'magit-bookmark--stash-jump "magit-bookmark" "\
-Handle a Magit stash BOOKMARK.
-
-\(fn BOOKMARK)" nil nil)
-
-(autoload 'magit-bookmark--stash-make-record "magit-bookmark" "\
-Create a Magit stash bookmark.
-
-\(fn)" nil nil)
-
-(autoload 'magit-bookmark--submodules-jump "magit-bookmark" "\
-Handle a Magit submodule list BOOKMARK.
-
-\(fn BOOKMARK)" nil nil)
-
-(autoload 'magit-bookmark--submodules-make-record "magit-bookmark" "\
-Create a Magit submodule list bookmark.
-
-\(fn)" nil nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-branch" "magit-branch.el" (22985 22856
-;;;;;;  899338 931000))
-;;; Generated autoloads from magit-branch.el
- (autoload 'magit-branch-popup "magit" nil t)
-
-(autoload 'magit-checkout "magit-branch" "\
-Checkout REVISION, updating the index and the working tree.
-If REVISION is a local branch, then that becomes the current
-branch.  If it is something else, then `HEAD' becomes detached.
-Checkout fails if the working tree or the staging area contain
-changes.
-
-\(git checkout REVISION).
-
-\(fn REVISION)" t nil)
-
-(autoload 'magit-branch "magit-branch" "\
-Create BRANCH at branch or revision START-POINT.
-
-\(git branch [ARGS] BRANCH START-POINT).
-
-\(fn BRANCH START-POINT &optional ARGS)" t nil)
-
-(autoload 'magit-branch-and-checkout "magit-branch" "\
-Create and checkout BRANCH at branch or revision START-POINT.
-
-\(git checkout [ARGS] -b BRANCH START-POINT).
-
-\(fn BRANCH START-POINT &optional ARGS)" t nil)
-
-(autoload 'magit-branch-orphan "magit-branch" "\
-Create and checkout an orphan BRANCH with contents from revision START-POINT.
-
-\(git checkout --orphan [ARGS] BRANCH START-POINT).
-
-\(fn BRANCH START-POINT &optional ARGS)" t nil)
-
-(autoload 'magit-branch-spinoff "magit-branch" "\
-Create new branch from the unpushed commits.
-
-Create and checkout a new branch starting at and tracking the
-current branch.  That branch in turn is reset to the last commit
-it shares with its upstream.  If the current branch has no
-upstream or no unpushed commits, then the new branch is created
-anyway and the previously current branch is not touched.
-
-This is useful to create a feature branch after work has already
-began on the old branch (likely but not necessarily \"master\").
-
-If the current branch is a member of the value of option
-`magit-branch-prefer-remote-upstream' (which see), then the
-current branch will be used as the starting point as usual, but
-the upstream of the starting-point may be used as the upstream
-of the new branch, instead of the starting-point itself.
-
-If optional FROM is non-nil, then the source branch is reset
-to `FROM~', instead of to the last commit it shares with its
-upstream.  Interactively, FROM is only ever non-nil, if the
-region selects some commits, and among those commits, FROM is
-the commit that is the fewest commits ahead of the source
-branch.  (It not yet possible to spin off a single commit,
-unless it is the only unpushed commit.  See #2920.)
-
-The commit at the other end of the selection actually does not
-matter, all commits between FROM and `HEAD' are moved to the new
-branch.  If FROM is not reachable from `HEAD' or is reachable
-from the source branch's upstream, then an error is raised.
-
-\(fn BRANCH &optional FROM &rest ARGS)" t nil)
-
-(autoload 'magit-branch-reset "magit-branch" "\
-Reset a branch to the tip of another branch or any other commit.
-
-When the branch being reset is the current branch, then do a
-hard reset.  If there are any uncommitted changes, then the user
-has to confirm the reset because those changes would be lost.
-
-This is useful when you have started work on a feature branch but
-realize it's all crap and want to start over.
-
-When resetting to another branch and a prefix argument is used,
-then also set the target branch as the upstream of the branch
-that is being reset.
-
-\(fn BRANCH TO &optional ARGS SET-UPSTREAM)" t nil)
-
-(autoload 'magit-branch-delete "magit-branch" "\
-Delete one or multiple branches.
-If the region marks multiple branches, then offer to delete
-those, otherwise prompt for a single branch to be deleted,
-defaulting to the branch at point.
-
-\(fn BRANCHES &optional FORCE)" t nil)
-
-(autoload 'magit-branch-rename "magit-branch" "\
-Rename branch OLD to NEW.
-With prefix, forces the rename even if NEW already exists.
-
-\(git branch -m|-M OLD NEW).
-
-\(fn OLD NEW &optional FORCE)" t nil)
-
-(autoload 'magit-branch-config-popup "magit-branch" "\
-Popup console for setting branch variables.
-
-\(fn BRANCH)" t nil)
-
-(autoload 'magit-edit-branch*description "magit-branch" "\
-Edit the description of the current branch.
-With a prefix argument edit the description of another branch.
-
-The description for the branch named NAME is stored in the Git
-variable `branch.<name>.description'.
-
-\(fn BRANCH)" t nil)
-
-(autoload 'magit-set-branch*merge/remote "magit-branch" "\
-Set or unset the upstream of the current branch.
-With a prefix argument do so for another branch.
-
-When the branch in question already has an upstream then simply
-unsets it.  Invoke this command again to set another upstream.
-
-Together the Git variables `branch.<name>.remote' and
-`branch.<name>.merge' define the upstream branch of the local
-branch named NAME.  The value of `branch.<name>.remote' is the
-name of the upstream remote.  The value of `branch.<name>.merge'
-is the full reference of the upstream branch, on the remote.
-
-Non-interactively, when UPSTREAM is non-nil, then always set it
-as the new upstream, regardless of whether another upstream was
-already set.  When nil, then always unset.
-
-\(fn BRANCH UPSTREAM)" t nil)
-
-(autoload 'magit-cycle-branch*rebase "magit-branch" "\
-Cycle the value of `branch.<name>.rebase' for the current branch.
-With a prefix argument cycle the value for another branch.
-
-The Git variables `branch.<name>.rebase' controls whether pulling
-into the branch named NAME is done by rebasing that branch onto
-the fetched branch or by merging that branch.
-
-When `true' then pulling is done by rebasing.
-When `false' then pulling is done by merging.
-
-When that variable is undefined then the value of `pull.rebase'
-is used instead.  It defaults to `false'.
-
-\(fn BRANCH)" t nil)
-
-(autoload 'magit-cycle-branch*pushRemote "magit-branch" "\
-Cycle the value of `branch.<name>.pushRemote' for the current branch.
-With a prefix argument cycle the value for another branch.
-
-The Git variable `branch.<name>.pushRemote' specifies the remote
-that the branch named NAME is usually pushed to.  The value has
-to be the name of an existing remote.
-
-If that variable is undefined, then the value of the Git variable
-`remote.pushDefault' is used instead, provided that it is defined,
-which by default it is not.
-
-\(fn BRANCH)" t nil)
-
-(autoload 'magit-cycle-pull\.rebase "magit-branch" "\
-Cycle the repository-local value of `pull.rebase'.
-
-The Git variable `pull.rebase' specifies whether pulling is done
-by rebasing or by merging.  It can be overwritten using the Git
-variable `branch.<name>.rebase'.
-
-When `true' then pulling is done by rebasing.
-When `false' (the default) then pulling is done by merging.
-
-\(fn)" t nil)
-
-(autoload 'magit-cycle-remote\.pushDefault "magit-branch" "\
-Cycle the repository-local value of `remote.pushDefault'.
-
-The Git variable `remote.pushDefault' specifies the remote that
-local branches are usually pushed to.  It can be overwritten
-using the Git variable `branch.<name>.pushRemote'.
-
-\(fn)" t nil)
-
-(autoload 'magit-cycle-branch*autoSetupMerge "magit-branch" "\
-Cycle the repository-local value of `branch.autoSetupMerge'.
-
-The Git variable `branch.autoSetupMerge' under what circumstances
-creating a branch (named NAME) should result in the variables
-`branch.<name>.merge' and `branch.<name>.remote' being set
-according to the starting point used to create the branch.  If
-the starting point isn't a branch, then these variables are never
-set.
-
-When `always' then the variables are set regardless of whether
-the starting point is a local or a remote branch.
-
-When `true' (the default) then the variable are set when the
-starting point is a remote branch, but not when it is a local
-branch.
-
-When `false' then the variables are never set.
-
-\(fn)" t nil)
-
-(autoload 'magit-cycle-branch*autoSetupRebase "magit-branch" "\
-Cycle the repository-local value of `branch.autoSetupRebase'.
-
-The Git variable `branch.autoSetupRebase' specifies whether
-creating a branch (named NAME) should result in the variable
-`branch.<name>.rebase' being set to `true'.
-
-When `always' then the variable is set regardless of whether the
-starting point is a local or a remote branch.
-
-When `local' then the variable are set when the starting point
-is a local branch, but not when it is a remote branch.
-
-When `remote' then the variable are set when the starting point
-is a remote branch, but not when it is a local branch.
-
-When `never' (the default) then the variable is never set.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-commit" "magit-commit.el" (22985 22856
-;;;;;;  887339 42000))
-;;; Generated autoloads from magit-commit.el
-
-(autoload 'magit-commit "magit-commit" "\
-Create a new commit on `HEAD'.
-With a prefix argument, amend to the commit at `HEAD' instead.
-
-\(git commit [--amend] ARGS)
-
-\(fn &optional ARGS)" t nil)
-
-(autoload 'magit-commit-amend "magit-commit" "\
-Amend the last commit.
-
-\(git commit --amend ARGS)
-
-\(fn &optional ARGS)" t nil)
-
-(autoload 'magit-commit-extend "magit-commit" "\
-Amend the last commit, without editing the message.
-
-With a prefix argument keep the committer date, otherwise change
-it.  The option `magit-commit-extend-override-date' can be used
-to inverse the meaning of the prefix argument.  
-\(git commit
---amend --no-edit)
-
-\(fn &optional ARGS OVERRIDE-DATE)" t nil)
-
-(autoload 'magit-commit-reword "magit-commit" "\
-Reword the last commit, ignoring staged changes.
-
-With a prefix argument keep the committer date, otherwise change
-it.  The option `magit-commit-reword-override-date' can be used
-to inverse the meaning of the prefix argument.
-
-Non-interactively respect the optional OVERRIDE-DATE argument
-and ignore the option.
-
-\(git commit --amend --only)
-
-\(fn &optional ARGS OVERRIDE-DATE)" t nil)
-
-(autoload 'magit-commit-fixup "magit-commit" "\
-Create a fixup commit.
-
-With a prefix argument the target COMMIT has to be confirmed.
-Otherwise the commit at point may be used without confirmation
-depending on the value of option `magit-commit-squash-confirm'.
-
-\(fn &optional COMMIT ARGS)" t nil)
-
-(autoload 'magit-commit-squash "magit-commit" "\
-Create a squash commit, without editing the squash message.
-
-With a prefix argument the target COMMIT has to be confirmed.
-Otherwise the commit at point may be used without confirmation
-depending on the value of option `magit-commit-squash-confirm'.
-
-\(fn &optional COMMIT ARGS)" t nil)
-
-(autoload 'magit-commit-augment "magit-commit" "\
-Create a squash commit, editing the squash message.
-
-With a prefix argument the target COMMIT has to be confirmed.
-Otherwise the commit at point may be used without confirmation
-depending on the value of option `magit-commit-squash-confirm'.
-
-\(fn &optional COMMIT ARGS)" t nil)
-
-(autoload 'magit-commit-instant-fixup "magit-commit" "\
-Create a fixup commit targeting COMMIT and instantly rebase.
-
-\(fn &optional COMMIT ARGS)" t nil)
-
-(autoload 'magit-commit-instant-squash "magit-commit" "\
-Create a squash commit targeting COMMIT and instantly rebase.
-
-\(fn &optional COMMIT ARGS)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-diff" "magit-diff.el" (22985 22856 911338
-;;;;;;  821000))
-;;; Generated autoloads from magit-diff.el
-
-(autoload 'magit-diff-popup "magit-diff" "\
-Popup console for diff commands.
-
-\(fn ARG)" t nil)
-
-(autoload 'magit-diff-buffer-file-popup "magit-diff" "\
-Popup console for diff commands.
-
-This is a variant of `magit-diff-popup' which shows the same popup
-but which limits the diff to the file being visited in the current
-buffer.
-
-\(fn)" t nil)
-
-(autoload 'magit-diff-dwim "magit-diff" "\
-Show changes for the thing at point.
-
-\(fn &optional ARGS FILES)" t nil)
-
-(autoload 'magit-diff "magit-diff" "\
-Show differences between two commits.
-
-REV-OR-RANGE should be a range or a single revision.  If it is a
-revision, then show changes in the working tree relative to that
-revision.  If it is a range, but one side is omitted, then show
-changes relative to `HEAD'.
-
-If the region is active, use the revisions on the first and last
-line of the region as the two sides of the range.  With a prefix
-argument, instead of diffing the revisions, choose a revision to
-view changes along, starting at the common ancestor of both
-revisions (i.e., use a \"...\" range).
-
-\(fn REV-OR-RANGE &optional ARGS FILES)" t nil)
-
-(autoload 'magit-diff-working-tree "magit-diff" "\
-Show changes between the current working tree and the `HEAD' commit.
-With a prefix argument show changes between the working tree and
-a commit read from the minibuffer.
-
-\(fn &optional REV ARGS FILES)" t nil)
-
-(autoload 'magit-diff-staged "magit-diff" "\
-Show changes between the index and the `HEAD' commit.
-With a prefix argument show changes between the index and
-a commit read from the minibuffer.
-
-\(fn &optional REV ARGS FILES)" t nil)
-
-(autoload 'magit-diff-unstaged "magit-diff" "\
-Show changes between the working tree and the index.
-
-\(fn &optional ARGS FILES)" t nil)
-
-(autoload 'magit-diff-while-committing "magit-diff" "\
-While committing, show the changes that are about to be committed.
-While amending, invoking the command again toggles between
-showing just the new changes or all the changes that will
-be committed.
-
-\(fn &optional ARGS FILES)" t nil)
-
-(autoload 'magit-diff-buffer-file "magit-diff" "\
-Show diff for the blob or file visited in the current buffer.
-
-\(fn)" t nil)
-
-(autoload 'magit-diff-paths "magit-diff" "\
-Show changes between any two files on disk.
-
-\(fn A B)" t nil)
-
-(autoload 'magit-show-commit "magit-diff" "\
-Visit the revision at point in another buffer.
-If there is no revision at point or with a prefix argument prompt
-for a revision.
-
-\(fn REV &optional ARGS FILES MODULE)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (22985 22856
-;;;;;;  907338 858000))
-;;; Generated autoloads from magit-ediff.el
- (autoload 'magit-ediff-popup "magit-ediff" nil t)
-
-(autoload 'magit-ediff-resolve "magit-ediff" "\
-Resolve outstanding conflicts in FILE using Ediff.
-FILE has to be relative to the top directory of the repository.
-
-In the rare event that you want to manually resolve all
-conflicts, including those already resolved by Git, use
-`ediff-merge-revisions-with-ancestor'.
-
-\(fn FILE)" t nil)
-
-(autoload 'magit-ediff-stage "magit-ediff" "\
-Stage and unstage changes to FILE using Ediff.
-FILE has to be relative to the top directory of the repository.
-
-\(fn FILE)" t nil)
-
-(autoload 'magit-ediff-compare "magit-ediff" "\
-Compare REVA:FILEA with REVB:FILEB using Ediff.
-
-FILEA and FILEB have to be relative to the top directory of the
-repository.  If REVA or REVB is nil, then this stands for the
-working tree state.
-
-If the region is active, use the revisions on the first and last
-line of the region.  With a prefix argument, instead of diffing
-the revisions, choose a revision to view changes along, starting
-at the common ancestor of both revisions (i.e., use a \"...\"
-range).
-
-\(fn REVA REVB FILEA FILEB)" t nil)
-
-(autoload 'magit-ediff-dwim "magit-ediff" "\
-Compare, stage, or resolve using Ediff.
-This command tries to guess what file, and what commit or range
-the user wants to compare, stage, or resolve using Ediff.  It
-might only be able to guess either the file, or range or commit,
-in which case the user is asked about the other.  It might not
-always guess right, in which case the appropriate `magit-ediff-*'
-command has to be used explicitly.  If it cannot read the user's
-mind at all, then it asks the user for a command to run.
-
-\(fn)" t nil)
-
-(autoload 'magit-ediff-show-staged "magit-ediff" "\
-Show staged changes using Ediff.
-
-This only allows looking at the changes; to stage, unstage,
-and discard changes using Ediff, use `magit-ediff-stage'.
-
-FILE must be relative to the top directory of the repository.
-
-\(fn FILE)" t nil)
-
-(autoload 'magit-ediff-show-unstaged "magit-ediff" "\
-Show unstaged changes using Ediff.
-
-This only allows looking at the changes; to stage, unstage,
-and discard changes using Ediff, use `magit-ediff-stage'.
-
-FILE must be relative to the top directory of the repository.
-
-\(fn FILE)" t nil)
-
-(autoload 'magit-ediff-show-working-tree "magit-ediff" "\
-Show changes between `HEAD' and working tree using Ediff.
-FILE must be relative to the top directory of the repository.
-
-\(fn FILE)" t nil)
-
-(autoload 'magit-ediff-show-commit "magit-ediff" "\
-Show changes introduced by COMMIT using Ediff.
-
-\(fn COMMIT)" t nil)
-
-(autoload 'magit-ediff-show-stash "magit-ediff" "\
-Show changes introduced by STASH using Ediff.
-`magit-ediff-show-stash-with-index' controls whether a
-three-buffer Ediff is used in order to distinguish changes in the
-stash that were staged.
-
-\(fn STASH)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-extras" "magit-extras.el" (22985 22856
-;;;;;;  888339 32000))
-;;; Generated autoloads from magit-extras.el
-
-(autoload 'magit-run-git-gui "magit-extras" "\
-Run `git gui' for the current git repository.
-
-\(fn)" t nil)
-
-(autoload 'magit-run-git-gui-blame "magit-extras" "\
-Run `git gui blame' on the given FILENAME and COMMIT.
-Interactively run it for the current file and the `HEAD', with a
-prefix or when the current file cannot be determined let the user
-choose.  When the current buffer is visiting FILENAME instruct
-blame to center around the line point is on.
-
-\(fn COMMIT FILENAME &optional LINENUM)" t nil)
-
-(autoload 'magit-run-gitk "magit-extras" "\
-Run `gitk' in the current repository.
-
-\(fn)" t nil)
-
-(autoload 'magit-run-gitk-branches "magit-extras" "\
-Run `gitk --branches' in the current repository.
-
-\(fn)" t nil)
-
-(autoload 'magit-run-gitk-all "magit-extras" "\
-Run `gitk --all' in the current repository.
-
-\(fn)" t nil)
-
-(autoload 'ido-enter-magit-status "magit-extras" "\
-Drop into `magit-status' from file switching.
-
-To make this command available use something like:
-
-  (add-hook \\='ido-setup-hook
-            (lambda ()
-              (define-key ido-completion-map
-                (kbd \"C-x g\") \\='ido-enter-magit-status)))
-
-Starting with Emacs 25.1 the Ido keymaps are defined just once
-instead of every time Ido is invoked, so now you can modify it
-like pretty much every other keymap:
-
-  (define-key ido-common-completion-map
-    (kbd \"C-x g\") 'ido-enter-magit-status)
-
-\(fn)" t nil)
-
-(autoload 'magit-dired-jump "magit-extras" "\
-Visit file at point using Dired.
-With a prefix argument, visit in another window.  If there
-is no file at point, then instead visit `default-directory'.
-
-\(fn &optional OTHER-WINDOW)" t nil)
-
-(autoload 'magit-do-async-shell-command "magit-extras" "\
-Open FILE with `dired-do-async-shell-command'.
-Interactively, open the file at point.
-
-\(fn FILE)" t nil)
-
-(autoload 'magit-clean "magit-extras" "\
-Remove untracked files from the working tree.
-With a prefix argument also remove ignored files,
-with two prefix arguments remove ignored files only.
-
-\(git clean -f -d [-x|-X])
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'magit-gitignore "magit-extras" "\
-Instruct Git to ignore FILE-OR-PATTERN.
-With a prefix argument only ignore locally.
-
-\(fn FILE-OR-PATTERN &optional LOCAL)" t nil)
-
-(autoload 'magit-gitignore-locally "magit-extras" "\
-Instruct Git to locally ignore FILE-OR-PATTERN.
-
-\(fn FILE-OR-PATTERN)" t nil)
-
-(autoload 'magit-add-change-log-entry "magit-extras" "\
-Find change log file and add date entry and item for current change.
-This differs from `add-change-log-entry' (which see) in that
-it acts on the current hunk in a Magit buffer instead of on
-a position in a file-visiting buffer.
-
-\(fn &optional WHOAMI FILE-NAME OTHER-WINDOW)" t nil)
-
-(autoload 'magit-add-change-log-entry-other-window "magit-extras" "\
-Find change log file in other window and add entry and item.
-This differs from `add-change-log-entry-other-window' (which see)
-in that it acts on the current hunk in a Magit buffer instead of
-on a position in a file-visiting buffer.
-
-\(fn &optional WHOAMI FILE-NAME)" t nil)
-
-(autoload 'magit-abort-dwim "magit-extras" "\
-Abort current operation.
-Depending on the context, this will abort a merge, a rebase, a
-patch application, a cherry-pick, a revert, or a bisect.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-files" "magit-files.el" (22985 22856
-;;;;;;  896338 959000))
-;;; Generated autoloads from magit-files.el
-
-(autoload 'magit-find-file "magit-files" "\
-View FILE from REV.
-Switch to a buffer visiting blob REV:FILE,
-creating one if none already exists.
-
-\(fn REV FILE)" t nil)
-
-(autoload 'magit-find-file-other-window "magit-files" "\
-View FILE from REV, in another window.
-Like `magit-find-file', but create a new window or reuse an
-existing one.
-
-\(fn REV FILE)" t nil)
- (autoload 'magit-file-popup "magit" nil t)
-
-(defvar global-magit-file-mode nil "\
-Non-nil if Global Magit-File mode is enabled.
-See the `global-magit-file-mode' command
-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-magit-file-mode'.")
-
-(custom-autoload 'global-magit-file-mode "magit-files" nil)
-
-(autoload 'global-magit-file-mode "magit-files" "\
-Toggle Magit-File mode in all buffers.
-With prefix ARG, enable Global Magit-File mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
-
-Magit-File mode is enabled in all buffers where
-`magit-file-mode-turn-on' would do it.
-See `magit-file-mode' for more information on Magit-File mode.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'magit-file-checkout "magit-files" "\
-Checkout FILE from REV.
-
-\(fn REV FILE)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-imenu" "magit-imenu.el" (22985 22856
-;;;;;;  906338 867000))
-;;; Generated autoloads from magit-imenu.el
-
-(autoload 'magit-imenu--log-prev-index-position-function "magit-imenu" "\
-Move point to previous line in current buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--log-extract-index-name-function "magit-imenu" "\
-Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--diff-prev-index-position-function "magit-imenu" "\
-Move point to previous file line in current buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--diff-extract-index-name-function "magit-imenu" "\
-Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--status-create-index-function "magit-imenu" "\
-Return an alist of all imenu entries in current buffer.
-This function is used as a value for
-`imenu-create-index-function'.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--refs-create-index-function "magit-imenu" "\
-Return an alist of all imenu entries in current buffer.
-This function is used as a value for
-`imenu-create-index-function'.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--cherry-create-index-function "magit-imenu" "\
-Return an alist of all imenu entries in current buffer.
-This function is used as a value for
-`imenu-create-index-function'.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--submodule-prev-index-position-function "magit-imenu" "\
-Move point to previous line in magit-submodule-list buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--submodule-extract-index-name-function "magit-imenu" "\
-Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--repolist-prev-index-position-function "magit-imenu" "\
-Move point to previous line in magit-repolist buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--repolist-extract-index-name-function "magit-imenu" "\
-Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--process-prev-index-position-function "magit-imenu" "\
-Move point to previous process in magit-process buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--process-extract-index-name-function "magit-imenu" "\
-Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--rebase-prev-index-position-function "magit-imenu" "\
-Move point to previous commit in git-rebase buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'.
-
-\(fn)" nil nil)
-
-(autoload 'magit-imenu--rebase-extract-index-name-function "magit-imenu" "\
-Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line.
-
-\(fn)" nil nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-log" "magit-log.el" (22985 22856 908338
-;;;;;;  849000))
-;;; Generated autoloads from magit-log.el
-
-(autoload 'magit-log-buffer-file-popup "magit-log" "\
-Popup console for log commands.
-
-This is a variant of `magit-log-popup' which shows the same popup
-but which limits the log to the file being visited in the current
-buffer.
-
-\(fn)" t nil)
-
-(autoload 'magit-log-current "magit-log" "\
-Show log for the current branch.
-When `HEAD' is detached or with a prefix argument show log for
-one or more revs read from the minibuffer.
-
-\(fn REVS &optional ARGS FILES)" t nil)
-
-(autoload 'magit-log "magit-log" "\
-Show log for one or more revs read from the minibuffer.
-The user can input any revision or revisions separated by a
-space, or even ranges, but only branches and tags, and a
-representation of the commit at point, are available as
-completion candidates.
-
-\(fn REVS &optional ARGS FILES)" t nil)
-
-(autoload 'magit-log-head "magit-log" "\
-Show log for `HEAD'.
-
-\(fn &optional ARGS FILES)" t nil)
-
-(autoload 'magit-log-branches "magit-log" "\
-Show log for all local branches and `HEAD'.
-
-\(fn &optional ARGS FILES)" t nil)
-
-(autoload 'magit-log-all-branches "magit-log" "\
-Show log for all local and remote branches and `HEAD'.
-
-\(fn &optional ARGS FILES)" t nil)
-
-(autoload 'magit-log-all "magit-log" "\
-Show log for all references and `HEAD'.
-
-\(fn &optional ARGS FILES)" t nil)
-
-(autoload 'magit-log-buffer-file "magit-log" "\
-Show log for the blob or file visited in the current buffer.
-With a prefix argument or when `--follow' is part of
-`magit-log-arguments', then follow renames.  When the region is
-active, restrict the log to the lines that the region touches.
-
-\(fn &optional FOLLOW BEG END)" t nil)
-
-(autoload 'magit-reflog-current "magit-log" "\
-Display the reflog of the current branch.
-
-\(fn)" t nil)
-
-(autoload 'magit-reflog "magit-log" "\
-Display the reflog of a branch.
-
-\(fn REF)" t nil)
-
-(autoload 'magit-reflog-head "magit-log" "\
-Display the `HEAD' reflog.
-
-\(fn)" t nil)
-
-(autoload 'magit-log-move-to-parent "magit-log" "\
-Move to the Nth parent of the current commit.
-
-\(fn &optional N)" t nil)
-
-(autoload 'magit-cherry "magit-log" "\
-Show commits in a branch that are not merged in the upstream branch.
-
-\(fn HEAD UPSTREAM)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-notes" "magit-notes.el" (22985 22856
-;;;;;;  922338 720000))
-;;; Generated autoloads from magit-notes.el
- (autoload 'magit-notes-popup "magit" nil t)
-
-;;;***
-
-;;;### (autoloads nil "magit-refs" "magit-refs.el" (22985 22856 889339
-;;;;;;  23000))
-;;; Generated autoloads from magit-refs.el
- (autoload 'magit-show-refs-popup "magit" nil t)
-
-(autoload 'magit-show-refs-head "magit-refs" "\
-List and compare references in a dedicated buffer.
-Refs are compared with `HEAD'.
-
-\(fn &optional ARGS)" t nil)
-
-(autoload 'magit-show-refs-current "magit-refs" "\
-List and compare references in a dedicated buffer.
-Refs are compared with the current branch or `HEAD' if
-it is detached.
-
-\(fn &optional ARGS)" t nil)
-
-(autoload 'magit-show-refs "magit-refs" "\
-List and compare references in a dedicated buffer.
-Refs are compared with a branch read from the user.
-
-\(fn &optional REF ARGS)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-remote" "magit-remote.el" (22985 22856
-;;;;;;  918338 756000))
-;;; Generated autoloads from magit-remote.el
-
-(autoload 'magit-clone "magit-remote" "\
-Clone the REPOSITORY to DIRECTORY.
-Then show the status buffer for the new repository.
-
-\(fn REPOSITORY DIRECTORY)" t nil)
- (autoload 'magit-remote-popup "magit-remote" nil t)
-
-(autoload 'magit-remote-add "magit-remote" "\
-Add a remote named REMOTE and fetch it.
-
-\(fn REMOTE URL &optional ARGS)" t nil)
-
-(autoload 'magit-remote-rename "magit-remote" "\
-Rename the remote named OLD to NEW.
-
-\(fn OLD NEW)" t nil)
-
-(autoload 'magit-remote-set-url "magit-remote" "\
-Change the url of the remote named REMOTE to URL.
-
-\(fn REMOTE URL)" t nil)
-
-(autoload 'magit-remote-remove "magit-remote" "\
-Delete the remote named REMOTE.
-
-\(fn REMOTE)" t nil)
-
-(autoload 'magit-remote-set-head "magit-remote" "\
-Set the local representation of REMOTE's default branch.
-Query REMOTE and set the symbolic-ref refs/remotes/<remote>/HEAD
-accordingly.  With a prefix argument query for the branch to be
-used, which allows you to select an incorrect value if you fancy
-doing that.
-
-\(fn REMOTE &optional BRANCH)" t nil)
-
-(autoload 'magit-remote-unset-head "magit-remote" "\
-Unset the local representation of REMOTE's default branch.
-Delete the symbolic-ref \"refs/remotes/<remote>/HEAD\".
-
-\(fn REMOTE)" t nil)
- (autoload 'magit-fetch-popup "magit-remote" nil t)
-
-(autoload 'magit-fetch-from-pushremote "magit-remote" "\
-Fetch from the push-remote of the current branch.
-
-\(fn ARGS)" t nil)
-
-(autoload 'magit-fetch-from-upstream "magit-remote" "\
-Fetch from the upstream repository of the current branch.
-
-\(fn ARGS)" t nil)
-
-(autoload 'magit-fetch "magit-remote" "\
-Fetch from another repository.
-
-\(fn REMOTE ARGS)" t nil)
-
-(autoload 'magit-fetch-branch "magit-remote" "\
-Fetch a BRANCH from a REMOTE.
-
-\(fn REMOTE BRANCH ARGS)" t nil)
-
-(autoload 'magit-fetch-refspec "magit-remote" "\
-Fetch a REFSPEC from a REMOTE.
-
-\(fn REMOTE REFSPEC ARGS)" t nil)
-
-(autoload 'magit-fetch-all "magit-remote" "\
-Fetch from all remotes.
-
-\(fn ARGS)" t nil)
-
-(autoload 'magit-fetch-all-prune "magit-remote" "\
-Fetch from all remotes, and prune.
-Prune remote tracking branches for branches that have been
-removed on the respective remote.
-
-\(fn)" t nil)
-
-(autoload 'magit-fetch-all-no-prune "magit-remote" "\
-Fetch from all remotes.
-
-\(fn)" t nil)
- (autoload 'magit-pull-popup "magit-remote" nil t)
- (autoload 'magit-pull-and-fetch-popup "magit-remote" nil t)
-
-(autoload 'magit-pull-from-pushremote "magit-remote" "\
-Pull from the push-remote of the current branch.
-
-\(fn ARGS)" t nil)
-
-(autoload 'magit-pull-from-upstream "magit-remote" "\
-Pull from the upstream of the current branch.
-
-\(fn ARGS)" t nil)
-
-(autoload 'magit-pull "magit-remote" "\
-Pull from a branch read in the minibuffer.
-
-\(fn SOURCE ARGS)" t nil)
- (autoload 'magit-push-popup "magit-remote" nil t)
-
-(autoload 'magit-push-current-to-pushremote "magit-remote" "\
-Push the current branch to `branch.<name>.pushRemote'.
-If that variable is unset, then push to `remote.pushDefault'.
-
-When `magit-push-current-set-remote-if-missing' is non-nil and
-the push-remote is not configured, then read the push-remote from
-the user, set it, and then push to it.  With a prefix argument
-the push-remote can be changed before pushed to it.
-
-\(fn ARGS &optional PUSH-REMOTE)" t nil)
-
-(autoload 'magit-push-current-to-upstream "magit-remote" "\
-Push the current branch to its upstream branch.
-
-When `magit-push-current-set-remote-if-missing' is non-nil and
-the upstream is not configured, then read the upstream from the
-user, set it, and then push to it.  With a prefix argument the
-upstream can be changed before pushed to it.
-
-\(fn ARGS &optional UPSTREAM)" t nil)
-
-(autoload 'magit-push-current "magit-remote" "\
-Push the current branch to a branch read in the minibuffer.
-
-\(fn TARGET ARGS)" t nil)
-
-(autoload 'magit-push "magit-remote" "\
-Push an arbitrary branch or commit somewhere.
-Both the source and the target are read in the minibuffer.
-
-\(fn SOURCE TARGET ARGS)" t nil)
-
-(autoload 'magit-push-refspecs "magit-remote" "\
-Push one or multiple REFSPECS to a REMOTE.
-Both the REMOTE and the REFSPECS are read in the minibuffer.  To
-use multiple REFSPECS, separate them with commas.  Completion is
-only available for the part before the colon, or when no colon
-is used.
-
-\(fn REMOTE REFSPECS ARGS)" t nil)
-
-(autoload 'magit-push-matching "magit-remote" "\
-Push all matching branches to another repository.
-If multiple remotes exist, then read one from the user.
-If just one exists, use that without requiring confirmation.
-
-\(fn REMOTE &optional ARGS)" t nil)
-
-(autoload 'magit-push-tags "magit-remote" "\
-Push all tags to another repository.
-If only one remote exists, then push to that.  Otherwise prompt
-for a remote, offering the remote configured for the current
-branch as default.
-
-\(fn REMOTE &optional ARGS)" t nil)
-
-(autoload 'magit-push-tag "magit-remote" "\
-Push a tag to another repository.
-
-\(fn TAG REMOTE &optional ARGS)" t nil)
-
-(autoload 'magit-push-implicitly "magit-remote" "\
-Push somewhere without using an explicit refspec.
-
-This command simply runs \"git push -v [ARGS]\".  ARGS are the
-arguments specified in the popup buffer.  No explicit refspec
-arguments are used.  Instead the behavior depends on at least
-these Git variables: `push.default', `remote.pushDefault',
-`branch.<branch>.pushRemote', `branch.<branch>.remote',
-`branch.<branch>.merge', and `remote.<remote>.push'.
-
-To add this command to the push popup add this to your init file:
-
-  (with-eval-after-load \\='magit-remote
-    (magit-define-popup-action \\='magit-push-popup ?P
-      \\='magit-push-implicitly--desc
-      \\='magit-push-implicitly ?p t))
-
-The function `magit-push-implicitly--desc' attempts to predict
-what this command will do.  The value it returns is displayed in
-the popup buffer.
-
-\(fn ARGS)" t nil)
-
-(autoload 'magit-push-to-remote "magit-remote" "\
-Push to REMOTE without using an explicit refspec.
-The REMOTE is read in the minibuffer.
-
-This command simply runs \"git push -v [ARGS] REMOTE\".  ARGS
-are the arguments specified in the popup buffer.  No refspec
-arguments are used.  Instead the behavior depends on at least
-these Git variables: `push.default', `remote.pushDefault',
-`branch.<branch>.pushRemote', `branch.<branch>.remote',
-`branch.<branch>.merge', and `remote.<remote>.push'.
-
-To add this command to the push popup add this to your init file:
-
-  (with-eval-after-load \\='magit-remote
-    (magit-define-popup-action \\='magit-push-popup ?r
-      \\='magit-push-to-remote--desc
-      \\='magit-push-to-remote ?p t))
-
-\(fn REMOTE ARGS)" t nil)
- (autoload 'magit-patch-popup "magit-remote" nil t)
-
-(autoload 'magit-format-patch "magit-remote" "\
-Create patches for the commits in RANGE.
-When a single commit is given for RANGE, create a patch for the
-changes introduced by that commit (unlike 'git format-patch'
-which creates patches for all commits that are reachable from
-`HEAD' but not from the specified commit).
-
-\(fn RANGE ARGS)" t nil)
-
-(autoload 'magit-request-pull "magit-remote" "\
-Request upstream to pull from you public repository.
-
-URL is the url of your publically accessible repository.
-START is a commit that already is in the upstream repository.
-END is the last commit, usually a branch name, which upstream
-is asked to pull.  START has to be reachable from that commit.
-
-\(fn URL START END)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-repos" "magit-repos.el" (22985 22856
-;;;;;;  910338 830000))
-;;; Generated autoloads from magit-repos.el
-
-(autoload 'magit-list-repositories "magit-repos" "\
-Display a list of repositories.
-
-Use the options `magit-repository-directories'
-and `magit-repository-directories-depth' to
-control which repositories are displayed.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (22985
-;;;;;;  22856 916338 775000))
-;;; Generated autoloads from magit-sequence.el
-
-(autoload 'magit-sequencer-continue "magit-sequence" "\
-Resume the current cherry-pick or revert sequence.
-
-\(fn)" t nil)
-
-(autoload 'magit-sequencer-skip "magit-sequence" "\
-Skip the stopped at commit during a cherry-pick or revert sequence.
-
-\(fn)" t nil)
-
-(autoload 'magit-sequencer-abort "magit-sequence" "\
-Abort the current cherry-pick or revert sequence.
-This discards all changes made since the sequence started.
-
-\(fn)" t nil)
- (autoload 'magit-cherry-pick-popup "magit-sequence" nil t)
-
-(autoload 'magit-cherry-pick "magit-sequence" "\
-Cherry-pick COMMIT.
-Prompt for a commit, defaulting to the commit at point.  If
-the region selects multiple commits, then pick all of them,
-without prompting.
-
-\(fn COMMIT &optional ARGS)" t nil)
-
-(autoload 'magit-cherry-apply "magit-sequence" "\
-Apply the changes in COMMIT but do not commit them.
-Prompt for a commit, defaulting to the commit at point.  If
-the region selects multiple commits, then apply all of them,
-without prompting.
-
-\(fn COMMIT &optional ARGS)" t nil)
- (autoload 'magit-revert-popup "magit-sequence" nil t)
-
-(autoload 'magit-revert "magit-sequence" "\
-Revert COMMIT by creating a new commit.
-Prompt for a commit, defaulting to the commit at point.  If
-the region selects multiple commits, then revert all of them,
-without prompting.
-
-\(fn COMMIT &optional ARGS)" t nil)
-
-(autoload 'magit-revert-no-commit "magit-sequence" "\
-Revert COMMIT by applying it in reverse to the worktree.
-Prompt for a commit, defaulting to the commit at point.  If
-the region selects multiple commits, then revert all of them,
-without prompting.
-
-\(fn COMMIT &optional ARGS)" t nil)
- (autoload 'magit-am-popup "magit-sequence" nil t)
-
-(autoload 'magit-am-apply-patches "magit-sequence" "\
-Apply the patches FILES.
-
-\(fn &optional FILES ARGS)" t nil)
-
-(autoload 'magit-am-apply-maildir "magit-sequence" "\
-Apply the patches from MAILDIR.
-
-\(fn &optional MAILDIR ARGS)" t nil)
-
-(autoload 'magit-am-continue "magit-sequence" "\
-Resume the current patch applying sequence.
-
-\(fn)" t nil)
-
-(autoload 'magit-am-skip "magit-sequence" "\
-Skip the stopped at patch during a patch applying sequence.
-
-\(fn)" t nil)
-
-(autoload 'magit-am-abort "magit-sequence" "\
-Abort the current patch applying sequence.
-This discards all changes made since the sequence started.
-
-\(fn)" t nil)
- (autoload 'magit-rebase-popup "magit-sequence" nil t)
-
-(autoload 'magit-rebase-onto-pushremote "magit-sequence" "\
-Rebase the current branch onto `branch.<name>.pushRemote'.
-If that variable is unset, then rebase onto `remote.pushDefault'.
-
-\(fn ARGS)" t nil)
-
-(autoload 'magit-rebase-onto-upstream "magit-sequence" "\
-Rebase the current branch onto its upstream branch.
-
-\(fn ARGS)" t nil)
-
-(autoload 'magit-rebase "magit-sequence" "\
-Rebase the current branch onto a branch read in the minibuffer.
-All commits that are reachable from `HEAD' but not from the
-selected branch TARGET are being rebased.
-
-\(fn TARGET ARGS)" t nil)
-
-(autoload 'magit-rebase-subset "magit-sequence" "\
-Rebase a subset of the current branch's history onto a new base.
-Rebase commits from START to `HEAD' onto NEWBASE.
-START has to be selected from a list of recent commits.
-
-\(fn NEWBASE START ARGS)" t nil)
-
-(autoload 'magit-rebase-interactive "magit-sequence" "\
-Start an interactive rebase sequence.
-
-\(fn COMMIT ARGS)" t nil)
-
-(autoload 'magit-rebase-autosquash "magit-sequence" "\
-Combine squash and fixup commits with their intended targets.
-
-\(fn ARGS)" t nil)
-
-(autoload 'magit-rebase-edit-commit "magit-sequence" "\
-Edit a single older commit using rebase.
-
-\(fn COMMIT ARGS)" t nil)
-
-(autoload 'magit-rebase-reword-commit "magit-sequence" "\
-Reword a single older commit using rebase.
-
-\(fn COMMIT ARGS)" t nil)
-
-(autoload 'magit-rebase-continue "magit-sequence" "\
-Restart the current rebasing operation.
-In some cases this pops up a commit message buffer for you do
-edit.  With a prefix argument the old message is reused as-is.
-
-\(fn &optional NOEDIT)" t nil)
-
-(autoload 'magit-rebase-skip "magit-sequence" "\
-Skip the current commit and restart the current rebase operation.
-
-\(fn)" t nil)
-
-(autoload 'magit-rebase-edit "magit-sequence" "\
-Edit the todo list of the current rebase operation.
-
-\(fn)" t nil)
-
-(autoload 'magit-rebase-abort "magit-sequence" "\
-Abort the current rebase operation, restoring the original branch.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-stash" "magit-stash.el" (22985 22856
-;;;;;;  904338 885000))
-;;; Generated autoloads from magit-stash.el
- (autoload 'magit-stash-popup "magit-stash" nil t)
-
-(autoload 'magit-stash "magit-stash" "\
-Create a stash of the index and working tree.
-Untracked files are included according to popup arguments.
-One prefix argument is equivalent to `--include-untracked'
-while two prefix arguments are equivalent to `--all'.
-
-\(fn MESSAGE &optional INCLUDE-UNTRACKED)" t nil)
-
-(autoload 'magit-stash-index "magit-stash" "\
-Create a stash of the index only.
-Unstaged and untracked changes are not stashed.  The stashed
-changes are applied in reverse to both the index and the
-worktree.  This command can fail when the worktree is not clean.
-Applying the resulting stash has the inverse effect.
-
-\(fn MESSAGE)" t nil)
-
-(autoload 'magit-stash-worktree "magit-stash" "\
-Create a stash of unstaged changes in the working tree.
-Untracked files are included according to popup arguments.
-One prefix argument is equivalent to `--include-untracked'
-while two prefix arguments are equivalent to `--all'.
-
-\(fn MESSAGE &optional INCLUDE-UNTRACKED)" t nil)
-
-(autoload 'magit-stash-keep-index "magit-stash" "\
-Create a stash of the index and working tree, keeping index intact.
-Untracked files are included according to popup arguments.
-One prefix argument is equivalent to `--include-untracked'
-while two prefix arguments are equivalent to `--all'.
-
-\(fn MESSAGE &optional INCLUDE-UNTRACKED)" t nil)
-
-(autoload 'magit-snapshot "magit-stash" "\
-Create a snapshot of the index and working tree.
-Untracked files are included according to popup arguments.
-One prefix argument is equivalent to `--include-untracked'
-while two prefix arguments are equivalent to `--all'.
-
-\(fn &optional INCLUDE-UNTRACKED)" t nil)
-
-(autoload 'magit-snapshot-index "magit-stash" "\
-Create a snapshot of the index only.
-Unstaged and untracked changes are not stashed.
-
-\(fn)" t nil)
-
-(autoload 'magit-snapshot-worktree "magit-stash" "\
-Create a snapshot of unstaged changes in the working tree.
-Untracked files are included according to popup arguments.
-One prefix argument is equivalent to `--include-untracked'
-while two prefix arguments are equivalent to `--all'.
-
-\(fn &optional INCLUDE-UNTRACKED)" t nil)
-
-(autoload 'magit-stash-apply "magit-stash" "\
-Apply a stash to the working tree.
-Try to preserve the stash index.  If that fails because there
-are staged changes, apply without preserving the stash index.
-
-\(fn STASH)" t nil)
-
-(autoload 'magit-stash-drop "magit-stash" "\
-Remove a stash from the stash list.
-When the region is active offer to drop all contained stashes.
-
-\(fn STASH)" t nil)
-
-(autoload 'magit-stash-clear "magit-stash" "\
-Remove all stashes saved in REF's reflog by deleting REF.
-
-\(fn REF)" t nil)
-
-(autoload 'magit-stash-branch "magit-stash" "\
-Create and checkout a new BRANCH from STASH.
-
-\(fn STASH BRANCH)" t nil)
-
-(autoload 'magit-stash-format-patch "magit-stash" "\
-Create a patch from STASH
-
-\(fn STASH)" t nil)
-
-(autoload 'magit-stash-list "magit-stash" "\
-List all stashes in a buffer.
-
-\(fn)" t nil)
-
-(autoload 'magit-stash-show "magit-stash" "\
-Show all diffs of a stash in a buffer.
-
-\(fn STASH &optional ARGS FILES)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-status" "magit-status.el" (22985 22856
-;;;;;;  909338 839000))
-;;; Generated autoloads from magit-status.el
-
-(autoload 'magit-init "magit-status" "\
-Initialize a Git repository, then show its status.
-
-If the directory is below an existing repository, then the user
-has to confirm that a new one should be created inside.  If the
-directory is the root of the existing repository, then the user
-has to confirm that it should be reinitialized.
-
-Non-interactively DIRECTORY is (re-)initialized unconditionally.
-
-\(fn DIRECTORY)" t nil)
-
-(autoload 'magit-status "magit-status" "\
-Show the status of the current Git repository in a buffer.
-With a prefix argument prompt for a repository to be shown.
-With two prefix arguments prompt for an arbitrary directory.
-If that directory isn't the root of an existing repository,
-then offer to initialize it as a new repository.
-
-\(fn &optional DIRECTORY CACHE)" t nil)
-
-(autoload 'magit-status-internal "magit-status" "\
-
-
-\(fn DIRECTORY)" nil nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (22985
-;;;;;;  22856 923338 711000))
-;;; Generated autoloads from magit-submodule.el
- (autoload 'magit-submodule-popup "magit-submodule" nil t)
-
-(autoload 'magit-submodule-add "magit-submodule" "\
-Add the repository at URL as a submodule.
-
-Optional PATH is the path to the submodule relative to the root
-of the superproject.  If it is nil, then the path is determined
-based on the URL.
-
-Optional NAME is the name of the submodule.  If it is nil, then
-PATH also becomes the name.
-
-\(fn URL &optional PATH NAME)" t nil)
-
-(autoload 'magit-submodule-read-name-for-path "magit-submodule" "\
-
-
-\(fn PATH)" nil nil)
-
-(autoload 'magit-submodule-setup "magit-submodule" "\
-Clone and register missing submodules and checkout appropriate commits.
-
-\(fn)" t nil)
-
-(autoload 'magit-submodule-init "magit-submodule" "\
-Register submodules listed in \".gitmodules\" into \".git/config\".
-
-\(fn)" t nil)
-
-(autoload 'magit-submodule-update "magit-submodule" "\
-Clone missing submodules and checkout appropriate commits.
-With a prefix argument also register submodules in \".git/config\".
-
-\(fn &optional INIT)" t nil)
-
-(autoload 'magit-submodule-sync "magit-submodule" "\
-Update each submodule's remote URL according to \".gitmodules\".
-
-\(fn)" t nil)
-
-(autoload 'magit-submodule-fetch "magit-submodule" "\
-Fetch all submodules.
-With a prefix argument fetch all remotes.
-
-\(fn &optional ALL)" t nil)
-
-(autoload 'magit-submodule-deinit "magit-submodule" "\
-Unregister the submodule at PATH.
-
-\(fn PATH)" t nil)
-
-(autoload 'magit-insert-modules "magit-submodule" "\
-Insert submodule sections.
-Hook `magit-module-sections-hook' controls which module sections
-are inserted, and option `magit-insert-modules-nested' controls
-whether they are wrapped in an additional section.
-
-\(fn)" nil nil)
-
-(autoload 'magit-insert-modules-overview "magit-submodule" "\
-Insert sections for all modules.
-For each section insert the path and the output of `git describe --tags'.
-
-\(fn)" nil nil)
-
-(autoload 'magit-insert-modules-unpulled-from-upstream "magit-submodule" "\
-Insert sections for modules that haven't been pulled from the upstream.
-These sections can be expanded to show the respective commits.
-
-\(fn)" nil nil)
-
-(autoload 'magit-insert-modules-unpulled-from-pushremote "magit-submodule" "\
-Insert sections for modules that haven't been pulled from the push-remote.
-These sections can be expanded to show the respective commits.
-
-\(fn)" nil nil)
-
-(autoload 'magit-insert-modules-unpushed-to-upstream "magit-submodule" "\
-Insert sections for modules that haven't been pushed to the upstream.
-These sections can be expanded to show the respective commits.
-
-\(fn)" nil nil)
-
-(autoload 'magit-insert-modules-unpushed-to-pushremote "magit-submodule" "\
-Insert sections for modules that haven't been pushed to the push-remote.
-These sections can be expanded to show the respective commits.
-
-\(fn)" nil nil)
-
-(autoload 'magit-list-submodules "magit-submodule" "\
-Display a list of the current repository's submodules.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-subtree" "magit-subtree.el" (22985 22856
-;;;;;;  898338 941000))
-;;; Generated autoloads from magit-subtree.el
- (autoload 'magit-subtree-popup "magit-subtree" nil t)
-
-(autoload 'magit-subtree-add "magit-subtree" "\
-Add REF from REPOSITORY as a new subtree at PREFIX.
-
-\(fn PREFIX REPOSITORY REF ARGS)" t nil)
-
-(autoload 'magit-subtree-add-commit "magit-subtree" "\
-Add COMMIT as a new subtree at PREFIX.
-
-\(fn PREFIX COMMIT ARGS)" t nil)
-
-(autoload 'magit-subtree-merge "magit-subtree" "\
-Merge COMMIT into the PREFIX subtree.
-
-\(fn PREFIX COMMIT ARGS)" t nil)
-
-(autoload 'magit-subtree-pull "magit-subtree" "\
-Pull REF from REPOSITORY into the PREFIX subtree.
-
-\(fn PREFIX REPOSITORY REF ARGS)" t nil)
-
-(autoload 'magit-subtree-push "magit-subtree" "\
-Extract the history of the subtree PREFIX and push it to REF on REPOSITORY.
-
-\(fn PREFIX REPOSITORY REF ARGS)" t nil)
-
-(autoload 'magit-subtree-split "magit-subtree" "\
-Extract the history of the subtree PREFIX.
-
-\(fn PREFIX COMMIT ARGS)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-utils" "magit-utils.el" (22985 22856
-;;;;;;  884339 69000))
-;;; Generated autoloads from magit-utils.el
-
-(autoload 'magit-emacs-Q-command "magit-utils" "\
-Show a shell command that runs an uncustomized Emacs with only Magit loaded.
-See info node `(magit)Debugging Tools' for more information.
-
-\(fn)" t nil)
-
-(autoload 'Info-follow-nearest-node--magit-gitman "magit-utils" "\
-
-
-\(fn FN &optional FORK)" nil nil)
-
-(advice-add 'Info-follow-nearest-node :around 'Info-follow-nearest-node--magit-gitman)
-
-(autoload 'org-man-export--magit-gitman "magit-utils" "\
-
-
-\(fn FN LINK DESCRIPTION FORMAT)" nil nil)
-
-(advice-add 'org-man-export :around 'org-man-export--magit-gitman)
-
-;;;***
-
-;;;### (autoloads nil "magit-wip" "magit-wip.el" (22985 22856 891339
-;;;;;;  5000))
-;;; Generated autoloads from magit-wip.el
-
-(defvar magit-wip-after-save-mode nil "\
-Non-nil if Magit-Wip-After-Save mode is enabled.
-See the `magit-wip-after-save-mode' command
-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 `magit-wip-after-save-mode'.")
-
-(custom-autoload 'magit-wip-after-save-mode "magit-wip" nil)
-
-(autoload 'magit-wip-after-save-mode "magit-wip" "\
-Toggle Magit-Wip-After-Save-Local mode in all buffers.
-With prefix ARG, enable Magit-Wip-After-Save mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
-
-Magit-Wip-After-Save-Local mode is enabled in all buffers where
-`magit-wip-after-save-local-mode-turn-on' would do it.
-See `magit-wip-after-save-local-mode' for more information on Magit-Wip-After-Save-Local mode.
-
-\(fn &optional ARG)" t nil)
-
-(defvar magit-wip-after-apply-mode nil "\
-Non-nil if Magit-Wip-After-Apply mode is enabled.
-See the `magit-wip-after-apply-mode' command
-for a description of this minor mode.")
-
-(custom-autoload 'magit-wip-after-apply-mode "magit-wip" nil)
-
-(autoload 'magit-wip-after-apply-mode "magit-wip" "\
-Commit to work-in-progress refs.
-
-After applying a change using any \"apply variant\"
-command (apply, stage, unstage, discard, and reverse) commit the
-affected files to the current wip refs.  For each branch there
-may be two wip refs; one contains snapshots of the files as found
-in the worktree and the other contains snapshots of the entries
-in the index.
-
-\(fn &optional ARG)" t nil)
-
-(defvar magit-wip-before-change-mode nil "\
-Non-nil if Magit-Wip-Before-Change mode is enabled.
-See the `magit-wip-before-change-mode' command
-for a description of this minor mode.")
-
-(custom-autoload 'magit-wip-before-change-mode "magit-wip" nil)
-
-(autoload 'magit-wip-before-change-mode "magit-wip" "\
-Commit to work-in-progress refs before certain destructive changes.
-
-Before invoking a revert command or an \"apply variant\"
-command (apply, stage, unstage, discard, and reverse) commit the
-affected tracked files to the current wip refs.  For each branch
-there may be two wip refs; one contains snapshots of the files
-as found in the worktree and the other contains snapshots of the
-entries in the index.
-
-Only changes to files which could potentially be affected by the
-command which is about to be called are committed.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "magit-worktree" "magit-worktree.el" (22985
-;;;;;;  22856 920338 738000))
-;;; Generated autoloads from magit-worktree.el
-
-(autoload 'magit-worktree-checkout "magit-worktree" "\
-Checkout BRANCH in a new worktree at PATH.
-
-\(fn PATH BRANCH)" t nil)
-
-(autoload 'magit-worktree-branch "magit-worktree" "\
-Create a new BRANCH and check it out in a new worktree at PATH.
-
-\(fn PATH BRANCH START-POINT &optional FORCE)" t nil)
-
-;;;***
-
-;;;### (autoloads nil nil ("magit-core.el" "magit-git.el" "magit-margin.el"
-;;;;;;  "magit-mode.el" "magit-obsolete.el" "magit-pkg.el" "magit-process.el"
-;;;;;;  "magit-section.el") (22985 22856 919338 748000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; magit-autoloads.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-autorevert.el
@@ -1,261 +0,0 @@
-;;; magit-autorevert.el --- revert buffers when files in repository change  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'dash)
-
-(require 'magit-git)
-
-(require 'autorevert)
-
-;;; Options
-
-(defgroup magit-auto-revert nil
-  "Revert buffers when files in repository change."
-  :link '(custom-group-link auto-revert)
-  :link '(info-link "(magit)Automatic Reverting of File-Visiting Buffers")
-  :group 'auto-revert
-  :group 'magit-essentials
-  :group 'magit-modes)
-
-(defcustom auto-revert-buffer-list-filter nil
-  "Filter that determines which buffers `auto-revert-buffers' reverts.
-
-This option is provided by `magit', which also redefines
-`auto-revert-buffers' to respect it.  Magit users who do not turn
-on the local mode `auto-revert-mode' themselves, are best served
-by setting the value to `magit-auto-revert-repository-buffers-p'.
-
-However the default is nil, to not disturb users who do use the
-local mode directly.  If you experience delays when running Magit
-commands, then you should consider using one of the predicates
-provided by Magit - especially if you also use Tramp.
-
-Users who do turn on `auto-revert-mode' in buffers in which Magit
-doesn't do that for them, should likely not use any filter.
-Users who turn on `global-auto-revert-mode', do not have to worry
-about this option, because it is disregarded if the global mode
-is enabled."
-  :package-version '(magit . "2.4.2")
-  :group 'auto-revert
-  :group 'magit-auto-revert
-  :group 'magit-related
-  :type '(radio (const :tag "no filter" nil)
-                (function-item magit-auto-revert-buffer-p)
-                (function-item magit-auto-revert-repository-buffer-p)
-                function))
-
-(defcustom magit-auto-revert-tracked-only t
-  "Whether `magit-auto-revert-mode' only reverts tracked files."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-auto-revert
-  :type 'boolean
-  :set (lambda (var val)
-         (set var val)
-         (when (and (bound-and-true-p magit-auto-revert-mode)
-                    (featurep 'magit-autorevert))
-           (magit-auto-revert-mode -1)
-           (magit-auto-revert-mode))))
-
-(defcustom magit-auto-revert-immediately t
-  "Whether Magit reverts buffers immediately.
-
-If this is non-nil and either `global-auto-revert-mode' or
-`magit-auto-revert-mode' is enabled, then Magit immediately
-reverts buffers by explicitly calling `auto-revert-buffers'
-after running git for side-effects.
-
-If `auto-revert-use-notify' is non-nil (and file notifications
-are actually supported), then `magit-auto-revert-immediately'
-does not have to be non-nil, because the reverts happen
-immediately anyway.
-
-If `magit-auto-revert-immediately' and `auto-revert-use-notify'
-are both nil, then reverts happen after `auto-revert-interval'
-seconds of user inactivity.  That is not desirable."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-auto-revert
-  :type 'boolean)
-
-;;; Mode
-
-(defun magit-turn-on-auto-revert-mode-if-desired (&optional file)
-  (if file
-      (--when-let (find-buffer-visiting file)
-        (with-current-buffer it
-          (magit-turn-on-auto-revert-mode-if-desired)))
-    (when (and buffer-file-name
-               (file-readable-p buffer-file-name)
-               (magit-toplevel)
-               (or (not magit-auto-revert-tracked-only)
-                   (magit-file-tracked-p buffer-file-name)))
-      (auto-revert-mode))))
-
-;;;###autoload
-(defvar magit-revert-buffers t) ; obsolete
-
-;;;###autoload
-(define-globalized-minor-mode magit-auto-revert-mode auto-revert-mode
-  magit-turn-on-auto-revert-mode-if-desired
-  :package-version '(magit . "2.4.0")
-  :link '(info-link "(magit)Automatic Reverting of File-Visiting Buffers")
-  :group 'magit-auto-revert
-  :group 'magit-essentials
-  ;; When `global-auto-revert-mode' is enabled, then this mode is
-  ;; redundant.  When `magit-revert-buffers' is nil, then the user has
-  ;; opted out of the automatic reverts while the old implementation
-  ;; was still in use.  In all other cases enable the mode because if
-  ;; buffers are not automatically reverted that would make many very
-  ;; common tasks much more cumbersome.
-  :init-value (and (with-no-warnings magit-revert-buffers)
-                   (not global-auto-revert-mode)
-                   (not noninteractive)))
-;; - Unfortunately `:init-value t' only sets the value of the mode
-;;   variable but does not cause the mode function to be called.
-;; - I don't think it works like this on purpose, but since one usually
-;;   should not enable global modes by default, it is understandable.
-;; - If the user has set the variable `magit-auto-revert-mode' to nil
-;;   after loading magit (instead of doing so before loading magit or
-;;   by using the function), then we should still respect that setting.
-;; - If the user has set the obsolete variable `magit-revert-buffers'
-;;   to nil before or after loading magit, then we should still respect
-;;   that setting.
-;; - If the user sets one of these variables after loading magit and
-;;   after `after-init-hook' has run, then that won't have an effect
-;;   and there is nothing we can do about it.
-(defun magit-auto-revert-mode--init-kludge ()
-  "This is an internal kludge to be used on `after-init-hook'.
-Do not use this function elsewhere, and don't remove it from
-the `after-init-hook'.  For more information see the comments
-and code surrounding the definition of this function."
-  ;; `magit-revert-buffers' may have been set to nil before the alias
-  ;; had been established, so consult the value of both variables.
-  (if (and magit-auto-revert-mode (with-no-warnings magit-revert-buffers))
-      (let ((start (current-time)))
-        (magit-message "Turning on magit-auto-revert-mode...")
-        (magit-auto-revert-mode 1)
-        (magit-message
-         "Turning on magit-auto-revert-mode...done%s"
-         (let ((elapsed (float-time (time-subtract (current-time) start))))
-           (if (> elapsed 0.2)
-               (format " (%.3fs, %s buffers checked)" elapsed
-                       (length (buffer-list)))
-             ""))))
-    (magit-auto-revert-mode -1)))
-(if after-init-time
-    ;; Since `after-init-hook' has already been
-    ;; run, turn the mode on or off right now.
-    (magit-auto-revert-mode--init-kludge)
-  ;; By the time the init file has been fully loaded the
-  ;; values of the relevant variables might have changed.
-  (add-hook 'after-init-hook #'magit-auto-revert-mode--init-kludge t))
-
-(put 'magit-auto-revert-mode 'function-documentation
-     "Toggle Magit Auto Revert mode.
-With a prefix argument ARG, enable Magit Auto Revert mode if ARG
-is positive, and disable it otherwise.  If called from Lisp,
-enable the mode if ARG is omitted or nil.
-
-Magit Auto Revert mode is a global minor mode that reverts
-buffers associated with a file that is located inside a Git
-repository when the file changes on disk.  Use `auto-revert-mode'
-to revert a particular buffer.  Or use `global-auto-revert-mode'
-to revert all file-visiting buffers, not just those that visit
-a file located inside a Git repository.
-
-This global mode works by turning on the buffer-local mode
-`auto-revert-mode' at the time a buffer is first created.  The
-local mode is turned on if the visited file is being tracked in
-a Git repository at the time when the buffer is created.
-
-If `magit-auto-revert-tracked-only' is non-nil (the default),
-then only tracked files are reverted.  But if you stage a
-previously untracked file using `magit-stage', then this mode
-notices that.
-
-Unlike `global-auto-revert-mode', this mode never reverts any
-buffers that are not visiting files.
-
-The behavior of this mode can be customized using the options
-in the `autorevert' and `magit-autorevert' groups.
-
-This function calls the hook `magit-auto-revert-mode-hook'.")
-
-(defun magit-auto-revert-buffers ()
-  (when (and magit-auto-revert-immediately
-             (or global-auto-revert-mode
-                 (and magit-auto-revert-mode auto-revert-buffer-list)))
-    (let ((auto-revert-buffer-list-filter
-           (or auto-revert-buffer-list-filter
-               'magit-auto-revert-repository-buffer-p)))
-      (auto-revert-buffers))))
-
-(defvar magit-auto-revert-toplevel nil)
-
-(when (< emacs-major-version 25)
-  (defvar auto-revert-buffers-counter 1
-    "Incremented each time `auto-revert-buffers' is called"))
-
-(defun magit-auto-revert-buffer-p (buffer)
-  "Return t if BUFFER visits a file inside the current repository.
-The current repository is the one in which `default-directory' is
-located.  If there is no current repository, then return t for
-any BUFFER."
-  (magit-auto-revert-repository-buffer-p buffer t))
-
-(defun magit-auto-revert-repository-buffer-p (buffer &optional fallback)
-  "Return t if BUFFER visits a file inside the current repository.
-The current repository is the one in which `default-directory' is
-located.  If there is no current repository, then return FALLBACK
-\(which defaults to nil) for any BUFFER."
-  ;; Call `magit-toplevel' just once per cycle.
-  (unless (and magit-auto-revert-toplevel
-               (= (cdr magit-auto-revert-toplevel)
-                  auto-revert-buffers-counter))
-    (setq magit-auto-revert-toplevel
-          (cons (or (magit-toplevel) 'no-repo)
-                auto-revert-buffers-counter)))
-  (let ((top (car magit-auto-revert-toplevel)))
-    (if (eq top 'no-repo)
-        fallback
-      (let ((dir (with-current-buffer buffer default-directory)))
-        (and (equal (file-remote-p dir)
-                    (file-remote-p top))
-             ;; ^ `tramp-handle-file-in-directory-p' lacks this optimization.
-             (file-in-directory-p dir top))))))
-
-(defun auto-revert-buffers--buffer-list-filter ()
-  (when (< emacs-major-version 25)
-    (cl-incf auto-revert-buffers-counter))
-  (when auto-revert-buffer-list-filter
-    (setq auto-revert-buffer-list
-          (--filter auto-revert-buffer-list-filter
-                    auto-revert-buffer-list))))
-
-(advice-add 'auto-revert-buffers :before
-            'auto-revert-buffers--buffer-list-filter)
-
-(provide 'magit-autorevert)
-;;; magit-autorevert.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-autorevert.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-bisect.el
@@ -1,210 +0,0 @@
-;;; magit-bisect.el --- bisect support for Magit  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2011-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; Use a binary search to find the commit that introduced a bug.
-
-;;; Code:
-
-(require 'magit)
-
-;;; Options
-
-(defcustom magit-bisect-show-graph t
-  "Whether to use `--graph' in the log showing commits yet to be bisected."
-  :package-version '(magit . "2.8.0")
-  :group 'magit-status
-  :type 'boolean)
-
-(defface magit-bisect-good
-  '((t :foreground "DarkOliveGreen"))
-  "Face for good bisect revisions."
-  :group 'magit-faces)
-
-(defface magit-bisect-skip
-  '((t :foreground "DarkGoldenrod"))
-  "Face for skipped bisect revisions."
-  :group 'magit-faces)
-
-(defface magit-bisect-bad
-  '((t :foreground "IndianRed4"))
-  "Face for bad bisect revisions."
-  :group 'magit-faces)
-
-;;; Commands
-
-;;;###autoload (autoload 'magit-bisect-popup "magit-bisect" nil t)
-(magit-define-popup magit-bisect-popup
-  "Popup console for bisect commands."
-  :man-page "git-bisect"
-  :actions            '((?B "Start"        magit-bisect-start)
-                        (?s "Start script" magit-bisect-run))
-  :sequence-actions   '((?b "Bad"          magit-bisect-bad)
-                        (?g "Good"         magit-bisect-good)
-                        (?k "Skip"         magit-bisect-skip)
-                        (?r "Reset"        magit-bisect-reset)
-                        (?s "Run script"   magit-bisect-run))
-  :sequence-predicate 'magit-bisect-in-progress-p)
-
-;;;###autoload
-(defun magit-bisect-start (bad good)
-  "Start a bisect session.
-
-Bisecting a bug means to find the commit that introduced it.
-This command starts such a bisect session by asking for a know
-good and a bad commit.  To move the session forward use the
-other actions from the bisect popup (\
-\\<magit-status-mode-map>\\[magit-bisect-popup])."
-  (interactive (if (magit-bisect-in-progress-p)
-                   (user-error "Already bisecting")
-                 (magit-bisect-start-read-args)))
-  (magit-git-bisect "start" (list bad good) t))
-
-(defun magit-bisect-start-read-args ()
-  (let  ((b (magit-read-branch-or-commit "Start bisect with bad revision")))
-    (list b (magit-read-other-branch-or-commit "Good revision" b))))
-
-;;;###autoload
-(defun magit-bisect-reset ()
-  "After bisecting, cleanup bisection state and return to original `HEAD'."
-  (interactive)
-  (when (magit-confirm 'reset-bisect)
-    (magit-run-git "bisect" "reset")
-    (ignore-errors (delete-file (magit-git-dir "BISECT_CMD_OUTPUT")))))
-
-;;;###autoload
-(defun magit-bisect-good ()
-  "While bisecting, mark the current commit as good.
-Use this after you have asserted that the commit does not contain
-the bug in question."
-  (interactive)
-  (magit-git-bisect "good"))
-
-;;;###autoload
-(defun magit-bisect-bad ()
-  "While bisecting, mark the current commit as bad.
-Use this after you have asserted that the commit does contain the
-bug in question."
-  (interactive)
-  (magit-git-bisect "bad"))
-
-;;;###autoload
-(defun magit-bisect-skip ()
-  "While bisecting, skip the current commit.
-Use this if for some reason the current commit is not a good one
-to test.  This command lets Git choose a different one."
-  (interactive)
-  (magit-git-bisect "skip"))
-
-;;;###autoload
-(defun magit-bisect-run (cmdline &optional bad good)
-  "Bisect automatically by running commands after each step.
-
-Unlike `git bisect run' this can be used before bisecting has
-begun.  In that case it behaves like `git bisect start; git
-bisect run'."
-  (interactive (let ((args (and (not (magit-bisect-in-progress-p))
-                                (magit-bisect-start-read-args))))
-                 (cons (read-shell-command "Bisect shell command: ") args)))
-  (when (and bad good)
-    (magit-bisect-start bad good))
-  (magit-git-bisect "run" (list shell-file-name shell-command-switch cmdline)))
-
-(defun magit-git-bisect (subcommand &optional args no-assert)
-  (unless (or no-assert (magit-bisect-in-progress-p))
-    (user-error "Not bisecting"))
-  (magit-with-toplevel
-    (magit-run-git-with-logfile
-     (magit-git-dir "BISECT_CMD_OUTPUT") "bisect" subcommand args)))
-
-;;; Sections
-
-(defun magit-bisect-in-progress-p ()
-  (file-exists-p (magit-git-dir "BISECT_LOG")))
-
-(defun magit-insert-bisect-output ()
-  "While bisecting, insert section with output from `git bisect'."
-  (when (magit-bisect-in-progress-p)
-    (let* ((lines
-            (or (magit-file-lines (magit-git-dir "BISECT_CMD_OUTPUT"))
-                (list "Bisecting: (no saved bisect output)"
-                      "It appears you have invoked `git bisect' from a shell."
-                      "There is nothing wrong with that, we just cannot display"
-                      "anything useful here.  Consult the shell output instead.")))
-           (done-re "^\\([a-z0-9]\\{40\\}\\) is the first bad commit$")
-           (bad-line (or (and (string-match done-re (car lines))
-                              (pop lines))
-                         (--first (string-match done-re it) lines))))
-      (magit-insert-section ((eval (if bad-line 'commit 'bisect-output))
-                             (and bad-line (match-string 1 bad-line)))
-        (magit-insert-heading
-          (propertize (or bad-line (pop lines))
-                      'face 'magit-section-heading))
-        (dolist (line lines)
-          (insert line "\n"))))
-    (insert "\n")))
-
-(defun magit-insert-bisect-rest ()
-  "While bisecting, insert section visualizing the bisect state."
-  (when (magit-bisect-in-progress-p)
-    (magit-insert-section (bisect-view)
-      (magit-insert-heading "Bisect Rest:")
-      (magit-git-wash (apply-partially 'magit-log-wash-log 'bisect-vis)
-        "bisect" "visualize" "git" "log"
-        "--format=%h%d%x00%s" "--decorate=full"
-        (and magit-bisect-show-graph "--graph")))))
-
-(defun magit-insert-bisect-log ()
-  "While bisecting, insert section logging bisect progress."
-  (when (magit-bisect-in-progress-p)
-    (magit-insert-section (bisect-log)
-      (magit-insert-heading "Bisect Log:")
-      (magit-git-wash #'magit-wash-bisect-log "bisect" "log")
-      (insert ?\n))))
-
-(defun magit-wash-bisect-log (_args)
-  (let (beg)
-    (while (progn (setq beg (point-marker))
-                  (re-search-forward "^\\(git bisect [^\n]+\n\\)" nil t))
-      (magit-bind-match-strings (heading) nil
-        (magit-delete-match)
-        (save-restriction
-          (narrow-to-region beg (point))
-          (goto-char (point-min))
-          (magit-insert-section (bisect-log heading t)
-            (insert (propertize heading 'face 'magit-section-secondary-heading))
-            (magit-insert-heading)
-            (magit-wash-sequence
-             (apply-partially 'magit-log-wash-rev 'bisect-log
-                              (magit-abbrev-length)))
-            (insert ?\n)))))
-    (when (re-search-forward
-           "# first bad commit: \\[\\([a-z0-9]\\{40\\}\\)\\] [^\n]+\n" nil t)
-      (magit-bind-match-strings (hash) nil
-        (magit-delete-match)
-        (magit-insert-section (bisect-log)
-          (insert hash " is the first bad commit\n"))))))
-
-(provide 'magit-bisect)
-;;; magit-bisect.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-bisect.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-blame.el
@@ -1,538 +0,0 @@
-;;; magit-blame.el --- blame support for Magit  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2012-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; Annotates each line in file-visiting buffer with information from
-;; the revision which last modified the line.
-
-;;; Code:
-
-(require 'magit)
-
-;;; Options
-
-(defgroup magit-blame nil
-  "Blame support for Magit."
-  :link '(info-link "(magit)Blaming")
-  :group 'magit-modes)
-
-(defcustom magit-blame-heading-format "%-20a %C %s"
-  "Format string used for blame headings.
-
-The following placeholders are recognized:
-
-  %H    hash
-  %s    summary
-  %a    author
-  %A    author time
-  %c    committer
-  %C    committer time
-
-The author and committer time formats can be specified with
-`magit-blame-time-format'."
-  :group 'magit-blame
-  :type 'string)
-
-(defcustom magit-blame-time-format "%F %H:%M"
-  "Format for time strings in blame headings."
-  :group 'magit-blame
-  :type 'string)
-
-(defcustom magit-blame-show-headings t
-  "Whether to initially show blame block headings.
-The headings can also be toggled locally using command
-`magit-blame-toggle-headings'."
-  :group 'magit-blame
-  :type 'boolean)
-
-(defcustom magit-blame-disable-modes '(fci-mode yascroll-bar-mode)
-  "List of modes not compatible with Magit-Blame mode.
-This modes are turned off when Magit-Blame mode is turned on,
-and then turned on again when turning off the latter."
-  :group 'magit-blame
-  :type '(repeat (symbol :tag "Mode")))
-
-(defcustom magit-blame-mode-lighter " Blame"
-  "The mode-line lighter of the Magit-Blame mode."
-  :group 'magit-blame
-  :type '(choice (const :tag "No lighter" "") string))
-
-(defcustom magit-blame-goto-chunk-hook '(magit-blame-maybe-update-revision-buffer)
-  "Hook run by `magit-blame-next-chunk' and `magit-blame-previous-chunk'."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-blame
-  :type 'hook
-  :get 'magit-hook-custom-get
-  :options '(magit-blame-maybe-update-revision-buffer))
-
-(defface magit-blame-heading
-  '((((class color) (background light))
-     :background "grey80"
-     :foreground "black")
-    (((class color) (background dark))
-     :background "grey25"
-     :foreground "white"))
-  "Face for blame headings."
-  :group 'magit-faces)
-
-(defface magit-blame-summary
-  '((t :inherit magit-blame-heading))
-  "Face for commit summary in blame headings."
-  :group 'magit-faces)
-
-(defface magit-blame-hash
-  '((t :inherit magit-blame-heading))
-  "Face for commit hash in blame headings."
-  :group 'magit-faces)
-
-(defface magit-blame-name
-  '((t :inherit magit-blame-heading))
-  "Face for author and committer names in blame headings."
-  :group 'magit-faces)
-
-(defface magit-blame-date
-  '((t :inherit magit-blame-heading))
-  "Face for dates in blame headings."
-  :group 'magit-faces)
-
-;;; Mode
-
-(defvar magit-blame-mode-map
-  (let ((map (make-sparse-keymap)))
-    (cond ((featurep 'jkl)
-           (define-key map [return]    'magit-show-commit)
-           (define-key map (kbd   "i") 'magit-blame-previous-chunk)
-           (define-key map (kbd   "I") 'magit-blame-previous-chunk-same-commit)
-           (define-key map (kbd   "k") 'magit-blame-next-chunk)
-           (define-key map (kbd   "K") 'magit-blame-next-chunk-same-commit))
-          (t
-           (define-key map (kbd "C-m") 'magit-show-commit)
-           (define-key map (kbd   "p") 'magit-blame-previous-chunk)
-           (define-key map (kbd   "P") 'magit-blame-previous-chunk-same-commit)
-           (define-key map (kbd   "n") 'magit-blame-next-chunk)
-           (define-key map (kbd   "N") 'magit-blame-next-chunk-same-commit)))
-    (define-key map (kbd   "b") 'magit-blame-popup)
-    (define-key map (kbd   "t") 'magit-blame-toggle-headings)
-    (define-key map (kbd   "q") 'magit-blame-quit)
-    (define-key map (kbd "M-w") 'magit-blame-copy-hash)
-    (define-key map (kbd "SPC") 'magit-diff-show-or-scroll-up)
-    (define-key map (kbd "DEL") 'magit-diff-show-or-scroll-down)
-    map)
-  "Keymap for `magit-blame-mode'.")
-
-(defun magit-blame-put-keymap-before-view-mode ()
-  "Put `magit-blame-mode' ahead of `view-mode' in `minor-mode-map-alist'."
-  (--when-let (assq 'magit-blame-mode
-                    (cl-member 'view-mode minor-mode-map-alist :key #'car))
-    (setq minor-mode-map-alist
-          (cons it (delq it minor-mode-map-alist))))
-  (remove-hook 'view-mode-hook #'magit-blame-put-keymap-before-view-mode))
-
-(add-hook 'view-mode-hook #'magit-blame-put-keymap-before-view-mode)
-
-(defvar-local magit-blame-buffer-read-only nil)
-(defvar-local magit-blame-cache nil)
-(defvar-local magit-blame-disabled-modes nil)
-(defvar-local magit-blame-process nil)
-(defvar-local magit-blame-recursive-p nil)
-(defvar-local magit-blame-separator nil)
-
-(define-minor-mode magit-blame-mode
-  "Display blame information inline.
-\n\\{magit-blame-mode-map}"
-  :lighter magit-blame-mode-lighter
-  (cond (magit-blame-mode
-         (when (called-interactively-p 'any)
-           (setq magit-blame-mode nil)
-           (user-error
-            (concat "Don't call `magit-blame-mode' directly; "
-                    "instead use `magit-blame' or `magit-blame-popup'")))
-         (setq magit-blame-buffer-read-only buffer-read-only)
-         (read-only-mode 1)
-         (dolist (mode magit-blame-disable-modes)
-           (when (and (boundp mode) (symbol-value mode))
-             (funcall mode -1)
-             (push mode magit-blame-disabled-modes)))
-         (setq magit-blame-separator (magit-blame-format-separator)))
-        (t
-         (unless magit-blame-buffer-read-only
-           (read-only-mode -1))
-         (dolist (mode magit-blame-disabled-modes)
-           (funcall mode 1))
-         (when (process-live-p magit-blame-process)
-           (kill-process magit-blame-process))
-         (save-excursion
-           (save-restriction
-             (widen)
-             (dolist (ov (overlays-in (point-min) (point-max)))
-               (when (overlay-get ov 'magit-blame)
-                 (delete-overlay ov))))))))
-
-(defun auto-revert-handler--unless-magit-blame-mode ()
-  "If Magit-Blame mode is on, then do nothing.  See #1731."
-  magit-blame-mode)
-
-(advice-add 'auto-revert-handler :before-until
-            'auto-revert-handler--unless-magit-blame-mode)
-
-;;; Popup
-
-;;;###autoload (autoload 'magit-blame-popup "magit-blame" nil t)
-(magit-define-popup magit-blame-popup
-  "Popup console for blame commands."
-  :man-page "git-blame"
-  :switches '((?w "Ignore whitespace" "-w")
-              (?r "Do not treat root commits as boundaries" "--root"))
-  :options  '((?M "Detect lines moved or copied within a file" "-M")
-              (?C "Detect lines moved or copied between files" "-C"))
-  :actions  '((?b "Blame" magit-blame))
-  :default-arguments '("-w")
-  :default-action 'magit-blame)
-
-;;; Process
-
-;;;###autoload
-(defun magit-blame (revision file &optional args line)
-  "Display edit history of FILE up to REVISION.
-
-Interactively blame the file being visited in the current buffer.
-If the buffer visits a revision of that file, then blame up to
-that revision, otherwise blame the file's full history, including
-uncommitted changes.
-
-If Magit-Blame mode is already turned on then blame recursively, by
-visiting REVISION:FILE (using `magit-find-file'), where revision
-is the revision before the revision that added the lines at
-point.
-
-ARGS is a list of additional arguments to pass to `git blame';
-only arguments available from `magit-blame-popup' should be used.
-\n(fn REVISION FILE &optional ARGS)" ; LINE is for internal use
-  (interactive
-   (let ((args (magit-blame-arguments)))
-     (if magit-blame-mode
-         (--if-let (magit-blame-chunk-get :previous-hash)
-             (list it (magit-blame-chunk-get :previous-file)
-                   args (magit-blame-chunk-get :previous-start))
-           (user-error "Block has no further history"))
-       (--if-let (magit-file-relative-name nil (not magit-buffer-file-name))
-           (list (or magit-buffer-refname magit-buffer-revision) it args)
-         (if buffer-file-name
-             (user-error "Buffer isn't visiting a tracked file")
-           (user-error "Buffer isn't visiting a file"))))))
-  (let ((toplevel (or (magit-toplevel)
-                      (user-error "Not in git repository"))))
-    (let ((default-directory toplevel))
-      (if revision
-          (magit-find-file revision file)
-        (--if-let (find-buffer-visiting file)
-            (progn (switch-to-buffer it)
-                   (save-buffer))
-          (find-file file))))
-    (let ((default-directory toplevel))
-      (widen)
-      (when line
-        (setq magit-blame-recursive-p t)
-        (goto-char (point-min))
-        (forward-line (1- line)))
-      (unless magit-blame-mode
-        (setq magit-blame-cache (make-hash-table :test 'equal))
-        (let ((show-headings magit-blame-show-headings))
-          (magit-blame-mode 1)
-          (setq-local magit-blame-show-headings show-headings))
-        (message "Blaming...")
-        (let ((magit-process-popup-time -1)
-              (inhibit-magit-refresh t))
-          (magit-run-git-async
-           "blame" "--incremental" args
-           "-L" (format "%s,%s"
-                        (line-number-at-pos (window-start))
-                        (line-number-at-pos (1- (window-end nil t))))
-           revision "--" file))
-        (setq magit-blame-process magit-this-process)
-        (set-process-filter magit-this-process 'magit-blame-process-filter)
-        (set-process-sentinel
-         magit-this-process
-         `(lambda (process event)
-            (when (memq (process-status process) '(exit signal))
-              (magit-process-sentinel process event)
-              (magit-blame-assert-buffer process)
-              (with-current-buffer (process-get process 'command-buf)
-                (when magit-blame-mode
-                  (let ((magit-process-popup-time -1)
-                        (inhibit-magit-refresh t)
-                        (default-directory ,default-directory))
-                    (magit-run-git-async "blame" "--incremental" ,@args
-                                         ,revision "--" ,file))
-                  (setq magit-blame-process magit-this-process)
-                  (set-process-filter
-                   magit-this-process 'magit-blame-process-filter)
-                  (set-process-sentinel
-                   magit-this-process 'magit-blame-process-sentinel))))))))))
-
-(defun magit-blame-process-sentinel (process event)
-  (let ((status (process-status process)))
-    (when (memq status '(exit signal))
-      (magit-process-sentinel process event)
-      (if (and (eq status 'exit)
-               (zerop (process-exit-status process)))
-          (message "Blaming...done")
-        (magit-blame-assert-buffer process)
-        (with-current-buffer (process-get process 'command-buf)
-          (magit-blame-mode -1))
-        (message "Blaming...failed")))))
-
-(defvar magit-blame-log nil
-  "Whether to log blame output to the process buffer.
-This is intended for debugging purposes.")
-
-(defun magit-blame-process-filter (process string)
-  (when magit-blame-log
-    (magit-process-filter process string))
-  (--when-let (process-get process 'partial-line)
-    (setq string (concat it string))
-    (setf (process-get process 'partial-line) nil))
-  (magit-blame-assert-buffer process)
-  (with-current-buffer (process-get process 'command-buf)
-    (when (and magit-blame-mode
-               (zerop (process-exit-status process)))
-      (let ((chunk (process-get process 'chunk))
-            (lines (split-string string "\n" t)))
-        (unless (string-match-p "\n\\'" string)
-          (process-put process 'chunk chunk)
-          (process-put process 'partial-line (car (last lines)))
-          (setq lines (butlast lines)))
-        (dolist (line lines)
-          (cond
-           ((equal line ""))
-           ((not chunk)
-            (string-match
-             "^\\(.\\{40\\}\\) \\([0-9]+\\) \\([0-9]+\\) \\([0-9]+\\)" line)
-            (setq chunk
-                  (list :hash (let ((hash (match-string 1 line)))
-                                (unless (equal hash (make-string 40 ?0))
-                                  hash))
-                        :previous-start (string-to-number (match-string 2 line))
-                        :start (string-to-number (match-string 3 line))
-                        :lines (string-to-number (match-string 4 line)))))
-           ((string-match "^filename \\(.+\\)" line)
-            (let* ((hash (plist-get chunk :hash))
-                   (file (match-string 1 line)))
-              (--if-let (gethash hash magit-blame-cache)
-                  (setq chunk (nconc chunk it))
-                (plist-put chunk :filename file)
-                (puthash hash chunk magit-blame-cache)))
-            (magit-blame-make-overlay chunk)
-            (setq chunk nil))
-           ((string-match "^previous \\(.\\{40\\}\\) \\(.+\\)" line)
-            (plist-put chunk :previous-hash (match-string 1 line))
-            (plist-put chunk :previous-file (match-string 2 line)))
-           ((string-match "^\\([^ ]+?-mail\\) <\\([^>]+\\)>" line)
-            (plist-put chunk (intern (concat ":" (match-string 1 line)))
-                       (string-to-number (match-string 2 line))))
-           ((string-match "^\\([^ ]+?-\\(?:time\\|tz\\)\\) \\(.+\\)" line)
-            (plist-put chunk (intern (concat ":" (match-string 1 line)))
-                       (string-to-number (match-string 2 line))))
-           ((string-match "^\\([^ ]+\\) \\(.+\\)" line)
-            (plist-put chunk (intern (concat ":" (match-string 1 line)))
-                       (match-string 2 line))))
-          (process-put process 'chunk chunk))))))
-
-(defun magit-blame-assert-buffer (process)
-  (unless (buffer-live-p (process-get process 'command-buf))
-    (kill-process process)
-    (user-error "Buffer being blamed has been killed")))
-
-;;; Display
-
-(defun magit-blame-make-overlay (chunk)
-  (let ((ov (save-excursion
-              (save-restriction
-                (widen)
-                (goto-char (point-min))
-                (forward-line (1- (plist-get chunk :start)))
-                (--when-let (--first (overlay-get it 'magit-blame)
-                                     (overlays-at (point)))
-                  (delete-overlay it))
-                (make-overlay (point)
-                              (progn (forward-line
-                                      (plist-get chunk :lines))
-                                     (point))))))
-        (heading (magit-blame-format-heading chunk)))
-    (overlay-put ov 'magit-blame chunk)
-    (overlay-put ov 'magit-blame-heading heading)
-    (overlay-put ov 'before-string
-                 (if magit-blame-show-headings
-                     heading
-                   magit-blame-separator))))
-
-(defun magit-blame-format-separator ()
-  (propertize
-   (concat (propertize " "  'display '(space :height (2)))
-           (propertize "\n" 'line-height t))
-   'face (list :background (face-attribute 'magit-blame-heading :background))))
-
-(defun magit-blame-format-heading (chunk)
-  (with-temp-buffer
-    (insert (format-spec
-             (concat magit-blame-heading-format "\n")
-             `((?H . ,(propertize (or (plist-get chunk :hash) "")
-                                  'face 'magit-blame-hash))
-               (?s . ,(propertize (or (plist-get chunk :summary) "")
-                                  'face 'magit-blame-summary))
-               (?a . ,(propertize (or (plist-get chunk :author) "")
-                                  'face 'magit-blame-name))
-               (?A . ,(propertize (magit-blame-format-time-string
-                                   magit-blame-time-format
-                                   (plist-get chunk :author-time)
-                                   (plist-get chunk :author-tz))
-                                  'face 'magit-blame-date))
-               (?c . ,(propertize (or (plist-get chunk :committer) "")
-                                  'face 'magit-blame-name))
-               (?C . ,(propertize (magit-blame-format-time-string
-                                   magit-blame-time-format
-                                   (plist-get chunk :committer-time)
-                                   (plist-get chunk :committer-tz))
-                                  'face 'magit-blame-date)))))
-    (goto-char (point-min))
-    (while (not (eobp))
-      (let ((face (get-text-property (point) 'face))
-            (next (or (next-single-property-change (point) 'face)
-                      (point-max))))
-        (unless face
-          (put-text-property (point) next 'face 'magit-blame-heading))
-        (goto-char next)))
-    (buffer-string)))
-
-(defun magit-blame-format-time-string (format time tz)
-  (format-time-string
-   format (seconds-to-time (+ time (* (/ tz 100) 60 60) (* (% tz 100) 60)))))
-
-;;; Commands
-
-(defun magit-blame-quit ()
-  "Turn off Magit-Blame mode.
-If the buffer was created during a recursive blame,
-then also kill the buffer."
-  (interactive)
-  (if magit-blame-recursive-p
-      (kill-buffer)
-    (magit-blame-mode -1)))
-
-(defun magit-blame-next-chunk ()
-  "Move to the next chunk."
-  (interactive)
-  (--if-let (next-single-char-property-change (point) 'magit-blame)
-      (progn (goto-char it)
-             (run-hooks 'magit-blame-goto-chunk-hook))
-    (user-error "No more chunks")))
-
-(defun magit-blame-previous-chunk ()
-  "Move to the previous chunk."
-  (interactive)
-  (--if-let (previous-single-char-property-change (point) 'magit-blame)
-      (progn (goto-char it)
-             (run-hooks 'magit-blame-goto-chunk-hook))
-    (user-error "No more chunks")))
-
-(defun magit-blame-next-chunk-same-commit (&optional previous)
-  "Move to the next chunk from the same commit.\n\n(fn)"
-  (interactive)
-  (-if-let (hash (magit-blame-chunk-get :hash))
-      (let ((pos (point)) ov)
-        (save-excursion
-          (while (and (not ov)
-                      (not (= pos (if previous (point-min) (point-max))))
-                      (setq pos (funcall
-                                 (if previous
-                                     'previous-single-char-property-change
-                                   'next-single-char-property-change)
-                                 pos 'magit-blame)))
-            (--when-let (magit-blame-overlay-at pos)
-              (when (equal (magit-blame-chunk-get :hash pos) hash)
-                (setq ov it)))))
-        (if ov
-            (goto-char (overlay-start ov))
-          (user-error "No more chunks from same commit")))
-    (user-error "This chunk hasn't been blamed yet")))
-
-(defun magit-blame-previous-chunk-same-commit ()
-  "Move to the previous chunk from the same commit."
-  (interactive)
-  (magit-blame-next-chunk-same-commit 'previous-single-char-property-change))
-
-(defun magit-blame-toggle-headings ()
-  "Show or hide blame chunk headings."
-  (interactive)
-  (setq-local magit-blame-show-headings (not magit-blame-show-headings))
-  (save-excursion
-    (save-restriction
-      (widen)
-      (goto-char (point-min))
-      (while (not (eobp))
-        (let ((next (next-single-char-property-change (point) 'magit-blame)))
-          (--when-let (magit-blame-overlay-at (point))
-            (overlay-put it 'before-string
-                         (if magit-blame-show-headings
-                             (overlay-get it 'magit-blame-heading)
-                           magit-blame-separator)))
-          (goto-char (or next (point-max))))))))
-
-(defun magit-blame-copy-hash ()
-  "Save hash of the current chunk's commit to the kill ring.
-
-When the region is active, then save that to the `kill-ring',
-like `kill-ring-save' would."
-  (interactive)
-  (if (use-region-p)
-      (copy-region-as-kill nil nil 'region)
-    (kill-new (message "%s" (magit-blame-chunk-get :hash)))))
-
-;;; Utilities
-
-(defun magit-blame-chunk-get (key &optional pos)
-  (--when-let (magit-blame-overlay-at pos)
-    (plist-get (overlay-get it 'magit-blame) key)))
-
-(defun magit-blame-overlay-at (&optional pos)
-  (--first (overlay-get it 'magit-blame)
-           (overlays-at (or pos (point)))))
-
-(defun magit-blame-maybe-update-revision-buffer ()
-  (unless magit--update-revision-buffer
-    (setq magit--update-revision-buffer nil)
-    (-when-let* ((commit (magit-blame-chunk-get :hash))
-                 (buffer (magit-mode-get-buffer 'magit-revision-mode nil t)))
-      (setq magit--update-revision-buffer (list commit buffer))
-      (run-with-idle-timer
-       magit-update-other-window-delay nil
-       (lambda ()
-         (-let [(rev buf) magit--update-revision-buffer]
-           (setq magit--update-revision-buffer nil)
-           (when (buffer-live-p buf)
-             (let ((magit-display-buffer-noselect t))
-               (apply #'magit-show-commit rev (magit-diff-arguments))))))))))
-
-(provide 'magit-blame)
-;;; magit-blame.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-blame.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-bookmark.el
@@ -1,364 +0,0 @@
-;;; magit-bookmark.el --- bookmark support for Magit  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Yuri Khan <yuri.v.khan@gmail.com>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; Support for bookmarks for most Magit buffers.
-
-;;; Code:
-
-(require 'magit)
-(require 'bookmark)
-
-;;; Supporting primitives
-
-(defun magit-bookmark--jump (bookmark fn &rest args)
-  "Handle a Magit BOOKMARK.
-
-This function will:
-
-1. Bind `default-directory' to the repository root directory
-   stored in the `filename' bookmark property.
-2. Invoke the function FN with ARGS as arguments.  This needs to
-   restore the buffer.
-3. Restore the expanded/collapsed status of top level sections
-   and the point position."
-  (declare (indent 2))
-  (let* ((default-directory (bookmark-get-filename bookmark)))
-    (if default-directory
-        (apply fn args)
-      (signal 'bookmark-error-no-filename (list 'stringp default-directory)))
-    (when (derived-mode-p 'magit-mode)
-      (-when-let (hidden-sections (bookmark-prop-get bookmark
-                                                     'magit-hidden-sections))
-        (--each (magit-section-children magit-root-section)
-          (if (member (cons (magit-section-type it) (magit-section-value it))
-                      hidden-sections)
-              (magit-section-hide it)
-            (magit-section-show it)))))
-    (--when-let (bookmark-get-position bookmark)
-      (goto-char it))
-    (--when-let (bookmark-get-front-context-string bookmark)
-      (when (search-forward it (point-max) t)
-        (goto-char (match-beginning 0))))
-    (--when-let (bookmark-get-rear-context-string bookmark)
-      (when (search-backward it (point-min) t)
-        (goto-char (match-end 0))))
-    nil))
-
-(defun magit-bookmark--make-record (mode handler &optional make-props)
-  "Create a Magit bookmark.
-
-MODE specifies the expected major mode of current buffer.
-
-HANDLER should be a function that will be used to restore this
-buffer.
-
-MAKE-PROPS should be either nil or a function that will be called
-with `magit-refresh-args' as the argument list, and may return an
-alist whose every element has the form (PROP . VALUE) and
-specifies additional properties to store in the bookmark."
-  (declare (indent 1))
-  (unless (eq major-mode mode)
-    (user-error "Not in a %s buffer" mode))
-  (let ((bookmark (bookmark-make-record-default 'no-file)))
-    (bookmark-prop-set bookmark 'handler handler)
-    (bookmark-set-filename bookmark (magit-toplevel))
-    (when (derived-mode-p 'magit-mode)
-      (bookmark-prop-set
-       bookmark 'magit-hidden-sections
-       (--map (cons (magit-section-type it) (magit-section-value it))
-              (-filter #'magit-section-hidden
-                       (magit-section-children magit-root-section)))))
-    (when make-props
-      (pcase-dolist (`(,prop . ,value) (apply make-props magit-refresh-args))
-        (bookmark-prop-set bookmark prop value)))
-    bookmark))
-
-;;; Status
-
-;;;###autoload
-(defun magit-bookmark--status-jump (bookmark)
-  "Handle a Magit status BOOKMARK."
-  (magit-bookmark--jump bookmark
-      (lambda () (magit-status-internal default-directory))))
-
-;;;###autoload
-(defun magit-bookmark--status-make-record ()
-  "Create a Magit status bookmark."
-  (magit-bookmark--make-record 'magit-status-mode
-    #'magit-bookmark--status-jump))
-
-;;; Refs
-
-;;;###autoload
-(defun magit-bookmark--refs-jump (bookmark)
-  "Handle a Magit refs BOOKMARK."
-  (magit-bookmark--jump bookmark #'magit-show-refs
-    (bookmark-prop-get bookmark 'magit-refs)
-    (bookmark-prop-get bookmark 'magit-args)))
-
-;;;###autoload
-(defun magit-bookmark--refs-make-record ()
-  "Create a Magit refs bookmark."
-  (magit-bookmark--make-record 'magit-refs-mode
-    #'magit-bookmark--refs-jump
-    (lambda (refs args)
-      `((magit-refs . ,refs)
-        (magit-args . ,args)))))
-
-;;; Log
-
-;;;###autoload
-(defun magit-bookmark--log-jump (bookmark)
-  "Handle a Magit log BOOKMARK."
-  (magit-bookmark--jump bookmark #'magit-log
-    (bookmark-prop-get bookmark 'magit-revs)
-    (bookmark-prop-get bookmark 'magit-args)
-    (bookmark-prop-get bookmark 'magit-files)))
-
-(defun magit-bookmark--log-make-name (buffer-name revs _args files)
-  "Generate the default name for a log bookmark."
-  (concat
-   buffer-name " " (mapconcat #'identity revs " ")
-   (and files
-        (concat " touching " (mapconcat #'identity files " ")))))
-
-;;;###autoload
-(defun magit-bookmark--log-make-record ()
-  "Create a Magit log bookmark."
-  (magit-bookmark--make-record 'magit-log-mode
-    #'magit-bookmark--log-jump
-    (lambda (revs args files)
-      `((defaults    . (,(magit-bookmark--log-make-name
-                          (buffer-name) revs args files)))
-        (magit-revs  . ,revs)
-        (magit-args  . ,args)
-        (magit-files . ,files)))))
-
-;;; Reflog
-
-;;;###autoload
-(defun magit-bookmark--reflog-jump (bookmark)
-  "Handle a Magit reflog BOOKMARK."
-  (magit-bookmark--jump bookmark
-      (lambda ()
-        (let ((magit-reflog-arguments (bookmark-prop-get bookmark 'magit-args)))
-          (magit-reflog (bookmark-prop-get bookmark 'magit-ref))))))
-
-(defun magit-bookmark--reflog-make-name (buffer-name ref)
-  "Generate the default name for a reflog bookmark."
-  (concat buffer-name " " ref))
-
-;;;###autoload
-(defun magit-bookmark--reflog-make-record ()
-  "Create a Magit reflog bookmark."
-  (magit-bookmark--make-record 'magit-reflog-mode
-    #'magit-bookmark--reflog-jump
-    (lambda (ref args)
-      `((defaults   . (,(magit-bookmark--reflog-make-name (buffer-name) ref)))
-        (magit-ref  . ,ref)
-        (magit-args . ,args)))))
-
-;;; Stashes
-
-;;;###autoload
-(defun magit-bookmark--stashes-jump (bookmark)
-  "Handle a Magit stash list BOOKMARK."
-  (magit-bookmark--jump bookmark #'magit-stash-list))
-
-;;;###autoload
-(defun magit-bookmark--stashes-make-record ()
-  "Create a Magit stash list bookmark."
-  (magit-bookmark--make-record 'magit-stashes-mode
-    #'magit-bookmark--stashes-jump))
-
-;;; Cherry
-
-;;;###autoload
-(defun magit-bookmark--cherry-jump (bookmark)
-  "Handle a Magit cherry BOOKMARK."
-  (magit-bookmark--jump bookmark #'magit-cherry
-    (bookmark-prop-get bookmark 'magit-head)
-    (bookmark-prop-get bookmark 'magit-upstream)))
-
-(defun magit-bookmark--cherry-make-name (buffer-name head upstream)
-  "Generate the default name for a cherry bookmark."
-  (concat buffer-name " " head " upstream " upstream))
-
-;;;###autoload
-(defun magit-bookmark--cherry-make-record ()
-  "Create a Magit cherry bookmark."
-  (magit-bookmark--make-record 'magit-cherry-mode
-    #'magit-bookmark--cherry-jump
-    (lambda (upstream head)
-      `((defaults       . (,(magit-bookmark--cherry-make-name
-                             (buffer-name) head upstream)))
-        (magit-head     . ,head)
-        (magit-upstream . ,upstream)))))
-
-;;; Diff
-
-;;;###autoload
-(defun magit-bookmark--diff-jump (bookmark)
-  "Handle a Magit diff BOOKMARK."
-  (magit-bookmark--jump bookmark #'magit-diff-setup
-    (bookmark-prop-get bookmark 'magit-rev-or-range)
-    (bookmark-prop-get bookmark 'magit-const)
-    (bookmark-prop-get bookmark 'magit-args)
-    (bookmark-prop-get bookmark 'magit-files)))
-
-(defun magit-bookmark--resolve (rev-or-range)
-  "Return REV-OR-RANGE with ref names resolved to commit hashes."
-  (pcase (magit-git-lines "rev-parse" rev-or-range)
-    (`(,rev)
-     (magit-rev-abbrev rev))
-    ((and `(,rev1 ,rev2)
-          (guard (/= ?^ (aref rev1 0)))
-          (guard (=  ?^ (aref rev2 0))))
-     (concat (magit-rev-abbrev (substring rev2 1))
-             ".."
-             (magit-rev-abbrev rev1)))
-    ((and `(,rev1 ,rev2 ,rev3)
-          (guard (/= ?^ (aref rev1 0)))
-          (guard (/= ?^ (aref rev2 0)))
-          (guard (=  ?^ (aref rev3 0))))
-     (ignore rev3)
-     (concat (magit-rev-abbrev rev1)
-             "..."
-             (magit-rev-abbrev rev2)))
-    (_
-     rev-or-range)))
-
-(defun magit-bookmark--diff-make-name
-    (buffer-name rev-or-range const _args files)
-  "Generate a default name for a diff bookmark."
-  (if (member "--no-index" const)
-      (apply #'format "*magit-diff %s %s" files)
-    (concat buffer-name " "
-            (cond (rev-or-range)
-                  ((member "--cached" const) "staged")
-                  (t                       "unstaged"))
-            (when files
-              (concat " in " (mapconcat #'identity files ", "))))))
-
-;;;###autoload
-(defun magit-bookmark--diff-make-record ()
-  "Create a Magit diff bookmark."
-  (magit-bookmark--make-record 'magit-diff-mode
-    #'magit-bookmark--diff-jump
-    (lambda (rev-or-range const args files)
-      (let ((resolved (magit-bookmark--resolve rev-or-range)))
-        `((defaults           . (,(magit-bookmark--diff-make-name
-                                   (buffer-name) resolved const args files)))
-          (magit-rev-or-range . ,resolved)
-          (magit-const        . ,const)
-          (magit-args         . ,args)
-          (magit-files        . ,files))))))
-
-;;; Revision
-
-;;;###autoload
-(defun magit-bookmark--revision-jump (bookmark)
-  "Handle a Magit revision BOOKMARK."
-  (magit-bookmark--jump bookmark #'magit-show-commit
-    (bookmark-prop-get bookmark 'magit-rev)
-    (bookmark-prop-get bookmark 'args)
-    (bookmark-prop-get bookmark 'files)))
-
-(defun magit-bookmark--revision-make-name (buffer-name rev _args files)
-  "Generate a default name for a revision bookmark."
-  (let ((subject (magit-rev-format "%s" rev)))
-    (concat buffer-name " "
-            (magit-rev-abbrev rev)
-            (cond (files   (concat " " (mapconcat #'identity files " ")))
-                  (subject (concat " " subject))))))
-
-;;;###autoload
-(defun magit-bookmark--revision-make-record ()
-  "Create a Magit revision bookmark."
-  ;; magit-refresh-args stores the revision in relative form.
-  ;; For bookmarks, the exact hash is more appropriate.
-  (magit-bookmark--make-record 'magit-revision-mode
-    #'magit-bookmark--revision-jump
-    (lambda (_rev _ args files)
-      `((defaults    . (,(magit-bookmark--revision-make-name
-                          (buffer-name) magit-buffer-revision-hash
-                          args files)))
-        (magit-rev   . ,magit-buffer-revision-hash)
-        (magit-args  . ,args)
-        (magit-files . ,files)))))
-
-;;; Stash
-
-;;;###autoload
-(defun magit-bookmark--stash-jump (bookmark)
-  "Handle a Magit stash BOOKMARK."
-  (magit-bookmark--jump bookmark #'magit-stash-show
-    (bookmark-prop-get bookmark 'magit-stash)
-    (bookmark-prop-get bookmark 'magit-args)
-    (bookmark-prop-get bookmark 'magit-files)))
-
-(defun magit-bookmark--stash-make-name (buffer-name stash _args files)
-  "Generate the default name for a stash bookmark."
-  (concat buffer-name " " stash " "
-          (if files
-              (mapconcat #'identity files " ")
-            (magit-rev-format "%s" stash))))
-
-;;;###autoload
-(defun magit-bookmark--stash-make-record ()
-  "Create a Magit stash bookmark."
-  (magit-bookmark--make-record 'magit-stash-mode
-    #'magit-bookmark--stash-jump
-    (lambda (stash _ args files)
-      `((defaults    . (,(magit-bookmark--stash-make-name
-                          (buffer-name)
-                          (magit-rev-abbrev magit-buffer-revision-hash)
-                          args files)))
-        (magit-stash . ,magit-buffer-revision-hash)
-        (magit-args  . ,args)
-        (magit-files . ,files)
-        (magit-hidden-sections
-         . ,(--map `(,(magit-section-type it)
-                     . ,(replace-regexp-in-string (regexp-quote stash)
-                                                  magit-buffer-revision-hash
-                                                  (magit-section-value it)))
-                   (-filter #'magit-section-hidden
-                            (magit-section-children magit-root-section))))))))
-
-;;; Submodules
-
-;;;###autoload
-(defun magit-bookmark--submodules-jump (bookmark)
-  "Handle a Magit submodule list BOOKMARK."
-  (magit-bookmark--jump bookmark #'magit-list-submodules))
-
-;;;###autoload
-(defun magit-bookmark--submodules-make-record ()
-  "Create a Magit submodule list bookmark."
-  (magit-bookmark--make-record 'magit-submodule-list-mode
-    #'magit-bookmark--submodules-jump))
-
-(provide 'magit-bookmark)
-;;; magit-bookmark.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-bookmark.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-branch.el
@@ -1,785 +0,0 @@
-;;; magit-branch.el --- branch support  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements support for branches.  It defines popups
-;; and commands for creating, checking out, manipulating, and
-;; configuring branches.  Commands defined here are mainly concerned
-;; with branches as pointers, commands that deal with what a branch
-;; points at, are defined elsewhere.
-
-;;; Code:
-
-(require 'magit)
-
-;;; Options
-
-(defcustom magit-branch-read-upstream-first t
-  "Whether to read upstream before name of new branch when creating a branch.
-
-`nil'      Read the branch name first.
-`t'        Read the upstream first.
-`fallback' Read the upstream first, but if it turns out that the chosen
-           value is not a valid upstream (because it cannot be resolved
-           as an existing revision), then treat it as the name of the
-           new branch and continue by reading the upstream next."
-  :package-version '(magit . "2.2.0")
-  :group 'magit-commands
-  :type '(choice (const :tag "read branch name first" nil)
-                 (const :tag "read upstream first" t)
-                 (const :tag "read upstream first, with fallback" fallback)))
-
-(defcustom magit-branch-prefer-remote-upstream nil
-  "Whether to favor remote upstreams when creating new branches.
-
-When a new branch is created, then the branch, commit, or stash
-at point is suggested as the default starting point of the new
-branch, or if there is no such revision at point the current
-branch.  In either case the user may choose another starting
-point.
-
-If the chosen starting point is a branch, then it may also be set
-as the upstream of the new branch, depending on the value of the
-Git variable `branch.autoSetupMerge'.  By default this is done
-for remote branches, but not for local branches.
-
-You might prefer to always use some remote branch as upstream.
-If the chosen starting point is (1) a local branch, (2) whose
-name matches a member of the value of this option, (3) the
-upstream of that local branch is a remote branch with the same
-name, and (4) that remote branch can be fast-forwarded to the
-local branch, then the chosen branch is used as starting point,
-but its own upstream is used as the upstream of the new branch.
-
-Members of this option's value are treated as branch names that
-have to match exactly unless they contain a character that makes
-them invalid as a branch name.  Recommended characters to use
-to trigger interpretation as a regexp are \"*\" and \"^\".  Some
-other characters which you might expect to be invalid, actually
-are not, e.g. \".+$\" are all perfectly valid.  More precisely,
-if `git check-ref-format --branch STRING' exits with a non-zero
-status, then treat STRING as a regexp.
-
-Assuming the chosen branch matches these conditions you would end
-up with with e.g.:
-
-  feature --upstream--> origin/master
-
-instead of
-
-  feature --upstream--> master --upstream--> origin/master
-
-Which you prefer is a matter of personal preference.  If you do
-prefer the former, then you should add branches such as \"master\",
-\"next\", and \"maint\" to the value of this options."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-commands
-  :type '(repeat string))
-
-(defcustom magit-branch-adjust-remote-upstream-alist nil
-  "Alist of upstreams to be used when branching from remote branches.
-
-When creating a local branch from an ephemeral branch located
-on a remote, e.g. a feature or hotfix branch, then that remote
-branch should usually not be used as the upstream branch, since
-the push-remote already allows accessing it and having both the
-upstream and the push-remote reference the same related branch
-would be wasteful.  Instead a branch like \"maint\" or \"master\"
-should be used as the upstream.
-
-This option allows specifing the branch that should be used as
-the upstream when branching certain remote branches.  The value
-is an alist of the form ((UPSTREAM . RULE)...).  The first
-matching element is used, the following elements are ignored.
-
-UPSTREAM is the branch to be used as the upstream for branches
-specified by RULE.  It can be a local or a remote branch.
-
-RULE can either be a regular expression, matching branches whose
-upstream should be the one specified by UPSTREAM.  Or it can be
-a list of the only branches that should *not* use UPSTREAM; all
-other branches will.  Matching is done after stripping the remote
-part of the name of the branch that is being branched from.
-
-If you use a finite set of non-ephemeral branches across all your
-repositories, then you might use something like:
-
-  ((\"origin/master\" \"master\" \"next\" \"maint\"))
-
-Or if the names of all your ephemeral branches contain a slash,
-at least in some repositories, then a good value could be:
-
-  ((\"origin/master\" . \"/\"))
-
-Of course you can also fine-tune:
-
-  ((\"origin/maint\" . \"\\`hotfix/\")
-   (\"origin/master\" . \"\\`feature/\"))"
-  :package-version '(magit . "2.9.0")
-  :group 'magit-commands
-  :type '(repeat (cons (string :tag "Use upstream")
-                       (choice :tag "for branches"
-                               (regexp :tag "matching")
-                               (repeat :tag "except"
-                                       (string :tag "branch"))))))
-
-(defcustom magit-branch-popup-show-variables t
-  "Whether the `magit-branch-popup' shows Git variables.
-This defaults to t to avoid changing key bindings.  When set to
-nil, no variables are displayed directly in this popup, instead
-the sub-popup `magit-branch-config-popup' has to be used to view
-and change branch related variables."
-  :package-version '(magit . "2.7.0")
-  :group 'magit-commands
-  :type 'boolean)
-
-;;; Branch Popup
-
-;;;###autoload (autoload 'magit-branch-popup "magit" nil t)
-(magit-define-popup magit-branch-popup
-  "Popup console for branch commands."
-  :man-page "git-branch"
-  :actions '((?b "Checkout"              magit-checkout)
-             (?n "Create new branch"     magit-branch)
-             (?C "Configure..."          magit-branch-config-popup)
-             (?c "Checkout new branch"   magit-branch-and-checkout)
-             (?s "Create new spin-off"   magit-branch-spinoff)
-             (?m "Rename"                magit-branch-rename)
-             (?w "Checkout new worktree" magit-worktree-checkout)
-             (?W "Create new worktree"   magit-worktree-branch)
-             (?x "Reset"                 magit-branch-reset) nil nil
-             (?k "Delete"                magit-branch-delete))
-  :default-action 'magit-checkout
-  :max-action-columns 3
-  :setup-function 'magit-branch-popup-setup)
-
-(defvar magit-branch-config-variables)
-
-(defun magit-branch-popup-setup (val def)
-  (magit-popup-default-setup val def)
-  (when magit-branch-popup-show-variables
-    (magit-popup-put :variables (magit-popup-convert-variables
-                                 val magit-branch-config-variables))
-    (use-local-map (copy-keymap magit-popup-mode-map))
-    (dolist (ev (-filter #'magit-popup-event-p (magit-popup-get :variables)))
-      (local-set-key (vector (magit-popup-event-key ev))
-                     'magit-invoke-popup-action))))
-
-;;; Branch Commands
-
-;;;###autoload
-(defun magit-checkout (revision)
-  "Checkout REVISION, updating the index and the working tree.
-If REVISION is a local branch, then that becomes the current
-branch.  If it is something else, then `HEAD' becomes detached.
-Checkout fails if the working tree or the staging area contain
-changes.
-\n(git checkout REVISION)."
-  (interactive (list (magit-read-other-branch-or-commit "Checkout")))
-  (when (string-match "\\`heads/\\(.+\\)" revision)
-    (setq revision (match-string 1 revision)))
-  (magit-run-git "checkout" revision))
-
-;;;###autoload
-(defun magit-branch (branch start-point &optional args)
-  "Create BRANCH at branch or revision START-POINT.
-\n(git branch [ARGS] BRANCH START-POINT)."
-  (interactive (magit-branch-read-args "Create branch"))
-  (magit-call-git "branch" args branch start-point)
-  (magit-branch-maybe-adjust-upstream branch start-point)
-  (magit-refresh))
-
-;;;###autoload
-(defun magit-branch-and-checkout (branch start-point &optional args)
-  "Create and checkout BRANCH at branch or revision START-POINT.
-\n(git checkout [ARGS] -b BRANCH START-POINT)."
-  (interactive (magit-branch-read-args "Create and checkout branch"))
-  (if (string-match-p "^stash@{[0-9]+}$" start-point)
-      (magit-run-git "stash" "branch" branch start-point)
-    (magit-call-git "checkout" args "-b" branch start-point)
-    (magit-branch-maybe-adjust-upstream branch start-point)
-    (magit-refresh)))
-
-(defun magit-branch-maybe-adjust-upstream (branch start-point)
-  (--when-let
-      (or (and (magit-get-upstream-branch branch)
-               (magit-get-indirect-upstream-branch start-point))
-          (and (magit-remote-branch-p start-point)
-               (let ((name (cdr (magit-split-branch-name start-point))))
-                 (car (--first (if (listp (cdr it))
-                                   (not (member name (cdr it)))
-                                 (string-match-p (cdr it) name))
-                               magit-branch-adjust-remote-upstream-alist)))))
-    (magit-call-git "branch" (concat "--set-upstream-to=" it) branch)))
-
-;;;###autoload
-(defun magit-branch-orphan (branch start-point &optional args)
-  "Create and checkout an orphan BRANCH with contents from revision START-POINT.
-\n(git checkout --orphan [ARGS] BRANCH START-POINT)."
-  (interactive (magit-branch-read-args "Create and checkout orphan branch"))
-  (magit-run-git "checkout" "--orphan" args branch start-point))
-
-(defun magit-branch-read-args (prompt)
-  (let ((args (magit-branch-arguments)))
-    (if magit-branch-read-upstream-first
-        (let* ((default (and (or (memq this-command magit-no-confirm-default)
-                                 (memq magit-current-popup-action
-                                       magit-no-confirm-default))
-                             (magit--default-starting-point)))
-               (choice (or default
-                           (magit-read-starting-point prompt))))
-          (if (magit-rev-verify choice)
-              (list (magit-read-string-ns
-                     (if default
-                         (format "%s (starting at %s)" prompt choice)
-                       "Branch name")
-                     (let ((def (mapconcat #'identity
-                                           (cdr (split-string choice "/"))
-                                           "/")))
-                       (and (member choice (magit-list-remote-branch-names))
-                            (not (member def (magit-list-local-branch-names)))
-                            def)))
-                    choice args)
-            (if (eq magit-branch-read-upstream-first 'fallback)
-                (list choice
-                      (magit-read-starting-point (concat prompt " " choice))
-                      args)
-              (user-error "Not a valid starting-point: %s" choice))))
-      (let ((branch (magit-read-string-ns (concat prompt " named"))))
-        (list branch
-              (magit-read-starting-point (concat prompt " " branch))
-              args)))))
-
-;;;###autoload
-(defun magit-branch-spinoff (branch &optional from &rest args)
-  "Create new branch from the unpushed commits.
-
-Create and checkout a new branch starting at and tracking the
-current branch.  That branch in turn is reset to the last commit
-it shares with its upstream.  If the current branch has no
-upstream or no unpushed commits, then the new branch is created
-anyway and the previously current branch is not touched.
-
-This is useful to create a feature branch after work has already
-began on the old branch (likely but not necessarily \"master\").
-
-If the current branch is a member of the value of option
-`magit-branch-prefer-remote-upstream' (which see), then the
-current branch will be used as the starting point as usual, but
-the upstream of the starting-point may be used as the upstream
-of the new branch, instead of the starting-point itself.
-
-If optional FROM is non-nil, then the source branch is reset
-to `FROM~', instead of to the last commit it shares with its
-upstream.  Interactively, FROM is only ever non-nil, if the
-region selects some commits, and among those commits, FROM is
-the commit that is the fewest commits ahead of the source
-branch.  (It not yet possible to spin off a single commit,
-unless it is the only unpushed commit.  See #2920.)
-
-The commit at the other end of the selection actually does not
-matter, all commits between FROM and `HEAD' are moved to the new
-branch.  If FROM is not reachable from `HEAD' or is reachable
-from the source branch's upstream, then an error is raised."
-  (interactive (list (magit-read-string "Spin off branch")
-                     (car (last (magit-region-values 'commit)))
-                     (magit-branch-arguments)))
-  (when (magit-branch-p branch)
-    (user-error "Cannot spin off %s.  It already exists" branch))
-  (-if-let (current (magit-get-current-branch))
-      (let ((tracked (magit-get-upstream-branch current))
-            base)
-        (when from
-          (unless (magit-rev-ancestor-p from current)
-            (user-error "Cannot spin off %s.  %s is not reachable from %s"
-                        branch from current))
-          (when (and tracked
-                     (magit-rev-ancestor-p from tracked))
-            (user-error "Cannot spin off %s.  %s is ancestor of upstream %s"
-                        branch from tracked)))
-        (magit-call-git "checkout" args "-b" branch current)
-        (--when-let (magit-get-indirect-upstream-branch current)
-          (magit-call-git "branch" "--set-upstream-to" it branch))
-        (when (and tracked
-                   (setq base
-                         (if from
-                             (concat from "^")
-                           (magit-git-string "merge-base" current tracked)))
-                   (not (magit-rev-eq base current)))
-          (magit-call-git "update-ref" "-m"
-                          (format "reset: moving to %s" base)
-                          (concat "refs/heads/" current) base))
-        (magit-refresh))
-    (magit-run-git "checkout" "-b" branch)))
-
-;;;###autoload
-(defun magit-branch-reset (branch to &optional args set-upstream)
-  "Reset a branch to the tip of another branch or any other commit.
-
-When the branch being reset is the current branch, then do a
-hard reset.  If there are any uncommitted changes, then the user
-has to confirm the reset because those changes would be lost.
-
-This is useful when you have started work on a feature branch but
-realize it's all crap and want to start over.
-
-When resetting to another branch and a prefix argument is used,
-then also set the target branch as the upstream of the branch
-that is being reset."
-  (interactive
-   (let* ((atpoint (magit-branch-at-point))
-          (branch  (magit-read-local-branch "Reset branch" atpoint)))
-     (list branch
-           (magit-completing-read (format "Reset %s to" branch)
-                                  (delete branch (magit-list-branch-names))
-                                  nil nil nil 'magit-revision-history
-                                  (or (and (not (equal branch atpoint)) atpoint)
-                                      (magit-get-upstream-branch branch)))
-           (magit-branch-arguments)
-           current-prefix-arg)))
-  (unless (member "--force" args)
-    (setq args (cons "--force" args)))
-  (if (equal branch (magit-get-current-branch))
-      (if (and (magit-anything-modified-p)
-               (not (yes-or-no-p "Uncommitted changes will be lost.  Proceed?")))
-          (user-error "Abort")
-        (magit-reset-hard to)
-        (when (and set-upstream (magit-branch-p to))
-          (magit-set-branch*merge/remote branch to)))
-    (magit-branch branch to args)))
-
-;;;###autoload
-(defun magit-branch-delete (branches &optional force)
-  "Delete one or multiple branches.
-If the region marks multiple branches, then offer to delete
-those, otherwise prompt for a single branch to be deleted,
-defaulting to the branch at point."
-  ;; One would expect this to be a command as simple as, for example,
-  ;; `magit-branch-rename'; but it turns out everyone wants to squeeze
-  ;; a bit of extra functionality into this one.  And once it's there,
-  ;; you cannot remove it anymore. (I tried, it causes protests.)
-  (interactive
-   (let ((branches (magit-region-values 'branch))
-         (force current-prefix-arg))
-     (if (if (> (length branches) 1)
-             (magit-confirm t nil "Delete %i branches" branches)
-           (setq branches
-                 (list (magit-read-branch (if force
-                                              "Force delete branch"
-                                            "Delete branch")
-                                          (magit-get-previous-branch)))))
-         (unless force
-           (--when-let (-remove #'magit-branch-merged-p branches)
-             (if (magit-confirm 'delete-unmerged-branch
-                   "Delete unmerged branch %s"
-                   "Delete %i unmerged branches" it)
-                 (setq force branches)
-               (or (setq branches (-difference branches it))
-                   (user-error "Abort")))))
-       (user-error "Abort"))
-     (list branches force)))
-  (let* ((refs (-map #'magit-ref-fullname branches))
-         (ambiguous (--filter (not it) refs)))
-    (when ambiguous
-      (user-error
-       "%s ambiguous.  Please cleanup using git directly."
-       (let ((len (length ambiguous)))
-         (cond
-          ((= len 1)
-           (format "%s is" (-first #'magit-ref-ambiguous-p branches)))
-          ((= len (length refs))
-           (format "These %s names are" len))
-          (t
-           (format "%s of these names are" len))))))
-    (cond
-     ((string-match "^refs/remotes/\\([^/]+\\)" (car refs))
-      (let* ((remote (match-string 1 (car refs)))
-             (offset (1+ (length remote))))
-        ;; Assume the branches actually still exists on the remote.
-        (magit-run-git-async
-         "push" remote (--map (concat ":" (substring it offset)) branches))
-        ;; If that is not the case, then this deletes the tracking branches.
-        (set-process-sentinel
-         magit-this-process
-         (apply-partially 'magit-delete-remote-branch-sentinel refs))))
-     ((> (length branches) 1)
-      (magit-run-git "branch" (if force "-D" "-d")
-                     (delete (magit-get-current-branch) branches)))
-     (t ; And now for something completely different.
-      (let* ((branch (car branches))
-             (prompt (format "Branch %s is checked out.  " branch)))
-        (when (equal branch (magit-get-current-branch))
-          (pcase (if (or (equal branch "master")
-                         (not (magit-rev-verify "master")))
-                     (magit-read-char-case prompt nil
-                       (?d "[d]etach HEAD & delete" 'detach)
-                       (?a "[a]bort"                'abort))
-                   (magit-read-char-case prompt nil
-                     (?d "[d]etach HEAD & delete"     'detach)
-                     (?c "[c]heckout master & delete" 'master)
-                     (?a "[a]bort"                    'abort)))
-            (`detach (unless (or (equal force '(4))
-                                 (member branch force)
-                                 (magit-branch-merged-p branch t)
-                                 (magit-confirm 'delete-unmerged-branch
-                                   "Delete unmerged branch %s" ""
-                                   (list branch)))
-                       (user-error "Abort"))
-                     (magit-call-git "checkout" "--detach"))
-            (`master (unless (or (equal force '(4))
-                                 (member branch force)
-                                 (magit-branch-merged-p branch "master")
-                                 (magit-confirm 'delete-unmerged-branch
-                                   "Delete unmerged branch %s" ""
-                                   (list branch)))
-                       (user-error "Abort"))
-                     (magit-call-git "checkout" "master"))
-            (`abort  (user-error "Abort")))
-          (setq force t))
-        (magit-run-git "branch" (if force "-D" "-d") branch))))))
-
-(put 'magit-branch-delete 'interactive-only t)
-
-(defun magit-delete-remote-branch-sentinel (refs process event)
-  (when (memq (process-status process) '(exit signal))
-    (if (= (process-exit-status process) 0)
-        (magit-process-sentinel process event)
-      (-if-let (rest (-filter #'magit-ref-exists-p refs))
-          (progn
-            (process-put process 'inhibit-refresh t)
-            (magit-process-sentinel process event)
-            (setq magit-this-error nil)
-            (message "Some remote branches no longer exist.  %s"
-                     "Deleting just the local tracking refs instead...")
-            (--each rest (magit-call-git "update-ref" "-d" it))
-            (magit-refresh)
-            (message "Deleting local remote-tracking refs...done"))
-        (magit-process-sentinel process event)))))
-
-;;;###autoload
-(defun magit-branch-rename (old new &optional force)
-  "Rename branch OLD to NEW.
-With prefix, forces the rename even if NEW already exists.
-\n(git branch -m|-M OLD NEW)."
-  (interactive
-   (let ((branch (or (and (memq 'magit-branch-rename magit-no-confirm-default)
-                          (or (magit-local-branch-at-point)
-                              (magit-get-current-branch)))
-                     (magit-read-local-branch "Rename branch"))))
-     (list branch
-           (magit-read-string-ns (format "Rename branch '%s' to" branch)
-                                 nil 'magit-revision-history)
-           current-prefix-arg)))
-  (unless (string= old new)
-    (magit-run-git "branch" (if force "-M" "-m") old new)))
-
-;;; Config Popup
-
-(defvar magit-branch-config-branch nil)
-
-;;;###autoload
-(defun magit-branch-config-popup (branch)
-  "Popup console for setting branch variables."
-  (interactive
-   (list (if (or current-prefix-arg
-                 (and (eq magit-current-popup 'magit-branch-popup)
-                      magit-branch-popup-show-variables))
-             (magit-read-local-branch "Configure branch")
-           (magit-get-current-branch))))
-  (let ((magit-branch-config-branch branch))
-    (magit-invoke-popup 'magit-branch-config-popup nil nil)))
-
-(defvar magit-branch-config-variables
-  '((lambda ()
-      (concat
-       (propertize "Configure " 'face 'magit-popup-heading)
-       (propertize (magit-branch-config-branch) 'face 'magit-branch-local)))
-    (?d "branch.%s.description"
-        magit-edit-branch*description
-        magit-format-branch*description)
-    (?u "branch.%s.merge"
-        magit-set-branch*merge/remote
-        magit-format-branch*merge/remote)
-    (?r "branch.%s.rebase"
-        magit-cycle-branch*rebase
-        magit-format-branch*rebase)
-    (?p "branch.%s.pushRemote"
-        magit-cycle-branch*pushRemote
-        magit-format-branch*pushRemote)
-    "Configure repository defaults"
-    (?\M-r "pull.rebase"
-           magit-cycle-pull.rebase
-           magit-format-pull.rebase)
-    (?\M-p "remote.pushDefault"
-           magit-cycle-remote.pushDefault
-           magit-format-remote.pushDefault)
-    "Configure branch creation"
-    (?U "branch.autoSetupMerge"
-        magit-cycle-branch*autoSetupMerge
-        magit-format-branch*autoSetupMerge)
-    (?R "branch.autoSetupRebase"
-        magit-cycle-branch*autoSetupRebase
-        magit-format-branch*autoSetupRebase)))
-
-(defvar magit-branch-config-popup
-  `(:man-page "git-branch"
-    :variables ,magit-branch-config-variables
-    :default-action magit-checkout
-    :setup-function magit-branch-config-popup-setup))
-
-(defun magit-branch-config-popup-setup (val def)
-  (magit-popup-default-setup val def)
-  (setq-local magit-branch-config-branch magit-branch-config-branch)
-  (use-local-map (copy-keymap magit-popup-mode-map))
-  (dolist (ev (-filter #'magit-popup-event-p (magit-popup-get :variables)))
-    (local-set-key (vector (magit-popup-event-key ev))
-                   'magit-invoke-popup-action)))
-
-(defun magit-branch-config-branch (&optional prompt)
-  (if prompt
-      (or (and (not current-prefix-arg)
-               (or magit-branch-config-branch
-                   (magit-get-current-branch)))
-          (magit-read-local-branch prompt))
-    (or magit-branch-config-branch
-        (magit-get-current-branch)
-        "<name>")))
-
-;;; Config Commands and Inserters
-
-;;;###autoload
-(defun magit-edit-branch*description (branch)
-  "Edit the description of the current branch.
-With a prefix argument edit the description of another branch.
-
-The description for the branch named NAME is stored in the Git
-variable `branch.<name>.description'."
-  (interactive (list (magit-branch-config-branch "Edit branch description")))
-  (magit-run-git-with-editor "branch" "--edit-description" branch))
-
-(defun magit-edit-branch*description-check-buffers ()
-  (and buffer-file-name
-       (string-match-p "/\\(BRANCH\\|EDIT\\)_DESCRIPTION\\'" buffer-file-name)
-       (add-hook 'with-editor-post-finish-hook
-                 (lambda ()
-                   (when (derived-mode-p 'magit-popup-mode)
-                     (magit-refresh-popup-buffer)))
-                 nil t)))
-
-(add-hook 'find-file-hook 'magit-edit-branch*description-check-buffers)
-
-(defun magit-format-branch*description ()
-  (let* ((branch (magit-branch-config-branch))
-         (width (+ (length branch) 19))
-         (var (format "branch.%s.description" branch)))
-    (concat var " " (make-string (- width (length var)) ?\s)
-            (-if-let (value (magit-get var))
-                (propertize value 'face 'magit-popup-option-value)
-              (propertize "unset" 'face 'magit-popup-disabled-argument)))))
-
-;;;###autoload
-(defun magit-set-branch*merge/remote (branch upstream)
-  "Set or unset the upstream of the current branch.
-With a prefix argument do so for another branch.
-
-When the branch in question already has an upstream then simply
-unsets it.  Invoke this command again to set another upstream.
-
-Together the Git variables `branch.<name>.remote' and
-`branch.<name>.merge' define the upstream branch of the local
-branch named NAME.  The value of `branch.<name>.remote' is the
-name of the upstream remote.  The value of `branch.<name>.merge'
-is the full reference of the upstream branch, on the remote.
-
-Non-interactively, when UPSTREAM is non-nil, then always set it
-as the new upstream, regardless of whether another upstream was
-already set.  When nil, then always unset."
-  (interactive
-   (let ((branch (magit-branch-config-branch "Change upstream of branch")))
-     (list branch (and (not (magit-get-upstream-branch branch))
-                       (magit-read-upstream-branch branch)))))
-  (if upstream
-      (-let (((remote . merge) (magit-split-branch-name upstream)))
-        (setf (magit-get (format "branch.%s.remote" branch)) remote)
-        (setf (magit-get (format "branch.%s.merge"  branch))
-              (concat "refs/heads/" merge)))
-    (magit-call-git "branch" "--unset-upstream" branch))
-  (when (called-interactively-p 'any)
-    (magit-refresh)))
-
-(defun magit-format-branch*merge/remote ()
-  (let* ((branch (magit-branch-config-branch))
-         (width (+ (length branch) 20))
-         (varM (format "branch.%s.merge" branch))
-         (varR (format "branch.%s.remote" branch))
-         (face (if (equal (magit-get varR) ".")
-                   'magit-branch-local
-                 'magit-branch-remote)))
-    (concat varM (make-string (- width (length varM)) ?\s)
-            (-if-let (value (magit-get varM))
-                (propertize value 'face face)
-              (propertize "unset" 'face 'magit-popup-disabled-argument))
-            "\n   " varR (make-string (- width (length varR)) ?\s)
-            (-if-let (value (magit-get varR))
-                (propertize value 'face face)
-              (propertize "unset" 'face 'magit-popup-disabled-argument)))))
-
-;;;###autoload
-(defun magit-cycle-branch*rebase (branch)
-  "Cycle the value of `branch.<name>.rebase' for the current branch.
-With a prefix argument cycle the value for another branch.
-
-The Git variables `branch.<name>.rebase' controls whether pulling
-into the branch named NAME is done by rebasing that branch onto
-the fetched branch or by merging that branch.
-
-When `true' then pulling is done by rebasing.
-When `false' then pulling is done by merging.
-
-When that variable is undefined then the value of `pull.rebase'
-is used instead.  It defaults to `false'."
-  (interactive (list (magit-branch-config-branch
-                      "Cycle branch.<name>.rebase for")))
-  (magit-popup-set-variable (format "branch.%s.rebase" branch)
-                            '("true" "false")
-                            "false" "pull.rebase"))
-
-(defun magit-format-branch*rebase ()
-  (let ((branch (magit-branch-config-branch)))
-    (magit-popup-format-variable (format "branch.%s.rebase" branch)
-                                 '("true" "false")
-                                 "false" "pull.rebase"
-                                 (+ (length branch) 20))))
-
-;;;###autoload
-(defun magit-cycle-branch*pushRemote (branch)
-  "Cycle the value of `branch.<name>.pushRemote' for the current branch.
-With a prefix argument cycle the value for another branch.
-
-The Git variable `branch.<name>.pushRemote' specifies the remote
-that the branch named NAME is usually pushed to.  The value has
-to be the name of an existing remote.
-
-If that variable is undefined, then the value of the Git variable
-`remote.pushDefault' is used instead, provided that it is defined,
-which by default it is not."
-  (interactive (list (magit-branch-config-branch
-                      "Cycle branch.<name>.pushRemote for")))
-  (magit-popup-set-variable (format "branch.%s.pushRemote" branch)
-                            (magit-list-remotes)
-                            "remote.pushDefault"))
-
-(defun magit-format-branch*pushRemote ()
-  (let ((branch (magit-branch-config-branch)))
-    (magit-popup-format-variable (format "branch.%s.pushRemote" branch)
-                                 (magit-list-remotes)
-                                 nil "remote.pushDefault"
-                                 (+ (length branch) 20))))
-
-;;;###autoload
-(defun magit-cycle-pull.rebase ()
-  "Cycle the repository-local value of `pull.rebase'.
-
-The Git variable `pull.rebase' specifies whether pulling is done
-by rebasing or by merging.  It can be overwritten using the Git
-variable `branch.<name>.rebase'.
-
-When `true' then pulling is done by rebasing.
-When `false' (the default) then pulling is done by merging."
-  (interactive)
-  (magit-popup-set-variable "pull.rebase" '("true" "false") "false"))
-
-(defun magit-format-pull.rebase ()
-  (magit-popup-format-variable "pull.rebase" '("true" "false") "false" nil 19))
-
-;;;###autoload
-(defun magit-cycle-remote.pushDefault ()
-  "Cycle the repository-local value of `remote.pushDefault'.
-
-The Git variable `remote.pushDefault' specifies the remote that
-local branches are usually pushed to.  It can be overwritten
-using the Git variable `branch.<name>.pushRemote'."
-  (interactive)
-  (magit-popup-set-variable "remote.pushDefault" (magit-list-remotes)))
-
-(defun magit-format-remote.pushDefault ()
-  (magit-popup-format-variable "remote.pushDefault"
-                               (magit-list-remotes) nil nil 19))
-
-;;;###autoload
-(defun magit-cycle-branch*autoSetupMerge ()
-  "Cycle the repository-local value of `branch.autoSetupMerge'.
-
-The Git variable `branch.autoSetupMerge' under what circumstances
-creating a branch (named NAME) should result in the variables
-`branch.<name>.merge' and `branch.<name>.remote' being set
-according to the starting point used to create the branch.  If
-the starting point isn't a branch, then these variables are never
-set.
-
-When `always' then the variables are set regardless of whether
-the starting point is a local or a remote branch.
-
-When `true' (the default) then the variable are set when the
-starting point is a remote branch, but not when it is a local
-branch.
-
-When `false' then the variables are never set."
-  (interactive)
-  (magit-popup-set-variable "branch.autoSetupMerge"
-                            '("always" "true" "false") "true"))
-
-(defun magit-format-branch*autoSetupMerge ()
-  (magit-popup-format-variable "branch.autoSetupMerge"
-                               '("always" "true" "false") "true" nil 23))
-
-;;;###autoload
-(defun magit-cycle-branch*autoSetupRebase ()
-  "Cycle the repository-local value of `branch.autoSetupRebase'.
-
-The Git variable `branch.autoSetupRebase' specifies whether
-creating a branch (named NAME) should result in the variable
-`branch.<name>.rebase' being set to `true'.
-
-When `always' then the variable is set regardless of whether the
-starting point is a local or a remote branch.
-
-When `local' then the variable are set when the starting point
-is a local branch, but not when it is a remote branch.
-
-When `remote' then the variable are set when the starting point
-is a remote branch, but not when it is a local branch.
-
-When `never' (the default) then the variable is never set."
-  (interactive)
-  (magit-popup-set-variable "branch.autoSetupRebase"
-                            '("always" "local" "remote" "never") "never"))
-
-(defun magit-format-branch*autoSetupRebase ()
-  (magit-popup-format-variable "branch.autoSetupRebase"
-                               '("always" "local" "remote" "never")
-                               "never" nil 23))
-
-(provide 'magit-branch)
-;;; magit-branch.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-branch.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-commit.el
@@ -1,427 +0,0 @@
-;;; magit-commit.el --- create Git commits  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2008-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements commands for creating Git commits.  These
-;; commands just initiate the commit, support for writing the commit
-;; messages is implemented in `git-commit.el'.
-
-;;; Code:
-
-(require 'magit)
-(require 'magit-sequence)
-
-(eval-when-compile (require 'epa)) ; for `epa-protocol'
-(eval-when-compile (require 'epg))
-(declare-function epg-sub-key-id 'epg)
-(declare-function epg-key-sub-key-list 'epg)
-(declare-function epg-key-user-id-list 'epg)
-(declare-function epg-user-id-string 'epg)
-(declare-function epg-decode-dn 'epg)
-(declare-function epg-list-keys 'epg)
-
-;;; Options
-
-(defcustom magit-commit-arguments nil
-  "The arguments used when committing."
-  :group 'magit-git-arguments
-  :type '(repeat (string :tag "Argument")))
-
-(defcustom magit-commit-ask-to-stage 'verbose
-  "Whether to ask to stage everything when committing and nothing is staged."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-commands
-  :type '(choice (const :tag "Ask showing diff" verbose)
-                 (const :tag "Ask" t)
-                 (const :tag "Don't ask" nil)))
-
-(defcustom magit-commit-show-diff t
-  "Whether the relevant diff is automatically shown when committing."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-commands
-  :type 'boolean)
-
-(defcustom magit-commit-extend-override-date t
-  "Whether using `magit-commit-extend' changes the committer date."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-commands
-  :type 'boolean)
-
-(defcustom magit-commit-reword-override-date t
-  "Whether using `magit-commit-reword' changes the committer date."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-commands
-  :type 'boolean)
-
-(defcustom magit-commit-squash-confirm t
-  "Whether the commit targeted by squash and fixup has to be confirmed.
-When non-nil then the commit at point (if any) is used as default
-choice, otherwise it has to be confirmed.  This option only
-affects `magit-commit-squash' and `magit-commit-fixup'.  The
-\"instant\" variants always require confirmation because making
-an error while using those is harder to recover from."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-commands
-  :type 'boolean)
-
-;;; Popup
-
-(defun magit-commit-popup (&optional arg)
-  "Popup console for commit commands."
-  (interactive "P")
-  (--if-let (magit-commit-message-buffer)
-      (switch-to-buffer it)
-    (magit-invoke-popup 'magit-commit-popup nil arg)))
-
-(defvar magit-commit-popup
-  '(:variable magit-commit-arguments
-    :man-page "git-commit"
-    :switches ((?a "Stage all modified and deleted files"   "--all")
-               (?e "Allow empty commit"                     "--allow-empty")
-               (?v "Show diff of changes to be committed"   "--verbose")
-               (?h "Disable hooks"                          "--no-verify")
-               (?s "Add Signed-off-by line"                 "--signoff")
-               (?R "Claim authorship and reset author date" "--reset-author"))
-    :options  ((?A "Override the author"  "--author=")
-               (?S "Sign using gpg"       "--gpg-sign=" magit-read-gpg-secret-key)
-               (?C "Reuse commit message" "--reuse-message="
-                   magit-read-reuse-message))
-    :actions  ((?c "Commit"         magit-commit)
-               (?e "Extend"         magit-commit-extend)
-               (?f "Fixup"          magit-commit-fixup)
-               (?F "Instant Fixup"  magit-commit-instant-fixup) nil
-               (?w "Reword"         magit-commit-reword)
-               (?s "Squash"         magit-commit-squash)
-               (?S "Instant Squash" magit-commit-instant-squash) nil
-               (?a "Amend"          magit-commit-amend)
-               (?A "Augment"        magit-commit-augment))
-    :max-action-columns 4
-    :default-action magit-commit))
-
-(magit-define-popup-keys-deferred 'magit-commit-popup)
-
-(defun magit-commit-arguments nil
-  (if (eq magit-current-popup 'magit-commit-popup)
-      magit-current-popup-args
-    magit-commit-arguments))
-
-(defvar magit-gpg-secret-key-hist nil)
-
-(defun magit-read-gpg-secret-key (prompt &optional _initial-input)
-  (require 'epa)
-  (let ((keys (--map (concat (epg-sub-key-id (car (epg-key-sub-key-list it)))
-                             " "
-                             (-when-let (id-obj (car (epg-key-user-id-list it)))
-                               (let    ((id-str (epg-user-id-string id-obj)))
-                                 (if (stringp id-str)
-                                     id-str
-                                   (epg-decode-dn id-obj)))))
-                     (epg-list-keys (epg-make-context epa-protocol) nil t))))
-    (car (split-string (magit-completing-read
-                        prompt keys nil nil nil 'magit-gpg-secret-key-hist
-                        (car (or magit-gpg-secret-key-hist keys)))
-                       " "))))
-
-(defun magit-read-reuse-message (prompt &optional default)
-  (magit-completing-read prompt (magit-list-refnames)
-                         nil nil nil 'magit-revision-history
-                         (or default
-                             (and (magit-rev-verify "ORIG_HEAD")
-                                  "ORIG_HEAD"))))
-
-;;; Commands
-
-;;;###autoload
-(defun magit-commit (&optional args)
-  "Create a new commit on `HEAD'.
-With a prefix argument, amend to the commit at `HEAD' instead.
-\n(git commit [--amend] ARGS)"
-  (interactive (if current-prefix-arg
-                   (list (cons "--amend" (magit-commit-arguments)))
-                 (list (magit-commit-arguments))))
-  (when (setq args (magit-commit-assert args))
-    (magit-run-git-with-editor "commit" args)))
-
-;;;###autoload
-(defun magit-commit-amend (&optional args)
-  "Amend the last commit.
-\n(git commit --amend ARGS)"
-  (interactive (list (magit-commit-arguments)))
-  (magit-run-git-with-editor "commit" "--amend" args))
-
-;;;###autoload
-(defun magit-commit-extend (&optional args override-date)
-  "Amend the last commit, without editing the message.
-
-With a prefix argument keep the committer date, otherwise change
-it.  The option `magit-commit-extend-override-date' can be used
-to inverse the meaning of the prefix argument.  \n(git commit
---amend --no-edit)"
-  (interactive (list (magit-commit-arguments)
-                     (if current-prefix-arg
-                         (not magit-commit-extend-override-date)
-                       magit-commit-extend-override-date)))
-  (when (setq args (magit-commit-assert args (not override-date)))
-    (let ((process-environment process-environment))
-      (unless override-date
-        (push (magit-rev-format "GIT_COMMITTER_DATE=%cD") process-environment))
-      (magit-run-git-with-editor "commit" "--amend" "--no-edit" args))))
-
-;;;###autoload
-(defun magit-commit-reword (&optional args override-date)
-  "Reword the last commit, ignoring staged changes.
-
-With a prefix argument keep the committer date, otherwise change
-it.  The option `magit-commit-reword-override-date' can be used
-to inverse the meaning of the prefix argument.
-
-Non-interactively respect the optional OVERRIDE-DATE argument
-and ignore the option.
-\n(git commit --amend --only)"
-  (interactive (list (magit-commit-arguments)
-                     (if current-prefix-arg
-                         (not magit-commit-reword-override-date)
-                       magit-commit-reword-override-date)))
-  (let ((process-environment process-environment))
-    (unless override-date
-      (push (magit-rev-format "GIT_COMMITTER_DATE=%cD") process-environment))
-    (magit-run-git-with-editor "commit" "--amend" "--only" args)))
-
-;;;###autoload
-(defun magit-commit-fixup (&optional commit args)
-  "Create a fixup commit.
-
-With a prefix argument the target COMMIT has to be confirmed.
-Otherwise the commit at point may be used without confirmation
-depending on the value of option `magit-commit-squash-confirm'."
-  (interactive (list (magit-commit-at-point)
-                     (magit-commit-arguments)))
-  (magit-commit-squash-internal "--fixup" commit args))
-
-;;;###autoload
-(defun magit-commit-squash (&optional commit args)
-  "Create a squash commit, without editing the squash message.
-
-With a prefix argument the target COMMIT has to be confirmed.
-Otherwise the commit at point may be used without confirmation
-depending on the value of option `magit-commit-squash-confirm'."
-  (interactive (list (magit-commit-at-point)
-                     (magit-commit-arguments)))
-  (magit-commit-squash-internal "--squash" commit args))
-
-;;;###autoload
-(defun magit-commit-augment (&optional commit args)
-  "Create a squash commit, editing the squash message.
-
-With a prefix argument the target COMMIT has to be confirmed.
-Otherwise the commit at point may be used without confirmation
-depending on the value of option `magit-commit-squash-confirm'."
-  (interactive (list (magit-commit-at-point)
-                     (magit-commit-arguments)))
-  (magit-commit-squash-internal "--squash" commit args nil t))
-
-;;;###autoload
-(defun magit-commit-instant-fixup (&optional commit args)
-  "Create a fixup commit targeting COMMIT and instantly rebase."
-  (interactive (list (magit-commit-at-point)
-                     (magit-commit-arguments)))
-  (magit-commit-squash-internal "--fixup" commit args t))
-
-;;;###autoload
-(defun magit-commit-instant-squash (&optional commit args)
-  "Create a squash commit targeting COMMIT and instantly rebase."
-  (interactive (list (magit-commit-at-point)
-                     (magit-commit-arguments)))
-  (magit-commit-squash-internal "--squash" commit args t))
-
-(defun magit-commit-squash-internal
-    (option commit &optional args rebase edit confirmed)
-  (-when-let (args (magit-commit-assert args t))
-    (if (and commit
-             (or confirmed
-                 (not (or rebase
-                          current-prefix-arg
-                          magit-commit-squash-confirm))))
-        (let ((magit-commit-show-diff nil))
-          (push (concat option "=" commit) args)
-          (unless edit
-            (push "--no-edit" args))
-          (if rebase
-              (magit-with-editor
-                (magit-call-git
-                 "commit" "--no-gpg-sign"
-                 (-remove-first
-                  (apply-partially #'string-match-p "\\`--gpg-sign=")
-                  args)))
-            (magit-run-git-with-editor "commit" args)))
-      (magit-log-select
-        `(lambda (commit)
-           (magit-commit-squash-internal ,option commit ',args ,rebase ,edit t)
-           ,@(when rebase
-               `((magit-rebase-interactive-1 commit
-                     (list "--autosquash" "--autostash")
-                   "" "true"))))
-        (format "Type %%p on a commit to %s into it,"
-                (substring option 2)))
-      (when magit-commit-show-diff
-        (let ((magit-display-buffer-noselect t))
-          (apply #'magit-diff-staged nil (magit-diff-arguments)))))))
-
-(defun magit-commit-assert (args &optional strict)
-  (cond
-   ((or (magit-anything-staged-p)
-        (and (magit-anything-unstaged-p)
-             ;; ^ Everything of nothing is still nothing.
-             (member "--all" args))
-        (and (not strict)
-             ;; ^ For amend variants that don't make sense otherwise.
-             (or (member "--amend" args)
-                 (member "--allow-empty" args))))
-    (or args (list "--")))
-   ((and (magit-rebase-in-progress-p)
-         (not (magit-anything-unstaged-p))
-         (y-or-n-p "Nothing staged.  Continue in-progress rebase? "))
-    (magit-run-git-sequencer "rebase" "--continue")
-    nil)
-   ((and (file-exists-p (magit-git-dir "MERGE_MSG"))
-         (not (magit-anything-unstaged-p)))
-    (or args (list "--")))
-   ((not (magit-anything-unstaged-p))
-    (user-error "Nothing staged (or unstaged)"))
-   (magit-commit-ask-to-stage
-    (when (eq magit-commit-ask-to-stage 'verbose)
-      (magit-diff-unstaged))
-    (prog1 (when (y-or-n-p "Nothing staged.  Stage and commit everything? ")
-             (magit-run-git "add" "-u" ".")
-             (or args (list "--")))
-      (when (and (eq magit-commit-ask-to-stage 'verbose)
-                 (derived-mode-p 'magit-diff-mode))
-        (magit-mode-bury-buffer))))
-   (t
-    (user-error "Nothing staged"))))
-
-;;; Pending Diff
-
-(defun magit-commit-diff ()
-  (-when-let (fn (and git-commit-mode
-                      magit-commit-show-diff
-                      (pcase last-command
-                        (`magit-commit
-                         (apply-partially 'magit-diff-staged nil))
-                        (`magit-commit-amend  'magit-diff-while-amending)
-                        (`magit-commit-reword 'magit-diff-while-amending))))
-    (-when-let (diff-buffer (magit-mode-get-buffer 'magit-diff-mode))
-      ;; This window just started displaying the commit message
-      ;; buffer.  Without this that buffer would immediately be
-      ;; replaced with the diff buffer.  See #2632.
-      (unrecord-window-buffer nil diff-buffer))
-    (condition-case nil
-        (let ((magit-inhibit-save-previous-winconf 'unset)
-              (magit-display-buffer-noselect t)
-              (inhibit-quit nil))
-          (message "Diffing changes to be committed (C-g to abort diffing)")
-          (funcall fn (car (magit-diff-arguments))))
-      (quit))))
-
-;; Mention `magit-diff-while-committing' because that's
-;; always what I search for when I try to find this line.
-(add-hook 'server-switch-hook 'magit-commit-diff)
-
-(add-to-list 'with-editor-server-window-alist
-             (cons git-commit-filename-regexp 'switch-to-buffer))
-
-;;; Message Utilities
-
-(defun magit-commit-message-buffer ()
-  (let* ((find-file-visit-truename t) ; git uses truename of COMMIT_EDITMSG
-         (topdir (magit-toplevel)))
-    (--first (equal topdir (with-current-buffer it
-                             (and git-commit-mode (magit-toplevel))))
-             (append (buffer-list (selected-frame))
-                     (buffer-list)))))
-
-(defvar magit-commit-add-log-insert-function 'magit-commit-add-log-insert
-  "Used by `magit-commit-add-log' to insert a single entry.")
-
-(defun magit-commit-add-log ()
-  "Add a stub for the current change into the commit message buffer.
-If no commit is in progress, then initiate it.  Use the function
-specified by variable `magit-commit-add-log-insert-function' to
-actually insert the entry."
-  (interactive)
-  (let ((hunk (magit-section-when 'hunk it))
-        (log (magit-commit-message-buffer)) buf pos)
-    (save-window-excursion
-      (call-interactively #'magit-diff-visit-file)
-      (setq buf (current-buffer))
-      (setq pos (point)))
-    (unless log
-      (unless (magit-commit-assert nil)
-        (user-error "Abort"))
-      (magit-commit)
-      (while (not (setq log (magit-commit-message-buffer)))
-        (sit-for 0.01)))
-    (save-excursion
-      (with-current-buffer buf
-        (goto-char pos)
-        (funcall magit-commit-add-log-insert-function log
-                 (magit-file-relative-name)
-                 (and hunk (add-log-current-defun)))))))
-
-(defun magit-commit-add-log-insert (buffer file defun)
-  (with-current-buffer buffer
-    (undo-boundary)
-    (goto-char (point-max))
-    (while (re-search-backward (concat "^" comment-start) nil t))
-    (cond ((re-search-backward (format "* %s\\(?: (\\([^)]+\\))\\)?: " file)
-                               nil t)
-           (when (equal (match-string 1) defun)
-             (setq defun nil))
-           (re-search-forward ": "))
-          (t
-           (when (re-search-backward "^[\\*(].+\n" nil t)
-             (goto-char (match-end 0)))
-           (while (re-search-forward "^[^\\*#\n].*\n" nil t))
-           (if defun
-               (progn (insert (format "* %s (%s): \n" file defun))
-                      (setq defun nil))
-             (insert (format "* %s: \n" file)))
-           (backward-char)
-           (unless (looking-at "\n[\n\\']")
-             (insert ?\n)
-             (backward-char))))
-    (when defun
-      (forward-line)
-      (let ((limit (save-excursion
-                     (and (re-search-forward "^\\*" nil t)
-                          (point)))))
-        (unless (or (looking-back (format "(%s): " defun)
-                                  (line-beginning-position))
-                    (re-search-forward (format "^(%s): " defun) limit t))
-          (while (re-search-forward "^[^\\*#\n].*\n" limit t))
-          (insert (format "(%s): \n" defun))
-          (backward-char))))))
-
-(provide 'magit-commit)
-;;; magit-commit.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-commit.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-core.el
@@ -1,132 +0,0 @@
-;;; magit-core.el --- core functionality  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library requires several other libraries, so that yet other
-;; libraries can just require this one, instead of having to require
-;; all the other ones.  In other words this separates the low-level
-;; stuff from the rest.  It also defines some Custom groups.
-
-;;; Code:
-
-(require 'magit-popup)
-(require 'magit-utils)
-(require 'magit-section)
-(require 'magit-git)
-(require 'magit-mode)
-(require 'magit-margin)
-(require 'magit-process)
-(require 'magit-autorevert)
-
-(defgroup magit nil
-  "Controlling Git from Emacs."
-  :link '(url-link "https://magit.vc")
-  :link '(info-link "(magit)FAQ")
-  :link '(info-link "(magit)")
-  :group 'tools)
-
-(defgroup magit-essentials nil
-  "Options that every Magit user should briefly think about.
-
-Each of these options falls into one or more of these categories:
-
-* Options that affect Magit's behavior in fundamental ways.
-* Options that affect safety.
-* Options that affect performance.
-* Options that are of a personal nature."
-  :link '(info-link "(magit)Essential Settings")
-  :group 'magit)
-
-(defgroup magit-miscellaneous nil
-  "Miscellanous Magit options."
-  :group 'magit)
-
-(defgroup magit-commands nil
-  "Options controlling behavior of certain commands."
-  :group 'magit)
-
-(defgroup magit-git-arguments nil
-  "Options controlling what arguments are passed to Git.
-
-Most of these options can be set using the respective popup,
-and it is recommended that you do that because then you can
-be certain that Magit supports the arguments that you select.
-
-An option `magit-NAME-argument' specifies the arguments that
-are enabled by default by the popup `magit-NAME-popup'."
-  :link '(info-link "(magit-popup)Customizing Existing Popups")
-  :link '(info-link "(magit-popup)Usage")
-  :group 'magit-commands)
-
-(defgroup magit-modes nil
-  "Modes used or provided by Magit."
-  :group 'magit)
-
-(defgroup magit-buffers nil
-  "Options concerning Magit buffers."
-  :link '(info-link "(magit)Modes and Buffers")
-  :group 'magit)
-
-(defgroup magit-refresh nil
-  "Options controlling how Magit buffers are refreshed."
-  :link '(info-link "(magit)Automatic Refreshing of Magit Buffers")
-  :group 'magit
-  :group 'magit-buffers)
-
-(defgroup magit-faces nil
-  "Faces used by Magit."
-  :group 'magit
-  :group 'faces)
-
-(defgroup magit-extensions nil
-  "Extensions to Magit."
-  :group 'magit)
-
-(custom-add-to-group 'magit-modes   'magit-popup       'custom-group)
-(custom-add-to-group 'magit-faces   'magit-popup-faces 'custom-group)
-(custom-add-to-group 'magit-modes   'git-commit        'custom-group)
-(custom-add-to-group 'magit-faces   'git-commit-faces  'custom-group)
-(custom-add-to-group 'magit-modes   'git-rebase        'custom-group)
-(custom-add-to-group 'magit-faces   'git-rebase-faces  'custom-group)
-(custom-add-to-group 'magit-process 'with-editor       'custom-group)
-
-(defgroup magit-related nil
-  "Options that are relevant to Magit but that are defined elsewhere."
-  :link '(custom-group-link vc)
-  :link '(custom-group-link smerge)
-  :link '(custom-group-link ediff)
-  :link '(custom-group-link auto-revert)
-  :group 'magit
-  :group 'magit-extensions
-  :group 'magit-essentials)
-
-(custom-add-to-group 'magit-related     'auto-revert-check-vc-info 'custom-variable)
-(custom-add-to-group 'magit-auto-revert 'auto-revert-check-vc-info 'custom-variable)
-
-(custom-add-to-group 'magit-related 'ediff-window-setup-function 'custom-variable)
-(custom-add-to-group 'magit-related 'smerge-refine-ignore-whitespace 'custom-variable)
-(custom-add-to-group 'magit-related 'vc-follow-symlinks 'custom-variable)
-
-(provide 'magit-core)
-;;; magit-core.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-core.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-diff.el
@@ -1,2490 +0,0 @@
-;;; magit-diff.el --- inspect Git diffs  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements support for looking at Git diffs and
-;; commits.
-
-;;; Code:
-
-(require 'git-commit)
-(require 'magit-core)
-
-;; For `magit-diff-popup'
-(declare-function magit-stash-show 'magit-stash)
-;; For `magit-diff-visit-file'
-(declare-function dired-jump 'dired-x)
-(declare-function magit-find-file-noselect 'magit)
-(declare-function magit-status-internal 'magit)
-;; For `magit-diff-while-committing'
-(declare-function magit-commit-message-buffer 'magit)
-;; For `magit-insert-revision-gravatar'
-(defvar gravatar-size)
-;; For `magit-show-commit' and `magit-diff-show-or-scroll'
-(declare-function magit-blame-chunk-get 'magit-blame)
-(declare-function magit-blame-mode 'magit-blame)
-(defvar magit-blame-mode)
-(defvar git-rebase-line)
-
-(require 'diff-mode)
-(require 'smerge-mode)
-
-(defvar bookmark-make-record-function)
-
-;;; Options
-;;;; Diff Mode
-
-(defgroup magit-diff nil
-  "Inspect and manipulate Git diffs."
-  :link '(info-link "(magit)Diffing")
-  :group 'magit-modes)
-
-(defcustom magit-diff-mode-hook nil
-  "Hook run after entering Magit-Diff mode."
-  :group 'magit-diff
-  :type 'hook)
-
-(defcustom magit-diff-arguments '("--stat" "--no-ext-diff")
-  "The diff arguments used in buffers whose mode derives from `magit-diff-mode'."
-  :group 'magit-git-arguments
-  :group 'magit-diff
-  :type '(repeat (string :tag "Argument")))
-
-(defcustom magit-diff-sections-hook
-  '(magit-insert-diff
-    magit-insert-xref-buttons)
-  "Hook run to insert sections into a `magit-diff-mode' buffer."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-diff
-  :type 'hook)
-
-(defcustom magit-diff-expansion-threshold 60
-  "After how many seconds not to expand anymore diffs.
-
-Except in status buffers, diffs are usually start out fully
-expanded.  Because that can take a long time, all diffs that
-haven't been fontified during a refresh before the threshold
-defined here are instead displayed with their bodies collapsed.
-
-Note that this can cause sections that were previously expanded
-to be collapsed.  So you should not pick a very low value here.
-
-The hook function `magit-diff-expansion-threshold' has to be a
-member of `magit-section-set-visibility-hook' for this option
-to have any effect."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-diff
-  :type 'float)
-
-(defcustom magit-diff-highlight-hunk-body t
-  "Whether to highlight bodies of selected hunk sections.
-This only has an effect if `magit-diff-highlight' is a
-member of `magit-section-highlight-hook', which see."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-diff
-  :type 'boolean)
-
-(defcustom magit-diff-show-lines-boundary t
-  "This option is obsolete.
-If you have set this to nil, then remove that customization, and
-instead customize `magit-diff-highlight-hunk-region-functions'."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-diff
-  :type 'boolean)
-
-(defcustom magit-diff-highlight-hunk-region-functions
-  '(magit-diff-highlight-hunk-region-dim-outside
-    magit-diff-highlight-hunk-region-using-overlays)
-  "The functions used to highlight the hunk-internal region.
-
-`magit-diff-highlight-hunk-region-dim-outside' overlays the outside
-of the hunk internal selection with a face that causes the added and
-removed lines to have the same background color as context lines.
-This function should not be removed from the value of this option.
-
-`magit-diff-highlight-hunk-region-using-overlays' and
-`magit-diff-highlight-hunk-region-using-underline' emphasize the
-region by placing delimiting horizonal lines before and after it.
-Both of these functions have glitches which cannot be fixed due
-to limitations of Emacs' display engine.  For more information
-see https://github.com/magit/magit/issues/2758 ff.
-
-Instead of, or in addition to, using delimiting horizontal lines,
-to emphasize the boundaries, you may which to emphasize the text
-itself, using `magit-diff-highlight-hunk-region-using-face'.
-
-In terminal frames it's not possible to draw lines as the overlay
-and underline variants normally do, so there they fall back to
-calling the face function instead."
-  :package-version '(magit . "2.9.0")
-  :set-after '(magit-diff-show-lines-boundaries)
-  :group 'magit-diff
-  :type 'hook
-  :options '(magit-diff-highlight-hunk-region-dim-outside
-             magit-diff-highlight-hunk-region-using-underline
-             magit-diff-highlight-hunk-region-using-overlays
-             magit-diff-highlight-hunk-region-using-face))
-
-(defcustom magit-diff-unmarked-lines-keep-foreground t
-  "Whether `magit-diff-highlight-hunk-region-dim-outside' preserves foreground.
-When this is set to nil, then that function only adjusts the
-foreground color but added and removed lines outside the region
-keep their distinct foreground colors."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-diff
-  :type 'boolean)
-
-(defcustom magit-diff-refine-hunk nil
-  "Whether to show word-granularity differences within diff hunks.
-
-nil    never show fine differences.
-t      show fine differences for the current diff hunk only.
-`all'  show fine differences for all displayed diff hunks."
-  :group 'magit-diff
-  :safe (lambda (val) (memq val '(nil t all)))
-  :type '(choice (const :tag "Never" nil)
-                 (const :tag "Current" t)
-                 (const :tag "All" all)))
-
-(put 'magit-diff-refine-hunk 'permanent-local t)
-
-(defcustom magit-diff-paint-whitespace t
-  "Specify where to highlight whitespace errors.
-See `magit-diff-highlight-trailing',
-`magit-diff-highlight-indentation'.  The symbol t means in all
-diffs, `status' means only in the status buffer, and nil means
-nowhere."
-  :group 'magit-diff
-  :safe (lambda (val) (memq val '(t nil status)))
-  :type '(choice (const :tag "Always" t)
-                 (const :tag "Never" nil)
-                 (const :tag "In status buffer" status)))
-
-(defcustom magit-diff-highlight-trailing t
-  "Whether to highlight whitespace at the end of a line in diffs.
-Used only when `magit-diff-paint-whitespace' is non-nil."
-  :group 'magit-diff
-  :safe 'booleanp
-  :type 'boolean)
-
-(defcustom magit-diff-highlight-indentation nil
-  "Highlight the \"wrong\" indentation style.
-Used only when `magit-diff-paint-whitespace' is non-nil.
-
-The value is a list of cons cells.  The car is a regular
-expression, and the cdr is the value that applies to repositories
-whose directory matches the regular expression.  If more than one
-element matches, then the *last* element in the list applies.
-The default value should therefore come first in the list.
-
-If the value is `tabs', highlight indentation with tabs.  If the
-value is an integer, highlight indentation with at least that
-many spaces.  Otherwise, highlight neither."
-  :group 'magit-diff
-  :type `(repeat (cons (string :tag "Directory regexp")
-                       (choice (const :tag "Tabs" tabs)
-                               (integer :tag "Spaces" :value ,tab-width)
-                               (const :tag "Neither" nil)))))
-
-(defcustom magit-diff-hide-trailing-cr-characters
-  (and (memq system-type '(ms-dos windows-nt)) t)
-  "Whether to hide ^M characters at the end of a line in diffs."
-  :package-version '(magit . "2.6.0")
-  :group 'magit-diff
-  :type 'boolean)
-
-(defcustom magit-diff-visit-previous-blob t
-  "Whether `magit-diff-visit-file' may visit the previous blob.
-
-When this is t and point is on a removed line in a diff for a
-committed change, then `magit-diff-visit-file' visits the blob
-from the last revision which still had that line.
-
-Currently this is only supported for committed changes, for
-staged and unstaged changes `magit-diff-visit-file' always
-visits the file in the working tree."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-diff
-  :type 'boolean)
-
-;;;; File Diff
-
-(defcustom magit-diff-buffer-file-locked t
-  "Whether `magit-diff-buffer-file' uses a dedicated buffer."
-  :package-version '(magit . "2.7.0")
-  :group 'magit-commands
-  :group 'magit-diff
-  :type 'boolean)
-
-;;;; Revision Mode
-
-(defgroup magit-revision nil
-  "Inspect and manipulate Git commits."
-  :link '(info-link "(magit)Revision Buffer")
-  :group 'magit-modes)
-
-(defcustom magit-revision-mode-hook '(bug-reference-mode)
-  "Hook run after entering Magit-Revision mode."
-  :group 'magit-revision
-  :type 'hook
-  :options '(bug-reference-mode))
-
-(defcustom magit-revision-sections-hook
-  '(magit-insert-revision-tag
-    magit-insert-revision-headers
-    magit-insert-revision-message
-    magit-insert-revision-notes
-    magit-insert-revision-diff
-    magit-insert-xref-buttons)
-  "Hook run to insert sections into a `magit-revision-mode' buffer."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-revision
-  :type 'hook)
-
-(defcustom magit-revision-headers-format "\
-Author:     %aN <%aE>
-AuthorDate: %ad
-Commit:     %cN <%cE>
-CommitDate: %cd
-"
-  "Format string used to insert headers in revision buffers.
-
-All headers in revision buffers are inserted by the section
-inserter `magit-insert-revision-headers'.  Some of the headers
-are created by calling `git show --format=FORMAT' where FORMAT
-is the format specified here.  Other headers are hard coded or
-subject to option `magit-revision-insert-related-refs'."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-revision
-  :type 'string)
-
-(defcustom magit-revision-insert-related-refs t
-  "Whether to show related refs in revision buffers."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-revision
-  :type 'boolean)
-
-(defcustom magit-revision-show-gravatars nil
-  "Whether to show gravatar images in revision buffers.
-
-If non-nil, then the value has to be a cons-cell which specifies
-where the gravatar images for the author and/or the committer are
-inserted inside the text that was previously inserted according
-to `magit-revision-header-format'.
-
-Both cells are regular expressions.  The car specifies where to
-insert the author gravatar image.  The top half of the image is
-inserted right after the matched text, the bottom half on the
-next line at the same offset.  The cdr specifies where to insert
-the committer image, accordingly.  Either the car or the cdr may
-be nil."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-revision
-  :type '(choice (const :tag "Don't show gravatars" nil)
-                 (cons  :tag "Show gravatars"
-                        (regexp :tag "Author regexp"    "^Author:     ")
-                        (regexp :tag "Committer regexp" "^Commit:     "))))
-
-(defcustom magit-revision-use-gravatar-kludge nil
-  "Whether to work around a bug which affects display of gravatars.
-
-Gravatar images are spliced into two halves which are then
-displayed on separate lines.  On OS X the splicing has a bug in
-some Emacs builds, which causes the top and bottom halves to be
-interchanged.  Enabling this option works around this issue by
-interchanging the halves once more, which cancels out the effect
-of the bug.
-
-See https://github.com/magit/magit/issues/2265
-and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=7847."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-revision
-  :type 'boolean)
-
-;;;; Diff Sections
-
-(defcustom magit-diff-section-arguments '("--no-ext-diff")
-  "The diff arguments used in buffers that show other things besides diffs."
-  :group 'magit-git-arguments
-  :group 'magit-diff
-  :group 'magit-status
-  :type '(repeat (string :tag "Argument")))
-
-;;; Faces
-
-(defface magit-diff-file-heading
-  '((t :weight bold))
-  "Face for diff file headings."
-  :group 'magit-faces)
-
-(defface magit-diff-file-heading-highlight
-  '((t :inherit (magit-section-highlight)))
-  "Face for current diff file headings."
-  :group 'magit-faces)
-
-(defface magit-diff-file-heading-selection
-  '((((class color) (background light))
-     :inherit magit-diff-file-heading-highlight
-     :foreground "salmon4")
-    (((class color) (background dark))
-     :inherit magit-diff-file-heading-highlight
-     :foreground "LightSalmon3"))
-  "Face for selected diff file headings."
-  :group 'magit-faces)
-
-(defface magit-diff-hunk-heading
-  '((((class color) (background light))
-     :background "grey80"
-     :foreground "grey30")
-    (((class color) (background dark))
-     :background "grey25"
-     :foreground "grey70"))
-  "Face for diff hunk headings."
-  :group 'magit-faces)
-
-(defface magit-diff-hunk-heading-highlight
-  '((((class color) (background light))
-     :background "grey75"
-     :foreground "grey30")
-    (((class color) (background dark))
-     :background "grey35"
-     :foreground "grey70"))
-  "Face for current diff hunk headings."
-  :group 'magit-faces)
-
-(defface magit-diff-hunk-heading-selection
-  '((((class color) (background light))
-     :inherit magit-diff-hunk-heading-highlight
-     :foreground "salmon4")
-    (((class color) (background dark))
-     :inherit magit-diff-hunk-heading-highlight
-     :foreground "LightSalmon3"))
-  "Face for selected diff hunk headings."
-  :group 'magit-faces)
-
-(defface magit-diff-hunk-region
-  '((t :inherit bold))
-  "Face used by `magit-diff-highlight-hunk-region-using-face'.
-
-This face is overlayed over text that uses other hunk faces,
-and those normally set the foreground and background colors.
-The `:foreground' and especially the `:background' properties
-should be avoided here.  Setting the latter would cause the
-lose of information.  Good properties to set here are `:weight'
-and `:slant'."
-  :group 'magit-faces)
-
-(defface magit-diff-lines-heading
-  '((((class color) (background light))
-     :inherit magit-diff-hunk-heading-highlight
-     :background "LightSalmon3")
-    (((class color) (background dark))
-     :inherit magit-diff-hunk-heading-highlight
-     :foreground "grey80"
-     :background "salmon4"))
-  "Face for diff hunk heading when lines are marked."
-  :group 'magit-faces)
-
-(defface magit-diff-lines-boundary
-  '((t :inherit magit-diff-lines-heading))
-  "Face for boundary of marked lines in diff hunk."
-  :group 'magit-faces)
-
-(defface magit-diff-conflict-heading
-  '((t :inherit magit-diff-hunk-heading))
-  "Face for conflict markers."
-  :group 'magit-faces)
-
-(defface magit-diff-added
-  '((((class color) (background light))
-     :background "#ddffdd"
-     :foreground "#22aa22")
-    (((class color) (background dark))
-     :background "#335533"
-     :foreground "#ddffdd"))
-  "Face for lines in a diff that have been added."
-  :group 'magit-faces)
-
-(defface magit-diff-removed
- '((((class color) (background light))
-    :background "#ffdddd"
-    :foreground "#aa2222")
-   (((class color) (background dark))
-    :background "#553333"
-    :foreground "#ffdddd"))
-  "Face for lines in a diff that have been removed."
-  :group 'magit-faces)
-
-(defface magit-diff-our
-  '((t :inherit magit-diff-removed))
-  "Face for lines in a diff for our side in a conflict."
-  :group 'magit-faces)
-
-(defface magit-diff-base
-  '((((class color) (background light))
-     :background "#ffffcc"
-     :foreground "#aaaa11")
-    (((class color) (background dark))
-     :background "#555522"
-     :foreground "#ffffcc"))
-  "Face for lines in a diff for the base side in a conflict."
-  :group 'magit-faces)
-
-(defface magit-diff-their
-  '((t :inherit magit-diff-added))
-  "Face for lines in a diff for their side in a conflict."
-  :group 'magit-faces)
-
-(defface magit-diff-context
-  '((((class color) (background light)) :foreground "grey50")
-    (((class color) (background  dark)) :foreground "grey70"))
-  "Face for lines in a diff that are unchanged."
-  :group 'magit-faces)
-
-(defface magit-diff-added-highlight
-  '((((class color) (background light))
-     :background "#cceecc"
-     :foreground "#22aa22")
-    (((class color) (background dark))
-     :background "#336633"
-     :foreground "#cceecc"))
-  "Face for lines in a diff that have been added."
-  :group 'magit-faces)
-
-(defface magit-diff-removed-highlight
-  '((((class color) (background light))
-     :background "#eecccc"
-     :foreground "#aa2222")
-    (((class color) (background dark))
-     :background "#663333"
-     :foreground "#eecccc"))
-  "Face for lines in a diff that have been removed."
-  :group 'magit-faces)
-
-(defface magit-diff-our-highlight
-  '((t :inherit magit-diff-removed-highlight))
-  "Face for lines in a diff for our side in a conflict."
-  :group 'magit-faces)
-
-(defface magit-diff-base-highlight
-  '((((class color) (background light))
-     :background "#eeeebb"
-     :foreground "#aaaa11")
-    (((class color) (background dark))
-     :background "#666622"
-     :foreground "#eeeebb"))
-  "Face for lines in a diff for the base side in a conflict."
-  :group 'magit-faces)
-
-(defface magit-diff-their-highlight
-  '((t :inherit magit-diff-added-highlight))
-  "Face for lines in a diff for their side in a conflict."
-  :group 'magit-faces)
-
-(defface magit-diff-context-highlight
-  '((((class color) (background light))
-     :background "grey95"
-     :foreground "grey50")
-    (((class color) (background dark))
-     :background "grey20"
-     :foreground "grey70"))
-  "Face for lines in a diff that have been removed."
-  :group 'magit-faces)
-
-(defface magit-diff-whitespace-warning
-  '((t :inherit trailing-whitespace))
-  "Face for highlighting whitespace errors added lines."
-  :group 'magit-faces)
-
-(defface magit-diffstat-added
-  '((((class color) (background light)) :foreground "#22aa22")
-    (((class color) (background  dark)) :foreground "#448844"))
-  "Face for plus sign in diffstat."
-  :group 'magit-faces)
-
-(defface magit-diffstat-removed
-  '((((class color) (background light)) :foreground "#aa2222")
-    (((class color) (background  dark)) :foreground "#aa4444"))
-  "Face for minus sign in diffstat."
-  :group 'magit-faces)
-
-;;; Commands
-;;;; Diff popups
-
-(defconst magit-diff-popup-common
-  '(:variable magit-diff-arguments
-    :man-page "git-diff"
-    :options  ((?f "Limit to files" "-- " magit-read-files)
-               (?u "Context lines"  "-U")
-               (?m "Detect renames" "-M")
-               (?c "Detect copies"  "-C")
-               (?a "Diff algorithm" "--diff-algorithm="
-                   magit-diff-select-algorithm))))
-
-(defvar magit-diff-popup
-  `(,@magit-diff-popup-common
-    :switches ((?f "Show surrounding functions"     "--function-context")
-               (?b "Ignore whitespace changes"      "--ignore-space-change")
-               (?w "Ignore all whitespace"          "--ignore-all-space")
-               (?x "Disallow external diff drivers" "--no-ext-diff")
-               (?s "Show stats"                     "--stat"))
-    :actions  ((?d "Dwim"          magit-diff-dwim)
-               (?u "Diff unstaged" magit-diff-unstaged)
-               (?c "Show commit"   magit-show-commit)
-               (?r "Diff range"    magit-diff)
-               (?s "Diff staged"   magit-diff-staged)
-               (?t "Show stash"    magit-stash-show)
-               (?p "Diff paths"    magit-diff-paths)
-               (?w "Diff worktree" magit-diff-working-tree))
-    :default-action magit-diff-dwim
-    :max-action-columns 3))
-
-(defvar magit-diff-refresh-popup
-  `(,@magit-diff-popup-common
-    :switches ((?f "Show surrounding functions"     "--function-context")
-               (?b "Ignore whitespace changes"      "--ignore-space-change")
-               (?w "Ignore all whitespace"          "--ignore-all-space")
-               (?x "Disallow external diff drivers" "--no-ext-diff"))
-    :actions  ((?g "Refresh"                magit-diff-refresh)
-               (?t "Toggle hunk refinement" magit-diff-toggle-refine-hunk)
-               (?s "Set defaults"           magit-diff-set-default-arguments)
-               (?F "Toggle file filter"     magit-diff-toggle-file-filter)
-               (?w "Save defaults"          magit-diff-save-default-arguments))
-    :max-action-columns 2))
-
-(defvar magit-diff-mode-refresh-popup
-  `(,@magit-diff-popup-common
-    :switches ((?f "Show surrounding functions"     "--function-context")
-               (?b "Ignore whitespace changes"      "--ignore-space-change")
-               (?w "Ignore all whitespace"          "--ignore-all-space")
-               (?x "Disallow external diff drivers" "--no-ext-diff")
-               (?s "Show stats"                     "--stat"))
-    :actions  ((?g "Refresh"                magit-diff-refresh)
-               (?t "Toggle hunk refinement" magit-diff-toggle-refine-hunk)
-               (?s "Set defaults"           magit-diff-set-default-arguments)
-               (?r "Switch range type"      magit-diff-switch-range-type)
-               (?w "Save defaults"          magit-diff-save-default-arguments)
-               (?f "Flip revisions"         magit-diff-flip-revs) nil
-               (?F "Toggle file filter"     magit-diff-toggle-file-filter))
-    :max-action-columns 2))
-
-(defvar magit-revision-mode-refresh-popup
-  `(,@magit-diff-popup-common
-    :switches ((?f "Show surrounding functions"     "--function-context")
-               (?b "Ignore whitespace changes"      "--ignore-space-change")
-               (?w "Ignore all whitespace"          "--ignore-all-space")
-               (?x "Disallow external diff drivers" "--no-ext-diff")
-               (?s "Show stats"                     "--stat"))
-    :actions  ((?g "Refresh"                magit-diff-refresh)
-               (?t "Toggle hunk refinement" magit-diff-toggle-refine-hunk)
-               (?s "Set defaults"           magit-diff-set-default-arguments)
-               (?F "Toggle file filter"     magit-diff-toggle-file-filter)
-               (?w "Save defaults"          magit-diff-save-default-arguments))
-    :max-action-columns 2))
-
-(magit-define-popup-keys-deferred 'magit-diff-popup)
-(magit-define-popup-keys-deferred 'magit-diff-refresh-popup)
-(magit-define-popup-keys-deferred 'magit-diff-mode-refresh-popup)
-(magit-define-popup-keys-deferred 'magit-revision-mode-refresh-popup)
-
-(defvar magit-diff-section-file-args nil)
-(put 'magit-diff-section-file-args 'permanent-local t)
-(put 'magit-diff-section-arguments 'permanent-local t)
-
-(defun magit-diff-get-buffer-args ()
-  (cond ((and magit-use-sticky-arguments
-              (derived-mode-p 'magit-diff-mode))
-         (list (nth 2 magit-refresh-args)
-               (nth 3 magit-refresh-args)))
-        ((and (eq magit-use-sticky-arguments t)
-              (--when-let (magit-mode-get-buffer 'magit-diff-mode)
-                (with-current-buffer it
-                  (list (nth 2 magit-refresh-args)
-                        (nth 3 magit-refresh-args))))))
-        (t
-         (list (default-value 'magit-diff-arguments) nil))))
-
-(defun magit-diff-arguments (&optional refresh)
-  (cond ((memq magit-current-popup '(magit-diff-popup magit-diff-refresh-popup))
-         (magit-popup-export-file-args magit-current-popup-args))
-        ((and refresh (not (derived-mode-p 'magit-diff-mode)))
-         (list magit-diff-section-arguments
-               magit-diff-section-file-args))
-        (t
-         (magit-diff-get-buffer-args))))
-
-;;;###autoload
-(defun magit-diff-popup (arg)
-  "Popup console for diff commands."
-  (interactive "P")
-  (let ((magit-diff-arguments
-         ;; We cannot possibly know what suffix command the user is
-         ;; about to invoke, so we also don't know from which buffer
-         ;; we should get the current values.  However it is much
-         ;; more likely that we will end up updating the diff buffer,
-         ;; and we therefore use the value from that buffer.
-         (apply #'magit-popup-import-file-args (magit-diff-get-buffer-args))))
-    (magit-invoke-popup 'magit-diff-popup nil arg)))
-
-;;;###autoload
-(defun magit-diff-buffer-file-popup ()
-  "Popup console for diff commands.
-
-This is a variant of `magit-diff-popup' which shows the same popup
-but which limits the diff to the file being visited in the current
-buffer."
-  (interactive)
-  (-if-let (file (magit-file-relative-name))
-      (let ((magit-diff-arguments
-             (magit-popup-import-file-args
-              (-if-let (buffer (magit-mode-get-buffer 'magit-diff-mode))
-                  (with-current-buffer buffer
-                    (nth 3 magit-refresh-args))
-                (default-value 'magit-diff-arguments))
-              (list file))))
-        (magit-invoke-popup 'magit-diff-popup nil nil))
-    (user-error "Buffer isn't visiting a file")))
-
-(defun magit-diff-refresh-popup (arg)
-  "Popup console for changing diff arguments in the current buffer."
-  (interactive "P")
-  (let ((magit-diff-refresh-popup
-         (pcase major-mode
-           (`magit-revision-mode magit-revision-mode-refresh-popup)
-           (`magit-diff-mode     magit-diff-mode-refresh-popup)
-           (_                    magit-diff-refresh-popup)))
-        (magit-diff-arguments
-         (if (derived-mode-p 'magit-diff-mode)
-             (magit-popup-import-file-args (nth 2 magit-refresh-args)
-                                           (nth 3 magit-refresh-args))
-           (magit-popup-import-file-args magit-diff-section-arguments
-                                         magit-diff-section-file-args))))
-    (magit-invoke-popup 'magit-diff-refresh-popup nil arg)))
-
-(defun magit-diff-select-algorithm (&rest _ignore)
-  (magit-read-char-case nil t
-    (?d "[d]efault"   "default")
-    (?m "[m]inimal"   "minimal")
-    (?p "[p]atience"  "patience")
-    (?h "[h]istogram" "histogram")))
-
-;;;; Diff commands
-
-;;;###autoload
-(defun magit-diff-dwim (&optional args files)
-  "Show changes for the thing at point."
-  (interactive (magit-diff-arguments))
-  (pcase (magit-diff--dwim)
-    (`unstaged (magit-diff-unstaged args files))
-    (`staged (magit-diff-staged nil args files))
-    (`(commit . ,value)
-     (magit-diff (format "%s^..%s" value value) args files))
-    (`(stash  . ,value) (magit-stash-show value args))
-    ((and range (pred stringp))
-     (magit-diff range args files))
-    (_
-     (call-interactively #'magit-diff))))
-
-(defun magit-diff--dwim ()
-  "Return information for performing DWIM diff.
-
-The information can be in three forms:
-1. TYPE
-   A symbol describing a type of diff where no additional information
-   is needed to generate the diff.  Currently, this includes `staged'
-   and `unstaged'.
-2. (TYPE . VALUE)
-   Like #1 but the diff requires additional information, which is
-   given by VALUE.  Currently, this includes `commit' and `stash',
-   where VALUE is the given commit or stash, respectively.
-3. RANGE
-   A string indicating a diff range.
-
-If no DWIM context is found, nil is returned."
-  (cond
-   ((--when-let (magit-region-values 'commit 'branch)
-      (deactivate-mark)
-      (concat (car (last it)) ".." (car it))))
-   (magit-buffer-refname
-    (cons 'commit magit-buffer-refname))
-   ((derived-mode-p 'magit-stash-mode)
-    (cons 'commit
-          (magit-section-case
-            (commit (magit-section-value it))
-            (file (-> it
-                      magit-section-parent
-                      magit-section-value))
-            (hunk (-> it
-                      magit-section-parent
-                      magit-section-parent
-                      magit-section-value)))))
-   ((derived-mode-p 'magit-revision-mode)
-    (cons 'commit (car magit-refresh-args)))
-   ((derived-mode-p 'magit-diff-mode)
-    (nth 0 magit-refresh-args))
-   (t
-    (magit-section-case
-      ([* unstaged] 'unstaged)
-      ([* staged] 'staged)
-      (unpushed (magit-section-value it))
-      (unpulled (magit-section-value it))
-      (branch (let ((current (magit-get-current-branch))
-                    (atpoint (magit-section-value it)))
-                (if (equal atpoint current)
-                    (--if-let (magit-get-upstream-branch)
-                        (format "%s...%s" it current)
-                      (if (magit-anything-modified-p)
-                          current
-                        (cons 'commit current)))
-                  (format "%s...%s"
-                          (or current "HEAD")
-                          atpoint))))
-      (commit (cons 'commit (magit-section-value it)))
-      (stash (cons 'stash (magit-section-value it)))))))
-
-(defun magit-diff-read-range-or-commit (prompt &optional secondary-default mbase)
-  "Read range or revision with special diff range treatment.
-If MBASE is non-nil, prompt for which rev to place at the end of
-a \"revA...revB\" range.  Otherwise, always construct
-\"revA..revB\" range."
-  (--if-let (magit-region-values 'commit 'branch)
-      (let ((revA (car (last it)))
-            (revB (car it)))
-        (deactivate-mark)
-        (if mbase
-            (let ((base (magit-git-string "merge-base" revA revB)))
-              (cond
-               ((string= (magit-rev-parse revA) base)
-                (format "%s..%s" revA revB))
-               ((string= (magit-rev-parse revB) base)
-                (format "%s..%s" revB revA))
-               (t
-                (let ((main (magit-completing-read "View changes along"
-                                                   (list revA revB)
-                                                   nil t nil nil revB)))
-                  (format "%s...%s"
-                          (if (string= main revB) revA revB) main)))))
-          (format "%s..%s" revA revB)))
-    (magit-read-range prompt
-                      (or (pcase (magit-diff--dwim)
-                            (`(commit . ,value)
-                             (format "%s^..%s" value value))
-                            ((and range (pred stringp))
-                             range))
-                          secondary-default
-                          (magit-get-current-branch)))))
-
-(defun magit-diff-setup (rev-or-range const args files)
-  (require 'magit)
-  (magit-mode-setup #'magit-diff-mode rev-or-range const args files))
-
-;;;###autoload
-(defun magit-diff (rev-or-range &optional args files)
-  "Show differences between two commits.
-
-REV-OR-RANGE should be a range or a single revision.  If it is a
-revision, then show changes in the working tree relative to that
-revision.  If it is a range, but one side is omitted, then show
-changes relative to `HEAD'.
-
-If the region is active, use the revisions on the first and last
-line of the region as the two sides of the range.  With a prefix
-argument, instead of diffing the revisions, choose a revision to
-view changes along, starting at the common ancestor of both
-revisions (i.e., use a \"...\" range)."
-  (interactive (cons (magit-diff-read-range-or-commit "Diff for range"
-                                                      nil current-prefix-arg)
-                     (magit-diff-arguments)))
-  (magit-diff-setup rev-or-range nil args files))
-
-;;;###autoload
-(defun magit-diff-working-tree (&optional rev args files)
-  "Show changes between the current working tree and the `HEAD' commit.
-With a prefix argument show changes between the working tree and
-a commit read from the minibuffer."
-  (interactive
-   (cons (and current-prefix-arg
-              (magit-read-branch-or-commit "Diff working tree and commit"))
-         (magit-diff-arguments)))
-  (magit-diff-setup (or rev "HEAD") nil args files))
-
-;;;###autoload
-(defun magit-diff-staged (&optional rev args files)
-  "Show changes between the index and the `HEAD' commit.
-With a prefix argument show changes between the index and
-a commit read from the minibuffer."
-  (interactive
-   (cons (and current-prefix-arg
-              (magit-read-branch-or-commit "Diff index and commit"))
-         (magit-diff-arguments)))
-  (magit-diff-setup rev (list "--cached") args files))
-
-;;;###autoload
-(defun magit-diff-unstaged (&optional args files)
-  "Show changes between the working tree and the index."
-  (interactive (magit-diff-arguments))
-  (magit-diff-setup nil nil args files))
-
-;;;###autoload
-(defun magit-diff-while-committing (&optional args files)
-  "While committing, show the changes that are about to be committed.
-While amending, invoking the command again toggles between
-showing just the new changes or all the changes that will
-be committed."
-  (interactive (magit-diff-arguments))
-  (let ((toplevel (magit-toplevel))
-        (diff-buf (magit-mode-get-buffer 'magit-diff-mode)))
-    (if (magit-commit-message-buffer)
-        (if (and (or ;; most likely an explicit amend
-                     (not (magit-anything-staged-p))
-                     ;; explicitly toggled from within diff
-                     (and (eq (current-buffer) diff-buf)))
-                 (or (not diff-buf)
-                     (with-current-buffer diff-buf
-                       (or ;; default to include last commit
-                           (not (equal (magit-toplevel) toplevel))
-                           ;; toggle to include last commit
-                           (not (car magit-refresh-args))))))
-            (magit-diff-while-amending args files)
-          (magit-diff-staged nil args files))
-      (user-error "No commit in progress"))))
-
-(define-key git-commit-mode-map
-  (kbd "C-c C-d") 'magit-diff-while-committing)
-
-(defun magit-diff-while-amending (&optional args files)
-  (magit-diff-setup "HEAD^" (list "--cached") args files))
-
-;;;###autoload
-(defun magit-diff-buffer-file ()
-  "Show diff for the blob or file visited in the current buffer."
-  (interactive)
-  (require 'magit)
-  (-if-let (file (magit-file-relative-name))
-      (magit-mode-setup-internal #'magit-diff-mode
-                                 (list (or magit-buffer-refname
-                                           (magit-get-current-branch)
-                                           "HEAD")
-                                       nil
-                                       (cadr (magit-diff-arguments))
-                                       (list file))
-                                 magit-diff-buffer-file-locked)
-    (user-error "Buffer isn't visiting a file")))
-
-;;;###autoload
-(defun magit-diff-paths (a b)
-  "Show changes between any two files on disk."
-  (interactive (list (read-file-name "First file: " nil nil t)
-                     (read-file-name "Second file: " nil nil t)))
-  (magit-diff-setup nil (list "--no-index")
-                    nil (list (expand-file-name a)
-                              (expand-file-name b))))
-
-(defvar-local magit-buffer-revision-hash nil)
-
-(defun magit-show-commit--arguments ()
-  (-let [(args diff-files) (magit-diff-arguments)]
-    (list args (if (derived-mode-p 'magit-log-mode)
-                   (and (not (member "--follow" (nth 1 magit-refresh-args)))
-                        (nth 2 magit-refresh-args))
-                 diff-files))))
-
-;;;###autoload
-(defun magit-show-commit (rev &optional args files module)
-  "Visit the revision at point in another buffer.
-If there is no revision at point or with a prefix argument prompt
-for a revision."
-  (interactive
-   (let* ((mcommit (magit-section-when module-commit))
-          (atpoint (or (and (bound-and-true-p magit-blame-mode)
-                            (magit-blame-chunk-get :hash))
-                       mcommit
-                       (magit-branch-or-commit-at-point))))
-     (nconc (cons (or (and (not current-prefix-arg) atpoint)
-                      (magit-read-branch-or-commit "Show commit" atpoint))
-                  (magit-show-commit--arguments))
-            (and mcommit (list (magit-section-parent-value
-                                (magit-current-section)))))))
-  (require 'magit)
-  (magit-with-toplevel
-    (when module
-      (setq default-directory
-            (expand-file-name (file-name-as-directory module))))
-    (unless (magit-rev-verify-commit rev)
-      (user-error "%s is not a commit" rev))
-    (-when-let (buffer (magit-mode-get-buffer 'magit-revision-mode))
-      (with-current-buffer buffer
-        (let ((prev (car magit-refresh-args)))
-          (unless (equal rev prev)
-            (dolist (child (cdr (magit-section-children magit-root-section)))
-              (when (eq (magit-section-type child) 'file)
-                (magit-section-cache-visibility child)))))))
-    (magit-mode-setup #'magit-revision-mode rev nil args files)))
-
-;;;; Setting commands
-
-(defun magit-diff-refresh (args files)
-  "Set the local diff arguments for the current buffer."
-  (interactive (magit-diff-arguments t))
-  (cond ((derived-mode-p 'magit-diff-mode)
-         (setcdr (cdr magit-refresh-args) (list args files)))
-        (t
-         (setq-local magit-diff-section-arguments args)
-         (setq-local magit-diff-section-file-args files)))
-  (magit-refresh))
-
-(defun magit-diff-set-default-arguments (args files)
-  "Set the global diff arguments for the current buffer."
-  (interactive (magit-diff-arguments t))
-  (cond ((derived-mode-p 'magit-diff-mode)
-         (customize-set-variable 'magit-diff-arguments args)
-         (setcdr (cdr magit-refresh-args) (list args files)))
-        (t
-         (customize-set-variable 'magit-diff-section-arguments args)
-         (kill-local-variable 'magit-diff-section-arguments)
-         (kill-local-variable 'magit-diff-section-file-args)))
-  (magit-refresh))
-
-(defun magit-diff-save-default-arguments (args files)
-  "Set and save the global diff arguments for the current buffer."
-  (interactive (magit-diff-arguments t))
-  (cond ((derived-mode-p 'magit-diff-mode)
-         (customize-save-variable 'magit-diff-arguments args)
-         (setcdr (cdr magit-refresh-args) (list args files)))
-        (t
-         (customize-save-variable 'magit-diff-section-arguments args)
-         (kill-local-variable 'magit-diff-section-arguments)
-         (kill-local-variable 'magit-diff-section-file-args)))
-  (magit-refresh))
-
-(defun magit-diff-switch-range-type ()
-  "Convert diff range type.
-Change \"revA..revB\" to \"revB...revA\", or vice versa."
-  (interactive)
-  (let ((range (car magit-refresh-args)))
-    (if (and range
-             (derived-mode-p 'magit-diff-mode)
-             (string-match magit-range-re range))
-        (progn
-          (setcar magit-refresh-args
-                  (concat (match-string 1 range)
-                          (if (string= (match-string 2 range) "..")
-                              "..."
-                            "..")
-                          (match-string 3 range)))
-          (magit-refresh))
-      (user-error "No range to change"))))
-
-(defun magit-diff-flip-revs ()
-  "Swap revisions in diff range.
-Change \"revA..revB\" to \"revB..revA\"."
-  (interactive)
-  (let ((range (car magit-refresh-args)))
-    (if (and range
-             (derived-mode-p 'magit-diff-mode)
-             (string-match magit-range-re range))
-        (progn
-          (setcar magit-refresh-args
-                  (concat (match-string 3 range)
-                          (match-string 2 range)
-                          (match-string 1 range)))
-          (magit-refresh))
-      (user-error "No range to swap"))))
-
-(defvar-local magit-diff--last-file-args nil)
-(defun magit-diff--toggle-file-args (files)
-  (cond (files
-         (setq magit-diff--last-file-args files)
-               nil)
-        (magit-diff--last-file-args)
-        (t
-         (user-error "No diff file filter to toggle"))))
-
-(defun magit-diff-toggle-file-filter ()
-  "Toggle the file restriction of the current buffer's diffs.
-If the current buffer's mode is derived from `magit-log-mode',
-toggle the file restriction in the repository's revision buffer
-instead."
-  (interactive)
-  (--if-let (and (derived-mode-p 'magit-log-mode)
-                 (magit-mode-get-buffer 'magit-revision-mode))
-      (with-current-buffer it
-        (setf (nth 3 magit-refresh-args)
-              (magit-diff--toggle-file-args (nth 3 magit-refresh-args)))
-        (magit-refresh))
-    (if (derived-mode-p 'magit-diff-mode)
-        (setf (nth 3 magit-refresh-args)
-              (magit-diff--toggle-file-args (nth 3 magit-refresh-args)))
-      (setq-local magit-diff-section-file-args
-                  (magit-diff--toggle-file-args magit-diff-section-file-args)))
-    (magit-refresh)))
-
-(defun magit-diff-less-context (&optional count)
-  "Decrease the context for diff hunks by COUNT lines."
-  (interactive "p")
-  (magit-diff-set-context `(lambda (cur) (max 0 (- (or cur 0) ,count)))))
-
-(defun magit-diff-more-context (&optional count)
-  "Increase the context for diff hunks by COUNT lines."
-  (interactive "p")
-  (magit-diff-set-context `(lambda (cur) (+ (or cur 0) ,count))))
-
-(defun magit-diff-default-context ()
-  "Reset context for diff hunks to the default height."
-  (interactive)
-  (magit-diff-set-context #'ignore))
-
-(defun magit-diff-set-context (fn)
-  (let* ((def (--if-let (magit-get "diff.context") (string-to-number it) 3))
-         (val (car (magit-diff-arguments t)))
-         (arg (--first (string-match "^-U\\([0-9]+\\)?$" it) val))
-         (num (--if-let (and arg (match-string 1 arg)) (string-to-number it) def))
-         (val (delete arg val))
-         (num (funcall fn num))
-         (arg (and num (not (= num def)) (format "-U%i" num)))
-         (val (if arg (cons arg val) val)))
-    (if (derived-mode-p 'magit-diff-mode)
-        (setcar (cddr magit-refresh-args) val)
-      (setq magit-diff-section-arguments val)))
-  (magit-refresh))
-
-(defun magit-diff-context-p ()
-  (--if-let (--first (string-match "^-U\\([0-9]+\\)$" it)
-                     (car (magit-diff-arguments t)))
-      (not (equal "-U0" it))
-    t))
-
-(defun magit-diff-toggle-refine-hunk (&optional style)
-  "Turn diff-hunk refining on or off.
-
-If hunk refining is currently on, then hunk refining is turned off.
-If hunk refining is off, then hunk refining is turned on, in
-`selected' mode (only the currently selected hunk is refined).
-
-With a prefix argument, the \"third choice\" is used instead:
-If hunk refining is currently on, then refining is kept on, but
-the refining mode (`selected' or `all') is switched.
-If hunk refining is off, then hunk refining is turned on, in
-`all' mode (all hunks refined).
-
-Customize variable `magit-diff-refine-hunk' to change the default mode."
-  (interactive "P")
-  (setq-local magit-diff-refine-hunk
-              (if style
-                  (if (eq magit-diff-refine-hunk 'all) t 'all)
-                (not magit-diff-refine-hunk)))
-  (magit-diff-update-hunk-refinement))
-
-;;;; Visit commands
-
-(defun magit-diff-visit-file (file &optional other-window force-worktree)
-  "From a diff, visit the corresponding file at the appropriate position.
-
-If the diff shows changes in the worktree, the index, or `HEAD',
-then visit the actual file.  Otherwise, when the diff is about an
-older commit or a range, then visit the appropriate blob.
-
-If point is on a removed line, then visit the blob for the first
-parent of the commit which removed that line, i.e. the last
-commit where that line still existed.  Otherwise visit the blob
-for the commit whose changes are being shown.
-
-When the file or blob to be displayed is already being displayed
-in another window of the same frame, then just select that window
-and adjust point.  Otherwise, or with a prefix argument, display
-the buffer in another window."
-  (interactive (list (--if-let (magit-file-at-point)
-                         (expand-file-name it)
-                       (user-error "No file at point"))
-                     current-prefix-arg))
-  (if (magit-file-accessible-directory-p file)
-      (magit-diff-visit-directory file other-window)
-    (let* ((hunk (magit-diff-visit--hunk))
-           (line (and hunk (magit-diff-hunk-line   hunk)))
-           (col  (and hunk (magit-diff-hunk-column hunk)))
-           (rev  (if (and magit-diff-visit-previous-blob
-                          (magit-section-match 'hunk)
-                          (save-excursion
-                            (goto-char (line-beginning-position))
-                            (looking-at "-")))
-                     (magit-diff-visit--range-beginning)
-                   (magit-diff-visit--range-end)))
-           (buf  (if (and (not force-worktree)
-                          (stringp rev))
-                     (magit-find-file-noselect rev file)
-                   (or (get-file-buffer file)
-                       (find-file-noselect file)))))
-      (magit-display-file-buffer buf)
-      (with-selected-window
-          (or (get-buffer-window buf 'visible)
-              (error "File buffer is not visible"))
-        (when line
-          (setq line
-                (cond ((eq rev 'staged)
-                       (apply 'magit-diff-visit--offset file nil line))
-                      ((and force-worktree
-                            (stringp rev))
-                       (apply 'magit-diff-visit--offset file rev line))
-                      (t
-                       (apply '+ line))))
-          (let ((pos (save-restriction
-                       (widen)
-                       (goto-char (point-min))
-                       (forward-line (1- line))
-                       (move-to-column col)
-                       (point))))
-            (unless (<= (point-min) pos (point-max))
-              (widen)
-              (goto-char pos))))
-        (when (magit-anything-unmerged-p file)
-          (smerge-start-session))
-        (run-hooks 'magit-diff-visit-file-hook)))))
-
-(defvar magit-display-file-buffer-function
-  'magit-display-file-buffer-traditional
-  "The function used by `magit-diff-visit-file' to display blob buffers.
-
-Other commands such as `magit-find-file' do not use this
-function.  Instead they use high-level functions to select the
-window to be used to display the buffer.  This variable and the
-related functions are an experimental feature and should be
-treated as such.")
-
-(defun magit-display-file-buffer (buffer)
-  (funcall magit-display-file-buffer-function buffer))
-
-(defun magit-display-file-buffer-traditional (buffer)
-  "Display BUFFER in the current window.
-With a prefix argument display it in another window.
-Option `magit-display-file-buffer-function' controls
-whether `magit-diff-visit-file' uses this function."
-  (if (or current-prefix-arg (get-buffer-window buffer))
-      (pop-to-buffer buffer)
-    (switch-to-buffer buffer)))
-
-(defun magit-display-file-buffer-other-window (buffer)
-  "Display BUFFER in another window.
-With a prefix argument display it in the current window.
-Option `magit-display-file-buffer-function' controls
-whether `magit-diff-visit-file' uses this function."
-  (if (or current-prefix-arg (get-buffer-window buffer))
-      (switch-to-buffer buffer)
-    (pop-to-buffer buffer)))
-
-(defun magit-diff-visit-file-worktree (file &optional other-window)
-  "From a diff, visit the corresponding file at the appropriate position.
-
-When the file is already being displayed in another window of the
-same frame, then just select that window and adjust point.  With
-a prefix argument also display in another window.
-
-The actual file in the worktree is visited. The positions in the
-hunk headers get less useful the \"older\" the changes are, and
-as a result, jumping to the appropriate position gets less
-reliable.
-
-Also see `magit-diff-visit-file' which visits the respective
-blob, unless the diff shows changes in the worktree, the index,
-or `HEAD'."
-  (interactive (list (or (magit-file-at-point)
-                         (user-error "No file at point"))
-                     current-prefix-arg))
-  (magit-diff-visit-file file other-window t))
-
-(defun magit-diff-visit--range-end ()
-  (let ((rev (magit-diff--dwim)))
-    (if (symbolp rev)
-        rev
-      (setq rev (if (consp rev)
-                    (cdr rev)
-                  (cdr (magit-split-range rev))))
-      (if (magit-rev-head-p rev)
-          'unstaged
-        rev))))
-
-(defun magit-diff-visit--range-beginning ()
-  (let ((rev (magit-diff--dwim)))
-    (cond ((consp rev)
-           (concat (cdr rev) "^"))
-          ((stringp rev)
-           (car (magit-split-range rev)))
-          (t
-           rev))))
-
-(defun magit-diff-visit--hunk ()
-  (-when-let (scope (magit-diff-scope))
-    (let ((section (magit-current-section)))
-      (cl-case scope
-        ((file files)
-         (setq section (car (magit-section-children section))))
-        (list
-         (setq section (car (magit-section-children section)))
-         (when section
-           (setq section (car (magit-section-children section))))))
-      (and
-       ;; Unmerged files appear in the list of staged changes
-       ;; but unlike in the list of unstaged changes no diffs
-       ;; are shown here.  In that case `section' is nil.
-       section
-       ;; Currently the `hunk' type is also abused for file
-       ;; mode changes, which we are not interested in here.
-       ;; Such sections have no value.
-       (magit-section-value section)
-       section))))
-
-(defun magit-diff-visit--offset (file rev hunk-start line-offset)
-  (let ((offset 0))
-    (with-temp-buffer
-      (save-excursion
-        (magit-with-toplevel
-          (magit-git-insert "diff" rev "--" file)))
-      (catch 'found
-        (while (re-search-forward
-                "^@@ -\\([0-9]+\\),\\([0-9]+\\) \\+\\([0-9]+\\),\\([0-9]+\\) @@"
-                nil t)
-          (let* ((abeg (string-to-number (match-string 1)))
-                 (alen (string-to-number (match-string 2)))
-                 (bbeg (string-to-number (match-string 3)))
-                 (blen (string-to-number (match-string 4)))
-                 (aend (+ abeg alen))
-                 (bend (+ bbeg blen))
-                 (hend (+ hunk-start line-offset)))
-            (if (<= abeg hunk-start)
-                (if (or (>= aend hend)
-                        (>= bend hend))
-                    (let ((line 0))
-                      (while (<= line alen)
-                        (forward-line 1)
-                        (cl-incf line)
-                        (cond ((looking-at "^\\+") (cl-incf offset))
-                              ((looking-at "^-")   (cl-decf offset)))))
-                  (cl-incf offset (- blen alen)))
-              (throw 'found nil))))))
-    (+ hunk-start line-offset offset)))
-
-(defun magit-diff-hunk-line (section)
-  (let* ((value  (magit-section-value section))
-         (prefix (- (length value) 2))
-         (cpos   (marker-position (magit-section-content section)))
-         (stop   (line-number-at-pos))
-         (cstart (save-excursion (goto-char cpos)
-                                 (line-number-at-pos)))
-         (prior  (and (= (length value) 3)
-                      (save-excursion (goto-char (line-beginning-position))
-                                      (looking-at "-"))))
-         (offset 0)
-         (line   (if prior
-                     (cadr value)
-                   (car (last value)))))
-    (string-match (format "^%s\\([0-9]+\\)" (if prior "-" "\\+")) line)
-    (setq line (string-to-number (match-string 1 line)))
-    (when (> cstart stop)
-      (save-excursion
-        (goto-char cpos)
-        (re-search-forward "^[-+]")
-        (setq stop (line-number-at-pos))))
-    (save-excursion
-      (goto-char cpos)
-      (while (< (line-number-at-pos) stop)
-        (unless (string-match-p
-                 (if prior "\\+" "-")
-                 (buffer-substring (point) (+ (point) prefix)))
-          (cl-incf offset))
-        (forward-line)))
-    (list line offset)))
-
-(defun magit-diff-hunk-column (section)
-  (if (or (< (point) (magit-section-content section))
-          (save-excursion (beginning-of-line) (looking-at-p "-")))
-      0
-    (max 0 (- (+ (current-column) 2)
-              (length (magit-section-value section))))))
-
-(defun magit-diff-visit-directory (directory &optional other-window)
-  (if (equal (magit-toplevel directory)
-             (magit-toplevel))
-      (dired-jump other-window (concat directory "/."))
-    (let ((display-buffer-overriding-action
-           (if other-window
-               '(nil (inhibit-same-window t))
-             '(display-buffer-same-window))))
-      (magit-status-internal directory))))
-
-;;;; Scroll commands
-
-(defun magit-diff-show-or-scroll-up ()
-  "Update the commit or diff buffer for the thing at point.
-
-Either show the commit or stash at point in the appropriate
-buffer, or if that buffer is already being displayed in the
-current frame and contains information about that commit or
-stash, then instead scroll the buffer up.  If there is no
-commit or stash at point, then prompt for a commit."
-  (interactive)
-  (magit-diff-show-or-scroll 'scroll-up))
-
-(defun magit-diff-show-or-scroll-down ()
-  "Update the commit or diff buffer for the thing at point.
-
-Either show the commit or stash at point in the appropriate
-buffer, or if that buffer is already being displayed in the
-current frame and contains information about that commit or
-stash, then instead scroll the buffer down.  If there is no
-commit or stash at point, then prompt for a commit."
-  (interactive)
-  (magit-diff-show-or-scroll 'scroll-down))
-
-(defun magit-diff-show-or-scroll (fn)
-  (let (rev cmd buf win)
-    (cond
-     (magit-blame-mode
-      (setq rev (magit-blame-chunk-get :hash))
-      (setq cmd 'magit-show-commit)
-      (setq buf (magit-mode-get-buffer 'magit-revision-mode)))
-     ((derived-mode-p 'git-rebase-mode)
-      (save-excursion
-        (goto-char (line-beginning-position))
-        (--if-let (and git-rebase-line
-                       (looking-at git-rebase-line)
-                       (match-string 2))
-            (progn (setq rev it)
-                   (setq cmd 'magit-show-commit)
-                   (setq buf (magit-mode-get-buffer 'magit-revision-mode)))
-          (user-error "No commit on this line"))))
-     (t
-      (magit-section-case
-        (branch
-         (setq rev (magit-ref-maybe-qualify (magit-section-value it)))
-         (setq cmd 'magit-show-commit)
-         (setq buf (magit-mode-get-buffer 'magit-revision-mode)))
-        (commit
-         (setq rev (magit-section-value it))
-         (setq cmd 'magit-show-commit)
-         (setq buf (magit-mode-get-buffer 'magit-revision-mode)))
-        (stash
-         (setq rev (magit-section-value it))
-         (setq cmd 'magit-stash-show)
-         (setq buf (magit-mode-get-buffer 'magit-stash-mode))))))
-    (if rev
-        (if (and buf
-                 (setq win (get-buffer-window buf))
-                 (with-current-buffer buf
-                   (and (equal rev (car magit-refresh-args))
-                        (equal (magit-rev-parse rev)
-                               magit-buffer-revision-hash))))
-            (with-selected-window win
-              (condition-case nil
-                  (funcall fn)
-                (error
-                 (goto-char (pcase fn
-                              (`scroll-up   (point-min))
-                              (`scroll-down (point-max)))))))
-          (let ((magit-display-buffer-noselect t))
-            (if (eq cmd 'magit-show-commit)
-                (apply #'magit-show-commit rev (magit-show-commit--arguments))
-              (funcall cmd rev))))
-      (call-interactively #'magit-show-commit))))
-
-;;; Diff Mode
-
-(defvar magit-diff-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-mode-map)
-    (define-key map "\C-c\C-d" 'magit-diff-while-committing)
-    (define-key map "\C-c\C-b" 'magit-go-backward)
-    (define-key map "\C-c\C-f" 'magit-go-forward)
-    (define-key map "\s" 'scroll-up)
-    (define-key map "\d" 'scroll-down)
-    (define-key map "j" 'magit-jump-to-diffstat-or-diff)
-    map)
-  "Keymap for `magit-diff-mode'.")
-
-(define-derived-mode magit-diff-mode magit-mode "Magit Diff"
-  "Mode for looking at a Git diff.
-
-This mode is documented in info node `(magit)Diff Buffer'.
-
-\\<magit-mode-map>\
-Type \\[magit-refresh] to refresh the current buffer.
-Type \\[magit-section-toggle] to expand or hide the section at point.
-Type \\[magit-visit-thing] to visit the hunk or file at point.
-
-Staging and applying changes is documented in info node
-`(magit)Staging and Unstaging' and info node `(magit)Applying'.
-
-\\<magit-hunk-section-map>Type \
-\\[magit-apply] to apply the change at point, \
-\\[magit-stage] to stage,
-\\[magit-unstage] to unstage, \
-\\[magit-discard] to discard, or \
-\\[magit-reverse] to reverse it.
-
-\\{magit-diff-mode-map}"
-  :group 'magit-diff
-  (hack-dir-local-variables-non-file-buffer)
-  (setq imenu-prev-index-position-function
-        'magit-imenu--diff-prev-index-position-function)
-  (setq imenu-extract-index-name-function
-        'magit-imenu--diff-extract-index-name-function)
-  (setq-local bookmark-make-record-function
-              'magit-bookmark--diff-make-record))
-
-(defun magit-diff-refresh-buffer (rev-or-range const _args files)
-  "Refresh the current `magit-diff-mode' buffer.
-
-In such buffers the buffer-local value of `magit-refresh-args'
-has the same form as the arguments of this function.  The value
-is set in `magit-mode-setup'."
-  (setq header-line-format
-        (propertize
-         (if (member "--no-index" const)
-             (apply #'format " Differences between %s and %s" files)
-           (concat (if rev-or-range
-                       (if (string-match-p "\\(\\.\\.\\|\\^-\\)"
-                                           rev-or-range)
-                           (format " Changes in %s" rev-or-range)
-                         (format " Changes from %s to working tree" rev-or-range))
-                     (if (member "--cached" const)
-                         " Staged changes"
-                       " Unstaged changes"))
-                   (pcase (length files)
-                     (0)
-                     (1 (concat " in file " (car files)))
-                     (_ (concat " in files "
-                                (mapconcat #'identity files ", "))))))
-         'face 'magit-header-line))
-  (magit-insert-section (diffbuf)
-    (run-hook-with-args 'magit-diff-sections-hook rev-or-range)))
-
-(defun magit-insert-diff (rev-or-range)
-  "Insert the diff into this `magit-diff-mode' buffer."
-  (let ((magit-git-global-arguments
-         (remove "--literal-pathspecs" magit-git-global-arguments)))
-    (magit-git-wash #'magit-diff-wash-diffs
-      "diff" rev-or-range "-p" "--no-prefix"
-      (and (member "--stat" (nth 2 magit-refresh-args)) "--numstat")
-      (nth 1 magit-refresh-args)
-      (nth 2 magit-refresh-args) "--"
-      (nth 3 magit-refresh-args))))
-
-(defvar magit-file-section-map
-  (let ((map (make-sparse-keymap)))
-    (unless (featurep 'jkl)
-      (define-key map (kbd "C-j") 'magit-diff-visit-file-worktree))
-    (define-key map [C-return] 'magit-diff-visit-file-worktree)
-    (define-key map [remap magit-visit-thing]      'magit-diff-visit-file)
-    (define-key map [remap magit-delete-thing]     'magit-discard)
-    (define-key map [remap magit-revert-no-commit] 'magit-reverse)
-    (define-key map "a" 'magit-apply)
-    (define-key map "C" 'magit-commit-add-log)
-    (define-key map "s" 'magit-stage)
-    (define-key map "u" 'magit-unstage)
-    (define-key map "&" 'magit-do-async-shell-command)
-    map)
-  "Keymap for `file' sections.")
-
-(defvar magit-hunk-section-map
-  (let ((map (make-sparse-keymap)))
-    (unless (featurep 'jkl)
-      (define-key map (kbd "C-j") 'magit-diff-visit-file-worktree))
-    (define-key map [C-return] 'magit-diff-visit-file-worktree)
-    (define-key map [remap magit-visit-thing]      'magit-diff-visit-file)
-    (define-key map [remap magit-delete-thing]     'magit-discard)
-    (define-key map [remap magit-revert-no-commit] 'magit-reverse)
-    (define-key map "a" 'magit-apply)
-    (define-key map "C" 'magit-commit-add-log)
-    (define-key map "s" 'magit-stage)
-    (define-key map "u" 'magit-unstage)
-    (define-key map "&" 'magit-do-async-shell-command)
-    map)
-  "Keymap for `hunk' sections.")
-
-(defconst magit-diff-headline-re
-  (concat "^\\(@@@?\\|diff\\|Submodule\\|"
-          "\\* Unmerged path\\|merged\\|changed in both\\|"
-          "added in remote\\|removed in remote\\)"))
-
-(defconst magit-diff-statline-re
-  (concat "^ ?"
-          "\\(.*\\)"     ; file
-          "\\( +| +\\)"  ; separator
-          "\\([0-9]+\\|Bin\\(?: +[0-9]+ -> [0-9]+ bytes\\)?$\\) ?"
-          "\\(\\+*\\)"   ; add
-          "\\(-*\\)$"))  ; del
-
-(defun magit-diff-wash-diffs (args &optional limit)
-  (when (member "--stat" args)
-    (magit-diff-wash-diffstat))
-  (when (re-search-forward magit-diff-headline-re limit t)
-    (goto-char (line-beginning-position))
-    (magit-wash-sequence (apply-partially 'magit-diff-wash-diff args))
-    (insert ?\n)))
-
-(defun magit-jump-to-diffstat-or-diff ()
-  "Jump to the diffstat or diff.
-When point is on a file inside the diffstat section, then jump
-to the respective diff section, otherwise jump to the diffstat
-section or a child thereof."
-  (interactive)
-  (--if-let (magit-get-section
-             (append (magit-section-case
-                       ([file diffstat] `((file . ,(magit-section-value it))))
-                       (file `((file . ,(magit-section-value it)) (diffstat)))
-                       (t '((diffstat))))
-                     (magit-section-ident magit-root-section)))
-      (magit-section-goto it)
-    (user-error "No diffstat in this buffer")))
-
-(defun magit-diff-wash-diffstat ()
-  (let (heading (beg (point)))
-    (when (re-search-forward "^ ?\\([0-9]+ +files? change[^\n]*\n\\)" nil t)
-      (setq heading (match-string 1))
-      (magit-delete-match)
-      (goto-char beg)
-      (magit-insert-section it (diffstat)
-        (insert (propertize heading 'face 'magit-diff-file-heading))
-        (magit-insert-heading)
-        (let (files)
-          (while (looking-at "^[-0-9]+\t[-0-9]+\t\\(.+\\)$")
-            (push (magit-decode-git-path (match-string 1)) files)
-            (magit-delete-line))
-          (setq files (nreverse files))
-          (while (looking-at magit-diff-statline-re)
-            (magit-bind-match-strings (file sep cnt add del) nil
-              (magit-delete-line)
-              (when (string-match " +$" file)
-                (setq sep (concat (match-string 0 file) sep))
-                (setq file (substring file 0 (match-beginning 0))))
-              (let ((le (length file)) ld)
-                (setq file (magit-decode-git-path file))
-                (setq ld (length file))
-                (when (> le ld)
-                  (setq sep (concat (make-string (- le ld) ?\s) sep))))
-              (magit-insert-section (file (pop files))
-                (insert (propertize file 'face 'magit-filename) sep cnt " ")
-                (when add
-                  (insert (propertize add 'face 'magit-diffstat-added)))
-                (when del
-                  (insert (propertize del 'face 'magit-diffstat-removed)))
-                (insert "\n")))))
-        (if (looking-at "^$") (forward-line) (insert "\n"))))))
-
-(defun magit-diff-wash-diff (args)
-  (cond
-   ((looking-at "^Submodule")
-    (magit-diff-wash-submodule))
-   ((looking-at "^\\* Unmerged path \\(.*\\)")
-    (let ((file (magit-decode-git-path (match-string 1))))
-      (magit-delete-line)
-      (unless (and (derived-mode-p 'magit-status-mode)
-                   (not (member "--cached" args)))
-        (magit-insert-section (file file)
-          (insert (propertize
-                   (format "unmerged   %s%s" file
-                           (pcase (cddr (car (magit-file-status file)))
-                             (`(?D ?D) " (both deleted)")
-                             (`(?D ?U) " (deleted by us)")
-                             (`(?U ?D) " (deleted by them)")
-                             (`(?A ?A) " (both added)")
-                             (`(?A ?U) " (added by us)")
-                             (`(?U ?A) " (added by them)")
-                             (`(?U ?U) "")))
-                   'face 'magit-diff-file-heading))
-          (insert ?\n))))
-    t)
-   ((looking-at (concat "^\\(merged\\|changed in both\\|"
-                        "added in remote\\|removed in remote\\)"))
-    (let ((status (pcase (match-string 1)
-                    ("merged" "merged")
-                    ("changed in both" "conflict")
-                    ("added in remote" "new file")
-                    ("removed in remote" "deleted")))
-          file orig base modes)
-      (magit-delete-line)
-      (while (looking-at
-              "^  \\([^ ]+\\) +[0-9]\\{6\\} \\([a-z0-9]\\{40\\}\\) \\(.+\\)$")
-        (magit-bind-match-strings (side _blob name) nil
-          (pcase side
-            ("result" (setq file name))
-            ("our" (setq orig name))
-            ("their" (setq file name))
-            ("base" (setq base name))))
-        (magit-delete-line))
-      (when orig (setq orig (magit-decode-git-path orig)))
-      (when file (setq file (magit-decode-git-path file)))
-      (magit-diff-insert-file-section (or file base) orig status modes nil)))
-   ((looking-at
-     "^diff --\\(?:\\(git\\) \\(?:\\(.+?\\) \\2\\)?\\|\\(cc\\|combined\\) \\(.+\\)\\)")
-    (let ((status (cond ((equal (match-string 1) "git")        "modified")
-                        ((derived-mode-p 'magit-revision-mode) "resolved")
-                        (t                                     "unmerged")))
-          (file (or (match-string 2) (match-string 4)))
-          (beg (point))
-          orig header modes)
-      (save-excursion
-        (forward-line 1)
-        (setq header (buffer-substring
-                      beg (if (re-search-forward magit-diff-headline-re nil t)
-                              (match-beginning 0)
-                            (point-max)))))
-      (magit-delete-line)
-      (while (not (or (eobp) (looking-at magit-diff-headline-re)))
-        (if (looking-at "^old mode \\([^\n]+\\)\nnew mode \\([^\n]+\\)\n")
-            (progn (setq modes (match-string 0))
-                   (magit-delete-match))
-          (cond
-           ((looking-at "^--- \\([^/].*?\\)\t?$") ; i.e. not /dev/null
-            (setq orig (match-string 1)))
-           ((looking-at "^\\+\\+\\+ \\([^/].*?\\)\t?$")
-            (setq file (match-string 1)))
-           ((looking-at "^\\(copy\\|rename\\) from \\(.+\\)$")
-            (setq orig (match-string 2)))
-           ((looking-at "^\\(copy\\|rename\\) to \\(.+\\)$")
-            (setq file (match-string 2))
-            (setq status (if (equal (match-string 1) "copy") "new file" "renamed")))
-           ((looking-at "^\\(new file\\|deleted\\)")
-            (setq status (match-string 1))))
-          (magit-delete-line)))
-      (when orig
-        (setq orig (magit-decode-git-path orig)))
-      (setq file (magit-decode-git-path file))
-      ;; KLUDGE `git-log' ignores `--no-prefix' when `-L' is used.
-      (when (and (derived-mode-p 'magit-log-mode)
-                 (--first (string-match-p "\\`-L" it)
-                          (nth 1 magit-refresh-args)))
-        (setq file (substring file 2))
-        (when orig
-          (setq orig (substring orig 2))))
-      (magit-diff-insert-file-section file orig status modes header)))))
-
-(defun magit-diff-insert-file-section (file orig status modes header)
-  (magit-insert-section section
-    (file file (or (equal status "deleted")
-                   (derived-mode-p 'magit-status-mode)))
-    (insert (propertize (format "%-10s %s\n" status
-                                (if (or (not orig) (equal orig file))
-                                    file
-                                  (format "%s -> %s" orig file)))
-                        'face 'magit-diff-file-heading))
-    (magit-insert-heading)
-    (unless (equal orig file)
-      (setf (magit-section-source section) orig))
-    (setf (magit-section-diff-header section) header)
-    (when modes
-      (magit-insert-section (hunk)
-        (insert modes)))
-    (magit-wash-sequence #'magit-diff-wash-hunk)))
-
-(defun magit-diff-wash-submodule ()
-  ;; See `show_submodule_summary' in submodule.c and "this" commit.
-  (when (looking-at "^Submodule \\([^ ]+\\)")
-    (let ((module (match-string 1))
-          untracked modified)
-      (when (looking-at "^Submodule [^ ]+ contains untracked content$")
-        (magit-delete-line)
-        (setq untracked t))
-      (when (looking-at "^Submodule [^ ]+ contains modified content$")
-        (magit-delete-line)
-        (setq modified t))
-      (cond
-       ((and (looking-at "^Submodule \\([^ ]+\\) \\([^ :]+\\)\\( (rewind)\\)?:$")
-             (equal (match-string 1) module))
-        (magit-bind-match-strings (_module range rewind) nil
-          (magit-delete-line)
-          (while (looking-at "^  \\([<>]\\) \\(.+\\)$")
-            (magit-delete-line))
-          (when rewind
-            (setq range (replace-regexp-in-string "[^.]\\(\\.\\.\\)[^.]"
-                                                  "..." range t t 1)))
-          (magit-insert-section (file module t)
-            (magit-insert-heading
-              (concat (propertize (concat "modified   " module)
-                                  'face 'magit-diff-file-heading)
-                      " ("
-                      (cond (rewind "rewind")
-                            ((string-match-p "\\.\\.\\." range) "non-ff")
-                            (t "new commits"))
-                      (and (or modified untracked)
-                           (concat ", "
-                                   (and modified "modified")
-                                   (and modified untracked " and ")
-                                   (and untracked "untracked")
-                                   " content"))
-                      ")"))
-            (let ((default-directory
-                    (file-name-as-directory
-                     (expand-file-name module (magit-toplevel)))))
-              (magit-git-wash (apply-partially 'magit-log-wash-log 'module)
-                "log" "--oneline" "--left-right" range)
-              (delete-char -1)))))
-       ((and (looking-at "^Submodule \\([^ ]+\\) \\([^ ]+\\) (\\([^)]+\\))$")
-             (equal (match-string 1) module))
-        (magit-bind-match-strings (_module _range msg) nil
-          (magit-delete-line)
-          (magit-insert-section (file module)
-            (magit-insert-heading
-              (concat (propertize (concat "submodule  " module)
-                                  'face 'magit-diff-file-heading)
-                      " (" msg ")")))))
-       (t
-        (magit-insert-section (file module)
-          (magit-insert-heading
-            (concat (propertize (concat "modified   " module)
-                                'face 'magit-diff-file-heading)
-                    " ("
-                    (and modified "modified")
-                    (and modified untracked " and ")
-                    (and untracked "untracked")
-                    " content)"))))))))
-
-(defun magit-diff-wash-hunk ()
-  (when (looking-at "^@\\{2,\\} \\(.+?\\) @\\{2,\\}\\(?: \\(.*\\)\\)?")
-    (let ((heading (match-string 0))
-          (value (cons (match-string 2) (split-string (match-string 1)))))
-      (magit-delete-line)
-      (magit-insert-section it (hunk value)
-        (insert (propertize (concat heading "\n") 'face 'magit-diff-hunk-heading))
-        (magit-insert-heading)
-        (while (not (or (eobp) (looking-at "^[^-+\s\\]")))
-          (forward-line))
-        (setf (magit-section-end it) (point))
-        (setf (magit-section-washer it) #'magit-diff-paint-hunk)))
-    t))
-
-(defun magit-diff-expansion-threshold (section)
-  "Keep new diff sections collapsed if washing takes too long."
-  (and (memq (magit-section-type section) '(file))
-       (> (float-time (time-subtract (current-time) magit-refresh-start-time))
-          magit-diff-expansion-threshold)
-       'hide))
-
-;;; Revision Mode
-
-(define-derived-mode magit-revision-mode magit-diff-mode "Magit Rev"
-  "Mode for looking at a Git commit.
-
-This mode is documented in info node `(magit)Revision Buffer'.
-
-\\<magit-mode-map>\
-Type \\[magit-refresh] to refresh the current buffer.
-Type \\[magit-section-toggle] to expand or hide the section at point.
-Type \\[magit-visit-thing] to visit the hunk or file at point.
-
-Staging and applying changes is documented in info node
-`(magit)Staging and Unstaging' and info node `(magit)Applying'.
-
-\\<magit-hunk-section-map>Type \
-\\[magit-apply] to apply the change at point, \
-\\[magit-stage] to stage,
-\\[magit-unstage] to unstage, \
-\\[magit-discard] to discard, or \
-\\[magit-reverse] to reverse it.
-
-\\{magit-revision-mode-map}"
-  :group 'magit-revision
-  (hack-dir-local-variables-non-file-buffer)
-  (setq-local bookmark-make-record-function
-              'magit-bookmark--revision-make-record))
-
-(defun magit-revision-refresh-buffer (rev __const _args files)
-  (setq header-line-format
-        (propertize (concat " " (capitalize (magit-object-type rev))
-                            " " rev
-                            (pcase (length files)
-                              (0)
-                              (1 (concat " limited to file " (car files)))
-                              (_ (concat " limited to files "
-                                         (mapconcat #'identity files ", ")))))
-                    'face 'magit-header-line))
-  (setq magit-buffer-revision-hash (magit-rev-parse rev))
-  (magit-insert-section (commitbuf)
-    (run-hook-with-args 'magit-revision-sections-hook rev)))
-
-(defun magit-insert-revision-diff (rev)
-  "Insert the diff into this `magit-revision-mode' buffer."
-  (let ((magit-git-global-arguments
-         (remove "--literal-pathspecs" magit-git-global-arguments)))
-    ;; Before v2.2.0, "--format=" did not mean "no output".
-    ;; Instead the default format was used.  So use "--format=%n"
-    ;; and then delete the empty lines.
-    (magit-git-wash (lambda (args)
-                      (delete-region (point) (progn (forward-line 3) (point)))
-                      (magit-diff-wash-diffs args))
-      "show" "-p" "--cc" "--format=%n" "--no-prefix"
-      (and (member "--stat" (nth 2 magit-refresh-args)) "--numstat")
-      (nth 2 magit-refresh-args) (concat rev "^{commit}") "--"
-      (nth 3 magit-refresh-args))))
-
-(defun magit-insert-revision-tag (rev)
-  "Insert tag message and headers into a revision buffer.
-This function only inserts anything when `magit-show-commit' is
-called with a tag as argument, when that is called with a commit
-or a ref which is not a branch, then it inserts nothing."
-  (when (equal (magit-object-type rev) "tag")
-    (magit-insert-section (taginfo)
-      (let ((beg (point)))
-        (magit-git-insert "cat-file" "tag" rev)
-        (goto-char beg)
-        (forward-line 3)
-        (delete-region beg (point)))
-      (looking-at "^tagger \\([^<]+\\) <\\([^>]+\\)")
-      (let ((heading (format "Tagger: %s <%s>"
-                             (match-string 1)
-                             (match-string 2))))
-        (magit-delete-line)
-        (insert (propertize heading 'face 'magit-section-secondary-heading)))
-      (magit-insert-heading)
-      (goto-char (point-max))
-      (insert ?\n))))
-
-(defun magit-insert-revision-message (rev)
-  "Insert the commit message into a revision buffer."
-  (magit-insert-section (message)
-    (let ((beg (point)))
-      (magit-rev-insert-format "%B" rev)
-      (if (= (point) (+ beg 2))
-          (progn (backward-delete-char 2)
-                 (insert "(no message)\n"))
-        (goto-char beg)
-        (save-excursion
-          (while (search-forward "\r\n" nil t) ; Remove trailing CRs.
-            (delete-region (match-beginning 0) (1+ (match-beginning 0)))))
-        (save-excursion
-          (forward-line)
-          (put-text-property beg (point) 'face 'magit-section-secondary-heading)
-          (magit-insert-heading))
-        (save-excursion
-          (while (re-search-forward "\\[[^[]*\\]" nil t)
-            (put-text-property (match-beginning 0)
-                               (match-end 0)
-                               'face 'magit-keyword)))
-        (goto-char (point-max))))))
-
-(defun magit-insert-revision-notes (rev)
-  "Insert commit notes into a revision buffer."
-  (magit-insert-section (notes)
-    (let ((beg (point)))
-      (magit-git-insert "notes" "show" rev)
-      (if (= (point) beg)
-          (magit-cancel-section)
-        (goto-char beg)
-        (forward-line)
-        (put-text-property beg (point) 'face 'magit-section-secondary-heading)
-        (magit-insert-heading)
-        (goto-char (point-max))
-        (insert ?\n)))))
-
-(defun magit-insert-revision-headers (rev)
-  "Insert headers about the commit into a revision buffer."
-  (magit-insert-section (headers)
-    ;; Before v2.2.0, "%D" was not supported.
-    (--when-let (magit-rev-format "%d" rev "--decorate=full")
-      (insert (magit-format-ref-labels it) ?\s))
-    (insert (propertize (magit-rev-parse (concat rev "^{commit}"))
-                        'face 'magit-hash))
-    (magit-insert-heading)
-    (let ((beg (point)))
-      (magit-rev-insert-format magit-revision-headers-format rev)
-      (magit-insert-revision-gravatars rev beg))
-    (when magit-revision-insert-related-refs
-      (dolist (parent (magit-commit-parents rev))
-        (magit-insert-section (commit parent)
-          (let ((line (magit-rev-format "%h %s" parent)))
-            (string-match "^\\([^ ]+\\) \\(.*\\)" line)
-            (magit-bind-match-strings (hash msg) line
-              (insert "Parent:     ")
-              (insert (propertize hash 'face 'magit-hash))
-              (insert " " msg "\n")))))
-      (-when-let (merged (magit-list-merged-branches rev))
-        (insert "Merged:    ")
-        (let (branch)
-          (while (and (< (+ (- (point) (line-beginning-position))
-                            (length (car merged)) 9)
-                         (window-width))
-                      (setq branch (pop merged)))
-            (insert ?\s)
-            (magit-insert-section (branch branch)
-              (insert (propertize branch 'face 'magit-branch-local)))))
-        (when merged
-          (insert (format " (%s more)" (length merged))))
-        (insert ?\n))
-      (-when-let (containing (magit-list-containing-branches rev))
-        (insert "Containing:")
-        (let (branch)
-          (while (and (< (+ (- (point) (line-beginning-position))
-                            (length (car containing)) 9)
-                         (window-width))
-                      (setq branch (pop containing)))
-            (insert ?\s)
-            (magit-insert-section (branch branch)
-              (insert (propertize branch 'face 'magit-branch-local)))))
-        (when containing
-          (insert (format " (%s more)" (length containing))))
-        (insert ?\n))
-      (-when-let (follows (magit-get-current-tag rev t))
-        (let ((tag (car  follows))
-              (cnt (cadr follows)))
-          (magit-insert-section (tag tag)
-            (insert (format "Follows:    %s (%s)\n"
-                            (propertize tag 'face 'magit-tag)
-                            (propertize (number-to-string cnt)
-                                        'face 'magit-branch-local))))))
-      (-when-let (precedes (magit-get-next-tag rev t))
-        (let ((tag (car  precedes))
-              (cnt (cadr precedes)))
-          (magit-insert-section (tag tag)
-            (insert (format "Precedes:   %s (%s)\n"
-                            (propertize tag 'face 'magit-tag)
-                            (propertize (number-to-string cnt)
-                                        'face 'magit-tag))))))
-      (insert ?\n))))
-
-(defun magit-insert-revision-gravatars (rev beg)
-  (when (and magit-revision-show-gravatars (window-system))
-    (require 'gravatar)
-    (magit-insert-revision-gravatar beg (magit-rev-format "%aE" rev)
-                                    (car magit-revision-show-gravatars))
-    (magit-insert-revision-gravatar beg (magit-rev-format "%cE" rev)
-                                    (cdr magit-revision-show-gravatars))
-    (goto-char (point-max))))
-
-(defun magit-insert-revision-gravatar (beg email regexp)
-  (when (and email (goto-char beg) (re-search-forward regexp nil t))
-    (ignore-errors
-      (let* ((offset   (length (match-string 0)))
-             (font-obj (query-font (font-at (point) (get-buffer-window))))
-             (size     (* 2 (+ (aref font-obj 4) (aref font-obj 5))))
-             (align-to (+ offset (ceiling (/ size (aref font-obj 7) 1.0))))
-             (gravatar-size (- size 2))
-             (slice1  '(slice .0 .0 1.0 0.5))
-             (slice2  '(slice .0 .5 1.0 1.0))
-             (image    (gravatar-retrieve-synchronously email)))
-        (unless (eq image 'error)
-          (when magit-revision-use-gravatar-kludge
-            (cl-rotatef slice1 slice2))
-          (insert (propertize " " 'display `((,@image :ascent center :relief 1)
-                                             ,slice1)))
-          (insert (propertize " " 'display `((space :align-to ,align-to))))
-          (insert " ")
-          (forward-line)
-          (forward-char offset)
-          (insert (propertize " " 'display `((,@image :ascent center :relief 1)
-                                             ,slice2)))
-          (insert (propertize " " 'display `((space :align-to ,align-to))))
-          (insert " "))))))
-
-;;; Diff Sections
-
-(defvar magit-unstaged-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-visit-thing]  'magit-diff-unstaged)
-    (define-key map [remap magit-delete-thing] 'magit-discard)
-    (define-key map "s" 'magit-stage)
-    (define-key map "u" 'magit-unstage)
-    map)
-  "Keymap for the `unstaged' section.")
-
-(magit-define-section-jumper magit-jump-to-unstaged "Unstaged changes" unstaged)
-
-(defun magit-insert-unstaged-changes ()
-  "Insert section showing unstaged changes."
-  (magit-insert-section (unstaged)
-    (magit-insert-heading "Unstaged changes:")
-    (magit-git-wash #'magit-diff-wash-diffs
-      "diff" magit-diff-section-arguments "--no-prefix"
-      "--" magit-diff-section-file-args)))
-
-(defvar magit-staged-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-visit-thing]      'magit-diff-staged)
-    (define-key map [remap magit-delete-thing]     'magit-discard)
-    (define-key map [remap magit-revert-no-commit] 'magit-reverse)
-    (define-key map "s" 'magit-stage)
-    (define-key map "u" 'magit-unstage)
-    map)
-  "Keymap for the `staged' section.")
-
-(magit-define-section-jumper magit-jump-to-staged "Staged changes" staged)
-
-(defun magit-insert-staged-changes ()
-  "Insert section showing staged changes."
-  (magit-insert-section (staged)
-    (magit-insert-heading "Staged changes:")
-    (magit-git-wash #'magit-diff-wash-diffs
-      "diff" "--cached" magit-diff-section-arguments "--no-prefix"
-      "--" magit-diff-section-file-args)))
-
-;;; Diff Type
-
-(defun magit-diff-type (&optional section)
-  "Return the diff type of SECTION.
-
-The returned type is one of the symbols `staged', `unstaged',
-`committed', or `undefined'.  This type serves a similar purpose
-as the general type common to all sections (which is stored in
-the `type' slot of the corresponding `magit-section' struct) but
-takes additional information into account.  When the SECTION
-isn't related to diffs and the buffer containing it also isn't
-a diff-only buffer, then return nil.
-
-Currently the type can also be one of `tracked' and `untracked'
-but these values are not handled explicitly everywhere they
-should be and a possible fix could be to just return nil here.
-
-The section has to be a `diff' or `hunk' section, or a section
-whose children are of type `diff'.  If optional SECTION is nil,
-return the diff type for the current section.  In buffers whose
-major mode is `magit-diff-mode' SECTION is ignored and the type
-is determined using other means.  In `magit-revision-mode'
-buffers the type is always `committed'.
-
-Do not confuse this with `magit-diff-scope' (which see)."
-  (--when-let (or section (magit-current-section))
-    (cond ((derived-mode-p 'magit-revision-mode 'magit-stash-mode) 'committed)
-          ((derived-mode-p 'magit-diff-mode)
-           (let ((range (nth 0 magit-refresh-args))
-                 (const (nth 1 magit-refresh-args)))
-             (cond ((member "--no-index" const) 'undefined)
-                   ((not range)
-                    (if (member "--cached" const)
-                        'staged
-                      'unstaged))
-                   ((member "--cached" const)
-                    (if (magit-rev-head-p range)
-                        'staged
-                      'undefined)) ; i.e. committed and staged
-                   (t 'committed))))
-          ((derived-mode-p 'magit-status-mode)
-           (let ((stype (magit-section-type it)))
-             (if (memq stype '(staged unstaged tracked untracked))
-                 stype
-               (pcase stype
-                 (`file (let* ((parent (magit-section-parent it))
-                               (type   (magit-section-type parent)))
-                          (if (eq type 'file)
-                              (magit-diff-type parent)
-                            type)))
-                 (`hunk (-> it magit-section-parent magit-section-parent
-                            magit-section-type))))))
-          ((derived-mode-p 'magit-log-mode)
-           (if (or (and (magit-section-match 'commit section)
-                        (magit-section-children section))
-                   (magit-section-match [* file commit] section))
-               'committed
-           'undefined))
-          (t 'undefined))))
-
-(cl-defun magit-diff-scope (&optional (section nil ssection) strict)
-  "Return the diff scope of SECTION or the selected section(s).
-
-A diff's \"scope\" describes what part of a diff is selected, it is
-a symbol, one of `region', `hunk', `hunks', `file', `files', or
-`list'.  Do not confuse this with the diff \"type\", as returned by
-`magit-diff-type'.
-
-If optional SECTION is non-nil, then return the scope of that,
-ignoring the sections selected by the region.  Otherwise return
-the scope of the current section, or if the region is active and
-selects a valid group of diff related sections, the type of these
-sections, i.e. `hunks' or `files'.  If SECTION, or if that is nil
-the current section, is a `hunk' section; and the region region
-starts and ends inside the body of a that section, then the type
-is `region'.  If the region is empty after a mouse click, then
-`hunk' is returned instead of `region'.
-
-If optional STRICT is non-nil, then return nil if the diff type of
-the section at point is `untracked' or the section at point is not
-actually a `diff' but a `diffstat' section."
-  (let ((siblings (and (not ssection) (magit-region-sections))))
-    (setq section (or section (car siblings) (magit-current-section)))
-    (when (and section
-               (or (not strict)
-                   (and (not (eq (magit-diff-type section) 'untracked))
-                        (not (eq (--when-let (magit-section-parent section)
-                                   (magit-section-type it))
-                                 'diffstat)))))
-      (pcase (list (magit-section-type section)
-                   (and siblings t)
-                   (magit-diff-use-hunk-region-p)
-                   ssection)
-        (`(hunk nil   t  ,_)
-         (if (magit-section-internal-region-p section) 'region 'hunk))
-        (`(hunk   t   t nil) 'hunks)
-        (`(hunk  ,_  ,_  ,_) 'hunk)
-        (`(file   t   t nil) 'files)
-        (`(file  ,_  ,_  ,_) 'file)
-        (`(,(or `staged `unstaged `untracked)
-           nil ,_ ,_) 'list)))))
-
-(defun magit-diff-use-hunk-region-p ()
-  (and (region-active-p)
-       (not (and (if (version< emacs-version "25.1")
-                     (eq this-command 'mouse-drag-region)
-                   ;; TODO implement this from first principals
-                   ;; currently it's trial-and-error
-                   (or (eq this-command 'mouse-drag-region)
-                       (eq last-command 'mouse-drag-region)
-                       ;; When another window was previously
-                       ;; selected then the last-command is
-                       ;; some byte-code function.
-                       (byte-code-function-p last-command)))
-                 (eq (region-end) (region-beginning))))))
-
-;;; Diff Highlight
-
-(defun magit-diff-unhighlight (section selection)
-  "Remove the highlighting of the diff-related SECTION."
-  (when (eq (magit-section-type section) 'hunk)
-    (magit-diff-paint-hunk section selection nil)
-    t))
-
-(defun magit-diff-highlight (section selection)
-  "Highlight the diff-related SECTION.
-If SECTION is not a diff-related section, then do nothing and
-return nil.  If SELECTION is non-nil, then it is a list of sections
-selected by the region, including SECTION.  All of these sections
-are highlighted."
-  (if (and (magit-section-match 'commit section)
-           (magit-section-children section))
-      (progn (if selection
-                 (dolist (section selection)
-                   (magit-diff-highlight-list section selection))
-               (magit-diff-highlight-list section))
-             t)
-    (-when-let (scope (magit-diff-scope section t))
-      (cond ((eq scope 'region)
-             (magit-diff-paint-hunk section selection t))
-            (selection
-             (dolist (section selection)
-               (magit-diff-highlight-recursive section selection)))
-            (t
-             (magit-diff-highlight-recursive section)))
-      t)))
-
-(defun magit-diff-highlight-recursive (section &optional selection)
-  (pcase (magit-diff-scope section)
-    (`list (magit-diff-highlight-list section selection))
-    (`file (magit-diff-highlight-file section selection))
-    (`hunk (magit-diff-highlight-heading section selection)
-           (magit-diff-paint-hunk section selection t))
-    (_     (magit-section-highlight section nil))))
-
-(defun magit-diff-highlight-list (section &optional selection)
-  (let ((beg (magit-section-start   section))
-        (cnt (magit-section-content section))
-        (end (magit-section-end     section)))
-    (unless (and (region-active-p)
-                 (= end (1+ (region-end))))
-      (magit-section-make-overlay beg cnt 'magit-section-highlight)
-      (unless (magit-section-hidden section)
-        (dolist (child (magit-section-children section))
-          (magit-diff-highlight-recursive child selection))))
-    (when magit-diff-highlight-hunk-body
-      (magit-section-make-overlay (1- end) end 'magit-section-highlight))))
-
-(defun magit-diff-highlight-file (section &optional selection)
-  (magit-diff-highlight-heading section selection)
-  (unless (magit-section-hidden section)
-    (dolist (child (magit-section-children section))
-      (magit-diff-highlight-recursive child selection))))
-
-(defun magit-diff-highlight-heading (section &optional selection)
-  (magit-section-make-overlay
-   (magit-section-start section)
-   (or (magit-section-content section)
-       (magit-section-end     section))
-   (pcase (list (magit-section-type section)
-                (and (member section selection) t))
-     (`(file   t) 'magit-diff-file-heading-selection)
-     (`(file nil) 'magit-diff-file-heading-highlight)
-     (`(hunk   t) 'magit-diff-hunk-heading-selection)
-     (`(hunk nil) 'magit-diff-hunk-heading-highlight))))
-
-;;; Hunk Paint
-
-(cl-defun magit-diff-paint-hunk
-    (section &optional selection
-             (highlight (magit-section-selected-p section selection)))
-  (let (paint)
-    (unless magit-diff-highlight-hunk-body
-      (setq highlight nil))
-    (cond (highlight
-           (unless (magit-section-hidden section)
-             (add-to-list 'magit-section-highlighted-sections section)
-             (cond ((memq section magit-section-unhighlight-sections)
-                    (setq magit-section-unhighlight-sections
-                          (delq section magit-section-unhighlight-sections)))
-                   (magit-diff-highlight-hunk-body
-                    (setq paint t)))))
-          (t
-           (cond ((and (magit-section-hidden section)
-                       (memq section magit-section-unhighlight-sections))
-                  (add-to-list 'magit-section-highlighted-sections section)
-                  (setq magit-section-unhighlight-sections
-                        (delq section magit-section-unhighlight-sections)))
-                 (t
-                  (setq paint t)))))
-    (when paint
-      (save-excursion
-        (goto-char (magit-section-start section))
-        (let ((end (magit-section-end section))
-              (merging (looking-at "@@@"))
-              (stage nil))
-          (forward-line)
-          (while (< (point) end)
-            (when (and magit-diff-hide-trailing-cr-characters
-                       (char-equal ?\r (char-before (line-end-position))))
-              (put-text-property (1- (line-end-position)) (line-end-position)
-                                 'invisible t))
-            (put-text-property
-             (point) (1+ (line-end-position)) 'face
-             (cond
-              ((looking-at "^\\+\\+?\\([<=|>]\\)\\{7\\}")
-               (setq stage (pcase (list (match-string 1) highlight)
-                             (`("<" nil) 'magit-diff-our)
-                             (`("<"   t) 'magit-diff-our-highlight)
-                             (`("|" nil) 'magit-diff-base)
-                             (`("|"   t) 'magit-diff-base-highlight)
-                             (`("=" nil) 'magit-diff-their)
-                             (`("="   t) 'magit-diff-their-highlight)
-                             (`(">" nil) nil)))
-               'magit-diff-conflict-heading)
-              ((looking-at (if merging  "^\\(\\+\\| \\+\\)" "^\\+"))
-               (magit-diff-paint-whitespace merging)
-               (or stage
-                   (if highlight 'magit-diff-added-highlight 'magit-diff-added)))
-              ((looking-at (if merging  "^\\(-\\| -\\)" "^-"))
-               (if highlight 'magit-diff-removed-highlight 'magit-diff-removed))
-              (t
-               (if highlight 'magit-diff-context-highlight 'magit-diff-context))))
-            (forward-line))))))
-  (magit-diff-update-hunk-refinement section))
-
-(defun magit-diff-paint-whitespace (merging)
-  (when (and magit-diff-paint-whitespace
-             (or (derived-mode-p 'magit-status-mode)
-                 (not (eq magit-diff-paint-whitespace 'status))))
-    (let ((prefix (if merging "^[-\\+\s]\\{2\\}" "^[-\\+]"))
-          (indent
-           (if (local-variable-p 'magit-diff-highlight-indentation)
-               magit-diff-highlight-indentation
-             (setq-local
-              magit-diff-highlight-indentation
-              (cdr (--first (string-match-p (car it) default-directory)
-                            (nreverse
-                             (default-value
-                               'magit-diff-highlight-indentation))))))))
-      (when (and magit-diff-highlight-trailing
-                 (looking-at (concat prefix ".*?\\([ \t]+\\)$")))
-        (let ((ov (make-overlay (match-beginning 1) (match-end 1) nil t)))
-          (overlay-put ov 'face 'magit-diff-whitespace-warning)
-          (overlay-put ov 'evaporate t)))
-      (when (or (and (eq indent 'tabs)
-                     (looking-at (concat prefix "\\( *\t[ \t]*\\)")))
-                (and (integerp indent)
-                     (looking-at (format "%s\\([ \t]* \\{%s,\\}[ \t]*\\)"
-                                         prefix indent))))
-        (let ((ov (make-overlay (match-beginning 1) (match-end 1) nil t)))
-          (overlay-put ov 'face 'magit-diff-whitespace-warning)
-          (overlay-put ov 'evaporate t))))))
-
-(defun magit-diff-update-hunk-refinement (&optional section)
-  (if section
-      (unless (magit-section-hidden section)
-        (pcase (list magit-diff-refine-hunk
-                     (magit-section-refined section)
-                     (eq section (magit-current-section)))
-          ((or `(all nil ,_) `(t nil t))
-           (setf (magit-section-refined section) t)
-           (save-excursion
-             (goto-char (magit-section-start section))
-             ;; `diff-refine-hunk' does not handle combined diffs.
-             (unless (looking-at "@@@")
-               ;; Avoid fsyncing many small temp files
-               (let ((write-region-inhibit-fsync t))
-                 (diff-refine-hunk)))))
-          ((or `(nil t ,_) `(t t nil))
-           (setf (magit-section-refined section) nil)
-           (remove-overlays (magit-section-start section)
-                            (magit-section-end   section)
-                            'diff-mode 'fine))))
-    (cl-labels ((recurse (section)
-                         (if (magit-section-match 'hunk section)
-                             (magit-diff-update-hunk-refinement section)
-                           (--each (magit-section-children section)
-                             (recurse it)))))
-      (recurse magit-root-section))))
-
-
-;;; Hunk Region
-
-(defun magit-diff-hunk-region-beginning ()
-  (save-excursion (goto-char (region-beginning))
-                  (line-beginning-position)))
-
-(defun magit-diff-hunk-region-end ()
-  (save-excursion (goto-char (region-end))
-                  (line-end-position)))
-
-(defun magit-diff-update-hunk-region (section)
-  "Highlight the hunk-internal region if any."
-  (when (eq (magit-diff-scope section t) 'region)
-    (magit-diff--make-hunk-overlay
-     (magit-section-start section)
-     (1- (magit-section-content section))
-     'face 'magit-diff-lines-heading
-     'display (magit-diff-hunk-region-header section)
-     'after-string (magit-diff--hunk-after-string 'magit-diff-lines-heading))
-    (run-hook-with-args 'magit-diff-highlight-hunk-region-functions section)
-    t))
-
-(defun magit-diff-highlight-hunk-region-dim-outside (section)
-  "Dim the parts of the hunk that are outside the hunk-internal region.
-This is done by using the same foreground and background color
-for added and removed lines as for context lines."
-  (let ((face (if magit-diff-highlight-hunk-body
-                  'magit-diff-context-highlight
-                'magit-diff-context)))
-    (when magit-diff-unmarked-lines-keep-foreground
-      (setq face (list :background (face-attribute face :background))))
-    (magit-diff--make-hunk-overlay (magit-section-content section)
-                                   (magit-diff-hunk-region-beginning)
-                                   'face face
-                                   'priority 2)
-    (magit-diff--make-hunk-overlay (1+ (magit-diff-hunk-region-end))
-                                   (magit-section-end section)
-                                   'face face
-                                   'priority 2)))
-
-(defun magit-diff-highlight-hunk-region-using-face (_section)
-  "Highlight the hunk-internal region by making it bold.
-Or rather highlight using the face `magit-diff-hunk-region', though
-changing only the `:weight' and/or `:slant' is recommended for that
-face."
-  (magit-diff--make-hunk-overlay (magit-diff-hunk-region-beginning)
-                                 (1+ (magit-diff-hunk-region-end))
-                                 'face 'magit-diff-hunk-region))
-
-(defun magit-diff-highlight-hunk-region-using-overlays (section)
-  "Emphasize the hunk-internal region using delimiting horizontal lines.
-This is implemented as single-pixel newlines places inside overlays.
-Although creating overlays containing newlines is discouraged,
-this version turns out to be less glitchy on Emacs 24 than the
-other method."
-  (if (window-system)
-      (let ((beg (magit-diff-hunk-region-beginning))
-            (end (magit-diff-hunk-region-end))
-            (str (propertize
-                  (concat (propertize "\s" 'display '(space :height (1)))
-                          (propertize "\n" 'line-height t))
-                  'face 'magit-diff-lines-boundary)))
-        (magit-diff--make-hunk-overlay beg (1+ beg) 'before-string str)
-        (magit-diff--make-hunk-overlay end (1+ end) 'after-string  str))
-    (magit-diff-highlight-hunk-region-using-face section)))
-
-(defun magit-diff-highlight-hunk-region-using-underline (section)
-  "Emphasize the hunk-internal region using delimiting horizontal lines.
-This is implemented by overlining and underlining the first and
-last (visual) lines of the region.  In Emacs 24, using this
-method causes `move-end-of-line' to jump to the next line, so
-we only use it in Emacs 25 where that glitch was fixed (see
-https://github.com/magit/magit/pull/2293 for more details)."
-  (if (window-system)
-      (let* ((beg (magit-diff-hunk-region-beginning))
-             (end (magit-diff-hunk-region-end))
-             (beg-eol (save-excursion (goto-char beg)
-                                      (end-of-visual-line)
-                                      (point)))
-             (end-bol (save-excursion (goto-char end)
-                                      (beginning-of-visual-line)
-                                      (point)))
-             (color (face-background 'magit-diff-lines-boundary nil t)))
-        (cl-flet ((ln (b e &rest face)
-                      (magit-diff--make-hunk-overlay
-                       b e 'face face 'after-string
-                       (magit-diff--hunk-after-string face))))
-          (if (= beg end-bol)
-              (ln beg beg-eol :overline color :underline color)
-            (ln beg beg-eol :overline color)
-            (ln end-bol end :underline color))))
-    (magit-diff-highlight-hunk-region-using-face section)))
-
-(defun magit-diff--make-hunk-overlay (start end &rest args)
-  (let ((ov (make-overlay start end nil t)))
-    (overlay-put ov 'evaporate t)
-    (while args (overlay-put ov (pop args) (pop args)))
-    (push ov magit-region-overlays)
-    ov))
-
-(defun magit-diff--hunk-after-string (face)
-  (propertize "\s"
-              'face face
-              'display (list 'space :align-to
-                             `(+ (0 . right)
-                                 ,(min (window-hscroll)
-                                       (- (line-end-position)
-                                          (line-beginning-position)))))
-              ;; This prevents the cursor from being rendered at the
-              ;; edge of the window.
-              'cursor t))
-
-;;; Diff Extract
-
-(defun magit-diff-file-header (section)
-  (when (eq (magit-section-type section) 'hunk)
-    (setq section (magit-section-parent section)))
-  (when (eq (magit-section-type section) 'file)
-    (magit-section-diff-header section)))
-
-(defun magit-diff-hunk-region-header (section)
-  (let ((patch (magit-diff-hunk-region-patch section)))
-    (string-match "\n" patch)
-    (substring patch 0 (1- (match-end 0)))))
-
-(defun magit-diff-hunk-region-patch (section &optional args)
-  (let ((op (if (member "--reverse" args) "+" "-"))
-        (sbeg (magit-section-start section))
-        (rbeg (magit-diff-hunk-region-beginning))
-        (rend (region-end))
-        (send (magit-section-end section))
-        (patch nil))
-    (save-excursion
-      (goto-char sbeg)
-      (while (< (point) send)
-        (looking-at "\\(.\\)\\([^\n]*\n\\)")
-        (cond ((or (string-match-p "[@ ]" (match-string-no-properties 1))
-                   (and (>= (point) rbeg)
-                        (<= (point) rend)))
-               (push (match-string-no-properties 0) patch))
-              ((equal op (match-string-no-properties 1))
-               (push (concat " " (match-string-no-properties 2)) patch)))
-        (forward-line)))
-    (with-temp-buffer
-      (insert (mapconcat 'identity (reverse patch) ""))
-      (diff-fixup-modifs (point-min) (point-max))
-      (setq patch (buffer-string)))
-    patch))
-
-(provide 'magit-diff)
-;;; magit-diff.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-diff.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-ediff.el
@@ -1,507 +0,0 @@
-;;; magit-ediff.el --- Ediff extension for Magit  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library provides basic support for Ediff.
-
-;;; Code:
-
-(require 'magit)
-
-(require 'ediff)
-(require 'smerge-mode)
-
-(defvar smerge-ediff-buf)
-(defvar smerge-ediff-windows)
-
-;;; Options
-
-(defgroup magit-ediff nil
-  "Ediff support for Magit."
-  :link '(info-link "(magit)Ediffing")
-  :group 'magit-extensions)
-
-(defcustom magit-ediff-quit-hook
-  '(magit-ediff-cleanup-auxiliary-buffers
-    magit-ediff-restore-previous-winconf)
-  "Hooks to run after finishing Ediff, when that was invoked using Magit.
-The hooks are run in the Ediff control buffer.  This is similar
-to `ediff-quit-hook' but takes the needs of Magit into account.
-The `ediff-quit-hook' is ignored by Ediff sessions which were
-invoked using Magit."
-  :package-version '(magit . "2.2.0")
-  :group 'magit-ediff
-  :type 'hook
-  :get 'magit-hook-custom-get
-  :options '(magit-ediff-cleanup-auxiliary-buffers
-             magit-ediff-restore-previous-winconf))
-
-(defcustom magit-ediff-dwim-show-on-hunks nil
-  "Whether `magit-ediff-dwim' runs show variants on hunks.
-If non-nil, `magit-ediff-show-staged' or
-`magit-ediff-show-unstaged' are called based on what section the
-hunk is in.  Otherwise, `magit-ediff-dwim' runs
-`magit-ediff-stage' when point is on an uncommitted hunk."
-  :package-version '(magit . "2.2.0")
-  :group 'magit-ediff
-  :type 'boolean)
-
-(defcustom magit-ediff-show-stash-with-index t
-  "Whether `magit-ediff-show-stash' shows the state of the index.
-
-If non-nil, use a third Ediff buffer to distinguish which changes
-in the stash were staged.  In cases where the stash contains no
-staged changes, fall back to a two-buffer Ediff.
-
-More specifically, a stash is a merge commit, stash@{N}, with
-potentially three parents.
-
-* stash@{N}^1 represents the `HEAD' commit at the time the stash
-  was created.
-
-* stash@{N}^2 records any changes that were staged when the stash
-  was made.
-
-* stash@{N}^3, if it exists, contains files that were untracked
-  when stashing.
-
-If this option is non-nil, `magit-ediff-show-stash' will run
-Ediff on a file using three buffers: one for stash@{N}, another
-for stash@{N}^1, and a third for stash@{N}^2.
-
-Otherwise, Ediff uses two buffers, comparing
-stash@{N}^1..stash@{N}.  Along with any unstaged changes, changes
-in the index commit, stash@{N}^2, will be shown in this
-comparison unless they conflicted with changes in the working
-tree at the time of stashing."
-  :package-version '(magit . "2.6.0")
-  :group 'magit-ediff
-  :type 'boolean)
-
-;;; Commands
-
-(defvar magit-ediff-previous-winconf nil)
-
-;;;###autoload (autoload 'magit-ediff-popup "magit-ediff" nil t)
-(magit-define-popup magit-ediff-popup
-  "Popup console for ediff commands."
-  :actions '((?E "Dwim"          magit-ediff-dwim)
-             (?u "Show unstaged" magit-ediff-show-unstaged)
-             (?s "Stage"         magit-ediff-stage)
-             (?i "Show staged"   magit-ediff-show-staged)
-             (?m "Resolve"       magit-ediff-resolve)
-             (?w "Show worktree" magit-ediff-show-working-tree)
-             (?r "Diff range"    magit-ediff-compare)
-             (?c "Show commit"   magit-ediff-show-commit) nil
-             (?z "Show stash"    magit-ediff-show-stash))
-  :max-action-columns 2)
-
-;;;###autoload
-(defun magit-ediff-resolve (file)
-  "Resolve outstanding conflicts in FILE using Ediff.
-FILE has to be relative to the top directory of the repository.
-
-In the rare event that you want to manually resolve all
-conflicts, including those already resolved by Git, use
-`ediff-merge-revisions-with-ancestor'."
-  (interactive
-   (let ((current  (magit-current-file))
-         (unmerged (magit-unmerged-files)))
-     (unless unmerged
-       (user-error "There are no unresolved conflicts"))
-     (list (magit-completing-read "Resolve file" unmerged nil t nil nil
-                                  (car (member current unmerged))))))
-  (magit-with-toplevel
-    (with-current-buffer (find-file-noselect file)
-      (smerge-ediff)
-      (setq-local
-       ediff-quit-hook
-       (lambda ()
-         (let ((bufC ediff-buffer-C)
-               (bufS smerge-ediff-buf))
-           (with-current-buffer bufS
-             (when (yes-or-no-p (format "Conflict resolution finished; save %s?"
-                                        buffer-file-name))
-               (erase-buffer)
-               (insert-buffer-substring bufC)
-               (save-buffer))))
-         (when (buffer-live-p ediff-buffer-A) (kill-buffer ediff-buffer-A))
-         (when (buffer-live-p ediff-buffer-B) (kill-buffer ediff-buffer-B))
-         (when (buffer-live-p ediff-buffer-C) (kill-buffer ediff-buffer-C))
-         (when (buffer-live-p ediff-ancestor-buffer)
-           (kill-buffer ediff-ancestor-buffer))
-         (let ((magit-ediff-previous-winconf smerge-ediff-windows))
-           (run-hooks 'magit-ediff-quit-hook)))))))
-
-;;;###autoload
-(defun magit-ediff-stage (file)
-  "Stage and unstage changes to FILE using Ediff.
-FILE has to be relative to the top directory of the repository."
-  (interactive
-   (list (magit-completing-read "Selectively stage file" nil
-                                (magit-tracked-files) nil nil nil
-                                (magit-current-file))))
-  (magit-with-toplevel
-    (let* ((conf (current-window-configuration))
-           (bufA (magit-get-revision-buffer "HEAD" file))
-           (bufB (get-buffer (concat file ".~{index}~")))
-           (bufBrw (and bufB (with-current-buffer bufB (not buffer-read-only))))
-           (bufC (get-file-buffer file))
-           (fileBufC (or bufC (find-file-noselect file)))
-           (coding-system-for-read
-            (with-current-buffer fileBufC buffer-file-coding-system)))
-      (ediff-buffers3
-       (or bufA (magit-find-file-noselect "HEAD" file))
-       (with-current-buffer (magit-find-file-index-noselect file t)
-         (setq buffer-read-only nil)
-         (current-buffer))
-       fileBufC
-       `((lambda ()
-           (setq-local
-            ediff-quit-hook
-            (lambda ()
-              (and (buffer-live-p ediff-buffer-B)
-                   (buffer-modified-p ediff-buffer-B)
-                   (with-current-buffer ediff-buffer-B
-                     (magit-update-index)))
-              (and (buffer-live-p ediff-buffer-C)
-                   (buffer-modified-p ediff-buffer-C)
-                   (with-current-buffer ediff-buffer-C
-                     (when (y-or-n-p
-                            (format "Save file %s? " buffer-file-name))
-                       (save-buffer))))
-              ,@(unless bufA '((ediff-kill-buffer-carefully ediff-buffer-A)))
-              ,@(if bufB
-                    (unless bufBrw '((with-current-buffer ediff-buffer-B
-                                       (setq buffer-read-only t))))
-                  '((ediff-kill-buffer-carefully ediff-buffer-B)))
-              ,@(unless bufC '((ediff-kill-buffer-carefully ediff-buffer-C)))
-              (let ((magit-ediff-previous-winconf ,conf))
-                (run-hooks 'magit-ediff-quit-hook))))))
-       'ediff-buffers3))))
-
-;;;###autoload
-(defun magit-ediff-compare (revA revB fileA fileB)
-  "Compare REVA:FILEA with REVB:FILEB using Ediff.
-
-FILEA and FILEB have to be relative to the top directory of the
-repository.  If REVA or REVB is nil, then this stands for the
-working tree state.
-
-If the region is active, use the revisions on the first and last
-line of the region.  With a prefix argument, instead of diffing
-the revisions, choose a revision to view changes along, starting
-at the common ancestor of both revisions (i.e., use a \"...\"
-range)."
-  (interactive (-let [(revA revB) (magit-ediff-compare--read-revisions
-                                   nil current-prefix-arg)]
-                 (nconc (list revA revB)
-                        (magit-ediff-read-files revA revB))))
-  (magit-with-toplevel
-    (let ((conf (current-window-configuration))
-          (bufA (if revA
-                    (magit-get-revision-buffer revA fileA)
-                  (get-file-buffer fileA)))
-          (bufB (if revB
-                    (magit-get-revision-buffer revB fileB)
-                  (get-file-buffer fileB))))
-      (ediff-buffers
-       (or bufA (if revA
-                    (magit-find-file-noselect revA fileA)
-                  (find-file-noselect fileA)))
-       (or bufB (if revB
-                    (magit-find-file-noselect revB fileB)
-                  (find-file-noselect fileB)))
-       `((lambda ()
-           (setq-local
-            ediff-quit-hook
-            (lambda ()
-              ,@(unless bufA '((ediff-kill-buffer-carefully ediff-buffer-A)))
-              ,@(unless bufB '((ediff-kill-buffer-carefully ediff-buffer-B)))
-              (let ((magit-ediff-previous-winconf ,conf))
-                (run-hooks 'magit-ediff-quit-hook))))))
-       'ediff-revision))))
-
-(defun magit-ediff-compare--read-revisions (&optional arg mbase)
-  (let ((input (or arg (magit-diff-read-range-or-commit
-                        "Compare range or commit"
-                        nil mbase))))
-    (--if-let (magit-split-range input)
-        (-cons-to-list it)
-      (list input nil))))
-
-(defun magit-ediff-read-files (revA revB &optional fileB)
-  "Read file in REVB, return it and the corresponding file in REVA.
-When FILEB is non-nil, use this as REVB's file instead of
-prompting for it."
-  (unless fileB
-    (setq fileB (magit-read-file-choice
-                 (format "File to compare between %s and %s"
-                         revA (or revB "the working tree"))
-                 (magit-changed-files revA revB)
-                 (format "No changed files between %s and %s"
-                         revA (or revB "the working tree")))))
-  (list (or (car (member fileB (magit-revision-files revA)))
-            (cdr (assoc fileB (magit-renamed-files revB revA)))
-            (magit-read-file-choice
-             (format "File in %s to compare with %s in %s"
-                     revA fileB (or revB "the working tree"))
-             (magit-changed-files revB revA)
-             (format "No files have changed between %s and %s"
-                     revA revB)))
-        fileB))
-
-;;;###autoload
-(defun magit-ediff-dwim ()
-  "Compare, stage, or resolve using Ediff.
-This command tries to guess what file, and what commit or range
-the user wants to compare, stage, or resolve using Ediff.  It
-might only be able to guess either the file, or range or commit,
-in which case the user is asked about the other.  It might not
-always guess right, in which case the appropriate `magit-ediff-*'
-command has to be used explicitly.  If it cannot read the user's
-mind at all, then it asks the user for a command to run."
-  (interactive)
-  (magit-section-case
-    (hunk (save-excursion
-            (goto-char (magit-section-start (magit-section-parent it)))
-            (magit-ediff-dwim)))
-    (t
-     (let ((range (magit-diff--dwim))
-           (file (magit-current-file))
-           command revA revB)
-       (pcase range
-         ((and (guard (not magit-ediff-dwim-show-on-hunks))
-               (or `unstaged `staged))
-          (setq command (if (magit-anything-unmerged-p)
-                            #'magit-ediff-resolve
-                          #'magit-ediff-stage)))
-         (`unstaged (setq command #'magit-ediff-show-unstaged))
-         (`staged (setq command #'magit-ediff-show-staged))
-         (`(commit . ,value)
-          (setq command #'magit-ediff-show-commit)
-          (setq revB value))
-         (`(stash . ,value)
-          (setq command #'magit-ediff-show-stash)
-          (setq revB value))
-         ((pred stringp)
-          (-let [(a b) (magit-ediff-compare--read-revisions range)]
-            (setq command #'magit-ediff-compare)
-            (setq revA a)
-            (setq revB b)))
-         (_
-          (when (derived-mode-p 'magit-diff-mode)
-            (pcase (magit-diff-type)
-              (`committed (-let [(a b) (magit-ediff-compare--read-revisions
-                                        (car magit-refresh-args))]
-                            (setq revA a)
-                            (setq revB b)))
-              ((guard (not magit-ediff-dwim-show-on-hunks))
-               (setq command #'magit-ediff-stage))
-              (`unstaged  (setq command #'magit-ediff-show-unstaged))
-              (`staged    (setq command #'magit-ediff-show-staged))
-              (`undefined (setq command nil))
-              (_          (setq command nil))))))
-       (cond ((not command)
-              (call-interactively
-               (magit-read-char-case
-                   "Failed to read your mind; do you want to " t
-                 (?c "[c]ommit"  'magit-ediff-show-commit)
-                 (?r "[r]ange"   'magit-ediff-compare)
-                 (?s "[s]tage"   'magit-ediff-stage)
-                 (?v "resol[v]e" 'magit-ediff-resolve))))
-             ((eq command 'magit-ediff-compare)
-              (apply 'magit-ediff-compare revA revB
-                     (magit-ediff-read-files revA revB file)))
-             ((eq command 'magit-ediff-show-commit)
-              (magit-ediff-show-commit revB))
-             ((eq command 'magit-ediff-show-stash)
-              (magit-ediff-show-stash revB))
-             (file
-              (funcall command file))
-             (t
-              (call-interactively command)))))))
-
-;;;###autoload
-(defun magit-ediff-show-staged (file)
-  "Show staged changes using Ediff.
-
-This only allows looking at the changes; to stage, unstage,
-and discard changes using Ediff, use `magit-ediff-stage'.
-
-FILE must be relative to the top directory of the repository."
-  (interactive
-   (list (magit-read-file-choice "Show staged changes for file"
-                                 (magit-staged-files)
-                                 "No staged files")))
-  (let ((conf (current-window-configuration))
-        (bufA (magit-get-revision-buffer "HEAD" file))
-        (bufB (get-buffer (concat file ".~{index}~"))))
-    (ediff-buffers
-     (or bufA (magit-find-file-noselect "HEAD" file))
-     (or bufB (magit-find-file-index-noselect file t))
-     `((lambda ()
-         (setq-local
-          ediff-quit-hook
-          (lambda ()
-            ,@(unless bufA '((ediff-kill-buffer-carefully ediff-buffer-A)))
-            ,@(unless bufB '((ediff-kill-buffer-carefully ediff-buffer-B)))
-            (let ((magit-ediff-previous-winconf ,conf))
-              (run-hooks 'magit-ediff-quit-hook))))))
-     'ediff-buffers)))
-
-;;;###autoload
-(defun magit-ediff-show-unstaged (file)
-  "Show unstaged changes using Ediff.
-
-This only allows looking at the changes; to stage, unstage,
-and discard changes using Ediff, use `magit-ediff-stage'.
-
-FILE must be relative to the top directory of the repository."
-  (interactive
-   (list (magit-read-file-choice "Show unstaged changes for file"
-                                 (magit-unstaged-files)
-                                 "No unstaged files")))
-  (magit-with-toplevel
-    (let ((conf (current-window-configuration))
-          (bufA (get-buffer (concat file ".~{index}~")))
-          (bufB (get-file-buffer file)))
-      (ediff-buffers
-       (or bufA (magit-find-file-index-noselect file t))
-       (or bufB (find-file-noselect file))
-       `((lambda ()
-           (setq-local
-            ediff-quit-hook
-            (lambda ()
-              ,@(unless bufA '((ediff-kill-buffer-carefully ediff-buffer-A)))
-              ,@(unless bufB '((ediff-kill-buffer-carefully ediff-buffer-B)))
-              (let ((magit-ediff-previous-winconf ,conf))
-                (run-hooks 'magit-ediff-quit-hook))))))
-       'ediff-buffers))))
-
-;;;###autoload
-(defun magit-ediff-show-working-tree (file)
-  "Show changes between `HEAD' and working tree using Ediff.
-FILE must be relative to the top directory of the repository."
-  (interactive
-   (list (magit-read-file-choice "Show changes in file"
-                                 (magit-changed-files "HEAD")
-                                 "No changed files")))
-  (magit-with-toplevel
-    (let ((conf (current-window-configuration))
-          (bufA (magit-get-revision-buffer "HEAD" file))
-          (bufB (get-file-buffer file)))
-      (ediff-buffers
-       (or bufA (magit-find-file-noselect "HEAD" file))
-       (or bufB (find-file-noselect file))
-       `((lambda ()
-           (setq-local
-            ediff-quit-hook
-            (lambda ()
-              ,@(unless bufA '((ediff-kill-buffer-carefully ediff-buffer-A)))
-              ,@(unless bufB '((ediff-kill-buffer-carefully ediff-buffer-B)))
-              (let ((magit-ediff-previous-winconf ,conf))
-                (run-hooks 'magit-ediff-quit-hook))))))
-       'ediff-buffers))))
-
-;;;###autoload
-(defun magit-ediff-show-commit (commit)
-  "Show changes introduced by COMMIT using Ediff."
-  (interactive (list (magit-read-branch-or-commit "Revision")))
-  (let ((revA (concat commit "^"))
-        (revB commit))
-    (apply #'magit-ediff-compare
-           revA revB
-           (magit-ediff-read-files revA revB (magit-current-file)))))
-
-;;;###autoload
-(defun magit-ediff-show-stash (stash)
-  "Show changes introduced by STASH using Ediff.
-`magit-ediff-show-stash-with-index' controls whether a
-three-buffer Ediff is used in order to distinguish changes in the
-stash that were staged."
-  (interactive (list (magit-read-stash "Stash")))
-  (-let* ((revA (concat stash "^1"))
-          (revB (concat stash "^2"))
-          (revC stash)
-          ((fileA fileC) (magit-ediff-read-files revA revC))
-          (fileB fileC))
-    (if (and magit-ediff-show-stash-with-index
-             (member fileA (magit-changed-files revB revA)))
-        (let ((conf (current-window-configuration))
-              (bufA (magit-get-revision-buffer revA fileA))
-              (bufB (magit-get-revision-buffer revB fileB))
-              (bufC (magit-get-revision-buffer revC fileC)))
-          (ediff-buffers3
-           (or bufA (magit-find-file-noselect revA fileA))
-           (or bufB (magit-find-file-noselect revB fileB))
-           (or bufC (magit-find-file-noselect revC fileC))
-           `((lambda ()
-               (setq-local
-                ediff-quit-hook
-                (lambda ()
-                  ,@(unless bufA
-                      '((ediff-kill-buffer-carefully ediff-buffer-A)))
-                  ,@(unless bufB
-                      '((ediff-kill-buffer-carefully ediff-buffer-B)))
-                  ,@(unless bufC
-                      '((ediff-kill-buffer-carefully ediff-buffer-C)))
-                  (let ((magit-ediff-previous-winconf ,conf))
-                    (run-hooks 'magit-ediff-quit-hook))))))
-           'ediff-buffers3))
-      (magit-ediff-compare revA revC fileA fileC))))
-
-(defun magit-ediff-cleanup-auxiliary-buffers ()
-  (let* ((ctl-buf ediff-control-buffer)
-         (ctl-win (ediff-get-visible-buffer-window ctl-buf))
-         (ctl-frm ediff-control-frame)
-         (main-frame (cond ((window-live-p ediff-window-A)
-                            (window-frame ediff-window-A))
-                           ((window-live-p ediff-window-B)
-                            (window-frame ediff-window-B)))))
-    (ediff-kill-buffer-carefully ediff-diff-buffer)
-    (ediff-kill-buffer-carefully ediff-custom-diff-buffer)
-    (ediff-kill-buffer-carefully ediff-fine-diff-buffer)
-    (ediff-kill-buffer-carefully ediff-tmp-buffer)
-    (ediff-kill-buffer-carefully ediff-error-buffer)
-    (ediff-kill-buffer-carefully ediff-msg-buffer)
-    (ediff-kill-buffer-carefully ediff-debug-buffer)
-    (when (boundp 'ediff-patch-diagnostics)
-      (ediff-kill-buffer-carefully ediff-patch-diagnostics))
-    (cond ((and (ediff-window-display-p)
-                (frame-live-p ctl-frm))
-           (delete-frame ctl-frm))
-          ((window-live-p ctl-win)
-           (delete-window ctl-win)))
-    (unless (ediff-multiframe-setup-p)
-      (ediff-kill-bottom-toolbar))
-    (ediff-kill-buffer-carefully ctl-buf)
-    (when (frame-live-p main-frame)
-      (select-frame main-frame))))
-
-(defun magit-ediff-restore-previous-winconf ()
-  (set-window-configuration magit-ediff-previous-winconf))
-
-(provide 'magit-ediff)
-;;; magit-ediff.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-ediff.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-extras.el
@@ -1,265 +0,0 @@
-;;; magit-extras.el --- additional functionality for Magit  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2008-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; Additional functionality for Magit.
-
-;;; Code:
-
-(require 'magit)
-
-(declare-function dired-do-shell-command 'dired-aux)
-(declare-function dired-read-shell-command 'dired-aux)
-
-(defgroup magit-extras nil
-  "Additional functionality for Magit."
-  :group 'magit-extensions)
-
-;;; External Tools
-
-(defcustom magit-gitk-executable
-  (or (and (eq system-type 'windows-nt)
-           (let ((exe (expand-file-name
-                       "gitk" (file-name-nondirectory magit-git-executable))))
-             (and (file-executable-p exe) exe)))
-      (executable-find "gitk") "gitk")
-  "The Gitk executable."
-  :group 'magit-extras
-  :set-after '(magit-git-executable)
-  :type 'string)
-
-;;;###autoload
-(defun magit-run-git-gui ()
-  "Run `git gui' for the current git repository."
-  (interactive)
-  (magit-with-toplevel
-    (magit-process-file magit-git-executable nil 0 nil "gui")))
-
-;;;###autoload
-(defun magit-run-git-gui-blame (commit filename &optional linenum)
-  "Run `git gui blame' on the given FILENAME and COMMIT.
-Interactively run it for the current file and the `HEAD', with a
-prefix or when the current file cannot be determined let the user
-choose.  When the current buffer is visiting FILENAME instruct
-blame to center around the line point is on."
-  (interactive
-   (let (revision filename)
-     (when (or current-prefix-arg
-               (not (setq revision "HEAD"
-                          filename (magit-file-relative-name nil 'tracked))))
-       (setq revision (magit-read-branch-or-commit "Blame from revision"))
-       (setq filename (magit-read-file-from-rev revision "Blame file")))
-     (list revision filename
-           (and (equal filename
-                       (ignore-errors
-                         (magit-file-relative-name buffer-file-name)))
-                (line-number-at-pos)))))
-  (magit-with-toplevel
-    (apply #'magit-process-file magit-git-executable nil 0 nil "gui" "blame"
-           `(,@(and linenum (list (format "--line=%d" linenum)))
-             ,commit
-             ,filename))))
-
-;;;###autoload
-(defun magit-run-gitk ()
-  "Run `gitk' in the current repository."
-  (interactive)
-  (magit-process-file magit-gitk-executable nil 0))
-
-;;;###autoload
-(defun magit-run-gitk-branches ()
-  "Run `gitk --branches' in the current repository."
-  (interactive)
-  (magit-process-file magit-gitk-executable nil 0 nil "--branches"))
-
-;;;###autoload
-(defun magit-run-gitk-all ()
-  "Run `gitk --all' in the current repository."
-  (interactive)
-  (magit-process-file magit-gitk-executable nil 0 nil "--all"))
-
-;;; Emacs Tools
-
-;;;###autoload
-(defun ido-enter-magit-status ()
-  "Drop into `magit-status' from file switching.
-
-To make this command available use something like:
-
-  (add-hook \\='ido-setup-hook
-            (lambda ()
-              (define-key ido-completion-map
-                (kbd \"C-x g\") \\='ido-enter-magit-status)))
-
-Starting with Emacs 25.1 the Ido keymaps are defined just once
-instead of every time Ido is invoked, so now you can modify it
-like pretty much every other keymap:
-
-  (define-key ido-common-completion-map
-    (kbd \"C-x g\") 'ido-enter-magit-status)"
-  (interactive)
-  (with-no-warnings ; FIXME these are internal variables
-    (setq ido-exit 'fallback fallback 'magit-status))
-  (exit-minibuffer))
-
-;;;###autoload
-(defun magit-dired-jump (&optional other-window)
-  "Visit file at point using Dired.
-With a prefix argument, visit in another window.  If there
-is no file at point, then instead visit `default-directory'."
-  (interactive "P")
-  (dired-jump other-window (-if-let (file (magit-file-at-point))
-                               (progn (setq file (expand-file-name file))
-                                      (if (file-directory-p file)
-                                          (concat file "/.")
-                                        file))
-                             (concat default-directory "/."))))
-
-;;;###autoload
-(defun magit-do-async-shell-command (file)
-  "Open FILE with `dired-do-async-shell-command'.
-Interactively, open the file at point."
-  (interactive (list (or (magit-file-at-point)
-                         (completing-read "Act on file: "
-                                          (magit-list-files)))))
-  (require 'dired-aux)
-  (dired-do-async-shell-command
-   (dired-read-shell-command "& on %s: " current-prefix-arg (list file))
-   nil (list file)))
-
-;;; Clean
-
-;;;###autoload
-(defun magit-clean (&optional arg)
-  "Remove untracked files from the working tree.
-With a prefix argument also remove ignored files,
-with two prefix arguments remove ignored files only.
-\n(git clean -f -d [-x|-X])"
-  (interactive "p")
-  (when (yes-or-no-p (format "Remove %s files? "
-                             (pcase arg
-                               (1 "untracked")
-                               (4 "untracked and ignored")
-                               (_ "ignored"))))
-    (magit-wip-commit-before-change)
-    (magit-run-git "clean" "-f" "-d" (pcase arg (4 "-x") (16 "-X")))))
-
-(put 'magit-clean 'disabled t)
-
-;;; Gitignore
-
-;;;###autoload
-(defun magit-gitignore (file-or-pattern &optional local)
-  "Instruct Git to ignore FILE-OR-PATTERN.
-With a prefix argument only ignore locally."
-  (interactive (list (magit-gitignore-read-pattern current-prefix-arg)
-                     current-prefix-arg))
-  (let ((gitignore
-         (if local
-             (magit-git-dir (convert-standard-filename "info/exclude"))
-           (expand-file-name ".gitignore" (magit-toplevel)))))
-    (make-directory (file-name-directory gitignore) t)
-    (with-temp-buffer
-      (when (file-exists-p gitignore)
-        (insert-file-contents gitignore))
-      (goto-char (point-max))
-      (unless (bolp)
-        (insert "\n"))
-      (insert (replace-regexp-in-string "\\(\\\\*\\)" "\\1\\1" file-or-pattern))
-      (insert "\n")
-      (write-region nil nil gitignore))
-    (if local
-        (magit-refresh)
-      (magit-run-git "add" ".gitignore"))))
-
-;;;###autoload
-(defun magit-gitignore-locally (file-or-pattern)
-  "Instruct Git to locally ignore FILE-OR-PATTERN."
-  (interactive (list (magit-gitignore-read-pattern t)))
-  (magit-gitignore file-or-pattern t))
-
-(defun magit-gitignore-read-pattern (local)
-  (let* ((default (magit-current-file))
-         (choices
-          (delete-dups
-           (--mapcat
-            (cons (concat "/" it)
-                  (-when-let (ext (file-name-extension it))
-                    (list (concat "/" (file-name-directory "foo") "*." ext)
-                          (concat "*." ext))))
-            (magit-untracked-files)))))
-    (when default
-      (setq default (concat "/" default))
-      (unless (member default choices)
-        (setq default (concat "*." (file-name-extension default)))
-        (unless (member default choices)
-          (setq default nil))))
-    (magit-completing-read (concat "File or pattern to ignore"
-                                   (and local " locally"))
-                           choices nil nil nil nil default)))
-
-;;; ChangeLog
-
-;;;###autoload
-(defun magit-add-change-log-entry (&optional whoami file-name other-window)
-  "Find change log file and add date entry and item for current change.
-This differs from `add-change-log-entry' (which see) in that
-it acts on the current hunk in a Magit buffer instead of on
-a position in a file-visiting buffer."
-  (interactive (list current-prefix-arg
-                     (prompt-for-change-log-name)))
-  (let (buf pos)
-    (save-window-excursion
-      (call-interactively #'magit-diff-visit-file)
-      (setq buf (current-buffer))
-      (setq pos (point)))
-    (save-excursion
-      (with-current-buffer buf
-        (goto-char pos)
-        (add-change-log-entry whoami file-name other-window)))))
-
-;;;###autoload
-(defun magit-add-change-log-entry-other-window (&optional whoami file-name)
-  "Find change log file in other window and add entry and item.
-This differs from `add-change-log-entry-other-window' (which see)
-in that it acts on the current hunk in a Magit buffer instead of
-on a position in a file-visiting buffer."
-  (interactive (and current-prefix-arg
-                    (list current-prefix-arg
-                          (prompt-for-change-log-name))))
-  (magit-add-change-log-entry whoami file-name t))
-
-;;; Miscellaneous
-
-;;;###autoload
-(defun magit-abort-dwim ()
-  "Abort current operation.
-Depending on the context, this will abort a merge, a rebase, a
-patch application, a cherry-pick, a revert, or a bisect."
-  (interactive)
-  (cond ((magit-merge-state)             (magit-merge-abort))
-        ((magit-rebase-in-progress-p)    (magit-rebase-abort))
-        ((magit-am-in-progress-p)        (magit-am-abort))
-        ((magit-sequencer-in-progress-p) (magit-sequencer-abort))
-        ((magit-bisect-in-progress-p)    (magit-bisect-reset))))
-
-(provide 'magit-extras)
-;;; magit-extras.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-extras.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-files.el
@@ -1,443 +0,0 @@
-;;; magit-files.el --- finding files  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements support for finding blobs, staged files,
-;; and Git configuration files.  It also implements modes useful in
-;; buffers visiting files and blobs, and the commands used by those
-;; modes.
-
-;;; Code:
-
-(require 'magit)
-
-;;; Find Blob
-
-(defvar magit-find-file-hook nil)
-(add-hook 'magit-find-file-hook #'magit-blob-mode)
-
-;;;###autoload
-(defun magit-find-file (rev file)
-  "View FILE from REV.
-Switch to a buffer visiting blob REV:FILE,
-creating one if none already exists."
-  (interactive (magit-find-file-read-args "Find file"))
-  (switch-to-buffer (magit-find-file-noselect rev file)))
-
-;;;###autoload
-(defun magit-find-file-other-window (rev file)
-  "View FILE from REV, in another window.
-Like `magit-find-file', but create a new window or reuse an
-existing one."
-  (interactive (magit-find-file-read-args "Find file in other window"))
-  (switch-to-buffer-other-window (magit-find-file-noselect rev file)))
-
-(defun magit-find-file-read-args (prompt)
-  (let  ((rev (magit-read-branch-or-commit "Find file from revision")))
-    (list rev (magit-read-file-from-rev rev prompt))))
-
-(defun magit-find-file-noselect (rev file)
-  "Read FILE from REV into a buffer and return the buffer.
-FILE must be relative to the top directory of the repository."
-  (magit-find-file-noselect-1 rev file 'magit-find-file-hook))
-
-(defun magit-find-file-noselect-1 (rev file hookvar &optional revert)
-  "Read FILE from REV into a buffer and return the buffer.
-FILE must be relative to the top directory of the repository.
-An empty REV stands for index."
-  (let ((topdir (magit-toplevel)))
-    (when (file-name-absolute-p file)
-      (setq file (file-relative-name file topdir)))
-    (with-current-buffer (magit-get-revision-buffer-create rev file)
-      (when (or (not magit-buffer-file-name)
-                (if (eq revert 'ask-revert)
-                    (y-or-n-p (format "%s already exists; revert it? "
-                                      (buffer-name))))
-                revert)
-        (setq magit-buffer-revision
-              (if (string= rev "") "{index}" (magit-rev-format "%H" rev)))
-        (setq magit-buffer-refname rev)
-        (setq magit-buffer-file-name (expand-file-name file topdir))
-        (setq default-directory
-              (let ((dir (file-name-directory magit-buffer-file-name)))
-                (if (file-exists-p dir) dir topdir)))
-        (setq-local revert-buffer-function #'magit-revert-rev-file-buffer)
-        (revert-buffer t t)
-        (run-hooks hookvar))
-      (current-buffer))))
-
-(defun magit-get-revision-buffer-create (rev file)
-  (magit-get-revision-buffer rev file t))
-
-(defun magit-get-revision-buffer (rev file &optional create)
-  (funcall (if create 'get-buffer-create 'get-buffer)
-           (format "%s.~%s~" file (if (equal rev "") "index"
-                                    (subst-char-in-string ?/ ?_ rev)))))
-
-(defun magit-revert-rev-file-buffer (_ignore-auto noconfirm)
-  (when (or noconfirm
-            (and (not (buffer-modified-p))
-                 (catch 'found
-                   (dolist (regexp revert-without-query)
-                     (when (string-match regexp magit-buffer-file-name)
-                       (throw 'found t)))))
-            (yes-or-no-p (format "Revert buffer from git %s? "
-                                 (if (equal magit-buffer-refname "") "{index}"
-                                   (concat "revision " magit-buffer-refname)))))
-    (let* ((inhibit-read-only t)
-           (default-directory (magit-toplevel))
-           (file (file-relative-name magit-buffer-file-name))
-           (coding-system-for-read (or coding-system-for-read 'undecided)))
-      (erase-buffer)
-      (magit-git-insert "cat-file" "-p" (concat magit-buffer-refname ":" file))
-      (setq buffer-file-coding-system last-coding-system-used))
-    (let ((buffer-file-name magit-buffer-file-name)
-          (after-change-major-mode-hook
-           (remq 'global-diff-hl-mode-enable-in-buffers
-                 after-change-major-mode-hook)))
-      (normal-mode t))
-    (setq buffer-read-only t)
-    (set-buffer-modified-p nil)
-    (goto-char (point-min))))
-
-;;; Find Index
-
-(defvar magit-find-index-hook nil)
-
-(defun magit-find-file-index-noselect (file &optional revert)
-  "Read FILE from the index into a buffer and return the buffer.
-FILE must to be relative to the top directory of the repository."
-  (magit-find-file-noselect-1 "" file 'magit-find-index-hook
-                              (or revert 'ask-revert)))
-
-(defun magit-update-index ()
-  "Update the index with the contents of the current buffer.
-The current buffer has to be visiting a file in the index, which
-is done using `magit-find-index-noselect'."
-  (interactive)
-  (let ((file (magit-file-relative-name)))
-    (unless (equal magit-buffer-refname "")
-      (user-error "%s isn't visiting the index" file))
-    (if (y-or-n-p (format "Update index with contents of %s" (buffer-name)))
-        (let ((index (make-temp-file "index"))
-              (buffer (current-buffer)))
-          (when magit-wip-before-change-mode
-            (magit-wip-commit-before-change (list file) " before un-/stage"))
-          (let ((coding-system-for-write buffer-file-coding-system))
-            (with-temp-file index
-              (insert-buffer-substring buffer)))
-          (magit-with-toplevel
-            (magit-call-git "update-index" "--cacheinfo"
-                            (substring (magit-git-string "ls-files" "-s" file)
-                                       0 6)
-                            (magit-git-string "hash-object" "-t" "blob" "-w"
-                                              (concat "--path=" file)
-                                              "--" index)
-                            file))
-          (set-buffer-modified-p nil)
-          (when magit-wip-after-apply-mode
-            (magit-wip-commit-after-apply (list file) " after un-/stage")))
-      (message "Abort")))
-  (--when-let (magit-mode-get-buffer 'magit-status-mode)
-    (with-current-buffer it (magit-refresh)))
-  t)
-
-;;; Find Config File
-
-(defun magit-find-git-config-file (filename &optional wildcards)
-  "Edit a file located in the current repository's git directory.
-
-When \".git\", located at the root of the working tree, is a
-regular file, then that makes it cumbersome to open a file
-located in the actual git directory.
-
-This command is like `find-file', except that it temporarily
-binds `default-directory' to the actual git directory, while
-reading the FILENAME."
-  (interactive
-   (let ((default-directory (magit-git-dir)))
-     (find-file-read-args "Find file: "
-                          (confirm-nonexistent-file-or-buffer))))
-  (find-file filename wildcards))
-
-(defun magit-find-git-config-file-other-window (filename &optional wildcards)
-  "Edit a file located in the current repository's git directory, in another window.
-
-When \".git\", located at the root of the working tree, is a
-regular file, then that makes it cumbersome to open a file
-located in the actual git directory.
-
-This command is like `find-file-other-window', except that it
-temporarily binds `default-directory' to the actual git
-directory, while reading the FILENAME."
-  (interactive
-   (let ((default-directory (magit-git-dir)))
-     (find-file-read-args "Find file in other window: "
-                          (confirm-nonexistent-file-or-buffer))))
-  (find-file-other-window filename wildcards))
-
-(defun magit-find-git-config-file-other-frame (filename &optional wildcards)
-  "Edit a file located in the current repository's git directory, in another frame.
-
-When \".git\", located at the root of the working tree, is a
-regular file, then that makes it cumbersome to open a file
-located in the actual git directory.
-
-This command is like `find-file-other-frame', except that it
-temporarily binds `default-directory' to the actual git
-directory, while reading the FILENAME."
-  (interactive
-   (let ((default-directory (magit-git-dir)))
-     (find-file-read-args "Find file in other frame: "
-                          (confirm-nonexistent-file-or-buffer))))
-  (find-file-other-frame filename wildcards))
-
-;;; File Mode
-
-(defvar magit-file-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "\C-xg"    'magit-status)
-    (define-key map "\C-x\M-g" 'magit-dispatch-popup)
-    (define-key map "\C-c\M-g" 'magit-file-popup)
-    map)
-  "Keymap for `magit-file-mode'.")
-
-;;;###autoload (autoload 'magit-file-popup "magit" nil t)
-(magit-define-popup magit-file-popup
-  "Popup console for Magit commands in file-visiting buffers."
-  :actions '((?s "Stage"     magit-stage-file)
-             (?d "Diff"      magit-diff-buffer-file)
-             (?l "Log"       magit-log-buffer-file)
-             (?b "Blame"     magit-blame-popup)
-             (?u "Unstage"   magit-unstage-file)
-             (?D "Diff..."   magit-diff-buffer-file-popup)
-             (?L "Log..."    magit-log-buffer-file-popup)
-             (?p "Find blob" magit-blob-previous)
-             (?c "Commit"    magit-commit-popup))
-  :max-action-columns 4)
-
-(defvar magit-file-mode-lighter "")
-
-(define-minor-mode magit-file-mode
-  "Enable some Magit features in a file-visiting buffer.
-
-Currently this only adds the following key bindings.
-\n\\{magit-file-mode-map}"
-  :package-version '(magit . "2.2.0")
-  :lighter magit-file-mode-lighter
-  :keymap  magit-file-mode-map)
-
-(defun magit-file-mode-turn-on ()
-  (and buffer-file-name
-       (ignore-errors (magit-inside-worktree-p))
-       (magit-file-mode)))
-
-;;;###autoload
-(define-globalized-minor-mode global-magit-file-mode
-  magit-file-mode magit-file-mode-turn-on
-  :package-version '(magit . "2.2.0")
-  :link '(info-link "(magit)Minor Mode for Buffers Visiting Files")
-  :group 'magit-essentials
-  :group 'magit-modes)
-
-;;; Blob Mode
-
-(defvar magit-blob-mode-map
-  (let ((map (make-sparse-keymap)))
-    (cond ((featurep 'jkl)
-           (define-key map "i" 'magit-blob-previous)
-           (define-key map "k" 'magit-blob-next))
-          (t
-           (define-key map "p" 'magit-blob-previous)
-           (define-key map "n" 'magit-blob-next)))
-    (define-key map "q" 'magit-kill-this-buffer)
-    map)
-  "Keymap for `magit-blob-mode'.")
-
-(define-minor-mode magit-blob-mode
-  "Enable some Magit features in blob-visiting buffers.
-
-Currently this only adds the following key bindings.
-\n\\{magit-blob-mode-map}"
-  :package-version '(magit . "2.3.0"))
-
-(defun magit-blob-next ()
-  "Visit the next blob which modified the current file."
-  (interactive)
-  (if magit-buffer-file-name
-      (magit-blob-visit (or (magit-blob-successor magit-buffer-revision
-                                                  magit-buffer-file-name)
-                            magit-buffer-file-name)
-                        (line-number-at-pos))
-    (if (buffer-file-name (buffer-base-buffer))
-        (user-error "You have reached the end of time")
-      (user-error "Buffer isn't visiting a file or blob"))))
-
-(defun magit-blob-previous ()
-  "Visit the previous blob which modified the current file."
-  (interactive)
-  (-if-let (file (or magit-buffer-file-name
-                     (buffer-file-name (buffer-base-buffer))))
-      (--if-let (magit-blob-ancestor magit-buffer-revision file)
-          (magit-blob-visit it (line-number-at-pos))
-        (user-error "You have reached the beginning of time"))
-    (user-error "Buffer isn't visiting a file or blob")))
-
-(defun magit-blob-visit (blob-or-file line)
-  (if (stringp blob-or-file)
-      (find-file blob-or-file)
-    (-let [(rev file) blob-or-file]
-      (magit-find-file rev file)
-      (apply #'message "%s (%s %s ago)"
-             (magit-rev-format "%s" rev)
-             (magit--age (magit-rev-format "%ct" rev)))))
-  (goto-char (point-min))
-  (forward-line (1- line)))
-
-(defun magit-blob-ancestor (rev file)
-  (let ((lines (magit-with-toplevel
-                 (magit-git-lines "log" "-2" "--format=%H" "--name-only"
-                                  "--follow" (or rev "HEAD") "--" file))))
-    (if rev (cddr lines) (butlast lines 2))))
-
-(defun magit-blob-successor (rev file)
-  (let ((lines (magit-with-toplevel
-                 (magit-git-lines "log" "--format=%H" "--name-only" "--follow"
-                                  "HEAD" "--" file))))
-    (catch 'found
-      (while lines
-        (if (equal (nth 2 lines) rev)
-            (throw 'found (list (nth 0 lines) (nth 1 lines)))
-          (setq lines (nthcdr 2 lines)))))))
-
-;;; File Commands
-
-(defun magit-file-rename (file newname)
-  "Rename the FILE to NEWNAME.
-If FILE isn't tracked in Git, fallback to using `rename-file'."
-  (interactive
-   (let* ((file (magit-read-file "Rename file"))
-          (newname (read-file-name (format "Rename %s to file: " file))))
-     (list (expand-file-name file (magit-toplevel))
-           (expand-file-name newname))))
-  (if (magit-file-tracked-p file)
-      (let ((oldbuf (get-file-buffer file)))
-        (when (and oldbuf (buffer-modified-p oldbuf))
-          (user-error "Save %s before moving it" file))
-        (when (file-exists-p newname)
-          (user-error "%s already exists" newname))
-        (magit-run-git "mv" file newname)
-        (when oldbuf
-          (with-current-buffer oldbuf
-            (let ((buffer-read-only buffer-read-only))
-              (set-visited-file-name newname))
-            (if (fboundp 'vc-refresh-state)
-                (vc-refresh-state)
-              (with-no-warnings
-                (vc-find-file-hook))))))
-    (rename-file file newname current-prefix-arg)
-    (magit-refresh)))
-
-(defun magit-file-untrack (file)
-  "Untrack FILE.
-Stop tracking FILE in Git but do not remove it from the working
-tree."
-  (interactive (list (magit-read-tracked-file "Untrack file")))
-  (magit-run-git "rm" "--cached" "--" file))
-
-(defun magit-file-delete (file &optional force)
-  "Delete FILE.
-With a prefix argument FORCE do so even when FILE has uncommitted
-changes.
-
-If FILE isn't tracked in Git, fallback to using `delete-file'."
-  (interactive (list (magit-read-file "Delete file")))
-  (if (magit-file-tracked-p file)
-      (magit-run-git "rm" (and force "--force") "--" file)
-    (delete-file (expand-file-name file (magit-toplevel)) t)
-    (magit-refresh)))
-
-;;;###autoload
-(defun magit-file-checkout (rev file)
-  "Checkout FILE from REV."
-  (interactive
-   (let ((rev (magit-read-branch-or-commit
-               "Checkout from revision" magit-buffer-revision)))
-     (list rev (magit-read-file-from-rev rev "Checkout file"))))
-  (magit-with-toplevel
-    (magit-run-git "checkout" rev "--" file)))
-
-;;; Read File
-
-(defvar magit-read-file-hist nil)
-
-(defun magit-read-file-from-rev (rev prompt &optional default)
-  (let ((files (magit-revision-files rev)))
-    (magit-completing-read
-     prompt files nil t nil 'magit-read-file-hist
-     (car (member (or default (magit-current-file)) files)))))
-
-(defun magit-read-file (prompt &optional tracked-only)
-  (let ((choices (nconc (magit-list-files)
-                        (unless tracked-only (magit-untracked-files)))))
-    (magit-completing-read prompt choices nil t nil nil
-                           (car (member (or (magit-section-when (file submodule))
-                                            (magit-file-relative-name
-                                             nil tracked-only))
-                                        choices)))))
-
-(defun magit-read-tracked-file (prompt)
-  (magit-read-file prompt t))
-
-(defun magit-read-file-choice (prompt files &optional error default)
-  "Read file from FILES.
-
-If FILES has only one member, return that instead of prompting.
-If FILES has no members, give a user error.  ERROR can be given
-to provide a more informative error.
-
-If DEFAULT is non-nil, use this as the default value instead of
-`magit-current-file'."
-  (pcase (length files)
-    (0 (user-error (or error "No file choices")))
-    (1 (car files))
-    (_ (magit-completing-read
-        prompt files nil t nil 'magit-read-file-hist
-        (car (member (or default (magit-current-file)) files))))))
-
-(defun magit-read-changed-file (rev-or-range prompt &optional default)
-  (magit-read-file-choice
-   prompt
-   (magit-changed-files rev-or-range)
-   default
-   (concat "No file changed in " rev-or-range)))
-
-(defun magit-read-files (prompt initial-contents)
-  (mapconcat 'identity
-             (completing-read-multiple (or prompt "File,s: ")
-                                       (magit-list-files)
-                                       nil nil initial-contents) ","))
-
-(provide 'magit-files)
-;;; magit-files.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-files.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-git.el
@@ -1,1712 +0,0 @@
-;;; magit-git.el --- Git functionality  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements wrappers for various Git plumbing commands.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'dash)
-
-(require 'magit-utils)
-(require 'magit-section)
-
-(declare-function magit-maybe-make-margin-overlay 'magit-log)
-(declare-function magit-process-buffer 'magit-process)
-(declare-function magit-process-file 'magit-process)
-(declare-function magit-process-insert-section 'magit-process)
-(defvar magit-process-error-message-re)
-(defvar magit-refresh-args) ; from `magit-mode' for `magit-current-file'
-(defvar magit-branch-prefer-remote-upstream)
-
-(defvar magit-tramp-process-environment nil)
-
-;;; Options
-
-;; For now this is shared between `magit-process' and `magit-git'.
-(defgroup magit-process nil
-  "Git and other external processes used by Magit."
-  :group 'magit)
-
-(defvar magit-git-environment
-  (list (format "INSIDE_EMACS=%s,magit" emacs-version))
-  "Prepended to `process-environment' while running git.")
-
-(defcustom magit-git-output-coding-system
-  (and (eq system-type 'windows-nt) 'utf-8)
-  "Coding system for receiving output from Git.
-
-If non-nil, the Git config value `i18n.logOutputEncoding' should
-be set via `magit-git-global-arguments' to value consistent with
-this."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-process
-  :type '(choice (coding-system :tag "Coding system to decode Git output")
-                 (const :tag "Use system default" nil)))
-
-(defcustom magit-git-executable
-  ;; Git might be installed in a different location on a remote, so
-  ;; it is better not to use the full path to the executable, except
-  ;; on Window were we would otherwise end up using one one of the
-  ;; wrappers "cmd/git.exe" or "cmd/git.cmd", which are much slower
-  ;; than using "bin/git.exe" directly.
-  (or (and (eq system-type 'windows-nt)
-           (--when-let (executable-find "git")
-             (or (ignore-errors
-                   ;; Git for Windows 2.x provides cygpath so we can
-                   ;; ask it for native paths.  Using an upper case
-                   ;; alias makes this fail on 1.x (which is good,
-                   ;; because we would not want to end up using some
-                   ;; other cygpath).
-                   (prog1 (car
-                           (process-lines
-                            it "-c"
-                            "alias.X=!x() { which \"$1\" | cygpath -mf -; }; x"
-                            "X" "git"))
-                     (setq magit-git-environment
-                           (cons (concat "PATH="
-                                         (car (process-lines
-                                               it "-c"
-                                               "alias.P=!cygpath -wp \"$PATH\""
-                                               "P")))
-                                 magit-git-environment))))
-                 ;; For 1.x, we search for bin/ next to cmd/.
-                 (let ((alt (directory-file-name (file-name-directory it))))
-                   (if (and (equal (file-name-nondirectory alt) "cmd")
-                            (setq alt (expand-file-name
-                                       (convert-standard-filename "bin/git.exe")
-                                       (file-name-directory alt)))
-                            (file-executable-p alt))
-                       alt
-                     it)))))
-      "git")
-  "The Git executable used by Magit."
-  :group 'magit-process
-  :type 'string)
-
-(defcustom magit-git-global-arguments
-  `("--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true"
-    "-c" "log.showSignature=false"
-    ,@(and (eq system-type 'windows-nt)
-           (list "-c" "i18n.logOutputEncoding=UTF-8")))
-  "Global Git arguments.
-
-The arguments set here are used every time the git executable is
-run as a subprocess.  They are placed right after the executable
-itself and before the git command - as in `git HERE... COMMAND
-REST'.  See the manpage `git(1)' for valid arguments.
-
-Be careful what you add here, especially if you are using Tramp
-to connect to servers with ancient Git versions.  Never remove
-anything that is part of the default value, unless you really
-know what you are doing.  And think very hard before adding
-something; it will be used every time Magit runs Git for any
-purpose."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-git-arguments
-  :group 'magit-process
-  :type '(repeat string))
-
-(defvar magit-git-debug nil
-  "Whether to enable additional reporting of git errors.
-
-Magit basically calls git for one of these two reasons: for
-side-effects or to do something with its standard output.
-
-When git is run for side-effects then its output, including error
-messages, go into the process buffer which is shown when using \
-\\<magit-status-mode-map>\\[magit-process].
-
-When git's output is consumed in some way, then it would be too
-expensive to also insert it into this buffer, but when this
-option is non-nil and git returns with a non-zero exit status,
-then at least its standard error is inserted into this buffer.
-
-This is only intended for debugging purposes.  Do not enable this
-permanently, that would negatively affect performance.")
-
-(defcustom magit-ref-namespaces
-  '(("^@$"                       magit-head nil)
-    ("^refs/tags/\\(.+\\)"       magit-tag nil)
-    ("^refs/heads/\\(.+\\)"      magit-branch-local nil)
-    ("^refs/remotes/\\(.+\\)"    magit-branch-remote nil)
-    ("^refs/bisect/\\(bad\\)"    magit-bisect-bad nil)
-    ("^refs/bisect/\\(skip.*\\)" magit-bisect-skip nil)
-    ("^refs/bisect/\\(good.*\\)" magit-bisect-good nil)
-    ("^refs/stash$"              magit-refname-stash nil)
-    ("^refs/wip/\\(.+\\)"        magit-refname-wip nil)
-    ("^\\(bad\\):"               magit-bisect-bad nil)
-    ("^\\(skip\\):"              magit-bisect-skip nil)
-    ("^\\(good\\):"              magit-bisect-good nil)
-    ("\\(.+\\)"                  magit-refname nil))
-  "How refs are formatted for display.
-
-Each entry controls how a certain type of ref is displayed, and
-has the form (REGEXP FACE FORMATTER).  REGEXP is a regular
-expression used to match full refs.  The first entry whose REGEXP
-matches the reference is used.  The first regexp submatch becomes
-the \"label\" that represents the ref and is propertized with
-font FONT.  If FORMATTER is non-nil, it should be a function that
-takes two arguments, the full ref and the face.  It is supposed
-to return a propertized label that represents the ref."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-miscellanous
-  :type '(repeat
-          (list regexp
-                face
-                (choice (const :tag "first submatch is label" nil)
-                        (function :tag "format using function")))))
-
-(defcustom magit-prefer-remote-upstream nil
-  "Whether to favor remote branches when reading the upstream branch.
-
-This controls whether commands that read a branch from the user
-and then set it as the upstream branch, offer a local or a remote
-branch as default completion candidate, when they have the choice.
-
-This affects all commands that use `magit-read-upstream-branch'
-or `magit-read-starting-point', which includes all commands that
-change the upstream and many which create new branches."
-  :package-version '(magit . "2.4.2")
-  :group 'magit-commands
-  :type 'boolean)
-
-(defcustom magit-list-refs-sortby nil
-  "How to sort the ref collection in the prompt.
-
-This affects commands that read a ref.  More specifically, it
-controls the order of refs returned by `magit-list-refs', which
-is called by functions like `magit-list-branch-names' to generate
-the collection of refs.  By default, refs are sorted according to
-their full refname (i.e., 'refs/...').
-
-Any value accepted by the `--sort' flag of `git for-each-ref' can
-be used.  For example, \"-creatordate\" places refs with more
-recent committer or tagger dates earlier in the list.  A list of
-strings can also be given in order to pass multiple sort keys to
-`git for-each-ref'.
-
-Note that, depending on the completion framework you use, this
-may not be sufficient to change the order in which the refs are
-displayed.  It only controls the order of the collection passed
-to `magit-completing-read' or, for commands that support reading
-multiple strings, `read-from-minibuffer'.  The completion
-framework ultimately determines how the collection is displayed."
-  :package-version '(magit . "2.11.0")
-  :group 'magit-miscellanous
-  :type '(choice string (repeat string)))
-
-;;; Git
-
-(defvar magit--refresh-cache nil)
-
-(defmacro magit--with-refresh-cache (key &rest body)
-  (declare (indent 1) (debug (form body)))
-  (let ((k (cl-gensym)))
-    `(if magit--refresh-cache
-         (let ((,k ,key))
-           (--if-let (assoc ,k (cdr magit--refresh-cache))
-               (progn (cl-incf (caar magit--refresh-cache))
-                      (cdr it))
-             (cl-incf (cdar magit--refresh-cache))
-             (let ((value ,(macroexp-progn body)))
-               (push (cons ,k value)
-                     (cdr magit--refresh-cache))
-               value)))
-       ,@body)))
-
-(defmacro magit-with-editor (&rest body)
-  "Like `with-editor' but let-bind some more variables."
-  (declare (indent 0) (debug (body)))
-  `(let ((magit-process-popup-time -1)
-         ;; The user may have customized `shell-file-name' to
-         ;; something which results in `w32-shell-dos-semantics' nil
-         ;; (which changes the quoting style used by
-         ;; `shell-quote-argument'), but Git for Windows expects shell
-         ;; quoting in the dos style.
-         (shell-file-name (if (and (eq system-type 'windows-nt)
-                                   ;; If we have Cygwin mount points,
-                                   ;; the git flavor is cygwin, so dos
-                                   ;; shell quoting is probably wrong.
-                                   (not magit-cygwin-mount-points))
-                              "cmdproxy"
-                            shell-file-name)))
-     (with-editor "GIT_EDITOR"
-       ,@body)))
-
-(defun magit-process-git-arguments (args)
-  "Prepare ARGS for a function that invokes Git.
-
-Magit has many specialized functions for running Git; they all
-pass arguments through this function before handing them to Git,
-to do the following.
-
-* Flatten ARGS, removing nil arguments.
-* Prepend `magit-git-global-arguments' to ARGS."
-  (append magit-git-global-arguments (-flatten args)))
-
-(defun magit-git-exit-code (&rest args)
-  "Execute Git with ARGS, returning its exit code."
-  (apply #'magit-process-file magit-git-executable nil nil nil
-         (magit-process-git-arguments args)))
-
-(defun magit-git-success (&rest args)
-  "Execute Git with ARGS, returning t if its exit code is 0."
-  (= (magit-git-exit-code args) 0))
-
-(defun magit-git-failure (&rest args)
-  "Execute Git with ARGS, returning t if its exit code is 1."
-  (= (magit-git-exit-code args) 1))
-
-(defun magit-git-str (&rest args)
-  "Execute Git with ARGS, returning the first line of its output.
-If there is no output, return nil.  If the output begins with a
-newline, return an empty string.  Like `magit-git-string' but
-ignore `magit-git-debug'."
-  (setq args (-flatten args))
-  (magit--with-refresh-cache (cons default-directory args)
-    (with-temp-buffer
-      (apply #'magit-process-file magit-git-executable nil (list t nil) nil
-             (magit-process-git-arguments args))
-      (unless (bobp)
-        (goto-char (point-min))
-        (buffer-substring-no-properties (point) (line-end-position))))))
-
-(defun magit-git-true (&rest args)
-  "Execute Git with ARGS, returning t if it prints \"true\".
-Return t if the first (and usually only) output line is the
-string \"true\", otherwise return nil."
-  (equal (magit-git-str args) "true"))
-
-(defun magit-git-false (&rest args)
-  "Execute Git with ARGS, returning t if it prints \"false\".
-Return t if the first (and usually only) output line is the
-string \"false\", otherwise return nil."
-  (equal (magit-git-str args) "false"))
-
-(defun magit-git-insert (&rest args)
-  "Execute Git with ARGS, inserting its output at point.
-If Git exits with a non-zero exit status, then show a message and
-add a section in the respective process buffer."
-  (setq args (magit-process-git-arguments args))
-  (if magit-git-debug
-      (let (log)
-        (unwind-protect
-            (progn
-              (setq log (make-temp-file "magit-stderr"))
-              (delete-file log)
-              (let ((exit (apply #'magit-process-file magit-git-executable
-                                 nil (list t log) nil args)))
-                (when (> exit 0)
-                  (let ((msg "Git failed"))
-                    (when (file-exists-p log)
-                      (setq msg (with-temp-buffer
-                                  (insert-file-contents log)
-                                  (goto-char (point-max))
-                                  (cond
-                                   ((functionp magit-git-debug)
-                                    (funcall magit-git-debug (buffer-string)))
-                                   ((re-search-backward
-                                     magit-process-error-message-re nil t)
-                                    (match-string 1)))))
-                      (let ((magit-git-debug nil))
-                        (with-current-buffer (magit-process-buffer t)
-                          (magit-process-insert-section default-directory
-                                                        magit-git-executable
-                                                        args exit log))))
-                    (message "%s" msg)))
-                exit))
-          (ignore-errors (delete-file log))))
-    (apply #'magit-process-file magit-git-executable
-           nil (list t nil) nil args)))
-
-(defun magit-git-string (&rest args)
-  "Execute Git with ARGS, returning the first line of its output.
-If there is no output, return nil.  If the output begins with a
-newline, return an empty string."
-  (setq args (-flatten args))
-  (magit--with-refresh-cache (cons default-directory args)
-    (with-temp-buffer
-      (apply #'magit-git-insert args)
-      (unless (bobp)
-        (goto-char (point-min))
-        (buffer-substring-no-properties (point) (line-end-position))))))
-
-(defun magit-git-lines (&rest args)
-  "Execute Git with ARGS, returning its output as a list of lines.
-Empty lines anywhere in the output are omitted.
-
-If Git exits with a non-zero exit status, then report show a
-message and add a section in the respective process buffer."
-  (with-temp-buffer
-    (apply #'magit-git-insert args)
-    (split-string (buffer-string) "\n" t)))
-
-(defun magit-git-items (&rest args)
-  "Execute Git with ARGS, returning its null-separated output as a list.
-Empty items anywhere in the output are omitted.
-
-If Git exits with a non-zero exit status, then report show a
-message and add a section in the respective process buffer."
-  (with-temp-buffer
-    (apply #'magit-git-insert args)
-    (split-string (buffer-string) "\0" t)))
-
-(defun magit-git-wash (washer &rest args)
-  "Execute Git with ARGS, inserting washed output at point.
-Actually first insert the raw output at point.  If there is no
-output, call `magit-cancel-section'.  Otherwise temporarily narrow
-the buffer to the inserted text, move to its beginning, and then
-call function WASHER with ARGS as its sole argument."
-  (declare (indent 1))
-  (let ((beg (point)))
-    (setq args (-flatten args))
-    (magit-git-insert args)
-    (if (= (point) beg)
-        (magit-cancel-section)
-      (unless (bolp)
-        (insert "\n"))
-      (save-restriction
-        (narrow-to-region beg (point))
-        (goto-char beg)
-        (funcall washer args))
-      (when (or (= (point) beg)
-                (= (point) (1+ beg)))
-        (magit-cancel-section))
-      (magit-maybe-make-margin-overlay))))
-
-(defun magit-git-version (&optional raw)
-  (--when-let (let (magit-git-global-arguments)
-                (ignore-errors (substring (magit-git-string "version") 12)))
-    (if raw it (and (string-match "^\\([0-9]+\\.[0-9]+\\.[0-9]+\\)" it)
-                    (match-string 1 it)))))
-
-;;; Files
-
-(defun magit--safe-default-directory (&optional file)
-  (catch 'unsafe-default-dir
-    (let ((dir (file-name-as-directory
-                (expand-file-name (or file default-directory))))
-          (previous nil))
-      (while (not (magit-file-accessible-directory-p dir))
-        (setq dir (file-name-directory (directory-file-name dir)))
-        (when (equal dir previous)
-          (throw 'unsafe-default-dir nil))
-        (setq previous dir))
-      dir)))
-
-(defmacro magit--with-safe-default-directory (file &rest body)
-  (declare (indent 1) (debug (form body)))
-  `(-when-let (default-directory (magit--safe-default-directory ,file))
-     ,@body))
-
-(defun magit-git-dir (&optional path)
-  "Return absolute path to the control directory of the current repository.
-
-All symlinks are followed.  If optional PATH is non-nil, then
-it has to be a path relative to the control directory and its
-absolute path is returned."
-  (magit--with-refresh-cache (list default-directory 'magit-git-dir path)
-    (magit--with-safe-default-directory nil
-      (--when-let (magit-rev-parse-safe "--git-dir")
-        (setq it (file-name-as-directory (magit-expand-git-file-name it)))
-        (if path (expand-file-name (convert-standard-filename path) it) it)))))
-
-(defvar magit--separated-gitdirs nil)
-
-(defun magit--record-separated-gitdir ()
-  (let ((topdir (magit-toplevel))
-        (gitdir (magit-git-dir)))
-    ;; We want to delete the entry for `topdir' here, rather than within
-    ;; (unless ...), in case a `--separate-git-dir' repository was switched to
-    ;; the standard structure (i.e., "topdir/.git/").
-    (setq magit--separated-gitdirs (cl-delete topdir
-                                            magit--separated-gitdirs
-                                            :key #'car :test #'equal))
-    (unless (equal (file-name-as-directory (expand-file-name ".git" topdir))
-                   gitdir)
-      (push (cons topdir gitdir) magit--separated-gitdirs))))
-
-(defun magit-toplevel (&optional directory)
-  "Return the absolute path to the toplevel of the current repository.
-
-From within the working tree or control directory of a repository
-return the absolute path to the toplevel directory of the working
-tree.  As a special case, from within a bare repository return
-the control directory instead.  When called outside a repository
-then return nil.
-
-When optional DIRECTORY is non-nil then return the toplevel for
-that directory instead of the one for `default-directory'.
-
-Try to respect the option `find-file-visit-truename', i.e.  when
-the value of that option is nil, then avoid needlessly returning
-the truename.  When a symlink to a sub-directory of the working
-tree is involved, or when called from within a sub-directory of
-the gitdir or from the toplevel of a gitdir, which itself is not
-located within the working tree, then it is not possible to avoid
-returning the truename."
-  (magit--with-refresh-cache
-      (cons (or directory default-directory) 'magit-toplevel)
-    (magit--with-safe-default-directory directory
-      (-if-let (topdir (magit-rev-parse-safe "--show-toplevel"))
-          (let (updir)
-            (setq topdir (magit-expand-git-file-name topdir))
-            (if (and
-                 ;; Always honor these settings.
-                 (not find-file-visit-truename)
-                 (not (getenv "GIT_WORK_TREE"))
-                 ;; `--show-cdup' is the relative path to the toplevel
-                 ;; from `(file-truename default-directory)'.  Here we
-                 ;; pretend it is relative to `default-directory', and
-                 ;; go to that directory.  Then we check whether
-                 ;; `--show-toplevel' still returns the same value and
-                 ;; whether `--show-cdup' now is the empty string.  If
-                 ;; both is the case, then we are at the toplevel of
-                 ;; the same working tree, but also avoided needlessly
-                 ;; following any symlinks.
-                 (progn
-                   (setq updir (file-name-as-directory
-                                (magit-rev-parse-safe "--show-cdup")))
-                   (setq updir (if (file-name-absolute-p updir)
-                                   (concat (file-remote-p default-directory) updir)
-                                 (expand-file-name updir)))
-                   (let ((default-directory updir))
-                     (and (string-equal (magit-rev-parse-safe "--show-cdup") "")
-                          (--when-let (magit-rev-parse-safe "--show-toplevel")
-                            (string-equal (magit-expand-git-file-name it)
-                                          topdir))))))
-                updir
-              (concat (file-remote-p default-directory)
-                      (file-name-as-directory topdir))))
-        (-when-let (gitdir (magit-rev-parse-safe "--git-dir"))
-          (setq gitdir (file-name-as-directory
-                        (if (file-name-absolute-p gitdir)
-                            ;; We might have followed a symlink.
-                            (concat (file-remote-p default-directory)
-                                    (magit-expand-git-file-name gitdir))
-                          (expand-file-name gitdir))))
-          (if (magit-bare-repo-p)
-              gitdir
-            (let* ((link (expand-file-name "gitdir" gitdir))
-                   (wtree (and (file-exists-p link)
-                               (magit-file-line link))))
-              (cond
-               ((and wtree
-                     ;; Ignore .git/gitdir files that result from a
-                     ;; Git bug.  See #2364.
-                     (not (equal wtree ".git")))
-                ;; Return the linked working tree.
-                (file-name-directory wtree))
-               ;; The working directory may not be the parent directory of
-               ;; .git if it was set up with `git init --separate-git-dir'.
-               ;; See #2955.
-               ((car (rassoc gitdir magit--separated-gitdirs)))
-               (t
-                ;; Step outside the control directory to enter the working tree.
-                (file-name-directory (directory-file-name gitdir)))))))))))
-
-(defmacro magit-with-toplevel (&rest body)
-  (declare (indent defun) (debug (body)))
-  (let ((toplevel (cl-gensym "toplevel")))
-    `(let ((,toplevel (magit-toplevel)))
-       (if ,toplevel
-           (let ((default-directory ,toplevel))
-             ,@body)
-         (error "Not inside a Git repository: %s" default-directory)))))
-
-(defun magit-inside-gitdir-p ()
-  "Return t if `default-directory' is below a repository directory."
-  ;; This does not work if the gitdir is not located inside the
-  ;; working tree: (magit-rev-parse-p "--is-inside-git-dir").
-  (-when-let (gitdir (magit-git-dir))
-    (file-in-directory-p default-directory gitdir)))
-
-(defun magit-inside-worktree-p ()
-  "Return t if `default-directory' is below the work tree of a repository."
-  (magit-rev-parse-p "--is-inside-work-tree"))
-
-(defun magit-bare-repo-p ()
-  "Return t if the current repository is bare."
-  (magit-rev-parse-p "--is-bare-repository"))
-
-(defun magit-git-repo-p (directory &optional non-bare)
-  "Return t if DIRECTORY is a Git repository.
-When optional NON-BARE is non-nil also return nil if DIRECTORY is
-a bare repository."
-  (or (file-regular-p (expand-file-name ".git" directory))
-      (file-directory-p (expand-file-name ".git" directory))
-      (and (not non-bare)
-           (file-regular-p (expand-file-name "HEAD" directory))
-           (file-directory-p (expand-file-name "refs" directory))
-           (file-directory-p (expand-file-name "objects" directory)))))
-
-(defvar-local magit-buffer-revision  nil)
-(defvar-local magit-buffer-refname   nil)
-(defvar-local magit-buffer-file-name nil)
-(put 'magit-buffer-revision  'permanent-local t)
-(put 'magit-buffer-refname   'permanent-local t)
-(put 'magit-buffer-file-name 'permanent-local t)
-
-(defun magit-file-relative-name (&optional file tracked)
-  "Return the path of FILE relative to the repository root.
-
-If optional FILE is nil or omitted, return the relative path of
-the file being visited in the current buffer, if any, else nil.
-If the file is not inside a Git repository, then return nil.
-
-If TRACKED is non-nil, return the path only if it matches a
-tracked file."
-  (unless file
-    (with-current-buffer (or (buffer-base-buffer)
-                             (current-buffer))
-      (setq file (or magit-buffer-file-name buffer-file-name))))
-  (when (and file (or (not tracked)
-                      (magit-file-tracked-p (file-relative-name file))))
-    (--when-let (magit-toplevel
-                 (magit--safe-default-directory
-                  (directory-file-name (file-name-directory file))))
-      (file-relative-name file it))))
-
-(defun magit-file-tracked-p (file)
-  (magit-git-success "ls-files" "--error-unmatch" file))
-
-(defun magit-list-files (&rest args)
-  (apply #'magit-git-items "ls-files" "-z" "--full-name" args))
-
-(defun magit-tracked-files ()
-  (magit-list-files "--cached"))
-
-(defun magit-untracked-files (&optional all files)
-  (magit-list-files "--other" (unless all "--exclude-standard") "--" files))
-
-(defun magit-unstaged-files (&optional nomodules files)
-  (magit-git-items "diff-files" "-z" "--name-only"
-                   (and nomodules "--ignore-submodules")
-                   "--" files))
-
-(defun magit-staged-files (&optional nomodules files)
-  (magit-git-items "diff-index" "-z" "--name-only" "--cached"
-                   (and nomodules "--ignore-submodules")
-                   (magit-headish) "--" files))
-
-(defun magit-staged-binary-files ()
-  (--mapcat (and (string-match "^-\t-\t\\(.+\\)" it)
-                 (list (match-string 1 it)))
-            (magit-git-items "diff" "-z" "--cached"
-                             "--numstat" "--ignore-submodules")))
-
-(defun magit-unmerged-files ()
-  (magit-git-items "diff-files" "-z" "--name-only" "--diff-filter=U"))
-
-(defun magit-revision-files (rev)
-  (magit-with-toplevel
-    (magit-git-items "ls-tree" "-z" "-r" "--name-only" rev)))
-
-(defun magit-changed-files (rev-or-range &optional other-rev)
-  "Return list of files the have changed between two revisions.
-If OTHER-REV is non-nil, REV-OR-RANGE should be a revision, not a
-range.  Otherwise, it can be any revision or range accepted by
-\"git diff\" (i.e., <rev>, <revA>..<revB>, or <revA>...<revB>)."
-  (magit-with-toplevel
-    (magit-git-items "diff" "-z" "--name-only" rev-or-range other-rev)))
-
-(defun magit-renamed-files (revA revB)
-  (--map (cons (nth 1 it) (nth 2 it))
-         (-partition 3 (magit-git-items
-                        "diff-tree" "-r" "--diff-filter=R" "-z" "-M"
-                        revA revB))))
-
-(defun magit-file-status (&rest args)
-  (with-temp-buffer
-    (save-excursion (magit-git-insert "status" "-z" args))
-    (let ((pos (point)) status)
-      (while (> (skip-chars-forward "[:print:]") 0)
-        (let ((x (char-after     pos))
-              (y (char-after (1+ pos)))
-              (file (buffer-substring (+ pos 3) (point))))
-          (forward-char)
-          (if (memq x '(?R ?C))
-              (progn
-                (setq pos (point))
-                (skip-chars-forward "[:print:]")
-                (push (list file (buffer-substring pos (point)) x y) status)
-                (forward-char))
-            (push (list file nil x y) status)))
-        (setq pos (point)))
-      status)))
-
-(defcustom magit-cygwin-mount-points
-  (when (eq system-type 'windows-nt)
-    (cl-sort (--map (if (string-match "^\\(.*\\) on \\(.*\\) type" it)
-                        (cons (file-name-as-directory (match-string 2 it))
-                              (file-name-as-directory (match-string 1 it)))
-                      (lwarn '(magit) :error
-                             "Failed to parse Cygwin mount: %S" it))
-                    ;; If --exec-path is not a native Windows path,
-                    ;; then we probably have a cygwin git.
-                    (let ((process-environment
-                           (append magit-git-environment process-environment)))
-                      (and (not (string-match-p
-                                 "\\`[a-zA-Z]:"
-                                 (car (process-lines
-                                       magit-git-executable "--exec-path"))))
-                           (ignore-errors (process-lines "mount")))))
-             #'> :key (-lambda ((cyg . _win)) (length cyg))))
-  "Alist of (CYGWIN . WIN32) directory names.
-Sorted from longest to shortest CYGWIN name."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-process
-  :type '(alist :key-type string :value-type directory))
-
-(defun magit-expand-git-file-name (filename)
-  (unless (file-name-absolute-p filename)
-    (setq filename (expand-file-name filename)))
-  (-if-let ((cyg . win)
-            (cl-assoc filename magit-cygwin-mount-points
-                      :test (lambda (f cyg) (string-prefix-p cyg f))))
-      (concat win (substring filename (length cyg)))
-    filename))
-
-(defun magit-convert-filename-for-git (filename)
-  "Convert FILENAME so that it can be passed to git.
-1. If it's a remote filename, then remove the remote part.
-2. Expand \"~/\", git isn't a shell and does not understand it.
-3. Deal with an `windows-nt' Emacs vs. Cygwin Git incompatibility."
-  (if (file-name-absolute-p filename)
-      (-if-let ((cyg . win)
-                (cl-rassoc filename magit-cygwin-mount-points
-                           :test (lambda (f win) (string-prefix-p win f))))
-          (concat cyg (substring filename (length win)))
-        (or (file-remote-p filename 'localname)
-            filename))
-    filename))
-
-(defun magit-decode-git-path (path)
-  (if (eq (aref path 0) ?\")
-      (decode-coding-string (read path)
-                            (or magit-git-output-coding-system
-                                (car default-process-coding-system))
-                            t)
-    path))
-
-(defun magit-file-at-point ()
-  (magit-section-case
-    (file (magit-section-value it))
-    (hunk (magit-section-parent-value it))))
-
-(defun magit-current-file ()
-  (or (magit-file-relative-name)
-      (magit-file-at-point)
-      (and (derived-mode-p 'magit-log-mode)
-           (car (nth 2 magit-refresh-args)))))
-
-;;; Predicates
-
-(defun magit-no-commit-p ()
-  "Return t if there is no commit in the current Git repository."
-  (not (magit-rev-verify "HEAD")))
-
-(defun magit-anything-staged-p (&optional ignore-submodules &rest files)
-  "Return t if there are any staged changes.
-If optional FILES is non-nil, then only changes to those files
-are considered."
-  (magit-git-failure "diff" "--quiet" "--cached"
-                     (and ignore-submodules "--ignore-submodules")
-                     "--" files))
-
-(defun magit-anything-unstaged-p (&optional ignore-submodules &rest files)
-  "Return t if there are any unstaged changes.
-If optional FILES is non-nil, then only changes to those files
-are considered."
-  (magit-git-failure "diff" "--quiet"
-                     (and ignore-submodules "--ignore-submodules")
-                     "--" files))
-
-(defun magit-anything-modified-p (&optional ignore-submodules &rest files)
-  "Return t if there are any staged or unstaged changes.
-If optional FILES is non-nil, then only changes to those files
-are considered."
-  (or (apply 'magit-anything-staged-p   ignore-submodules files)
-      (apply 'magit-anything-unstaged-p ignore-submodules files)))
-
-(defun magit-anything-unmerged-p (&rest files)
-  "Return t if there are any merge conflicts.
-If optional FILES is non-nil, then only conflicts in those files
-are considered."
-  (and (magit-git-string "ls-files" "--unmerged" files) t))
-
-;;; Revisions and References
-
-(defun magit-rev-parse (&rest args)
-  "Execute `git rev-parse ARGS', returning first line of output.
-If there is no output, return nil."
-  (apply #'magit-git-string "rev-parse" args))
-
-(defun magit-rev-parse-safe (&rest args)
-  "Execute `git rev-parse ARGS', returning first line of output.
-If there is no output, return nil.  Like `magit-rev-parse' but
-ignore `magit-git-debug'."
-  (apply #'magit-git-str "rev-parse" args))
-
-(defun magit-rev-parse-p (&rest args)
-  "Execute `git rev-parse ARGS', returning t if it prints \"true\".
-Return t if the first (and usually only) output line is the
-string \"true\", otherwise return nil."
-  (magit-git-true "rev-parse" args))
-
-(defun magit-rev-verify (rev)
-  (magit-rev-parse-safe "--verify" rev))
-
-(defun magit-rev-verify-commit (rev)
-  "Return full hash for REV if it names an existing commit."
-  (magit-rev-verify (concat rev "^{commit}")))
-
-(defun magit-rev-equal (a b)
-  (magit-git-success "diff" "--quiet" a b))
-
-(defun magit-rev-eq (a b)
-  (equal (magit-rev-verify a)
-         (magit-rev-verify b)))
-
-(defun magit-rev-ancestor-p (a b)
-  "Return non-nil if commit A is an ancestor of commit B."
-  (magit-git-success "merge-base" "--is-ancestor" a b))
-
-(defun magit-rev-head-p (rev)
-  (or (equal rev "HEAD")
-      (and rev
-           (not (string-match-p "\\.\\." rev))
-           (equal (magit-rev-parse rev)
-                  (magit-rev-parse "HEAD")))))
-
-(defun magit-rev-name (rev &optional pattern)
-  "Return a symbolic name for REV.
-PATTERN is passed to the `--refs' flag of `git-name-rev' and can
-be used to limit the result to a matching ref.  When structured
-as \"refs/<subdir>/*\", PATTERN is taken as a namespace.  In this
-case, the name returned by `git-name-rev' is discarded if it
-corresponds to a ref outside of the namespace."
-  (--when-let (magit-git-string "name-rev" "--name-only" "--no-undefined"
-                                (and pattern (concat "--refs=" pattern))
-                                rev)
-    ;; We can't use name-rev's --exclude to filter out "*/PATTERN"
-    ;; because --exclude wasn't added until Git v2.13.0.
-    (if (and pattern
-             (string-match-p "\\`refs/[^/]+/\\*\\'" pattern))
-        (let ((namespace (substring pattern 0 -1)))
-          (unless (and (string-match-p namespace it)
-                       (not (magit-rev-verify (concat namespace it))))
-            it))
-      it)))
-
-(defun magit-rev-branch (rev)
-  (--when-let (magit-rev-name rev "refs/heads/*")
-    (unless (string-match-p "~" it) it)))
-
-(defun magit-get-shortname (rev)
-  (let* ((fn (apply-partially 'magit-rev-name rev))
-         (name (or (funcall fn "refs/tags/*")
-                   (funcall fn "refs/heads/*")
-                   (funcall fn "refs/remotes/*"))))
-    (cond ((not name)
-           (magit-rev-parse "--short" rev))
-          ((string-match "^\\(?:tags\\|remotes\\)/\\(.+\\)" name)
-           (if (magit-ref-ambiguous-p (match-string 1 name))
-               name
-             (match-string 1 name)))
-          (t (magit-ref-maybe-qualify name)))))
-
-(defun magit-name-branch (rev &optional lax)
-  (or (magit-name-local-branch rev)
-      (magit-name-remote-branch rev)
-      (and lax (or (magit-name-local-branch rev t)
-                   (magit-name-remote-branch rev t)))))
-
-(defun magit-name-local-branch (rev &optional lax)
-  (--when-let (magit-rev-name rev "refs/heads/*")
-    (and (or lax (not (string-match-p "[~^]" it))) it)))
-
-(defun magit-name-remote-branch (rev &optional lax)
-  (--when-let (magit-rev-name rev "refs/remotes/*")
-    (and (or lax (not (string-match-p "[~^]" it)))
-         (substring it 8))))
-
-(defun magit-name-tag (rev &optional lax)
-  (--when-let (magit-rev-name rev "refs/tags/*")
-    (and (or lax (not (string-match-p "[~^]" it)))
-         (substring it 5))))
-
-(defun magit-ref-fullname (name)
-  "Return fully qualified refname for NAME.
-If NAME is ambiguous, return nil.  NAME may include suffixes such
-as \"^1\" and \"~3\".  "
-  (save-match-data
-    (if (string-match "\\`\\([^^~]+\\)\\(.*\\)" name)
-        (--when-let (magit-rev-parse "--symbolic-full-name"
-                                     (match-string 1 name))
-          (concat it (match-string 2 name)))
-      (error "`name' has an unrecognized format"))))
-
-(defun magit-ref-ambiguous-p (name)
-  (not (magit-ref-fullname name)))
-
-(cl-defun magit-ref-maybe-qualify (name &optional (prefix "heads/"))
-  "If NAME is ambiguous, prepend PREFIX to it."
-  (concat (and (magit-ref-ambiguous-p name)
-               prefix)
-          name))
-
-(defun magit-ref-exists-p (ref)
-  (magit-git-success "show-ref" "--verify" ref))
-
-(defun magit-ref-equal (a b)
-  "Return t if the refs A and B are `equal'.
-A symbolic-ref pointing to some ref, is `equal' to that ref,
-as are two symbolic-refs pointing to the same ref."
-  (equal (magit-ref-fullname a)
-         (magit-ref-fullname b)))
-
-(defun magit-ref-eq (a b)
-  "Return t if the refs A and B are `eq'.
-A symbolic-ref is `eq' to itself, but not to the ref it points
-to, or to some other symbolic-ref that points to the same ref."
-  (let ((symbolic-a (magit-symbolic-ref-p a))
-        (symbolic-b (magit-symbolic-ref-p b)))
-    (or (and symbolic-a
-             symbolic-b
-             (equal a b))
-        (and (not symbolic-a)
-             (not symbolic-b)
-             (magit-ref-equal a b)))))
-
-(defun magit-headish ()
-  "Return \"HEAD\" or if that doesn't exist the hash of the empty tree."
-  (if (magit-no-commit-p)
-      (magit-git-string "mktree")
-    "HEAD"))
-
-(defun magit-branch-at-point ()
-  (magit-section-case
-    (branch (magit-section-value it))
-    (commit (magit-name-branch (magit-section-value it)))))
-
-(defun magit-local-branch-at-point ()
-  (magit-section-case
-    (branch (let ((branch (magit-ref-maybe-qualify (magit-section-value it))))
-              (when (member branch (magit-list-local-branch-names))
-                branch)))
-    (commit (magit-name-local-branch (magit-section-value it)))))
-
-(defun magit-remote-branch-at-point ()
-  (magit-section-case
-    (branch (let ((branch (magit-section-value it)))
-              (when (member branch (magit-list-remote-branch-names))
-                branch)))
-    (commit (magit-name-remote-branch (magit-section-value it)))))
-
-(defun magit-commit-at-point ()
-  (or (magit-section-when commit)
-      (and (derived-mode-p 'magit-revision-mode)
-           (car magit-refresh-args))))
-
-(defun magit-branch-or-commit-at-point ()
-  (or magit-buffer-refname
-      (magit-section-case
-        (branch (magit-ref-maybe-qualify (magit-section-value it)))
-        (commit (let ((rev (magit-section-value it)))
-                  (or (magit-get-shortname rev) rev)))
-        (tag (magit-ref-maybe-qualify (magit-section-value it) "tags/")))
-      (and (derived-mode-p 'magit-revision-mode
-                           'magit-merge-preview-mode)
-           (car magit-refresh-args))))
-
-(defun magit-tag-at-point ()
-  (magit-section-case
-    (tag    (magit-section-value it))
-    (commit (magit-name-tag (magit-section-value it)))))
-
-(defun magit-stash-at-point ()
-  (magit-section-when stash))
-
-(defun magit-remote-at-point ()
-  (magit-section-case
-    (remote (magit-section-value it))
-    (branch (magit-section-parent-value it))))
-
-(defun magit-get-current-branch ()
-  "Return the refname of the currently checked out branch.
-Return nil if no branch is currently checked out."
-  (magit-git-string "symbolic-ref" "--short" "HEAD"))
-
-(defun magit-get-previous-branch ()
-  "Return the refname of the previously checked out branch.
-Return nil if no branch can be found in the `HEAD' reflog
-which is different from the current branch and still exists."
-  (let ((current (magit-get-current-branch))
-        (i 1) prev)
-    (while (and (setq prev (magit-rev-verify (format "@{-%i}" i)))
-                (or (not (setq prev (magit-rev-branch prev)))
-                    (equal prev current)))
-      (cl-incf i))
-    prev))
-
-(defun magit-get-upstream-ref (&optional branch)
-  (and (or branch (setq branch (magit-get-current-branch)))
-       (let ((remote (magit-get "branch" branch "remote"))
-             (merge  (magit-get "branch" branch "merge")))
-         (when (and remote merge)
-           (cond ((string-equal remote ".") merge)
-                 ((string-prefix-p "refs/heads/" merge)
-                  (concat "refs/remotes/" remote "/" (substring merge 11))))))))
-
-(defun magit-get-upstream-branch (&optional branch verify)
-  (and (or branch (setq branch (magit-get-current-branch)))
-       (-when-let* ((remote (magit-get "branch" branch "remote"))
-                    (merge  (magit-get "branch" branch "merge")))
-         (and (string-prefix-p "refs/heads/" merge)
-              (let* ((upstream (substring merge 11))
-                     (upstream
-                      (cond ((string-equal remote ".")
-                             (propertize upstream 'face 'magit-branch-local))
-                            ((string-match-p "[@:]" remote)
-                             (propertize (concat remote " " upstream)
-                                         'face 'magit-branch-remote))
-                            (t
-                             (propertize (concat remote "/" upstream)
-                                         'face 'magit-branch-remote)))))
-                (and (or (not verify)
-                         (magit-rev-verify upstream))
-                     upstream))))))
-
-(defun magit-get-indirect-upstream-branch (branch &optional force)
-  (let ((remote (magit-get "branch" branch "remote")))
-    (and remote (not (equal remote "."))
-         ;; The user has opted in...
-         (or force
-             (--any (if (magit-git-success "check-ref-format" "--branch" it)
-                        (equal it branch)
-                      (string-match-p it branch))
-                    magit-branch-prefer-remote-upstream))
-         ;; and local BRANCH tracks a remote branch...
-         (let ((upstream (magit-get-upstream-branch branch)))
-           ;; whose upstream...
-           (and upstream
-                ;; has the same name as BRANCH and...
-                (equal (substring upstream (1+ (length remote))) branch)
-                ;; and can be fast-forwarded to BRANCH.
-                (magit-rev-ancestor-p upstream branch)
-                upstream)))))
-
-(defun magit-get-upstream-remote (&optional branch)
-  (and (or branch (setq branch (magit-get-current-branch)))
-       (magit-get "branch" branch "remote")))
-
-(defun magit-get-push-remote (&optional branch)
-  (or (and (or branch (setq branch (magit-get-current-branch)))
-           (magit-get "branch" branch "pushRemote"))
-      (magit-get "remote.pushDefault")))
-
-(defun magit-get-push-branch (&optional branch verify)
-  (and (or branch (setq branch (magit-get-current-branch)))
-       (-when-let* ((remote (magit-get-push-remote branch))
-                    (push-branch (concat remote "/" branch)))
-         (and (or (not verify)
-                  (magit-rev-verify push-branch))
-              push-branch))))
-
-(defun magit-get-@{push}-branch (&optional branch)
-  (let ((ref (magit-rev-parse "--symbolic-full-name"
-                              (concat branch "@{push}"))))
-    (when (and ref (string-prefix-p "refs/remotes/" ref))
-      (substring ref 13))))
-
-(defun magit-get-remote (&optional branch)
-  (when (or branch (setq branch (magit-get-current-branch)))
-    (let ((remote (magit-get "branch" branch "remote")))
-      (unless (equal remote ".")
-        remote))))
-
-(defun magit-branch-merged-p (branch &optional target)
-  "Return non-nil if BRANCH is merged into its upstream and TARGET.
-
-TARGET defaults to the current branch.  If `HEAD' is detached and
-TARGET is nil, then always return nil.  As a special case, if
-TARGET is t, then return non-nil if BRANCH is merged into any one
-of the other local branches.
-
-If, and only if, BRANCH has an upstream, then only return non-nil
-if BRANCH is merged into both TARGET (as described above) as well
-as into its upstream."
-  (and (--if-let (and (magit-branch-p branch)
-                      (magit-get-upstream-branch branch))
-           (magit-git-success "merge-base" "--is-ancestor" branch it)
-         t)
-       (if (eq target t)
-           (delete (magit-name-local-branch branch)
-                   (magit-list-containing-branches branch))
-         (--when-let (or target (magit-get-current-branch))
-           (magit-git-success "merge-base" "--is-ancestor" branch it)))))
-
-(defun magit-split-branch-name (branch)
-  (cond ((member branch (magit-list-local-branch-names))
-         (cons "." branch))
-        ((string-match " " branch)
-         (pcase-let ((`(,url ,branch) (split-string branch " ")))
-           (cons url branch)))
-        ((string-match "/" branch)
-         (let ((remote (substring branch 0 (match-beginning 0))))
-           (if (save-match-data (member remote (magit-list-remotes)))
-               (cons remote (substring branch (match-end 0)))
-             (error "Invalid branch name %s" branch))))))
-
-(defun magit-get-current-tag (&optional rev with-distance)
-  "Return the closest tag reachable from REV.
-
-If optional REV is nil, then default to `HEAD'.
-If optional WITH-DISTANCE is non-nil then return (TAG COMMITS),
-if it is `dirty' return (TAG COMMIT DIRTY). COMMITS is the number
-of commits in `HEAD' but not in TAG and DIRTY is t if there are
-uncommitted changes, nil otherwise."
-  (--when-let (magit-git-str "describe" "--long" "--tags"
-                             (and (eq with-distance 'dirty) "--dirty") rev)
-    (save-match-data
-      (string-match
-       "\\(.+\\)-\\(?:0[0-9]*\\|\\([0-9]+\\)\\)-g[0-9a-z]+\\(-dirty\\)?$" it)
-      (if with-distance
-          `(,(match-string 1 it)
-            ,(string-to-number (or (match-string 2 it) "0"))
-            ,@(and (match-string 3 it) (list t)))
-        (match-string 1 it)))))
-
-(defun magit-get-next-tag (&optional rev with-distance)
-  "Return the closest tag from which REV is reachable.
-
-If optional REV is nil, then default to `HEAD'.
-If no such tag can be found or if the distance is 0 (in which
-case it is the current tag, not the next), return nil instead.
-If optional WITH-DISTANCE is non-nil, then return (TAG COMMITS)
-where COMMITS is the number of commits in TAG but not in REV."
-  (--when-let (magit-git-str "describe" "--contains" (or rev "HEAD"))
-    (save-match-data
-      (when (string-match "^[^^~]+" it)
-        (setq it (match-string 0 it))
-        (unless (equal it (magit-get-current-tag rev))
-          (if with-distance
-              (list it (car (magit-rev-diff-count it rev)))
-            it))))))
-
-(defvar magit-list-refs-namespaces
-  '("refs/heads" "refs/remotes" "refs/tags" "refs/pull"))
-
-(defun magit-list-refs (&optional namespaces format sortby)
-  "Return list of references.
-
-When NAMESPACES is non-nil, list refs from these namespaces
-rather than those from `magit-list-refs-namespaces'.
-
-FORMAT is passed to the `--format' flag of `git for-each-ref' and
-defaults to \"%(refname)\".
-
-SORTBY is a key or list of keys to pass to the `--sort' flag of
-`git for-each-ref'.  When nil, use `magit-list-refs-sortby'"
-  (magit-git-lines "for-each-ref"
-                   (concat "--format=" (or format "%(refname)"))
-                   (--map (concat "--sort=" it)
-                          (pcase (or sortby magit-list-refs-sortby)
-                            ((and val (pred stringp)) (list val))
-                            ((and val (pred listp)) val)))
-                   (or namespaces magit-list-refs-namespaces)))
-
-(defun magit-list-branches ()
-  (magit-list-refs (list "refs/heads" "refs/remotes")))
-
-(defun magit-list-local-branches ()
-  (magit-list-refs "refs/heads"))
-
-(defun magit-list-remote-branches (&optional remote)
-  (magit-list-refs (concat "refs/remotes/" remote)))
-
-(defun magit-list-containing-branches (&optional commit)
-  (--filter (not (string-match-p "\\`(HEAD" it))
-            (--map (substring it 2)
-                   (magit-git-lines "branch" "--contains" commit))))
-
-(defun magit-list-merged-branches (&optional commit)
-  (--filter (not (string-match-p "\\`(HEAD" it))
-            (--map (substring it 2)
-                   (magit-git-lines "branch" "--merged" commit))))
-
-(defun magit-list-unmerged-branches (&optional commit)
-  (--filter (not (string-match-p "\\`(HEAD" it))
-            (--map (substring it 2)
-                   (magit-git-lines "branch" "--no-merged" commit))))
-
-(defun magit-list-unmerged-to-upstream-branches ()
-  (--filter (-when-let (upstream (magit-get-upstream-branch it))
-              (member it (magit-list-unmerged-branches upstream)))
-            (magit-list-local-branch-names)))
-
-(defun magit-list-refnames (&optional namespaces)
-  (magit-list-refs namespaces "%(refname:short)"))
-
-(defun magit-list-branch-names ()
-  (magit-list-refnames (list "refs/heads" "refs/remotes")))
-
-(defun magit-list-local-branch-names ()
-  (magit-list-refnames "refs/heads"))
-
-(defun magit-list-remote-branch-names (&optional remote relative)
-  (if (and remote relative)
-      (let ((regexp (format "^refs/remotes/%s/\\(.+\\)" remote)))
-        (--mapcat (when (string-match regexp it)
-                    (list (match-string 1 it)))
-                  (magit-list-remote-branches remote)))
-    (magit-list-refnames (concat "refs/remotes/" remote))))
-
-(defun magit-format-refs (format &rest args)
-  (let ((lines (magit-git-lines
-                "for-each-ref" (concat "--format=" format)
-                (or args (list "refs/heads" "refs/remotes" "refs/tags")))))
-    (if (string-match-p "\f" format)
-        (--map (split-string it "\f") lines)
-      lines)))
-
-(defun magit-list-remotes ()
-  (magit-git-lines "remote"))
-
-(defun magit-list-tags ()
-  (magit-git-lines "tag"))
-
-(defun magit-list-stashes (&optional format)
-  (magit-git-lines "stash" "list" (concat "--format=" (or format "%gd"))))
-
-(defun magit-list-notes-refnames ()
-  (--map (substring it 6) (magit-list-refnames "refs/notes")))
-
-(defun magit-remote-list-tags (remote)
-  (--keep (and (not (string-match-p "\\^{}$" it))
-               (substring it 51))
-          (magit-git-lines "ls-remote" "--tags" remote)))
-
-(defun magit-remote-list-branches (remote)
-  (--keep (and (not (string-match-p "\\^{}$" it))
-               (substring it 52))
-          (magit-git-lines "ls-remote" "--heads" remote)))
-
-(defun magit-remote-list-refs (remote)
-  (--keep (and (not (string-match-p "\\^{}$" it))
-               (substring it 41))
-          (magit-git-lines "ls-remote" remote)))
-
-(defun magit-get-submodules ()
-  (--mapcat (and (string-match "^160000 [0-9a-z]\\{40\\} 0\t\\(.+\\)$" it)
-                 (list (match-string 1 it)))
-            (magit-git-items "ls-files" "-z" "--stage")))
-
-(defun magit-get-submodule-name (path)
-  "Return the name of the submodule at PATH.
-PATH has to be relative to the super-repository."
-  (cadr (split-string
-         (car (or (magit-git-items
-                   "config" "-z"
-                   "-f" (expand-file-name ".gitmodules" (magit-toplevel))
-                   "--get-regexp" "^submodule\\..*\\.path$"
-                   (concat "^" (regexp-quote (directory-file-name path)) "$"))
-                  (error "No such submodule `%s'" path)))
-         "\n")))
-
-(defun magit-list-worktrees ()
-  (let (worktrees worktree)
-    (dolist (line (let ((magit-git-global-arguments
-                         ;; KLUDGE At least in v2.8.3 this triggers a segfault.
-                         (remove "--no-pager" magit-git-global-arguments)))
-                    (magit-git-lines "worktree" "list" "--porcelain")))
-      (cond ((string-prefix-p "worktree" line)
-             (push (setq worktree (list (substring line 9) nil nil nil))
-                   worktrees))
-            ((string-equal line "bare")
-             (let* ((default-directory (car worktree))
-                    (wt (and (not (magit-get-boolean "core.bare"))
-                             (magit-get "core.worktree"))))
-               (if (and wt (file-exists-p (expand-file-name wt)))
-                   (progn (setf (nth 0 worktree) (expand-file-name wt))
-                          (setf (nth 2 worktree) (magit-rev-parse "HEAD"))
-                          (setf (nth 3 worktree) (magit-get-current-branch)))
-                 (setf (nth 1 worktree) t))))
-            ((string-prefix-p "HEAD" line)
-             (setf (nth 2 worktree) (substring line 5)))
-            ((string-prefix-p "branch" line)
-             (setf (nth 3 worktree) (substring line 18)))
-            ((string-equal line "detached"))))
-    (nreverse worktrees)))
-
-(defun magit-symbolic-ref-p (name)
-  (magit-git-success "symbolic-ref" "--quiet" name))
-
-(defun magit-ref-p (rev)
-  (or (car (member rev (magit-list-refs)))
-      (car (member rev (magit-list-refnames)))))
-
-(defun magit-branch-p (rev)
-  (or (car (member rev (magit-list-branches)))
-      (car (member rev (magit-list-branch-names)))))
-
-(defun magit-local-branch-p (rev)
-  (or (car (member rev (magit-list-local-branches)))
-      (car (member rev (magit-list-local-branch-names)))))
-
-(defun magit-remote-branch-p (rev)
-  (or (car (member rev (magit-list-remote-branches)))
-      (car (member rev (magit-list-remote-branch-names)))))
-
-(defun magit-branch-set-face (branch)
-  (propertize branch 'face (if (magit-local-branch-p branch)
-                               'magit-branch-local
-                             'magit-branch-remote)))
-
-(defun magit-tag-p (rev)
-  (car (member rev (magit-list-tags))))
-
-(defun magit-remote-p (string)
-  (car (member string (magit-list-remotes))))
-
-(defun magit-rev-diff-count (a b)
-  "Return the commits in A but not B and vice versa.
-Return a list of two integers: (A>B B>A)."
-  (mapcar 'string-to-number
-          (split-string (magit-git-string "rev-list"
-                                          "--count" "--left-right"
-                                          (concat a "..." b))
-                        "\t")))
-
-(defun magit-abbrev-length ()
-  (--if-let (magit-get "core.abbrev")
-      (string-to-number it)
-    ;; Guess the length git will be using based on an example
-    ;; abbreviation.  Actually HEAD's abbreviation might be an
-    ;; outlier, so use the shorter of the abbreviations for two
-    ;; commits.  When a commit does not exist, then fall back
-    ;; to the default of 7.  See #3034.
-    (min (--if-let (magit-rev-parse "--short" "HEAD")  (length it) 7)
-         (--if-let (magit-rev-parse "--short" "HEAD~") (length it) 7))))
-
-(defun magit-abbrev-arg (&optional arg)
-  (format "--%s=%d" (or arg "abbrev") (magit-abbrev-length)))
-
-(defun magit-rev-abbrev (rev)
-  (magit-rev-parse (magit-abbrev-arg "short") rev))
-
-(defun magit-commit-children (commit &optional args)
-  (-map #'car
-        (--filter (member commit (cdr it))
-                  (--map (split-string it " ")
-                         (magit-git-lines
-                          "log" "--format=%H %P"
-                          (or args (list "--branches" "--tags" "--remotes"))
-                          "--not" commit)))))
-
-(defun magit-commit-parents (commit)
-  (--when-let (magit-git-string "rev-list" "-1" "--parents" commit)
-    (cdr (split-string it))))
-
-(defun magit-assert-one-parent (commit command)
-  (when (> (length (magit-commit-parents commit)) 1)
-    (user-error "Cannot %s a merge commit" command)))
-
-(defun magit-patch-id (rev)
-  (with-temp-buffer
-    (magit-process-file
-     shell-file-name nil '(t nil) nil shell-command-switch
-     (let ((exec (shell-quote-argument magit-git-executable)))
-       (format "%s diff-tree -u %s | %s patch-id" exec rev exec)))
-    (car (split-string (buffer-string)))))
-
-(defun magit-rev-format (format &optional rev args)
-  (let ((str (magit-git-string "show" "--no-patch"
-                               (concat "--format=" format) args
-                               (if rev (concat rev "^{commit}") "HEAD") "--")))
-    (unless (string-equal str "")
-      str)))
-
-(defun magit-rev-insert-format (format &optional rev args)
-  (magit-git-insert "show" "--no-patch"
-                    (concat "--format=" format) args
-                    (if rev (concat rev "^{commit}") "HEAD") "--"))
-
-(defun magit-format-rev-summary (rev)
-  (--when-let (magit-rev-format "%h %s" rev)
-    (string-match " " it)
-    (put-text-property 0 (match-beginning 0) 'face 'magit-hash it)
-    it))
-
-(defun magit-format-ref-label (ref &optional head)
-  (-let [(_re face fn)
-         (--first (string-match (car it) ref) magit-ref-namespaces)]
-    (if fn
-        (funcall fn ref face)
-      (propertize (or (match-string 1 ref) ref)
-                  'face (if (equal ref head) 'magit-branch-current face)))))
-
-(defun magit-format-ref-labels (string)
-  ;; To support Git <2.2.0, we remove the surrounding parentheses here
-  ;; rather than specifying that STRING should be generated with Git's
-  ;; "%D" placeholder.
-  (setq string (->> string
-                    (replace-regexp-in-string "\\`\\s-*(" "")
-                    (replace-regexp-in-string ")\\s-*\\'" "")))
-  (save-match-data
-    (let ((regexp "\\(, \\|tag: \\| -> \\)")
-          head names)
-      (if (and (derived-mode-p 'magit-log-mode)
-               (member "--simplify-by-decoration" (cadr magit-refresh-args)))
-          (let ((branches (magit-list-local-branch-names))
-                (re (format "^%s/.+" (regexp-opt (magit-list-remotes)))))
-            (setq names
-                  (--map (cond ((string-equal it "HEAD")     it)
-                               ((string-prefix-p "refs/" it) it)
-                               ((member it branches) (concat "refs/heads/" it))
-                               ((string-match re it) (concat "refs/remotes/" it))
-                               (t                    (concat "refs/" it)))
-                         (split-string
-                          (replace-regexp-in-string "tag: " "refs/tags/" string)
-                          regexp t))))
-        (setq names (split-string string regexp t)))
-      (when (member "HEAD" names)
-        (setq head  (magit-git-string "symbolic-ref" "HEAD")
-              names (cons (or head "@") (delete head (delete "HEAD" names)))))
-      (mapconcat (lambda (it) (magit-format-ref-label it head)) names " "))))
-
-(defun magit-object-type (object)
-  (magit-git-string "cat-file" "-t" object))
-
-(defmacro magit-with-blob (commit file &rest body)
-  (declare (indent 2)
-           (debug (form form body)))
-  `(with-temp-buffer
-     (let ((buffer-file-name ,file))
-       (save-excursion
-         (magit-git-insert "cat-file" "-p"
-                           (concat ,commit ":" buffer-file-name)))
-       (decode-coding-inserted-region
-        (point-min) (point-max) buffer-file-name t nil nil t)
-       ,@body)))
-
-(defmacro magit-with-temp-index (tree arg &rest body)
-  (declare (indent 2) (debug (form form body)))
-  (let ((file (cl-gensym "file")))
-    `(let ((magit--refresh-cache nil)
-           (,file (magit-convert-filename-for-git
-                   (make-temp-name (magit-git-dir "index.magit.")))))
-       (unwind-protect
-           (progn (--when-let ,tree
-                    (or (magit-git-success "read-tree" ,arg it
-                                           (concat "--index-output=" ,file))
-                        (error "Cannot read tree %s" it)))
-                  (if (file-remote-p default-directory)
-                      (let ((magit-tramp-process-environment
-                             (cons (concat "GIT_INDEX_FILE=" ,file)
-                                   magit-tramp-process-environment)))
-                        ,@body)
-                    (let ((process-environment
-                           (cons (concat "GIT_INDEX_FILE=" ,file)
-                                 process-environment)))
-                      ,@body)))
-         (ignore-errors
-           (delete-file (concat (file-remote-p default-directory) ,file)))))))
-
-(defun magit-commit-tree (message &optional tree &rest parents)
-  (magit-git-string "commit-tree" "--no-gpg-sign" "-m" message
-                    (--mapcat (list "-p" it) (delq nil parents))
-                    (or tree
-                        (magit-git-string "write-tree")
-                        (error "Cannot write tree"))))
-
-(defun magit-commit-worktree (message &optional arg &rest other-parents)
-  (magit-with-temp-index "HEAD" arg
-    (and (magit-update-files (magit-unstaged-files))
-         (apply #'magit-commit-tree message nil "HEAD" other-parents))))
-
-(defun magit-update-files (files)
-  (magit-git-success "update-index" "--add" "--remove" "--" files))
-
-(defun magit-update-ref (ref message rev &optional stashish)
-  (or (if (not (version< (magit-git-version) "2.6.0"))
-          (magit-git-success "update-ref" "--create-reflog"
-                             "-m" message ref rev
-                             (or (magit-rev-verify ref) ""))
-        ;; `--create-reflog' didn't exist before v2.6.0
-        (let ((oldrev  (magit-rev-verify ref))
-              (logfile (magit-git-dir (concat "logs/" ref))))
-          (unless (file-exists-p logfile)
-            (when oldrev
-              (magit-git-success "update-ref" "-d" ref oldrev))
-            (make-directory (file-name-directory logfile) t)
-            (with-temp-file logfile)
-            (when (and oldrev (not stashish))
-              (magit-git-success "update-ref" "-m" "enable reflog"
-                                 ref oldrev ""))))
-        (magit-git-success "update-ref" "-m" message ref rev
-                           (or (magit-rev-verify ref) "")))
-      (error "Cannot update %s with %s" ref rev)))
-
-(defconst magit-range-re
-  (concat "\\`\\([^ \t]*[^.]\\)?"       ; revA
-          "\\(\\.\\.\\.?\\)"            ; range marker
-          "\\([^.][^ \t]*\\)?\\'"))     ; revB
-
-(defun magit-split-range (range)
-  (when (string-match magit-range-re range)
-    (let ((beg (or (match-string 1 range) "HEAD"))
-          (end (or (match-string 3 range) "HEAD")))
-      (cons (if (string-equal (match-string 2 range) "...")
-                (magit-git-string "merge-base" beg end)
-              beg)
-            end))))
-
-;;; Completion
-
-(defvar magit-revision-history nil)
-
-(defun magit-read-branch (prompt &optional secondary-default)
-  (magit-completing-read prompt (magit-list-branch-names)
-                         nil t nil 'magit-revision-history
-                         (or (magit-branch-at-point)
-                             secondary-default
-                             (magit-get-current-branch))))
-
-(defun magit-read-branch-or-commit (prompt &optional secondary-default)
-  (or (magit-completing-read prompt (cons "HEAD" (magit-list-refnames))
-                             nil nil nil 'magit-revision-history
-                             (or (magit-branch-or-commit-at-point)
-                                 secondary-default
-                                 (magit-get-current-branch)))
-      (user-error "Nothing selected")))
-
-(defun magit-read-range-or-commit (prompt &optional secondary-default)
-  (magit-read-range
-   prompt
-   (or (--when-let (magit-region-values 'commit 'branch)
-         (deactivate-mark)
-         (concat (car (last it)) ".." (car it)))
-       (magit-branch-or-commit-at-point)
-       secondary-default
-       (magit-get-current-branch))))
-
-(defun magit-read-range (prompt &optional default)
-  (magit-completing-read-multiple prompt
-                                  (magit-list-refnames)
-                                  "\\.\\.\\.?"
-                                  default 'magit-revision-history))
-
-(defun magit-read-remote-branch
-    (prompt &optional remote default local-branch require-match)
-  (let ((choice (magit-completing-read
-                 prompt
-                 (-union (and local-branch
-                              (if remote
-                                  (concat remote "/" local-branch)
-                                (--map (concat it "/" local-branch)
-                                       (magit-list-remotes))))
-                         (magit-list-remote-branch-names remote t))
-                 nil require-match nil 'magit-revision-history default)))
-    (if (or remote (string-match "\\`\\([^/]+\\)/\\(.+\\)" choice))
-        choice
-      (user-error "`%s' doesn't have the form REMOTE/BRANCH" choice))))
-
-(defun magit-read-refspec (prompt remote)
-  (magit-completing-read prompt
-                         (prog2 (message "Determining available refs...")
-                             (magit-remote-list-refs remote)
-                           (message "Determining available refs...done"))))
-
-(defun magit-read-local-branch (prompt &optional secondary-default)
-  (magit-completing-read prompt (magit-list-local-branch-names)
-                         nil t nil 'magit-revision-history
-                         (or (magit-local-branch-at-point)
-                             secondary-default
-                             (magit-get-current-branch))))
-
-(defun magit-read-local-branch-or-commit (prompt)
-  (let ((branches (magit-list-local-branch-names))
-        (commit (magit-commit-at-point)))
-    (or (magit-completing-read prompt
-                               (if commit (cons commit branches) branches)
-                               nil nil nil 'magit-revision-history
-                               (or (magit-local-branch-at-point) commit))
-                     (user-error "Nothing selected"))))
-
-(defun magit-read-local-branch-or-ref (prompt &optional secondary-default)
-  (magit-completing-read prompt (nconc (magit-list-local-branch-names)
-                                       (magit-list-refs "refs/"))
-                         nil t nil 'magit-revision-history
-                         (or (magit-local-branch-at-point)
-                             secondary-default
-                             (magit-get-current-branch))))
-
-(defun magit-read-other-branch
-    (prompt &optional exclude secondary-default no-require-match)
-  (let* ((current (magit-get-current-branch))
-         (atpoint (magit-branch-at-point))
-         (exclude (or exclude current))
-         (default (or (and (not (equal atpoint exclude)) atpoint)
-                      (and (not (equal current exclude)) current)
-                      secondary-default
-                      (magit-get-previous-branch))))
-    (magit-completing-read prompt (delete exclude (magit-list-branch-names))
-                           nil (not no-require-match)
-                           nil 'magit-revision-history default)))
-
-(defun magit-read-other-branch-or-commit
-    (prompt &optional exclude secondary-default)
-  (let* ((current (magit-get-current-branch))
-         (atpoint (magit-branch-or-commit-at-point))
-         (exclude (or exclude current))
-         (default (or (and (not (equal atpoint exclude)) atpoint)
-                      (and (not (equal current exclude)) current)
-                      secondary-default
-                      (magit-get-previous-branch))))
-    (or (magit-completing-read prompt (delete exclude (magit-list-refnames))
-                               nil nil nil 'magit-revision-history default)
-        (user-error "Nothing selected"))))
-
-(cl-defun magit-read-upstream-branch
-    (&optional (branch (magit-get-current-branch)) prompt)
-  (magit-completing-read
-   (or prompt (format "Change upstream of %s to" branch))
-   (-union (--map (concat it "/" branch)
-                  (magit-list-remotes))
-           (delete branch (magit-list-branch-names)))
-   nil nil nil 'magit-revision-history
-   (or (let ((r (magit-remote-branch-at-point))
-             (l (magit-branch-at-point)))
-         (when (and l (equal l branch))
-           (setq l nil))
-         (if magit-prefer-remote-upstream (or r l) (or l r)))
-       (let ((r (magit-branch-p "origin/master"))
-             (l (and (not (equal branch "master"))
-                     (magit-branch-p "master"))))
-         (if magit-prefer-remote-upstream (or r l) (or l r)))
-       (let ((previous (magit-get-previous-branch)))
-         (and (not (equal previous branch)) previous)))))
-
-(defun magit-read-starting-point (prompt)
-  (or (magit-completing-read (concat prompt " starting at")
-                             (cons "HEAD" (magit-list-refnames))
-                             nil nil nil 'magit-revision-history
-                             (magit--default-starting-point))
-      (user-error "Nothing selected")))
-
-(defun magit--default-starting-point ()
-  (or (let ((r (magit-remote-branch-at-point))
-            (l (magit-local-branch-at-point)))
-        (if magit-prefer-remote-upstream (or r l) (or l r)))
-      (magit-commit-at-point)
-      (magit-stash-at-point)
-      (magit-get-current-branch)))
-
-(defun magit-read-tag (prompt &optional require-match)
-  (magit-completing-read prompt (magit-list-tags) nil
-                         require-match nil 'magit-revision-history
-                         (magit-tag-at-point)))
-
-(defun magit-read-stash (prompt &optional use-at-point)
-  (let ((atpoint (magit-stash-at-point)))
-    (or (and use-at-point atpoint)
-        (let ((stashes (magit-list-stashes)))
-          (magit-completing-read prompt stashes nil t nil nil
-                                 (or atpoint (car stashes)))))))
-
-(defun magit-read-remote (prompt &optional default use-only)
-  (let ((remotes (magit-list-remotes)))
-    (if (and use-only (= (length remotes) 1))
-        (car remotes)
-      (magit-completing-read prompt remotes
-                             nil t nil nil
-                             (or default
-                                 (magit-remote-at-point)
-                                 (magit-get-remote))))))
-
-(defun magit-read-remote-or-url (prompt &optional default)
-  (magit-completing-read prompt
-                         (nconc (magit-list-remotes)
-                                (list "https://" "git://" "git@"))
-                         nil nil nil nil
-                         (or default
-                             (magit-remote-at-point)
-                             (magit-get-remote))))
-
-(defun magit-read-module-path (prompt)
-  (magit-completing-read prompt (magit-get-submodules)))
-
-;;; Variables
-
-(defun magit-config-get-from-cached-list (key)
-  (gethash
-   ;; `git config --list' downcases first and last components of the key.
-   (--> key
-        (replace-regexp-in-string "\\`[^.]+" #'downcase it t t)
-        (replace-regexp-in-string "[^.]+\\'" #'downcase it t t))
-   (magit--with-refresh-cache (list 'config (magit-toplevel))
-     (let ((configs (make-hash-table :test 'equal)))
-       (dolist (conf (magit-git-items "config" "--list" "-z"))
-         (let* ((nl-pos (cl-position ?\n conf))
-                (key (substring conf 0 nl-pos))
-                (val (if nl-pos (substring conf (1+ nl-pos)) "")))
-           (puthash key (nconc (gethash key configs) (list val)) configs)))
-       configs))))
-
-(defun magit-get (&rest keys)
-  "Return the value of Git config entry specified by KEYS."
-  (car (last (apply 'magit-get-all keys))))
-
-(defun magit-get-all (&rest keys)
-  "Return all values of the Git config entry specified by KEYS."
-  (let ((magit-git-debug nil)
-        (key (mapconcat 'identity keys ".")))
-    (if magit--refresh-cache
-        (magit-config-get-from-cached-list key)
-      (magit-git-items "config" "-z" "--get-all" key))))
-
-(defun magit-get-boolean (&rest keys)
-  "Return the boolean value of Git config entry specified by KEYS."
-  (let ((key (mapconcat 'identity keys ".")))
-    (if magit--refresh-cache
-        (equal "true" (car (magit-config-get-from-cached-list key)))
-      (magit-git-true "config" "--bool" key))))
-
-(defun magit-set (val &rest keys)
-  "Set Git config settings specified by KEYS to VAL."
-  (let ((key (mapconcat 'identity keys ".")))
-    (if val
-        (magit-git-success "config" key val)
-      (magit-git-success "config" "--unset" key))
-    val))
-
-(gv-define-setter magit-get (val &rest keys)
-  `(magit-set ,val ,@keys))
-
-(provide 'magit-git)
-;;; magit-git.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-git.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-imenu.el
@@ -1,243 +0,0 @@
-;;; magit-imenu.el --- Integrate Imenu in magit major modes  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Damien Cassou <damien@cassou.me>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; Emacs' major modes can facilitate navigation in their buffers by
-;; supporting Imenu.  In such major modes, launching Imenu (M-x imenu)
-;; makes Emacs display a list of items (e.g., function definitions in
-;; a programming major mode).  Selecting an item from this list moves
-;; point to this item.
-
-;; magit-imenu.el adds Imenu support to every major mode in Magit
-
-;;; Code:
-
-(require 'subr-x)
-
-(require 'magit)
-(require 'git-rebase)
-
-(defun magit-imenu--index-function (entry-types menu-types)
-  "Return an alist of imenu entries in current buffer.
-
-ENTRY-TYPES is a list of section types to be selected through
-`imenu'.
-
-MENU-TYPES is a list of section types containing elements of
-ENTRY-TYPES.  Elements of MENU-TYPES are are used to categories
-elements of ENTRY-TYPES.
-
-This function is used as a helper for functions set as
-`imenu-create-index-function'."
-  (let ((entries (make-hash-table :test 'equal)))
-    (goto-char (point-max))
-    (while (magit-section--backward-find
-            (lambda ()
-              (let* ((section (magit-current-section))
-                     (type (magit-section-type section))
-                     (parent (magit-section-parent section))
-                     (parent-type (magit-section-type parent)))
-                (and (-contains-p entry-types type)
-                     (-contains-p menu-types parent-type)))))
-      (let* ((section (magit-current-section))
-             (name (buffer-substring-no-properties
-                    (line-beginning-position)
-                    (line-end-position)))
-             (parent (magit-section-parent section))
-             (parent-title (buffer-substring-no-properties
-                            (magit-section-start parent)
-                            (1- (magit-section-content parent)))))
-        (puthash parent-title
-                 (cons (cons name (point))
-                       (gethash parent-title entries (list)))
-                 entries)))
-    (-map (lambda (menu-title)
-            (cons menu-title (gethash menu-title entries)))
-          (hash-table-keys entries))))
-
-;;; Log mode
-
-;;;###autoload
-(defun magit-imenu--log-prev-index-position-function ()
-  "Move point to previous line in current buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'."
-  (magit-section--backward-find
-   (lambda ()
-     (-contains-p '(commit stash)
-                  (magit-section-type (magit-current-section))))))
-
-;;;###autoload
-(defun magit-imenu--log-extract-index-name-function ()
-  "Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line."
-  (save-match-data
-    (looking-at "\\([^ ]+\\)[ *|]+\\(.+\\)$")
-    (format "%s: %s"
-            (match-string-no-properties 1)
-            (match-string-no-properties 2))))
-
-;;; Diff mode
-
-;;;###autoload
-(defun magit-imenu--diff-prev-index-position-function ()
-  "Move point to previous file line in current buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'."
-  (magit-section--backward-find
-   (lambda ()
-     (and (equal (magit-section-type (magit-current-section)) 'file)
-          (not (equal (magit-section-type
-                       (magit-section-parent (magit-current-section)))
-                      'diffstat))))))
-
-;;;###autoload
-(defun magit-imenu--diff-extract-index-name-function ()
-  "Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line."
-  (buffer-substring-no-properties (line-beginning-position)
-                                  (line-end-position)))
-
-;;; Status mode
-
-;;;###autoload
-(defun magit-imenu--status-create-index-function ()
-  "Return an alist of all imenu entries in current buffer.
-This function is used as a value for
-`imenu-create-index-function'."
-  (magit-imenu--index-function
-   '(file commit stash)
-   '(unpushed unstaged unpulled untracked staged stashes)))
-
-;;;; Refs mode
-
-;;;###autoload
-(defun magit-imenu--refs-create-index-function ()
-  "Return an alist of all imenu entries in current buffer.
-This function is used as a value for
-`imenu-create-index-function'."
-  (magit-imenu--index-function
-   '(branch commit tag)
-   '(local remote tags)))
-
-;;;; Cherry mode
-
-;;;###autoload
-(defun magit-imenu--cherry-create-index-function ()
-  "Return an alist of all imenu entries in current buffer.
-This function is used as a value for
-`imenu-create-index-function'."
-  (magit-imenu--index-function
-   '(commit)
-   '(cherries)))
-
-;;;; Submodule list mode
-
-;;;###autoload
-(defun magit-imenu--submodule-prev-index-position-function ()
-  "Move point to previous line in magit-submodule-list buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'."
-  (unless (bobp)
-    (forward-line -1)))
-
-;;;###autoload
-(defun magit-imenu--submodule-extract-index-name-function ()
-  "Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line."
-  (elt (tabulated-list-get-entry) 0))
-
-;;;; Repolist mode
-
-;;;###autoload
-(defun magit-imenu--repolist-prev-index-position-function ()
-  "Move point to previous line in magit-repolist buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'."
-  (unless (bobp)
-    (forward-line -1)))
-
-;;;###autoload
-(defun magit-imenu--repolist-extract-index-name-function ()
-  "Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line."
-  (let ((entry (tabulated-list-get-entry)))
-    (format "%s (%s)"
-            (elt entry 0)
-            (elt entry (1- (length entry))))))
-
-;;;; Process mode
-
-;;;###autoload
-(defun magit-imenu--process-prev-index-position-function ()
-  "Move point to previous process in magit-process buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'."
-  (magit-section--backward-find
-   (lambda ()
-     (eq
-      (magit-section-type (magit-current-section))
-      'process))))
-
-;;;###autoload
-(defun magit-imenu--process-extract-index-name-function ()
-  "Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line."
-  (buffer-substring-no-properties (line-beginning-position)
-                                  (line-end-position)))
-
-;;;; Rebase mode
-
-;;;###autoload
-(defun magit-imenu--rebase-prev-index-position-function ()
-  "Move point to previous commit in git-rebase buffer.
-This function is used as a value for
-`imenu-prev-index-position-function'."
-  (catch 'found
-    (while (not (bobp))
-      (git-rebase-backward-line)
-      (when (git-rebase-line-p)
-        (throw 'found t)))))
-
-;;;###autoload
-(defun magit-imenu--rebase-extract-index-name-function ()
-  "Return imenu name for line at point.
-This function is used as a value for
-`imenu-extract-index-name-function'.  Point should be at the
-beginning of the line."
-  (buffer-substring-no-properties (line-beginning-position)
-                                  (line-end-position)))
-
-(provide 'magit-imenu)
-;;; magit-imenu.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-imenu.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-log.el
@@ -1,1558 +0,0 @@
-;;; magit-log.el --- inspect Git history  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements support for looking at Git logs, including
-;; special logs like reflogs and cherry-logs, as well as for selecting
-;; a commit from a log.
-
-;;; Code:
-
-(require 'magit-core)
-(require 'magit-diff)
-
-(declare-function magit-blob-visit 'magit)
-(declare-function magit-insert-head-branch-header 'magit)
-(declare-function magit-insert-upstream-branch-header 'magit)
-(declare-function magit-read-file-from-rev 'magit)
-(declare-function magit-show-commit 'magit)
-(defvar magit-refs-indent-cherry-lines)
-(defvar magit-refs-margin)
-(defvar magit-refs-show-commit-count)
-(defvar magit-buffer-margin)
-(defvar magit-status-margin)
-(defvar magit-status-sections-hook)
-
-(require 'ansi-color)
-(require 'crm)
-(defvar bookmark-make-record-function)
-
-;;; Options
-;;;; Log Mode
-
-(defgroup magit-log nil
-  "Inspect and manipulate Git history."
-  :link '(info-link "(magit)Logging")
-  :group 'magit-modes)
-
-(defcustom magit-log-mode-hook nil
-  "Hook run after entering Magit-Log mode."
-  :group 'magit-log
-  :type 'hook)
-
-(defcustom magit-log-arguments '("-n256" "--graph" "--decorate")
-  "The log arguments used in `magit-log-mode' buffers."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-git-arguments
-  :group 'magit-log
-  :type '(repeat (string :tag "Argument")))
-
-(defcustom magit-log-remove-graph-args '("--follow" "--grep" "-G" "-S" "-L")
-  "The log arguments that cause the `--graph' argument to be dropped."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-log
-  :type '(repeat (string :tag "Argument"))
-  :options '("--follow" "--grep" "-G" "-S" "-L"))
-
-(defcustom magit-log-revision-headers-format "\
-%+b
-Author:    %aN <%aE>
-Committer: %cN <%cE>"
-  "Additional format string used with the `++header' argument."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-log
-  :type 'string)
-
-(defcustom magit-log-auto-more nil
-  "Insert more log entries automatically when moving past the last entry.
-Only considered when moving past the last entry with
-`magit-goto-*-section' commands."
-  :group 'magit-log
-  :type 'boolean)
-
-(defcustom magit-log-margin '(t age magit-log-margin-width t 18)
-  "Format of the margin in `magit-log-mode' buffers.
-
-The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH).
-
-If INIT is non-nil, then the margin is shown initially.
-STYLE controls how to format the committer date.  It can be one
-  of `age' (to show the age of the commit), `age-abbreviated' (to
-  abbreviate the time unit to a character), or a string (suitable
-  for `format-time-string') to show the actual date.
-WIDTH controls the width of the margin.  This exists for forward
-  compatibility and currently the value should not be changed.
-AUTHOR controls whether the name of the author is also shown by
-  default.
-AUTHOR-WIDTH has to be an integer.  When the name of the author
-  is shown, then this specifies how much space is used to do so."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-log
-  :group 'magit-margin
-  :type magit-log-margin--custom-type
-  :initialize 'magit-custom-initialize-reset
-  :set (apply-partially #'magit-margin-set-variable 'magit-log-mode))
-
-(defcustom magit-log-show-refname-after-summary nil
-  "Whether to show refnames after commit summaries.
-This is useful if you use really long branch names."
-  :package-version '(magit . "2.2.0")
-  :group 'magit-log
-  :type 'boolean)
-
-(defface magit-log-graph
-  '((((class color) (background light)) :foreground "grey30")
-    (((class color) (background  dark)) :foreground "grey80"))
-  "Face for the graph part of the log output."
-  :group 'magit-faces)
-
-(defface magit-log-author
-  '((((class color) (background light)) :foreground "firebrick")
-    (((class color) (background  dark)) :foreground "tomato"))
-  "Face for the author part of the log output."
-  :group 'magit-faces)
-
-(defface magit-log-date
-  '((((class color) (background light)) :foreground "grey30")
-    (((class color) (background  dark)) :foreground "grey80"))
-  "Face for the date part of the log output."
-  :group 'magit-faces)
-
-;;;; File Log
-
-(defcustom magit-log-buffer-file-locked t
-  "Whether `magit-log-buffer-file' uses a decicated buffer."
-  :package-version '(magit . "2.7.0")
-  :group 'magit-commands
-  :group 'magit-log
-  :type 'boolean)
-
-;;;; Select Mode
-
-(defcustom magit-log-select-arguments '("-n256" "--decorate")
-  "The log arguments used in `magit-log-select-mode' buffers."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-log
-  :type '(repeat (string :tag "Argument")))
-
-(defcustom magit-log-select-show-usage 'both
-  "Whether to show usage information when selecting a commit from a log.
-The message can be shown in the `echo-area' or the `header-line', or in
-`both' places.  If the value isn't one of these symbols, then it should
-be nil, in which case no usage information is shown."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-log
-  :type '(choice (const :tag "in echo-area" echo-area)
-                 (const :tag "in header-line" header-line)
-                 (const :tag "in both places" both)
-                 (const :tag "nowhere")))
-
-(defcustom magit-log-select-margin
-  (list (nth 0 magit-log-margin)
-        (nth 1 magit-log-margin)
-        'magit-log-margin-width t
-        (nth 4 magit-log-margin))
-  "Format of the margin in `magit-log-select-mode' buffers.
-
-The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH).
-
-If INIT is non-nil, then the margin is shown initially.
-STYLE controls how to format the committer date.  It can be one
-  of `age' (to show the age of the commit), `age-abbreviated' (to
-  abbreviate the time unit to a character), or a string (suitable
-  for `format-time-string') to show the actual date.
-WIDTH controls the width of the margin.  This exists for forward
-  compatibility and currently the value should not be changed.
-AUTHOR controls whether the name of the author is also shown by
-  default.
-AUTHOR-WIDTH has to be an integer.  When the name of the author
-  is shown, then this specifies how much space is used to do so."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-log
-  :group 'magit-margin
-  :type magit-log-margin--custom-type
-  :initialize 'magit-custom-initialize-reset
-  :set-after '(magit-log-margin)
-  :set (apply-partially #'magit-margin-set-variable 'magit-log-select-mode))
-
-;;;; Cherry Mode
-
-(defcustom magit-cherry-sections-hook
-  '(magit-insert-cherry-headers
-    magit-insert-cherry-commits)
-  "Hook run to insert sections into the cherry buffer."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-log
-  :type 'hook)
-
-(defcustom magit-cherry-margin
-  (list (nth 0 magit-log-margin)
-        (nth 1 magit-log-margin)
-        'magit-log-margin-width t
-        (nth 4 magit-log-margin))
-  "Format of the margin in `magit-cherry-mode' buffers.
-
-The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH).
-
-If INIT is non-nil, then the margin is shown initially.
-STYLE controls how to format the committer date.  It can be one
-  of `age' (to show the age of the commit), `age-abbreviated' (to
-  abbreviate the time unit to a character), or a string (suitable
-  for `format-time-string') to show the actual date.
-WIDTH controls the width of the margin.  This exists for forward
-  compatibility and currently the value should not be changed.
-AUTHOR controls whether the name of the author is also shown by
-  default.
-AUTHOR-WIDTH has to be an integer.  When the name of the author
-  is shown, then this specifies how much space is used to do so."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-log
-  :group 'magit-margin
-  :type magit-log-margin--custom-type
-  :initialize 'magit-custom-initialize-reset
-  :set-after '(magit-log-margin)
-  :set (apply-partially #'magit-margin-set-variable 'magit-cherry-mode))
-
-;;;; Reflog Mode
-
-(defcustom magit-reflog-arguments '("-n256")
-  "The log arguments used in `magit-reflog-mode' buffers."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-git-arguments
-  :type '(repeat (string :tag "Argument")))
-
-(defcustom magit-reflog-margin
-  (list (nth 0 magit-log-margin)
-        (nth 1 magit-log-margin)
-        'magit-log-margin-width nil
-        (nth 4 magit-log-margin))
-  "Format of the margin in `magit-reflog-mode' buffers.
-
-The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH).
-
-If INIT is non-nil, then the margin is shown initially.
-STYLE controls how to format the committer date.  It can be one
-  of `age' (to show the age of the commit), `age-abbreviated' (to
-  abbreviate the time unit to a character), or a string (suitable
-  for `format-time-string') to show the actual date.
-WIDTH controls the width of the margin.  This exists for forward
-  compatibility and currently the value should not be changed.
-AUTHOR controls whether the name of the author is also shown by
-  default.
-AUTHOR-WIDTH has to be an integer.  When the name of the author
-  is shown, then this specifies how much space is used to do so."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-log
-  :group 'magit-margin
-  :type magit-log-margin--custom-type
-  :initialize 'magit-custom-initialize-reset
-  :set-after '(magit-log-margin)
-  :set (apply-partially #'magit-margin-set-variable 'magit-reflog-mode))
-
-(defface magit-reflog-commit '((t :foreground "green"))
-  "Face for commit commands in reflogs."
-  :group 'magit-faces)
-
-(defface magit-reflog-amend '((t :foreground "magenta"))
-  "Face for amend commands in reflogs."
-  :group 'magit-faces)
-
-(defface magit-reflog-merge '((t :foreground "green"))
-  "Face for merge, checkout and branch commands in reflogs."
-  :group 'magit-faces)
-
-(defface magit-reflog-checkout '((t :foreground "blue"))
-  "Face for checkout commands in reflogs."
-  :group 'magit-faces)
-
-(defface magit-reflog-reset '((t :foreground "red"))
-  "Face for reset commands in reflogs."
-  :group 'magit-faces)
-
-(defface magit-reflog-rebase '((t :foreground "magenta"))
-  "Face for rebase commands in reflogs."
-  :group 'magit-faces)
-
-(defface magit-reflog-cherry-pick '((t :foreground "green"))
-  "Face for cherry-pick commands in reflogs."
-  :group 'magit-faces)
-
-(defface magit-reflog-remote '((t :foreground "cyan"))
-  "Face for pull and clone commands in reflogs."
-  :group 'magit-faces)
-
-(defface magit-reflog-other '((t :foreground "cyan"))
-  "Face for other commands in reflogs."
-  :group 'magit-faces)
-
-;;;; Log Sections
-
-(defcustom magit-log-section-commit-count 10
-  "How many recent commits to show in certain log sections.
-How many recent commits `magit-insert-recent-commits' and
-`magit-insert-unpulled-from-upstream-or-recent' (provided
-the upstream isn't ahead of the current branch) show."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-status
-  :type 'number)
-
-(defcustom magit-log-section-arguments '("-n256" "--decorate")
-  "The log arguments used in buffers that show other things besides logs."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-git-arguments
-  :group 'magit-log
-  :group 'magit-status
-  :type '(repeat (string :tag "Argument")))
-
-;;; Commands
-;;;; Popups
-
-(defvar magit-log-popup
-  '(:variable magit-log-arguments
-    :man-page "git-log"
-    :switches ((?g "Show graph"              "--graph")
-               (?c "Show graph in color"     "--color")
-               (?d "Show refnames"           "--decorate")
-               (?S "Show signatures"         "--show-signature")
-               (?u "Show diffs"              "--patch")
-               (?s "Show diffstats"          "--stat")
-               (?h "Show header"             "++header")
-               (?D "Simplify by decoration"  "--simplify-by-decoration")
-               (?f "Follow renames when showing single-file log" "--follow"))
-    :options  ((?n "Limit number of commits" "-n")
-               (?f "Limit to files"          "-- " magit-read-files)
-               (?a "Limit to author"         "--author=")
-               (?o "Order commits by"        "++order=" magit-log-select-order)
-               (?g "Search messages"         "--grep=")
-               (?G "Search changes"          "-G")
-               (?S "Search occurrences"      "-S")
-               (?L "Trace line evolution"    "-L" magit-read-file-trace))
-    :actions  ((?l "Log current"             magit-log-current)
-               (?L "Log local branches"      magit-log-branches)
-               (?r "Reflog current"          magit-reflog-current)
-               (?o "Log other"               magit-log)
-               (?b "Log all branches"        magit-log-all-branches)
-               (?O "Reflog other"            magit-reflog)
-               (?h "Log HEAD"                magit-log-head)
-               (?a "Log all references"      magit-log-all)
-               (?H "Reflog HEAD"             magit-reflog-head))
-    :default-action magit-log-current
-    :max-action-columns 3))
-
-(defvar magit-log-mode-refresh-popup
-  '(:variable magit-log-arguments
-    :man-page "git-log"
-    :switches ((?g "Show graph"              "--graph")
-               (?c "Show graph in color"     "--color")
-               (?d "Show refnames"           "--decorate")
-               (?S "Show signatures"         "--show-signature")
-               (?u "Show diffs"              "--patch")
-               (?s "Show diffstats"          "--stat")
-               (?D "Simplify by decoration"  "--simplify-by-decoration")
-               (?f "Follow renames when showing single-file log" "--follow"))
-    :options  ((?n "Limit number of commits" "-n")
-               (?f "Limit to files"          "-- " magit-read-files)
-               (?a "Limit to author"         "--author=")
-               (?o "Order commits by"        "++order=" magit-log-select-order)
-               (?g "Search messages"         "--grep=")
-               (?G "Search changes"          "-G")
-               (?S "Search occurrences"      "-S")
-               (?L "Trace line evolution"    "-L" magit-read-file-trace))
-    :actions  ((?g "Refresh"       magit-log-refresh)
-               (?L "Toggle margin" magit-toggle-margin)
-               (?s "Set defaults"  magit-log-set-default-arguments) nil
-               (?w "Save defaults" magit-log-save-default-arguments))
-    :max-action-columns 2))
-
-(defvar magit-reflog-mode-refresh-popup
-  '(:variable magit-reflog-arguments
-    :man-page "git-reflog"
-    :options  ((?n "Limit number of commits" "-n"))))
-
-(defvar magit-log-refresh-popup
-  '(:variable magit-log-arguments
-    :man-page "git-log"
-    :switches ((?g "Show graph"          "--graph")
-               (?c "Show graph in color" "--color")
-               (?d "Show refnames"       "--decorate"))
-    :options  ((?n "Limit number of commits" "-n")
-               (?o "Order commits by"        "++order=" magit-log-select-order))
-    :actions  ("Refresh"
-               (?g "buffer"                   magit-log-refresh)
-               (?s "buffer and set defaults"  magit-log-set-default-arguments)
-               (?w "buffer and save defaults" magit-log-save-default-arguments)
-               "Margin"
-               (?L "toggle visibility" magit-toggle-margin)
-               (?l "cycle style"       magit-cycle-margin-style)
-               (?d "toggle details"    magit-toggle-margin-details))
-    :max-action-columns 1))
-
-(magit-define-popup-keys-deferred 'magit-log-popup)
-(magit-define-popup-keys-deferred 'magit-log-mode-refresh-popup)
-(magit-define-popup-keys-deferred 'magit-log-refresh-popup)
-
-(defun magit-read-file-trace (&rest _ignored)
-  (let ((file  (magit-read-file-from-rev "HEAD" "File"))
-        (trace (magit-read-string "Trace")))
-    (if (string-match
-         "^\\(/.+/\\|:[^:]+\\|[0-9]+,[-+]?[0-9]+\\)\\(:\\)?$" trace)
-        (concat trace (or (match-string 2 trace) ":") file)
-      (user-error "Trace is invalid, see man git-log"))))
-
-(defun magit-log-select-order (&rest _ignored)
-  (magit-read-char-case "Order commits by " t
-    (?t "[t]opography"     "topo")
-    (?a "[a]uthor date"    "author-date")
-    (?c "[c]ommitter date" "date")))
-
-(defun magit-log-get-buffer-args ()
-  (cond ((and magit-use-sticky-arguments
-              (derived-mode-p 'magit-log-mode))
-         (list (nth 1 magit-refresh-args)
-               (nth 2 magit-refresh-args)))
-        ((and (eq magit-use-sticky-arguments t)
-              (--when-let (magit-mode-get-buffer 'magit-log-mode)
-                (with-current-buffer it
-                  (list (nth 1 magit-refresh-args)
-                        (nth 2 magit-refresh-args))))))
-        (t
-         (list (default-value 'magit-log-arguments) nil))))
-
-(defun magit-log-arguments (&optional refresh)
-  (cond ((memq magit-current-popup
-               '(magit-log-popup magit-log-refresh-popup))
-         (magit-popup-export-file-args magit-current-popup-args))
-        ((and refresh (not (derived-mode-p 'magit-log-mode)))
-         (list magit-log-section-arguments nil))
-        (t
-         (magit-log-get-buffer-args))))
-
-(defun magit-log-popup (arg)
-  "Popup console for log commands."
-  (interactive "P")
-  (let ((magit-log-refresh-popup
-         (pcase major-mode
-           (`magit-log-mode magit-log-mode-refresh-popup)
-           (_               magit-log-refresh-popup)))
-        (magit-log-arguments
-         (apply #'magit-popup-import-file-args (magit-log-get-buffer-args))))
-    (magit-invoke-popup 'magit-log-popup nil arg)))
-
-;;;###autoload
-(defun magit-log-buffer-file-popup ()
-  "Popup console for log commands.
-
-This is a variant of `magit-log-popup' which shows the same popup
-but which limits the log to the file being visited in the current
-buffer."
-  (interactive)
-  (-if-let (file (magit-file-relative-name))
-      (let ((magit-log-arguments
-             (magit-popup-import-file-args
-              (-if-let (buffer (magit-mode-get-buffer 'magit-log-mode))
-                  (with-current-buffer buffer
-                    (nth 2 magit-refresh-args))
-                (default-value 'magit-log-arguments))
-              (list file))))
-        (magit-invoke-popup 'magit-log-popup nil nil))
-    (user-error "Buffer isn't visiting a file")))
-
-(defun magit-log-refresh-popup (arg)
-  "Popup console for changing log arguments in the current buffer."
-  (interactive "P")
-  (magit-log-refresh-assert)
-  (let ((magit-log-refresh-popup
-         (cond ((derived-mode-p 'magit-log-select-mode)
-                magit-log-refresh-popup)
-               ((derived-mode-p 'magit-log-mode)
-                (let ((def (copy-sequence magit-log-refresh-popup)))
-                  (plist-put def :switches (plist-get magit-log-popup :switches))
-                  (plist-put def :options  (plist-get magit-log-popup :options))
-                  def))
-               (t
-                magit-log-refresh-popup)))
-        (magit-log-arguments
-         (cond ((derived-mode-p 'magit-log-select-mode)
-                (cadr magit-refresh-args))
-               ((derived-mode-p 'magit-log-mode)
-                (magit-popup-import-file-args (nth 1 magit-refresh-args)
-                                              (nth 2 magit-refresh-args)))
-               (t
-                magit-log-section-arguments))))
-    (magit-invoke-popup 'magit-log-refresh-popup nil arg)))
-
-;;;; Refresh Commands
-
-(defun magit-log-refresh (args files)
-  "Set the local log arguments for the current buffer."
-  (interactive (magit-log-arguments t))
-  (magit-log-refresh-assert)
-  (cond ((derived-mode-p 'magit-log-select-mode)
-         (setcar (cdr magit-refresh-args) args))
-        ((derived-mode-p 'magit-log-mode)
-         (setcdr magit-refresh-args (list args files)))
-        (t
-         (setq-local magit-log-section-arguments args)))
-  (magit-refresh))
-
-(defun magit-log-set-default-arguments (args files)
-  "Set the global log arguments for the current buffer."
-  (interactive (magit-log-arguments t))
-  (magit-log-refresh-assert)
-  (cond ((derived-mode-p 'magit-log-select-mode)
-         (customize-set-variable 'magit-log-select-arguments args)
-         (setcar (cdr magit-refresh-args) args))
-        ((derived-mode-p 'magit-log-mode)
-         (customize-set-variable 'magit-log-arguments args)
-         (setcdr magit-refresh-args (list args files)))
-        (t
-         (customize-set-variable 'magit-log-section-arguments args)
-         (kill-local-variable    'magit-log-section-arguments)))
-  (magit-refresh))
-
-(defun magit-log-save-default-arguments (args files)
-  "Set and save the global log arguments for the current buffer."
-  (interactive (magit-log-arguments t))
-  (magit-log-refresh-assert)
-  (cond ((derived-mode-p 'magit-log-select-mode)
-         (customize-save-variable 'magit-log-select-arguments args)
-         (setcar (cdr magit-refresh-args) args))
-        ((derived-mode-p 'magit-log-mode)
-         (customize-save-variable 'magit-log-arguments args)
-         (setcdr magit-refresh-args (list args files)))
-        (t
-         (customize-save-variable 'magit-log-section-arguments args)
-         (kill-local-variable     'magit-log-section-arguments)))
-  (magit-refresh))
-
-(defun magit-log-refresh-assert ()
-  (cond ((derived-mode-p 'magit-reflog-mode)
-         (user-error "Cannot change log arguments in reflog buffers"))
-        ((derived-mode-p 'magit-cherry-mode)
-         (user-error "Cannot change log arguments in cherry buffers"))))
-
-;;;; Log Commands
-
-(defvar magit-log-read-revs-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map crm-local-completion-map)
-    (define-key map "\s" 'self-insert-command)
-    map))
-
-(defun magit-log-read-revs (&optional use-current)
-  (or (and use-current (--when-let (magit-get-current-branch) (list it)))
-      (let ((collection `(,@(and (file-exists-p (magit-git-dir "FETCH_HEAD"))
-                                 (list "FETCH_HEAD"))
-                          ,@(magit-list-refnames))))
-        (split-string
-         (magit-completing-read-multiple "Log rev,s" collection
-                                         "\\(\\.\\.\\.?\\|[, ]\\)"
-                                         (or (magit-branch-or-commit-at-point)
-                                             (unless use-current
-                                               (magit-get-previous-branch)))
-                                         'magit-revision-history
-                                         magit-log-read-revs-map)
-         "[, ]" t))))
-
-;;;###autoload
-(defun magit-log-current (revs &optional args files)
-  "Show log for the current branch.
-When `HEAD' is detached or with a prefix argument show log for
-one or more revs read from the minibuffer."
-  (interactive (cons (magit-log-read-revs t)
-                     (magit-log-arguments)))
-  (magit-log revs args files))
-
-;;;###autoload
-(defun magit-log (revs &optional args files)
-  "Show log for one or more revs read from the minibuffer.
-The user can input any revision or revisions separated by a
-space, or even ranges, but only branches and tags, and a
-representation of the commit at point, are available as
-completion candidates."
-  (interactive (cons (magit-log-read-revs)
-                     (magit-log-arguments)))
-  (require 'magit)
-  (magit-mode-setup #'magit-log-mode revs args files)
-  (magit-log-goto-same-commit))
-
-;;;###autoload
-(defun magit-log-head (&optional args files)
-  "Show log for `HEAD'."
-  (interactive (magit-log-arguments))
-  (magit-log (list "HEAD") args files))
-
-;;;###autoload
-(defun magit-log-branches (&optional args files)
-  "Show log for all local branches and `HEAD'."
-  (interactive (magit-log-arguments))
-  (magit-log (if (magit-get-current-branch)
-                 (list "--branches")
-               (list "HEAD" "--branches"))
-             args files))
-
-;;;###autoload
-(defun magit-log-all-branches (&optional args files)
-  "Show log for all local and remote branches and `HEAD'."
-  (interactive (magit-log-arguments))
-  (magit-log (if (magit-get-current-branch)
-                 (list "--branches" "--remotes")
-               (list "HEAD" "--branches" "--remotes"))
-             args files))
-
-;;;###autoload
-(defun magit-log-all (&optional args files)
-  "Show log for all references and `HEAD'."
-  (interactive (magit-log-arguments))
-  (magit-log (if (magit-get-current-branch)
-                 (list "--all")
-               (list "HEAD" "--all"))
-             args files))
-
-;;;###autoload
-(defun magit-log-buffer-file (&optional follow beg end)
-  "Show log for the blob or file visited in the current buffer.
-With a prefix argument or when `--follow' is part of
-`magit-log-arguments', then follow renames.  When the region is
-active, restrict the log to the lines that the region touches."
-  (interactive
-   (cons current-prefix-arg
-         (and (region-active-p)
-              (save-restriction
-                (widen)
-                (list (line-number-at-pos (region-beginning))
-                      (line-number-at-pos
-                       (let ((end (region-end)))
-                         (if (char-after end)
-                             end
-                           ;; Ensure that we don't get the line number
-                           ;; of a trailing newline.
-                           (1- end)))))))))
-  (require 'magit)
-  (-if-let (file (magit-file-relative-name))
-      (magit-mode-setup-internal
-       #'magit-log-mode
-       (list (list (or magit-buffer-refname
-                       (magit-get-current-branch)
-                       "HEAD"))
-             (let ((args (car (magit-log-arguments))))
-               (when (and follow (not (member "--follow" args)))
-                 (push "--follow" args))
-               (when (and beg end)
-                 (setq args (cons (format "-L%s,%s:%s" beg end file)
-                                  (cl-delete "-L" args :test
-                                             'string-prefix-p)))
-                 (setq file nil))
-               args)
-             (and file (list file)))
-       magit-log-buffer-file-locked)
-    (user-error "Buffer isn't visiting a file"))
-  (magit-log-goto-same-commit))
-
-;;;###autoload
-(defun magit-reflog-current ()
-  "Display the reflog of the current branch."
-  (interactive)
-  (magit-reflog (magit-get-current-branch)))
-
-;;;###autoload
-(defun magit-reflog (ref)
-  "Display the reflog of a branch."
-  (interactive (list (magit-read-local-branch-or-ref "Show reflog for")))
-  (require 'magit)
-  (magit-mode-setup #'magit-reflog-mode ref magit-reflog-arguments))
-
-;;;###autoload
-(defun magit-reflog-head ()
-  "Display the `HEAD' reflog."
-  (interactive)
-  (magit-reflog "HEAD"))
-
-;;;; Limit Commands
-
-(defun magit-log-toggle-commit-limit ()
-  "Toggle the number of commits the current log buffer is limited to.
-If the number of commits is currently limited, then remove that
-limit.  Otherwise set it to 256."
-  (interactive)
-  (magit-log-set-commit-limit (lambda (&rest _) nil)))
-
-(defun magit-log-double-commit-limit ()
-  "Double the number of commits the current log buffer is limited to."
-  (interactive)
-  (magit-log-set-commit-limit '*))
-
-(defun magit-log-half-commit-limit ()
-  "Half the number of commits the current log buffer is limited to."
-  (interactive)
-  (magit-log-set-commit-limit '/))
-
-(defun magit-log-set-commit-limit (fn)
-  (let* ((val (car (magit-log-arguments t)))
-         (arg (--first (string-match "^-n\\([0-9]+\\)?$" it) val))
-         (num (and arg (string-to-number (match-string 1 arg))))
-         (num (if num (funcall fn num 2) 256)))
-    (setq val (delete arg val))
-    (setcar (cdr magit-refresh-args)
-            (if (and num (> num 0))
-                (cons (format "-n%i" num) val)
-              val)))
-  (magit-refresh))
-
-(defun magit-log-get-commit-limit ()
-  (--when-let (--first (string-match "^-n\\([0-9]+\\)?$" it)
-                       (car (magit-log-arguments t)))
-    (string-to-number (match-string 1 it))))
-
-;;;; Other Commands
-
-(defun magit-log-bury-buffer (&optional arg)
-  "Bury the current buffer or the revision buffer in the same frame.
-Like `magit-mode-bury-buffer' (which see) but with a negative
-prefix argument instead bury the revision buffer, provided it
-is displayed in the current frame."
-  (interactive "p")
-  (if (< arg 0)
-      (let* ((buf (magit-mode-get-buffer 'magit-revision-mode))
-             (win (and buf (get-buffer-window buf (selected-frame)))))
-        (if win
-            (with-selected-window win
-              (with-current-buffer buf
-                (magit-mode-bury-buffer (> (abs arg) 1))))
-          (user-error "No revision buffer in this frame")))
-    (magit-mode-bury-buffer (> arg 1))))
-
-;;;###autoload
-(defun magit-log-move-to-parent (&optional n)
-  "Move to the Nth parent of the current commit."
-  (interactive "p")
-  (when (derived-mode-p 'magit-log-mode)
-    (magit-section-when commit
-      (let ((parent-rev (format "%s^%s" (magit-section-value it) (or n 1))))
-        (-if-let (parent-hash (magit-rev-parse "--short" parent-rev))
-            (-if-let (section (--first (equal (magit-section-value it)
-                                              parent-hash)
-                                       (magit-section-siblings it 'next)))
-                (magit-section-goto section)
-              (user-error
-               (substitute-command-keys
-                (concat "Parent " parent-hash " not found.  Try typing "
-                        "\\[magit-log-double-commit-limit] first"))))
-          (user-error "Parent %s does not exist" parent-rev))))))
-
-;;; Log Mode
-
-(defvar magit-log-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-mode-map)
-    (define-key map "\C-c\C-b" 'magit-go-backward)
-    (define-key map "\C-c\C-f" 'magit-go-forward)
-    (define-key map "\C-c\C-n" 'magit-log-move-to-parent)
-    (define-key map "=" 'magit-log-toggle-commit-limit)
-    (define-key map "+" 'magit-log-double-commit-limit)
-    (define-key map "-" 'magit-log-half-commit-limit)
-    (define-key map "q" 'magit-log-bury-buffer)
-    map)
-  "Keymap for `magit-log-mode'.")
-
-(define-derived-mode magit-log-mode magit-mode "Magit Log"
-  "Mode for looking at Git log.
-
-This mode is documented in info node `(magit)Log Buffer'.
-
-\\<magit-mode-map>\
-Type \\[magit-refresh] to refresh the current buffer.
-Type \\[magit-visit-thing] or \\[magit-diff-show-or-scroll-up] \
-to visit the commit at point.
-
-Type \\[magit-branch-popup] to see available branch commands.
-Type \\[magit-merge-popup] to merge the branch or commit at point.
-Type \\[magit-cherry-pick-popup] to apply the commit at point.
-Type \\[magit-reset] to reset `HEAD' to the commit at point.
-
-\\{magit-log-mode-map}"
-  :group 'magit-log
-  (hack-dir-local-variables-non-file-buffer)
-  (setq imenu-prev-index-position-function
-        'magit-imenu--log-prev-index-position-function)
-  (setq imenu-extract-index-name-function
-        'magit-imenu--log-extract-index-name-function)
-  (setq-local bookmark-make-record-function
-              'magit-bookmark--log-make-record))
-
-(defvar magit-log-disable-graph-hack-args
-  '("-G" "--grep" "--author")
-  "Arguments which disable the graph speedup hack.")
-
-(defun magit-log-refresh-buffer (revs args files)
-  (setq header-line-format
-        (propertize
-         (concat " Commits in " (mapconcat 'identity revs  " ")
-                 (and files (concat " touching "
-                                    (mapconcat 'identity files " ")))
-                 (--some (and (string-prefix-p "-L" it)
-                              (concat " " it))
-                         args))
-         'face 'magit-header-line))
-  (unless (= (length files) 1)
-    (setq args (remove "--follow" args)))
-  (when (--any-p (string-match-p
-                  (concat "^" (regexp-opt magit-log-remove-graph-args)) it)
-                 args)
-    (setq args (remove "--graph" args)))
-  (unless (member "--graph" args)
-    (setq args (remove "--color" args)))
-  (-when-let* ((limit (magit-log-get-commit-limit))
-               (limit (* 2 limit)) ; increase odds for complete graph
-               (count (and (= (length revs) 1)
-                           (> limit 1024) ; otherwise it's fast enough
-                           (setq revs (car revs))
-                           (not (string-match-p "\\.\\." revs))
-                           (not (member revs '("--all" "--branches")))
-                           (-none-p (lambda (arg)
-                                      (--any-p (string-prefix-p it arg)
-                                               magit-log-disable-graph-hack-args))
-                                    args)
-                           (magit-git-string "rev-list" "--count"
-                                             "--first-parent" args revs))))
-    (setq revs (if (< (string-to-number count) limit)
-                   revs
-                 (format "%s~%s..%s" revs limit revs))))
-  (magit-insert-section (logbuf)
-    (magit-insert-log revs args files)))
-
-(defun magit-insert-log (revs &optional args files)
-  "Insert a log section.
-Do not add this to a hook variable."
-  (let ((magit-git-global-arguments
-         (remove "--literal-pathspecs" magit-git-global-arguments)))
-    (magit-git-wash (apply-partially #'magit-log-wash-log 'log)
-      "log"
-      (format "--format=%%h%s%%x00%s%%x00%%aN%%x00%%at%%x00%%s%s"
-              (if (member "--decorate" args) "%d" "")
-              (if (member "--show-signature" args)
-                  (progn (setq args (remove "--show-signature" args)) "%G?")
-                "")
-              (if (member "++header" args)
-                  (if (member "--graph" (setq args (remove "++header" args)))
-                      (concat "\n" magit-log-revision-headers-format "\n")
-                    (concat "\n" magit-log-revision-headers-format "\n"))
-                ""))
-      (progn
-        (--when-let (--first (string-match "^\\+\\+order=\\(.+\\)$" it) args)
-          (setq args (cons (format "--%s-order" (match-string 1 it))
-                           (remove it args))))
-        (if (member "--decorate" args)
-            (cons "--decorate=full" (remove "--decorate" args))
-          args))
-      "--use-mailmap" "--no-prefix" revs "--" files)))
-
-(defvar magit-commit-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-visit-thing] 'magit-show-commit)
-    (define-key map "a" 'magit-cherry-apply)
-    map)
-  "Keymap for `commit' sections.")
-
-(defvar magit-module-commit-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-visit-thing] 'magit-show-commit)
-    map)
-  "Keymap for `module-commit' sections.")
-
-(defconst magit-log-heading-re
-  (concat "^"
-          "\\(?4:[-_/|\\*o. ]*\\)"                 ; graph
-          "\\(?1:[0-9a-fA-F]+\\)"                  ; sha1
-          "\\(?3:[^\0\n]+)\\)?\0"                  ; refs
-          "\\(?7:[BGUXYREN]\\)?\0"                 ; gpg
-          "\\(?5:[^\0\n]*\\)\0"                    ; author
-          "\\(?6:[^\0\n]+\\)\0"                    ; date
-          "\\(?2:.*\\)$"))                         ; msg
-
-(defconst magit-log-cherry-re
-  (concat "^"
-          "\\(?8:[-+]\\) "                         ; cherry
-          "\\(?1:[0-9a-fA-F]+\\) "                 ; sha1
-          "\\(?2:.*\\)$"))                         ; msg
-
-(defconst magit-log-module-re
-  (concat "^"
-          "\\(?:\\(?11:[<>]\\) \\)?"               ; side
-          "\\(?1:[0-9a-fA-F]+\\) "                 ; sha1
-          "\\(?2:.*\\)$"))                         ; msg
-
-(defconst magit-log-bisect-vis-re
-  (concat "^"
-          "\\(?4:[-_/|\\*o. ]*\\)"                 ; graph
-          "\\(?1:[0-9a-fA-F]+\\)"                  ; sha1
-          "\\(?3:[^\0\n]+)\\)?\0"                  ; refs
-          "\\(?2:.*\\)$"))                         ; msg
-
-(defconst magit-log-bisect-log-re
-  (concat "^# "
-          "\\(?3:bad:\\|skip:\\|good:\\) "         ; "refs"
-          "\\[\\(?1:[^]\n]+\\)\\] "                ; sha1
-          "\\(?2:.*\\)$"))                         ; msg
-
-(defconst magit-log-reflog-re
-  (concat "^"
-          "\\(?1:[^\0\n]+\\)\0"                    ; sha1
-          "\\(?5:[^\0\n]*\\)\0"                    ; author
-          "\\(?:\\(?:[^@\n]+@{\\(?6:[^}\n]+\\)}\0" ; date
-          "\\(?10:merge \\|autosave \\|restart \\|[^:\n]+: \\)?" ; refsub
-          "\\(?2:.*\\)?\\)\\|\0\\)$"))             ; msg
-
-(defconst magit-reflog-subject-re
-  (concat "\\(?1:[^ ]+\\) ?"                       ; command
-          "\\(?2:\\(?: ?-[^ ]+\\)+\\)?"            ; option
-          "\\(?: ?(\\(?3:[^)]+\\))\\)?"))          ; type
-
-(defconst magit-log-stash-re
-  (concat "^"
-          "\\(?1:[^\0\n]+\\)\0"                    ; "sha1"
-          "\\(?5:[^\0\n]*\\)\0"                    ; author
-          "\\(?6:[^\0\n]+\\)\0"                    ; date
-          "\\(?2:.*\\)$"))                         ; msg
-
-(defvar magit-log-count nil)
-
-(defun magit-log-wash-log (style args)
-  (setq args (-flatten args))
-  (when (and (member "--graph" args)
-             (member "--color" args))
-    (let ((ansi-color-apply-face-function
-           (lambda (beg end face)
-             (put-text-property beg end 'font-lock-face
-                                (or face 'magit-log-graph)))))
-      (ansi-color-apply-on-region (point-min) (point-max))))
-  (when (eq style 'cherry)
-    (reverse-region (point-min) (point-max)))
-  (let ((magit-log-count 0)
-        (abbrev (magit-abbrev-length)))
-    (magit-wash-sequence (apply-partially 'magit-log-wash-rev style abbrev))
-    (if (derived-mode-p 'magit-log-mode)
-        (when (eq magit-log-count (magit-log-get-commit-limit))
-          (magit-insert-section (longer)
-            (insert-text-button
-             (substitute-command-keys
-              (format "Type \\<%s>\\[%s] to show more history"
-                      'magit-log-mode-map
-                      'magit-log-double-commit-limit))
-             'action (lambda (_button)
-                       (magit-log-double-commit-limit))
-             'follow-link t
-             'mouse-face 'magit-section-highlight)))
-      (insert ?\n))))
-
-(cl-defun magit-log-wash-rev (style abbrev)
-  (when (derived-mode-p 'magit-log-mode)
-    (cl-incf magit-log-count))
-  (looking-at (pcase style
-                (`log        magit-log-heading-re)
-                (`cherry     magit-log-cherry-re)
-                (`module     magit-log-module-re)
-                (`reflog     magit-log-reflog-re)
-                (`stash      magit-log-stash-re)
-                (`bisect-vis magit-log-bisect-vis-re)
-                (`bisect-log magit-log-bisect-log-re)))
-  (magit-bind-match-strings
-      (hash msg refs graph author date gpg cherry _ refsub side) nil
-    (let ((align (not (member "--stat" (cadr magit-refresh-args))))
-          (non-graph-re (if (eq style 'bisect-vis)
-                            magit-log-bisect-vis-re
-                          magit-log-heading-re)))
-      (magit-delete-line)
-      ;; If the reflog entries have been pruned, the output of `git
-      ;; reflog show' includes a partial line that refers to the hash
-      ;; of the youngest expired reflog entry.
-      (when (and (eq style 'reflog) (not date))
-        (cl-return-from magit-log-wash-rev t))
-      (magit-insert-section section (commit hash)
-        (pcase style
-          (`stash      (setf (magit-section-type section) 'stash))
-          (`module     (setf (magit-section-type section) 'module-commit))
-          (`bisect-log (setq hash (magit-rev-parse "--short" hash))))
-        (when cherry
-          (when (and (derived-mode-p 'magit-refs-mode)
-                     magit-refs-show-commit-count)
-            (insert (make-string magit-refs-indent-cherry-lines ?\s)))
-          (insert (propertize cherry 'face (if (string= cherry "-")
-                                               'magit-cherry-equivalent
-                                             'magit-cherry-unmatched)))
-          (insert ?\s))
-        (when side
-          (insert (propertize side 'face (if (string= side "<")
-                                             'magit-cherry-equivalent
-                                           'magit-cherry-unmatched)))
-          (insert ?\s))
-        (when align
-          (insert (propertize hash 'face 'magit-hash) ?\s))
-        (when graph
-          (insert graph))
-        (unless align
-          (insert (propertize hash 'face 'magit-hash) ?\s))
-        (when (and refs (not magit-log-show-refname-after-summary))
-          (insert (magit-format-ref-labels refs) ?\s))
-        (when (eq style 'reflog)
-          (insert (format "%-2s " (1- magit-log-count)))
-          (when refsub
-            (insert (magit-reflog-format-subject
-                     (substring refsub 0 (if (string-match-p ":" refsub) -2 -1))))))
-        (when msg
-          (when gpg
-            (setq msg (propertize msg 'face
-                                  (pcase (aref gpg 0)
-                                    (?G 'magit-signature-good)
-                                    (?B 'magit-signature-bad)
-                                    (?U 'magit-signature-untrusted)
-                                    (?X 'magit-signature-expired)
-                                    (?Y 'magit-signature-expired-key)
-                                    (?R 'magit-signature-revoked)
-                                    (?E 'magit-signature-error)))))
-          (let ((start 0))
-            (while (string-match "\\[[^[]*\\]" msg start)
-              (setq start (match-end 0))
-              (put-text-property (match-beginning 0)
-                                 (match-end 0)
-                                 'face 'magit-keyword msg)))
-          (insert msg))
-        (when (and refs magit-log-show-refname-after-summary)
-          (insert ?\s)
-          (insert (magit-format-ref-labels refs)))
-        (insert ?\n)
-        (when (memq style '(log reflog stash))
-          (goto-char (line-beginning-position))
-          (when (and refsub
-                     (string-match "\\`\\([^ ]\\) \\+\\(..\\)\\(..\\)" date))
-            (setq date (+ (string-to-number (match-string 1 date))
-                          (* (string-to-number (match-string 2 date)) 60 60)
-                          (* (string-to-number (match-string 3 date)) 60))))
-          (save-excursion
-            (backward-char)
-            (magit-log-format-margin author date)))
-        (when (and (eq style 'cherry)
-                   (magit-buffer-margin-p))
-          (save-excursion
-            (backward-char)
-            (apply #'magit-log-format-margin
-                   (split-string (magit-rev-format "%aN%x00%ct" hash) "\0"))))
-        (when (and graph
-                   (not (eobp))
-                   (not (looking-at non-graph-re)))
-          (when (looking-at "")
-            (magit-insert-heading)
-            (delete-char 1)
-            (magit-insert-section (commit-header)
-              (forward-line)
-              (magit-insert-heading)
-              (re-search-forward "")
-              (backward-delete-char 1)
-              (forward-char)
-              (insert ?\n))
-            (delete-char 1))
-          (if (looking-at "^\\(---\\|\n\s\\|\ndiff\\)")
-              (let ((limit (save-excursion
-                             (and (re-search-forward non-graph-re nil t)
-                                  (match-beginning 0)))))
-                (unless (magit-section-content magit-insert-section--current)
-                  (magit-insert-heading))
-                (delete-char (if (looking-at "\n") 1 4))
-                (magit-diff-wash-diffs (list "--stat") limit))
-            (when align
-              (setq align (make-string (1+ abbrev) ? )))
-            (when (and (not (eobp)) (not (looking-at non-graph-re)))
-              (when align
-                (setq align (make-string (1+ abbrev) ? )))
-              (while (and (not (eobp)) (not (looking-at non-graph-re)))
-                (when align
-                  (save-excursion (insert align)))
-                (magit-make-margin-overlay)
-                (forward-line))
-              ;; When `--format' is used and its value isn't one of the
-              ;; predefined formats, then `git-log' does not insert a
-              ;; separator line.
-              (save-excursion
-                (forward-line -1)
-                (looking-at "[-_/|\\*o. ]*"))
-              (setq graph (match-string 0))
-              (unless (string-match-p "[/\\]" graph)
-                (insert graph ?\n))))))))
-  t)
-
-(defun magit-log-maybe-show-more-commits (section)
-  "When point is at the end of a log buffer, insert more commits.
-
-Log buffers end with a button \"Type + to show more history\".
-When the use of a section movement command puts point on that
-button, then automatically show more commits, without the user
-having to press \"+\".
-
-This function is called by `magit-section-movement-hook' and
-exists mostly for backward compatibility reasons."
-  (when (and (eq (magit-section-type section) 'longer)
-             magit-log-auto-more)
-    (magit-log-double-commit-limit)
-    (forward-line -1)
-    (magit-section-forward)))
-
-(defvar magit--update-revision-buffer nil)
-
-(defun magit-log-maybe-update-revision-buffer (&optional _)
-  "When moving in the log buffer, update the revision buffer.
-If there is no revision buffer in the same frame, then do nothing."
-  (when (derived-mode-p 'magit-log-mode)
-    (magit-log-maybe-update-revision-buffer-1)))
-
-(defun magit-log-maybe-update-revision-buffer-1 ()
-  (unless magit--update-revision-buffer
-    (-when-let* ((commit (magit-section-when 'commit))
-                 (buffer (magit-mode-get-buffer 'magit-revision-mode nil t)))
-      (setq magit--update-revision-buffer (list commit buffer))
-      (run-with-idle-timer
-       magit-update-other-window-delay nil
-       (let ((args (magit-show-commit--arguments)))
-         (lambda ()
-           (-let [(rev buf) magit--update-revision-buffer]
-             (setq magit--update-revision-buffer nil)
-             (when (buffer-live-p buf)
-               (let ((magit-display-buffer-noselect t))
-                 (apply #'magit-show-commit rev args))))
-           (setq magit--update-revision-buffer nil)))))))
-
-(defvar magit--update-blob-buffer nil)
-
-(defun magit-log-maybe-update-blob-buffer (&optional _)
-  "When moving in the log buffer, update the blob buffer.
-If there is no blob buffer in the same frame, then do nothing."
-  (when (derived-mode-p 'magit-log-mode)
-    (magit-log-maybe-update-blob-buffer-1)))
-
-(defun magit-log-maybe-update-blob-buffer-1 ()
-  (unless magit--update-revision-buffer
-    (-when-let* ((commit (magit-section-when 'commit))
-                 (buffer (--first (with-current-buffer it magit-buffer-revision)
-                                  (-map #'window-buffer (window-list)))))
-        (setq magit--update-blob-buffer (list commit buffer))
-        (run-with-idle-timer
-         magit-update-other-window-delay nil
-         (lambda ()
-           (-let [(rev buf) magit--update-blob-buffer]
-             (setq magit--update-blob-buffer nil)
-             (when (buffer-live-p buf)
-               (save-excursion
-                 (with-selected-window (get-buffer-window buf)
-                   (with-current-buffer buf
-                     (magit-blob-visit (list (magit-rev-parse rev)
-                                             (magit-file-relative-name
-                                              magit-buffer-file-name))
-                                       (line-number-at-pos))))))))))))
-
-(defun magit-log-goto-same-commit ()
-  (-when-let* ((prev magit-previous-section)
-               (rev  (cond ((magit-section-match 'commit prev)
-                            (magit-section-value prev))
-                           ((magit-section-match 'branch prev)
-                            (magit-rev-format
-                             "%h" (magit-section-value prev)))))
-               (same (--first (equal (magit-section-value it) rev)
-                              (magit-section-children magit-root-section))))
-    (goto-char (magit-section-start same))))
-
-;;; Log Margin
-
-(defun magit-log-format-margin (author date)
-  (-when-let (option (magit-margin-option))
-    (-let [(_ style width details details-width)
-           (or magit-buffer-margin
-               (symbol-value option))]
-      (magit-make-margin-overlay
-       (concat (and details
-                    (concat (propertize (truncate-string-to-width
-                                         (or author "")
-                                         details-width
-                                         nil ?\s (make-string 1 magit-ellipsis))
-                                        'face 'magit-log-author)
-                            " "))
-               (propertize
-                (if (stringp style)
-                    (format-time-string
-                     style
-                     (seconds-to-time (string-to-number date)))
-                  (-let* ((abbr (eq style 'age-abbreviated))
-                          ((cnt unit) (magit--age date abbr)))
-                    (format (format (if abbr "%%2i%%-%ic" "%%2i %%-%is")
-                                    (- width (if details (1+ details-width) 0)))
-                            cnt unit)))
-                'face 'magit-log-date))))))
-
-(defun magit-log-margin-width (style details details-width)
-  (+ (if details (1+ details-width) 0)
-     (if (stringp style)
-         (length (format-time-string style))
-       (+ 2 ; two digits
-          1 ; trailing space
-          (if (eq style 'age-abbreviated)
-              1  ; single character
-            (+ 1 ; gap after digits
-               (apply #'max (--map (max (length (nth 1 it))
-                                        (length (nth 2 it)))
-                                   magit--age-spec))))))))
-
-;;; Select Mode
-
-(defvar magit-log-select-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-log-mode-map)
-    (define-key map "\C-c\C-b" 'undefined)
-    (define-key map "\C-c\C-f" 'undefined)
-    (define-key map "."        'magit-log-select-pick)
-    (define-key map "e"        'magit-log-select-pick)
-    (define-key map "\C-c\C-c" 'magit-log-select-pick)
-    (define-key map "q"        'magit-log-select-quit)
-    (define-key map "\C-c\C-k" 'magit-log-select-quit)
-    map)
-  "Keymap for `magit-log-select-mode'.")
-
-(put 'magit-log-select-pick :advertised-binding [?\C-c ?\C-c])
-(put 'magit-log-select-quit :advertised-binding [?\C-c ?\C-k])
-
-(define-derived-mode magit-log-select-mode magit-log-mode "Magit Select"
-  "Mode for selecting a commit from history.
-
-This mode is documented in info node `(magit)Select from Log'.
-
-\\<magit-mode-map>\
-Type \\[magit-refresh] to refresh the current buffer.
-Type \\[magit-visit-thing] or \\[magit-diff-show-or-scroll-up] \
-to visit the commit at point.
-
-\\<magit-log-select-mode-map>\
-Type \\[magit-log-select-pick] to select the commit at point.
-Type \\[magit-log-select-quit] to abort without selecting a commit."
-  :group 'magit-log
-  (hack-dir-local-variables-non-file-buffer))
-
-(defun magit-log-select-refresh-buffer (rev args)
-  (magit-insert-section (logbuf)
-    (magit-insert-log rev args)))
-
-(defvar-local magit-log-select-pick-function nil)
-(defvar-local magit-log-select-quit-function nil)
-
-(defun magit-log-select (pick &optional msg quit branch)
-  (declare (indent defun))
-  (magit-mode-setup #'magit-log-select-mode
-                    (or branch (magit-get-current-branch) "HEAD")
-                    magit-log-select-arguments)
-  (magit-log-goto-same-commit)
-  (setq magit-log-select-pick-function pick)
-  (setq magit-log-select-quit-function quit)
-  (when magit-log-select-show-usage
-    (setq msg (substitute-command-keys
-               (format-spec
-                (if msg
-                    (if (string-suffix-p "," msg)
-                        (concat msg " or %q to abort")
-                      msg)
-                  "Type %p to select commit at point, or %q to abort")
-                '((?p . "\\[magit-log-select-pick]")
-                  (?q . "\\[magit-log-select-quit]")))))
-    (when (memq magit-log-select-show-usage '(both header-line))
-      (setq header-line-format (propertize (concat " " msg) 'face 'bold)))
-    (when (memq magit-log-select-show-usage '(both echo-area))
-      (message "%s" msg))))
-
-(defun magit-log-select-pick ()
-  "Select the commit at point and act on it.
-Call `magit-log-select-pick-function' with the selected
-commit as argument."
-  (interactive)
-  (let ((fun magit-log-select-pick-function)
-        (rev (magit-commit-at-point)))
-    (quit-restore-window nil 'kill)
-    (funcall fun rev)))
-
-(defun magit-log-select-quit ()
-  "Abort selecting a commit, don't act on any commit."
-  (interactive)
-  (quit-restore-window nil 'kill)
-  (when magit-log-select-quit-function
-    (funcall magit-log-select-quit-function)))
-
-;;; Cherry Mode
-
-(defvar magit-cherry-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-mode-map)
-    (define-key map "q" 'magit-log-bury-buffer)
-    (define-key map "L" 'magit-margin-popup)
-    map)
-  "Keymap for `magit-cherry-mode'.")
-
-(define-derived-mode magit-cherry-mode magit-mode "Magit Cherry"
-  "Mode for looking at commits not merged upstream.
-
-\\<magit-mode-map>\
-Type \\[magit-refresh] to refresh the current buffer.
-Type \\[magit-visit-thing] or \\[magit-diff-show-or-scroll-up] \
-to visit the commit at point.
-
-Type \\[magit-cherry-pick-popup] to apply the commit at point.
-
-\\{magit-cherry-mode-map}"
-  :group 'magit-log
-  (hack-dir-local-variables-non-file-buffer)
-  (setq imenu-create-index-function
-        'magit-imenu--cherry-create-index-function)
-  (setq-local bookmark-make-record-function
-              'magit-bookmark--cherry-make-record))
-
-;;;###autoload
-(defun magit-cherry (head upstream)
-  "Show commits in a branch that are not merged in the upstream branch."
-  (interactive
-   (let  ((head (magit-read-branch "Cherry head")))
-     (list head (magit-read-other-branch "Cherry upstream" head
-                                         (magit-get-upstream-branch head)))))
-  (require 'magit)
-  (magit-mode-setup #'magit-cherry-mode upstream head))
-
-(defun magit-cherry-refresh-buffer (_upstream _head)
-  (magit-insert-section (cherry)
-    (run-hooks 'magit-cherry-sections-hook)))
-
-(defun magit-insert-cherry-headers ()
-  "Insert headers appropriate for `magit-cherry-mode' buffers."
-  (magit-insert-head-branch-header (nth 1 magit-refresh-args))
-  (magit-insert-upstream-branch-header (nth 1 magit-refresh-args)
-                                       (nth 0 magit-refresh-args)
-                                       "Upstream: ")
-  (insert ?\n))
-
-(defun magit-insert-cherry-commits ()
-  "Insert commit sections into a `magit-cherry-mode' buffer."
-  (magit-insert-section (cherries)
-    (magit-insert-heading "Cherry commits:")
-    (magit-git-wash (apply-partially 'magit-log-wash-log 'cherry)
-      "cherry" "-v" "--abbrev" magit-refresh-args)))
-
-;;; Reflog Mode
-
-(defvar magit-reflog-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-log-mode-map)
-    (define-key map "L" 'magit-margin-popup)
-    map)
-  "Keymap for `magit-reflog-mode'.")
-
-(define-derived-mode magit-reflog-mode magit-log-mode "Magit Reflog"
-  "Mode for looking at Git reflog.
-
-This mode is documented in info node `(magit)Reflog'.
-
-\\<magit-mode-map>\
-Type \\[magit-refresh] to refresh the current buffer.
-Type \\[magit-visit-thing] or \\[magit-diff-show-or-scroll-up] \
-to visit the commit at point.
-
-Type \\[magit-cherry-pick-popup] to apply the commit at point.
-Type \\[magit-reset] to reset `HEAD' to the commit at point.
-
-\\{magit-reflog-mode-map}"
-  :group 'magit-log
-  (hack-dir-local-variables-non-file-buffer)
-  (setq-local bookmark-make-record-function
-              'magit-bookmark--reflog-make-record))
-
-(defun magit-reflog-refresh-buffer (ref args)
-  (setq header-line-format
-        (propertize (concat " Reflog for " ref) 'face 'magit-header-line))
-  (magit-insert-section (reflogbuf)
-    (magit-git-wash (apply-partially 'magit-log-wash-log 'reflog)
-      "reflog" "show" "--format=%h%x00%aN%x00%gd%x00%gs" "--date=raw"
-      args ref "--")))
-
-(defvar magit-reflog-labels
-  '(("commit"      . magit-reflog-commit)
-    ("amend"       . magit-reflog-amend)
-    ("merge"       . magit-reflog-merge)
-    ("checkout"    . magit-reflog-checkout)
-    ("branch"      . magit-reflog-checkout)
-    ("reset"       . magit-reflog-reset)
-    ("rebase"      . magit-reflog-rebase)
-    ("cherry-pick" . magit-reflog-cherry-pick)
-    ("initial"     . magit-reflog-commit)
-    ("pull"        . magit-reflog-remote)
-    ("clone"       . magit-reflog-remote)
-    ("autosave"    . magit-reflog-commit)
-    ("restart"     . magit-reflog-reset)))
-
-(defun magit-reflog-format-subject (subject)
-  (let* ((match (string-match magit-reflog-subject-re subject))
-         (command (and match (match-string 1 subject)))
-         (option  (and match (match-string 2 subject)))
-         (type    (and match (match-string 3 subject)))
-         (label (if (string= command "commit")
-                    (or type command)
-                  command))
-         (text (if (string= command "commit")
-                   label
-                 (mapconcat #'identity
-                            (delq nil (list command option type))
-                            " "))))
-    (format "%-16s "
-            (propertize text 'face
-                        (or (cdr (assoc label magit-reflog-labels))
-                            'magit-reflog-other)))))
-
-;;; Log Sections
-;;;; Standard Log Sections
-
-(defvar magit-unpulled-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-visit-thing] 'magit-diff-dwim)
-    map)
-  "Keymap for `unpulled' sections.")
-
-(magit-define-section-jumper magit-jump-to-unpulled-from-upstream
-  "Unpulled from @{upstream}" unpulled "..@{upstream}")
-
-(defun magit-insert-unpulled-from-upstream ()
-  "Insert commits that haven't been pulled from the upstream yet."
-  (when (magit-git-success "rev-parse" "@{upstream}")
-    (magit-insert-section (unpulled "..@{upstream}")
-      (magit-insert-heading
-        (format (propertize "Unpulled from %s:" 'face 'magit-section-heading)
-                (magit-get-upstream-branch)))
-      (magit-insert-log "..@{upstream}" magit-log-section-arguments))))
-
-(magit-define-section-jumper magit-jump-to-unpulled-from-pushremote
-  "Unpulled from <push-remote>" unpulled
-  (concat ".." (magit-get-push-branch)))
-
-(defun magit-insert-unpulled-from-pushremote ()
-  "Insert commits that haven't been pulled from the push-remote yet."
-  (--when-let (magit-get-push-branch)
-    (unless (and (equal (magit-rev-name it)
-                        (magit-rev-name "@{upstream}"))
-                 (or (memq 'magit-insert-unpulled-from-upstream
-                           magit-status-sections-hook)
-                     (memq 'magit-insert-unpulled-from-upstream-or-recent
-                           magit-status-sections-hook)))
-      (magit-insert-section (unpulled (concat ".." it))
-        (magit-insert-heading
-          (format (propertize "Unpulled from %s:" 'face 'magit-section-heading)
-                  (propertize it 'face 'magit-branch-remote)))
-        (magit-insert-log (concat ".." it) magit-log-section-arguments)))))
-
-(defvar magit-unpushed-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-visit-thing] 'magit-diff-dwim)
-    map)
-  "Keymap for `unpushed' sections.")
-
-(magit-define-section-jumper magit-jump-to-unpushed-to-upstream
-  "Unpushed to @{upstream}" unpushed "@{upstream}..")
-
-(defun magit-insert-unpushed-to-upstream ()
-  "Insert commits that haven't been pushed to the upstream yet."
-  (when (magit-git-success "rev-parse" "@{upstream}")
-    (magit-insert-section (unpushed "@{upstream}..")
-      (magit-insert-heading
-        (format (propertize "Unmerged into %s:" 'face 'magit-section-heading)
-                (magit-get-upstream-branch)))
-      (magit-insert-log "@{upstream}.." magit-log-section-arguments))))
-
-(magit-define-section-jumper magit-jump-to-unpushed-to-pushremote
-  "Unpushed to <push-remote>" unpushed
-  (concat (magit-get-push-branch) ".."))
-
-(defun magit-insert-unpushed-to-pushremote ()
-  "Insert commits that haven't been pushed to the push-remote yet."
-  (--when-let (magit-get-push-branch)
-    (unless (and (equal (magit-rev-name it)
-                        (magit-rev-name "@{upstream}"))
-                 (memq 'magit-insert-unpushed-to-upstream
-                       magit-status-sections-hook))
-      (magit-insert-section (unpushed (concat it ".."))
-        (magit-insert-heading
-          (format (propertize "Unpushed to %s:" 'face 'magit-section-heading)
-                  (propertize it 'face 'magit-branch-remote)))
-        (magit-insert-log (concat it "..") magit-log-section-arguments)))))
-
-(defun magit-insert-recent-commits (&optional collapse)
-  "Insert section showing recent commits.
-Show the last `magit-log-section-commit-count' commits."
-  (let* ((start (format "HEAD~%s" magit-log-section-commit-count))
-         (range (and (magit-rev-verify start)
-                     (concat start "..HEAD"))))
-    (magit-insert-section (recent range collapse)
-      (magit-insert-heading "Recent commits")
-      (magit-insert-log range
-                        (cons (format "-%d" magit-log-section-commit-count)
-                              magit-log-section-arguments)))))
-
-(defun magit-insert-unpulled-from-upstream-or-recent ()
-  "Insert section showing unpulled or recent commits.
-If an upstream is configured for the current branch and it is
-ahead of the current branch, then show the commits that have
-not yet been pulled into the current branch.  If no upstream is
-configured or if the upstream is not ahead of the current branch,
-then show the last `magit-log-section-commit-count' commits."
-  (let ((upstream (magit-rev-parse "@{upstream}")))
-    (if (or (not upstream)
-            (equal upstream (magit-rev-parse "HEAD")))
-        (magit-insert-recent-commits t)
-      (magit-insert-unpulled-from-upstream))))
-
-;;;; Auxiliary Log Sections
-
-(defun magit-insert-unpulled-cherries ()
-  "Insert section showing unpulled commits.
-Like `magit-insert-unpulled-from-upstream' but prefix each commit
-which has not been applied yet (i.e. a commit with a patch-id
-not shared with any local commit) with \"+\", and all others with
-\"-\"."
-  (when (magit-git-success "rev-parse" "@{upstream}")
-    (magit-insert-section (unpulled "..@{upstream}")
-      (magit-insert-heading "Unpulled commits:")
-      (magit-git-wash (apply-partially 'magit-log-wash-log 'cherry)
-        "cherry" "-v" (magit-abbrev-arg)
-        (magit-get-current-branch) "@{upstream}"))))
-
-(defun magit-insert-unpushed-cherries ()
-  "Insert section showing unpushed commits.
-Like `magit-insert-unpushed-to-upstream' but prefix each commit
-which has not been applied to upstream yet (i.e. a commit with
-a patch-id not shared with any upstream commit) with \"+\", and
-all others with \"-\"."
-  (when (magit-git-success "rev-parse" "@{upstream}")
-    (magit-insert-section (unpushed "@{upstream}..")
-      (magit-insert-heading "Unpushed commits:")
-      (magit-git-wash (apply-partially 'magit-log-wash-log 'cherry)
-        "cherry" "-v" (magit-abbrev-arg) "@{upstream}"))))
-
-(provide 'magit-log)
-;;; magit-log.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-log.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-margin.el
@@ -1,229 +0,0 @@
-;;; magit-margin.el --- margins in Magit buffers  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements support for showing additional information
-;; in the margins of Magit buffers.  Currently this is only used for
-;; commits, for which the committer date or age, and optionally the
-;; author name are shown.
-
-;;; Code:
-
-(require 'dash)
-
-(require 'magit-section)
-(require 'magit-mode)
-
-(defgroup magit-margin nil
-  "Information Magit displays in the margin.
-
-You can change the STYLE and AUTHOR-WIDTH of all `magit-*-margin'
-options to the same values by customizing `magit-log-margin'
-*before* `magit' is loaded.  If you do that, then the respective
-values for the other options will default to what you have set
-for that variable.  Likewise if you set `magit-log-margin's INIT
-to nil, then that is used in the default of all other options.  But
-setting it to t, i.e. re-enforcing the default for that option,
-does not carry to other options."
-  :link '(info-link "(magit)Log Margin")
-  :group 'magit-log)
-
-(defvar-local magit-buffer-margin nil)
-(put 'magit-buffer-margin 'permanent-local t)
-
-(defvar-local magit-set-buffer-margin-refresh nil)
-
-(defvar magit--age-spec)
-
-;;; Commands
-
-(magit-define-popup magit-margin-popup
-  "Popup console for changing appearance of the margin."
-  :actions '("Margin"
-             (?L "toggle visibility" magit-toggle-margin)
-             (?l "cycle style"       magit-cycle-margin-style)
-             (?d "toggle details"    magit-toggle-margin-details))
-  :max-action-columns 1)
-
-(defun magit-toggle-margin ()
-  "Show or hide the Magit margin."
-  (interactive)
-  (unless (magit-margin-option)
-    (user-error "Magit margin isn't supported in this buffer"))
-  (setcar magit-buffer-margin (not (magit-buffer-margin-p)))
-  (magit-set-buffer-margin))
-
-(defun magit-cycle-margin-style ()
-  "Cycle style used for the Magit margin."
-  (interactive)
-  (unless (magit-margin-option)
-    (user-error "Magit margin isn't supported in this buffer"))
-  ;; This is only suitable for commit margins (there are not others).
-  (setf (cadr magit-buffer-margin)
-        (pcase (cadr magit-buffer-margin)
-          (`age 'age-abbreviated)
-          (`age-abbreviated
-           (let ((default (cadr (symbol-value (magit-margin-option)))))
-             (if (stringp default) default "%Y-%m-%d %H:%M ")))
-          (_ 'age)))
-  (magit-set-buffer-margin nil t))
-
-(defun magit-toggle-margin-details ()
-  "Show or hide details in the Magit margin."
-  (interactive)
-  (unless (magit-margin-option)
-    (user-error "Magit margin isn't supported in this buffer"))
-  (setf (nth 3 magit-buffer-margin)
-        (not (nth 3 magit-buffer-margin)))
-  (magit-set-buffer-margin nil t))
-
-;;; Core
-
-(defun magit-buffer-margin-p ()
-  (car magit-buffer-margin))
-
-(defun magit-margin-option ()
-  (pcase major-mode
-    (`magit-cherry-mode     'magit-cherry-margin)
-    (`magit-log-mode        'magit-log-margin)
-    (`magit-log-select-mode 'magit-log-select-margin)
-    (`magit-reflog-mode     'magit-reflog-margin)
-    (`magit-refs-mode       'magit-refs-margin)
-    (`magit-stashes-mode    'magit-stashes-margin)
-    (`magit-status-mode     'magit-status-margin)))
-
-(defun magit-set-buffer-margin (&optional reset refresh)
-  (-when-let (option (magit-margin-option))
-    (let* ((default (symbol-value option))
-           (default-width (nth 2 default)))
-      (when (or reset (not magit-buffer-margin))
-        (setq magit-buffer-margin (copy-sequence default)))
-      (-let [(enable style _width details details-width)
-             magit-buffer-margin]
-        (when (functionp default-width)
-          (setf (nth 2 magit-buffer-margin)
-                (funcall default-width style details details-width)))
-        (dolist (window (get-buffer-window-list nil nil 0))
-          (with-selected-window window
-            (magit-set-window-margin window)
-            (if enable
-                (add-hook  'window-configuration-change-hook
-                           'magit-set-window-margin nil t)
-              (remove-hook 'window-configuration-change-hook
-                           'magit-set-window-margin t))))
-        (when (and enable (or refresh magit-set-buffer-margin-refresh))
-          (magit-refresh-buffer))))))
-
-(defun magit-set-window-margin (&optional window)
-  (when (or window (setq window (get-buffer-window)))
-    (with-selected-window window
-      (set-window-margins nil (car (window-margins))
-                          (and (magit-buffer-margin-p)
-                               (nth 2 magit-buffer-margin))))))
-
-(defun magit-make-margin-overlay (&optional string previous-line)
-  (if previous-line
-      (save-excursion
-        (forward-line -1)
-        (magit-make-margin-overlay string))
-    ;; Don't put the overlay on the complete line to work around #1880.
-    (let ((o (make-overlay (1+ (line-beginning-position))
-                           (line-end-position)
-                           nil t)))
-      (overlay-put o 'evaporate t)
-      (overlay-put o 'before-string
-                   (propertize "o" 'display
-                               (list (list 'margin 'right-margin)
-                                     (or string " ")))))))
-
-(defun magit-maybe-make-margin-overlay ()
-  (when (or (magit-section-match
-             '(unpulled unpushed recent stashes local cherries)
-             magit-insert-section--current)
-            (and (eq major-mode 'magit-refs-mode)
-                 (magit-section-match
-                  '(remote commit tags)
-                  magit-insert-section--current)))
-    (magit-make-margin-overlay nil t)))
-
-;;; Custom Support
-
-(defun magit-margin-set-variable (mode symbol value)
-  (set-default symbol value)
-  (message "Updating margins in %s buffers..." mode)
-  (dolist (buffer (buffer-list))
-    (with-current-buffer buffer
-      (when (eq major-mode mode)
-        (magit-set-buffer-margin t)
-        (magit-refresh))))
-  (message "Updating margins in %s buffers...done" mode))
-
-(defconst magit-log-margin--custom-type
-  '(list (boolean :tag "Show margin initially")
-         (choice  :tag "Show committer"
-                  (string :tag "date using time-format" "%Y-%m-%d %H:%M ")
-                  (const  :tag "date's age" age)
-                  (const  :tag "date's age (abbreviated)" age-abbreviated))
-         (const   :tag "Calculate width using magit-log-margin-width"
-                  magit-log-margin-width)
-         (boolean :tag "Show author name by default")
-         (integer :tag "Show author name using width")))
-
-;;; Time Utilities
-
-(defvar magit--age-spec
-  `((?Y "year"   "years"   ,(round (* 60 60 24 365.2425)))
-    (?M "month"  "months"  ,(round (* 60 60 24 30.436875)))
-    (?w "week"   "weeks"   ,(* 60 60 24 7))
-    (?d "day"    "days"    ,(* 60 60 24))
-    (?h "hour"   "hours"   ,(* 60 60))
-    (?m "minute" "minutes" 60)
-    (?s "second" "seconds" 1))
-  "Time units used when formatting relative commit ages.
-
-The value is a list of time units, beginning with the longest.
-Each element has the form (CHAR UNIT UNITS SECONDS).  UNIT is the
-time unit, UNITS is the plural of that unit.  CHAR is a character
-abbreviation.  And SECONDS is the number of seconds in one UNIT.
-
-This is defined as a variable to make it possible to use time
-units for a language other than English.  It is not defined
-as an option, because most other parts of Magit are always in
-English.")
-
-(defun magit--age (date &optional abbreviate)
-  (cl-labels ((fn (age spec)
-                  (-let [(char unit units weight) (car spec)]
-                    (let ((cnt (round (/ age weight 1.0))))
-                      (if (or (not (cdr spec))
-                              (>= (/ age weight) 1))
-                          (list cnt (cond (abbreviate char)
-                                          ((= cnt 1) unit)
-                                          (t units)))
-                        (fn age (cdr spec)))))))
-    (fn (abs (- (float-time) (string-to-number date)))
-        magit--age-spec)))
-
-(provide 'magit-margin)
-;;; magit-margin.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-margin.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-mode.el
@@ -1,1196 +0,0 @@
-;;; magit-mode.el --- create and refresh Magit buffers  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements the abstract major-mode `magit-mode' from
-;; which almost all other Magit major-modes derive.  The code in here
-;; is mostly concerned with creating and refreshing Magit buffers.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'dash)
-
-(require 'magit-section)
-(require 'magit-git)
-(require 'magit-popup)
-
-;; For `magit-display-buffer-fullcolumn-most-v1' from `git-commit'
-(defvar git-commit-mode)
-;; For `magit-xref-insert-buttons' from `magit'
-(defvar magit-diff-show-xref-buttons)
-(defvar magit-revision-show-xref-buttons)
-;; For `magit-refresh' and `magit-refresh-all'
-(declare-function magit-auto-revert-buffers 'magit-autorevert)
-
-(require 'format-spec)
-(require 'help-mode)
-
-;;; Options
-
-(defcustom magit-mode-hook
-  '(magit-load-config-extensions
-    magit-xref-setup)
-  "Hook run when entering a mode derived from Magit mode."
-  :group 'magit-modes
-  :type 'hook
-  :options '(magit-load-config-extensions
-             magit-xref-setup
-             bug-reference-mode))
-
-(defcustom magit-mode-setup-hook
-  '(magit-maybe-save-repository-buffers
-    magit-set-buffer-margin)
-  "Hook run by `magit-mode-setup'.
-
-This is run right after displaying the buffer and right before
-generating or updating its content.  `magit-mode-hook' and other,
-more specific, `magit-mode-*-hook's on the other hand are run
-right before displaying the buffer.  Usually one of these hooks
-should be used instead of this one."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-modes
-  :type 'hook
-  :options '(magit-maybe-save-repository-buffers
-             magit-set-buffer-margin))
-
-(defcustom magit-pre-refresh-hook '(magit-maybe-save-repository-buffers)
-  "Hook run before refreshing in `magit-refresh'.
-
-This hook, or `magit-post-refresh-hook', should be used
-for functions that are not tied to a particular buffer.
-
-To run a function with a particular buffer current, use
-`magit-refresh-buffer-hook' and use `derived-mode-p'
-inside your function."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-refresh
-  :type 'hook
-  :options '(magit-maybe-save-repository-buffers))
-
-(defcustom magit-post-refresh-hook nil
-  "Hook run after refreshing in `magit-refresh'.
-
-This hook, or `magit-pre-refresh-hook', should be used
-for functions that are not tied to a particular buffer.
-
-To run a function with a particular buffer current, use
-`magit-refresh-buffer-hook' and use `derived-mode-p'
-inside your function."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-refresh
-  :type 'hook)
-
-(defcustom magit-display-buffer-function 'magit-display-buffer-traditional
-  "The function used display a Magit buffer.
-
-All Magit buffers (buffers whose major-modes derive from
-`magit-mode') are displayed using `magit-display-buffer',
-which in turn uses the function specified here."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-buffers
-  :type '(radio (function-item magit-display-buffer-traditional)
-                (function-item magit-display-buffer-same-window-except-diff-v1)
-                (function-item magit-display-buffer-fullframe-status-v1)
-                (function-item magit-display-buffer-fullframe-status-topleft-v1)
-                (function-item magit-display-buffer-fullcolumn-most-v1)
-                (function-item display-buffer)
-                (function :tag "Function")))
-
-(defcustom magit-pre-display-buffer-hook '(magit-save-window-configuration)
-  "Hook run by `magit-display-buffer' before displaying the buffer."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-buffers
-  :type 'hook
-  :get 'magit-hook-custom-get
-  :options '(magit-save-window-configuration))
-
-(defcustom magit-post-display-buffer-hook '(magit-maybe-set-dedicated)
-  "Hook run by `magit-display-buffer' after displaying the buffer."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-buffers
-  :type 'hook
-  :get 'magit-hook-custom-get
-  :options '(magit-maybe-set-dedicated))
-
-(defcustom magit-generate-buffer-name-function
-  'magit-generate-buffer-name-default-function
-  "The function used to generate the name for a Magit buffer."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-buffers
-  :type '(radio (function-item magit-generate-buffer-name-default-function)
-                (function :tag "Function")))
-
-(defcustom magit-buffer-name-format "*%M%v: %t"
-  "The format string used to name Magit buffers.
-
-The following %-sequences are supported:
-
-`%m' The name of the major-mode, but with the `-mode' suffix
-     removed.
-
-`%M' Like \"%m\" but abbreviate `magit-status-mode' as `magit'.
-
-`%v' The value the buffer is locked to, in parentheses, or an empty
-     string if the buffer is not locked to a value.
-
-`%V' Like \"%v\", but the string is prefixed with a space, unless it
-     is an empty string.
-
-`%t' The top-level directory of the working tree of the
-     repository, or if `magit-uniquify-buffer-names' is non-nil
-     an abbreviation of that.
-
-The value should always contain either \"%m\" or \"%M\" as well as
-\"%t\".  If `magit-uniquify-buffer-names' is non-nil, then the
-value must end with \"%t\".
-
-This is used by `magit-generate-buffer-name-default-function'.
-If another `magit-generate-buffer-name-function' is used, then
-it may not respect this option, or on the contrary it may
-support additional %-sequences."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-buffers
-  :type 'string)
-
-(defcustom magit-uniquify-buffer-names t
-  "Whether to uniquify the names of Magit buffers."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-buffers
-  :type 'boolean)
-
-(defcustom magit-bury-buffer-function 'magit-restore-window-configuration
-  "The function used to bury or kill the current Magit buffer."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-buffers
-  :type '(radio (function-item quit-window)
-                (function-item magit-mode-quit-window)
-                (function-item magit-restore-window-configuration)
-                (function :tag "Function")))
-
-(defcustom magit-use-sticky-arguments t
-  "How to reuse arguments from existing diff and log buffers.
-
-nil       Always use the default value of the variable
-          `magit-log-arguments' for log commands.  Likewise,
-          always use the default value of the variable
-          `magit-diff-arguments' for diff command calls.
-
-current   If the mode of the current buffer is derived from
-          `magit-log-mode' or `magit-diff-mode', reuse the
-          arguments from that buffer instead of those given by
-          the variable `magit-log-arguments' or
-          `magit-diff-arguments', respectively.
-
-t         Like `current', but if the mode of the current buffer
-          is not derived from `magit-log-mode' or
-          `magit-diff-mode', use the arguments from the current
-          repository's active (i.e. non-locked) `magit-log-mode'
-          or `magit-diff-mode' buffer, respectively, if it
-          exists.
-
-          Note that commands that generate a
-          `magit-revision-mode' or `magit-stash-mode' buffer will
-          also collect their diff arguments from the active
-          `magit-diff-mode' buffer.
-
-In general, there is a separation between the \"sticky\"
-arguments for log and diff buffers, but there is one special
-case: if the current buffer is a log buffer,
-`magit-show-commit' (considered a diff command) uses the file
-filter from the log buffer."
-  :package-version '(magit . "2.11.0")
-  :group 'magit-buffers
-  :type '(choice (const :tag "disabled" nil)
-                 (const :tag "sticky for current" current)
-                 (const :tag "sticky" t)))
-
-(defcustom magit-region-highlight-hook
-  '(magit-section-update-region magit-diff-update-hunk-region)
-  "Functions used to highlight the region.
-
-Each function is run with the current section as only argument
-until one of them returns non-nil.  If all functions return nil,
-then fall back to regular region highlighting."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-refresh
-  :type 'hook
-  :options '(magit-section-update-region magit-diff-update-hunk-region))
-
-(defcustom magit-refresh-verbose nil
-  "Whether to revert Magit buffers verbosely."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-refresh
-  :type 'boolean)
-
-(defcustom magit-refresh-buffer-hook nil
-  "Normal hook for `magit-refresh-buffer' to run after refreshing."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-refresh
-  :type 'hook)
-
-(defcustom magit-refresh-status-buffer t
-  "Whether the status buffer is refreshed after running git.
-
-When this is non-nil, then the status buffer is automatically
-refreshed after running git for side-effects, in addition to the
-current Magit buffer, which is always refreshed automatically.
-
-Only set this to nil after exhausting all other options to
-improve performance."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-refresh
-  :group 'magit-status
-  :type 'boolean)
-
-(defcustom magit-save-repository-buffers t
-  "Whether to save file-visiting buffers when appropriate.
-
-If non-nil, then all modified file-visiting buffers belonging
-to the current repository may be saved before running Magit
-commands and before creating or refreshing Magit buffers.
-If `dontask', then this is done without user intervention, for
-any other non-nil value the user has to confirm each save.
-
-The default is t to avoid surprises, but `dontask' is the
-recommended value."
-  :group 'magit-essentials
-  :group 'magit-buffers
-  :type '(choice (const :tag "Never" nil)
-                 (const :tag "Ask" t)
-                 (const :tag "Save without asking" dontask)))
-
-(defcustom magit-keep-region-overlay nil
-  "Whether to keep the region overlay when there is a valid selection.
-
-By default Magit removes the regular region overlay if, and only
-if, that region constitutes a valid selection as understood by
-Magit commands.  Otherwise it does not remove that overlay, and
-the region looks like it would in other buffers.
-
-There are two types of such valid selections: hunk-internal
-regions and regions that select two or more sibling sections.
-In such cases Magit removes the region overlay and instead
-highlights a slightly larger range.  All text (for hunk-internal
-regions) or the headings of all sections (for sibling selections)
-that are inside that range (not just inside the region) are acted
-on by commands such as the staging command.  This buffer range
-begins at the beginning of the line on which the region begins
-and ends at the end of the line on which the region ends.
-
-Because Magit acts on this larger range and not the region, it is
-actually quite important to visualize that larger range.  If we
-don't do that, then one might think that these commands act on
-the region instead.  If you want to *also* visualize the region,
-then set this option to t.  But please note that when the region
-does *not* constitute a valid selection, then the region is
-*always* visualized as usual, and that it is usually under such
-circumstances that you want to use a non-magit command to act on
-the region.
-
-Besides keeping the region overlay, setting this option to t also
-causes all face properties, except for `:foreground', to be
-ignored for the faces used to highlight headings of selected
-sections.  This avoids the worst conflicts that result from
-displaying the region and the selection overlays at the same
-time.  We are not interested in dealing with other conflicts.
-In fact we *already* provide a way to avoid all of these
-conflicts: *not* changing the value of this option.
-
-It should be clear by now that we consider it a mistake to set
-this to display the region when the Magit selection is also
-visualized, but since it has been requested a few times and
-because it doesn't cost much to offer this option we do so.
-However that might change.  If the existence of this option
-starts complicating other things, then it will be removed."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-miscellaneous
-  :type 'boolean)
-
-;;; Magit Mode
-
-(defvar magit-mode-map
-  (let ((map (make-keymap)))
-    (suppress-keymap map t)
-    (cond ((featurep 'jkl)
-           (define-key map   [return]  'magit-visit-thing)
-           (define-key map [C-return]  'magit-dired-jump)
-           (define-key map   [tab]     'magit-section-toggle)
-           (define-key map [C-tab]     'magit-section-cycle)
-           (define-key map [M-tab]     'magit-section-cycle-diffs)
-           (define-key map [S-tab]     'magit-section-cycle-global)
-           (define-key map (kbd "M-o") 'magit-section-up)
-           (define-key map (kbd   "i") 'magit-section-backward)
-           (define-key map (kbd   "k") 'magit-section-forward)
-           (define-key map (kbd "M-i") 'magit-section-backward-sibling)
-           (define-key map (kbd "M-k") 'magit-section-forward-sibling)
-           (define-key map (kbd   "p") 'magit-push-popup)
-           (define-key map (kbd   ",") 'magit-delete-thing)
-           (define-key map (kbd   ";") 'magit-file-untrack)
-           (define-key map (kbd "C-c C-i") 'magit-gitignore)
-           (define-key map (kbd "C-c i")   'magit-gitignore-locally))
-          (t
-           (define-key map [C-return]  'magit-visit-thing)
-           (define-key map (kbd "C-m") 'magit-visit-thing)
-           (define-key map (kbd "C-M-i") 'magit-dired-jump)
-           (define-key map (kbd "C-i") 'magit-section-toggle)
-           (define-key map [C-tab]     'magit-section-cycle)
-           (define-key map [M-tab]     'magit-section-cycle-diffs)
-           (define-key map [S-tab]     'magit-section-cycle-global)
-           ;; Next two are for backward compatibility.
-           (define-key map [s-tab]     'magit-section-cycle-global)
-           (define-key map   [backtab] 'magit-section-cycle-global)
-           (define-key map (kbd   "^") 'magit-section-up)
-           (define-key map (kbd   "p") 'magit-section-backward)
-           (define-key map (kbd   "n") 'magit-section-forward)
-           (define-key map (kbd "M-p") 'magit-section-backward-sibling)
-           (define-key map (kbd "M-n") 'magit-section-forward-sibling)
-           (define-key map (kbd   "P") 'magit-push-popup)
-           (define-key map (kbd   "k") 'magit-delete-thing)
-           (define-key map (kbd   "K") 'magit-file-untrack)
-           (define-key map (kbd   "i") 'magit-gitignore)
-           (define-key map (kbd   "I") 'magit-gitignore-locally)))
-    (define-key map (kbd "SPC") 'magit-diff-show-or-scroll-up)
-    (define-key map (kbd "DEL") 'magit-diff-show-or-scroll-down)
-    (define-key map "+"         'magit-diff-more-context)
-    (define-key map "-"         'magit-diff-less-context)
-    (define-key map "0"         'magit-diff-default-context)
-    (define-key map "1"         'magit-section-show-level-1)
-    (define-key map "2"         'magit-section-show-level-2)
-    (define-key map "3"         'magit-section-show-level-3)
-    (define-key map "4"         'magit-section-show-level-4)
-    (define-key map (kbd "M-1") 'magit-section-show-level-1-all)
-    (define-key map (kbd "M-2") 'magit-section-show-level-2-all)
-    (define-key map (kbd "M-3") 'magit-section-show-level-3-all)
-    (define-key map (kbd "M-4") 'magit-section-show-level-4-all)
-    (define-key map "$" 'magit-process-buffer)
-    (define-key map "a" 'magit-cherry-apply)
-    (define-key map "A" 'magit-cherry-pick-popup)
-    (define-key map "b" 'magit-branch-popup)
-    (define-key map "B" 'magit-bisect-popup)
-    (define-key map "c" 'magit-commit-popup)
-    (define-key map "d" 'magit-diff-popup)
-    (define-key map "D" 'magit-diff-refresh-popup)
-    (define-key map "e" 'magit-ediff-dwim)
-    (define-key map "E" 'magit-ediff-popup)
-    (define-key map "f" 'magit-fetch-popup)
-    (define-key map "F" 'magit-pull-popup)
-    (define-key map "g" 'magit-refresh)
-    (define-key map "G" 'magit-refresh-all)
-    (define-key map "h" 'magit-dispatch-popup)
-    (define-key map "?" 'magit-dispatch-popup)
-    (define-key map "l" 'magit-log-popup)
-    (define-key map "L" 'magit-log-refresh-popup)
-    (define-key map "m" 'magit-merge-popup)
-    (define-key map "M" 'magit-remote-popup)
-    (define-key map "o" 'magit-submodule-popup)
-    (define-key map "O" 'magit-subtree-popup)
-    (define-key map "q" 'magit-mode-bury-buffer)
-    (define-key map "r" 'magit-rebase-popup)
-    (define-key map "R" 'magit-file-rename)
-    (define-key map "t" 'magit-tag-popup)
-    (define-key map "T" 'magit-notes-popup)
-    (define-key map "s" 'magit-stage-file)
-    (define-key map "S" 'magit-stage-modified)
-    (define-key map "u" 'magit-unstage-file)
-    (define-key map "U" 'magit-unstage-all)
-    (define-key map "v" 'magit-revert-no-commit)
-    (define-key map "V" 'magit-revert-popup)
-    (define-key map "w" 'magit-am-popup)
-    (define-key map "W" 'magit-patch-popup)
-    (define-key map "x" 'magit-reset)
-    (define-key map "X" 'magit-reset-popup)
-    (define-key map "y" 'magit-show-refs-popup)
-    (define-key map "Y" 'magit-cherry)
-    (define-key map "z" 'magit-stash-popup)
-    (define-key map "Z" 'magit-stash-popup)
-    (define-key map ":" 'magit-git-command)
-    (define-key map "!" 'magit-run-popup)
-    (define-key map (kbd "C-c C-c") 'magit-dispatch-popup)
-    (define-key map (kbd "C-c C-e") 'magit-dispatch-popup)
-    (define-key map (kbd "C-x a")   'magit-add-change-log-entry)
-    (define-key map (kbd "C-x 4 a") 'magit-add-change-log-entry-other-window)
-    (define-key map (kbd "C-w")     'magit-copy-section-value)
-    (define-key map (kbd "M-w")     'magit-copy-buffer-revision)
-    (define-key map [remap evil-previous-line] 'evil-previous-visual-line)
-    (define-key map [remap evil-next-line] 'evil-next-visual-line)
-    map)
-  "Parent keymap for all keymaps of modes derived from `magit-mode'.")
-
-(defun magit-delete-thing ()
-  "This is a placeholder command.
-Where applicable, section-specific keymaps bind another command
-which deletes the thing at point."
-  (interactive)
-  (user-error "There is no thing at point that could be deleted"))
-
-(defun magit-visit-thing ()
-  "This is a placeholder command.
-Where applicable, section-specific keymaps bind another command
-which visits the thing at point."
-  (interactive)
-  (if (eq magit-current-popup 'magit-dispatch-popup)
-      (progn (setq magit-current-popup nil)
-             (call-interactively (key-binding (this-command-keys))))
-    (user-error "There is no thing at point that could be visited")))
-
-(easy-menu-define magit-mode-menu magit-mode-map
-  "Magit menu"
-  '("Magit"
-    ["Refresh" magit-refresh t]
-    ["Refresh all" magit-refresh-all t]
-    "---"
-    ["Stage" magit-stage t]
-    ["Stage modified" magit-stage-modified t]
-    ["Unstage" magit-unstage t]
-    ["Reset index" magit-reset-index t]
-    ["Commit" magit-commit-popup t]
-    ["Add log entry" magit-commit-add-log t]
-    ["Tag" magit-tag t]
-    "---"
-    ["Diff working tree" magit-diff-working-tree t]
-    ["Diff" magit-diff t]
-    ("Log"
-     ["Log" magit-log t]
-     ["Reflog" magit-reflog t]
-     ["Extended..." magit-log-popup t])
-    "---"
-    ["Cherry pick" magit-cherry-pick t]
-    ["Revert commit" magit-revert-popup t]
-    "---"
-    ["Ignore" magit-gitignore t]
-    ["Ignore locally" magit-gitignore-locally t]
-    ["Discard" magit-discard t]
-    ["Reset head" magit-reset-head t]
-    ["Stash" magit-stash t]
-    ["Snapshot" magit-snapshot t]
-    "---"
-    ["Branch..." magit-checkout t]
-    ["Merge" magit-merge t]
-    ["Ediff resolve" magit-ediff-resolve t]
-    ["Rebase..." magit-rebase-popup t]
-    "---"
-    ["Push" magit-push t]
-    ["Pull" magit-pull t]
-    ["Remote update" magit-fetch-all t]
-    ("Submodule"
-     ["Submodule update" magit-submodule-update t]
-     ["Submodule update and init" magit-submodule-setup t]
-     ["Submodule init" magit-submodule-init t]
-     ["Submodule sync" magit-submodule-sync t])
-    "---"
-    ("Extensions")
-    "---"
-    ["Display Git output" magit-process-buffer t]
-    ["Quit Magit" magit-mode-bury-buffer t]))
-
-(defun magit-load-config-extensions ()
-  "Load Magit extensions that are defined at the Git config layer."
-  (dolist (ext (magit-get-all "magit.extension"))
-    (let ((sym (intern (format "magit-%s-mode" ext))))
-      (when (fboundp sym)
-        (funcall sym 1)))))
-
-(define-derived-mode magit-mode special-mode "Magit"
-  "Parent major mode from which Magit major modes inherit.
-
-Magit is documented in info node `(magit)'."
-  :group 'magit-modes
-  (buffer-disable-undo)
-  (setq truncate-lines t)
-  (setq buffer-read-only t)
-  (setq-local line-move-visual t) ; see #1771
-  (setq show-trailing-whitespace nil)
-  (setq list-buffers-directory (abbreviate-file-name default-directory))
-  (hack-dir-local-variables-non-file-buffer)
-  (make-local-variable 'text-property-default-nonsticky)
-  (push (cons 'keymap t) text-property-default-nonsticky)
-  (add-hook 'post-command-hook #'magit-section-update-highlight t t)
-  (setq-local redisplay-highlight-region-function 'magit-highlight-region)
-  (setq-local redisplay-unhighlight-region-function 'magit-unhighlight-region)
-  (when (bound-and-true-p global-linum-mode)
-    (linum-mode -1))
-  (when (and (fboundp 'nlinum-mode)
-             (bound-and-true-p global-nlinum-mode))
-    (nlinum-mode -1)))
-
-(defvar-local magit-region-overlays nil)
-
-(defun magit-delete-region-overlays ()
-  (mapc #'delete-overlay magit-region-overlays)
-  (setq magit-region-overlays nil))
-
-(defun magit-highlight-region (start end window rol)
-  (magit-delete-region-overlays)
-  (if (and (run-hook-with-args-until-success 'magit-region-highlight-hook
-                                             (magit-current-section))
-           (not magit-keep-region-overlay))
-      (funcall (default-value 'redisplay-unhighlight-region-function) rol)
-    (funcall (default-value 'redisplay-highlight-region-function)
-             start end window rol)))
-
-(defun magit-unhighlight-region (rol)
-  (setq magit-section-highlighted-section nil)
-  (magit-delete-region-overlays)
-  (funcall (default-value 'redisplay-unhighlight-region-function) rol))
-
-(defvar-local magit-refresh-args nil
-  "The arguments used to refresh the current buffer.")
-(put 'magit-refresh-args 'permanent-local t)
-
-(defvar-local magit-previous-section nil)
-(put 'magit-previous-section 'permanent-local t)
-
-(defun magit-mode-setup (mode &rest args)
-  "Setup up a MODE buffer using ARGS to generate its content."
-  (magit-mode-setup-internal mode args))
-
-(defun magit-mode-setup-internal (mode args &optional locked)
-  "Setup up a MODE buffer using ARGS to generate its content.
-When optional LOCKED is non-nil, then create a buffer that is
-locked to its value, which is derived from MODE and ARGS."
-  (let ((buffer (magit-mode-get-buffer
-                 mode t nil
-                 (and locked (magit-buffer-lock-value mode args))))
-        (section (magit-current-section)))
-    (with-current-buffer buffer
-      (setq magit-previous-section section)
-      (setq magit-refresh-args args)
-      (funcall mode))
-    (magit-display-buffer buffer)
-    (with-current-buffer buffer
-      (run-hooks 'magit-mode-setup-hook)
-      (magit-refresh-buffer))))
-
-(defvar magit-display-buffer-noselect nil
-  "If non-nil, then `magit-display-buffer' doesn't call `select-window'.")
-
-(defun magit-display-buffer (buffer)
-  "Display BUFFER in some window and maybe select it.
-
-Display the buffer using `magit-display-buffer-function' and
-then, unless `magit-display-buffer-noselect' is non-nil, select
-the window which was used to display the buffer.
-
-Also run the hooks `magit-pre-display-buffer-hook'
-and `magit-post-display-buffer-hook'."
-  (with-current-buffer buffer
-    (run-hooks 'magit-pre-display-buffer-hook))
-  (let ((window (funcall magit-display-buffer-function buffer)))
-    (unless magit-display-buffer-noselect
-      (select-frame-set-input-focus
-       (window-frame
-        (select-window window)))))
-  (with-current-buffer buffer
-    (run-hooks 'magit-post-display-buffer-hook)))
-
-(defun magit-display-buffer-traditional (buffer)
-  "Display BUFFER the way this has traditionally been done."
-  (display-buffer
-   buffer (if (and (derived-mode-p 'magit-mode)
-                   (not (memq (with-current-buffer buffer major-mode)
-                              '(magit-process-mode
-                                magit-revision-mode
-                                magit-diff-mode
-                                magit-stash-mode
-                                magit-status-mode))))
-              '(display-buffer-same-window)
-            nil))) ; display in another window
-
-(defun magit-display-buffer-same-window-except-diff-v1 (buffer)
-  "Display BUFFER in the selected window except for some modes.
-If a buffer's `major-mode' derives from `magit-diff-mode' or
-`magit-process-mode', display it in another window.  Display all
-other buffers in the selected window."
-  (display-buffer
-   buffer (if (with-current-buffer buffer
-                (derived-mode-p 'magit-diff-mode 'magit-process-mode))
-              nil  ; display in another window
-            '(display-buffer-same-window))))
-
-(defun magit--display-buffer-fullframe (buffer alist)
-  (-when-let (window (or (display-buffer-reuse-window buffer alist)
-                         (display-buffer-same-window buffer alist)
-                         (display-buffer-pop-up-window buffer alist)
-                         (display-buffer-use-some-window buffer alist)))
-    (delete-other-windows window)
-    window))
-
-(defun magit-display-buffer-fullframe-status-v1 (buffer)
-  "Display BUFFER, filling entire frame if BUFFER is a status buffer.
-Otherwise, behave like `magit-display-buffer-traditional'."
-  (if (eq (with-current-buffer buffer major-mode)
-          'magit-status-mode)
-      (display-buffer buffer '(magit--display-buffer-fullframe))
-    (magit-display-buffer-traditional buffer)))
-
-(defun magit--display-buffer-topleft (buffer alist)
-  (or (display-buffer-reuse-window buffer alist)
-      (-when-let (window2 (display-buffer-pop-up-window buffer alist))
-        (let ((window1 (get-buffer-window))
-              (buffer1 (current-buffer))
-              (buffer2 (window-buffer window2))
-              (w2-quit-restore (window-parameter window2 'quit-restore)))
-          (set-window-buffer window1 buffer2)
-          (set-window-buffer window2 buffer1)
-          (select-window window2)
-          ;; Swap some window state that `magit-mode-quit-window' and
-          ;; `quit-restore-window' inspect.
-          (set-window-prev-buffers window2 (cdr (window-prev-buffers window1)))
-          (set-window-prev-buffers window1 nil)
-          (set-window-parameter window2 'magit-dedicated
-                                (window-parameter window1 'magit-dedicated))
-          (set-window-parameter window1 'magit-dedicated t)
-          (set-window-parameter window1 'quit-restore
-                                (list 'window 'window
-                                      (nth 2 w2-quit-restore)
-                                      (nth 3 w2-quit-restore)))
-          (set-window-parameter window2 'quit-restore nil)
-          window1))))
-
-(defun magit-display-buffer-fullframe-status-topleft-v1 (buffer)
-  "Display BUFFER, filling entire frame if BUFFER is a status buffer.
-When BUFFER derives from `magit-diff-mode' or
-`magit-process-mode', try to display BUFFER to the top or left of
-the current buffer rather than to the bottom or right, as
-`magit-display-buffer-fullframe-status-v1' would.  Whether the
-split is made vertically or horizontally is determined by
-`split-window-preferred-function'."
-  (display-buffer
-   buffer
-   (cond ((eq (with-current-buffer buffer major-mode)
-              'magit-status-mode)
-          '(magit--display-buffer-fullframe))
-         ((with-current-buffer buffer
-            (derived-mode-p 'magit-diff-mode 'magit-process-mode))
-          '(magit--display-buffer-topleft))
-         (t
-          '(display-buffer-same-window)))))
-
-(defun magit--display-buffer-fullcolumn (buffer alist)
-  (-when-let (window (or (display-buffer-reuse-window buffer alist)
-                         (display-buffer-same-window buffer alist)
-                         (display-buffer-below-selected buffer alist)))
-    (delete-other-windows-vertically window)
-    window))
-
-(defun magit-display-buffer-fullcolumn-most-v1 (buffer)
-  "Display BUFFER using the full column except in some cases.
-For most cases where BUFFER's `major-mode' derives from
-`magit-mode', display it in the selected window and grow that
-window to the full height of the frame, deleting other windows in
-that column as necessary.  However, display BUFFER in another
-window if 1) BUFFER's mode derives from `magit-process-mode', or
-2) BUFFER's mode derives from `magit-diff-mode', provided that
-the mode of the current buffer derives from `magit-log-mode' or
-`magit-cherry-mode'."
-  (display-buffer
-   buffer
-   (cond ((and (or git-commit-mode
-                   (derived-mode-p 'magit-log-mode 'magit-cherry-mode))
-               (with-current-buffer buffer
-                 (derived-mode-p 'magit-diff-mode)))
-          nil)
-         ((with-current-buffer buffer
-            (derived-mode-p 'magit-process-mode))
-          nil)
-         (t
-          '(magit--display-buffer-fullcolumn)))))
-
-(defun magit-maybe-set-dedicated ()
-  "Mark the selected window as dedicated if appropriate.
-
-If a new window was created to display the buffer, then remember
-that fact.  That information is used by `magit-mode-quit-window',
-to determine whether the window should be deleted when its last
-Magit buffer is buried."
-  (let ((window (get-buffer-window (current-buffer))))
-    (when (and (window-live-p window)
-               (not (window-prev-buffers window)))
-      (set-window-parameter window 'magit-dedicated t))))
-
-(defvar-local magit--default-directory nil
-  "Value of `default-directory' when buffer is generated.
-This exists to prevent a let-bound `default-directory' from
-tricking `magit-mode-get-buffer' or `magit-mode-get-buffers' into
-thinking a buffer belongs to a repo that it doesn't.")
-(put 'magit--default-directory 'permanent-local t)
-
-(defun magit-mode-get-buffers ()
-  (let ((topdir (magit-toplevel)))
-    (--filter (with-current-buffer it
-                (and (derived-mode-p 'magit-mode)
-                     (equal magit--default-directory topdir)))
-              (buffer-list))))
-
-(defvar-local magit-buffer-locked-p nil)
-(put 'magit-buffer-locked-p 'permanent-local t)
-
-(defun magit-mode-get-buffer (mode &optional create frame value)
-  (-if-let (topdir (magit-toplevel))
-      (or (--first (with-current-buffer it
-                     (and (eq major-mode mode)
-                          (equal magit--default-directory topdir)
-                          (if value
-                              (and magit-buffer-locked-p
-                                   (equal (magit-buffer-lock-value) value))
-                            (not magit-buffer-locked-p))))
-                   (if frame
-                       (-map #'window-buffer
-                             (window-list (unless (eq frame t) frame)))
-                     (buffer-list)))
-          (and create
-               (let ((default-directory topdir))
-                 (magit-generate-new-buffer mode value))))
-    (user-error "Not inside a Git repository")))
-
-(defun magit-generate-new-buffer (mode &optional value)
-  (let* ((name (funcall magit-generate-buffer-name-function mode value))
-         (buffer (generate-new-buffer name)))
-    (with-current-buffer buffer
-      (setq magit--default-directory default-directory)
-      (setq magit-buffer-locked-p (and value t)))
-    (when magit-uniquify-buffer-names
-      (add-to-list 'uniquify-list-buffers-directory-modes mode)
-      (with-current-buffer buffer
-        (setq list-buffers-directory (abbreviate-file-name default-directory)))
-      (let ((uniquify-buffer-name-style
-             (if (memq uniquify-buffer-name-style '(nil forward))
-                 'post-forward-angle-brackets
-               uniquify-buffer-name-style)))
-        (uniquify-rationalize-file-buffer-names
-         name (file-name-directory (directory-file-name default-directory))
-         buffer)))
-    buffer))
-
-(defun magit-generate-buffer-name-default-function (mode &optional value)
-  "Generate buffer name for a MODE buffer in the current repository.
-The returned name is based on `magit-buffer-name-format' and
-takes `magit-uniquify-buffer-names' and VALUE, if non-nil, into
-account."
-  (let ((m (substring (symbol-name mode) 0 -5))
-        (v (and value (format "%s" (if (listp value) value (list value))))))
-    (format-spec
-     magit-buffer-name-format
-     `((?m . ,m)
-       (?M . ,(if (eq mode 'magit-status-mode) "magit" m))
-       (?v . ,(or v ""))
-       (?V . ,(if v (concat " " v) ""))
-       (?t . ,(if magit-uniquify-buffer-names
-                  (file-name-nondirectory
-                   (directory-file-name default-directory))
-                (abbreviate-file-name default-directory)))))))
-
-(defun magit-toggle-buffer-lock ()
-  "Lock the current buffer to its value or unlock it.
-
-Locking a buffer to its value prevents it from being reused to
-display another value.  The name of a locked buffer contains its
-value, which allows telling it apart from other locked buffers
-and the unlocked buffer.
-
-Not all Magit buffers can be locked to their values, for example
-it wouldn't make sense to lock a status buffer.
-
-There can only be a single unlocked buffer using a certain
-major-mode per repository.  So when a buffer is being unlocked
-and another unlocked buffer already exists for that mode and
-repository, then the former buffer is instead deleted and the
-latter is displayed in its place."
-  (interactive)
-  (if magit-buffer-locked-p
-      (-if-let (unlocked (magit-mode-get-buffer major-mode))
-          (let ((locked (current-buffer)))
-            (switch-to-buffer unlocked nil t)
-            (kill-buffer locked))
-        (setq magit-buffer-locked-p nil)
-        (rename-buffer (funcall magit-generate-buffer-name-function
-                                major-mode)))
-    (-if-let (value (magit-buffer-lock-value))
-        (-if-let (locked (magit-mode-get-buffer major-mode nil nil value))
-            (let ((unlocked (current-buffer)))
-              (switch-to-buffer locked nil t)
-              (kill-buffer unlocked))
-          (setq magit-buffer-locked-p t)
-          (rename-buffer (funcall magit-generate-buffer-name-function
-                                  major-mode value)))
-      (user-error "Buffer has no value it could be locked to"))))
-
-(cl-defun magit-buffer-lock-value
-    (&optional (mode major-mode)
-               (args magit-refresh-args))
-  (cl-case mode
-    (magit-cherry-mode
-     (-let [(upstream head) args]
-       (concat head ".." upstream)))
-    (magit-diff-mode
-     (-let [(rev-or-range const _args files) args]
-       (nconc (cons (or rev-or-range
-                        (if (member "--cached" const)
-                            (progn (setq const (delete "--cached" const))
-                                   'staged)
-                          'unstaged))
-                    const)
-              (and files (cons "--" files)))))
-    (magit-log-mode
-     (-let [(revs _args files) args]
-       (if (and revs files)
-           (append revs (cons "--" files))
-         (append revs files))))
-    (magit-refs-mode
-     (-let [(ref args) args]
-       (cons (or ref "HEAD") args)))
-    (magit-revision-mode
-     (-let [(rev __const _args files) args]
-       (if files (cons rev files) (list rev))))
-    ((magit-reflog-mode   ; (ref ~args)
-      magit-stash-mode    ; (stash _const _args _files)
-      magit-stashes-mode) ; (ref)
-     (car args))))
-
-(defun magit-mode-bury-buffer (&optional kill-buffer)
-  "Bury the current buffer.
-With a prefix argument, kill the buffer instead.
-This is done using `magit-bury-buffer-function'."
-  (interactive "P")
-  (funcall magit-bury-buffer-function kill-buffer))
-
-(defun magit-mode-quit-window (kill-buffer)
-  "Quit the selected window and bury its buffer.
-
-This behaves similar to `quit-window', but when the window
-was originally created to display a Magit buffer and the
-current buffer is the last remaining Magit buffer that was
-ever displayed in the selected window, then delete that
-window."
-  (if (or (one-window-p)
-          (--first (let ((buffer (car it)))
-                     (and (not (eq buffer (current-buffer)))
-                          (buffer-live-p buffer)
-                          (or (not (window-parameter nil 'magit-dedicated))
-                              (with-current-buffer buffer
-                                (derived-mode-p 'magit-mode
-                                                'magit-process-mode)))))
-                   (window-prev-buffers)))
-      (quit-window kill-buffer)
-    (let ((window (selected-window)))
-      (quit-window kill-buffer)
-      (when (window-live-p window)
-        (delete-window window)))))
-
-;;; Refresh Magit Buffers
-
-(defvar inhibit-magit-refresh nil)
-
-(defun magit-refresh ()
-  "Refresh some buffers belonging to the current repository.
-
-Refresh the current buffer if its major mode derives from
-`magit-mode', and refresh the corresponding status buffer.
-
-Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'."
-  (interactive)
-  (unless inhibit-magit-refresh
-    (let ((start (current-time))
-          (magit--refresh-cache (or magit--refresh-cache
-                                    (list (cons 0 0)))))
-      (when magit-refresh-verbose
-        (message "Refreshing magit..."))
-      (magit-run-hook-with-benchmark 'magit-pre-refresh-hook)
-      (when (derived-mode-p 'magit-mode)
-        (magit-refresh-buffer))
-      (--when-let (and magit-refresh-status-buffer
-                       (not (derived-mode-p 'magit-status-mode))
-                       (magit-mode-get-buffer 'magit-status-mode))
-        (with-current-buffer it
-          (magit-refresh-buffer)))
-      (magit-auto-revert-buffers)
-      (magit-run-hook-with-benchmark 'magit-post-refresh-hook)
-      (when magit-refresh-verbose
-        (message "Refreshing magit...done (%.3fs, cached %s/%s)"
-                 (float-time (time-subtract (current-time) start))
-                 (caar magit--refresh-cache)
-                 (+ (caar magit--refresh-cache)
-                    (cdar magit--refresh-cache)))))))
-
-(defun magit-refresh-all ()
-  "Refresh all buffers belonging to the current repository.
-
-Refresh all Magit buffers belonging to the current repository,
-and revert buffers that visit files located inside the current
-repository.
-
-Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'."
-  (interactive)
-  (magit-run-hook-with-benchmark 'magit-pre-refresh-hook)
-  (dolist (buffer (magit-mode-get-buffers))
-    (with-current-buffer buffer (magit-refresh-buffer)))
-  (magit-auto-revert-buffers)
-  (magit-run-hook-with-benchmark 'magit-post-refresh-hook))
-
-(defvar-local magit-refresh-start-time nil)
-
-(defun magit-refresh-buffer ()
-  "Refresh the current Magit buffer."
-  (setq magit-refresh-start-time (current-time))
-  (let ((refresh (intern (format "%s-refresh-buffer"
-                                 (substring (symbol-name major-mode) 0 -5))))
-        (magit--refresh-cache (or magit--refresh-cache (list (cons 0 0)))))
-    (when (functionp refresh)
-      (when magit-refresh-verbose
-        (message "Refreshing buffer `%s'..." (buffer-name)))
-      (let* ((buffer (current-buffer))
-             (windows
-              (--mapcat (with-selected-window it
-                          (with-current-buffer buffer
-                            (-when-let (section (magit-current-section))
-                              (list
-                               (nconc (list it section)
-                                      (magit-refresh-get-relative-position))))))
-                        (or (get-buffer-window-list buffer nil t)
-                            (list (selected-window))))))
-        (deactivate-mark)
-        (setq magit-section-highlight-overlays nil)
-        (setq magit-section-highlighted-section nil)
-        (setq magit-section-highlighted-sections nil)
-        (setq magit-section-unhighlight-sections nil)
-        (let ((inhibit-read-only t))
-          (erase-buffer)
-          (save-excursion
-            (apply refresh magit-refresh-args)))
-        (dolist (window windows)
-          (with-selected-window (car window)
-            (with-current-buffer buffer
-              (apply #'magit-section-goto-successor (cdr window)))))
-        (run-hooks 'magit-refresh-buffer-hook)
-        (magit-section-update-highlight)
-        (set-buffer-modified-p nil))
-      (when magit-refresh-verbose
-        (message "Refreshing buffer `%s'...done (%.3fs)" (buffer-name)
-                 (float-time (time-subtract (current-time)
-                                            magit-refresh-start-time)))))))
-
-(defun magit-refresh-get-relative-position ()
-  (-when-let (section (magit-current-section))
-    (let ((start (magit-section-start section)))
-      (list (count-lines start (point))
-            (- (point) (line-beginning-position))
-            (and (eq (magit-section-type section) 'hunk)
-                 (region-active-p)
-                 (progn (goto-char (line-beginning-position))
-                        (when  (looking-at "^[-+]") (forward-line))
-                        (while (looking-at "^[ @]") (forward-line))
-                        (let ((beg (point)))
-                          (cond ((looking-at "^[-+]")
-                                 (forward-line)
-                                 (while (looking-at "^[-+]") (forward-line))
-                                 (while (looking-at "^ ")    (forward-line))
-                                 (forward-line -1)
-                                 (regexp-quote (buffer-substring-no-properties
-                                                beg (line-end-position))))
-                                (t t)))))))))
-
-;;; Save File-Visiting Buffers
-
-(defvar disable-magit-save-buffers nil)
-
-(defun magit-pre-command-hook ()
-  (setq disable-magit-save-buffers nil))
-(add-hook 'pre-command-hook #'magit-pre-command-hook)
-
-(defvar magit-after-save-refresh-buffers nil)
-
-(defun magit-after-save-refresh-buffers ()
-  (dolist (buffer magit-after-save-refresh-buffers)
-    (when (buffer-live-p buffer)
-      (with-current-buffer buffer
-        (magit-refresh-buffer))))
-  (setq magit-after-save-refresh-buffers nil)
-  (remove-hook 'post-command-hook 'magit-after-save-refresh-buffers))
-
-(defun magit-after-save-refresh-status ()
-  "Refresh the status buffer of the current repository.
-
-This function is intended to be added to `after-save-hook'.
-
-If the status buffer does not exist or the file being visited in
-the current buffer isn't inside the working tree of a repository,
-then do nothing.
-
-Note that refreshing a Magit buffer is done by re-creating its
-contents from scratch, which can be slow in large repositories.
-If you are not satisfied with Magit's performance, then you
-should obviously not add this function to that hook."
-  (when (and (not disable-magit-save-buffers)
-             (magit-inside-worktree-p))
-    (--when-let (ignore-errors (magit-mode-get-buffer 'magit-status-mode))
-      (add-to-list 'magit-after-save-refresh-buffers it)
-      (add-hook 'post-command-hook 'magit-after-save-refresh-buffers))))
-
-(defun magit-maybe-save-repository-buffers ()
-  "Maybe save file-visiting buffers belonging to the current repository.
-Do so if `magit-save-repository-buffers' is non-nil.  You should
-not remove this from any hooks, instead set that variable to nil
-if you so desire."
-  (when (and magit-save-repository-buffers
-             (not disable-magit-save-buffers))
-    (setq disable-magit-save-buffers t)
-    (let ((msg (current-message)))
-      (magit-save-repository-buffers
-       (eq magit-save-repository-buffers 'dontask))
-      (when (and msg (not (equal msg (current-message))))
-        (message "%s" msg)))))
-
-(add-hook 'magit-pre-refresh-hook #'magit-maybe-save-repository-buffers)
-(add-hook 'magit-pre-call-git-hook #'magit-maybe-save-repository-buffers)
-(add-hook 'magit-pre-start-git-hook #'magit-maybe-save-repository-buffers)
-
-(defun magit-save-repository-buffers (&optional arg)
-  "Save file-visiting buffers belonging to the current repository.
-After any buffer where `buffer-save-without-query' is non-nil
-is saved without asking, the user is asked about each modified
-buffer which visits a file in the current repository.  Optional
-argument (the prefix) non-nil means save all with no questions."
-  (interactive "P")
-  (-when-let (topdir (magit-rev-parse-safe "--show-toplevel"))
-    (let ((remote (file-remote-p topdir)))
-      (save-some-buffers
-       arg (lambda ()
-             (and buffer-file-name
-                  ;; Avoid needlessly connecting to unrelated remotes.
-                  (equal (file-remote-p buffer-file-name)
-                         remote)
-                  (string-prefix-p topdir (file-truename buffer-file-name))
-                  (equal (magit-rev-parse-safe "--show-toplevel")
-                         topdir)))))))
-
-;;; Restore Window Configuration
-
-(defvar magit-inhibit-save-previous-winconf nil)
-
-(defvar-local magit-previous-window-configuration nil)
-(put 'magit-previous-window-configuration 'permanent-local t)
-
-(defun magit-save-window-configuration ()
-  "Save the current window configuration.
-
-Later, when the buffer is buried, it may be restored by
-`magit-restore-window-configuration'."
-  (if magit-inhibit-save-previous-winconf
-      (when (eq magit-inhibit-save-previous-winconf 'unset)
-        (setq magit-previous-window-configuration nil))
-    (unless (get-buffer-window (current-buffer) (selected-frame))
-      (setq magit-previous-window-configuration
-            (current-window-configuration)))))
-
-(defun magit-restore-window-configuration (&optional kill-buffer)
-  "Bury or kill the current buffer and restore previous window configuration."
-  (let ((winconf magit-previous-window-configuration)
-        (buffer (current-buffer))
-        (frame (selected-frame)))
-    (quit-window kill-buffer (selected-window))
-    (when (and winconf (equal frame (window-configuration-frame winconf)))
-      (set-window-configuration winconf)
-      (when (buffer-live-p buffer)
-        (with-current-buffer buffer
-          (setq magit-previous-window-configuration nil))))))
-
-;;; Buffer History
-
-(defun magit-go-backward ()
-  "Move backward in current buffer's history."
-  (interactive)
-  (if help-xref-stack
-      (help-xref-go-back (current-buffer))
-    (user-error "No previous entry in buffer's history")))
-
-(defun magit-go-forward ()
-  "Move forward in current buffer's history."
-  (interactive)
-  (if help-xref-forward-stack
-      (help-xref-go-forward (current-buffer))
-    (user-error "No next entry in buffer's history")))
-
-(defun magit-insert-xref-buttons (&optional _)
-  "Insert xref buttons."
-  (when (or help-xref-stack help-xref-forward-stack)
-    (when help-xref-stack
-      (magit-xref-insert-button help-back-label 'magit-xref-backward))
-    (when help-xref-forward-stack
-      (when help-xref-stack
-        (insert " "))
-      (magit-xref-insert-button help-forward-label 'magit-xref-forward))))
-
-(defun magit-xref-insert-button (label type)
-  (magit-insert-section (button label)
-    (insert-text-button label 'type type
-                        'help-args (list (current-buffer)))))
-
-(define-button-type 'magit-xref-backward
-  :supertype 'help-back
-  'mouse-face 'magit-section-highlight
-  'help-echo (purecopy "mouse-2, RET: go back to previous history entry"))
-
-(define-button-type 'magit-xref-forward
-  :supertype 'help-forward
-  'mouse-face 'magit-section-highlight
-  'help-echo (purecopy "mouse-2, RET: go back to next history entry"))
-
-(defun magit-xref-setup ()
-  "Insert backward/forward buttons if the major-mode supports it.
-Currently `magit-log-mode', `magit-reflog-mode',
-`magit-diff-mode', and `magit-revision-mode' support it"
-  (when (memq major-mode '(magit-log-mode
-                           magit-reflog-mode
-                           magit-diff-mode
-                           magit-revision-mode))
-    (when help-xref-stack-item
-      (push (cons (point) help-xref-stack-item) help-xref-stack)
-      (setq help-xref-forward-stack nil))
-    (when (called-interactively-p 'interactive)
-      (--when-let (nthcdr 10 help-xref-stack)
-        (setcdr it nil)))
-    (setq help-xref-stack-item
-          `(magit-xref-restore ,default-directory ,@magit-refresh-args))))
-
-(defun magit-xref-restore (&rest args)
-  (magit-xref-setup)
-  (setq default-directory  (car args))
-  (setq magit-refresh-args (cdr args))
-  (magit-refresh-buffer))
-
-;;; Utilities
-
-(defun magit-run-hook-with-benchmark (hook)
-  (when hook
-    (if magit-refresh-verbose
-        (let ((start (current-time)))
-          (message "Running %s..." hook)
-          (run-hooks hook)
-          (message "Running %s...done (%.3fs)" hook
-                   (float-time (time-subtract (current-time) start))))
-      (run-hooks hook))))
-
-(provide 'magit-mode)
-;;; magit-mode.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-mode.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-notes.el
@@ -1,179 +0,0 @@
-;;; magit-notes.el --- notes support  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements support for `git-notes'.
-
-;;; Code:
-
-(require 'magit)
-
-;;; Popup
-
-;;;###autoload (autoload 'magit-notes-popup "magit" nil t)
-(magit-define-popup magit-notes-popup
-  "Popup console for notes commands."
-  :man-page "git-tag"
-  :switches '("Switch for prune"
-              (?n "Dry run"          "--dry-run"))
-  :options  '("Option for edit and remove"
-              (?r "Manipulate ref"   "--ref=" magit-notes-popup-read-ref)
-              "Option for merge"
-              (?s "Merge strategy"   "--strategy="))
-  :actions  '((?T "Edit"             magit-notes-edit)
-              (?r "Remove"           magit-notes-remove)
-              (?m "Merge"            magit-notes-merge)
-              (?p "Prune"            magit-notes-prune)
-              (?s "Set ref"          magit-notes-set-ref)
-              (?S "Set display refs" magit-notes-set-display-refs))
-  :sequence-actions '((?c "Commit merge" magit-notes-merge-commit)
-                      (?a "Abort merge"  magit-notes-merge-abort))
-  :sequence-predicate 'magit-notes-merging-p
-  :default-action 'magit-notes-edit)
-
-(defun magit-notes-merging-p ()
-  (let ((dir (magit-git-dir "NOTES_MERGE_WORKTREE")))
-    (and (file-directory-p dir)
-         (directory-files dir nil "^[^.]"))))
-
-(defun magit-notes-popup-read-ref (prompt &optional initial-input)
-  (magit-completing-read prompt (nconc (list "refs/" "refs/notes/")
-                                       (magit-list-notes-refnames))
-                         nil nil initial-input))
-
-;;; Commands
-
-(defun magit-notes-edit (commit &optional ref)
-  "Edit the note attached to COMMIT.
-REF is the notes ref used to store the notes.
-
-Interactively or when optional REF is nil use the value of Git
-variable `core.notesRef' or \"refs/notes/commits\" if that is
-undefined."
-  (interactive (magit-notes-read-args "Edit notes"))
-  (magit-run-git-with-editor "notes" (and ref (concat "--ref=" ref))
-                             "edit" commit))
-
-(defun magit-notes-remove (commit &optional ref)
-  "Remove the note attached to COMMIT.
-REF is the notes ref from which the note is removed.
-
-Interactively or when optional REF is nil use the value of Git
-variable `core.notesRef' or \"refs/notes/commits\" if that is
-undefined."
-  (interactive (magit-notes-read-args "Remove notes"))
-  (magit-run-git-with-editor "notes" (and ref (concat "--ref=" ref))
-                             "remove" commit))
-
-(defun magit-notes-merge (ref)
-  "Merge the notes ref REF into the current notes ref.
-
-The current notes ref is the value of Git variable
-`core.notesRef' or \"refs/notes/commits\" if that is undefined.
-
-When there are conflicts, then they have to be resolved in the
-temporary worktree \".git/NOTES_MERGE_WORKTREE\".  When
-done use `magit-notes-merge-commit' to finish.  To abort
-use `magit-notes-merge-abort'."
-  (interactive (list (magit-read-string-ns "Merge reference")))
-  (magit-run-git-with-editor "notes" "merge" ref))
-
-(defun magit-notes-merge-commit ()
-  "Commit the current notes ref merge.
-Also see `magit-notes-merge'."
-  (interactive)
-  (magit-run-git-with-editor "notes" "merge" "--commit"))
-
-(defun magit-notes-merge-abort ()
-  "Abort the current notes ref merge.
-Also see `magit-notes-merge'."
-  (interactive)
-  (magit-run-git-with-editor "notes" "merge" "--abort"))
-
-(defun magit-notes-prune (&optional dry-run)
-  "Remove notes about unreachable commits."
-  (interactive (list (and (member "--dry-run" (magit-notes-arguments)) t)))
-  (when dry-run
-    (magit-process-buffer))
-  (magit-run-git-with-editor "notes" "prune" (and dry-run "--dry-run")))
-
-(defun magit-notes-set-ref (ref &optional global)
-  "Set the current notes ref to REF.
-The ref is made current by setting the value of the Git variable
-`core.notesRef'.  With a prefix argument GLOBAL change the global
-value, else the value in the current repository.  When this is
-undefined, then \"refs/notes/commit\" is used.
-
-Other `magit-notes-*' commands, as well as the sub-commands
-of Git's `note' command, default to operate on that ref."
-  (interactive
-   (list (magit-completing-read "Set notes ref"
-                                (nconc (list "refs/" "refs/notes/")
-                                       (magit-list-notes-refnames))
-                                nil nil
-                                (--when-let (magit-get "core.notesRef")
-                                  (if (string-match "^refs/notes/\\(.+\\)" it)
-                                      (match-string 1 it)
-                                    it)))
-         current-prefix-arg))
-  (if ref
-      (magit-run-git "config" (and global "--global") "core.notesRef"
-                     (if (string-prefix-p "refs/" ref)
-                         ref
-                       (concat "refs/notes/" ref)))
-    (magit-run-git "config" (and global "--global")
-                   "--unset" "core.notesRef")))
-
-(defun magit-notes-set-display-refs (refs &optional global)
-  "Set notes refs to be display in addition to \"core.notesRef\".
-REFS is a colon separated list of notes refs.  The values are
-stored in the Git variable `notes.displayRef'.  With a prefix
-argument GLOBAL change the global values, else the values in
-the current repository."
-  (interactive
-   (list (magit-completing-read "Set additional notes ref(s)"
-                                (nconc (list "refs/" "refs/notes/")
-                                       (magit-list-notes-refnames))
-                                nil nil
-                                (mapconcat #'identity
-                                           (magit-get-all "notes.displayRef")
-                                           ":"))
-         current-prefix-arg))
-  (when (and refs (atom refs))
-    (setq refs (split-string refs ":")))
-  (when global
-    (setq global "--global"))
-  (magit-git-success "config" "--unset-all" global "notes.displayRef")
-  (dolist (ref refs)
-    (magit-call-git "config" "--add" global "notes.displayRef" ref))
-  (magit-refresh))
-
-(defun magit-notes-read-args (prompt)
- (list (magit-read-branch-or-commit prompt)
-       (--when-let (--first (string-match "^--ref=\\(.+\\)" it)
-                            (magit-notes-arguments))
-         (match-string 1 it))))
-
-(provide 'magit-notes)
-;;; magit-notes.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-notes.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-obsolete.el
@@ -1,133 +0,0 @@
-;;; magit-obsolete.el --- obsolete definitions  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library defines aliases for obsolete variables and functions.
-
-;;; Code:
-
-(require 'magit)
-
-;;; Obsolete since v2.1.0
-
-(define-obsolete-variable-alias 'magit-git-standard-options
-  'magit-git-global-arguments "Magit 2.1.0")
-
-;;; Obsolete since v2.2.0
-
-(define-obsolete-variable-alias 'magit-log-section-args
-  'magit-log-section-arguments "Magit 2.2.0")
-
-;;; Obsolete since v2.3.0
-
-(define-obsolete-function-alias 'global-magit-file-buffer-mode
-  'global-magit-file-mode "Magit 2.3.0")
-
-;;; Obsolete since v2.4.0
-
-(define-obsolete-function-alias 'magit-get-tracked-ref
-  'magit-get-upstream-ref "Magit 2.4.0")
-
-(define-obsolete-function-alias 'magit-get-tracked-branch
-  'magit-get-upstream-branch "Magit 2.4.0")
-
-(define-obsolete-function-alias 'magit-get-tracked-remote
-  'magit-get-upstream-remote "Magit 2.4.0")
-
-(define-obsolete-function-alias 'magit-insert-head-header
-  'magit-insert-head-branch-header "Magit 2.4.0")
-
-(define-obsolete-function-alias 'magit-insert-pull-branch-header
-  'magit-insert-upstream-branch-header "Magit 2.4.0")
-
-(define-obsolete-function-alias 'magit-insert-unpulled-or-recent-commits
-  'magit-insert-unpulled-from-upstream-or-recent "Magit 2.4.0")
-
-(define-obsolete-function-alias 'magit-insert-upstream-header
-  'magit-insert-upstream-branch-header "Magit 2.4.0")
-
-(make-obsolete-variable 'magit-revert-buffers
-                        'magit-auto-revert-mode
-                        "Magit 2.4.0")
-
-(make-obsolete-variable 'magit-status-refresh-hook "\
-use `magit-pre-refresh-hook', `magit-post-refresh-hook',
-  `magit-refresh-buffer-hook', or `magit-status-mode-hook' instead.
-
-  If you want to run a function every time the status buffer is
-  refreshed, in order to do something with that buffer, then use:
-
-    (add-hook 'magit-refresh-buffer-hook
-              (lambda ()
-                (when (derived-mode-p 'magit-status-mode)
-                  ...)))
-
-  If your hook function should run regardless of whether the
-  status buffer exists or not, then use `magit-pre-refresh-hook'
-  or `magit-post-refresh-hook'.
-
-  If your hook function only has to be run once, when the buffer
-  is first created, then `magit-status-mode-hook' instead.
-" "Magit 2.4.0")
-
-;;; Obsolete since v2.6.0
-
-(define-obsolete-function-alias 'magit-insert-unpulled-module-commits
-  'magit-insert-modules-unpulled-from-upstream "Magit 2.6.0")
-
-(define-obsolete-function-alias 'magit-insert-unpushed-module-commits
-  'magit-insert-modules-unpushed-to-upstream "Magit 2.6.0")
-
-;;; Obsolete since v2.8.0
-
-(make-obsolete-variable 'magit-repository-directories-depth
-                        'magit-repository-directories "Magit 2.8.0")
-
-;;; Obsolete since v2.9.0
-
-(define-obsolete-variable-alias 'magit-duration-spec
-  'magit--age-spec "Magit 2.9.0")
-
-(make-obsolete-variable 'magit-diff-show-lines-boundary
-                        'magit-diff-highlight-hunk-region-functions
-                        "Magit 2.9.0")
-
-(define-obsolete-variable-alias 'magit-log-output-coding-system
-  'magit-git-output-coding-system "Magit 2.9.0")
-
-;;; Obsolete since v2.9.1
-
-(define-obsolete-function-alias 'magit-checkout-file
-  'magit-file-checkout "Magit 2.9.1")
-
-;;; Obsolete since v2.11.0
-
-(define-obsolete-function-alias 'magit-modified-files
-  'magit-unstaged-files "Magit 2.11.0")
-
-(define-obsolete-function-alias 'magit-insert-submodules
-  'magit-insert-modules-overview "Magit 2.11.0")
-
-(provide 'magit-obsolete)
-;;; magit-obsolete.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-obsolete.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-pkg.el
@@ -1,12 +0,0 @@
-(define-package "magit" "20170913.1424" "A Git porcelain inside Emacs"
-  '((emacs "24.4")
-    (async "20170823")
-    (dash "20170810")
-    (with-editor "20170817")
-    (git-commit "20170823")
-    (magit-popup "20170824"))
-  :url "https://github.com/magit/magit" :keywords
-  '("git" "tools" "vc"))
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/magit-20170913.1424/magit-process.el
@@ -1,878 +0,0 @@
-;;; magit-process.el --- process functionality  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements the tools used to run Git for side-effects.
-
-;; Note that the functions used to run Git and then consume its
-;; output, are defined in `magit-git.el'.  There's a bit of overlap
-;; though.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'dash)
-
-(require 'with-editor)
-(require 'magit-utils)
-(require 'magit-section)
-(require 'magit-git)
-(require 'magit-mode)
-
-(eval-when-compile (require 'dired))
-(declare-function dired-uncache 'dired)
-
-(eval-when-compile (require 'auth-source))
-(declare-function auth-source-search 'auth-source)
-
-;;; Options
-
-(defcustom magit-process-connection-type (not (eq system-type 'cygwin))
-  "Connection type used for the Git process.
-
-If nil, use pipes: this is usually more efficient, and works on Cygwin.
-If t, use ptys: this enables Magit to prompt for passphrases when needed."
-  :group 'magit-process
-  :type '(choice (const :tag "pipe" nil)
-                 (const :tag "pty" t)))
-
-(defcustom magit-need-cygwin-noglob
-  (and (eq system-type 'windows-nt)
-       (with-temp-buffer
-         (let ((process-environment
-                (append magit-git-environment process-environment)))
-           (condition-case e
-               (process-file magit-git-executable
-                             nil (current-buffer) nil
-                             "-c" "alias.echo=!echo" "echo" "x{0}")
-             (file-error
-              (lwarn 'magit-process :warning
-                     "Could not run Git: %S" e))))
-         (equal "x0\n" (buffer-string))))
-  "Whether to use a workaround for Cygwin's globbing behavior.
-
-If non-nil, add environment variables to `process-environment' to
-prevent the git.exe distributed by Cygwin and MSYS2 from
-attempting to perform glob expansion when called from a native
-Windows build of Emacs.  See #2246."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-process
-  :type '(choice (const :tag "Yes" t)
-                 (const :tag "No" nil)))
-
-(defcustom magit-process-popup-time -1
-  "Popup the process buffer if a command takes longer than this many seconds."
-  :group 'magit-process
-  :type '(choice (const :tag "Never" -1)
-                 (const :tag "Immediately" 0)
-                 (integer :tag "After this many seconds")))
-
-(defcustom magit-process-log-max 32
-  "Maximum number of sections to keep in a process log buffer.
-When adding a new section would go beyond the limit set here,
-then the older half of the sections are remove.  Sections that
-belong to processes that are still running are never removed.
-When this is nil, no sections are ever removed."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-process
-  :type '(choice (const :tag "Never remove old sections" nil) integer))
-
-(defcustom magit-credential-cache-daemon-socket
-  (--some (-let [(prog . args) (split-string it)]
-            (if (string-match-p
-                 "\\`\\(?:\\(?:/.*/\\)?git-credential-\\)?cache\\'" prog)
-                (or (cl-loop for (opt val) on args
-                             if (string= opt "--socket")
-                             return val)
-                    (expand-file-name "~/.git-credential-cache/socket"))))
-          ;; Note: `magit-process-file' is not yet defined when
-          ;; evaluating this form, so we use `process-lines'.
-          (ignore-errors
-            (let ((process-environment
-                   (append magit-git-environment process-environment)))
-              (process-lines magit-git-executable
-                             "config" "--get-all" "credential.helper"))))
-  "If non-nil, start a credential cache daemon using this socket.
-
-When using Git's cache credential helper in the normal way, Emacs
-sends a SIGHUP to the credential daemon after the git subprocess
-has exited, causing the daemon to also quit.  This can be avoided
-by starting the `git-credential-cache--daemon' process directly
-from Emacs.
-
-The function `magit-maybe-start-credential-cache-daemon' takes
-care of starting the daemon if necessary, using the value of this
-option as the socket.  If this option is nil, then it does not
-start any daemon.  Likewise if another daemon is already running,
-then it starts no new daemon.  This function has to be a member
-of the hook variable `magit-credential-hook' for this to work.
-If an error occurs while starting the daemon, most likely because
-the necessary executable is missing, then the function removes
-itself from the hook, to avoid further futile attempts."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-process
-  :type '(choice (file  :tag "Socket")
-                 (const :tag "Don't start a cache daemon" nil)))
-
-(defcustom magit-process-yes-or-no-prompt-regexp
-  " [\[(]\\([Yy]\\(?:es\\)?\\)[/|]\\([Nn]o?\\)[\])] ?[?:] ?$"
-  "Regexp matching Yes-or-No prompts of Git and its subprocesses."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-process
-  :type 'regexp)
-
-(defcustom magit-process-password-prompt-regexps
-  '("^\\(Enter \\)?[Pp]assphrase\\( for \\(RSA \\)?key '.*'\\)?: ?$"
-    ;; match-group 99 is used to identify a host
-    "^\\(Enter \\)?[Pp]assword\\( for '\\(?99:.*\\)'\\)?: ?$"
-    "^.*'s password: ?$"
-    "^Yubikey for .*: ?$"
-    "^Enter PIN for .*: ?$")
-  "List of regexps matching password prompts of Git and its subprocesses.
-Also see `magit-process-find-password-functions'."
-  :package-version '(magit . "2.8.0")
-  :group 'magit-process
-  :type '(repeat (regexp)))
-
-(defcustom magit-process-find-password-functions nil
-  "List of functions to try in sequence to get a password.
-
-These functions may be called when git asks for a password, which
-is detected using `magit-process-password-prompt-regexps'.  They
-are called if and only if matching the prompt resulted in the
-value of the 99th submatch to be non-nil.  Therefore users can
-control for which prompts these functions should be called by
-putting the host name in the 99th submatch, or not.
-
-If the functions are called, then they are called in the order
-given, with the host name as only argument, until one of them
-returns non-nil.  If they are not called or none of them returns
-non-nil, then the password is read from the user instead."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-process
-  :type 'hook
-  :options '(magit-process-password-auth-source))
-
-(defcustom magit-process-username-prompt-regexps
-  '("^Username for '.*': ?$")
-  "List of regexps matching username prompts of Git and its subprocesses."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-process
-  :type '(repeat (regexp)))
-
-(defcustom magit-process-ensure-unix-line-ending t
-  "Whether Magit should ensure a unix coding system when talking to Git."
-  :package-version '(magit . "2.6.0")
-  :group 'magit-process
-  :type 'boolean)
-
-(defface magit-process-ok
-  '((t :inherit magit-section-heading :foreground "green"))
-  "Face for zero exit-status."
-  :group 'magit-faces)
-
-(defface magit-process-ng
-  '((t :inherit magit-section-heading :foreground "red"))
-  "Face for non-zero exit-status."
-  :group 'magit-faces)
-
-;;; Process Mode
-
-(defvar magit-process-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-mode-map)
-    map)
-  "Keymap for `magit-process-mode'.")
-
-(define-derived-mode magit-process-mode magit-mode "Magit Process"
-  "Mode for looking at Git process output."
-  :group 'magit-process
-  (hack-dir-local-variables-non-file-buffer)
-  (setq imenu-prev-index-position-function
-        'magit-imenu--process-prev-index-position-function)
-  (setq imenu-extract-index-name-function
-        'magit-imenu--process-extract-index-name-function))
-
-(defun magit-process-buffer (&optional nodisplay)
-  "Display the current repository's process buffer.
-
-If that buffer doesn't exist yet, then create it.
-Non-interactively return the buffer and unless
-optional NODISPLAY is non-nil also display it."
-  (interactive)
-  (let ((topdir (magit-toplevel)))
-    (unless topdir
-      (magit--with-safe-default-directory nil
-        (setq topdir default-directory)
-        (let (prev)
-          (while (not (equal topdir prev))
-            (setq prev topdir)
-            (setq topdir (file-name-directory (directory-file-name topdir)))))))
-    (let ((buffer (or (--first (with-current-buffer it
-                                 (and (eq major-mode 'magit-process-mode)
-                                      (equal default-directory topdir)))
-                               (buffer-list))
-                      (let ((default-directory topdir))
-                        (magit-generate-new-buffer 'magit-process-mode)))))
-      (with-current-buffer buffer
-        (if magit-root-section
-            (when magit-process-log-max
-              (magit-process-truncate-log))
-          (magit-process-mode)
-          (let ((inhibit-read-only t)
-                (magit-insert-section--parent  nil)
-                (magit-insert-section--oldroot nil))
-            (make-local-variable 'text-property-default-nonsticky)
-            (magit-insert-section (processbuf)
-              (insert "\n")))))
-      (unless nodisplay
-        (magit-display-buffer buffer))
-      buffer)))
-
-(defun magit-process-kill ()
-  "Kill the process at point."
-  (interactive)
-  (magit-section-when process
-    (let ((process (magit-section-value it)))
-      (if (eq (process-status process) 'run)
-          (when (magit-confirm 'kill-process)
-            (kill-process process))
-        (user-error "Process isn't running")))))
-
-;;; Synchronous Processes
-
-(defvar magit-process-raise-error nil)
-
-(defun magit-git (&rest args)
-  "Call Git synchronously in a separate process, for side-effects.
-
-Option `magit-git-executable' specifies the Git executable.
-The arguments ARGS specify arguments to Git, they are flattened
-before use.
-
-Process output goes into a new section in the buffer returned by
-`magit-process-buffer'.  If Git exits with a non-zero status,
-then raise an error."
-  (let ((magit-process-raise-error t))
-    (magit-call-git args)))
-
-(defun magit-run-git (&rest args)
-  "Call Git synchronously in a separate process, and refresh.
-
-Option `magit-git-executable' specifies the Git executable and
-option `magit-git-global-arguments' specifies constant arguments.
-The arguments ARGS specify arguments to Git, they are flattened
-before use.
-
-After Git returns, the current buffer (if it is a Magit buffer)
-as well as the current repository's status buffer are refreshed.
-
-Process output goes into a new section in the buffer returned by
-`magit-process-buffer'."
-  (let ((magit--refresh-cache (list (cons 0 0))))
-    (magit-call-git args)
-    (magit-refresh)))
-
-(defvar magit-pre-call-git-hook nil)
-
-(defun magit-call-git (&rest args)
-  "Call Git synchronously in a separate process.
-
-Option `magit-git-executable' specifies the Git executable and
-option `magit-git-global-arguments' specifies constant arguments.
-The arguments ARGS specify arguments to Git, they are flattened
-before use.
-
-Process output goes into a new section in the buffer returned by
-`magit-process-buffer'."
-  (run-hooks 'magit-pre-call-git-hook)
-  (let ((default-process-coding-system (magit--process-coding-system)))
-    (apply #'magit-call-process magit-git-executable
-           (magit-process-git-arguments args))))
-
-(defun magit-call-process (program &rest args)
-  "Call PROGRAM synchronously in a separate process.
-Process output goes into a new section in the buffer returned by
-`magit-process-buffer'."
-  (-let [(process-buf . section) (magit-process-setup program args)]
-    (magit-process-finish
-     (let ((inhibit-read-only t))
-       (apply #'magit-process-file program nil process-buf nil args))
-     process-buf (current-buffer) default-directory section)))
-
-(defun magit-process-file (&rest args)
-  "Process files synchronously in a separate process.
-Identical to `process-file' but temporarily enable Cygwin's
-\"noglob\" option during the call and ensure unix eol
-conversion."
-  (let ((process-environment (append (magit-cygwin-env-vars)
-                                     process-environment))
-        (default-process-coding-system (magit--process-coding-system)))
-    (apply #'process-file args)))
-
-(defun magit-cygwin-env-vars ()
-  (append magit-git-environment
-          (and magit-need-cygwin-noglob
-               (mapcar (lambda (var)
-                         (concat var "=" (--if-let (getenv var)
-                                             (concat it " noglob")
-                                           "noglob")))
-                       '("CYGWIN" "MSYS")))))
-
-(defvar magit-this-process nil)
-
-(defun magit-run-git-with-input (&rest args)
-  "Call Git in a separate process.
-ARGS is flattened and then used as arguments to Git.
-
-The current buffer's content is used as the process' standard
-input.
-
-Option `magit-git-executable' specifies the Git executable and
-option `magit-git-global-arguments' specifies constant arguments.
-The remaining arguments ARGS specify arguments to Git, they are
-flattened before use."
-  (declare (indent 1))
-  (if (file-remote-p default-directory)
-      ;; We lack `process-file-region', so fall back to asynch +
-      ;; waiting in remote case.
-      (progn
-        (magit-start-git (current-buffer) args)
-        (while (and magit-this-process
-                    (eq (process-status magit-this-process) 'run))
-          (sleep-for 0.005)))
-    (run-hooks 'magit-pre-call-git-hook)
-    (-let* ((process-environment (append (magit-cygwin-env-vars)
-                                         process-environment))
-            (default-process-coding-system (magit--process-coding-system))
-            (flat-args (magit-process-git-arguments args))
-            ((process-buf . section)
-             (magit-process-setup magit-git-executable flat-args))
-            (inhibit-read-only t))
-      (magit-process-finish
-       (apply #'call-process-region (point-min) (point-max)
-              magit-git-executable nil process-buf nil flat-args)
-       process-buf nil default-directory section))))
-
-(defun magit-run-git-with-logfile (file &rest args)
-  "Call Git in a separate process and log its output to FILE.
-This function might have a short halflive."
-  (apply #'magit-process-file magit-git-executable nil `(:file ,file) nil
-         (magit-process-git-arguments args))
-  (magit-refresh))
-
-;;; Asynchronous Processes
-
-(defun magit-run-git-async (&rest args)
-  "Start Git, prepare for refresh, and return the process object.
-ARGS is flattened and then used as arguments to Git.
-
-Display the command line arguments in the echo area.
-
-After Git returns some buffers are refreshed: the buffer that was
-current when this function was called (if it is a Magit buffer
-and still alive), as well as the respective Magit status buffer.
-
-See `magit-start-process' for more information."
-  (message "Running %s %s" magit-git-executable
-           (let ((m (mapconcat #'identity (-flatten args) " ")))
-             (remove-list-of-text-properties 0 (length m) '(face) m)
-             m))
-  (magit-start-git nil args))
-
-(defun magit-run-git-with-editor (&rest args)
-  "Export GIT_EDITOR and start Git.
-Also prepare for refresh and return the process object.
-ARGS is flattened and then used as arguments to Git.
-
-Display the command line arguments in the echo area.
-
-After Git returns some buffers are refreshed: the buffer that was
-current when this function was called (if it is a Magit buffer
-and still alive), as well as the respective Magit status buffer.
-
-See `magit-start-process' and `with-editor' for more information."
-  (magit--record-separated-gitdir)
-  (magit-with-editor (magit-run-git-async args)))
-
-(defun magit-run-git-sequencer (&rest args)
-  "Export GIT_EDITOR and start Git.
-Also prepare for refresh and return the process object.
-ARGS is flattened and then used as arguments to Git.
-
-Display the command line arguments in the echo area.
-
-After Git returns some buffers are refreshed: the buffer that was
-current when this function was called (if it is a Magit buffer
-and still alive), as well as the respective Magit status buffer.
-If the sequence stops at a commit, make the section representing
-that commit the current section by moving `point' there.
-
-See `magit-start-process' and `with-editor' for more information."
-  (apply #'magit-run-git-with-editor args)
-  (set-process-sentinel magit-this-process #'magit-sequencer-process-sentinel)
-  magit-this-process)
-
-(defvar magit-pre-start-git-hook nil)
-
-(defun magit-start-git (input &rest args)
-  "Start Git, prepare for refresh, and return the process object.
-
-If INPUT is non-nil, it has to be a buffer or the name of an
-existing buffer.  The buffer content becomes the processes
-standard input.
-
-Option `magit-git-executable' specifies the Git executable and
-option `magit-git-global-arguments' specifies constant arguments.
-The remaining arguments ARGS specify arguments to Git, they are
-flattened before use.
-
-After Git returns some buffers are refreshed: the buffer that was
-current when this function was called (if it is a Magit buffer
-and still alive), as well as the respective Magit status buffer.
-
-See `magit-start-process' for more information."
-  (run-hooks 'magit-pre-start-git-hook)
-  (let ((default-process-coding-system (magit--process-coding-system)))
-    (apply #'magit-start-process magit-git-executable input
-           (magit-process-git-arguments args))))
-
-(defun magit-start-process (program &optional input &rest args)
-  "Start PROGRAM, prepare for refresh, and return the process object.
-
-If optional argument INPUT is non-nil, it has to be a buffer or
-the name of an existing buffer.  The buffer content becomes the
-processes standard input.
-
-The process is started using `start-file-process' and then setup
-to use the sentinel `magit-process-sentinel' and the filter
-`magit-process-filter'.  Information required by these functions
-is stored in the process object.  When this function returns the
-process has not started to run yet so it is possible to override
-the sentinel and filter.
-
-After the process returns, `magit-process-sentinel' refreshes the
-buffer that was current when `magit-start-process' was called (if
-it is a Magit buffer and still alive), as well as the respective
-Magit status buffer."
-  (-let* (((process-buf . section)
-           (magit-process-setup program args))
-          (process
-           (let ((process-connection-type
-                  ;; Don't use a pty, because it would set icrnl
-                  ;; which would modify the input (issue #20).
-                  (and (not input) magit-process-connection-type))
-                 (process-environment (append (magit-cygwin-env-vars)
-                                              process-environment))
-                 (default-process-coding-system (magit--process-coding-system)))
-             (apply #'start-file-process
-                    (file-name-nondirectory program)
-                    process-buf program args))))
-    (with-editor-set-process-filter process #'magit-process-filter)
-    (set-process-sentinel process #'magit-process-sentinel)
-    (set-process-buffer   process process-buf)
-    (process-put process 'section section)
-    (process-put process 'command-buf (current-buffer))
-    (process-put process 'default-dir default-directory)
-    (when inhibit-magit-refresh
-      (process-put process 'inhibit-refresh t))
-    (setf (magit-section-process section) process)
-    (with-current-buffer process-buf
-      (set-marker (process-mark process) (point)))
-    (when input
-      (with-current-buffer input
-        (process-send-region process (point-min) (point-max))
-        (process-send-eof    process)))
-    (setq magit-this-process process)
-    (setf (magit-section-value section) process)
-    (magit-process-display-buffer process)
-    process))
-
-;;; Process Internals
-
-(defun magit-process-setup (program args)
-  (magit-process-set-mode-line program args)
-  (let ((pwd default-directory)
-        (buf (magit-process-buffer t)))
-    (cons buf (with-current-buffer buf
-                (prog1 (magit-process-insert-section pwd program args nil nil)
-                  (backward-char 1))))))
-
-(defun magit-process-insert-section (pwd program args &optional errcode errlog)
-  (let ((inhibit-read-only t)
-        (magit-insert-section--parent magit-root-section)
-        (magit-insert-section--oldroot nil))
-    (goto-char (1- (point-max)))
-    (magit-insert-section (process)
-      (insert (if errcode
-                  (format "%3s " (propertize (number-to-string errcode)
-                                             'face 'magit-process-ng))
-                "run "))
-      (unless (equal (expand-file-name pwd)
-                     (expand-file-name default-directory))
-        (insert (file-relative-name pwd default-directory) ?\s))
-      (cond
-       ((and args (equal program magit-git-executable))
-        (setq args (-split-at (length magit-git-global-arguments) args))
-        (insert (propertize program 'face 'magit-section-heading) " ")
-        (insert (propertize (char-to-string magit-ellipsis)
-                            'face 'magit-section-heading
-                            'help-echo (mapconcat #'identity (car args) " ")))
-        (insert " ")
-        (insert (propertize (mapconcat #'shell-quote-argument (cadr args) " ")
-                            'face 'magit-section-heading)))
-       ((and args (equal program shell-file-name))
-        (insert (propertize (cadr args) 'face 'magit-section-heading)))
-       (t
-        (insert (propertize program 'face 'magit-section-heading) " ")
-        (insert (propertize (mapconcat #'shell-quote-argument args " ")
-                            'face 'magit-section-heading))))
-      (magit-insert-heading)
-      (when errlog
-        (insert-file-contents errlog)
-        (goto-char (1- (point-max))))
-      (insert "\n"))))
-
-(defun magit-process-truncate-log ()
-  (let* ((head nil)
-         (tail (magit-section-children magit-root-section))
-         (count (length tail)))
-    (when (> (1+ count) magit-process-log-max)
-      (while (and (cdr tail)
-                  (> count (/ magit-process-log-max 2)))
-        (let* ((inhibit-read-only t)
-               (section (car tail))
-               (process (magit-section-process section)))
-          (cond ((not process))
-                ((memq (process-status process) '(exit signal))
-                 (delete-region (magit-section-start section)
-                                (1+ (magit-section-end section)))
-                 (cl-decf count))
-                (t
-                 (push section head))))
-        (pop tail))
-      (setf (magit-section-children magit-root-section)
-            (nconc (reverse head) tail)))))
-
-(defun magit-process-sentinel (process event)
-  "Default sentinel used by `magit-start-process'."
-  (when (memq (process-status process) '(exit signal))
-    (setq event (substring event 0 -1))
-    (when (string-match "^finished" event)
-      (message (concat (capitalize (process-name process)) " finished")))
-    (magit-process-finish process)
-    (when (eq process magit-this-process)
-      (setq magit-this-process nil))
-    (unless (process-get process 'inhibit-refresh)
-      (let ((command-buf (process-get process 'command-buf)))
-        (if (buffer-live-p command-buf)
-            (with-current-buffer command-buf
-              (magit-refresh))
-          (with-temp-buffer
-            (setq default-directory (process-get process 'default-dir))
-            (magit-refresh)))))))
-
-(defun magit-sequencer-process-sentinel (process event)
-  "Special sentinel used by `magit-run-git-sequencer'."
-  (when (memq (process-status process) '(exit signal))
-    (magit-process-sentinel process event)
-    (-when-let (process-buf (process-buffer process))
-      (when (buffer-live-p process-buf)
-        (-when-let (status-buf (with-current-buffer process-buf
-                                 (magit-mode-get-buffer 'magit-status-mode)))
-          (with-current-buffer status-buf
-            (--when-let
-                (magit-get-section
-                 `((commit . ,(magit-rev-parse "HEAD"))
-                   (,(pcase (car (cadr (-split-at
-                                        (1+ (length magit-git-global-arguments))
-                                        (process-command process))))
-                       ((or "rebase" "am")   'rebase-sequence)
-                       ((or "cherry-pick" "revert") 'sequence)))
-                   (status)))
-              (goto-char (magit-section-start it))
-              (magit-section-update-highlight))))))))
-
-(defun magit-process-filter (proc string)
-  "Default filter used by `magit-start-process'."
-  (with-current-buffer (process-buffer proc)
-    (let ((inhibit-read-only t))
-      (magit-process-yes-or-no-prompt proc string)
-      (magit-process-username-prompt  proc string)
-      (magit-process-password-prompt  proc string)
-      (goto-char (process-mark proc))
-      (setq string (propertize string 'magit-section
-                               (process-get proc 'section)))
-      ;; Find last ^M in string.  If one was found, ignore
-      ;; everything before it and delete the current line.
-      (let ((ret-pos (length string)))
-        (while (and (>= (cl-decf ret-pos) 0)
-                    (/= ?\r (aref string ret-pos))))
-        (if (< ret-pos 0)
-            (insert string)
-          (delete-region (line-beginning-position) (point))
-          (insert (substring string (1+ ret-pos)))))
-      (set-marker (process-mark proc) (point)))))
-
-(defmacro magit-process-kill-on-abort (proc &rest body)
-  (declare (indent 1) (debug (form body)))
-  (let ((map (cl-gensym)))
-    `(let ((,map (make-sparse-keymap)))
-       (set-keymap-parent ,map minibuffer-local-map)
-       (define-key ,map "\C-g"
-         (lambda ()
-           (interactive)
-           (ignore-errors (kill-process ,proc))
-           (abort-recursive-edit)))
-       (let ((minibuffer-local-map ,map))
-         ,@body))))
-
-(defun magit-process-yes-or-no-prompt (process string)
-  "Forward Yes-or-No prompts to the user."
-  (-when-let (beg (string-match magit-process-yes-or-no-prompt-regexp string))
-    (let ((max-mini-window-height 30))
-      (process-send-string
-       process
-       (downcase
-        (concat
-         (match-string
-          (if (save-match-data
-                (magit-process-kill-on-abort process
-                  (yes-or-no-p (substring string 0 beg)))) 1 2)
-          string)
-         "\n"))))))
-
-(defun magit-process-password-auth-source (key)
-  "Use `auth-source-search' to get a password.
-If found, return the password.  Otherwise, return nil."
-  (require 'auth-source)
-  (let ((secret (plist-get (car (auth-source-search :max 1 :host key
-                                                    :require '(:host)))
-                           :secret)))
-    (if (functionp secret)
-        (funcall secret)
-      secret)))
-
-(defun magit-process-password-prompt (process string)
-  "Find a password based on prompt STRING and send it to git.
-First try the functions in `magit-process-find-password-functions'.
-If none of them returns a password, then read it from the user
-instead."
-  (--when-let (magit-process-match-prompt
-               magit-process-password-prompt-regexps string)
-    (process-send-string
-     process (magit-process-kill-on-abort process
-               (concat (or (--when-let (match-string 99 string)
-                             (run-hook-with-args-until-success
-                              'magit-process-find-password-functions it))
-                           (read-passwd it))
-                       "\n")))))
-
-(defun magit-process-username-prompt (process string)
-  "Forward username prompts to the user."
-  (--when-let (magit-process-match-prompt
-               magit-process-username-prompt-regexps string)
-    (process-send-string
-     process (magit-process-kill-on-abort process
-               (concat (read-string it nil nil (user-login-name)) "\n")))))
-
-(defun magit-process-match-prompt (prompts string)
-  "Match STRING against PROMPTS and set match data.
-Return the matched string suffixed with \": \", if needed."
-  (when (--any-p (string-match it string) prompts)
-    (let ((prompt (match-string 0 string)))
-      (cond ((string-suffix-p ": " prompt) prompt)
-            ((string-suffix-p ":"  prompt) (concat prompt " "))
-            (t                             (concat prompt ": "))))))
-
-(defun magit--process-coding-system ()
-  (let ((fro (or magit-git-output-coding-system
-                 (car default-process-coding-system)))
-        (to (cdr default-process-coding-system)))
-    (if magit-process-ensure-unix-line-ending
-        (cons (coding-system-change-eol-conversion fro 'unix)
-              (coding-system-change-eol-conversion to 'unix))
-      (cons fro to))))
-
-(defvar magit-credential-hook nil
-  "Hook run before Git needs credentials.")
-
-(defvar magit-credential-cache-daemon-process nil)
-
-(defun magit-maybe-start-credential-cache-daemon ()
-  "Maybe start a `git-credential-cache--daemon' process.
-
-If such a process is already running or if the value of option
-`magit-credential-cache-daemon-socket' is nil, then do nothing.
-Otherwise start the process passing the value of that options
-as argument."
-  (unless (or (not magit-credential-cache-daemon-socket)
-              (process-live-p magit-credential-cache-daemon-process)
-              (memq magit-credential-cache-daemon-process
-                    (list-system-processes)))
-    (setq magit-credential-cache-daemon-process
-          (or (--first (-let (((&alist 'comm comm 'user user)
-                               (process-attributes it)))
-                         (and (string= comm "git-credential-cache--daemon")
-                              (string= user user-login-name)))
-                       (list-system-processes))
-              (condition-case nil
-                  (start-process "git-credential-cache--daemon"
-                                 " *git-credential-cache--daemon*"
-                                 magit-git-executable
-                                 "credential-cache--daemon"
-                                 magit-credential-cache-daemon-socket)
-                ;; Some Git implementations (e.g. Windows) won't have
-                ;; this program; if we fail the first time, stop trying.
-                ((debug error)
-                 (remove-hook 'magit-credential-hook
-                              #'magit-maybe-start-credential-cache-daemon)))))))
-
-(add-hook 'magit-credential-hook #'magit-maybe-start-credential-cache-daemon)
-
-(defun tramp-sh-handle-start-file-process--magit-tramp-process-environment
-    (fn name buffer program &rest args)
-  (if magit-tramp-process-environment
-      (apply fn name buffer
-             (car magit-tramp-process-environment)
-             (append (cdr magit-tramp-process-environment)
-                     (cons program args)))
-    (apply fn name buffer program args)))
-
-(advice-add 'tramp-sh-handle-start-file-process :around
-            'tramp-sh-handle-start-file-process--magit-tramp-process-environment)
-
-(defun tramp-sh-handle-process-file--magit-tramp-process-environment
-    (fn program &optional infile destination display &rest args)
-  (if magit-tramp-process-environment
-      (apply fn "env" infile destination display
-             (append magit-tramp-process-environment
-                     (cons program args)))
-    (apply fn program infile destination display args)))
-
-(advice-add 'tramp-sh-handle-process-file :around
-            'tramp-sh-handle-process-file--magit-tramp-process-environment)
-
-(defun magit-process-set-mode-line (program args)
-  (when (equal program magit-git-executable)
-    (setq args (nthcdr (length magit-git-global-arguments) args)))
-  (let ((str (concat " " program (and args (concat " " (car args))))))
-    (dolist (buf (magit-mode-get-buffers))
-      (with-current-buffer buf (setq mode-line-process str)))))
-
-(defun magit-process-unset-mode-line ()
-  (dolist (buf (magit-mode-get-buffers))
-    (with-current-buffer buf (setq mode-line-process nil))))
-
-(defvar magit-process-error-message-re
-  (concat "^\\(?:error\\|fatal\\|git\\): \\(.*\\)" paragraph-separate))
-
-(define-error 'magit-git-error "Git error")
-
-(defvar-local magit-this-error nil)
-
-(defun magit-process-finish (arg &optional process-buf command-buf
-                                 default-dir section)
-  (unless (integerp arg)
-    (setq process-buf (process-buffer arg))
-    (setq command-buf (process-get arg 'command-buf))
-    (setq default-dir (process-get arg 'default-dir))
-    (setq section     (process-get arg 'section))
-    (setq arg         (process-exit-status arg)))
-  (when (featurep 'dired)
-    (dired-uncache default-dir))
-  (when (buffer-live-p process-buf)
-    (with-current-buffer process-buf
-      (magit-process-unset-mode-line)
-      (let ((inhibit-read-only t)
-            (marker (magit-section-start section)))
-        (goto-char marker)
-        (save-excursion
-          (delete-char 3)
-          (set-marker-insertion-type marker nil)
-          (insert (propertize (format "%3s" arg)
-                              'magit-section section
-                              'face (if (= arg 0)
-                                        'magit-process-ok
-                                      'magit-process-ng)))
-          (set-marker-insertion-type marker t))
-        (if (= (magit-section-end section)
-               (+ (line-end-position) 2))
-            (save-excursion
-              (goto-char (1+ (line-end-position)))
-              (delete-char -1)
-              (setf (magit-section-content section) nil))
-          (let ((buf (magit-process-buffer t)))
-            (when (and (= arg 0)
-                       (not (--any-p (eq (window-buffer it) buf)
-                                     (window-list))))
-              (magit-section-hide section)))))))
-  (unless (= arg 0)
-    (let ((msg (or (and (buffer-live-p process-buf)
-                        (with-current-buffer process-buf
-                          (save-excursion
-                            (goto-char (magit-section-end section))
-                            (--when-let (magit-section-content section)
-                              (when (re-search-backward
-                                     magit-process-error-message-re it t)
-                                (match-string-no-properties 1))))))
-                   "Git failed")))
-      (if magit-process-raise-error
-          (signal 'magit-git-error (list (format "%s (in %s)" msg default-dir)))
-        (when (buffer-live-p process-buf)
-          (with-current-buffer process-buf
-            (-when-let (status-buf (magit-mode-get-buffer 'magit-status-mode))
-              (with-current-buffer status-buf
-                (setq magit-this-error msg)))))
-        (message "%s ... [%s buffer %s for details]" msg
-                 (-if-let (key (and (buffer-live-p command-buf)
-                                    (with-current-buffer command-buf
-                                      (car (where-is-internal
-                                            'magit-process-buffer)))))
-                     (format "Hit %s to see" (key-description key))
-                   "See")
-                 (buffer-name process-buf)))))
-  arg)
-
-(defun magit-process-display-buffer (process)
-  (when (process-live-p process)
-    (let ((buf (process-buffer process)))
-      (cond ((not (buffer-live-p buf)))
-            ((= magit-process-popup-time 0)
-             (if (minibufferp)
-                 (switch-to-buffer-other-window buf)
-               (pop-to-buffer buf)))
-            ((> magit-process-popup-time 0)
-             (run-with-timer magit-process-popup-time nil
-                             (lambda (p)
-                               (when (eq (process-status p) 'run)
-                                 (let ((buf (process-buffer p)))
-                                   (when (buffer-live-p buf)
-                                     (if (minibufferp)
-                                         (switch-to-buffer-other-window buf)
-                                       (pop-to-buffer buf))))))
-                             process))))))
-
-(provide 'magit-process)
-;;; magit-process.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-process.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-refs.el
@@ -1,582 +0,0 @@
-;;; magit-refs.el --- listing references  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements support for listing references in a buffer.
-
-;;; Code:
-
-(require 'magit)
-
-(defvar bookmark-make-record-function)
-
-;;; Options
-
-(defgroup magit-refs nil
-  "Inspect and manipulate Git branches and tags."
-  :link '(info-link "(magit)References Buffer")
-  :group 'magit-modes)
-
-(defcustom magit-refs-mode-hook nil
-  "Hook run after entering Magit-Refs mode."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-refs
-  :type 'hook)
-
-(defcustom magit-refs-sections-hook
-  '(magit-insert-error-header
-    magit-insert-branch-description
-    magit-insert-local-branches
-    magit-insert-remote-branches
-    magit-insert-tags)
-  "Hook run to insert sections into a references buffer."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-refs
-  :type 'hook)
-
-(defcustom magit-refs-show-commit-count nil
-  "Whether to show commit counts in Magit-Refs mode buffers.
-
-all    Show counts for branches and tags.
-branch Show counts for branches only.
-nil    Never show counts.
-
-To change the value in an existing buffer use the command
-`magit-refs-show-commit-count'"
-  :package-version '(magit . "2.1.0")
-  :group 'magit-refs
-  :safe (lambda (val) (memq val '(all branch nil)))
-  :type '(choice (const all    :tag "For branches and tags")
-                 (const branch :tag "For branches only")
-                 (const nil    :tag "Never")))
-(put 'magit-refs-show-commit-count 'safe-local-variable 'symbolp)
-(put 'magit-refs-show-commit-count 'permanent-local t)
-
-(defcustom magit-refs-margin
-  (list nil
-        (nth 1 magit-log-margin)
-        'magit-log-margin-width nil
-        (nth 4 magit-log-margin))
-  "Format of the margin in `magit-refs-mode' buffers.
-
-The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH).
-
-If INIT is non-nil, then the margin is shown initially.
-STYLE controls how to format the committer date.  It can be one
-  of `age' (to show the age of the commit), `age-abbreviated' (to
-  abbreviate the time unit to a character), or a string (suitable
-  for `format-time-string') to show the actual date.
-WIDTH controls the width of the margin.  This exists for forward
-  compatibility and currently the value should not be changed.
-AUTHOR controls whether the name of the author is also shown by
-  default.
-AUTHOR-WIDTH has to be an integer.  When the name of the author
-  is shown, then this specifies how much space is used to do so."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-refs
-  :group 'magit-margin
-  :safe (lambda (val) (memq val '(all branch nil)))
-  :type magit-log-margin--custom-type
-  :initialize 'magit-custom-initialize-reset
-  :set-after '(magit-log-margin)
-  :set (apply-partially #'magit-margin-set-variable 'magit-refs-mode))
-
-(defcustom magit-refs-margin-for-tags nil
-  "Whether to show information about tags in the margin.
-
-This is disabled by default because it is slow if there are many
-tags."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-refs
-  :group 'magit-margin
-  :type 'boolean)
-
-(defcustom magit-visit-ref-behavior nil
-  "Control how `magit-visit-ref' behaves in `magit-refs-mode' buffers.
-
-By default `magit-visit-ref' behaves like `magit-show-commit',
-in all buffers, including `magit-refs-mode' buffers.  When the
-type of the section at point is `commit' then \"RET\" is bound to
-`magit-show-commit', and when the type is either `branch' or
-`tag' then it is bound to `magit-visit-ref'.
-
-\"RET\" is one of Magit's most essential keys and at least by
-default it should behave consistently across all of Magit,
-especially because users quickly learn that it does something
-very harmless; it shows more information about the thing at point
-in another buffer.
-
-However \"RET\" used to behave differently in `magit-refs-mode'
-buffers, doing surprising things, some of which cannot really be
-described as \"visit this thing\".  If you have grown accustomed
-to such inconsistent, but to you useful, behavior, then you can
-restore that by adding one or more of the below symbols to the
-value of this option.  But keep in mind that by doing so you
-don't only introduce inconsistencies, you also lose some
-functionality and might have to resort to `M-x magit-show-commit'
-to get it back.
-
-`magit-visit-ref' looks for these symbols in the order in which
-they are described here.  If the presence of a symbol applies to
-the current situation, then the symbols that follow do not affect
-the outcome.
-
-`focus-on-ref'
-
-  With a prefix argument update the buffer to show commit counts
-  and lists of cherry commits relative to the reference at point
-  instead of relative to the current buffer or `HEAD'.
-
-  Instead of adding this symbol, consider pressing \"C-u y o RET\".
-
-`create-branch'
-
-  If point is on a remote branch, then create a new local branch
-  with the same name, use the remote branch as its upstream, and
-  then check out the local branch.
-
-  Instead of adding this symbol, consider pressing \"b c RET RET\",
-  like you would do in other buffers.
-
-`checkout-any'
-
-  Check out the reference at point.  If that reference is a tag
-  or a remote branch, then this results in a detached `HEAD'.
-
-  Instead of adding this symbol, consider pressing \"b b RET\",
-  like you would do in other buffers.
-
-`checkout-branch'
-
-  Check out the local branch at point.
-
-  Instead of adding this symbol, consider pressing \"b b RET\",
-  like you would do in other buffers."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-refs
-  :group 'magit-commands
-  :options '(focus-on-ref create-branch checkout-any checkout-branch)
-  :type '(list :convert-widget custom-hook-convert-widget))
-
-;;; Mode
-
-(defvar magit-refs-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-mode-map)
-    (define-key map "\C-y" 'magit-refs-set-show-commit-count)
-    (define-key map "L"    'magit-margin-popup)
-    map)
-  "Keymap for `magit-refs-mode'.")
-
-(define-derived-mode magit-refs-mode magit-mode "Magit Refs"
-  "Mode which lists and compares references.
-
-This mode is documented in info node `(magit)References Buffer'.
-
-\\<magit-mode-map>\
-Type \\[magit-refresh] to refresh the current buffer.
-Type \\[magit-section-toggle] to expand or hide the section at point.
-Type \\[magit-visit-thing] or \\[magit-diff-show-or-scroll-up] \
-to visit the commit or branch at point.
-
-Type \\[magit-branch-popup] to see available branch commands.
-Type \\[magit-merge-popup] to merge the branch or commit at point.
-Type \\[magit-cherry-pick-popup] to apply the commit at point.
-Type \\[magit-reset] to reset `HEAD' to the commit at point.
-
-\\{magit-refs-mode-map}"
-  :group 'magit-refs
-  (hack-dir-local-variables-non-file-buffer)
-  (setq imenu-create-index-function
-        #'magit-imenu--refs-create-index-function)
-  (setq-local bookmark-make-record-function
-              #'magit-bookmark--refs-make-record))
-
-(defun magit-refs-refresh-buffer (&rest _ignore)
-  (setq magit-set-buffer-margin-refresh (not (magit-buffer-margin-p)))
-  (unless (magit-rev-verify (or (car magit-refresh-args) "HEAD"))
-    (setq magit-refs-show-commit-count nil))
-  (magit-insert-section (branchbuf)
-    (run-hooks 'magit-refs-sections-hook)))
-
-;;; Commands
-
-;;;###autoload (autoload 'magit-show-refs-popup "magit" nil t)
-(magit-define-popup magit-show-refs-popup
-  "Popup console for `magit-show-refs'."
-  :man-page "git-branch"
-  :switches '((?m "Merged to HEAD"            "--merged")
-              (?M "Merged to master"          "--merged=master")
-              (?n "Not merged to HEAD"        "--no-merged")
-              (?N "Not merged to master"      "--no-merged=master"))
-  :options  '((?c "Contains"   "--contains="  magit-read-branch-or-commit)
-              (?m "Merged"     "--merged="    magit-read-branch-or-commit)
-              (?n "Not merged" "--no-merged=" magit-read-branch-or-commit)
-              (?s "Sort"       "--sort="      magit-read-ref-sort))
-  :actions  '((?y "Show refs, comparing them with HEAD"
-                  magit-show-refs-head)
-              (?c "Show refs, comparing them with current branch"
-                  magit-show-refs-current)
-              (?o "Show refs, comparing them with other branch"
-                  magit-show-refs))
-  :default-action 'magit-show-refs-head
-  :use-prefix 'popup)
-
-(defun magit-read-ref-sort (prompt initial-input)
-  (magit-completing-read prompt
-                         '("-committerdate" "-authordate"
-                           "committerdate" "authordate")
-                         nil nil initial-input))
-
-;;;###autoload
-(defun magit-show-refs-head (&optional args)
-  "List and compare references in a dedicated buffer.
-Refs are compared with `HEAD'."
-  (interactive (list (magit-show-refs-arguments)))
-  (magit-show-refs nil args))
-
-;;;###autoload
-(defun magit-show-refs-current (&optional args)
-  "List and compare references in a dedicated buffer.
-Refs are compared with the current branch or `HEAD' if
-it is detached."
-  (interactive (list (magit-show-refs-arguments)))
-  (magit-show-refs (magit-get-current-branch) args))
-
-;;;###autoload
-(defun magit-show-refs (&optional ref args)
-  "List and compare references in a dedicated buffer.
-Refs are compared with a branch read from the user."
-  (interactive (list (magit-read-other-branch "Compare with")
-                     (magit-show-refs-arguments)))
-  (magit-mode-setup #'magit-refs-mode ref args))
-
-(defun magit-refs-set-show-commit-count ()
-  "Change for which refs the commit count is shown."
-  (interactive)
-  (setq-local magit-refs-show-commit-count
-              (magit-read-char-case "Show commit counts for " nil
-                (?a "[a]ll refs" 'all)
-                (?b "[b]ranches only" t)
-                (?n "[n]othing" nil)))
-  (magit-refresh))
-
-(defun magit-visit-ref ()
-  "Visit the reference or revision at point in another buffer.
-If there is no revision at point or with a prefix argument prompt
-for a revision.
-
-This command behaves just like `magit-show-commit', except if
-point is on a reference in a `magit-refs-mode' buffer (a buffer
-listing branches and tags), in which case the behavior may be
-different, but only if you have customized the option
-`magit-visit-ref-behavior' (which see)."
-  (interactive)
-  (if (and (derived-mode-p 'magit-refs-mode)
-           (magit-section-match '(branch tag)))
-      (let ((ref (magit-section-value (magit-current-section))))
-        (cond ((and (memq 'focus-on-ref magit-visit-ref-behavior)
-                    current-prefix-arg)
-               (magit-show-refs ref))
-              ((and (memq 'create-branch magit-visit-ref-behavior)
-                    (magit-section-match [branch remote]))
-               (let ((branch (cdr (magit-split-branch-name ref))))
-                 (if (magit-branch-p branch)
-                     (if (yes-or-no-p
-                          (format "Branch %s already exists.  Reset it to %s?"
-                                  branch ref))
-                         (magit-call-git "checkout" "-B" branch ref)
-                       (user-error "Abort"))
-                   (magit-call-git "checkout" "-b" branch ref))
-                 (setcar magit-refresh-args branch)
-                 (magit-refresh)))
-              ((or (memq 'checkout-any magit-visit-ref-behavior)
-                   (and (memq 'checkout-branch magit-visit-ref-behavior)
-                        (magit-section-match [branch local])))
-               (magit-call-git "checkout" ref)
-               (setcar magit-refresh-args ref)
-               (magit-refresh))
-              (t
-               (call-interactively #'magit-show-commit))))
-    (call-interactively #'magit-show-commit)))
-
-;;; Sections
-;;;; Section Keymaps
-
-(defvar magit-branch-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-visit-thing]  'magit-visit-ref)
-    (define-key map [remap magit-delete-thing] 'magit-branch-delete)
-    (define-key map "R"                        'magit-branch-rename)
-    map)
-  "Keymap for `branch' sections.")
-
-(defvar magit-remote-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-delete-thing] 'magit-remote-remove)
-    (define-key map "R"                        'magit-remote-rename)
-    map)
-  "Keymap for `remote' sections.")
-
-(defvar magit-tag-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-visit-thing]  'magit-visit-ref)
-    (define-key map [remap magit-delete-thing] 'magit-tag-delete)
-    map)
-  "Keymap for `tag' sections.")
-
-;;;; Section Variables
-
-(defconst magit-refs-branch-line-re
-  (concat "^"
-          "\\(?:[ \\*]\\) "
-          "\\(?1:([^)]+)\\|[^ ]+?\\)"       ; branch
-          "\\(?: +\\)"
-          "\\(?2:[0-9a-fA-F]+\\) "          ; sha1
-          "\\(?:\\["
-          "\\(?4:[^:]+\\)"                  ; upstream
-          "\\(?:: \\(?:"
-          "\\(?7:gone\\)\\|"                ; gone
-          "\\(?:ahead \\(?5:[0-9]+\\)\\)?"  ; ahead
-          "\\(?:, \\)?"
-          "\\(?:behind \\(?6:[0-9]+\\)\\)?" ; behind
-          "\\)\\)?"
-          "\\] \\)?"
-          "\\(?3:.*\\)"))                   ; message
-
-(defconst magit-refs-symref-line-re "^  \\([^ ]+\\) +-> \\(.+\\)")
-
-(defvar magit-refs-local-branch-format "%4c %-25n %U%m\n"
-  "Format used for local branches in refs buffers.")
-(defvar magit-refs-remote-branch-format "%4c %-25n %m\n"
-  "Format used for remote branches in refs buffers.")
-(defvar magit-refs-symref-format "%4c %-25n -> %m\n"
-  "Format used for symrefs in refs buffers.")
-(defvar magit-refs-tags-format "%4c %-25n %m\n"
-  "Format used for tags in refs buffers.")
-(defvar magit-refs-indent-cherry-lines 3
-  "Indentation of cherries in refs buffers.")
-
-;;;; Branch Sections
-
-(defun magit-insert-branch-description ()
-  "Insert header containing the description of the current branch.
-Insert a header line with the name and description of the
-current branch.  The description is taken from the Git variable
-`branch.<NAME>.description'; if that is undefined then no header
-line is inserted at all."
-  (let ((branch (magit-get-current-branch)))
-    (-when-let* ((desc (magit-get "branch" branch "description"))
-                 (desc-lines (split-string desc "\n")))
-      (magit-insert-section (branchdesc branch t)
-        (magit-insert-heading branch ": " (car desc-lines))
-        (insert (mapconcat 'identity (cdr desc-lines) "\n"))
-        (insert "\n\n")))))
-
-(defun magit-insert-local-branches ()
-  "Insert sections showing all local branches."
-  (magit-insert-section (local nil)
-    (magit-insert-heading "Branches:")
-    (let ((current  (magit-get-current-branch))
-          (branches (magit-list-local-branch-names)))
-      (dolist (line (magit-git-lines "branch" "-vv"
-                                     (cadr magit-refresh-args)))
-        (cond
-         ((string-match magit-refs-branch-line-re line)
-          (magit-bind-match-strings
-              (branch hash message upstream ahead behind gone) line
-            (when (string-match-p "(HEAD detached" branch)
-              (setq branch nil))
-            (magit-insert-branch
-             branch magit-refs-local-branch-format current branches
-             'magit-branch-local hash message upstream ahead behind gone)))
-         ((string-match magit-refs-symref-line-re line)
-          (magit-bind-match-strings (symref ref) line
-            (magit-insert-symref symref ref 'magit-branch-local))))))
-    (insert ?\n)
-    (magit-make-margin-overlay nil t)))
-
-(defun magit-insert-remote-branches ()
-  "Insert sections showing all remote-tracking branches."
-  (dolist (remote (magit-list-remotes))
-    (magit-insert-section (remote remote)
-      (magit-insert-heading
-        (let ((pull (magit-get "remote" remote "url"))
-              (push (magit-get "remote" remote "pushurl")))
-          (format "%s (%s):" (capitalize remote)
-                  (concat pull (and pull push ", ") push))))
-      (let ((current  (magit-get-current-branch))
-            (branches (magit-list-local-branch-names)))
-        (dolist (line (magit-git-lines "branch" "-vvr"
-                                       (cadr magit-refresh-args)))
-          (cond
-           ((string-match magit-refs-branch-line-re line)
-            (magit-bind-match-strings (branch hash message) line
-              (when (string-match-p (format "^%s/" remote) branch)
-                (magit-insert-branch
-                 branch magit-refs-remote-branch-format current branches
-                 'magit-branch-remote hash message))))
-           ((string-match magit-refs-symref-line-re line)
-            (magit-bind-match-strings (symref ref) line
-              (magit-insert-symref symref ref 'magit-branch-remote))))))
-      (insert ?\n)
-      (magit-make-margin-overlay nil t))))
-
-(defun magit-insert-branch (branch format &rest args)
-  "For internal use, don't add to a hook."
-  (unless magit-refs-show-commit-count
-    (setq format (replace-regexp-in-string "%[0-9]\\([cC]\\)" "%1\\1" format t)))
-  (if (equal branch "HEAD")
-      (magit-insert-section it (commit (magit-rev-parse "HEAD") t)
-        (apply #'magit-insert-branch-1 it nil format args))
-    (magit-insert-section it (branch branch t)
-      (apply #'magit-insert-branch-1 it branch format args))))
-
-(defun magit-insert-branch-1
-    (section branch format current branches face
-             &optional hash message upstream ahead behind gone)
-  "For internal use, don't add to a hook."
-  (let* ((head  (or (car magit-refresh-args) current "HEAD"))
-         (count (and branch
-                     (magit-refs-format-commit-count branch head format)))
-         (mark  (cond ((or (equal branch head)
-                           (and (not branch) (equal head "HEAD")))
-                       (if (equal branch current)
-                           (propertize "@" 'face 'magit-head)
-                         (propertize "#" 'face 'magit-tag)))
-                      ((equal branch current)
-                       (propertize "." 'face 'magit-head)))))
-    (when upstream
-      (setq upstream (propertize upstream 'face
-                                 (if (member upstream branches)
-                                     'magit-branch-local
-                                   'magit-branch-remote))))
-    (magit-insert-heading
-      (format-spec
-       format
-       `((?a . ,(or ahead ""))
-         (?b . ,(or behind ""))
-         (?c . ,(or mark count ""))
-         (?C . ,(or mark " "))
-         (?h . ,(or (propertize hash 'face 'magit-hash) ""))
-         (?m . ,(or message ""))
-         (?n . ,(propertize (or branch "(detached)") 'face face))
-         (?u . ,(or upstream ""))
-         (?U . ,(if upstream
-                    (format (propertize "[%s%s] " 'face 'magit-dimmed)
-                            upstream
-                            (cond
-                             (gone
-                              (concat ": " (propertize gone 'face 'error)))
-                             ((or ahead behind)
-                              (concat ": "
-                                      (and ahead (format "ahead %s" ahead))
-                                      (and ahead behind ", ")
-                                      (and behind (format "behind %s" behind))))
-                             (t "")))
-                  "")))))
-    (when (magit-buffer-margin-p)
-      (magit-refs-format-margin branch))
-    (magit-refs-insert-cherry-commits head branch section)))
-
-(defun magit-insert-symref (symref ref face)
-  "For internal use, don't add to a hook."
-  (magit-insert-section (commit symref)
-    (insert
-     (format-spec (if magit-refs-show-commit-count
-                      magit-refs-symref-format
-                    (replace-regexp-in-string "%[0-9]\\([cC]\\)" "%1\\1"
-                                              magit-refs-symref-format t))
-                  `((?c . "")
-                    (?n . ,(propertize symref 'face face))
-                    (?m . ,(propertize ref    'face face)))))))
-
-(defun magit-refs-format-commit-count (ref head format &optional tag-p)
-  (and (string-match-p "%-?[0-9]+c" format)
-       (if tag-p
-           (eq magit-refs-show-commit-count 'all)
-         magit-refs-show-commit-count)
-       (let ((count (cadr (magit-rev-diff-count head ref))))
-         (and (> count 0)
-              (propertize (number-to-string count) 'face 'magit-dimmed)))))
-
-;;;; Tag Sections
-
-(defun magit-insert-tags ()
-  "Insert sections showing all tags."
-  (-when-let (tags (magit-git-lines "tag" "-l" "-n"))
-    (magit-insert-section (tags)
-      (magit-insert-heading "Tags:")
-      (let ((head (or (car magit-refresh-args)
-                      (magit-get-current-branch)
-                      "HEAD"))
-            (format (if magit-refs-show-commit-count
-                        magit-refs-tags-format
-                      (replace-regexp-in-string
-                       "%[0-9]\\([cC]\\)" "%1\\1" magit-refs-tags-format t))))
-        (dolist (tag (nreverse tags))
-          (string-match "^\\([^ \t]+\\)[ \t]+\\([^ \t\n].*\\)?" tag)
-          (let* ((message (match-string 2 tag))
-                 (tag     (match-string 1 tag))
-                 (count   (magit-refs-format-commit-count tag head format t))
-                 (mark    (and (equal tag head)
-                               (propertize "#" 'face 'magit-tag))))
-            (magit-insert-section section (tag tag t)
-              (magit-insert-heading
-               (format-spec format
-                            `((?n . ,(propertize tag 'face 'magit-tag))
-                              (?c . ,(or mark count ""))
-                              (?m . ,(or message "")))))
-              (when (and (magit-buffer-margin-p)
-                         magit-refs-margin-for-tags)
-                (magit-refs-format-margin (concat tag "^{commit}")))
-              (magit-refs-insert-cherry-commits head tag section)))))
-      (insert ?\n)
-      (magit-make-margin-overlay nil t))))
-
-;;;; Cherry Sections
-
-(defun magit-refs-insert-cherry-commits (head ref section)
-  (if (magit-section-hidden section)
-      (setf (magit-section-washer section)
-            (apply-partially #'magit-refs-insert-cherry-commits-1
-                             head ref section))
-    (magit-refs-insert-cherry-commits-1 head ref section)))
-
-(defun magit-refs-insert-cherry-commits-1 (head ref _section)
-  (let ((start (point)))
-    (magit-git-wash (apply-partially 'magit-log-wash-log 'cherry)
-      "cherry" "-v" (magit-abbrev-arg) head ref magit-refresh-args)
-    (unless (= (point) start)
-      (magit-make-margin-overlay nil t))))
-
-(defun magit-refs-format-margin (commit)
-  (save-excursion
-    (goto-char (line-beginning-position 0))
-    (let ((line (magit-rev-format "%ct%cN" commit)))
-      (magit-log-format-margin (substring line 10)
-                               (substring line 0 10)))))
-
-(provide 'magit-refs)
-;;; magit-refs.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-refs.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-remote.el
@@ -1,771 +0,0 @@
-;;; magit-remote.el --- transfer Git commits  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2008-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements support for interacting with remote
-;; repositories.  Commands for cloning, fetching, pulling, and
-;; pushing are defined here.
-
-;;; Code:
-
-(require 'magit)
-
-;;; Clone
-
-(defcustom magit-clone-set-remote-head nil
-  "Whether cloning creates the symbolic-ref `<remote>/HEAD'."
-  :package-version '(magit . "2.4.2")
-  :group 'magit-commands
-  :type 'boolean)
-
-(defcustom magit-clone-set-remote.pushDefault 'ask
-  "Whether to set the value of `remote.pushDefault' after cloning.
-
-If t, then set without asking.  If nil, then don't set.  If
-`ask', then ask."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-commands
-  :type '(choice (const :tag "set" t)
-                 (const :tag "ask" ask)
-                 (const :tag "don't set" nil)))
-
-;;;###autoload
-(defun magit-clone (repository directory)
-  "Clone the REPOSITORY to DIRECTORY.
-Then show the status buffer for the new repository."
-  (interactive
-   (let  ((url (magit-read-string-ns "Clone repository")))
-     (list url (read-directory-name
-                "Clone to: " nil nil nil
-                (and (string-match "\\([^/:]+?\\)\\(/?\\.git\\)?$" url)
-                     (match-string 1 url))))))
-  (setq directory (file-name-as-directory (expand-file-name directory)))
-  (magit-run-git-async "clone" repository
-                       (magit-convert-filename-for-git directory))
-  ;; Don't refresh the buffer we're calling from.
-  (process-put magit-this-process 'inhibit-refresh t)
-  (set-process-sentinel
-   magit-this-process
-   (lambda (process event)
-     (when (memq (process-status process) '(exit signal))
-       (let ((magit-process-raise-error t))
-         (magit-process-sentinel process event)))
-     (when (and (eq (process-status process) 'exit)
-                (= (process-exit-status process) 0))
-       (let ((default-directory directory))
-         (when (or (eq  magit-clone-set-remote.pushDefault t)
-                   (and magit-clone-set-remote.pushDefault
-                        (y-or-n-p "Set `remote.pushDefault' to \"origin\"? ")))
-           (setf (magit-get "remote.pushDefault") "origin"))
-         (unless magit-clone-set-remote-head
-           (magit-remote-unset-head "origin")))
-       (with-current-buffer (process-get process 'command-buf)
-         (magit-status-internal directory))))))
-
-;;; Setup
-
-(defcustom magit-remote-add-set-remote.pushDefault 'ask-if-unset
-  "Whether to set the value of `remote.pushDefault' after adding a remote.
-
-If `ask', then always ask.  If `ask-if-unset', then ask, but only
-if the variable isn't set already.  If nil, then don't ever set.
-If the value is a string, then set without asking, provided that
-the name of the added remote is equal to that string and the
-variable isn't already set."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-commands
-  :type '(choice (const  :tag "ask if unset" ask-if-unset)
-                 (const  :tag "always ask" ask)
-                 (string :tag "set if named")
-                 (const  :tag "don't set")))
-
-;;;###autoload (autoload 'magit-remote-popup "magit-remote" nil t)
-(magit-define-popup magit-remote-popup
-  "Popup console for remote commands."
-  :man-page "git-remote"
-  :default-arguments '("-f")
-  :switches '("Switches for add"
-              (?f "Fetch after add" "-f"))
-  :actions  '((?a "Add"     magit-remote-add)
-              (?r "Rename"  magit-remote-rename)
-              (?k "Remove"  magit-remote-remove)
-              (?u "Set url" magit-remote-set-url)))
-
-(defun magit-read-url (prompt &optional initial-input)
-  (let ((url (magit-read-string-ns prompt initial-input)))
-    (if (string-prefix-p "~" url)
-        (expand-file-name url)
-      url)))
-
-;;;###autoload
-(defun magit-remote-add (remote url &optional args)
-  "Add a remote named REMOTE and fetch it."
-  (interactive (list (magit-read-string-ns "Remote name")
-                     (magit-read-url "Remote url")
-                     (magit-remote-arguments)))
-  (if (pcase (list magit-remote-add-set-remote.pushDefault
-                   (magit-get "remote.pushDefault"))
-        (`(,(pred stringp) ,_) t)
-        ((or `(ask ,_) `(ask-if-unset nil))
-         (y-or-n-p (format "Set `remote.pushDefault' to \"%s\"? " remote))))
-      (progn (magit-call-git "remote" "add" args remote url)
-             (setf (magit-get "remote.pushDefault") remote)
-             (magit-refresh))
-    (magit-run-git-async "remote" "add" args remote url)))
-
-;;;###autoload
-(defun magit-remote-rename (old new)
-  "Rename the remote named OLD to NEW."
-  (interactive
-   (let  ((remote (magit-read-remote "Rename remote")))
-     (list remote (magit-read-string-ns (format "Rename %s to" remote)))))
-  (unless (string= old new)
-    (magit-run-git "remote" "rename" old new)))
-
-;;;###autoload
-(defun magit-remote-set-url (remote url)
-  "Change the url of the remote named REMOTE to URL."
-  (interactive
-   (let  ((remote (magit-read-remote "Set url of remote")))
-     (list remote (magit-read-url
-                   "Url" (magit-get "remote" remote "url")))))
-  (magit-run-git "remote" "set-url" remote url))
-
-;;;###autoload
-(defun magit-remote-remove (remote)
-  "Delete the remote named REMOTE."
-  (interactive (list (magit-read-remote "Delete remote")))
-  (magit-run-git "remote" "rm" remote))
-
-;;;###autoload
-(defun magit-remote-set-head (remote &optional branch)
-  "Set the local representation of REMOTE's default branch.
-Query REMOTE and set the symbolic-ref refs/remotes/<remote>/HEAD
-accordingly.  With a prefix argument query for the branch to be
-used, which allows you to select an incorrect value if you fancy
-doing that."
-  (interactive
-   (let  ((remote (magit-read-remote "Set HEAD for remote")))
-     (list remote
-           (and current-prefix-arg
-                (magit-read-remote-branch (format "Set %s/HEAD to" remote)
-                                          remote nil nil t)))))
-  (magit-run-git "remote" "set-head" remote (or branch "--auto")))
-
-;;;###autoload
-(defun magit-remote-unset-head (remote)
-  "Unset the local representation of REMOTE's default branch.
-Delete the symbolic-ref \"refs/remotes/<remote>/HEAD\"."
-  (interactive (list (magit-read-remote "Unset HEAD for remote")))
-  (magit-run-git "remote" "set-head" remote "--delete"))
-
-;;; Fetch
-
-;;;###autoload (autoload 'magit-fetch-popup "magit-remote" nil t)
-(magit-define-popup magit-fetch-popup
-  "Popup console for fetch commands."
-  :man-page "git-fetch"
-  :switches '((?p "Prune deleted branches" "--prune"))
-  :actions  '("Configure"
-              (?C "variables..."           magit-branch-config-popup)
-              "Fetch from"
-              (?p magit-get-push-remote    magit-fetch-from-pushremote)
-              (?u magit-get-remote         magit-fetch-from-upstream)
-              (?e "elsewhere"              magit-fetch)
-              (?a "all remotes"            magit-fetch-all)
-              "Fetch"
-              (?o "another branch"         magit-fetch-branch)
-              (?r "explicit refspec"       magit-fetch-refspec)
-              (?m "submodules"             magit-submodule-fetch))
-  :default-action 'magit-fetch
-  :max-action-columns 1)
-
-(defun magit-git-fetch (remote args)
-  (run-hooks 'magit-credential-hook)
-  (magit-run-git-async "fetch" remote args))
-
-;;;###autoload
-(defun magit-fetch-from-pushremote (args)
-  "Fetch from the push-remote of the current branch."
-  (interactive (list (magit-fetch-arguments)))
-  (--if-let (magit-get-push-remote)
-      (magit-git-fetch it args)
-    (--if-let (magit-get-current-branch)
-        (user-error "No push-remote is configured for %s" it)
-      (user-error "No branch is checked out"))))
-
-;;;###autoload
-(defun magit-fetch-from-upstream (args)
-  "Fetch from the upstream repository of the current branch."
-  (interactive (list (magit-fetch-arguments)))
-  (--if-let (magit-get-remote)
-      (magit-git-fetch it args)
-    (--if-let (magit-get-current-branch)
-        (user-error "No upstream is configured for %s" it)
-      (user-error "No branch is checked out"))))
-
-;;;###autoload
-(defun magit-fetch (remote args)
-  "Fetch from another repository."
-  (interactive (list (magit-read-remote "Fetch remote")
-                     (magit-fetch-arguments)))
-  (magit-git-fetch remote args))
-
-;;;###autoload
-(defun magit-fetch-branch (remote branch args)
-  "Fetch a BRANCH from a REMOTE."
-  (interactive
-   (let ((remote (magit-read-remote-or-url "Fetch from remote or url")))
-     (list remote
-           (magit-read-remote-branch "Fetch branch" remote)
-           (magit-fetch-arguments))))
-  (magit-git-fetch remote (cons branch args)))
-
-;;;###autoload
-(defun magit-fetch-refspec (remote refspec args)
-  "Fetch a REFSPEC from a REMOTE."
-  (interactive
-   (let ((remote (magit-read-remote-or-url "Fetch from remote or url")))
-     (list remote
-           (magit-read-refspec "Fetch using refspec" remote)
-           (magit-fetch-arguments))))
-  (magit-git-fetch remote (cons refspec args)))
-
-;;;###autoload
-(defun magit-fetch-all (args)
-  "Fetch from all remotes."
-  (interactive (list (magit-fetch-arguments)))
-  (run-hooks 'magit-credential-hook)
-  (magit-run-git-async "remote" "update" args))
-
-;;;###autoload
-(defun magit-fetch-all-prune ()
-  "Fetch from all remotes, and prune.
-Prune remote tracking branches for branches that have been
-removed on the respective remote."
-  (interactive)
-  (run-hooks 'magit-credential-hook)
-  (magit-run-git-async "remote" "update" "--prune"))
-
-;;;###autoload
-(defun magit-fetch-all-no-prune ()
-  "Fetch from all remotes."
-  (interactive)
-  (run-hooks 'magit-credential-hook)
-  (magit-run-git-async "remote" "update"))
-
-;;; Pull
-
-;;;###autoload (autoload 'magit-pull-popup "magit-remote" nil t)
-(magit-define-popup magit-pull-popup
-  "Popup console for pull commands."
-  :man-page "git-pull"
-  :variables '("Configure"
-               (?r "branch.%s.rebase"
-                   magit-cycle-branch*rebase
-                   magit-pull-format-branch*rebase)
-               (?C "variables..." magit-branch-config-popup))
-  :actions '((lambda ()
-               (--if-let (magit-get-current-branch)
-                   (concat
-                    (propertize "Pull into " 'face 'magit-popup-heading)
-                    (propertize it           'face 'magit-branch-local)
-                    (propertize " from"      'face 'magit-popup-heading))
-                 (propertize "Pull from" 'face 'magit-popup-heading)))
-             (?p magit-get-push-branch     magit-pull-from-pushremote)
-             (?u magit-get-upstream-branch magit-pull-from-upstream)
-             (?e "elsewhere"               magit-pull))
-  :default-action 'magit-pull
-  :max-action-columns 1)
-
-;;;###autoload (autoload 'magit-pull-and-fetch-popup "magit-remote" nil t)
-(magit-define-popup magit-pull-and-fetch-popup
-  "Popup console for pull and fetch commands.
-
-This popup is intended as a replacement for the separate popups
-`magit-pull-popup' and `magit-fetch-popup'.  To use it, add this
-to your init file:
-
-  (with-eval-after-load \\='magit-remote
-    (define-key magit-mode-map \"f\" \\='magit-pull-and-fetch-popup)
-    (define-key magit-mode-map \"F\" nil))
-
-The combined popup does not offer all commands and arguments
-available from the individual popups.  Instead of the argument
-`--prune' and the command `magit-fetch-all' it uses two commands
-`magit-fetch-prune' and `magit-fetch-no-prune'.  And the commands
-`magit-fetch-from-pushremote' and `magit-fetch-from-upstream' are
-missing.  To add them use something like:
-
-  (with-eval-after-load \\='magit-remote
-    (magit-define-popup-action \\='magit-pull-and-fetch-popup ?U
-      \\='magit-get-upstream-branch
-      \\='magit-fetch-from-upstream-remote ?F)
-    (magit-define-popup-action \\='magit-pull-and-fetch-popup ?P
-      \\='magit-get-push-branch
-      \\='magit-fetch-from-push-remote ?F))"
-  :man-page "git-pull"
-  :variables '("Configure"
-               (?r "branch.%s.rebase"
-                   magit-cycle-branch*rebase
-                   magit-pull-format-branch*rebase)
-               (?C "variables..." magit-branch-config-popup))
-  :actions '((lambda ()
-               (--if-let (magit-get-current-branch)
-                   (concat
-                    (propertize "Pull into " 'face 'magit-popup-heading)
-                    (propertize it           'face 'magit-branch-local)
-                    (propertize " from"      'face 'magit-popup-heading))
-                 (propertize "Pull from" 'face 'magit-popup-heading)))
-             (?p magit-get-push-branch     magit-pull-from-pushremote)
-             (?u magit-get-upstream-branch magit-pull-from-upstream)
-             (?e "elsewhere"               magit-pull)
-             "Fetch from"
-             (?f "remotes"           magit-fetch-all-no-prune)
-             (?F "remotes and prune" magit-fetch-all-prune)
-             "Fetch"
-             (?o "another branch"    magit-fetch-branch)
-             (?s "explicit refspec"  magit-fetch-refspec)
-             (?m "submodules"        magit-submodule-fetch))
-  :default-action 'magit-fetch
-  :max-action-columns 1)
-
-(defun magit-pull-format-branch*rebase ()
-  (magit-popup-format-variable (format "branch.%s.rebase"
-                                       (or (magit-get-current-branch) "<name>"))
-                               '("true" "false")
-                               "false" "pull.rebase"))
-
-(defun magit-git-pull (source args)
-  (run-hooks 'magit-credential-hook)
-  (-let [(remote . branch)
-         (magit-split-branch-name source)]
-    (magit-run-git-with-editor "pull" args remote branch)))
-
-;;;###autoload
-(defun magit-pull-from-pushremote (args)
-  "Pull from the push-remote of the current branch."
-  (interactive (list (magit-pull-arguments)))
-  (--if-let (magit-get-push-branch)
-      (magit-git-pull it args)
-    (--if-let (magit-get-current-branch)
-        (user-error "No push-remote is configured for %s" it)
-      (user-error "No branch is checked out"))))
-
-;;;###autoload
-(defun magit-pull-from-upstream (args)
-  "Pull from the upstream of the current branch."
-  (interactive (list (magit-pull-arguments)))
-  (--if-let (magit-get-upstream-branch)
-      (progn (run-hooks 'magit-credential-hook)
-             (magit-run-git-with-editor
-              "pull" args (car (magit-split-branch-name it))))
-    (--if-let (magit-get-current-branch)
-        (user-error "No upstream is configured for %s" it)
-      (user-error "No branch is checked out"))))
-
-;;;###autoload
-(defun magit-pull (source args)
-  "Pull from a branch read in the minibuffer."
-  (interactive (list (magit-read-remote-branch "Pull" nil nil nil t)
-                     (magit-pull-arguments)))
-  (magit-git-pull source args))
-
-;;; Push
-
-(defcustom magit-push-current-set-remote-if-missing t
-  "Whether to configure missing remotes before pushing.
-
-When nil, then the command `magit-push-current-to-pushremote' and
-`magit-push-current-to-upstream' do not appear in the push popup
-if the push-remote resp. upstream is not configured.  If the user
-invokes one of these commands anyway, then it raises an error.
-
-When non-nil, then these commands always appear in the push
-popup.  But if the required configuration is missing, then they
-do appear in a way that indicates that this is the case.  If the
-user invokes one of them, then it asks for the necessary
-configuration, stores the configuration, and then uses it to push
-a first time.
-
-This option also affects whether the argument `--set-upstream' is
-available in the popup.  If the value is t, then that argument is
-redundant.  But note that changing the value of this option does
-not take affect immediately, the argument will only be added or
-removed after restarting Emacs."
-  :package-version '(magit . "2.6.0")
-  :group 'magit-commands
-  :type '(choice (const :tag "don't set" nil)
-                 (const :tag "set branch.<name>.pushRemote" t)
-                 (const :tag "set remote.pushDefault" default)))
-
-;;;###autoload (autoload 'magit-push-popup "magit-remote" nil t)
-(magit-define-popup magit-push-popup
-  "Popup console for push commands."
-  :man-page "git-push"
-  :switches `((?f "Force with lease" "--force-with-lease")
-              (?F "Force"            "--force")
-              (?h "Disable hooks"    "--no-verify")
-              (?d "Dry run"          "--dry-run")
-              ,@(and (not magit-push-current-set-remote-if-missing)
-                     '((?u "Set upstream"  "--set-upstream"))))
-  :actions '("Configure"
-             (?C "variables..."      magit-branch-config-popup)
-             (lambda ()
-               (--when-let (magit-get-current-branch)
-                 (concat (propertize "Push " 'face 'magit-popup-heading)
-                         (propertize it      'face 'magit-branch-local)
-                         (propertize " to"   'face 'magit-popup-heading))))
-             (?p magit--push-current-to-pushremote-desc
-                 magit-push-current-to-pushremote)
-             (?u magit--push-current-to-upstream-desc
-                 magit-push-current-to-upstream)
-             (?e "elsewhere\n"       magit-push-current)
-             "Push"
-             (?o "another branch"    magit-push)
-             (?T "a tag"             magit-push-tag)
-             (?r "explicit refspecs" magit-push-refspecs)
-             (?t "all tags"          magit-push-tags)
-             (?m "matching branches" magit-push-matching))
-  :max-action-columns 2)
-
-(defun magit-git-push (branch target args)
-  (run-hooks 'magit-credential-hook)
-  (-let [(remote . target)
-         (magit-split-branch-name target)]
-    (magit-run-git-async "push" "-v" args remote
-                         (format "%s:refs/heads/%s" branch target))))
-
-;;;###autoload
-(defun magit-push-current-to-pushremote (args &optional push-remote)
-  "Push the current branch to `branch.<name>.pushRemote'.
-If that variable is unset, then push to `remote.pushDefault'.
-
-When `magit-push-current-set-remote-if-missing' is non-nil and
-the push-remote is not configured, then read the push-remote from
-the user, set it, and then push to it.  With a prefix argument
-the push-remote can be changed before pushed to it."
-  (interactive
-   (list (magit-push-arguments)
-         (and (magit--push-current-set-pushremote-p current-prefix-arg)
-              (magit-read-remote
-               (if (eq magit-push-current-set-remote-if-missing 'default)
-                   "Set `remote.pushDefault' and push there"
-                 (format "Set `branch.%s.pushRemote' and push there"
-                         (magit-get-current-branch)))))))
-  (--if-let (magit-get-current-branch)
-      (progn (when push-remote
-               (setf (magit-get
-                      (if (eq magit-push-current-set-remote-if-missing 'default)
-                          "remote.pushDefault"
-                        (format "branch.%s.pushRemote"
-                                (magit-get-current-branch))))
-                     push-remote))
-             (-if-let (remote (magit-get-push-remote it))
-                 (if (member remote (magit-list-remotes))
-                     (magit-git-push it (concat remote "/" it) args)
-                   (user-error "Remote `%s' doesn't exist" remote))
-               (user-error "No push-remote is configured for %s" it)))
-    (user-error "No branch is checked out")))
-
-(defun magit--push-current-set-pushremote-p (&optional change)
-  (and (or change
-           (and magit-push-current-set-remote-if-missing
-                (not (magit-get-push-remote))))
-       (magit-get-current-branch)))
-
-(defun magit--push-current-to-pushremote-desc ()
-  (--if-let (magit-get-push-branch)
-      (concat (magit-branch-set-face it) "\n")
-    (and (magit--push-current-set-pushremote-p)
-         (concat
-          (propertize (if (eq magit-push-current-set-remote-if-missing 'default)
-                          "pushDefault"
-                        "pushRemote")
-                      'face 'bold)
-          ", after setting that\n"))))
-
-;;;###autoload
-(defun magit-push-current-to-upstream (args &optional upstream)
-  "Push the current branch to its upstream branch.
-
-When `magit-push-current-set-remote-if-missing' is non-nil and
-the upstream is not configured, then read the upstream from the
-user, set it, and then push to it.  With a prefix argument the
-upstream can be changed before pushed to it."
-  (interactive
-   (list (magit-push-arguments)
-         (and (magit--push-current-set-upstream-p current-prefix-arg)
-              (magit-read-upstream-branch))))
-  (--if-let (magit-get-current-branch)
-      (progn
-        (when upstream
-          (magit-set-branch*merge/remote it upstream))
-        (-if-let (target (magit-get-upstream-branch it))
-            (magit-git-push it target args)
-          (user-error "No upstream is configured for %s" it)))
-    (user-error "No branch is checked out")))
-
-(defun magit--push-current-set-upstream-p (&optional change)
-  (and (or change
-           (and magit-push-current-set-remote-if-missing
-                (not (magit-get-upstream-branch))))
-       (magit-get-current-branch)))
-
-(defun magit--push-current-to-upstream-desc ()
-  (--if-let (magit-get-upstream-branch)
-      (concat (magit-branch-set-face it) "\n")
-    (and (magit--push-current-set-upstream-p)
-         (concat (propertize "@{upstream}" 'face 'bold)
-                 ", after setting that\n"))))
-
-;;;###autoload
-(defun magit-push-current (target args)
-  "Push the current branch to a branch read in the minibuffer."
-  (interactive
-   (--if-let (magit-get-current-branch)
-       (list (magit-read-remote-branch (format "Push %s to" it)
-                                       nil nil it 'confirm)
-             (magit-push-arguments))
-     (user-error "No branch is checked out")))
-  (magit-git-push (magit-get-current-branch) target args))
-
-;;;###autoload
-(defun magit-push (source target args)
-  "Push an arbitrary branch or commit somewhere.
-Both the source and the target are read in the minibuffer."
-  (interactive
-   (let ((source (magit-read-local-branch-or-commit "Push")))
-     (list source
-           (magit-read-remote-branch
-            (format "Push %s to" source) nil
-            (if (magit-local-branch-p source)
-                (or (magit-get-push-branch source)
-                    (magit-get-upstream-branch source))
-              (and (magit-rev-ancestor-p source "HEAD")
-                   (or (magit-get-push-branch)
-                       (magit-get-upstream-branch))))
-            source 'confirm)
-           (magit-push-arguments))))
-  (magit-git-push source target args))
-
-;;;###autoload
-(defun magit-push-refspecs (remote refspecs args)
-  "Push one or multiple REFSPECS to a REMOTE.
-Both the REMOTE and the REFSPECS are read in the minibuffer.  To
-use multiple REFSPECS, separate them with commas.  Completion is
-only available for the part before the colon, or when no colon
-is used."
-  (interactive
-   (list (magit-read-remote "Push to remote")
-         (split-string (magit-completing-read-multiple
-                        "Push refspec,s"
-                        (cons "HEAD" (magit-list-local-branch-names)))
-                       crm-default-separator t)
-         (magit-push-arguments)))
-  (run-hooks 'magit-credential-hook)
-  (magit-run-git-async "push" "-v" args remote refspecs))
-
-;;;###autoload
-(defun magit-push-matching (remote &optional args)
-  "Push all matching branches to another repository.
-If multiple remotes exist, then read one from the user.
-If just one exists, use that without requiring confirmation."
-  (interactive (list (magit-read-remote "Push matching branches to" nil t)
-                     (magit-push-arguments)))
-  (run-hooks 'magit-credential-hook)
-  (magit-run-git-async "push" "-v" args remote ":"))
-
-;;;###autoload
-(defun magit-push-tags (remote &optional args)
-  "Push all tags to another repository.
-If only one remote exists, then push to that.  Otherwise prompt
-for a remote, offering the remote configured for the current
-branch as default."
-  (interactive (list (magit-read-remote "Push tags to remote" nil t)
-                     (magit-push-arguments)))
-  (run-hooks 'magit-credential-hook)
-  (magit-run-git-async "push" remote "--tags" args))
-
-;;;###autoload
-(defun magit-push-tag (tag remote &optional args)
-  "Push a tag to another repository."
-  (interactive
-   (let  ((tag (magit-read-tag "Push tag")))
-     (list tag (magit-read-remote (format "Push %s to remote" tag) nil t)
-           (magit-push-arguments))))
-  (run-hooks 'magit-credential-hook)
-  (magit-run-git-async "push" remote tag args))
-
-;;;###autoload
-(defun magit-push-implicitly (args)
-  "Push somewhere without using an explicit refspec.
-
-This command simply runs \"git push -v [ARGS]\".  ARGS are the
-arguments specified in the popup buffer.  No explicit refspec
-arguments are used.  Instead the behavior depends on at least
-these Git variables: `push.default', `remote.pushDefault',
-`branch.<branch>.pushRemote', `branch.<branch>.remote',
-`branch.<branch>.merge', and `remote.<remote>.push'.
-
-To add this command to the push popup add this to your init file:
-
-  (with-eval-after-load \\='magit-remote
-    (magit-define-popup-action \\='magit-push-popup ?P
-      \\='magit-push-implicitly--desc
-      \\='magit-push-implicitly ?p t))
-
-The function `magit-push-implicitly--desc' attempts to predict
-what this command will do.  The value it returns is displayed in
-the popup buffer."
-  (interactive (list (magit-push-arguments)))
-  (run-hooks 'magit-credential-hook)
-  (magit-run-git-async "push" "-v" args))
-
-(defun magit-push-implicitly--desc ()
-  (let ((default (magit-get "push.default")))
-    (unless (equal default "nothing")
-      (or (-when-let* ((remote (or (magit-get-remote)
-                                   (magit-remote-p "origin")))
-                       (refspec (magit-get "remote" remote "push")))
-            (format "%s using %s"
-                    (propertize remote  'face 'magit-branch-remote)
-                    (propertize refspec 'face 'bold)))
-          (--when-let (and (not (magit-get-push-branch))
-                           (magit-get-upstream-branch))
-            (format "%s aka %s\n"
-                    (magit-branch-set-face it)
-                    (propertize "@{upstream}" 'face 'bold)))
-          (--when-let (magit-get-push-branch)
-            (format "%s aka %s\n"
-                    (magit-branch-set-face it)
-                    (propertize "pushRemote" 'face 'bold)))
-          (--when-let (magit-get-@{push}-branch)
-            (format "%s aka %s\n"
-                    (magit-branch-set-face it)
-                    (propertize "@{push}" 'face 'bold)))
-          (format "using %s (%s is %s)\n"
-                  (propertize "git push"     'face 'bold)
-                  (propertize "push.default" 'face 'bold)
-                  (propertize default        'face 'bold))))))
-
-;;;###autoload
-(defun magit-push-to-remote (remote args)
-  "Push to REMOTE without using an explicit refspec.
-The REMOTE is read in the minibuffer.
-
-This command simply runs \"git push -v [ARGS] REMOTE\".  ARGS
-are the arguments specified in the popup buffer.  No refspec
-arguments are used.  Instead the behavior depends on at least
-these Git variables: `push.default', `remote.pushDefault',
-`branch.<branch>.pushRemote', `branch.<branch>.remote',
-`branch.<branch>.merge', and `remote.<remote>.push'.
-
-To add this command to the push popup add this to your init file:
-
-  (with-eval-after-load \\='magit-remote
-    (magit-define-popup-action \\='magit-push-popup ?r
-      \\='magit-push-to-remote--desc
-      \\='magit-push-to-remote ?p t))"
-  (interactive (list (magit-read-remote "Push to remote")
-                     (magit-push-arguments)))
-  (run-hooks 'magit-credential-hook)
-  (magit-run-git-async "push" "-v" args remote))
-
-(defun magit-push-to-remote--desc ()
-  (format "using %s\n" (propertize "git push <remote>" 'face 'bold)))
-
-;;; Email
-
-;;;###autoload (autoload 'magit-patch-popup "magit-remote" nil t)
-(magit-define-popup magit-patch-popup
-  "Popup console for patch commands."
-  :man-page "git-format-patch"
-  :switches '("Switches for formatting patches"
-              (?l "Add cover letter" "--cover-letter"))
-  :options  '("Options for formatting patches"
-              (?f "From"             "--from=")
-              (?t "To"               "--to=")
-              (?c "CC"               "--cc=")
-              (?r "In reply to"      "--in-reply-to=")
-              (?v "Reroll count"     "--reroll-count=")
-              (?s "Thread style"     "--thread=")
-              (?U "Context lines"    "-U")
-              (?M "Detect renames"   "-M")
-              (?C "Detect copies"    "-C")
-              (?A "Diff algorithm"   "--diff-algorithm="
-                  magit-diff-select-algorithm)
-              (?o "Output directory" "--output-directory="))
-  :actions  '((?p "Format patches"   magit-format-patch)
-              (?r "Request pull"     magit-request-pull))
-  :default-action 'magit-format-patch)
-
-;;;###autoload
-(defun magit-format-patch (range args)
-  "Create patches for the commits in RANGE.
-When a single commit is given for RANGE, create a patch for the
-changes introduced by that commit (unlike 'git format-patch'
-which creates patches for all commits that are reachable from
-`HEAD' but not from the specified commit)."
-  (interactive
-   (list (-if-let (revs (magit-region-values 'commit))
-             (concat (car (last revs)) "^.." (car revs))
-           (let ((range (magit-read-range-or-commit "Format range or commit")))
-             (if (string-match-p "\\.\\." range)
-                 range
-               (format "%s~..%s" range range))))
-         (magit-patch-arguments)))
-  (magit-call-git "format-patch" range args)
-  (when (member "--cover-letter" args)
-    (find-file
-     (expand-file-name
-      "0000-cover-letter.patch"
-      (let ((topdir (magit-toplevel)))
-        (or (--some (and (string-match "--output-directory=\\(.+\\)" it)
-                         (expand-file-name (match-string 1 it) topdir))
-                    args)
-            topdir))))))
-
-;;;###autoload
-(defun magit-request-pull (url start end)
-  "Request upstream to pull from you public repository.
-
-URL is the url of your publically accessible repository.
-START is a commit that already is in the upstream repository.
-END is the last commit, usually a branch name, which upstream
-is asked to pull.  START has to be reachable from that commit."
-  (interactive
-   (list (magit-get "remote" (magit-read-remote "Remote") "url")
-         (magit-read-branch-or-commit "Start" (magit-get-upstream-branch))
-         (magit-read-branch-or-commit "End")))
-  (let ((dir default-directory))
-    ;; mu4e changes default-directory
-    (compose-mail)
-    (setq default-directory dir))
-  (message-goto-body)
-  (magit-git-insert "request-pull" start url end)
-  (set-buffer-modified-p nil))
-
-(provide 'magit-remote)
-;;; magit-remote.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-remote.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-repos.el
@@ -1,308 +0,0 @@
-;;; magit-repos.el --- listing repositories  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements support for listing repositories.  This
-;; includes getting a Lisp list of known repositories as well as a
-;; mode for listing repositories in a buffer.
-
-;;; Code:
-
-(require 'magit-core)
-
-(declare-function magit-status-internal 'magit-status)
-
-(defvar x-stretch-cursor)
-
-;;; Options
-
-(defcustom magit-repository-directories nil
-  "List of directories that are or contain Git repositories.
-
-Each element has the form (DIRECTORY . DEPTH) or, for backward
-compatibility, just DIRECTORY.  DIRECTORY has to be a directory
-or a directory file-name, a string.  DEPTH, an integer, specifies
-the maximum depth to look for Git repositories.  If it is 0, then
-only add DIRECTORY itself.
-
-For backward compatibility reasons an element may be a string,
-instead of a cons-cell, in which case the value of the obsolete
-option `magit-repository-directories-depth' specifies the depth."
-  :package-version '(magit . "2.8.0")
-  :group 'magit-essentials
-  :type '(repeat (choice (cons directory (integer :tag "Depth")) directory)))
-
-(defvar magit-repository-directories-depth 3
-  "The maximum depth to look for Git repositories.
-This variable is obsolete and only used for elements of the
-option `magit-repository-directories' (which see) that don't
-specify the depth directly.")
-
-(defgroup magit-repolist nil
-  "List repositories in a buffer."
-  :link '(info-link "(magit)Repository List")
-  :group 'magit-modes)
-
-(defcustom magit-repolist-mode-hook '(hl-line-mode)
-  "Hook run after entering Magit-Repolist mode."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-repolist
-  :type 'hook
-  :get 'magit-hook-custom-get
-  :options '(hl-line-mode))
-
-(defcustom magit-repolist-columns
-  '(("Name"    25 magit-repolist-column-ident                  nil)
-    ("Version" 25 magit-repolist-column-version                nil)
-    ("B<U"      3 magit-repolist-column-unpulled-from-upstream ((:right-align t)))
-    ("B>U"      3 magit-repolist-column-unpushed-to-upstream   ((:right-align t)))
-    ("Path"    99 magit-repolist-column-path                   nil))
-  "List of columns displayed by `magit-list-repositories'.
-
-Each element has the form (HEADER WIDTH FORMAT PROPS).
-
-HEADER is the string displayed in the header.  WIDTH is the width
-of the column.  FORMAT is a function that is called with one
-argument, the repository identification (usually its basename),
-and with `default-directory' bound to the toplevel of its working
-tree.  It has to return a string to be inserted or nil.  PROPS is
-an alist that supports the keys `:right-align' and `:pad-right'."
-  :package-version '(magit . "2.8.0")
-  :group 'magit-repolist
-  :type `(repeat (list :tag "Column"
-                       (string   :tag "Header Label")
-                       (integer  :tag "Column Width")
-                       (function :tag "Inserter Function")
-                       (repeat   :tag "Properties"
-                                 (list (choice :tag "Property"
-                                               (const :right-align)
-                                               (const :pad-right)
-                                               (symbol))
-                                       (sexp   :tag "Value"))))))
-
-
-;;; List Repositories
-;;;; Command
-;;;###autoload
-(defun magit-list-repositories ()
-  "Display a list of repositories.
-
-Use the options `magit-repository-directories'
-and `magit-repository-directories-depth' to
-control which repositories are displayed."
-  (interactive)
-  (if magit-repository-directories
-      (with-current-buffer (get-buffer-create "*Magit Repositories*")
-        (magit-repolist-mode)
-        (setq tabulated-list-entries
-              (mapcar (-lambda ((id . path))
-                        (let ((default-directory path))
-                          (list path
-                                (vconcat (--map (or (funcall (nth 2 it) id) "")
-                                                magit-repolist-columns)))))
-                      (magit-list-repos-uniquify
-                       (--map (cons (file-name-nondirectory (directory-file-name it))
-                                    it)
-                              (magit-list-repos)))))
-        (tabulated-list-print)
-        (switch-to-buffer (current-buffer)))
-    (message "You need to customize `magit-repository-directories' %s"
-             "before you can list repositories")))
-
-;;;; Mode
-
-(defvar magit-repolist-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map tabulated-list-mode-map)
-    (define-key map "g" 'magit-list-repositories)
-    (define-key map (if (featurep 'jkl) [return] (kbd "C-m"))
-      'magit-repolist-status)
-    map)
-  "Local keymap for Magit-Repolist mode buffers.")
-
-(defun magit-repolist-status (&optional _button)
-  "Show the status for the repository at point."
-  (interactive)
-  (--if-let (tabulated-list-get-id)
-      (magit-status-internal (expand-file-name it))
-    (user-error "There is no repository at point")))
-
-(define-derived-mode magit-repolist-mode tabulated-list-mode "Repos"
-  "Major mode for browsing a list of Git repositories."
-  (setq x-stretch-cursor        nil)
-  (setq tabulated-list-padding  0)
-  (setq tabulated-list-sort-key (cons "Name" nil))
-  (setq tabulated-list-format
-        (vconcat (mapcar (-lambda ((title width _fn props))
-                           (nconc (list title width t)
-                                  (-flatten props)))
-                         magit-repolist-columns)))
-  (tabulated-list-init-header)
-  (setq imenu-prev-index-position-function
-        'magit-imenu--repolist-prev-index-position-function)
-  (setq imenu-extract-index-name-function
-        'magit-imenu--repolist-extract-index-name-function))
-
-;;;; Columns
-
-(defun magit-repolist-column-ident (id)
-  "Insert the identification of the repository.
-Usually this is just its basename."
-  id)
-
-(defun magit-repolist-column-path (_id)
-  "Insert the absolute path of the repository."
-  (abbreviate-file-name default-directory))
-
-(defun magit-repolist-column-version (_id)
-  "Insert a description of the repository's `HEAD' revision."
-  (let ((v (or (magit-git-string "describe" "--tags")
-               ;; If there are no tags, use the date in MELPA format.
-               (magit-git-string "show" "--no-patch" "--format=%cd-g%h"
-                                 "--date=format:%Y%m%d.%H%M"))))
-    (if (and v (string-match-p "\\`[0-9]" v))
-        (concat " " v)
-      v)))
-
-(defun magit-repolist-column-branch (_id)
-  "Insert the current branch."
-  (magit-get-current-branch))
-
-(defun magit-repolist-column-upstream (_id)
-  "Insert the upstream branch of the current branch."
-  (magit-get-upstream-branch))
-
-(defun magit-repolist-column-dirty (_id)
-  "Insert a letter if there are uncommitted changes.
-
-Show N if there is at least one untracked file.
-Show U if there is at least one unstaged file.
-Show S if there is at least one staged file.
-Only one letter is shown, the first that applies."
-  (cond ((magit-untracked-files) "N")
-        ((magit-unstaged-files)  "U")
-        ((magit-staged-files)    "S")))
-
-(defun magit-repolist-column-unpulled-from-upstream (_id)
-  "Insert number of upstream commits not in the current branch."
-  (--when-let (magit-get-upstream-branch nil t)
-    (let ((n (cadr (magit-rev-diff-count "HEAD" it))))
-      (propertize (number-to-string n) 'face (if (> n 0) 'bold 'shadow)))))
-
-(defun magit-repolist-column-unpulled-from-pushremote (_id)
-  "Insert number of commits in the push branch but not the current branch."
-  (--when-let (magit-get-push-branch nil t)
-    (let ((n (cadr (magit-rev-diff-count "HEAD" it))))
-      (propertize (number-to-string n) 'face (if (> n 0) 'bold 'shadow)))))
-
-(defun magit-repolist-column-unpushed-to-upstream (_id)
-  "Insert number of commits in the current branch but not its upstream."
-  (--when-let (magit-get-upstream-branch nil t)
-    (let ((n (car (magit-rev-diff-count "HEAD" it))))
-      (propertize (number-to-string n) 'face (if (> n 0) 'bold 'shadow)))))
-
-(defun magit-repolist-column-unpushed-to-pushremote (_id)
-  "Insert number of commits in the current branch but not its push branch."
-  (--when-let (magit-get-push-branch nil t)
-    (let ((n (car (magit-rev-diff-count "HEAD" it))))
-      (propertize (number-to-string n) 'face (if (> n 0) 'bold 'shadow)))))
-
-(defun magit-repolist-column-branches (_id)
-  "Insert number of branches."
-  (let ((n (length (magit-list-local-branches))))
-    (propertize (number-to-string n) 'face (if (> n 1) 'bold 'shadow))))
-
-(defun magit-repolist-column-stashes (_id)
-  "Insert number of stashes."
-  (let ((n (length (magit-list-stashes))))
-    (propertize (number-to-string n) 'face (if (> n 0) 'bold 'shadow))))
-
-;;; Read Repository
-
-(defun magit-read-repository (&optional read-directory-name)
-  "Read a Git repository in the minibuffer, with completion.
-
-The completion choices are the basenames of top-levels of
-repositories found in the directories specified by option
-`magit-repository-directories'.  In case of name conflicts
-the basenames are prefixed with the name of the respective
-parent directories.  The returned value is the actual path
-to the selected repository.
-
-With prefix argument simply read a directory name using
-`read-directory-name'."
-  (if (and (not read-directory-name) magit-repository-directories)
-      (let* ((repos (magit-list-repos-uniquify
-                     (--map (cons (file-name-nondirectory
-                                   (directory-file-name it))
-                                  it)
-                            (magit-list-repos))))
-             (reply (magit-completing-read "Git repository" repos)))
-        (file-name-as-directory
-         (or (cdr (assoc reply repos))
-             (if (file-directory-p reply)
-                 (expand-file-name reply)
-               (user-error "Not a repository or a directory: %s" reply)))))
-    (file-name-as-directory
-     (read-directory-name "Git repository: "
-                          (or (magit-toplevel) default-directory)))))
-
-(defun magit-list-repos ()
-  (--mapcat (if (consp it)
-                (magit-list-repos-1 (car it) (cdr it))
-              (magit-list-repos-1 it magit-repository-directories-depth))
-            magit-repository-directories))
-
-(defun magit-list-repos-1 (directory depth)
-  (cond ((file-readable-p (expand-file-name ".git" directory))
-         (list directory))
-        ((and (> depth 0) (magit-file-accessible-directory-p directory))
-         (--mapcat (and (file-directory-p it)
-                        (magit-list-repos-1 it (1- depth)))
-                   (directory-files directory t
-                                    directory-files-no-dot-files-regexp t)))))
-
-(defun magit-list-repos-uniquify (alist)
-  (let (result (dict (make-hash-table :test 'equal)))
-    (dolist (a (delete-dups alist))
-      (puthash (car a) (cons (cdr a) (gethash (car a) dict)) dict))
-    (maphash
-     (lambda (key value)
-       (if (= (length value) 1)
-           (push (cons key (car value)) result)
-         (setq result
-               (append result
-                       (magit-list-repos-uniquify
-                        (--map (cons (concat
-                                      key "\\"
-                                      (file-name-nondirectory
-                                       (directory-file-name
-                                        (substring it 0 (- (1+ (length key)))))))
-                                     it)
-                               value))))))
-     dict)
-    result))
-
-(provide 'magit-repos)
-;;; magit-repos.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-repos.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-section.el
@@ -1,1217 +0,0 @@
-;;; magit-section.el --- section functionality  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements "sections" as used in all Magit buffers.
-;; If you have used Magit before, then you probably know what that
-;; means, otherwise think "read-only Org-Mode for Git", kinda.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'dash)
-
-(require 'magit-utils)
-
-(declare-function magit-maybe-make-margin-overlay 'magit-log)
-(defvar magit-keep-region-overlay)
-
-;;; Options
-
-(defgroup magit-section nil
-  "Expandable sections."
-  :link '(info-link "(magit)Sections")
-  :group 'magit)
-
-(defcustom magit-section-show-child-count t
-  "Whether to append the number of children to section headings.
-This only applies to sections for which doing so makes sense."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-section
-  :type 'boolean)
-
-(defcustom magit-section-movement-hook
-  '(magit-hunk-set-window-start
-    magit-log-maybe-update-revision-buffer
-    magit-log-maybe-show-more-commits)
-  "Hook run by `magit-section-goto'.
-That function in turn is used by all section movement commands."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-section
-  :type 'hook
-  :options '(magit-hunk-set-window-start
-             magit-status-maybe-update-revision-buffer
-             magit-status-maybe-update-blob-buffer
-             magit-log-maybe-update-revision-buffer
-             magit-log-maybe-update-blob-buffer
-             magit-log-maybe-show-more-commits))
-
-(defcustom magit-section-highlight-hook
-  '(magit-diff-highlight
-    magit-section-highlight
-    magit-section-highlight-selection)
-  "Functions used to highlight the current section.
-Each function is run with the current section as only argument
-until one of them returns non-nil."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-section
-  :type 'hook
-  :options '(magit-diff-highlight
-             magit-section-highlight
-             magit-section-highlight-selection))
-
-(defcustom magit-section-unhighlight-hook
-  '(magit-diff-unhighlight)
-  "Functions used to unhighlight the previously current section.
-Each function is run with the current section as only argument
-until one of them returns non-nil.  Most sections are properly
-unhighlighted without requiring a specialized unhighlighter,
-diff-related sections being the only exception."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-section
-  :type 'hook
-  :options '(magit-diff-unhighlight))
-
-(defcustom magit-section-set-visibility-hook
-  '(magit-diff-expansion-threshold
-    magit-section-set-visibility-from-cache)
-  "Hook used to set the initial visibility of a section.
-Stop at the first function that returns non-nil.  The value
-should be `show' or `hide'.  If no function returns non-nil,
-determine the visibility as usual, i.e. use the hardcoded
-section specific default (see `magit-insert-section')."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-section
-  :type 'hook
-  :options '(magit-diff-expansion-threshold
-             magit-section-set-visibility-from-cache))
-
-(defface magit-section-highlight
-  '((((class color) (background light)) :background "grey95")
-    (((class color) (background  dark)) :background "grey20"))
-  "Face for highlighting the current section."
-  :group 'magit-faces)
-
-(defface magit-section-heading
-  '((((class color) (background light)) :foreground "DarkGoldenrod4" :weight bold)
-    (((class color) (background  dark)) :foreground "LightGoldenrod2" :weight bold))
-  "Face for section headings."
-  :group 'magit-faces)
-
-(defface magit-section-secondary-heading '((t :weight bold))
-  "Face for section headings of some secondary headings."
-  :group 'magit-faces)
-
-(defface magit-section-heading-selection
-  '((((class color) (background light)) :foreground "salmon4")
-    (((class color) (background  dark)) :foreground "LightSalmon3"))
-  "Face for selected section headings."
-  :group 'magit-faces)
-
-;;; Core
-
-(cl-defstruct magit-section
-  type value start content end hidden washer refined
-  source diff-header process parent children)
-
-(defvar-local magit-root-section nil
-  "The root section in the current buffer.
-All other sections are descendants of this section.  The value
-of this variable is set by `magit-insert-section' and you should
-never modify it.")
-(put 'magit-root-section 'permanent-local t)
-
-(defun magit-current-section ()
-  "Return the section at point."
-  (or (get-text-property (point) 'magit-section) magit-root-section))
-
-(defun magit-section-ident (section)
-  "Return an unique identifier for SECTION.
-The return value has the form ((TYPE . VALUE)...)."
-  (cons (cons (magit-section-type section)
-              (magit-section-value section))
-        (--when-let (magit-section-parent section)
-          (magit-section-ident it))))
-
-(defun magit-get-section (ident &optional root)
-  "Return the section identified by IDENT.
-IDENT has to be a list as returned by `magit-section-ident'."
-  (setq ident (reverse ident))
-  (let ((section (or root magit-root-section)))
-    (when (eq (car (pop ident)) (magit-section-type section))
-      (while (and ident
-                  (setq section
-                        (--first
-                         (and (eq    (caar ident) (magit-section-type it))
-                              (equal (cdar ident) (magit-section-value it)))
-                         (magit-section-children section))))
-        (pop ident))
-      section)))
-
-(defvar magit-insert-section--current nil "For internal use only.")
-(defvar magit-insert-section--parent  nil "For internal use only.")
-(defvar magit-insert-section--oldroot nil "For internal use only.")
-
-;;; Commands
-;;;; Movement
-
-(defun magit-section-forward ()
-  "Move to the beginning of the next visible section."
-  (interactive)
-  (if (eobp)
-      (user-error "No next section")
-    (let ((section (magit-current-section)))
-      (if (magit-section-parent section)
-          (let ((next (and (not (magit-section-hidden section))
-                           (not (= (magit-section-end section) (1+ (point))))
-                           (car (magit-section-children section)))))
-            (while (and section (not next))
-              (unless (setq next (car (magit-section-siblings section 'next)))
-                (setq section (magit-section-parent section))))
-            (if next
-                (magit-section-goto next)
-              (user-error "No next section")))
-        (magit-section-goto 1)))))
-
-(defun magit-section-backward ()
-  "Move to the beginning of the current or the previous visible section.
-When point is at the beginning of a section then move to the
-beginning of the previous visible section.  Otherwise move to
-the beginning of the current section."
-  (interactive)
-  (if (bobp)
-      (user-error "No previous section")
-    (let ((section (magit-current-section)) children)
-      (cond
-       ((and (= (point) (1- (magit-section-end section)))
-             (setq children (magit-section-children section)))
-        (magit-section-goto (car (last children))))
-       ((and (magit-section-parent section)
-             (not (= (point) (magit-section-start section))))
-        (magit-section-goto section))
-       (t
-        (let ((prev (car (magit-section-siblings section 'prev))))
-          (if prev
-              (while (and (not (magit-section-hidden prev))
-                          (setq children (magit-section-children prev)))
-                (setq prev (car (last children))))
-            (setq prev (magit-section-parent section)))
-          (cond (prev
-                 (magit-section-goto prev))
-                ((magit-section-parent section)
-                 (user-error "No previous section"))
-                ;; Eob special cases.
-                ((not (get-text-property (1- (point)) 'invisible))
-                 (magit-section-goto -1))
-                (t
-                 (goto-char (previous-single-property-change
-                             (1- (point)) 'invisible))
-                 (forward-line -1)
-                 (magit-section-goto (magit-current-section))))))))))
-
-(defun magit-section-up ()
-  "Move to the beginning of the parent section."
-  (interactive)
-  (--if-let (magit-section-parent (magit-current-section))
-      (magit-section-goto it)
-    (user-error "No parent section")))
-
-(defun magit-section-forward-sibling ()
-  "Move to the beginning of the next sibling section.
-If there is no next sibling section, then move to the parent."
-  (interactive)
-  (let ((current (magit-current-section)))
-    (if (magit-section-parent current)
-        (--if-let (car (magit-section-siblings current 'next))
-            (magit-section-goto it)
-          (magit-section-forward))
-      (magit-section-goto 1))))
-
-(defun magit-section-backward-sibling ()
-  "Move to the beginning of the previous sibling section.
-If there is no previous sibling section, then move to the parent."
-  (interactive)
-  (let ((current (magit-current-section)))
-    (if (magit-section-parent current)
-        (--if-let (car (magit-section-siblings current 'prev))
-            (magit-section-goto it)
-          (magit-section-backward))
-      (magit-section-goto -1))))
-
-(defun magit-section-goto (arg)
-  (if (integerp arg)
-      (progn (forward-line arg)
-             (setq arg (magit-current-section)))
-    (goto-char (magit-section-start arg)))
-  (run-hook-with-args 'magit-section-movement-hook arg))
-
-(defun magit-section-set-window-start (section)
-  "Ensure the beginning of SECTION is visible."
-  (unless (pos-visible-in-window-p (magit-section-end section))
-    (set-window-start (selected-window) (magit-section-start section))))
-
-(defun magit-hunk-set-window-start (section)
-  "When SECTION is a `hunk', ensure that its beginning is visible.
-It the SECTION has a different type, then do nothing."
-  (when (eq (magit-section-type section) 'hunk)
-    (magit-section-set-window-start section)))
-
-(defmacro magit-define-section-jumper (name heading type &optional value)
-  "Define an interactive function to go some section.
-Together TYPE and VALUE identify the section.
-HEADING is the displayed heading of the section."
-  (declare (indent defun))
-  `(defun ,name (&optional expand) ,(format "\
-Jump to the section \"%s\".
-With a prefix argument also expand it." heading)
-     (interactive "P")
-     (--if-let (magit-get-section
-                (cons (cons ',type ,value)
-                      (magit-section-ident magit-root-section)))
-         (progn (goto-char (magit-section-start it))
-                (when expand
-                  (with-local-quit (magit-section-show it))
-                  (recenter 0)))
-       (message ,(format "Section \"%s\" wasn't found" heading)))))
-
-;;;; Visibility
-
-(defun magit-section-show (section)
-  "Show the body of the current section."
-  (interactive (list (magit-current-section)))
-  (setf (magit-section-hidden section) nil)
-  (-when-let (washer (magit-section-washer section))
-    (setf (magit-section-washer section) nil)
-    (let ((inhibit-read-only t)
-          (magit-insert-section--parent section)
-          (content (magit-section-content section)))
-      (save-excursion
-        (if (and content (< content (magit-section-end section)))
-            (funcall washer section) ; already partially washed (hunk)
-          (goto-char (magit-section-end section))
-          (setf (magit-section-content section) (point-marker))
-          (funcall washer)
-          (setf (magit-section-end section) (point-marker)))))
-    (magit-section-update-highlight))
-  (-when-let (beg (magit-section-content section))
-    (remove-overlays beg (magit-section-end section) 'invisible t))
-  (magit-section-update-visibility-cache section)
-  (dolist (child (magit-section-children section))
-    (if (magit-section-hidden child)
-        (magit-section-hide child)
-      (magit-section-show child))))
-
-(defun magit-section-hide (section)
-  "Hide the body of the current section."
-  (interactive (list (magit-current-section)))
-  (if (eq section magit-root-section)
-      (user-error "Cannot hide root section")
-    (setf (magit-section-hidden section) t)
-    (-when-let (beg (magit-section-content section))
-      (let ((end (magit-section-end section)))
-        (remove-overlays beg end 'invisible t)
-        (let ((o (make-overlay beg end)))
-          (overlay-put o 'evaporate t)
-          (overlay-put o 'invisible t))))
-    (when (memq (magit-section-type section) '(unpulled unpushed))
-      (magit-section-cache-visibility section))))
-
-(defun magit-section-toggle (section)
-  "Toggle visibility of the body of the current section."
-  (interactive (list (magit-current-section)))
-  (if (eq section magit-root-section)
-      (user-error "Cannot hide root section")
-    (goto-char (magit-section-start section))
-    (if (magit-section-hidden section)
-        (magit-section-show section)
-      (magit-section-hide section))))
-
-(defun magit-section-toggle-children (section)
-  "Toggle visibility of bodies of children of the current section."
-  (interactive (list (magit-current-section)))
-  (goto-char (magit-section-start section))
-  (let* ((children (magit-section-children section))
-         (show (-any-p 'magit-section-hidden children)))
-    (dolist (c children)
-      (setf (magit-section-hidden c) show)))
-  (magit-section-show section))
-
-(defun magit-section-show-children (section &optional depth)
-  "Recursively show the bodies of children of the current section.
-With a prefix argument show children that deep and hide deeper
-children."
-  (interactive (list (magit-current-section)))
-  (magit-section-show-children-1 section depth)
-  (magit-section-show section))
-
-(defun magit-section-show-children-1 (section &optional depth)
-  (dolist (s (magit-section-children section))
-    (setf (magit-section-hidden s) nil)
-    (if depth
-        (if (> depth 0)
-            (magit-section-show-children-1 s (1- depth))
-          (magit-section-hide s))
-      (magit-section-show-children-1 s))))
-
-(defun magit-section-hide-children (section)
-  "Recursively hide the bodies of children of the current section."
-  (interactive (list (magit-current-section)))
-  (mapc 'magit-section-hide (magit-section-children section)))
-
-(defun magit-section-show-headings (section)
-  "Recursively show headings of children of the current section.
-Only show the headings, previously shown text-only bodies are
-hidden."
-  (interactive (list (magit-current-section)))
-  (magit-section-show-headings-1 section)
-  (magit-section-show section))
-
-(defun magit-section-show-headings-1 (section)
-  (dolist (s (magit-section-children section))
-    (setf (magit-section-hidden s) nil)
-    (when (or (magit-section-children s)
-              (not (magit-section-content s)))
-      (magit-section-show-headings-1 s))))
-
-(defun magit-section-cycle (section)
-  "Cycle visibility of current section and its children."
-  (interactive (list (magit-current-section)))
-  (goto-char (magit-section-start section))
-  (if (magit-section-hidden section)
-      (progn (magit-section-show section)
-             (magit-section-hide-children section))
-    (let ((children (magit-section-children section)))
-      (cond ((and (-any-p 'magit-section-hidden   children)
-                  (-any-p 'magit-section-children children))
-             (magit-section-show-headings section))
-            ((-any-p 'magit-section-hidden-body children)
-             (magit-section-show-children section))
-            (t
-             (magit-section-hide section))))))
-
-(defun magit-section-cycle-global ()
-  "Cycle visibility of all sections in the current buffer."
-  (interactive)
-  (let ((children (magit-section-children magit-root-section)))
-    (cond ((and (-any-p 'magit-section-hidden   children)
-                (-any-p 'magit-section-children children))
-           (magit-section-show-headings magit-root-section))
-          ((-any-p 'magit-section-hidden-body children)
-           (magit-section-show-children magit-root-section))
-          (t
-           (mapc 'magit-section-hide children)))))
-
-(defun magit-section-cycle-diffs ()
-  "Cycle visibility of diff-related sections in the current buffer."
-  (interactive)
-  (-when-let (sections
-              (cond ((derived-mode-p 'magit-status-mode)
-                     (--mapcat
-                      (when it
-                        (when (magit-section-hidden it)
-                          (magit-section-show it))
-                        (magit-section-children it))
-                      (list (magit-get-section '((staged)   (status)))
-                            (magit-get-section '((unstaged) (status))))))
-                    ((derived-mode-p 'magit-diff-mode)
-                     (--filter (eq (magit-section-type it) 'file)
-                               (magit-section-children magit-root-section)))))
-    (if (-any-p 'magit-section-hidden sections)
-        (dolist (s sections)
-          (magit-section-show s)
-          (magit-section-hide-children s))
-      (let ((children (-mapcat 'magit-section-children sections)))
-        (cond ((and (-any-p 'magit-section-hidden   children)
-                    (-any-p 'magit-section-children children))
-               (mapc 'magit-section-show-headings sections))
-              ((-any-p 'magit-section-hidden-body children)
-               (mapc 'magit-section-show-children sections))
-              (t
-               (mapc 'magit-section-hide sections)))))))
-
-(defun magit-section-hidden-body (section &optional pred)
-  (--if-let (magit-section-children section)
-      (funcall (or pred '-any-p) 'magit-section-hidden-body it)
-    (and (magit-section-content section)
-         (magit-section-hidden  section))))
-
-(defun magit-section-invisible-p (section)
-  "Return t if the SECTION's body is invisible.
-When the body of an ancestor of SECTION is collapsed then
-SECTION's body (and heading) obviously cannot be visible."
-  (or (magit-section-hidden section)
-      (--when-let (magit-section-parent section)
-        (magit-section-invisible-p it))))
-
-(defun magit-section-show-level (level)
-  "Show surrounding sections up to LEVEL.
-If LEVEL is negative, show up to the absolute value.
-Sections at higher levels are hidden."
-  (if (< level 0)
-      (let ((s (magit-current-section)))
-        (setq level (- level))
-        (while (> (1- (length (magit-section-ident s))) level)
-          (setq s (magit-section-parent s))
-          (goto-char (magit-section-start s)))
-        (magit-section-show-children magit-root-section (1- level)))
-    (cl-do* ((s (magit-current-section) (magit-section-parent s))
-             (i (1- (length (magit-section-ident s))) (cl-decf i)))
-        ((cond ((< i level) (magit-section-show-children s (- level i 1)) t)
-               ((= i level) (magit-section-hide s) t))
-         (magit-section-goto s)))))
-
-(defun magit-section-show-level-1 ()
-  "Show surrounding sections on first level."
-  (interactive)
-  (magit-section-show-level 1))
-
-(defun magit-section-show-level-1-all ()
-  "Show all sections on first level."
-  (interactive)
-  (magit-section-show-level -1))
-
-(defun magit-section-show-level-2 ()
-  "Show surrounding sections up to second level."
-  (interactive)
-  (magit-section-show-level 2))
-
-(defun magit-section-show-level-2-all ()
-  "Show all sections up to second level."
-  (interactive)
-  (magit-section-show-level -2))
-
-(defun magit-section-show-level-3 ()
-  "Show surrounding sections up to third level."
-  (interactive)
-  (magit-section-show-level 3))
-
-(defun magit-section-show-level-3-all ()
-  "Show all sections up to third level."
-  (interactive)
-  (magit-section-show-level -3))
-
-(defun magit-section-show-level-4 ()
-  "Show surrounding sections up to fourth level."
-  (interactive)
-  (magit-section-show-level 4))
-
-(defun magit-section-show-level-4-all ()
-  "Show all sections up to fourth level."
-  (interactive)
-  (magit-section-show-level -4))
-
-;;;; Auxiliary
-
-(defun magit-describe-section ()
-  "Show information about the section at point.
-This command is intended for debugging purposes."
-  (interactive)
-  (let ((section (magit-current-section)))
-    (message "%S %S %s-%s"
-             (magit-section-value section)
-             (apply 'vector (mapcar 'car (magit-section-ident section)))
-             (marker-position (magit-section-start section))
-             (marker-position (magit-section-end section)))))
-
-;;; Match
-
-(cl-defun magit-section-match
-    (condition &optional (section (magit-current-section)))
-  "Return t if SECTION matches CONDITION.
-
-SECTION defaults to the section at point.  If SECTION is not
-specified and there also is no section at point, then return
-nil.
-
-CONDITION can take the following forms:
-  (CONDITION...)  matches if any of the CONDITIONs matches.
-  [TYPE...]       matches if the first TYPE matches the type
-                  of the section, the second matches that of
-                  its parent, and so on.
-  [* TYPE...]     matches sections that match [TYPE...] and
-                  also recursively all their child sections.
-  TYPE            matches sections of TYPE regardless of the
-                  types of the parent sections.
-
-Each TYPE is a symbol.  Note that it is not necessary to specify
-all TYPEs up to the root section as printed by
-`magit-describe-type', unless of course you want to be that
-precise."
-  ;; For backward compatibility reasons SECTION can also be a
-  ;; type-list as understood by `magit-section-match-1'.  This
-  ;; includes uses of the macros `magit-section-when' and
-  ;; `magit-section-case' that did not get recompiled after
-  ;; this function was changed.
-  (and section
-       (magit-section-match-1 condition
-                              (if (magit-section-p section)
-                                  (mapcar #'car (magit-section-ident section))
-                                section))))
-
-(defun magit-section-match-1 (condition type-list)
-  (if (listp condition)
-      (--first (magit-section-match-1 it type-list) condition)
-    (magit-section-match-2 (if (symbolp condition)
-                               (list condition)
-                             (append condition nil))
-                           type-list)))
-
-(defun magit-section-match-2 (l1 l2)
-  (or (null l1)
-      (if (eq (car l1) '*)
-          (or (magit-section-match-2 (cdr l1) l2)
-              (and l2
-                   (magit-section-match-2 l1 (cdr l2))))
-        (and l2
-             (equal (car l1) (car l2))
-             (magit-section-match-2 (cdr l1) (cdr l2))))))
-
-(defmacro magit-section-when (condition &rest body)
-  "If the section at point matches CONDITION, evaluate BODY.
-
-If the section matches, then evaluate BODY forms sequentially
-with `it' bound to the section and return the value of the last
-form.  If there are no BODY forms, then return the value of the
-section.  If the section does not match or if there is no section
-at point, then return nil.
-
-See `magit-section-match' for the forms CONDITION can take."
-  (declare (indent 1)
-           (debug (sexp body)))
-  `(--when-let (magit-current-section)
-     ;; Quoting CONDITION here often leads to double-quotes, which
-     ;; isn't an issue because `magit-section-match-1' implicitly
-     ;; deals with that.  We shouldn't force users of this function
-     ;; to not quote CONDITION because that would needlessly break
-     ;; backward compatibility.
-     (when (magit-section-match ',condition it)
-       ,@(or body '((magit-section-value it))))))
-
-(defmacro magit-section-case (&rest clauses)
-  "Choose among clauses on the type of the section at point.
-
-Each clause looks like (CONDITION BODY...).  The type of the
-section is compared against each CONDITION; the BODY forms of the
-first match are evaluated sequentially and the value of the last
-form is returned.  Inside BODY the symbol `it' is bound to the
-section at point.  If no clause succeeds or if there is no
-section at point, return nil.
-
-See `magit-section-match' for the forms CONDITION can take.
-Additionally a CONDITION of t is allowed in the final clause, and
-matches if no other CONDITION match, even if there is no section
-at point."
-  (declare (indent 0)
-           (debug (&rest (sexp body))))
-  (let ((ident (cl-gensym "id")))
-    `(let* ((it (magit-current-section))
-            (,ident (and it (mapcar 'car (magit-section-ident it)))))
-       (cond ,@(mapcar (lambda (clause)
-                         `(,(or (eq (car clause) t)
-                                `(and it (magit-section-match-1
-                                          ',(car clause) ,ident)))
-                           ,@(cdr clause)))
-                       clauses)))))
-;;; Create
-
-(defvar magit-insert-section-hook nil
-  "Hook run after `magit-insert-section's BODY.
-Avoid using this hook and only ever do so if you know
-what you are doing and are sure there is no other way.")
-
-(defmacro magit-insert-section (&rest args)
-  "Insert a section at point.
-
-TYPE is the section type, a symbol.  Many commands that act on
-the current section behave differently depending on that type.
-Also if a variable `magit-TYPE-section-map' exists, then use
-that as the text-property `keymap' of all text belonging to the
-section (but this may be overwritten in subsections).  TYPE can
-also have the form `(eval FORM)' in which case FORM is evaluated
-at runtime.
-
-Optional VALUE is the value of the section, usually a string
-that is required when acting on the section.
-
-When optional HIDE is non-nil collapse the section body by
-default, i.e. when first creating the section, but not when
-refreshing the buffer.  Else expand it by default.  This can be
-overwritten using `magit-section-set-visibility-hook'.  When a
-section is recreated during a refresh, then the visibility of
-predecessor is inherited and HIDE is ignored (but the hook is
-still honored).
-
-BODY is any number of forms that actually insert the section's
-heading and body.  Optional NAME, if specified, has to be a
-symbol, which is then bound to the struct of the section being
-inserted.
-
-Before BODY is evaluated the `start' of the section object is set
-to the value of `point' and after BODY was evaluated its `end' is
-set to the new value of `point'; BODY is responsible for moving
-`point' forward.
-
-If it turns out inside BODY that the section is empty, then
-`magit-cancel-section' can be used to abort and remove all traces
-of the partially inserted section.  This can happen when creating
-a section by washing Git's output and Git didn't actually output
-anything this time around.
-
-\(fn [NAME] (TYPE &optional VALUE HIDE) &rest BODY)"
-  (declare (indent defun)
-           (debug ([&optional symbolp]
-                   (&or [("eval" symbolp) &optional form form]
-                        [symbolp &optional form form])
-                   body)))
-  (let ((s (if (symbolp (car args))
-               (pop args)
-             (cl-gensym "section"))))
-    `(let* ((,s (make-magit-section
-                 :type ,(let ((type (nth 0 (car args))))
-                          (if (eq (car-safe type) 'eval)
-                              (cadr type)
-                            `',type))
-                 :value ,(nth 1 (car args))
-                 :start (point-marker)
-                 :parent magit-insert-section--parent)))
-       (setf (magit-section-hidden ,s)
-             (-if-let (value (run-hook-with-args-until-success
-                              'magit-section-set-visibility-hook ,s))
-                 (eq value 'hide)
-               (--if-let (and magit-insert-section--oldroot
-                              (magit-get-section
-                               (magit-section-ident ,s)
-                               magit-insert-section--oldroot))
-                   (magit-section-hidden it)
-                 ,(nth 2 (car args)))))
-       (let ((magit-insert-section--current ,s)
-             (magit-insert-section--parent  ,s)
-             (magit-insert-section--oldroot
-              (or magit-insert-section--oldroot
-                  (unless magit-insert-section--parent
-                    (prog1 magit-root-section
-                      (setq magit-root-section ,s))))))
-         (catch 'cancel-section
-           ,@(cdr args)
-           (run-hooks 'magit-insert-section-hook)
-           (magit-insert-child-count ,s)
-           (set-marker-insertion-type (magit-section-start ,s) t)
-           (let* ((end (setf (magit-section-end ,s) (point-marker)))
-                  (map (intern (format "magit-%s-section-map"
-                                       (magit-section-type ,s))))
-                  (map (and (boundp map) (symbol-value map))))
-             (save-excursion
-               (goto-char (magit-section-start ,s))
-               (while (< (point) end)
-                 (let ((next (or (next-single-property-change
-                                  (point) 'magit-section)
-                                 end)))
-                   (unless (get-text-property (point) 'magit-section)
-                     (put-text-property (point) next 'magit-section ,s)
-                     (when map
-                       (put-text-property (point) next 'keymap map)))
-                   (goto-char next)))))
-           (if (eq ,s magit-root-section)
-               (magit-section-show ,s)
-             (setf (magit-section-children (magit-section-parent ,s))
-                   (nconc (magit-section-children (magit-section-parent ,s))
-                          (list ,s)))))
-         ,s))))
-
-(defun magit-cancel-section ()
-  (when magit-insert-section--current
-    (if (not (magit-section-parent magit-insert-section--current))
-        (insert "(empty)\n")
-      (delete-region (magit-section-start magit-insert-section--current)
-                     (point))
-      (setq magit-insert-section--current nil)
-      (throw 'cancel-section nil))))
-
-(defun magit-insert-heading (&rest args)
-  "Insert the heading for the section currently being inserted.
-
-This function should only be used inside `magit-insert-section'.
-
-When called without any arguments, then just set the `content'
-slot of the object representing the section being inserted to
-a marker at `point'.  The section should only contain a single
-line when this function is used like this.
-
-When called with arguments ARGS, which have to be strings, then
-insert those strings at point.  The section should not contain
-any text before this happens and afterwards it should again only
-contain a single line.  If the `face' property is set anywhere
-inside any of these strings, then insert all of them unchanged.
-Otherwise use the `magit-section-heading' face for all inserted
-text.
-
-The `content' property of the section struct is the end of the
-heading (which lasts from `start' to `content') and the beginning
-of the the body (which lasts from `content' to `end').  If the
-value of `content' is nil, then the section has no heading and
-its body cannot be collapsed.  If a section does have a heading,
-then its height must be exactly one line, including a trailing
-newline character.  This isn't enforced, you are responsible for
-getting it right.  The only exception is that this function does
-insert a newline character if necessary."
-  (declare (indent defun))
-  (when args
-    (let ((heading (apply #'concat args)))
-      (insert (if (next-single-property-change 0 'face (concat "0" heading))
-                  heading
-                (propertize heading 'face 'magit-section-heading)))))
-  (unless (bolp)
-    (insert ?\n))
-  (magit-maybe-make-margin-overlay)
-  (setf (magit-section-content magit-insert-section--current) (point-marker)))
-
-(defvar magit-insert-headers--hook nil "For internal use only.")
-(defvar magit-insert-headers--beginning nil "For internal use only.")
-
-(defun magit-insert-headers (hooks)
-  (let ((magit-insert-section-hook
-         (cons 'magit-insert-remaining-headers
-               (if (listp magit-insert-section-hook)
-                   magit-insert-section-hook
-                 (list magit-insert-section-hook))))
-        (magit-insert-headers--hook hooks)
-        wrapper)
-    (setq magit-insert-headers--beginning (point))
-    (while (and (setq wrapper (pop magit-insert-headers--hook))
-                (= (point) magit-insert-headers--beginning))
-      (funcall wrapper))))
-
-(defun magit-insert-remaining-headers ()
-  (if (= (point) magit-insert-headers--beginning)
-      (magit-cancel-section)
-    (magit-insert-heading)
-    (remove-hook 'magit-insert-section-hook 'magit-insert-remaining-headers)
-    (mapc #'funcall magit-insert-headers--hook)
-    (insert "\n")))
-
-(defun magit-insert-child-count (section)
-  "Modify SECTION's heading to contain number of child sections.
-
-If `magit-section-show-child-count' is non-nil and the SECTION
-has children and its heading ends with \":\", then replace that
-with \" (N)\", where N is the number of child sections.
-
-This function is called by `magit-insert-section' after that has
-evaluated its BODY.  Admittedly that's a bit of a hack."
-  ;; This has to be fast, not pretty!
-  (let (content count)
-    (when (and magit-section-show-child-count
-               (setq count (length (magit-section-children section)))
-               (> count 0)
-               (setq content (magit-section-content section))
-               (eq (char-before (1- content)) ?:))
-      (save-excursion
-        (goto-char (- content 2))
-        (insert (format " (%s)" count))
-        (delete-char 1)))))
-
-;;; Update
-
-(defvar-local magit-section-highlight-overlays nil)
-(defvar-local magit-section-highlighted-section nil)
-(defvar-local magit-section-highlighted-sections nil)
-(defvar-local magit-section-unhighlight-sections nil)
-
-(defun magit-section-update-region (_)
-  "When the region is a valid section-selection, highlight them all."
-  ;; At least that's what it does conceptually.  In actuality it just
-  ;; returns a list of those sections, and it doesn't even matter if
-  ;; this is a member of `magit-region-highlight-hook'.  It probably
-  ;; should be removed, but I want to make sure before removing it.
-  (magit-region-sections))
-
-(defun magit-section-update-highlight ()
-  (let ((section (magit-current-section)))
-    (unless (eq section magit-section-highlighted-section)
-      (let ((inhibit-read-only t)
-            (deactivate-mark nil)
-            (selection (magit-region-sections)))
-        (mapc #'delete-overlay magit-section-highlight-overlays)
-        (setq magit-section-highlight-overlays nil)
-        (setq magit-section-unhighlight-sections
-              magit-section-highlighted-sections)
-        (setq magit-section-highlighted-sections nil)
-        (unless (eq section magit-root-section)
-          (run-hook-with-args-until-success
-           'magit-section-highlight-hook section selection))
-        (--each magit-section-unhighlight-sections
-          (run-hook-with-args-until-success
-           'magit-section-unhighlight-hook it selection))
-        (restore-buffer-modified-p nil)
-        (unless (eq magit-section-highlighted-section section)
-          (setq magit-section-highlighted-section
-                (unless (magit-section-hidden section) section))))
-      (setq deactivate-mark nil))))
-
-(defun magit-section-highlight (section selection)
-  "Highlight SECTION and if non-nil all sections in SELECTION.
-This function works for any section but produces undesirable
-effects for diff related sections, which by default are
-highlighted using `magit-diff-highlight'.  Return t."
-  (cond (selection
-         (magit-section-make-overlay (magit-section-start     (car selection))
-                                     (magit-section-end (car (last selection)))
-                                     'magit-section-highlight)
-         (magit-section-highlight-selection nil selection))
-        (t
-         (magit-section-make-overlay (magit-section-start section)
-                                     (magit-section-end   section)
-                                     'magit-section-highlight)))
-  t)
-
-(defun magit-section-highlight-selection (_ selection)
-  "Highlight the section-selection region.
-If SELECTION is non-nil, then it is a list of sections selected by
-the region.  The headings of these sections are then highlighted.
-
-This is a fallback for people who don't want to highlight the
-current section and therefore removed `magit-section-highlight'
-from `magit-section-highlight-hook'.
-
-This function is necessary to ensure that a representation of
-such a region is visible.  If neither of these functions were
-part of the hook variable, then such a region would be
-invisible."
-  (when selection
-    (--each selection
-      (magit-section-make-overlay (magit-section-start it)
-                                  (or (magit-section-content it)
-                                      (magit-section-end it))
-                                  'magit-section-heading-selection))
-    t))
-
-(defun magit-section-make-overlay (start end face)
-  ;; Yes, this doesn't belong here.  But the alternative of
-  ;; spreading this hack across the code base is even worse.
-  (when (and magit-keep-region-overlay
-             (memq face '(magit-section-heading-selection
-                          magit-diff-file-heading-selection
-                          magit-diff-hunk-heading-selection)))
-    (setq face (list :foreground (face-foreground face))))
-  (let ((ov (make-overlay start end nil t)))
-    (overlay-put ov 'face face)
-    (overlay-put ov 'evaporate t)
-    (push ov magit-section-highlight-overlays)
-    ov))
-
-(defun magit-section-goto-successor (section line char arg)
-  (let ((ident (magit-section-ident section)))
-    (--if-let (magit-get-section ident)
-        (let ((start (magit-section-start it)))
-          (goto-char start)
-          (unless (eq it magit-root-section)
-            (ignore-errors
-              (forward-line line)
-              (forward-char char))
-            (unless (eq (magit-current-section) it)
-              (goto-char start))))
-      (or (and (eq (magit-section-type section) 'hunk)
-               (-when-let (parent (magit-get-section
-                                   (magit-section-ident
-                                    (magit-section-parent section))))
-                 (let* ((children (magit-section-children parent))
-                        (siblings (magit-section-siblings section 'prev))
-                        (previous (nth (length siblings) children)))
-                   (if (not arg)
-                       (--when-let (or previous (car (last children)))
-                         (magit-section-goto it)
-                         t)
-                     (when previous
-                       (magit-section-goto previous))
-                     (if (and (stringp arg)
-                              (re-search-forward
-                               arg (magit-section-end parent) t))
-                         (goto-char (match-beginning 0))
-                       (goto-char (magit-section-end (car (last children))))
-                       (forward-line -1)
-                       (while (looking-at "^ ")    (forward-line -1))
-                       (while (looking-at "^[-+]") (forward-line -1))
-                       (forward-line))))))
-          (goto-char (--if-let (magit-section-goto-successor-1 section)
-                         (if (eq (magit-section-type it) 'button)
-                             (point-min)
-                           (magit-section-start it))
-                       (point-min)))))))
-
-(defun magit-section-goto-successor-1 (section)
-  (or (--when-let (pcase (magit-section-type section)
-                    (`staged 'unstaged)
-                    (`unstaged 'staged)
-                    (`unpushed 'unpulled)
-                    (`unpulled 'unpushed))
-        (magit-get-section `((,it) (status))))
-      (--when-let (car (magit-section-siblings section 'next))
-        (magit-get-section (magit-section-ident it)))
-      (--when-let (car (magit-section-siblings section 'prev))
-        (magit-get-section (magit-section-ident it)))
-      (--when-let (magit-section-parent section)
-        (or (magit-get-section (magit-section-ident it))
-            (magit-section-goto-successor-1 it)))))
-
-;;; Visibility
-
-(defvar-local magit-section-visibility-cache nil)
-(put 'magit-section-visibility-cache 'permanent-local t)
-
-(defun magit-section-set-visibility-from-cache (section)
-  "Set SECTION's visibility to the cached value.
-Currently the cache can only be used to remember that a section's
-body should be collapsed, not that it should be expanded.  Return
-either `hide' or nil."
-  (and (member (magit-section-visibility-ident section)
-               magit-section-visibility-cache)
-       'hide))
-
-(cl-defun magit-section-cache-visibility
-    (&optional (section magit-insert-section--current))
-  (let ((ident (magit-section-visibility-ident section)))
-    (if (magit-section-hidden section)
-        (cl-pushnew ident magit-section-visibility-cache :test #'equal)
-      (setq magit-section-visibility-cache
-            (delete ident magit-section-visibility-cache)))))
-
-(defun magit-section-update-visibility-cache (section)
-  (setq magit-section-visibility-cache
-        (delete (magit-section-visibility-ident section)
-                magit-section-visibility-cache)))
-
-(defun magit-section-visibility-ident (section)
-  (let ((type  (magit-section-type  section))
-        (value (magit-section-value section)))
-    (cons type
-          (cond ((not (memq type '(unpulled unpushed))) value)
-                ((string-match-p "@{upstream}" value) value)
-                ;; Unfortunately Git chokes on "@{push}" when the
-                ;; value of `push.default' does not allow a 1:1
-                ;; mapping.  But collapsed logs of unpushed and
-                ;; unpulled commits in the status buffer should
-                ;; remain invisible after changing branches.
-                ;; So we have to pretend the value is constant.
-                ((string-match-p "\\`\\.\\." value) "..@{push}")
-                (t "@{push}..")))))
-
-;;; Utilities
-
-(cl-defun magit-section-selected-p (section &optional (selection nil sselection))
-  (and (not (eq section magit-root-section))
-       (or  (eq section (magit-current-section))
-            (memq section (if sselection
-                              selection
-                            (setq selection (magit-region-sections))))
-            (--when-let (magit-section-parent section)
-              (magit-section-selected-p it selection)))))
-
-(defun magit-section-parent-value (section)
-  (setq section (magit-section-parent section))
-  (when section (magit-section-value  section)))
-
-(defun magit-section-siblings (section &optional direction)
-  "Return a list of the sibling sections of SECTION.
-
-If optional DIRECTION is `prev', then return siblings that come
-before SECTION.  If it is `next', then return siblings that come
-after SECTION.  For all other values, return all siblings
-excluding SECTION itself."
-  (-when-let (parent (magit-section-parent section))
-    (let ((siblings  (magit-section-children parent)))
-      (pcase direction
-        (`prev  (cdr (member section (reverse siblings))))
-        (`next  (cdr (member section siblings)))
-        (_      (remq section siblings))))))
-
-(defun magit-region-values (&rest types)
-  "Return a list of the values of the selected sections.
-
-Also see `magit-region-sections' whose doc-string explains when a
-region is a valid section selection.  If the region is not active
-or is not a valid section selection, then return nil.  If optional
-TYPES is non-nil then the selection not only has to be valid; the
-types of all selected sections additionally have to match one of
-TYPES, or nil is returned."
-  (mapcar 'magit-section-value (apply 'magit-region-sections types)))
-
-(defun magit-region-sections (&rest types)
-  "Return a list of the selected sections.
-
-When the region is active and constitutes a valid section
-selection, then return a list of all selected sections.  This is
-the case when the region begins in the heading of a section and
-ends in the heading of a sibling of that first section.  When
-the selection is not valid then return nil.  Most commands that
-can act on the selected sections, then instead just act on the
-current section, the one point is in.
-
-When the region looks like it would in any other buffer then
-the selection is invalid.  When the selection is valid then the
-region uses the `magit-section-highlight' face.  This does not
-apply to diffs where things get a bit more complicated, but even
-here if the region looks like it usually does, then that's not
-a valid selection as far as this function is concerned.
-
-If optional TYPES is non-nil, then the selection not only has to
-be valid; the types of all selected sections additionally have to
-match one of TYPES, or nil is returned."
-  (when (use-region-p)
-    (let* ((rbeg (region-beginning))
-           (rend (region-end))
-           (sbeg (get-text-property rbeg 'magit-section))
-           (send (get-text-property rend 'magit-section)))
-      (unless (memq send (list sbeg magit-root-section nil))
-        (let ((siblings (magit-section-siblings sbeg 'next)) sections)
-          (when (and (memq send siblings)
-                     (magit-section-position-in-heading-p sbeg rbeg)
-                     (magit-section-position-in-heading-p send rend))
-            (while siblings
-              (push (car siblings) sections)
-              (when (eq (pop siblings) send)
-                (setq siblings nil)))
-            (setq sections (cons sbeg (nreverse sections)))
-            (when (or (not types)
-                      (--all-p (memq (magit-section-type it) types) sections))
-              sections)))))))
-
-(defun magit-section-position-in-heading-p (section pos)
-  "Return t if POSITION is inside the heading of SECTION."
-  (and (>= pos (magit-section-start section))
-       (<  pos (or (magit-section-content section)
-                   (magit-section-end section)))
-       t))
-
-(defun magit-section-internal-region-p (&optional section)
-  "Return t if the region is active and inside SECTION's body.
-If optional SECTION is nil, use the current section."
-  (and (region-active-p)
-       (or section (setq section (magit-current-section)))
-       (let ((beg (get-text-property (region-beginning) 'magit-section)))
-         (and (eq beg (get-text-property   (region-end) 'magit-section))
-              (eq beg section)))
-       (not (or (magit-section-position-in-heading-p section (region-beginning))
-                (magit-section-position-in-heading-p section (region-end))))
-       t))
-
-(defun magit-section--backward-protected ()
-  "Move to the beginning of the current or the previous visible section.
-Same as `magit-section-backward' but for non-interactive use.
-Suppress `magit-section-movement-hook', and return a boolean to
-indicate whether a section was found, instead of raising an error
-if not."
-  (condition-case nil
-      (let ((magit-section-movement-hook nil))
-        (magit-section-backward)
-        t)
-    (user-error nil)))
-
-(defun magit-section--backward-find (predicate)
-  "Move to the first previous section satisfying PREDICATE.
-PREDICATE does not take any parameter and should not move
-point."
-  (let (found)
-    (while (and (setq found (magit-section--backward-protected))
-                (not (funcall predicate))))
-    found))
-
-(defun magit-wash-sequence (function)
-  "Repeatedly call FUNCTION until it returns nil or eob is reached.
-FUNCTION has to move point forward or return nil."
-  (while (and (not (eobp)) (funcall function))))
-
-(defun magit-add-section-hook (hook function &optional at append local)
-  "Add to the value of section hook HOOK the function FUNCTION.
-
-Add FUNCTION at the beginning of the hook list unless optional
-APPEND is non-nil, in which case FUNCTION is added at the end.
-If FUNCTION already is a member, then move it to the new location.
-
-If optional AT is non-nil and a member of the hook list, then
-add FUNCTION next to that instead.  Add before or after AT, or
-replace AT with FUNCTION depending on APPEND.  If APPEND is the
-symbol `replace', then replace AT with FUNCTION.  For any other
-non-nil value place FUNCTION right after AT.  If nil, then place
-FUNCTION right before AT.  If FUNCTION already is a member of the
-list but AT is not, then leave FUNCTION where ever it already is.
-
-If optional LOCAL is non-nil, then modify the hook's buffer-local
-value rather than its global value.  This makes the hook local by
-copying the default value.  That copy is then modified.
-
-HOOK should be a symbol.  If HOOK is void, it is first set to nil.
-HOOK's value must not be a single hook function.  FUNCTION should
-be a function that takes no arguments and inserts one or multiple
-sections at point, moving point forward.  FUNCTION may choose not
-to insert its section(s), when doing so would not make sense.  It
-should not be abused for other side-effects.  To remove FUNCTION
-again use `remove-hook'."
-  (unless (boundp hook)
-    (error "Cannot add function to undefined hook variable %s" hook))
-  (or (default-boundp hook) (set-default hook nil))
-  (let ((value (if local
-                   (if (local-variable-p hook)
-                       (symbol-value hook)
-                     (unless (local-variable-if-set-p hook)
-                       (make-local-variable hook))
-                     (copy-sequence (default-value hook)))
-                 (default-value hook))))
-    (if at
-        (when (setq at (member at value))
-          (setq value (delq function value))
-          (cond ((eq append 'replace)
-                 (setcar at function))
-                (append
-                 (push function (cdr at)))
-                (t
-                 (push (car at) (cdr at))
-                 (setcar at function))))
-      (setq value (delq function value)))
-    (unless (member function value)
-      (setq value (if append
-                      (append value (list function))
-                    (cons function value))))
-    (when (eq append 'replace)
-      (setq value (delq at value)))
-    (if local
-        (set hook value)
-      (set-default hook value))))
-
-(defun magit-run-section-hook (hook)
-  "Run HOOK, warning about invalid entries."
-  (--if-let (-remove #'functionp (symbol-value hook))
-      (progn
-        (message "`%s' contains entries that are no longer valid.
-%s\nUsing standard value instead.  Please re-configure hook variable."
-                 hook
-                 (mapconcat (lambda (sym) (format "  `%s'" sym)) it "\n"))
-        (sit-for 5)
-        (defvar magit--hook-standard-value nil)
-        (let ((magit--hook-standard-value
-               (eval (car (get hook 'standard-value)))))
-          (run-hooks 'magit---hook-standard-value)))
-    (run-hooks hook)))
-
-(provide 'magit-section)
-;;; magit-section.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-section.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-sequence.el
@@ -1,673 +0,0 @@
-;;; magit-sequence.el --- history manipulation in Magit  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2011-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; Support for Git commands that replay commits and help the user make
-;; changes along the way.  Supports `cherry-pick', `revert', `rebase',
-;; `rebase--interactive' and `am'.
-
-;;; Code:
-
-(require 'magit)
-
-;;; Options
-;;;; Faces
-
-(defface magit-sequence-pick
-  '((t :inherit default))
-  "Face used in sequence sections."
-  :group 'magit-faces)
-
-(defface magit-sequence-stop
-  '((((class color) (background light)) :foreground "DarkOliveGreen4")
-    (((class color) (background dark))  :foreground "DarkSeaGreen2"))
-  "Face used in sequence sections."
-  :group 'magit-faces)
-
-(defface magit-sequence-part
-  '((((class color) (background light)) :foreground "Goldenrod4")
-    (((class color) (background dark))  :foreground "LightGoldenrod2"))
-  "Face used in sequence sections."
-  :group 'magit-faces)
-
-(defface magit-sequence-head
-  '((((class color) (background light)) :foreground "SkyBlue4")
-    (((class color) (background dark))  :foreground "LightSkyBlue1"))
-  "Face used in sequence sections."
-  :group 'magit-faces)
-
-(defface magit-sequence-drop
-  '((((class color) (background light)) :foreground "IndianRed")
-    (((class color) (background dark))  :foreground "IndianRed"))
-  "Face used in sequence sections."
-  :group 'magit-faces)
-
-(defface magit-sequence-done
-  '((t :inherit magit-hash))
-  "Face used in sequence sections."
-  :group 'magit-faces)
-
-(defface magit-sequence-onto
-  '((t :inherit magit-sequence-done))
-  "Face used in sequence sections."
-  :group 'magit-faces)
-
-;;; Common
-
-;;;###autoload
-(defun magit-sequencer-continue ()
-  "Resume the current cherry-pick or revert sequence."
-  (interactive)
-  (if (magit-sequencer-in-progress-p)
-      (if (magit-anything-unstaged-p t)
-          (user-error "Cannot continue due to unstaged changes")
-        (magit-run-git-sequencer
-         (if (magit-revert-in-progress-p) "revert" "cherry-pick") "--continue"))
-    (user-error "No cherry-pick or revert in progress")))
-
-;;;###autoload
-(defun magit-sequencer-skip ()
-  "Skip the stopped at commit during a cherry-pick or revert sequence."
-  (interactive)
-  (if (magit-sequencer-in-progress-p)
-      (progn (magit-call-git "reset" "--hard")
-             (magit-sequencer-continue))
-    (user-error "No cherry-pick or revert in progress")))
-
-;;;###autoload
-(defun magit-sequencer-abort ()
-  "Abort the current cherry-pick or revert sequence.
-This discards all changes made since the sequence started."
-  (interactive)
-  (if (magit-sequencer-in-progress-p)
-      (magit-run-git-sequencer
-       (if (magit-revert-in-progress-p) "revert" "cherry-pick") "--abort")
-    (user-error "No cherry-pick or revert in progress")))
-
-(defun magit-sequencer-in-progress-p ()
-  (or (magit-cherry-pick-in-progress-p)
-      (magit-revert-in-progress-p)))
-
-;;; Cherry-Pick
-
-;;;###autoload (autoload 'magit-cherry-pick-popup "magit-sequence" nil t)
-(magit-define-popup magit-cherry-pick-popup
-  "Popup console for cherry-pick commands."
-  :man-page "git-cherry-pick"
-  :switches '((?s "Add Signed-off-by lines"            "--signoff")
-              (?e "Edit commit messages"               "--edit")
-              (?x "Reference cherry in commit message" "-x")
-              (?F "Attempt fast-forward"               "--ff"))
-  :options  '((?s "Strategy"                        "--strategy=")
-              (?m "Replay merge relative to parent" "--mainline="))
-  :actions  '((?A "Cherry Pick"  magit-cherry-pick)
-              (?a "Cherry Apply" magit-cherry-apply))
-  :sequence-actions '((?A "Continue" magit-sequencer-continue)
-                      (?s "Skip"     magit-sequencer-skip)
-                      (?a "Abort"    magit-sequencer-abort))
-  :sequence-predicate 'magit-sequencer-in-progress-p
-  :default-arguments '("--ff"))
-
-(defun magit-cherry-pick-read-args (prompt)
-  (list (or (nreverse (magit-region-values 'commit))
-            (magit-read-other-branch-or-commit prompt))
-        (magit-cherry-pick-arguments)))
-
-;;;###autoload
-(defun magit-cherry-pick (commit &optional args)
-  "Cherry-pick COMMIT.
-Prompt for a commit, defaulting to the commit at point.  If
-the region selects multiple commits, then pick all of them,
-without prompting."
-  (interactive (magit-cherry-pick-read-args "Cherry-pick"))
-  (unless (--any (string-prefix-p "--mainline" it) args)
-    (magit-assert-one-parent (car (if (listp commit)
-                                      commit
-                                    (split-string commit "\\.\\.")))
-                             "cherry-pick"))
-  (magit-run-git-sequencer "cherry-pick" args commit))
-
-;;;###autoload
-(defun magit-cherry-apply (commit &optional args)
-  "Apply the changes in COMMIT but do not commit them.
-Prompt for a commit, defaulting to the commit at point.  If
-the region selects multiple commits, then apply all of them,
-without prompting."
-  (interactive (magit-cherry-pick-read-args "Apply changes from commit"))
-  (unless (--any (string-prefix-p "--mainline" it) args)
-    (magit-assert-one-parent commit "cherry-pick"))
-  (magit-run-git-sequencer "cherry-pick" "--no-commit"
-                           (remove "--ff" args) commit))
-
-(defun magit-cherry-pick-in-progress-p ()
-  ;; .git/sequencer/todo does not exist when there is only one commit left.
-  (file-exists-p (magit-git-dir "CHERRY_PICK_HEAD")))
-
-;;; Revert
-
-;;;###autoload (autoload 'magit-revert-popup "magit-sequence" nil t)
-(magit-define-popup magit-revert-popup
-  "Popup console for revert commands."
-  :man-page "git-revert"
-  :switches '((?s "Add Signed-off-by lines" "--signoff"))
-  :options  '((?s "Strategy"       "--strategy=")
-              (?S "Sign using gpg" "--gpg-sign=" magit-read-gpg-secret-key)
-              (?m "Replay merge relative to parent" "--mainline="))
-  :actions  '((?V "Revert commit(s)" magit-revert)
-              (?v "Revert changes"   magit-revert-no-commit))
-  :sequence-actions '((?V "Continue" magit-sequencer-continue)
-                      (?s "Skip"     magit-sequencer-skip)
-                      (?a "Abort"    magit-sequencer-abort))
-  :sequence-predicate 'magit-sequencer-in-progress-p)
-
-(defun magit-revert-read-args (prompt)
-  (list (or (magit-region-values 'commit)
-            (magit-read-branch-or-commit prompt))
-        (magit-revert-arguments)))
-
-;;;###autoload
-(defun magit-revert (commit &optional args)
-  "Revert COMMIT by creating a new commit.
-Prompt for a commit, defaulting to the commit at point.  If
-the region selects multiple commits, then revert all of them,
-without prompting."
-  (interactive (magit-revert-read-args "Revert commit"))
-  (unless (--any (string-prefix-p "--mainline" it) args)
-    (magit-assert-one-parent commit "revert"))
-  (magit-run-git-sequencer "revert" args commit))
-
-;;;###autoload
-(defun magit-revert-no-commit (commit &optional args)
-  "Revert COMMIT by applying it in reverse to the worktree.
-Prompt for a commit, defaulting to the commit at point.  If
-the region selects multiple commits, then revert all of them,
-without prompting."
-  (interactive (magit-revert-read-args "Revert changes"))
-  (unless (--any (string-prefix-p "--mainline" it) args)
-    (magit-assert-one-parent commit "revert"))
-  (magit-run-git-sequencer "revert" "--no-commit" args commit))
-
-(defun magit-revert-in-progress-p ()
-  ;; .git/sequencer/todo does not exist when there is only one commit left.
-  (file-exists-p (magit-git-dir "REVERT_HEAD")))
-
-;;; Patch
-
-;;;###autoload (autoload 'magit-am-popup "magit-sequence" nil t)
-(magit-define-popup magit-am-popup
-  "Popup console for mailbox commands."
-  :man-page "git-am"
-  :switches '((?3 "Fall back on 3way merge"           "--3way")
-              (?s "Add Signed-off-by lines"           "--signoff")
-              (?c "Remove text before scissors line"  "--scissors")
-              (?k "Inhibit removal of email cruft"    "--keep")
-              (?b "Limit removal of email cruft"      "--keep-non-patch")
-              (?d "Use author date as committer date"
-                  "--committer-date-is-author-date")
-              (?D "Use committer date as author date" "--ignore-date"))
-  :options  '((?p "Remove leading slashes from paths" "-p"
-                  magit-popup-read-number))
-  :actions  '((?w "Apply patches" magit-am-apply-patches)
-              (?m "Apply maildir" magit-am-apply-maildir))
-  :default-arguments '("--3way")
-  :default-actions 'magit-am-apply-patches
-  :sequence-actions '((?w "Continue" magit-am-continue)
-                      (?s "Skip"     magit-am-skip)
-                      (?a "Abort"    magit-am-abort))
-  :sequence-predicate 'magit-am-in-progress-p)
-
-;;;###autoload
-(defun magit-am-apply-patches (&optional files args)
-  "Apply the patches FILES."
-  (interactive (list (or (magit-region-values 'file)
-                         (list (let ((default (magit-file-at-point)))
-                                 (read-file-name
-                                  (if default
-                                      (format "Apply patch (%s): " default)
-                                    "Apply patch: ")
-                                  nil default))))
-                     (magit-am-arguments)))
-  (magit-run-git-sequencer "am" args "--" (mapcar 'expand-file-name files)))
-
-;;;###autoload
-(defun magit-am-apply-maildir (&optional maildir args)
-  "Apply the patches from MAILDIR."
-  (interactive (list (read-file-name "Apply mbox or Maildir: ")
-                     (magit-am-arguments)))
-  (magit-run-git-sequencer "am" args (expand-file-name maildir)))
-
-;;;###autoload
-(defun magit-am-continue ()
-  "Resume the current patch applying sequence."
-  (interactive)
-  (if (magit-am-in-progress-p)
-      (if (magit-anything-unstaged-p t)
-          (error "Cannot continue due to unstaged changes")
-        (magit-run-git-sequencer "am" "--continue"))
-    (user-error "Not applying any patches")))
-
-;;;###autoload
-(defun magit-am-skip ()
-  "Skip the stopped at patch during a patch applying sequence."
-  (interactive)
-  (if (magit-am-in-progress-p)
-      (magit-run-git-sequencer "am" "--skip")
-    (user-error "Not applying any patches")))
-
-;;;###autoload
-(defun magit-am-abort ()
-  "Abort the current patch applying sequence.
-This discards all changes made since the sequence started."
-  (interactive)
-  (if (magit-am-in-progress-p)
-      (magit-run-git "am" "--abort")
-    (user-error "Not applying any patches")))
-
-(defun magit-am-in-progress-p ()
-  (file-exists-p (magit-git-dir "rebase-apply/applying")))
-
-;;; Rebase
-
-;;;###autoload (autoload 'magit-rebase-popup "magit-sequence" nil t)
-(magit-define-popup magit-rebase-popup
-  "Key menu for rebasing."
-  :man-page "git-rebase"
-  :switches '((?k "Keep empty commits"       "--keep-empty")
-              (?p "Preserve merges"          "--preserve-merges")
-              (?c "Lie about committer date" "--committer-date-is-author-date")
-              (?a "Autosquash"               "--autosquash")
-              (?A "Autostash"                "--autostash")
-              (?i "Interactive"              "--interactive")
-              (?h "Disable hooks"            "--no-verify"))
-  :actions  '((lambda ()
-                (concat (propertize "Rebase " 'face 'magit-popup-heading)
-                        (propertize (or (magit-get-current-branch) "HEAD")
-                                    'face 'magit-branch-local)
-                        (propertize " onto" 'face 'magit-popup-heading)))
-              (?p (lambda ()
-                    (--when-let (magit-get-push-branch) (concat it "\n")))
-                  magit-rebase-onto-pushremote)
-              (?u (lambda ()
-                    (--when-let (magit-get-upstream-branch) (concat it "\n")))
-                  magit-rebase-onto-upstream)
-              (?e "elsewhere"               magit-rebase)
-              "Rebase"
-              (?i "interactively"      magit-rebase-interactive)
-              (?m "to edit a commit"   magit-rebase-edit-commit)
-              (?s "subset"             magit-rebase-subset)
-              (?w "to reword a commit" magit-rebase-reword-commit) nil
-              (?f "to autosquash"      magit-rebase-autosquash))
-  :sequence-actions '((?r "Continue" magit-rebase-continue)
-                      (?s "Skip"     magit-rebase-skip)
-                      (?e "Edit"     magit-rebase-edit)
-                      (?a "Abort"    magit-rebase-abort))
-  :sequence-predicate 'magit-rebase-in-progress-p
-  :max-action-columns 2)
-
-(defun magit-git-rebase (target args)
-  (magit-run-git-sequencer "rebase" target args))
-
-;;;###autoload
-(defun magit-rebase-onto-pushremote (args)
-  "Rebase the current branch onto `branch.<name>.pushRemote'.
-If that variable is unset, then rebase onto `remote.pushDefault'."
-  (interactive (list (magit-rebase-arguments)))
-  (--if-let (magit-get-current-branch)
-      (-if-let (remote (magit-get-push-remote it))
-          (if (member remote (magit-list-remotes))
-              (magit-git-rebase (concat remote "/" it) args)
-            (user-error "Remote `%s' doesn't exist" remote))
-        (user-error "No push-remote is configured for %s" it))
-    (user-error "No branch is checked out")))
-
-;;;###autoload
-(defun magit-rebase-onto-upstream (args)
-  "Rebase the current branch onto its upstream branch."
-  (interactive (list (magit-rebase-arguments)))
-  (--if-let (magit-get-current-branch)
-      (-if-let (target (magit-get-upstream-branch it))
-          (magit-git-rebase target args)
-        (user-error "No upstream is configured for %s" it))
-    (user-error "No branch is checked out")))
-
-;;;###autoload
-(defun magit-rebase (target args)
-  "Rebase the current branch onto a branch read in the minibuffer.
-All commits that are reachable from `HEAD' but not from the
-selected branch TARGET are being rebased."
-  (interactive (list (magit-read-other-branch-or-commit "Rebase onto")
-                     (magit-rebase-arguments)))
-  (message "Rebasing...")
-  (magit-git-rebase target args)
-  (message "Rebasing...done"))
-
-;;;###autoload
-(defun magit-rebase-subset (newbase start args)
-  "Rebase a subset of the current branch's history onto a new base.
-Rebase commits from START to `HEAD' onto NEWBASE.
-START has to be selected from a list of recent commits."
-  (interactive (list (magit-read-other-branch-or-commit
-                      "Rebase subset onto" nil
-                      (magit-get-upstream-branch))
-                     nil
-                     (magit-rebase-arguments)))
-  (if start
-      (progn (message "Rebasing...")
-             (magit-run-git-sequencer "rebase" "--onto" newbase start args)
-             (message "Rebasing...done"))
-    (magit-log-select
-      `(lambda (commit)
-         (magit-rebase-subset ,newbase (concat commit "^") (list ,@args)))
-      (concat "Type %p on a commit to rebase it "
-              "and commits above it onto " newbase ","))))
-
-(defun magit-rebase-interactive-1 (commit args message &optional editor)
-  (declare (indent 2))
-  (when commit
-    (if (eq commit :merge-base)
-        (setq commit (--if-let (magit-get-upstream-branch)
-                         (magit-git-string "merge-base" it "HEAD")
-                       nil))
-      (unless (magit-rev-ancestor-p commit "HEAD")
-        (user-error "%s isn't an ancestor of HEAD" commit))
-      (if (magit-commit-parents commit)
-          (setq commit (concat commit "^"))
-        (setq args (cons "--root" args)))))
-  (when (and commit
-             (magit-git-lines "rev-list" "--merges" (concat commit "..HEAD")))
-    (magit-read-char-case "Proceed despite merge in rebase range?  " nil
-      (?c "[c]ontinue")
-      (?s "[s]elect other" (setq commit nil))
-      (?a "[a]bort" (user-error "Quit"))))
-  (if commit
-      (let ((process-environment process-environment))
-        (when editor
-          (push (concat "GIT_SEQUENCE_EDITOR=" editor) process-environment))
-        (magit-run-git-sequencer "rebase" "-i" args
-                                 (unless (member "--root" args) commit)))
-    (magit-log-select
-      `(lambda (commit)
-         (magit-rebase-interactive-1 commit (list ,@args) ,message ,editor))
-      message)))
-
-;;;###autoload
-(defun magit-rebase-interactive (commit args)
-  "Start an interactive rebase sequence."
-  (interactive (list (magit-commit-at-point)
-                     (magit-rebase-arguments)))
-  (magit-rebase-interactive-1 commit args
-    "Type %p on a commit to rebase it and all commits above it,"))
-
-;;;###autoload
-(defun magit-rebase-autosquash (args)
-  "Combine squash and fixup commits with their intended targets."
-  (interactive (list (magit-rebase-arguments)))
-  (magit-rebase-interactive-1 :merge-base (cons "--autosquash" args)
-    "Type %p on a commit to squash into it and then rebase as necessary,"
-    "true"))
-
-;;;###autoload
-(defun magit-rebase-edit-commit (commit args)
-  "Edit a single older commit using rebase."
-  (interactive (list (magit-commit-at-point)
-                     (magit-rebase-arguments)))
-  (magit-rebase-interactive-1 commit args
-    "Type %p on a commit to edit it,"
-    "perl -i -p -e '++$x if not $x and s/^pick/edit/'"))
-
-;;;###autoload
-(defun magit-rebase-reword-commit (commit args)
-  "Reword a single older commit using rebase."
-  (interactive (list (magit-commit-at-point)
-                     (magit-rebase-arguments)))
-  (magit-rebase-interactive-1 commit args
-    "Type %p on a commit to reword its message,"
-    "perl -i -p -e '++$x if not $x and s/^pick/reword/'"))
-
-;;;###autoload
-(defun magit-rebase-continue (&optional noedit)
-  "Restart the current rebasing operation.
-In some cases this pops up a commit message buffer for you do
-edit.  With a prefix argument the old message is reused as-is."
-  (interactive "P")
-  (if (magit-rebase-in-progress-p)
-      (if (magit-anything-unstaged-p t)
-          (user-error "Cannot continue rebase with unstaged changes")
-        (if noedit
-            (let ((process-environment process-environment))
-              (push "GIT_EDITOR=true" process-environment)
-              (magit-run-git-async "rebase" "--continue")
-              (set-process-sentinel magit-this-process
-                                    #'magit-sequencer-process-sentinel)
-              magit-this-process)
-          (magit-run-git-sequencer "rebase" "--continue")))
-    (user-error "No rebase in progress")))
-
-;;;###autoload
-(defun magit-rebase-skip ()
-  "Skip the current commit and restart the current rebase operation."
-  (interactive)
-  (if (magit-rebase-in-progress-p)
-      (magit-run-git-sequencer "rebase" "--skip")
-    (user-error "No rebase in progress")))
-
-;;;###autoload
-(defun magit-rebase-edit ()
-  "Edit the todo list of the current rebase operation."
-  (interactive)
-  (if (magit-rebase-in-progress-p)
-      (magit-run-git-sequencer "rebase" "--edit-todo")
-    (user-error "No rebase in progress")))
-
-;;;###autoload
-(defun magit-rebase-abort ()
-  "Abort the current rebase operation, restoring the original branch."
-  (interactive)
-  (if (magit-rebase-in-progress-p)
-      (when (magit-confirm 'abort-rebase "Abort this rebase")
-        (magit-run-git "rebase" "--abort"))
-    (user-error "No rebase in progress")))
-
-(defun magit-rebase-in-progress-p ()
-  "Return t if a rebase is in progress."
-  (or (file-exists-p (magit-git-dir "rebase-merge"))
-      (file-exists-p (magit-git-dir "rebase-apply/onto"))))
-
-;;; Sections
-
-(defun magit-insert-sequencer-sequence ()
-  "Insert section for the on-going cherry-pick or revert sequence.
-If no such sequence is in progress, do nothing."
-  (let ((picking (magit-cherry-pick-in-progress-p)))
-    (when (or picking (magit-revert-in-progress-p))
-      (magit-insert-section (sequence)
-        (magit-insert-heading (if picking "Cherry Picking" "Reverting"))
-        (-when-let (lines (cdr (magit-file-lines (magit-git-dir "sequencer/todo"))))
-          (dolist (line (nreverse lines))
-            (when (string-match "^\\(pick\\|revert\\) \\([^ ]+\\) \\(.*\\)$" line)
-              (magit-bind-match-strings (cmd hash msg) line
-                (magit-insert-section (commit hash)
-                  (insert (propertize cmd 'face 'magit-sequence-pick)
-                          " " (propertize hash 'face 'magit-hash)
-                          " " msg "\n"))))))
-        (magit-sequence-insert-sequence
-         (magit-file-line (magit-git-dir (if picking
-                                             "CHERRY_PICK_HEAD"
-                                           "REVERT_HEAD")))
-         (magit-file-line (magit-git-dir "sequencer/head")))
-        (insert "\n")))))
-
-(defun magit-insert-am-sequence ()
-  "Insert section for the on-going patch applying sequence.
-If no such sequence is in progress, do nothing."
-  (when (magit-am-in-progress-p)
-    (magit-insert-section (rebase-sequence)
-      (magit-insert-heading "Applying patches")
-      (let ((patches (nreverse (magit-rebase-patches)))
-            patch commit)
-        (while patches
-          (setq patch (pop patches))
-          (setq commit (magit-rev-verify-commit
-                        (cadr (split-string (magit-file-line patch)))))
-          (cond ((and commit patches)
-                 (magit-sequence-insert-commit
-                  "pick" commit 'magit-sequence-pick))
-                (patches
-                 (magit-sequence-insert-am-patch
-                  "pick" patch 'magit-sequence-pick))
-                (commit
-                 (magit-sequence-insert-sequence commit "ORIG_HEAD"))
-                (t
-                 (magit-sequence-insert-am-patch
-                  "stop" patch 'magit-sequence-stop)
-                 (magit-sequence-insert-sequence nil "ORIG_HEAD")))))
-      (insert ?\n))))
-
-(defun magit-sequence-insert-am-patch (type patch face)
-  (magit-insert-section (file patch)
-    (insert (propertize type 'face face)
-            ?\s (propertize (file-name-nondirectory patch) 'face 'magit-hash)
-            ?\n)))
-
-(defun magit-insert-rebase-sequence ()
-  "Insert section for the on-going rebase sequence.
-If no such sequence is in progress, do nothing."
-  (when (magit-rebase-in-progress-p)
-    (let* ((interactive (file-directory-p (magit-git-dir "rebase-merge")))
-           (dir  (if interactive "rebase-merge/" "rebase-apply/"))
-           (name (-> (concat dir "head-name") magit-git-dir magit-file-line))
-           (onto (-> (concat dir "onto")      magit-git-dir magit-file-line))
-           (onto (or (magit-rev-name onto name)
-                     (magit-rev-name onto "refs/heads/*") onto))
-           (name (or (magit-rev-name name "refs/heads/*") name)))
-      (magit-insert-section (rebase-sequence)
-        (magit-insert-heading (format "Rebasing %s onto %s" name onto))
-        (if interactive
-            (magit-rebase-insert-merge-sequence onto)
-          (magit-rebase-insert-apply-sequence onto))
-        (insert ?\n)))))
-
-(defun magit-rebase-insert-merge-sequence (onto)
-  (dolist (line (nreverse
-                 (magit-file-lines
-                  (magit-git-dir "rebase-merge/git-rebase-todo"))))
-    (when (string-match (format "^\\([^%c ]+\\) \\([^ ]+\\) .*$"
-                                (string-to-char
-                                 (or (magit-get "core.commentChar") "#")))
-                        line)
-      (magit-bind-match-strings (action hash) line
-        (unless (equal action "exec")
-          (magit-sequence-insert-commit action hash 'magit-sequence-pick)))))
-  (magit-sequence-insert-sequence
-   (magit-file-line (magit-git-dir "rebase-merge/stopped-sha"))
-   onto
-   (--when-let (magit-file-lines (magit-git-dir "rebase-merge/done"))
-     (cadr (split-string (car (last it)))))))
-
-(defun magit-rebase-insert-apply-sequence (onto)
-  (let ((rewritten
-         (--map (car (split-string it))
-                (magit-file-lines (magit-git-dir "rebase-apply/rewritten"))))
-        (stop (magit-file-line (magit-git-dir "rebase-apply/original-commit"))))
-    (dolist (patch (nreverse (cdr (magit-rebase-patches))))
-      (let ((hash (cadr (split-string (magit-file-line patch)))))
-        (unless (or (member hash rewritten)
-                    (equal hash stop))
-          (magit-sequence-insert-commit "pick" hash 'magit-sequence-pick)))))
-  (magit-sequence-insert-sequence
-   (magit-file-line (magit-git-dir "rebase-apply/original-commit"))
-   onto))
-
-(defun magit-rebase-patches ()
-  (directory-files (magit-git-dir "rebase-apply") t "^[0-9]\\{4\\}$"))
-
-(defun magit-sequence-insert-sequence (stop onto &optional orig)
-  (let ((head (magit-rev-parse "HEAD")) done)
-    (setq onto (if onto (magit-rev-parse onto) head))
-    (setq done (magit-git-lines "log" "--format=%H" (concat onto "..HEAD")))
-    (when (and stop (not (member stop done)))
-      (let ((id (magit-patch-id stop)))
-        (--if-let (--first (equal (magit-patch-id it) id) done)
-            (setq stop it)
-          (cond
-           ((--first (magit-rev-equal it stop) done)
-            ;; The commit's testament has been executed.
-            (magit-sequence-insert-commit "void" stop 'magit-sequence-drop))
-           ;; The faith of the commit is still undecided...
-           ((magit-anything-unmerged-p)
-            ;; ...and time travel isn't for the faint of heart.
-            (magit-sequence-insert-commit "join" stop 'magit-sequence-part))
-           ((magit-anything-modified-p t)
-            ;; ...and the dust hasn't settled yet...
-            (magit-sequence-insert-commit
-             (let* ((magit--refresh-cache nil)
-                    (staged   (magit-commit-tree "oO" nil "HEAD"))
-                    (unstaged (magit-commit-worktree "oO" "--reset")))
-               (cond
-                ;; ...but we could end up at the same tree just by committing.
-                ((or (magit-rev-equal staged   stop)
-                     (magit-rev-equal unstaged stop)) "goal")
-                ;; ...but the changes are still there, untainted.
-                ((or (equal (magit-patch-id staged)   id)
-                     (equal (magit-patch-id unstaged) id)) "same")
-                ;; ...and some changes are gone and/or others were added.
-                (t "work")))
-             stop 'magit-sequence-part))
-           ;; The commit is definitely gone...
-           ((--first (magit-rev-equal it stop) done)
-            ;; ...but all of its changes are still in effect.
-            (magit-sequence-insert-commit "poof" stop 'magit-sequence-drop))
-           (t
-            ;; ...and some changes are gone and/or other changes were added.
-            (magit-sequence-insert-commit "gone" stop 'magit-sequence-drop)))
-          (setq stop nil))))
-    (dolist (rev done)
-      (apply 'magit-sequence-insert-commit
-             (cond ((equal rev stop)
-                    ;; ...but its reincarnation lives on.
-                    ;; Or it didn't die in the first place.
-                    (list (if (and (equal rev head)
-                                   (equal (magit-patch-id rev)
-                                          (magit-patch-id orig)))
-                              "stop" ; We haven't done anything yet.
-                            "like")  ; There are new commits.
-                          rev (if (equal rev head)
-                                  'magit-sequence-head
-                                'magit-sequence-stop)))
-                   ((equal rev head)
-                    (list "done" rev 'magit-sequence-head))
-                   (t
-                    (list "done" rev 'magit-sequence-done)))))
-    (magit-sequence-insert-commit "onto" onto
-                                (if (equal onto head)
-                                    'magit-sequence-head
-                                  'magit-sequence-onto))))
-
-(defun magit-sequence-insert-commit (type hash face)
-  (magit-insert-section (commit hash)
-    (insert (propertize type 'face face)    ?\s
-            (magit-format-rev-summary hash) ?\n)))
-
-(provide 'magit-sequence)
-;;; magit-sequence.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-sequence.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-stash.el
@@ -1,443 +0,0 @@
-;;; magit-stash.el --- stash support for Magit  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2008-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; Support for Git stashes.
-
-;;; Code:
-
-(require 'magit)
-
-(defvar bookmark-make-record-function)
-
-;;; Options
-
-(defgroup magit-stash nil
-  "List stashes and show stash diffs."
-  :group 'magit-modes)
-
-;;;; Diff options
-
-(defcustom magit-stash-sections-hook
-  '(magit-insert-stash-worktree
-    magit-insert-stash-index
-    magit-insert-stash-untracked)
-  "Hook run to insert sections into stash diff buffers."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-stash
-  :type 'hook)
-
-;;;; Log options
-
-(defcustom magit-stashes-margin
-  (list (nth 0 magit-log-margin)
-        (nth 1 magit-log-margin)
-        'magit-log-margin-width nil
-        (nth 4 magit-log-margin))
-  "Format of the margin in `magit-stashes-mode' buffers.
-
-The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH).
-
-If INIT is non-nil, then the margin is shown initially.
-STYLE controls how to format the committer date.  It can be one
-  of `age' (to show the age of the commit), `age-abbreviated' (to
-  abbreviate the time unit to a character), or a string (suitable
-  for `format-time-string') to show the actual date.
-WIDTH controls the width of the margin.  This exists for forward
-  compatibility and currently the value should not be changed.
-AUTHOR controls whether the name of the author is also shown by
-  default.
-AUTHOR-WIDTH has to be an integer.  When the name of the author
-  is shown, then this specifies how much space is used to do so."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-stash
-  :group 'magit-margin
-  :type magit-log-margin--custom-type
-  :initialize 'magit-custom-initialize-reset
-  :set-after '(magit-log-margin)
-  :set (apply-partially #'magit-margin-set-variable 'magit-stashes-mode))
-
-;;; Commands
-
-;;;###autoload (autoload 'magit-stash-popup "magit-stash" nil t)
-(magit-define-popup magit-stash-popup
-  "Popup console for stash commands."
-  :man-page "git-stash"
-  :switches '((?u "Also save untracked files" "--include-untracked")
-              (?a "Also save untracked and ignored files" "--all"))
-  :actions  '((?z "Save"               magit-stash)
-              (?Z "Snapshot"           magit-snapshot)
-              (?p "Pop"                magit-stash-pop)
-              (?i "Save index"         magit-stash-index)
-              (?I "Snapshot index"     magit-snapshot-index)
-              (?a "Apply"              magit-stash-apply)
-              (?w "Save worktree"      magit-stash-worktree)
-              (?W "Snapshot worktree"  magit-snapshot-worktree)
-              (?l "List"               magit-stash-list)
-              (?x "Save keeping index" magit-stash-keep-index)
-              (?r "Snapshot to wipref" magit-wip-commit)
-              (?v "Show"               magit-stash-show)
-              (?b "Branch"             magit-stash-branch)
-              (?k "Drop"               magit-stash-drop) nil
-              (?f "Format patch"       magit-stash-format-patch))
-  :default-action 'magit-stash
-  :max-action-columns 3)
-
-;;;###autoload
-(defun magit-stash (message &optional include-untracked)
-  "Create a stash of the index and working tree.
-Untracked files are included according to popup arguments.
-One prefix argument is equivalent to `--include-untracked'
-while two prefix arguments are equivalent to `--all'."
-  (interactive (magit-stash-read-args))
-  (magit-stash-save message t t include-untracked t))
-
-;;;###autoload
-(defun magit-stash-index (message)
-  "Create a stash of the index only.
-Unstaged and untracked changes are not stashed.  The stashed
-changes are applied in reverse to both the index and the
-worktree.  This command can fail when the worktree is not clean.
-Applying the resulting stash has the inverse effect."
-  (interactive (list (magit-stash-read-message)))
-  (magit-stash-save message t nil nil t 'worktree))
-
-;;;###autoload
-(defun magit-stash-worktree (message &optional include-untracked)
-  "Create a stash of unstaged changes in the working tree.
-Untracked files are included according to popup arguments.
-One prefix argument is equivalent to `--include-untracked'
-while two prefix arguments are equivalent to `--all'."
-  (interactive (magit-stash-read-args))
-  (magit-stash-save message nil t include-untracked t 'index))
-
-;;;###autoload
-(defun magit-stash-keep-index (message &optional include-untracked)
-  "Create a stash of the index and working tree, keeping index intact.
-Untracked files are included according to popup arguments.
-One prefix argument is equivalent to `--include-untracked'
-while two prefix arguments are equivalent to `--all'."
-  (interactive (magit-stash-read-args))
-  (magit-stash-save message t t include-untracked t 'index))
-
-(defun magit-stash-read-args ()
-  (list (magit-stash-read-message)
-        (magit-stash-read-untracked)))
-
-(defun magit-stash-read-untracked ()
-  (let ((prefix (prefix-numeric-value current-prefix-arg))
-        (args   (magit-stash-arguments)))
-    (cond ((or (= prefix 16) (member "--all" args)) 'all)
-          ((or (= prefix  4) (member "--include-untracked" args)) t))))
-
-(defun magit-stash-read-message ()
-  (let* ((default (format "On %s: "
-                          (or (magit-get-current-branch) "(no branch)")))
-         (input (magit-read-string "Stash message" default)))
-    (if (equal input default)
-        (concat default (magit-rev-format "%h %s"))
-      input)))
-
-;;;###autoload
-(defun magit-snapshot (&optional include-untracked)
-  "Create a snapshot of the index and working tree.
-Untracked files are included according to popup arguments.
-One prefix argument is equivalent to `--include-untracked'
-while two prefix arguments are equivalent to `--all'."
-  (interactive (magit-snapshot-read-args))
-  (magit-snapshot-save t t include-untracked t))
-
-;;;###autoload
-(defun magit-snapshot-index ()
-  "Create a snapshot of the index only.
-Unstaged and untracked changes are not stashed."
-  (interactive)
-  (magit-snapshot-save t nil nil t))
-
-;;;###autoload
-(defun magit-snapshot-worktree (&optional include-untracked)
-  "Create a snapshot of unstaged changes in the working tree.
-Untracked files are included according to popup arguments.
-One prefix argument is equivalent to `--include-untracked'
-while two prefix arguments are equivalent to `--all'."
-  (interactive (magit-snapshot-read-args))
-  (magit-snapshot-save nil t include-untracked t))
-
-(defun magit-snapshot-read-args ()
-  (list (magit-stash-read-untracked)))
-
-(defun magit-snapshot-save (index worktree untracked &optional refresh)
-  (magit-stash-save (concat "WIP on " (magit-stash-summary))
-                    index worktree untracked refresh t))
-
-;;;###autoload
-(defun magit-stash-apply (stash)
-  "Apply a stash to the working tree.
-Try to preserve the stash index.  If that fails because there
-are staged changes, apply without preserving the stash index."
-  (interactive (list (magit-read-stash "Apply stash" t)))
-  (if (= (magit-call-git "stash" "apply" "--index" stash) 0)
-      (magit-refresh)
-    (magit-run-git "stash" "apply" stash)))
-
-(defun magit-stash-pop (stash)
-  "Apply a stash to the working tree and remove it from stash list.
-Try to preserve the stash index.  If that fails because there
-are staged changes, apply without preserving the stash index
-and forgo removing the stash."
-  (interactive (list (magit-read-stash "Apply pop" t)))
-  (if (= (magit-call-git "stash" "apply" "--index" stash) 0)
-      (magit-stash-drop stash)
-    (magit-run-git "stash" "apply" stash)))
-
-;;;###autoload
-(defun magit-stash-drop (stash)
-  "Remove a stash from the stash list.
-When the region is active offer to drop all contained stashes."
-  (interactive (list (--if-let (magit-region-values 'stash)
-                         (or (magit-confirm t nil "Drop %i stashes" it)
-                             (user-error "Abort"))
-                       (magit-read-stash "Drop stash"))))
-  (dolist (stash (if (listp stash)
-                     (nreverse (prog1 stash (setq stash (car stash))))
-                   (list stash)))
-    (message "Deleted refs/%s (was %s)" stash
-             (magit-rev-parse "--short" stash))
-    (magit-call-git "rev-parse" stash)
-    (magit-call-git "reflog" "delete" "--updateref" "--rewrite" stash))
-  (-when-let (ref (and (string-match "\\(.+\\)@{[0-9]+}$" stash)
-                       (match-string 1 stash)))
-    (unless (string-match "^refs/" ref)
-      (setq ref (concat "refs/" ref)))
-    (unless (magit-rev-verify (concat ref "@{0}"))
-      (magit-run-git "update-ref" "-d" ref)))
-  (magit-refresh))
-
-;;;###autoload
-(defun magit-stash-clear (ref)
-  "Remove all stashes saved in REF's reflog by deleting REF."
-  (interactive
-   (let ((ref (or (magit-section-when 'stashes) "refs/stash")))
-     (if (magit-confirm t (format "Drop all stashes in %s" ref))
-         (list ref)
-       (user-error "Abort"))))
-  (magit-run-git "update-ref" "-d" ref))
-
-;;;###autoload
-(defun magit-stash-branch (stash branch)
-  "Create and checkout a new BRANCH from STASH."
-  (interactive (list (magit-read-stash "Branch stash" t)
-                     (magit-read-string-ns "Branch name")))
-  (magit-run-git "stash" "branch" branch stash))
-
-;;;###autoload
-(defun magit-stash-format-patch (stash)
-  "Create a patch from STASH"
-  (interactive (list (magit-read-stash "Create patch from stash" t)))
-  (with-temp-file (magit-rev-format "0001-%f.patch" stash)
-    (magit-git-insert "stash" "show" "-p" stash))
-  (magit-refresh))
-
-;;; Plumbing
-
-(defun magit-stash-save (message index worktree untracked
-                                 &optional refresh keep noerror ref)
-  (if (or (and index     (magit-staged-files t))
-          (and worktree  (magit-unstaged-files t))
-          (and untracked (magit-untracked-files (eq untracked 'all))))
-      (magit-with-toplevel
-        (magit-stash-store message (or ref "refs/stash")
-                           (magit-stash-create message index worktree untracked))
-        (if (eq keep 'worktree)
-            (with-temp-buffer
-              (magit-git-insert "diff" "--cached")
-              (magit-run-git-with-input
-               "apply" "--reverse" "--cached" "--ignore-space-change" "-")
-              (magit-run-git-with-input
-               "apply" "--reverse" "--ignore-space-change" "-"))
-          (unless (eq keep t)
-            (if (eq keep 'index)
-                (magit-call-git "checkout" "--" ".")
-              (magit-call-git "reset" "--hard" "HEAD"))
-            (when untracked
-              (magit-call-git "clean" "-f" (and (eq untracked 'all) "-x")))))
-        (when refresh
-          (magit-refresh)))
-    (unless noerror
-      (user-error "No %s changes to save" (cond ((not index)  "unstaged")
-                                                ((not worktree) "staged")
-                                                (t "local"))))))
-
-(defun magit-stash-store (message ref commit)
-  (magit-update-ref ref message commit t))
-
-(defun magit-stash-create (message index worktree untracked)
-  (unless (magit-rev-parse "--verify" "HEAD")
-    (error "You do not have the initial commit yet"))
-  (let ((magit-git-global-arguments (nconc (list "-c" "commit.gpgsign=false")
-                                           magit-git-global-arguments))
-        (default-directory (magit-toplevel))
-        (summary (magit-stash-summary))
-        (head "HEAD"))
-    (when (and worktree (not index))
-      (setq head (or (magit-commit-tree "pre-stash index" nil "HEAD")
-                     (error "Cannot save the current index state"))))
-    (or (setq index (magit-commit-tree (concat "index on " summary) nil head))
-        (error "Cannot save the current index state"))
-    (and untracked
-         (setq untracked (magit-untracked-files (eq untracked 'all)))
-         (setq untracked (magit-with-temp-index nil nil
-                           (or (and (magit-update-files untracked)
-                                    (magit-commit-tree
-                                     (concat "untracked files on " summary)))
-                               (error "Cannot save the untracked files")))))
-    (magit-with-temp-index index "-m"
-      (when worktree
-        (or (magit-update-files (magit-git-items "diff" "-z" "--name-only" head))
-            (error "Cannot save the current worktree state")))
-      (or (magit-commit-tree message nil head index untracked)
-          (error "Cannot save the current worktree state")))))
-
-(defun magit-stash-summary ()
-  (concat (or (magit-get-current-branch) "(no branch)")
-          ": " (magit-rev-format "%h %s")))
-
-;;; Sections
-
-(defvar magit-stashes-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-delete-thing] 'magit-stash-clear)
-    map)
-  "Keymap for `stashes' section.")
-
-(defvar magit-stash-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-visit-thing]  'magit-stash-show)
-    (define-key map [remap magit-delete-thing] 'magit-stash-drop)
-    (define-key map "a"  'magit-stash-apply)
-    (define-key map "A"  'magit-stash-pop)
-    map)
-  "Keymap for `stash' sections.")
-
-(magit-define-section-jumper magit-jump-to-stashes
-  "Stashes" stashes "refs/stash")
-
-(cl-defun magit-insert-stashes (&optional (ref   "refs/stash")
-                                          (heading "Stashes:"))
-  "Insert `stashes' section showing reflog for \"refs/stash\".
-If optional REF is non-nil, show reflog for that instead.
-If optional HEADING is non-nil, use that as section heading
-instead of \"Stashes:\"."
-  (when (magit-rev-verify ref)
-    (magit-insert-section (stashes ref (not magit-status-expand-stashes))
-      (magit-insert-heading heading)
-      (magit-git-wash (apply-partially 'magit-log-wash-log 'stash)
-        "reflog" "--format=%gd%x00%aN%x00%at%x00%gs" ref))))
-
-;;; List Stashes
-
-;;;###autoload
-(defun magit-stash-list ()
-  "List all stashes in a buffer."
-  (interactive)
-  (magit-mode-setup #'magit-stashes-mode "refs/stash"))
-
-(define-derived-mode magit-stashes-mode magit-reflog-mode "Magit Stashes"
-  "Mode for looking at lists of stashes."
-  :group 'magit-log
-  (hack-dir-local-variables-non-file-buffer)
-  (setq-local bookmark-make-record-function
-              #'magit-bookmark--stashes-make-record))
-
-(cl-defun magit-stashes-refresh-buffer (ref)
-  (magit-insert-section (stashesbuf)
-    (magit-insert-heading (if (equal ref "refs/stash")
-                              "Stashes:"
-                            (format "Stashes [%s]:" ref)))
-    (magit-git-wash (apply-partially 'magit-log-wash-log 'stash)
-      "reflog" "--format=%gd%x00%aN%x00%at%x00%gs" ref)))
-
-;;; Show Stash
-
-;;;###autoload
-(defun magit-stash-show (stash &optional args files)
-  "Show all diffs of a stash in a buffer."
-  (interactive (cons (or (and (not current-prefix-arg)
-                              (magit-stash-at-point))
-                         (magit-read-stash "Show stash"))
-                     (-let [(args files) (magit-diff-arguments)]
-                       (list (delete "--stat" args) files))))
-  (magit-mode-setup #'magit-stash-mode stash nil args files))
-
-(define-derived-mode magit-stash-mode magit-diff-mode "Magit Stash"
-  "Mode for looking at individual stashes."
-  :group 'magit-diff
-  (hack-dir-local-variables-non-file-buffer)
-  (setq-local bookmark-make-record-function
-              #'magit-bookmark--stash-make-record))
-
-(defun magit-stash-refresh-buffer (stash _const _args _files)
-  (setq header-line-format
-        (concat
-         "\s" (propertize (capitalize stash) 'face 'magit-section-heading)
-         "\s" (magit-rev-format "%s" stash)))
-  (setq magit-buffer-revision-hash (magit-rev-parse stash))
-  (magit-insert-section (stash)
-    (run-hooks 'magit-stash-sections-hook)))
-
-(defun magit-stash-insert-section (commit range message &optional files)
-  (magit-insert-section (commit commit)
-    (magit-insert-heading message)
-    (magit-git-wash #'magit-diff-wash-diffs
-      "diff" range "-p" "--no-prefix"
-      (nth 2 magit-refresh-args)
-      "--" (or files (nth 3 magit-refresh-args)))))
-
-(defun magit-insert-stash-index ()
-  "Insert section showing staged changes of the stash."
-  (let ((stash (car magit-refresh-args)))
-    (magit-stash-insert-section (format "%s^2" stash)
-                                (format "%s^..%s^2" stash stash)
-                                "Staged")))
-
-(defun magit-insert-stash-worktree ()
-  "Insert section showing unstaged changes of the stash."
-  (let ((stash (car magit-refresh-args)))
-    (magit-stash-insert-section stash
-                                (format "%s^2..%s" stash stash)
-                                "Unstaged")))
-
-(defun magit-insert-stash-untracked ()
-  "Insert section showing the untracked files commit of the stash."
-  (let ((stash (car magit-refresh-args))
-        (rev   (concat (car magit-refresh-args) "^3")))
-    (when (magit-rev-verify rev)
-      (magit-stash-insert-section (format "%s^3" stash)
-                                  (format "%s^..%s^3" stash stash)
-                                  "Untracked files"
-                                  (magit-git-items "ls-tree" "-z" "--name-only"
-                                                   "-r" "--full-tree" rev)))))
-
-(provide 'magit-stash)
-;;; magit-stash.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-stash.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-status.el
@@ -1,613 +0,0 @@
-;;; magit-status.el --- the grand overview  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements the status buffer.
-
-;;; Code:
-
-(require 'magit)
-
-(require 'subr-x)
-
-(defvar bookmark-make-record-function)
-
-;;; Options
-
-(defgroup magit-status nil
-  "Inspect and manipulate Git repositories."
-  :link '(info-link "(magit)Status Buffer")
-  :group 'magit-modes)
-
-(defcustom magit-status-mode-hook nil
-  "Hook run after entering Magit-Status mode."
-  :group 'magit-status
-  :type 'hook)
-
-(defcustom magit-status-headers-hook
-  '(magit-insert-error-header
-    magit-insert-diff-filter-header
-    magit-insert-head-branch-header
-    magit-insert-upstream-branch-header
-    magit-insert-push-branch-header
-    magit-insert-tags-header)
-  "Hook run to insert headers into the status buffer.
-
-This hook is run by `magit-insert-status-headers', which in turn
-has to be a member of `magit-status-sections-hook' to be used at
-all."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-status
-  :type 'hook
-  :options '(magit-insert-error-header
-             magit-insert-diff-filter-header
-             magit-insert-repo-header
-             magit-insert-remote-header
-             magit-insert-head-branch-header
-             magit-insert-upstream-branch-header
-             magit-insert-push-branch-header
-             magit-insert-tags-header))
-
-(defcustom magit-status-sections-hook
-  '(magit-insert-campaign-header
-    magit-insert-status-headers
-    magit-insert-merge-log
-    magit-insert-rebase-sequence
-    magit-insert-am-sequence
-    magit-insert-sequencer-sequence
-    magit-insert-bisect-output
-    magit-insert-bisect-rest
-    magit-insert-bisect-log
-    magit-insert-untracked-files
-    magit-insert-unstaged-changes
-    magit-insert-staged-changes
-    magit-insert-stashes
-    magit-insert-unpulled-from-upstream
-    magit-insert-unpulled-from-pushremote
-    magit-insert-unpushed-to-upstream
-    magit-insert-unpushed-to-pushremote)
-  "Hook run to insert sections into a status buffer."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-status
-  :type 'hook)
-
-(defcustom magit-status-expand-stashes t
-  "Whether the list of stashes is expanded initially."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-status
-  :type 'boolean)
-
-(defcustom magit-status-show-hashes-in-headers nil
-  "Whether headers in the status buffer show hashes.
-The functions which respect this option are
-`magit-insert-head-branch-header',
-`magit-insert-upstream-branch-header', and
-`magit-insert-push-branch-header'."
-  :package-version '(magit . "2.4.0")
-  :group 'magit-status
-  :type 'boolean)
-
-(defcustom magit-status-margin
-  (list nil
-        (nth 1 magit-log-margin)
-        'magit-log-margin-width nil
-        (nth 4 magit-log-margin))
-  "Format of the margin in `magit-status-mode' buffers.
-
-The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH).
-
-If INIT is non-nil, then the margin is shown initially.
-STYLE controls how to format the committer date.  It can be one
-  of `age' (to show the age of the commit), `age-abbreviated' (to
-  abbreviate the time unit to a character), or a string (suitable
-  for `format-time-string') to show the actual date.
-WIDTH controls the width of the margin.  This exists for forward
-  compatibility and currently the value should not be changed.
-AUTHOR controls whether the name of the author is also shown by
-  default.
-AUTHOR-WIDTH has to be an integer.  When the name of the author
-  is shown, then this specifies how much space is used to do so."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-status
-  :group 'magit-margin
-  :type magit-log-margin--custom-type
-  :initialize 'magit-custom-initialize-reset
-  :set-after '(magit-log-margin)
-  :set (apply-partially #'magit-margin-set-variable 'magit-status-mode))
-
-;;; Commands
-
-;;;###autoload
-(defun magit-init (directory)
-  "Initialize a Git repository, then show its status.
-
-If the directory is below an existing repository, then the user
-has to confirm that a new one should be created inside.  If the
-directory is the root of the existing repository, then the user
-has to confirm that it should be reinitialized.
-
-Non-interactively DIRECTORY is (re-)initialized unconditionally."
-  (interactive
-   (let ((directory (file-name-as-directory
-                     (expand-file-name
-                      (read-directory-name "Create repository in: ")))))
-     (-when-let (toplevel (magit-toplevel directory))
-       (setq toplevel (expand-file-name toplevel))
-       (unless (y-or-n-p (if (file-equal-p toplevel directory)
-                             (format "Reinitialize existing repository %s? "
-                                     directory)
-                           (format "%s is a repository.  Create another in %s? "
-                                   toplevel directory)))
-         (user-error "Abort")))
-     (list directory)))
-  ;; `git init' does not understand the meaning of "~"!
-  (magit-call-git "init" (magit-convert-filename-for-git
-                          (expand-file-name directory)))
-  (magit-status-internal directory))
-
-;;;###autoload
-(defun magit-status (&optional directory cache)
-  "Show the status of the current Git repository in a buffer.
-With a prefix argument prompt for a repository to be shown.
-With two prefix arguments prompt for an arbitrary directory.
-If that directory isn't the root of an existing repository,
-then offer to initialize it as a new repository."
-  (interactive
-   (let ((magit--refresh-cache (list (cons 0 0))))
-     (list (and (or current-prefix-arg (not (magit-toplevel)))
-                (magit-read-repository
-                 (>= (prefix-numeric-value current-prefix-arg) 16)))
-           magit--refresh-cache)))
-  (let ((magit--refresh-cache (or cache (list (cons 0 0)))))
-    (if directory
-        (let ((toplevel (magit-toplevel directory)))
-          (setq directory (file-name-as-directory
-                           (expand-file-name directory)))
-          (if (and toplevel (file-equal-p directory toplevel))
-              (magit-status-internal directory)
-            (when (y-or-n-p
-                   (if toplevel
-                       (format "%s is a repository.  Create another in %s? "
-                               toplevel directory)
-                     (format "Create repository in %s? " directory)))
-              ;; Creating a new repository will invalidate cached
-              ;; values.
-              (setq magit--refresh-cache nil)
-              (magit-init directory))))
-      (magit-status-internal default-directory))))
-
-(put 'magit-status 'interactive-only 'magit-status-internal)
-
-;;;###autoload
-(defun magit-status-internal (directory)
-  (magit--tramp-asserts directory)
-  (let ((default-directory directory))
-    (magit-mode-setup #'magit-status-mode)))
-
-(defvar magit--remotes-using-recent-git nil)
-
-(defun magit--tramp-asserts (directory)
-  (-when-let (remote (file-remote-p directory))
-    (unless (member remote magit--remotes-using-recent-git)
-      (-if-let (version (let ((default-directory directory))
-                          (magit-git-version)))
-          (if (version<= magit--minimal-git version)
-              (push version magit--remotes-using-recent-git)
-            (display-warning 'magit (format "\
-Magit requires Git >= %s, but on %s the version is %s.
-
-If multiple Git versions are installed on the host, then the
-problem might be that TRAMP uses the wrong executable.
-
-First check the value of `magit-git-executable'.  Its value is
-used when running git locally as well as when running it on a
-remote host.  The default value is \"git\", except on Windows
-where an absolute path is used for performance reasons.
-
-If the value already is just \"git\" but TRAMP never-the-less
-doesn't use the correct executable, then consult the info node
-`(tramp)Remote programs'.\n" magit--minimal-git remote version) :error))
-        (display-warning 'magit (format "\
-Magit cannot find Git on %s.
-
-First check the value of `magit-git-executable'.  Its value is
-used when running git locally as well as when running it on a
-remote host.  The default value is \"git\", except on Windows
-where an absolute path is used for performance reasons.
-
-If the value already is just \"git\" but TRAMP never-the-less
-doesn't find the executable, then consult the info node
-`(tramp)Remote programs'.\n" remote) :error)))))
-
-;;; Mode
-
-(defvar magit-status-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-mode-map)
-    (define-key map "jz" 'magit-jump-to-stashes)
-    (define-key map "jt" 'magit-jump-to-tracked)
-    (define-key map "jn" 'magit-jump-to-untracked)
-    (define-key map "ju" 'magit-jump-to-unstaged)
-    (define-key map "js" 'magit-jump-to-staged)
-    (define-key map "jfu" 'magit-jump-to-unpulled-from-upstream)
-    (define-key map "jfp" 'magit-jump-to-unpulled-from-pushremote)
-    (define-key map "jpu" 'magit-jump-to-unpushed-to-upstream)
-    (define-key map "jpp" 'magit-jump-to-unpushed-to-pushremote)
-    (define-key map [remap dired-jump] 'magit-dired-jump)
-    map)
-  "Keymap for `magit-status-mode'.")
-
-(define-derived-mode magit-status-mode magit-mode "Magit"
-  "Mode for looking at Git status.
-
-This mode is documented in info node `(magit)Status Buffer'.
-
-\\<magit-mode-map>\
-Type \\[magit-refresh] to refresh the current buffer.
-Type \\[magit-section-toggle] to expand or hide the section at point.
-Type \\[magit-visit-thing] to visit the change or commit at point.
-
-Type \\[magit-dispatch-popup] to see available prefix popups.
-
-Staging and applying changes is documented in info node
-`(magit)Staging and Unstaging' and info node `(magit)Applying'.
-
-\\<magit-hunk-section-map>Type \
-\\[magit-apply] to apply the change at point, \
-\\[magit-stage] to stage,
-\\[magit-unstage] to unstage, \
-\\[magit-discard] to discard, or \
-\\[magit-reverse] to reverse it.
-
-\\<magit-status-mode-map>\
-Type \\[magit-commit-popup] to create a commit.
-
-\\{magit-status-mode-map}"
-  :group 'magit-status
-  (hack-dir-local-variables-non-file-buffer)
-  (setq imenu-create-index-function
-        'magit-imenu--status-create-index-function)
-  (setq-local bookmark-make-record-function
-              #'magit-bookmark--status-make-record)
-  ;; Avoid listing all files as deleted when visiting a bare repo.
-  (when (magit-bare-repo-p)
-    (make-local-variable 'magit-status-sections-hook)
-    (remove-hook 'magit-status-sections-hook #'magit-insert-staged-changes
-                 'local)))
-
-(defun magit-status-refresh-buffer ()
-  (magit-git-exit-code "update-index" "--refresh")
-  (magit-insert-section (status)
-    (magit-run-section-hook 'magit-status-sections-hook))
-  (run-hooks 'magit-status-refresh-hook))
-
-(defun magit-status-maybe-update-revision-buffer (&optional _)
-  "When moving in the status buffer, update the revision buffer.
-If there is no revision buffer in the same frame, then do nothing."
-  (when (derived-mode-p 'magit-status-mode)
-    (magit-log-maybe-update-revision-buffer-1)))
-
-(defun magit-status-maybe-update-blob-buffer (&optional _)
-  "When moving in the status buffer, update the blob buffer.
-If there is no blob buffer in the same frame, then do nothing."
-  (when (derived-mode-p 'magit-status-mode)
-    (magit-log-maybe-update-blob-buffer-1)))
-
-;;; Sections
-;;;; Special Headers
-
-(defun magit-insert-status-headers ()
-  "Insert header sections appropriate for `magit-status-mode' buffers.
-The sections are inserted by running the functions on the hook
-`magit-status-headers-hook'."
-  (if (magit-rev-verify "HEAD")
-      (magit-insert-headers magit-status-headers-hook)
-    (insert "In the beginning there was darkness\n\n")))
-
-(defun magit-insert-error-header ()
-  "Insert the message about the Git error that just occured.
-
-This function is only aware of the last error that occur when Git
-was run for side-effects.  If, for example, an error occurs while
-generating a diff, then that error won't be inserted.  Refreshing
-the status buffer causes this section to disappear again."
-  (when magit-this-error
-    (magit-insert-section (error 'git)
-      (insert (propertize (format "%-10s" "GitError! ")
-                          'face 'magit-section-heading))
-      (insert (propertize magit-this-error 'face 'font-lock-warning-face))
-      (-when-let (key (car (where-is-internal 'magit-process-buffer)))
-        (insert (format "  [Type `%s' for details]" (key-description key))))
-      (insert ?\n))
-    (setq magit-this-error nil)))
-
-(defun magit-insert-diff-filter-header ()
-  "Insert a header line showing the effective diff filters."
-  (when magit-diff-section-file-args
-    (magit-insert-section (filter 'diff)
-      (insert (propertize (format "%-10s" "Filter! ")
-                          'face 'magit-section-heading))
-      (insert (mapconcat #'identity magit-diff-section-file-args " "))
-      (insert ?\n))))
-
-;;;; Reference Headers
-
-(cl-defun magit-insert-head-branch-header
-    (&optional (branch (magit-get-current-branch)))
-  "Insert a header line about BRANCH.
-When BRANCH is nil, use the current branch or, if none, the
-detached `HEAD'."
-  (let ((output (magit-rev-format "%h %s" (or branch "HEAD"))))
-    (string-match "^\\([^ ]+\\) \\(.*\\)" output)
-    (magit-bind-match-strings (commit summary) output
-      (if branch
-          (magit-insert-section (branch branch)
-            (insert (format "%-10s" "Head: "))
-            (when magit-status-show-hashes-in-headers
-              (insert (propertize commit 'face 'magit-hash) ?\s))
-            (insert (propertize branch 'face 'magit-branch-local))
-            (insert ?\s summary ?\n))
-        (magit-insert-section (commit commit)
-          (insert (format "%-10s" "Head: "))
-          (insert (propertize commit 'face 'magit-hash))
-          (insert ?\s summary ?\n))))))
-
-(cl-defun magit-insert-upstream-branch-header
-    (&optional (branch (magit-get-current-branch))
-               (pull   (magit-get-upstream-branch branch))
-               keyword)
-  "Insert a header line about branch usually pulled into current branch."
-  (when pull
-    (magit-insert-section (branch pull)
-      (let ((rebase (magit-get "branch" branch "rebase")))
-        (pcase rebase
-          ("true")
-          ("false" (setq rebase nil))
-          (_       (setq rebase (magit-get-boolean "pull.rebase"))))
-        (insert (format "%-10s" (or keyword (if rebase "Rebase: " "Merge: ")))))
-      (--when-let (and magit-status-show-hashes-in-headers
-                       (not (string-match-p " " pull))
-                       (magit-rev-format "%h" pull))
-        (insert (propertize it 'face 'magit-hash) " "))
-      (if (string-match-p " " pull)
-          (pcase-let ((`(,url ,branch) (split-string pull " ")))
-            (insert branch " from " url " "))
-        (insert pull " ")
-        (if (magit-rev-verify pull)
-            (insert (or (magit-rev-format "%s" pull) ""))
-          (insert (propertize "is missing" 'face 'font-lock-warning-face))))
-      (insert ?\n))))
-
-(cl-defun magit-insert-push-branch-header
-    (&optional (branch (magit-get-current-branch))
-               (push   (magit-get-push-branch branch)))
-  "Insert a header line about the branch the current branch is pushed to."
-  (when push
-    (magit-insert-section (branch push)
-      (insert (format "%-10s" "Push: "))
-      (--when-let (and magit-status-show-hashes-in-headers
-                       (magit-rev-format "%h" push))
-        (insert (propertize it 'face 'magit-hash) ?\s))
-      (insert (propertize push 'face 'magit-branch-remote) ?\s)
-      (if (magit-rev-verify push)
-          (insert (or (magit-rev-format "%s" push) ""))
-        (insert (propertize "is missing" 'face 'font-lock-warning-face)))
-      (insert ?\n))))
-
-(defun magit-insert-tags-header ()
-  "Insert a header line about the current and/or next tag."
-  (let* ((this-tag (magit-get-current-tag nil t))
-         (next-tag (magit-get-next-tag nil t))
-         (this-cnt (cadr this-tag))
-         (next-cnt (cadr next-tag))
-         (this-tag (car this-tag))
-         (next-tag (car next-tag))
-         (both-tags (and this-tag next-tag t)))
-    (when (or this-tag next-tag)
-      (magit-insert-section (tag (or this-tag next-tag))
-        (insert (format "%-10s" (if both-tags "Tags: " "Tag: ")))
-        (cl-flet ((insert-count
-                   (tag count face)
-                   (insert (concat (propertize tag 'face 'magit-tag)
-                                   (and (> count 0)
-                                        (format " (%s)"
-                                                (propertize (format "%s" count)
-                                                            'face face)))))))
-          (when this-tag  (insert-count this-tag this-cnt 'magit-branch-local))
-          (when both-tags (insert ", "))
-          (when next-tag  (insert-count next-tag next-cnt 'magit-tag)))
-        (insert ?\n)))))
-
-;;;; Auxiliary Headers
-
-(defun magit-insert-user-header ()
-  "Insert a header line about the current user."
-  (let ((name  (magit-get "user.name"))
-        (email (magit-get "user.email")))
-    (when (and name email)
-      (magit-insert-section (user name)
-        (insert (format "%-10s" "User: "))
-        (insert (propertize name 'face 'magit-log-author))
-        (insert " <" email ">\n")))))
-
-(defun magit-insert-repo-header ()
-  "Insert a header line showing the path to the repository top-level."
-  (let ((topdir (magit-toplevel)))
-    (magit-insert-section (repo topdir)
-      (insert (format "%-10s%s\n" "Repo: " (abbreviate-file-name topdir))))))
-
-(defun magit-insert-remote-header ()
-  "Insert a header line about the remote of the current branch.
-
-If no remote is configured for the current branch, then fall back
-showing the \"origin\" remote, or if that does not exist the first
-remote in alphabetic order."
-  (-when-let* ((name (or (magit-get-remote)
-                         (let ((remotes (magit-list-remotes)))
-                           (or (car (member "origin" remotes))
-                               (car remotes)))))
-               ;; Under certain configurations it's possible for url
-               ;; to be nil, when name is not, see #2858.
-               (url (magit-get "remote" name "url")))
-    (magit-insert-section (remote name)
-      (insert (format "%-10s" "Remote: "))
-      (insert (propertize name 'face 'magit-branch-remote) ?\s)
-      (insert url ?\n))))
-
-;;;; Campaign Header
-
-(defvar magit-hide-campaign-header
-  (ignore-errors (magit-get-boolean "magit.hideCampaign")))
-
-(defun magit-campaign-remove ()
-  "Remove the fundraising campaign header permanently."
-  (interactive)
-  (magit-call-git "config" "--global" "magit.hideCampaign" "true")
-  (setq magit-hide-campaign-header t)
-  (magit-refresh))
-
-(defun magit-campaign-hide ()
-  "Remove the fundraising campaign header until restart."
-  (interactive)
-  (setq magit-hide-campaign-header t)
-  (magit-refresh))
-
-(defun magit-campaign-visit ()
-  "Visit the fundraising campaign in a browser."
-  (interactive)
-  (browse-url "https://www.kickstarter.com/projects/1681258897/its-magit-the-magical-git-client?ref=2nj0oy"))
-
-(defvar magit-campaign-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "C-c C-k") 'magit-campaign-remove)
-    (define-key map (kbd "C-c C-h") 'magit-campaign-hide)
-    (define-key map [remap magit-visit-thing] 'magit-campaign-visit)
-    map))
-
-(defun magit-insert-campaign-header ()
-  "Insert a header informing users of the fundraiser."
-  (unless (or (< (float-time) 1505512800) ; 2017-09-16 00:00:00 +0200
-              (> (float-time) 1506895200) ; 2017-10-02 00:00:00 +0200
-              magit-hide-campaign-header)
-    (magit-insert-section (campaign nil t)
-      (magit-insert-heading
-        (propertize "<3" 'face '(:foreground "magenta"))
-        (propertize " Please consider backing the Magit fundraiser.")
-        (propertize " Thanks!" 'face '(:foreground "magenta"))
-        " [TAB] to expand"
-        (propertize " <3" 'face '(:foreground "magenta")))
-      (insert "
-Please accept my apologies for this brief interruption.
-
-  C-c C-k   remove this section permanently
-  C-c C-h   remove this section until restart
-  TAB       collapse this section
-
-  RET       visit the fundraising campaign in a browser
-
---------------------------------------------------------------
-                     The magic must go on
---------------------------------------------------------------
-
-I am currently running a fundraising campaign on Kickstarter.
-If it succeeds, then I can work on Magit full-time for a whole
-year.  I am still overflowing with ideas, and depend on your
-support to realize them.
-
-I would love to work on Magit for at least another year and
-think that its users would miss out on a lot of significant
-improvements if I were unable to do so.  Magit and I are at
-a crossroad — either I can intensive my efforts or I have
-to give up bringing the long time goals to completion that
-I have been working toward for the past few years.
-
-Magit is still far from fulfilling its potential and now I
-need your help to get it there.  Visit the campaign to learn
-more about the planned improvements and please consider to
-make a contribution.
-
-  Thank you,
-  Jonas Bernoulli\n\n"))))
-
-;;;; File Sections
-
-(defvar magit-untracked-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-delete-thing] 'magit-discard)
-    (define-key map "s" 'magit-stage)
-    map)
-  "Keymap for the `untracked' section.")
-
-(magit-define-section-jumper magit-jump-to-untracked "Untracked files" untracked)
-
-(defun magit-insert-untracked-files ()
-  "Maybe insert a list or tree of untracked files.
-Do so depending on the value of `status.showUntrackedFiles'.
-Note that even if the value is `all', Magit still initially only
-shows directories.  But the directory sections can then be expanded
-using \"TAB\"."
-  (let ((show (or (magit-get "status.showUntrackedFiles") "normal")))
-    (unless (equal show "no")
-      (if (equal show "all")
-          (-when-let (files (magit-untracked-files))
-            (magit-insert-section (untracked)
-              (magit-insert-heading "Untracked files:")
-              (magit-insert-un/tracked-files-1 files nil)
-              (insert ?\n)))
-        (-when-let
-            (files (--mapcat (and (eq (aref it 0) ??)
-                                  (list (substring it 3)))
-                             (magit-git-items "status" "-z" "--porcelain")))
-          (magit-insert-section (untracked)
-            (magit-insert-heading "Untracked files:")
-            (dolist (file files)
-              (magit-insert-section (file file)
-                (insert (propertize file 'face 'magit-filename) ?\n)))
-            (insert ?\n)))))))
-
-(magit-define-section-jumper magit-jump-to-tracked "Tracked files" tracked)
-
-(defun magit-insert-tracked-files ()
-  "Insert a tree of tracked files."
-  (-when-let (files (magit-list-files))
-    (magit-insert-section (tracked nil t)
-      (magit-insert-heading "Tracked files:")
-      (magit-insert-un/tracked-files-1 files nil)
-      (insert ?\n))))
-
-(defun magit-insert-un/tracked-files-1 (files directory)
-  (while (and files (string-prefix-p (or directory "") (car files)))
-    (let ((dir (file-name-directory (car files))))
-      (if (equal dir directory)
-          (let ((file (pop files)))
-            (magit-insert-section (file file)
-              (insert (propertize file 'face 'magit-filename) ?\n)))
-        (magit-insert-section (file dir t)
-          (insert (propertize dir 'file 'magit-filename) ?\n)
-          (magit-insert-heading)
-          (setq files (magit-insert-un/tracked-files-1 files dir))))))
-  files)
-
-(provide 'magit-status)
-;;; magit-status.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-status.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-submodule.el
@@ -1,408 +0,0 @@
-;;; magit-submodule.el --- submodule support for Magit  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2011-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Code:
-
-(require 'magit)
-
-(defvar x-stretch-cursor)
-(defvar bookmark-make-record-function)
-
-;;; Options
-
-(defcustom magit-module-sections-hook
-  '(magit-insert-modules-overview
-    magit-insert-modules-unpulled-from-upstream
-    magit-insert-modules-unpulled-from-pushremote
-    magit-insert-modules-unpushed-to-upstream
-    magit-insert-modules-unpushed-to-pushremote)
-  "Hook run by `magit-insert-modules'.
-
-That function isn't part of `magit-status-sections-hook's default
-value, so you have to add it yourself for this hook to have any
-effect."
-  :package-version '(magit . "2.11.0")
-  :group 'magit-status
-  :type 'hook)
-
-(defcustom magit-module-sections-nested t
-  "Whether `magit-insert-modules' wraps inserted sections.
-
-If this is non-nil, then only a single top-level section
-is inserted.  If it is nil, then all sections listed in
-`magit-module-sections-hook' become top-level sections."
-  :package-version '(magit . "2.11.0")
-  :group 'magit-status
-  :type 'boolean)
-
-(defcustom magit-submodule-list-mode-hook '(hl-line-mode)
-  "Hook run after entering Magit-Submodule-List mode."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-repolist
-  :type 'hook
-  :get 'magit-hook-custom-get
-  :options '(hl-line-mode))
-
-(defcustom magit-submodule-list-columns
-  '(("Path"     25 magit-modulelist-column-path   nil)
-    ("Version"  25 magit-repolist-column-version  nil)
-    ("Branch"   20 magit-repolist-column-branch   nil)
-    ("B<U" 3 magit-repolist-column-unpulled-from-upstream   ((:right-align t)))
-    ("B>U" 3 magit-repolist-column-unpushed-to-upstream     ((:right-align t)))
-    ("B<P" 3 magit-repolist-column-unpulled-from-pushremote ((:right-align t)))
-    ("B>P" 3 magit-repolist-column-unpushed-to-pushremote   ((:right-align t)))
-    ("B"   3 magit-repolist-column-branches                 ((:right-align t)))
-    ("S"   3 magit-repolist-column-stashes                  ((:right-align t))))
-  "List of columns displayed by `magit-list-submodules'.
-
-Each element has the form (HEADER WIDTH FORMAT PROPS).
-
-HEADER is the string displayed in the header.  WIDTH is the width
-of the column.  FORMAT is a function that is called with one
-argument, the repository identification (usually its basename),
-and with `default-directory' bound to the toplevel of its working
-tree.  It has to return a string to be inserted or nil.  PROPS is
-an alist that supports the keys `:right-align' and `:pad-right'."
-  :package-version '(magit . "2.8.0")
-  :group 'magit-repolist-mode
-  :type `(repeat (list :tag "Column"
-                       (string   :tag "Header Label")
-                       (integer  :tag "Column Width")
-                       (function :tag "Inserter Function")
-                       (repeat   :tag "Properties"
-                                 (list (choice :tag "Property"
-                                               (const :right-align)
-                                               (const :pad-right)
-                                               (symbol))
-                                       (sexp   :tag "Value"))))))
-
-;;; Commands
-
-;;;###autoload (autoload 'magit-submodule-popup "magit-submodule" nil t)
-(magit-define-popup magit-submodule-popup
-  "Popup console for submodule commands."
-  :man-page "git-submodule"
-  :actions  '((?a "Add"    magit-submodule-add)
-              (?b "Setup"  magit-submodule-setup)
-              (?i "Init"   magit-submodule-init)
-              (?u "Update" magit-submodule-update)
-              (?s "Sync"   magit-submodule-sync)
-              (?f "Fetch"  magit-submodule-fetch)
-              (?d "Deinit" magit-submodule-deinit)
-              (?l "List"   magit-list-submodules)))
-
-;;;###autoload
-(defun magit-submodule-add (url &optional path name)
-  "Add the repository at URL as a submodule.
-
-Optional PATH is the path to the submodule relative to the root
-of the superproject.  If it is nil, then the path is determined
-based on the URL.
-
-Optional NAME is the name of the submodule.  If it is nil, then
-PATH also becomes the name."
-  (interactive
-   (magit-with-toplevel
-     (let* ((url (magit-read-string-ns "Add submodule (remote url)"))
-            (path (let ((read-file-name-function #'read-file-name-default))
-                    (directory-file-name
-                     (file-relative-name
-                      (read-directory-name
-                       "Add submodules at path: " nil nil nil
-                       (and (string-match "\\([^./]+\\)\\(\\.git\\)?$" url)
-                            (match-string 1 url))))))))
-       (list url
-             (directory-file-name path)
-             (magit-submodule-read-name-for-path path)))))
-  (magit-run-git "submodule" "add" (and name (list "--name" name)) url path))
-
-;;;###autoload
-(defun magit-submodule-read-name-for-path (path)
-  (setq path (directory-file-name (file-relative-name path)))
-  (push (file-name-nondirectory path) minibuffer-history)
-  (magit-read-string-ns
-   "Submodule name" nil (cons 'minibuffer-history 2)
-   (or (--keep (-let [(var val) (split-string it "=")]
-                 (and (equal val path)
-                      (cadr (split-string var "\\."))))
-               (magit-git-lines "config" "--list" "-f" ".gitmodules"))
-       path)))
-
-;;;###autoload
-(defun magit-submodule-setup ()
-  "Clone and register missing submodules and checkout appropriate commits."
-  (interactive)
-  (magit-with-toplevel
-    (--if-let (--filter (not (file-exists-p (expand-file-name ".git" it)))
-                        (magit-get-submodules))
-        (magit-run-git-async "submodule" "update" "--init" "--" it)
-      (message "All submodules already setup"))))
-
-;;;###autoload
-(defun magit-submodule-init ()
-  "Register submodules listed in \".gitmodules\" into \".git/config\"."
-  (interactive)
-  (magit-with-toplevel
-    (magit-run-git-async "submodule" "init")))
-
-;;;###autoload
-(defun magit-submodule-update (&optional init)
-  "Clone missing submodules and checkout appropriate commits.
-With a prefix argument also register submodules in \".git/config\"."
-  (interactive "P")
-  (magit-with-toplevel
-    (magit-run-git-async "submodule" "update" (and init "--init"))))
-
-;;;###autoload
-(defun magit-submodule-sync ()
-  "Update each submodule's remote URL according to \".gitmodules\"."
-  (interactive)
-  (magit-with-toplevel
-    (magit-run-git-async "submodule" "sync")))
-
-;;;###autoload
-(defun magit-submodule-fetch (&optional all)
-  "Fetch all submodules.
-With a prefix argument fetch all remotes."
-  (interactive "P")
-  (magit-with-toplevel
-    (magit-run-git-async "submodule" "foreach"
-                         (format "git fetch %s || true" (if all "--all" "")))))
-
-;;;###autoload
-(defun magit-submodule-deinit (path)
-  "Unregister the submodule at PATH."
-  (interactive
-   (list (magit-completing-read "Deinit module" (magit-get-submodules)
-                                nil t nil nil (magit-section-when module))))
-  (magit-with-toplevel
-    (magit-run-git-async "submodule" "deinit" path)))
-
-;;; Sections
-
-;;;###autoload
-(defun magit-insert-modules ()
-  "Insert submodule sections.
-Hook `magit-module-sections-hook' controls which module sections
-are inserted, and option `magit-insert-modules-nested' controls
-whether they are wrapped in an additional section."
-  (-when-let (modules (magit-get-submodules))
-    (if magit-module-sections-nested
-        (magit-insert-section section (submodules nil t)
-          (magit-insert-heading
-            (format "%s (%s)"
-                    (propertize "Modules" 'face 'magit-section-heading)
-                    (length modules)))
-          (if (magit-section-hidden section)
-              (setf (magit-section-washer section) 'magit--insert-modules)
-            (magit--insert-modules)))
-      (magit--insert-modules))))
-
-(defun magit--insert-modules (&optional _section)
-  (magit-run-section-hook 'magit-module-sections-hook))
-
-;;;###autoload
-(defun magit-insert-modules-overview ()
-  "Insert sections for all modules.
-For each section insert the path and the output of `git describe --tags'."
-  (-when-let (modules (magit-get-submodules))
-    (magit-insert-section section (submodules nil t)
-      (magit-insert-heading
-        (format "%s (%s)"
-                (propertize "Modules overview" 'face 'magit-section-heading)
-                (length modules)))
-      (if (magit-section-hidden section)
-          (setf (magit-section-washer section) 'magit--insert-modules-overview)
-        (magit--insert-modules-overview)))))
-
-(defun magit--insert-modules-overview (&optional _section)
-  (magit-with-toplevel
-    (let ((col-format (format "%%-%is " (min 25 (/ (window-width) 3)))))
-      (dolist (module (magit-get-submodules))
-        (let ((default-directory
-                (expand-file-name (file-name-as-directory module))))
-          (magit-insert-section (submodule module t)
-            (insert (propertize (format col-format module)
-                                'face 'magit-diff-file-heading))
-            (if (not (file-exists-p ".git"))
-                (insert "(uninitialized)")
-              (insert (format col-format
-                              (--if-let (magit-get-current-branch)
-                                  (propertize it 'face 'magit-branch-local)
-                                (propertize "(detached)" 'face 'warning))))
-              (--when-let (magit-git-string "describe" "--tags")
-                (when (string-match-p "\\`[0-9]" it)
-                  (insert ?\s))
-                (insert (propertize it 'face 'magit-tag))))
-            (insert ?\n))))))
-  (insert ?\n))
-
-(defvar magit-submodules-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-visit-thing] 'magit-list-submodules)
-    map)
-  "Keymap for `submodules' sections.")
-
-(defvar magit-submodule-section-map
-  (let ((map (make-sparse-keymap)))
-    (unless (featurep 'jkl)
-      (define-key map "\C-j"   'magit-submodule-visit))
-    (define-key map [C-return] 'magit-submodule-visit)
-    (define-key map [remap magit-visit-thing]  'magit-submodule-visit)
-    (define-key map [remap magit-delete-thing] 'magit-submodule-deinit)
-    (define-key map "K" 'magit-file-untrack)
-    (define-key map "R" 'magit-file-rename)
-    map)
-  "Keymap for `submodule' sections.")
-
-(defun magit-submodule-visit (module &optional other-window)
-  "Visit MODULE by calling `magit-status' on it.
-Offer to initialize MODULE if it's not checked out yet.
-With a prefix argument, visit in another window."
-  (interactive (list (or (magit-section-when submodule)
-                         (magit-read-module-path "Visit module"))
-                     current-prefix-arg))
-  (magit-with-toplevel
-    (let ((path (expand-file-name module)))
-      (if (and (not (file-exists-p (expand-file-name ".git" module)))
-               (not (y-or-n-p (format "Initialize submodule '%s' first?"
-                                      module))))
-          (when (file-exists-p path)
-            (dired-jump other-window (concat path "/.")))
-        (magit-run-git-async "submodule" "update" "--init" "--" module)
-        (set-process-sentinel
-         magit-this-process
-         (lambda (process event)
-           (let ((magit-process-raise-error t))
-             (magit-process-sentinel process event))
-           (when (and (eq (process-status      process) 'exit)
-                      (=  (process-exit-status process) 0))
-             (magit-diff-visit-directory path other-window))))))))
-
-;;;###autoload
-(defun magit-insert-modules-unpulled-from-upstream ()
-  "Insert sections for modules that haven't been pulled from the upstream.
-These sections can be expanded to show the respective commits."
-  (magit--insert-modules-logs "Modules unpulled from @{upstream}"
-                              'modules-unpulled-from-upstream
-                              "HEAD..@{upstream}"))
-
-;;;###autoload
-(defun magit-insert-modules-unpulled-from-pushremote ()
-  "Insert sections for modules that haven't been pulled from the push-remote.
-These sections can be expanded to show the respective commits."
-  (magit--insert-modules-logs "Modules unpulled from ${push}"
-                              'modules-unpulled-from-pushremote
-                              "HEAD..@{push}"))
-
-;;;###autoload
-(defun magit-insert-modules-unpushed-to-upstream ()
-  "Insert sections for modules that haven't been pushed to the upstream.
-These sections can be expanded to show the respective commits."
-  (magit--insert-modules-logs "Modules unmerged into @{upstream}"
-                              'modules-unpushed-to-upstream
-                              "@{upstream}..HEAD"))
-
-;;;###autoload
-(defun magit-insert-modules-unpushed-to-pushremote ()
-  "Insert sections for modules that haven't been pushed to the push-remote.
-These sections can be expanded to show the respective commits."
-  (magit--insert-modules-logs "Modules unpushed to @{push}"
-                              'modules-unpushed-to-pushremote
-                              "${push}..HEAD"))
-
-(defun magit--insert-modules-logs (heading type range)
-  "For internal use, don't add to a hook."
-  (-when-let (modules (magit-get-submodules))
-    (magit-insert-section section ((eval type) nil t)
-      (string-match "\\`\\(.+\\) \\([^ ]+\\)\\'" heading)
-      (magit-insert-heading
-        (concat
-         (propertize (match-string 1 heading) 'face 'magit-section-heading) " "
-         (propertize (match-string 2 heading) 'face 'magit-branch-remote) ":"))
-      (magit-with-toplevel
-        (dolist (module modules)
-          (let ((default-directory
-                  (expand-file-name (file-name-as-directory module))))
-            (when (magit-file-accessible-directory-p default-directory)
-              (magit-insert-section sec (file module t)
-                (magit-insert-heading
-                  (concat (propertize module 'face 'magit-diff-file-heading) ":"))
-                (magit-git-wash (apply-partially 'magit-log-wash-log 'module)
-                  "-c" "push.default=current" "log" "--oneline" range)
-                (when (> (point) (magit-section-content sec))
-                  (delete-char -1)))))))
-      (if (> (point) (magit-section-content section))
-          (insert ?\n)
-        (magit-cancel-section)))))
-
-;;; List
-
-;;;###autoload
-(defun magit-list-submodules ()
-  "Display a list of the current repository's submodules."
-  (interactive)
-  (magit-display-buffer (magit-mode-get-buffer 'magit-submodule-list-mode t))
-  (magit-submodule-list-mode)
-  (setq tabulated-list-entries
-        (mapcar (lambda (module)
-                  (let ((default-directory
-                          (expand-file-name (file-name-as-directory module))))
-                    (list module
-                          (vconcat (--map (or (funcall (nth 2 it) module) "")
-                                          magit-submodule-list-columns)))))
-                (magit-get-submodules)))
-  (tabulated-list-print))
-
-(defvar magit-submodule-list-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-repolist-mode-map)
-    (define-key map "g" 'magit-list-submodules)
-    map)
-  "Local keymap for Magit-Submodule-List mode buffers.")
-
-(define-derived-mode magit-submodule-list-mode tabulated-list-mode "Modules"
-  "Major mode for browsing a list of Git submodules."
-  :group 'magit-repolist-mode
-  (setq x-stretch-cursor        nil)
-  (setq tabulated-list-padding  0)
-  (setq tabulated-list-sort-key (cons "Path" nil))
-  (setq tabulated-list-format
-        (vconcat (mapcar (-lambda ((title width _fn props))
-                           (nconc (list title width t)
-                                  (-flatten props)))
-                         magit-submodule-list-columns)))
-  (tabulated-list-init-header)
-  (setq imenu-prev-index-position-function
-        #'magit-imenu--submodule-prev-index-position-function)
-  (setq imenu-extract-index-name-function
-        #'magit-imenu--submodule-extract-index-name-function)
-  (setq-local bookmark-make-record-function
-              #'magit-bookmark--submodules-make-record))
-
-(defun magit-modulelist-column-path (path)
-  "Insert the relative path of the submodule."
-  path)
-
-(provide 'magit-submodule)
-;;; magit-submodule.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-submodule.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-subtree.el
@@ -1,146 +0,0 @@
-;;; magit-subtree.el --- subtree support for Magit  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2011-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Code:
-
-(require 'magit)
-
-;;; Popup
-
-;;;###autoload (autoload 'magit-subtree-popup "magit-subtree" nil t)
-(magit-define-popup magit-subtree-popup
-  "Popup console for subtree commands."
-  :man-page "git-subtree"
-  :switches '("Switches for add, merge, push, and pull"
-              (?s "Squash" "--squash")
-              "Switches for split"
-              (?i "Ignore joins" "--ignore-joins")
-              (?j "Rejoin"       "--rejoin"))
-  :options  '("Options"
-              (?p "Prefix" "--prefix=" magit-subtree-read-prefix)
-              "Options for add, merge, and pull"
-              (?m "Message" "--message=")
-              "Options for split"
-              (?a "Annotate" "--annotate=")
-              (?b "Branch"   "--branch=")
-              (?o "Onto"     "--onto=" magit-read-branch-or-commit))
-  :actions  '((?a "Add"        magit-subtree-add)
-              (?m "Merge"      magit-subtree-merge)
-              (?p "Push"       magit-subtree-push)
-              (?c "Add commit" magit-subtree-add-commit)
-              (?f "Pull"       magit-subtree-pull)
-              (?s "Split"      magit-subtree-split))
-  :max-action-columns 3)
-
-(defun magit-subtree-read-prefix (prompt &optional default)
-  (let* ((insert-default-directory nil)
-         (topdir (magit-toplevel))
-         (prefix (read-directory-name (concat prompt ": ") topdir default)))
-    (if (file-name-absolute-p prefix)
-        ;; At least `ido-mode's variant is not compatible.
-        (if (string-prefix-p topdir prefix)
-            (file-relative-name prefix topdir)
-          (user-error "%s isn't inside the repository at %s" prefix topdir))
-      prefix)))
-
-;;; Commands
-
-(defun magit-subtree-prefix (prompt)
-  (--if-let (--first (string-prefix-p "--prefix=" it)
-                     (magit-subtree-arguments))
-      (substring it 9)
-    (magit-subtree-read-prefix prompt)))
-
-(defun magit-subtree-args ()
-  (-filter (lambda (arg)
-             (if (eq this-command 'magit-subtree-split)
-                 (or (equal arg "--ignore-joins")
-                     (equal arg "--rejoin")
-                     (string-prefix-p "--annotate=" arg)
-                     (string-prefix-p "--branch=" arg)
-                     (string-prefix-p "--onto=" arg))
-               (or (equal arg "--squash")
-                   (and (string-prefix-p "--message=" arg)
-                        (not (eq this-command 'magit-subtree-push))))))
-           (magit-subtree-arguments)))
-
-(defun magit-git-subtree (subcmd prefix &rest args)
-  (magit-run-git-async "subtree" subcmd (concat "--prefix=" prefix) args))
-
-;;;###autoload
-(defun magit-subtree-add (prefix repository ref args)
-  "Add REF from REPOSITORY as a new subtree at PREFIX."
-  (interactive
-   (cons (magit-subtree-prefix "Add subtree")
-         (let ((remote (magit-read-remote-or-url "From repository")))
-           (list remote
-                 (magit-read-refspec "Ref" remote)
-                 (magit-subtree-args)))))
-  (magit-git-subtree "add" prefix args repository ref))
-
-;;;###autoload
-(defun magit-subtree-add-commit (prefix commit args)
-  "Add COMMIT as a new subtree at PREFIX."
-  (interactive (list (magit-subtree-prefix "Add subtree")
-                     (magit-read-string-ns "Commit")
-                     (magit-subtree-args)))
-  (magit-git-subtree "add" prefix args commit))
-
-;;;###autoload
-(defun magit-subtree-merge (prefix commit args)
-  "Merge COMMIT into the PREFIX subtree."
-  (interactive (list (magit-subtree-prefix "Merge into subtree")
-                     (magit-read-string-ns "Commit")
-                     (magit-subtree-args)))
-  (magit-git-subtree "merge" prefix args commit))
-
-;;;###autoload
-(defun magit-subtree-pull (prefix repository ref args)
-  "Pull REF from REPOSITORY into the PREFIX subtree."
-  (interactive
-   (cons (magit-subtree-prefix "Pull into subtree")
-         (let ((remote (magit-read-remote-or-url "From repository")))
-           (list remote
-                 (magit-read-refspec "Ref" remote)
-                 (magit-subtree-args)))))
-  (magit-git-subtree "pull" prefix args repository ref))
-
-;;;###autoload
-(defun magit-subtree-push (prefix repository ref args)
-  "Extract the history of the subtree PREFIX and push it to REF on REPOSITORY."
-  (interactive (list (magit-subtree-prefix "Push subtree")
-                     (magit-read-remote-or-url "To repository")
-                     (magit-read-string-ns "To reference")
-                     (magit-subtree-args)))
-  (magit-git-subtree "push" prefix args repository ref))
-
-;;;###autoload
-(defun magit-subtree-split (prefix commit args)
-  "Extract the history of the subtree PREFIX."
-  (interactive (list (magit-subtree-prefix "Split subtree")
-                     (magit-read-string-ns "Commit")
-                     (magit-subtree-args)))
-  (magit-git-subtree "split" prefix args commit))
-
-(provide 'magit-subtree)
-;;; magit-subtree.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-subtree.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-utils.el
@@ -1,778 +0,0 @@
-;;; magit-utils.el --- various utilities  -*- lexical-binding: t; coding: utf-8 -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Contains code from GNU Emacs https://www.gnu.org/software/emacs,
-;; released under the GNU General Public License version 3 or later.
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library defines several utility functions used by several
-;; other libraries which cannot depend on one another (because
-;; circular dependencies are not good).  Luckily most (all) of these
-;; functions have very little (nothing) to do with Git, so we not only
-;; have to do this, it even makes sense.
-
-;; Unfortunately there are also some options which are used by several
-;; libraries which cannot depend on one another, they are defined here
-;; too.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'dash)
-
-(require 'crm)
-
-(eval-when-compile (require 'ido))
-(declare-function ido-completing-read+ 'ido-completing-read+)
-(declare-function Info-get-token 'info)
-
-(eval-when-compile (require 'vc-git))
-(declare-function vc-git--run-command-string 'vc-git)
-
-(defvar magit-wip-before-change-mode)
-
-;;; Options
-
-(defcustom magit-completing-read-function 'magit-builtin-completing-read
-  "Function to be called when requesting input from the user.
-
-If you have enabled `ivy-mode' or `helm-mode', then you don't
-have to customize this option; `magit-builtin-completing-read'
-will work just fine.  However, if you use Ido completion, then
-you do have to use `magit-ido-completion-read', because Ido is
-less well behaved than the former, more modern alternatives.
-
-If you would like to use Ivy or Helm completion with Magit but
-not enable the respective modes globally, then customize this
-option to use `ivy-completing-read'
-or `helm--completing-read-default'."
-  :group 'magit-essentials
-  :type '(radio (function-item magit-builtin-completing-read)
-                (function-item magit-ido-completing-read)
-                (function-item ivy-completing-read)
-                (function-item helm--completing-read-default)
-                (function :tag "Other function")))
-
-(defcustom magit-no-confirm-default nil
-  "A list of commands which should just use the default choice.
-
-Many commands let the user choose the target they act on offering
-a sensible default as default choice.  If you think that that
-default is so sensible that it should always be used without even
-offering other choices, then add that command here.
-
-Commands have to explicitly support this option.  Currently only
-these commands do:
-  `magit-branch'
-  `magit-branch-and-checkout'
-  `magit-branch-orphan'
-  `magit-worktree-branch'
-    For these four commands `magit-branch-read-upstream-first'
-    must be non-nil, or adding them here has no effect.
-  `magit-branch-rename'
-  `magit-tag'"
-  :package-version '(magit . "2.9.0")
-  :group 'magit-miscellaneous
-  :type '(list :convert-widget custom-hook-convert-widget)
-  :options '(magit-branch
-             magit-branch-and-checkout
-             magit-branch-orphan
-             magit-branch-rename
-             magit-worktree-branch
-             magit-tag))
-
-(defconst magit--confirm-actions
-  '((const reverse)           (const discard)
-    (const rename)            (const resurrect)
-    (const trash)             (const delete)
-    (const abort-rebase)
-    (const abort-merge)       (const merge-dirty)
-    (const drop-stashes)      (const resect-bisect)
-    (const kill-process)      (const delete-unmerged-branch)
-    (const stage-all-changes) (const unstage-all-changes)
-    (const safe-with-wip)))
-
-(defcustom magit-no-confirm nil
-  "A list of symbols for actions Magit should not confirm, or t.
-
-Many potentially dangerous commands by default ask the user for
-confirmation.  Each of the below symbols stands for an action
-which, when invoked unintentionally or without being fully aware
-of the consequences, could lead to tears.  In many cases there
-are several commands that perform variations of a certain action,
-so we don't use the command names but more generic symbols.
-
-Applying changes:
-
-  `discard' Discarding one or more changes (i.e. hunks or the
-  complete diff for a file) loses that change, obviously.
-
-  `reverse' Reverting one or more changes can usually be undone
-  by reverting the reversion.
-
-  `stage-all-changes', `unstage-all-changes' When there are both
-  staged and unstaged changes, then un-/staging everything would
-  destroy that distinction.  Of course that also applies when
-  un-/staging a single change, but then less is lost and one does
-  that so often that having to confirm every time would be
-  unacceptable.
-
-Files:
-
-  `delete' When a file that isn't yet tracked by Git is deleted
-  then it is completely lost, not just the last changes.  Very
-  dangerous.
-
-  `trash' Instead of deleting a file it can also be move to the
-  system trash.  Obviously much less dangerous than deleting it.
-
-  Also see option `magit-delete-by-moving-to-trash'.
-
-  `resurrect' A deleted file can easily be resurrected by
-  \"deleting\" the deletion, which is done using the same command
-  that was used to delete the same file in the first place.
-
-  `rename' Renaming a file can easily be undone.
-
-Sequences:
-
-  `reset-bisect' Aborting (known to Git as \"resetting\") a
-  bisect operation loses all information collected so far.
-
-  `abort-rebase' Aborting a rebase throws away all already
-  modified commits, but it's possible to restore those from the
-  reflog.
-
-  `abort-merge' Aborting a merge throws away all conflict
-  resolutions which has already been carried out by the user.
-
-  `merge-dirty' Merging with a dirty worktree can make it hard to
-  go back to the state before the merge was initiated.
-
-References:
-
-  `delete-unmerged-branch' Once a branch has been deleted it can
-  only be restored using low-level recovery tools provided by
-  Git.  And even then the reflog is gone.  The user always has
-  to confirm the deletion of a branch by accepting the default
-  choice (or selecting another branch), but when a branch has
-  not been merged yet, also make sure the user is aware of that.
-
-  `drop-stashes' Dropping a stash is dangerous because Git stores
-  stashes in the reflog.  Once a stash is removed, there is no
-  going back without using low-level recovery tools provided by
-  Git.  When a single stash is dropped, then the user always has
-  to confirm by accepting the default (or selecting another).
-  This action only concerns the deletion of multiple stashes at
-  once.
-
-Various:
-
-  `kill-process' There seldom is a reason to kill a process.
-
-Global settings:
-
-  Instead of adding all of the above symbols to the value of this
-  option you can also set it to the atom `t', which has the same
-  effect as adding all of the above symbols.  Doing that most
-  certainly is a bad idea, especially because other symbols might
-  be added in the future.  So even if you don't want to be asked
-  for confirmation for any of these actions, you are still better
-  of adding all of the respective symbols individually.
-
-  When `magit-wip-before-change-mode' is enabled then these actions
-  can fairly easily be undone: `discard', `reverse',
-  `stage-all-changes', and `unstage-all-changes'.  If and only if
-  this mode is enabled, then `safe-with-wip' has the same effect
-  as adding all of these symbols individually."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-essentials
-  :group 'magit-commands
-  :type `(choice (const :tag "Always require confirmation" nil)
-                 (const :tag "Never require confirmation" t)
-                 (set   :tag "Require confirmation only for"
-                        ,@magit--confirm-actions)))
-
-(defcustom magit-slow-confirm '(drop-stashes)
-  "Whether to ask user \"y or n\" or \"yes or no\" questions.
-
-When this is nil, then `y-or-n-p' is used when the user has to
-confirm a potentially destructive action.  When this is t, then
-`yes-or-no-p' is used instead.  If this is a list of symbols
-identifying actions, then `yes-or-no-p' is used for those,
-`y-or-no-p' for all others.  The list of actions is the same as
-for `magit-no-confirm' (which see)."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-miscellaneous
-  :type `(choice (const :tag "Always ask \"yes or no\" questions" t)
-                 (const :tag "Always ask \"y or n\" questions" nil)
-                 (set   :tag "Ask \"yes or no\" questions only for"
-                        ,@magit--confirm-actions)))
-
-(defcustom magit-no-message nil
-  "A list of messages Magit should not display.
-
-Magit displays most echo area messages using `message', but a few
-are displayed using `magit-message' instead, which takes the same
-arguments as the former, FORMAT-STRING and ARGS.  `magit-message'
-forgoes printing a message if any member of this list is a prefix
-of the respective FORMAT-STRING.
-
-If Magit prints a message which causes you grief, then please
-first investigate whether there is another option which can be
-used to suppress it.  If that is not the case, then ask the Magit
-maintainers to start using `magit-message' instead of `message'
-in that case.  We are not proactively replacing all uses of
-`message' with `magit-message', just in case someone *might* find
-some of these messages useless.
-
-Messages which can currently be suppressed using this option are:
-* \"Turning on magit-auto-revert-mode...\""
-  :package-version '(magit . "2.8.0")
-  :group 'magit-miscellaneous
-  :type '(repeat string))
-
-(defcustom magit-ellipsis ?…
-  "Character used to abbreviate text.
-
-Currently this is used to abbreviate author names in the margin
-and in process buffers to elide `magit-git-global-arguments'."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-miscellaneous
-  :type 'character)
-
-(defcustom magit-update-other-window-delay 0.2
-  "Delay before automatically updating the other window.
-
-When moving around in certain buffers certain other buffers,
-which are being displayed in another window, may optionally be
-updated to display information about the section at point.
-
-When holding down a key to move by more than just one section,
-then that would update that buffer for each section on the way.
-To prevent that, updating the revision buffer is delayed, and
-this option controls for how long.  For optimal experience you
-might have to adjust this delay and/or the keyboard repeat rate
-and delay of your graphical environment or operating system."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-miscellaneous
-  :type 'number)
-
-(defcustom magit-view-git-manual-method 'info
-  "How links to Git documentation are followed from Magit's Info manuals.
-
-`info'  Follow the link to the node in the `gitman' Info manual
-        as usual.  Unfortunately that manual is not installed by
-        default on some platforms, and when it is then the nodes
-        look worse than the actual manpages.
-
-`man'   View the respective man-page using the `man' package.
-
-`woman' View the respective man-page using the `woman' package."
-  :package-version '(magit . "2.9.0")
-  :group 'magit-miscellaneous
-  :type '(choice (const :tag "view info manual" info)
-                 (const :tag "view manpage using `man'" man)
-                 (const :tag "view manpage using `woman'" woman)))
-
-;;; User Input
-
-(defun magit-completing-read
-  (prompt collection &optional predicate require-match initial-input hist def)
-  "Magit wrapper around `completing-read' or an alternative function.
-
-Option `magit-completing-read-function' can be used to wrap
-around another `completing-read'-like function.  Unless it
-doesn't have the exact same signature, an additional wrapper is
-required.  Even if it has the same signature it might be a good
-idea to wrap it, so that `magit-prompt-with-default' can be used.
-
-See `completing-read' for the meanings of the arguments, but note
-that this wrapper makes the following changes:
-
-- If REQUIRE-MATCH is nil and the user exits without a choice,
-  then return nil instead of an empty string.
-
-- If REQUIRE-MATCH is non-nil and the users exits without a
-  choice, then raise an user-error.
-
-- \": \" is appended to PROMPT.
-
-- If a `magit-completing-read-function' is used which in turn
-  uses `magit-prompt-with-completion' and DEF is non-nil, then
-  PROMPT is modified to end with \" (default DEF): \".
-
-The use of another completing function and/or wrapper obviously
-results in additional differences."
-  (let ((reply (funcall magit-completing-read-function
-                        (concat prompt ": ")
-                        (if (and def (not (member def collection)))
-                            (cons def collection)
-                          collection)
-                        predicate
-                        require-match initial-input hist def)))
-    (if (string= reply "")
-        (if require-match
-            (user-error "Nothing selected")
-          nil)
-      reply)))
-
-(defun magit--completion-table (collection)
-  (lambda (string pred action)
-    (if (eq action 'metadata)
-        '(metadata (display-sort-function . identity))
-      (complete-with-action action collection string pred))))
-
-(defun magit-builtin-completing-read
-  (prompt choices &optional predicate require-match initial-input hist def)
-  "Magit wrapper for standard `completing-read' function."
-  (cl-letf (((symbol-function 'completion-pcm--all-completions)
-             #'magit-completion-pcm--all-completions))
-    (completing-read (if (or (bound-and-true-p helm-mode)
-                             (bound-and-true-p ivy-mode))
-                         prompt
-                       (magit-prompt-with-default prompt def))
-                     (magit--completion-table choices)
-                     predicate require-match
-                     initial-input hist def)))
-
-(defvar helm-completion-in-region-default-sort-fn)
-
-(defun magit-completing-read-multiple
-  (prompt choices &optional sep default hist keymap)
-  "Read multiple items from CHOICES, separated by SEP.
-
-Set up the `crm' variables needed to read multiple values with
-`read-from-minibuffer'.
-
-SEP is a regexp matching characters that can separate choices.
-When SEP is nil, it defaults to `crm-default-separator'.
-DEFAULT, HIST, and KEYMAP are passed to `read-from-minibuffer'.
-When KEYMAP is nil, it defaults to `crm-local-completion-map'.
-
-Unlike `completing-read-multiple', the return value is not split
-into a list."
-  (let* ((crm-separator (or sep crm-default-separator))
-         (crm-completion-table (magit--completion-table choices))
-         (choose-completion-string-functions
-          '(crm--choose-completion-string))
-         (minibuffer-completion-table #'crm--collection-fn)
-         (minibuffer-completion-confirm t)
-         (helm-completion-in-region-default-sort-fn nil)
-         (input
-          (cl-letf (((symbol-function 'completion-pcm--all-completions)
-                     #'magit-completion-pcm--all-completions))
-            (read-from-minibuffer
-             (concat prompt (and default (format " (%s)" default)) ": ")
-             nil (or keymap crm-local-completion-map)
-             nil hist default))))
-    (when (string-equal input "")
-      (or (setq input default)
-          (user-error "Nothing selected")))
-    input))
-
-(defun magit-ido-completing-read
-  (prompt choices &optional predicate require-match initial-input hist def)
-  "Ido-based `completing-read' almost-replacement.
-
-Unfortunately `ido-completing-read' is not suitable as a
-drop-in replacement for `completing-read', instead we use
-`ido-completing-read+' from the third-party package by the
-same name."
-  (if (require 'ido-completing-read+ nil t)
-      (ido-completing-read+ prompt choices predicate require-match
-                            initial-input hist def)
-    (display-warning 'magit "ido-completing-read+ is not installed
-
-To use Ido completion with Magit you need to install the
-third-party `ido-completing-read+' packages.  Falling
-back to built-in `completing-read' for now." :error)
-    (magit-builtin-completing-read prompt choices predicate require-match
-                                   initial-input hist def)))
-
-(defun magit-prompt-with-default (prompt def)
-  (if (and def (> (length prompt) 2)
-           (string-equal ": " (substring prompt -2)))
-      (format "%s (default %s): " (substring prompt 0 -2) def)
-    prompt))
-
-(defvar magit-minibuffer-local-ns-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map minibuffer-local-map)
-    (define-key map "\s" 'magit-whitespace-disallowed)
-    (define-key map "\t" 'magit-whitespace-disallowed)
-    map))
-
-(defun magit-whitespace-disallowed ()
-  "Beep to tell the user that whitespace is not allowed."
-  (interactive)
-  (ding)
-  (message "Whitespace isn't allowed here")
-  (setq defining-kbd-macro nil)
-  (force-mode-line-update))
-
-(defun magit-read-string (prompt &optional initial-input history default-value
-                                 inherit-input-method no-whitespace)
-  "Read a string from the minibuffer, prompting with string PROMPT.
-
-This is similar to `read-string', but
-* empty input is only allowed if DEFAULT-VALUE is non-nil in
-  which case that is returned,
-* whitespace is not allowed if NO-WHITESPACE is non-nil,
-* \": \" is appended to PROMPT, and
-* an invalid DEFAULT-VALUE is silently ignored."
-  (when default-value
-    (when (consp default-value)
-      (setq default-value (car default-value)))
-    (unless (stringp default-value)
-      (setq default-value nil)))
-  (let* ((minibuffer-completion-table nil)
-         (val (read-from-minibuffer
-               (magit-prompt-with-default (concat prompt ": ") default-value)
-               initial-input (and no-whitespace magit-minibuffer-local-ns-map)
-               nil history default-value inherit-input-method)))
-    (when (and (string= val "") default-value)
-      (setq val default-value))
-    (cond ((string= val "")
-           (user-error "Need non-empty input"))
-          ((and no-whitespace (string-match-p "[\s\t\n]" val))
-           (user-error "Input contains whitespace"))
-          (t val))))
-
-(defun magit-read-string-ns (prompt &optional initial-input history
-                                    default-value inherit-input-method)
-  "Call `magit-read-string' with non-nil NO-WHITESPACE."
-  (magit-read-string prompt initial-input history default-value
-                     inherit-input-method t))
-
-(defmacro magit-read-char-case (prompt verbose &rest clauses)
-  (declare (indent 2)
-           (debug (form form &rest (characterp form body))))
-  `(pcase (read-char-choice
-           (concat ,prompt
-                   ,(concat (mapconcat 'cadr clauses ", ")
-                            (and verbose ", or [C-g] to abort") " "))
-           ',(mapcar 'car clauses))
-     ,@(--map `(,(car it) ,@(cddr it)) clauses)))
-
-(defun magit-y-or-n-p (prompt &optional action)
-  "Ask user a \"y or n\" or a \"yes or no\" question using PROMPT.
-Which kind of question is used depends on whether
-ACTION is a member of option `magit-slow-confirm'."
-  (if (or (eq magit-slow-confirm t)
-          (and action (member action magit-slow-confirm)))
-      (yes-or-no-p prompt)
-    (y-or-n-p prompt)))
-
-(cl-defun magit-confirm (action &optional prompt prompt-n (items nil sitems))
-  (declare (indent defun))
-  (setq prompt-n (format (concat (or prompt-n prompt) "? ") (length items)))
-  (setq prompt   (format (concat (or prompt (magit-confirm-make-prompt action))
-                                 "? ")
-                         (car items)))
-  (cond ((and (not (eq action t))
-              (or (eq magit-no-confirm t)
-                  (memq action
-                        `(,@magit-no-confirm
-                          ,@(and magit-wip-before-change-mode
-                                 (memq 'safe-with-wip magit-no-confirm)
-                                 `(discard reverse
-                                   stage-all-changes
-                                   unstage-all-changes))))))
-         (or (not sitems) items))
-        ((not sitems)
-         (magit-y-or-n-p prompt action))
-        ((= (length items) 1)
-         (and (magit-y-or-n-p prompt action) items))
-        ((> (length items) 1)
-         (let ((buffer (get-buffer-create " *Magit Confirm*")))
-           (with-current-buffer buffer
-             (with-current-buffer-window
-              buffer (cons 'display-buffer-below-selected
-                           '((window-height . fit-window-to-buffer)))
-              (lambda (window _value)
-                (with-selected-window window
-                  (unwind-protect (and (magit-y-or-n-p prompt-n action) items)
-                    (when (window-live-p window)
-                      (quit-restore-window window 'kill)))))
-              (dolist (item items)
-                (insert item "\n"))))))))
-
-(defun magit-confirm-files (action files &optional prompt)
-  (when files
-    (unless prompt
-      (setq prompt (magit-confirm-make-prompt action)))
-    (magit-confirm action
-      (concat prompt " %s")
-      (concat prompt " %i files")
-      files)))
-
-(defun magit-confirm-make-prompt (action)
-  (let ((prompt (symbol-name action)))
-    (replace-regexp-in-string
-     "-" " " (concat (upcase (substring prompt 0 1)) (substring prompt 1)))))
-
-;;; Debug Utilities
-
-;;;###autoload
-(defun magit-emacs-Q-command ()
-  "Show a shell command that runs an uncustomized Emacs with only Magit loaded.
-See info node `(magit)Debugging Tools' for more information."
-  (interactive)
-  (let ((cmd (mapconcat
-              #'shell-quote-argument
-              `(,(concat invocation-directory invocation-name)
-                "-Q" "--eval" "(setq debug-on-error t)"
-                ,@(cl-mapcan
-                   (lambda (dir) (list "-L" dir))
-                   (delete-dups
-                    (mapcar (lambda (lib)
-                              (file-name-directory (locate-library lib)))
-                            '("magit" "magit-popup" "with-editor"
-                              "git-commit" "dash"))))
-                ;; Avoid Emacs bug#16406 by using full path.
-                "-l" ,(file-name-sans-extension (locate-library "magit")))
-              " ")))
-    (message "Uncustomized Magit command saved to kill-ring, %s"
-             "please run it in a terminal.")
-    (kill-new cmd)))
-
-;;; Text Utilities
-
-(defmacro magit-bind-match-strings (varlist string &rest body)
-  "Bind variables to submatches according to VARLIST then evaluate BODY.
-Bind the symbols in VARLIST to submatches of the current match
-data, starting with 1 and incrementing by 1 for each symbol.  If
-the last match was against a string, then that has to be provided
-as STRING."
-  (declare (indent 2) (debug (listp form body)))
-  (let ((s (cl-gensym "string"))
-        (i 0))
-    `(let ((,s ,string))
-       (let ,(save-match-data
-               (--map (list it (list 'match-string (cl-incf i) s)) varlist))
-         ,@body))))
-
-(defun magit-delete-line ()
-  "Delete the rest of the current line."
-  (delete-region (point) (1+ (line-end-position))))
-
-(defun magit-delete-match (&optional num)
-  "Delete text matched by last search.
-If optional NUM is specified, only delete that subexpression."
-  (delete-region (match-beginning (or num 0))
-                 (match-end (or num 0))))
-
-(defun magit-file-line (file)
-  "Return the first line of FILE as a string."
-  (when (file-regular-p file)
-    (with-temp-buffer
-      (insert-file-contents file)
-      (buffer-substring-no-properties (point-min)
-                                      (line-end-position)))))
-
-(defun magit-file-lines (file &optional keep-empty-lines)
-  "Return a list of strings containing one element per line in FILE.
-Unless optional argument KEEP-EMPTY-LINES is t, trim all empty lines."
-  (when (file-regular-p file)
-    (with-temp-buffer
-      (insert-file-contents file)
-      (split-string (buffer-string) "\n" (not keep-empty-lines)))))
-
-;;; Missing from Emacs
-
-(defun magit-kill-this-buffer ()
-  "Kill the current buffer."
-  (interactive)
-  (kill-buffer (current-buffer)))
-
-;;; Kludges for Emacs Bugs
-
-(defun magit-file-accessible-directory-p (filename)
-  "Like `file-accessible-directory-p' but work around an Apple bug.
-See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21573#17
-and https://github.com/magit/magit/issues/2295."
-  (and (file-directory-p filename)
-       (file-accessible-directory-p filename)))
-
-(when (version<= "25.1" emacs-version)
-  (with-eval-after-load 'vc-git
-    (defun vc-git-conflicted-files (directory)
-      "Return the list of files with conflicts in DIRECTORY."
-      (let* ((status
-              (vc-git--run-command-string directory "diff-files"
-                                          "--name-status"))
-             (lines (when status (split-string status "\n" 'omit-nulls)))
-             files)
-        (dolist (line lines files)
-          (when (string-match "\\([ MADRCU?!]\\)[ \t]+\\(.+\\)" line)
-            (let ((state (match-string 1 line))
-                  (file (match-string 2 line)))
-              (when (equal state "U")
-                (push (expand-file-name file directory) files)))))))))
-
-;; `completion-pcm--all-completions' reverses the completion list.  To
-;; preserve the order of our pre-sorted completions, we'll temporarily
-;; override it with the function below.  bug#24676
-(defun magit-completion-pcm--all-completions (prefix pattern table pred)
-  (if (completion-pcm--pattern-trivial-p pattern)
-      (all-completions (concat prefix (car pattern)) table pred)
-    (let* ((regex (completion-pcm--pattern->regex pattern))
-           (case-fold-search completion-ignore-case)
-           (completion-regexp-list (cons regex completion-regexp-list))
-           (compl (all-completions
-                   (concat prefix
-                           (if (stringp (car pattern)) (car pattern) ""))
-                   table pred)))
-      (if (not (functionp table))
-          compl
-        (let ((poss ()))
-          (dolist (c compl)
-            (when (string-match-p regex c) (push c poss)))
-          ;; This `nreverse' call is the only code change made to the
-          ;; `completion-pcm--all-completions' that shipped with Emacs 25.1.
-          (nreverse poss))))))
-
-;;; Kludges for Incompatible Modes
-
-(defvar whitespace-mode)
-
-(defun whitespace-dont-turn-on-in-magit-mode ()
-  "Prevent `whitespace-mode' from being turned on in Magit buffers.
-Because `whitespace-mode' uses font-lock and Magit does not,
-they are not compatible.  See `magit-diff-paint-whitespace'
-for an alternative."
-  (when (derived-mode-p 'magit-mode)
-    (setq whitespace-mode nil)
-    (user-error
-     "Whitespace-Mode isn't compatible with Magit.  %s"
-     "See `magit-diff-paint-whitespace' for an alternative.")))
-
-(advice-add 'whitespace-turn-on :before
-            'whitespace-dont-turn-on-in-magit-mode)
-
-;;; Kludges for Custom
-
-(defun magit-custom-initialize-reset (symbol exp)
-  "Initialize SYMBOL based on EXP.
-Set the symbol, using `set-default' (unlike
-`custom-initialize-reset' which uses the `:set' function if any.)
-The value is either the symbol's current value
- (as obtained using the `:get' function), if any,
-or the value in the symbol's `saved-value' property if any,
-or (last of all) the value of EXP."
-  (set-default-toplevel-value
-   symbol
-   (condition-case nil
-       (let ((def (default-toplevel-value symbol))
-             (getter (get symbol 'custom-get)))
-         (if getter (funcall getter symbol) def))
-     (error
-      (eval (let ((sv (get symbol 'saved-value)))
-              (if sv (car sv) exp)))))))
-
-(defun magit-hook-custom-get (symbol)
-  (if (symbol-file symbol 'defvar)
-      (default-toplevel-value symbol)
-    ;;
-    ;; Called by `custom-initialize-reset' on behalf of `symbol's
-    ;; `defcustom', which is being evaluated for the first time to
-    ;; set the initial value, but there's already a default value,
-    ;; which most likely was established by one or more `add-hook'
-    ;; calls.
-    ;;
-    ;; We combine the `standard-value' and the current value, while
-    ;; preserving the order established by `:options', and return
-    ;; the result of that to be used as the "initial" default value.
-    ;;
-    (let ((standard (eval (car (get symbol 'standard-value))))
-          (current (default-toplevel-value symbol))
-          (value nil))
-      (dolist (fn (get symbol 'custom-options))
-        (when (or (memq fn standard)
-                  (memq fn current))
-          (push fn value)))
-      (dolist (fn current)
-        (unless (memq fn value)
-          (push fn value)))
-      (nreverse value))))
-
-;;; Kludges for Info Manuals
-
-;;;###autoload
-(defun Info-follow-nearest-node--magit-gitman (fn &optional fork)
-  (if magit-view-git-manual-method
-      (let ((node (Info-get-token
-                   (point) "\\*note[ \n\t]+"
-                   "\\*note[ \n\t]+\\([^:]*\\):\\(:\\|[ \n\t]*(\\)?")))
-        (if (and node (string-match "^(gitman)\\(.+\\)" node))
-            (pcase magit-view-git-manual-method
-              (`man   (require 'man)
-                      (man (match-string 1 node)))
-              (`woman (require 'woman)
-                      (woman (match-string 1 node)))
-              (_
-               (user-error "Invalid value for `magit-view-git-documentation'")))
-          (funcall fn fork)))
-    (funcall fn fork)))
-
-;;;###autoload
-(advice-add 'Info-follow-nearest-node :around
-            'Info-follow-nearest-node--magit-gitman)
-
-;;;###autoload
-(defun org-man-export--magit-gitman (fn link description format)
-  (if (and (eq format 'texinfo)
-           (string-match-p "\\`git" link))
-      (replace-regexp-in-string "%s" link "
-@ifinfo
-@ref{%s,,,gitman,}.
-@end ifinfo
-@ifhtml
-@html
-the <a href=\"http://git-scm.com/docs/%s\">%s(1)</a> manpage.
-@end html
-@end ifhtml
-@iftex
-the %s(1) manpage.
-@end iftex
-")
-    (funcall fn link description format)))
-
-;;;###autoload
-(advice-add 'org-man-export :around
-            'org-man-export--magit-gitman)
-
-;;; Miscellaneous
-
-(defun magit-message (format-string &rest args)
-  "Display a message at the bottom of the screen, or not.
-Like `message', except that if the users configured option
-`magit-no-message' to prevent the message corresponding to
-FORMAT-STRING to be displayed, then don't."
-  (unless (--first (string-prefix-p it format-string) magit-no-message)
-    (apply #'message format-string args)))
-
-(provide 'magit-utils)
-;;; magit-utils.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-utils.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-wip.el
@@ -1,286 +0,0 @@
-;;; magit-wip.el --- commit snapshots to work-in-progress refs  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library defines tree global modes which automatically commit
-;; snapshots to branch-specific work-in-progress refs before and after
-;; making changes, and two commands which can be used to do so on
-;; demand.
-
-;;; Code:
-
-(require 'magit-core)
-(require 'magit-log)
-
-;;; Options
-
-(defgroup magit-wip nil
-  "Automatically commit to work-in-progress refs."
-  :link '(info-link "(magit)Wip Modes")
-  :group 'magit-modes
-  :group 'magit-essentials)
-
-(defcustom magit-wip-after-save-local-mode-lighter " sWip"
-  "Lighter for Magit-Wip-After-Save-Local mode."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-wip
-  :type 'string)
-
-(defcustom magit-wip-after-apply-mode-lighter " aWip"
-  "Lighter for Magit-Wip-After-Apply mode."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-wip
-  :type 'string)
-
-(defcustom magit-wip-before-change-mode-lighter " cWip"
-  "Lighter for Magit-Wip-Before-Change mode."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-wip
-  :type 'string)
-
-(defcustom magit-wip-namespace "refs/wip/"
-  "Namespace used for work-in-progress refs.
-The wip refs are named \"<namespace/>index/<branchref>\"
-and \"<namespace/>wtree/<branchref>\".  When snapshots
-are created while the `HEAD' is detached then \"HEAD\"
-is used as `branch-ref'."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-wip
-  :type 'string)
-
-;;; Modes
-
-(define-minor-mode magit-wip-after-save-local-mode
-  "After saving, also commit to a worktree work-in-progress ref.
-
-After saving the current file-visiting buffer this mode also
-commits the changes to the worktree work-in-progress ref for
-the current branch.
-
-This mode should be enabled globally by turning on the globalized
-variant `magit-wip-after-save-mode'."
-  :package-version '(magit . "2.1.0")
-  :lighter magit-wip-after-save-local-mode-lighter
-  (if magit-wip-after-save-local-mode
-      (if (and buffer-file-name (magit-inside-worktree-p))
-          (add-hook 'after-save-hook 'magit-wip-commit-buffer-file t t)
-        (setq magit-wip-after-save-local-mode nil)
-        (user-error "Need a worktree and a file"))
-    (remove-hook 'after-save-hook 'magit-wip-commit-buffer-file t)))
-
-(defun magit-wip-after-save-local-mode-turn-on ()
-  (and buffer-file-name
-       (ignore-errors (magit-inside-worktree-p))
-       (magit-file-tracked-p buffer-file-name)
-       (magit-wip-after-save-local-mode)))
-
-;;;###autoload
-(define-globalized-minor-mode magit-wip-after-save-mode
-  magit-wip-after-save-local-mode magit-wip-after-save-local-mode-turn-on
-  :package-version '(magit . "2.1.0")
-  :group 'magit-wip)
-
-(defun magit-wip-commit-buffer-file ()
-  "Commit visited file to a worktree work-in-progress ref.
-
-Also see `magit-wip-after-save-mode' which calls this function
-automatically whenever a buffer visiting a tracked file is saved."
-  (interactive)
-  (--when-let (magit-wip-get-ref)
-    (magit-with-toplevel
-      (let ((file (file-relative-name buffer-file-name)))
-        (magit-wip-commit-worktree
-         it (list file) (if (called-interactively-p 'any)
-                            (format "wip-save %s after save" file)
-                          (format "autosave %s after save" file)))))))
-
-;;;###autoload
-(define-minor-mode magit-wip-after-apply-mode
-  "Commit to work-in-progress refs.
-
-After applying a change using any \"apply variant\"
-command (apply, stage, unstage, discard, and reverse) commit the
-affected files to the current wip refs.  For each branch there
-may be two wip refs; one contains snapshots of the files as found
-in the worktree and the other contains snapshots of the entries
-in the index."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-wip
-  :lighter magit-wip-after-apply-mode-lighter
-  :global t)
-
-(defun magit-wip-commit-after-apply (&optional files msg)
-  (when magit-wip-after-apply-mode
-    (magit-wip-commit files msg)))
-
-;;;###autoload
-(define-minor-mode magit-wip-before-change-mode
-  "Commit to work-in-progress refs before certain destructive changes.
-
-Before invoking a revert command or an \"apply variant\"
-command (apply, stage, unstage, discard, and reverse) commit the
-affected tracked files to the current wip refs.  For each branch
-there may be two wip refs; one contains snapshots of the files
-as found in the worktree and the other contains snapshots of the
-entries in the index.
-
-Only changes to files which could potentially be affected by the
-command which is about to be called are committed."
-  :package-version '(magit . "2.1.0")
-  :group 'magit-wip
-  :lighter magit-wip-before-change-mode-lighter
-  :global t)
-
-(defun magit-wip-commit-before-change (&optional files msg)
-  (when magit-wip-before-change-mode
-    (magit-with-toplevel
-      (magit-wip-commit files msg))))
-
-;;; Core
-
-(defun magit-wip-commit (&optional files msg)
-  "Commit all tracked files to the work-in-progress refs.
-
-Interactively, commit all changes to all tracked files using
-a generic commit message.  With a prefix-argument the commit
-message is read in the minibuffer.
-
-Non-interactively, only commit changes to FILES using MSG as
-commit message."
-  (interactive (list nil (if current-prefix-arg
-                             (magit-read-string "Wip commit message")
-                           "wip-save tracked files")))
-  (--when-let (magit-wip-get-ref)
-    (magit-wip-commit-index it files msg)
-    (magit-wip-commit-worktree it files msg)))
-
-(defun magit-wip-commit-index (ref files msg &optional cached-only)
-  (let* ((wipref (concat magit-wip-namespace "index/" ref))
-         (parent (magit-wip-get-parent ref wipref)))
-    (when (magit-git-failure "diff-index" "--quiet"
-                             (and cached-only "--cached")
-                             parent "--" files)
-      (magit-wip-update-wipref wipref (magit-git-string "write-tree")
-                               parent files msg "index"))))
-
-(defun magit-wip-commit-worktree (ref files msg)
-  (let* ((wipref (concat magit-wip-namespace "wtree/" ref))
-         (parent (magit-wip-get-parent ref wipref))
-         (tree (magit-with-temp-index parent "--reset"
-                 (if files
-                     (magit-call-git "add" "--" files)
-                   (magit-with-toplevel
-                     (magit-call-git "add" "-u" ".")))
-                 (magit-git-string "write-tree"))))
-    (when (magit-git-failure "diff-tree" "--quiet" parent tree "--" files)
-      (magit-wip-update-wipref wipref tree parent files msg "worktree"))))
-
-(defun magit-wip-update-wipref (wipref tree parent files msg start-msg)
-  (let ((len (length files)))
-    (unless (and msg (not (= (aref msg 0) ?\s)))
-      (setq msg (concat
-                 (cond ((= len 0) "autosave tracked files")
-                       ((> len 1) (format "autosave %s files" len))
-                       (t (concat "autosave "
-                                  (file-relative-name (car files)
-                                                      (magit-toplevel)))))
-                 msg)))
-    (unless (equal parent wipref)
-      (setq start-msg (concat "restart autosaving " start-msg))
-      (magit-update-ref wipref start-msg
-                        (magit-git-string "commit-tree" "--no-gpg-sign"
-                                          "-p" parent "-m" start-msg
-                                          (concat parent "^{tree}")))
-      (setq parent wipref))
-    (magit-update-ref wipref msg
-                      (magit-git-string "commit-tree" "--no-gpg-sign"
-                                        "-p" parent "-m" msg tree))))
-
-(defun magit-wip-get-ref ()
-  (let ((ref (or (magit-git-string "symbolic-ref" "HEAD") "HEAD")))
-    (when (magit-rev-verify ref)
-      ref)))
-
-(defun magit-wip-get-parent (ref wipref)
-  (if (and (magit-rev-verify wipref)
-           (equal (magit-git-string "merge-base" wipref ref)
-                  (magit-rev-verify ref)))
-      wipref
-    ref))
-
-;;; Log
-
-(defun magit-wip-log-current (branch args files count)
-  "Show log for the current branch and its wip refs.
-With a negative prefix argument only show the worktree wip ref.
-The absolute numeric value of the prefix argument controls how
-many \"branches\" of each wip ref are shown."
-  (interactive
-   (nconc (list (or (magit-get-current-branch) "HEAD"))
-          (magit-log-arguments)
-          (list (prefix-numeric-value current-prefix-arg))))
-  (magit-wip-log branch args files count))
-
-(defun magit-wip-log (branch args files count)
-  "Show log for a branch and its wip refs.
-With a negative prefix argument only show the worktree wip ref.
-The absolute numeric value of the prefix argument controls how
-many \"branches\" of each wip ref are shown."
-  (interactive
-   (nconc (list (magit-completing-read
-                 "Log branch and its wip refs"
-                 (-snoc (magit-list-local-branch-names) "HEAD")
-                 nil t nil 'magit-revision-history
-                 (or (magit-branch-at-point)
-                     (magit-get-current-branch)
-                     "HEAD")))
-          (magit-log-arguments)
-          (list (prefix-numeric-value current-prefix-arg))))
-  (unless (equal branch "HEAD")
-    (setq branch (concat "refs/heads/" branch)))
-  (magit-log (nconc (list branch)
-                    (magit-wip-log-get-tips
-                     (concat magit-wip-namespace "wtree/" branch)
-                     (abs count))
-                    (and (>= count 0)
-                         (magit-wip-log-get-tips
-                          (concat magit-wip-namespace "index/" branch)
-                          (abs count))))
-             args files))
-
-(defun magit-wip-log-get-tips (wipref count)
-  (-when-let (reflog (magit-git-lines "reflog" wipref))
-    (let (tips)
-      (while (and reflog (> count 1))
-        (setq reflog (cl-member "^[^ ]+ [^:]+: restart autosaving"
-                                reflog :test #'string-match-p))
-        (when (and (cadr reflog)
-                   (string-match "^[^ ]+ \\([^:]+\\)" (cadr reflog)))
-          (push (match-string 1 (cadr reflog)) tips))
-        (setq reflog (cddr reflog))
-        (cl-decf count))
-      (cons wipref (nreverse tips)))))
-
-(provide 'magit-wip)
-;;; magit-wip.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-wip.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit-worktree.el
@@ -1,132 +0,0 @@
-;;; magit-worktree.el --- worktree support  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements support for `git-worktree'.
-
-;;; Code:
-
-(eval-when-compile
-  '(require 'pcase)) ; `pcase-dolist' isn't autoloaded by v24.4
-
-(require 'magit)
-
-;;; Commands
-
-;;;###autoload
-(defun magit-worktree-checkout (path branch)
-  "Checkout BRANCH in a new worktree at PATH."
-  (interactive
-   (let ((branch (magit-read-local-branch "Checkout")))
-     (list (read-directory-name (format "Checkout %s in new worktree: " branch))
-           branch)))
-  (magit-run-git "worktree" "add" (expand-file-name path) branch)
-  (magit-diff-visit-directory path))
-
-;;;###autoload
-(defun magit-worktree-branch (path branch start-point &optional force)
-  "Create a new BRANCH and check it out in a new worktree at PATH."
-  (interactive
-   `(,(read-directory-name "Create worktree: ")
-     ,@(butlast (magit-branch-read-args "Create and checkout branch"))
-     ,current-prefix-arg))
-  (magit-run-git "worktree" "add" (if force "-B" "-b")
-                 branch (expand-file-name path) start-point)
-  (magit-diff-visit-directory path))
-
-(defun magit-worktree-delete (worktree)
-  "Delete a worktree, defaulting to the worktree at point.
-The primary worktree cannot be deleted."
-  (interactive
-   (list (magit-completing-read "Delete worktree"
-                                (cdr (magit-list-worktrees))
-                                nil t nil nil
-                                (magit-section-when (worktree)))))
-  (if (file-directory-p (expand-file-name ".git" worktree))
-      (user-error "Deleting %s would delete the shared .git directory" worktree)
-    (let ((primary (file-name-as-directory (caar (magit-list-worktrees)))))
-      (when (if magit-delete-by-moving-to-trash
-                (magit-confirm-files 'trash (list "worktree"))
-              (magit-confirm-files 'delete (list "worktree")))
-        (let ((delete-by-moving-to-trash magit-delete-by-moving-to-trash))
-          (delete-directory worktree t magit-delete-by-moving-to-trash))
-        (if (file-exists-p default-directory)
-            (magit-run-git "worktree" "prune")
-          (let ((default-directory primary))
-            (magit-run-git "worktree" "prune")))))))
-
-(defun magit-worktree-status (worktree)
-  "Show the status for the worktree at point.
-If there is no worktree at point, then read one in the
-minibuffer.  If the worktree at point is the one whose
-status is already being displayed in the current buffer,
-then show it in Dired instead."
-  (interactive
-   (list (or (magit-section-when (worktree))
-             (magit-completing-read
-              "Show status for worktree"
-              (cl-delete (directory-file-name (magit-toplevel))
-                         (magit-list-worktrees)
-                         :test #'equal :key #'car)))))
-  (magit-diff-visit-directory worktree))
-
-;;; Sections
-
-(defvar magit-worktree-section-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap magit-visit-thing]  'magit-worktree-status)
-    (define-key map [remap magit-delete-thing] 'magit-worktree-delete)
-    map)
-  "Keymap for `worktree' sections.")
-
-(defun magit-insert-worktrees ()
-  "Insert sections for all worktrees.
-If there is only one worktree, then insert nothing."
-  (let ((worktrees (magit-list-worktrees)))
-    (when (> (length worktrees) 1)
-      (magit-insert-section (worktrees)
-        (magit-insert-heading "Worktrees:")
-        (let* ((cols
-                (mapcar (-lambda ((path barep commit branch))
-                          (cons (cond
-                                 (branch (propertize branch
-                                                     'face 'magit-branch-local))
-                                 (commit (propertize (magit-rev-abbrev commit)
-                                                     'face 'magit-hash))
-                                 (barep  "(bare)"))
-                                path))
-                        worktrees))
-               (align (1+ (-max (--map (string-width (car it)) cols)))))
-          (pcase-dolist (`(,head . ,path) cols)
-            (magit-insert-section (worktree path)
-              (insert head)
-              (indent-to align)
-              (insert (let ((r (file-relative-name path))
-                            (a (abbreviate-file-name path)))
-                        (if (< (string-width r) (string-width a)) r a)))
-              (insert ?\n))))
-        (insert ?\n)))))
-
-(provide 'magit-worktree)
-;;; magit-worktree.el ends here
.emacs.d/elpa/magit-20170913.1424/magit-worktree.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit.el
@@ -1,1084 +0,0 @@
-;;; magit.el --- A Git porcelain inside Emacs  -*- lexical-binding: t; coding: utf-8 -*-
-
-;; Copyright (C) 2008-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; Author: Marius Vollmer <marius.vollmer@gmail.com>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-;;	Kyle Meyer        <kyle@kyleam.com>
-;;	Noam Postavsky    <npostavs@users.sourceforge.net>
-;; Former-Maintainers:
-;;	Nicolas Dudebout  <nicolas.dudebout@gatech.edu>
-;;	Peter J. Weisberg <pj@irregularexpressions.net>
-;;	Phil Jackson      <phil@shellarchive.co.uk>
-;;	Rémi Vanicat      <vanicat@debian.org>
-;;	Yann Hodique      <yann.hodique@gmail.com>
-
-;; Package-Requires: ((emacs "24.4") (async "20170823") (dash "20170810") (with-editor "20170817") (git-commit "20170823") (magit-popup "20170824"))
-;; Keywords: git tools vc
-;; Homepage: https://github.com/magit/magit
-
-;; Magit requires at least GNU Emacs 24.4 and Git 1.9.4.
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; Magit is an interface to the version control system Git,
-;; implemented as an Emacs package.  Magit aspires to be a complete
-;; Git porcelain.  While we cannot (yet) claim, that Magit wraps and
-;; improves upon each and every Git command, it is complete enough to
-;; allow even experienced Git users to perform almost all of their
-;; daily version control tasks directly from within Emacs.  While many
-;; fine Git clients exist, only Magit and Git itself deserve to be
-;; called porcelains.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'dash)
-
-(require 'with-editor)
-(require 'git-commit)
-(require 'magit-core)
-(require 'magit-diff)
-(require 'magit-apply)
-(require 'magit-log)
-(require 'magit-repos)
-
-(require 'format-spec)
-(require 'package nil t) ; used in `magit-version'
-
-(eval-when-compile (require 'dired-x))
-(declare-function dired-jump 'dired-x)
-(eval-when-compile (require 'eshell))
-(declare-function eshell-parse-arguments 'eshell)
-(eval-when-compile (require 'message))
-
-(defconst magit--minimal-git "1.9.4")
-(defconst magit--minimal-emacs "24.4")
-
-;;; Faces
-
-(defface magit-header-line
-  '((t :inherit magit-section-heading))
-  "Face for the `header-line'."
-  :group 'magit-faces)
-
-(defface magit-dimmed
-  '((((class color) (background light)) :foreground "grey50")
-    (((class color) (background  dark)) :foreground "grey50"))
-  "Face for text that shouldn't stand out."
-  :group 'magit-faces)
-
-(defface magit-hash
-  '((((class color) (background light)) :foreground "grey60")
-    (((class color) (background  dark)) :foreground "grey40"))
-  "Face for the sha1 part of the log output."
-  :group 'magit-faces)
-
-(defface magit-tag
-  '((((class color) (background light)) :foreground "Goldenrod4")
-    (((class color) (background  dark)) :foreground "LightGoldenrod2"))
-  "Face for tag labels shown in log buffer."
-  :group 'magit-faces)
-
-(defface magit-branch-remote
-  '((((class color) (background light)) :foreground "DarkOliveGreen4")
-    (((class color) (background  dark)) :foreground "DarkSeaGreen2"))
-  "Face for remote branch head labels shown in log buffer."
-  :group 'magit-faces)
-
-(defface magit-branch-local
-  '((((class color) (background light)) :foreground "SkyBlue4")
-    (((class color) (background  dark)) :foreground "LightSkyBlue1"))
-  "Face for local branches."
-  :group 'magit-faces)
-
-(defface magit-branch-current
-  '((((class color) (background light)) :inherit magit-branch-local :box t)
-    (((class color) (background  dark)) :inherit magit-branch-local :box t))
-  "Face for current branch."
-  :group 'magit-faces)
-
-(defface magit-head
-  '((((class color) (background light)) :inherit magit-branch-local)
-    (((class color) (background  dark)) :inherit magit-branch-local))
-  "Face for the symbolic ref `HEAD'."
-  :group 'magit-faces)
-
-(defface magit-refname
-  '((((class color) (background light)) :foreground "grey30")
-    (((class color) (background  dark)) :foreground "grey80"))
-  "Face for refnames without a dedicated face."
-  :group 'magit-faces)
-
-(defface magit-refname-stash
-  '((t :inherit magit-refname))
-  "Face for wip refnames."
-  :group 'magit-faces)
-
-(defface magit-refname-wip
-  '((t :inherit magit-refname))
-  "Face for wip refnames."
-  :group 'magit-faces)
-
-(defface magit-keyword
-  '((t :inherit font-lock-string-face))
-  "Face for parts of commit messages inside brackets."
-  :group 'magit-faces)
-
-(defface magit-signature-good
-  '((t :foreground "green"))
-  "Face for good signatures."
-  :group 'magit-faces)
-
-(defface magit-signature-bad
-  '((t :foreground "red" :weight bold))
-  "Face for bad signatures."
-  :group 'magit-faces)
-
-(defface magit-signature-untrusted
-  '((t :foreground "cyan"))
-  "Face for good untrusted signatures."
-  :group 'magit-faces)
-
-(defface magit-signature-expired
-  '((t :foreground "orange"))
-  "Face for signatures that have expired."
-  :group 'magit-faces)
-
-(defface magit-signature-expired-key
-  '((t :inherit magit-signature-expired))
-  "Face for signatures made by an expired key."
-  :group 'magit-faces)
-
-(defface magit-signature-revoked
-  '((t :foreground "violet red"))
-  "Face for signatures made by a revoked key."
-  :group 'magit-faces)
-
-(defface magit-signature-error
-  '((t :foreground "firebrick3"))
-  "Face for signatures that cannot be checked (e.g. missing key)."
-  :group 'magit-faces)
-
-(defface magit-cherry-unmatched
-  '((t :foreground "cyan"))
-  "Face for unmatched cherry commits."
-  :group 'magit-faces)
-
-(defface magit-cherry-equivalent
-  '((t :foreground "magenta"))
-  "Face for equivalent cherry commits."
-  :group 'magit-faces)
-
-(defface magit-filename
-  '((t :weight normal))
-  "Face for filenames."
-  :group 'magit-faces)
-
-;;; Commands
-;;;; Merge
-
-;;;###autoload (autoload 'magit-merge-popup "magit" nil t)
-(magit-define-popup magit-merge-popup
-  "Popup console for merge commands."
-  :man-page "git-merge"
-  :switches '((?f "Fast-forward only" "--ff-only")
-              (?n "No fast-forward"   "--no-ff")
-              (?s "Squash"            "--squash"))
-  :options  '((?s "Strategy" "--strategy="))
-  :actions  '((?m "Merge"                  magit-merge)
-              (?e "Merge and edit message" magit-merge-editmsg)
-              (?p "Preview merge"          magit-merge-preview)
-              (?n "Merge but don't commit" magit-merge-nocommit))
-  :sequence-actions   '((?m "Commit merge" magit-commit)
-                        (?a "Abort merge"  magit-merge-abort))
-  :sequence-predicate 'magit-merge-state
-  :default-action 'magit-merge
-  :max-action-columns 2)
-
-;;;###autoload
-(defun magit-merge (rev &optional args nocommit)
-  "Merge commit REV into the current branch; using default message.
-
-Unless there are conflicts or a prefix argument is used create a
-merge commit using a generic commit message and without letting
-the user inspect the result.  With a prefix argument pretend the
-merge failed to give the user the opportunity to inspect the
-merge.
-
-\(git merge --no-edit|--no-commit [ARGS] REV)"
-  (interactive (list (magit-read-other-branch-or-commit "Merge")
-                     (magit-merge-arguments)
-                     current-prefix-arg))
-  (magit-merge-assert)
-  (magit-run-git-async "merge" (if nocommit "--no-commit" "--no-edit") args rev))
-
-;;;###autoload
-(defun magit-merge-editmsg (rev &optional args)
-  "Merge commit REV into the current branch; and edit message.
-Perform the merge and prepare a commit message but let the user
-edit it.
-\n(git merge --edit --no-ff [ARGS] REV)"
-  (interactive (list (magit-read-other-branch-or-commit "Merge")
-                     (magit-merge-arguments)))
-  (magit-merge-assert)
-  (cl-pushnew "--no-ff" args :test #'equal)
-  (apply #'magit-run-git-with-editor "merge" "--edit"
-         (append args (list rev))))
-
-;;;###autoload
-(defun magit-merge-nocommit (rev &optional args)
-  "Merge commit REV into the current branch; pretending it failed.
-Pretend the merge failed to give the user the opportunity to
-inspect the merge and change the commit message.
-\n(git merge --no-commit --no-ff [ARGS] REV)"
-  (interactive (list (magit-read-other-branch-or-commit "Merge")
-                     (magit-merge-arguments)))
-  (magit-merge-assert)
-  (cl-pushnew "--no-ff" args :test #'equal)
-  (magit-run-git-async "merge" "--no-commit" args rev))
-
-;;;###autoload
-(defun magit-merge-preview (rev)
-  "Preview result of merging REV into the current branch."
-  (interactive (list (magit-read-other-branch-or-commit "Preview merge")))
-  (magit-mode-setup #'magit-merge-preview-mode rev))
-
-(define-derived-mode magit-merge-preview-mode magit-diff-mode "Magit Merge"
-  "Mode for previewing a merge."
-  :group 'magit-diff
-  (hack-dir-local-variables-non-file-buffer))
-
-(defun magit-merge-preview-refresh-buffer (rev)
-  (let* ((branch (magit-get-current-branch))
-         (head (or branch (magit-rev-verify "HEAD"))))
-    (setq header-line-format
-          (propertize (format "Preview merge of %s into %s"
-                              rev (or branch "HEAD"))
-                      'face 'magit-header-line))
-    (magit-insert-section (diffbuf)
-      (magit-git-wash #'magit-diff-wash-diffs
-        "merge-tree" (magit-git-string "merge-base" head rev) head rev))))
-
-;;;###autoload
-(defun magit-merge-abort ()
-  "Abort the current merge operation.
-\n(git merge --abort)"
-  (interactive)
-  (if (file-exists-p (magit-git-dir "MERGE_HEAD"))
-      (when (magit-confirm 'abort-merge)
-        (magit-run-git-async "merge" "--abort"))
-    (user-error "No merge in progress")))
-
-(defun magit-checkout-stage (file arg)
-  "During a conflict checkout and stage side, or restore conflict."
-  (interactive
-   (let ((file (magit-completing-read "Checkout file"
-                                      (magit-tracked-files) nil nil nil
-                                      'magit-read-file-hist
-                                      (magit-current-file))))
-     (cond ((member file (magit-unmerged-files))
-            (list file (magit-checkout-read-stage file)))
-           ((yes-or-no-p (format "Restore conflicts in %s? " file))
-            (list file "--merge"))
-           (t
-            (user-error "Quit")))))
-  (pcase (cons arg (cddr (car (magit-file-status file))))
-    ((or `("--ours"   ?D ,_)
-         `("--theirs" ,_ ?D))
-     (magit-run-git "rm" "--" file))
-    (_ (if (equal arg "--merge")
-           ;; This fails if the file was deleted on one
-           ;; side.  And we cannot do anything about it.
-           (magit-run-git "checkout" "--merge" "--" file)
-         (magit-call-git "checkout" arg "--" file)
-         (magit-run-git "add" "-u" "--" file)))))
-
-(defun magit-merge-state ()
-  (file-exists-p (magit-git-dir "MERGE_HEAD")))
-
-(defun magit-merge-assert ()
-  (or (not (magit-anything-modified-p t))
-      (magit-confirm 'merge-dirty
-        "Merging with dirty worktree is risky.  Continue")
-      (user-error "Abort")))
-
-(defun magit-checkout-read-stage (file)
-  (magit-read-char-case (format "For %s checkout: " file) t
-    (?o "[o]ur stage"   "--ours")
-    (?t "[t]heir stage" "--theirs")
-    (?c "[c]onflict"    "--merge")))
-
-(defun magit-insert-merge-log ()
-  "Insert section for the on-going merge.
-Display the heads that are being merged.
-If no merge is in progress, do nothing."
-  (-when-let (heads (mapcar 'magit-get-shortname
-                            (magit-file-lines (magit-git-dir "MERGE_HEAD"))))
-    (magit-insert-section (commit (car heads))
-      (magit-insert-heading
-        (format "Merging %s:" (mapconcat 'identity heads ", ")))
-      (magit-insert-log
-       (concat (magit-git-string "merge-base" "--octopus" "HEAD" (car heads))
-               ".." (car heads))
-       (let ((args magit-log-section-arguments))
-         (unless (member "--decorate=full" magit-log-section-arguments)
-           (push "--decorate=full" args))
-         args)))))
-
-;;;; Reset
-
-;;;###autoload (autoload 'magit-reset-popup "magit" nil t)
-(magit-define-popup magit-reset-popup
-  "Popup console for reset commands."
-  :man-page "git-reset"
-  :actions '((?m "reset mixed  (HEAD and index)"         magit-reset-head)
-             (?s "reset soft   (HEAD only)"              magit-reset-soft)
-             (?h "reset hard   (HEAD, index, and files)" magit-reset-hard)
-             (?i "reset index  (index only)"             magit-reset-index) nil
-             (?f "reset a file"                          magit-file-checkout))
-  :max-action-columns 1)
-
-;;;###autoload
-(defun magit-reset-index (commit)
-  "Reset the index to COMMIT.
-Keep the head and working tree as-is, so if COMMIT refers to the
-head this effectively unstages all changes.
-\n(git reset COMMIT .)"
-  (interactive (list (magit-read-branch-or-commit "Reset index to")))
-  (magit-reset-internal nil commit "."))
-
-;;;###autoload
-(defun magit-reset (commit &optional hard)
-  "Reset the head and index to COMMIT, but not the working tree.
-With a prefix argument also reset the working tree.
-\n(git reset --mixed|--hard COMMIT)"
-  (interactive (list (magit-read-branch-or-commit
-                      (if current-prefix-arg
-                          "Hard reset to"
-                        "Reset head to"))
-                     current-prefix-arg))
-  (magit-reset-internal (if hard "--hard" "--mixed") commit))
-
-;;;###autoload
-(defun magit-reset-head (commit)
-  "Reset the head and index to COMMIT, but not the working tree.
-\n(git reset --mixed COMMIT)"
-  (interactive (list (magit-read-branch-or-commit "Reset head to")))
-  (magit-reset-internal "--mixed" commit))
-
-;;;###autoload
-(defun magit-reset-soft (commit)
-  "Reset the head to COMMIT, but not the index and working tree.
-\n(git reset --soft REVISION)"
-  (interactive (list (magit-read-branch-or-commit "Soft reset to")))
-  (magit-reset-internal "--soft" commit))
-
-;;;###autoload
-(defun magit-reset-hard (commit)
-  "Reset the head, index, and working tree to COMMIT.
-\n(git reset --hard REVISION)"
-  (interactive (list (magit-read-branch-or-commit "Hard reset to")))
-  (magit-reset-internal "--hard" commit))
-
-(defun magit-reset-internal (arg commit &optional path)
-  (when (and (not (member arg '("--hard" nil)))
-             (equal (magit-rev-parse commit)
-                    (magit-rev-parse "HEAD~")))
-    (with-temp-buffer
-      (magit-git-insert "show" "-s" "--format=%B" "HEAD")
-      (when git-commit-major-mode
-        (funcall git-commit-major-mode))
-      (git-commit-setup-font-lock)
-      (git-commit-save-message)))
-  (let ((cmd (if (and (equal commit "HEAD") (not arg)) "unstage" "reset")))
-    (magit-wip-commit-before-change nil (concat " before " cmd))
-    (magit-run-git "reset" arg commit "--" path)
-    (when (equal cmd "unstage")
-      (magit-wip-commit-after-apply nil " after unstage"))))
-
-;;;; Tag
-
-;;;###autoload (autoload 'magit-tag-popup "magit" nil t)
-(magit-define-popup magit-tag-popup
-  "Popup console for tag commands."
-  :man-page "git-tag"
-  :switches '((?a "Annotate" "--annotate")
-              (?s "Sign"     "--sign")
-              (?f "Force"    "--force"))
-  :actions  '((?t "Create"   magit-tag)
-              (?k "Delete"   magit-tag-delete)
-              (?p "Prune"    magit-tag-prune))
-  :default-action 'magit-tag)
-
-;;;###autoload
-(defun magit-tag (name rev &optional args)
-  "Create a new tag with the given NAME at REV.
-With a prefix argument annotate the tag.
-\n(git tag [--annotate] NAME REV)"
-  (interactive (list (magit-read-tag "Tag name")
-                     (or (and (memq 'magit-tag magit-no-confirm-default)
-                              (or (magit-branch-or-commit-at-point)
-                                  (magit-get-current-branch)))
-                         (magit-read-branch-or-commit "Place tag on"))
-                     (let ((args (magit-tag-arguments)))
-                       (when current-prefix-arg
-                         (cl-pushnew "--annotate" args))
-                       args)))
-  (magit-run-git-with-editor "tag" args name rev))
-
-;;;###autoload
-(defun magit-tag-delete (tags)
-  "Delete one or more tags.
-If the region marks multiple tags (and nothing else), then offer
-to delete those, otherwise prompt for a single tag to be deleted,
-defaulting to the tag at point.
-\n(git tag -d TAGS)"
-  (interactive (list (--if-let (magit-region-values 'tag)
-                         (magit-confirm t nil "Delete %i tags" it)
-                       (magit-read-tag "Delete tag" t))))
-  (magit-run-git "tag" "-d" tags))
-
-(defun magit-tag-prune (tags remote-tags remote)
-  "Offer to delete tags missing locally from REMOTE, and vice versa."
-  (interactive
-   (let* ((remote (magit-read-remote "Prune tags using remote"))
-          (tags   (magit-list-tags))
-          (rtags  (prog2 (message "Determining remote tags...")
-                      (magit-remote-list-tags remote)
-                    (message "Determining remote tags...done")))
-          (ltags  (-difference tags rtags))
-          (rtags  (-difference rtags tags)))
-     (unless (or ltags rtags)
-       (message "Same tags exist locally and remotely"))
-     (unless (magit-confirm t "Delete %s locally"
-               "Delete %i tags locally" ltags)
-       (setq ltags nil))
-     (unless (magit-confirm t "Delete %s from remote"
-               "Delete %i tags from remote" rtags)
-       (setq rtags nil))
-     (list ltags rtags remote)))
-  (when tags
-    (magit-call-git "tag" "-d" tags))
-  (when remote-tags
-    (magit-run-git-async "push" remote (--map (concat ":" it) remote-tags))))
-
-;;;; Dispatch Popup
-
-;;;###autoload (autoload 'magit-dispatch-popup "magit" nil t)
-(magit-define-popup magit-dispatch-popup
-  "Popup console for dispatching other popups."
-  :actions '("Popup and dwim commands"
-             (?A "Cherry-picking"  magit-cherry-pick-popup)
-             (?b "Branching"       magit-branch-popup)
-             (?B "Bisecting"       magit-bisect-popup)
-             (?c "Committing"      magit-commit-popup)
-             (?d "Diffing"         magit-diff-popup)
-             (?D "Change diffs"    magit-diff-refresh-popup)
-             (?e "Ediff dwimming"  magit-ediff-dwim)
-             (?E "Ediffing"        magit-ediff-popup)
-             (?f "Fetching"        magit-fetch-popup)
-             (?F "Pulling"         magit-pull-popup)
-             (?l "Logging"         magit-log-popup)
-             (?L "Change logs"     magit-log-refresh-popup)
-             (?m "Merging"         magit-merge-popup)
-             (?M "Remoting"        magit-remote-popup)
-             (?o "Submodules"      magit-submodule-popup)
-             (?O "Subtrees"        magit-subtree-popup)
-             (?P "Pushing"         magit-push-popup)
-             (?r "Rebasing"        magit-rebase-popup)
-             (?t "Tagging"         magit-tag-popup)
-             (?T "Notes"           magit-notes-popup)
-             (?V "Reverting"       magit-revert-popup)
-             (?w "Apply patches"   magit-am-popup)
-             (?W "Format patches"  magit-patch-popup)
-             (?X "Resetting"       magit-reset-popup)
-             (?y "Show Refs"       magit-show-refs-popup)
-             (?z "Stashing"        magit-stash-popup)
-             (?! "Running"         magit-run-popup)
-             "Applying changes"
-             (?a "Apply"           magit-apply)
-             (?s "Stage"           magit-stage)
-             (?u "Unstage"         magit-unstage)
-             (?v "Reverse"         magit-reverse)
-             (?S "Stage all"       magit-stage-modified)
-             (?U "Unstage all"     magit-unstage-all)
-             (?k "Discard"         magit-discard)
-             "Essential commands"
-             (?g  "    refresh current buffer"   magit-refresh)
-             ;; These bindings only work because of :setup-function.
-             (?\t   "  toggle section at point"  magit-section-toggle)
-             (?\r   "  visit thing at point"     magit-visit-thing)
-             ;; This binding has no effect and only appears to do
-             ;; so because it is identical to the global binding.
-             ("C-h m" "show all key bindings"    describe-mode))
-  :setup-function 'magit-dispatch-popup-setup
-  :max-action-columns (lambda (heading)
-                        (pcase heading
-                          ("Popup and dwim commands" 4)
-                          ("Applying changes" 3)
-                          ("Essential commands" 1))))
-
-(defvar magit-dispatch-popup-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-popup-mode-map)
-    (cond ((featurep 'jkl)
-           (define-key map [tab]    'magit-invoke-popup-action)
-           (define-key map [return] 'magit-invoke-popup-action))
-          (t
-           (define-key map (kbd "C-i") 'magit-invoke-popup-action)
-           (define-key map (kbd "C-m") 'magit-invoke-popup-action)))
-    map)
-  "Keymap used by `magit-dispatch-popup'.")
-
-(defun magit-dispatch-popup-setup (val def)
-  (magit-popup-default-setup val def)
-  (use-local-map magit-dispatch-popup-map)
-  ;; This is necessary for users (i.e. me) who have broken the
-  ;; connection between C-i (aka TAB) and tab, and C-m (aka RET)
-  ;; and return.
-  (magit-popup-put
-   :actions (nconc (magit-popup-get :actions)
-                   (list (make-magit-popup-event :key 'tab
-                                                 :fun 'magit-section-toggle)
-                         (make-magit-popup-event :key 'return
-                                                 :fun 'magit-visit-thing)))))
-
-;;;; Git Popup
-
-(defcustom magit-shell-command-verbose-prompt t
-  "Whether to show the working directory when reading a command.
-This affects `magit-git-command', `magit-git-command-topdir',
-`magit-shell-command', and `magit-shell-command-topdir'."
-  :package-version '(magit . "2.11.0")
-  :group 'magit-commands
-  :type 'boolean)
-
-(defvar magit-git-command-history nil)
-
-;;;###autoload (autoload 'magit-run-popup "magit" nil t)
-(magit-define-popup magit-run-popup
-  "Popup console for running raw Git commands."
-  :actions '((?! "Git Subcommand (in topdir)" magit-git-command-topdir)
-             (?k "Gitk"                       magit-run-gitk)
-             (?p "Git Subcommand (in pwd)"    magit-git-command)
-             (?a "Gitk --all"                 magit-run-gitk-all)
-             (?s "Shell command (in topdir)"  magit-shell-command-topdir)
-             (?b "Gitk --branches"            magit-run-gitk-branches)
-             (?S "Shell command (in pwd)"     magit-shell-command)
-             (?g "Git Gui"                    magit-run-git-gui))
-  :default-action 'magit-git-command
-  :max-action-columns 2)
-
-;;;###autoload
-(defun magit-git-command (command)
-  "Execute COMMAND asynchonously; display output.
-
-Interactively, prompt for COMMAND in the minibuffer. \"git \" is
-used as initial input, but can be deleted to run another command.
-
-With a prefix argument COMMAND is run in the top-level directory
-of the current working tree, otherwise in `default-directory'."
-  (interactive (list (magit-read-shell-command nil "git ")))
-  (magit--shell-command command))
-
-;;;###autoload
-(defun magit-git-command-topdir (command)
-  "Execute COMMAND asynchonously; display output.
-
-Interactively, prompt for COMMAND in the minibuffer. \"git \" is
-used as initial input, but can be deleted to run another command.
-
-COMMAND is run in the top-level directory of the current
-working tree."
-  (interactive (list (magit-read-shell-command t "git ")))
-  (magit--shell-command command (magit-toplevel)))
-
-;;;###autoload
-(defun magit-shell-command (command)
-  "Execute COMMAND asynchonously; display output.
-
-Interactively, prompt for COMMAND in the minibuffer.  With a
-prefix argument COMMAND is run in the top-level directory of
-the current working tree, otherwise in `default-directory'."
-  (interactive (list (magit-read-shell-command)))
-  (magit--shell-command command))
-
-;;;###autoload
-(defun magit-shell-command-topdir (command)
-  "Execute COMMAND asynchonously; display output.
-
-Interactively, prompt for COMMAND in the minibuffer.  COMMAND
-is run in the top-level directory of the current working tree."
-  (interactive (list (magit-read-shell-command t)))
-  (magit--shell-command command (magit-toplevel)))
-
-(defun magit--shell-command (command &optional directory)
-  (let ((default-directory (or directory default-directory))
-        (process-environment process-environment))
-    (push "GIT_PAGER=cat" process-environment)
-    (magit-start-process shell-file-name nil
-                         shell-command-switch command))
-  (magit-process-buffer))
-
-(defun magit-read-shell-command (&optional toplevel initial-input)
-  (let ((dir (abbreviate-file-name
-              (if (or toplevel current-prefix-arg)
-                  (or (magit-toplevel)
-                      (user-error "Not inside a Git repository"))
-                default-directory))))
-    (read-shell-command (if magit-shell-command-verbose-prompt
-                            (format "Async shell command in %s: " dir)
-                          "Async shell command: ")
-                        initial-input 'magit-git-command-history)))
-
-;;; Revision Stack
-
-(defvar magit-revision-stack nil)
-
-(defcustom magit-pop-revision-stack-format
-  '("[%N: %h] " "%N: %H\n   %s\n" "\\[\\([0-9]+\\)[]:]")
-  "Control how `magit-pop-revision-stack' inserts a revision.
-
-The command `magit-pop-revision-stack' inserts a representation
-of the revision last pushed to the `magit-revision-stack' into
-the current buffer.  It inserts text at point and/or near the end
-of the buffer, and removes the consumed revision from the stack.
-
-The entries on the stack have the format (HASH TOPLEVEL) and this
-option has the format (POINT-FORMAT EOB-FORMAT INDEX-REGEXP), all
-of which may be nil or a string (though either one of EOB-FORMAT
-or POINT-FORMAT should be a string, and if INDEX-REGEXP is
-non-nil, then the two formats should be too).
-
-First INDEX-REGEXP is used to find the previously inserted entry,
-by searching backward from point.  The first submatch must match
-the index number.  That number is incremented by one, and becomes
-the index number of the entry to be inserted.  If you don't want
-to number the inserted revisions, then use nil for INDEX-REGEXP.
-
-If INDEX-REGEXP is non-nil, then both POINT-FORMAT and EOB-FORMAT
-should contain \"%N\", which is replaced with the number that was
-determined in the previous step.
-
-Both formats, if non-nil and after removing %N, are then expanded
-using `git show --format=FORMAT ...' inside TOPLEVEL.
-
-The expansion of POINT-FORMAT is inserted at point, and the
-expansion of EOB-FORMAT is inserted at the end of the buffer (if
-the buffer ends with a comment, then it is inserted right before
-that)."
-  :package-version '(magit . "2.3.0")
-  :group 'magit-commands
-  :type '(list (choice (string :tag "Insert at point format")
-                       (cons (string :tag "Insert at point format")
-                             (repeat (string :tag "Argument to git show")))
-                       (const :tag "Don't insert at point" nil))
-               (choice (string :tag "Insert at eob format")
-                       (cons (string :tag "Insert at eob format")
-                             (repeat (string :tag "Argument to git show")))
-                       (const :tag "Don't insert at eob" nil))
-               (choice (regexp :tag "Find index regexp")
-                       (const :tag "Don't number entries" nil))))
-
-(defun magit-pop-revision-stack (rev toplevel)
-  "Insert a representation of a revision into the current buffer.
-
-Pop a revision from the `magit-revision-stack' and insert it into
-the current buffer according to `magit-pop-revision-stack-format'.
-Revisions can be put on the stack using `magit-copy-section-value'
-and `magit-copy-buffer-revision'.
-
-If the stack is empty or with a prefix argument, instead read a
-revision in the minibuffer.  By using the minibuffer history this
-allows selecting an item which was popped earlier or to insert an
-arbitrary reference or revision without first pushing it onto the
-stack.
-
-When reading the revision from the minibuffer, then it might not
-be possible to guess the correct repository.  When this command
-is called inside a repository (e.g. while composing a commit
-message), then that repository is used.  Otherwise (e.g. while
-composing an email) then the repository recorded for the top
-element of the stack is used (even though we insert another
-revision).  If not called inside a repository and with an empty
-stack, or with two prefix arguments, then read the repository in
-the minibuffer too."
-  (interactive
-   (if (or current-prefix-arg (not magit-revision-stack))
-       (let ((default-directory
-               (or (and (not (= (prefix-numeric-value current-prefix-arg) 16))
-                        (or (magit-toplevel)
-                            (cadr (car magit-revision-stack))))
-                   (magit-read-repository))))
-         (list (magit-read-branch-or-commit "Insert revision")
-               default-directory))
-     (push (caar magit-revision-stack) magit-revision-history)
-     (pop magit-revision-stack)))
-  (if rev
-      (-let [(pnt-format eob-format idx-format) magit-pop-revision-stack-format]
-        (let ((default-directory toplevel)
-              (idx (and idx-format
-                        (save-excursion
-                          (if (re-search-backward idx-format nil t)
-                              (number-to-string
-                               (1+ (string-to-number (match-string 1))))
-                            "1"))))
-              pnt-args eob-args)
-          (when (listp pnt-format)
-            (setq pnt-args (cdr pnt-format))
-            (setq pnt-format (car pnt-format)))
-          (when (listp eob-format)
-            (setq eob-args (cdr eob-format))
-            (setq eob-format (car eob-format)))
-          (when pnt-format
-            (when idx-format
-              (setq pnt-format
-                    (replace-regexp-in-string "%N" idx pnt-format t t)))
-            (magit-rev-insert-format pnt-format rev pnt-args)
-            (backward-delete-char 1))
-          (when eob-format
-            (when idx-format
-              (setq eob-format
-                    (replace-regexp-in-string "%N" idx eob-format t t)))
-            (save-excursion
-              (goto-char (point-max))
-              (skip-syntax-backward ">s-")
-              (beginning-of-line)
-              (if (and comment-start (looking-at comment-start))
-                  (while (looking-at comment-start)
-                    (forward-line -1))
-                (forward-line)
-                (unless (= (current-column) 0)
-                  (insert ?\n)))
-              (insert ?\n)
-              (magit-rev-insert-format eob-format rev eob-args)
-              (backward-delete-char 1)))))
-    (user-error "Revision stack is empty")))
-
-(define-key git-commit-mode-map
-  (kbd "C-c C-w") 'magit-pop-revision-stack)
-
-(defun magit-copy-section-value ()
-  "Save the value of the current section for later use.
-
-Save the section value to the `kill-ring', and, provided that
-the current section is a commit, branch, or tag section, push
-the (referenced) revision to the `magit-revision-stack' for use
-with `magit-pop-revision-stack'.
-
-When the current section is a branch or a tag, and a prefix
-argument is used, then save the revision at its tip to the
-`kill-ring' instead of the reference name.
-
-When the region is active, then save that to the `kill-ring',
-like `kill-ring-save' would, instead of behaving as described
-above."
-  (interactive)
-  (if (use-region-p)
-      (copy-region-as-kill nil nil 'region)
-    (-when-let* ((section (magit-current-section))
-                 (value (magit-section-value section)))
-      (magit-section-case
-        ((branch commit module-commit tag)
-         (let ((default-directory default-directory) ref)
-           (magit-section-case
-             ((branch tag)
-              (setq ref value))
-             (module-commit
-              (setq default-directory
-                    (file-name-as-directory
-                     (expand-file-name (magit-section-parent-value section)
-                                       (magit-toplevel))))))
-           (setq value (magit-rev-parse value))
-           (push (list value default-directory) magit-revision-stack)
-           (kill-new (message "%s" (or (and current-prefix-arg ref)
-                                       value)))))
-        (t (kill-new (message "%s" value)))))))
-
-(defun magit-copy-buffer-revision ()
-  "Save the revision of the current buffer for later use.
-
-Save the revision shown in the current buffer to the `kill-ring'
-and push it to the `magit-revision-stack'.
-
-This command is mainly intended for use in `magit-revision-mode'
-buffers, the only buffers where it is always unambiguous exactly
-which revision should be saved.
-
-Most other Magit buffers usually show more than one revision, in
-some way or another, so this command has to select one of them,
-and that choice might not always be the one you think would have
-been the best pick.
-
-In such buffers it is often more useful to save the value of
-the current section instead, using `magit-copy-section-value'.
-
-When the region is active, then save that to the `kill-ring',
-like `kill-ring-save' would, instead of behaving as described
-above."
-  (interactive)
-  (if (use-region-p)
-      (copy-region-as-kill nil nil 'region)
-    (-when-let (rev (cond ((memq major-mode '(magit-cherry-mode
-                                              magit-log-select-mode
-                                              magit-reflog-mode
-                                              magit-refs-mode
-                                              magit-revision-mode
-                                              magit-stash-mode
-                                              magit-stashes-mode))
-                           (car magit-refresh-args))
-                          ((memq major-mode '(magit-diff-mode
-                                              magit-log-mode))
-                           (let ((r (caar magit-refresh-args)))
-                             (if (string-match "\\.\\.\\.?\\(.+\\)" r)
-                                 (match-string 1 r)
-                               r)))
-                          ((eq major-mode 'magit-status-mode) "HEAD")))
-      (when (magit-rev-verify-commit rev)
-        (setq rev (magit-rev-parse rev))
-        (push (list rev default-directory) magit-revision-stack)
-        (kill-new (message "%s" rev))))))
-
-;;; (Keywords)
-
-(defconst magit-font-lock-keywords
-  (eval-when-compile
-    `((,(concat "(\\(magit-define-section-jumper\\)\\_>"
-                "[ \t'\(]*"
-                "\\(\\(?:\\sw\\|\\s_\\)+\\)?")
-       (1 'font-lock-keyword-face)
-       (2 'font-lock-function-name-face nil t))
-      (,(concat "(" (regexp-opt '("magit-insert-section"
-                                  "magit-section-case"
-                                  "magit-section-when"
-                                  "magit-bind-match-strings"
-                                  "magit-with-temp-index"
-                                  "magit-with-blob"
-                                  "magit-with-toplevel") t)
-                "\\_>")
-       . 1))))
-
-(font-lock-add-keywords 'emacs-lisp-mode magit-font-lock-keywords)
-
-;;; (Versions)
-
-(defvar magit-version 'undefined
-  "The version of Magit that you're using.
-Use the function by the same name instead of this variable.")
-
-;;;###autoload
-(defun magit-version (&optional print-dest)
-  "Return the version of Magit currently in use.
-If optional argument PRINT-DEST is non-nil, output
-stream (interactively, the echo area, or the current buffer with
-a prefix argument), also print the used versions of Magit, Git,
-and Emacs to it."
-  (interactive (list (if current-prefix-arg (current-buffer) t)))
-  (let ((magit-git-global-arguments nil)
-        (toplib (or load-file-name buffer-file-name))
-        debug)
-    (unless (and toplib
-                 (equal (file-name-nondirectory toplib) "magit.el"))
-      (setq toplib (locate-library "magit.el")))
-    (setq toplib (and toplib (file-chase-links toplib)))
-    (push toplib debug)
-    (when toplib
-      (let* ((topdir (file-name-directory toplib))
-             (gitdir (expand-file-name
-                      ".git" (file-name-directory
-                              (directory-file-name topdir))))
-             (static (locate-library "magit-version.el" nil (list topdir)))
-             (static (and static (file-chase-links static))))
-        (or (progn
-              (push 'repo debug)
-              (when (and (file-exists-p gitdir)
-                         ;; It is a repo, but is it the Magit repo?
-                         (file-exists-p
-                          (expand-file-name "../lisp/magit.el" gitdir)))
-                (push t debug)
-                ;; Inside the repo the version file should only exist
-                ;; while running make.
-                (when (and static (not noninteractive))
-                  (ignore-errors (delete-file static)))
-                (setq magit-version
-                      (let ((default-directory topdir))
-                        (magit-git-string "describe" "--tags" "--dirty")))))
-            (progn
-              (push 'static debug)
-              (when (and static (file-exists-p static))
-                (push t debug)
-                (load-file static)
-                magit-version))
-            (when (featurep 'package)
-              (push 'elpa debug)
-              (ignore-errors
-                (--when-let (assq 'magit package-alist)
-                  (push t debug)
-                  (setq magit-version
-                        (and (fboundp 'package-desc-version)
-                             (package-version-join
-                              (package-desc-version (cadr it))))))))
-            (progn
-              (push 'debug debug)
-              (let ((dirname (file-name-nondirectory
-                              (directory-file-name topdir))))
-                (when (string-match "\\`magit-\\([0-9]\\{8\\}\\.[0-9]*\\)"
-                                    dirname)
-                  (setq magit-version (match-string 1 dirname))))))))
-    (if (stringp magit-version)
-        (when print-dest
-          (princ (format "Magit %s, Git %s, Emacs %s, %s"
-                         (or magit-version "(unknown)")
-                         (or (let ((magit-git-debug
-                                    (lambda (err)
-                                      (display-warning '(magit git)
-                                                       err :error))))
-                               (magit-git-version t))
-                             "(unknown)")
-                         emacs-version
-                         system-type)
-                 print-dest))
-      (setq debug (reverse debug))
-      (setq magit-version 'error)
-      (when magit-version
-        (push magit-version debug))
-      (unless (equal (getenv "TRAVIS") "true")
-        ;; The repository is a sparse clone.
-        (message "Cannot determine Magit's version %S" debug)))
-    magit-version))
-
-(defun magit-debug-git-executable ()
-  "Display a buffer with information about `magit-git-executable'.
-See info node `(magit)Debugging Tools' for more information."
-  (interactive)
-  (with-current-buffer (get-buffer-create "*magit-git-debug*")
-    (pop-to-buffer (current-buffer))
-    (erase-buffer)
-    (insert (format "magit-git-executable: %S" magit-git-executable)
-            (unless (file-name-absolute-p magit-git-executable)
-              (format " [%S]" (executable-find magit-git-executable)))
-            (format " (%s)\n"
-                    (let* ((errmsg nil)
-                           (magit-git-debug (lambda (err) (setq errmsg err))))
-                      (or (magit-git-version t) errmsg))))
-    (insert (format "exec-path: %S\n" exec-path))
-    (--when-let (cl-set-difference
-                 (-filter #'file-exists-p (remq nil (parse-colon-path
-                                                     (getenv "PATH"))))
-                 (-filter #'file-exists-p (remq nil exec-path))
-                 :test #'file-equal-p)
-      (insert (format "  entries in PATH, but not in exec-path: %S\n" it)))
-    (dolist (execdir exec-path)
-      (insert (format "  %s (%s)\n" execdir (car (file-attributes execdir))))
-      (when (file-directory-p execdir)
-        (dolist (exec (directory-files
-                       execdir t (concat
-                                  "\\`git" (regexp-opt exec-suffixes) "\\'")))
-          (insert (format "    %s (%s)\n" exec
-                          (let* ((magit-git-executable exec)
-                                 (errmsg nil)
-                                 (magit-git-debug (lambda (err) (setq errmsg err))))
-                            (or (magit-git-version t) errmsg)))))))))
-
-;;; (Asserts)
-
-(defun magit-startup-asserts ()
-  (let ((version (magit-git-version)))
-    (when (and version
-               (version< version magit--minimal-git)
-               (not (equal (getenv "TRAVIS") "true")))
-      (display-warning 'magit (format "\
-Magit requires Git >= %s, you are using %s.
-
-If this comes as a surprise to you, because you do actually have
-a newer version installed, then that probably means that the
-older version happens to appear earlier on the `$PATH'.  If you
-always start Emacs from a shell, then that can be fixed in the
-shell's init file.  If you start Emacs by clicking on an icon,
-or using some sort of application launcher, then you probably
-have to adjust the environment as seen by graphical interface.
-For X11 something like ~/.xinitrc should work.
-
-If you use Tramp to work inside remote Git repositories, then you
-have to make sure a suitable Git is used on the remote machines
-too.\n" magit--minimal-git version) :error)))
-  (when (version< emacs-version magit--minimal-emacs)
-    (display-warning 'magit (format "\
-Magit requires Emacs >= %s, you are using %s.
-
-If this comes as a surprise to you, because you do actually have
-a newer version installed, then that probably means that the
-older version happens to appear earlier on the `$PATH'.  If you
-always start Emacs from a shell, then that can be fixed in the
-shell's init file.  If you start Emacs by clicking on an icon,
-or using some sort of application launcher, then you probably
-have to adjust the environment as seen by graphical interface.
-For X11 something like ~/.xinitrc should work.\n"
-                                    magit--minimal-emacs emacs-version)
-                     :error))
-  (--each '((magit-log-edit  . git-commit)
-            (git-commit-mode . git-commit)
-            (git-rebase-mode . git-rebase))
-    (when (or (featurep (car it)) (locate-library (symbol-name (car it))))
-      (display-warning 'magit (format "%s has to be removed
-
-Magit is no longer compatible with the library `%s',
-which was used in earlier releases.  Please remove it, so that
-Magit can use the successor `%s' without the obsolete
-library getting in the way.  Then restart Emacs.\n"
-                                      (car it)  (car it) (cdr it)) :error))))
-
-;;; (Features)
-
-(provide 'magit)
-
-(cl-eval-when (load eval)
-  (require 'magit-status)
-  (require 'magit-refs)
-  (require 'magit-files)
-  (require 'magit-branch)
-  (require 'magit-worktree)
-  (require 'magit-notes)
-  (require 'magit-sequence)
-  (require 'magit-commit)
-  (require 'magit-remote)
-  (require 'magit-bisect)
-  (require 'magit-stash)
-  (require 'magit-blame)
-  (require 'magit-obsolete)
-  (unless (load "magit-autoloads" t t)
-    (require 'magit-submodule)
-    (require 'magit-subtree)
-    (require 'magit-ediff)
-    (require 'magit-extras)
-    (require 'git-rebase)
-    (require 'magit-imenu)
-    (require 'magit-bookmark)))
-
-(eval-after-load 'bookmark
-  '(require 'magit-bookmark))
-
-(if after-init-time
-    (progn (magit-startup-asserts)
-           (magit-version))
-  (add-hook 'after-init-hook #'magit-startup-asserts t)
-  (add-hook 'after-init-hook #'magit-version t))
-
-;;; magit.el ends here
.emacs.d/elpa/magit-20170913.1424/magit.elc
Binary file
.emacs.d/elpa/magit-20170913.1424/magit.info
@@ -1,171 +0,0 @@
-This is magit.info, produced by makeinfo version 5.2 from magit.texi.
-
-     Copyright (C) 2015-2017 Jonas Bernoulli <jonas@bernoul.li>
-
-     You can redistribute this document 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 document 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.
-INFO-DIR-SECTION Emacs
-START-INFO-DIR-ENTRY
-* Magit: (magit).       Using Git from Emacs with Magit.
-END-INFO-DIR-ENTRY
-
-
-Indirect:
-magit.info-1: 752
-magit.info-2: 329267
-
-Tag Table:
-(Indirect)
-Node: Top752
-Node: Introduction5655
-Node: Installation10378
-Node: Installing from an Elpa Archive10718
-Node: Installing from the Git Repository11821
-Node: Post-Installation Tasks14464
-Node: Getting Started15749
-Node: Interface Concepts21096
-Node: Modes and Buffers21370
-Node: Switching Buffers23115
-Node: Naming Buffers27656
-Node: Quitting Windows30491
-Node: Automatic Refreshing of Magit Buffers32123
-Node: Automatic Saving of File-Visiting Buffers34891
-Node: Automatic Reverting of File-Visiting Buffers36076
-Node: Risk of Reverting Automatically41072
-Node: Sections43455
-Node: Section Movement44396
-Node: Section Visibility48323
-Node: Section Hooks51798
-Node: Section Types and Values54079
-Node: Section Options55349
-Node: Popup Buffers and Prefix Commands55821
-Node: Completion and Confirmation58188
-Node: Running Git61472
-Node: Viewing Git Output61708
-Node: Running Git Manually62708
-Node: Git Executable65110
-Node: Global Git Arguments67392
-Node: Inspecting68198
-Node: Status Buffer69345
-Node: Status Sections72258
-Node: Status Header Sections76773
-Node: Status Module Sections79333
-Node: Status Options81776
-Node: Repository List83530
-Node: Logging85688
-Node: Refreshing Logs88135
-Node: Log Buffer89520
-Node: Log Margin92355
-Node: Select from Log94995
-Node: Reflog97099
-Node: Cherries98616
-Node: Diffing100343
-Node: Refreshing Diffs103290
-Node: Diff Buffer106781
-Node: Diff Options109366
-Node: Revision Buffer112736
-Node: Ediffing114453
-Node: References Buffer118049
-Node: References Sections125348
-Node: Bisecting126209
-Node: Visiting Blobs127947
-Node: Blaming128456
-Node: Manipulating131885
-Node: Repository Setup132201
-Node: Staging and Unstaging133241
-Node: Staging from File-Visiting Buffers137322
-Node: Applying138490
-Node: Committing140383
-Node: Initiating a Commit140966
-Node: Editing Commit Messages144277
-Node: Branching154673
-Node: The Two Remotes154873
-Node: The Branch Popup157490
-Node: The Branch Config Popup166791
-Node: Merging172687
-Node: Resolving Conflicts174854
-Node: Rebasing179856
-Node: Editing Rebase Sequences183460
-Node: Information About In-Progress Rebase186490
-Ref: Information About In-Progress Rebase-Footnote-1193297
-Node: Cherry Picking193883
-Node: Reverting195488
-Node: Resetting196851
-Node: Stashing198268
-Node: Transferring202462
-Node: Remotes202700
-Node: Fetching203978
-Node: Pulling205334
-Node: Pushing206170
-Node: Creating and Sending Patches210904
-Node: Applying Patches211599
-Node: Miscellaneous212596
-Node: Tagging212899
-Node: Notes213683
-Node: Submodules216207
-Node: Listing Submodules216421
-Node: Submodule Popup218241
-Node: Subtree219524
-Node: Common Commands220771
-Node: Wip Modes222516
-Node: Minor Mode for Buffers Visiting Files229312
-Node: Minor Mode for Buffers Visiting Blobs232661
-Node: Customizing233474
-Node: Per-Repository Configuration235146
-Node: Essential Settings236793
-Node: Safety237117
-Node: Performance238882
-Node: Microsoft Windows Performance245742
-Node: MacOS Performance246935
-Ref: MacOS Performance-Footnote-1248171
-Ref: MacOS Performance-Footnote-2248253
-Ref: MacOS Performance-Footnote-3248313
-Node: Plumbing248479
-Node: Calling Git249303
-Node: Getting a Value from Git250826
-Node: Calling Git for Effect253930
-Node: Section Plumbing260448
-Node: Creating Sections260676
-Node: Section Selection264575
-Node: Matching Sections266255
-Node: Refreshing Buffers271687
-Node: Conventions274822
-Node: Confirmation and Completion274999
-Node: Theming Faces275897
-Node: FAQ284048
-Node: FAQ - How to …?284490
-Node: How to show git's output?284854
-Node: How to install the gitman info manual?285608
-Node: How to show diffs for gpg-encrypted files?286578
-Node: How does branching and pushing work?287174
-Node: Can Magit be used as ‘ediff-version-control-package’?287543
-Node: FAQ - Issues and Errors289539
-Node: Magit is slow290283
-Node: I changed several thousand files at once and now Magit is unusable290497
-Node: I am having problems committing291226
-Node: I am using MS Windows and cannot push with Magit291707
-Node: I am using OS X and SOMETHING works in shell but not in Magit292324
-Node: Diffs contain control sequences293130
-Node: Expanding a file to show the diff causes it to disappear294204
-Node: Point is wrong in the ‘COMMIT_EDITMSG’ buffer294761
-Node: The mode-line information isn't always up-to-date295813
-Node: Emacs 245 hangs when loading Magit296880
-Node: Debugging Tools297430
-Node: Keystroke Index299165
-Node: Command Index329267
-Node: Function Index359933
-Node: Variable Index373536
-
-End Tag Table
-
-
-Local Variables:
-coding: utf-8
-End:
.emacs.d/elpa/magit-20170913.1424/magit.info-1
@@ -1,8198 +0,0 @@
-This is magit.info, produced by makeinfo version 5.2 from magit.texi.
-
-     Copyright (C) 2015-2017 Jonas Bernoulli <jonas@bernoul.li>
-
-     You can redistribute this document 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 document 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.
-INFO-DIR-SECTION Emacs
-START-INFO-DIR-ENTRY
-* Magit: (magit).       Using Git from Emacs with Magit.
-END-INFO-DIR-ENTRY
-
-
-File: magit.info,  Node: Top,  Next: Introduction,  Up: (dir)
-
-Magit User Manual
-*****************
-
-Magit is an interface to the version control system Git, implemented as
-an Emacs package.  Magit aspires to be a complete Git porcelain.  While
-we cannot (yet) claim that Magit wraps and improves upon each and every
-Git command, it is complete enough to allow even experienced Git users
-to perform almost all of their daily version control tasks directly from
-within Emacs.  While many fine Git clients exist, only Magit and Git
-itself deserve to be called porcelains.
-
-     Copyright (C) 2015-2017 Jonas Bernoulli <jonas@bernoul.li>
-
-     You can redistribute this document 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 document 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.
-
-* Menu:
-
-* Introduction::
-* Installation::
-* Getting Started::
-* Interface Concepts::
-* Inspecting::
-* Manipulating::
-* Transferring::
-* Miscellaneous::
-* Customizing::
-* Plumbing::
-* FAQ::
-* Debugging Tools::
-* Keystroke Index::
-* Command Index::
-* Function Index::
-* Variable Index::
-
-— The Detailed Node Listing —
-
-
-Installation
-
-* Installing from an Elpa Archive::
-* Installing from the Git Repository::
-* Post-Installation Tasks::
-
-
-
-
-Interface Concepts
-
-* Modes and Buffers::
-* Sections::
-* Popup Buffers and Prefix Commands::
-* Completion and Confirmation::
-* Running Git::
-
-Modes and Buffers
-
-* Switching Buffers::
-* Naming Buffers::
-* Quitting Windows::
-* Automatic Refreshing of Magit Buffers::
-* Automatic Saving of File-Visiting Buffers::
-* Automatic Reverting of File-Visiting Buffers::
-
-
-Sections
-
-* Section Movement::
-* Section Visibility::
-* Section Hooks::
-* Section Types and Values::
-* Section Options::
-
-
-
-
-Running Git
-
-* Viewing Git Output::
-* Running Git Manually::
-* Git Executable::
-* Global Git Arguments::
-
-Inspecting
-
-* Status Buffer::
-* Repository List::
-* Logging::
-* Diffing::
-* Ediffing::
-* References Buffer::
-* Bisecting::
-* Visiting Blobs::
-* Blaming::
-
-Status Buffer
-
-* Status Sections::
-* Status Header Sections::
-* Status Module Sections::
-* Status Options::
-
-
-
-Logging
-
-* Refreshing Logs::
-* Log Buffer::
-* Log Margin::
-* Select from Log::
-* Reflog::
-* Cherries::
-
-
-Diffing
-
-* Refreshing Diffs::
-* Diff Buffer::
-* Diff Options::
-* Revision Buffer::
-
-
-
-References Buffer
-
-* References Sections::
-
-Manipulating
-
-* Repository Setup::
-* Staging and Unstaging::
-* Applying::
-* Committing::
-* Branching::
-* Merging::
-* Resolving Conflicts::
-* Rebasing::
-* Cherry Picking::
-* Resetting::
-* Stashing::
-
-
-Staging and Unstaging
-
-* Staging from File-Visiting Buffers::
-
-
-
-Committing
-
-* Initiating a Commit::
-* Editing Commit Messages::
-
-
-Branching
-
-* The Two Remotes::
-* The Branch Popup::
-* The Branch Config Popup::
-
-
-
-
-Rebasing
-
-* Editing Rebase Sequences::
-* Information About In-Progress Rebase::
-
-
-Cherry Picking
-
-* Reverting::
-
-Transferring
-
-* Remotes::
-* Fetching::
-* Pulling::
-* Pushing::
-* Creating and Sending Patches::
-* Applying Patches::
-
-
-
-Miscellaneous
-
-* Tagging::
-* Notes::
-* Submodules::
-* Subtree::
-* Common Commands::
-* Wip Modes::
-* Minor Mode for Buffers Visiting Files::
-* Minor Mode for Buffers Visiting Blobs::
-
-
-
-Submodules
-
-* Listing Submodules::
-* Submodule Popup::
-
-Customizing
-
-* Per-Repository Configuration::
-* Essential Settings::
-
-
-Essential Settings
-
-* Safety::
-* Performance::
-
-Plumbing
-
-* Calling Git::
-* Section Plumbing::
-* Refreshing Buffers::
-* Conventions::
-
-Calling Git
-
-* Getting a Value from Git::
-* Calling Git for Effect::
-
-
-Section Plumbing
-
-* Creating Sections::
-* Section Selection::
-* Matching Sections::
-
-
-
-Conventions
-
-* Confirmation and Completion::
-* Theming Faces::
-
-FAQ
-
-* FAQ - How to …?::
-* FAQ - Issues and Errors::
-
-FAQ - How to …?
-
-* How to show git's output?::
-* How to install the gitman info manual?::
-* How to show diffs for gpg-encrypted files?::
-* How does branching and pushing work?::
-* Can Magit be used as ‘ediff-version-control-package’?::
-
-
-FAQ - Issues and Errors
-
-* Magit is slow::
-* I changed several thousand files at once and now Magit is unusable::
-* I am having problems committing::
-* I am using MS Windows and cannot push with Magit::
-* I am using OS X and SOMETHING works in shell, but not in Magit: I am using OS X and SOMETHING works in shell but not in Magit. 
-* Diffs contain control sequences::
-* Expanding a file to show the diff causes it to disappear::
-* Point is wrong in the ‘COMMIT_EDITMSG’ buffer::
-* The mode-line information isn't always up-to-date::
-* Emacs 24.5 hangs when loading Magit: Emacs 245 hangs when loading Magit. 
-
-
-File: magit.info,  Node: Introduction,  Next: Installation,  Prev: Top,  Up: Top
-
-1 Introduction
-**************
-
-Magit is an interface to the version control system Git, implemented as
-an Emacs package.  Magit aspires to be a complete Git porcelain.  While
-we cannot (yet) claim that Magit wraps and improves upon each and every
-Git command, it is complete enough to allow even experienced Git users
-to perform almost all of their daily version control tasks directly from
-within Emacs.  While many fine Git clients exist, only Magit and Git
-itself deserve to be called porcelains.
-
-   Staging and otherwise applying changes is one of the most important
-features in a Git porcelain and here Magit outshines anything else,
-including Git itself.  Git’s own staging interface (‘git add --patch’)
-is so cumbersome that many users only use it in exceptional cases.  In
-Magit staging a hunk or even just part of a hunk is as trivial as
-staging all changes made to a file.
-
-   The most visible part of Magit’s interface is the status buffer,
-which displays information about the current repository.  Its content is
-created by running several Git commands and making their output
-actionable.  Among other things, it displays information about the
-current branch, lists unpulled and unpushed changes and contains
-sections displaying the staged and unstaged changes.  That might sound
-noisy, but, since sections are collapsible, it’s not.
-
-   To stage or unstage a change one places the cursor on the change and
-then types ‘s’ or ‘u’.  The change can be a file or a hunk, or when the
-region is active (i.e.  when there is a selection) several files or
-hunks, or even just part of a hunk.  The change or changes that these
-commands - and many others - would act on are highlighted.
-
-   Magit also implements several other "apply variants" in addition to
-staging and unstaging.  One can discard or reverse a change, or apply it
-to the working tree.  Git’s own porcelain only supports this for staging
-and unstaging and you would have to do something like ‘git diff ... |
-??? | git apply ...’ to discard, revert, or apply a single hunk on the
-command line.  In fact that’s exactly what Magit does internally (which
-is what lead to the term "apply variants").
-
-   Magit isn’t just for Git experts, but it does assume some prior
-experience with Git as well as Emacs.  That being said, many users have
-reported that using Magit was what finally taught them what Git is
-capable of and how to use it to its fullest.  Other users wished they
-had switched to Emacs sooner so that they would have gotten their hands
-on Magit earlier.
-
-   While one has to know the basic features of Emacs to be able to make
-full use of Magit, acquiring just enough Emacs skills doesn’t take long
-and is worth it, even for users who prefer other editors.  Vim users are
-advised to give Evil (https://bitbucket.org/lyro/evil/wiki/Home), the
-"Extensible VI Layer for Emacs", and Spacemacs
-(https://github.com/syl20bnr/spacemacs), an "Emacs starter-kit focused
-on Evil" a try.
-
-   Magit provides a consistent and efficient Git porcelain.  After a
-short learning period, you will be able to perform most of your daily
-version control tasks faster than you would on the command line.  You
-will likely also start using features that seemed too daunting in the
-past.
-
-   Magit fully embraces Git.  It exposes many advanced features using a
-simple but flexible interface instead of only wrapping the trivial ones
-like many GUI clients do.  Of course Magit supports logging, cloning,
-pushing, and other commands that usually don’t fail in spectacular ways;
-but it also supports tasks that often cannot be completed in a single
-step.  Magit fully supports tasks such as merging, rebasing,
-cherry-picking, reverting, and blaming by not only providing a command
-to initiate these tasks but also by displaying context sensitive
-information along the way and providing commands that are useful for
-resolving conflicts and resuming the sequence after doing so.
-
-   Magit wraps and in many cases improves upon at least the following
-Git porcelain commands: ‘add’, ‘am’, ‘bisect’, ‘blame’, ‘branch’,
-‘checkout’, ‘cherry’, ‘cherry-pick’, ‘clean’, ‘clone’, ‘commit’,
-‘config’, ‘describe’, ‘diff’, ‘fetch’, ‘format-patch’, ‘init’, ‘log’,
-‘merge’, ‘merge-tree’, ‘mv’, ‘notes’, ‘pull’, ‘rebase’, ‘reflog’,
-‘remote’, ‘request-pull’, ‘reset’, ‘revert’, ‘rm’, ‘show’, ‘stash’,
-‘submodule’, ‘subtree’, ‘tag’, and ‘worktree.’ Many more Magit porcelain
-commands are implemented on top of Git plumbing commands.
-
-
-File: magit.info,  Node: Installation,  Next: Getting Started,  Prev: Introduction,  Up: Top
-
-2 Installation
-**************
-
-Magit can be installed using Emacs’ package manager or manually from its
-development repository.
-
-* Menu:
-
-* Installing from an Elpa Archive::
-* Installing from the Git Repository::
-* Post-Installation Tasks::
-
-
-File: magit.info,  Node: Installing from an Elpa Archive,  Next: Installing from the Git Repository,  Up: Installation
-
-2.1 Installing from an Elpa Archive
-===================================
-
-Magit is available from Melpa and Melpa-Stable.  If you haven’t used
-Emacs’ package manager before, then it is high time you familiarize
-yourself with it by reading the documentation in the Emacs manual, see
-*note (emacs)Packages::.  Then add one of the archives to
-‘package-archives’:
-
-   • To use Melpa:
-
-     (require 'package)
-     (add-to-list 'package-archives
-                  '("melpa" . "http://melpa.org/packages/") t)
-
-   • To use Melpa-Stable:
-
-     (require 'package)
-     (add-to-list 'package-archives
-                  '("melpa-stable" . "http://stable.melpa.org/packages/") t)
-
-   Once you have added your preferred archive, you need to update the
-local package list using:
-
-     M-x package-refresh-contents RET
-
-   Once you have done that, you can install Magit and its dependencies
-using:
-
-     M-x package-install RET magit RET
-
-   Now see *note Post-Installation Tasks::.
-
-
-File: magit.info,  Node: Installing from the Git Repository,  Next: Post-Installation Tasks,  Prev: Installing from an Elpa Archive,  Up: Installation
-
-2.2 Installing from the Git Repository
-======================================
-
-Magit depends on the ‘dash’ and ‘with-editor’ library which are
-available from Melpa and Melpa-Stable.  Install them using ‘M-x
-package-install RET <package> RET’.  Of course you may also install them
-manually from their development repository, but I won’t cover that here.
-
-   (An older release of Magit is also available from Marmalade, but no
-new versions will be uploaded in the future.  Marmalade’s maintainer has
-stopped responding to requests from package maintainers who are having
-difficulties or require him to create an account so that they can upload
-their packages in the first place.)
-
-   Then clone the Magit repository:
-
-     $ git clone https://github.com/magit/magit.git ~/.emacs.d/site-lisp/magit
-     $ cd ~/.emacs.d/site-lisp/magit
-
-   Then compile the libraries and generate the info manuals:
-
-     $ make
-
-   If you haven’t installed ‘dash’ and ‘with-editor’ using Elpa or at
-‘/path/to/magit/../<package>’, then you have to tell ‘make’ where to
-find them.  To do so create ‘/path/to/magit/config.mk’ with the
-following content before running ‘make’:
-
-     LOAD_PATH  = -L /path/to/magit/lisp
-     LOAD_PATH += -L /path/to/dash
-     LOAD_PATH += -L /path/to/with-editor
-
-   Finally add this to your init file:
-
-     (add-to-list 'load-path "~/.emacs.d/site-lisp/magit/lisp")
-     (require 'magit)
-
-     (with-eval-after-load 'info
-       (info-initialize)
-       (add-to-list 'Info-directory-list
-                    "~/.emacs.d/site-lisp/magit/Documentation/"))
-
-   Note that you have to add the ‘lisp’ subdirectory to the ‘load-path’,
-not the top-level of the repository, and that elements of ‘load-path’
-should not end with a slash, while those of ‘Info-directory-list’
-should.
-
-   Instead of requiring the feature ‘magit’, you could load just the
-autoload definitions, by loading the file ‘magit-autoloads.el’.
-
-     (load "/path/to/magit/lisp/magit-autoloads")
-
-   Instead of running Magit directly from the repository by adding that
-to the ‘load-path’, you might want to instead install it in some other
-directory using ‘sudo make install’ and setting ‘load-path’ accordingly.
-
-   To update Magit use:
-
-     $ git pull
-     $ make
-
-   At times it might be necessary to run ‘make clean all’ instead.
-
-   To view all available targets use ‘make help’.
-
-   Now see *note Post-Installation Tasks::.
-
-
-File: magit.info,  Node: Post-Installation Tasks,  Prev: Installing from the Git Repository,  Up: Installation
-
-2.3 Post-Installation Tasks
-===========================
-
-After installing Magit you should verify that you are indeed using the
-Magit, Git, and Emacs releases you think you are using.  It’s best to
-restart Emacs before doing so, to make sure you are not using an
-outdated value for ‘load-path’.
-
-     M-x magit-version RET
-
-   should display something like
-
-     Magit 2.8.0, Git 2.10.2, Emacs 25.1.1, gnu/linux
-
-   Then you might also want to read about options that many users likely
-want to customize.  See *note Essential Settings::.
-
-   To be able to follow cross references to Git manpages found in this
-manual, you might also have to manually install the ‘gitman’ info
-manual, or advice ‘Info-follow-nearest-node’ to instead open the actual
-manpage.  See *note How to install the gitman info manual?::.
-
-   If you are completely new to Magit then see *note Getting Started::.
-
-   If you run into problems, then please see the *note FAQ::.  Also see
-the *note Debugging Tools::.
-
-   And last but not least please consider making a donation, to ensure
-that I can keep working on Magit.  See <https://magit.vc/donations>.
-for various donation options.
-
-
-File: magit.info,  Node: Getting Started,  Next: Interface Concepts,  Prev: Installation,  Up: Top
-
-3 Getting Started
-*****************
-
-This short tutorial describes the most essential features that many
-Magitians use on a daily basis.  It only scratches the surface but
-should be enough to get you started.
-
-   IMPORTANT: It is safest if you clone some repository just for this
-tutorial.  Alternatively you can use an existing local repository, but
-if you do that, then you should commit all uncommitted changes before
-proceeding.
-
-   To display information about the current Git repository, type ‘M-x
-magit-status RET’.  You will be using this command a lot, and should
-therefore give it a global key binding.  This is what we recommend:
-
-     (global-set-key (kbd "C-x g") 'magit-status)
-
-   Most Magit commands are commonly invoked from the status buffer.  It
-can be considered the primary interface for interacting with Git using
-Magit.  Many other Magit buffers may exist at a given time, but they are
-often created from this buffer.
-
-   Depending on what state your repository is in, this buffer may
-contain sections titled "Staged changes", "Unstaged changes", "Unmerged
-into origin/master", "Unpushed to origin/master", and many others.
-
-   Since we are starting from a safe state, which you can easily return
-to (by doing a ‘git reset --hard PRE-MAGIT-STATE’), there currently are
-not staged or unstaged changes.  Edit some files and save the changes.
-Then go back to the status buffer, while at the same time refreshing it,
-by typing ‘C-x g’.  (When the status buffer, or any Magit buffer for
-that matter, is the current buffer, then you can also use just ‘g’ to
-refresh it).
-
-   Move between sections using ‘p’ and ‘n’.  Note that the bodies of
-some sections are hidden.  Type ‘TAB’ to expand or collapse the section
-at point.  You can also use ‘C-tab’ to cycle the visibility of the
-current section and its children.  Move to a file section inside the
-section named "Unstaged changes" and type ‘s’ to stage the changes you
-have made to that file.  That file now appears under "Staged changes".
-
-   Magit can stage and unstage individual hunks, not just complete
-files.  Move to the file you have just staged, expand it using ‘TAB’,
-move to one of the hunks using ‘n’, and unstage just that by typing ‘u’.
-Note how the staging (‘s’) and unstaging (‘u’) commands operate on the
-change at point.  Many other commands behave the same way.
-
-   You can also un-/stage just part of a hunk.  Inside the body of a
-hunk section (move there using ‘C-n’), set the mark using ‘C-SPC’ and
-move down until some added and/or removed lines fall inside the region
-but not all of them.  Again type ‘s’ to stage.
-
-   It is also possible to un-/stage multiple files at once.  Move to a
-file section, type ‘C-SPC’, move to the next file using ‘n’, and then
-‘s’ to stage both files.  Note that both the mark and point have to be
-on the headings of sibling sections for this to work.  If the region
-looks like it does in other buffers, then it doesn’t select Magit
-sections that can be acted on as a unit.
-
-   And then of course you want to commit your changes.  Type ‘c’.  This
-shows the committing popup buffer featuring various commit variants and
-arguments that can be passed to ‘git commit’.  Do not worry about those
-for now.  We want to create a "normal" commit, which is done by typing
-‘c’ again.
-
-   Now two new buffers appear.  One is for writing the commit message,
-the other shows a diff with the changes that you are about to committed.
-Write a message and then type ‘C-c C-c’ to actually create the commit.
-
-   You probably don’t want to push the commit you just created because
-you just committed some random changes, but if that is not the case you
-could push it by typing ‘P’ to bring up the push popup and then ‘p’ to
-push to a branch with the same name as the local branch onto the remote
-configured as the push-remote.  (If the push-remote is not configured
-yet, then you would first be prompted for the remote to push to.)
-
-   So far we have mentioned the commit, push, and log popups.  These are
-probably among the popups you will be using the most, but many others
-exist.  To show a popup that lists all other popups (as well as the
-various apply commands and some other fundamental commands), type ‘h’.
-Try a few.
-
-   The key bindings in that popup correspond to the bindings in Magit
-buffers, including but not limited to the status buffer.  So you could
-type ‘h d’ to bring up the diff popup, but once you remember that "d"
-stands for "diff", you would usually do so by just typing ‘d’.  But the
-"popup of popups" is useful even once you have memorized all the
-bindings, as it can provide easy access to Magit commands from non-Magit
-buffers.  You should create a global key binding for this command too:
-
-     (global-set-key (kbd "C-x M-g") 'magit-dispatch-popup)
-
-   In the same vein, you might also want to enable
-‘global-magit-file-mode’ to get some more Magit key bindings in regular
-file-visiting buffers (see *note Minor Mode for Buffers Visiting
-Files::).
-
-   It is not necessary that you do so now, but if you stick with Magit,
-then it is highly recommended that you read the next section too.
-
-
-File: magit.info,  Node: Interface Concepts,  Next: Inspecting,  Prev: Getting Started,  Up: Top
-
-4 Interface Concepts
-********************
-
-* Menu:
-
-* Modes and Buffers::
-* Sections::
-* Popup Buffers and Prefix Commands::
-* Completion and Confirmation::
-* Running Git::
-
-
-File: magit.info,  Node: Modes and Buffers,  Next: Sections,  Up: Interface Concepts
-
-4.1 Modes and Buffers
-=====================
-
-Magit provides several major-modes.  For each of these modes there
-usually exists only one buffer per repository.  Separate modes and thus
-buffers exist for commits, diffs, logs, and some other things.
-
-   Besides these special purpose buffers, there also exists an overview
-buffer, called the *status buffer*.  Its usually from this buffer that
-the user invokes Git commands, or creates or visits other buffers.
-
-   In this manual we often speak about "Magit buffers".  By that we mean
-buffers whose major-modes derive from ‘magit-mode’.
-
-‘M-x magit-toggle-buffer-lock’     (‘magit-toggle-buffer-lock’)
-
-     This command locks the current buffer to its value or if the buffer
-     is already locked, then it unlocks it.
-
-     Locking a buffer to its value prevents it from being reused to
-     display another value.  The name of a locked buffer contains its
-     value, which allows telling it apart from other locked buffers and
-     the unlocked buffer.
-
-     Not all Magit buffers can be locked to their values, for example it
-     wouldn’t make sense to lock a status buffer.
-
-     There can only be a single unlocked buffer using a certain
-     major-mode per repository.  So when a buffer is being unlocked and
-     another unlocked buffer already exists for that mode and
-     repository, then the former buffer is instead deleted and the
-     latter is displayed in its place.
-
-* Menu:
-
-* Switching Buffers::
-* Naming Buffers::
-* Quitting Windows::
-* Automatic Refreshing of Magit Buffers::
-* Automatic Saving of File-Visiting Buffers::
-* Automatic Reverting of File-Visiting Buffers::
-
-
-File: magit.info,  Node: Switching Buffers,  Next: Naming Buffers,  Up: Modes and Buffers
-
-4.1.1 Switching Buffers
------------------------
-
- -- Function: magit-display-buffer buffer
-
-     This function is a wrapper around ‘display-buffer’ and is used to
-     display any Magit buffer.  It displays BUFFER in some window and,
-     unlike ‘display-buffer’, also selects that window, provided
-     ‘magit-display-buffer-noselect’ is ‘nil’.  It also runs the hooks
-     mentioned below.
-
- -- Variable: magit-display-buffer-noselect
-
-     When this is non-nil, then ‘magit-display-buffer’ only displays the
-     buffer but forgoes also selecting the window.  This variable should
-     not be set globally, it is only intended to be let-bound, by code
-     that automatically updates "the other window".  This is used for
-     example when the revision buffer is updated when you move inside
-     the log buffer.
-
- -- User Option: magit-display-buffer-function
-
-     The function specified here is called by ‘magit-display-buffer’
-     with one argument, a buffer, to actually display that buffer.  This
-     function should call ‘display-buffer’ with that buffer as first and
-     a list of display actions as second argument.
-
-     Magit provides several functions, listed below, that are suitable
-     values for this option.  If you want to use different rules, then a
-     good way of doing that is to start with a copy of one of these
-     functions and then adjust it to your needs.
-
-     Instead of using a wrapper around ‘display-buffer’, that function
-     itself can be used here, in which case the display actions have to
-     be specified by adding them to ‘display-buffer-alist’ instead.
-
-     To learn about display actions, see *note (elisp)Choosing a Window
-     for Display::.
-
- -- Function: magit-display-buffer-traditional buffer
-
-     This function is the current default value of the option
-     ‘magit-display-buffer-function’.  Before that option and this
-     function were added, the behavior was hard-coded in many places all
-     over the code base but now all the rules are contained in this one
-     function (except for the "noselect" special case mentioned above).
-
- -- Function: magit-display-buffer-same-window-except-diff-v1
-
-     This function displays most buffers in the currently selected
-     window.  If a buffer’s mode derives from ‘magit-diff-mode’ or
-     ‘magit-process-mode’, it is displayed in another window.
-
- -- Function: magit-display-buffer-fullframe-status-v1
-
-     This function fills the entire frame when displaying a status
-     buffer.  Otherwise, it behaves like
-     ‘magit-display-buffer-traditional’.
-
- -- Function: magit-display-buffer-fullframe-status-topleft-v1
-
-     This function fills the entire frame when displaying a status
-     buffer.  It behaves like ‘magit-display-buffer-fullframe-status-v1’
-     except that it displays buffers that derive from ‘magit-diff-mode’
-     or ‘magit-process-mode’ to the top or left of the current buffer
-     rather than to the bottom or right.  As a result, Magit buffers
-     tend to pop up on the same side as they would if
-     ‘magit-display-buffer-traditional’ were in use.
-
- -- Function: magit-display-buffer-fullcolumn-most-v1
-
-     This function displays most buffers so that they fill the entire
-     height of the frame.  However, the buffer is displayed in another
-     window if 1) the buffer’s mode derives from ‘magit-process-mode’,
-     or 2) the buffer’s mode derives from ‘magit-diff-mode’, provided
-     that the mode of the current buffer derives from ‘magit-log-mode’
-     or ‘magit-cherry-mode’.
-
- -- User Option: magit-pre-display-buffer-hook
-
-     This hook is run by ‘magit-display-buffer’ before displaying the
-     buffer.
-
- -- Function: magit-save-window-configuration
-
-     This function saves the current window configuration.  Later when
-     the buffer is buried, it may be restored by
-     ‘magit-restore-window-configuration’.
-
- -- User Option: magit-post-display-buffer-hook
-
-     This hook is run by ‘magit-display-buffer’ after displaying the
-     buffer.
-
- -- Function: magit-maybe-set-dedicated
-
-     This function remembers if a new window had to be created to
-     display the buffer, or whether an existing window was reused.  This
-     information is later used by ‘magit-mode-quit-window’, to determine
-     whether the window should be deleted when its last Magit buffer is
-     buried.
-
-
-File: magit.info,  Node: Naming Buffers,  Next: Quitting Windows,  Prev: Switching Buffers,  Up: Modes and Buffers
-
-4.1.2 Naming Buffers
---------------------
-
- -- User Option: magit-generate-buffer-name-function
-
-     The function used to generate the names of Magit buffers.
-
-     Such a function should take the options
-     ‘magit-uniquify-buffer-names’ as well as ‘magit-buffer-name-format’
-     into account.  If it doesn’t, then should be clearly stated in the
-     doc-string.  And if it supports %-sequences beyond those mentioned
-     in the doc-string of the option ‘magit-buffer-name-format’, then
-     its own doc-string should describe the additions.
-
- -- Function: magit-generate-buffer-name-default-function mode
-
-     This function returns a buffer name suitable for a buffer whose
-     major-mode is MODE and which shows information about the repository
-     in which ‘default-directory’ is located.
-
-     This function uses ‘magit-buffer-name-format’ and supporting all of
-     the %-sequences mentioned the documentation of that option.  It
-     also respects the option ‘magit-uniquify-buffer-names’.
-
- -- User Option: magit-buffer-name-format
-
-     The format string used to name Magit buffers.
-
-     At least the following %-sequences are supported:
-
-        • ‘%m’
-
-          The name of the major-mode, but with the ‘-mode’ suffix
-          removed.
-
-        • ‘%M’
-
-          Like ‘%m’ but abbreviate ‘magit-status-mode’ as ‘magit’.
-
-        • ‘%v’
-
-          The value the buffer is locked to, in parentheses, or an empty
-          string if the buffer is not locked to a value.
-
-        • ‘%V’
-
-          Like ‘%v’, but the string is prefixed with a space, unless it
-          is an empty string.
-
-        • ‘%t’
-
-          The top-level directory of the working tree of the repository,
-          or if ‘magit-uniquify-buffer-names’ is non-nil an abbreviation
-          of that.
-     The value should always contain either ‘%m’ or ‘%M’, ‘%v’ or ‘%V’,
-     and ‘%t’.  If ‘magit-uniquify-buffer-names’ is non-nil, then the
-     value must end with ‘%t’.
-
- -- User Option: magit-uniquify-buffer-names
-
-     This option controls whether the names of Magit buffers are
-     uniquified.  If the names are not being uniquified, then they
-     contain the full path of the top-level of the working tree of the
-     corresponding repository.  If they are being uniquified, then they
-     end with the basename of the top-level, or if that would conflict
-     with the name used for other buffers, then the names of all these
-     buffers are adjusted until they no longer conflict.
-
-     This is done using the ‘uniquify’ package; customize its options to
-     control how buffer names are uniquified.
-
-
-File: magit.info,  Node: Quitting Windows,  Next: Automatic Refreshing of Magit Buffers,  Prev: Naming Buffers,  Up: Modes and Buffers
-
-4.1.3 Quitting Windows
-----------------------
-
-‘q’     (‘magit-mode-bury-buffer’)
-
-     This command buries the current Magit buffer.  With a prefix
-     argument, it instead kills the buffer.
-
- -- User Option: magit-bury-buffer-function
-
-     The function used to actually bury or kill the current buffer.
-
-     ‘magit-mode-bury-buffer’ calls this function with one argument.  If
-     the argument is non-nil, then the function has to kill the current
-     buffer.  Otherwise it has to bury it alive.  The default value
-     currently is ‘magit-restore-window-configuration’.
-
- -- Function: magit-restore-window-configuration kill-buffer
-
-     Bury or kill the current buffer using ‘quit-window’, which is
-     called with KILL-BUFFER as first and the selected window as second
-     argument.
-
-     Then restore the window configuration that existed right before the
-     current buffer was displayed in the selected frame.  Unfortunately
-     that also means that point gets adjusted in all the buffers, which
-     are being displayed in the selected frame.
-
- -- Function: magit-mode-quit-window kill-buffer
-
-     Bury or kill the current buffer using ‘quit-window’, which is
-     called with KILL-BUFFER as first and the selected window as second
-     argument.
-
-     Then, if the window was originally created to display a Magit
-     buffer and the buried buffer was the last remaining Magit buffer
-     that was ever displayed in the window, then that is deleted.
-
-
-File: magit.info,  Node: Automatic Refreshing of Magit Buffers,  Next: Automatic Saving of File-Visiting Buffers,  Prev: Quitting Windows,  Up: Modes and Buffers
-
-4.1.4 Automatic Refreshing of Magit Buffers
--------------------------------------------
-
-After running a command which may change the state of the current
-repository, the current Magit buffer and the corresponding status buffer
-are refreshed.  The status buffer may optionally be automatically
-refreshed whenever a buffer is saved to a file inside the respective
-repository.
-
-   Automatically refreshing Magit buffers ensures that the displayed
-information is up-to-date most of the time but can lead to a noticeable
-delay in big repositories.  Other Magit buffers are not refreshed to
-keep the delay to a minimum and also because doing so can sometimes be
-undesirable.
-
-   Buffers can also be refreshed explicitly, which is useful in buffers
-that weren’t current during the last refresh and after changes were made
-to the repository outside of Magit.
-
-‘g’     (‘magit-refresh’)
-
-     This command refreshes the current buffer if its major mode derives
-     from ‘magit-mode’ as well as the corresponding status buffer.
-
-     If the option ‘magit-revert-buffers’ calls for it, then it also
-     reverts all unmodified buffers that visit files being tracked in
-     the current repository.
-
-‘G’     (‘magit-refresh-all’)
-
-     This command refreshes all Magit buffers belonging to the current
-     repository and also reverts all unmodified buffers that visit files
-     being tracked in the current repository.
-
-     The file-visiting buffers are always reverted, even if
-     ‘magit-revert-buffers’ is nil.
-
- -- User Option: magit-refresh-buffer-hook
-
-     This hook is run in each Magit buffer that was refreshed during the
-     current refresh - normally the current buffer and the status
-     buffer.
-
- -- User Option: magit-refresh-status-buffer
-
-     When this option is non-nil, then the status buffer is
-     automatically refreshed after running git for side-effects, in
-     addition to the current Magit buffer, which is always refreshed
-     automatically.
-
-     Only set this to nil after exhausting all other options to improve
-     performance.
-
- -- Function: magit-after-save-refresh-status
-
-     This function is intended to be added to ‘after-save-hook’.  After
-     doing that the corresponding status buffer is refreshed whenever a
-     buffer is saved to a file inside a repository.
-
-     Note that refreshing a Magit buffer is done by re-creating its
-     contents from scratch, which can be slow in large repositories.  If
-     you are not satisfied with Magit’s performance, then you should
-     obviously not add this function to that hook.
-
-
-File: magit.info,  Node: Automatic Saving of File-Visiting Buffers,  Next: Automatic Reverting of File-Visiting Buffers,  Prev: Automatic Refreshing of Magit Buffers,  Up: Modes and Buffers
-
-4.1.5 Automatic Saving of File-Visiting Buffers
------------------------------------------------
-
-File-visiting buffers are by default saved at certain points in time.
-This doesn’t guarantee that Magit buffers are always up-to-date, but,
-provided one only edits files by editing them in Emacs and uses only
-Magit to interact with Git, one can be fairly confident.  When in doubt
-or after outside changes, type ‘g’ (‘magit-refresh’) to save and refresh
-explicitly.
-
- -- User Option: magit-save-repository-buffers
-
-     This option controls whether file-visiting buffers are saved before
-     certain events.
-
-     If this is non-nil then all modified file-visiting buffers
-     belonging to the current repository may be saved before running
-     commands, before creating new Magit buffers, and before explicitly
-     refreshing such buffers.  If this is ‘dontask’ then this is done
-     without user intervention.  If it is ‘t’ then the user has to
-     confirm each save.
-
-
-File: magit.info,  Node: Automatic Reverting of File-Visiting Buffers,  Prev: Automatic Saving of File-Visiting Buffers,  Up: Modes and Buffers
-
-4.1.6 Automatic Reverting of File-Visiting Buffers
---------------------------------------------------
-
-By default Magit automatically reverts buffers that are visiting files
-that are being tracked in a Git repository, after they have changed on
-disk.  When using Magit one often changes files on disk by running git,
-i.e.  "outside Emacs", making this a rather important feature.
-
-   For example, if you discard a change in the status buffer, then that
-is done by running ‘git apply --reverse ...’, and Emacs considers the
-file to have "changed on disk".  If Magit did not automatically revert
-the buffer, then you would have to type ‘M-x revert-buffer RET RET’ in
-the visiting buffer before you could continue making changes.
-
- -- User Option: magit-auto-revert-mode
-
-     When this mode is enabled, then buffers that visit tracked files,
-     are automatically reverted after the visited files changed on disk.
-
- -- User Option: global-auto-revert-mode
-
-     When this mode is enabled, then any file-visiting buffer is
-     automatically reverted after the visited file changed on disk.
-
-     If you like buffers that visit tracked files to be automatically
-     reverted, then you might also like any buffer to be reverted, not
-     just those visiting tracked files.  If that is the case, then
-     enable this mode _instead of_ ‘magit-auto-revert-mode’.
-
- -- User Option: magit-auto-revert-immediately
-
-     This option controls whether Magit reverts buffers immediately.
-
-     If this is non-nil and either ‘global-auto-revert-mode’ or
-     ‘magit-auto-revert-mode’ is enabled, then Magit immediately reverts
-     buffers by explicitly calling ‘auto-revert-buffers’ after running
-     git for side-effects.
-
-     If ‘auto-revert-use-notify’ is non-nil (and file notifications are
-     actually supported), then ‘magit-auto-revert-immediately’ does not
-     have to be non-nil, because the reverts happen immediately anyway.
-
-     If ‘magit-auto-revert-immediately’ and ‘auto-revert-use-notify’ are
-     both ‘nil’, then reverts happen after ‘auto-revert-interval’
-     seconds of user inactivity.  That is not desirable.
-
- -- User Option: auto-revert-use-notify
-
-     This option controls whether file notification functions should be
-     used.  Note that this variable unfortunately defaults to ‘t’ even
-     on systems on which file notifications cannot be used.
-
- -- User Option: magit-auto-revert-tracked-only
-
-     This option controls whether ‘magit-auto-revert-mode’ only reverts
-     tracked files or all files that are located inside Git
-     repositories, including untracked files and files located inside
-     Git’s control directory.
-
- -- Command: auto-revert-mode
-
-     The global mode ‘magit-auto-revert-mode’ works by turning on this
-     local mode in the appropriate buffers (but
-     ‘global-auto-revert-mode’ is implemented differently).  You can
-     also turn it on or off manually, which might be necessary if Magit
-     does not notice that a previously untracked file now is being
-     tracked or vice-versa.
-
- -- User Option: auto-revert-stop-on-user-input
-
-     This option controls whether the arrival of user input suspends the
-     automatic reverts for ‘auto-revert-interval’ seconds.
-
- -- User Option: auto-revert-interval
-
-     This option controls for how many seconds Emacs waits before
-     resuming suspended reverts.
-
- -- User Option: auto-revert-buffer-list-filter
-
-     This option specifies an additional filter used by
-     ‘auto-revert-buffers’ to determine whether a buffer should be
-     reverted or not.
-
-     This option is provided by ‘magit’, which also redefines
-     ‘auto-revert-buffers’ to respect it.  Magit users who do not turn
-     on the local mode ‘auto-revert-mode’ themselves, are best served by
-     setting the value to ‘magit-auto-revert-repository-buffers-p’.
-
-     However the default is nil, to not disturb users who do use the
-     local mode directly.  If you experience delays when running Magit
-     commands, then you should consider using one of the predicates
-     provided by Magit - especially if you also use Tramp.
-
-     Users who do turn on ‘auto-revert-mode’ in buffers in which Magit
-     doesn’t do that for them, should likely not use any filter.  Users
-     who turn on ‘global-auto-revert-mode’, do not have to worry about
-     this option, because it is disregarded if the global mode is
-     enabled.
-
- -- User Option: auto-revert-verbose
-
-     This option controls whether Emacs reports when a buffer has been
-     reverted.
-
-   The options with the ‘auto-revert-’ prefix are located in the Custom
-group named ‘auto-revert’.  The other, magit-specific, options are
-located in the ‘magit’ group.
-
-* Menu:
-
-* Risk of Reverting Automatically::
-
-
-File: magit.info,  Node: Risk of Reverting Automatically,  Up: Automatic Reverting of File-Visiting Buffers
-
-Risk of Reverting Automatically
-...............................
-
-For the vast majority users automatically reverting file-visiting
-buffers after they have changed on disk is harmless.
-
-   If a buffer is modified (i.e.  it contains changes that haven’t been
-saved yet), then Emacs would refuse to automatically revert it.  If you
-save a previously modified buffer, then that results in what is seen by
-Git as an uncommitted change.  Git would then refuse to carry out any
-commands that would cause these changes to be lost.  In other words, if
-there is anything that could be lost, then either Git or Emacs would
-refuse to discard the changes.
-
-   However if you do use file-visiting buffers as a sort of ad hoc
-"staging area", then the automatic reverts could potentially cause data
-loss.  So far I have only heard from one user who uses such a workflow.
-
-   An example: You visit some file in a buffer, edit it, and save the
-changes.  Then, outside of Emacs (or at least not using Magit or by
-saving the buffer) you change the file on disk again.  At this point the
-buffer is the only place where the intermediate version still exists.
-You have saved the changes to disk, but that has since been overwritten.
-Meanwhile Emacs considers the buffer to be unmodified (because you have
-not made any changes to it since you last saved it to the visited file)
-and therefore would not object to it being automatically reverted.  At
-this point an Auto-Revert mode would kick in.  It would check whether
-the buffer is modified and since that is not the case it would revert
-it.  The intermediate version would be lost.  (Actually you could still
-get it back using the ‘undo’ command.)
-
-   If your workflow depends on Emacs preserving the intermediate version
-in the buffer, then you have to disable all Auto-Revert modes.  But
-please consider that such a workflow would be dangerous even without
-using an Auto-Revert mode, and should therefore be avoided.  If Emacs
-crashed or if you quit Emacs by mistake, then you would also lose the
-buffer content.  There would be no autosave file still containing the
-intermediate version (because that was deleted when you saved the
-buffer) and you would not be asked whether you want to save the buffer
-(because it isn’t modified).
-
-
-File: magit.info,  Node: Sections,  Next: Popup Buffers and Prefix Commands,  Prev: Modes and Buffers,  Up: Interface Concepts
-
-4.2 Sections
-============
-
-Magit buffers are organized into nested sections, which can be collapsed
-and expanded, similar to how sections are handled in Org mode.  Each
-section also has a type, and some sections also have a value.  For each
-section type there can also be a local keymap, shared by all sections of
-that type.
-
-   Taking advantage of the section value and type, many commands operate
-on the current section, or when the region is active and selects
-sections of the same type, all of the selected sections.  Commands that
-only make sense for a particular section type (as opposed to just
-behaving differently depending on the type) are usually bound in section
-type keymaps.
-
-* Menu:
-
-* Section Movement::
-* Section Visibility::
-* Section Hooks::
-* Section Types and Values::
-* Section Options::
-
-
-File: magit.info,  Node: Section Movement,  Next: Section Visibility,  Up: Sections
-
-4.2.1 Section Movement
-----------------------
-
-To move within a section use the usual keys (‘C-p’, ‘C-n’, ‘C-b’, ‘C-f’
-etc), whose global bindings are not shadowed.  To move to another
-section use the following commands.
-
-‘p’     (‘magit-section-backward’)
-
-     When not at the beginning of a section, then move to the beginning
-     of the current section.  At the beginning of a section, instead
-     move to the beginning of the previous visible section.
-
-‘n’     (‘magit-section-forward’)
-
-     Move to the beginning of the next visible section.
-
-‘M-p’     (‘magit-section-backward-siblings’)
-
-     Move to the beginning of the previous sibling section.  If there is
-     no previous sibling section, then move to the parent section
-     instead.
-
-‘M-n’     (‘magit-section-forward-siblings’)
-
-     Move to the beginning of the next sibling section.  If there is no
-     next sibling section, then move to the parent section instead.
-
-‘^’     (‘magit-section-up’)
-
-     Move to the beginning of the parent of the current section.
-
-   The above commands all call the hook ‘magit-section-movement-hook’.
-And, except for the second, the below functions are all members of that
-hook’s default value.
-
- -- Variable: magit-section-movement-hook
-
-     This hook is run by all of the above movement commands, after
-     arriving at the destination.
-
- -- Function: magit-hunk-set-window-start
-
-     This hook function ensures that the beginning of the current
-     section is visible, provided it is a ‘hunk’ section.  Otherwise, it
-     does nothing.
-
- -- Function: magit-section-set-window-start
-
-     This hook function ensures that the beginning of the current
-     section is visible, regardless of the section’s type.  If you add
-     this to ‘magit-section-movement-hook’, then you must remove the
-     hunk-only variant in turn.
-
- -- Function: magit-log-maybe-show-more-commits
-
-     This hook function only has an effect in log buffers, and ‘point’
-     is on the "show more" section.  If that is the case, then it
-     doubles the number of commits that are being shown.
-
- -- Function: magit-log-maybe-update-revision-buffer
-
-     When moving inside a log buffer, then this function updates the
-     revision buffer, provided it is already being displayed in another
-     window of the same frame.
-
- -- Function: magit-log-maybe-update-blob-buffer
-
-     When moving inside a log buffer and another window of the same
-     frame displays a blob buffer, then this function instead displays
-     the blob buffer for the commit at point in that window.
-
- -- Function: magit-status-maybe-update-revision-buffer
-
-     When moving inside a status buffer, then this function updates the
-     revision buffer, provided it is already being displayed in another
-     window of the same frame.
-
- -- Function: magit-status-maybe-update-blob-buffer
-
-     When moving inside a status buffer and another window of the same
-     frame displays a blob buffer, then this function instead displays
-     the blob buffer for the commit at point in that window.
-
- -- User Option: magit-update-other-window-delay
-
-     Delay before automatically updating the other window.
-
-     When moving around in certain buffers certain other buffers, which
-     are being displayed in another window, may optionally be updated to
-     display information about the section at point.
-
-     When holding down a key to move by more than just one section, then
-     that would update that buffer for each section on the way.  To
-     prevent that, updating the revision buffer is delayed, and this
-     option controls for how long.  For optimal experience you might
-     have to adjust this delay and/or the keyboard repeat rate and delay
-     of your graphical environment or operating system.
-
-
-File: magit.info,  Node: Section Visibility,  Next: Section Hooks,  Prev: Section Movement,  Up: Sections
-
-4.2.2 Section Visibility
-------------------------
-
-Magit provides many commands for changing the visibility of sections,
-but all you need to get started are the next two.
-
-‘TAB’     (‘magit-section-toggle’)
-
-     Toggle the visibility of the body of the current section.
-
-‘C-<tab>’     (‘magit-section-cycle’)
-
-     Cycle the visibility of current section and its children.
-
-‘M-<tab>’     (‘magit-section-cycle-diffs’)
-
-     Cycle the visibility of diff-related sections in the current
-     buffer.
-
-‘S-<tab>’     (‘magit-section-cycle-global’)
-
-     Cycle the visibility of all sections in the current buffer.
-
-‘1’     (‘magit-section-show-level-1’)
-‘2’     (‘magit-section-show-level-2’)
-‘3’     (‘magit-section-show-level-3’)
-‘4’     (‘magit-section-show-level-4’)
-
-     Show sections surrounding the current section up to level N.
-
-‘M-1’     (‘magit-section-show-level-1-all’)
-‘M-2’     (‘magit-section-show-level-2-all’)
-‘M-3’     (‘magit-section-show-level-3-all’)
-‘M-4’     (‘magit-section-show-level-4-all’)
-
-     Show all sections up to level N.
-
-   Some functions, which are used to implement the above commands, are
-also exposed as commands themselves.  By default no keys are bound to
-these commands, as they are generally perceived to be much less useful.
-But your mileage may vary.
-
- -- Command: magit-section-show
-
-     Show the body of the current section.
-
- -- Command: magit-section-hide
-
-     Hide the body of the current section.
-
- -- Command: magit-section-show-headings
-
-     Recursively show headings of children of the current section.  Only
-     show the headings.  Previously shown text-only bodies are hidden.
-
- -- Command: magit-section-show-children
-
-     Recursively show the bodies of children of the current section.
-     With a prefix argument show children down to the level of the
-     current section, and hide deeper children.
-
- -- Command: magit-section-hide-children
-
-     Recursively hide the bodies of children of the current section.
-
- -- Command: magit-section-toggle-children
-
-     Toggle visibility of bodies of children of the current section.
-
-   When a buffer is first created then some sections are shown expanded
-while others are not.  This is hard coded.  When a buffer is refreshed
-then the previous visibility is preserved.  The initial visibility of
-certain sections can also be overwritten using the hook
-‘magit-section-set-visibility-hook’.
-
- -- Variable: magit-section-set-visibility-hook
-
-     This hook is run when first creating a buffer and also when
-     refreshing an existing buffer, and is used to determine the
-     visibility of the section currently being inserted.
-
-     Each function is called with one argument, the section being
-     inserted.  It should return ‘hide’ or ‘show’, or to leave the
-     visibility undefined ‘nil’.  If no function decides on the
-     visibility and the buffer is being refreshed, then the visibility
-     is preserved; or if the buffer is being created, then the hard
-     coded default is used.
-
-     Usually this should only be used to set the initial visibility but
-     not during refreshes.  If ‘magit-insert-section--oldroot’ is
-     non-nil, then the buffer is being refreshed and these functions
-     should immediately return ‘nil’.
-
-
-File: magit.info,  Node: Section Hooks,  Next: Section Types and Values,  Prev: Section Visibility,  Up: Sections
-
-4.2.3 Section Hooks
--------------------
-
-Which sections are inserted into certain buffers is controlled with
-hooks.  This includes the status and the refs buffers.  For other
-buffers, e.g.  log, diff, and revision buffers, this is not possible.
-
-   For buffers whose sections can be customized by the user, a hook
-variable called ‘magit-TYPE-sections-hook’ exists.  This hook should be
-changed using ‘magit-add-section-hook’.  Avoid using ‘add-hooks’ or the
-Custom interface.
-
-   The various available section hook variables are described later in
-this manual along with the appropriate "section inserter functions".
-
- -- Function: magit-add-section-hook hook function &optional at append
-          local
-
-     Add the function FUNCTION to the value of section hook HOOK.
-
-     Add FUNCTION at the beginning of the hook list unless optional
-     APPEND is non-nil, in which case FUNCTION is added at the end.  If
-     FUNCTION already is a member then move it to the new location.
-
-     If optional AT is non-nil and a member of the hook list, then add
-     FUNCTION next to that instead.  Add before or after AT, or replace
-     AT with FUNCTION depending on APPEND. If APPEND is the symbol
-     ‘replace’, then replace AT with FUNCTION. For any other non-nil
-     value place FUNCTION right after AT. If nil, then place FUNCTION
-     right before AT. If FUNCTION already is a member of the list but AT
-     is not, then leave FUNCTION where ever it already is.
-
-     If optional LOCAL is non-nil, then modify the hook’s buffer-local
-     value rather than its global value.  This makes the hook local by
-     copying the default value.  That copy is then modified.
-
-     HOOK should be a symbol.  If HOOK is void, it is first set to nil.
-     HOOK’s value must not be a single hook function.  FUNCTION should
-     be a function that takes no arguments and inserts one or multiple
-     sections at point, moving point forward.  FUNCTION may choose not
-     to insert its section(s), when doing so would not make sense.  It
-     should not be abused for other side-effects.
-
-   To remove a function from a section hook, use ‘remove-hook’.
-
-
-File: magit.info,  Node: Section Types and Values,  Next: Section Options,  Prev: Section Hooks,  Up: Sections
-
-4.2.4 Section Types and Values
-------------------------------
-
-Each section has a type, for example ‘hunk’, ‘file’, and ‘commit’.
-Instances of certain section types also have a value.  The value of a
-section of type ‘file’, for example, is a file name.
-
-   Users usually do not have to worry about a section’s type and value,
-but knowing them can be handy at times.
-
-‘M-x magit-describe-section’     (‘magit-describe-section’)
-
-     Show information about the section at point in the echo area, as
-     "VALUE [TYPE PARENT-TYPE…] BEGINNING-END".
-
-   Many commands behave differently depending on the type of the section
-at point and/or somehow consume the value of that section.  But that is
-only one of the reasons why the same key may do something different,
-depending on what section is current.
-
-   Additionally for each section type a keymap *might* be defined, named
-‘magit-TYPE-section-map’.  That keymap is used as text property keymap
-of all text belonging to any section of the respective type.  If such a
-map does not exist for a certain type, then you can define it yourself,
-and it will automatically be used.
-
-
-File: magit.info,  Node: Section Options,  Prev: Section Types and Values,  Up: Sections
-
-4.2.5 Section Options
----------------------
-
-This section describes options that have an effect on more than just a
-certain type of sections.  As you can see there are not many of those.
-
- -- User Option: magit-section-show-child-count
-
-     Whether to append the number of children to section headings.  This
-     only affects sections that could benefit from this information.
-
-
-File: magit.info,  Node: Popup Buffers and Prefix Commands,  Next: Completion and Confirmation,  Prev: Sections,  Up: Interface Concepts
-
-4.3 Popup Buffers and Prefix Commands
-=====================================
-
-Many Magit commands are implemented using *popup buffers*.  First the
-user invokes a *popup* or *prefix* command, which causes a popup buffer
-with the available *infix* arguments and *suffix* commands to be
-displayed.  The user then optionally toggles/sets some arguments and
-finally invokes one of the suffix commands.
-
-   This is implemented in the library ‘magit-popup’.  Earlier releases
-used the library ‘magit-key-mode’.  A future release will switch to a
-yet-to-be-written successor, which will likely be named ‘transient’.
-
-   Because ‘magit-popup’ can also be used by other packages without
-having to depend on all of Magit, it is documented in its own manual.
-See *note (magit-popup)Top::.
-
-‘C-c C-c’     (‘magit-dispatch-popup’)
-
-     This popup command shows a buffer featuring all other Magit popup
-     commands as well as some other commands that are not popup commands
-     themselves.
-
-   This command is also, or especially, useful outside Magit buffers, so
-you should setup a global binding:
-
-     (global-set-key (kbd "C-x M-g") 'magit-dispatch-popup)
-
-   Most popups set their initial arguments according to the
-corresponding ‘magit-*-arguments’ variable.  Two popups, the log and
-diff popups (see *note Logging:: and *note Diffing::), may behave a bit
-differently, depending on the value of ‘magit-use-sticky-arguments’.
-
- -- User Option: magit-use-sticky-arguments
-
-     This option controls how diff and log commands reuse arguments from
-     existing buffers.
-
-     When ‘t’ (the default value), the log or diff popup reuses the
-     arguments from the current repository’s log or diff buffer,
-     respectively.  When no log or diff buffer exists for the current
-     repository, these popups use the default value of
-     ‘magit-log-arguments’ or ‘magit-diff-arguments’.
-
-     When ‘current’, log and diff popups will only reuse the arguments
-     if the current buffer is derived from ‘magit-log-mode’ or
-     ‘magit-diff-mode’, respectively.
-
-     When ‘nil’, the default value of ‘magit-log-arguments’ or
-     ‘magit-diff-arguments’ is always used.
-
-
-File: magit.info,  Node: Completion and Confirmation,  Next: Running Git,  Prev: Popup Buffers and Prefix Commands,  Up: Interface Concepts
-
-4.4 Completion and Confirmation
-===============================
-
-Many commands read a value from the user.  By default this is done using
-the built-in function ‘completing-read’, but Magit can instead use
-another completion framework.
-
- -- User Option: magit-completing-read-function
-
-     The value of this variable is the function used to perform
-     completion.  Because functions _intended_ to replace
-     ‘completing-read’ often are not fully compatible drop-in
-     replacements, and also because Magit expects them to add the
-     default choice to the prompt themselves, such functions should not
-     be used directly.  Instead a wrapper function has to be used.
-
-   Currently only the real ‘completing-read’ and Ido
-(http://www.emacswiki.org/emacs/InteractivelyDoThings) are fully
-supported.  More frameworks will be supported in the future.
-
- -- Function: magit-builtin-completing-read prompt choices &optional
-          predicate require-match initial-input hist def
-
-     Perform completion using ‘completion-read’.
-
- -- Function: magit-ido-completing-read prompt choices &optional
-          predicate require-match initial-input hist def
-
-     Perform completion using ‘ido-completing-read+’ from the package by
-     the same name (which you have to explicitly install).  Ido itself
-     comes with a supposed drop-in replacement ‘ido-completing-read’,
-     but that has too many deficits to serve our needs.
-
- -- User Option: magit-list-refs-sortby
-
-     For many commands that read a ref or refs from the user, the value
-     of this option can be used to control the order of the refs.  Valid
-     values include any key accepted by the ‘--sort’ flag of ‘git
-     for-each-ref’.  By default, refs are sorted alphabetically by their
-     full name (e.g., "refs/heads/master").
-
-   By default many commands that could potentially lead to data loss
-have to be confirmed.  This includes many very common commands, so this
-can become annoying quickly.  Many of these actions can be undone,
-provided ‘magit-wip-before-change-mode’ is turned on (which it is not by
-default, due to performance concerns).
-
- -- User Option: magit-no-confirm
-
-     The value of this option is a list of symbols, representing
-     commands which do not have to be confirmed by the user before being
-     carried out.
-
-     When the global mode ‘magit-wip-before-change-mode’ is enabled then
-     many commands can be undone.  If that mode is enabled then adding
-     ‘safe-with-wip’ to this list has the same effect as adding
-     ‘discard’, ‘reverse’, ‘stage-all-changes’, and
-     ‘unstage-all-changes’.
-
-          (add-to-list 'magit-no-confirm 'safe-with-wip)
-
-     For a list of all symbols that can be added to the value of this
-     variable, see the doc-string.
-
-   Note that there are commands that ignore this option and always
-require confirmation, or which can be told not to do so using another
-dedicated option.  Also most commands, when acting on multiple sections
-at once always, require confirmation, even when they do respect this
-option when acting on a single section.
-
-
-File: magit.info,  Node: Running Git,  Prev: Completion and Confirmation,  Up: Interface Concepts
-
-4.5 Running Git
-===============
-
-* Menu:
-
-* Viewing Git Output::
-* Running Git Manually::
-* Git Executable::
-* Global Git Arguments::
-
-
-File: magit.info,  Node: Viewing Git Output,  Next: Running Git Manually,  Up: Running Git
-
-4.5.1 Viewing Git Output
-------------------------
-
-Magit runs Git either for side-effects (e.g.  when pushing) or to get
-some value (e.g.  the name of the current branch).  When Git is run for
-side-effects then the output goes into a per-repository log buffer,
-which can be consulted when things don’t go as expected.
-
-‘$’     (‘magit-process’)
-
-     This commands displays the process buffer for the current
-     repository.
-
-   Inside that buffer, the usual key bindings for navigating and showing
-sections are available.  There is one additional command.
-
-‘k’     (‘magit-process-kill’)
-
-     This command kills the process represented by the section at point.
-
- -- User Option: magit-git-debug
-
-     When this is non-nil then the output of all calls to git are logged
-     in the process buffer.  This is useful when debugging, otherwise it
-     just negatively affects performance.
-
-
-File: magit.info,  Node: Running Git Manually,  Next: Git Executable,  Prev: Viewing Git Output,  Up: Running Git
-
-4.5.2 Running Git Manually
---------------------------
-
-While Magit provides many Emacs commands to interact with Git, it does
-not cover everything.  In those cases your existing Git knowledge will
-come in handy.  Magit provides some commands for running arbitrary Git
-commands by typing them into the minibuffer, instead of having to switch
-to a shell.
-
-‘!’     (‘magit-run-popup’)
-
-     Shows the popup buffer featuring the below suffix commands.
-
-‘! !’     (‘magit-git-command-topdir’)
-
-     This command reads a command from the user and executes it in the
-     top-level directory of the current working tree.
-
-     The string "git " is used as initial input when prompting the user
-     for the command.  It can be removed to run another command.
-
-‘! p’     (‘magit-git-command’)
-
-     This command reads a command from the user and executes it in
-     ‘default-directory’.  With a prefix argument the command is
-     executed in the top-level directory of the current working tree
-     instead.
-
-     The string "git " is used as initial input when prompting the user
-     for the command.  It can be removed to run another command.
-
-‘! s’     (‘magit-shell-command-topdir’)
-
-     This command reads a command from the user and executes it in the
-     top-level directory of the current working tree.
-
-‘! S’     (‘magit-shell-command’)
-
-     This command reads a command from the user and executes it in
-     ‘default-directory’.  With a prefix argument the command is
-     executed in the top-level directory of the current working tree
-     instead.
-
- -- User Option: magit-shell-command-verbose-prompt
-
-     Whether the prompt, used by the the above commands when reading a
-     shell command, shows the directory in which it will be run.
-
-   These suffix commands start external gui tools.
-
-‘! k’     (‘magit-run-gitk’)
-
-     This command runs ‘gitk’ in the current repository.
-
-‘! a’     (‘magit-run-gitk-all’)
-
-     This command runs ‘gitk --all’ in the current repository.
-
-‘! b’     (‘magit-run-gitk-branches’)
-
-     This command runs ‘gitk --branches’ in the current repository.
-
-‘! g’     (‘magit-run-git-gui’)
-
-     This command runs ‘git gui’ in the current repository.
-
-
-File: magit.info,  Node: Git Executable,  Next: Global Git Arguments,  Prev: Running Git Manually,  Up: Running Git
-
-4.5.3 Git Executable
---------------------
-
-Except on MS Windows, Magit defaults to running Git without specifying
-the path to the git executable.  Instead the first executable found by
-Emacs on ‘exec-path’ is used (whose value in turn is set based on the
-value of the environment variable ‘$PATH’ when Emacs was started).
-
-   This has the advantage that it continues to work even when using
-Tramp to connect to a remote machine on which the executable is found in
-a different place.  The downside is that if you have multiple versions
-of Git installed, then you might end up using another version than the
-one you think you are using.
-
-‘M-x magit-version’     (‘magit-version’)
-
-     This command shows the currently used versions of Magit, Git, and
-     Emacs in the echo area.  Non-interactively this just returns the
-     Magit version.
-
-   When the ‘system-type’ is ‘windows-nt’, then ‘magit-git-executable’
-is set to an absolute path when Magit is first loaded.  This is
-necessary because Git on that platform comes with several wrapper
-scripts for the actual git binary, which are also placed on ‘$PATH’, and
-using one of these wrappers instead of the binary would degrade
-performance horribly.
-
-   If Magit doesn’t find the correct executable then you *can* work
-around that by setting ‘magit-git-executable’ to an absolute path.  But
-note that doing so is a kludge.  It is better to make sure the order in
-the environment variable ‘$PATH’ is correct, and that Emacs is started
-with that environment in effect.  The command
-‘magit-debug-git-executable’ can be useful to find out where Emacs is
-searching for git.  If you have to connect from Windows to a non-Windows
-machine, then you must change the value to "git".
-
- -- User Option: magit-git-executable
-
-     The git executable used by Magit, either the full path to the
-     executable or the string "git" to let Emacs find the executable
-     itself, using the standard mechanism for doing such things.
-
-‘M-x magit-debug-git-executable’     (‘magit-debug-git-executable’)
-
-     Display a buffer with information about ‘magit-git-executable’.
-
-
-File: magit.info,  Node: Global Git Arguments,  Prev: Git Executable,  Up: Running Git
-
-4.5.4 Global Git Arguments
---------------------------
-
- -- User Option: magit-git-global-arguments
-
-     The arguments set here are used every time the git executable is
-     run as a subprocess.  They are placed right after the executable
-     itself and before the git command - as in ‘git HERE... COMMAND
-     REST’.  For valid arguments see *note (gitman)git::.
-
-     Be careful what you add here, especially if you are using Tramp to
-     connect to servers with ancient Git versions.  Never remove
-     anything that is part of the default value, unless you really know
-     what you are doing.  And think very hard before adding something;
-     it will be used every time Magit runs Git for any purpose.
-
-
-File: magit.info,  Node: Inspecting,  Next: Manipulating,  Prev: Interface Concepts,  Up: Top
-
-5 Inspecting
-************
-
-The functionality provided by Magit can be roughly divided into three
-groups: inspecting existing data, manipulating existing data or adding
-new data, and transferring data.  Of course that is a rather crude
-distinction that often falls short, but it’s more useful than no
-distinction at all.  This section is concerned with inspecting data, the
-next two with manipulating and transferring it.  Then follows a section
-about miscellaneous functionality, which cannot easily be fit into this
-distinction.
-
-   Of course other distinctions make sense too, e.g.  Git’s distinction
-between porcelain and plumbing commands, which for the most part is
-equivalent to Emacs’ distinction between interactive commands and
-non-interactive functions.  All of the sections mentioned before are
-mainly concerned with the porcelain – Magit’s plumbing layer is
-described later.
-
-* Menu:
-
-* Status Buffer::
-* Repository List::
-* Logging::
-* Diffing::
-* Ediffing::
-* References Buffer::
-* Bisecting::
-* Visiting Blobs::
-* Blaming::
-
-
-File: magit.info,  Node: Status Buffer,  Next: Repository List,  Up: Inspecting
-
-5.1 Status Buffer
-=================
-
-While other Magit buffers contain e.g.  one particular diff or one
-particular log, the status buffer contains the diffs for staged and
-unstaged changes, logs for unpushed and unpulled commits, lists of
-stashes and untracked files, and information related to the current
-branch.
-
-   During certain incomplete operations – for example when a merge
-resulted in a conflict – additional information is displayed that helps
-proceeding with or aborting the operation.
-
-   The command ‘magit-status’ displays the status buffer belonging to
-the current repository in another window.  This command is used so often
-that it should be bound globally.  We recommend using ‘C-x g’:
-
-     (global-set-key (kbd "C-x g") 'magit-status)
-
-‘C-x g’     (‘magit-status’)
-
-     Show the status of the current Git repository in a buffer.  With a
-     prefix argument prompt for a repository to be shown.  With two
-     prefix arguments prompt for an arbitrary directory.  If that
-     directory isn’t the root of an existing repository, then offer to
-     initialize it as a new repository.
-
- -- User Option: magit-repository-directories
-
-     List of directories that are or contain Git repositories.  Each
-     element has the form ‘(DIRECTORY . DEPTH)’ or, for backward
-     compatibility, just DIRECTORY. DIRECTORY has to be a directory or a
-     directory file-name, a string.  DEPTH, an integer, specifies the
-     maximum depth to look for Git repositories.  If it is 0, then only
-     add DIRECTORY itself.  For elements that are strings, the value of
-     option ‘magit-repository-directories-depth’ specifies the depth.
-
- -- User Option: magit-repository-directories-depth
-
-     The maximum depth to look for Git repositories.  This option is
-     obsolete and only used for elements of the option
-     ‘magit-repository-directories’ (which see) that don’t specify the
-     depth directly.
-
- -- Command: ido-enter-magit-status
-
-     From an Ido prompt used to open a file, instead drop into
-     ‘magit-status’.  This is similar to ‘ido-magic-delete-char’, which,
-     despite its name, usually causes a Dired buffer to be created.
-
-     To make this command available, use something like:
-
-          (add-hook 'ido-setup-hook
-                    (lambda ()
-                      (define-key ido-completion-map
-                        (kbd \"C-x g\") 'ido-enter-magit-status)))
-
-     Starting with Emacs 25.1 the Ido keymaps are defined just once
-     instead of every time Ido is invoked, so now you can modify it like
-     pretty much every other keymap:
-
-          (define-key ido-common-completion-map
-            (kbd \"C-x g\") 'ido-enter-magit-status)
-
-* Menu:
-
-* Status Sections::
-* Status Header Sections::
-* Status Module Sections::
-* Status Options::
-
-
-File: magit.info,  Node: Status Sections,  Next: Status Header Sections,  Up: Status Buffer
-
-5.1.1 Status Sections
----------------------
-
-The contents of status buffers is controlled using the hook
-‘magit-status-sections-hook’.  See *note Section Hooks:: to learn about
-such hooks and how to customize them.
-
- -- User Option: magit-status-sections-hook
-
-     Hook run to insert sections into a status buffer.
-
-   The first function on that hook by default is
-‘magit-insert-status-headers’; it is described in the next section.  By
-default the following functions are also members of that hook:
-
- -- Function: magit-insert-merge-log
-
-     Insert section for the on-going merge.  Display the heads that are
-     being merged.  If no merge is in progress, do nothing.
-
- -- Function: magit-insert-rebase-sequence
-
-     Insert section for the on-going rebase sequence.  If no such
-     sequence is in progress, do nothing.
-
- -- Function: magit-insert-am-sequence
-
-     Insert section for the on-going patch applying sequence.  If no
-     such sequence is in progress, do nothing.
-
- -- Function: magit-insert-sequencer-sequence
-
-     Insert section for the on-going cherry-pick or revert sequence.  If
-     no such sequence is in progress, do nothing.
-
- -- Function: magit-insert-bisect-output
-
-     While bisecting, insert section with output from ‘git bisect’.
-
- -- Function: magit-insert-bisect-rest
-
-     While bisecting, insert section visualizing the bisect state.
-
- -- Function: magit-insert-bisect-log
-
-     While bisecting, insert section logging bisect progress.
-
- -- Function: magit-insert-untracked-files
-
-     Maybe insert a list or tree of untracked files.
-
-     Do so depending on the value of ‘status.showUntrackedFiles’.  Note
-     that even if the value is ‘all’, Magit still initially only shows
-     directories.  But the directory sections can then be expanded using
-     ‘TAB’.
-
- -- Function: magit-insert-unstaged-changes
-
-     Insert section showing unstaged changes.
-
- -- Function: magit-insert-staged-changes
-
-     Insert section showing staged changes.
-
- -- Function: magit-insert-stashes &optional ref heading
-
-     Insert the ‘stashes’ section showing reflog for "refs/stash".  If
-     optional REF is non-nil show reflog for that instead.  If optional
-     HEADING is non-nil use that as section heading instead of
-     "Stashes:".
-
- -- Function: magit-insert-unpulled-from-upstream
-
-     Insert section showing commits that haven’t been pulled from the
-     upstream branch yet.
-
- -- Function: magit-insert-unpulled-from-pushremote
-
-     Insert section showing commits that haven’t been pulled from the
-     push-remote branch yet.
-
- -- Function: magit-insert-unpushed-to-upstream
-
-     Insert section showing commits that haven’t been pushed to the
-     upstream yet.
-
- -- Function: magit-insert-unpushed-to-pushremote
-
-     Insert section showing commits that haven’t been pushed to the
-     push-remote yet.
-
-   The following functions can also be added to the above hook:
-
- -- Function: magit-insert-tracked-files
-
-     Insert a tree of tracked files.
-
- -- Function: magit-insert-unpulled-or-recent-commits
-
-     Insert section showing unpulled or recent commits.  If an upstream
-     is configured for the current branch and it is ahead of the current
-     branch, then show the missing commits.  Otherwise, show the last
-     ‘magit-log-section-commit-count’ commits.
-
- -- Function: magit-insert-recent-commits
-
-     Insert section showing the last ‘magit-log-section-commit-count’
-     commits.
-
- -- User Option: magit-log-section-commit-count
-
-     How many recent commits ‘magit-insert-recent-commits’ and
-     ‘magit-insert-unpulled-or-recent-commits’ (provided there are no
-     unpulled commits) show.
-
- -- Function: magit-insert-unpulled-cherries
-
-     Insert section showing unpulled commits.  Like
-     ‘magit-insert-unpulled-commits’ but prefix each commit that has not
-     been applied yet (i.e.  a commit with a patch-id not shared with
-     any local commit) with "+", and all others with "-".
-
- -- Function: magit-insert-unpushed-cherries
-
-     Insert section showing unpushed commits.  Like
-     ‘magit-insert-unpushed-commits’ but prefix each commit which has
-     not been applied to upstream yet (i.e.  a commit with a patch-id
-     not shared with any upstream commit) with "+" and all others with
-     "-".
-
-   See *note References Buffer:: for some more section inserters, which
-could be used here.
-
-
-File: magit.info,  Node: Status Header Sections,  Next: Status Module Sections,  Prev: Status Sections,  Up: Status Buffer
-
-5.1.2 Status Header Sections
-----------------------------
-
-The contents of status buffers is controlled using the hook
-‘magit-status-sections-hook’ (see *note Status Sections::).
-
-   By default ‘magit-insert-status-headers’ is the first member of that
-hook variable.
-
- -- Function: magit-insert-status-headers
-
-     Insert headers sections appropriate for ‘magit-status-mode’
-     buffers.  The sections are inserted by running the functions on the
-     hook ‘magit-status-headers-hook’.
-
- -- User Option: magit-status-headers-hook
-
-     Hook run to insert headers sections into the status buffer.
-
-     This hook is run by ‘magit-insert-status-headers’, which in turn
-     has to be a member of ‘magit-status-sections-hook’ to be used at
-     all.
-
-   By default the following functions are members of the above hook:
-
- -- Function: magit-insert-error-header
-
-     Insert a header line showing the message about the Git error that
-     just occurred.
-
-     This function is only aware of the last error that occur when Git
-     was run for side-effects.  If, for example, an error occurs while
-     generating a diff, then that error won’t be inserted.  Refreshing
-     the status buffer causes this section to disappear again.
-
- -- Function: magit-insert-diff-filter-header
-
-     Insert a header line showing the effective diff filters.
-
- -- Function: magit-insert-head-branch-header
-
-     Insert a header line about the current branch or detached ‘HEAD’.
-
- -- Function: magit-insert-upstream-branch-header
-
-     Insert a header line about the branch that is usually pulled into
-     the current branch.
-
- -- Function: magit-insert-push-branch-header
-
-     Insert a header line about the branch that the current branch is
-     usually pushed to.
-
- -- Function: magit-insert-tags-header
-
-     Insert a header line about the current and/or next tag.
-
-   The following functions can also be added to the above hook:
-
- -- Function: magit-insert-repo-header
-
-     Insert a header line showing the path to the repository top-level.
-
- -- Function: magit-insert-remote-header
-
-     Insert a header line about the remote of the current branch.
-
-     If no remote is configured for the current branch, then fall back
-     showing the "origin" remote, or if that does not exist the first
-     remote in alphabetic order.
-
- -- Function: magit-insert-user-header
-
-     Insert a header line about the current user.
-
-
-File: magit.info,  Node: Status Module Sections,  Next: Status Options,  Prev: Status Header Sections,  Up: Status Buffer
-
-5.1.3 Status Module Sections
-----------------------------
-
-The contents of status buffers is controlled using the hook
-‘magit-status-sections-hook’ (see *note Status Sections::).
-
-   By default ‘magit-insert-modules’ is _not_ a member of that hook
-variable.
-
- -- Function: magit-insert-modules
-
-     Insert submodule sections.
-
-     Hook ‘magit-module-sections-hook’ controls which module sections
-     are inserted, and option ‘magit-insert-modules-nested’ controls
-     whether they are wrapped in an additional section.
-
-   • Option: magit-module-sections-hook
-
-     Hook run by ‘magit-insert-modules’.
-
-   • Option: magit-module-sections-nested
-
-     This option controls whether ‘magit-insert-modules’ wraps inserted
-     sections in an additional section.
-
-     If this is non-nil, then only a single top-level section is
-     inserted.  If it is nil, then all sections listed in
-     ‘magit-module-sections-hook’ become top-level sections.
-
- -- Function: magit-insert-modules-overview
-
-     Insert sections for all submodules.  For each section insert the
-     path, the branch, and the output of ‘git describe --tags’.
-
-     Press ‘RET’ on such a submodule section to show its own status
-     buffer.  Press ‘RET’ on the "Modules" section to display a list of
-     submodules in a separate buffer.  This shows additional information
-     not displayed in the super-repository’s status buffer.
-
- -- Function: magit-insert-modules-unpulled-from-upstream
-
-     Insert sections for modules that haven’t been pulled from the
-     upstream yet.  These sections can be expanded to show the
-     respective commits.
-
- -- Function: magit-insert-modules-unpulled-from-pushremote
-
-     Insert sections for modules that haven’t been pulled from the
-     push-remote yet.  These sections can be expanded to show the
-     respective commits.
-
- -- Function: magit-insert-modules-unpushed-to-upstream
-
-     Insert sections for modules that haven’t been pushed to the
-     upstream yet.  These sections can be expanded to show the
-     respective commits.
-
- -- Function: magit-insert-modules-unpushed-to-pushremote
-
-     Insert sections for modules that haven’t been pushed to the
-     push-remote yet.  These sections can be expanded to show the
-     respective commits.
-
-
-File: magit.info,  Node: Status Options,  Prev: Status Module Sections,  Up: Status Buffer
-
-5.1.4 Status Options
---------------------
-
- -- User Option: magit-status-refresh-hook
-
-     Hook run after a status buffer has been refreshed.
-
- -- User Option: magit-status-margin
-
-     This option specifies whether the margin is initially shown in
-     Magit-Status mode buffers and how it is formatted.
-
-     The value has the form ‘(INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH)’.
-
-        • If INIT is non-nil, then the margin is shown initially.
-
-        • STYLE controls how to format the committer date.  It can be
-          one of ‘age’ (to show the age of the commit),
-          ‘age-abbreviated’ (to abbreviate the time unit to a
-          character), or a string (suitable for ‘format-time-string’) to
-          show the actual date.
-
-        • WIDTH controls the width of the margin.  This exists for
-          forward compatibility and currently the value should not be
-          changed.
-
-        • AUTHOR controls whether the name of the author is also shown
-          by default.
-
-        • AUTHOR-WIDTH has to be an integer.  When the name of the
-          author is shown, then this specifies how much space is used to
-          do so.
-
- -- User Option: magit-log-section-args
-
-     Additional Git arguments used when creating log sections.  Only
-     ‘--graph’, ‘--decorate’, and ‘--show-signature’ are supported.
-     This option is only a temporary kludge and will be removed.
-
-     Note that due to an issue in Git the use of ‘--graph’ is very slow
-     with long histories, so you probably don’t want to add this here.
-
-   Also see the proceeding section for more options concerning status
-buffers.
-
-
-File: magit.info,  Node: Repository List,  Next: Logging,  Prev: Status Buffer,  Up: Inspecting
-
-5.2 Repository List
-===================
-
- -- Command: magit-list-repositories
-
-     This command displays a list of repositories in a separate buffer.
-
-     The options ‘magit-repository-directories’ and
-     ‘magit-repository-directories-depth’ control which repositories are
-     displayed.
-
- -- User Option: magit-repolist-columns
-
-     This option controls what columns are displayed by the command
-     ‘magit-list-repositories’ and how they are displayed.
-
-     Each element has the form ‘(HEADER WIDTH FORMAT PROPS)’.
-
-     HEADER is the string displayed in the header.  WIDTH is the width
-     of the column.  FORMAT is a function that is called with one
-     argument, the repository identification (usually its basename), and
-     with ‘default-directory’ bound to the toplevel of its working tree.
-     It has to return a string to be inserted or nil.  PROPS is an alist
-     that supports the keys ‘:right-align’ and ‘:pad-right’.
-
-   The following functions can be added to the above option:
-
- -- Function: magit-repolist-column-ident
-
-     This function inserts the identification of the repository.
-     Usually this is just its basename.
-
- -- Function: magit-repolist-column-path
-
-     This function inserts the absolute path of the repository.
-
- -- Function: magit-repolist-column-version
-
-     This function inserts a description of the repository’s ‘HEAD’
-     revision.
-
- -- Function: magit-repolist-column-unpulled-from-upstream
-
-     This function inserts the number of upstream commits not in the
-     current branch.
-
- -- Function: magit-repolist-column-unpulled-from-pushremote
-
-     This function inserts the number of commits in the push branch but
-     not the current branch.
-
- -- Function: magit-repolist-column-unpushed-to-upstream
-
-     This function inserts the number of commits in the current branch
-     but not its upstream.
-
- -- Function: magit-repolist-column-unpushed-to-pushremote
-
-     This function inserts the number of commits in the current branch
-     but not its push branch.
-
-
-File: magit.info,  Node: Logging,  Next: Diffing,  Prev: Repository List,  Up: Inspecting
-
-5.3 Logging
-===========
-
-The status buffer contains logs for the unpushed and unpulled commits,
-but that obviously isn’t enough.  The prefix command ‘magit-log-popup’,
-on ‘l’, features several suffix commands, which show a specific log in a
-separate log buffer.
-
-   Like other popups, the log popup also features several arguments that
-can be changed before invoking one of the suffix commands.  However, in
-the case of the log popup, these arguments may be taken from those
-currently in use in the current repository’s log buffer, depending on
-the value of ‘magit-use-sticky-arguments’ (see *note Popup Buffers and
-Prefix Commands::).
-
-   For information about the various arguments, see *note
-(gitman)git-log::.
-
-   The switch ‘++order=VALUE’ is converted to one of
-‘--author-date-order’, ‘--date-order’, or ‘--topo-order’ before being
-passed to ‘git log’.
-
-   The log popup also features several reflog commands.  See *note
-Reflog::.
-
-‘l’     (‘magit-log-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘l l’     (‘magit-log-current’)
-
-     Show log for the current branch.  When ‘HEAD’ is detached or with a
-     prefix argument, show log for one or more revs read from the
-     minibuffer.
-
-‘l o’     (‘magit-log’)
-
-     Show log for one or more revs read from the minibuffer.  The user
-     can input any revision or revisions separated by a space, or even
-     ranges, but only branches, tags, and a representation of the commit
-     at point are available as completion candidates.
-
-‘l h’     (‘magit-log-head’)
-
-     Show log for ‘HEAD’.
-
-‘l L’     (‘magit-log-branches’)
-
-     Show log for all local branches and ‘HEAD’.
-
-‘l b’     (‘magit-log-all-branches’)
-
-     Show log for all local and remote branches and ‘HEAD’.
-
-‘l a’     (‘magit-log-all’)
-
-     Show log for all references and ‘HEAD’.
-
-   Two additional commands that show the log for the file or blob that
-is being visited in the current buffer exists, see *note Minor Mode for
-Buffers Visiting Files::.  The command ‘magit-cherry’ also shows a log,
-see *note Cherries::.
-
-* Menu:
-
-* Refreshing Logs::
-* Log Buffer::
-* Log Margin::
-* Select from Log::
-* Reflog::
-* Cherries::
-
-
-File: magit.info,  Node: Refreshing Logs,  Next: Log Buffer,  Up: Logging
-
-5.3.1 Refreshing Logs
----------------------
-
-The prefix command ‘magit-log-refresh-popup’, on ‘L’, can be used to
-change the log arguments used in the current buffer, without changing
-which log is shown.  This works in dedicated log buffers, but also in
-the status buffer.
-
-‘L’     (‘magit-log-refresh-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘L g’     (‘magit-log-refresh’)
-
-     This suffix command sets the local log arguments for the current
-     buffer.
-
-‘L s’     (‘magit-log-set-default-arguments’)
-
-     This suffix command sets the default log arguments for buffers of
-     the same type as that of the current buffer.  Other existing
-     buffers of the same type are not affected because their local
-     values have already been initialized.
-
-‘L w’     (‘magit-log-save-default-arguments’)
-
-     This suffix command sets the default log arguments for buffers of
-     the same type as that of the current buffer, and saves the value
-     for future sessions.  Other existing buffers of the same type are
-     not affected because their local values have already been
-     initialized.
-
-‘L t’     (‘magit-toggle-margin’)
-
-     Show or hide the margin.
-
-
-File: magit.info,  Node: Log Buffer,  Next: Log Margin,  Prev: Refreshing Logs,  Up: Logging
-
-5.3.2 Log Buffer
-----------------
-
-‘L’     (‘magit-log-refresh-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.  See *note
-     Refreshing Logs::.
-
-‘q’     (‘magit-log-bury-buffer’)
-
-     Bury the current buffer or the revision buffer in the same frame.
-     Like ‘magit-mode-bury-buffer’ (which see) but with a negative
-     prefix argument instead bury the revision buffer, provided it is
-     displayed in the current frame.
-
-‘C-c C-b’     (‘magit-go-backward’)
-
-     Move backward in current buffer’s history.
-
-‘C-c C-f’     (‘magit-go-forward’)
-
-     Move forward in current buffer’s history.
-
-‘C-c C-n’     (‘magit-log-move-to-parent’)
-
-     Move to a parent of the current commit.  By default, this is the
-     first parent, but a numeric prefix can be used to specify another
-     parent.
-
-‘SPC’     (‘magit-diff-show-or-scroll-up’)
-
-     Update the commit or diff buffer for the thing at point.
-
-     Either show the commit or stash at point in the appropriate buffer,
-     or if that buffer is already being displayed in the current frame
-     and contains information about that commit or stash, then instead
-     scroll the buffer up.  If there is no commit or stash at point,
-     then prompt for a commit.
-
-‘DEL’     (‘magit-diff-show-or-scroll-down’)
-
-     Update the commit or diff buffer for the thing at point.
-
-     Either show the commit or stash at point in the appropriate buffer,
-     or if that buffer is already being displayed in the current frame
-     and contains information about that commit or stash, then instead
-     scroll the buffer down.  If there is no commit or stash at point,
-     then prompt for a commit.
-
-‘=’     (‘magit-log-toggle-commit-limit’)
-
-     Toggle the number of commits the current log buffer is limited to.
-     If the number of commits is currently limited, then remove that
-     limit.  Otherwise set it to 256.
-
-‘+’     (‘magit-log-double-commit-limit’)
-
-     Double the number of commits the current log buffer is limited to.
-
-‘-’     (‘magit-log-half-commit-limit’)
-
-     Half the number of commits the current log buffer is limited to.
-
- -- User Option: magit-log-auto-more
-
-     Insert more log entries automatically when moving past the last
-     entry.  Only considered when moving past the last entry with
-     ‘magit-goto-*-section’ commands.
-
- -- User Option: magit-log-show-refname-after-summary
-
-     Whether to show the refnames after the commit summaries.  This is
-     useful if you use really long branch names.
-
-   For a description of ‘magit-log-margin’ see *note Log Margin::.
-
-
-File: magit.info,  Node: Log Margin,  Next: Select from Log,  Prev: Log Buffer,  Up: Logging
-
-5.3.3 Log Margin
-----------------
-
-In buffers which show one or more logs, it is possible to show
-additional information about each commit in the margin.  The options
-used to configure the margin are named ‘magit-INFIX-margin’, where INFIX
-is the same as in the respective major-mode ‘magit-INFIX-mode’.  In
-regular log buffers that would be ‘magit-log-margin’.
-
- -- User Option: magit-log-margin
-
-     This option specifies whether the margin is initially shown in
-     Magit-Log mode buffers and how it is formatted.
-
-     The value has the form ‘(INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH)’.
-
-        • If INIT is non-nil, then the margin is shown initially.
-
-        • STYLE controls how to format the committer date.  It can be
-          one of ‘age’ (to show the age of the commit),
-          ‘age-abbreviated’ (to abbreviate the time unit to a
-          character), or a string (suitable for ‘format-time-string’) to
-          show the actual date.
-
-        • WIDTH controls the width of the margin.  This exists for
-          forward compatibility and currently the value should not be
-          changed.
-
-        • AUTHOR controls whether the name of the author is also shown
-          by default.
-
-        • AUTHOR-WIDTH has to be an integer.  When the name of the
-          author is shown, then this specifies how much space is used to
-          do so.
-
-   You can change the STYLE and AUTHOR-WIDTH of all ‘magit-INFIX-margin’
-options to the same values by customizing ‘magit-log-margin’ *before*
-‘magit’ is loaded.  If you do that, then the respective values for the
-other options will default to what you have set for that variable.
-Likewise if you set INIT in ‘magit-log-margin’ to ‘nil’, then that is
-used in the default of all other options.  But setting it to ‘t’, i.e.
-re-enforcing the default for that option, does not carry to other
-options.
-
-‘L’     (‘magit-margin-popup’)
-
-     This prefix command features the following commands for changing
-     the appearance of the margin.
-
-   In some buffers that support the margin, "L" is bound to
-‘magit-log-refresh-popup’, but that popup features the same commands,
-and then some other unrelated commands.
-
-‘L L’     (‘magit-toggle-margin’)
-
-     This command shows or hides the margin.
-
-‘L l’     (‘magit-cycle-margin-style’)
-
-     This command cycles the style used for the margin.
-
-‘L d’     (‘magit-toggle-margin-details’)
-
-     This command shows or hides details in the margin.
-
-
-File: magit.info,  Node: Select from Log,  Next: Reflog,  Prev: Log Margin,  Up: Logging
-
-5.3.4 Select from Log
----------------------
-
-When the user has to select a recent commit that is reachable from
-‘HEAD’, using regular completion would be inconvenient (because most
-humans cannot remember hashes or "HEAD~5", at least not without double
-checking).  Instead a log buffer is used to select the commit, which has
-the advantage that commits are presented in order and with the commit
-message.
-
-   Such selection logs are used when selecting the beginning of a rebase
-and when selecting the commit to be squashed into.
-
-   In addition to the key bindings available in all log buffers, the
-following additional key bindings are available in selection log
-buffers:
-
-‘C-c C-c’     (‘magit-log-select-pick’)
-
-     Select the commit at point and act on it.  Call
-     ‘magit-log-select-pick-function’ with the selected commit as
-     argument.
-
-‘C-c C-k’     (‘magit-log-select-quit’)
-
-     Abort selecting a commit, don’t act on any commit.
-
- -- User Option: magit-log-select-margin
-
-     This option specifies whether the margin is initially shown in
-     Magit-Log-Select mode buffers and how it is formatted.
-
-     The value has the form ‘(INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH)’.
-
-        • If INIT is non-nil, then the margin is shown initially.
-
-        • STYLE controls how to format the committer date.  It can be
-          one of ‘age’ (to show the age of the commit),
-          ‘age-abbreviated’ (to abbreviate the time unit to a
-          character), or a string (suitable for ‘format-time-string’) to
-          show the actual date.
-
-        • WIDTH controls the width of the margin.  This exists for
-          forward compatibility and currently the value should not be
-          changed.
-
-        • AUTHOR controls whether the name of the author is also shown
-          by default.
-
-        • AUTHOR-WIDTH has to be an integer.  When the name of the
-          author is shown, then this specifies how much space is used to
-          do so.
-
-
-File: magit.info,  Node: Reflog,  Next: Cherries,  Prev: Select from Log,  Up: Logging
-
-5.3.5 Reflog
-------------
-
-Also see *note (gitman)git-reflog::.
-
-   These reflog commands are available from the log popup.  See *note
-Logging::.
-
-‘l r’     (‘magit-reflog-current’)
-
-     Display the reflog of the current branch.
-
-‘l O’     (‘magit-reflog-other’)
-
-     Display the reflog of a branch.
-
-‘l H’     (‘magit-reflog-head’)
-
-     Display the ‘HEAD’ reflog.
-
- -- User Option: magit-reflog-margin
-
-     This option specifies whether the margin is initially shown in
-     Magit-Reflog mode buffers and how it is formatted.
-
-     The value has the form ‘(INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH)’.
-
-        • If INIT is non-nil, then the margin is shown initially.
-
-        • STYLE controls how to format the committer date.  It can be
-          one of ‘age’ (to show the age of the commit),
-          ‘age-abbreviated’ (to abbreviate the time unit to a
-          character), or a string (suitable for ‘format-time-string’) to
-          show the actual date.
-
-        • WIDTH controls the width of the margin.  This exists for
-          forward compatibility and currently the value should not be
-          changed.
-
-        • AUTHOR controls whether the name of the author is also shown
-          by default.
-
-        • AUTHOR-WIDTH has to be an integer.  When the name of the
-          author is shown, then this specifies how much space is used to
-          do so.
-
-
-File: magit.info,  Node: Cherries,  Prev: Reflog,  Up: Logging
-
-5.3.6 Cherries
---------------
-
-Cherries are commits that haven’t been applied upstream (yet), and are
-usually visualized using a log.  Each commit is prefixed with ‘-’ if it
-has an equivalent in the upstream and ‘+’ if it does not, i.e.  if it is
-a cherry.
-
-   The command ‘magit-cherry’ shows cherries for a single branch, but
-the references buffer (see *note References Buffer::) can show cherries
-for multiple "upstreams" at once.
-
-   Also see *note (gitman)git-reflog::.
-
-‘Y’     (‘magit-cherry’)
-
-     Show commits that are in a certain branch but that have not been
-     merged in the upstream branch.
-
- -- User Option: magit-cherry-margin
-
-     This option specifies whether the margin is initially shown in
-     Magit-Cherry mode buffers and how it is formatted.
-
-     The value has the form ‘(INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH)’.
-
-        • If INIT is non-nil, then the margin is shown initially.
-
-        • STYLE controls how to format the committer date.  It can be
-          one of ‘age’ (to show the age of the commit),
-          ‘age-abbreviated’ (to abbreviate the time unit to a
-          character), or a string (suitable for ‘format-time-string’) to
-          show the actual date.
-
-        • WIDTH controls the width of the margin.  This exists for
-          forward compatibility and currently the value should not be
-          changed.
-
-        • AUTHOR controls whether the name of the author is also shown
-          by default.
-
-        • AUTHOR-WIDTH has to be an integer.  When the name of the
-          author is shown, then this specifies how much space is used to
-          do so.
-
-
-File: magit.info,  Node: Diffing,  Next: Ediffing,  Prev: Logging,  Up: Inspecting
-
-5.4 Diffing
-===========
-
-The status buffer contains diffs for the staged and unstaged commits,
-but that obviously isn’t enough.  The prefix command ‘magit-diff-popup’,
-on ‘d’, features several suffix commands, which show a specific diff in
-a separate diff buffer.
-
-   Like other popups, the diff popup also features several arguments
-that can be changed before invoking one of the suffix commands.
-However, in the case of the diff popup, these arguments may be taken
-from those currently in use in the current repository’s log buffer,
-depending on the value of ‘magit-use-sticky-arguments’ (see *note Popup
-Buffers and Prefix Commands::).
-
-   Also see *note (gitman)git-diff::.
-
-‘d’     (‘magit-diff-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘d d’     (‘magit-diff-dwim’)
-
-     Show changes for the thing at point.
-
-‘d r’     (‘magit-diff’)
-
-     Show differences between two commits.
-
-     RANGE should be a range (A..B or A…B) but can also be a single
-     commit.  If one side of the range is omitted, then it defaults to
-     ‘HEAD’.  If just a commit is given, then changes in the working
-     tree relative to that commit are shown.
-
-     If the region is active, use the revisions on the first and last
-     line of the region.  With a prefix argument, instead of diffing the
-     revisions, choose a revision to view changes along, starting at the
-     common ancestor of both revisions (i.e., use a "…" range).
-
-‘d w’     (‘magit-diff-working-tree’)
-
-     Show changes between the current working tree and the ‘HEAD’
-     commit.  With a prefix argument show changes between the working
-     tree and a commit read from the minibuffer.
-
-‘d s’     (‘magit-diff-staged’)
-
-     Show changes between the index and the ‘HEAD’ commit.  With a
-     prefix argument show changes between the index and a commit read
-     from the minibuffer.
-
-‘d u’     (‘magit-diff-unstaged’)
-
-     Show changes between the working tree and the index.
-
-‘d p’     (‘magit-diff-paths’)
-
-     Show changes between any two files on disk.
-
-   All of the above suffix commands update the repository’s diff buffer.
-The diff popup also features two commands which show differences in
-another buffer:
-
-‘d c’     (‘magit-show-commit’)
-
-     Show the commit at point.  If there is no commit at point or with a
-     prefix argument, prompt for a commit.
-
-‘d t’     (‘magit-stash-show’)
-
-     Show all diffs of a stash in a buffer.
-
-   Two additional commands that show the diff for the file or blob that
-is being visited in the current buffer exists, see *note Minor Mode for
-Buffers Visiting Files::.
-
-* Menu:
-
-* Refreshing Diffs::
-* Diff Buffer::
-* Diff Options::
-* Revision Buffer::
-
-
-File: magit.info,  Node: Refreshing Diffs,  Next: Diff Buffer,  Up: Diffing
-
-5.4.1 Refreshing Diffs
-----------------------
-
-The prefix command ‘magit-diff-refresh-popup’, on ‘D’, can be used to
-change the diff arguments used in the current buffer, without changing
-which diff is shown.  This works in dedicated diff buffers, but also in
-the status buffer.
-
-‘D’     (‘magit-diff-refresh-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘D g’     (‘magit-diff-refresh’)
-
-     This suffix command sets the local diff arguments for the current
-     buffer.
-
-‘D s’     (‘magit-diff-set-default-arguments’)
-
-     This suffix command sets the default diff arguments for buffers of
-     the same type as that of the current buffer.  Other existing
-     buffers of the same type are not affected because their local
-     values have already been initialized.
-
-‘D w’     (‘magit-diff-save-default-arguments’)
-
-     This suffix command sets the default diff arguments for buffers of
-     the same type as that of the current buffer, and saves the value
-     for future sessions.  Other existing buffers of the same type are
-     not affected because their local values have already been
-     initialized.
-
-‘D t’     (‘magit-diff-toggle-refine-hunk’)
-
-     This command toggles hunk refinement on or off.
-
-‘D r’     (‘magit-diff-switch-range-type’)
-
-     This command converts the diff range type from "revA..revB" to
-     "revB…revA", or vice versa.
-
-‘D f’     (‘magit-diff-flip-revs’)
-
-     This command swaps revisions in the diff range from "revA..revB" to
-     "revB..revA", or vice versa.
-
-‘D F’     (‘magit-diff-toggle-file-filter’)
-
-     This command toggles the file restriction of the diffs in the
-     current buffer, allowing you to quickly switch between viewing all
-     the changes in the commit and the restricted subset.  As a special
-     case, when this command is called from a log buffer, it toggles the
-     file restriction in the repository’s revision buffer, which is
-     useful when you display a revision from a log buffer that is
-     restricted to a file or files.
-
-   In addition to the above popup, which allows changing any of the
-supported arguments, there also exist some commands which change a
-particular argument.
-
-‘-’     (‘magit-diff-less-context’)
-
-     This command decreases the context for diff hunks by COUNT lines.
-
-‘+’     (‘magit-diff-more-context’)
-
-     This command increases the context for diff hunks by COUNT lines.
-
-‘0’     (‘magit-diff-default-context’)
-
-     This command resets the context for diff hunks to the default
-     height.
-
-   The following commands quickly change what diff is being displayed
-without having to using one of the diff popups.
-
-‘C-c C-d’     (‘magit-diff-while-committing’)
-
-     While committing, this command shows the changes that are about to
-     be committed.  While amending, invoking the command again toggles
-     between showing just the new changes or all the changes that will
-     be committed.
-
-     This binding is available in the diff buffer as well as the commit
-     message buffer.
-
-‘C-c C-b’     (‘magit-go-backward’)
-
-     This command moves backward in current buffer’s history.
-
-‘C-c C-f’     (‘magit-go-forward’)
-
-     This command moves forward in current buffer’s history.
-
-
-File: magit.info,  Node: Diff Buffer,  Next: Diff Options,  Prev: Refreshing Diffs,  Up: Diffing
-
-5.4.2 Diff Buffer
------------------
-
-‘RET’     (‘magit-diff-visit-file’)
-
-     From a diff, visit the corresponding file at the appropriate
-     position.
-
-     If the diff shows changes in the worktree, the index, or ‘HEAD’,
-     then visit the actual file.  Otherwise, when the diff is about an
-     older commit or a range, then visit the appropriate blob.
-
-     If point is on a removed line, then visit the blob for the first
-     parent of the commit which removed that line, i.e.  the last commit
-     where that line still existed.  Otherwise visit the blob for the
-     commit whose changes are being shown.
-
-     When the file or blob to be displayed is already being displayed in
-     another window of the same frame, then just select that window and
-     adjust point.  Otherwise, or with a prefix argument, display the
-     buffer in another window.
-
- -- User Option: magit-diff-visit-previous-blob
-
-     This option controls whether ‘magit-diff-visit-file’ may visit the
-     previous blob.  When this is ‘t’ and point is on a removed line in
-     a diff for a committed change, then ‘magit-diff-visit-file’ visits
-     the blob from the last revision which still had that line.
-
-     Currently this is only supported for committed changes, for staged
-     and unstaged changes ‘magit-diff-visit-file’ always visits the file
-     in the working tree.
-
-‘C-<return>’     (‘magit-diff-visit-file-worktree’)
-
-     From a diff, visit the corresponding file at the appropriate
-     position.
-
-     When the file is already being displayed in another window of the
-     same frame, then just select that window and adjust point.  With a
-     prefix argument also display in another window.
-
-     The actual file in the worktree is visited.  The positions in the
-     hunk headers get less useful the "older" the changes are, and as a
-     result, jumping to the appropriate position gets less reliable.
-
-     Also see ‘magit-diff-visit-file’, which visits the respective blob,
-     unless the diff shows changes in the worktree, the index, or
-     ‘HEAD’.
-
-‘j’     (‘magit-jump-to-diffstat-or-diff’)
-
-     Jump to the diffstat or diff.  When point is on a file inside the
-     diffstat section, then jump to the respective diff section.
-     Otherwise, jump to the diffstat section or a child thereof.
-
-‘SPC’     (‘scroll-up’)
-
-     Scroll text upward.
-
-‘DEL’     (‘scroll-down’)
-
-     Scroll text downward.
-
-
-File: magit.info,  Node: Diff Options,  Next: Revision Buffer,  Prev: Diff Buffer,  Up: Diffing
-
-5.4.3 Diff Options
-------------------
-
- -- User Option: magit-diff-refine-hunk
-
-     Whether to show word-granularity differences within diff hunks.
-
-        • ‘nil’ never show fine differences.
-
-        • ‘t’ show fine differences for the current diff hunk only.
-
-        • ‘all’ show fine differences for all displayed diff hunks.
-
- -- User Option: magit-diff-paint-whitespace
-
-     Specify where to highlight whitespace errors.
-
-     See ‘magit-diff-highlight-trailing’,
-     ‘magit-diff-highlight-indentation’.  The symbol ‘t’ means in all
-     diffs, ‘status’ means only in the status buffer, and nil means
-     nowhere.
-
- -- User Option: magit-diff-highlight-trailing
-
-     Whether to highlight whitespace at the end of a line in diffs.
-     Used only when ‘magit-diff-paint-whitespace’ is non-nil.
-
- -- User Option: magit-diff-highlight-indentation
-
-     Highlight the "wrong" indentation style.  Used only when
-     ‘magit-diff-paint-whitespace’ is non-nil.
-
-     The value is a list of cons cells.  The car is a regular
-     expression, and the cdr is the value that applies to repositories
-     whose directory matches the regular expression.  If more than one
-     element matches, then the *last* element in the list applies.  The
-     default value should therefore come first in the list.
-
-     If the value is ‘tabs’, highlight indentation with tabs.  If the
-     value is an integer, highlight indentation with at least that many
-     spaces.  Otherwise, highlight neither.
-
- -- User Option: magit-diff-hide-trailing-cr-characters
-
-     Whether to hide ^M characters at the end of a line in diffs.
-
- -- User Option: magit-diff-highlight-hunk-region-functions
-
-     This option specifies the functions used to highlight the
-     hunk-internal region.
-
-     ‘magit-diff-highlight-hunk-region-dim-outside’ overlays the outside
-     of the hunk internal selection with a face that causes the added
-     and removed lines to have the same background color as context
-     lines.  This function should not be removed from the value of this
-     option.
-
-     ‘magit-diff-highlight-hunk-region-using-overlays’ and
-     ‘magit-diff-highlight-hunk-region-using-underline’ emphasize the
-     region by placing delimiting horizonal lines before and after it.
-     Both of these functions have glitches which cannot be fixed due to
-     limitations of Emacs’ display engine.  For more information see
-     <https://github.com/magit/magit/issues/2758> ff.
-
-     Instead of, or in addition to, using delimiting horizontal lines,
-     to emphasize the boundaries, you may which to emphasize the text
-     itself, using ‘magit-diff-highlight-hunk-region-using-face’.
-
-     In terminal frames it’s not possible to draw lines as the overlay
-     and underline variants normally do, so there they fall back to
-     calling the face function instead.
-
- -- User Option: magit-diff-unmarked-lines-keep-foreground
-
-     This option controls whether added and removed lines outside the
-     hunk-internal region only lose their distinct background color or
-     also the foreground color.  Whether the outside of the region is
-     dimmed at all depends on
-     ‘magit-diff-highlight-hunk-region-functions’.
-
-
-File: magit.info,  Node: Revision Buffer,  Prev: Diff Options,  Up: Diffing
-
-5.4.4 Revision Buffer
----------------------
-
- -- User Option: magit-revision-insert-related-refs
-
-     Whether to show related refs in revision buffers.
-
- -- User Option: magit-revision-show-gravatar
-
-     Whether to show gravatar images in revision buffers.
-
-     If non-nil, then the value has to be a cons-cell which specifies
-     where the gravatar images for the author and/or the committer are
-     inserted inside the text that was previously inserted according to
-     ‘magit-revision-header-format’.
-
-     Both cells are regular expressions.  The car specifies where to
-     insert the author gravatar image.  The top half of the image is
-     inserted right after the matched text, the bottom half on the next
-     line at the same offset.  The cdr specifies where to insert the
-     committer image, accordingly.  Either the car or the cdr may be
-     nil.
-
-   The diffs shown in the revision buffer may be automatically
-restricted to a subset of the changed files.  If the revision buffer is
-displayed from a log buffer, the revision buffer will share the same
-file restriction as that log buffer (also see the command
-‘magit-diff-toggle-file-filter’).  Note, however, that the log’s file
-restriction will be ignored when ‘magit-log-arguments’ includes
-‘--follow’.  In this case, the ‘-u’ argument of the log popup can be
-used to show the file-restricted diffs inline.
-
-   If the revision buffer is not displayed from a log buffer, the file
-restriction is determined by the file restriction in the repository’s
-diff buffer, if it exists, and the value of the option
-‘magit-use-sticky-arguments’.
-
-
-File: magit.info,  Node: Ediffing,  Next: References Buffer,  Prev: Diffing,  Up: Inspecting
-
-5.5 Ediffing
-============
-
-This section describes how to enter Ediff from Magit buffers.  For
-information on how to use Ediff itself, see *note (ediff)Top::.
-
-‘e’     (‘magit-ediff-dwim’)
-
-     Compare, stage, or resolve using Ediff.
-
-     This command tries to guess what file, and what commit or range the
-     user wants to compare, stage, or resolve using Ediff.  It might
-     only be able to guess either the file, or range/commit, in which
-     case the user is asked about the other.  It might not always guess
-     right, in which case the appropriate ‘magit-ediff-*’ command has to
-     be used explicitly.  If it cannot read the user’s mind at all, then
-     it asks the user for a command to run.
-
-‘E’     (‘magit-ediff-popup’)
-
-     This prefix command shows the following suffix commands in a popup
-     buffer.
-
-‘E r’     (‘magit-ediff-compare’)
-
-     Compare two revisions of a file using Ediff.
-
-     If the region is active, use the revisions on the first and last
-     line of the region.  With a prefix argument, instead of diffing the
-     revisions, choose a revision to view changes along, starting at the
-     common ancestor of both revisions (i.e., use a "…" range).
-
-‘E m’     (‘magit-ediff-resolve’)
-
-     Resolve outstanding conflicts in a file using Ediff, defaulting to
-     the file at point.
-
-     Provided that the value of ‘merge.conflictstyle’ is ‘diff3’, you
-     can view the file’s merge-base revision using ‘/’ in the Ediff
-     control buffer.
-
-     In the rare event that you want to manually resolve all conflicts,
-     including those already resolved by Git, use
-     ‘ediff-merge-revisions-with-ancestor’.
-
-‘E s’     (‘magit-ediff-stage’)
-
-     Stage and unstage changes to a file using Ediff, defaulting to the
-     file at point.
-
-‘E u’     (‘magit-ediff-show-unstaged’)
-
-     Show unstaged changes to a file using Ediff.
-
-‘E i’     (‘magit-ediff-show-staged’)
-
-     Show staged changes to a file using Ediff.
-
-‘E w’     (‘magit-ediff-show-working-tree’)
-
-     Show changes in a file between ‘HEAD’ and working tree using Ediff.
-
-‘E c’     (‘magit-ediff-show-commit’)
-
-     Show changes to a file introduced by a commit using Ediff.
-
-‘E z’     (‘magit-ediff-show-stash’)
-
-     Show changes to a file introduced by a stash using Ediff.
-
- -- User Option: magit-ediff-dwim-show-on-hunks
-
-     This option controls what command ‘magit-ediff-dwim’ calls when
-     point is on uncommitted hunks.  When nil, always run
-     ‘magit-ediff-stage’.  Otherwise, use ‘magit-ediff-show-staged’ and
-     ‘magit-ediff-show-unstaged’ to show staged and unstaged changes,
-     respectively.
-
- -- User Option: magit-ediff-show-stash-with-index
-
-     This option controls whether ‘magit-ediff-show-stash’ includes a
-     buffer containing the file’s state in the index at the time the
-     stash was created.  This makes it possible to tell which changes in
-     the stash were staged.
-
- -- User Option: magit-ediff-quit-hook
-
-     This hook is run after quitting an Ediff session that was created
-     using a Magit command.  The hook functions are run inside the Ediff
-     control buffer, and should not change the current buffer.
-
-     This is similar to ‘ediff-quit-hook’ but takes the needs of Magit
-     into account.  The regular ‘ediff-quit-hook’ is ignored by Ediff
-     sessions that were created using a Magit command.
-
-
-File: magit.info,  Node: References Buffer,  Next: Bisecting,  Prev: Ediffing,  Up: Inspecting
-
-5.6 References Buffer
-=====================
-
-‘y’     (‘magit-show-refs-popup’)
-
-     List and compare references in a dedicated buffer.  By default all
-     refs are compared with ‘HEAD’, but with a prefix argument this
-     command instead acts as a prefix command and shows the following
-     suffix commands along with the appropriate infix arguments in a
-     popup buffer.
-
-‘y y’     (‘magit-show-refs-head’)
-
-     List and compare references in a dedicated buffer.  Refs are
-     compared with ‘HEAD’.
-
-‘y c’     (‘magit-show-refs-current’)
-
-     List and compare references in a dedicated buffer.  Refs are
-     compared with the current branch or ‘HEAD’ if it is detached.
-
-‘y o’     (‘magit-show-refs’)
-
-     List and compare references in a dedicated buffer.  Refs are
-     compared with a branch read from the user.
-
- -- User Option: magit-refs-show-commit-count
-
-     Whether to show commit counts in Magit-Refs mode buffers.
-
-        • ‘all’ Show counts for branches and tags.
-
-        • ‘branch’ Show counts for branches only.
-
-        • ‘nil’ Never show counts.
-     The default is ‘nil’ because anything else can be very expensive.
-
- -- User Option: magit-refs-margin
-
-     This option specifies whether the margin is initially shown in
-     Magit-Refs mode buffers and how it is formatted.
-
-     The value has the form ‘(INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH)’.
-
-        • If INIT is non-nil, then the margin is shown initially.
-
-        • STYLE controls how to format the committer date.  It can be
-          one of ‘age’ (to show the age of the commit),
-          ‘age-abbreviated’ (to abbreviate the time unit to a
-          character), or a string (suitable for ‘format-time-string’) to
-          show the actual date.
-
-        • WIDTH controls the width of the margin.  This exists for
-          forward compatibility and currently the value should not be
-          changed.
-
-        • AUTHOR controls whether the name of the author is also shown
-          by default.
-
-        • AUTHOR-WIDTH has to be an integer.  When the name of the
-          author is shown, then this specifies how much space is used to
-          do so.
-
- -- User Option: magit-refs-margin-for-tags
-
-     This option specifies whether to show information about tags in the
-     margin.  This is disabled by default because it is slow if there
-     are many tags.
-
-   The following variables control how individual refs are displayed.
-If you change one of these variables (especially the "%c" part), then
-you should also change the others to keep things aligned.  The following
-%-sequences are supported:
-
-   • ‘%a’ Number of commits this ref has over the one we compare to.
-
-   • ‘%b’ Number of commits the ref we compare to has over this one.
-
-   • ‘%c’ Number of commits this ref has over the one we compare to.
-     For the ref which all other refs are compared this is instead "@",
-     if it is the current branch, or "#" otherwise.
-
-   • ‘%C’ For the ref which all other refs are compared this is "@", if
-     it is the current branch, or "#" otherwise.  For all other refs "
-     ".
-
-   • ‘%h’ Hash of this ref’s tip.
-
-   • ‘%m’ Commit summary of the tip of this ref.
-
-   • ‘%n’ Name of this ref.
-
-   • ‘%u’ Upstream of this local branch.
-
-   • ‘%U’ Upstream of this local branch and additional local vs.
-     upstream information.
-
- -- Variable: magit-refs-local-branch-format
-
-     Format used for local branches in refs buffers.
-
- -- Variable: magit-refs-remote-branch-format
-
-     Format used for remote branches in refs buffers.
-
- -- Variable: magit-refs-tags-format
-
-     Format used for tags in refs buffers.
-
- -- Variable: magit-refs-indent-cherry-lines
-
-     Indentation of cherries in refs buffers.  This should be N-1 where
-     N is taken from "%Nc" in the above format strings.
-
-‘RET’     (‘magit-visit-ref’)
-
-     This command visits the reference or revision at point in another
-     buffer.  If there is no revision at point or with a prefix argument
-     then it prompts for a revision.
-
-     This command behaves just like ‘magit-show-commit’ as described
-     above, except if point is on a reference in a ‘magit-refs-mode’
-     buffer, in which case the behavior may be different, but only if
-     you have customized the option ‘magit-visit-ref-behavior’.
-
- -- User Option: magit-visit-ref-behavior
-
-     This option controls how ‘magit-visit-ref’ behaves in
-     ‘magit-refs-mode’ buffers.
-
-     By default ‘magit-visit-ref’ behaves like ‘magit-show-commit’, in
-     all buffers, including ‘magit-refs-mode’ buffers.  When the type of
-     the section at point is ‘commit’ then "RET" is bound to
-     ‘magit-show-commit’, and when the type is either ‘branch’ or ‘tag’
-     then it is bound to ‘magit-visit-ref’.
-
-     "RET" is one of Magit’s most essential keys and at least by default
-     it should behave consistently across all of Magit, especially
-     because users quickly learn that it does something very harmless;
-     it shows more information about the thing at point in another
-     buffer.
-
-     However "RET" used to behave differently in ‘magit-refs-mode’
-     buffers, doing surprising things, some of which cannot really be
-     described as "visit this thing".  If you’ve grown accustomed this
-     behavior, you can restore it by adding one or more of the below
-     symbols to the value of this option.  But keep in mind that by
-     doing so you don’t only introduce inconsistencies, you also lose
-     some functionality and might have to resort to ‘M-x
-     magit-show-commit’ to get it back.
-
-     ‘magit-visit-ref’ looks for these symbols in the order in which
-     they are described here.  If the presence of a symbol applies to
-     the current situation, then the symbols that follow do not affect
-     the outcome.
-
-        • ‘focus-on-ref’
-
-          With a prefix argument update the buffer to show commit counts
-          and lists of cherry commits relative to the reference at point
-          instead of relative to the current buffer or ‘HEAD’.
-
-          Instead of adding this symbol, consider pressing "C-u y o
-          RET".
-
-        • ‘create-branch’
-
-          If point is on a remote branch, then create a new local branch
-          with the same name, use the remote branch as its upstream, and
-          then check out the local branch.
-
-          Instead of adding this symbol, consider pressing "b c RET
-          RET", like you would do in other buffers.
-
-        • ‘checkout-any’
-
-          Check out the reference at point.  If that reference is a tag
-          or a remote branch, then this results in a detached ‘HEAD’.
-
-          Instead of adding this symbol, consider pressing "b b RET",
-          like you would do in other buffers.
-
-        • ‘checkout-branch’
-
-          Check out the local branch at point.
-
-          Instead of adding this symbol, consider pressing "b b RET",
-          like you would do in other buffers.
-
-* Menu:
-
-* References Sections::
-
-
-File: magit.info,  Node: References Sections,  Up: References Buffer
-
-5.6.1 References Sections
--------------------------
-
-The contents of references buffers is controlled using the hook
-‘magit-refs-sections-hook’.  See *note Section Hooks:: to learn about
-such hooks and how to customize them.  All of the below functions are
-members of the default value.  Note that it makes much less sense to
-customize this hook than it does for the respective hook used for the
-status buffer.
-
- -- User Option: magit-refs-sections-hook
-
-     Hook run to insert sections into a references buffer.
-
- -- Function: magit-insert-local-branches
-
-     Insert sections showing all local branches.
-
- -- Function: magit-insert-remote-branches
-
-     Insert sections showing all remote-tracking branches.
-
- -- Function: magit-insert-tags
-
-     Insert sections showing all tags.
-
-
-File: magit.info,  Node: Bisecting,  Next: Visiting Blobs,  Prev: References Buffer,  Up: Inspecting
-
-5.7 Bisecting
-=============
-
-Also see *note (gitman)git-bisect::.
-
-‘B’     (‘magit-bisect-popup’)
-
-     This prefix command shows the following suffix commands in a popup
-     buffer.
-
-   When bisecting is not in progress, then the popup buffer features the
-following commands.
-
-‘B B’     (‘magit-bisect-start’)
-
-     Start a bisect session.
-
-     Bisecting a bug means to find the commit that introduced it.  This
-     command starts such a bisect session by asking for a known good and
-     a bad commit.
-
-‘B s’     (‘magit-bisect-run’)
-
-     Bisect automatically by running commands after each step.
-
-   When bisecting is in progress, then the popup buffer features these
-commands instead.
-
-‘B b’     (‘magit-bisect-bad’)
-
-     Mark the current commit as bad.  Use this after you have asserted
-     that the commit does contain the bug in question.
-
-‘B g’     (‘magit-bisect-good’)
-
-     Mark the current commit as good.  Use this after you have asserted
-     that the commit does not contain the bug in question.
-
-‘B k’     (‘magit-bisect-skip’)
-
-     Skip the current commit.  Use this if for some reason the current
-     commit is not a good one to test.  This command lets Git choose a
-     different one.
-
-‘B r’     (‘magit-bisect-reset’)
-
-     After bisecting, cleanup bisection state and return to original
-     ‘HEAD’.
-
-   By default the status buffer shows information about the ongoing
-bisect session.
-
- -- User Option: magit-bisect-show-graph
-
-     This option controls whether a graph is displayed for the log of
-     commits that still have to be bisected.
-
-
-File: magit.info,  Node: Visiting Blobs,  Next: Blaming,  Prev: Bisecting,  Up: Inspecting
-
-5.8 Visiting Blobs
-==================
-
-‘M-x magit-find-file’     (‘magit-find-file’)
-
-     View FILE from REV. Switch to a buffer visiting blob REV:FILE,
-     creating one if none already exists.
-
-‘M-x magit-find-file-other-window’     (‘magit-find-file-other-window’)
-
-     View FILE from REV, in another window.  Like ‘magit-find-file’, but
-     create a new window or reuse an existing one.
-
-
-File: magit.info,  Node: Blaming,  Prev: Visiting Blobs,  Up: Inspecting
-
-5.9 Blaming
-===========
-
-Also see *note (gitman)git-blame::.
-
-‘M-x magit-blame’     (‘magit-blame’)
-
-     Display edit history of FILE up to REVISION.
-
-     Interactively blame the file being visited in the current buffer.
-     If the buffer visits a revision of that file, then blame up to that
-     revision.  Otherwise, blame the file’s full history, including
-     uncommitted changes.
-
-     If Magit-Blame mode is already turned on then blame recursively, by
-     visiting REVISION:FILE (using ‘magit-find-file’), where revision is
-     the revision before the revision that added the lines at point.
-
-     ARGS is a list of additional arguments to pass to ‘git blame’; only
-     arguments available from ‘magit-blame-popup’ should be used.
-
-‘M-x magit-blame-popup’     (‘magit-blame-popup’)
-
-     This prefix command shows the above suffix command along with the
-     appropriate infix arguments in a popup buffer.
-
-‘RET’     (‘magit-show-commit’)
-
-     Show the commit at point.  If there is no commit at point or with a
-     prefix argument, prompt for a commit.
-
-‘SPC’     (‘magit-diff-show-or-scroll-up’)
-
-     Update the commit or diff buffer for the thing at point.
-
-     Either show the commit or stash at point in the appropriate buffer,
-     or if that buffer is already being displayed in the current frame
-     and contains information about that commit or stash, then instead
-     scroll the buffer up.  If there is no commit or stash at point,
-     then prompt for a commit.
-
-‘DEL’     (‘magit-diff-show-or-scroll-down’)
-
-     Update the commit or diff buffer for the thing at point.
-
-     Either show the commit or stash at point in the appropriate buffer,
-     or if that buffer is already being displayed in the current frame
-     and contains information about that commit or stash, then instead
-     scroll the buffer down.  If there is no commit or stash at point,
-     then prompt for a commit.
-
-‘n’     (‘magit-blame-next-chunk’)
-
-     Move to the next chunk.
-
-‘N’     (‘magit-blame-next-chunk-same-commit’)
-
-     Move to the next chunk from the same commit.
-
-‘p’     (‘magit-blame-previous-chunk’)
-
-     Move to the previous chunk.
-
-‘P’     (‘magit-blame-previous-chunk-same-commit’)
-
-     Move to the previous chunk from the same commit.
-
-‘q’     (‘magit-blame-quit’)
-
-     Turn off Magit-Blame mode.  If the buffer was created during a
-     recursive blame, then also kill the buffer.
-
-‘M-w’     (‘magit-blame-copy-hash’)
-
-     Save the hash of the current chunk’s commit to the kill ring.
-
-     When the region is active, then save that to the ‘kill-ring’, like
-     ‘kill-ring-save’ would.
-
-‘t’     (‘magit-blame-toggle-headings’)
-
-     Show or hide blame chunk headings.
-
- -- User Option: magit-blame-heading-format
-
-     Format string used for blame headings.
-
- -- User Option: magit-blame-time-format
-
-     Format string used for time strings in blame headings.
-
- -- User Option: magit-blame-show-headings
-
-     Whether to initially show blame block headings.  The headings can
-     also be toggled locally using command
-     ‘magit-blame-toggle-headings’.
-
- -- User Option: magit-blame-goto-chunk-hook
-
-     Hook run by ‘magit-blame-next-chunk’ and
-     ‘magit-blame-previous-chunk’.
-
-
-File: magit.info,  Node: Manipulating,  Next: Transferring,  Prev: Inspecting,  Up: Top
-
-6 Manipulating
-**************
-
-* Menu:
-
-* Repository Setup::
-* Staging and Unstaging::
-* Applying::
-* Committing::
-* Branching::
-* Merging::
-* Resolving Conflicts::
-* Rebasing::
-* Cherry Picking::
-* Resetting::
-* Stashing::
-
-
-File: magit.info,  Node: Repository Setup,  Next: Staging and Unstaging,  Up: Manipulating
-
-6.1 Repository Setup
-====================
-
-‘M-x magit-init’     (‘magit-init’)
-
-     This command initializes a repository and then shows the status
-     buffer for the new repository.
-
-     If the directory is below an existing repository, then the user has
-     to confirm that a new one should be created inside.  If the
-     directory is the root of the existing repository, then the user has
-     to confirm that it should be reinitialized.
-
-‘M-x magit-clone’     (‘magit-clone’)
-
-     This command clones a repository and then shows the status buffer
-     for the new repository.
-
-     The user is queried for a remote url and a local directory.
-
- -- User Option: magit-clone-set-remote.pushDefault
-
-     Whether to set the value of ‘remote.pushDefault’ after cloning.
-
-     If ‘t’, then set without asking.  If ‘nil’, then don’t set.  If
-     ‘ask’, then ask the user every time she clones a repository.
-
-
-File: magit.info,  Node: Staging and Unstaging,  Next: Applying,  Prev: Repository Setup,  Up: Manipulating
-
-6.2 Staging and Unstaging
-=========================
-
-Like Git, Magit can of course stage and unstage complete files.  Unlike
-Git, it also allows users to gracefully un-/stage individual hunks and
-even just part of a hunk.  To stage individual hunks and parts of hunks
-using Git directly, one has to use the very modal and rather clumsy
-interface of a ‘git add --interactive’ session.
-
-   With Magit, on the other hand, one can un-/stage individual hunks by
-just moving point into the respective section inside a diff displayed in
-the status buffer or a separate diff buffer and typing ‘s’ or ‘u’.  To
-operate on just parts of a hunk, mark the changes that should be
-un-/staged using the region and then press the same key that would be
-used to un-/stage.  To stage multiple files or hunks at once use a
-region that starts inside the heading of such a section and ends inside
-the heading of a sibling section of the same type.
-
-   Besides staging and unstaging, Magit also provides several other
-"apply variants" that can also operate on a file, multiple files at
-once, a hunk, multiple hunks at once, and on parts of a hunk.  These
-apply variants are described in the next section.
-
-   You can also use Ediff to stage and unstage.  See *note Ediffing::.
-
-‘s’     (‘magit-stage’)
-
-     Add the change at point to the staging area.
-
-     With a prefix argument and an untracked file (or files) at point,
-     stage the file but not its content.  This makes it possible to
-     stage only a subset of the new file’s changes.
-
-‘S’     (‘magit-stage-modified’)
-
-     Stage all changes to files modified in the worktree.  Stage all new
-     content of tracked files and remove tracked files that no longer
-     exist in the working tree from the index also.  With a prefix
-     argument also stage previously untracked (but not ignored) files.
-
-‘u’     (‘magit-unstage’)
-
-     Remove the change at point from the staging area.
-
-     Only staged changes can be unstaged.  But by default this command
-     performs an action that is somewhat similar to unstaging, when it
-     is called on a committed change: it reverses the change in the
-     index but not in the working tree.
-
-‘U’     (‘magit-unstage-all’)
-
-     Remove all changes from the staging area.
-
- -- User Option: magit-unstage-committed
-
-     This option controls whether ‘magit-unstage’ "unstages" committed
-     changes by reversing them in the index but not the working tree.
-     The alternative is to raise an error.
-
-‘M-x magit-reverse-in-index’     (‘magit-reverse-in-index’)
-
-     This command reverses the committed change at point in the index
-     but not the working tree.  By default no key is bound directly to
-     this command, but it is indirectly called when ‘u’
-     (‘magit-unstage’) is pressed on a committed change.
-
-     This allows extracting a change from ‘HEAD’, while leaving it in
-     the working tree, so that it can later be committed using a
-     separate commit.  A typical workflow would be:
-
-        • Optionally make sure that there are no uncommitted changes.
-
-        • Visit the ‘HEAD’ commit and navigate to the change that should
-          not have been included in that commit.
-
-        • Type ‘u’ (‘magit-unstage’) to reverse it in the index.  This
-          assumes that ‘magit-unstage-committed-changes’ is non-nil.
-
-        • Type ‘c e’ to extend ‘HEAD’ with the staged changes, including
-          those that were already staged before.
-
-        • Optionally stage the remaining changes using ‘s’ or ‘S’ and
-          then type ‘c c’ to create a new commit.
-
-‘M-x magit-reset-index’     (‘magit-reset-index’)
-
-     Reset the index to some commit.  The commit is read from the user
-     and defaults to the commit at point.  If there is no commit at
-     point, then it defaults to ‘HEAD’.
-
-* Menu:
-
-* Staging from File-Visiting Buffers::
-
-
-File: magit.info,  Node: Staging from File-Visiting Buffers,  Up: Staging and Unstaging
-
-6.2.1 Staging from File-Visiting Buffers
-----------------------------------------
-
-Fine-grained un-/staging has to be done from the status or a diff
-buffer, but it’s also possible to un-/stage all changes made to the file
-visited in the current buffer right from inside that buffer.
-
-‘M-x magit-stage-file’     (‘magit-stage-file’)
-
-     When invoked inside a file-visiting buffer, then stage all changes
-     to that file.  In a Magit buffer, stage the file at point if any.
-     Otherwise prompt for a file to be staged.  With a prefix argument
-     always prompt the user for a file, even in a file-visiting buffer
-     or when there is a file section at point.
-
-‘M-x magit-unstage-file’     (‘magit-unstage-file’)
-
-     When invoked inside a file-visiting buffer, then unstage all
-     changes to that file.  In a Magit buffer, unstage the file at point
-     if any.  Otherwise prompt for a file to be unstaged.  With a prefix
-     argument always prompt the user for a file, even in a file-visiting
-     buffer or when there is a file section at point.
-
-
-File: magit.info,  Node: Applying,  Next: Committing,  Prev: Staging and Unstaging,  Up: Manipulating
-
-6.3 Applying
-============
-
-Magit provides several "apply variants": stage, unstage, discard,
-reverse, and "regular apply".  At least when operating on a hunk they
-are all implemented using ‘git apply’, which is why they are called
-"apply variants".
-
-   • Stage.  Apply a change from the working tree to the index.  The
-     change also remains in the working tree.
-
-   • Unstage.  Remove a change from the index.  The change remains in
-     the working tree.
-
-   • Discard.  On a staged change, remove it from the working tree and
-     the index.  On an unstaged change, remove it from the working tree
-     only.
-
-   • Reverse.  Reverse a change in the working tree.  Both committed and
-     staged changes can be reversed.  Unstaged changes cannot be
-     reversed.  Discard them instead.
-
-   • Apply.  Apply a change to the working tree.  Both committed and
-     staged changes can be applied.  Unstaged changes cannot be applied
-     - as they already have been applied.
-
-   The previous section described the staging and unstaging commands.
-What follows are the commands which implement the remaining apply
-variants.
-
-‘a’     (‘magit-apply’)
-
-     Apply the change at point to the working tree.
-
-     With a prefix argument fallback to a 3-way merge.  Doing so causes
-     the change to be applied to the index as well.
-
-‘k’     (‘magit-discard’)
-
-     Remove the change at point from the working tree.
-
-‘v’     (‘magit-reverse’)
-
-     Reverse the change at point in the working tree.
-
-     With a prefix argument fallback to a 3-way merge.  Doing so causes
-     the change to be applied to the index as well.
-
-   With a prefix argument all apply variants attempt a 3-way merge when
-appropriate (i.e.  when ‘git apply’ is used internally).
-
-
-File: magit.info,  Node: Committing,  Next: Branching,  Prev: Applying,  Up: Manipulating
-
-6.4 Committing
-==============
-
-When the user initiates a commit, Magit calls ‘git commit’ without any
-arguments, so Git has to get it from the user.  It creates the file
-‘.git/COMMIT_EDITMSG’ and then opens that file in an editor.  Magit
-arranges for that editor to be the Emacsclient.  Once the user finishes
-the editing session, the Emacsclient exits and Git creates the commit
-using the file’s content as message.
-
-* Menu:
-
-* Initiating a Commit::
-* Editing Commit Messages::
-
-
-File: magit.info,  Node: Initiating a Commit,  Next: Editing Commit Messages,  Up: Committing
-
-6.4.1 Initiating a Commit
--------------------------
-
-Also see *note (gitman)git-commit::.
-
-‘c’     (‘magit-commit-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘c c’     (‘magit-commit’)
-
-     Create a new commit on ‘HEAD’.  With a prefix argument amend to the
-     commit at ‘HEAD’ instead.
-
-‘c a’     (‘magit-commit-amend’)
-
-     Amend the last commit.
-
-‘c e’     (‘magit-commit-extend’)
-
-     Amend the last commit, without editing the message.  With a prefix
-     argument keep the committer date, otherwise change it.  The option
-     ‘magit-commit-extend-override-date’ can be used to inverse the
-     meaning of the prefix argument.
-
-     Non-interactively respect the optional OVERRIDE-DATE argument and
-     ignore the option.
-
-‘c w’     (‘magit-commit-reword’)
-
-     Reword the last commit, ignoring staged changes.  With a prefix
-     argument keep the committer date, otherwise change it.  The option
-     ‘magit-commit-reword-override-date’ can be used to inverse the
-     meaning of the prefix argument.
-
-     Non-interactively respect the optional OVERRIDE-DATE argument and
-     ignore the option.
-
-‘c f’     (‘magit-commit-fixup’)
-
-     Create a fixup commit.
-
-     With a prefix argument the target commit has to be confirmed.
-     Otherwise the commit at point may be used without confirmation
-     depending on the value of option ‘magit-commit-squash-confirm’.
-
-‘c F’     (‘magit-commit-instant-fixup’)
-
-     Create a fixup commit and instantly rebase.
-
-‘c s’     (‘magit-commit-squash’)
-
-     Create a squash commit, without editing the squash message.
-
-     With a prefix argument the target commit has to be confirmed.
-     Otherwise the commit at point may be used without confirmation
-     depending on the value of option ‘magit-commit-squash-confirm’.
-
-‘c S’     (‘magit-commit-instant-squash’)
-
-     Create a squash commit and instantly rebase.
-
-‘c A’     (‘magit-commit-augment’)
-
-     Create a squash commit, editing the squash message.
-
-     With a prefix argument the target commit has to be confirmed.
-     Otherwise the commit at point may be used without confirmation
-     depending on the value of option ‘magit-commit-squash-confirm’.
-
- -- User Option: magit-commit-ask-to-stage
-
-     Whether to ask to stage everything when committing and nothing is
-     staged.
-
- -- User Option: magit-commit-extend-override-date
-
-     Whether using ‘magit-commit-extend’ changes the committer date.
-
- -- User Option: magit-commit-reword-override-date
-
-     Whether using ‘magit-commit-reword’ changes the committer date.
-
- -- User Option: magit-commit-squash-confirm
-
-     Whether the commit targeted by squash and fixup has to be
-     confirmed.  When non-nil then the commit at point (if any) is used
-     as default choice.  Otherwise it has to be confirmed.  This option
-     only affects ‘magit-commit-squash’ and ‘magit-commit-fixup’.  The
-     "instant" variants always require confirmation because making an
-     error while using those is harder to recover from.
-
-
-File: magit.info,  Node: Editing Commit Messages,  Prev: Initiating a Commit,  Up: Committing
-
-6.4.2 Editing Commit Messages
------------------------------
-
-After initiating a commit as described in the previous section, two new
-buffers appear.  One shows the changes that are about to committed,
-while the other is used to write the message.  All regular editing
-commands are available in the commit message buffer.  This section only
-describes the additional commands.
-
-   Commit messages are edited in an edit session - in the background Git
-is waiting for the editor, in our case the Emacsclient, to save the
-commit message in a file (in most cases ‘.git/COMMIT_EDITMSG’) and then
-return.  If the Emacsclient returns with a non-zero exit status then Git
-does not create the commit.  So the most important commands are those
-for finishing and aborting the commit.
-
-‘C-c C-c’     (‘with-editor-finish’)
-
-     Finish the current editing session by returning with exit code 0.
-     Git then creates the commit using the message it finds in the file.
-
-‘C-c C-k’     (‘with-editor-cancel’)
-
-     Cancel the current editing session by returning with exit code 1.
-     Git then cancels the commit, but leaves the file untouched.
-
-   In addition to being used by Git, these messages may also be stored
-in a ring that persists until Emacs is closed.  By default the message
-is stored at the beginning and the end of an edit session (regardless of
-whether the session is finished successfully or was canceled).  It is
-sometimes useful to bring back messages from that ring.
-
-‘C-c M-s’     (‘git-commit-save-message’)
-
-     Save the current buffer content to the commit message ring.
-
-‘M-p’     (‘git-commit-prev-message’)
-
-     Cycle backward through the commit message ring, after saving the
-     current message to the ring.  With a numeric prefix ARG, go back
-     ARG comments.
-
-‘M-n’     (‘git-commit-next-message’)
-
-     Cycle forward through the commit message ring, after saving the
-     current message to the ring.  With a numeric prefix ARG, go back
-     ARG comments.
-
-   By default the diff for the changes that are about to be committed
-are automatically shown when invoking the commit.  When amending to an
-existing commit it may be useful to show either the changes that are
-about to be added to that commit or to show those changes together with
-those that are already committed.
-
-‘C-c C-d’     (‘magit-diff-while-committing’)
-
-     While committing, show the changes that are about to be committed.
-     While amending, invoking the command again toggles between showing
-     just the new changes or all the changes that will be committed.
-
-‘C-c C-w’     (‘magit-pop-revision-stack’)
-
-     This command inserts a representation of a revision into the
-     current buffer.  It can be used inside buffers used to write commit
-     messages but also in other buffers such as buffers used to edit
-     emails or ChangeLog files.
-
-     By default this command pops the revision which was last added to
-     the ‘magit-revision-stack’ and inserts it into the current buffer
-     according to ‘magit-pop-revision-stack-format’.  Revisions can be
-     put on the stack using ‘magit-copy-section-value’ and
-     ‘magit-copy-buffer-revision’.
-
-     If the stack is empty or with a prefix argument it instead reads a
-     revision in the minibuffer.  By using the minibuffer history this
-     allows selecting an item which was popped earlier or to insert an
-     arbitrary reference or revision without first pushing it onto the
-     stack.
-
-     When reading the revision from the minibuffer, then it might not be
-     possible to guess the correct repository.  When this command is
-     called inside a repository (e.g.  while composing a commit
-     message), then that repository is used.  Otherwise (e.g.  while
-     composing an email) then the repository recorded for the top
-     element of the stack is used (even though we insert another
-     revision).  If not called inside a repository and with an empty
-     stack, or with two prefix arguments, then read the repository in
-     the minibuffer too.
-
- -- User Option: magit-pop-revision-stack-format
-
-     This option controls how the command ‘magit-pop-revision-stack’
-     inserts a revision into the current buffer.
-
-     The entries on the stack have the format ‘(HASH TOPLEVEL)’ and this
-     option has the format ‘(POINT-FORMAT EOB-FORMAT INDEX-REGEXP)’, all
-     of which may be nil or a string (though either one of EOB-FORMAT or
-     POINT-FORMAT should be a string, and if INDEX-REGEXP is non-nil,
-     then the two formats should be too).
-
-     First INDEX-REGEXP is used to find the previously inserted entry,
-     by searching backward from point.  The first submatch must match
-     the index number.  That number is incremented by one, and becomes
-     the index number of the entry to be inserted.  If you don’t want to
-     number the inserted revisions, then use nil for INDEX-REGEXP.
-
-     If INDEX-REGEXP is non-nil then both POINT-FORMAT and EOB-FORMAT
-     should contain \"%N\", which is replaced with the number that was
-     determined in the previous step.
-
-     Both formats, if non-nil and after removing %N, are then expanded
-     using ‘git show –format=FORMAT …’ inside TOPLEVEL.
-
-     The expansion of POINT-FORMAT is inserted at point, and the
-     expansion of EOB-FORMAT is inserted at the end of the buffer (if
-     the buffer ends with a comment, then it is inserted right before
-     that).
-
-   Some projects use pseudo headers in commit messages.  Magit colorizes
-such headers and provides some commands to insert such headers.
-
- -- User Option: git-commit-known-pseudo-headers
-
-     A list of Git pseudo headers to be highlighted.
-
-‘C-c C-a’     (‘git-commit-ack’)
-
-     Insert a header acknowledging that you have looked at the commit.
-
-‘C-c C-r’     (‘git-commit-review’)
-
-     Insert a header acknowledging that you have reviewed the commit.
-
-‘C-c C-s’     (‘git-commit-signoff’)
-
-     Insert a header to sign off the commit.
-
-‘C-c C-t’     (‘git-commit-test’)
-
-     Insert a header acknowledging that you have tested the commit.
-
-‘C-c C-o’     (‘git-commit-cc’)
-
-     Insert a header mentioning someone who might be interested.
-
-‘C-c C-p’     (‘git-commit-reported’)
-
-     Insert a header mentioning the person who reported the issue being
-     fixed by the commit.
-
-‘C-c C-i’     (‘git-commit-suggested’)
-
-     Insert a header mentioning the person who suggested the change.
-
-   ‘git-commit-mode’ is a minor mode that is only used to establish the
-above key bindings.  This allows using an arbitrary major mode when
-editing the commit message.  It’s even possible to use a different major
-mode in different repositories, which is useful when different projects
-impose different commit message conventions.
-
- -- User Option: git-commit-major-mode
-
-     The value of this option is the major mode used to edit Git commit
-     messages.
-
-   Because ‘git-commit-mode’ is a minor mode, we don’t use its mode hook
-to setup the buffer, except for the key bindings.  All other setup
-happens in the function ‘git-commit-setup’, which among other things
-runs the hook ‘git-commit-setup-hook’.  The following functions are
-suitable for that hook.
-
- -- User Option: git-commit-setup-hook
-
-     Hook run at the end of ‘git-commit-setup’.
-
- -- Function: magit-revert-buffers &optional force
-
-     Revert unmodified file-visiting buffers of the current repository.
-
-     If either ‘magit-revert-buffers’ is non-nil and
-     ‘inhibit-magit-revert’ is nil, or if optional FORCE is non-nil,
-     then revert all unmodified buffers that visit files being tracked
-     in the current repository.
-
- -- Function: git-commit-save-message
-
-     Save the current buffer content to the commit message ring.
-
- -- Function: git-commit-setup-changelog-support
-
-     After this function is called, ChangeLog entries are treated as
-     paragraphs.
-
- -- Function: git-commit-turn-on-auto-fill
-
-     Turn on ‘auto-fill-mode’ and set ‘fill-column’ to the value of
-     ‘git-commit-fill-column’.
-
- -- Function: git-commit-turn-on-flyspell
-
-     Turn on Flyspell mode.  Also prevent comments from being checked
-     and finally check current non-comment text.
-
- -- Function: git-commit-propertize-diff
-
-     Propertize the diff shown inside the commit message buffer.  Git
-     inserts such diffs into the commit message template when the
-     ‘--verbose’ argument is used.  Magit’s commit popup by default does
-     not offer that argument because the diff that is shown in a
-     separate buffer is more useful.  But some users disagree, which is
-     why this function exists.
-
- -- Function: with-editor-usage-message
-
-     Show usage information in the echo area.
-
-   Magit also helps with writing *good* commit messages by complaining
-when certain rules are violated.
-
- -- User Option: git-commit-summary-max-length
-
-     The intended maximal length of the summary line of commit messages.
-     Characters beyond this column are colorized to indicate that this
-     preference has been violated.
-
- -- User Option: git-commit-fill-column
-
-     Column beyond which automatic line-wrapping should happen in commit
-     message buffers.
-
- -- User Option: git-commit-finish-query-functions
-
-     List of functions called to query before performing commit.
-
-     The commit message buffer is current while the functions are
-     called.  If any of them returns nil, then the commit is not
-     performed and the buffer is not killed.  The user should then fix
-     the issue and try again.
-
-     The functions are called with one argument.  If it is non-nil then
-     that indicates that the user used a prefix argument to force
-     finishing the session despite issues.  Functions should usually
-     honor this wish and return non-nil.
-
- -- Function: git-commit-check-style-conventions
-
-     Check for violations of certain basic style conventions.  For each
-     violation ask the user if she wants to proceed anyway.  This makes
-     sure the summary line isn’t too long and that the second line is
-     empty.
-
-   To show no diff while committing remove ‘magit-commit-diff’ from
-‘server-switch-hook’.
-
-
-File: magit.info,  Node: Branching,  Next: Merging,  Prev: Committing,  Up: Manipulating
-
-6.5 Branching
-=============
-
-* Menu:
-
-* The Two Remotes::
-* The Branch Popup::
-* The Branch Config Popup::
-
-
-File: magit.info,  Node: The Two Remotes,  Next: The Branch Popup,  Up: Branching
-
-6.5.1 The Two Remotes
----------------------
-
-The upstream branch of some local branch is the branch into which the
-commits on that local branch should eventually be merged, usually
-something like ‘origin/master’.  For the ‘master’ branch itself the
-upstream branch and the branch it is being pushed to, are usually the
-same remote branch.  But for a feature branch the upstream branch and
-the branch it is being pushed to should differ.
-
-   The commits on feature branches too should _eventually_ end up in a
-remote branch such as ‘origin/master’ or ‘origin/maint’.  Such a branch
-should therefore be used as the upstream.  But feature branches
-shouldn’t be pushed directly to such branches.  Instead a feature branch
-‘my-feature’ is usually pushed to ‘my-fork/my-feature’ or if you are a
-contributor ‘origin/my-feature’.  After the new feature has been
-reviewed, the maintainer merges the feature into ‘master’.  And finally
-‘master’ (not ‘my-feature’ itself) is pushed to ‘origin/master’.
-
-   But new features seldom are perfect on the first try, and so feature
-branches usually have to be reviewed, improved, and re-pushed several
-times.  Pushing should therefore be easy to do, and for that reason many
-Git users have concluded that it is best to use the remote branch to
-which the local feature branch is being pushed as its upstream.
-
-   But luckily Git has long ago gained support for a push-remote which
-can be configured separately from the upstream branch, using the
-variables ‘branch.<name>.pushRemote’ and ‘remote.pushDefault’.  So we no
-longer have to choose which of the two remotes should be used as "the
-remote".
-
-   Each of the fetching, pulling, and pushing popups features three
-commands that act on the current branch and some other branch.  Of
-these, ‘p’ is bound to a command which acts on the push-remote, ‘u’ is
-bound to a command which acts on the upstream, and ‘e’ is bound to a
-command which acts on any other branch.  The status buffer shows
-unpushed and unpulled commits for both the push-remote and the upstream.
-
-   It’s fairly simple to configure these two remotes.  The values of all
-the variables that are related to fetching, pulling, and pushing (as
-well as some other branch-related variables) can be inspected and
-changed using the popup ‘magit-branch-config-popup’, which is a
-sub-popup of many popups that deal with branches.  It is also possible
-to set the push-remote or upstream while pushing (see *note Pushing::).
-
-
-File: magit.info,  Node: The Branch Popup,  Next: The Branch Config Popup,  Prev: The Two Remotes,  Up: Branching
-
-6.5.2 The Branch Popup
-----------------------
-
-The popup ‘magit-branch-popup’ is used to create and checkout branches,
-and to make changes to existing branches.  It is not used to fetch,
-pull, merge, rebase, or push branches, i.e.  this popup deals with
-branches themselves, not with the commits reachable from them.  Those
-features are available from separate popups.
-
-‘b’     (‘magit-branch-popup’)
-
-     This prefix command shows the following suffix commands in a popup
-     buffer.
-
-     By default it also displays the values of some branch-related Git
-     variables and allows changing their values, just like the
-     specialized ‘magit-branch-config-popup’ does.
-
- -- User Option: magit-branch-popup-show-variables
-
-     Whether the ‘magit-branch-popup’ shows Git variables.  This
-     defaults to t to avoid changing key bindings.  When set to nil, no
-     variables are displayed directly in this popup, and the sub-popup
-     ‘magit-branch-config-popup’ has to be used indead to view and
-     change branch related variables.
-
-‘b b’     (‘magit-checkout’)
-
-     Checkout a revision read in the minibuffer and defaulting to the
-     branch or arbitrary revision at point.  If the revision is a local
-     branch then that becomes the current branch.  If it is something
-     else then ‘HEAD’ becomes detached.  Checkout fails if the working
-     tree or the staging area contain changes.
-
-‘b n’     (‘magit-branch’)
-
-     Create a new branch.  The user is asked for a branch or arbitrary
-     revision to use as the starting point of the new branch.  When a
-     branch name is provided, then that becomes the upstream branch of
-     the new branch.  The name of the new branch is also read in the
-     minibuffer.
-
-     Also see option ‘magit-branch-prefer-remote-upstream’.
-
-‘b c’     (‘magit-branch-and-checkout’)
-
-     This command creates a new branch like ‘magit-branch’, but then
-     also checks it out.
-
-     Also see option ‘magit-branch-prefer-remote-upstream’.
-
-‘b s’     (‘magit-branch-spinoff’)
-
-     This command creates and checks out a new branch starting at and
-     tracking the current branch.  That branch in turn is reset to the
-     last commit it shares with its upstream.  If the current branch has
-     no upstream or no unpushed commits, then the new branch is created
-     anyway and the previously current branch is not touched.
-
-     This is useful to create a feature branch after work has already
-     began on the old branch (likely but not necessarily "master").
-
-     If the current branch is a member of the value of option
-     ‘magit-branch-prefer-remote-upstream’ (which see), then the current
-     branch will be used as the starting point as usual, but the
-     upstream of the starting-point may be used as the upstream of the
-     new branch, instead of the starting-point itself.
-
-     If optional FROM is non-nil, then the source branch is reset to
-     ‘FROM~’, instead of to the last commit it shares with its upstream.
-     Interactively, FROM is only ever non-nil, if the region selects
-     some commits, and among those commits, FROM is the commit that is
-     the fewest commits ahead of the source branch.  (It not yet
-     possible to spin off a single commit, unless it is the only
-     unpushed commit.  See #2920.)
-
-     The commit at the other end of the selection actually does not
-     matter, all commits between FROM and ‘HEAD’ are moved to the new
-     branch.  If FROM is not reachable from ‘HEAD’ or is reachable from
-     the source branch’s upstream, then an error is raised.
-
-‘b x’     (‘magit-branch-reset’)
-
-     This command resets a branch, defaulting to the branch at point, to
-     the tip of another branch or any other commit.
-
-     When the branch being reset is the current branch, then a hard
-     reset is performed.  If there are any uncommitted changes, then the
-     user has to confirm the reset because those changes would be lost.
-
-     This is useful when you have started work on a feature branch but
-     realize it’s all crap and want to start over.
-
-     When resetting to another branch and a prefix argument is used,
-     then the target branch is set as the upstream of the branch that is
-     being reset.
-
-‘b k’     (‘magit-branch-delete’)
-
-     Delete one or multiple branches.  If the region marks multiple
-     branches, then offer to delete those.  Otherwise, prompt for a
-     single branch to be deleted, defaulting to the branch at point.
-
-‘b r’     (‘magit-branch-rename’)
-
-     Rename a branch.  The branch and the new name are read in the
-     minibuffer.  With prefix argument the branch is renamed even if
-     that name conflicts with an existing branch.
-
- -- User Option: magit-branch-read-upstream-first
-
-     When creating a branch, whether to read the upstream branch before
-     the name of the branch that is to be created.  The default is
-     ‘nil’, and I recommend you leave it at that.
-
- -- User Option: magit-branch-prefer-remote-upstream
-
-     This option specifies whether remote upstreams are favored over
-     local upstreams when creating new branches.
-
-     When a new branch is created, then the branch, commit, or stash at
-     point is suggested as the starting point of the new branch, or if
-     there is no such revision at point the current branch.  In either
-     case the user may choose another starting point.
-
-     If the chosen starting point is a branch, then it may also be set
-     as the upstream of the new branch, depending on the value of the
-     Git variable ‘branch.autoSetupMerge’.  By default this is done for
-     remote branches, but not for local branches.
-
-     You might prefer to always use some remote branch as upstream.  If
-     the chosen starting point is (1) a local branch, (2) whose name
-     matches a member of the value of this option, (3) the upstream of
-     that local branch is a remote branch with the same name, and (4)
-     that remote branch can be fast-forwarded to the local branch, then
-     the chosen branch is used as starting point, but its own upstream
-     is used as the upstream of the new branch.
-
-     Members of this option’s value are treated as branch names that
-     have to match exactly unless they contain a character that makes
-     them invalid as a branch name.  Recommended characters to use to
-     trigger interpretation as a regexp are "*" and "^".  Some other
-     characters which you might expect to be invalid, actually are not,
-     e.g.  ".+$" are all perfectly valid.  More precisely, if ‘git
-     check-ref-format –branch STRING’ exits with a non-zero status, then
-     treat STRING as a regexp.
-
-     Assuming the chosen branch matches these conditions you would end
-     up with with e.g.:
-
-          feature --upstream--> origin/master
-
-     instead of
-
-          feature --upstream--> master --upstream--> origin/master
-
-     Which you prefer is a matter of personal preference.  If you do
-     prefer the former, then you should add branches such as ‘master’,
-     ‘next’, and ‘maint’ to the value of this options.
-
- -- User Option: magit-branch-adjust-remote-upstream-alist
-
-     The value of this option is an alist of branches to be used as the
-     upstream when branching a remote branch.
-
-     When creating a local branch from an ephemeral branch located on a
-     remote, e.g.  a feature or hotfix branch, then that remote branch
-     should usually not be used as the upstream branch, since the
-     push-remote already allows accessing it and having both the
-     upstream and the push-remote reference the same related branch
-     would be wasteful.  Instead a branch like "maint" or "master"
-     should be used as the upstream.
-
-     This option allows specifing the branch that should be used as the
-     upstream when branching certain remote branches.  The value is an
-     alist of the form ‘((UPSTREAM . RULE)...)’.  The first matching
-     element is used, the following elements are ignored.
-
-     UPSTREAM is the branch to be used as the upstream for branches
-     specified by RULE. It can be a local or a remote branch.
-
-     RULE can either be a regular expression, matching branches whose
-     upstream should be the one specified by UPSTREAM. Or it can be a
-     list of the only branches that should *not* use UPSTREAM; all other
-     branches will.  Matching is done after stripping the remote part of
-     the name of the branch that is being branched from.
-
-     If you use a finite set of non-ephemeral branches across all your
-     repositories, then you might use something like:
-
-          (("origin/master" "master" "next" "maint"))
-
-     Or if the names of all your ephemeral branches contain a slash, at
-     least in some repositories, then a good value could be:
-
-          (("origin/master" . "/"))
-
-     Of course you can also fine-tune:
-
-          (("origin/maint" . "\\`hotfix/")
-           ("origin/master" . "\\`feature/"))
-
- -- Command: magit-branch-orphan
-
-     This command creates and checks out a new orphan branch with
-     contents from a given revision.
-
-
-File: magit.info,  Node: The Branch Config Popup,  Prev: The Branch Popup,  Up: Branching
-
-6.5.3 The Branch Config Popup
------------------------------
-
- -- Command: magit-branch-popup
-
-     This prefix command shows the following branch-related Git
-     variables in a popup buffer.  The values can be changed from that
-     buffer.
-
-     This popup is a sub-popup of several popups that deal with
-     branches, including ‘magit-branch-popup’, ‘magit-pull-popup’,
-     ‘magit-fetch-popup’, ‘magit-pull-and-fetch-popup’, and
-     ‘magit-push-popup’.  In all of these popups "C" is bound to this
-     popup.
-
-   The following variables are used to configure a specific branch.  The
-values are being displayed for the current branch (if any).  To change
-the value for another branch invoke ‘magit-branch-config-popup’ with a
-prefix argument.
-
- -- Variable: branch.NAME.merge
-
-     Together with ‘branch.NAME.remote’ this variable defines the
-     upstream branch of the local branch named NAME. The value of this
-     variable is the full reference of the upstream _branch_.
-
- -- Variable: branch.NAME.remote
-
-     Together with ‘branch.NAME.merge’ this variable defines the
-     upstream branch of the local branch named NAME. The value of this
-     variable is the name of the upstream _remote_.
-
- -- Variable: branch.NAME.rebase
-
-     This variable controls whether pulling into the branch named NAME
-     is done by rebasing or by merging the fetched branch.
-
-        • When ‘true’ then pulling is done by rebasing.
-
-        • When ‘false’ then pulling is done by merging.
-
-        • When undefined then the value of ‘pull.rebase’ is used.  The
-          default of that variable is ‘false’.
-
- -- Variable: branch.NAME.pushRemote
-
-     This variable specifies the remote that the branch named NAME is
-     usually pushed to.  The value has to be the name of an existing
-     remote.
-
-     It is not possible to specify the name of _branch_ to push the
-     local branch to.  The name of the remote branch is always the same
-     as the name of the local branch.
-
-     If this variable is undefined but ‘remote.pushDefault’ is defined,
-     then the value of the latter is used.  By default
-     ‘remote.pushDefault’ is undefined.
-
- -- Variable: branch.NAME.description
-
-     This variable can be used to describe the branch named NAME. That
-     description is used e.g.  when turning the branch into a series of
-     patches.
-
-   The following variables specify defaults which are used if the above
-branch-specific variables are not set.
-
- -- Variable: pull.rebase
-
-     This variable specifies whether pulling is done by rebasing or by
-     merging.  It can be overwritten using ‘branch.NAME.rebase’.
-
-        • When ‘true’ then pulling is done by rebasing.
-
-        • When ‘false’ (the default) then pulling is done by merging.
-     Since it is never a good idea to merge the upstream branch into a
-     feature or hotfix branch and most branches are such branches, you
-     should consider setting this to ‘true’, and ‘branch.master.rebase’
-     to ‘false’.
-
- -- Variable: remote.pushDefault
-
-     This variable specifies what remote the local branches are usually
-     pushed to.  This can be overwritten per branch using
-     ‘branch.NAME.pushRemote’.
-
-   The following variables are used during the creation of a branch and
-control whether the various branch-specific variables are automatically
-set at this time.
-
- -- Variable: branch.autoSetupMerge
-
-     This variable specifies under what circumstances creating a branch
-     NAME should result in the variables ‘branch.NAME.merge’ and
-     ‘branch.NAME.remote’ being set according to the starting point used
-     to create the branch.  If the starting point isn’t a branch, then
-     these variables are never set.
-
-        • When ‘always’ then the variables are set regardless of whether
-          the starting point is a local or a remote branch.
-
-        • When ‘true’ (the default) then the variables are set when the
-          starting point is a remote branch, but not when it is a local
-          branch.
-
-        • When ‘false’ then the variables are never set.
-
- -- Variable: branch.autoSetupRebase
-
-     This variable specifies whether creating a branch NAME should
-     result in the variable ‘branch.NAME.rebase’ being set to ‘true’.
-
-        • When ‘always’ then the variable is set regardless of whether
-          the starting point is a local or a remote branch.
-
-        • When ‘local’ then the variable are set when the starting point
-          is a local branch, but not when it is a remote branch.
-
-        • When ‘remote’ then the variable are set when the starting
-          point is a remote branch, but not when it is a local branch.
-
-        • When ‘never’ (the default) then the variable is never set.
-
-   Note that the respective commands always change the repository-local
-values.  If you want to change the global value, which is used when the
-local value is undefined, then you have to do so on the command line,
-e.g.:
-
-     git config --global remote.autoSetupMerge always
-
-   For more information about these variables you should also see
-
-   *note (gitman)git-config::.  Also see *note (gitman)git-branch::.  ,
-*note (gitman)git-checkout::.  and *note Pushing::.
-
- -- User Option: magit-prefer-remote-upstream
-
-     This option controls whether commands that read a branch from the
-     user and then set it as the upstream branch, offer a local or a
-     remote branch as default completion candidate, when they have the
-     choice.
-
-     This affects all commands that use ‘magit-read-upstream-branch’ or
-     ‘magit-read-starting-point’, which includes all commands that
-     change the upstream and many which create new branches.
-
-
-File: magit.info,  Node: Merging,  Next: Resolving Conflicts,  Prev: Branching,  Up: Manipulating
-
-6.6 Merging
-===========
-
-Also see *note (gitman)git-merge::.  For information on how to resolve
-merge conflicts see the next section.
-
-‘m’     (‘magit-merge-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-   When no merge is in progress, then the popup buffer features the
-following commands.
-
-‘m m’     (‘magit-merge’)
-
-     Merge another branch or an arbitrary revision into the current
-     branch.  The branch or revision to be merged is read in the
-     minibuffer and defaults to the one at point.
-
-     Unless there are conflicts or a prefix argument is used, the
-     resulting merge commit uses a generic commit message, and the user
-     does not get a chance to inspect or change it before the commit is
-     created.  With a prefix argument this does not actually create the
-     merge commit, which makes it possible to inspect how conflicts were
-     resolved and to adjust the commit message.
-
-‘m e’     (‘magit-merge-editmsg’)
-
-     Merge another branch or an arbitrary revision into the current
-     branch and open a commit message buffer, so that the user can make
-     adjustments.  The commit is not actually created until the user
-     finishes with ‘C-c C-c’.
-
-‘m n’     (‘magit-merge-nocommit’)
-
-     Merge another branch or an arbitrary revision into the current
-     branch, but do not actually create the commit.  The user can then
-     further adjust the merge, even when automatic conflict resolution
-     succeeded and/or adjust the commit message.
-
-‘m p’     (‘magit-merge-preview’)
-
-     Preview result of merging another branch or an arbitrary revision
-     into the current branch.
-
-   When a merge is in progress, then the popup buffer features these
-commands instead.
-
-‘m m’     (‘magit-merge’)
-
-     After resolving conflicts, proceed with the merge.  If there are
-     still conflicts, then this fails.
-
-‘m a’     (‘magit-merge-abort’)
-
-     Abort the current merge operation.
-
-
-File: magit.info,  Node: Resolving Conflicts,  Next: Rebasing,  Prev: Merging,  Up: Manipulating
-
-6.7 Resolving Conflicts
-=======================
-
-When merging branches (or otherwise combining or changing history)
-conflicts can occur.  If you edited two completely different parts of
-the same file in two branches and then merge one of these branches into
-the other, then Git can resolve that on its own, but if you edit the
-same area of a file, then a human is required to decide how the two
-versions, or "sides of the conflict", are to be combined into one.
-
-   Here we can only provide a brief introduction to the subject and
-point you toward some tools that can help.  If you are new to this, then
-please also consult Git’s own documentation as well as other resources.
-
-   If a file has conflicts and Git cannot resolve them by itself, then
-it puts both versions into the affected file along with special markers
-whose purpose is to denote the boundaries of the unresolved part of the
-file and between the different versions.  These boundary lines begin
-with the strings consisting of six times the same character, one of ‘<’,
-‘|’, ‘=’ and ‘>’ and are followed by information about the source of the
-respective versions, e.g.:
-
-     <<<<<<< HEAD
-     Take the blue pill.
-     =======
-     Take the red pill.
-     >>>>>>> feature
-
-   In this case you have chosen to take the red pill on one branch and
-on another you picked the blue pill.  Now that you are merging these two
-diverging branches, Git cannot possibly know which pill you want to
-take.
-
-   To resolve that conflict you have to create a version of the affected
-area of the file by keeping only one of the sides, possibly by editing
-it in order to bring in the changes from the other side, remove the
-other versions as well as the markers, and then stage the result.  A
-possible resolution might be:
-
-     Take both pills.
-
-   Often it is useful to see not only the two sides of the conflict but
-also the "original" version from before the same area of the file was
-modified twice on different branches.  Instruct Git to insert that
-version as well by running this command once:
-
-     git config --global merge.conflictStyle diff3
-
-   The above conflict might then have looked like this:
-
-     <<<<<<< HEAD
-     Take the blue pill.
-     ||||||| merged common ancestors
-     Take either the blue or the red pill, but not both.
-     =======
-     Take the red pill.
-     >>>>>>> feature
-
-   If that were the case, then the above conflict resolution would not
-have been correct, which demonstrates why seeing the original version
-alongside the conflicting versions can be useful.
-
-   You can perform the conflict resolution completely by hand, but Emacs
-also provides some packages that help in the process: Smerge, Ediff
-(*note (ediff)Top::), and Emerge (*note (emacs)Emerge::).  Magit does
-not provide its own tools for conflict resolution, but it does make
-using Smerge and Ediff more convenient.  (Ediff supersedes Emerge, so
-you probably don’t want to use the latter anyway.)
-
-   In the Magit status buffer, files with unresolved conflicts are
-listed in the "Unstaged changes" and/or "Staged changes" sections.  They
-are prefixed with the word "unmerged", which in this context essentially
-is a synonym for "unresolved".
-
-   Pressing ‘RET’ while point is on such a file section shows a buffer
-visiting that file, turns on ‘smerge-mode’ in that buffer, and places
-point inside the first area with conflicts.  You should then resolve
-that conflict using regular edit commands and/or Smerge commands.
-
-   Unfortunately Smerge does not have a manual, but you can get a list
-of commands and binding ‘C-c ^ C-h’ and press ‘RET’ while point is on a
-command name to read its documentation.
-
-   Normally you would edit one version and then tell Smerge to keep only
-that version.  Use ‘C-c ^ m’ (‘smerge-keep-mine’) to keep the ‘HEAD’
-version or ‘C-c ^ o’ (‘smerge-keep-other’) to keep the version that
-follows "|||||||".  Then use ‘C-c ^ n’ to move to the next conflicting
-area in the same file.  Once you are done resolving conflicts, return to
-the Magit status buffer.  The file should now be shown as "modified", no
-longer as "unmerged", because Smerge automatically stages the file when
-you save the buffer after resolving the last conflict.
-
-   Alternatively you could use Ediff, which uses separate buffers for
-the different versions of the file.  To resolve conflicts in a file
-using Ediff press ‘e’ while point is on such a file in the status
-buffer.
-
-   Ediff can be used for other purposes as well.  For more information
-on how to enter Ediff from Magit, see *note Ediffing::.  Explaining how
-to use Ediff is beyond the scope of this manual, instead see *note
-(ediff)Top::.
-
-   If you are unsure whether you should Smerge or Ediff, then use the
-former.  It is much easier to understand and use, and except for truely
-complex conflicts, the latter is usually overkill.
-
-
-File: magit.info,  Node: Rebasing,  Next: Cherry Picking,  Prev: Resolving Conflicts,  Up: Manipulating
-
-6.8 Rebasing
-============
-
-Also see *note (gitman)git-rebase::.  For information on how to resolve
-conflicts that occur during rebases see the preceding section.
-
-‘r’     (‘magit-rebase-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-   When no rebase is in progress, then the popup buffer features the
-following commands.
-
-   Using one of these commands _starts_ a rebase sequence.  Git might
-then stop somewhere along the way, either because you told it to do so,
-or because applying a commit failed due to a conflict.  When that
-happens, then the status buffer shows information about the rebase
-sequence which is in progress in a section similar to a log section.
-See *note Information About In-Progress Rebase::.
-
-‘r p’     (‘magit-rebase-onto-pushremote’)
-
-     Rebase the current branch onto ‘branch.<name>.pushRemote’.  If that
-     variable is unset, then rebase onto ‘remote.pushDefault’.
-
-‘r u’     (‘magit-rebase-onto-upstream’)
-
-     Rebase the current branch onto its upstream branch.
-
-‘r e’     (‘magit-rebase’)
-
-     Rebase the current branch onto a branch read in the minibuffer.
-     All commits that are reachable from head but not from the selected
-     branch TARGET are being rebased."
-
-‘r s’     (‘magit-rebase-subset’)
-
-     Start a non-interactive rebase sequence with commits from START to
-     ‘HEAD’ onto NEWBASE. START has to be selected from a list of recent
-     commits.
-
-   Note that the popup also features the infix argument ‘--interactive’.
-This can be used to turn one of the above non-interactive rebase
-variants into an interactive rebase.
-
-   For example if you want to clean up a feature branch and at the same
-time rebase it onto ‘master’, then you could use ‘r-iu’.  But we
-recommend that you instead do that in two steps.  First use ‘ri’ to
-cleanup the feature branch, and then in a second step ‘ru’ to rebase it
-onto ‘master’.  That way if things turn out to be more complicated than
-you thought and/or you make a mistake and have to start over, then you
-only have to redo half the work.
-
-   Explicitly enabling ‘--interactive’ won’t have an effect on the
-following commands as they always use that argument anyway, even if it
-is not enabled in the popup.
-
-‘r i’     (‘magit-rebase-interactive’)
-
-     Start an interactive rebase sequence.
-
-‘r f’     (‘magit-rebase-autosquash’)
-
-     Combine squash and fixup commits with their intended targets.
-
-‘r m’     (‘magit-rebase-edit-commit’)
-
-     Edit a single older commit using rebase.
-
-‘r w’     (‘magit-rebase-reword-commit’)
-
-     Reword a single older commit using rebase.
-
-   When a rebase is in progress, then the popup buffer features these
-commands instead.
-
-‘r r’     (‘magit-rebase-continue’)
-
-     Restart the current rebasing operation.
-
-     In some cases this pops up a commit message buffer for you do edit.
-     With a prefix argument the old message is reused as-is.
-
-‘r s’     (‘magit-rebase-skip’)
-
-     Skip the current commit and restart the current rebase operation.
-
-‘r e’     (‘magit-rebase-edit’)
-
-     Edit the todo list of the current rebase operation.
-
-‘r a’     (‘magit-rebase-abort’)
-
-     Abort the current rebase operation, restoring the original branch.
-
-* Menu:
-
-* Editing Rebase Sequences::
-* Information About In-Progress Rebase::
-
-
-File: magit.info,  Node: Editing Rebase Sequences,  Next: Information About In-Progress Rebase,  Up: Rebasing
-
-6.8.1 Editing Rebase Sequences
-------------------------------
-
-‘C-c C-c’     (‘with-editor-finish’)
-
-     Finish the current editing session by returning with exit code 0.
-     Git then uses the rebase instructions it finds in the file.
-
-‘C-c C-k’     (‘with-editor-cancel’)
-
-     Cancel the current editing session by returning with exit code 1.
-     Git then forgoes starting the rebase sequence.
-
-‘RET’     (‘git-rebase-show-commit’)
-
-     Show the commit on the current line in another buffer and select
-     that buffer.
-
-‘SPC’     (‘git-rebase-show-or-scroll-up’)
-
-     Show the commit on the current line in another buffer without
-     selecting that buffer.  If the revision buffer is already visible
-     in another window of the current frame, then instead scroll that
-     window up.
-
-‘DEL’     (‘git-rebase-show-or-scroll-down’)
-
-     Show the commit on the current line in another buffer without
-     selecting that buffer.  If the revision buffer is already visible
-     in another window of the current frame, then instead scroll that
-     window down.
-
-‘p’     (‘git-rebase-backward-line’)
-
-     Move to previous line.
-
-‘n’     (‘forward-line’)
-
-     Move to next line.
-
-‘M-p’     (‘git-rebase-move-line-up’)
-
-     Move the current commit (or command) up.
-
-‘M-n’     (‘git-rebase-move-line-down’)
-
-     Move the current commit (or command) down.
-
-‘r’     (‘git-rebase-reword’)
-
-     Edit message of commit on current line.
-
-‘e’     (‘git-rebase-edit’)
-
-     Stop at the commit on the current line.
-
-‘s’     (‘git-rebase-squash’)
-
-     Meld commit on current line into previous commit, and edit message.
-
-‘f’     (‘git-rebase-fixup’)
-
-     Meld commit on current line into previous commit, discarding the
-     current commit’s message.
-
-‘k’     (‘git-rebase-kill-line’)
-
-     Kill the current action line.
-
-‘c’     (‘git-rebase-pick’)
-
-     Use commit on current line.
-
-‘x’     (‘git-rebase-exec’)
-
-     Insert a shell command to be run after the proceeding commit.
-
-     If there already is such a command on the current line, then edit
-     that instead.  With a prefix argument insert a new command even
-     when there already is one on the current line.  With empty input
-     remove the command on the current line, if any.
-
-‘y’     (‘git-rebase-insert’)
-
-     Read an arbitrary commit and insert it below current line.
-
-‘C-x u’     (‘git-rebase-undo’)
-
-     Undo some previous changes.  Like ‘undo’ but works in read-only
-     buffers.
-
- -- User Option: git-rebase-auto-advance
-
-     Whether to move to next line after changing a line.
-
- -- User Option: git-rebase-show-instructions
-
-     Whether to show usage instructions inside the rebase buffer.
-
- -- User Option: git-rebase-confirm-cancel
-
-     Whether confirmation is required to cancel.
-
-
-File: magit.info,  Node: Information About In-Progress Rebase,  Prev: Editing Rebase Sequences,  Up: Rebasing
-
-6.8.2 Information About In-Progress Rebase
-------------------------------------------
-
-While a rebase sequence is in progress, the status buffer features a
-section which lists the commits that have already been applied as well
-as the commits that still have to be applied.
-
-   The commits are split in two halves.  When rebase stops at a commit,
-either because the user has to deal with a conflict or explicitly
-requested that rebase stops at that commit, then point is placed on the
-commit that separates the two groups, i.e.  on ‘HEAD’.  The commits
-above it have not been applied yet, while it and the commits below it
-have already been applied.  In between these two groups of applied and
-yet-to-be applied commits, there sometimes is a commit which has been
-dropped.
-
-   Each commit is prefixed with a word and these words are additionally
-shown in different colors to indicate the status of the commits.
-
-   The following colors are used:
-
-   • Yellow commits have not been applied yet.
-
-   • Gray commits have already been applied.
-
-   • The blue commit is the ‘HEAD’ commit.
-
-   • The green commit is the commit the rebase sequence stopped at.  If
-     this is the same commit as ‘HEAD’ (e.g.  because you haven’t done
-     anything yet after rebase stopped at the commit, then this commit
-     is shown in blue, not green.  There can only be a green and a blue
-     commit at the same time, if you create one or more new commits
-     after rebase stops at a commit.
-
-   • Red commits have been dropped.  They are shown for reference only,
-     e.g.  to make it easier to diff.
-
-   Of course these colors are subject to the color-theme in use.
-
-   The following words are used:
-
-   • Commits prefixed with ‘pick’, ‘reword’, ‘edit’, ‘squash’, and
-     ‘fixup’ have not been applied yet.  These words have the same
-     meaning here as they do in the buffer used to edit the rebase
-     sequence.  See *note Editing Rebase Sequences::.
-
-   • The commit prefixed with ‘onto’ is the commit on top of which all
-     the other commits are being re-applied.  Like the commits that have
-     already been re-applied, it is reachable from ‘HEAD’, but unlike
-     those it has not actually been re-applied during the current
-     session - it wasn’t touched at all.
-
-   • Commits prefixed with ‘done’ have already been re-applied.  Not all
-     commits that have already been applied are prefixed with this word,
-     though.
-
-   • When a commit is prefixed with ‘void’, then that indicates that
-     Magit knows for sure that all the changes in that commit have been
-     applied using several new commits.  This commit is no longer
-     reachable from ‘HEAD’, and it also isn’t one of the commits that
-     will be applied when resuming the session.
-
-   • When a commit is prefixed with ‘join’, then that indicates that the
-     rebase sequence stopped at that commit due to a conflict - you now
-     have to join (merge) the changes with what has already been
-     applied.  In a sense this is the commit rebase stopped at, but
-     while its effect is already in the index and in the worktree (with
-     conflict markers), the commit itself has not actually been applied
-     yet (it isn’t the ‘HEAD’).  So it is shown in yellow, like the
-     other commits that still have to be applied.
-
-   • When a commit is prefixed with ‘goal’, ‘same’, or ‘work’, then that
-     indicates that you reset to an earlier commit (and that this commit
-     therefore is no longer reachable from ‘HEAD’), but that it might
-     still be possible to create a new commit with the exact same tree
-     or at least the same patch-id (1), without manually editing any
-     file.  Or at the very least that there are some uncommitted
-     remaining, which may or may not originate from that commit.
-
-        • When a commit is prefixed with ‘goal’, then that indicates
-          that it is still possible to create a commit with the exact
-          same tree (the "goal") without manually editing a file, by
-          simply committing the index (or, provided nothing is already
-          staged, by staging all unstaged changes and then committing
-          that).  This is the case when the original tree exists in the
-          index or worktree in untainted form.
-
-        • When a commit is prefixed with ‘same’, then that indicates
-          that it is no longer possible to create a commit with the
-          exact same tree, but that it is still possible to create a
-          commit with the same patch-id.  This would be the case if you
-          created a new commit with other changes, but the changes from
-          the original commit still exist in the index and/or working
-          tree in untainted form.
-
-        • When a commit is prefixed with ‘work’, then that indicates
-          that you are working with the changes from that commit after
-          resetting to an earlier commit.  There are changes in the
-          index and/or working tree and some of them likely originate
-          from that commit.
-
-   • When a commit is prefixed with ‘poof’ or ‘gone’, then that
-     indicates that you reset to an earlier commit (and that this commit
-     therefore is no longer reachable from ‘HEAD’), and that there are
-     no uncommitted changes remaining which might allow you to create a
-     new commit with the same tree or at least the same patch-id.
-
-        • When a commit is prefixed with ‘poof’, then that indicates
-          that it is no longer reachable from ‘HEAD’, but that it has
-          been replaced with one or more commits, which together have
-          the exact same effect.
-
-        • When a commit is prefixed with ‘gone’, then that indicates
-          that it is no longer reachable from ‘HEAD’ and that we also
-          cannot determine whether its changes are still in effect in
-          one or more new commits.  They might be, but if so, then there
-          must also be other changes which makes it impossible to know
-          for sure.
-
-   Do not worry if you do not fully understand the above.  That’s okay,
-you will acquire a good enough understanding through practice.
-
-   For other sequence operations such as cherry-picking, a similar
-section is displayed, but they lack some of the features described
-above, due to limitations in the git commands used to implement them.
-Most importantly these sequences only support "picking" a commit but not
-other actions such as "rewording", and they do not keep track of the
-commits which have already been applied.
-
-   ---------- Footnotes ----------
-
-   (1) The patch-id is a hash of the _changes_ introduced by commit.  It
-differs from hash of the commit itself, which is a hash of the result of
-applying that change (i.e.  the resulting trees and blobs) as well as
-author and committer information, the commit message, and the hashes of
-the parents of the commit.  The patch-id hash on the other hand is
-created only from the added and removed lines, even line numbers and
-whitespace are created when calculating the hash.  The patch-ids of two
-commits can be used to answer the question "Do these two commits make
-the same change?".
-
-
-File: magit.info,  Node: Cherry Picking,  Next: Resetting,  Prev: Rebasing,  Up: Manipulating
-
-6.9 Cherry Picking
-==================
-
-Also see *note (gitman)git-cherry-pick::.
-
-‘A’     (‘magit-cherry-pick-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-   When no cherry-pick or revert is in progress, then the popup buffer
-features the following commands.
-
-‘A A’     (‘magit-cherry-pick’)
-
-     Cherry-pick a commit.  Prompt for a commit, defaulting to the
-     commit at point.  If the region selects multiple commits, then pick
-     all of them, without prompting.
-
-‘A a’     (‘magit-cherry-apply’)
-
-     Apply the changes in a commit to the working tree, but do not
-     commit them.  Prompt for a commit, defaulting to the commit at
-     point.  If the region selects multiple commits, then apply all of
-     them, without prompting.
-
-     This command also has a top-level binding, which can be invoked
-     without using the popup by typing ‘a’ at the top-level.
-
-   When a cherry-pick or revert is in progress, then the popup buffer
-features these commands instead.
-
-‘A A’     (‘magit-sequence-continue’)
-
-     Resume the current cherry-pick or revert sequence.
-
-‘A s’     (‘magit-sequence-skip’)
-
-     Skip the stopped at commit during a cherry-pick or revert sequence.
-
-‘A a’     (‘magit-sequence-abort’)
-
-     Abort the current cherry-pick or revert sequence.  This discards
-     all changes made since the sequence started.
-
-* Menu:
-
-* Reverting::
-
-
-File: magit.info,  Node: Reverting,  Up: Cherry Picking
-
-6.9.1 Reverting
----------------
-
-‘V’     (‘magit-revert-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-   When no cherry-pick or revert is in progress, then the popup buffer
-features the following commands.
-
-‘V V’     (‘magit-revert’)
-
-     Revert a commit by creating a new commit.  Prompt for a commit,
-     defaulting to the commit at point.  If the region selects multiple
-     commits, then revert all of them, without prompting.
-
-‘V v’     (‘magit-revert-no-commit’)
-
-     Revert a commit by applying it in reverse to the working tree.
-     Prompt for a commit, defaulting to the commit at point.  If the
-     region selects multiple commits, then revert all of them, without
-     prompting.
-
-   When a cherry-pick or revert is in progress, then the popup buffer
-features these commands instead.
-
-‘V A’     (‘magit-sequence-continue’)
-
-     Resume the current cherry-pick or revert sequence.
-
-‘V s’     (‘magit-sequence-skip’)
-
-     Skip the stopped at commit during a cherry-pick or revert sequence.
-
-‘V a’     (‘magit-sequence-abort’)
-
-     Abort the current cherry-pick or revert sequence.  This discards
-     all changes made since the sequence started.
-
-
-File: magit.info,  Node: Resetting,  Next: Stashing,  Prev: Cherry Picking,  Up: Manipulating
-
-6.10 Resetting
-==============
-
-Also see *note (gitman)git-reset::.
-
-‘x’     (‘magit-reset’)
-
-     Reset the head and index to some commit read from the user and
-     defaulting to the commit at point.  The working tree is kept as-is.
-     With a prefix argument also reset the working tree.
-
-‘X m’     (‘magit-reset-head’)
-
-     Reset the ‘HEAD’ and index to some commit read from the user and
-     defaulting to the commit at point.  The working tree is kept as-is.
-
-‘X s’     (‘magit-reset-soft’)
-
-     Reset the ‘HEAD’ to some commit read from the user and defaulting
-     to the commit at point.  The index and the working tree are kept
-     as-is.
-
-‘X h’     (‘magit-reset-hard’)
-
-     Reset the ‘HEAD’, index, and working tree to some commit read from
-     the user and defaulting to the commit at point.
-
-‘X i’     (‘magit-reset-index’)
-
-     Reset the index to some commit read from the user and defaulting to
-     the commit at point.  Keep the ‘HEAD’ and working tree as-is, so if
-     the commit refers to the ‘HEAD’, then this effectively unstages all
-     changes.
-
-‘X f’     (‘magit-file-checkout’)
-
-     Update file in the working tree and index to the contents from a
-     revision.  Both the revision and file are read from the user.
-
-
-File: magit.info,  Node: Stashing,  Prev: Resetting,  Up: Manipulating
-
-6.11 Stashing
-=============
-
-Also see *note (gitman)git-stash::.
-
-‘z’     (‘magit-stash-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘z z’     (‘magit-stash’)
-
-     Create a stash of the index and working tree.  Untracked files are
-     included according to popup arguments.  One prefix argument is
-     equivalent to ‘--include-untracked’ while two prefix arguments are
-     equivalent to ‘--all’.
-
-‘z i’     (‘magit-stash-index’)
-
-     Create a stash of the index only.  Unstaged and untracked changes
-     are not stashed.
-
-‘z w’     (‘magit-stash-worktree’)
-
-     Create a stash of unstaged changes in the working tree.  Untracked
-     files are included according to popup arguments.  One prefix
-     argument is equivalent to ‘--include-untracked’ while two prefix
-     arguments are equivalent to ‘--all’.
-
-‘z x’     (‘magit-stash-keep-index’)
-
-     Create a stash of the index and working tree, keeping index intact.
-     Untracked files are included according to popup arguments.  One
-     prefix argument is equivalent to ‘--include-untracked’ while two
-     prefix arguments are equivalent to ‘--all’.
-
-‘z Z’     (‘magit-snapshot’)
-
-     Create a snapshot of the index and working tree.  Untracked files
-     are included according to popup arguments.  One prefix argument is
-     equivalent to ‘--include-untracked’ while two prefix arguments are
-     equivalent to ‘--all’.
-
-‘z I’     (‘magit-snapshot-index’)
-
-     Create a snapshot of the index only.  Unstaged and untracked
-     changes are not stashed.
-
-‘z W’     (‘magit-snapshot-worktree’)
-
-     Create a snapshot of unstaged changes in the working tree.
-     Untracked files are included according to popup arguments.  One
-     prefix argument is equivalent to ‘--include-untracked’ while two
-     prefix arguments are equivalent to ‘--all’-.
-
-‘z a’     (‘magit-stash-apply’)
-
-     Apply a stash to the working tree.  Try to preserve the stash
-     index.  If that fails because there are staged changes, apply
-     without preserving the stash index.
-
-‘z p’     (‘magit-stash-pop’)
-
-     Apply a stash to the working tree and remove it from stash list.
-     Try to preserve the stash index.  If that fails because there are
-     staged changes, apply without preserving the stash index and forgo
-     removing the stash.
-
-‘z k’     (‘magit-stash-drop’)
-
-     Remove a stash from the stash list.  When the region is active,
-     offer to drop all contained stashes.
-
-‘z v’     (‘magit-stash-show’)
-
-     Show all diffs of a stash in a buffer.
-
-‘z b’     (‘magit-stash-branch’)
-
-     Create and checkout a new BRANCH from STASH.
-
-‘z f’     (‘magit-stash-format-patch’)
-
-     Create a patch from STASH.
-
-‘k’     (‘magit-stash-clear’)
-
-     Remove all stashes saved in REF’s reflog by deleting REF.
-
-‘z l’     (‘magit-stash-list’)
-
-     List all stashes in a buffer.
-
- -- User Option: magit-stashes-margin
-
-     This option specifies whether the margin is initially shown in
-     stashes buffers and how it is formatted.
-
-     The value has the form ‘(INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH)’.
-
-        • If INIT is non-nil, then the margin is shown initially.
-
-        • STYLE controls how to format the committer date.  It can be
-          one of ‘age’ (to show the age of the commit),
-          ‘age-abbreviated’ (to abbreviate the time unit to a
-          character), or a string (suitable for ‘format-time-string’) to
-          show the actual date.
-
-        • WIDTH controls the width of the margin.  This exists for
-          forward compatibility and currently the value should not be
-          changed.
-
-        • AUTHOR controls whether the name of the author is also shown
-          by default.
-
-        • AUTHOR-WIDTH has to be an integer.  When the name of the
-          author is shown, then this specifies how much space is used to
-          do so.
-
-
-File: magit.info,  Node: Transferring,  Next: Miscellaneous,  Prev: Manipulating,  Up: Top
-
-7 Transferring
-**************
-
-* Menu:
-
-* Remotes::
-* Fetching::
-* Pulling::
-* Pushing::
-* Creating and Sending Patches::
-* Applying Patches::
-
-
-File: magit.info,  Node: Remotes,  Next: Fetching,  Up: Transferring
-
-7.1 Remotes
-===========
-
-Also see *note (gitman)git-remote::.
-
-‘M’     (‘magit-remote-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘M a’     (‘magit-remote-add’)
-
-     Add a remote and fetch it.  The remote name and url are read in the
-     minibuffer.
-
-‘M r’     (‘magit-remote-rename’)
-
-     Rename a remote.  Both the old and the new names are read in the
-     minibuffer.
-
-‘M u’     (‘magit-remote-set-url’)
-
-     Change the url of a remote.  Both the remote and the new url are
-     read in the minibuffer.
-
-‘M k’     (‘magit-remote-remove’)
-
-     Delete a remote, read from the minibuffer.
-
- -- User Option: magit-remote-add-set-remote.pushDefault
-
-     Whether to set the value of ‘remote.pushDefault’ after adding a
-     remote.
-
-     If ‘ask’, then always ask.  If ‘ask-if-unset’, then ask, but only
-     if the variable isn’t set already.  If ‘nil’, then don’t ever set.
-     If the value is a string, then set without asking, provided that
-     the name of the added remote is equal to that string and the
-     variable isn’t already set.
-
-
-File: magit.info,  Node: Fetching,  Next: Pulling,  Prev: Remotes,  Up: Transferring
-
-7.2 Fetching
-============
-
-For information about the differences between the _upstream_ and the
-_push-remote_, see *note Branching::.
-
-   Also see *note (gitman)git-fetch::.
-
-‘f’     (‘magit-fetch-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘f p’     (‘magit-fetch-from-pushremote’)
-
-     Fetch from the push-remote of the current branch.
-
-‘f u’     (‘magit-fetch-from-upstream’)
-
-     Fetch from the upstream of the current branch.
-
-‘f e’     (‘magit-fetch’)
-
-     Fetch from another repository.
-
-‘f o’     (‘magit-fetch-branch’)
-
-     Fetch a branch from a remote, both of which are read from the
-     minibuffer.
-
-‘f r’     (‘magit-fetch-refspec’)
-
-     Fetch from a remote using an explicit refspec, both of which are
-     read from the minibuffer.
-
-‘f a’     (‘magit-fetch-all’)
-
-     Fetch from all remotes.
-
-‘f m’     (‘magit-submodule-fetch’)
-
-     Fetch all submodules.  With a prefix argument fetch all remotes of
-     all submodules.
-
-   Instead of using one popup for fetching and another for pulling, you
-could also use ‘magit-pull-and-fetch-popup’.  See its doc-string for
-more information.
-
-
-File: magit.info,  Node: Pulling,  Next: Pushing,  Prev: Fetching,  Up: Transferring
-
-7.3 Pulling
-===========
-
-For information about the differences between the _upstream_ and the
-_push-remote_, see *note Branching::.
-
-   Also see *note (gitman)git-pull::.
-
-‘F’     (‘magit-pull-popup’)
-
-     This prefix command shows the following suffix commands in a popup
-     buffer.
-
-‘F p’     (‘magit-pull-from-pushremote’)
-
-     Pull from the push-remote of the current branch.
-
-‘F u’     (‘magit-pull-from-upstream’)
-
-     Pull from the upstream of the current branch.
-
-‘F e’     (‘magit-pull’)
-
-     Pull from a branch read in the minibuffer.
-
-   Instead of using one popup for fetching and another for pulling, you
-could also use ‘magit-pull-and-fetch-popup’.  See its doc-string for
-more information.
-
-
-File: magit.info,  Node: Pushing,  Next: Creating and Sending Patches,  Prev: Pulling,  Up: Transferring
-
-7.4 Pushing
-===========
-
-For information about the differences between the _upstream_ and the
-_push-remote_, see *note Branching::.
-
-   Also see *note (gitman)git-push::.
-
-‘P’     (‘magit-push-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘P p’     (‘magit-push-current-to-pushremote’)
-
-     Push the current branch to ‘branch.<name>.pushRemote’ or if that is
-     unset to ‘remote.pushDefault’.
-
-     When ‘magit-push-current-set-remote-if-missing’ is non-nil and the
-     push-remote is not configured, then read the push-remote from the
-     user, set it, and then push to it.  With a prefix argument the
-     push-remote can be changed before pushed to it.
-
-‘P u’     (‘magit-push-current-to-upstream’)
-
-     Push the current branch to its upstream branch.
-
-     When ‘magit-push-current-set-remote-if-missing’ is non-nil and the
-     push-remote is not configured, then read the upstram from the user,
-     set it, and then push to it.  With a prefix argument the
-     push-remote can be changed before pushed to it.
-
-‘P e’     (‘magit-push-current’)
-
-     Push the current branch to a branch read in the minibuffer.
-
-‘P o’     (‘magit-push’)
-
-     Push an arbitrary branch or commit somewhere.  Both the source and
-     the target are read in the minibuffer.
-
-‘P r’     (‘magit-push-refspecs’)
-
-     Push one or multiple refspecs to a remote, both of which are read
-     in the minibuffer.
-
-     To use multiple refspecs, separate them with commas.  Completion is
-     only available for the part before the colon, or when no colon is
-     used.
-
-‘P m’     (‘magit-push-matching’)
-
-     Push all matching branches to another repository.  If multiple
-     remotes exit, then read one from the user.  If just one exists, use
-     that without requiring confirmation.
-
-‘P t’     (‘magit-push-tags’)
-
-     Push all tags to another repository.  If only one remote exists,
-     then push to that.  Otherwise prompt for a remote, offering the
-     remote configured for the current branch as default.
-
-‘P T’     (‘magit-push-tag’)
-
-     Push a tag to another repository.
-
-   Two more push commands exist, which by default are not available from
-the push popup.  See their doc-strings for instructions on how to add
-them to the popup.
-
- -- Command: magit-push-implicitly args
-
-     Push somewhere without using an explicit refspec.
-
-     This command simply runs ‘git push -v [ARGS]’.  ARGS are the
-     arguments specified in the popup buffer.  No explicit refspec
-     arguments are used.  Instead the behavior depends on at least these
-     Git variables: ‘push.default’, ‘remote.pushDefault’,
-     ‘branch.<branch>.pushRemote’, ‘branch.<branch>.remote’,
-     ‘branch.<branch>.merge’, and ‘remote.<remote>.push’.
-
- -- Command: magit-push-to-remote remote args
-
-     Push to the remote REMOTE without using an explicit refspec.  The
-     remote is read in the minibuffer.
-
-     This command simply runs ‘git push -v [ARGS] REMOTE’.  ARGS are the
-     arguments specified in the popup buffer.  No refspec arguments are
-     used.  Instead the behavior depends on at least these Git
-     variables: ‘push.default’, ‘remote.pushDefault’,
-     ‘branch.<branch>.pushRemote’, ‘branch.<branch>.remote’,
-     ‘branch.<branch>.merge’, and ‘remote.<remote>.push’.
-
- -- User Option: magit-push-current-set-remote-if-missing
-
-     This option controls whether missing remotes are configured before
-     pushing.
-
-     When ‘nil’, then the command ‘magit-push-current-to-pushremote’ and
-     ‘magit-push-current-to-upstream’ do not appear in the push popup if
-     the push-remote resp.  upstream is not configured.  If the user
-     invokes one of these commands anyway, then it raises an error.
-
-     When ‘non-nil’, then these commands always appear in the push
-     popup.  But if the required configuration is missing, then they do
-     appear in a way that indicates that this is the case.  If the user
-     invokes one of them, then it asks for the necessary configuration,
-     stores the configuration, and then uses it to push a first time.
-
-     This option also affects whether the argument ‘--set-upstream’ is
-     available in the popup.  If the value is ‘non-nil’, then that
-     argument is redundant.  But note that changing the value of this
-     option does not take affect immediately, the argument will only be
-     added or removed after restarting Emacs.
-
-
-File: magit.info,  Node: Creating and Sending Patches,  Next: Applying Patches,  Prev: Pushing,  Up: Transferring
-
-7.5 Creating and Sending Patches
-================================
-
-‘W’     (‘magit-patch-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘W p’     (‘magit-format-patch’)
-
-     Create patches for a set commits.  If the region marks commits,
-     then create patches for those.  Otherwise prompt for a range or a
-     single commit, defaulting to the commit at point.
-
-‘W r’     (‘magit-request-pull’)
-
-     Request that upstream pulls from your public repository.
-
-
-File: magit.info,  Node: Applying Patches,  Prev: Creating and Sending Patches,  Up: Transferring
-
-7.6 Applying Patches
-====================
-
-Also see *note (gitman)git-am::.
-
-‘w’     (‘magit-am-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘w w’     (‘magit-am-apply-patches’)
-
-     Apply one or more patches.  If the region marks files, then apply
-     those patches.  Otherwise read a file name in the minibuffer
-     defaulting to the file at point.
-
-‘w m’     (‘magit-am-apply-maildir’)
-
-     Apply the patches from a maildir.
-
-‘w w’     (‘magit-am-continue’)
-
-     Resume the current patch applying sequence.
-
-‘w s’     (‘magit-am-skip’)
-
-     Skip the stopped at patch during a patch applying sequence.
-
-‘w a’     (‘magit-am-abort’)
-
-     Abort the current patch applying sequence.  This discards all
-     changes made since the sequence started.
-
-
-File: magit.info,  Node: Miscellaneous,  Next: Customizing,  Prev: Transferring,  Up: Top
-
-8 Miscellaneous
-***************
-
-* Menu:
-
-* Tagging::
-* Notes::
-* Submodules::
-* Subtree::
-* Common Commands::
-* Wip Modes::
-* Minor Mode for Buffers Visiting Files::
-* Minor Mode for Buffers Visiting Blobs::
-
-
-File: magit.info,  Node: Tagging,  Next: Notes,  Up: Miscellaneous
-
-8.1 Tagging
-===========
-
-Also see *note (gitman)git-tag::.
-
-‘t’     (‘magit-tag-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘t t’     (‘magit-tag’)
-
-     Create a new tag with the given NAME at REV. With a prefix argument
-     annotate the tag.
-
-‘t k’     (‘magit-tag-delete’)
-
-     Delete one or more tags.  If the region marks multiple tags (and
-     nothing else), then offer to delete those.  Otherwise, prompt for a
-     single tag to be deleted, defaulting to the tag at point.
-
-‘t p’     (‘magit-tag-prune’)
-
-     Offer to delete tags missing locally from REMOTE, and vice versa.
-
-
-File: magit.info,  Node: Notes,  Next: Submodules,  Prev: Tagging,  Up: Miscellaneous
-
-8.2 Notes
-=========
-
-Also see *note (gitman)git-notes::.
-
-‘T’     (‘magit-notes-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘T T’     (‘magit-notes-edit’)
-
-     Edit the note attached to a commit, defaulting to the commit at
-     point.
-
-     By default use the value of Git variable ‘core.notesRef’ or
-     "refs/notes/commits" if that is undefined.
-
-‘T r’     (‘magit-notes-remove’)
-
-     Remove the note attached to a commit, defaulting to the commit at
-     point.
-
-     By default use the value of Git variable ‘core.notesRef’ or
-     "refs/notes/commits" if that is undefined.
-
-‘T p’     (‘magit-notes-prune’)
-
-     Remove notes about unreachable commits.
-
-‘T s’     (‘magit-notes-set-ref’)
-
-     Set the current notes ref to a the value read from the user.  The
-     ref is made current by setting the value of the Git variable
-     ‘core.notesRef’.  With a prefix argument change the global value
-     instead of the value in the current repository.  When this is
-     undefined, then "refs/notes/commit" is used.
-
-     Other ‘magit-notes-*’ commands, as well as the sub-commands of
-     Git’s ‘note’ command, default to operate on that ref.
-
-‘T S’     (‘magit-notes-set-display-refs’)
-
-     Set notes refs to be display in addition to "core.notesRef".  This
-     reads a colon separated list of notes refs from the user.  The
-     values are stored in the Git variable ‘notes.displayRef’.  With a
-     prefix argument GLOBAL change the global values instead of the
-     values in the current repository.
-
-   It is possible to merge one note ref into another.  That may result
-in conflicts which have to resolved in the temporary worktree
-".git/NOTES_MERGE_WORKTREE".
-
-‘T m’     (‘magit-notes-merge’)
-
-     Merge the notes of a ref read from the user into the current notes
-     ref.  The current notes ref is the value of Git variable
-     ‘core.notesRef’ or "refs/notes/commits" if that is undefined.
-
-   When a notes merge is in progress then the popup features the
-following suffix commands, instead of those listed above.
-
-‘T c’     (‘magit-notes-merge-commit’)
-
-     Commit the current notes ref merge, after manually resolving
-     conflicts.
-
-‘T a’     (‘magit-notes-merge-abort’)
-
-     Abort the current notes ref merge.
-
-
-File: magit.info,  Node: Submodules,  Next: Subtree,  Prev: Notes,  Up: Miscellaneous
-
-8.3 Submodules
-==============
-
-Also see *note (gitman)git-submodule::.
-
-* Menu:
-
-* Listing Submodules::
-* Submodule Popup::
-
-
-File: magit.info,  Node: Listing Submodules,  Next: Submodule Popup,  Up: Submodules
-
-8.3.1 Listing Submodules
-------------------------
-
-The command ‘magit-list-submodules’ displays a list of the current
-repository’s submodules in a separate buffer.  It’s also possible to
-display information about submodules directly in the status buffer of
-the super-repository by adding ‘magit-insert-submodules’ to the hook
-‘magit-status-sections-hook’.
-
- -- Command: magit-list-submodules
-
-     This command displays a list of the current repository’s submodules
-     in a separate buffer.
-
-     It can be invoked by pressing ‘RET’ on the section titled
-     "Modules".
-
- -- User Option: magit-submodule-list-columns
-
-     This option controls what columns are displayed by the command
-     ‘magit-list-submodules’ and how they are displayed.
-
-     Each element has the form ‘(HEADER WIDTH FORMAT PROPS)’.
-
-     HEADER is the string displayed in the header.  WIDTH is the width
-     of the column.  FORMAT is a function that is called with one
-     argument, the repository identification (usually its basename), and
-     with ‘default-directory’ bound to the toplevel of its working tree.
-     It has to return a string to be inserted or nil.  PROPS is an alist
-     that supports the keys ‘:right-align’ and ‘:pad-right’.
-
- -- Function: magit-insert-submodules
-
-     Insert sections for all submodules.  For each section insert the
-     path, the branch, and the output of ‘git describe --tags’.
-
-     Press ‘RET’ on such a submodule section to show its own status
-     buffer.  Press ‘RET’ on the "Modules" section to display a list of
-     submodules in a separate buffer.  This shows additional information
-     not displayed in the super-repository’s status buffer.
-
-
-File: magit.info,  Node: Submodule Popup,  Prev: Listing Submodules,  Up: Submodules
-
-8.3.2 Submodule Popup
----------------------
-
-‘o’     (‘magit-submodule-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-‘o a’     (‘magit-submodule-add’)
-
-     Add the repository at URL as a submodule.  Optional PATH is the
-     path to the submodule relative to the root of the super-project.
-     If it is nil then the path is determined based on URL.
-
-‘o b’     (‘magit-submodule-setup’)
-
-     Clone and register missing submodules and checkout appropriate
-     commits.
-
-‘o i’     (‘magit-submodule-init’)
-
-     Register submodules listed in ".gitmodules" into ".git/config".
-
-‘o u’     (‘magit-submodule-update’)
-
-     Clone missing submodules and checkout appropriate commits.  With a
-     prefix argument also register submodules in ".git/config".
-
-‘o s’     (‘magit-submodule-sync’)
-
-     Update each submodule’s remote URL according to ".gitmodules".
-
-‘o f’     (‘magit-submodule-fetch’)
-
-     Fetch submodule.  With a prefix argument fetch all remotes.
-
-‘o i’     (‘magit-submodule-init’)
-
-     Unregister the submodule at PATH.
-
-
-File: magit.info,  Node: Subtree,  Next: Common Commands,  Prev: Submodules,  Up: Miscellaneous
-
-8.4 Subtree
-===========
-
-Also see *note (gitman)git-subtree::.
-
-‘O’     (‘magit-tree-popup’)
-
-     This prefix command shows the following suffix commands along with
-     the appropriate infix arguments in a popup buffer.
-
-   Most infix arguments only apply to some of the ‘git subtree’
-subcommands.  When an argument that does not apply to the invoked
-command is set, then it is silently ignored.
-
-   When the ‘--prefix’ argument is set in the popup buffer, then that is
-used.  Otherwise the prefix is read in the minibuffer.
-
-‘O a’     (‘magit-subtree-add’)
-
-     Add COMMIT from REPOSITORY as a new subtree at PREFIX.
-
-‘O c’     (‘magit-subtree-add-commit’)
-
-     Add COMMIT as a new subtree at PREFIX.
-
-‘O m’     (‘magit-subtree-merge’)
-
-     Merge COMMIT into the PREFIX subtree.
-
-‘O f’     (‘magit-subtree-pull’)
-
-     Pull COMMIT from REPOSITORY into the PREFIX subtree.
-
-‘O p’     (‘magit-subtree-push’)
-
-     Extract the history of the subtree PREFIX and push it to REF on
-     REPOSITORY.
-
-‘O s’     (‘magit-subtree-split’)
-
-     Extract the history of the subtree PREFIX.
-
-
-File: magit.info,  Node: Common Commands,  Next: Wip Modes,  Prev: Subtree,  Up: Miscellaneous
-
-8.5 Common Commands
-===================
-
-These are some of the commands that can be used in all buffers whose
-major-modes derive from ‘magit-mode’.  There are other common commands
-beside the ones below, but these didn’t fit well anywhere else.
-
-‘M-w’     (‘magit-copy-section-value’)
-
-     This command saves the value of the current section to the
-     ‘kill-ring’, and, provided that the current section is a commit,
-     branch, or tag section, it also pushes the (referenced) revision to
-     the ‘magit-revision-stack’.
-
-     When the current section is a branch or a tag, and a prefix
-     argument is used, then it saves the revision at its tip to the
-     ‘kill-ring’ instead of the reference name.
-
-‘C-w’     (‘magit-copy-buffer-revision’)
-
-     This command save the revision being displayed in the current
-     buffer to the ‘kill-ring’ and also pushes it to the
-     ‘magit-revision-stack’.  It is mainly intended for use in
-     ‘magit-revision-mode’ buffers, the only buffers where it is always
-     unambiguous exactly which revision should be saved.
-
-     Most other Magit buffers usually show more than one revision, in
-     some way or another, so this command has to select one of them, and
-     that choice might not always be the one you think would have been
-     the best pick.
-
-   Outside of Magit ‘M-w’ and ‘C-w’ are usually bound to
-‘kill-ring-save’ and ‘kill-region’, and these commands would also be
-useful in Magit buffers.  Therefore when the region is active, then both
-of these commands behave like ‘kill-ring-save’ instead of as described
-above.
-
-
-File: magit.info,  Node: Wip Modes,  Next: Minor Mode for Buffers Visiting Files,  Prev: Common Commands,  Up: Miscellaneous
-
-8.6 Wip Modes
-=============
-
-Git keeps *committed* changes around long enough for users to recover
-changes they have accidentally deleted.  It does so by not garbage
-collecting any committed but no longer referenced objects for a certain
-period of time, by default 30 days.
-
-   But Git does *not* keep track of *uncommitted* changes in the working
-tree and not even the index (the staging area).  Because Magit makes it
-so convenient to modify uncommitted changes, it also makes it easy to
-shoot yourself in the foot in the process.
-
-   For that reason Magit provides three global modes that save *tracked*
-files to work-in-progress references after or before certain actions.
-(Untracked files are never saved and these modes also only work after
-the first commit has been created).
-
-   Two separate work-in-progress references are used to track the state
-of the index and of the working tree: "refs/wip/index/<branchref>" and
-"refs/wip/wtree/<branchref>", where ‘<branchref>’ is the full ref of the
-current branch, e.g.  "refs/heads/master".  When the ‘HEAD’ is detached
-then "HEAD" is in place of ‘<branchref>’.
-
-   Checking out another branch (or detaching ‘HEAD’) causes the use of
-different wip refs for subsequent changes, but the old refs are not
-deleted.
-
-   Creating a commit and then making a change causes the wip refs to be
-recreated to fork from the new commit.  But the old commits on the wip
-refs are not lost.  They are still available from the reflog.  To make
-it easier to see when the fork point of a wip ref was changed, an
-additional commit with the message "restart autosaving" is created on it
-(‘xxO’ commits below are such boundary commits).
-
-   Starting with
-
-           BI0---BI1    refs/wip/index/refs/heads/master
-          /
-     A---B              refs/heads/master
-          \
-           BW0---BW1    refs/wip/wtree/refs/heads/master
-
-   and committing the staged changes and editing and saving a file would
-result in
-
-           BI0---BI1        refs/wip/index/refs/heads/master
-          /
-     A---B---C              refs/heads/master
-          \   \
-           \   CW0---CW1    refs/wip/wtree/refs/heads/master
-            \
-             BW0---BW1      refs/wip/wtree/refs/heads/master@{2}
-
-   The fork-point of the index wip ref is not changed until some change
-is being staged.  Likewise just checking out a branch or creating a
-commit does not change the fork-point of the working tree wip ref.  The
-fork-points are not adjusted until there actually is a change that
-should be committed to the respective wip ref.
-
-   To view the log for the a branch and its wip refs use the commands
-‘magit-wip-log’ and ‘magit-wip-log-current’.  You should use ‘--graph’
-when using these commands.  Alternatively you can use the reflog to show
-all commits that ever existed on a wip ref.  You can then recover lost
-changes from the commits shown in the log or reflog.
-
- -- Command: magit-wip-log
-
-     This command shows the log for a branch and its wip refs.
-
-     With a negative prefix argument only the worktree wip ref is shown.
-     The absolute numeric value of the prefix argument controls how many
-     "branches" of each wip ref are shown.
-
- -- Command: magit-wip-log-current
-
-     This command shows the log for the current branch and its wip refs.
-
-     With a negative prefix argument only the worktree wip ref is shown.
-     The absolute numeric value of the prefix argument controls how many
-     "branches" of each wip ref are shown.
-
-   There exists a total of three global modes that save to the wip refs,
-which might seem excessive, but allows fine tuning of when exactly
-changes are being committed to the wip refs.  Enabling all modes makes
-it less likely that a change slips through the cracks.
-
-   Setting the below variable directly does not take effect; either
-customize them or call the respective mode function.
-
- -- User Option: magit-wip-after-save-mode
-
-     When this mode is enabled, then saving a buffer that visits a file
-     tracked in a Git repository causes its current state to be
-     committed to the working tree wip ref for the current branch.
-
- -- User Option: magit-wip-after-apply-mode
-
-     When this mode is enabled, then applying (i.e.  staging, unstaging,
-     discarding, reversing, and regularly applying) a change to a file
-     tracked in a Git repository causes its current state to be
-     committed to the index and/or working tree wip refs for the current
-     branch.
-
-   If you only ever edit files using Emacs and only ever interact with
-Git using Magit, then the above two modes should be enough to protect
-each and every change from accidental loss.  In practice nobody does
-that.  So an additional mode exists that does commit to the wip refs
-before making changes that could cause the loss of earlier changes.
-
- -- User Option: magit-wip-before-change-mode
-
-     When this mode is enabled, then certain commands commit the
-     existing changes to the files they are about to make changes to.
-
-   Note that even if you enable all three modes this won’t give you
-perfect protection.  The most likely scenario for losing changes despite
-the use of these modes is making a change outside Emacs and then
-destroying it also outside Emacs.  In such a scenario, Magit, being an
-Emacs package, didn’t get the opportunity to keep you from shooting
-yourself in the foot.
-
-   When you are unsure whether Magit did commit a change to the wip
-refs, then you can explicitly request that all changes to all tracked
-files are being committed.
-
-‘M-x magit-wip-commit’     (‘magit-wip-commit’)
-
-     This command commits all changes to all tracked files to the index
-     and working tree work-in-progress refs.  Like the modes described
-     above, it does not commit untracked files, but it does check all
-     tracked files for changes.  Use this command when you suspect that
-     the modes might have overlooked a change made outside Emacs/Magit.
-
- -- User Option: magit-wip-after-save-local-mode-lighter
-
-     Mode-line lighter for ‘magit-wip-after-save-local-mode’.
-
- -- User Option: magit-wip-after-apply-mode-lighter
-
-     Mode-line lighter for ‘magit-wip-after-apply-mode’.
-
- -- User Option: magit-wip-before-change-mode-lighter
-
-     Mode-line lighter for ‘magit-wip-before-change-mode’.
-
- -- User Option: magit-wip-namespace
-
-     The namespace used for work-in-progress refs.  It has to end with a
-     slash.  The wip refs are named "<namespace>index/<branchref>" and
-     "<namespace>wtree/<branchref>".  When snapshots are created while
-     the ‘HEAD’ is detached then "HEAD" is used in place of
-     ‘<branchref>’.
-
-
-File: magit.info,  Node: Minor Mode for Buffers Visiting Files,  Next: Minor Mode for Buffers Visiting Blobs,  Prev: Wip Modes,  Up: Miscellaneous
-
-8.7 Minor Mode for Buffers Visiting Files
-=========================================
-
-The ‘magit-file-mode’ enables certain Magit features in file-visiting
-buffers belonging to a Git repository.  It should be enabled globally
-using ‘global-magit-file-mode’.  Currently this mode only establishes a
-few key bindings, but this might be extended in the future.
-
- -- User Option: magit-file-mode
-
-     Whether to establish certain Magit key bindings in all
-     file-visiting buffers belonging to a Git repository.  This
-     establishes the bindings suggested in *note Getting Started:: (but
-     only for file-visiting buffers), and additionally binds ‘C-c M-g’
-     to ‘magit-file-popup’.
-
-‘C-c M-g’     (‘magit-file-popup’)
-
-     This prefix command shows a popup buffer featuring suffix commands
-     that operate on the file being visited in the current buffer.
-
-‘C-c M-g s’     (‘magit-stage-file’)
-
-     Stage all changes to the file being visited in the current buffer.
-
-‘C-c M-g u’     (‘magit-unstage-file’)
-
-     Unstage all changes to the file being visited in the current
-     buffer.
-
-‘C-c M-g c’     (‘magit-commit-popup’)
-
-     This prefix command shows suffix commands along with the
-     appropriate infix arguments in a popup buffer.  See *note
-     Initiating a Commit::.
-
-‘C-c M-g D’     (‘magit-diff-buffer-file-popup’)
-
-     This prefix command shows the same suffix commands and infix
-     arguments in a popup buffer as ‘magit-diff-popup’.  But this
-     variant has to be called from a file-visiting buffer and the
-     visited file is automatically used in the popup to limit the diff
-     to that file.
-
-‘C-c M-g d’     (‘magit-diff-buffer-file’)
-
-     This command shows the diff for the file of blob that the current
-     buffer visits.
-
- -- User Option: magit-diff-buffer-file-locked
-
-     This option controls whether ‘magit-diff-buffer-file’ uses a
-     decicated buffer.  See *note Modes and Buffers::.
-
-‘C-c M-g L’     (‘magit-log-buffer-file-popup’)
-
-     This prefix command shows the same suffix commands and infix
-     arguments in a popup buffer as ‘magit-log-popup’.  But this variant
-     has to be called from a file-visiting buffer and the visited file
-     is automatically used in the popup to limit the log to that file.
-
-‘C-c M-g l’     (‘magit-log-buffer-file’)
-
-     This command shows the log for the file of blob that the current
-     buffer visits.  Renames are followed when a prefix argument is used
-     or when ‘--follow’ is part of ‘magit-log-arguments’.  When the
-     region is active, the log is restricted to the selected line range.
-
- -- User Option: magit-log-buffer-file-locked
-
-     This option controls whether ‘magit-log-buffer-file’ uses a
-     decicated buffer.  See *note Modes and Buffers::.
-
-‘C-c M-g b’     (‘magit-blame-popup’)
-
-     This prefix command shows the ‘magit-blame’ suffix command along
-     with the appropriate infix arguments in a popup buffer.  See *note
-     Initiating a Commit::.
-
-‘C-c M-g p’     (‘magit-blob-previous’)
-
-     Visit the previous blob which modified the current file.
-
-
-File: magit.info,  Node: Minor Mode for Buffers Visiting Blobs,  Prev: Minor Mode for Buffers Visiting Files,  Up: Miscellaneous
-
-8.8 Minor Mode for Buffers Visiting Blobs
-=========================================
-
-The ‘magit-blob-mode’ enables certain Magit features in blob-visiting
-buffers.  Such buffers can be created using ‘magit-find-file’ and some
-of the commands mentioned below, which also take care of turning on this
-minor mode.  Currently this mode only establishes a few key bindings,
-but this might be extended.
-
-‘p’     (‘magit-blob-previous’)
-
-     Visit the previous blob which modified the current file.
-
-‘n’     (‘magit-blob-next’)
-
-     Visit the next blob which modified the current file.
-
-‘q’     (‘magit-kill-this-buffer’)
-
-     Kill the current buffer.
-
-
-File: magit.info,  Node: Customizing,  Next: Plumbing,  Prev: Miscellaneous,  Up: Top
-
-9 Customizing
-*************
-
-Both Git and Emacs are highly customizable.  Magit is both a Git
-porcelain as well as an Emacs package, so it makes sense to customize it
-using both Git variables as well as Emacs options.  However this
-flexibility doesn’t come without problems, including but not limited to
-the following.
-
-   • Some Git variables automatically have an effect in Magit without
-     requiring any explicit support.  Sometimes that is desirable - in
-     other cases, it breaks Magit.
-
-     When a certain Git setting breaks Magit but you want to keep using
-     that setting on the command line, then that can be accomplished by
-     overriding the value for Magit only by appending something like
-     ‘("-c" "some.variable=compatible-value")’ to
-     ‘magit-git-global-arguments’.
-
-   • Certain settings like ‘fetch.prune=true’ are respected by Magit
-     commands (because they simply call the respective Git command) but
-     their value is not reflected in the respective popup buffers.  In
-     this case the ‘--prune’ argument in ‘magit-fetch-popup’ might be
-     active or inactive depending on the value of
-     ‘magit-fetch-arguments’ only, but that doesn’t keep the Git
-     variable from being honored by the suffix commands anyway.  So
-     pruning might happen despite the the ‘--prune’ arguments being
-     displayed in a way that seems to indicate that no pruning will
-     happen.
-
-   I intend to address these and similar issues in a future release.
-
-* Menu:
-
-* Per-Repository Configuration::
-* Essential Settings::
-
-
-File: magit.info,  Node: Per-Repository Configuration,  Next: Essential Settings,  Up: Customizing
-
-9.1 Per-Repository Configuration
-================================
-
-Magit can be configured on a per-repository level using both Git
-variables as well as Emacs options.
-
-   To set a Git variable for one repository only, simply set it in
-‘/path/to/repo/.git/config’ instead of ‘$HOME/.gitconfig’ or
-‘/etc/gitconfig’.  See *note (gitman)git-config::.
-
-   Similarly, Emacs options can be set for one repository only by
-editing ‘/path/to/repo/.dir-locals.el’.  See *note (emacs)Directory
-Variables::.  For example to disable automatic refreshes of
-file-visiting buffers in just one huge repository use this:
-
-   • ‘/path/to/huge/repo/.dir-locals.el’
-
-          ((nil . ((magit-refresh-buffers . nil))
-
-   If you want to apply the same settings to several, but not all,
-repositories then keeping the repository-local config files in sync
-would quickly become annoying.  To avoid that you can create config
-files for certain classes of repositories (e.g.  "huge repositories")
-and then include those files in the per-repository config files.  For
-example:
-
-   • ‘/path/to/huge/repo/.git/config’
-
-          [include]
-                  path = /path/to/huge-gitconfig
-
-   • ‘/path/to/huge-gitconfig’
-
-          [status]
-                  showUntrackedFiles = no
-
-   • ‘$HOME/.emacs.d/init.el’
-
-          (dir-locals-set-class-variables 'huge-git-repository
-             '((nil . ((magit-refresh-buffers . nil)))))
-
-          (dir-locals-set-directory-class
-             "/path/to/huge/repo/" 'huge-git-repository)
-
-
-File: magit.info,  Node: Essential Settings,  Prev: Per-Repository Configuration,  Up: Customizing
-
-9.2 Essential Settings
-======================
-
-The next two sections list and discuss several variables that many users
-might want to customize, for safety and/or performance reasons.
-
-* Menu:
-
-* Safety::
-* Performance::
-
-
-File: magit.info,  Node: Safety,  Next: Performance,  Up: Essential Settings
-
-9.2.1 Safety
-------------
-
-This section discusses various variables that you might want to change
-(or *not* change) for safety reasons.
-
-   Git keeps *committed* changes around long enough for users to recover
-changes they have accidentally been deleted.  It does not do the same
-for *uncommitted* changes in the working tree and not even the index
-(the staging area).  Because Magit makes it so easy to modify
-uncommitted changes, it also makes it easy to shoot yourself in the foot
-in the process.  For that reason Magit provides three global modes that
-save *tracked* files to work-in-progress references after or before
-certain actions.  See *note Wip Modes::.
-
-   These modes are not enabled by default because of performance
-concerns.  Instead a lot of potentially destructive commands require
-confirmation every time they are used.  In many cases this can be
-disabled by adding a symbol to ‘magit-no-confirm’ (see *note Completion
-and Confirmation::).  If you enable the various wip modes then you
-should add ‘safe-with-wip’ to this list.
-
-   Similarly it isn’t necessary to require confirmation before moving a
-file to the system trash - if you trashed a file by mistake then you can
-recover it from the there.  Option ‘magit-delete-by-moving-to-trash’
-controls whether the system trash is used, which is the case by default.
-Nevertheless, ‘trash’ isn’t a member of ‘magit-no-confirm’ - you might
-want to change that.
-
-   By default buffers visiting files are automatically reverted when the
-visited file changes on disk.  This isn’t as risky as it might seem, but
-to make an informed decision you should see *note Risk of Reverting
-Automatically::.
-
-
-File: magit.info,  Node: Performance,  Prev: Safety,  Up: Essential Settings
-
-9.2.2 Performance
------------------
-
-After Magit has run ‘git’ for side-effects, it also refreshes the
-current Magit buffer and the respective status buffer.  This is
-necessary because otherwise outdated information might be displayed
-without the user noticing.  Magit buffers are updated by recreating
-their content from scratch, which makes updating simpler and less
-error-prone, but also more costly.  Keeping it simple and just
-re-creating everything from scratch is an old design decision and
-departing from that will require major refactoring.
-
-   I plan to do that in time for the next major release.  I also intend
-to create logs and diffs asynchronously, which should also help a lot
-but also requires major refactoring.
-
-   Meanwhile you can tell Magit to only automatically refresh the
-current Magit buffer, but not the status buffer.  If you do that, then
-the status buffer is only refreshed automatically if it itself is the
-current buffer.
-
-     (setq magit-refresh-status-buffer nil)
-
-   You should also check whether any third-party packages have added
-anything to ‘magit-refresh-buffer-hook’, ‘magit-status-refresh-hook’,
-‘magit-pre-refresh-hook’, and ‘magit-post-refresh-hook’.  If so, then
-check whether those additions impacts performance significantly.
-Setting ‘magit-refresh-verbose’ and then inspecting the output in the
-‘*Messages*’ buffer, should help doing so.
-
-   Magit also reverts buffers which visit files located inside the
-current repository, when the visited file changes on disk.  That is
-implemented on top of ‘auto-revert-mode’ from the built-in library
-‘autorevert’.  To figure out whether that impacts performance, check
-whether performance is significantly worse, when many buffers exist
-and/or when some buffers visit files using Tramp.  If so, then this
-should help.
-
-     (setq auto-revert-buffer-list-filter
-           'magit-auto-revert-repository-buffers-p)
-
-   For alternative approaches see *note Automatic Reverting of
-File-Visiting Buffers::.
-
-   If you have enabled any features that are disabled by default, then
-you should check whether they impact performance significantly.  It’s
-likely that they were not enabled by default because it is known that
-they reduce performance at least in large repositories.
-
-   If performance is only slow inside certain unusually large
-repositories, then you might want to disable certain features on a
-per-repository or per-repository-class basis only.  See *note
-Per-Repository Configuration::.
-
-* Menu:
-
-* Microsoft Windows Performance::
-* MacOS Performance::
-
-Log Performance
-...............
-
-When showing logs, Magit limits the number of commits initially shown in
-the hope that this avoids unnecessary work.  When using ‘--graph’ is
-used, then this unfortunately does not have the desired effect for large
-histories.  Junio, Git’s maintainer, said on the git mailing list
-(<http://www.spinics.net/lists/git/msg232230.html>): "‘--graph’ wants to
-compute the whole history and the max-count only affects the output
-phase after ‘--graph’ does its computation".
-
-   In other words, it’s not that Git is slow at outputting the
-differences, or that Magit is slow at parsing the output - the problem
-is that Git first goes outside and has a smoke.
-
-   We actually work around this issue by limiting the number of commits
-not only by using ‘-<N>’ but by also using a range.  But unfortunately
-that’s not always possible.
-
-   In repositories with more than a few thousand commits ‘--graph’
-should never be a member of ‘magit-log-section-arguments’.  That
-variable is used in the status buffer which is refreshed every time you
-run any Magit command.
-
-   Using ‘--color --graph’ is even slower.  Magit uses code that is part
-of Emacs to turn control characters into faces.  That code is pretty
-slow and this is quite noticeable when showing a log with many branches
-and merges.  For that reason ‘--color’ is not enabled by default
-anymore.  Consider leaving it at that.
-
-Diff Performance
-................
-
-If diffs are slow, then consider turning off some optional diff features
-by setting all or some of the following variables to ‘nil’:
-‘magit-diff-highlight-indentation’, ‘magit-diff-highlight-trailing’,
-‘magit-diff-paint-whitespace’, ‘magit-diff-highlight-hunk-body’, and
-‘magit-diff-refine-hunk’.
-
-   When showing a commit instead of some arbitrary diff, then some
-additional information is displayed.  Calculating this information can
-be quite expensive given certain circumstances.  If looking at a commit
-using ‘magit-revision-mode’ takes considerably more time than looking at
-the same commit in ‘magit-diff-mode’, then consider setting
-‘magit-revision-insert-related-refs’ to ‘nil’.
-
-Refs Buffer Performance
-.......................
-
-When refreshing the "references buffer" is slow, then that’s usually
-because several hundred refs are being displayed.  The best way to
-address that is to display fewer refs, obviously.
-
-   If you are not, or only mildly, interested in seeing the list of
-tags, then start by not displaying them:
-
-     (remove-hook 'magit-refs-sections-hook 'magit-insert-tags)
-
-   Then you should also make sure that the listed remote branches
-actually all exist.  You can do so by pruning branches which no longer
-exist using ‘f-pa’.
-
-Committing Performance
-......................
-
-When you initiate a commit, then Magit by default automatically shows a
-diff of the changes you are about to commit.  For large commits this can
-take a long time, which is especially distracting when you are
-committing large amounts of generated data which you don’t actually
-intend to inspect before committing.  This behavior can be turned off
-using:
-
-     (remove-hook 'server-switch-hook 'magit-commit-diff)
-
-   Then you can type ‘C-c C-d’ to show the diff when you actually want
-to see it, but only then.  Alternatively you can leave the hook alone
-and just type ‘C-g’ in those cases when it takes to long to generate the
-diff.  If you do that, then you will end up with a broken diff buffer,
-but doing it this way has the advantage that you usually get to see the
-diff, which is useful because it increases the odds that you spot
-potential issues.
-
-The Built-In VC Package
-.......................
-
-Emacs comes with a version control interface called "VC", see *note
-(emacs)Version Control::.  It is enabled be default and if you don’t use
-it in addition to Magit, then you should disable it to keep it from
-performing unnecessary work:
-
-     (setq vc-handled-backends nil)
-
-   You can also disable its use only for Git but keep using it when
-using another version control system:
-
-     (setq vc-handled-backends (delq 'Git vc-handled-backends))
-
-
-File: magit.info,  Node: Microsoft Windows Performance,  Next: MacOS Performance,  Up: Performance
-
-Microsoft Windows Performance
-.............................
-
-In order to update the status buffer, ‘git’ has to be run a few dozen
-times.  That is problematic on Microsoft Windows, because that operating
-system is exceptionally slow at starting processes.  Sadly this is an
-issue that can only be fixed by Microsoft itself, and they don’t appear
-to be particularly interested in doing so.
-
-   Beside the subprocess issue, there also exist other Window-specific
-performance issues, some of which can be worked around.  The maintainers
-of "Git for Windows" try to reduce their effect, and in order to benefit
-from the latest performance tweaks, should always use the latest
-release.  Magit too tries to work around some Windows-specific issues.
-
-   According to some sources setting the following Git variables can
-also help.
-
-     git config --global core.preloadindex true   # default since v2.1
-     git config --global core.fscache true        # default since v2.8
-     git config --global gc.auto 256
-
-   You should also check whether an anti-virus program is slowing things
-down.
-
-
-File: magit.info,  Node: MacOS Performance,  Prev: Microsoft Windows Performance,  Up: Performance
-
-MacOS Performance
-.................
-
-On macOS Emacs currently creates child processes using ‘fork’.  It
-appears that this also copies GUI resources.  The result is that forking
-takes about 30 times as long on Darwin than on Linux.  And because Magit
-starts many ‘git’ processes even when doing simple things, that makes
-quite a difference.
-
-   On the ‘master’ branch Emacs now uses ‘vfork’ when possible, like
-this was already done on Linux, and now child creation only takes about
-twice as long on Darwin.  See (1) for more information.
-
-   Nobody knows when the changes on the ‘master’ branch will be released
-as ‘26.1’, but it is still a long way off.  You might want to get your
-hands on this change before then.  The easiest way to get a patched
-Emacs is to install the ‘emacs-plus’ formula (2) using ‘homebrew’.  The
-change has been backported, so you get it not only when using ‘--HEAD’,
-but also when using ‘--devel’ or when installing the latest release (by
-not using a version argument).
-
-   Alternatively you can apply the backport (3) manually.
-
-   ---------- Footnotes ----------
-
-   (1) 
-<https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-04/msg00201.html>
-
-   (2) <https://github.com/d12frosted/homebrew-emacs-plus>
-
-   (3) 
-<https://gist.githubusercontent.com/aaronjensen/f45894ddf431ecbff78b1bcf533d3e6b/raw/6a5cd7f57341aba673234348d8b0d2e776f86719/Emacs-25-OS-X-use-vfork.patch>
-
-
-File: magit.info,  Node: Plumbing,  Next: FAQ,  Prev: Customizing,  Up: Top
-
-10 Plumbing
-***********
-
-The following sections describe how to use several of Magit’s core
-abstractions to extend Magit itself or implement a separate extension.
-
-   A few of the low-level features used by Magit have been factored out
-into separate libraries/packages, so that they can be used by other
-packages, without having to depend on Magit.  These libraries are
-described in separate manuals, see *note (with-editor)Top:: and *note
-(magit-popup)Top::.
-
-   If you are trying to find an unused key that you can bound to a
-command provided by your own Magit extension, then checkout
-<https://github.com/magit/magit/wiki/Plugin-Dispatch-Key-Registry>.
-
-* Menu:
-
-* Calling Git::
-* Section Plumbing::
-* Refreshing Buffers::
-* Conventions::
-
-
-File: magit.info,  Node: Calling Git,  Next: Section Plumbing,  Up: Plumbing
-
-10.1 Calling Git
-================
-
-Magit provides many specialized functions for calling Git.  All of these
-functions are defined in either ‘magit-git.el’ or ‘magit-process.el’ and
-have one of the prefixes ‘magit-run-’, ‘magit-call-’, ‘magit-start-’, or
-‘magit-git-’ (which is also used for other things).
-
-   All of these functions accept an indefinite number of arguments,
-which are strings that specify command line arguments for git (or in
-some cases an arbitrary executable).  These arguments are flattened
-before being passed on to the executable; so instead of strings they can
-also be lists of strings and arguments that are ‘nil’ are silently
-dropped.  Some of these functions also require a single mandatory
-argument before these command line arguments.
-
-   Roughly speaking these functions run Git either to get some value or
-for side-effect.  The functions that return a value are useful to
-collect the information necessary to populate a Magit buffer, while the
-others are used to implement Magit commands.
-
-   The functions in the value-only group always run synchronously, and
-they never trigger a refresh.  The function in the side-effect group can
-be further divided into subgroups depending on whether they run Git
-synchronously or asynchronously, and depending on whether they trigger a
-refresh when the executable has finished.
-
-* Menu:
-
-* Getting a Value from Git::
-* Calling Git for Effect::
-
-
-File: magit.info,  Node: Getting a Value from Git,  Next: Calling Git for Effect,  Up: Calling Git
-
-10.1.1 Getting a Value from Git
--------------------------------
-
-These functions run Git in order to get a value, either its exit status
-or its output.  Of course you could also use them to run Git commands
-that have side-effects, but that should be avoided.
-
- -- Function: magit-git-exit-code &rest args
-
-     Executes git with ARGS and returns its exit code.
-
- -- Function: magit-git-success &rest args
-
-     Executes git with ARGS and returns ‘t’ if the exit code is ‘0’,
-     ‘nil’ otherwise.
-
- -- Function: magit-git-failure &rest args
-
-     Executes git with ARGS and returns ‘t’ if the exit code is ‘1’,
-     ‘nil’ otherwise.
-
- -- Function: magit-git-true &rest args
-
-     Executes git with ARGS and returns ‘t’ if the first line printed by
-     git is the string "true", ‘nil’ otherwise.
-
- -- Function: magit-git-false &rest args
-
-     Executes git with ARGS and returns ‘t’ if the first line printed by
-     git is the string "false", ‘nil’ otherwise.
-
- -- Function: magit-git-insert &rest args
-
-     Executes git with ARGS and inserts its output at point.
-
- -- Function: magit-git-string &rest args
-
-     Executes git with ARGS and returns the first line of its output.
-     If there is no output or if it begins with a newline character,
-     then this returns ‘nil’.
-
- -- Function: magit-git-lines &rest args
-
-     Executes git with ARGS and returns its output as a list of lines.
-     Empty lines anywhere in the output are omitted.
-
- -- Function: magit-git-items &rest args
-
-     Executes git with ARGS and returns its null-separated output as a
-     list.  Empty items anywhere in the output are omitted.
-
-     If the value of option ‘magit-git-debug’ is non-nil and git exits
-     with a non-zero exit status, then warn about that in the echo area
-     and add a section containing git’s standard error in the current
-     repository’s process buffer.
-
-   When an error occurs when using one of the above functions, then that
-is usually due to a bug, i.e.  the use of an argument which is not
-actually supported.  Such errors are usually not reported, but when they
-occur we need to be able to debug them.
-
- -- User Option: magit-git-debug
-
-     Whether to report errors that occur when using ‘magit-git-insert’,
-     ‘magit-git-string’, ‘magit-git-lines’, or ‘magit-git-items’.  This
-     does not actually raise an error.  Instead a message is shown in
-     the echo area, and git’s standard error is insert into a new
-     section in the current repository’s process buffer.
-
- -- Function: magit-git-str &rest args
-
-     This is a variant of ‘magit-git-string’ that ignores the option
-     ‘magit-git-debug’.  It is mainly intended to be used while handling
-     errors in functions that do respect that option.  Using such a
-     function while handing an error could cause yet another error and
-     therefore lead to an infinite recursion.  You probably won’t ever
-     need to use this function.
-
-
-File: magit.info,  Node: Calling Git for Effect,  Prev: Getting a Value from Git,  Up: Calling Git
-
-10.1.2 Calling Git for Effect
------------------------------
-
-These functions are used to run git to produce some effect.  Most Magit
-commands that actually run git do so by using such a function.
-
-   Because we do not need to consume git’s output when using these
-functions, their output is instead logged into a per-repository buffer,
-which can be shown using ‘$’ from a Magit buffer or ‘M-x magit-process’
-elsewhere.
-
-   These functions can have an effect in two distinct ways.  Firstly,
-running git may change something, i.e.  create or push a new commit.
-Secondly, that change may require that Magit buffers are refreshed to
-reflect the changed state of the repository.  But refreshing isn’t
-always desirable, so only some of these functions do perform such a
-refresh after git has returned.
-
-   Sometimes it is useful to run git asynchronously.  For example, when
-the user has just initiated a push, then there is no reason to make her
-wait until that has completed.  In other cases it makes sense to wait
-for git to complete before letting the user do something else.  For
-example after staging a change it is useful to wait until after the
-refresh because that also automatically moves to the next change.
-
- -- Function: magit-call-git &rest args
-
-     Calls git synchronously with ARGS.
-
- -- Function: magit-call-process program &rest args
-
-     Calls PROGRAM synchronously with ARGS.
-
- -- Function: magit-run-git &rest args
-
-     Calls git synchronously with ARGS and then refreshes.
-
- -- Function: magit-run-git-with-input input &rest args
-
-     Calls git synchronously with ARGS and sends it INPUT on standard
-     input.
-
-     INPUT should be a buffer or the name of an existing buffer.  The
-     content of that buffer is used as the process’ standard input.
-     After the process returns a refresh is performed.
-
-     As a special case, INPUT may also be nil.  In that case the content
-     of the current buffer is used as standard input and *no* refresh is
-     performed.
-
-     This function actually runs git asynchronously.  But then it waits
-     for the process to return, so the function itself is synchronous.
-
- -- Function: magit-run-git-with-logfile file &rest args
-
-     Calls git synchronously with ARGS. The process’ output is saved in
-     FILE. This is rarely useful and so this function might be removed
-     in the future.
-
-     This function actually runs git asynchronously.  But then it waits
-     for the process to return, so the function itself is synchronous.
-
- -- Function: magit-git &rest args
-
-     Calls git synchronously with ARGS for side-effects only.  This
-     function does not refresh the buffer.
-
- -- Function: magit-git-wash washer &rest args
-
-     Execute Git with ARGS, inserting washed output at point.  Actually
-     first insert the raw output at point.  If there is no output call
-     ‘magit-cancel-section’.  Otherwise temporarily narrow the buffer to
-     the inserted text, move to its beginning, and then call function
-     WASHER with ARGS as its sole argument.
-
-   And now for the asynchronous variants.
-
- -- Function: magit-run-git-async &rest args
-
-     Start Git, prepare for refresh, and return the process object.
-     ARGS is flattened and then used as arguments to Git.
-
-     Display the command line arguments in the echo area.
-
-     After Git returns some buffers are refreshed: the buffer that was
-     current when this function was called (if it is a Magit buffer and
-     still alive), as well as the respective Magit status buffer.
-     Unmodified buffers visiting files that are tracked in the current
-     repository are reverted if ‘magit-revert-buffers’ is non-nil.
-
- -- Function: magit-run-git-with-editor &rest args
-
-     Export GIT_EDITOR and start Git.  Also prepare for refresh and
-     return the process object.  ARGS is flattened and then used as
-     arguments to Git.
-
-     Display the command line arguments in the echo area.
-
-     After Git returns some buffers are refreshed: the buffer that was
-     current when this function was called (if it is a Magit buffer and
-     still alive), as well as the respective Magit status buffer.
-
- -- Function: magit-start-git &rest args
-
-     Start Git, prepare for refresh, and return the process object.
-
-     If INPUT is non-nil, it has to be a buffer or the name of an
-     existing buffer.  The buffer content becomes the processes standard
-     input.
-
-     Option ‘magit-git-executable’ specifies the Git executable and
-     option ‘magit-git-global-arguments’ specifies constant arguments.
-     The remaining arguments ARGS specify arguments to Git.  They are
-     flattened before use.
-
-     After Git returns, some buffers are refreshed: the buffer that was
-     current when this function was called (if it is a Magit buffer and
-     still alive), as well as the respective Magit status buffer.
-     Unmodified buffers visiting files that are tracked in the current
-     repository are reverted if ‘magit-revert-buffers’ is non-nil.
-
- -- Function: magit-start-process &rest args
-
-     Start PROGRAM, prepare for refresh, and return the process object.
-
-     If optional argument INPUT is non-nil, it has to be a buffer or the
-     name of an existing buffer.  The buffer content becomes the
-     processes standard input.
-
-     The process is started using ‘start-file-process’ and then setup to
-     use the sentinel ‘magit-process-sentinel’ and the filter
-     ‘magit-process-filter’.  Information required by these functions is
-     stored in the process object.  When this function returns the
-     process has not started to run yet so it is possible to override
-     the sentinel and filter.
-
-     After the process returns, ‘magit-process-sentinel’ refreshes the
-     buffer that was current when ‘magit-start-process’ was called (if
-     it is a Magit buffer and still alive), as well as the respective
-     Magit status buffer.  Unmodified buffers visiting files that are
-     tracked in the current repository are reverted if
-     ‘magit-revert-buffers’ is non-nil.
-
- -- Variable: magit-this-process
-
-     The child process which is about to start.  This can be used to
-     change the filter and sentinel.
-
- -- Variable: magit-process-raise-error
-
-     When this is non-nil, then ‘magit-process-sentinel’ raises an error
-     if git exits with a non-zero exit status.  For debugging purposes.
-
-
-File: magit.info,  Node: Section Plumbing,  Next: Refreshing Buffers,  Prev: Calling Git,  Up: Plumbing
-
-10.2 Section Plumbing
-=====================
-
-* Menu:
-
-* Creating Sections::
-* Section Selection::
-* Matching Sections::
-
-
-File: magit.info,  Node: Creating Sections,  Next: Section Selection,  Up: Section Plumbing
-
-10.2.1 Creating Sections
-------------------------
-
- -- Macro: magit-insert-section &rest args
-
-     Insert a section at point.
-
-     TYPE is the section type, a symbol.  Many commands that act on the
-     current section behave differently depending on that type.  Also if
-     a variable ‘magit-TYPE-section-map’ exists, then use that as the
-     text-property ‘keymap’ of all text belonging to the section (but
-     this may be overwritten in subsections).  TYPE can also have the
-     form ‘(eval FORM)’ in which case FORM is evaluated at runtime.
-
-     Optional VALUE is the value of the section, usually a string that
-     is required when acting on the section.
-
-     When optional HIDE is non-nil collapse the section body by default,
-     i.e.  when first creating the section, but not when refreshing the
-     buffer.  Otherwise, expand it by default.  This can be overwritten
-     using ‘magit-section-set-visibility-hook’.  When a section is
-     recreated during a refresh, then the visibility of predecessor is
-     inherited and HIDE is ignored (but the hook is still honored).
-
-     BODY is any number of forms that actually insert the section’s
-     heading and body.  Optional NAME, if specified, has to be a symbol,
-     which is then bound to the struct of the section being inserted.
-
-     Before BODY is evaluated the ‘start’ of the section object is set
-     to the value of ‘point’ and after BODY was evaluated its ‘end’ is
-     set to the new value of ‘point’; BODY is responsible for moving
-     ‘point’ forward.
-
-     If it turns out inside BODY that the section is empty, then
-     ‘magit-cancel-section’ can be used to abort and remove all traces
-     of the partially inserted section.  This can happen when creating a
-     section by washing Git’s output and Git didn’t actually output
-     anything this time around.
-
- -- Function: magit-insert-heading &rest args
-
-     Insert the heading for the section currently being inserted.
-
-     This function should only be used inside ‘magit-insert-section’.
-
-     When called without any arguments, then just set the ‘content’ slot
-     of the object representing the section being inserted to a marker
-     at ‘point’.  The section should only contain a single line when
-     this function is used like this.
-
-     When called with arguments ARGS, which have to be strings, then
-     insert those strings at point.  The section should not contain any
-     text before this happens and afterwards it should again only
-     contain a single line.  If the ‘face’ property is set anywhere
-     inside any of these strings, then insert all of them unchanged.
-     Otherwise use the ‘magit-section-heading’ face for all inserted
-     text.
-
-     The ‘content’ property of the section struct is the end of the
-     heading (which lasts from ‘start’ to ‘content’) and the beginning
-     of the body (which lasts from ‘content’ to ‘end’).  If the value of
-     ‘content’ is nil, then the section has no heading and its body
-     cannot be collapsed.  If a section does have a heading then its
-     height must be exactly one line, including a trailing newline
-     character.  This isn’t enforced; you are responsible for getting it
-     right.  The only exception is that this function does insert a
-     newline character if necessary.
-
- -- Function: magit-cancel-section
-
-     Cancel the section currently being inserted.  This exits the
-     innermost call to ‘magit-insert-section’ and removes all traces of
-     what has already happened inside that call.
-
- -- Function: magit-define-section-jumper sym title &optional value
-
-     Define an interactive function to go to section SYM. TITLE is the
-     displayed title of the section.
-
-
-File: magit.info,  Node: Section Selection,  Next: Matching Sections,  Prev: Creating Sections,  Up: Section Plumbing
-
-10.2.2 Section Selection
-------------------------
-
- -- Function: magit-current-section
-
-     Return the section at point.
-
- -- Function: magit-region-sections
-
-     Return a list of the selected sections.
-
-     When the region is active and constitutes a valid section
-     selection, then return a list of all selected sections.  This is
-     the case when the region begins in the heading of a section and
-     ends in the heading of a sibling of that first section.  When the
-     selection is not valid then return nil.  Most commands that can act
-     on the selected sections, then instead just act on the current
-     section, the one point is in.
-
-     When the region looks like it would in any other buffer then the
-     selection is invalid.  When the selection is valid then the region
-     uses the ‘magit-section-highlight’.  This does not apply to diffs
-     where things get a bit more complicated, but even here if the
-     region looks like it usually does, then that’s not a valid
-     selection as far as this function is concerned.
-
- -- Function: magit-region-values &rest types
-
-     Return a list of the values of the selected sections.
-
-     Also see ‘magit-region-sections’ whose doc-string explains when a
-     region is a valid section selection.  If the region is not active
-     or is not a valid section selection, then return nil.  If optional
-     TYPES is non-nil then the selection not only has to be valid; the
-     types of all selected sections additionally have to match one of
-     TYPES, or nil is returned.
-
-
-File: magit.info,  Node: Matching Sections,  Prev: Section Selection,  Up: Section Plumbing
-
-10.2.3 Matching Sections
-------------------------
-
-‘M-x magit-describe-section’     (‘magit-describe-section’)
-
-     Show information about the section at point.  This command is
-     intended for debugging purposes.
-
- -- Function: magit-section-ident
-
-     Return an unique identifier for SECTION. The return value has the
-     form ‘((TYPE . VALUE)...)’.
-
- -- Function: magit-get-section
-
-     Return the section identified by IDENT. IDENT has to be a list as
-     returned by ‘magit-section-ident’.
-
- -- Function: magit-section-match condition &optional section
-
-     Return ‘t’ if SECTION matches CONDITION. SECTION defaults to the
-     section at point.  If SECTION is not specified and there also is no
-     section at point, then return ‘nil’.
-
-     CONDITION can take the following forms:
-        • ‘(CONDITION...)’
-
-          matches if any of the CONDITIONs matches.
-
-        • ‘[TYPE...]’
-
-          matches if the first TYPE matches the type of the section, the
-          second matches that of its parent, and so on.
-
-        • ‘[* TYPE...]’
-
-          matches sections that match [TYPE…] and also recursively all
-          their child sections.
-
-        • ‘TYPE’
-
-          matches sections of TYPE regardless of the types of the parent
-          sections.
-     Each TYPE is a symbol.  Note that it is not necessary to specify
-     all TYPEs up to the root section as printed by
-     ‘magit-describe-type’, unless of course you want to be that
-     precise.
-
- -- Function: magit-section-when condition &rest body
-
-     If the section at point matches CONDITION evaluate BODY.
-
-     If the section matches, then evaluate BODY forms sequentially with
-     ‘it’ bound to the section and return the value of the last form.
-     If there are no BODY forms, then return the value of the section.
-     If the section does not match or if there is no section at point
-     then return nil.
-
-     See ‘magit-section-match’ for the forms CONDITION can take.
-
- -- Function: magit-section-case &rest clauses
-
-     Choose among clauses on the type of the section at point.
-
-     Each clause looks like (CONDITION BODY…).  The type of the section
-     is compared against each CONDITION; the BODY forms of the first
-     match are evaluated sequentially and the value of the last form is
-     returned.  Inside BODY the symbol ‘it’ is bound to the section at
-     point.  If no clause succeeds or if there is no section at point
-     return nil.
-
-     See ‘magit-section-match’ for the forms CONDITION can take.
-     Additionally a CONDITION of t is allowed in the final clause and
-     matches if no other CONDITION match, even if there is no section at
-     point.
-
- -- Variable: magit-root-section
-
-     The root section in the current buffer.  All other sections are
-     descendants of this section.  The value of this variable is set by
-     ‘magit-insert-section’ and you should never modify it.
-
-   For diff related sections a few additional tools exist.
-
- -- Function: magit-diff-type &optional section
-
-     Return the diff type of SECTION.
-
-     The returned type is one of the symbols ‘staged’, ‘unstaged’,
-     ‘committed’, or ‘undefined’.  This type serves a similar purpose as
-     the general type common to all sections (which is stored in the
-     ‘type’ slot of the corresponding ‘magit-section’ struct) but takes
-     additional information into account.  When the SECTION isn’t
-     related to diffs and the buffer containing it also isn’t a
-     diff-only buffer, then return nil.
-
-     Currently the type can also be one of ‘tracked’ and ‘untracked’,
-     but these values are not handled explicitly in every place they
-     should be.  A possible fix could be to just return nil here.
-
-     The section has to be a ‘diff’ or ‘hunk’ section, or a section
-     whose children are of type ‘diff’.  If optional SECTION is nil,
-     return the diff type for the current section.  In buffers whose
-     major mode is ‘magit-diff-mode’ SECTION is ignored and the type is
-     determined using other means.  In ‘magit-revision-mode’ buffers the
-     type is always ‘committed’.
-
- -- Function: magit-diff-scope &optional section strict
-
-     Return the diff scope of SECTION or the selected section(s).
-
-     A diff’s "scope" describes what part of a diff is selected, it is a
-     symbol, one of ‘region’, ‘hunk’, ‘hunks’, ‘file’, ‘files’, or
-     ‘list’.  Do not confuse this with the diff "type", as returned by
-     ‘magit-diff-type’.
-
-     If optional SECTION is non-nil, then return the scope of that,
-     ignoring the sections selected by the region.  Otherwise return the
-     scope of the current section, or if the region is active and
-     selects a valid group of diff related sections, the type of these
-     sections, i.e.  ‘hunks’ or ‘files’.  If SECTION (or if the current
-     section that is nil) is a ‘hunk’ section and the region starts and
-     ends inside the body of a that section, then the type is ‘region’.
-
-     If optional STRICT is non-nil then return nil if the diff type of
-     the section at point is ‘untracked’ or the section at point is not
-     actually a ‘diff’ but a ‘diffstat’ section.
-
-
-File: magit.info,  Node: Refreshing Buffers,  Next: Conventions,  Prev: Section Plumbing,  Up: Plumbing
-
-10.3 Refreshing Buffers
-=======================
-
-All commands that create a new Magit buffer or change what is being
-displayed in an existing buffer do so by calling ‘magit-mode-setup’.
-Among other things, that function sets the buffer local values of
-‘default-directory’ (to the top-level of the repository),
-‘magit-refresh-function’, and ‘magit-refresh-args’.
-
-   Buffers are refreshed by calling the function that is the local value
-of ‘magit-refresh-function’ (a function named ‘magit-*-refresh-buffer’,
-where ‘*’ may be something like ‘diff’) with the value of
-‘magit-refresh-args’ as arguments.
-
- -- Macro: magit-mode-setup buffer switch-func mode refresh-func
-          &optional refresh-args
-
-     This function displays and selects BUFFER, turns on MODE, and
-     refreshes a first time.
-
-     This function displays and optionally selects BUFFER by calling
-     ‘magit-mode-display-buffer’ with BUFFER, MODE and SWITCH-FUNC as
-     arguments.  Then it sets the local value of
-     ‘magit-refresh-function’ to REFRESH-FUNC and that of
-     ‘magit-refresh-args’ to REFRESH-ARGS. Finally it creates the buffer
-     content by calling REFRESH-FUNC with REFRESH-ARGS as arguments.
-
-     All arguments are evaluated before switching to BUFFER.
-
- -- Function: magit-mode-display-buffer buffer mode &optional
-          switch-function
-
-     This function display BUFFER in some window and select it.  BUFFER
-     may be a buffer or a string, the name of a buffer.  The buffer is
-     returned.
-
-     Unless BUFFER is already displayed in the selected frame, store the
-     previous window configuration as a buffer local value, so that it
-     can later be restored by ‘magit-mode-bury-buffer’.
-
-     The buffer is displayed and selected using SWITCH-FUNCTION. If that
-     is ‘nil’ then ‘pop-to-buffer’ is used if the current buffer’s major
-     mode derives from ‘magit-mode’.  Otherwise ‘switch-to-buffer’ is
-     used.
-
- -- Variable: magit-refresh-function
-
-     The value of this buffer-local variable is the function used to
-     refresh the current buffer.  It is called with ‘magit-refresh-args’
-     as arguments.
-
- -- Variable: magit-refresh-args
-
-     The list of arguments used by ‘magit-refresh-function’ to refresh
-     the current buffer.  ‘magit-refresh-function’ is called with these
-     arguments.
-
-     The value is usually set using ‘magit-mode-setup’, but in some
-     cases it’s also useful to provide commands which can change the
-     value.  For example, the ‘magit-diff-refresh-popup’ can be used to
-     change any of the arguments used to display the diff, without
-     having to specify again which differences should be shown.
-     ‘magit-diff-more-context’, ‘magit-diff-less-context’, and
-     ‘magit-diff-default-context’ change just the ‘-U<N>’ argument.  In
-     both case this is done by changing the value of this variable and
-     then calling this ‘magit-refresh-function’.
-
-
-File: magit.info,  Node: Conventions,  Prev: Refreshing Buffers,  Up: Plumbing
-
-10.4 Conventions
-================
-
-* Menu:
-
-* Confirmation and Completion::
-* Theming Faces::
-
-
-File: magit.info,  Node: Confirmation and Completion,  Next: Theming Faces,  Up: Conventions
-
-10.4.1 Confirmation and Completion
-----------------------------------
-
-Dangerous operations that may lead to data loss have to be confirmed by
-default.  With a multi-section selection, this is done using questions
-that can be answered with "yes" or "no".  When the region isn’t active,
-or if it doesn’t constitute a valid section selection, then such
-commands instead read a single item in the minibuffer.  When the value
-of the current section is among the possible choices, then that is
-presented as default choice.  To confirm the action on a single item,
-the user has to answer ‘RET’ (instead of "yes"), and to abort, ‘C-g’
-(instead of "no").  But alternatively the user may also select another
-item, just like if the command had been invoked with no suitable section
-at point at all.
-
-
-File: magit.info,  Node: Theming Faces,  Prev: Confirmation and Completion,  Up: Conventions
-
-10.4.2 Theming Faces
---------------------
-
-The default theme uses blue for local branches, green for remote
-branches, and goldenrod (brownish yellow) for tags.  When creating a new
-theme, you should probably follow that example.  If your theme already
-uses other colors, then stick to that.
-
-   In older releases these reference faces used to have a background
-color and a box around them.  The basic default faces no longer do so,
-to make Magit buffers much less noisy, and you should follow that
-example at least with regards to boxes.  (Boxes were used in the past to
-work around a conflict between the highlighting overlay and text
-property backgrounds.  That’s no longer necessary because highlighting
-no longer causes other background colors to disappear.)  Alternatively
-you can keep the background color and/or box, but then have to take
-special care to adjust ‘magit-branch-current’ accordingly.  By default
-it looks mostly like ‘magit-branch-local’, but with a box (by default
-the former is the only face that uses a box, exactly so that it sticks
-out).  If the former also uses a box, then you have to make sure that it
-differs in some other way from the latter.
-
-   The most difficult faces to theme are those related to diffs,
-headings, highlighting, and the region.  There are faces that fall into
-all four groups - expect to spend some time getting this right.
-
-   The ‘region’ face in the default theme, in both the light and dark
-variants, as well as in many other themes, distributed with Emacs or by
-third-parties, is very ugly.  It is common to use a background color
-that really sticks out, which is ugly but if that were the only problem
-then it would be acceptable.  Unfortunately many themes also set the
-foreground color, which ensures that all text within the region is
-readable.  Without doing that there might be cases where some foreground
-color is too close to the region background color to still be readable.
-But it also means that text within the region loses all syntax
-highlighting.
-
-   I consider the work that went into getting the ‘region’ face right to
-be a good indicator for the general quality of a theme.  My
-recommendation for the ‘region’ face is this: use a background color
-slightly different from the background color of the ‘default’ face, and
-do not set the foreground color at all.  So for a light theme you might
-use a light (possibly tinted) gray as the background color of ‘default’
-and a somewhat darker gray for the background of ‘region’.  That should
-usually be enough to not collide with the foreground color of any other
-face.  But if some other faces also set a light gray as background
-color, then you should also make sure it doesn’t collide with those (in
-some cases it might be acceptable though).
-
-   Magit only uses the ‘region’ face when the region is "invalid" by its
-own definition.  In a Magit buffer the region is used to either select
-multiple sibling sections, so that commands which support it act on all
-of these sections instead of just the current section, or to select
-lines within a single hunk section.  In all other cases, the section is
-considered invalid and Magit won’t act on it.  But such invalid sections
-happen, either because the user has not moved point enough yet to make
-it valid or because she wants to use a non-magit command to act on the
-region, e.g.  ‘kill-region’.
-
-   So using the regular ‘region’ face for invalid sections is a feature.
-It tells the user that Magit won’t be able to act on it.  It’s
-acceptable if that face looks a bit odd and even (but less so) if it
-collides with the background colors of section headings and other things
-that have a background color.
-
-   Magit highlights the current section.  If a section has subsections,
-then all of them are highlighted.  This is done using faces that have
-"highlight" in their names.  For most sections,
-‘magit-section-highlight’ is used for both the body and the heading.
-Like the ‘region’ face, it should only set the background color to
-something similar to that of ‘default’.  The highlight background color
-must be different from both the ‘region’ background color and the
-‘default’ background color.
-
-   For diff related sections Magit uses various faces to highlight
-different parts of the selected section(s).  Note that hunk headings,
-unlike all other section headings, by default have a background color,
-because it is useful to have very visible separators between hunks.
-That face ‘magit-diff-hunk-heading’, should be different from both
-‘magit-diff-hunk-heading-highlight’ and ‘magit-section-highlight’, as
-well as from ‘magit-diff-context’ and ‘magit-diff-context-highlight’.
-By default we do that by changing the foreground color.  Changing the
-background color would lead to complications, and there are already
-enough we cannot get around.  (Also note that it is generally a good
-idea for section headings to always be bold, but only for sections that
-have subsections).
-
-   When there is a valid region selecting diff-related sibling sections,
-i.e.  multiple files or hunks, then the bodies of all these sections use
-the respective highlight faces, but additionally the headings instead
-use one of the faces ‘magit-diff-file-heading-selection’ or
-‘magit-diff-hunk-heading-selection’.  These faces have to be different
-from the regular highlight variants to provide explicit visual
-indication that the region is active.
-
-   When theming diff related faces, start by setting the option
-‘magit-diff-refine-hunk’ to ‘all’.  You might personally prefer to only
-refine the current hunk or not use hunk refinement at all, but some of
-the users of your theme want all hunks to be refined, so you have to
-cater to that.
-
-   (Also turn on ‘magit-diff-highlight-indentation’,
-‘magit-diff-highlight-trailing’, and ‘magit-diff-paint-whitespace’; and
-insert some whitespace errors into the code you use for testing.)
-
-   For e.g.  "added lines" you have to adjust three faces:
-‘magit-diff-added’, ‘magit-diff-added-highlight’, and
-‘smerge-refined-added’.  Make sure that the latter works well with both
-of the former, as well as ‘smerge-other’ and ‘diff-added’.  Then do the
-same for the removed lines, context lines, lines added by us, and lines
-added by them.  Also make sure the respective added, removed, and
-context faces use approximately the same saturation for both the
-highlighted and unhighlighted variants.  Also make sure the file and
-diff headings work nicely with context lines (e.g.  make them look
-different).  Line faces should set both the foreground and the
-background color.  For example, for added lines use two different
-greens.
-
-   It’s best if the foreground color of both the highlighted and the
-unhighlighted variants are the same, so you will need to have to find a
-color that works well on the highlight and unhighlighted background, the
-refine background, and the highlight context background.  When there is
-an hunk internal region, then the added- and removed-lines background
-color is used only within that region.  Outside the region the
-highlighted context background color is used.  This makes it easier to
-see what is being staged.  With an hunk internal region the hunk heading
-is shown using ‘magit-diff-hunk-heading-selection’, and so are the thin
-lines that are added around the lines that fall within the region.  The
-background color of that has to be distinct enough from the various
-other involved background colors.
-
-   Nobody said this would be easy.  If your theme restricts itself to a
-certain set of colors, then you should make an exception here.
-Otherwise it would be impossible to make the diffs look good in each and
-every variation.  Actually you might want to just stick to the default
-definitions for these faces.  You have been warned.  Also please note
-that if you do not get this right, this will in some cases look to users
-like bugs in Magit - so please do it right or not at all.
-
-
-File: magit.info,  Node: FAQ,  Next: Debugging Tools,  Prev: Plumbing,  Up: Top
-
-Appendix A FAQ
-**************
-
-The next two nodes lists frequently asked questions.  For a list of
-frequently *and recently* asked questions, i.e.  questions that haven’t
-made it into the manual yet, see
-<https://github.com/magit/magit/wiki/FAQ>.
-
-   Please also use the *note Debugging Tools::.
-
-* Menu:
-
-* FAQ - How to …?::
-* FAQ - Issues and Errors::
-
-
-File: magit.info,  Node: FAQ - How to …?,  Next: FAQ - Issues and Errors,  Up: FAQ
-
-A.1 FAQ - How to …?
-===================
-
-* Menu:
-
-* How to show git's output?::
-* How to install the gitman info manual?::
-* How to show diffs for gpg-encrypted files?::
-* How does branching and pushing work?::
-* Can Magit be used as ‘ediff-version-control-package’?::
-
-
-File: magit.info,  Node: How to show git's output?,  Next: How to install the gitman info manual?,  Up: FAQ - How to …?
-
-A.1.1 How to show git’s output?
--------------------------------
-
-To show the output of recently run git commands, press ‘$’ (or, if that
-isn’t available, ‘M-x magit-process-buffer’).  This will show a buffer
-containing a section per git invocation; as always press ‘TAB’ to expand
-or collapse them.
-
-   By default git’s output is only inserted into the process buffer if
-it is run for side-effects.  When the output is consumed in some way
-then also inserting it into the process buffer would be to expensive.
-For debugging purposes it’s possible to do so anyway by setting
-‘magit-git-debug’ to ‘t’.
-
-
-File: magit.info,  Node: How to install the gitman info manual?,  Next: How to show diffs for gpg-encrypted files?,  Prev: How to show git's output?,  Up: FAQ - How to …?
-
-A.1.2 How to install the gitman info manual?
---------------------------------------------
-
-Git’s manpages can be exported as an info manual called ‘gitman’.
-Magit’s own info manual links to nodes in that manual instead of the
-actual manpages because Info doesn’t support linking to manpages.
-
-   Unfortunately some distributions do not install the ‘gitman’ manual
-by default and you will have to install a separate documentation package
-to get it.
-
-   Magit patches Info adding the ability to visit links to the ‘gitman’
-Info manual by instead viewing the respective manpage.  If you prefer
-that approach, then set the value of ‘magit-view-git-manual-method’ to
-one of the supported packages ‘man’ or ‘woman’, e.g.:
-
-     (setq magit-view-git-manual-method 'man)
-
-
-File: magit.info,  Node: How to show diffs for gpg-encrypted files?,  Next: How does branching and pushing work?,  Prev: How to install the gitman info manual?,  Up: FAQ - How to …?
-
-A.1.3 How to show diffs for gpg-encrypted files?
-------------------------------------------------
-
-Git supports showing diffs for encrypted files, but has to be told to do
-so.  Since Magit just uses Git to get the diffs, configuring Git also
-affects the diffs displayed inside Magit.
-
-     git config --global diff.gpg.textconv "gpg --no-tty --decrypt"
-     echo "*.gpg filter=gpg diff=gpg" > .gitattributes
-
-
-File: magit.info,  Node: How does branching and pushing work?,  Next: Can Magit be used as ‘ediff-version-control-package’?,  Prev: How to show diffs for gpg-encrypted files?,  Up: FAQ - How to …?
-
-A.1.4 How does branching and pushing work?
-------------------------------------------
-
-Please see *note Branching:: and
-<http://emacsair.me/2016/01/18/magit-2.4>
-
-
-File: magit.info,  Node: Can Magit be used as ‘ediff-version-control-package’?,  Prev: How does branching and pushing work?,  Up: FAQ - How to …?
-
-A.1.5 Can Magit be used as ‘ediff-version-control-package’?
------------------------------------------------------------
-
-No, it cannot.  For that to work the functions ‘ediff-magit-internal’
-and ‘ediff-magit-merge-internal’ would have to be implemented, and they
-are not.  These two functions are only used by the three commands
-‘ediff-revision’, ‘ediff-merge-revisions-with-ancestor’, and
-‘ediff-merge-revisions’.
-
-   These commands only delegate the task of populating buffers with
-certain revisions to the "internal" functions.  The equally important
-task of determining which revisions are to be compared/merged is not
-delegated.  Instead this is done without any support whatsoever, from
-the version control package/system - meaning that the user has to enter
-the revisions explicitly.  Instead of implementing
-‘ediff-magit-internal’ we provide ‘magit-ediff-compare’, which handles
-both tasks like it is 2005.
-
-   The other commands ‘ediff-merge-revisions’ and
-‘ediff-merge-revisions-with-ancestor’ are normally not what you want
-when using a modern version control system like Git.  Instead of letting
-the user resolve only those conflicts which Git could not resolve on its
-own, they throw away all work done by Git and then expect the user to
-manually merge all conflicts, including those that had already been
-resolved.  That made sense back in the days when version control systems
-couldn’t merge (or so I have been told), but not anymore.  Once in a
-blue moon you might actually want to see all conflicts, in which case
-you *can* use these commands, which then use ‘ediff-vc-merge-internal’.
-So we don’t actually have to implement ‘ediff-magit-merge-internal’.
-Instead we provide the more useful command ‘magit-ediff-resolve’ which
-only shows yet-to-be resolved conflicts.
-
-
-File: magit.info,  Node: FAQ - Issues and Errors,  Prev: FAQ - How to …?,  Up: FAQ
-
-A.2 FAQ - Issues and Errors
-===========================
-
-* Menu:
-
-* Magit is slow::
-* I changed several thousand files at once and now Magit is unusable::
-* I am having problems committing::
-* I am using MS Windows and cannot push with Magit::
-* I am using OS X and SOMETHING works in shell, but not in Magit: I am using OS X and SOMETHING works in shell but not in Magit. 
-* Diffs contain control sequences::
-* Expanding a file to show the diff causes it to disappear::
-* Point is wrong in the ‘COMMIT_EDITMSG’ buffer::
-* The mode-line information isn't always up-to-date::
-* Emacs 24.5 hangs when loading Magit: Emacs 245 hangs when loading Magit. 
-
-
-File: magit.info,  Node: Magit is slow,  Next: I changed several thousand files at once and now Magit is unusable,  Up: FAQ - Issues and Errors
-
-A.2.1 Magit is slow
--------------------
-
-See *note Performance::.
-
-
-File: magit.info,  Node: I changed several thousand files at once and now Magit is unusable,  Next: I am having problems committing,  Prev: Magit is slow,  Up: FAQ - Issues and Errors
-
-A.2.2 I changed several thousand files at once and now Magit is unusable
-------------------------------------------------------------------------
-
-Magit is *currently* not expected to work under such conditions.  It
-sure would be nice if it did, and v2.5 will hopefully be a big step into
-that direction.  But it might take until v3.1 to accomplish fully
-satisfactory performance, because that requires some heavy refactoring.
-
-   But for now we recommend you use the command line to complete this
-one commit.  Also see *note Performance::.
-
-
-File: magit.info,  Node: I am having problems committing,  Next: I am using MS Windows and cannot push with Magit,  Prev: I changed several thousand files at once and now Magit is unusable,  Up: FAQ - Issues and Errors
-
-A.2.3 I am having problems committing
--------------------------------------
-
-That likely means that Magit is having problems finding an appropriate
-emacsclient executable.  See *note (with-editor)Configuring
-With-Editor:: and *note (with-editor)Debugging::.
-
-
-File: magit.info,  Node: I am using MS Windows and cannot push with Magit,  Next: I am using OS X and SOMETHING works in shell but not in Magit,  Prev: I am having problems committing,  Up: FAQ - Issues and Errors
-
-A.2.4 I am using MS Windows and cannot push with Magit
-------------------------------------------------------
-
-It’s almost certain that Magit is only incidental to this issue.  It is
-much more likely that this is a configuration issue, even if you can
-push on the command line.
-
-   Detailed setup instructions can be found at
-<https://github.com/magit/magit/wiki/Pushing-with-Magit-from-Windows>.
-
-
-File: magit.info,  Node: I am using OS X and SOMETHING works in shell but not in Magit,  Next: Diffs contain control sequences,  Prev: I am using MS Windows and cannot push with Magit,  Up: FAQ - Issues and Errors
-
-A.2.5 I am using OS X and SOMETHING works in shell, but not in Magit
---------------------------------------------------------------------
-
-This usually occurs because Emacs doesn’t have the same environment
-variables as your shell.  Try installing and configuring
-<https://github.com/purcell/exec-path-from-shell>.  By default it
-synchronizes ‘$PATH’, which helps Magit find the same ‘git’ as the one
-you are using on the shell.
-
-   If SOMETHING is "passphrase caching with gpg-agent for commit and/or
-tag signing", then you’ll also need to synchronize ‘$GPG_AGENT_INFO’.
-
-
-File: magit.info,  Node: Diffs contain control sequences,  Next: Expanding a file to show the diff causes it to disappear,  Prev: I am using OS X and SOMETHING works in shell but not in Magit,  Up: FAQ - Issues and Errors
-
-A.2.6 Diffs contain control sequences
--------------------------------------
-
-This happens when you configure Git to always color diffs and/or all of
-its output.  The valid values for relevant Git variables ‘color.ui’ and
-‘color.diff’ are ‘false’, ‘true’ and ‘always’, and the default is
-‘true’.  You should leave it that because then you get colorful output
-in terminals but git’s output is consumed by something else, then no
-colors are used.
-
-   If you actually use some other tool which expects that requires that
-you force git to output control sequences (which is highly unlikely),
-then you can override these settings just for Magit by using:
-
-     (setq magit-git-global-arguments
-           (nconc magit-git-global-arguments
-                  '("-c" "color.ui=false"
-                    "-c" "color.diff=false")))
-
-
-File: magit.info,  Node: Expanding a file to show the diff causes it to disappear,  Next: Point is wrong in the ‘COMMIT_EDITMSG’ buffer,  Prev: Diffs contain control sequences,  Up: FAQ - Issues and Errors
-
-A.2.7 Expanding a file to show the diff causes it to disappear
---------------------------------------------------------------
-
-This is probably caused by a change of a ‘diff.*’ Git variable.  You
-probably set that variable for a reason, and should therefore only undo
-that setting in Magit by customizing ‘magit-git-global-arguments’.
-
-
-File: magit.info,  Node: Point is wrong in the ‘COMMIT_EDITMSG’ buffer,  Next: The mode-line information isn't always up-to-date,  Prev: Expanding a file to show the diff causes it to disappear,  Up: FAQ - Issues and Errors
-
-A.2.8 Point is wrong in the ‘COMMIT_EDITMSG’ buffer
----------------------------------------------------
-
-Neither Magit nor ‘git-commit‘ fiddle with point in the buffer used to
-write commit messages, so something else must be doing it.
-
-   You have probably globally enabled a mode which does restore point in
-file-visiting buffers.  It might be a bit surprising, but when you write
-a commit message, then you are actually editing a file.
-
-   So you have to figure out which package is doing.  ‘saveplace’,
-‘pointback’, and ‘session’ are likely candidates.  These snippets might
-help:
-
-     (setq session-name-disable-regexp "\\(?:\\`'\\.git/[A-Z_]+\\'\\)")
-
-     (with-eval-after-load 'pointback
-       (lambda ()
-         (when (or git-commit-mode git-rebase-mode)
-           (pointback-mode -1))))
-
-
-File: magit.info,  Node: The mode-line information isn't always up-to-date,  Next: Emacs 245 hangs when loading Magit,  Prev: Point is wrong in the ‘COMMIT_EDITMSG’ buffer,  Up: FAQ - Issues and Errors
-
-A.2.9 The mode-line information isn’t always up-to-date
--------------------------------------------------------
-
-Magit is not responsible for the version control information that is
-being displayed in the mode-line and looks something like ‘Git-master’.
-The built-in "Version Control" package, also known as "VC", updates that
-information, and can be told to do so more often:
-
-     (setq auto-revert-check-vc-info t)
-
-   But doing so isn’t good for performance.  For more (overly
-optimistic) information see *note (emacs)VC Mode Line::.
-
-   If you don’t really care about seeing that information in the
-mode-line, but just don’t want to see _incorrect_ information, then
-consider disabling VC when using Git:
-
-     (setq vc-handled-backends (delq 'Git vc-handled-backends))
-
-   Or to disable it completely:
-
-     (setq vc-handled-backends nil)
-
-
-File: magit.info,  Node: Emacs 245 hangs when loading Magit,  Prev: The mode-line information isn't always up-to-date,  Up: FAQ - Issues and Errors
-
-A.2.10 Emacs 24.5 hangs when loading Magit
-------------------------------------------
-
-This is actually triggered by loading Tramp.  See
-<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20015> for details.  You
-can work around the problem by setting
-‘tramp-ssh-controlmaster-options’.  Changing your DNS server (e.g.  to
-Google’s ‘8.8.8.8’) may also be sufficient to work around the issue.
-
-
-File: magit.info,  Node: Debugging Tools,  Next: Keystroke Index,  Prev: FAQ,  Up: Top
-
-B Debugging Tools
-*****************
-
-Magit and its dependencies provide a few debugging tools, and we
-appreciate it very much if you use those tools before reporting an
-issue.  Please include all relevant output when reporting an issue.
-
-‘M-x magit-version’     (‘magit-version’)
-
-     This command shows the currently used versions of Magit, Git, and
-     Emacs in the echo area.  Non-interactively this just returns the
-     Magit version.
-
-‘M-x magit-emacs-Q-command’     (‘magit-emacs-Q-command’)
-
-     This command shows a debugging shell command in the echo area and
-     adds it to the kill ring.  Paste that command into a shell an run
-     it.
-
-     This shell command starts ‘emacs’ with only ‘magit’ and its
-     dependencies loaded.  Neither your configuration nor other
-     installed packages are loaded.  This makes it easier to determine
-     whether some issue lays with Magit or something else.
-
-‘M-x magit-debug-git-executable’     (‘magit-debug-git-executable’)
-
-     This command displays a buffer containing information about the
-     available and used ‘git’ executable(s), and can be useful when
-     investigating ‘exec-path’ issues.
-
-     Also see *note Git Executable::.
-
-‘M-x with-editor-debug’     (‘with-editor-debug’)
-
-     This command displays a buffer containing information about the
-     available and used ‘git’ executable(s), and can be useful when
-     investigating why Magit (or rather ‘with-editor’) cannot find an
-     appropriate ‘emacsclient’ executable.
-
-     Also see *note (with-editor)Debugging::.
-
-   Please also see the *note FAQ::.
-
-
-File: magit.info,  Node: Keystroke Index,  Next: Command Index,  Prev: Debugging Tools,  Up: Top
-
-Appendix C Keystroke Index
-**************************
-
-[index]
-* Menu:
-
-* !:                                     Running Git Manually.
-                                                              (line  12)
-* ! !:                                   Running Git Manually.
-                                                              (line  16)
-* ! a:                                   Running Git Manually.
-                                                              (line  57)
-* ! b:                                   Running Git Manually.
-                                                              (line  61)
-* ! g:                                   Running Git Manually.
-                                                              (line  65)
-* ! k:                                   Running Git Manually.
-                                                              (line  53)
-* ! p:                                   Running Git Manually.
-                                                              (line  24)
-* ! s:                                   Running Git Manually.
-                                                              (line  34)
-* ! S:                                   Running Git Manually.
-                                                              (line  39)
-* $:                                     Viewing Git Output.  (line  11)
-* +:                                     Log Buffer.          (line  59)
-* + <1>:                                 Refreshing Diffs.    (line  68)
-* -:                                     Log Buffer.          (line  63)
-* - <1>:                                 Refreshing Diffs.    (line  64)
-* 0:                                     Refreshing Diffs.    (line  72)
-* 1:                                     Section Visibility.  (line  26)
-* 2:                                     Section Visibility.  (line  27)
-* 3:                                     Section Visibility.  (line  28)
-* 4:                                     Section Visibility.  (line  29)
-* =:                                     Log Buffer.          (line  53)
-* ^:                                     Section Movement.    (line  31)
-* a:                                     Applying.            (line  33)
-* A:                                     Cherry Picking.      (line   8)
-* A A:                                   Cherry Picking.      (line  16)
-* A a:                                   Cherry Picking.      (line  22)
-* A A <1>:                               Cherry Picking.      (line  35)
-* A a <1>:                               Cherry Picking.      (line  43)
-* A s:                                   Cherry Picking.      (line  39)
-* B:                                     Bisecting.           (line   8)
-* b:                                     The Branch Popup.    (line  12)
-* B B:                                   Bisecting.           (line  16)
-* B b:                                   Bisecting.           (line  31)
-* b b:                                   The Branch Popup.    (line  29)
-* b c:                                   The Branch Popup.    (line  47)
-* B g:                                   Bisecting.           (line  36)
-* B k:                                   Bisecting.           (line  41)
-* b k:                                   The Branch Popup.    (line 100)
-* b n:                                   The Branch Popup.    (line  37)
-* B r:                                   Bisecting.           (line  47)
-* b r:                                   The Branch Popup.    (line 106)
-* B s:                                   Bisecting.           (line  24)
-* b s:                                   The Branch Popup.    (line  54)
-* b x:                                   The Branch Popup.    (line  84)
-* c:                                     Initiating a Commit. (line   8)
-* c <1>:                                 Editing Rebase Sequences.
-                                                              (line  72)
-* c a:                                   Initiating a Commit. (line  18)
-* c A:                                   Initiating a Commit. (line  66)
-* c c:                                   Initiating a Commit. (line  13)
-* c e:                                   Initiating a Commit. (line  22)
-* c f:                                   Initiating a Commit. (line  42)
-* c F:                                   Initiating a Commit. (line  50)
-* c s:                                   Initiating a Commit. (line  54)
-* c S:                                   Initiating a Commit. (line  62)
-* c w:                                   Initiating a Commit. (line  32)
-* C-<return>:                            Diff Buffer.         (line  36)
-* C-<tab>:                               Section Visibility.  (line  13)
-* C-c C-a:                               Editing Commit Messages.
-                                                              (line 128)
-* C-c C-b:                               Log Buffer.          (line  19)
-* C-c C-b <1>:                           Refreshing Diffs.    (line  90)
-* C-c C-c:                               Popup Buffers and Prefix Commands.
-                                                              (line  20)
-* C-c C-c <1>:                           Select from Log.     (line  20)
-* C-c C-c <2>:                           Editing Commit Messages.
-                                                              (line  19)
-* C-c C-c <3>:                           Editing Rebase Sequences.
-                                                              (line   6)
-* C-c C-d:                               Refreshing Diffs.    (line  80)
-* C-c C-d <1>:                           Editing Commit Messages.
-                                                              (line  57)
-* C-c C-f:                               Log Buffer.          (line  23)
-* C-c C-f <1>:                           Refreshing Diffs.    (line  94)
-* C-c C-i:                               Editing Commit Messages.
-                                                              (line 153)
-* C-c C-k:                               Select from Log.     (line  26)
-* C-c C-k <1>:                           Editing Commit Messages.
-                                                              (line  24)
-* C-c C-k <2>:                           Editing Rebase Sequences.
-                                                              (line  11)
-* C-c C-n:                               Log Buffer.          (line  27)
-* C-c C-o:                               Editing Commit Messages.
-                                                              (line 144)
-* C-c C-p:                               Editing Commit Messages.
-                                                              (line 148)
-* C-c C-r:                               Editing Commit Messages.
-                                                              (line 132)
-* C-c C-s:                               Editing Commit Messages.
-                                                              (line 136)
-* C-c C-t:                               Editing Commit Messages.
-                                                              (line 140)
-* C-c C-w:                               Editing Commit Messages.
-                                                              (line  63)
-* C-c M-g:                               Minor Mode for Buffers Visiting Files.
-                                                              (line  19)
-* C-c M-g b:                             Minor Mode for Buffers Visiting Files.
-                                                              (line  76)
-* C-c M-g c:                             Minor Mode for Buffers Visiting Files.
-                                                              (line  33)
-* C-c M-g D:                             Minor Mode for Buffers Visiting Files.
-                                                              (line  39)
-* C-c M-g d:                             Minor Mode for Buffers Visiting Files.
-                                                              (line  47)
-* C-c M-g L:                             Minor Mode for Buffers Visiting Files.
-                                                              (line  57)
-* C-c M-g l:                             Minor Mode for Buffers Visiting Files.
-                                                              (line  64)
-* C-c M-g p:                             Minor Mode for Buffers Visiting Files.
-                                                              (line  82)
-* C-c M-g s:                             Minor Mode for Buffers Visiting Files.
-                                                              (line  24)
-* C-c M-g u:                             Minor Mode for Buffers Visiting Files.
-                                                              (line  28)
-* C-c M-s:                               Editing Commit Messages.
-                                                              (line  35)
-* C-w:                                   Common Commands.     (line  21)
-* C-x g:                                 Status Buffer.       (line  22)
-* C-x u:                                 Editing Rebase Sequences.
-                                                              (line  89)
-* d:                                     Diffing.             (line  20)
-* D:                                     Refreshing Diffs.    (line  11)
-* d c:                                   Diffing.             (line  67)
-* d d:                                   Diffing.             (line  25)
-* D f:                                   Refreshing Diffs.    (line  45)
-* D F:                                   Refreshing Diffs.    (line  50)
-* D g:                                   Refreshing Diffs.    (line  16)
-* d p:                                   Diffing.             (line  59)
-* d r:                                   Diffing.             (line  29)
-* D r:                                   Refreshing Diffs.    (line  40)
-* d s:                                   Diffing.             (line  49)
-* D s:                                   Refreshing Diffs.    (line  21)
-* d t:                                   Diffing.             (line  72)
-* D t:                                   Refreshing Diffs.    (line  36)
-* d u:                                   Diffing.             (line  55)
-* d w:                                   Diffing.             (line  43)
-* D w:                                   Refreshing Diffs.    (line  28)
-* DEL:                                   Log Buffer.          (line  43)
-* DEL <1>:                               Diff Buffer.         (line  63)
-* DEL <2>:                               Blaming.             (line  44)
-* DEL <3>:                               Editing Rebase Sequences.
-                                                              (line  28)
-* e:                                     Ediffing.            (line   9)
-* E:                                     Ediffing.            (line  21)
-* e <1>:                                 Editing Rebase Sequences.
-                                                              (line  55)
-* E c:                                   Ediffing.            (line  65)
-* E i:                                   Ediffing.            (line  57)
-* E m:                                   Ediffing.            (line  35)
-* E r:                                   Ediffing.            (line  26)
-* E s:                                   Ediffing.            (line  48)
-* E u:                                   Ediffing.            (line  53)
-* E w:                                   Ediffing.            (line  61)
-* E z:                                   Ediffing.            (line  69)
-* f:                                     Editing Rebase Sequences.
-                                                              (line  63)
-* f <1>:                                 Fetching.            (line  11)
-* F:                                     Pulling.             (line  11)
-* f a:                                   Fetching.            (line  38)
-* f e:                                   Fetching.            (line  24)
-* F e:                                   Pulling.             (line  24)
-* f m:                                   Fetching.            (line  42)
-* f o:                                   Fetching.            (line  28)
-* f p:                                   Fetching.            (line  16)
-* F p:                                   Pulling.             (line  16)
-* f r:                                   Fetching.            (line  33)
-* f u:                                   Fetching.            (line  20)
-* F u:                                   Pulling.             (line  20)
-* g:                                     Automatic Refreshing of Magit Buffers.
-                                                              (line  22)
-* G:                                     Automatic Refreshing of Magit Buffers.
-                                                              (line  31)
-* j:                                     Diff Buffer.         (line  53)
-* k:                                     Viewing Git Output.  (line  19)
-* k <1>:                                 Applying.            (line  40)
-* k <2>:                                 Editing Rebase Sequences.
-                                                              (line  68)
-* k <3>:                                 Stashing.            (line  88)
-* l:                                     Logging.             (line  28)
-* L:                                     Refreshing Logs.     (line  11)
-* L <1>:                                 Log Buffer.          (line   6)
-* L <2>:                                 Log Margin.          (line  47)
-* l a:                                   Logging.             (line  58)
-* l b:                                   Logging.             (line  54)
-* L d:                                   Log Margin.          (line  64)
-* L g:                                   Refreshing Logs.     (line  16)
-* l h:                                   Logging.             (line  46)
-* l H:                                   Reflog.              (line  19)
-* l l:                                   Logging.             (line  33)
-* l L:                                   Logging.             (line  50)
-* L L:                                   Log Margin.          (line  56)
-* L l:                                   Log Margin.          (line  60)
-* l o:                                   Logging.             (line  39)
-* l O:                                   Reflog.              (line  15)
-* l r:                                   Reflog.              (line  11)
-* L s:                                   Refreshing Logs.     (line  21)
-* L t:                                   Refreshing Logs.     (line  36)
-* L w:                                   Refreshing Logs.     (line  28)
-* m:                                     Merging.             (line   9)
-* M:                                     Remotes.             (line   8)
-* m a:                                   Merging.             (line  57)
-* M a:                                   Remotes.             (line  13)
-* m e:                                   Merging.             (line  30)
-* M k:                                   Remotes.             (line  28)
-* m m:                                   Merging.             (line  17)
-* m m <1>:                               Merging.             (line  52)
-* m n:                                   Merging.             (line  37)
-* m p:                                   Merging.             (line  44)
-* M r:                                   Remotes.             (line  18)
-* M u:                                   Remotes.             (line  23)
-* M-1:                                   Section Visibility.  (line  33)
-* M-2:                                   Section Visibility.  (line  34)
-* M-3:                                   Section Visibility.  (line  35)
-* M-4:                                   Section Visibility.  (line  36)
-* M-<tab>:                               Section Visibility.  (line  17)
-* M-n:                                   Section Movement.    (line  26)
-* M-n <1>:                               Editing Commit Messages.
-                                                              (line  45)
-* M-n <2>:                               Editing Rebase Sequences.
-                                                              (line  47)
-* M-p:                                   Section Movement.    (line  20)
-* M-p <1>:                               Editing Commit Messages.
-                                                              (line  39)
-* M-p <2>:                               Editing Rebase Sequences.
-                                                              (line  43)
-* M-w:                                   Blaming.             (line  75)
-* M-w <1>:                               Common Commands.     (line  10)
-* M-x magit-blame:                       Blaming.             (line   8)
-* M-x magit-blame-popup:                 Blaming.             (line  24)
-* M-x magit-clone:                       Repository Setup.    (line  16)
-* M-x magit-debug-git-executable:        Git Executable.      (line  45)
-* M-x magit-debug-git-executable <1>:    Debugging Tools.     (line  27)
-* M-x magit-describe-section:            Section Types and Values.
-                                                              (line  13)
-* M-x magit-describe-section <1>:        Matching Sections.   (line   6)
-* M-x magit-emacs-Q-command:             Debugging Tools.     (line  16)
-* M-x magit-find-file:                   Visiting Blobs.      (line   6)
-* M-x magit-find-file-other-window:      Visiting Blobs.      (line  11)
-* M-x magit-init:                        Repository Setup.    (line   6)
-* M-x magit-reset-index:                 Staging and Unstaging.
-                                                              (line  87)
-* M-x magit-reverse-in-index:            Staging and Unstaging.
-                                                              (line  62)
-* M-x magit-stage-file:                  Staging from File-Visiting Buffers.
-                                                              (line  10)
-* M-x magit-toggle-buffer-lock:          Modes and Buffers.   (line  17)
-* M-x magit-unstage-file:                Staging from File-Visiting Buffers.
-                                                              (line  18)
-* M-x magit-version:                     Git Executable.      (line  17)
-* M-x magit-version <1>:                 Debugging Tools.     (line  10)
-* M-x magit-wip-commit:                  Wip Modes.           (line 129)
-* M-x with-editor-debug:                 Debugging Tools.     (line  35)
-* n:                                     Section Movement.    (line  16)
-* n <1>:                                 Blaming.             (line  54)
-* N:                                     Blaming.             (line  58)
-* n <2>:                                 Editing Rebase Sequences.
-                                                              (line  39)
-* n <3>:                                 Minor Mode for Buffers Visiting Blobs.
-                                                              (line  16)
-* o:                                     Submodule Popup.     (line   6)
-* O:                                     Subtree.             (line   8)
-* o a:                                   Submodule Popup.     (line  11)
-* O a:                                   Subtree.             (line  20)
-* o b:                                   Submodule Popup.     (line  17)
-* O c:                                   Subtree.             (line  24)
-* o f:                                   Submodule Popup.     (line  35)
-* O f:                                   Subtree.             (line  32)
-* o i:                                   Submodule Popup.     (line  22)
-* o i <1>:                               Submodule Popup.     (line  39)
-* O m:                                   Subtree.             (line  28)
-* O p:                                   Subtree.             (line  36)
-* o s:                                   Submodule Popup.     (line  31)
-* O s:                                   Subtree.             (line  41)
-* o u:                                   Submodule Popup.     (line  26)
-* p:                                     Section Movement.    (line  10)
-* p <1>:                                 Blaming.             (line  62)
-* P:                                     Blaming.             (line  66)
-* p <2>:                                 Editing Rebase Sequences.
-                                                              (line  35)
-* P <1>:                                 Pushing.             (line  11)
-* p <3>:                                 Minor Mode for Buffers Visiting Blobs.
-                                                              (line  12)
-* P e:                                   Pushing.             (line  35)
-* P m:                                   Pushing.             (line  53)
-* P o:                                   Pushing.             (line  39)
-* P p:                                   Pushing.             (line  16)
-* P r:                                   Pushing.             (line  44)
-* P t:                                   Pushing.             (line  59)
-* P T:                                   Pushing.             (line  65)
-* P u:                                   Pushing.             (line  26)
-* q:                                     Quitting Windows.    (line   6)
-* q <1>:                                 Log Buffer.          (line  12)
-* q <2>:                                 Blaming.             (line  70)
-* q <3>:                                 Minor Mode for Buffers Visiting Blobs.
-                                                              (line  20)
-* r:                                     Rebasing.            (line   9)
-* r <1>:                                 Editing Rebase Sequences.
-                                                              (line  51)
-* r a:                                   Rebasing.            (line  95)
-* r e:                                   Rebasing.            (line  33)
-* r e <1>:                               Rebasing.            (line  91)
-* r f:                                   Rebasing.            (line  65)
-* r i:                                   Rebasing.            (line  61)
-* r m:                                   Rebasing.            (line  69)
-* r p:                                   Rebasing.            (line  24)
-* r r:                                   Rebasing.            (line  80)
-* r s:                                   Rebasing.            (line  39)
-* r s <1>:                               Rebasing.            (line  87)
-* r u:                                   Rebasing.            (line  29)
-* r w:                                   Rebasing.            (line  73)
-* RET:                                   Diff Buffer.         (line   6)
-* RET <1>:                               References Buffer.   (line 117)
-* RET <2>:                               Blaming.             (line  29)
-* RET <3>:                               Editing Rebase Sequences.
-                                                              (line  16)
-* s:                                     Staging and Unstaging.
-                                                              (line  28)
-* S:                                     Staging and Unstaging.
-                                                              (line  36)
-* s <1>:                                 Editing Rebase Sequences.
-                                                              (line  59)
-* S-<tab>:                               Section Visibility.  (line  22)
-* SPC:                                   Log Buffer.          (line  33)
-* SPC <1>:                               Diff Buffer.         (line  59)
-* SPC <2>:                               Blaming.             (line  34)
-* SPC <3>:                               Editing Rebase Sequences.
-                                                              (line  21)
-* t:                                     Blaming.             (line  82)
-* t <1>:                                 Tagging.             (line   8)
-* T:                                     Notes.               (line   8)
-* T a:                                   Notes.               (line  70)
-* T c:                                   Notes.               (line  65)
-* t k:                                   Tagging.             (line  18)
-* T m:                                   Notes.               (line  56)
-* t p:                                   Tagging.             (line  24)
-* T p:                                   Notes.               (line  29)
-* T r:                                   Notes.               (line  21)
-* T s:                                   Notes.               (line  33)
-* T S:                                   Notes.               (line  44)
-* t t:                                   Tagging.             (line  13)
-* T T:                                   Notes.               (line  13)
-* TAB:                                   Section Visibility.  (line   9)
-* u:                                     Staging and Unstaging.
-                                                              (line  43)
-* U:                                     Staging and Unstaging.
-                                                              (line  52)
-* v:                                     Applying.            (line  44)
-* V:                                     Reverting.           (line   6)
-* V A:                                   Reverting.           (line  30)
-* V a:                                   Reverting.           (line  38)
-* V s:                                   Reverting.           (line  34)
-* V V:                                   Reverting.           (line  14)
-* V v:                                   Reverting.           (line  20)
-* W:                                     Creating and Sending Patches.
-                                                              (line   6)
-* w:                                     Applying Patches.    (line   8)
-* w a:                                   Applying Patches.    (line  31)
-* w m:                                   Applying Patches.    (line  19)
-* W p:                                   Creating and Sending Patches.
-                                                              (line  11)
-* W r:                                   Creating and Sending Patches.
-                                                              (line  17)
-* w s:                                   Applying Patches.    (line  27)
-* w w:                                   Applying Patches.    (line  13)
-* w w <1>:                               Applying Patches.    (line  23)
-* x:                                     Editing Rebase Sequences.
-                                                              (line  76)
-* x <1>:                                 Resetting.           (line   8)
-* X f:                                   Resetting.           (line  37)
-* X h:                                   Resetting.           (line  25)
-* X i:                                   Resetting.           (line  30)
-* X m:                                   Resetting.           (line  14)
-* X s:                                   Resetting.           (line  19)
-* Y:                                     Cherries.            (line  17)
-* y:                                     References Buffer.   (line   6)
-* y <1>:                                 Editing Rebase Sequences.
-                                                              (line  85)
-* y c:                                   References Buffer.   (line  19)
-* y o:                                   References Buffer.   (line  24)
-* y y:                                   References Buffer.   (line  14)
-* z:                                     Stashing.            (line   8)
-* z a:                                   Stashing.            (line  58)
-* z b:                                   Stashing.            (line  80)
-* z f:                                   Stashing.            (line  84)
-* z i:                                   Stashing.            (line  20)
-* z I:                                   Stashing.            (line  46)
-* z k:                                   Stashing.            (line  71)
-* z l:                                   Stashing.            (line  92)
-* z p:                                   Stashing.            (line  64)
-* z v:                                   Stashing.            (line  76)
-* z w:                                   Stashing.            (line  25)
-* z W:                                   Stashing.            (line  51)
-* z x:                                   Stashing.            (line  32)
-* z z:                                   Stashing.            (line  13)
-* z Z:                                   Stashing.            (line  39)
-
.emacs.d/elpa/magit-20170913.1424/magit.info-2
Binary file
.emacs.d/elpa/magit-annex-20170913.659/magit-annex-autoloads.el
@@ -1,54 +0,0 @@
-;;; magit-annex-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "magit-annex" "magit-annex.el" (22985 22859
-;;;;;;  250317 325000))
-;;; Generated autoloads from magit-annex.el
-
-(eval-after-load 'magit '(progn (define-key magit-mode-map "@" 'magit-annex-popup-or-init) (magit-define-popup-action 'magit-dispatch-popup 64 "Annex" 'magit-annex-popup-or-init 33)))
-
-(autoload 'magit-annex-popup-or-init "magit-annex" "\
-Call Magit-annex popup or offer to initialize non-annex repo.
-
-\(fn)" t nil)
-
-(autoload 'magit-annex-init "magit-annex" "\
-Initialize git-annex repository.
-\('git annex init [DESCRIPTION]')
-
-\(fn &optional DESCRIPTION)" t nil)
-
-(autoload 'magit-annex-unused "magit-annex" "\
-Show unused data.
-\('git annex unused [ARGS]')
-
-\(fn &optional ARGS)" t nil)
-
-(autoload 'magit-annex-unused-reflog "magit-annex" "\
-Show unused data.
-\('git annex unused --used-refspec=reflog [ARGS]')
-
-\(fn &optional ARGS)" t nil)
-
-(autoload 'magit-annex-list-files "magit-annex" "\
-List annex files.
-\('git annex list [ARGS]')
-
-\(fn &optional ARGS)" t nil)
-
-(autoload 'magit-annex-list-dir-files "magit-annex" "\
-List annex files in DIRECTORY.
-\('git annex list [ARGS] DIRECTORY')
-
-\(fn DIRECTORY &optional ARGS)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; magit-annex-autoloads.el ends here
.emacs.d/elpa/magit-annex-20170913.659/magit-annex-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "magit-annex" "20170913.659" "Control git-annex from Magit" '((cl-lib "0.3") (magit "2.11.0")) :commit "895c229c2b0d822a4debb302d8638105ecb4ee20" :url "https://github.com/magit/magit-annex" :keywords '("vc" "tools"))
.emacs.d/elpa/magit-annex-20170913.659/magit-annex.el
@@ -1,688 +0,0 @@
-;;; magit-annex.el --- Control git-annex from Magit  -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2013-2017 Kyle Meyer <kyle@kyleam.com>
-
-;; Author: Kyle Meyer <kyle@kyleam.com>
-;;         Rémi Vanicat <vanicat@debian.org>
-;; URL: https://github.com/magit/magit-annex
-;; Package-Version: 20170913.659
-;; Keywords: vc tools
-;; Version: 1.4.0
-;; Package-Requires: ((cl-lib "0.3") (magit "2.11.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, 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.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; Magit-annex adds a few git-annex operations to the Magit interface.
-;; Annex commands are available under the annex popup menu, which is
-;; bound to "@".  This key was chosen as a leading key mostly to be
-;; consistent with John Wiegley's git-annex.el (which provides a Dired
-;; interface to git-annex) [1].
-;;
-;; Adding files:
-;;   @a   Add a file to the annex.
-;;   @A   Add all untracked and modified files to the annex.
-;;
-;; Managing file content:
-;;   @fu   Unlock files.
-;;   @fl   Lock files.
-;;   @fg   Get files.
-;;   @fd   Drop files.
-;;   @fc   Copy files.
-;;   @fm   Move files.
-;;
-;;   @u    Browse unused files.
-;;   @l    List annex files.
-;;
-;; Updating:
-;;   @m   Run `git annex merge'.
-;;   @y   Run `git annex sync'.
-;;
-;; In the unused buffer
-;;   l    Show log for commits touching a file
-;;   RET  Open a file
-;;   k    Drop files
-;;   s    Add files back to the index
-;;
-;; When Magit-annex is installed from MELPA, no additional setup is
-;; needed.  The annex popup menu will be added under the main Magit
-;; popup menu (and loading of Magit-annex will be deferred until the
-;; first time the annex popup is called).
-;;
-;; To use Magit-annex from the source repository, put
-;;
-;;   (require 'magit-annex)
-;;
-;; in your initialization file.
-;;
-;;
-;; [1] https://github.com/jwiegley/git-annex-el
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'magit)
-(require 'magit-popup)
-
-
-;;; Variables
-
-(defgroup magit-annex nil
-  "Control git-annex from Magit"
-  :prefix "magit-annex"
-  :group 'magit-extensions)
-
-(defcustom magit-annex-add-all-confirm t
-  "Whether to confirm before adding all changes to the annex."
-  :type 'boolean)
-
-(defcustom magit-annex-global-arguments nil
-  "Arguments that are added to every git-annex call.
-These are placed after \"annex\" in the call, whereas values from
-`magit-git-global-arguments' are placed after \"git\"."
-  :type '(repeat string))
-
-(define-obsolete-variable-alias 'magit-annex-standard-options
-  'magit-annex-global-arguments "1.4.0")
-
-(defcustom magit-annex-limit-file-choices t
-  "Limit choices for file commands based on state of repo.
-For example, if locking a file, limit choices to unlocked files."
-  :safe 'booleanp
-  :type 'boolean)
-
-(defcustom magit-annex-confirm-all-files t
-  "Require confirmation of empty input to `magit-annex-*-files' commands.
-If this is nil, run the operation on all files without asking
-first."
-  :package-version '(magit-annex . "1.2.0")
-  :type 'boolean)
-
-(defcustom magit-annex-include-directories t
-  "Whether to list directories in prompts of `magit-annex-*-files' commands.
-Consider disabling this if the prompt is slow to appear in
-repositories that contain many annexed files."
-  :package-version '(magit-annex . "1.2.0")
-  :safe 'booleanp
-  :type 'boolean)
-
-(defcustom magit-annex-unused-open-function nil
-  "Function used by `magit-annex-unused-open'.
-
-This function should take a single required argument, a file
-name.  If you have configured Org mode to open files on your
-system, consider using `org-open-file'.
-
-If nil, `magit-annex-unused-open' will prompt for the name of the
-program used to open the unused file."
-  :type '(choice (const :tag "Read shell command" nil)
-                 (function :tag "Function to open file")))
-
-(defcustom magit-annex-unused-stat-argument t
-  "Enable '--stat' flag in log popup when point is on unused item."
-  :package-version '(magit-annex . "1.3.0")
-  :type 'boolean)
-
-
-;;; Popups
-
-(magit-define-popup magit-annex-popup
-  "Popup console for git-annex commands."
-  'magit-popups
-  :man-page "git-annex"
-  :actions  '((?a "Add" magit-annex-add)
-              (?@ "Add" magit-annex-add)
-              (?A "Add all" magit-annex-add-all)
-              (?f "Action on files" magit-annex-file-action-popup)
-              (?G "Get all (auto)" magit-annex-get-all-auto)
-              (?y "Sync" magit-annex-sync-popup)
-              (?m "Merge" magit-annex-merge)
-              (?u "Unused" magit-annex-unused-popup)
-              (?l "List files" magit-annex-list-popup)
-              (?: "Annex subcommand (from pwd)" magit-annex-command)
-              (?! "Running" magit-annex-run-popup))
-  :max-action-columns 3)
-
-(magit-define-popup magit-annex-file-action-popup
-  "Popup console for git-annex file commands."
-  'magit-annex-popups
-  :man-page "git-annex"
-  :actions  '((?g "Get" magit-annex-get-files)
-              (?d "Drop" magit-annex-drop-files)
-              (?c "Copy" magit-annex-copy-files)
-              (?m "Move" magit-annex-move-files)
-              (?l "Lock" magit-annex-lock-files)
-              (?u "Unlock" magit-annex-unlock-files))
-  :switches '((?f "Fast" "--fast")
-              (?F "Force" "--force")
-              (?a "Auto" "--auto"))
-  :options  '((?t "To remote" "--to=" magit-read-remote)
-              (?f "From remote" "--from=" magit-read-remote)
-              (?n "Number of copies" "--numcopies=")
-              (?j "Number of jobs" "--jobs="))
-  :max-action-columns 4)
-
-(magit-define-popup magit-annex-sync-popup
-  "Popup console for git annex sync."
-  'magit-annex-popups
-  :man-page "git-annex-sync"
-  :actions  '((?y "Sync" magit-annex-sync)
-              (?r "Sync remote" magit-annex-sync-remote))
-  :switches '((?c "Content" "--content")
-              (?f "Fast" "--fast")
-              (?F "Force" "--force")
-              (?n "Don't commit local changes" "--no-commit"))
-  :options  '((?j "Number of jobs" "--jobs="))
-  :default-action 'magit-annex-sync)
-
-(magit-define-popup magit-annex-unused-popup
-  "Popup console for git annex unused."
-  'magit-annex-popups
-  :man-page "git-annex-unused"
-  :actions  '((?u "Unused" magit-annex-unused)
-              (?r "Unused in reflog" magit-annex-unused-reflog))
-  :switches '((?f "Fast" "--fast"))
-  :options '((?f "From remote" "--from=" magit-read-remote)
-             (?r "Refspec" "--used-refspec="))
-  :default-action 'magit-annex-unused)
-
-(magit-define-popup magit-annex-list-popup
-  "Popup console for git annex list."
-  'magit-annex-popups
-  :man-page "git-annex-list"
-  :actions  '((?l "List files" magit-annex-list-files)
-              (?d "List files in directory" magit-annex-list-dir-files))
-  :switches '((?a "All repos" "--allrepos"))
-  :default-action 'magit-annex-list-files
-  :use-prefix 'popup)
-
-(magit-define-popup magit-annex-run-popup
-  "Popup console for running git-annex commands."
-  'magit-annex-popups
-  :man-page "git-annex"
-  :actions '((?! "Annex subcommand (from root)" magit-annex-command-topdir)
-             (?: "Annex subcommand (from pwd)" magit-annex-command)))
-
-;;;###autoload
-(eval-after-load 'magit
-  '(progn
-     (define-key magit-mode-map "@" 'magit-annex-popup-or-init)
-     (magit-define-popup-action 'magit-dispatch-popup
-       ?@ "Annex" 'magit-annex-popup-or-init ?!)))
-
-
-
-;;; Process calls
-
-(defun magit-annex-run (&rest args)
-  "Call git-annex synchronously in a separate process, and refresh.
-
-Before ARGS are passed to git-annex,
-`magit-annex-global-arguments' will be prepended.
-
-See `magit-run-git' for more details on the git call."
-  (magit-run-git "annex" magit-annex-global-arguments args))
-
-(defun magit-annex-run-async (&rest args)
-  "Call git-annex asynchronously with ARGS.
-See `magit-annex-run' and `magit-run-git-async' for more
-information."
-  (magit-run-git-async "annex" magit-annex-global-arguments args))
-
-(defun magit-annex-command (command)
-  "Execute COMMAND asynchonously, displaying output.
-This is like `magit-git-command', but \"git annex \" rather than
-\"git \" is used as the initial input."
-  (interactive (list (magit-read-shell-command nil "git annex ")))
-  (magit-git-command command))
-
-(defun magit-annex-command-topdir (command)
-  "Execute COMMAND asynchronously from top directory, displaying output.
-This is like `magit-git-command-topdir', but \"git annex \"
-rather than \"git \" is used as the initial input."
-  (interactive (list (magit-read-shell-command t "git annex ")))
-  (magit-git-command-topdir command))
-
-
-;;; Initialization
-
-;;;###autoload
-(defun magit-annex-popup-or-init ()
-  "Call Magit-annex popup or offer to initialize non-annex repo."
-  (interactive)
-  (cond
-   ((magit-annex-inside-annexdir-p)
-    (magit-annex-popup))
-   ((y-or-n-p (format "No git-annex repository in %s.  Initialize one? "
-                      default-directory))
-    (call-interactively 'magit-annex-init))))
-
-;;;###autoload
-(defun magit-annex-init (&optional description)
-  "Initialize git-annex repository.
-\('git annex init [DESCRIPTION]')"
-  (interactive "sDescription: ")
-  (magit-annex-run "init" description))
-
-(defun magit-annex-inside-annexdir-p ()
-  (file-exists-p (concat (magit-git-dir) "annex")))
-
-
-;;; Annexing
-
-(defun magit-annex-add (&optional file)
-  "Add the item at point to annex.
-With a prefix argument, prompt for FILE.
-\('git annex add')"
-  ;; Modified from `magit-stage'.
-  (interactive
-   (when current-prefix-arg
-     (list (magit-completing-read "Add file"
-                                  (nconc (magit-annex-unlocked-files)
-                                         (magit-untracked-files))))))
-  (if file
-      (magit-annex-run "add" file)
-    (--when-let (magit-current-section)
-      (pcase (list (magit-diff-type) (magit-diff-scope))
-        (`(untracked file)
-         (magit-annex-run "add" (directory-file-name
-                                 (magit-section-value it))))
-        (`(untracked files)
-         (magit-annex-run "add" (mapcar #'directory-file-name
-                                        (magit-region-values))))
-        (`(untracked list)
-         (magit-annex-run "add" (magit-untracked-files)))
-        (`(unstaged file)
-         (magit-annex-run "add" (magit-section-value it)))
-        (`(unstaged files)
-         (magit-annex-run "add" (magit-region-values)))
-        (`(unstaged list)
-         (magit-annex-run "add" (magit-annex-unlocked-files)))))))
-
-(defun magit-annex-add-all ()
-  "Add all untracked and modified files to the annex.
-\('git annex add .')"
-  ;; Modified from `magit-stage-all'.
-  (interactive)
-  (when (or (not magit-annex-add-all-confirm)
-            (not (magit-anything-staged-p))
-            (yes-or-no-p "Add all changes to the annex?"))
-    (magit-annex-run "add" ".")))
-
-
-;;; Updating
-
-(defun magit-annex-sync (&optional args)
-  "Sync git-annex.
-\('git annex sync [ARGS]')"
-  (interactive (list (magit-annex-sync-arguments)))
-  (magit-annex-run-async "sync" args))
-
-(defun magit-annex-sync-remote (remote &optional args)
-  "Sync git-annex with REMOTE.
-\('git annex sync [ARGS] REMOTE')"
-  (interactive (list (magit-read-remote "Remote")
-                     (magit-annex-sync-arguments)))
-  (magit-annex-run-async "sync" args remote))
-
-(defun magit-annex-merge ()
-  "Merge git-annex.
-\('git annex merge')"
-  (interactive)
-  (magit-annex-run "merge"))
-
-
-;;; Managing content
-
-(defun magit-annex-get-all-auto ()
-  "Run `git annex get --auto'."
-  (interactive)
-  (magit-annex-run-async "get" "--auto"))
-
-(defun magit-annex-read-files (prompt &optional limit-to default)
-  (let* ((files (pcase limit-to
-                  ((guard (not magit-annex-limit-file-choices))
-                   (magit-annex-files))
-                  (`absent (magit-annex-absent-files))
-                  (`present (magit-annex-present-files))
-                  (`unlocked (magit-annex-unlocked-files))
-                  (_ (magit-annex-files))))
-         (dirs (and magit-annex-include-directories
-                    (delete-dups
-                     (sort (delq nil (mapcar #'file-name-directory files))
-                           #'string-lessp))))
-         (input (if files
-                    (completing-read-multiple
-                     (or prompt "File,s: ")
-                     (cons "*all*" (if dirs (nconc dirs files) files))
-                     nil nil nil nil
-                     default)
-                  (user-error "No files to act on"))))
-    (cond
-     ((and (not input) (or (not magit-annex-confirm-all-files)
-                           (y-or-n-p "Act on all files?")
-                           (user-error "Aborting call")))
-      nil)
-     ((member "*all*" input) nil)
-     (t
-      (cl-mapcan (lambda (f)
-                   (if (string-match-p "[[.*+\\^$?]" f)
-                       (file-expand-wildcards f)
-                     (list f)))
-                 input)))))
-
-(defmacro magit-annex-files-action (command &optional limit no-async)
-  (declare (indent defun) (debug t))
-  `(defun ,(intern (concat "magit-annex-" command "-files")) (files &optional args)
-     ,(format "%s FILES.\n\n  git annex %s [ARGS] [FILE...]"
-              (capitalize command) command)
-     (interactive
-      (list (let ((atpoint (magit-annex-list-file-at-point)))
-              (magit-annex-read-files
-               (concat ,(capitalize command)
-                       " file,s"
-                       (and atpoint (format " (%s)" atpoint))
-                       ": ")
-               ,limit
-               atpoint))
-            (magit-annex-file-action-arguments)))
-     (magit-with-toplevel
-       (,(if no-async 'magit-annex-run 'magit-annex-run-async)
-        ,command args files))))
-
-(magit-annex-files-action "get" 'absent)
-(magit-annex-files-action "drop"
-  (unless (magit-annex-from-in-options-p) 'present))
-(magit-annex-files-action "copy"
-  (unless (magit-annex-from-in-options-p) 'present))
-(magit-annex-files-action "move"
-  (unless (magit-annex-from-in-options-p) 'present))
-(magit-annex-files-action "unlock" 'present t)
-(magit-annex-files-action "lock" 'unlocked t)
-
-(defun magit-annex-from-in-options-p ()
-  (cl-some (lambda (it) (string-match "--from=" it)) magit-current-popup-args))
-
-(defun magit-annex-files ()
-  "Return all annex files."
-  (magit-git-items "annex" "find" "--print0" "--include" "*"))
-
-(defun magit-annex-present-files ()
-  "Return annex files that are present in current repo."
-  (magit-git-items "annex" "find" "--print0"))
-
-(defun magit-annex-absent-files ()
-  "Return annex files that are absent in current repo."
-  (magit-git-items "annex" "find" "--print0" "--not" "--in=here"))
-
-(defun magit-annex-unlocked-files ()
-  "Return unlocked annex files."
-  (magit-git-items "diff-files" "-z" "--diff-filter=T" "--name-only"))
-
-
-;; Unused mode
-
-(defun magit-annex-unused-add ()
-  "Add annex unused data back into the index."
-  (interactive)
-  (magit-section-case
-    (unused-data
-     (let ((data-nums (or (mapcar #'car (magit-region-values))
-                          (list (car (magit-section-value it))))))
-       (magit-annex-run "addunused" data-nums)))))
-
-(defun magit-annex-unused-drop (&optional force)
-  "Drop current unused data.
-With prefix argument FORCE, pass \"--force\" flag to
-`git annex dropunused'."
-  (interactive "P")
-  (magit-section-case
-    (unused-data
-     (let ((data-nums (or (mapcar #'car (magit-region-values))
-                          (list (car (magit-section-value it))))))
-       (magit-annex-run "dropunused" (if force
-                                         (cons "--force" data-nums)
-                                       data-nums))))
-    (unused
-     (magit-annex-run "dropunused" (if force
-                                       '("--force" "all")
-                                     "all")))))
-
-(defun magit-annex-unused-log-popup ()
-  "Display log for unused file.
-
-This is like `magit-log-popup', but, if point is on an unused
-file, the unused file's key is automatically supplied as the
-value for the '-S' flag.  The '--stat' flag is also enabled if
-`magit-annex-unused-stat-argument' is non-nil.
-
-\('git log [--stat] -S<KEY>')"
-  (interactive)
-  (let ((section (magit-current-section)))
-    (if (not (eq (magit-section-type section) 'unused-data))
-        (call-interactively #'magit-log-popup)
-      (let ((magit-log-arguments
-             `(,(concat "-S" (cdr (magit-section-value section)))
-               ,(and magit-annex-unused-stat-argument "--stat")
-               ,@(cl-remove-if
-                  (lambda (x) (string-prefix-p "-S" x))
-                  (-if-let (buffer (magit-mode-get-buffer 'magit-log-mode))
-                      (with-current-buffer buffer
-                        (magit-popup-import-file-args (nth 1 magit-refresh-args)
-                                                      (nth 2 magit-refresh-args)))
-                    (default-value 'magit-log-arguments)))))
-            (magit-popup-use-prefix-argument 'default))
-        (magit-invoke-popup 'magit-log-popup nil nil)))))
-
-(defun magit-annex--file-name-from-key (key)
-  (magit-git-string "annex" "examinekey" key
-                    "--format=.git/annex/objects/${hashdirmixed}${key}/${key}"))
-
-(declare-function dired-read-shell-command "dired-aux" (prompt arg files))
-
-(defun magit-annex-unused-open (&optional in-emacs)
-  "Open an unused file.
-By default, prompt for a command to open the file.  If
-`magit-annex-unused-open-function' is non-nil, pass the file name
-to this function instead.  With prefix argument IN-EMACS, open
-the file within Emacs."
-  (interactive "P")
-  (magit-section-case
-    (unused-data
-     (let* ((key (cdr (magit-section-value it)))
-            (file (magit-annex--file-name-from-key key)))
-       (cond
-        (in-emacs
-         (find-file file))
-        (magit-annex-unused-open-function
-         (funcall magit-annex-unused-open-function file))
-        (t
-         (require 'dired-aux)
-         (let ((command (dired-read-shell-command "open %s with " ()
-                                                  (list file))))
-           (dired-do-async-shell-command command () (list file)))))))))
-
-(defvar magit-annex-unused-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-mode-map)
-    (define-key map (kbd "RET") #'magit-annex-unused-open)
-    (define-key map "s" #'magit-annex-unused-add)
-    (define-key map "k" #'magit-annex-unused-drop)
-    (define-key map "l" #'magit-annex-unused-log-popup)
-    map)
-  "Keymap for `magit-annex-unused-mode'.")
-
-(define-derived-mode magit-annex-unused-mode magit-mode "Magit-annex Unused"
-  "Mode for looking at unused data in annex.
-
-\\<magit-annex-unused-mode-map>\
-Type \\[magit-annex-unused-drop] to drop data at point.
-Type \\[magit-annex-unused-add] to add the unused data back into the index.
-Type \\[magit-annex-unused-log-popup] to show commit log for the unused file.
-Type \\[magit-annex-unused-open] to open the file.
-\n\\{magit-annex-unused-mode-map}"
-  :group 'magit-modes
-  (hack-dir-local-variables-non-file-buffer))
-
-;;;###autoload
-(defun magit-annex-unused (&optional args)
-  "Show unused data.
-\('git annex unused [ARGS]')"
-  (interactive (list (magit-annex-unused-arguments)))
-  (magit-mode-setup #'magit-annex-unused-mode args))
-
-;;;###autoload
-(defun magit-annex-unused-reflog (&optional args)
-  "Show unused data.
-\('git annex unused --used-refspec=reflog [ARGS]')"
-  (interactive (list (magit-annex-unused-arguments)))
-  (if (cl-some (lambda (x) (string-prefix-p "--used-refspec=" x))
-               args)
-      (user-error "Flag --used-refspec was given more than once")
-    (setq args (cons "--used-refspec=reflog" args)))
-  (magit-mode-setup #'magit-annex-unused-mode args))
-
-(defun magit-annex-unused-refresh-buffer (args)
-  "Refresh the content of the unused buffer."
-  (magit-insert-section (unused)
-    (magit-insert-heading
-      (concat "Unused files"
-              (and args
-                   (concat " (" (mapconcat #'identity args " ") ")"))
-              ":"))
-    (magit-git-wash #'magit-annex-unused-wash
-      "annex" "unused" args)))
-
-(defun magit-annex-unused-wash (&rest _)
-  "Convert the output of git-annex unused into Magit section."
-  (when (not (looking-at "unused .*
-"))
-    (error "Check magit-process for error"))
-  (delete-region (point) (match-end 0))
-  (if (not (looking-at ".*Some annexed data is no longer used by any files:
- *NUMBER *KEY
-"))
-      (progn
-        (delete-region (point-min) (point-max))
-        (insert "   nothing"))
-    (delete-region (point) (match-end 0))
-    (magit-wash-sequence #'magit-annex-unused-wash-line)
-    (delete-region (point) (point-max))))
-
-(defun magit-annex-unused-wash-line ()
-  "Make a Magit section from description of unused data."
-  (when (looking-at " *\\([0-9]+\\) *\\(.*\\)$")
-    (let ((num (match-string 1))
-          (key (match-string 2)))
-      (delete-region (match-beginning 0) (match-end 0))
-      (magit-insert-section it (unused-data (cons num key))
-        (insert (format "   %-3s   %s" num key))
-        (forward-line)))))
-
-
-;; List mode
-
-(defcustom magit-annex-list-sections-hook
-  '(magit-annex-list-insert-headers
-    magit-annex-list-insert-files)
-  "Hook run to insert sections into a `magit-annex-list-mode' buffer."
-  :group 'magit-modes
-  :type 'hook)
-
-(defvar magit-annex-list-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map magit-mode-map)
-    (define-key map "f" #'magit-annex-file-action-popup)
-    map)
-  "Keymap for `magit-annex-list-mode'.")
-
-(define-derived-mode magit-annex-list-mode magit-mode "Magit-annex List"
-  "Mode for viewing on `git annex list' output.
-
-\\<magit-annex-list-mode-map>\
-Type \\[magit-annex-file-action-popup] to perform git-annex action
-on the file at point.
-\n\\{magit-annex-list-mode-map}"
-  :group 'magit-modes
-  (hack-dir-local-variables-non-file-buffer))
-
-;;;###autoload
-(defun magit-annex-list-files (&optional args)
-  "List annex files.
-\('git annex list [ARGS]')"
-  (interactive (magit-annex-list-arguments))
-  (magit-mode-setup #'magit-annex-list-mode nil args))
-
-;;;###autoload
-(defun magit-annex-list-dir-files (directory &optional args)
-  "List annex files in DIRECTORY.
-\('git annex list [ARGS] DIRECTORY')"
-  (interactive
-   (list (directory-file-name
-          (file-relative-name (read-directory-name "List annex files in: "
-                                                   nil nil t)
-                              (magit-toplevel)))
-         (magit-annex-list-arguments)))
-  (magit-mode-setup #'magit-annex-list-mode directory args))
-
-(defun magit-annex-list-refresh-buffer (&rest _)
-  "Refresh content of a `magit-annex-list-mode' buffer."
-  (magit-insert-section (annex-list-buffer)
-    (run-hooks 'magit-annex-list-sections-hook)))
-
-(defun magit-annex-list-insert-headers ()
-  "Insert headers for `magit-annex-list-mode' buffer."
-  (magit-insert-status-headers))
-
-(defun magit-annex-list-insert-files ()
-  "Insert output of `git annex list'."
-  (let* ((subdir (car magit-refresh-args))
-         (heading (if subdir
-                      (format "Annex files in %s:" subdir)
-                    "Annex files:")))
-    (magit-insert-section (annex-list-buffer)
-      (magit-insert-heading heading)
-      (magit-git-wash #'magit-annex-list-wash
-        "annex" "list" magit-refresh-args))))
-
-(defconst magit-annex-list-line-re "\\([_X]+\\) \\(.*\\)$")
-
-(defun magit-annex-list-wash (&rest _)
-  "Convert the output of `git annex list' into Magit section."
-  (when (looking-at "(merging .+)")
-    (delete-region (point) (1+ (match-end 0))))
-  (when (not (looking-at "here"))
-    (error "Check magit-process for error"))
-  (if (re-search-forward magit-annex-list-line-re nil t)
-      (progn (beginning-of-line)
-             (magit-wash-sequence #'magit-annex-list-wash-line))
-    (re-search-forward "^|+$")))
-
-(defun magit-annex-list-wash-line ()
-  "Convert file line of `git annex list' into Magit section."
-  (when (looking-at magit-annex-list-line-re)
-    (let ((locs (match-string 1))
-          (file (match-string 2)))
-      (delete-region (match-beginning 0) (match-end 0))
-      (magit-insert-section it (annex-list-file (cons locs file))
-        (insert (format "%s %s" locs file))
-        (forward-line)))))
-
-(defun magit-annex-list-file-at-point ()
-  (cdr (magit-section-when annex-list-file)))
-
-(provide 'magit-annex)
-
-;;; magit-annex.el ends here
.emacs.d/elpa/magit-annex-20170913.659/magit-annex.elc
Binary file
.emacs.d/elpa/magit-popup-20170918.1116/dir
@@ -1,18 +0,0 @@
-This is the file .../info/dir, which contains the
-topmost node of the Info hierarchy, called (dir)Top.
-The first time you invoke Info you start off looking at this node.
-
-File: dir,	Node: Top	This is the top of the INFO tree
-
-  This (the Directory node) gives a menu of major topics.
-  Typing "q" exits, "?" lists all Info commands, "d" returns here,
-  "h" gives a primer for first-timers,
-  "mEmacs<Return>" visits the Emacs manual, etc.
-
-  In Emacs, you can click mouse button 2 on a menu item or cross reference
-  to select it.
-
-* Menu:
-
-Emacs
-* Magit-Popup: (magit-popup).   Infix arguments with feedback.
.emacs.d/elpa/magit-popup-20170918.1116/magit-popup-autoloads.el
@@ -1,16 +0,0 @@
-;;; magit-popup-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil nil ("magit-popup-pkg.el" "magit-popup.el")
-;;;;;;  (22985 22836 923522 524000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; magit-popup-autoloads.el ends here
.emacs.d/elpa/magit-popup-20170918.1116/magit-popup-pkg.el
@@ -1,9 +0,0 @@
-(define-package "magit-popup" "20170918.1116" "Define prefix-infix-suffix command combos"
-  '((emacs "24.4")
-    (async "20170823")
-    (dash "20170810"))
-  :url "https://github.com/magit/magit" :keywords
-  '("bindings"))
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/magit-popup-20170918.1116/magit-popup.el
@@ -1,1304 +0,0 @@
-;;; magit-popup.el --- Define prefix-infix-suffix command combos  -*- lexical-binding: t -*-
-
-;; Copyright (C) 2010-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file which
-;; lists all contributors.  If not, see http://magit.vc/authors.
-
-;; This library was inspired by and replaces library `magit-key-mode',
-;; which was written by Phil Jackson <phil@shellarchive.co.uk> and is
-;; distributed under the GNU General Public License version 3 or later.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Package-Requires: ((emacs "24.4") (async "20170823") (dash "20170810"))
-;; Keywords: bindings
-;; Homepage: https://github.com/magit/magit
-
-;; Magit 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, or (at your option)
-;; any later version.
-;;
-;; Magit 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library implements a generic interface for toggling switches
-;; and setting options and then invoking an Emacs command which does
-;; something with these arguments.  The prototypical use is for the
-;; command to call an external process, passing on the arguments as
-;; command line arguments.  But this is only one of many possible
-;; uses (though the one this library is optimized for).
-
-;; With the Emacs concept of "prefix arguments" in mind this could be
-;; described as "infix arguments with feedback in a buffer".
-
-;; Commands that set the prefix argument for the subsequent command do
-;; not limit what that next command could be.  But entering a command
-;; console popup does limit the selection to the commands defined for
-;; that popup, and so we use the term "infix" instead of "prefix".
-
-;;; Code:
-
-(require 'button)
-(require 'cl-lib)
-(require 'dash)
-(require 'format-spec)
-
-(and (require 'async-bytecomp nil t)
-     (cl-intersection '(all magit)
-                      (bound-and-true-p async-bytecomp-allowed-packages))
-     (fboundp 'async-bytecomp-package-mode)
-     (async-bytecomp-package-mode 1))
-
-(declare-function info 'info)
-(declare-function Man-find-section 'man)
-(declare-function Man-next-section 'man)
-
-;; For the `:variable' event type.
-(declare-function magit-git-string 'magit-git)
-(declare-function magit-refresh 'magit-mode)
-(declare-function magit-get 'magit-git)
-(declare-function magit-set 'magit-git)
-
-;; For branch actions.
-(declare-function magit-branch-set-face 'magit-git)
-
-;;; Settings
-;;;; Custom Groups
-
-(defgroup magit-popup nil
-  "Infix arguments with a popup as feedback."
-  :link '(info-link "(magit-popup)")
-  :group 'bindings)
-
-(defgroup magit-popup-faces nil
-  "Faces used by Magit-Popup."
-  :group 'magit-popup)
-
-;;;; Custom Options
-
-(defcustom magit-popup-display-buffer-action '((display-buffer-below-selected))
-  "The action used to display a popup buffer.
-
-Popup buffers are displayed using `display-buffer' with the value
-of this option as ACTION argument.  You can also set this to nil
-and instead add an entry to `display-buffer-alist'."
-  :package-version '(magit-popup . "2.4.0")
-  :group 'magit-popup
-  :type 'sexp)
-
-(defcustom magit-popup-manpage-package
-  (if (memq system-type '(windows-nt ms-dos)) 'woman 'man)
-  "The package used to display manpages.
-One of `man' or `woman'."
-  :group 'magit-popup
-  :type '(choice (const man) (const woman)))
-
-(defcustom magit-popup-show-help-echo t
-  "Show usage information in the echo area."
-  :group 'magit-popup
-  :type 'boolean)
-
-(defcustom magit-popup-show-common-commands nil
-  "Whether to initially show section with commands common to all popups.
-This section can also be toggled temporarily using \
-\\<magit-popup-mode-map>\\[magit-popup-toggle-show-common-commands]."
-  :package-version '(magit-popup . "2.9.0")
-  :group 'magit-popup
-  :type 'boolean)
-
-(defcustom magit-popup-use-prefix-argument 'default
-  "Control how prefix arguments affect infix argument popups.
-
-This option controls the effect that the use of a prefix argument
-before entering a popup has.
-
-`default'  With a prefix argument directly invoke the popup's
-           default action (an Emacs command), instead of bringing
-           up the popup.
-
-`popup'    With a prefix argument bring up the popup, otherwise
-           directly invoke the popup's default action.
-
-`nil'      Ignore prefix arguments."
-  :group 'magit-popup
-  :type '(choice
-          (const :tag "Call default action instead of showing popup" default)
-          (const :tag "Show popup instead of calling default action" popup)
-          (const :tag "Ignore prefix argument" nil)))
-
-;;;; Custom Faces
-
-(defface magit-popup-heading
-  '((t :inherit font-lock-keyword-face))
-  "Face for key mode header lines."
-  :group 'magit-popup-faces)
-
-(defface magit-popup-key
-  '((t :inherit font-lock-builtin-face))
-  "Face for key mode buttons."
-  :group 'magit-popup-faces)
-
-(defface magit-popup-argument
-  '((t :inherit font-lock-warning-face))
-  "Face used to display enabled arguments in popups."
-  :group 'magit-popup-faces)
-
-(defface magit-popup-disabled-argument
-  '((t :inherit shadow))
-  "Face used to display disabled arguments in popups."
-  :group 'magit-popup-faces)
-
-(defface magit-popup-option-value
-  '((t :inherit font-lock-string-face))
-  "Face used to display option values in popups."
-  :group 'magit-popup-faces)
-
-;;;; Keymap
-
-(defvar magit-popup-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap self-insert-command] 'magit-invoke-popup-action)
-    (define-key map (kbd "- <t>")               'magit-invoke-popup-switch)
-    (define-key map (kbd "= <t>")               'magit-invoke-popup-option)
-    (define-key map (kbd "C-g")     'magit-popup-quit)
-    (define-key map (kbd "?")       'magit-popup-help)
-    (define-key map (kbd "C-h k")   'magit-popup-help)
-    (define-key map (kbd "C-h i")   'magit-popup-info)
-    (define-key map (kbd "C-t")     'magit-popup-toggle-show-common-commands)
-    (define-key map (kbd "C-c C-c") 'magit-popup-set-default-arguments)
-    (define-key map (kbd "C-x C-s") 'magit-popup-save-default-arguments)
-    (cond ((featurep 'jkl)
-           (define-key map (kbd "C-p") 'universal-argument)
-           (define-key map [return]    'push-button)
-           (define-key map (kbd "C-i") 'backward-button)
-           (define-key map (kbd "C-k") 'forward-button))
-          (t
-           (define-key map (kbd "C-m") 'push-button)
-           (define-key map (kbd "DEL") 'backward-button)
-           (define-key map (kbd "C-p") 'backward-button)
-           (define-key map (kbd "C-i") 'forward-button)
-           (define-key map (kbd "C-n") 'forward-button)))
-    map)
-  "Keymap for `magit-popup-mode'.
-
-\\<magit-popup-mode-map>\
-This keymap contains bindings common to all popups.  A section
-listing these commands can be shown or hidden using \
-\\[magit-popup-toggle-show-common-commands].
-
-The prefix used to toggle any switch can be changed by binding
-another key to `magit-invoke-popup-switch'.  Likewise binding
-another key to `magit-invoke-popup-option' changes the prefixed
-used to set any option.  The two prefixes have to be different.
-If you change these bindings, you should also change the `prefix'
-property of the button types `magit-popup-switch-button' and
-`magit-popup-option-button'.
-
-If you change any other binding, then you might have to also edit
-`magit-popup-common-commands' for things to align correctly in
-the section listing these commands.
-
-Never bind an alphabetic character in this keymap or you might
-make it impossible to invoke certain actions.")
-
-(defvar magit-popup-common-commands
-  '(("Set defaults"          magit-popup-set-default-arguments)
-    ("View popup manual"     magit-popup-info)
-    ("Toggle this section"   magit-popup-toggle-show-common-commands)
-    ("Save defaults"         magit-popup-save-default-arguments)
-    ("    Popup help prefix" magit-popup-help)
-    ("Abort"                 magit-popup-quit)))
-
-;;;; Buttons
-
-(define-button-type 'magit-popup-button
-  'face nil
-  'action (lambda (button)
-            (funcall (button-get button 'function)
-                     (button-get button 'event))))
-
-(define-button-type 'magit-popup-switch-button
-  'supertype 'magit-popup-button
-  'function  'magit-invoke-popup-switch
-  'property  :switches
-  'heading   "Switches\n"
-  'formatter 'magit-popup-format-argument-button
-  'format    " %k %d (%a)"
-  'prefix    ?-
-  'maxcols   1)
-
-(define-button-type 'magit-popup-option-button
-  'supertype 'magit-popup-button
-  'function  'magit-invoke-popup-option
-  'property  :options
-  'heading   "Options\n"
-  'formatter 'magit-popup-format-argument-button
-  'format    " %k %d (%a%v)"
-  'prefix    ?=
-  'maxcols   1)
-
-(define-button-type 'magit-popup-variable-button
-  'supertype 'magit-popup-button
-  'function  'magit-invoke-popup-action
-  'property  :variables
-  'heading   "Variables\n"
-  'formatter 'magit-popup-format-variable-button
-  'format    " %k %d"
-  'prefix    nil
-  'maxcols   1)
-
-(define-button-type 'magit-popup-action-button
-  'supertype 'magit-popup-button
-  'function  'magit-invoke-popup-action
-  'property  :actions
-  'heading   "Actions\n"
-  'formatter 'magit-popup-format-action-button
-  'format    " %k %d"
-  'prefix    nil
-  'maxcols   :max-action-columns)
-
-(define-button-type 'magit-popup-command-button
-  'supertype 'magit-popup-action-button
-  'formatter 'magit-popup-format-command-button
-  'action    (lambda (button)
-               (let ((command (button-get button 'function)))
-                 (unless (eq command 'push-button)
-                   (call-interactively command)))))
-
-(define-button-type 'magit-popup-internal-command-button
-  'supertype 'magit-popup-command-button
-  'heading   "Common Commands\n"
-  'maxcols   3)
-
-;;; Events
-
-(defvar-local magit-this-popup nil
-  "The popup which is currently active.
-This is intended for internal use only.
-Don't confuse this with `magit-current-popup'.")
-
-(defvar-local magit-this-popup-events nil
-  "The events known to the active popup.
-This is intended for internal use only.
-Don't confuse this with `magit-current-popup-args'.")
-
-(defvar-local magit-previous-popup nil)
-
-(defun magit-popup-get (prop)
-  "While a popup is active, get the value of PROP."
-  (if (memq prop '(:switches :options :variables :actions))
-      (plist-get magit-this-popup-events prop)
-    (plist-get (symbol-value magit-this-popup) prop)))
-
-(defun magit-popup-put (prop val)
-  "While a popup is active, set the value of PROP to VAL."
-  (if (memq prop '(:switches :options :variables :actions))
-      (setq magit-this-popup-events
-            (plist-put magit-this-popup-events prop val))
-    (error "Property %s isn't supported" prop)))
-
-(defvar magit-current-popup nil
-  "The popup from which this editing command was invoked.
-
-Use this inside the `interactive' form of a popup aware command
-to determine whether it was invoked from a popup and if so from
-which popup.  If the current command was invoked without the use
-of a popup, then this is nil.")
-
-(defvar magit-current-popup-action nil
-  "The popup action now being executed.")
-
-(defvar magit-current-popup-args nil
-  "The value of the popup arguments for this editing command.
-
-If the current command was invoked from a popup, then this is
-a list of strings of all the set switches and options.  This
-includes arguments which are set by default not only those
-explicitly set during this invocation.
-
-When the value is nil, then that can be because no argument is
-set, or because the current command wasn't invoked from a popup;
-consult `magit-current-popup' to tell the difference.
-
-Generally it is better to use `NAME-arguments', which is created
-by `magit-define-popup', instead of this variable or the function
-by the same name, because `NAME-argument' uses the default value
-for the arguments when the editing command is invoked directly
-instead of from a popup.  When the command is bound in several
-popups that might not be feasible though.")
-
-(defun magit-current-popup-args (&rest filter)
-  "Return the value of the popup arguments for this editing command.
-
-The value is the same as that of the variable by the same name
-\(which see), except that FILTER is applied.  FILTER is a list
-of regexps; only arguments that match one of them are returned.
-The first element of FILTER may also be `:not' in which case
-only arguments that don't match any of the regexps are returned,
-or `:only' which doesn't change the behaviour."
-  (let ((-compare-fn (lambda (a b) (magit-popup-arg-match b a))))
-    (-filter (if (eq (car filter) :not)
-                 (lambda (arg) (not (-contains-p (cdr filter) arg)))
-               (when (eq (car filter) :only)
-                 (pop filter))
-               (lambda (arg) (-contains-p filter arg)))
-             magit-current-popup-args)))
-
-(defun magit-popup-arg-match (pattern string)
-  (if (or (string-match-p "=$" pattern)
-          (string-match-p "^-[A-Z]$" pattern))
-      (string-match (format "^%s\\(.*\\)$" pattern) string)
-    (string-equal string pattern)))
-
-(cl-defstruct magit-popup-event key dsc arg fun use val)
-
-(defun magit-popup-event-keydsc (ev)
-  (let ((key (magit-popup-event-key ev)))
-    (key-description (if (vectorp key) key (vector key)))))
-
-(defun magit-popup-lookup (event type)
-  (--first (equal (magit-popup-event-key it) event)
-           (-filter 'magit-popup-event-p (magit-popup-get type))))
-
-(defun magit-popup-get-args ()
-  (--mapcat (when (and (magit-popup-event-p it)
-                       (magit-popup-event-use it))
-              (list (format "%s%s"
-                            (magit-popup-event-arg it)
-                            (or (magit-popup-event-val it) ""))))
-            (append (magit-popup-get :switches)
-                    (magit-popup-get :options))))
-
-(defmacro magit-popup-convert-events (def form)
-  (declare (indent 1) (debug (form form)))
-  `(--map (if (or (null it) (stringp it) (functionp it)) it ,form) ,def))
-
-(defun magit-popup-convert-switches (val def)
-  (magit-popup-convert-events def
-    (let ((a (nth 2 it)))
-      (make-magit-popup-event
-       :key (car it) :dsc (cadr it) :arg a
-       :use (and (member a val) t)))))
-
-(defun magit-popup-convert-options (val def)
-  (magit-popup-convert-events def
-    (let* ((a (nth 2 it))
-           (r (format "^%s\\(.*\\)" a))
-           (v (--first (string-match r it) val)))
-      (make-magit-popup-event
-       :key (car it)  :dsc (cadr it) :arg a
-       :use (and v t) :val (and v (match-string 1 v))
-       :fun (or (nth 3 it) 'read-from-minibuffer)))))
-
-(defun magit-popup-convert-variables (_val def)
-  (magit-popup-convert-events def
-    (make-magit-popup-event
-     :key (car it) :dsc (cadr it) :fun (nth 2 it) :arg (nth 3 it))))
-
-(defun magit-popup-convert-actions (_val def)
-  (magit-popup-convert-events def
-    (make-magit-popup-event
-     :key (car it) :dsc (cadr it) :fun (nth 2 it))))
-
-;;; Define
-
-(defmacro magit-define-popup (name doc &rest args)
-  "Define a popup command named NAME.
-
-NAME should begin with the package prefix and by convention end
-with `-popup'.  That name is used for the actual command as well
-as for a variable used internally.  DOC is used as the doc-string
-of that command.
-
-Also define an option and a function named `SHORTNAME-arguments',
-where SHORTNAME is NAME with the trailing `-popup' removed.  The
-name of this option and this function can be overwritten using
-the optional argument OPTION, but that is rarely advisable. As a
-special case if OPTION is specified but nil, do not define this
-option and this function at all.
-
-The option `SHORTNAME-arguments' holds the default value for the
-popup arguments.  It can be customized from within the popup or
-using the Custom interface.
-
-The function `SHORTNAME-arguments' is a wrapper around the
-variable `magit-current-popup-args', both of which are intended
-to be used inside the `interactive' form of commands commonly
-invoked from the popup `NAME'.  When such a command is invoked
-from that popup, then the function `SHORTNAME-arguments' returns
-the value of the variable `magit-current-popup-args'; however
-when the command is invoked directly, then it returns the default
-value of the variable `SHORTNAME-arguments'.
-
-Optional argument GROUP specifies the Custom group into which the
-option is placed.  If omitted, then the option is placed into some
-group the same way it is done when directly using `defcustom' and
-omitting the group, except when NAME begins with \"magit-\", in
-which case the group `magit-git-arguments' is used.
-
-Optional argument MODE is deprecated, instead use the keyword
-arguments `:setup-function' and/or `:refresh-function'.  If MODE
-is non-nil, then it specifies the mode used by the popup buffer,
-instead of the default, which is `magit-popup-mode'.
-
-The remaining arguments should have the form
-
-    [KEYWORD VALUE]...
-
-The following keywords are meaningful (and by convention are
-usually specified in that order):
-
-`:actions'
-  The actions which can be invoked from the popup.  VALUE is a
-  list whose members have the form (KEY DESC COMMAND), see
-  `magit-define-popup-action' for details.
-
-  Actions are regular Emacs commands, which usually have an
-  `interactive' form setup to consume the values of the popup
-  `:switches' and `:options' when invoked from the corresponding
-  popup, else when invoked as the default action or directly
-  without using the popup, the default value of the variable
-  `SHORTNAME-arguments'.  This is usually done by calling the
-  function `SHORTNAME-arguments'.
-
-  Members of VALUE may also be strings, assuming the first member
-  is also a string.  Instead of just one action section with the
-  heading \"Actions\", multiple sections are then inserted into
-  the popup buffer, using these strings as headings.
-
-  Members of VALUE may also be nil.  This should only be used
-  together with `:max-action-columns' and allows having gaps in
-  the action grid, which can help arranging actions sensibly.
-
-`:default-action'
-  The default action of the popup which is used directly instead
-  of displaying the popup buffer, when the popup is invoked with
-  a prefix argument.  Also see `magit-popup-use-prefix-argument'
-  and `:use-prefix', which can be used to inverse the meaning of
-  the prefix argument.
-
-`:use-prefix'
-  Controls when to display the popup buffer and when to invoke
-  the default action (if any) directly.  This overrides the
-  global default set using `magit-popup-use-prefix-argument'.
-  The value, if specified, should be one of `default' or `popup',
-  or a function that is called with no arguments and returns one
-  of these symbols.
-
-`:max-action-columns'
-  The maximum number of actions to display on a single line, a
-  number or a function that returns a number and takes the name
-  of the section currently being inserted as argument.  If there
-  isn't enough room to display as many columns as specified here,
-  then fewer are used.
-
-`:switches'
-  The popup arguments which can be toggled on and off.  VALUE
-  is a list whose members have the form (KEY DESC SWITCH), see
-  `magit-define-popup-switch' for details.
-
-`:options'
-  The popup arguments which take a value, as in \"--opt=OPTVAL\".
-  VALUE is a list whose members have the form (KEY DESC OPTION
-  READER), see `magit-define-popup-option' for details.
-
-`:default-arguments'
-  The default arguments, a list of switches (which are then
-  enabled by default) and options with there default values, as
-  in \"--OPT=OPTVAL\".
-
-`:variables'
-
-  Git variables which can be set from the popup.  VALUE is a list
-  whose members have the form (KEY DESC COMMAND FORMATTER), see
-  `magit-define-popup-variable' for details.
-
-`:sequence-predicate'
-  When this function returns non-nil, then the popup uses
-  `:sequence-actions' instead of `:actions', and does not show
-  the `:switches' and `:options'.
-
-`:sequence-actions'
-  The actions which can be invoked from the popup, when
-  `:sequence-predicate' returns non-nil.
-
-`:setup-function'
-  When this function is specified, then it is used instead of
-  `magit-popup-default-setup'.
-
-`:refresh-function'
-  When this function is specified, then it is used instead of
-  calling `magit-popup-insert-section' three times with symbols
-  `magit-popup-switch-button', `magit-popup-option-button', and
-  finally `magit-popup-action-button' as argument.
-
-`:man-page'
-  The name of the manpage to be displayed when the user requests
-  help for a switch or argument.
-
-\(fn NAME DOC [GROUP [MODE [OPTION]]] :KEYWORD VALUE...)"
-  (declare (indent defun) (doc-string 2))
-  (let* ((str  (symbol-name name))
-         (grp  (if (keywordp (car args))
-                   (and (string-prefix-p "magit-" str) ''magit-git-arguments)
-                 (pop args)))
-         (mode (and (not (keywordp (car args))) (pop args)))
-         (opt  (if (keywordp (car args))
-                   (intern (concat (if (string-suffix-p "-popup" str)
-                                       (substring str 0 -6)
-                                     str)
-                                   "-arguments"))
-                 (eval (pop args)))))
-    `(progn
-       (defun ,name (&optional arg) ,doc
-         (interactive "P")
-         (magit-invoke-popup ',name ,mode arg))
-       (defvar ,name
-         (list :variable ',opt ,@args))
-       (magit-define-popup-keys-deferred ',name)
-       ,@(when opt
-           `((defcustom ,opt (plist-get ,name :default-arguments)
-               ""
-               ,@(and grp (list :group grp))
-               :type '(repeat (string :tag "Argument")))
-             (defun ,opt ()
-               (if (eq magit-current-popup ',name)
-                   magit-current-popup-args
-                 ,opt))
-             (put ',opt 'definition-name ',name))))))
-
-(defun magit-define-popup-switch (popup key desc switch
-                                        &optional enable at prepend)
-  "In POPUP, define KEY as SWITCH.
-
-POPUP is a popup command defined using `magit-define-popup'.
-SWITCH is a string representing an argument that takes no value.
-KEY is a character representing the second event in the sequence
-of keystrokes used to toggle the argument.  (The first event, the
-prefix, is shared among all switches, defaults to -, and can be
-changed in `magit-popup-mode-keymap').
-
-DESC is a string describing the purpose of the argument, it is
-displayed in the popup.
-
-If optional ENABLE is non-nil, then the switch is on by default.
-
-SWITCH is inserted after all other switches already defined for
-POPUP, unless optional PREPEND is non-nil, in which case it is
-placed first.  If optional AT is non-nil, then it should be the
-KEY of another switch already defined for POPUP, the argument
-is then placed before or after AT, depending on PREPEND."
-  (declare (indent defun))
-  (magit-define-popup-key popup :switches key
-    (list desc switch enable) at prepend))
-
-(defun magit-define-popup-option (popup key desc option
-                                        &optional reader value at prepend)
-  "In POPUP, define KEY as OPTION.
-
-POPUP is a popup command defined using `magit-define-popup'.
-OPTION is a string representing an argument that takes a value.
-KEY is a character representing the second event in the sequence
-of keystrokes used to set the argument's value.  (The first
-event, the prefix, is shared among all options, defaults to =,
-and can be changed in `magit-popup-mode-keymap').
-
-DESC is a string describing the purpose of the argument, it is
-displayed in the popup.
-
-If optional VALUE is non-nil then the option is on by default,
-and VALUE is its default value.
-
-READER is used to read a value from the user when the option is
-invoked and does not currently have a value.  It should take one
-argument and use it as the prompt.  If this is nil, then
-`read-from-minibuffer' is used.
-
-OPTION is inserted after all other options already defined for
-POPUP, unless optional PREPEND is non-nil, in which case it is
-placed first.  If optional AT is non-nil, then it should be the
-KEY of another option already defined for POPUP, the argument
-is then placed before or after AT, depending on PREPEND."
-  (declare (indent defun))
-  (magit-define-popup-key popup :options key
-    (list desc option reader value) at prepend))
-
-(defun magit-define-popup-variable (popup key desc command formatter
-                                          &optional at prepend)
-  "In POPUP, define KEY as COMMAND.
-
-POPUP is a popup command defined using `magit-define-popup'.
-COMMAND is a command which calls `magit-popup-set-variable'.
-FORMATTER is a function which calls `magit-popup-format-variable'.
-These two functions have to be called with the same arguments.
-
-KEY is a character representing the event used interactively call
-the COMMAND.
-
-DESC is the variable or a representation thereof.  It's not
-actually used for anything.
-
-COMMAND is inserted after all other commands already defined for
-POPUP, unless optional PREPEND is non-nil, in which case it is
-placed first.  If optional AT is non-nil, then it should be the
-KEY of another command already defined for POPUP, the command
-is then placed before or after AT, depending on PREPEND."
-  (declare (indent defun))
-  (magit-define-popup-key popup :variables key
-    (list desc command formatter) at prepend))
-
-(defun magit-define-popup-action (popup key desc command
-                                        &optional at prepend)
-  "In POPUP, define KEY as COMMAND.
-
-POPUP is a popup command defined using `magit-define-popup'.
-COMMAND can be any command but should usually consume the popup
-arguments in its `interactive' form.
-KEY is a character representing the event used invoke the action,
-i.e. to interactively call the COMMAND.
-
-DESC is a string describing the purpose of the action, it is
-displayed in the popup.
-
-COMMAND is inserted after all other commands already defined for
-POPUP, unless optional PREPEND is non-nil, in which case it is
-placed first.  If optional AT is non-nil, then it should be the
-KEY of another command already defined for POPUP, the command
-is then placed before or after AT, depending on PREPEND."
-  (declare (indent defun))
-  (magit-define-popup-key popup :actions key
-    (list desc command) at prepend))
-
-(defun magit-define-popup-sequence-action
-    (popup key desc command &optional at prepend)
-  "Like `magit-define-popup-action' but for `:sequence-action'."
-  (declare (indent defun))
-  (magit-define-popup-key popup :sequence-actions key
-    (list desc command) at prepend))
-
-(defconst magit-popup-type-plural-alist
-  '((:switch . :switches)
-    (:option . :options)
-    (:variable . :variables)
-    (:action . :actions)
-    (:sequence-action . :sequence-actions)))
-
-(defun magit-popup-pluralize-type (type)
-  (or (cdr (assq type magit-popup-type-plural-alist))
-      type))
-
-(defun magit-define-popup-key
-    (popup type key def &optional at prepend)
-  "In POPUP, define KEY as an action, switch, or option.
-It's better to use one of the specialized functions
-  `magit-define-popup-action',
-  `magit-define-popup-sequence-action',
-  `magit-define-popup-switch',
-  `magit-define-popup-option', or
-  `magit-define-popup-variable'."
-  (declare (indent defun))
-  (setq type (magit-popup-pluralize-type type))
-  (if (memq type '(:switches :options :variables :actions :sequence-actions))
-      (if (boundp popup)
-          (let* ((plist (symbol-value popup))
-                 (value (plist-get plist type))
-                 (elt   (assoc key value)))
-            (if elt
-                (setcdr elt def)
-              (setq elt (cons key def)))
-            (if at
-                (when (setq at (cl-member at value :key 'car-safe :test 'equal))
-                  (setq value (cl-delete key value :key 'car-safe :test 'equal))
-                  (if prepend
-                      (progn (push (car at) (cdr at))
-                             (setcar at elt))
-                    (push elt (cdr at))))
-              (setq value (cl-delete key value :key 'car-safe :test 'equal)))
-            (unless (assoc key value)
-              (setq value (if prepend
-                              (cons elt value)
-                            (append value (list elt)))))
-            (set popup (plist-put plist type value)))
-        (push (list type key def at prepend)
-              (get popup 'magit-popup-deferred)))
-    (error "Unknown popup event type: %s" type)))
-
-(defun magit-define-popup-keys-deferred (popup)
-  (dolist (args (get popup 'magit-popup-deferred))
-    (condition-case err
-        (apply #'magit-define-popup-key popup args)
-      ((debug error)
-       (display-warning 'magit (error-message-string err) :error))))
-  (put popup 'magit-popup-deferred nil))
-
-(defun magit-change-popup-key (popup type from to)
-  "In POPUP, bind TO to what FROM was bound to.
-TYPE is one of `:action', `:sequence-action', `:switch', or
-`:option'.  Bind TO and unbind FROM, both are characters."
-  (--if-let (assoc from (plist-get (symbol-value popup)
-                                   (magit-popup-pluralize-type type)))
-      (setcar it to)
-    (message "magit-change-popup-key: FROM key %c is unbound" from)))
-
-(defun magit-remove-popup-key (popup type key)
-  "In POPUP, remove KEY's binding of TYPE.
-POPUP is a popup command defined using `magit-define-popup'.
-TYPE is one of `:action', `:sequence-action', `:switch', or
-`:option'.  KEY is the character which is to be unbound."
-  (setq type (magit-popup-pluralize-type type))
-  (let* ((plist (symbol-value popup))
-         (alist (plist-get plist type))
-         (value (assoc key alist)))
-    (set popup (plist-put plist type (delete value alist)))))
-
-;;; Invoke
-
-(defvar-local magit-popup-previous-winconf nil)
-
-(defun magit-invoke-popup (popup mode arg)
-  (let* ((def     (symbol-value popup))
-         (val     (symbol-value (plist-get def :variable)))
-         (default (plist-get def :default-action))
-         (local   (plist-get def :use-prefix))
-         (local   (if (functionp local)
-                      (funcall local)
-                    local))
-         (use-prefix (or local magit-popup-use-prefix-argument)))
-    (cond
-     ((or (and (eq use-prefix 'default) arg)
-          (and (eq use-prefix 'popup) (not arg)))
-      (if default
-          (let ((magit-current-popup (list popup 'default))
-                (magit-current-popup-args
-                 (let ((magit-this-popup popup)
-                       (magit-this-popup-events nil))
-                   (magit-popup-default-setup val def)
-                   (magit-popup-get-args))))
-            (when (and arg (listp arg))
-              (setq current-prefix-arg (and (not (= (car arg) 4))
-                                            (list (/ (car arg) 4)))))
-            (call-interactively default))
-        (message "%s has no default action; showing popup instead." popup)
-        (magit-popup-mode-setup popup mode)))
-     ((memq use-prefix '(default popup nil))
-      (magit-popup-mode-setup popup mode)
-      (when magit-popup-show-help-echo
-        (message
-         (format
-          "[%s] show common commands, [%s] describe events, [%s] show manual"
-          (propertize "C-t"   'face 'magit-popup-key)
-          (propertize "?"     'face 'magit-popup-key)
-          (propertize "C-h i" 'face 'magit-popup-key)))))
-     (local
-      (error "Invalid :use-prefix popup property value: %s" use-prefix))
-     (t
-      (error "Invalid magit-popup-use-prefix-argument value: %s" use-prefix)))))
-
-(defun magit-invoke-popup-switch (event)
-  (interactive (list last-command-event))
-  (--if-let (magit-popup-lookup event :switches)
-      (progn
-        (setf (magit-popup-event-use it)
-              (not (magit-popup-event-use it)))
-        (magit-refresh-popup-buffer))
-    (user-error "%c isn't bound to any switch" event)))
-
-(defun magit-invoke-popup-option (event)
-  (interactive (list last-command-event))
-  (--if-let (magit-popup-lookup event :options)
-      (progn
-        (if (magit-popup-event-use it)
-            (setf (magit-popup-event-use it) nil)
-          (let* ((arg (magit-popup-event-arg it))
-                 (val (funcall
-                       (magit-popup-event-fun it)
-                       (concat arg (unless (string-match-p "=$" arg) ": "))
-                       (magit-popup-event-val it))))
-            (setf (magit-popup-event-use it) t)
-            (setf (magit-popup-event-val it) val)))
-        (magit-refresh-popup-buffer))
-    (user-error "%c isn't bound to any option" event)))
-
-(defun magit-invoke-popup-action (event)
-  (interactive (list last-command-event))
-  (let ((action   (magit-popup-lookup event :actions))
-        (variable (magit-popup-lookup event :variables)))
-    (when (and variable (not (magit-popup-event-arg variable)))
-      (setq action variable)
-      (setq variable nil))
-    (cond ((or action variable)
-           (let* ((magit-current-popup magit-this-popup)
-                  (magit-current-popup-args (magit-popup-get-args))
-                  (command (magit-popup-event-fun (or action variable)))
-                  (magit-current-popup-action command))
-             (when action
-               (magit-popup-quit))
-             (call-interactively command)
-             (setq this-command command)
-             (unless action
-               (magit-refresh-popup-buffer))))
-          ((eq event ?q)
-           (magit-popup-quit)
-           (when magit-previous-popup
-             (magit-popup-mode-setup magit-previous-popup nil)))
-          (t
-           (user-error "%c isn't bound to any action" event)))))
-
-(defun magit-popup-set-variable
-    (variable choices &optional default other)
-  (magit-set (--if-let (magit-git-string "config" "--local" variable)
-                 (cadr (member it choices))
-               (car choices))
-             variable)
-  (magit-refresh)
-  (message "%s %s" variable
-           (magit-popup-format-variable-1 variable choices default other)))
-
-(defun magit-popup-quit ()
-  "Quit the current popup command without invoking an action."
-  (interactive)
-  (let ((winconf magit-popup-previous-winconf))
-    (if (derived-mode-p 'magit-popup-mode)
-        (kill-buffer)
-      (magit-popup-help-mode -1)
-      (kill-local-variable 'magit-popup-previous-winconf))
-    (when winconf
-      (set-window-configuration winconf))))
-
-(defun magit-popup-read-number (prompt &optional default)
-  "Like `read-number' but DEFAULT may be a numeric string."
-  (read-number prompt (if (stringp default)
-                          (string-to-number default)
-                        default)))
-
-;;; Save
-
-(defun magit-popup-set-default-arguments (arg)
-  "Set default value for the arguments for the current popup.
-Then close the popup without invoking an action; unless a prefix
-argument is used in which case the popup remains open.
-
-For a popup named `NAME-popup' that usually means setting the
-value of the custom option `NAME-arguments'."
-  (interactive "P")
-  (-if-let (var (magit-popup-get :variable))
-      (progn (customize-set-variable var (magit-popup-get-args))
-             (unless arg (magit-popup-quit)))
-    (user-error "Nothing to set")))
-
-(defun magit-popup-save-default-arguments (arg)
-  "Save default value for the arguments for the current popup.
-Then close the popup without invoking an action; unless a prefix
-argument is used in which case the popup remains open.
-
-For a popup named `NAME-popup' that usually means saving the
-value of the custom option `NAME-arguments'."
-  (interactive "P")
-  (-if-let (var (magit-popup-get :variable))
-      (progn (customize-save-variable var (magit-popup-get-args))
-             (unless arg (magit-popup-quit)))
-    (user-error "Nothing to save")))
-
-;;; Help
-
-(defun magit-popup-toggle-show-common-commands ()
-  "Show or hide an additional section with common commands.
-The commands listed in this section are common to all popups
-and are defined in `magit-popup-mode-map' (which see)."
-  (interactive)
-  (setq magit-popup-show-common-commands
-        (not magit-popup-show-common-commands))
-  (magit-refresh-popup-buffer)
-  (fit-window-to-buffer))
-
-(defun magit-popup-help ()
-  "Show help for the argument or action at point."
-  (interactive)
-  (let* ((man (magit-popup-get :man-page))
-         (key (read-key-sequence
-               (concat "Describe key" (and man " (? for manpage)") ": ")))
-         (int (aref key (1- (length key))))
-         (def (or (lookup-key (current-local-map)  key t)
-                  (lookup-key (current-global-map) key))))
-    (pcase def
-      (`magit-invoke-popup-switch
-       (magit-popup-manpage man (magit-popup-lookup int :switches)))
-      (`magit-invoke-popup-option
-       (magit-popup-manpage man (magit-popup-lookup int :options)))
-      (`magit-popup-help
-       (magit-popup-manpage man nil))
-      ((or `self-insert-command
-           `magit-invoke-popup-action)
-       (setq def (or (magit-popup-lookup int :actions)
-                     (magit-popup-lookup int :variables)))
-       (if def
-           (magit-popup-describe-function (magit-popup-event-fun def))
-         (ding)
-         (message nil)))
-      (`nil (ding)
-            (message nil))
-      (_    (magit-popup-describe-function def)))))
-
-(defun magit-popup-manpage (topic arg)
-  (unless topic
-    (user-error "No man page associated with %s"
-                (magit-popup-get :man-page)))
-  (when arg
-    (setq arg (magit-popup-event-arg arg)))
-  (let ((winconf (current-window-configuration)) buffer)
-    (pcase magit-popup-manpage-package
-      (`woman (delete-other-windows)
-              (split-window-below)
-              (with-no-warnings ; display-buffer-function is obsolete
-                (let ((display-buffer-alist nil)
-                      (display-buffer-function nil)
-                      (display-buffer-overriding-action nil))
-                  (woman topic)))
-              (setq buffer (current-buffer)))
-      (`man   (cl-letf (((symbol-function #'fboundp) (lambda (_) nil)))
-                (setq buffer (man topic)))
-              (delete-other-windows)
-              (split-window-below)
-              (set-window-buffer (selected-window) buffer)))
-    (with-current-buffer buffer
-      (setq magit-popup-previous-winconf winconf)
-      (magit-popup-help-mode)
-      (fit-window-to-buffer (next-window))
-      (if (and arg
-               (Man-find-section "OPTIONS")
-               (re-search-forward (format "^[\t\s]+\\(-., \\)*?%s[=\n]" arg)
-                                  (save-excursion
-                                    (Man-next-section 1)
-                                    (point))
-                                  t))
-          (goto-char (1+ (match-beginning 0)))
-        (goto-char (point-min))))))
-
-(defun magit-popup-describe-function (function)
-  (let ((winconf (current-window-configuration)))
-    (delete-other-windows)
-    (split-window-below)
-    (other-window 1)
-    (with-no-warnings ; display-buffer-function is obsolete
-      (let ((display-buffer-alist '(("" display-buffer-use-some-window)))
-            (display-buffer-function nil)
-            (display-buffer-overriding-action nil)
-            (help-window-select nil))
-        (describe-function function)))
-    (fit-window-to-buffer)
-    (other-window 1)
-    (setq magit-popup-previous-winconf winconf)
-    (magit-popup-help-mode)))
-
-(defun magit-popup-info ()
-  "Show the popup manual."
-  (interactive)
-  (let ((winconf (current-window-configuration)))
-    (delete-other-windows)
-    (split-window-below)
-    (info "(magit-popup.info)Usage")
-    (magit-popup-help-mode)
-    (setq magit-popup-previous-winconf winconf))
-  (magit-popup-help-mode)
-  (fit-window-to-buffer (next-window)))
-
-(define-minor-mode magit-popup-help-mode
-  "Auxiliary minor mode used to restore previous window configuration.
-When some sort of help buffer is created from within a popup,
-then this minor mode is turned on in that buffer, so that when
-the user quits it, the previous window configuration is also
-restored."
-  :keymap '(([remap Man-quit]    . magit-popup-quit)
-            ([remap Info-exit]   . magit-popup-quit)
-            ([remap quit-window] . magit-popup-quit)))
-
-;;; Modes
-
-(define-derived-mode magit-popup-mode fundamental-mode "MagitPopup"
-  "Major mode for infix argument popups."
-  :mode 'magit-popup
-  (setq truncate-lines t)
-  (setq buffer-read-only t)
-  (setq-local scroll-margin 0)
-  (setq-local magit-popup-show-common-commands magit-popup-show-common-commands)
-  (hack-dir-local-variables-non-file-buffer))
-
-(put 'magit-popup-mode 'mode-class 'special)
-
-(defun magit-popup-default-setup (val def)
-  (if (--when-let (magit-popup-get :sequence-predicate)
-        (funcall it))
-      (magit-popup-put :actions (magit-popup-convert-actions
-                                 val (magit-popup-get :sequence-actions)))
-    (magit-popup-put :variables (magit-popup-convert-variables
-                                 val (plist-get def :variables)))
-    (magit-popup-put :switches  (magit-popup-convert-switches
-                                 val (plist-get def :switches)))
-    (magit-popup-put :options   (magit-popup-convert-options
-                                 val (plist-get def :options)))
-    (magit-popup-put :actions   (magit-popup-convert-actions
-                                 val (plist-get def :actions)))))
-
-(defun magit-popup-mode-setup (popup mode)
-  (setq magit-previous-popup magit-current-popup)
-  (let ((val (symbol-value (plist-get (symbol-value popup) :variable)))
-        (def (symbol-value popup)))
-    (magit-popup-mode-display-buffer (get-buffer-create
-                                      (format "*%s*" popup))
-                                     (or mode 'magit-popup-mode))
-    (setq magit-this-popup popup)
-    (if (bound-and-true-p magit-popup-setup-hook) ; obsolete
-        (run-hook-with-args 'magit-popup-setup-hook val def)
-      (funcall (or (magit-popup-get :setup-function)
-                   'magit-popup-default-setup)
-               val def)))
-  (magit-refresh-popup-buffer)
-  (fit-window-to-buffer nil nil (line-number-at-pos (point-max))))
-
-(defun magit-popup-mode-display-buffer (buffer mode)
-  (let ((winconf (current-window-configuration)))
-    (select-window (display-buffer buffer magit-popup-display-buffer-action))
-    (funcall mode)
-    (setq magit-popup-previous-winconf winconf)))
-
-(defvar magit-refresh-popup-buffer-hook nil
-  "Hook run by `magit-refresh-popup-buffer'.
-
-The hook is run right after inserting the representation of the
-popup events but before optionally inserting the representation
-of events shared by all popups and before point is adjusted.")
-
-(defun magit-refresh-popup-buffer ()
-  (let* ((inhibit-read-only t)
-         (button (button-at (point)))
-         (prefix (and button (button-get button 'prefix)))
-         (event  (and button (button-get button 'event))))
-    (erase-buffer)
-    (save-excursion
-      (--if-let (magit-popup-get :refresh-function)
-          (funcall it)
-        (magit-popup-insert-section 'magit-popup-switch-button)
-        (magit-popup-insert-section 'magit-popup-option-button)
-        (magit-popup-insert-section 'magit-popup-variable-button)
-        (magit-popup-insert-section 'magit-popup-action-button))
-      (run-hooks 'magit-refresh-popup-buffer-hook)
-      (when magit-popup-show-common-commands
-        (magit-popup-insert-command-section
-         'magit-popup-internal-command-button
-         magit-popup-common-commands)))
-    (set-buffer-modified-p nil)
-    (when event
-      (while (and (ignore-errors (forward-button 1))
-                  (let ((b (button-at (point))))
-                    (or (not (equal (button-get b 'prefix) prefix))
-                        (not (equal (button-get b 'event)  event)))))))))
-
-;;; Draw
-
-(defvar magit-popup-min-padding 3
-  "Minimal amount of whitespace between columns in popup buffers.")
-
-(defun magit-popup-insert-section (type &optional spec heading)
-  (if (not spec)
-      (progn (setq spec (magit-popup-get (button-type-get type 'property)))
-             (when spec
-               (if (or (stringp (car spec))
-                       (functionp (car spec)))
-                   (--each (--partition-by-header
-                            (or (stringp it) (functionp it))
-                            spec)
-                     (magit-popup-insert-section type (cdr it) (car it)))
-                 (magit-popup-insert-section type spec))))
-    (let* ((formatter (button-type-get type 'formatter))
-           (items (mapcar (lambda (ev)
-                            (and ev (or (funcall formatter type ev) '(""))))
-                          (or spec (magit-popup-get
-                                    (button-type-get type 'property)))))
-           (maxcols (button-type-get type 'maxcols))
-           (pred (magit-popup-get :sequence-predicate)))
-      (if (and pred (funcall pred))
-          (setq maxcols nil)
-        (cl-typecase maxcols
-          (keyword (setq maxcols (magit-popup-get maxcols)))
-          (symbol  (setq maxcols (symbol-value maxcols)))))
-      (when (functionp maxcols)
-        (setq maxcols (funcall maxcols heading)))
-      (when items
-        (if (functionp heading)
-            (when (setq heading (funcall heading))
-              (insert heading ?\n))
-          (unless heading
-            (setq heading (button-type-get type 'heading)))
-          (insert (propertize heading 'face 'magit-popup-heading))
-          (unless (string-match "\n$" heading)
-            (insert "\n")))
-        (when heading
-          (let ((colwidth
-                 (+ (apply 'max (mapcar (lambda (e) (length (car e))) items))
-                    magit-popup-min-padding)))
-            (dolist (item items)
-              (unless (bolp)
-                (let ((padding (- colwidth (% (current-column) colwidth))))
-                  (if (and (< (+ (current-column) padding colwidth)
-                              (window-width))
-                           (< (ceiling (/ (current-column) (* colwidth 1.0)))
-                              (or maxcols 1000)))
-                      (insert (make-string padding ?\s))
-                    (insert "\n"))))
-              (unless (equal item '(""))
-                (if item
-                    (apply 'insert-button item)
-                  (insert ?\s)))))
-          (insert (if (= (char-before) ?\n) "\n" "\n\n")))))))
-
-(defun magit-popup-format-argument-button (type ev)
-  (list (format-spec
-         (button-type-get type 'format)
-         `((?k . ,(propertize (concat
-                               (--when-let (button-type-get type 'prefix)
-                                 (char-to-string it))
-                               (magit-popup-event-keydsc ev))
-                              'face 'magit-popup-key))
-           (?d . ,(magit-popup-event-dsc ev))
-           (?a . ,(propertize (magit-popup-event-arg ev)
-                              'face (if (magit-popup-event-use ev)
-                                        'magit-popup-argument
-                                      'magit-popup-disabled-argument)))
-           (?v . ,(let ((val (magit-popup-event-val ev)))
-                    (if (and (magit-popup-event-use ev)
-                             (not (equal val "")))
-                        (propertize (format "\"%s\"" val)
-                                    'face 'magit-popup-option-value)
-                      "")))))
-        'type type 'event (magit-popup-event-key ev)))
-
-(defun magit-popup-format-variable-button (type ev)
-  (if (not (magit-popup-event-arg ev))
-      (magit-popup-format-action-button 'magit-popup-action-button ev)
-    (list (format-spec
-           (button-type-get type 'format)
-           `((?k . ,(propertize (magit-popup-event-keydsc ev)
-                                'face 'magit-popup-key))
-             (?d . ,(funcall (magit-popup-event-arg ev)))))
-          'type type 'event (magit-popup-event-key ev))))
-
-(defun magit-popup-format-variable
-    (variable choices &optional default other width)
-  (concat variable
-          (if width (make-string (- width (length variable)) ?\s) " ")
-          (magit-popup-format-variable-1 variable choices default other)))
-
-(defun magit-popup-format-variable-1
-    (variable choices &optional default other)
-  "Print popup entry for git VARIABLE with possible CHOICES.
-DEFAULT is git's default choice for VARIABLE.  OTHER is a git
-variable whose value may be used as a default."
-  (let ((local  (magit-git-string "config" "--local"  variable))
-        (global (magit-git-string "config" "--global" variable)))
-    (when other
-      (setq other (--when-let (magit-get other)
-                    (concat other ":" it))))
-    (concat
-     (propertize "[" 'face 'magit-popup-disabled-argument)
-     (mapconcat
-      (lambda (choice)
-        (propertize choice 'face (if (equal choice local)
-                                     'magit-popup-option-value
-                                   'magit-popup-disabled-argument)))
-      choices
-      (propertize "|" 'face 'magit-popup-disabled-argument))
-     (when (or global other default)
-       (concat
-        (propertize "|" 'face 'magit-popup-disabled-argument)
-        (cond (global
-               (propertize (concat "global:" global)
-                           'face (cond (local
-                                        'magit-popup-disabled-argument)
-                                       ((member global choices)
-                                        'magit-popup-option-value)
-                                       (t
-                                        'font-lock-warning-face))))
-              (other
-               (propertize other
-                           'face (if local
-                                     'magit-popup-disabled-argument
-                                   'magit-popup-option-value)))
-              (default
-               (propertize (concat "default:" default)
-                           'face (if local
-                                     'magit-popup-disabled-argument
-                                   'magit-popup-option-value))))))
-     (propertize "]" 'face 'magit-popup-disabled-argument))))
-
-(defun magit-popup-format-action-button (type ev)
-  (let* ((dsc (magit-popup-event-dsc ev))
-         (fun (and (functionp dsc) dsc)))
-    (when fun
-      (setq dsc
-            (-when-let (branch (funcall fun))
-              (if (next-single-property-change 0 'face (concat "0" branch))
-                  branch
-                (magit-branch-set-face branch)))))
-    (when dsc
-      (list (format-spec
-             (button-type-get type 'format)
-             `((?k . ,(propertize (magit-popup-event-keydsc ev)
-                                  'face 'magit-popup-key))
-               (?d . ,dsc)
-               (?D . ,(if (and (not fun)
-                               (eq (magit-popup-event-fun ev)
-                                   (magit-popup-get :default-action)))
-                          (propertize dsc 'face 'bold)
-                        dsc))))
-            'type type 'event (magit-popup-event-key ev)))))
-
-(defun magit-popup-insert-command-section (type spec)
-  (magit-popup-insert-section
-   type (mapcar (lambda (elt)
-                  (list (car (where-is-internal (cadr elt)
-                                                (current-local-map)))
-                        (car elt)))
-                spec)))
-
-(defun magit-popup-format-command-button (type elt)
-  (nconc (magit-popup-format-action-button
-          type (make-magit-popup-event :key (car  elt)
-                                       :dsc (cadr elt)))
-         (list 'function (lookup-key (current-local-map) (car elt)))))
-
-;;; Utilities
-
-(defun magit-popup-import-file-args (args files)
-  (if files
-      (cons (concat "-- " (mapconcat #'identity files ",")) args)
-    args))
-
-(defun magit-popup-export-file-args (args)
-  (let ((files (--first (string-prefix-p "-- " it) args)))
-    (when files
-      (setq args  (remove files args))
-      (setq files (split-string (substring files 3) ",")))
-    (list args files)))
-
-(defconst magit-popup-font-lock-keywords
-  (eval-when-compile
-    `((,(concat "(\\(magit-define-popup\\)\\_>"
-                "[ \t'\(]*"
-                "\\(\\(?:\\sw\\|\\s_\\)+\\)?")
-       (1 'font-lock-keyword-face)
-       (2 'font-lock-function-name-face nil t)))))
-
-(font-lock-add-keywords 'emacs-lisp-mode magit-popup-font-lock-keywords)
-
-(provide 'magit-popup)
-;;; magit-popup.el ends here
.emacs.d/elpa/magit-popup-20170918.1116/magit-popup.elc
Binary file
.emacs.d/elpa/magit-popup-20170918.1116/magit-popup.info
@@ -1,707 +0,0 @@
-This is magit-popup.info, produced by makeinfo version 5.2 from
-magit-popup.texi.
-
-     Copyright (C) 2015-2017 Jonas Bernoulli <jonas@bernoul.li>
-
-     You can redistribute this document 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 document 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.
-INFO-DIR-SECTION Emacs
-START-INFO-DIR-ENTRY
-* Magit-Popup: (magit-popup). Infix arguments with feedback.
-END-INFO-DIR-ENTRY
-
-
-File: magit-popup.info,  Node: Top,  Next: Introduction,  Up: (dir)
-
-Magit-Popup User Manual
-***********************
-
-Taking inspiration from regular prefix commands and prefix arguments,
-this library implements a similar abstraction; a new kind of prefix
-command that is associated with a specific set of infix arguments and
-suffix commands.
-
-     Copyright (C) 2015-2017 Jonas Bernoulli <jonas@bernoul.li>
-
-     You can redistribute this document 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 document 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.
-
-* Menu:
-
-* Introduction::
-* Usage::
-* Defining Prefix and Suffix Commands::
-
-— The Detailed Node Listing —
-
-
-Usage
-
-* Customizing Existing Popups::
-* Other Options::
-
-
-
-Defining Prefix and Suffix Commands
-
-* Defining Prefix Commands::
-* Defining Suffix Commands::
-
-
-File: magit-popup.info,  Node: Introduction,  Next: Usage,  Prev: Top,  Up: Top
-
-1 Introduction
-**************
-
-Taking inspiration from regular prefix commands and prefix arguments,
-this library implements a similar abstraction; a new kind of prefix
-command that is associated with a specific set of infix arguments and
-suffix commands.
-
-   Invoking such a prefix command displays a popup buffer which lists
-the associated infix arguments and suffix commands.  In that buffer each
-argument is prefixed with the key sequence that can be used to toggle it
-or change its value.  Likewise each suffix command is prefixed with the
-key used to invoke it.  Such a popup buffer might look like this:
-
-     ,-----------------------------------------
-     |Switches
-     | -l Show graph (--graph)
-     | -d Show refnames (--decorate)
-     |
-     |Options
-     | =m Search messages (--grep="popup")
-     | =p Search patches (-G)
-     |
-     |Action
-     | l Show log for current branch
-     | o Show log for another branch
-     '-----------------------------------------
-
-   The user could then for example type ‘-l’ to toggle the ‘--graph’
-*switch* (when it is on then it is shown in green, otherwise in gray),
-or ‘=m’ to change the value of the *option* ‘--grep’.
-
-   Once all arguments are as desired one invokes a suffix command, which
-causes the popup buffer to disappear.  The suffix command should then
-retrieve the infix arguments in its ‘interactive’ form like this is done
-for prefix arguments.
-
-   While such "prefix-infix-suffix" combos were inspired by regular
-prefix commands and prefix arguments, they are also quite different.
-This should illustrate the most basic differences:
-
-   • A regular prefix command
-
-                  /- command1
-          prefix --- command2
-                  \- command3
-
-   • Prefix arguments
-
-                   /- command1
-          C-u ... --- command2
-                   \- well any command
-
-   • A Prefix-Infix-Suffix combo
-
-                   /- argument1 -\ /- suffix1
-          prefix----- argument2 --+-- suffix2
-                 ^ \- argument3 -/
-                 |        |
-                 '--------'
-              (refresh buffer)
-
-   This library was written as a replacement for ‘magit-key-mode’, which
-was used in Magit releases before 2.1.0.  It is used to implement all
-"popups" in the current Magit release but a future release will switch
-to yet another implementation.
-
-   This library does not depend on any other Magit libraries and it is
-distributed as a separate package, which makes it possible to use it in
-packages that are not related to Magit.  But keep in mind that it will
-be deprecated eventually.
-
-
-File: magit-popup.info,  Node: Usage,  Next: Defining Prefix and Suffix Commands,  Prev: Introduction,  Up: Top
-
-2 Usage
-*******
-
-Every popup buffers created with a prefix command contains a section
-named "Actions" listing the available suffix commands.  Most buffers
-also contain a "Switches" and/or an "Options" section which list the two
-types of infix arguments separately.
-
-   Switches are arguments that can be toggled on or off.  When a switch
-is active then it is shown in color, when it is off then it is shown in
-gray (of course the details depend on the color theme in use).
-
-   Options are arguments that have a value.  When an option has a value
-then that is shown after the option itself.  Because for some options
-the empty string is a valid value, options are additionally colorized
-like switches to indicate whether they are active or not.
-
-   The events bound to suffix commands are always single alphabetic
-characters.  The bindings for arguments are always two events long.  For
-switches the first key is always ‘-’, for options it is always ‘=’.  The
-second key is always an alphabetic character.
-
-   By default popup buffers also feature a section listing commands
-common to all popups.  To avoid conflicts with suffix commands, the
-bindings of these common commands are not alphabetic characters.  This
-section is shown by default so that documentation-resistant users get a
-chance to notice them.
-
- -- User Option: magit-popup-show-common-commands
-
-     This option controls whether the section that lists the commands
-     that are common to all popups is initially shown.
-
-     By default this is not the case, but note that you can temporarily
-     show this section using ‘C-t’, which therefore is the only common
-     command you actually have to memorize.
-
-‘C-t’     (‘magit-popup-toggle-show-common-commands’)
-
-     Show or hide the section listing the commands shared by all popups.
-
-‘C-g’     (‘magit-popup-quit’)
-
-     Quit popup buffer without invoking a suffix command.
-
-   Without further action, setting arguments only affects the next
-suffix command.  Invoking the same prefix command again resets the
-arguments to their default value, but the defaults can be changed
-directly from the popup buffer itself.  For a prefix command named
-‘NAME-popup’ the default values are stored as the value of the custom
-option named ‘NAME-arguments’.  While this option can be customized
-using the Custom interface, it is better to do so directly from the
-popup buffer.
-
-‘C-c C-c’     (‘magit-popup-set-default-arguments’)
-
-     This sets the default value for the arguments for the current
-     popup.
-
-     Then the popup buffer is closed without invoking a suffix command;
-     unless a prefix argument is used in which case the popup remains
-     open.
-
-‘C-x C-s’     (‘magit-popup-save-default-arguments’)
-
-     This sets the default value for the arguments for the current popup
-     and saves it for future Emacs sessions.
-
-     Then the popup buffer is closed without invoking an action; unless
-     a prefix argument is used in which case the popup remains open.
-
-   It is also possible to add additional arguments and commands to an
-existing popup, but that cannot be done directly from the popup (or the
-Custom interface).  See *note Customizing Existing Popups::.
-
-   Documentation about a popup’s arguments and commands can be shown
-directly from the popup.
-
-‘C-h i’     (‘magit-popup-info’)
-
-     Show this manual.
-
-‘?’     (‘magit-popup-help’)
-
-     This command reads a key sequence and then shows the documentation
-     of the argument or command that sequence is bound to.  In other
-     words type the same keys that you would use to invoke the argument
-     or command, but prefix the sequence with ‘?’.
-
-     For suffix commands this shows the doc-string.  For arguments this
-     command can only show something for popups that have an associated
-     man-page.  If the man-page is set, then this command displays it in
-     a separate buffer and puts point on the entry about the argument in
-     question.
-
-     The buffer which is used to display the documentation is selected.
-     Simply press ‘q’ to leave that buffer and restore the old window
-     configuration.
-
-   While it isn’t very useful, it is possible to move around in a popup
-buffer using ‘C-p’ and ‘C-n’, and to invoke the argument or command at
-point using ‘RET’.  But it is much more efficient to use the dedicated
-key bindings instead, so these commands are not listed in popup buffers
-along with the other common commands.
-
-* Menu:
-
-* Customizing Existing Popups::
-* Other Options::
-
-
-File: magit-popup.info,  Node: Customizing Existing Popups,  Next: Other Options,  Up: Usage
-
-2.1 Customizing Existing Popups
-===============================
-
-It is possible to define additional infix arguments and suffix commands
-to an existing popup using the following functions.
-
-   You can find some examples which use the below commands at
-<https://github.com/magit/magit/wiki/Additional-proposed-infix-arguments-and-suffix-commands>.
-
- -- Function: magit-define-popup-switch popup key desc switch &optional
-          enable at prepend
-
-     In POPUP, define KEY as SWITCH.
-
-     POPUP is a popup command defined using ‘magit-define-popup’.
-     SWITCH is a string representing an argument that takes no value.
-     KEY is a character representing the second event in the sequence of
-     keystrokes used to toggle the argument.  (The first event, the
-     prefix, is shared among all switches, defaults to ‘-’, and can be
-     changed in ‘magit-popup-mode-keymap’).
-
-     DESC is a string describing the purpose of the argument, it is
-     displayed in the popup.
-
-     If optional ENABLE is non-nil then the switch is on by default.
-
-     SWITCH is inserted after all other switches already defined for
-     POPUP, unless optional PREPEND is non-nil, in which case it is
-     placed first.  If optional AT is non-nil then it should be the KEY
-     of another switch already defined for POPUP, the argument is then
-     placed before or after AT, depending on PREPEND.
-
- -- Function: magit-define-popup-option popup key desc option &optional
-          reader value at prepend
-
-     In POPUP, define KEY as OPTION.
-
-     POPUP is a popup command defined using ‘magit-define-popup’.
-     OPTION is a string representing an argument that takes a value.
-     KEY is a character representing the second event in the sequence of
-     keystrokes used to set the argument’s value.  (The first event, the
-     prefix, is shared among all options, defaults to ‘=’, and can be
-     changed in ‘magit-popup-mode-keymap’).
-
-     DESC is a string describing the purpose of the argument, it is
-     displayed in the popup.
-
-     If optional VALUE is non-nil then the option is on by default, and
-     VALUE is its default value.
-
-     READER is used to read a value from the user when the option is
-     invoked and does not currently have a value.  It should take one
-     argument and use it as the prompt.  If this is nil, then
-     ‘read-from-minibuffer’ is used.
-
-     OPTION is inserted after all other options already defined for
-     POPUP, unless optional PREPEND is non-nil, in which case it is
-     placed first.  If optional AT is non-nil then it should be the KEY
-     of another option already defined for POPUP, the argument is then
-     placed before or after AT, depending on PREPEND.
-
- -- Function: magit-define-popup-action popup key desc command &optional
-          at prepend
-
-     In POPUP, define KEY as COMMAND.
-
-     POPUP is a popup command defined using ‘magit-define-popup’.
-     COMMAND can be any command but should usually consume the popup
-     arguments in its ‘interactive’ form.  KEY is a character
-     representing the event used invoke the action, i.e.  to
-     interactively call the COMMAND.
-
-     DESC is a string describing the purpose of the action, it is
-     displayed in the popup.
-
-     COMMAND is inserted after all other commands already defined for
-     POPUP, unless optional PREPEND is non-nil, in which case it is
-     placed first.  If optional AT is non-nil then it should be the KEY
-     of another command already defined for POPUP, the command is then
-     placed before or after AT, depending on PREPEND.
-
- -- Function: magit-define-popup-sequence-action popup key desc command
-          &optional at prepend
-
-     Like ‘magit-define-popup-action’, but modifies the value of the
-     ‘:sequence-actions’ property instead of ‘:actions’.
-
- -- Function: magit-define-popup-variable popup key desc command
-          formatter &optional at prepend
-
-     In POPUP, define KEY as COMMAND.
-
-     POPUP is a popup command defined using ‘magit-define-popup’.
-     COMMAND is a command which calls ‘magit-popup-set-variable’.
-     FORMATTER is a function which calls ‘magit-popup-format-variable’.
-     These two functions have to be called with the same arguments.
-
-     KEY is a character representing the event used interactively call
-     the COMMAND.
-
-     DESC is the variable or a representation thereof.  It’s not
-     actually used for anything.
-
-     COMMAND is inserted after all other commands already defined for
-     POPUP, unless optional PREPEND is non-nil, in which case it is
-     placed first.  If optional AT is non-nil then it should be the KEY
-     of another command already defined for POPUP, the command is then
-     placed before or after AT, depending on PREPEND."
-
- -- Function: magit-change-popup-key popup type from to
-
-     In POPUP, bind TO to what FROM was bound to.  TYPE is one of
-     ‘:action’, ‘:sequence-action’, ‘:switch’, or ‘:option’.  Bind TO
-     and unbind FROM, both are characters.
-
- -- Function: magit-remove-popup-key popup type key
-
-     In POPUP, remove KEY’s binding of TYPE. POPUP is a popup command
-     defined using ‘magit-define-popup’.  TYPE is one of ‘:action’,
-     ‘:sequence-action’, ‘:switch’, or ‘:option’.  KEY is the character
-     which is to be unbound.
-
-   It is also possible to change other aspects of a popup by setting a
-property using ‘plist-put’.  See *note Defining Prefix Commands:: for
-valid properties.  The most likely change Magit users might want to make
-is:
-
-     (plist-put magit-show-refs-popup :use-prefix nil)
-
-
-File: magit-popup.info,  Node: Other Options,  Prev: Customizing Existing Popups,  Up: Usage
-
-2.2 Other Options
-=================
-
- -- User Option: magit-popup-use-prefix-argument
-
-     This option controls the effect that the use of a prefix argument
-     before entering a popup has.
-
-        • ‘default’
-
-          With a prefix argument directly invoke the popup’s default
-          action (an Emacs command), instead of bringing up the popup.
-
-        • ‘popup’
-
-          With a prefix argument bring up the popup, otherwise directly
-          invoke the popup’s default action.
-
-        • ‘nil’
-
-          Ignore prefix arguments.
-     This option can be overridden for individual popups.
-     ‘magit-show-refs-popup’ for example defaults to invoking the
-     default action directly.  It only shows the popup buffer when a
-     prefix argument is used.  See *note Customizing Existing Popups::.
-
- -- User Option: magit-popup-manpage-package
-
-     The Emacs package used to display man-pages, one of ‘man’ or
-     ‘woman’.
-
- -- User Option: magit-popup-display-buffer-action
-
-     The option controls how the window used to display a popup buffer
-     is created.  Popup buffers are displayed using ‘display-buffer’
-     with the value of this option as ACTION argument.  You can also set
-     this to nil and instead add an entry to ‘display-buffer-alist’.
-
-   To emphasize the default action by making it bold use this:
-
-     (button-type-put 'magit-popup-action-button 'format " %k %D")
-
-
-File: magit-popup.info,  Node: Defining Prefix and Suffix Commands,  Prev: Usage,  Up: Top
-
-3 Defining Prefix and Suffix Commands
-*************************************
-
-If you write an extension for Magit then you should use this library now
-and later when ‘transient’ is released port to that.
-
-   If you are considering using this library to define popups for
-packages not related to Magit, then keep in mind that it will be
-superseded eventually.  Once ‘transient’ has been released I will only
-fix bugs in ‘magit-popup’ but not implement any new features.
-
-   Also consider using ‘hydra’ instead.  To some extend ‘magit-popup’
-and ‘hydra’ are similar but have a different focus.  The main purpose of
-‘magit-popup’ is to pass infix arguments to suffix commands.  If all you
-need is a command dispatcher then you are better of using ‘hydra’.  Of
-course ‘hydra’ may also be a better fit not only because of the features
-it lacks, but also because of the features it provides, which are in
-turn missing from ‘magit-popup’.
-
-   Here is an example of how one defines a prefix command along with its
-infix arguments, and then also one of its suffix commands.
-
-     ;;;###autoload (autoload 'magit-tag-popup "magit" nil t)
-     (magit-define-popup magit-tag-popup
-       "Show popup buffer featuring tagging commands."
-       'magit-commands
-       :man-page "git-tag"
-       :switches '((?a "Annotate" "--annotate")
-                   (?s "Sign"     "--sign")
-                   (?f "Force"    "--force"))
-       :actions  '((?t "Create"   magit-tag)
-                   (?k "Delete"   magit-tag-delete)
-                   (?p "Prune"    magit-tag-prune))
-       :default-action 'magit-tag)
-
-     ;;;###autoload
-     (defun magit-tag (name rev &optional args)
-       "Create a new tag with the given NAME at REV."
-       (interactive (list (magit-read-tag "Tag name")
-                          (magit-read-branch-or-commit "Place tag on")
-                          (magit-tag-arguments)))
-       (magit-run-git-with-editor "tag" args name rev))
-
-* Menu:
-
-* Defining Prefix Commands::
-* Defining Suffix Commands::
-
-
-File: magit-popup.info,  Node: Defining Prefix Commands,  Next: Defining Suffix Commands,  Up: Defining Prefix and Suffix Commands
-
-3.1 Defining Prefix Commands
-============================
-
-Prefix commands and their infix arguments are defined using the macro
-‘magit-define-popup’.  The key bindings and descriptions of suffix
-commands are also defined using that macro, but the actual interactive
-commands have to be defined separately using plain ‘defun’.
-
- -- Macro: magit-define-popup name doc [group [mode [option]]] :keyword
-          value…
-
-     This macro defines a popup named NAME. The NAME should begin with
-     the package prefix and by convention end with ‘-popup’, it is used
-     as the name of the command which shows the popup and for an
-     internal variable (whose value is used to store information about
-     the popup and should not be accessed directly).  DOC is the
-     doc-string of the popup command.
-
-     This macro also defines an option and a function both named
-     ‘SHORTNAME-arguments’, where SHORTNAME is NAME with the trailing
-     ‘-popup’ removed.  The name of this option and this function can be
-     overwritten using the optional argument OPTION, but that is rarely
-     advisable.  As a special case if OPTION is specified but ‘nil’,
-     then this option and this function are not defined at all, which is
-     useful for popups that are used as simple dispatchers that offer no
-     arguments.
-
-     The option ‘SHORTNAME-arguments’ holds the value for the popup
-     arguments.  It can be customized from within the popup or using the
-     Custom interface.  It can also have a buffer local value in any
-     non-popup buffer.  The local value for the buffer from which the
-     popup command was invoked, can be set from within the popup buffer.
-
-     The function ‘SHORTNAME-arguments’ returns the currently effective
-     value of the variable by the same name.  See below for more
-     information.
-
-     Optional argument GROUP specifies the Custom group into which the
-     option is placed.  If omitted then the option is placed into some
-     group the same way it is done when directly using ‘defcustom’ and
-     omitting the group, except when NAME begins with "magit-", in which
-     case the group ‘magit-git-arguments’ is used.
-
-     The optional argument MODE specifies the mode used by the popup
-     buffer.  If it is omitted or ‘nil’ then ‘magit-popup-mode’ is used.
-
-     The remaining arguments should have the form ‘[KEYWORD VALUE]...’.
-
-     The following keywords are meaningful (and by convention are
-     usually specified in that order):
-
-        • ‘:actions’
-
-          The actions which can be invoked from the popup.  VALUE is a
-          list whose members have the form (KEY DESC COMMAND), see
-          ‘magit-define-popup-action’ for details.
-
-          Actions are regular Emacs commands, which usually have an
-          ‘interactive’ form setup to consume the values of the popup
-          ‘:switches’ and ‘:options’ when invoked from the corresponding
-          popup, else when invoked as the default action or directly
-          without using the popup, the default value of the variable
-          ‘SHORTNAME-arguments’.  This is usually done by calling the
-          function ‘SHORTNAME-arguments’.
-
-          Members of VALUE may also be strings, assuming the first
-          member is also a string.  Instead of just one action section
-          with the heading \"Actions\", multiple sections are then
-          inserted into the popup buffer, using these strings as
-          headings.
-
-          Members of VALUE may also be nil.  This should only be used
-          together with ‘:max-action-columns’ and allows having gaps in
-          the action grit, which can help arranging actions sensibly.
-
-        • ‘:default-action’
-
-          The default action of the popup which is used directly instead
-          of displaying the popup buffer, when the popup is invoked with
-          a prefix argument.  Also see ‘magit-popup-use-prefix-argument’
-          and ‘:use-prefix’, which can be used to inverse the meaning of
-          the prefix argument.
-
-        • ‘:use-prefix’
-
-          Controls when to display the popup buffer and when to invoke
-          the default action (if any) directly.  This overrides the
-          global default set using ‘magit-popup-use-prefix-argument’.
-          The value, if specified, should be one of ‘default’ or
-          ‘prefix’, or a function that is called with no arguments and
-          returns one of these symbols.
-
-        • ‘:max-action-columns’
-
-          The maximum number of actions to display on a single line, a
-          number or a function that return a number and takes the name
-          of the section currently being inserted as argument.  If there
-          isn’t enough room to display as many columns as specified
-          here, then fewer are used.
-
-        • ‘:switches’
-
-          The popup arguments which can be toggled on and off.  VALUE is
-          a list whose members have the form ‘(KEY DESC SWITCH)’, see
-          ‘magit-define-popup-switch’ for details.
-
-        • ‘:options’
-
-          The popup arguments which take a value, as in "–opt~OPTVAL".
-          VALUE is a list whose members have the form ‘(KEY DESC OPTION
-          READER)’, see ‘magit-define-popup-option’ for details.
-
-        • ‘:default-arguments’
-
-          The default arguments, a list of switches (which are then
-          enabled by default) and options with there default values, as
-          in ‘"--OPT=OPTVAL"’.
-
-        • ‘:variables’
-
-          Git variables which can be set from the popup.  VALUE is a
-          list whose members have the form ‘(KEY DESC COMMAND
-          FORMATTER)’, see ‘magit-define-popup-variable’ for details.
-
-        • ‘:sequence-predicate’
-
-          When this function returns non-nil, then the popup uses
-          ‘:sequence-actions’ instead of ‘:actions’, and does not show
-          the ‘:switches’ and ‘:options’.
-
-        • ‘:sequence-actions’
-
-          The actions which can be invoked from the popup, when
-          ‘:sequence-predicate’ returns non-nil.
-
-        • ‘:setup-function’
-
-          When this function is specified, then it is used instead of
-          ‘magit-popup-default-setup’.
-
-        • ‘:refresh-function’
-
-          When this function is specified, then it is used instead of
-          calling ‘magit-popup-insert-section’ three times with symbols
-          ‘magit-popup-switch-button’, ‘magit-popup-option-button’, and
-          finally ‘magit-popup-action-button’ as argument.
-
-        • ‘:man-page’
-
-          The name of the manpage to be displayed when the user requests
-          help for an argument.
-
-
-File: magit-popup.info,  Node: Defining Suffix Commands,  Prev: Defining Prefix Commands,  Up: Defining Prefix and Suffix Commands
-
-3.2 Defining Suffix Commands
-============================
-
-Commands intended to be invoked from a particular popup should determine
-the currently effective arguments by calling the function
-‘SHORTNAME-arguments’ inside their ‘interactive’ form.  This function is
-created by the ‘magit-define-popup’ macro.  For a popup named
-‘prefix-foo-popup’ the name of this function is ‘prefix-foo-arguments’.
-
-   When the command was invoked as an action in the respective popup,
-then this function returns the arguments that were set in the popup.
-Otherwise when the command was invoked as the default of the popup (by
-calling the popup command with a prefix argument), or without using the
-popup command at all, then this function returns the buffer-local or
-global value of the variable ‘SHORTNAME-arguments’.
-
-   Internally arguments are handled as a list of strings.  This might
-not be appropriate for the intended use inside commands, or it might be
-necessary to manipulate that list somehow, i.e.  to split "–ARG=VAL"
-into "–ARG""VAL". This should be done by advising or redefining the
-function ‘SHORTNAME-arguments’.
-
-   Internally ‘SHORNAME-arguments’ used following variables and
-function.  Except when redefining the former, you should not use these
-directly.
-
- -- Variable: magit-current-popup
-
-     The popup from which this editing command was invoked.
-
- -- Variable: magit-current-popup-args
-
-     The value of the popup arguments for this editing command.
-
-     If the current command was invoked from a popup, then this is a
-     list of strings of all the set switches and options.  This includes
-     arguments which are set by default not only those explicitly set
-     during this invocation.
-
-     When the value is nil, then that can be because no argument is set,
-     or because the current command wasn’t invoked from a popup at all.
-
- -- Function: magit-current-popup-args &rest args
-
-     This function returns the value of the popup arguments for this
-     editing command.  The value is the same as that of the variable by
-     the same name, except that FILTER is applied.  FILTER is a list of
-     regexps; only arguments that match one of them are returned.  The
-     first element of FILTER may also be ‘:not’ in which case only
-     arguments that don’t match any of the regexps are returned, or
-     ‘:only’ which doesn’t change the behavior.
-
-
-
-Tag Table:
-Node: Top768
-Node: Introduction1944
-Node: Usage4643
-Node: Customizing Existing Popups9340
-Node: Other Options15086
-Node: Defining Prefix and Suffix Commands16628
-Node: Defining Prefix Commands18780
-Node: Defining Suffix Commands25755
-
-End Tag Table
-
-
-Local Variables:
-coding: utf-8
-End:
.emacs.d/elpa/memoize-20170720.1802/memoize-autoloads.el
@@ -1,15 +0,0 @@
-;;; memoize-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil nil ("memoize.el") (22964 3865 252659 958000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; memoize-autoloads.el ends here
.emacs.d/elpa/memoize-20170720.1802/memoize-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "memoize" "20170720.1802" "Memoization functions" 'nil :commit "636defefa9168f90bce6fc27431352ac7d01a890" :url "https://github.com/skeeto/emacs-memoize")
.emacs.d/elpa/memoize-20170720.1802/memoize.el
@@ -1,174 +0,0 @@
-;;; memoize.el --- Memoization functions -*- lexical-binding: t; -*-
-
-;; This is free and unencumbered software released into the public domain.
-
-;; Author: Christopher Wellons <mosquitopsu@gmail.com>
-;; URL: https://github.com/skeeto/emacs-memoize
-;; Package-Version: 20170720.1802
-;; Version: 1.1
-
-;;; Commentary:
-
-;; `memoize' accepts a symbol or a function. When given a symbol, the
-;; symbol's function definition is memoized and installed overtop of
-;; the original function definition. When given a function, it returns
-;; a memoized version of that function.
-
-;;     (memoize 'my-expensive-function)
-
-;; `defmemoize' defines a memoized function directly, behaving just
-;; like `defun'.
-
-;;     (defmemoize my-expensive-function (x)
-;;       (if (zerop n)
-;;           1
-;;         (* n (my-expensive-function (1- n)))))
-
-;; Memoizing an interactive function will render that function
-;; non-interactive. It would be easy to fix this problem when it comes
-;; to non-byte-compiled functions, but recovering the interactive
-;; definition from a byte-compiled function is more complex than I
-;; care to deal with. Besides, interactive functions are always used
-;; for their side effects anyway.
-
-;; There's no way to memoize nil returns, but why would your expensive
-;; functions do all that work just to return nil? :-)
-
-;; Memoization takes up memory, which should be freed at some point.
-;; Because of this, all memoization has a timeout from when the last
-;; access was. The default timeout is set by
-;; `memoize-default-timeout'.  It can be overriden by using the
-;; `memoize' function, but the `defmemoize' macro will always just use
-;; the default timeout.
-
-;; If you wait to byte-compile the function until *after* it is
-;; memoized then the function and memoization wrapper both get
-;; compiled at once, so there's no special reason to do them
-;; separately. But there really isn't much advantage to compiling the
-;; memoization wrapper anyway.
-
-;;; Code:
-
-(require 'cl-lib)
-
-(defvar memoize-default-timeout "2 hours"
-  "The amount of time after which to remove a memoization.
-This represents the time after last use of the memoization after
-which the value is expired. Setting this to nil means to never
-expire, which will cause a memory leak, but may be acceptable for
-very careful uses.")
-
-(defun memoize (func &optional timeout)
-  "Memoize FUNC: a closure, lambda, or symbol.
-
-If argument is a symbol then install the memoized function over
-the original function. The TIMEOUT value, a timeout string as
-used by `run-at-time' will determine when the value expires, and
-will apply after the last access (unless another access
-happens)."
-  (cl-typecase func
-    (symbol
-     (put func 'function-documentation
-          (concat (documentation func) " (memoized)"))
-     (fset func (memoize--wrap (symbol-function func) timeout))
-     func)
-    (function (memoize--wrap func timeout))))
-
-(defun memoize--wrap (func timeout)
-  "Return the memoized version of FUNC.
-TIMEOUT specifies how long the values last from last access. A
-nil timeout will cause the values to never expire, which will
-cause a memory leak as memoize is use, so use the nil value with
-care."
-  (let ((table (make-hash-table :test 'equal))
-        (timeouts (make-hash-table :test 'equal)))
-    (lambda (&rest args)
-      (let ((value (gethash args table)))
-        (unwind-protect
-            (or value (puthash args (apply func args) table))
-          (let ((existing-timer (gethash args timeouts))
-                (timeout-to-use (or timeout memoize-default-timeout)))
-            (when existing-timer
-              (cancel-timer existing-timer))
-            (when timeout-to-use
-              (puthash args
-                       (run-at-time timeout-to-use nil
-                                    (lambda ()
-                                      (remhash args table))) timeouts))))))))
-
-(defmacro defmemoize (name arglist &rest body)
-  "Create a memoize'd function. NAME, ARGLIST, DOCSTRING and BODY
-have the same meaning as in `defun'."
-  (declare (indent defun))
-  `(progn
-     (defun ,name ,arglist
-       ,@body)
-     (memoize (quote ,name))))
-
-(defun memoize-by-buffer-contents (func)
-    "Memoize the given function by buffer contents.
-If argument is a symbol then install the memoized function over
-the original function."
-  (cl-typecase func
-    (symbol
-     (put func 'function-documentation
-          (concat (documentation func) " (memoized by buffer contents)"))
-     (fset func (memoize-by-buffer-contents--wrap (symbol-function func)))
-     func)
-    (function (memoize-by-buffer-contents--wrap func))))
-
-(defun memoize-by-buffer-contents--wrap (func)
-  "Return the memoization based on the buffer contents of FUNC.
-
-This form of memoization will be based off the current buffer
-contents. A different memoization is stored for all buffer
-contents, although old contents and no-longer-existant buffers
-will get garbage collected."
-  ;; We need 3 tables here to properly garbage collect. First is the
-  ;; table for the memoization itself, `memoization-table'. It holds a
-  ;; cons of the content hash and the function arguments.
-  ;;
-  ;; Buffer contents change often, though, so we want these entries to
-  ;; be automatically garbage collected when the buffer changes or the
-  ;; buffer goes away. To keep the entries around, we need to tie the
-  ;; content hash to the buffer, so that the content hash string
-  ;; doesn't go away until the buffer does. We do that with the
-  ;; `buffer-to-contents-table'.
-  ;;
-  ;; But even if the buffer content does change, we need to expire the
-  ;; memoization entries for that particular buffer content. So we
-  ;; have a `contents-to-memoization-table' that we use to tie the
-  ;; content hash to the memoization conses used as keys in the
-  ;; `memoization-table'.
-  ;;
-  ;; If a buffer's value changes, we make sure the next time we put a
-  ;; new value at the `buffer-to-contents-table', which causes the
-  ;; hash string to disappear. This causes the hash-string to
-  ;; disappear from the `contents-to-memoization-table', which causes
-  ;; the memoizations based on that content string to disappear from
-  ;; the `memoization-table'.
-  (let ((memoization-table (make-hash-table :test 'equal :weakness 'key))
-        (buffer-to-contents-table (make-hash-table :weakness 'key))
-        (contents-to-memoization-table (make-hash-table :weakness 'key)))
-    (lambda (&rest args)
-      (let* ((bufhash (secure-hash 'md5 (buffer-string)))
-             (memokey (cons bufhash args))
-             (value (gethash memokey memoization-table)))
-        (or value
-            (progn
-              (puthash (current-buffer) bufhash buffer-to-contents-table)
-              (puthash bufhash memokey contents-to-memoization-table)
-              (puthash memokey (apply func args) memoization-table)))))))
-
-(defmacro defmemoize-by-buffer-contents (name arglist &rest body)
-  "Create a memoize'd-by-buffer-contents function. NAME, ARGLIST,
-DOCSTRING and BODY have the same meaning as in `defun'."
-  (declare (indent defun))
-  `(progn
-     (defun ,name ,arglist
-       ,@body)
-     (memoize-by-buffer-contents (quote ,name))))
-
-(provide 'memoize)
-
-;;; memoize.el ends here
.emacs.d/elpa/memoize-20170720.1802/memoize.elc
Binary file
.emacs.d/elpa/nix-mode-20170831.1721/nix-mode-autoloads.el
@@ -1,44 +0,0 @@
-;;; nix-mode-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "nix-mode" "nix-mode.el" (22977 26490 236567
-;;;;;;  571000))
-;;; Generated autoloads from nix-mode.el
-
-(autoload 'nix-mode "nix-mode" "\
-Major mode for editing Nix expressions.
-
-The following commands may be useful:
-
-  '\\[newline-and-indent]'
-    Insert a newline and move the cursor to align with the previous
-    non-empty line.
-
-  '\\[fill-paragraph]'
-    Refill a paragraph so that all lines are at most `fill-column'
-    lines long.  This should do the right thing for comments beginning
-    with `#'.  However, this command doesn't work properly yet if the
-    comment is adjacent to code (i.e., no intervening empty lines).
-    In that case, select the text to be refilled and use
-    `\\[fill-region]' instead.
-
-The hook `nix-mode-hook' is run when Nix mode is started.
-
-\\{nix-mode-map}
-
-\(fn)" t nil)
-
-(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-mode))
-
-(add-to-list 'auto-mode-alist '("\\.nix.in\\'" . nix-mode))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; nix-mode-autoloads.el ends here
.emacs.d/elpa/nix-mode-20170831.1721/nix-mode-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "nix-mode" "20170831.1721" "Major mode for editing .nix files" '((emacs "24.3")) :commit "4a5b6d5d2c5fcca1bf7a925dfaaa1f13e552a1ea" :url "https://github.com/matthewbauer/nix-mode" :keywords '("nix" "languages" "tools" "unix"))
.emacs.d/elpa/nix-mode-20170831.1721/nix-mode.el
@@ -1,530 +0,0 @@
-;;; nix-mode.el --- Major mode for editing .nix files -*- lexical-binding: t -*-
-
-;; Maintainer: Matthew Bauer <mjbauer95@gmail.com>
-;; Homepage: https://github.com/matthewbauer/nix-mode
-;; Version: 1.2.1
-;; Package-Version: 20170831.1721
-;; Keywords: nix, languages, tools, unix
-;; Package-Requires: ((emacs "24.3"))
-
-;; This file is NOT part of GNU Emacs.
-
-;;; Commentary:
-
-;; A major mode for editing Nix expressions (.nix files).  See the Nix manual
-;; for more information available at https://nixos.org/nix/manual/.
-
-;;; Code:
-
-(require 'nix-format nil 'noerror)
-
-(defgroup nix nil
-  "Nix-related customizations"
-  :group 'languages)
-
-(defgroup nix-mode nil
-  "Nix mode customizations"
-  :group 'nix)
-
-(defgroup nix-faces nil
-  "Nix faces."
-  :group 'nix
-  :group 'faces)
-
-(defface nix-keyword-face
-  '((t :inherit font-lock-keyword-face))
-  "Face used to highlight Nix keywords."
-  :group 'nix-faces)
-
-(defface nix-keyword-warning-face
-  '((t :inherit font-lock-warning-face))
-  "Face used to highlight Nix warning keywords."
-  :group 'nix-faces)
-
-(defface nix-builtin-face
-  '((t :inherit font-lock-builtin-face))
-  "Face used to highlight Nix builtins."
-  :group 'nix-faces)
-
-(defface nix-constant-face
-  '((t :inherit font-lock-constant-face))
-  "Face used to highlight Nix constants."
-  :group 'nix-faces)
-
-(defface nix-attribute-face
-  '((t :inherit font-lock-variable-name-face))
-  "Face used to highlight Nix attributes."
-  :group 'nix-faces)
-
-(defface nix-antiquote-face
-  '((t :inherit font-lock-preprocessor-face))
-  "Face used to highlight Nix antiquotes."
-  :group 'nix-faces)
-
-(defvar nix-system-types
-  '("x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin")
-  "List of supported systems.")
-
-;;; Syntax coloring
-
-(defconst nix-keywords
-  '("if" "then"
-    "else" "with"
-    "let" "in"
-    "rec" "inherit"
-    "or"))
-
-(defconst nix-builtins
-  '("builtins" "baseNameOf"
-    "derivation" "dirOf"
-    "true" "false" "null"
-    "isNull" "toString"
-    "fetchTarball" "import"
-    "map" "removeAttrs"))
-
-(defconst nix-warning-keywords
-  '("assert" "abort" "throw"))
-
-(defconst nix-re-file-path
-  "[a-zA-Z0-9._\\+-]*\\(/[a-zA-Z0-9._\\+-]+\\)+")
-
-(defconst nix-re-url
-  "[a-zA-Z][a-zA-Z0-9\\+-\\.]*:[a-zA-Z0-9%/\\?:@&=\\+\\$,_\\.!~\\*'-]+")
-
-(defconst nix-re-bracket-path
-  "<[a-zA-Z0-9._\\+-]+\\(/[a-zA-Z0-9._\\+-]+\\)*>")
-
-(defconst nix-re-variable-assign
-  "\\<\\([a-zA-Z_][a-zA-Z0-9_'\-\.]*\\)[ \t]*=[^=]")
-
-(defconst nix-font-lock-keywords
-  `(
-    (,(regexp-opt nix-keywords 'symbols) 0 'nix-keyword-face)
-    (,(regexp-opt nix-warning-keywords 'symbols) 0 'nix-keyword-warning-face)
-    (,(regexp-opt nix-builtins 'symbols) 0 'nix-builtin-face)
-    (,nix-re-url 0 'nix-constant-face)
-    (,nix-re-file-path 0 'nix-constant-face)
-    (,nix-re-variable-assign 1 'nix-attribute-face)
-    (,nix-re-bracket-path 0 'nix-constant-face)
-    (nix--syntax-match-antiquote 0 'nix-antiquote-face t)
-    )
-  "Font lock keywords for nix.")
-
-(defconst nix--variable-char "[a-zA-Z0-9_'\-]")
-
-(defvar nix-mode-abbrev-table
-  (make-abbrev-table)
-  "Abbrev table for Nix mode.")
-
-(makunbound 'nix-mode-syntax-table)
-
-(defvar nix-mode-syntax-table
-  (let ((table (make-syntax-table)))
-    (modify-syntax-entry ?/ ". 14" table)
-    (modify-syntax-entry ?* ". 23" table)
-    (modify-syntax-entry ?# "< b" table)
-    (modify-syntax-entry ?\n "> b" table)
-    ;; We handle strings
-    (modify-syntax-entry ?\" "." table)
-    ;; We handle escapes
-    (modify-syntax-entry ?\\ "." table)
-    table)
-  "Syntax table for Nix mode.")
-
-(defun nix--syntax-match-antiquote (limit)
-  "Find antiquote within a Nix expression up to LIMIT."
-  (unless (> (point) limit)
-    (if (get-text-property (point) 'nix-syntax-antiquote)
-        (progn
-          (set-match-data (list (point) (1+ (point))))
-          (forward-char 1)
-          t)
-      (let ((pos (next-single-char-property-change (point) 'nix-syntax-antiquote
-                                                   nil limit)))
-        (when (and pos (not (> pos limit)))
-          (goto-char pos)
-          (let ((char (char-after pos)))
-            (pcase char
-              (`?{
-               (forward-char 1)
-               (set-match-data (list (1- pos) (point)))
-               t)
-              (`?}
-               (forward-char 1)
-               (set-match-data (list pos (point)))
-               t))))))))
-
-(defun nix--mark-string (pos string-type)
-  "Mark string as a Nix string.
-
-POS position of start of string
-STRING-TYPE type of string based off of Emacs syntax table types"
-  (put-text-property pos (1+ pos)
-                     'syntax-table (string-to-syntax "|"))
-  (put-text-property pos (1+ pos)
-                     'nix-string-type string-type))
-
-(defun nix--get-parse-state (pos)
-  "Get the result of `syntax-ppss' at POS."
-  (save-excursion (save-match-data (syntax-ppss pos))))
-
-(defun nix--get-string-type (parse-state)
-  "Get the type of string based on PARSE-STATE."
-  (let ((string-start (nth 8 parse-state)))
-    (and string-start (get-text-property string-start 'nix-string-type))))
-
-(defun nix--open-brace-string-type (parse-state)
-  "Determine if this is an open brace string type based on PARSE-STATE."
-  (let ((open-brace (nth 1 parse-state)))
-    (and open-brace (get-text-property open-brace 'nix-string-type))))
-
-(defun nix--open-brace-antiquote-p (parse-state)
-  "Determine if this is an open brace antiquote based on PARSE-STATE."
-  (let ((open-brace (nth 1 parse-state)))
-    (and open-brace (get-text-property open-brace 'nix-syntax-antiquote))))
-
-(defun nix--single-quotes ()
-  "Handle Nix single quotes."
-  (let* ((start (match-beginning 0))
-         (end (match-end 0))
-         (context (nix--get-parse-state start))
-         (string-type (nix--get-string-type context)))
-    (unless (or (equal string-type ?\")
-                (and (equal string-type nil)
-                     (< 1 start)
-                     (string-match-p nix--variable-char
-                                     (buffer-substring (1- start) start))))
-      (when (equal string-type nil)
-        (nix--mark-string start ?\')
-        (setq start (+ 2 start)))
-      (when (equal (mod (- end start) 3) 2)
-        (let ((str-peek (buffer-substring end (min (point-max) (+ 2 end)))))
-          (if (member str-peek '("${" "\\n" "\\r" "\\t"))
-              (goto-char (+ 2 end))
-            (nix--mark-string (1- end) ?\')))))))
-
-(defun nix--escaped-antiquote-dq-style ()
-  "Handle Nix escaped antiquote dq style."
-  (let* ((start (match-beginning 0))
-         (ps (nix--get-parse-state start))
-         (string-type (nix--get-string-type ps)))
-    (when (equal string-type ?\')
-      (nix--antiquote-open-at (1+ start) ?\'))))
-
-(defun nix--double-quotes ()
-  "Handle Nix double quotes."
-  (let* ((pos (match-beginning 0))
-         (ps (nix--get-parse-state pos))
-         (string-type (nix--get-string-type ps)))
-    (unless (equal string-type ?\')
-      (nix--mark-string pos ?\"))))
-
-(defun nix--antiquote-open-at (pos string-type)
-  "Handle Nix antiquote open at based on POS and STRING-TYPE."
-  (put-text-property pos (1+ pos)
-                     'syntax-table (string-to-syntax "|"))
-  (put-text-property pos (+ 2 pos)
-                     'nix-string-type string-type)
-  (put-text-property (1+ pos) (+ 2 pos)
-                     'nix-syntax-antiquote t))
-
-(defun nix--antiquote-open ()
-  "Handle Nix antiquote open."
-  (let* ((start (match-beginning 0))
-         (ps (nix--get-parse-state start))
-         (string-type (nix--get-string-type ps)))
-    (when string-type
-      (nix--antiquote-open-at start string-type))))
-
-(defun nix--antiquote-close-open ()
-  "Handle Nix antiquote close then open."
-  (let* ((start (match-beginning 0))
-         (ps (nix--get-parse-state start))
-         (string-type (nix--get-string-type ps)))
-    (if string-type
-        (nix--antiquote-open-at (1+ start) string-type)
-      (when (nix--open-brace-antiquote-p ps)
-        (let ((string-type (nix--open-brace-string-type ps)))
-          (put-text-property start (+ 3 start)
-                             'nix-string-type string-type)
-          (put-text-property start (1+ start)
-                             'nix-syntax-antiquote t)
-          (put-text-property (+ 2 start) (+ 3 start)
-                             'nix-syntax-antiquote t))))))
-
-(defun nix--antiquote-close ()
-  "Handle Nix antiquote close."
-  (let* ((start (match-beginning 0))
-         (ps (nix--get-parse-state start)))
-    (unless (nix--get-string-type ps)
-      (let ((string-type (nix--open-brace-string-type ps)))
-        (when string-type
-          (put-text-property start (1+ start)
-                             'nix-string-type string-type)
-          (put-text-property start (1+ start)
-                             'nix-syntax-antiquote t)
-          (let ((ahead (buffer-substring (1+ start) (min (point-max) (+ 5 start)))))
-            (pcase string-type
-              (`?\" (cond
-                     ((or (string-match "^\\\\\"" ahead)
-                          (string-match "^\\\\\\${" ahead))
-                      (nix--mark-string (1+ start) string-type)
-                      (goto-char (+ start (match-end 0) 1)))
-                     ((string-match-p "^\"" ahead)
-                      (goto-char (+ 2 start)))
-                     ((< (1+ start) (point-max))
-                      (nix--mark-string (1+ start) string-type)
-                      (goto-char (+ 2 start)))))
-              (`?\' (cond
-                     ((or (string-match "^'''" ahead)
-                          (string-match "^''\\${" ahead)
-                          (string-match "^''\\\\[nrt]" ahead))
-                      (nix--mark-string (1+ start) string-type)
-                      (goto-char (+ start (match-end 0) 1)))
-                     ((string-match-p "^''" ahead)
-                      (goto-char (+ 3 start)))
-                     ((< (1+ start) (point-max))
-                      (nix--mark-string (1+ start) string-type)
-                      (goto-char (+ 2 start))))))))))))
-
-(defun nix-syntax-propertize (start end)
-  "Special syntax properties for Nix from START to END."
-  (goto-char start)
-  (remove-text-properties start end
-                          '(syntax-table nil nix-string-type nil nix-syntax-antiquote nil))
-  (funcall
-   (syntax-propertize-rules
-    ("\\\\\\\\"
-     (0 nil))
-    ("\\\\\""
-     (0 nil))
-    ("\\\\\\${"
-     (0 (ignore (nix--escaped-antiquote-dq-style))))
-    ("'\\{2,\\}"
-     (0 (ignore (nix--single-quotes))))
-    ("}\\${"
-     (0 (ignore (nix--antiquote-close-open))))
-    ("\\${"
-     (0 (ignore (nix--antiquote-open))))
-    ("}"
-     (0 (ignore (nix--antiquote-close))))
-    ("\""
-     (0 (ignore (nix--double-quotes)))))
-   start end))
-
-;;; Indentation
-
-(defun nix-indent-level-parens ()
-  "Find indent level based on parens."
-  (save-excursion
-    (beginning-of-line)
-
-    (let ((p1 (point))
-          (p2 (nth 1 (syntax-ppss)))
-          (n 0))
-
-      ;; prevent moving beyond buffer
-      (if (eq p2 1)
-          (setq n (1+ n)))
-
-      (while (and p2 (not (eq p2 1))) ;; make sure p2 > 1
-        (goto-char p2)
-        (backward-char)
-        (let ((l1 (line-number-at-pos p1))
-              (l2 (line-number-at-pos p2)))
-          (if (not (eq l1 l2))
-              (setq n (1+ n))))
-        (setq p1 p2)
-        (setq p2 (nth 1 (syntax-ppss)))
-
-        ;; make sure we don't go beyond buffer
-        (if (eq p2 1)
-            (setq n (1+ n))))
-
-      n)))
-
-(defun nix-indent-level-is-closing ()
-  "Go forward from beginning of line."
-  (save-excursion
-    (beginning-of-line)
-    (skip-chars-forward "[:space:]")
-
-    (or ;; any of these should -1 indent level
-     (looking-at ")")
-     (looking-at "}")
-     (looking-at "]")
-     (looking-at "''")
-     (looking-at ",")
-     (looking-at "in[[:space:]]")
-     (looking-at "in$"))))
-
-(defun nix-indent-level-is-hanging ()
-  "Is hanging?"
-  (save-excursion
-    (beginning-of-line)
-    (skip-chars-forward "[:space:]")
-
-    (if (or
-         ;; (looking-at ",")
-         (looking-at "{")) nil
-
-      (forward-line -1)
-      (end-of-line)
-      (skip-chars-backward "\n[:space:]")
-
-      ;; skip through any comments in the way
-      (while (nth 4 (syntax-ppss))
-        (goto-char (nth 8 (syntax-ppss)))
-        (skip-chars-backward "\n[:space:]"))
-
-      (not (or
-            (looking-back "{" 1)
-            (looking-back "}" 1)
-            (looking-back ":" 1)
-            (looking-back ";" 1))))))
-
-(defun nix-indent-prev-level-is-hanging ()
-  "Is the previous level hanging?"
-  (save-excursion
-    (beginning-of-line)
-    (skip-chars-backward "\n[:space:]")
-    (nix-indent-level-is-hanging)))
-
-(defun nix-indent-prev-level ()
-  "Get the indent level of the previous line."
-  (save-excursion
-    (beginning-of-line)
-    (skip-chars-backward "\n[:space:]")
-    (current-indentation)))
-
-(defun nix-indent-level ()
-  "Get current indent level."
-  (if (nix-indent-level-is-hanging)
-      (+ (nix-indent-prev-level)
-         (* tab-width (+ (if (nix-indent-prev-level-is-hanging) 0 1)
-                         (if (nix-indent-level-is-closing) -1 0))))
-    (* tab-width (+ (nix-indent-level-parens)
-                    (if (nix-indent-level-is-closing) -1 0)))))
-
-(defun nix-indent-line ()
-  "Indent current line in a Nix expression."
-  (interactive)
-  (cond
-
-   ;; comment
-   ((save-excursion
-      (beginning-of-line)
-      (nth 4 (syntax-ppss)))
-    (indent-line-to (nix-indent-prev-level)))
-
-   ;; string
-   ((save-excursion
-      (beginning-of-line)
-      (nth 3 (syntax-ppss)))
-    (indent-line-to (+ (nix-indent-prev-level)
-                       (* tab-width (+ (if (save-excursion
-                                             (forward-line -1)
-                                             (end-of-line)
-                                             (skip-chars-backward "[:space:]")
-                                             (looking-back "''" 0)) 1 0)
-                                       (if (save-excursion
-                                             (beginning-of-line)
-                                             (skip-chars-forward
-                                              "[:space:]")
-                                             (looking-at "''")
-                                             ) -1 0)
-                                       )))))
-
-   ;; else
-   (t
-    (indent-line-to (nix-indent-level)))))
-
-;; Key maps
-
-(defvar nix-mode-menu (make-sparse-keymap "Nix")
-  "Menu for Nix mode.")
-
-(defvar nix-mode-map (make-sparse-keymap)
-  "Local keymap used for Nix mode.")
-
-(defun nix-create-keymap ()
-  "Create the keymap associated with the Nix mode."
-  (define-key nix-mode-map "\C-c\C-r" 'nix-format-buffer))
-
-(defun nix-create-menu ()
-  "Create the Nix menu as shown in the menu bar."
-  (let ((m '("Nix"
-	     ["Format buffer" nix-format-buffer t])
-	   ))
-    (easy-menu-define ada-mode-menu nix-mode-map "Menu keymap for Nix mode" m)))
-
-(nix-create-keymap)
-(nix-create-menu)
-
-(when (require 'company nil 'noerror) (require 'nix-company nil 'noerror))
-
-(when (require 'mmm-mode nil 'noerror) (require 'nix-mode-mmm nil 'noerror))
-
-;;;###autoload
-(define-derived-mode nix-mode prog-mode "Nix"
-  "Major mode for editing Nix expressions.
-
-The following commands may be useful:
-
-  '\\[newline-and-indent]'
-    Insert a newline and move the cursor to align with the previous
-    non-empty line.
-
-  '\\[fill-paragraph]'
-    Refill a paragraph so that all lines are at most `fill-column'
-    lines long.  This should do the right thing for comments beginning
-    with `#'.  However, this command doesn't work properly yet if the
-    comment is adjacent to code (i.e., no intervening empty lines).
-    In that case, select the text to be refilled and use
-    `\\[fill-region]' instead.
-
-The hook `nix-mode-hook' is run when Nix mode is started.
-
-\\{nix-mode-map}
-"
-  :group 'nix-mode
-  :syntax-table nix-mode-syntax-table
-  :abbrev-table nix-mode-abbrev-table
-
-  ;; Disable hard tabs and set tab to 2 spaces
-  ;; Recommended by nixpkgs manual: https://nixos.org/nixpkgs/manual/#sec-syntax
-  (setq-local indent-tabs-mode nil)
-  (setq-local tab-width 2)
-
-  ;; Font lock support.
-  (setq-local font-lock-defaults '(nix-font-lock-keywords))
-
-  ;; Special syntax properties for Nix
-  (setq-local syntax-propertize-function 'nix-syntax-propertize)
-
-  ;; Look at text properties when parsing
-  (setq-local parse-sexp-lookup-properties t)
-
-  ;; Automatic indentation [C-j]
-  (setq-local indent-line-function 'nix-indent-line)
-
-  ;; Indenting of comments
-  (setq-local comment-start "# ")
-  (setq-local comment-end "")
-  (setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *")
-  (setq-local comment-multi-line t)
-
-  ;; Filling of comments
-  (setq-local adaptive-fill-mode t)
-  (setq-local paragraph-start "[ \t]*\\(#+[ \t]*\\)?$")
-  (setq-local paragraph-separate paragraph-start)
-
-  (easy-menu-add nix-mode-menu nix-mode-map))
-
-;;;###autoload
-(progn
-  (add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-mode))
-  (add-to-list 'auto-mode-alist '("\\.nix.in\\'" . nix-mode)))
-
-(provide 'nix-mode)
-;;; nix-mode.el ends here
.emacs.d/elpa/nix-mode-20170831.1721/nix-mode.elc
Binary file
.emacs.d/elpa/packed-20170819.942/packed-autoloads.el
@@ -1,15 +0,0 @@
-;;; packed-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil nil ("packed.el") (22964 2141 241205 598000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; packed-autoloads.el ends here
.emacs.d/elpa/packed-20170819.942/packed-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "packed" "20170819.942" "package manager agnostic Emacs Lisp package utilities" '((emacs "24.3")) :commit "94ea12b9d44bfa42c28d0548199f2fcd19e4aa6a" :url "https://github.com/emacscollective/packed" :keywords '("compile" "convenience" "lisp" "package" "library"))
.emacs.d/elpa/packed-20170819.942/packed.el
@@ -1,584 +0,0 @@
-;;; packed.el --- package manager agnostic Emacs Lisp package utilities
-
-;; Copyright (C) 2012-2017  Jonas Bernoulli
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Homepage: https://github.com/emacscollective/packed
-;; Keywords: compile, convenience, lisp, package, library
-;; Package-Version: 20170819.942
-;; Package-Requires: ((emacs "24.3"))
-
-;; This file is not part of GNU Emacs.
-
-;; 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 3, 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.
-
-;; For a full copy of the GNU General Public License
-;; see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Packed provides some package manager agnostic utilities to work
-;; with Emacs Lisp packages.  As far as Packed is concerned packages
-;; are collections of Emacs Lisp libraries that are stored in a
-;; dedicated directory such as a vcs repository.  And libraries are
-;; Emacs Lisp files that provide the correct feature (matching the
-;; filename).
-
-;; Where a package manager might depend on metadata, Packed instead
-;; uses some heuristics to get the same information -- that is slower
-;; and might also fail at times but avoids having to create the
-;; metadata in the first place.
-
-;;; Code:
-
-(require 'bytecomp)
-(require 'cl-lib)
-
-(declare-function autoload-rubric "autoload")
-(declare-function autoload-find-destination "autoload")
-(declare-function autoload-file-load-name "autoload")
-(declare-function info-initialize "info")
-(defvar Info-directory-list)
-
-;;; Options
-
-(defgroup packed nil
-  "Emacs package utilities."
-  :group 'convenience
-  :prefix 'packed)
-
-(defcustom packed-loaddefs-filename "loaddefs.el"
-  "Name of the files used to store extracted autoload definitions."
-  :group 'packed
-  :type 'file)
-
-;;; Libraries
-
-(defun packed-el-suffixes (&optional nosuffix must-suffix)
-  "Return a list of the valid suffixes of Emacs Lisp source libraries.
-Unlike `get-load-suffixes' don't return the suffixes for
-byte-compile destinations just those of source files.
-
-If NOSUFFIX is non-nil the `.el' part is omitted.  IF MUST-SUFFIX
-is non-nil all returned suffixes contain `.el'.  This uses the
-variables `load-suffixes' (from which it removes \".elc\") and
-`load-file-rep-suffixes'."
-  (packed--suffixes ".elc" nosuffix must-suffix))
-
-(defun packed-elc-suffixes (&optional nosuffix must-suffix)
-  "Return a list of the valid suffixes of Emacs Lisp source libraries.
-Unlike `get-load-suffixes' don't return the suffixes for
-source files just those of byte-compile destinations.
-
-If NOSUFFIX is non-nil the `.elc' part is omitted.  IF MUST-SUFFIX
-is non-nil all returned suffixes contain `.elc'.  This uses the
-variables `load-suffixes' (from which it removes \".el\") and
-`load-file-rep-suffixes'."
-  (packed--suffixes ".el" nosuffix must-suffix))
-
-(defun packed--suffixes (remove-suffix &optional nosuffix must-suffix)
-  (append (unless nosuffix
-            (let ((load-suffixes (remove remove-suffix load-suffixes)))
-              (get-load-suffixes)))
-          (unless must-suffix
-            load-file-rep-suffixes)))
-
-(defun packed-el-regexp ()
-  "Return the valid suffixes of Emacs libraries as a regular expression.
-The returned regular expression matches source files but not
-byte-compile destinations and always expects the \".el\" suffix."
-  (concat (regexp-opt (packed-el-suffixes nil t)) "\\'"))
-
-(defun packed-elc-regexp ()
-  "Return the valid suffixes of byte-compile destinations as a regexp.
-The returned regular expression matches byte-compile destinations
-but not source files and always expects the \".elc\" suffix."
-  (concat (regexp-opt (packed-elc-suffixes nil t)) "\\'"))
-
-(defun packed-el-file (elc)
-  "Return the Emacs source file for byte-compile destination ELC."
-  (let ((standard (concat (file-name-sans-extension
-                           (file-name-sans-extension elc)) ".el"))
-        (suffixes (remove ".el" (packed-el-suffixes)))
-        file)
-    (while (and (not file) suffixes)
-      (unless (file-exists-p (setq file (concat standard (pop suffixes))))
-        (setq file nil)))
-    (or file standard)))
-
-(defalias 'packed-elc-file 'byte-compile-dest-file)
-
-(defun packed-locate-library (library &optional nosuffix path interactive-call)
-  "Show the precise file name of Emacs library LIBRARY.
-Unlike `locate-library' don't return the byte-compile destination
-if it exists but always the Emacs source file.
-
-LIBRARY should be a relative file name of the library, a string.
-It can omit the suffix (a.k.a. file-name extension) if NOSUFFIX is
-nil (which is the default, see below).
-This command searches the directories in `load-path' like `\\[load-library]'
-to find the file that `\\[load-library] RET LIBRARY RET' would load.
-Optional second arg NOSUFFIX non-nil means don't add suffixes `load-suffixes'
-to the specified name LIBRARY.
-
-If the optional third arg PATH is specified, that list of directories
-is used instead of `load-path'.
-
-When called from a program, the file name is normally returned as a
-string.  When run interactively, the argument INTERACTIVE-CALL is t,
-and the file name is displayed in the echo area."
-  (interactive (list (completing-read "Locate library: "
-                                      (apply-partially
-                                       'locate-file-completion-table
-                                       load-path (get-load-suffixes)))
-                     nil nil t))
-  (let ((file (locate-file (substitute-in-file-name library)
-                           (or path load-path)
-                           (packed-el-suffixes nosuffix))))
-    (when interactive-call
-      (if file
-          (message "Library is file %s" (abbreviate-file-name file))
-        (message "No library %s in search path" library)))
-    file))
-
-(defun packed-ignore-directory-p (directory)
-  "Return t if DIRECTORY is being ignored when searching for libraries.
-DIRECTORY and all libraries it and its subdirectories contain
-are being ignored if it contains a file named \".nosearch\" or
-if it is a hidden directory."
-  (or (string-prefix-p "." (file-name-nondirectory
-                            (directory-file-name directory)))
-      (file-exists-p (expand-file-name ".nosearch" directory))))
-
-(defmacro packed-with-file (file &rest body)
-  "Execute BODY in a buffer containing the contents of FILE.
-If FILE is nil or equal to `buffer-file-name' execute BODY in the
-current buffer.  Move to beginning of buffer before executing BODY.
-FILE should be an Emacs lisp source file."
-  (declare (indent 1) (debug t))
-  (let ((filesym (make-symbol "--file--")))
-    `(let ((,filesym ,file))
-       (save-match-data
-         (save-excursion
-           (if (and ,filesym (not (equal ,filesym buffer-file-name)))
-               (with-temp-buffer
-                 (insert-file-contents ,filesym)
-                 (setq buffer-file-name ,filesym)
-                 (set-buffer-modified-p nil)
-                 (with-syntax-table emacs-lisp-mode-syntax-table
-                   ,@body))
-             (goto-char (point-min))
-             (with-syntax-table emacs-lisp-mode-syntax-table
-               ,@body)))))))
-
-(defun packed-library-p (file)
-  "Return non-nil if FILE is an Emacs source library.
-Actually return the feature provided by FILE.
-
-An Emacs lisp file is considered to be a library if it provides
-the correct feature; that is a feature that matches its filename
-\(and possibly parts of the path leading to it)."
-  (and (let ((filename (file-name-nondirectory file)))
-         (save-match-data
-           (and (string-match (packed-el-regexp) filename)
-                (not (or (file-symlink-p file)
-                         (string-equal filename dir-locals-file)
-                         (auto-save-file-name-p filename))))))
-       (packed-library-feature file)))
-
-(defun packed-libraries (directory &optional full nonrecursive)
-  "Return a list of libraries that are part of PACKAGE located in DIRECTORY.
-DIRECTORY is assumed to contain the libraries belonging to a
-single package.
-
-If optional FULL is non-nil return absolute paths otherwise paths
-relative to DIRECTORY.
-
-If optional NONRECURSIVE only return libraries directly located
-in DIRECTORY."
-  (cl-mapcan (pcase-lambda (`(,library . ,feature))
-               (and feature
-                    (list (if full
-                              library
-                            (file-relative-name library directory)))))
-             (packed-libraries-1 directory nonrecursive)))
-
-(defun packed-libraries-1 (directory &optional nonrecursive)
-  "Return a list of Emacs lisp files DIRECTORY and its subdirectories.
-
-The return value has the form ((LIBRARY . FEATURE)...).  FEATURE
-is nil if LIBRARY does not provide a feature or only features
-that don't match the filename."
-  (let (libraries)
-    (dolist (f (directory-files directory t "^[^.]"))
-      (cond ((file-directory-p f)
-             (or nonrecursive
-                 (packed-ignore-directory-p f)
-                 (setq libraries (nconc (packed-libraries-1 f) libraries))))
-            ((string-match (packed-el-regexp)
-                           (file-name-nondirectory f))
-             (push (cons f (packed-library-p f)) libraries))))
-    (nreverse libraries)))
-
-(defun packed-main-library (directory &optional package noerror nosingle)
-  "Return the main library from the package directory DIRECTORY.
-Optional PACKAGE is the name of the package; if it is nil the
-basename of DIRECTORY is used as the package name.
-
-Return the library whose basename matches the package name.  If
-that fails append \"-mode\" to the package name, respectively
-remove that substring, and try again.
-
-The library must provide the correct feature; that is the feature
-which matches the filename (and possibly parts of the path leading
-to it).
-
-Unless optional NOSINGLE is non-nil and if there is only a single
-Emacs lisp file return that even if it doesn't match the package
-name.
-
-If the main library cannot be found raise an error or if optional
-NOERROR is non-nil return nil."
-  (packed-main-library-1
-   (or package (file-name-nondirectory (directory-file-name directory)))
-   (packed-libraries-1 directory)
-   noerror nosingle))
-
-(defun packed-main-library-1 (package libraries &optional noerror nosingle)
-  "Return the main library among LIBRARIES of the package PACKAGE.
-PACKAGE is a package name, a string.  LIBRARIES is a list of full
-library filenames or an alist as returned by `packed-libraries-1'.
-In the latter case also ensure that the main library provides the
-correct feature.
-
-Return the library whose basename matches the package name.  If
-that fails append \"-mode\" to the package name, respectively
-remove that substring, and try again.
-
-Unless optional NOSINGLE is non-nil and if there is only a single
-Emacs lisp file return that even if it doesn't match the package
-name.
-
-If no library matches raise an error or if optional NOERROR is
-non-nil return nil."
-  (let ((match
-         (cond ((and (not nosingle)
-                     (not (cdr libraries)))
-                (car libraries))
-               ((packed-main-library-2 package libraries))
-               ((packed-main-library-2
-                 (if (string-match "-mode$" package)
-                     (substring package 0 -5)
-                   (concat package "-mode"))
-                 libraries)))))
-    (cond ((and (not match)
-                (not noerror))
-           (error "Cannot determine main library of %s" package))
-          ((atom match)
-           match)
-          ((cdr match)
-           (car match))
-          ((not noerror)
-           (error "Main library %s provides no or wrong feature"
-                  (car match))))))
-
-(defun packed-main-library-2 (package libraries)
-  (let ((regexp (concat "^" (regexp-quote package) (packed-el-regexp) "$")))
-    (cl-find-if (lambda (lib)
-                  (string-match regexp (file-name-nondirectory
-                                        (if (consp lib) (car lib) lib))))
-                libraries)))
-
-;;; Load Path
-
-(defun packed-add-to-load-path (directory)
-  "Add DIRECTORY and subdirectories to `load-path' if they contain libraries."
-  (dolist (d (packed-load-path directory))
-    (add-to-list 'load-path d)))
-
-(defun packed-remove-from-load-path (directory)
-  "Remove DIRECTORY and its subdirectories from `load-path'.
-Elements of `load-path' which no longer exist are not removed."
-  (setq directory (directory-file-name (expand-file-name directory)))
-  (setq load-path (delete directory load-path))
-  (dolist (f (directory-files directory t "^[^.]" t))
-    (when (file-directory-p f)
-      (packed-remove-from-load-path f))))
-
-(defun packed-load-path (directory)
-  "Return a list of directories below DIRECTORY that contain libraries."
-  (let (lp in-lp)
-    (dolist (f (directory-files directory t "^[^.]"))
-      (cond ((file-regular-p f)
-             (and (not in-lp)
-                  (packed-library-p f)
-                  (add-to-list 'lp (directory-file-name directory))
-                  (setq in-lp t)))
-            ((file-directory-p f)
-             (unless (packed-ignore-directory-p f)
-               (setq lp (nconc (packed-load-path f) lp))))))
-    lp))
-
-;;; Byte Compile
-
-(defmacro packed-without-mode-hooks (&rest body)
-  (declare (indent 0))
-  `(let (after-change-major-mode-hook
-         prog-mode-hook
-         emacs-lisp-mode-hook)
-     ,@body))
-
-(defun packed-byte-compile-file (filename &optional load)
-  "Like `byte-compile-file' but don't run any mode hooks."
-  (packed-without-mode-hooks (byte-compile-file filename load)))
-
-(defun packed-compile-package (directory &optional force)
-  (unless noninteractive
-    (save-some-buffers)
-    (force-mode-line-update))
-  (with-current-buffer (get-buffer-create byte-compile-log-buffer)
-    (setq default-directory (expand-file-name directory))
-    (unless (eq major-mode 'compilation-mode)
-      (compilation-mode))
-    (let ((default-directory default-directory)
-          (skip-count 0)
-          (fail-count 0)
-          (lib-count 0)
-          (dir-count 0)
-          file dir last-dir)
-      (displaying-byte-compile-warnings
-       (dolist (elt (packed-libraries-1 directory))
-         (setq file (car elt)
-               dir (file-name-nondirectory file))
-         (if (cdr elt)
-             (cl-incf (pcase (byte-recompile-file file force 0)
-                        (`no-byte-compile skip-count)
-                        (`t lib-count)
-                        (_  fail-count)))
-           (setq skip-count (1+ skip-count)))
-         (unless (eq last-dir dir)
-           (setq last-dir dir dir-count (1+ dir-count)))))
-      (message "Done (Total of %d file%s compiled%s%s%s)"
-               lib-count (if (= lib-count 1) "" "s")
-               (if (> fail-count 0) (format ", %d failed"  fail-count) "")
-               (if (> skip-count 0) (format ", %d skipped" skip-count) "")
-               (if (> dir-count  1)
-                   (format " in %d director%s" dir-count
-                           (if (= dir-count 1) "y" "ies"))
-                 "")))))
-
-;;; Autoloads
-
-(defun packed-loaddefs-file (&optional directory)
-  (let ((file (locate-dominating-file (or directory default-directory)
-                                      packed-loaddefs-filename)))
-    (and file (expand-file-name packed-loaddefs-filename file))))
-
-(defun packed-load-loaddefs (&optional directory)
-  (let ((file (packed-loaddefs-file directory)))
-    (if  file
-        (load file)
-      (message "Cannot locate loaddefs file for %s" directory))))
-
-(defmacro packed-with-loaddefs (dest &rest body)
-  (declare (indent 1))
-  `(packed-without-mode-hooks
-     (require 'autoload)
-     (let ((generated-autoload-file ,dest) buf)
-       (prog1 (progn ,@body)
-         (while (setq buf (find-buffer-visiting generated-autoload-file))
-           (with-current-buffer buf
-             (save-buffer)
-             (kill-buffer)))))))
-
-(defun packed-update-autoloads (dest path)
-  (packed-with-loaddefs dest
-    (update-directory-autoloads path)))
-
-(defun packed-remove-autoloads (dest path)
-  (packed-with-loaddefs dest
-    ;; `autoload-find-destination' clears out autoloads associated
-    ;; with a file if they are not found in the current buffer
-    ;; anymore (which is the case here because it is empty).
-    (with-temp-buffer
-      (let ((autoload-modified-buffers (list (current-buffer))))
-        (dolist (d path)
-          (when (file-directory-p d)
-            (dolist (f (directory-files d t (packed-el-regexp)))
-              (autoload-find-destination
-               f (autoload-file-load-name f)))))))))
-
-;;; Features
-
-(defconst packed-provided-regexp "\
-\(\\(?:cc-\\|silentcomp-\\)?provide[\s\t\n]+'\
-\\([^(),\s\t\n]+\\)\\(?:[\s\t\n]+'\
-\(\\([^(),]+\\))\\)?)")
-
-(defun packed-provided ()
-  (let (features)
-    (save-excursion
-      (goto-char (point-min))
-      (while (re-search-forward packed-provided-regexp nil t)
-        (unless (save-match-data
-                  (or (nth 3 (syntax-ppss))   ; in string
-                      (nth 4 (syntax-ppss)))) ; in comment
-          (dolist (feature (cons (match-string 1)
-                                 (let ((f (match-string 2)))
-                                   (and f (split-string f " " t)))))
-            (add-to-list 'features (intern feature))))))
-    (or features
-        (and (goto-char (point-min))
-             (re-search-forward
-              "^(provide-theme[\s\t\n]+'\\([^)]+\\))" nil t)
-             (list (intern (concat (match-string 1)
-                                   "-theme"))))
-        (and (goto-char (point-min))
-             (re-search-forward
-              "^(provide-me\\(?:[\s\t\n]+\"\\(.+\\)\"\\)?)" nil t)
-             (list (intern (concat (match-string 1)
-                                   (file-name-sans-extension
-                                    (file-name-nondirectory
-                                     buffer-file-name)))))))))
-
-(defun packed-library-feature (file)
-  "Return the first valid feature actually provided by FILE.
-
-Here valid means that requiring that feature would actually load FILE.
-Normally that is the case when the feature matches the filename, e.g.
-when \"foo.el\" provides `foo'.  But if \"foo.el\"s parent directory's
-filename is \"bar\" then `bar/foo' would also be valid.  Of course this
-depends on the actual value of `load-path', here we just assume that it
-allows for file to be found.
-
-This can be used to determine if an Emacs lisp file should be considered
-a library.  Not every Emacs lisp file has to provide a feature / be a
-library.  If a file lacks an expected feature then loading it using
-`require' still succeeds but causes an error."
-  (let* ((file (expand-file-name file))
-         (sans (file-name-sans-extension (file-name-sans-extension file)))
-         (last (file-name-nondirectory sans)))
-    (cl-find-if (lambda (feature)
-                  (setq feature (symbol-name feature))
-                  (or (equal feature last)
-                      (string-suffix-p (concat "/" feature) sans)))
-                (packed-with-file file (packed-provided)))))
-
-(defconst packed-required-regexp "\
-\(\\(?:cc-\\)?require[\s\t\n]+'\
-\\([^(),\s\t\n\"]+\\)\
-\\(?:\\(?:[\s\t\n]+\\(?:nil\\|\"[^\"]*\"\\)\\)\
-\\(?:[\s\t\n]+\\(?:nil\\|\\(t\\)\\)\\)?\\)?)")
-
-(defun packed-required ()
-  (let (hard soft)
-    (save-excursion
-      (goto-char (point-min))
-      (while (re-search-forward packed-required-regexp nil t)
-        (let ((feature (intern (match-string 1))))
-          (cond ((save-match-data
-                   (or (nth 3 (syntax-ppss))    ; in string
-                       (nth 4 (syntax-ppss))))) ; in comment
-                ((match-string 2)
-                 (add-to-list 'soft feature))
-                (t
-                 (add-to-list 'hard feature))))))
-    (list hard soft)))
-
-;;; Info Pages
-
-(defvar packed-ginstall-info
-  (or (executable-find "ginstall-info")
-      (executable-find "install-info")))
-
-(defconst packed-texinfo-regexp
-  (concat "\\." (regexp-opt (list "texi" "texinfo" "txi")) "$"))
-
-(defun packed-enable-info-dir-file (dir-file)
-  "Add the directory containing DIR-FILE to `Info-directory-list'.
-Before doing so initialize the default value of the latter if
-that hasn't happened yet.  If DIR-FILE doesn't exist do nothing."
-  (when (file-exists-p dir-file)
-    (require 'info)
-    (info-initialize)
-    (add-to-list 'Info-directory-list (file-name-directory dir-file))))
-
-(defun packed-install-info (directory dir-file)
-  "Install info files from DIRECTORY in DIR-FILE.
-
-In the directory containing DIR-FILE create links to info and
-texinfo files in DIRECTORY and recursively all non-hidden
-subdirectories; and add the info files to DIR-FILE.  Files are
-linked to instead of copied to make it easier to later remove
-files from a particular DIRECTORY.
-
-If a texinfo file exists create a link to it and create the info
-file in the directory containing DIR-FILE.  The corresponding
-info file if it also exists in DIRECTORY is ignored."
-  (let ((default-directory (file-name-directory dir-file)))
-    (dolist (f (packed-info-files directory))
-      (let ((l (file-name-nondirectory f)))
-        (make-symbolic-link f l t)
-        (when (string-match packed-texinfo-regexp f)
-          (call-process "makeinfo" nil nil nil l)
-          (setq l (concat (file-name-sans-extension l) ".info")))
-        (call-process packed-ginstall-info nil nil nil l
-                      (file-name-nondirectory dir-file))))))
-
-(defun packed-uninstall-info (directory dir-file)
-  "Uninstall info files located in DIRECTORY from DIR-FILE.
-
-In the directory containing DIR-FILE remove links to info and
-texinfo files in DIRECTORY and recursively all non-hidden
-subdirectories; and remove the info files from DIR-FILE.
-
-When removing a symlink to a texinfo file also remove the info
-file created from it.  Also remove the corresponding entries from
-DIR-FILE."
-  (let ((default-directory (file-name-directory dir-file))
-        (r (concat "^" (regexp-quote directory))))
-    (dolist (f (directory-files default-directory "^[^.]"))
-      (when (and (file-symlink-p f)
-                 (string-match r (file-truename f)))
-        (when (string-match packed-texinfo-regexp f)
-          (delete-file f)
-          (setq f (concat (file-name-sans-extension f) ".info")))
-        (call-process packed-ginstall-info nil nil nil "--delete" f "dir")
-        (when (file-exists-p f)
-          (delete-file f))))))
-
-(defun packed-info-files (directory)
-  "Return a list of info and texinfo files in DIRECTORY.
-
-Return a list of absolute filenames of info and texinfo files in
-DIRECTORY and recursively all non-hidden subdirectories.  If both
-an info file and the corresponding texinfo file exist only
-include the latter in the returned list."
-  (let (files name)
-    (dolist (f (directory-files directory t "^[^.]"))
-      (cond ((file-directory-p f)
-             (setq files (nconc (packed-info-files f) files)))
-            ((file-regular-p f)
-             (cond ((and (string-match "\\.info\\'" f)
-                         (setq name (file-name-sans-extension f))
-                         (not (file-exists-p (concat name ".texinfo")))
-                         (not (file-exists-p (concat name ".texi")))
-                         (not (file-exists-p (concat name ".txi"))))
-                    (setq files (cons f files)))
-                   ((string-match "\\.\\(txi\\|texi\\(nfo\\)?\\)\\'" f)
-                    (setq files (cons f files)))))))
-    (sort files 'string<)))
-
-(provide 'packed)
-;; Local Variables:
-;; indent-tabs-mode: nil
-;; End:
-;;; packed.el ends here
.emacs.d/elpa/packed-20170819.942/packed.elc
Binary file
.emacs.d/elpa/page-break-lines-20170829.157/page-break-lines-autoloads.el
@@ -1,77 +0,0 @@
-;;; page-break-lines-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "page-break-lines" "page-break-lines.el" (22964
-;;;;;;  2890 175710 654000))
-;;; Generated autoloads from page-break-lines.el
-
-(defvar page-break-lines-char 9472 "\
-Character used to render page break lines.")
-
-(custom-autoload 'page-break-lines-char "page-break-lines" t)
-
-(defvar page-break-lines-lighter " PgLn" "\
-Mode-line indicator for `page-break-lines-mode'.")
-
-(custom-autoload 'page-break-lines-lighter "page-break-lines" t)
-
-(defvar 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'.")
-
-(custom-autoload 'page-break-lines-modes "page-break-lines" t)
-
-(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 (quote page-break-lines))
-
-(autoload 'page-break-lines-mode "page-break-lines" "\
-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.
-
-\(fn &optional ARG)" t nil)
-
-(define-obsolete-function-alias 'turn-on-page-break-lines-mode 'page-break-lines-mode)
-
-(autoload 'page-break-lines-mode-maybe "page-break-lines" "\
-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.
-
-\(fn)" nil nil)
-
-(defvar global-page-break-lines-mode nil "\
-Non-nil if Global Page-Break-Lines mode is enabled.
-See the `global-page-break-lines-mode' command
-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-page-break-lines-mode'.")
-
-(custom-autoload 'global-page-break-lines-mode "page-break-lines" nil)
-
-(autoload 'global-page-break-lines-mode "page-break-lines" "\
-Toggle Page-Break-Lines mode in all buffers.
-With prefix ARG, enable Global Page-Break-Lines mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
-
-Page-Break-Lines mode is enabled in all buffers where
-`page-break-lines-mode-maybe' would do it.
-See `page-break-lines-mode' for more information on Page-Break-Lines mode.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; page-break-lines-autoloads.el ends here
.emacs.d/elpa/page-break-lines-20170829.157/page-break-lines-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "page-break-lines" "20170829.157" "Display ^L page breaks as tidy horizontal lines" 'nil :commit "913732ad06d838661989fb1fef05fcc9ca88f725" :url "https://github.com/purcell/page-break-lines" :keywords '("convenience" "faces"))
.emacs.d/elpa/page-break-lines-20170829.157/page-break-lines.el
@@ -1,175 +0,0 @@
-;;; page-break-lines.el --- Display ^L page breaks as tidy horizontal lines
-
-;; Copyright (C) 2012-2015 Steve Purcell
-
-;; Author: Steve Purcell <steve@sanityinc.com>
-;; URL: https://github.com/purcell/page-break-lines
-;; Package-Version: 20170829.157
-;; Package-X-Original-Version: 0
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; 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)
-
-;;;###autoload
-(defcustom page-break-lines-char ?─
-  "Character used to render page break lines."
-  :type 'character
-  :group 'page-break-lines)
-
-;;;###autoload
-(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)
-
-;;;###autoload
-(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)
-
-;;;###autoload
-(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
-(define-obsolete-function-alias 'turn-on-page-break-lines-mode 'page-break-lines-mode)
-
-(dolist (hook '(window-configuration-change-hook
-                window-size-change-functions
-                after-setting-font-hook
-                display-line-numbers-mode-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)
-    (with-selected-window window
-      (if page-break-lines-mode
-          (progn
-            (unless buffer-display-table
-              (setq buffer-display-table (make-display-table)))
-            (let ((default-height (face-attribute 'default :height nil 'default)))
-              (set-face-attribute 'page-break-lines nil :height default-height)
-              (let* ((cwidth (char-width page-break-lines-char))
-                     (wwidth (- (window-width)
-                                (if (bound-and-true-p display-line-numbers)
-                                    (+ (line-number-display-width) 2)
-                                  0)
-                                (if (display-graphic-p) 0 1)))
-                     (width (/ wwidth cwidth))
-                     (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 (and (member major-mode page-break-lines-modes)
-                   buffer-display-table)
-          (aset buffer-display-table ?\^L nil))))))
-
-(defun page-break-lines--update-display-tables  (&optional frame)
-  "Function called for updating display table in windows of FRAME."
-  (unless (minibufferp)
-    (mapc 'page-break-lines--update-display-table (window-list frame '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
-  :require 'page-break-lines
-  :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
.emacs.d/elpa/page-break-lines-20170829.157/page-break-lines.elc
Binary file
.emacs.d/elpa/persp-projectile-20160709.2317/persp-projectile-autoloads.el
@@ -1,30 +0,0 @@
-;;; persp-projectile-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "persp-projectile" "persp-projectile.el" (22977
-;;;;;;  30128 60658 582000))
-;;; Generated autoloads from persp-projectile.el
-
-(autoload 'projectile-persp-switch-project "persp-projectile" "\
-Switch to a project or perspective we have visited before.
-If the perspective of corresponding project does not exist, this
-function will call `persp-switch' to create one and switch to
-that before `projectile-switch-project' invokes
-`projectile-switch-project-action'.
-
-Otherwise, this function calls `persp-switch' to switch to an
-existing perspective of the project unless we're already in that
-perspective.
-
-\(fn PROJECT-TO-SWITCH)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; persp-projectile-autoloads.el ends here
.emacs.d/elpa/persp-projectile-20160709.2317/persp-projectile-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "persp-projectile" "20160709.2317" "Perspective integration with Projectile" '((perspective "1.9") (projectile "0.11.0") (cl-lib "0.3")) :commit "7686633acf44402fa90429759cca6a155e4df2b9" :keywords '("project" "convenience"))
.emacs.d/elpa/persp-projectile-20160709.2317/persp-projectile.el
@@ -1,106 +0,0 @@
-;;; persp-projectile.el --- Perspective integration with Projectile
-
-;; Copyright (C) 2014-2016 Daniel Wu, Bozhidar Batsov
-
-;; Author: Daniel Wu
-;; Created: 2014-04-14
-;; Keywords: project, convenience
-;; Package-Version: 20160709.2317
-;; Version: 0.2.0
-;; Package-Requires: ((perspective "1.9") (projectile "0.11.0") (cl-lib "0.3"))
-
-;; This file is NOT part of GNU Emacs.
-
-;;; License:
-
-;; 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, 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., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-;;
-;; This library bridges perspective mode to the awesome library
-;; Projectile.  The idea is to create a separate perspective when
-;; switching project.  A perspective is an independant workspace for
-;; Emacs, similar to multiple desktops in Gnome and MacOS.  I often
-;; work on many projects at the same time, and using perspective and
-;; projectile together allows me to easily know which project I'm
-;; current in, and focus on files that only belong to current project
-;; when switching buffer.
-
-;; To use this library, put this file in your Emacs load path, and
-;; call (require 'persp-projectile)
-
-;; See perspective.el on github: https://github.com/nex3/perspective-el
-
-;;; Code:
-(require 'perspective)
-(require 'projectile)
-
-;; TODO this may be incompatible helm which let's you find stuff in new frame
-(defmacro projectile-persp-bridge (func-name)
-  "Create advice to create a perspective before invoking function FUNC-NAME.
-The advice provides bridge between perspective and projectile
-functions when switch between projects.  After switching to a new
-project, this advice creates a new perspective for that project."
-  `(defadvice ,func-name (before projectile-create-perspective-after-switching-projects activate)
-     "Create a dedicated perspective for current project's window after switching projects."
-     (let ((project-name (projectile-project-name)))
-       (when (projectile-project-p)
-         (persp-switch project-name)))))
-
-(projectile-persp-bridge projectile-dired)
-(projectile-persp-bridge projectile-find-file)
-
-;;;###autoload
-(defun projectile-persp-switch-project (project-to-switch)
-  "Switch to a project or perspective we have visited before.
-If the perspective of corresponding project does not exist, this
-function will call `persp-switch' to create one and switch to
-that before `projectile-switch-project' invokes
-`projectile-switch-project-action'.
-
-Otherwise, this function calls `persp-switch' to switch to an
-existing perspective of the project unless we're already in that
-perspective."
-  (interactive (list (projectile-completing-read "Switch to project: "
-                                                 (projectile-relevant-known-projects))))
-  (let* ((name (file-name-nondirectory (directory-file-name project-to-switch)))
-         (persp (gethash name perspectives-hash)))
-    (cond
-     ;; project-specific perspective already exists
-     ((and persp (not (equal persp persp-curr)))
-      (persp-switch name))
-     ;; project-specific perspective doesn't exist
-     ((not persp)
-      (let ((frame (selected-frame)))
-        (persp-switch name)
-        (projectile-switch-project-by-name project-to-switch)
-        ;; Clean up if we switched to a new frame. `helm' for one allows finding
-        ;; files in new frames so this is a real possibility.
-        (when (not (equal frame (selected-frame)))
-          (with-selected-frame frame
-            (persp-kill name))))))))
-
-(defadvice persp-init-frame (after projectile-persp-init-frame activate)
-  "Rename initial perspective to `projectile-project-name' when a
-new frame is created in a known project."
-  (with-selected-frame frame
-    (when (projectile-project-p)
-      (persp-rename (projectile-project-name)))))
-
-(define-key projectile-mode-map [remap projectile-switch-project] 'projectile-persp-switch-project)
-
-(provide 'persp-projectile)
-;;; persp-projectile.el ends here
.emacs.d/elpa/persp-projectile-20160709.2317/persp-projectile.elc
Binary file
.emacs.d/elpa/perspective-20160609.1444/perspective-autoloads.el
@@ -1,34 +0,0 @@
-;;; perspective-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "perspective" "perspective.el" (22977 30127
-;;;;;;  560663 522000))
-;;; Generated autoloads from perspective.el
-
-(defvar persp-mode nil "\
-Non-nil if Persp mode is enabled.
-See the `persp-mode' command
-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 `persp-mode'.")
-
-(custom-autoload 'persp-mode "perspective" nil)
-
-(autoload 'persp-mode "perspective" "\
-Toggle perspective mode.
-When active, keeps track of multiple 'perspectives',
-named collections of buffers and window configurations.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; perspective-autoloads.el ends here
.emacs.d/elpa/perspective-20160609.1444/perspective-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "perspective" "20160609.1444" "switch between named \"perspectives\" of the editor" '((cl-lib "0.5")) :commit "89a8ef5e8297b113e4f732bb94336608b76e13fd" :url "http://github.com/nex3/perspective-el" :keywords '("workspace" "convenience" "frames"))
.emacs.d/elpa/perspective-20160609.1444/perspective.el
@@ -1,926 +0,0 @@
-;;; perspective.el --- switch between named "perspectives" of the editor
-
-;; Copyright (C) 2008-2015 Natalie Weizenbaum <nex342@gmail.com>
-;;
-;; Licensed under the same terms as Emacs and under the MIT license.
-
-;; Author: Natalie Weizenbaum <nex342@gmail.com>
-;; URL: http://github.com/nex3/perspective-el
-;; Package-Version: 20160609.1444
-;; Package-Requires: ((cl-lib "0.5"))
-;; Version: 1.12
-;; Created: 2008-03-05
-;; By: Natalie Weizenbaum <nex342@gmail.com>
-;; Keywords: workspace, convenience, frames
-
-;;; Commentary:
-
-;; This package provides tagged workspaces in Emacs, similar to
-;; workspaces in windows managers such as Awesome and XMonad (and
-;; somewhat similar to multiple desktops in Gnome or Spaces in OS X).
-
-;; perspective.el provides multiple workspaces (or "perspectives") for
-;; each Emacs frame.  This makes it easy to work on many separate projects
-;; without getting lost in all the buffers.
-
-;; Each perspective is composed of a window configuration and a set of
-;; buffers.  Switching to a perspective activates its window
-;; configuration, and when in a perspective only its buffers are
-;; available by default.
-
-(require 'cl-lib)
-
-;; 'cl' is still required because the use of 'lexical-let'.  'lexical-let' has
-;; been deprecated since emacs 24.1, and it should be replaced with true
-;; lexical bindings.  For more information, please see
-;; https://www.gnu.org/software/emacs/manual/html_node/cl/
-;; Obsolete-Lexical-Binding.html
-(require 'cl)
-
-(defvar ido-temp-list)
-
-;;; Code:
-
-(defgroup perspective-mode 'nil
-  "Customization for Perspective mode"
-  :group 'frames)
-
-(defcustom persp-initial-frame-name "main"
-  "Name used for the initial perspective when enabling `persp-mode'."
-  :type 'string
-  :group 'perspective-mode)
-
-(defcustom persp-show-modestring t
-  "Determines if `persp-modestring' is shown in the modeline.
-If the value is 'header, `persp-modestring' is shown in the
-header line instead."
-  :group 'perspective-mode
-  :type '(choice (const :tag "Off" nil)
-                 (const :tag "Modeline" t)
-                 (const :tag "Header" 'header)))
-
-(defcustom persp-modestring-dividers '("[" "]" "|")
-  "Plist of strings used to created `persp-modestring'.
-First string is the start of the modestring, second is the
-closing of the mode string, and the last is the divider between
-perspectives."
-  :group 'perspective-mode
-  :type '(list (string :tag "Open")
-               (string :tag "Close")
-               (string :tag "Divider")))
-
-(defcustom persp-mode-prefix-key (kbd "C-x x")
-  "Prefix key to activate perspective-map"
-  :group 'perspective-mode
-  :set (lambda (sym value)
-	 (when (and (bound-and-true-p persp-mode-map)
-		    (bound-and-true-p perspective-map))
-           (persp-mode-set-prefix-key value))
-	 (set-default sym value))
-  :type 'key-sequence)
-
-(defcustom persp-switch-wrap t
-  "Whether `persp-next' and `persp-prev' should wrap."
-  :group 'perspective-mode
-  :type 'boolean)
-
-;; This is only available in Emacs >23,
-;; so we redefine it here for compatibility.
-(unless (fboundp 'with-selected-frame)
-  (defmacro with-selected-frame (frame &rest body)
-    "Execute the forms in BODY with FRAME as the selected frame.
-The value returned is the value of the last form in BODY.
-See also `with-temp-buffer'."
-    (declare (indent 1) (debug t))
-    (let ((old-frame (make-symbol "old-frame"))
-          (old-buffer (make-symbol "old-buffer")))
-      `(let ((,old-frame (selected-frame))
-             (,old-buffer (current-buffer)))
-         (unwind-protect
-             (progn (select-frame ,frame)
-                    ,@body)
-           (if (frame-live-p ,old-frame)
-               (select-frame ,old-frame))
-           (if (buffer-live-p ,old-buffer)
-               (set-buffer ,old-buffer)))))))
-
-(defmacro persp-frame-local-let (bindings &rest body)
-  "Like `let', but properly handles frame-local variables.
-Bind variables according to BINDINGS then eval BODY.
-
-In Emacs >= 23.2, frame-local variables are not reset after a
-`let' expression.  This hacks around that by manually resetting
-them in Emacs >= 23.2.  In older versions, this is identical to
-`let'."
-  (declare (indent 1))
-  (if (or (< emacs-major-version 23)
-          (and (= emacs-major-version 23) (< emacs-minor-version 2)))
-      `(let ,bindings ,@body)
-    (let ((binding-syms (mapcar (lambda (binding) (list (car binding) (cl-gensym))) bindings)))
-      ;; Each binding-sym is a pair (ORIGINAL-VALUE . WAS-BOUND).
-      `(let ,(mapcar (lambda (binding)
-                       (list (cadr binding)
-                             (let ((name (car binding)))
-                               `(cons (when (boundp ',name) ,name)
-                                      (boundp ',name)))))
-                     binding-syms)
-         (unwind-protect
-             (progn ,@(mapcar (lambda (binding) `(setq ,(car binding) ,(cadr binding))) bindings)
-                    ,@body)
-           ;; After the body, reset the original value of each binding sym if
-           ;; there was one, unbind it if there wasn't.
-           ,@(mapcar (lambda (binding)
-                       `(if (cdr ,(cadr binding))
-                            (setq ,(car binding) (car ,(cadr binding)))
-                          (makunbound ',(car binding)))) binding-syms))))))
-
-(cl-defstruct (perspective
-               (:conc-name persp-)
-               (:constructor make-persp-internal))
-  name buffers killed local-variables
-  (buffer-history buffer-name-history)
-  (window-configuration (current-window-configuration))
-  (point-marker (point-marker)))
-
-(defalias 'persp-killed-p 'persp-killed
-  "Return whether the perspective CL-X has been killed.")
-
-(defvar persp-interactive-completion-function
-  (if ido-mode 'ido-completing-read 'completing-read)
-  "The function which is used by perspective.el to interactivly complete user input")
-
-(defvar persp-before-switch-hook nil
-  "A hook that's run before `persp-switch'.
-Run with the previous perspective as `persp-curr'.")
-
-(defvar persp-switch-hook nil
-  "A hook that's run after `persp-switch'.
-Run with the newly created perspective as `persp-curr'.")
-
-(defvar persp-mode-hook nil
-  "A hook that's run after `persp-mode' has been activated.")
-
-(defvar persp-created-hook nil
-  "A hook that's run after a perspective has been created.
-Run with the newly created perspective as `persp-curr'.")
-
-(defvar persp-killed-hook nil
-  "A hook that's run just before a perspective is destroyed.
-Run with the perspective to be destroyed as `persp-curr'.")
-
-(defvar persp-activated-hook nil
-  "A hook that's run after a perspective has been activated.
-Run with the activated perspective active.")
-
-(defvar persp-mode-map (make-sparse-keymap)
-  "Keymap for perspective-mode.")
-
-(define-prefix-command 'perspective-map)
-(define-key persp-mode-map persp-mode-prefix-key 'perspective-map)
-
-(define-key perspective-map (kbd "s") 'persp-switch)
-(define-key perspective-map (kbd "k") 'persp-remove-buffer)
-(define-key perspective-map (kbd "c") 'persp-kill)
-(define-key perspective-map (kbd "r") 'persp-rename)
-(define-key perspective-map (kbd "a") 'persp-add-buffer)
-(define-key perspective-map (kbd "A") 'persp-set-buffer)
-(define-key perspective-map (kbd "b") 'persp-switch-to-buffer)
-(define-key perspective-map (kbd "i") 'persp-import)
-(define-key perspective-map (kbd "n") 'persp-next)
-(define-key perspective-map (kbd "<right>") 'persp-next)
-(define-key perspective-map (kbd "p") 'persp-prev)
-(define-key perspective-map (kbd "<left>") 'persp-prev)
-(define-key perspective-map persp-mode-prefix-key 'persp-switch-last)
-
-(defun persp-mode-set-prefix-key (newkey)
-  "Set the prefix key to activate persp-mode"
-  (substitute-key-definition 'perspective-map nil persp-mode-map)
-  (define-key persp-mode-map newkey 'perspective-map))
-
-;; make-variable-frame-local is obsolete according to the docs,
-;; but I don't want to have to manually munge frame-parameters
-;; all the time so I'm using it anyway.
-(make-variable-frame-local
- (defvar perspectives-hash nil
-   "A hash containing all perspectives. The keys are the
-perspectives' names. The values are persp structs,
-with the fields NAME, WINDOW-CONFIGURATION, BUFFERS,
-BUFFER-HISTORY, KILLED, POINT-MARKER, and LOCAL-VARIABLES.
-
-NAME is the name of the perspective.
-
-WINDOW-CONFIGURATION is the configuration given by
-`current-window-configuration' last time the perspective was
-saved (if this isn't the current perspective, this is when the
-perspective was last active).
-
-BUFFERS is a list of buffer objects that are associated with this
-perspective.
-
-BUFFER-HISTORY is the list of buffer history values for this
-perspective.
-
-KILLED is non-nil if the perspective has been killed.
-
-POINT-MARKER is the point position in the active buffer.
-Otherwise, when multiple windows are visiting the same buffer,
-all but one of their points will be overwritten.
-
-LOCAL-VARIABLES is an alist from variable names to their
-perspective-local values."))
-
-(make-variable-frame-local
- (defvar persp-curr nil
-   "The current perspective."))
-
-(make-variable-frame-local
- (defvar persp-recursive nil
-   "The current perspective before beginning a recursive edit."))
-
-(make-variable-frame-local
- (defvar persp-last nil
-   "The last perspective accessed before the current perspective."))
-
-(make-variable-frame-local
- (defvar persp-modestring nil
-   "The string displayed in the modeline representing the perspectives."))
-(put 'persp-modestring 'risky-local-variable t)
-
-(defvar persp-protected nil
-  "Whether a perspective error should cause persp-mode to be disabled.
-Dynamically bound by `persp-protect'.")
-
-(defface persp-selected-face
-  '((t (:weight bold :foreground "Blue")))
-  "The face used to highlight the current perspective on the modeline.")
-
-(defmacro persp-protect (&rest body)
-  "Wrap BODY to disable persp-mode when it errors out.
-This prevents the persp-mode from completely breaking Emacs."
-  (declare (indent 0))
-  (let ((persp-protected t))
-    `(condition-case err
-         (progn ,@body)
-       (persp-error
-        (message "Fatal persp-mode error: %S" err)
-        (persp-mode -1)))))
-
-(defun persp-error (&rest args)
-  "Like `error', but marks it as a persp-specific error.
-Used along with `persp-protect' to ensure that persp-mode doesn't
-bring down Emacs."
-  (if persp-protected
-      (signal 'persp-error (list (apply 'format args)))
-    (apply 'error args)))
-
-(defun check-persp (persp)
-  "Raise an error if PERSP has been killed."
-  (cond
-   ((not persp)
-    (persp-error "Expected perspective, was nil"))
-   ((persp-killed-p persp)
-    (persp-error "Using killed perspective `%s'" (persp-name persp)))))
-
-(defmacro make-persp (&rest args)
-  "Create a new perspective struct and put it in `perspectives-hash'.
-
-ARGS is a list of keyword arguments followed by an optional BODY.
-The keyword arguments set the fields of the perspective struct.
-If BODY is given, it is executed to set the window configuration
-for the perspective."
-  (declare (indent defun))
-  (let ((keywords))
-    (while (keywordp (car args))
-      (dotimes (_ 2) (push (pop args) keywords)))
-    (setq keywords (reverse keywords))
-    `(let ((persp (make-persp-internal ,@keywords)))
-       (when persp-curr
-         (setf (persp-local-variables persp) (persp-local-variables persp-curr)))
-       (puthash (persp-name persp) persp perspectives-hash)
-       (with-perspective (persp-name persp)
-         ,(when args
-            ;; Body form given
-            `(save-excursion ,@args))
-         (run-hooks 'persp-created-hook))
-       persp)))
-
-(defun persp-save ()
-  "Save the current perspective state.
-Specifically, save the current window configuration and
-perspective-local variables to `persp-curr'"
-  (when persp-curr
-    (setf (persp-local-variables persp-curr)
-          (mapcar
-           (lambda (c)
-             (let ((name (car c)))
-               (list name (symbol-value name))))
-           (persp-local-variables persp-curr)))
-    (setf (persp-buffer-history persp-curr) buffer-name-history)
-    (setf (persp-window-configuration persp-curr) (current-window-configuration))
-    (setf (persp-point-marker persp-curr) (point-marker))))
-
-(defun persp-names ()
-  "Return a list of the names of all perspectives, sorted alphabetically."
-  (sort
-   (cl-loop for name being the hash-keys of perspectives-hash
-            collect name)
-   'string<))
-
-(defun persp-all-names (&optional not-frame)
-  "Return a list of the perspective names for all frames.
-Excludes NOT-FRAME, if given."
-  (cl-reduce 'union
-             (mapcar
-              (lambda (frame)
-                (unless (equal frame not-frame)
-                  (with-selected-frame frame (persp-names))))
-              (frame-list))))
-
-(defun persp-prompt (&optional default require-match)
-  "Prompt for the name of a perspective.
-
-DEFAULT is a default value for the prompt.
-
-REQUIRE-MATCH can take the same values as in `completing-read'."
-  (funcall persp-interactive-completion-function (concat "Perspective name"
-                           (if default (concat " (default " default ")") "")
-                           ": ")
-                   (persp-names)
-                   nil require-match nil nil default))
-
-(defmacro with-perspective (name &rest body)
-  "Switch to the perspective given by NAME while evaluating BODY."
-  (declare (indent 1))
-  (let ((old (cl-gensym)))
-    `(progn
-       (let ((,old (when persp-curr (persp-name persp-curr)))
-             (last-persp-cache persp-last))
-         (unwind-protect
-             (progn
-               (persp-switch ,name)
-               ,@body)
-           (when ,old (persp-switch ,old)))
-         (setq persp-last last-persp-cache)))))
-
-(defun persp-new (name)
-  "Return a new perspective with name NAME.
-The new perspective will start with only an `initial-major-mode'
-buffer called \"*scratch* (NAME)\"."
-  (make-persp :name name
-    (switch-to-buffer (concat "*scratch* (" name ")"))
-    (funcall initial-major-mode)
-    (delete-other-windows)))
-
-(defun persp-reactivate-buffers (buffers)
-  "Raise BUFFERS to the top of the most-recently-selected list.
-Returns BUFFERS with all non-living buffers removed.
-
-See also `other-buffer'."
-  (cl-loop for buf in (reverse buffers)
-           if (not (null (buffer-name buf)))
-           collect buf into living-buffers
-           and do (switch-to-buffer buf)
-           finally return (reverse living-buffers)))
-
-(defun persp-set-local-variables (vars)
-  "Set the local variables given in VARS.
-VARS should be an alist of variable names to values."
-  (dolist (var vars) (apply 'set var)))
-
-(defun persp-intersperse (list interspersed-val)
-  "Intersperse a value into a list.
-Return a new list made from taking LIST and inserting
-INTERSPERSED-VAL between every pair of items.
-
-For example, (persp-intersperse '(1 2 3) 'a) gives '(1 a 2 a 3)."
-  (reverse
-   (cl-reduce
-    (lambda (list el) (if list (cl-list* el interspersed-val list) (list el)))
-    list :initial-value nil)))
-
-(defconst persp-mode-line-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [mode-line down-mouse-1] 'persp-mode-line-click)
-    map))
-
-(defun persp-mode-line-click (event)
-  "Select the clicked perspective.
-EVENT is the click event triggering this function call."
-  (interactive "e")
-  (persp-switch (format "%s" (car (posn-string (event-start event))))))
-
-(defun persp-update-modestring ()
-  "Update `persp-modestring' to reflect the current perspectives.
-Has no effect when `persp-show-modestring' is nil."
-  (when persp-show-modestring
-    (let ((open (list (nth 0 persp-modestring-dividers)))
-          (close (list (nth 1 persp-modestring-dividers)))
-          (sep (nth 2 persp-modestring-dividers)))
-     (setq persp-modestring
-           (append open
-                   (persp-intersperse (mapcar 'persp-format-name
-                                              (persp-names)) sep)
-                   close)))))
-
-(defun persp-format-name (name)
-  "Format the perspective name given by NAME for display in `persp-modestring'."
-  (let ((string-name (format "%s" name)))
-    (if (equal name (persp-name persp-curr))
-        (propertize string-name 'face 'persp-selected-face)
-      (propertize string-name
-                  'local-map persp-mode-line-map
-                  'mouse-face 'mode-line-highlight))))
-
-(defun persp-get-quick (char &optional prev)
-  "Return the name of the first perspective that begins with CHAR.
-Perspectives are sorted alphabetically.
-
-PREV can be the name of a perspective.  If it's passed,
-this will try to return the perspective alphabetically after PREV.
-This is used for cycling between perspectives."
-  (persp-get-quick-helper char prev (persp-names)))
-
-(defun persp-get-quick-helper (char prev names)
-  (if (null names) nil
-    (let ((name (car names)))
-      (cond
-       ((and (null prev) (eq (string-to-char name) char)) name)
-       ((equal name prev)
-        (if (and (not (null (cdr names))) (eq (string-to-char (cadr names)) char))
-            (cadr names)
-          (persp-get-quick char)))
-       (t (persp-get-quick-helper char prev (cdr names)))))))
-
-(defun persp-switch-last ()
-  "Switch to the perspective accessed before the current one."
-  (interactive)
-  (unless persp-last
-    (error "There is no last perspective"))
-  (persp-switch (persp-name persp-last)))
-
-(defun persp-switch (name)
-  "Switch to the perspective given by NAME.
-If it doesn't exist, create a new perspective and switch to that.
-
-Switching to a perspective means that all buffers associated with
-that perspective are reactivated (see `persp-reactivate-buffers'),
-the perspective's window configuration is restored, and the
-perspective's local variables are set."
-  (interactive "i")
-  (if (null name) (setq name (persp-prompt (and persp-last (persp-name persp-last)))))
-  (if (and persp-curr (equal name (persp-name persp-curr))) name
-    (let ((persp (gethash name perspectives-hash)))
-      (setq persp-last persp-curr)
-      (when (null persp)
-        (setq persp (persp-new name)))
-      (run-hooks 'persp-before-switch-hook)
-      (persp-activate persp)
-      name))
-  (run-hooks 'persp-switch-hook))
-
-(defun persp-activate (persp)
-  "Activate the perspective given by the persp struct PERSP."
-  (check-persp persp)
-  (persp-save)
-  (setq persp-curr persp)
-  (persp-set-local-variables (persp-local-variables persp))
-  (persp-reactivate-buffers (persp-buffers persp))
-  (setq buffer-name-history (persp-buffer-history persp))
-  (set-window-configuration (persp-window-configuration persp))
-  (goto-char (persp-point-marker persp))
-  (persp-update-modestring)
-  (run-hooks 'persp-activated-hook))
-
-(defun persp-switch-quick (char)
-  "Switch to the first perspective, alphabetically, that begins with CHAR.
-
-Sets `this-command' (and thus `last-command') to (persp-switch-quick . CHAR).
-
-See `persp-switch', `persp-get-quick'."
-  (interactive "c")
-  (let ((persp (if (and (consp last-command) (eq (car last-command) this-command))
-                   (persp-get-quick char (cdr last-command))
-                 (persp-get-quick char))))
-    (setq this-command (cons this-command persp))
-    (if persp (persp-switch persp)
-      (persp-error (concat "No perspective name begins with " (string char))))))
-
-(defun persp-next ()
-  "Switch to next perspective (to the right)."
-  (interactive)
-  (let* ((names (persp-names))
-         (pos (cl-position (persp-name persp-curr) names)))
-    (cond
-     ((null pos) (persp-find-some))
-     ((= pos (1- (length names)))
-      (if persp-switch-wrap (persp-switch (nth 0 names))))
-     (t (persp-switch (nth (1+ pos) names))))))
-
-(defun persp-prev ()
-  "Switch to previous perspective (to the left)."
-  (interactive)
-  (let* ((names (persp-names))
-         (pos (cl-position (persp-name persp-curr) names)))
-    (cond
-     ((null pos) (persp-find-some))
-     ((= pos 0)
-      (if persp-switch-wrap (persp-switch (nth (1- (length names)) names))))
-     (t (persp-switch (nth (1- pos) names))))))
-
-(defun persp-find-some ()
-  "Return the name of a valid perspective.
-
-This function tries to return the \"most appropriate\"
-perspective to switch to.  It tries:
-
-  * The perspective given by `persp-last'.
-  * The main perspective.
-  * The first existing perspective, alphabetically.
-
-If none of these perspectives can be found, this function will
-create a new main perspective and return \"main\"."
-  (cond
-   (persp-last (persp-name persp-last))
-   ((gethash persp-initial-frame-name perspectives-hash) persp-initial-frame-name)
-   ((> (hash-table-count perspectives-hash) 0) (car (persp-names)))
-   (t (persp-activate
-       (make-persp :name persp-initial-frame-name :buffers (buffer-list)
-         :window-configuration (current-window-configuration)
-         :point-marker (point-marker)))
-      persp-initial-frame-name)))
-
-(defun persp-add-buffer (buffer)
-  "Associate BUFFER with the current perspective.
-
-See also `persp-switch' and `persp-remove-buffer'."
-  (interactive
-   (list
-    (let ((read-buffer-function nil))
-      (read-buffer "Add buffer to perspective: "))))
-  (let ((buffer (get-buffer buffer)))
-    (unless (memq buffer (persp-buffers persp-curr))
-      (push buffer (persp-buffers persp-curr)))))
-
-(defun persp-set-buffer (buffer-name)
-  "Associate BUFFER-NAME with the current perspective and remove it from any other."
-  (interactive
-   (list
-    (let ((read-buffer-function nil))
-      (read-buffer "Set buffer to perspective: "))))
-  (cond ((get-buffer buffer-name)
-         (persp-add-buffer buffer-name)
-         (cl-loop for other-persp = (persp-buffer-in-other-p (get-buffer buffer-name))
-                  while other-persp
-                  do (with-perspective (cdr other-persp)
-                                       (persp-remove-buffer buffer-name))))
-        (t (message "buffer %s doesn't exist" buffer-name))))
-
-(cl-defun persp-buffer-in-other-p (buffer)
-  "Returns nil if BUFFER is only in the current perspective.
-Otherwise, returns (FRAME . NAME), the frame and name of another
-perspective that has the buffer.
-
-Prefers perspectives in the selected frame."
-  (cl-loop for frame in (sort (frame-list) (lambda (frame1 frame2) (eq frame2 (selected-frame))))
-           do (cl-loop for persp being the hash-values of (with-selected-frame frame perspectives-hash)
-                       if (and (not (and (equal frame (selected-frame))
-                                         (equal (persp-name persp) (persp-name persp-curr))))
-                               (memq buffer (persp-buffers persp)))
-                       do (cl-return-from persp-buffer-in-other-p
-                            (cons frame (persp-name persp)))))
-  nil)
-
-(defun persp-switch-to-buffer (buffer-or-name)
-  "Like `switch-to-buffer', but switches to another perspective if necessary."
-  (interactive
-   (list
-    (let ((read-buffer-function nil))
-      (read-buffer-to-switch "Switch to buffer: "))))
-  (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
-    (if (memq buffer (persp-buffers persp-curr))
-        (switch-to-buffer buffer)
-      (let ((other-persp (persp-buffer-in-other-p buffer)))
-        (when (eq (car-safe other-persp) (selected-frame))
-          (persp-switch (cdr other-persp)))
-        (switch-to-buffer buffer)))))
-
-(defun persp-remove-buffer (buffer)
-  "Disassociate BUFFER with the current perspective.
-
-See also `persp-switch' and `persp-add-buffer'."
-  (interactive "bRemove buffer from perspective: \n")
-  (setq buffer (get-buffer buffer))
-  (cond ((not (buffer-live-p buffer)))
-        ;; Only kill the buffer if no other perspectives are using it
-        ((not (persp-buffer-in-other-p buffer))
-         (kill-buffer buffer))
-        ;; Make the buffer go away if we can see it.
-        ;; TODO: Is it possible to tell if it's visible at all,
-        ;;       rather than just the current buffer?
-        ((eq buffer (current-buffer)) (bury-buffer))
-        (t (bury-buffer buffer)))
-  (setf (persp-buffers persp-curr) (remq buffer (persp-buffers persp-curr))))
-
-(defun persp-kill (name)
-  "Kill the perspective given by NAME.
-
-Killing a perspective means that all buffers associated with that
-perspective and no others are killed."
-  (interactive "i")
-  (if (null name) (setq name (persp-prompt (persp-name persp-curr) t)))
-  (with-perspective name
-    (run-hooks 'persp-killed-hook)
-    (mapc 'persp-remove-buffer (persp-buffers persp-curr))
-    (setf (persp-killed persp-curr) t))
-  (remhash name perspectives-hash)
-  (persp-update-modestring)
-  (when (equal name (persp-name persp-last))
-    (setq persp-last nil))
-  (when (equal name (persp-name persp-curr))
-    ;; Don't let persp-last get set to the deleted persp.
-    (persp-frame-local-let ((persp-last persp-last)) (persp-switch (persp-find-some)))))
-
-(defun persp-rename (name)
-  "Rename the current perspective to NAME."
-  (interactive "sNew name: ")
-  (if (gethash name perspectives-hash)
-      (persp-error "Perspective `%s' already exists" name)
-    (remhash (persp-name persp-curr) perspectives-hash)
-    (puthash name persp-curr perspectives-hash)
-    (setf (persp-name persp-curr) name)
-    (persp-update-modestring)))
-
-(cl-defun persp-all-get (name not-frame)
-  "Returns the list of buffers for a perspective named NAME from any
-frame other than NOT-FRAME.
-
-This doesn't return the window configuration because those can't be
-copied across frames."
-  (dolist (frame (frame-list))
-    (unless (equal frame not-frame)
-      (with-selected-frame frame
-        (let ((persp (gethash name perspectives-hash)))
-          (if persp (cl-return-from persp-all-get (persp-buffers persp))))))))
-
-(defun persp-read-buffer (prompt &optional def require-match)
-  "A replacement for the built-in `read-buffer'.
-Meant to be used with `read-buffer-function'. Return the name of
-the buffer selected, only selecting from buffers within the
-current perspective.
-
-With a prefix arg, uses the old `read-buffer' instead."
-  (persp-protect
-    (let ((read-buffer-function nil))
-      (if current-prefix-arg
-          (read-buffer prompt def require-match)
-        ;; Most of this is taken from `minibuffer-with-setup-hook',
-        ;; slightly modified because it's not a macro.
-        ;; The only functional difference is that the append argument
-        ;; to add-hook is t, so that it'll be run after the hook added
-        ;; by `read-buffer-to-switch'.
-        (let ((rb-completion-table (persp-complete-buffer))
-              (persp-read-buffer-hook))
-          (setq persp-read-buffer-hook
-                (lambda ()
-                  (remove-hook 'minibuffer-setup-hook persp-read-buffer-hook)
-                  (setq minibuffer-completion-table rb-completion-table)))
-          (unwind-protect
-              (progn
-                (add-hook 'minibuffer-setup-hook persp-read-buffer-hook t)
-                (read-buffer prompt def require-match))
-            (remove-hook 'minibuffer-setup-hook persp-read-buffer-hook)))))))
-
-(defun persp-complete-buffer ()
-  "Perform completion on all buffers within the current perspective."
-  (lexical-let ((persp-names (mapcar 'buffer-name (persp-buffers persp-curr))))
-    (apply-partially 'completion-table-with-predicate
-                     (or minibuffer-completion-table 'internal-complete-buffer)
-                     (lambda (name)
-                       (member (if (consp name) (car name) name) persp-names))
-                     nil)))
-
-(cl-defun persp-import (name &optional dont-switch)
-  "Import a perspective named NAME from another frame.  If DONT-SWITCH
-is non-nil or with prefix arg, don't switch to the new perspective."
-  ;; TODO: Have some way of selecting which frame the perspective is imported from.
-  (interactive "i\nP")
-  (unless name
-    (setq name (funcall persp-interactive-completion-function
-                        "Import perspective: " (persp-all-names (selected-frame)) nil t)))
-  (if (and (gethash name perspectives-hash)
-           (not (yes-or-no-p (concat "Perspective `" name "' already exits. Continue? "))))
-      (cl-return-from persp-import))
-  (let ((buffers (persp-all-get name (selected-frame)))
-        persp)
-    (if (null buffers)
-        (persp-error "Perspective `%s' doesn't exist in another frame" name))
-    (setq persp (make-persp :name name :buffers buffers
-                            (switch-to-buffer (cl-loop for buffer in buffers
-                                                       if (buffer-live-p buffer)
-                                                       return buffer))
-                            (delete-other-windows)))
-    (if dont-switch
-        (persp-update-modestring)
-      (persp-activate persp))))
-
-(defadvice switch-to-buffer (after persp-add-buffer-adv)
-  "Add BUFFER to the current perspective.
-
-See also `persp-add-buffer'."
-  (persp-protect
-    (let ((buf (ad-get-arg 0)))
-      (when buf
-        (persp-add-buffer buf)))))
-
-(defadvice display-buffer (after persp-add-buffer-adv)
-  "Add BUFFER to the perspective for the frame on which it's displayed.
-
-See also `persp-add-buffer'."
-  (persp-protect
-    (when ad-return-value
-      (let ((buf (ad-get-arg 0))
-            (frame (window-frame ad-return-value)))
-        (when (and buf frame)
-          (with-selected-frame frame
-            (persp-add-buffer buf)))))))
-
-(defadvice set-window-buffer (after persp-add-buffer-adv)
-  "Add BUFFER to the perspective for window's frame.
-
-See also `persp-add-buffer'."
-  (persp-protect
-    (let ((buf (ad-get-arg 1))
-          (frame (window-frame (ad-get-arg 0))))
-      (when (and buf frame)
-        (with-selected-frame frame
-          (persp-add-buffer buf))))))
-
-(defadvice switch-to-prev-buffer (around persp-ensure-buffer-in-persp)
-  "Ensure that the selected buffer is in WINDOW's perspective."
-  (let* ((window (window-normalize-window window t))
-         (frame (window-frame window))
-         (old-buffer (window-buffer window)))
-    ad-do-it
-
-    (let ((buffer (window-buffer window)))
-      (with-selected-frame frame
-        (unless (memq buffer (persp-buffers persp-curr))
-          ;; If a buffer from outside this perspective was selected, it's because
-          ;; this perspective is out of buffers. For lack of any better option, we
-          ;; recreate the scratch buffer.
-          ;;
-          ;; If we were just in a scratch buffer, change the name slightly.
-          ;; Otherwise our new buffer will get deleted too.
-          (let ((name (concat "*scratch* (" (persp-name persp-curr) ")")))
-            (when (and bury-or-kill (equal name (buffer-name old-buffer)))
-              (setq name (concat "*scratch*  (" (persp-name persp-curr) ")")))
-            (with-selected-window window
-              (switch-to-buffer name)
-              (funcall initial-major-mode))))))))
-
-(defadvice recursive-edit (around persp-preserve-for-recursive-edit)
-  "Preserve the current perspective when entering a recursive edit."
-  (persp-protect
-    (persp-save)
-    (persp-frame-local-let ((persp-recursive persp-curr))
-      (let ((old-hash (copy-hash-table perspectives-hash)))
-        ad-do-it
-        ;; We want the buffer lists that were created in the recursive edit,
-        ;; but not the window configurations
-        (maphash (lambda (key new-persp)
-                   (let ((persp (gethash key old-hash)))
-                     (when persp
-                       (setf (persp-buffers persp) (persp-buffers new-persp)))))
-                 perspectives-hash)
-        (setq perspectives-hash old-hash)))))
-
-(defadvice exit-recursive-edit (before persp-restore-after-recursive-edit)
-  "Restore the old perspective when exiting a recursive edit."
-  (persp-protect
-    (if persp-recursive (persp-switch (persp-name persp-recursive)))))
-
-;;;###autoload
-(define-minor-mode persp-mode
-  "Toggle perspective mode.
-When active, keeps track of multiple 'perspectives',
-named collections of buffers and window configurations."
-  :global t
-  :keymap persp-mode-map
-  (if persp-mode
-      (persp-protect
-        (ad-activate 'switch-to-buffer)
-        (ad-activate 'display-buffer)
-        (ad-activate 'set-window-buffer)
-        (ad-activate 'switch-to-prev-buffer)
-        (ad-activate 'recursive-edit)
-        (ad-activate 'exit-recursive-edit)
-        (add-hook 'after-make-frame-functions 'persp-init-frame)
-        (add-hook 'ido-make-buffer-list-hook 'persp-set-ido-buffers)
-        (setq read-buffer-function 'persp-read-buffer)
-        (mapc 'persp-init-frame (frame-list))
-        (setf (persp-buffers persp-curr) (buffer-list))
-
-        (run-hooks 'persp-mode-hook))
-    (ad-deactivate-regexp "^persp-.*")
-    (remove-hook 'after-make-frame-functions 'persp-init-frame)
-    (remove-hook 'ido-make-buffer-list-hook 'persp-set-ido-buffers)
-    (setq read-buffer-function nil)
-    (setq perspectives-hash nil)
-    (setq global-mode-string (delq 'persp-modestring global-mode-string))))
-
-(defun persp-init-frame (frame)
-  "Initialize the perspectives system in FRAME.
-By default, this uses the current frame."
-  (with-selected-frame frame
-    (modify-frame-parameters
-     frame
-     '((perspectives-hash) (persp-curr) (persp-last) (persp-recursive) (persp-modestring)))
-
-    ;; Don't set these variables in modify-frame-parameters
-    ;; because that won't do anything if they've already been accessed
-    (setq perspectives-hash (make-hash-table :test 'equal :size 10))
-
-    (when persp-show-modestring
-      (if (eq persp-show-modestring 'header)
-          (let ((val (or (default-value 'header-line-format) '(""))))
-            (unless (memq 'persp-modestring val)
-              (set-default 'header-line-format (append val '(persp-modestring)))))
-        (setq global-mode-string (or global-mode-string '("")))
-        (unless (memq 'persp-modestring global-mode-string)
-          (setq global-mode-string (append global-mode-string '(persp-modestring)))))
-      (persp-update-modestring))
-
-    (persp-activate
-     (make-persp :name persp-initial-frame-name :buffers (list (current-buffer))
-       :window-configuration (current-window-configuration)
-       :point-marker (point-marker)))))
-
-(defun persp-make-variable-persp-local (variable)
-  "Make VARIABLE become perspective-local.
-This means that whenever a new perspective is switched into, the
-variable will take on its local value for that perspective.  When
-a new perspective is created, the variable will inherit its value
-from the current perspective at time of creation."
-  (unless (assq variable (persp-local-variables persp-curr))
-    (let ((entry (list variable (symbol-value variable))))
-      (dolist (frame (frame-list))
-        (cl-loop for persp being the hash-values of (with-selected-frame frame perspectives-hash)
-                 do (push entry (persp-local-variables persp)))))))
-
-(defmacro persp-setup-for (name &rest body)
-  "Add code that should be run to set up the perspective named NAME.
-Whenever a new perspective named NAME is created, runs BODY in
-it. In addition, if one exists already, runs BODY in it immediately."
-  (declare (indent 1))
-  `(progn
-     (add-hook 'persp-created-hook
-               (lambda ()
-                 (when (string= (persp-name persp-curr) ,name)
-                   ,@body))
-               'append)
-     (when (gethash ,name perspectives-hash)
-       (with-perspective ,name ,@body))))
-
-(defun persp-set-ido-buffers ()
-  "Restrict the ido buffer to the current perspective."
-  (let ((persp-names
-         (remq nil (mapcar 'buffer-name (persp-buffers persp-curr))))
-        (indices (make-hash-table :test 'equal)))
-    (cl-loop for elt in ido-temp-list
-             for i upfrom 0
-             do (puthash elt i indices))
-    (setq ido-temp-list
-          (sort (intersection persp-names ido-temp-list)
-                (lambda (a b)
-                  (< (gethash a indices)
-                     (gethash b indices)))))))
-
-(defun quick-perspective-keys ()
-  "Bind quick key commands to switch to perspectives.
-All C-S-letter key combinations are bound to switch to the first
-perspective beginning with the given letter."
-  (cl-loop for c from ?a to ?z
-           do (define-key persp-mode-map
-                (read-kbd-macro (concat "C-S-" (string c)))
-                `(lambda ()
-                   (interactive)
-                   (persp-switch-quick ,c)))))
-
-(defun persp-turn-off-modestring ()
-  "Deactivate the perspective modestring."
-  (interactive)
-  (setq persp-modestring nil)
-  (setq persp-show-modestring nil))
-
-(defun persp-turn-on-modestring ()
-  "Activate the perspective modestring."
-  (interactive)
-  (setq persp-show-modestring t)
-  (persp-update-modestring))
-
-(provide 'perspective)
-
-;; Local Variables:
-;; indent-tabs-mode: nil
-;; End:
-;;; perspective.el ends here
.emacs.d/elpa/perspective-20160609.1444/perspective.elc
Binary file
.emacs.d/elpa/pkg-info-20150517.443/pkg-info-autoloads.el
@@ -1,122 +0,0 @@
-;;; pkg-info-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "pkg-info" "pkg-info.el" (22977 30123 659702
-;;;;;;  70000))
-;;; Generated autoloads from pkg-info.el
-
-(autoload 'pkg-info-library-original-version "pkg-info" "\
-Get the original version in the header of LIBRARY.
-
-The original version is stored in the X-Original-Version header.
-This header is added by the MELPA package archive to preserve
-upstream version numbers.
-
-LIBRARY is either a symbol denoting a named feature, or a library
-name as string.
-
-If SHOW is non-nil, show the version in the minibuffer.
-
-Return the version from the header of LIBRARY as list.  Signal an
-error if the LIBRARY was not found or had no X-Original-Version
-header.
-
-See Info node `(elisp)Library Headers' for more information
-about library headers.
-
-\(fn LIBRARY &optional SHOW)" t nil)
-
-(autoload 'pkg-info-library-version "pkg-info" "\
-Get the version in the header of LIBRARY.
-
-LIBRARY is either a symbol denoting a named feature, or a library
-name as string.
-
-If SHOW is non-nil, show the version in the minibuffer.
-
-Return the version from the header of LIBRARY as list.  Signal an
-error if the LIBRARY was not found or had no proper header.
-
-See Info node `(elisp)Library Headers' for more information
-about library headers.
-
-\(fn LIBRARY &optional SHOW)" t nil)
-
-(autoload 'pkg-info-defining-library-original-version "pkg-info" "\
-Get the original version of the library defining FUNCTION.
-
-The original version is stored in the X-Original-Version header.
-This header is added by the MELPA package archive to preserve
-upstream version numbers.
-
-If SHOW is non-nil, show the version in mini-buffer.
-
-This function is mainly intended to find the version of a major
-or minor mode, i.e.
-
-   (pkg-info-defining-library-version 'flycheck-mode)
-
-Return the version of the library defining FUNCTION.  Signal an
-error if FUNCTION is not a valid function, if its defining
-library was not found, or if the library had no proper version
-header.
-
-\(fn FUNCTION &optional SHOW)" t nil)
-
-(autoload 'pkg-info-defining-library-version "pkg-info" "\
-Get the version of the library defining FUNCTION.
-
-If SHOW is non-nil, show the version in mini-buffer.
-
-This function is mainly intended to find the version of a major
-or minor mode, i.e.
-
-   (pkg-info-defining-library-version 'flycheck-mode)
-
-Return the version of the library defining FUNCTION.  Signal an
-error if FUNCTION is not a valid function, if its defining
-library was not found, or if the library had no proper version
-header.
-
-\(fn FUNCTION &optional SHOW)" t nil)
-
-(autoload 'pkg-info-package-version "pkg-info" "\
-Get the version of an installed PACKAGE.
-
-If SHOW is non-nil, show the version in the minibuffer.
-
-Return the version as list, or nil if PACKAGE is not installed.
-
-\(fn PACKAGE &optional SHOW)" t nil)
-
-(autoload 'pkg-info-version-info "pkg-info" "\
-Obtain complete version info for LIBRARY and PACKAGE.
-
-LIBRARY is a symbol denoting a named feature, or a library name
-as string.  PACKAGE is a symbol denoting an ELPA package.  If
-omitted or nil, default to LIBRARY.
-
-If SHOW is non-nil, show the version in the minibuffer.
-
-When called interactively, prompt for LIBRARY.  When called
-interactively with prefix argument, prompt for PACKAGE as well.
-
-Return a string with complete version information for LIBRARY.
-This version information contains the version from the headers of
-LIBRARY, and the version of the installed PACKAGE, the LIBRARY is
-part of.  If PACKAGE is not installed, or if the PACKAGE version
-is the same as the LIBRARY version, do not include a package
-version.
-
-\(fn LIBRARY &optional PACKAGE SHOW)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; pkg-info-autoloads.el ends here
.emacs.d/elpa/pkg-info-20150517.443/pkg-info-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "pkg-info" "20150517.443" "Information about packages" '((epl "0.8")) :commit "76ba7415480687d05a4353b27fea2ae02b8d9d61" :url "https://github.com/lunaryorn/pkg-info.el" :keywords '("convenience"))
.emacs.d/elpa/pkg-info-20150517.443/pkg-info.el
@@ -1,331 +0,0 @@
-;;; pkg-info.el --- Information about packages       -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2013-2015  Sebastian Wiesner <swiesner@lunaryorn.com>
-
-;; Author: Sebastian Wiesner <swiesner@lunaryorn.com>
-;; URL: https://github.com/lunaryorn/pkg-info.el
-;; Package-Version: 20150517.443
-;; Keywords: convenience
-;; Version: 0.7-cvs
-;; Package-Requires: ((epl "0.8"))
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This library extracts information from installed packages.
-
-;;;; Functions:
-
-;; `pkg-info-library-version' extracts the version from the header of a library.
-;;
-;; `pkg-info-defining-library-version' extracts the version from the header of a
-;;  library defining a function.
-;;
-;; `pkg-info-package-version' gets the version of an installed package.
-;;
-;; `pkg-info-format-version' formats a version list as human readable string.
-;;
-;; `pkg-info-version-info' returns complete version information for a specific
-;; package.
-;;
-;; `pkg-info-get-melpa-recipe' gets the MELPA recipe for a package.
-;;
-;; `pkg-info-get-melpa-fetcher' gets the fetcher used to build a package on
-;; MELPA.
-;;
-;; `pkg-info-wiki-package-p' determines whether a package was build from
-;; EmacsWiki on MELPA.
-
-;;; Code:
-
-(require 'epl)
-
-(require 'lisp-mnt)
-(require 'find-func)
-(require 'json)                         ; `json-read'
-(require 'url-http)                     ; `url-http-parse-response'
-
-(defvar url-http-end-of-headers)
-
-
-;;; Version information
-(defun pkg-info-format-version (version)
-  "Format VERSION as human-readable string.
-
-Return a human-readable string representing VERSION."
-  ;; XXX: Find a better, more flexible way of formatting?
-  (package-version-join version))
-
-(defsubst pkg-info--show-version-and-return (version show)
-  "Show and return VERSION.
-
-When SHOW is non-nil, show VERSION in minibuffer.
-
-Return VERSION."
-  (when show
-    (message (if (listp version) (pkg-info-format-version version) version)))
-  version)
-
-(defun pkg-info--read-library ()
-  "Read a library from minibuffer."
-  (completing-read "Load library: "
-                   (apply-partially 'locate-file-completion-table
-                                    load-path
-                                    (get-load-suffixes))))
-
-(defun pkg-info--read-function ()
-  "Read a function name from minibuffer."
-  (let ((input (completing-read "Function: " obarray #'boundp :require-match)))
-    (if (string= input "") nil (intern input))))
-
-(defun pkg-info--read-package ()
-  "Read a package name from minibuffer."
-  (let* ((installed (epl-installed-packages))
-         (names (sort (mapcar (lambda (pkg)
-                                (symbol-name (epl-package-name pkg)))
-                              installed)
-                      #'string<))
-         (default (car names)))
-    (completing-read "Installed package: " names nil 'require-match
-                     nil nil default)))
-
-(defun pkg-info-library-source (library)
-  "Get the source file of LIBRARY.
-
-LIBRARY is either a symbol denoting a named feature, or a library
-name as string.
-
-Return the source file of LIBRARY as string."
-  (find-library-name (if (symbolp library) (symbol-name library) library)))
-
-(defun pkg-info-defining-library (function)
-  "Get the source file of the library defining FUNCTION.
-
-FUNCTION is a function symbol.
-
-Return the file name of the library as string.  Signal an error
-if the library does not exist, or if the definition of FUNCTION
-was not found."
-  (unless (functionp function)
-    (signal 'wrong-type-argument (list 'functionp function)))
-  (let ((library (symbol-file function 'defun)))
-    (unless library
-      (error "Can't find definition of %s" function))
-    library))
-
-(defun pkg-info-x-original-version (file)
-  "Read the X-Original-Version header from FILE.
-
-Return the value as version list, or return nil if FILE lacks
-this header.  Signal an error, if the value of the header is not
-a valid version."
-  (let ((version-str (with-temp-buffer
-                       (insert-file-contents file)
-                       (lm-header "X-Original-Version"))))
-    (when version-str
-      (version-to-list version-str))))
-
-;;;###autoload
-(defun pkg-info-library-original-version (library &optional show)
-  "Get the original version in the header of LIBRARY.
-
-The original version is stored in the X-Original-Version header.
-This header is added by the MELPA package archive to preserve
-upstream version numbers.
-
-LIBRARY is either a symbol denoting a named feature, or a library
-name as string.
-
-If SHOW is non-nil, show the version in the minibuffer.
-
-Return the version from the header of LIBRARY as list.  Signal an
-error if the LIBRARY was not found or had no X-Original-Version
-header.
-
-See Info node `(elisp)Library Headers' for more information
-about library headers."
-  (interactive (list (pkg-info--read-library) t))
-  (let ((version (pkg-info-x-original-version
-                  (pkg-info-library-source library))))
-    (if version
-        (pkg-info--show-version-and-return version show)
-      (error "Library %s has no original version" library))))
-
-;;;###autoload
-(defun pkg-info-library-version (library &optional show)
-  "Get the version in the header of LIBRARY.
-
-LIBRARY is either a symbol denoting a named feature, or a library
-name as string.
-
-If SHOW is non-nil, show the version in the minibuffer.
-
-Return the version from the header of LIBRARY as list.  Signal an
-error if the LIBRARY was not found or had no proper header.
-
-See Info node `(elisp)Library Headers' for more information
-about library headers."
-  (interactive (list (pkg-info--read-library) t))
-  (let* ((source (pkg-info-library-source library))
-         (version (epl-package-version (epl-package-from-file source))))
-    (pkg-info--show-version-and-return version show)))
-
-;;;###autoload
-(defun pkg-info-defining-library-original-version (function &optional show)
-  "Get the original version of the library defining FUNCTION.
-
-The original version is stored in the X-Original-Version header.
-This header is added by the MELPA package archive to preserve
-upstream version numbers.
-
-If SHOW is non-nil, show the version in mini-buffer.
-
-This function is mainly intended to find the version of a major
-or minor mode, i.e.
-
-   (pkg-info-defining-library-version 'flycheck-mode)
-
-Return the version of the library defining FUNCTION.  Signal an
-error if FUNCTION is not a valid function, if its defining
-library was not found, or if the library had no proper version
-header."
-  (interactive (list (pkg-info--read-function) t))
-  (pkg-info-library-original-version (pkg-info-defining-library function) show))
-
-;;;###autoload
-(defun pkg-info-defining-library-version (function &optional show)
-  "Get the version of the library defining FUNCTION.
-
-If SHOW is non-nil, show the version in mini-buffer.
-
-This function is mainly intended to find the version of a major
-or minor mode, i.e.
-
-   (pkg-info-defining-library-version 'flycheck-mode)
-
-Return the version of the library defining FUNCTION.  Signal an
-error if FUNCTION is not a valid function, if its defining
-library was not found, or if the library had no proper version
-header."
-  (interactive (list (pkg-info--read-function) t))
-  (pkg-info-library-version (pkg-info-defining-library function) show))
-
-;;;###autoload
-(defun pkg-info-package-version (package &optional show)
-  "Get the version of an installed PACKAGE.
-
-If SHOW is non-nil, show the version in the minibuffer.
-
-Return the version as list, or nil if PACKAGE is not installed."
-  (interactive (list (pkg-info--read-package) t))
-  (let* ((name (if (stringp package) (intern package) package))
-         (package (car (epl-find-installed-packages name))))
-    (unless package
-      (error "Can't find installed package %s" name))
-    (pkg-info--show-version-and-return (epl-package-version package) show)))
-
-;;;###autoload
-(defun pkg-info-version-info (library &optional package show)
-  "Obtain complete version info for LIBRARY and PACKAGE.
-
-LIBRARY is a symbol denoting a named feature, or a library name
-as string.  PACKAGE is a symbol denoting an ELPA package.  If
-omitted or nil, default to LIBRARY.
-
-If SHOW is non-nil, show the version in the minibuffer.
-
-When called interactively, prompt for LIBRARY.  When called
-interactively with prefix argument, prompt for PACKAGE as well.
-
-Return a string with complete version information for LIBRARY.
-This version information contains the version from the headers of
-LIBRARY, and the version of the installed PACKAGE, the LIBRARY is
-part of.  If PACKAGE is not installed, or if the PACKAGE version
-is the same as the LIBRARY version, do not include a package
-version."
-  (interactive (list (pkg-info--read-library)
-                     (when current-prefix-arg
-                       (pkg-info--read-package))
-                     t))
-  (let* ((package (or package (if (stringp library) (intern library) library)))
-         (orig-version (condition-case nil
-                           (pkg-info-library-original-version library)
-                         (error nil)))
-         ;; If we have X-Original-Version, we assume that MELPA replaced the
-         ;; library version with its generated version, so we use the
-         ;; X-Original-Version header instead, and ignore the library version
-         ;; header
-         (lib-version (or orig-version (pkg-info-library-version library)))
-         (pkg-version (condition-case nil
-                          (pkg-info-package-version package)
-                        (error nil)))
-         (version (if (and pkg-version
-                           (not (version-list-= lib-version pkg-version)))
-                      (format "%s (package: %s)"
-                              (pkg-info-format-version lib-version)
-                              (pkg-info-format-version pkg-version))
-                    (pkg-info-format-version lib-version))))
-    (pkg-info--show-version-and-return version show)))
-
-(defconst pkg-info-melpa-recipe-url "http://melpa.org/recipes.json"
-  "The URL from which to fetch MELPA recipes.")
-
-(defvar pkg-info-melpa-recipes nil
-  "An alist of MELPA recipes.")
-
-(defun pkg-info-retrieve-melpa-recipes ()
-  "Retrieve MELPA recipes from MELPA archive."
-  (let ((buffer (url-retrieve-synchronously pkg-info-melpa-recipe-url)))
-    (with-current-buffer buffer
-      (unwind-protect
-          (let ((response-code (url-http-parse-response)))
-            (unless (equal response-code 200)
-              (error "Failed to retrieve MELPA recipes from %s (code %s)"
-                     pkg-info-melpa-recipe-url response-code))
-            (goto-char url-http-end-of-headers)
-            (json-read))
-        (when (and buffer (buffer-live-p buffer))
-          (kill-buffer buffer))))))
-
-(defun pkg-info-get-melpa-recipes ()
-  "Get MELPA recipes."
-  (setq pkg-info-melpa-recipes
-        (or pkg-info-melpa-recipes
-            (pkg-info-retrieve-melpa-recipes))))
-
-(defun pkg-info-get-melpa-recipe (package)
-  "Get the MELPA recipe for PACKAGE.
-
-Return nil if PACKAGE is not on MELPA."
-  (cdr (assq package (pkg-info-get-melpa-recipes))))
-
-(defun pkg-info-get-melpa-fetcher (package)
-  "Get the MELPA fetcher for PACKAGE."
-  (cdr (assq 'fetcher (pkg-info-get-melpa-recipe package))))
-
-(defun pkg-info-wiki-package-p (package)
-  "Determine whether PACKAGE is build from the EmacsWiki."
-  (equal (pkg-info-get-melpa-fetcher package) "wiki"))
-
-(provide 'pkg-info)
-
-;; Local Variables:
-;; indent-tabs-mode: nil
-;; coding: utf-8
-;; End:
-
-;;; pkg-info.el ends here
.emacs.d/elpa/pkg-info-20150517.443/pkg-info.elc
Binary file
.emacs.d/elpa/projectile-20170917.410/projectile-autoloads.el
@@ -1,514 +0,0 @@
-;;; projectile-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "projectile" "projectile.el" (22977 30125 558683
-;;;;;;  305000))
-;;; Generated autoloads from projectile.el
-
-(autoload 'projectile-version "projectile" "\
-Get the Projectile 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.
-
-\(fn &optional SHOW-VERSION)" t nil)
-
-(autoload 'projectile-invalidate-cache "projectile" "\
-Remove the current project's files from `projectile-projects-cache'.
-
-With a prefix argument ARG prompts for the name of the project whose cache
-to invalidate.
-
-\(fn ARG)" t nil)
-
-(autoload 'projectile-purge-file-from-cache "projectile" "\
-Purge FILE from the cache of the current project.
-
-\(fn FILE)" t nil)
-
-(autoload 'projectile-purge-dir-from-cache "projectile" "\
-Purge DIR from the cache of the current project.
-
-\(fn DIR)" t nil)
-
-(autoload 'projectile-cache-current-file "projectile" "\
-Add the currently visited file to the cache.
-
-\(fn)" t nil)
-
-(autoload 'projectile-discover-projects-in-directory "projectile" "\
-Discover any projects in DIRECTORY and add them to the projectile cache.
-This function is not recursive and only adds projects with roots
-at the top level of DIRECTORY.
-
-\(fn DIRECTORY)" t nil)
-
-(autoload 'projectile-switch-to-buffer "projectile" "\
-Switch to a project buffer.
-
-\(fn)" t nil)
-
-(autoload 'projectile-switch-to-buffer-other-window "projectile" "\
-Switch to a project buffer and show it in another window.
-
-\(fn)" t nil)
-
-(autoload 'projectile-switch-to-buffer-other-frame "projectile" "\
-Switch to a project buffer and show it in another window.
-
-\(fn)" t nil)
-
-(autoload 'projectile-display-buffer "projectile" "\
-Display a project buffer in another window without selecting it.
-
-\(fn)" t nil)
-
-(autoload 'projectile-project-buffers-other-buffer "projectile" "\
-Switch to the most recently selected buffer project buffer.
-Only buffers not visible in windows are returned.
-
-\(fn)" t nil)
-
-(autoload 'projectile-multi-occur "projectile" "\
-Do a `multi-occur' in the project's buffers.
-With a prefix argument, show NLINES of context.
-
-\(fn &optional NLINES)" t nil)
-
-(autoload 'projectile-find-other-file "projectile" "\
-Switch between files with the same name but different extensions.
-With FLEX-MATCHING, match any file that contains the base name of current file.
-Other file extensions can be customized with the variable `projectile-other-file-alist'.
-
-\(fn &optional FLEX-MATCHING)" t nil)
-
-(autoload 'projectile-find-other-file-other-window "projectile" "\
-Switch between files with the same name but different extensions in other window.
-With FLEX-MATCHING, match any file that contains the base name of current file.
-Other file extensions can be customized with the variable `projectile-other-file-alist'.
-
-\(fn &optional FLEX-MATCHING)" t nil)
-
-(autoload 'projectile-find-other-file-other-frame "projectile" "\
-Switch between files with the same name but different extensions in other window.
-With FLEX-MATCHING, match any file that contains the base name of current file.
-Other file extensions can be customized with the variable `projectile-other-file-alist'.
-
-\(fn &optional FLEX-MATCHING)" t nil)
-
-(autoload 'projectile-find-file-dwim "projectile" "\
-Jump to a project's files using completion based on context.
-
-With a prefix ARG invalidates the cache first.
-
-If point is on a filename, Projectile first tries to search for that
-file in project:
-
-- If it finds just a file, it switches to that file instantly.  This works even
-if the filename is incomplete, but there's only a single file in the current project
-that matches the filename at point.  For example, if there's only a single file named
-\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete),
-`projectile-find-file-dwim' still switches to \"projectile/projectile.el\" immediately
- because this is the only filename that matches.
-
-- If it finds a list of files, the list is displayed for selecting.  A list of
-files is displayed when a filename appears more than one in the project or the
-filename at point is a prefix of more than two files in a project.  For example,
-if `projectile-find-file-dwim' is executed on a filepath like \"projectile/\", it lists
-the content of that directory.  If it is executed on a partial filename like
- \"projectile/a\", a list of files with character 'a' in that directory is presented.
-
-- If it finds nothing, display a list of all files in project for selecting.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-find-file-dwim-other-window "projectile" "\
-Jump to a project's files using completion based on context in other window.
-
-With a prefix ARG invalidates the cache first.
-
-If point is on a filename, Projectile first tries to search for that
-file in project:
-
-- If it finds just a file, it switches to that file instantly.  This works even
-if the filename is incomplete, but there's only a single file in the current project
-that matches the filename at point.  For example, if there's only a single file named
-\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete),
-`projectile-find-file-dwim-other-window' still switches to \"projectile/projectile.el\"
-immediately because this is the only filename that matches.
-
-- If it finds a list of files, the list is displayed for selecting.  A list of
-files is displayed when a filename appears more than one in the project or the
-filename at point is a prefix of more than two files in a project.  For example,
-if `projectile-find-file-dwim-other-window' is executed on a filepath like \"projectile/\", it lists
-the content of that directory.  If it is executed on a partial filename
-like \"projectile/a\", a list of files with character 'a' in that directory
-is presented.
-
-- If it finds nothing, display a list of all files in project for selecting.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-find-file-dwim-other-frame "projectile" "\
-Jump to a project's files using completion based on context in other frame.
-
-With a prefix ARG invalidates the cache first.
-
-If point is on a filename, Projectile first tries to search for that
-file in project:
-
-- If it finds just a file, it switches to that file instantly.  This works even
-if the filename is incomplete, but there's only a single file in the current project
-that matches the filename at point.  For example, if there's only a single file named
-\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete),
-`projectile-find-file-dwim-other-frame' still switches to \"projectile/projectile.el\"
-immediately because this is the only filename that matches.
-
-- If it finds a list of files, the list is displayed for selecting.  A list of
-files is displayed when a filename appears more than one in the project or the
-filename at point is a prefix of more than two files in a project.  For example,
-if `projectile-find-file-dwim-other-frame' is executed on a filepath like \"projectile/\", it lists
-the content of that directory.  If it is executed on a partial filename
-like \"projectile/a\", a list of files with character 'a' in that directory
-is presented.
-
-- If it finds nothing, display a list of all files in project for selecting.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-find-file "projectile" "\
-Jump to a project's file using completion.
-With a prefix ARG invalidates the cache first.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-find-file-other-window "projectile" "\
-Jump to a project's file using completion and show it in another window.
-
-With a prefix ARG invalidates the cache first.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-find-file-other-frame "projectile" "\
-Jump to a project's file using completion and show it in another frame.
-
-With a prefix ARG invalidates the cache first.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-find-dir "projectile" "\
-Jump to a project's directory using completion.
-
-With a prefix ARG invalidates the cache first.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-find-dir-other-window "projectile" "\
-Jump to a project's directory in other window using completion.
-
-With a prefix ARG invalidates the cache first.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-find-dir-other-frame "projectile" "\
-Jump to a project's directory in other window using completion.
-
-With a prefix ARG invalidates the cache first.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-find-test-file "projectile" "\
-Jump to a project's test file using completion.
-
-With a prefix ARG invalidates the cache first.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-project-info "projectile" "\
-Display info for current project.
-
-\(fn)" t nil)
-
-(autoload 'projectile-find-implementation-or-test-other-window "projectile" "\
-Open matching implementation or test file in other window.
-
-\(fn)" t nil)
-
-(autoload 'projectile-find-implementation-or-test-other-frame "projectile" "\
-Open matching implementation or test file in other frame.
-
-\(fn)" t nil)
-
-(autoload 'projectile-toggle-between-implementation-and-test "projectile" "\
-Toggle between an implementation file and its test file.
-
-\(fn)" t nil)
-
-(autoload 'projectile-grep "projectile" "\
-Perform rgrep in the project.
-
-With a prefix ARG asks for files (globbing-aware) which to grep in.
-With prefix ARG of `-' (such as `M--'), default the files (without prompt),
-to `projectile-grep-default-files'.
-
-With REGEXP given, don't query the user for a regexp.
-
-\(fn &optional REGEXP ARG)" t nil)
-
-(autoload 'projectile-ag "projectile" "\
-Run an ag search with SEARCH-TERM in the project.
-
-With an optional prefix argument ARG SEARCH-TERM is interpreted as a
-regular expression.
-
-\(fn SEARCH-TERM &optional ARG)" t nil)
-
-(autoload 'projectile-regenerate-tags "projectile" "\
-Regenerate the project's [e|g]tags.
-
-\(fn)" t nil)
-
-(autoload 'projectile-find-tag "projectile" "\
-Find tag in project.
-
-\(fn)" t nil)
-
-(autoload 'projectile-run-command-in-root "projectile" "\
-Invoke `execute-extended-command' in the project's root.
-
-\(fn)" t nil)
-
-(autoload 'projectile-run-shell-command-in-root "projectile" "\
-Invoke `shell-command' in the project's root.
-
-\(fn)" t nil)
-
-(autoload 'projectile-run-async-shell-command-in-root "projectile" "\
-Invoke `async-shell-command' in the project's root.
-
-\(fn)" t nil)
-
-(autoload 'projectile-run-shell "projectile" "\
-Invoke `shell' in the project's root.
-
-\(fn)" t nil)
-
-(autoload 'projectile-run-eshell "projectile" "\
-Invoke `eshell' in the project's root.
-
-\(fn)" t nil)
-
-(autoload 'projectile-run-term "projectile" "\
-Invoke `term' in the project's root.
-
-\(fn PROGRAM)" t nil)
-
-(autoload 'projectile-replace "projectile" "\
-Replace literal string in project using non-regexp `tags-query-replace'.
-
-With a prefix argument ARG prompts you for a directory on which
-to run the replacement.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-replace-regexp "projectile" "\
-Replace a regexp in the project using `tags-query-replace'.
-
-With a prefix argument ARG prompts you for a directory on which
-to run the replacement.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-kill-buffers "projectile" "\
-Kill all project buffers.
-
-\(fn)" t nil)
-
-(autoload 'projectile-save-project-buffers "projectile" "\
-Save all project buffers.
-
-\(fn)" t nil)
-
-(autoload 'projectile-dired "projectile" "\
-Open `dired' at the root of the project.
-
-\(fn)" t nil)
-
-(autoload 'projectile-dired-other-window "projectile" "\
-Open `dired'  at the root of the project in another window.
-
-\(fn)" t nil)
-
-(autoload 'projectile-dired-other-frame "projectile" "\
-Open `dired' at the root of the project in another frame.
-
-\(fn)" t nil)
-
-(autoload 'projectile-vc "projectile" "\
-Open `vc-dir' at the root of the project.
-
-For git projects `magit-status-internal' is used if available.
-For hg projects `monky-status' is used if available.
-
-\(fn &optional PROJECT-ROOT)" t nil)
-
-(autoload 'projectile-recentf "projectile" "\
-Show a list of recently visited files in a project.
-
-\(fn)" t nil)
-
-(autoload 'projectile-compile-project "projectile" "\
-Run project compilation command.
-
-Normally you'll be prompted for a compilation command, unless
-variable `compilation-read-command'.  You can force the prompt
-with a prefix ARG.
-
-\(fn ARG &optional DIR)" t nil)
-
-(autoload 'projectile-test-project "projectile" "\
-Run project test command.
-
-Normally you'll be prompted for a compilation command, unless
-variable `compilation-read-command'.  You can force the prompt
-with a prefix ARG.
-
-\(fn ARG)" t nil)
-
-(autoload 'projectile-run-project "projectile" "\
-Run project run command.
-
-Normally you'll be prompted for a compilation command, unless
-variable `compilation-read-command'.  You can force the prompt
-with a prefix ARG.
-
-\(fn ARG)" t nil)
-
-(autoload 'projectile-switch-project "projectile" "\
-Switch to a project we have visited before.
-Invokes the command referenced by `projectile-switch-project-action' on switch.
-With a prefix ARG invokes `projectile-commander' instead of
-`projectile-switch-project-action.'
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-switch-open-project "projectile" "\
-Switch to a project we have currently opened.
-Invokes the command referenced by `projectile-switch-project-action' on switch.
-With a prefix ARG invokes `projectile-commander' instead of
-`projectile-switch-project-action.'
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'projectile-find-file-in-directory "projectile" "\
-Jump to a file in a (maybe regular) DIRECTORY.
-
-This command will first prompt for the directory the file is in.
-
-\(fn &optional DIRECTORY)" t nil)
-
-(autoload 'projectile-find-file-in-known-projects "projectile" "\
-Jump to a file in any of the known projects.
-
-\(fn)" t nil)
-
-(autoload 'projectile-cleanup-known-projects "projectile" "\
-Remove known projects that don't exist anymore.
-
-\(fn)" t nil)
-
-(autoload 'projectile-clear-known-projects "projectile" "\
-Clear both `projectile-known-projects' and `projectile-known-projects-file'.
-
-\(fn)" t nil)
-
-(autoload 'projectile-remove-known-project "projectile" "\
-Remove PROJECT from the list of known projects.
-
-\(fn &optional PROJECT)" t nil)
-
-(autoload 'projectile-remove-current-project-from-known-projects "projectile" "\
-Remove the current project from the list of known projects.
-
-\(fn)" t nil)
-
-(autoload 'projectile-ibuffer "projectile" "\
-Open an IBuffer window showing all buffers in the current project.
-
-Let user choose another project when PREFIX is supplied.
-
-\(fn PREFIX)" t nil)
-
-(autoload 'projectile-commander "projectile" "\
-Execute a Projectile command with a single letter.
-The user is prompted for a single character indicating the action to invoke.
-The `?' character describes then
-available actions.
-
-See `def-projectile-commander-method' for defining new methods.
-
-\(fn)" t nil)
-
-(autoload 'projectile-edit-dir-locals "projectile" "\
-Edit or create a .dir-locals.el file of the project.
-
-\(fn)" t nil)
-
-(defvar projectile-mode-line '(:eval (format " Projectile[%s]" (projectile-project-name))) "\
-Mode line lighter for Projectile.
-
-The value of this variable is a mode line template as in
-`mode-line-format'.  See Info Node `(elisp)Mode Line Format' for
-details about mode line templates.
-
-Customize this variable to change how Projectile displays its
-status in the mode line.  The default value displays the project
-name.  Set this variable to nil to disable the mode line
-entirely.")
-
-(custom-autoload 'projectile-mode-line "projectile" t)
-
-(defvar projectile-mode nil "\
-Non-nil if Projectile mode is enabled.
-See the `projectile-mode' command
-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 `projectile-mode'.")
-
-(custom-autoload 'projectile-mode "projectile" nil)
-
-(autoload 'projectile-mode "projectile" "\
-Minor mode to assist project management and navigation.
-
-When called interactively, toggle `projectile-mode'.  With prefix
-ARG, enable `projectile-mode' if ARG is positive, otherwise disable
-it.
-
-When called from Lisp, enable `projectile-mode' if ARG is omitted,
-nil or positive.  If ARG is `toggle', toggle `projectile-mode'.
-Otherwise behave as if called interactively.
-
-\\{projectile-mode-map}
-
-\(fn &optional ARG)" t nil)
-
-(define-obsolete-function-alias 'projectile-global-mode 'projectile-mode)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; projectile-autoloads.el ends here
.emacs.d/elpa/projectile-20170917.410/projectile-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "projectile" "20170917.410" "Manage and navigate projects in Emacs easily" '((emacs "24.1") (pkg-info "0.4")) :commit "e4bbeef993a1642c6ef197e0f76f11faced5f133" :url "https://github.com/bbatsov/projectile" :keywords '("project" "convenience"))
.emacs.d/elpa/projectile-20170917.410/projectile.el
@@ -1,3860 +0,0 @@
-;;; projectile.el --- Manage and navigate projects in Emacs easily -*- lexical-binding: t -*-
-
-;; Copyright © 2011-2017 Bozhidar Batsov <bozhidar@batsov.com>
-
-;; Author: Bozhidar Batsov <bozhidar@batsov.com>
-;; URL: https://github.com/bbatsov/projectile
-;; Package-Version: 20170917.410
-;; Keywords: project, convenience
-;; Version: 0.15.0-cvs
-;; Package-Requires: ((emacs "24.1") (pkg-info "0.4"))
-
-;; 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, 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., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-;;
-;; This library provides easy project management and navigation.  The
-;; concept of a project is pretty basic - just a folder containing
-;; special file.  Currently git, mercurial and bazaar repos are
-;; considered projects by default.  If you want to mark a folder
-;; manually as a project just create an empty .projectile file in
-;; it.  See the README for more details.
-;;
-;;; Code:
-
-(require 'cl-lib)
-(require 'thingatpt)
-(require 'ibuffer)
-(require 'ibuf-ext)
-(require 'compile)
-(require 'grep)
-
-(eval-when-compile
-  (defvar ag-ignore-list)
-  (defvar ggtags-completion-table)
-  (defvar tags-completion-table)
-  (defvar tags-loop-scan)
-  (defvar tags-loop-operate)
-  (defvar eshell-buffer-name)
-  (defvar explicit-shell-file-name))
-
-(declare-function ggtags-ensure-project "ggtags")
-(declare-function ggtags-update-tags "ggtags")
-(declare-function pkg-info-version-info "pkg-info")
-(declare-function tags-completion-table "etags")
-(declare-function make-term "term")
-(declare-function term-mode "term")
-(declare-function term-char-mode "term")
-
-(defvar grep-files-aliases)
-(defvar grep-find-ignored-directories)
-(defvar grep-find-ignored-files)
-
-;;;; Compatibility
-(eval-and-compile
-  ;; Added in Emacs 24.3.
-  (unless (fboundp 'defvar-local)
-    (defmacro defvar-local (var val &optional docstring)
-      "Define VAR as a buffer-local variable with default value VAL.
-Like `defvar' but additionally marks the variable as being automatically
-buffer-local wherever it is set."
-      (declare (debug defvar) (doc-string 3))
-      `(progn
-         (defvar ,var ,val ,docstring)
-         (make-variable-buffer-local ',var))))
-
-  ;; Added in Emacs 24.4
-  (unless (fboundp 'string-suffix-p)
-    (defun string-suffix-p (suffix string &optional ignore-case)
-      "Return non-nil if SUFFIX is a suffix of STRING.
-If IGNORE-CASE is non-nil, the comparison is done without paying
-attention to case differences."
-      (let ((start-pos (- (length string) (length suffix))))
-        (and (>= start-pos 0)
-             (eq t (compare-strings suffix nil nil
-                                    string start-pos nil ignore-case))))))
-
-  ;; Improved (no more stack overflows) in Emacs 24.5
-  (eval-after-load 'etags
-    '(when (< emacs-major-version 25)
-       (defvar etags--table-line-limit 500)
-       (defun etags-tags-completion-table ()
-         (let ((table (make-vector 511 0))
-               (progress-reporter
-                (make-progress-reporter
-                 (format "Making tags completion table for %s..." buffer-file-name)
-                 (point-min) (point-max))))
-           (save-excursion
-             (goto-char (point-min))
-             (while (not (eobp))
-               (if (not (re-search-forward
-                         "[\f\t\n\r()=,; ]?\177\\\(?:\\([^\n\001]+\\)\001\\)?"
-                         (+ (point) etags--table-line-limit) t))
-                   (forward-line 1)
-                 (intern (prog1 (if (match-beginning 1)
-                                    (buffer-substring (match-beginning 1) (match-end 1))
-                                  (goto-char (match-beginning 0))
-                                  (skip-chars-backward "^\f\t\n\r()=,; ")
-                                  (prog1
-                                      (buffer-substring (point) (match-beginning 0))
-                                    (goto-char (match-end 0))))
-                           (progress-reporter-update progress-reporter (point)))
-                         table))))
-           table)))))
-
-(defun projectile-trim-string (string)
-  "Remove whitespace at the beginning and end of STRING."
-  (replace-regexp-in-string
-   "[ 	\n\r]+\\'"
-   ""
-   (replace-regexp-in-string
-    "\\`[ 	\n\r]+"
-    ""
-    string)))
-
-
-;;; Customization
-(defgroup projectile nil
-  "Manage and navigate projects easily."
-  :group 'tools
-  :group 'convenience
-  :link '(url-link :tag "Github" "https://github.com/bbatsov/projectile")
-  :link '(url-link :tag "Online Manual" "https://projectile.readthedocs.org")
-  :link '(emacs-commentary-link :tag "Commentary" "projectile"))
-
-(defcustom projectile-indexing-method (if (eq system-type 'windows-nt) 'native 'alien)
-  "Specifies the indexing method used by Projectile.
-
-There are two indexing methods - native and alien.
-
-The native method is implemented in Emacs Lisp (therefore it is
-native to Emacs).  Its advantage is that it is portable and will
-work everywhere that Emacs does.  Its disadvantage is that it is a
-bit slow (especially for large projects).  Generally it's a good
-idea to pair the native indexing method with caching.
-
-The alien indexing method uses external tools (e.g. git, find,
-etc) to speed up the indexing process.  The disadvantage of this
-method is that it's not well supported on Windows systems.
-
-By default alien indexing is the default on all operating
-systems, except Windows."
-  :group 'projectile
-  :type '(radio
-          (const :tag "Native" native)
-          (const :tag "Alien" alien)))
-
-(defcustom projectile-enable-caching (eq projectile-indexing-method 'native)
-  "When t enables project files caching.
-
-Project caching is automatically enabled by default if you're
-using the native indexing method."
-  :group 'projectile
-  :type 'boolean)
-
-(defcustom projectile-file-exists-local-cache-expire nil
-  "Number of seconds before file existence cache expires for a
-file on a local file system.
-
- A value of nil disables this cache."
-
-  :group 'projectile
-  :type '(choice (const :tag "Disabled" nil)
-                 (integer :tag "Seconds")))
-
-(defcustom projectile-file-exists-remote-cache-expire (* 5 60)
-  "Number of seconds before file existence cache expires for a
-file on a remote file system such as tramp.
-
- A value of nil disables this cache."
-  :group 'projectile
-  :type '(choice (const :tag "Disabled" nil)
-                 (integer :tag "Seconds")))
-
-(defcustom projectile-require-project-root t
-  "Require the presence of a project root to operate when true.
-Otherwise consider the current directory the project root."
-  :group 'projectile
-  :type 'boolean)
-
-(defcustom projectile-completion-system 'ido
-  "The completion system to be used by Projectile."
-  :group 'projectile
-  :type '(radio
-          (const :tag "Ido" ido)
-          (const :tag "Grizzl" grizzl)
-          (const :tag "Helm" helm)
-          (const :tag "Ivy" ivy)
-          (const :tag "Default" default)
-          (function :tag "Custom function")))
-
-(defcustom projectile-keymap-prefix (kbd "C-c p")
-  "Projectile keymap prefix."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-cache-file
-  (expand-file-name "projectile.cache" user-emacs-directory)
-  "The name of Projectile's cache file."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-build-dir "build"
-  "The directory Projectile will use for build systems that build out of tree."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-tags-file-name "TAGS"
-  "The tags filename Projectile's going to use."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-tags-command "ctags -Re -f \"%s\" %s"
-  "The command Projectile's going to use to generate a TAGS file."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-tags-backend 'auto
-  "The tag backend that Projectile should use.
-
-If set to 'auto', `projectile-find-tag' will automatically choose
-which backend to use.  Preference order is ggtags -> xref
--> etags-select -> `find-tag'.  Variable can also be set to specify which
-backend to use.  If selected backend is unavailable, fall back to
-`find-tag'.
-
-If this variable is set to 'auto' and ggtags is available, or if
-set to 'ggtags', then ggtags will be used for
-`projectile-regenerate-tags'.  For all other settings
-`projectile-tags-command' will be used."
-  :group 'projectile
-  :type '(radio
-          (const :tag "auto" auto)
-          (const :tag "xref" xref)
-          (const :tag "ggtags" ggtags)
-          (const :tag "etags" etags-select)
-          (const :tag "standard" find-tag))
-  :package-version '(projectile . "0.14.0"))
-
-(defcustom projectile-sort-order 'default
-  "The sort order used for a project's files."
-  :group 'projectile
-  :type '(radio
-          (const :tag "default" default)
-          (const :tag "recentf" recentf)
-          (const :tag "recently active" recently-active)
-          (const :tag "access time" access-time)
-          (const :tag "modification time" modification-time)))
-
-(defcustom projectile-verbose t
-  "Echo messages that are not errors."
-  :group 'projectile
-  :type 'boolean)
-
-(defcustom projectile-buffers-filter-function nil
-  "A function used to filter the buffers in `projectile-project-buffers'.
-
-The function should accept and return a list of Emacs buffers.
-Two example filter functions are shipped by default -
-`projectile-buffers-with-file' and
-`projectile-buffers-with-file-or-process'."
-  :group 'projectile
-  :type 'function)
-
-(defcustom projectile-project-name nil
-  "If this value is non-nil, it will be used as project name.
-
-It has precedence over function `projectile-project-name-function'."
-  :group 'projectile
-  :type 'string
-  :package-version '(projectile . "0.14.0"))
-
-(defcustom projectile-project-name-function 'projectile-default-project-name
-  "A function that receives the project-root and returns the project name.
-
-If variable `projectile-project-name' is non-nil, this function will not be used."
-  :group 'projectile
-  :type 'function
-  :package-version '(projectile . "0.14.0"))
-
-(defcustom projectile-project-root-files
-  '("rebar.config"       ; Rebar project file
-    "project.clj"        ; Leiningen project file
-    "build.boot"         ; Boot-clj project file
-    "SConstruct"         ; Scons project file
-    "pom.xml"            ; Maven project file
-    "build.sbt"          ; SBT project file
-    "gradlew"            ; Gradle wrapper script
-    "build.gradle"       ; Gradle project file
-    ".ensime"            ; Ensime configuration file
-    "Gemfile"            ; Bundler file
-    "requirements.txt"   ; Pip file
-    "setup.py"           ; Setuptools file
-    "tox.ini"            ; Tox file
-    "composer.json"      ; Composer project file
-    "Cargo.toml"         ; Cargo project file
-    "mix.exs"            ; Elixir mix project file
-    "stack.yaml"         ; Haskell's stack tool based project
-    "info.rkt"           ; Racket package description file
-    "DESCRIPTION"        ; R package description file
-    "TAGS"               ; etags/ctags are usually in the root of project
-    "GTAGS"              ; GNU Global tags
-    )
-  "A list of files considered to mark the root of a project.
-The topmost match has precedence."
-  :group 'projectile
-  :type '(repeat string))
-
-(defcustom projectile-project-root-files-bottom-up
-  '(".projectile" ; projectile project marker
-    ".git"        ; Git VCS root dir
-    ".hg"         ; Mercurial VCS root dir
-    ".fslckout"   ; Fossil VCS root dir
-    "_FOSSIL_"    ; Fossil VCS root DB on Windows
-    ".bzr"        ; Bazaar VCS root dir
-    "_darcs"      ; Darcs VCS root dir
-    )
-  "A list of files considered to mark the root of a project.
-The bottommost (parentmost) match has precedence."
-  :group 'projectile
-  :type '(repeat string))
-
-(defcustom projectile-project-root-files-top-down-recurring
-  '(".svn" ; Svn VCS root dir
-    "CVS"  ; Csv VCS root dir
-    "Makefile")
-  "A list of files considered to mark the root of a project.
-The search starts at the top and descends down till a directory
-that contains a match file but its parent does not.  Thus, it's a
-bottommost match in the topmost sequence of directories
-containing a root file."
-  :group 'projectile
-  :type '(repeat string))
-
-(defcustom projectile-project-root-files-functions
-  '(projectile-root-local
-    projectile-root-bottom-up
-    projectile-root-top-down
-    projectile-root-top-down-recurring)
-  "A list of functions for finding project roots."
-  :group 'projectile
-  :type '(repeat function))
-
-(defcustom projectile-globally-ignored-files
-  (list projectile-tags-file-name)
-  "A list of files globally ignored by projectile."
-  :group 'projectile
-  :type '(repeat string))
-
-(defcustom projectile-globally-unignored-files nil
-  "A list of files globally unignored by projectile."
-  :group 'projectile
-  :type '(repeat string)
-  :package-version '(projectile . "0.14.0"))
-
-(defcustom projectile-globally-ignored-file-suffixes
-  nil
-  "A list of file suffixes globally ignored by projectile."
-  :group 'projectile
-  :type '(repeat string))
-
-(defcustom projectile-globally-ignored-directories
-  '(".idea"
-    ".ensime_cache"
-    ".eunit"
-    ".git"
-    ".hg"
-    ".fslckout"
-    "_FOSSIL_"
-    ".bzr"
-    "_darcs"
-    ".tox"
-    ".svn"
-    ".stack-work")
-  "A list of directories globally ignored by projectile."
-  :safe (lambda (x) (not (remq t (mapcar #'stringp x))))
-  :group 'projectile
-  :type '(repeat string))
-
-(defcustom projectile-globally-unignored-directories nil
-  "A list of directories globally unignored by projectile."
-  :group 'projectile
-  :type '(repeat string)
-  :package-version '(projectile . "0.14.0"))
-
-(defcustom projectile-globally-ignored-modes
-  '("erc-mode"
-    "help-mode"
-    "completion-list-mode"
-    "Buffer-menu-mode"
-    "gnus-.*-mode"
-    "occur-mode")
-  "A list of regular expressions for major modes ignored by projectile.
-
-If a buffer is using a given major mode, projectile will ignore
-it for functions working with buffers."
-  :group 'projectile
-  :type '(repeat string))
-
-(defcustom projectile-globally-ignored-buffers nil
-  "A list of buffer-names ignored by projectile.
-
-If a buffer is in the list projectile will ignore
-it for functions working with buffers."
-  :group 'projectile
-  :type '(repeat string)
-  :package-version '(projectile . "0.12.0"))
-
-(defcustom projectile-find-file-hook nil
-  "Hooks run when a file is opened with `projectile-find-file'."
-  :group 'projectile
-  :type 'hook)
-
-(defcustom projectile-find-dir-hook nil
-  "Hooks run when a directory is opened with `projectile-find-dir'."
-  :group 'projectile
-  :type 'hook)
-
-(defcustom projectile-switch-project-action 'projectile-find-file
-  "Action invoked after switching projects with `projectile-switch-project'.
-
-Any function that does not take arguments will do."
-  :group 'projectile
-  :type 'function)
-
-(defcustom projectile-find-dir-includes-top-level nil
-  "If true, add top-level dir to options offered by `projectile-find-dir'."
-  :group 'projectile
-  :type 'boolean)
-
-(defcustom projectile-use-git-grep nil
-  "If true, use `vc-git-grep' in git projects."
-  :group 'projectile
-  :type 'boolean)
-
-(defcustom projectile-grep-finished-hook nil
-  "Hooks run when `projectile-grep' finishes."
-  :group 'projectile
-  :type 'hook
-  :package-version '(projectile . "0.14.0"))
-
-(defcustom projectile-test-prefix-function 'projectile-test-prefix
-  "Function to find test files prefix based on PROJECT-TYPE."
-  :group 'projectile
-  :type 'function)
-
-(defcustom projectile-test-suffix-function 'projectile-test-suffix
-  "Function to find test files suffix based on PROJECT-TYPE."
-  :group 'projectile
-  :type 'function)
-
-
-;;; Idle Timer
-(defvar projectile-idle-timer nil
-  "The timer object created when `projectile-enable-idle-timer' is non-nil.")
-
-(defcustom projectile-idle-timer-seconds 30
-  "The idle period to use when `projectile-enable-idle-timer' is non-nil."
-  :group 'projectile
-  :type 'number)
-
-(defcustom projectile-idle-timer-hook '(projectile-regenerate-tags)
-  "The hook run when `projectile-enable-idle-timer' is non-nil."
-  :group 'projectile
-  :type '(repeat symbol))
-
-(defcustom projectile-enable-idle-timer nil
-  "Enables idle timer hook `projectile-idle-timer-functions'.
-
-When `projectile-enable-idle-timer' is non-nil, the hook
-`projectile-idle-timer-hook' is run each time Emacs has been idle
-for `projectile-idle-timer-seconds' seconds and we're in a
-project."
-  :group 'projectile
-  :set (lambda (symbol value)
-         (set symbol value)
-         (when projectile-idle-timer
-           (cancel-timer projectile-idle-timer))
-         (setq projectile-idle-timer nil)
-         (when projectile-enable-idle-timer
-           (setq projectile-idle-timer (run-with-idle-timer
-                                        projectile-idle-timer-seconds t
-                                        (lambda ()
-                                          (when (projectile-project-p)
-                                            (run-hooks 'projectile-idle-timer-hook)))))))
-  :type 'boolean)
-
-;;; Serialization
-(defun projectile-serialize (data filename)
-  "Serialize DATA to FILENAME.
-
-The saved data can be restored with `projectile-unserialize'."
-  (when (file-writable-p filename)
-    (with-temp-file filename
-      (insert (let (print-length) (prin1-to-string data))))))
-
-(defun projectile-unserialize (filename)
-  "Read data serialized by `projectile-serialize' from FILENAME."
-  (with-demoted-errors
-      "Error during file deserialization: %S"
-    (when (file-exists-p filename)
-      (with-temp-buffer
-        (insert-file-contents filename)
-        ;; this will blow up if the contents of the file aren't
-        ;; lisp data structures
-        (read (buffer-string))))))
-
-(defvar projectile-projects-cache nil
-  "A hashmap used to cache project file names to speed up related operations.")
-
-(defvar projectile-project-root-cache (make-hash-table :test 'equal)
-  "Cached value of function `projectile-project-root`.")
-
-(defvar projectile-project-type-cache (make-hash-table :test 'equal)
-  "A hashmap used to cache project type to speed up related operations.")
-
-(defvar projectile-known-projects nil
-  "List of locations where we have previously seen projects.
-The list of projects is ordered by the time they have been accessed.
-
-See also `projectile-remove-known-project',
-`projectile-cleanup-known-projects' and `projectile-clear-known-projects'.")
-
-(defvar projectile-known-projects-on-file nil
-  "List of known projects reference point.
-
-Contains a copy of `projectile-known-projects' when it was last
-synchronized with `projectile-known-projects-file'.")
-
-(defcustom projectile-known-projects-file
-  (expand-file-name "projectile-bookmarks.eld"
-                    user-emacs-directory)
-  "Name and location of the Projectile's known projects file."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-ignored-projects nil
-  "A list of projects not to be added to `projectile-known-projects'."
-  :group 'projectile
-  :type '(repeat :tag "Project list" directory)
-  :package-version '(projectile . "0.11.0"))
-
-(defcustom projectile-ignored-project-function nil
-  "Function to decide if a project is added to `projectile-known-projects'.
-
-Can be either nil, or a function that takes the truename of the
-project root as argument and returns non-nil if the project is to
-be ignored or nil otherwise.
-
-This function is only called if the project is not listed in
-`projectile-ignored-projects'.
-
-A suitable candidate would be `file-remote-p' to ignore remote
-projects."
-  :group 'projectile
-  :type '(choice
-          (const :tag "Nothing" nil)
-          (const :tag "Remote files" file-remote-p)
-          function)
-  :package-version '(projectile . "0.13.0"))
-
-(defcustom projectile-track-known-projects-automatically t
-  "Controls whether Projectile will automatically register known projects.
-
-When set to nil you'll have always add projects explicitly with
-`projectile-add-known-project'."
-  :group 'projectile
-  :type 'boolean
-  :package-version '(projectile . "0.15.0"))
-
-
-;;; Version information
-
-;;;###autoload
-(defun projectile-version (&optional show-version)
-  "Get the Projectile 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))
-  (if (require 'pkg-info nil t)
-      (let ((version (pkg-info-version-info 'projectile)))
-        (when show-version
-          (message "Projectile %s" version))
-        version)
-    (error "Cannot determine version without package pkg-info")))
-
-
-;;; Caching
-(defvar projectile-file-exists-cache
-  (make-hash-table :test 'equal)
-  "Cached `projectile-file-exists-p' results.")
-
-(defvar projectile-file-exists-cache-timer nil
-  "Timer for scheduling`projectile-file-exists-cache-cleanup'.")
-
-(defun projectile-file-exists-cache-cleanup ()
-  "Removed timed out cache entries and reschedules or remove the
-timer if no more items are in the cache."
-  (let ((now (current-time)))
-    (maphash (lambda (key value)
-               (if (time-less-p (cdr value) now)
-                   (remhash key projectile-file-exists-cache)))
-             projectile-file-exists-cache)
-    (setq projectile-file-exists-cache-timer
-          (if (> (hash-table-count projectile-file-exists-cache) 0)
-              (run-with-timer 10 nil 'projectile-file-exists-cache-cleanup)))))
-
-(defun projectile-file-exists-p (filename)
-  "Return t if file FILENAME exist.
-A wrapper around `file-exists-p' with additional caching support."
-  (let* ((file-remote (file-remote-p filename))
-         (expire-seconds
-          (if file-remote
-              (and projectile-file-exists-remote-cache-expire
-                   (> projectile-file-exists-remote-cache-expire 0)
-                   projectile-file-exists-remote-cache-expire)
-            (and projectile-file-exists-local-cache-expire
-                 (> projectile-file-exists-local-cache-expire 0)
-                 projectile-file-exists-local-cache-expire)))
-         (remote-file-name-inhibit-cache (if expire-seconds
-                                             expire-seconds
-                                           remote-file-name-inhibit-cache)))
-    (if (not expire-seconds)
-        (file-exists-p filename)
-      (let* ((current-time (current-time))
-             (cached (gethash filename projectile-file-exists-cache))
-             (cached-value (if cached (car cached)))
-             (cached-expire (if cached (cdr cached)))
-             (cached-expired (if cached (time-less-p cached-expire current-time) t))
-             (value (or (and (not cached-expired) cached-value)
-                        (if (file-exists-p filename) 'found 'notfound))))
-        (when (or (not cached) cached-expired)
-          (puthash filename
-                   (cons value (time-add current-time (seconds-to-time expire-seconds)))
-                   projectile-file-exists-cache))
-        (unless projectile-file-exists-cache-timer
-          (setq projectile-file-exists-cache-timer
-                (run-with-timer 10 nil 'projectile-file-exists-cache-cleanup)))
-        (equal value 'found)))))
-
-;;;###autoload
-(defun projectile-invalidate-cache (arg)
-  "Remove the current project's files from `projectile-projects-cache'.
-
-With a prefix argument ARG prompts for the name of the project whose cache
-to invalidate."
-  (interactive "P")
-  (let ((project-root
-         (if arg
-             (completing-read "Remove cache for: "
-                              (projectile-hash-keys projectile-projects-cache))
-           (projectile-project-root))))
-    (setq projectile-project-root-cache (make-hash-table :test 'equal))
-    (remhash project-root projectile-project-type-cache)
-    (remhash project-root projectile-projects-cache)
-    (projectile-serialize-cache)
-    (when projectile-verbose
-      (message "Invalidated Projectile cache for %s."
-               (propertize project-root 'face 'font-lock-keyword-face))))
-  (when (fboundp 'recentf-cleanup)
-    (recentf-cleanup)))
-
-(defun projectile-cache-project (project files)
-  "Cache PROJECTs FILES.
-The cache is created both in memory and on the hard drive."
-  (when projectile-enable-caching
-    (puthash project files projectile-projects-cache)
-    (projectile-serialize-cache)))
-
-;;;###autoload
-(defun projectile-purge-file-from-cache (file)
-  "Purge FILE from the cache of the current project."
-  (interactive
-   (list (projectile-completing-read
-          "Remove file from cache: "
-          (projectile-current-project-files))))
-  (let* ((project-root (projectile-project-root))
-         (project-cache (gethash project-root projectile-projects-cache)))
-    (if (projectile-file-cached-p file project-root)
-        (progn
-          (puthash project-root (remove file project-cache) projectile-projects-cache)
-          (projectile-serialize-cache)
-          (when projectile-verbose
-            (message "%s removed from cache" file)))
-      (error "%s is not in the cache" file))))
-
-;;;###autoload
-(defun projectile-purge-dir-from-cache (dir)
-  "Purge DIR from the cache of the current project."
-  (interactive
-   (list (projectile-completing-read
-          "Remove directory from cache: "
-          (projectile-current-project-dirs))))
-  (let* ((project-root (projectile-project-root))
-         (project-cache (gethash project-root projectile-projects-cache)))
-    (puthash project-root
-             (cl-remove-if (lambda (str) (string-prefix-p dir str)) project-cache)
-             projectile-projects-cache)))
-
-(defun projectile-file-cached-p (file project)
-  "Check if FILE is already in PROJECT cache."
-  (member file (gethash project projectile-projects-cache)))
-
-;;;###autoload
-(defun projectile-cache-current-file ()
-  "Add the currently visited file to the cache."
-  (interactive)
-  (let ((current-project (projectile-project-root)))
-    (when (and (buffer-file-name) (gethash (projectile-project-root) projectile-projects-cache))
-      (let* ((abs-current-file (file-truename (buffer-file-name)))
-             (current-file (file-relative-name abs-current-file current-project)))
-        (unless (or (projectile-file-cached-p current-file current-project)
-                    (projectile-ignored-directory-p (file-name-directory abs-current-file))
-                    (projectile-ignored-file-p abs-current-file))
-          (puthash current-project
-                   (cons current-file (gethash current-project projectile-projects-cache))
-                   projectile-projects-cache)
-          (projectile-serialize-cache)
-          (message "File %s added to project %s cache."
-                   (propertize current-file 'face 'font-lock-keyword-face)
-                   (propertize current-project 'face 'font-lock-keyword-face)))))))
-
-;; cache opened files automatically to reduce the need for cache invalidation
-(defun projectile-cache-files-find-file-hook ()
-  "Function for caching files with `find-file-hook'."
-  (let ((project-root (projectile-project-p)))
-    (when (and projectile-enable-caching
-               project-root
-               (not (projectile-ignored-project-p project-root)))
-      (projectile-cache-current-file))))
-
-(defun projectile-track-known-projects-find-file-hook ()
-  "Function for caching projects with `find-file-hook'."
-  (when (and projectile-track-known-projects-automatically (projectile-project-p))
-    (let ((known-projects (and (sequencep projectile-known-projects)
-                               (copy-sequence projectile-known-projects))))
-      (projectile-add-known-project (projectile-project-root))
-      (unless (equal known-projects projectile-known-projects)
-        (projectile-merge-known-projects)))))
-
-
-(defun projectile-maybe-invalidate-cache (force)
-  "Invalidate if FORCE or project's dirconfig newer than cache."
-  (when (or force (file-newer-than-file-p (projectile-dirconfig-file)
-                                          projectile-cache-file))
-    (projectile-invalidate-cache nil)))
-
-;;;###autoload
-(defun projectile-discover-projects-in-directory (directory)
-  "Discover any projects in DIRECTORY and add them to the projectile cache.
-This function is not recursive and only adds projects with roots
-at the top level of DIRECTORY."
-  (interactive
-   (list (read-directory-name "Starting directory: ")))
-  (let ((subdirs (directory-files directory t)))
-    (mapcar
-     (lambda (dir)
-       (when (and (file-directory-p dir)
-                  (not (member (file-name-nondirectory dir) '(".." "."))))
-         (let ((default-directory dir))
-           (when (projectile-project-p)
-             (projectile-add-known-project (projectile-project-root))))))
-     subdirs)))
-
-
-(defadvice delete-file (before purge-from-projectile-cache (filename &optional trash))
-  (if (and projectile-enable-caching (projectile-project-p))
-      (let* ((project-root (projectile-project-root))
-             (true-filename (file-truename filename))
-             (relative-filename (file-relative-name true-filename project-root)))
-        (if (projectile-file-cached-p relative-filename project-root)
-            (projectile-purge-file-from-cache relative-filename)))))
-
-
-;;; Project root related utilities
-(defun projectile-parent (path)
-  "Return the parent directory of PATH.
-PATH may be a file or directory and directory paths may end with a slash."
-  (directory-file-name (file-name-directory (directory-file-name (expand-file-name path)))))
-
-(defun projectile-locate-dominating-file (file name)
-  "Look up the directory hierarchy from FILE for a directory containing NAME.
-Stop at the first parent directory containing a file NAME,
-and return the directory.  Return nil if not found.
-Instead of a string, NAME can also be a predicate taking one argument
-\(a directory) and returning a non-nil value if that directory is the one for
-which we're looking."
-  ;; copied from files.el (stripped comments) emacs-24 bzr branch 2014-03-28 10:20
-  (setq file (abbreviate-file-name file))
-  (let ((root nil)
-        try)
-    (while (not (or root
-                    (null file)
-                    (string-match locate-dominating-stop-dir-regexp file)))
-      (setq try (if (stringp name)
-                    (projectile-file-exists-p (expand-file-name name file))
-                  (funcall name file)))
-      (cond (try (setq root file))
-            ((equal file (setq file (file-name-directory
-                                     (directory-file-name file))))
-             (setq file nil))))
-    (and root (expand-file-name (file-name-as-directory root)))))
-
-(defvar-local projectile-project-root nil
-  "Defines a custom Projectile project root.
-This is intended to be used as a file local variable.")
-
-(defun projectile-root-local (_dir)
-  "A simple wrapper around `projectile-project-root'."
-  projectile-project-root)
-
-(defun projectile-root-top-down (dir &optional list)
-  "Identify a project root in DIR by top-down search for files in LIST.
-If LIST is nil, use `projectile-project-root-files' instead.
-Return the first (topmost) matched directory or nil if not found."
-  (projectile-locate-dominating-file
-   dir
-   (lambda (dir)
-     (cl-find-if (lambda (f) (projectile-file-exists-p (expand-file-name f dir)))
-                 (or list projectile-project-root-files)))))
-
-(defun projectile-root-bottom-up (dir &optional list)
-  "Identify a project root in DIR by bottom-up search for files in LIST.
-If LIST is nil, use `projectile-project-root-files-bottom-up' instead.
-Return the first (bottommost) matched directory or nil if not found."
-  (cl-some (lambda (name) (projectile-locate-dominating-file dir name))
-           (or list projectile-project-root-files-bottom-up)))
-
-(defun projectile-root-top-down-recurring (dir &optional list)
-  "Identify a project root in DIR by recurring top-down search for files in LIST.
-If LIST is nil, use `projectile-project-root-files-top-down-recurring'
-instead.  Return the last (bottommost) matched directory in the
-topmost sequence of matched directories.  Nil otherwise."
-  (cl-some
-   (lambda (f)
-     (projectile-locate-dominating-file
-      dir
-      (lambda (dir)
-        (and (projectile-file-exists-p (expand-file-name f dir))
-             (or (string-match locate-dominating-stop-dir-regexp (projectile-parent dir))
-                 (not (projectile-file-exists-p (expand-file-name f (projectile-parent dir)))))))))
-   (or list projectile-project-root-files-top-down-recurring)))
-
-(defvar-local projectile-cached-project-root nil
-  "Cached root of the current Projectile project. If non-nil, it
-is used as the return value of `projectile-project-root' for
-performance (unless the variable `projectile-project-root' is
-also set). If nil, it is recalculated the next time
-`projectile-project-root' is called.
-
-This variable is reset automatically when Projectile detects that
-the `buffer-file-name' has changed. It can also be reset manually
-by calling `projectile-reset-cached-project-root'.")
-
-(defvar-local projectile-cached-buffer-file-name nil
-  "The last known value of `buffer-file-name' for the current
-buffer. This is used to detect a change in `buffer-file-name',
-which triggers a reset of `projectile-cached-project-root' and
-`projectile-cached-project-name'.")
-
-(defun projectile-project-root ()
-  "Retrieves the root directory of a project if available.
-The current directory is assumed to be the project's root otherwise."
-  ;; the cached value will be 'none in the case of no project root (this is to
-  ;; ensure it is not reevaluated each time when not inside a project) so use
-  ;; cl-subst to replace this 'none value with nil so a nil value is used
-  ;; instead
-  (or (cl-subst nil 'none
-                (or (and (equal projectile-cached-buffer-file-name buffer-file-name)
-                         projectile-cached-project-root)
-                    (progn
-                      (setq projectile-cached-buffer-file-name buffer-file-name)
-                      (setq projectile-cached-project-root
-                            ;; The `is-local' and `is-connected' variables are
-                            ;; used to fix the behavior where Emacs hangs
-                            ;; because of Projectile when you open a file over
-                            ;; TRAMP. It basically prevents Projectile from
-                            ;; trying to find information about files for which
-                            ;; it's not possible to get that information right
-                            ;; now.
-                            (or (let* ((dir default-directory)
-                                       (is-local (not (file-remote-p dir)))      ;; `true' if the file is local
-                                       (is-connected (file-remote-p dir nil t))) ;; `true' if the file is remote AND we are connected to the remote
-                                  (when (or is-local is-connected)
-                                    (cl-some
-                                     (lambda (func)
-                                       (let* ((cache-key (format "%s-%s" func dir))
-                                              (cache-value (gethash cache-key projectile-project-root-cache)))
-                                         (if (and cache-value (file-exists-p cache-value))
-                                             cache-value
-                                           (let ((value (funcall func (file-truename dir))))
-                                             (puthash cache-key value projectile-project-root-cache)
-                                             value))))
-                                     projectile-project-root-files-functions)))
-                                ;; set cached to none so is non-nil so we don't try
-                                ;; and look it up again
-                                'none)))))
-      (if projectile-require-project-root
-          (error "You're not in a project")
-        default-directory)))
-
-(defun projectile-file-truename (file-name)
-  "Return the truename of FILE-NAME.
-A thin wrapper around `file-truename' that handles nil."
-  (when file-name
-    (file-truename file-name)))
-
-(defun projectile-project-p ()
-  "Check if we're in a project."
-  (condition-case nil
-      (projectile-project-root)
-    (error nil)))
-
-(defun projectile-default-project-name (project-root)
-  "Default function used create project name to be displayed based on the value of PROJECT-ROOT."
-  (file-name-nondirectory (directory-file-name project-root)))
-
-(defvar-local projectile-cached-project-name nil
-  "Cached name of the current Projectile project. If non-nil, it
-is used as the return value of `projectile-project-name' for
-performance (unless the variable `projectile-project-name' is
-also set). If nil, it is recalculated the next time
-`projectile-project-name' is called.
-
-This variable is reset automatically when Projectile detects that
-the `buffer-file-name' has changed. It can also be reset manually
-by calling `projectile-reset-cached-project-name'.")
-
-(defun projectile-reset-cached-project-root ()
-  "Reset the value of `projectile-cached-project-root' to nil.
-
-This means that it is automatically recalculated the next time
-function `projectile-project-root' is called."
-  (interactive)
-  (setq projectile-cached-project-root nil))
-
-(defun projectile-reset-cached-project-name ()
-  "Reset the value of `projectile-cached-project-name' to nil.
-
-This means that it is automatically recalculated the next time
-function `projectile-project-name' is called."
-  (interactive)
-  (setq projectile-cached-project-name nil))
-
-(defun projectile-project-name ()
-  "Return project name."
-  (or projectile-project-name
-      (and (equal projectile-cached-buffer-file-name buffer-file-name)
-           projectile-cached-project-name)
-      (progn
-        (setq projectile-cached-buffer-file-name buffer-file-name)
-        (setq projectile-cached-project-name
-              (let ((project-root
-                     (condition-case nil
-                         (projectile-project-root)
-                       (error nil))))
-                (if project-root
-                    (funcall projectile-project-name-function project-root)
-                  "-"))))))
-
-
-;;; Project indexing
-(defun projectile-get-project-directories ()
-  "Get the list of project directories that are of interest to the user."
-  (mapcar (lambda (subdir) (concat (projectile-project-root) subdir))
-          (or (nth 0 (projectile-parse-dirconfig-file)) '(""))))
-
-(defun projectile-dir-files (directory)
-  "List the files in DIRECTORY and in its sub-directories.
-Files are returned as relative paths to the project root."
-  ;; check for a cache hit first if caching is enabled
-  (let ((files-list (and projectile-enable-caching
-                         (gethash directory projectile-projects-cache)))
-        (root (projectile-project-root)))
-    ;; cache disabled or cache miss
-    (or files-list
-        (if (eq projectile-indexing-method 'native)
-            (projectile-dir-files-native root directory)
-          ;; use external tools to get the project files
-          (projectile-adjust-files (projectile-dir-files-external root directory))))))
-
-(defun projectile-dir-files-native (root directory)
-  "Get the files for ROOT under DIRECTORY using just Emacs Lisp."
-  (let ((progress-reporter
-         (make-progress-reporter
-          (format "Projectile is indexing %s"
-                  (propertize directory 'face 'font-lock-keyword-face)))))
-    ;; we need the files with paths relative to the project root
-    (mapcar (lambda (file) (file-relative-name file root))
-            (projectile-index-directory directory (projectile-filtering-patterns)
-                                        progress-reporter))))
-
-(defun projectile-dir-files-external (root directory)
-  "Get the files for ROOT under DIRECTORY using external tools."
-  (let ((default-directory directory))
-    (mapcar (lambda (file)
-              (file-relative-name (expand-file-name file directory) root))
-            (projectile-get-repo-files))))
-
-(defcustom projectile-git-command "git ls-files -zco --exclude-standard"
-  "Command used by projectile to get the files in a git project."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-git-submodule-command "git submodule --quiet foreach 'echo $path' | tr '\\n' '\\0'"
-  "Command used by projectile to get the files in git submodules."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-git-ignored-command "git ls-files -zcoi --exclude-standard"
-  "Command used by projectile to get the ignored files in a git project."
-  :group 'projectile
-  :type 'string
-  :package-version '(projectile . "0.14.0"))
-
-(defcustom projectile-hg-command "hg locate -f -0 -I ."
-  "Command used by projectile to get the files in a hg project."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-fossil-command (concat "fossil ls | "
-                                             (when (string-equal system-type
-                                                                 "windows-nt")
-                                               "dos2unix | ")
-                                             "tr '\\n' '\\0'")
-  "Command used by projectile to get the files in a fossil project."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-bzr-command "bzr ls -R --versioned -0"
-  "Command used by projectile to get the files in a bazaar project."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-darcs-command "darcs show files -0 . "
-  "Command used by projectile to get the files in a darcs project."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-svn-command "svn list -R . | grep -v '$/' | tr '\\n' '\\0'"
-  "Command used by projectile to get the files in a svn project."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-generic-command "find . -type f -print0"
-  "Command used by projectile to get the files in a generic project."
-  :group 'projectile
-  :type 'string)
-
-(defcustom projectile-vcs-dirty-state '("edited" "unregistered" "needs-update" "needs-merge" "unlocked-changes" "conflict")
-  "List of states checked by `projectile-browse-dirty-projects'.
-Possible checked states are:
-\"edited\", \"unregistered\", \"needs-update\", \"needs-merge\", unlocked-changes\" and \"conflict\",
-as defined in `vc.el'."
-  :group 'projectile
-  :type '(repeat (string))
-  :package-version '(projectile . "0.15.0"))
-
-(defun projectile-get-ext-command ()
-  "Determine which external command to invoke based on the project's VCS."
-  (let ((vcs (projectile-project-vcs)))
-    (cond
-     ((eq vcs 'git) projectile-git-command)
-     ((eq vcs 'hg) projectile-hg-command)
-     ((eq vcs 'fossil) projectile-fossil-command)
-     ((eq vcs 'bzr) projectile-bzr-command)
-     ((eq vcs 'darcs) projectile-darcs-command)
-     ((eq vcs 'svn) projectile-svn-command)
-     (t projectile-generic-command))))
-
-(defun projectile-get-sub-projects-command ()
-  (let ((vcs (projectile-project-vcs)))
-    (cond
-     ((eq vcs 'git) projectile-git-submodule-command)
-     (t ""))))
-
-(defun projectile-get-ext-ignored-command ()
-  "Determine which external command to invoke based on the project's VCS."
-  (let ((vcs (projectile-project-vcs)))
-    (cond
-     ((eq vcs 'git) projectile-git-ignored-command)
-     ;; TODO: Add support for other VCS
-     (t nil))))
-
-(defun projectile-flatten (lst)
-  "Take a nested list LST and return its contents as a single, flat list."
-  (if (and (listp lst) (listp (cdr lst)))
-      (cl-mapcan 'projectile-flatten lst)
-    (list lst)))
-
-(defun projectile-get-all-sub-projects (project)
-  "Get all sub-projects for a given project.
-
-PROJECT is base directory to start search recursively."
-  (let ((submodules (projectile-get-immediate-sub-projects project)))
-    (cond
-     ((null submodules)
-      nil)
-     (t
-      (nconc submodules (projectile-flatten
-                         ;; recursively get sub-projects of each sub-project
-                         (mapcar (lambda (s)
-                                   (projectile-get-all-sub-projects s)) submodules)))))))
-
-(defun projectile-get-immediate-sub-projects (path)
-  "Get immediate sub-projects for a given project without recursing.
-
-PATH is the vcs root or project root from which to start
-searching, and should end with an appropriate path delimiter, such as
-'/' or a '\\'.
-
-If the vcs get-sub-projects query returns results outside of path,
-they are excluded from the results of this function."
-  (let* ((default-directory path)
-         ;; search for sub-projects under current project `project'
-         (submodules (mapcar
-                      (lambda (s)
-                        (file-name-as-directory (expand-file-name s default-directory)))
-                      (projectile-files-via-ext-command (projectile-get-sub-projects-command))))
-         (project-child-folder-regex
-          (concat "\\`"
-                  (regexp-quote path))))
-
-    ;; If project root is inside of an VCS folder, but not actually an
-    ;; VCS root itself, submodules external to the project will be
-    ;; included in the VCS get sub-projects result. Let's remove them.
-    (cl-remove-if-not
-     (lambda (submodule)
-       (string-match-p project-child-folder-regex
-                       submodule))
-     submodules)))
-
-(defun projectile-get-sub-projects-files ()
-  "Get files from sub-projects recursively."
-  (projectile-flatten
-   (mapcar (lambda (s)
-             (let ((default-directory s))
-               (mapcar (lambda (f)
-                         (concat s f))
-                       (projectile-files-via-ext-command projectile-git-command))))
-           (condition-case nil
-               (projectile-get-all-sub-projects (projectile-project-root))
-             (error nil)))))
-
-(defun projectile-get-repo-files ()
-  "Get a list of the files in the project, including sub-projects."
-  (cond
-   ((eq (projectile-project-vcs) 'git)
-    (nconc (projectile-files-via-ext-command (projectile-get-ext-command))
-           (projectile-get-sub-projects-files)))
-   (t (projectile-files-via-ext-command (projectile-get-ext-command)))))
-
-(defun projectile-get-repo-ignored-files ()
-  "Get a list of the files ignored in the project."
-  (let ((cmd (projectile-get-ext-ignored-command)))
-    (when cmd
-      (projectile-files-via-ext-command cmd))))
-
-(defun projectile-get-repo-ignored-directory (dir)
-  "Get a list of the files ignored in the project in the directory DIR."
-  (let ((cmd (projectile-get-ext-ignored-command)))
-    (when cmd
-      (projectile-files-via-ext-command (concat cmd " " dir)))))
-
-(defun projectile-call-process-to-string (program &rest args)
-  "Invoke the executable PROGRAM with ARGS and return the output as a string."
-  (with-temp-buffer
-    (apply 'call-process program nil (current-buffer) nil args)
-    (buffer-string)))
-
-(defun projectile-shell-command-to-string (command)
-  "Try to run COMMAND without actually using a shell and return the output.
-
-The function `eshell-search-path' will be used to search the PATH
-environment variable for an appropriate executable using the text
-occuring before the first space.  If no executable is found,
-fallback to `shell-command-to-string'."
-  (cl-destructuring-bind
-      (the-command . args) (split-string command " ")
-    (let ((binary-path (eshell-search-path the-command)))
-      (if binary-path
-          (apply 'projectile-call-process-to-string binary-path args)
-        (shell-command-to-string command)))))
-
-(defun projectile-check-vcs-status (&optional PROJECT-PATH)
-  "Check the status of the current project.
-If PROJECT-PATH is a project, check this one instead."
-  (let* ((PROJECT-PATH (or PROJECT-PATH (projectile-project-root)))
-         (project-status nil))
-    (save-excursion
-      (vc-dir PROJECT-PATH)
-      ;; wait until vc-dir is done
-      (while (vc-dir-busy) (sleep-for 0 100))
-      ;; check for status
-      (save-excursion
-        (save-match-data
-          (dolist (check projectile-vcs-dirty-state)
-            (goto-char (point-min))
-            (when (search-forward check nil t)
-              (setq project-status (cons check project-status))))))
-      (kill-buffer)
-      project-status)))
-
-(defun projectile-check-vcs-status-of-known-projects ()
-  "Return the list of dirty projects.
-The list is composed of sublists~: (project-path, project-status).
-Raise an error if their is no dirty project."
-  (let ((projects projectile-known-projects)
-        (status ()))
-    (dolist (project projects)
-      (when (and (projectile-keep-project-p project) (not (string= 'none (projectile-project-vcs project))))
-        (let ((tmp-status (projectile-check-vcs-status project)))
-          (when tmp-status
-            (setq status (cons (list project tmp-status) status))))))
-    (when (= (length status) 0)
-      (message "No dirty projects have been found"))
-    status))
-
-(defun projectile-browse-dirty-projects ()
-  "Browse dirty version controlled projects."
-  (interactive)
-  (let ((status nil)
-        (mod-proj nil))
-    (message "Checking for modifications in known projects...")
-    (setq status (projectile-check-vcs-status-of-known-projects))
-    (while (not (= (length status) 0))
-      (setq mod-proj (cons (car (pop status)) mod-proj)))
-    (projectile-vc
-     (projectile-completing-read "Select project: " mod-proj))))
-
-(defun projectile-files-via-ext-command (command)
-  "Get a list of relative file names in the project root by executing COMMAND."
-  (split-string (shell-command-to-string command) "\0" t))
-
-(defun projectile-index-directory (directory patterns progress-reporter)
-  "Index DIRECTORY taking into account PATTERNS.
-The function calls itself recursively until all sub-directories
-have been indexed.  The PROGRESS-REPORTER is updated while the
-function is executing."
-  (apply 'append
-         (mapcar
-          (lambda (f)
-            (unless (or (and patterns (projectile-ignored-rel-p f directory patterns))
-                        (member (file-name-nondirectory (directory-file-name f))
-                                '("." ".." ".svn" ".cvs")))
-              (progress-reporter-update progress-reporter)
-              (if (file-directory-p f)
-                  (unless (projectile-ignored-directory-p
-                           (file-name-as-directory f))
-                    (projectile-index-directory f patterns progress-reporter))
-                (unless (projectile-ignored-file-p f)
-                  (list f)))))
-          (directory-files directory t))))
-
-(defun projectile-adjust-files (files)
-  "First remove ignored files from FILES, then add back unignored files."
-  (projectile-add-unignored (projectile-remove-ignored files)))
-
-(defun projectile--stringi= (string1 string2)
-  "Match STRING1 and STRING2 case insensitively."
-  (equal (compare-strings string1 nil nil string2 nil nil t) t))
-
-(defun projectile-remove-ignored (files)
-  "Remove ignored files and folders from FILES.
-
-If ignored directory prefixed with '*', then ignore all
-directories/subdirectories with matching filename,
-otherwise operates relative to project root."
-  (let ((ignored-files (projectile-ignored-files-rel))
-        (ignored-dirs (projectile-ignored-directories-rel)))
-    (cl-remove-if
-     (lambda (file)
-       (or (cl-some
-            (lambda (f)
-              (string= f (file-name-nondirectory file)))
-            ignored-files)
-           (cl-some
-            (lambda (dir)
-              ;; if the directory is prefixed with '*' then ignore all directories matching that name
-              (if (string-prefix-p "*" dir)
-                  ;; remove '*' and trailing slash from ignored directory name
-                  (let ((d (substring dir 1 (if (equal (substring dir -1) "/") -1 nil))))
-                    (cl-some
-                     (lambda (p)
-                       (string= d p))
-                     ;; split path by '/', remove empty strings, and check if any subdirs match name 'd'
-                     (delete "" (split-string (or (file-name-directory file) "") "/"))))
-                (string-prefix-p dir file)))
-            ignored-dirs)
-           (cl-some
-            (lambda (suf)
-              (projectile--stringi= suf (file-name-extension file t)))
-            projectile-globally-ignored-file-suffixes)))
-     files)))
-
-(defun projectile-keep-ignored-files (files)
-  "Filter FILES to retain only those that are ignored."
-  (when files
-    (cl-remove-if-not
-     (lambda (file)
-       (cl-some (lambda (f) (string-prefix-p f file)) files))
-     (projectile-get-repo-ignored-files))))
-
-(defun projectile-keep-ignored-directories (directories)
-  "Get ignored files within each of DIRECTORIES."
-  (when directories
-    (let (result)
-      (dolist (dir directories result)
-        (setq result (append result
-                             (projectile-get-repo-ignored-directory dir))))
-      result)))
-
-(defun projectile-add-unignored (files)
-  "This adds unignored files to FILES.
-
-Useful because the VCS may not return ignored files at all.  In
-this case unignored files will be absent from FILES."
-  (let ((unignored-files (projectile-keep-ignored-files
-                          (projectile-unignored-files-rel)))
-        (unignored-paths (projectile-remove-ignored
-                          (projectile-keep-ignored-directories
-                           (projectile-unignored-directories-rel)))))
-    (append files unignored-files unignored-paths)))
-
-(defun projectile-buffers-with-file (buffers)
-  "Return only those BUFFERS backed by files."
-  (cl-remove-if-not (lambda (b) (buffer-file-name b)) buffers))
-
-(defun projectile-buffers-with-file-or-process (buffers)
-  "Return only those BUFFERS backed by files or processes."
-  (cl-remove-if-not (lambda (b) (or (buffer-file-name b)
-                                    (get-buffer-process b))) buffers))
-
-(defun projectile-project-buffers ()
-  "Get a list of project buffers."
-  (let* ((project-root (projectile-project-root))
-         (all-buffers (cl-remove-if-not
-                       (lambda (buffer)
-                         (projectile-project-buffer-p buffer project-root))
-                       (buffer-list))))
-    (if projectile-buffers-filter-function
-        (funcall projectile-buffers-filter-function all-buffers)
-      all-buffers)))
-
-(defun projectile-process-current-project-buffers (action)
-  "Process the current project's buffers using ACTION."
-  (let ((project-buffers (projectile-project-buffers)))
-    (dolist (buffer project-buffers)
-      (funcall action buffer))))
-
-(defun projectile-project-buffer-files ()
-  "Get a list of project buffer files."
-  (let ((project-root (projectile-project-root)))
-    (mapcar
-     (lambda (buffer)
-       (file-relative-name
-        (buffer-file-name buffer)
-        project-root))
-     (projectile-buffers-with-file
-      (projectile-project-buffers)))))
-
-(defun projectile-project-buffer-p (buffer project-root)
-  "Check if BUFFER is under PROJECT-ROOT."
-  (with-current-buffer buffer
-    (and (not (string-prefix-p " " (buffer-name buffer)))
-         (not (projectile-ignored-buffer-p buffer))
-         (string-equal (file-remote-p default-directory)
-                       (file-remote-p project-root))
-         (not (string-match-p "^http\\(s\\)?://" default-directory))
-         (string-prefix-p project-root (file-truename default-directory) (eq system-type 'windows-nt)))))
-
-(defun projectile-ignored-buffer-p (buffer)
-  "Check if BUFFER should be ignored."
-  (or
-   (member (buffer-name buffer) projectile-globally-ignored-buffers)
-   (with-current-buffer buffer
-     (cl-some
-      (lambda (mode)
-        (string-match-p (concat "^" mode "$")
-                        (symbol-name major-mode)))
-      projectile-globally-ignored-modes))))
-
-(defun projectile-difference (list1 list2)
-  (cl-remove-if
-   (lambda (x) (member x list2))
-   list1))
-
-(defun projectile-recently-active-files ()
-  "Get list of recently active files.
-
-Files are ordered by recently active buffers, and then recently
-opened through use of recentf."
-  (let ((project-buffer-files (projectile-project-buffer-files)))
-    (append project-buffer-files
-            (projectile-difference
-             (projectile-recentf-files)
-             project-buffer-files))))
-
-(defun projectile-project-buffer-names ()
-  "Get a list of project buffer names."
-  (mapcar #'buffer-name (projectile-project-buffers)))
-
-(defun projectile-prepend-project-name (string)
-  "Prepend the current project's name to STRING."
-  (format "[%s] %s" (projectile-project-name) string))
-
-(defun projectile-read-buffer-to-switch (prompt)
-  "Read the name of a buffer to switch to, prompting with PROMPT.
-
-This function excludes the current buffer from the offered
-choices."
-  (projectile-completing-read
-   prompt
-   (delete (buffer-name (current-buffer))
-           (projectile-project-buffer-names))))
-
-;;;###autoload
-(defun projectile-switch-to-buffer ()
-  "Switch to a project buffer."
-  (interactive)
-  (switch-to-buffer
-   (projectile-read-buffer-to-switch "Switch to buffer: ")))
-
-;;;###autoload
-(defun projectile-switch-to-buffer-other-window ()
-  "Switch to a project buffer and show it in another window."
-  (interactive)
-  (switch-to-buffer-other-window
-   (projectile-read-buffer-to-switch "Switch to buffer: ")))
-
-;;;###autoload
-(defun projectile-switch-to-buffer-other-frame ()
-  "Switch to a project buffer and show it in another window."
-  (interactive)
-  (switch-to-buffer-other-frame
-   (projectile-read-buffer-to-switch "Switch to buffer: ")))
-
-;;;###autoload
-(defun projectile-display-buffer ()
-  "Display a project buffer in another window without selecting it."
-  (interactive)
-  (display-buffer
-   (projectile-completing-read
-    "Display buffer: "
-    (projectile-project-buffer-names))))
-
-;;;###autoload
-(defun projectile-project-buffers-other-buffer ()
-  "Switch to the most recently selected buffer project buffer.
-Only buffers not visible in windows are returned."
-  (interactive)
-  (switch-to-buffer (car (projectile-project-buffers-non-visible))) nil t)
-
-(defun projectile-project-buffers-non-visible ()
-  "Get a list of non visible project buffers."
-  (cl-remove-if-not
-   (lambda (buffer)
-     (not (get-buffer-window buffer 'visible)))
-   (projectile-project-buffers)))
-
-;;;###autoload
-(defun projectile-multi-occur (&optional nlines)
-  "Do a `multi-occur' in the project's buffers.
-With a prefix argument, show NLINES of context."
-  (interactive "P")
-  (multi-occur (projectile-project-buffers)
-               (car (occur-read-primary-args))
-               nlines))
-
-(defun projectile-normalise-paths (patterns)
-  "Remove leading `/' from the elements of PATTERNS."
-  (delq nil (mapcar (lambda (pat) (and (string-prefix-p "/" pat)
-                                       ;; remove the leading /
-                                       (substring pat 1)))
-                    patterns)))
-
-(defun projectile-expand-paths (paths)
-  "Expand the elements of PATHS.
-
-Elements containing wildcards are expanded and spliced into the
-resulting paths.  The returned PATHS are absolute, based on the
-projectile project root."
-  (let ((default-directory (projectile-project-root)))
-    (projectile-flatten (mapcar
-                         (lambda (pattern)
-                           (or (file-expand-wildcards pattern t)
-                               (projectile-expand-root pattern)))
-                         paths))))
-
-(defun projectile-normalise-patterns (patterns)
-  "Remove paths from PATTERNS."
-  (cl-remove-if (lambda (pat) (string-prefix-p "/" pat)) patterns))
-
-(defun projectile-make-relative-to-root (files)
-  "Make FILES relative to the project root."
-  (let ((project-root (projectile-project-root)))
-    (mapcar (lambda (f) (file-relative-name f project-root)) files)))
-
-(defun projectile-ignored-directory-p (directory)
-  "Check if DIRECTORY should be ignored."
-  (member directory (projectile-ignored-directories)))
-
-(defun projectile-ignored-file-p (file)
-  "Check if FILE should be ignored."
-  (member file (projectile-ignored-files)))
-
-(defun projectile-check-pattern-p (file pattern)
-  "Check if FILE meets PATTERN."
-  (or (string-suffix-p (directory-file-name pattern)
-                       (directory-file-name file))
-      (member file (file-expand-wildcards pattern t))))
-
-(defun projectile-ignored-rel-p (file directory patterns)
-  "Check if FILE should be ignored relative to DIRECTORY
-according to PATTERNS: (ignored . unignored)"
-  (let ((default-directory directory))
-    (and (cl-some
-          (lambda (pat) (projectile-check-pattern-p file pat))
-          (car patterns))
-         (cl-notany
-          (lambda (pat) (projectile-check-pattern-p file pat))
-          (cdr patterns)))))
-
-(defun projectile-ignored-files ()
-  "Return list of ignored files."
-  (projectile-difference
-   (mapcar
-    #'projectile-expand-root
-    (append
-     projectile-globally-ignored-files
-     (projectile-project-ignored-files)))
-   (projectile-unignored-files)))
-
-(defun projectile-ignored-directories ()
-  "Return list of ignored directories."
-  (projectile-difference
-   (mapcar
-    #'file-name-as-directory
-    (mapcar
-     #'projectile-expand-root
-     (append
-      projectile-globally-ignored-directories
-      (projectile-project-ignored-directories))))
-   (projectile-unignored-directories)))
-
-(defun projectile-ignored-directories-rel ()
-  "Return list of ignored directories, relative to the root."
-  (projectile-make-relative-to-root (projectile-ignored-directories)))
-
-(defun projectile-ignored-files-rel ()
-  "Return list of ignored files, relative to the root."
-  (projectile-make-relative-to-root (projectile-ignored-files)))
-
-(defun projectile-project-ignored-files ()
-  "Return list of project ignored files.
-Unignored files are not included."
-  (cl-remove-if 'file-directory-p (projectile-project-ignored)))
-
-(defun projectile-project-ignored-directories ()
-  "Return list of project ignored directories.
-Unignored directories are not included."
-  (cl-remove-if-not 'file-directory-p (projectile-project-ignored)))
-
-(defun projectile-paths-to-ignore ()
-  "Return a list of ignored project paths."
-  (projectile-normalise-paths (nth 1 (projectile-parse-dirconfig-file))))
-
-(defun projectile-patterns-to-ignore ()
-  "Return a list of relative file patterns."
-  (projectile-normalise-patterns (nth 1 (projectile-parse-dirconfig-file))))
-
-(defun projectile-project-ignored ()
-  "Return list of project ignored files/directories.
-Unignored files/directories are not included."
-  (let ((paths (projectile-paths-to-ignore)))
-    (projectile-expand-paths paths)))
-
-(defun projectile-unignored-files ()
-  "Return list of unignored files."
-  (mapcar
-   #'projectile-expand-root
-   (append
-    projectile-globally-unignored-files
-    (projectile-project-unignored-files))))
-
-(defun projectile-unignored-directories ()
-  "Return list of unignored directories."
-  (mapcar
-   #'file-name-as-directory
-   (mapcar
-    #'projectile-expand-root
-    (append
-     projectile-globally-unignored-directories
-     (projectile-project-unignored-directories)))))
-
-(defun projectile-unignored-directories-rel ()
-  "Return list of unignored directories, relative to the root."
-  (projectile-make-relative-to-root (projectile-unignored-directories)))
-
-(defun projectile-unignored-files-rel ()
-  "Return list of unignored files, relative to the root."
-  (projectile-make-relative-to-root (projectile-unignored-files)))
-
-(defun projectile-project-unignored-files ()
-  "Return list of project unignored files."
-  (cl-remove-if 'file-directory-p (projectile-project-unignored)))
-
-(defun projectile-project-unignored-directories ()
-  "Return list of project unignored directories."
-  (cl-remove-if-not 'file-directory-p (projectile-project-unignored)))
-
-(defun projectile-paths-to-ensure ()
-  "Return a list of unignored project paths."
-  (projectile-normalise-paths (nth 2 (projectile-parse-dirconfig-file))))
-
-(defun projectile-files-to-ensure ()
-  (projectile-flatten (mapcar (lambda (pat) (file-expand-wildcards pat t))
-                              (projectile-patterns-to-ensure))))
-
-(defun projectile-patterns-to-ensure ()
-  "Return a list of relative file patterns."
-  (projectile-normalise-patterns (nth 2 (projectile-parse-dirconfig-file))))
-
-(defun projectile-filtering-patterns ()
-  (cons (projectile-patterns-to-ignore)
-        (projectile-patterns-to-ensure)))
-
-(defun projectile-project-unignored ()
-  "Return list of project ignored files/directories."
-  (delete-dups (append (projectile-expand-paths (projectile-paths-to-ensure))
-                       (projectile-expand-paths (projectile-files-to-ensure)))))
-
-
-(defun projectile-dirconfig-file ()
-  "Return the absolute path to the project's dirconfig file."
-  (expand-file-name ".projectile" (projectile-project-root)))
-
-(defun projectile-parse-dirconfig-file ()
-  "Parse project ignore file and return directories to ignore and keep.
-
-The return value will be a list of three elements, the car being
-the list of directories to keep, the cadr being the list of files
-or directories to ignore, and the caddr being the list of files
-or directories to ensure.
-
-Strings starting with + will be added to the list of directories
-to keep, and strings starting with - will be added to the list of
-directories to ignore.  For backward compatibility, without a
-prefix the string will be assumed to be an ignore string."
-  (let (keep ignore ensure (dirconfig (projectile-dirconfig-file)))
-    (when (projectile-file-exists-p dirconfig)
-      (with-temp-buffer
-        (insert-file-contents dirconfig)
-        (while (not (eobp))
-          (pcase (char-after)
-            (?+ (push (buffer-substring (1+ (point)) (line-end-position)) keep))
-            (?- (push (buffer-substring (1+ (point)) (line-end-position)) ignore))
-            (?! (push (buffer-substring (1+ (point)) (line-end-position)) ensure))
-            (_ (push (buffer-substring (point) (line-end-position)) ignore)))
-          (forward-line)))
-      (list (mapcar (lambda (f) (file-name-as-directory (projectile-trim-string f)))
-                    (delete "" (reverse keep)))
-            (mapcar #'projectile-trim-string
-                    (delete "" (reverse ignore)))
-            (mapcar #'projectile-trim-string
-                    (delete "" (reverse ensure)))))))
-
-(defun projectile-expand-root (name)
-  "Expand NAME to project root.
-
-Never use on many files since it's going to recalculate the
-project-root for every file."
-  (expand-file-name name (projectile-project-root)))
-
-(cl-defun projectile-completing-read (prompt choices &key initial-input action)
-  "Present a project tailored PROMPT with CHOICES."
-  (let ((prompt (projectile-prepend-project-name prompt))
-        res)
-    (setq res
-          (cond
-           ((eq projectile-completion-system 'ido)
-            (ido-completing-read prompt choices nil nil initial-input))
-           ((eq projectile-completion-system 'default)
-            (completing-read prompt choices nil nil initial-input))
-           ((eq projectile-completion-system 'helm)
-            (if (and (fboundp 'helm)
-                     (fboundp 'helm-make-source))
-                (helm :sources
-                      (helm-make-source "Projectile" 'helm-source-sync
-                                        :candidates choices
-                                        :action (if action
-                                                    (prog1 action
-                                                      (setq action nil))
-                                                  #'identity))
-                      :prompt prompt
-                      :input initial-input
-                      :buffer "*helm-projectile*")
-              (user-error "Please install helm from \
-https://github.com/emacs-helm/helm")))
-           ((eq projectile-completion-system 'grizzl)
-            (if (and (fboundp 'grizzl-completing-read)
-                     (fboundp 'grizzl-make-index))
-                (grizzl-completing-read prompt (grizzl-make-index choices))
-              (user-error "Please install grizzl from \
-https://github.com/d11wtq/grizzl")))
-           ((eq projectile-completion-system 'ivy)
-            (if (fboundp 'ivy-read)
-                (ivy-read prompt choices
-                          :initial-input initial-input
-                          :action (prog1 action
-                                    (setq action nil))
-                          :caller 'projectile-completing-read)
-              (user-error "Please install ivy from \
-https://github.com/abo-abo/swiper")))
-           (t (funcall projectile-completion-system prompt choices))))
-    (if action
-        (funcall action res)
-      res)))
-
-(defun projectile-current-project-files ()
-  "Return a list of files for the current project."
-  (let ((files (and projectile-enable-caching
-                    (gethash (projectile-project-root) projectile-projects-cache))))
-    ;; nothing is cached
-    (unless files
-      (when projectile-enable-caching
-        (message "Empty cache. Projectile is initializing cache..."))
-      (setq files (cl-mapcan
-                   #'projectile-dir-files
-                   (projectile-get-project-directories)))
-      ;; cache the resulting list of files
-      (when projectile-enable-caching
-        (projectile-cache-project (projectile-project-root) files)))
-    (projectile-sort-files files)))
-
-(defun projectile-process-current-project-files (action)
-  "Process the current project's files using ACTION."
-  (let ((project-files (projectile-current-project-files))
-        (default-directory (projectile-project-root)))
-    (dolist (filename project-files)
-      (funcall action filename))))
-
-(defun projectile-current-project-dirs ()
-  "Return a list of dirs for the current project."
-  (delete-dups
-   (delq nil
-         (mapcar #'file-name-directory
-                 (projectile-current-project-files)))))
-
-(defun projectile-hash-keys (hash)
-  "Return a list of all HASH keys."
-  (let (allkeys)
-    (maphash (lambda (k _v) (setq allkeys (cons k allkeys))) hash)
-    allkeys))
-
-
-;;; Interactive commands
-(defcustom projectile-other-file-alist
-  '( ;; handle C/C++ extensions
-    ("cpp" . ("h" "hpp" "ipp"))
-    ("ipp" . ("h" "hpp" "cpp"))
-    ("hpp" . ("h" "ipp" "cpp" "cc"))
-    ("cxx" . ("h" "hxx" "ixx"))
-    ("ixx" . ("h" "hxx" "cxx"))
-    ("hxx" . ("h" "ixx" "cxx"))
-    ("c" . ("h"))
-    ("m" . ("h"))
-    ("mm" . ("h"))
-    ("h" . ("c" "cc" "cpp" "ipp" "hpp" "cxx" "ixx" "hxx" "m" "mm"))
-    ("cc" . ("h" "hh" "hpp"))
-    ("hh" . ("cc"))
-
-    ;; vertex shader and fragment shader extensions in glsl
-    ("vert" . ("frag"))
-    ("frag" . ("vert"))
-
-    ;; handle files with no extension
-    (nil . ("lock" "gpg"))
-    ("lock" . (""))
-    ("gpg" . (""))
-    )
-  "Alist of extensions for switching to file with the same name,
-  using other extensions based on the extension of current
-  file."
-  :type 'alist)
-
-(defun projectile--find-other-file (&optional flex-matching ff-variant)
-  "Switch between files with the same name but different extensions.
-With FLEX-MATCHING, match any file that contains the base name of current file.
-Other file extensions can be customized with the variable
-`projectile-other-file-alist'.  With FF-VARIANT set to a defun, use that
-instead of `find-file'.   A typical example of such a defun would be
-`find-file-other-window' or `find-file-other-frame'"
-  (let ((ff (or ff-variant #'find-file))
-        (other-files (projectile-get-other-files
-                      (buffer-file-name)
-                      (projectile-current-project-files)
-                      flex-matching)))
-    (if other-files
-        (let ((file-name (if (= (length other-files) 1)
-                             (car other-files)
-                           (projectile-completing-read "Switch to: "
-                                                       other-files))))
-          (funcall ff (expand-file-name file-name
-                                        (projectile-project-root))))
-      (error "No other file found"))))
-
-;;;###autoload
-(defun projectile-find-other-file (&optional flex-matching)
-  "Switch between files with the same name but different extensions.
-With FLEX-MATCHING, match any file that contains the base name of current file.
-Other file extensions can be customized with the variable `projectile-other-file-alist'."
-  (interactive "P")
-  (projectile--find-other-file flex-matching))
-
-;;;###autoload
-(defun projectile-find-other-file-other-window (&optional flex-matching)
-  "Switch between files with the same name but different extensions in other window.
-With FLEX-MATCHING, match any file that contains the base name of current file.
-Other file extensions can be customized with the variable `projectile-other-file-alist'."
-  (interactive "P")
-  (projectile--find-other-file flex-matching
-                               #'find-file-other-window))
-
-;;;###autoload
-(defun projectile-find-other-file-other-frame (&optional flex-matching)
-  "Switch between files with the same name but different extensions in other window.
-With FLEX-MATCHING, match any file that contains the base name of current file.
-Other file extensions can be customized with the variable `projectile-other-file-alist'."
-  (interactive "P")
-  (projectile--find-other-file flex-matching
-                               #'find-file-other-frame))
-
-(defun projectile--file-name-sans-extensions (file-name)
-  "Return FILE-NAME sans any extensions.
-The extensions, in a filename, are what follows the first '.', with the exception of a leading '.'"
-  (setq file-name (file-name-nondirectory file-name))
-  (substring file-name 0 (string-match "\\..*" file-name 1)))
-
-(defun projectile--file-name-extensions (file-name)
-  "Return FILE-NAME's extensions.
-The extensions, in a filename, are what follows the first '.', with the exception of a leading '.'"
-  ;;would it make sense to return nil instead of an empty string if no extensions are found?
-  (setq file-name (file-name-nondirectory file-name))
-  (let (extensions-start)
-    (substring file-name
-               (if (setq extensions-start (string-match "\\..*" file-name 1))
-                   (1+ extensions-start)
-                 (length file-name)))))
-
-(defun projectile-associated-file-name-extensions (file-name)
-  "Return projectile-other-file-extensions associated to FILE-NAME's extensions.
-If no associated other-file-extensions for the complete (nested) extension are found, remove subextensions from FILENAME's extensions until a match is found."
-  (let ((current-extensions (projectile--file-name-extensions (file-name-nondirectory file-name)))
-        associated-extensions)
-    (catch 'break
-      (while (not (string= "" current-extensions))
-        (if (setq associated-extensions (cdr (assoc current-extensions projectile-other-file-alist)))
-            (throw 'break associated-extensions))
-        (setq current-extensions (projectile--file-name-extensions current-extensions))))))
-
-(defun projectile-get-other-files (current-file project-file-list &optional flex-matching)
-  "Narrow to files with the same names but different extensions.
-Returns a list of possible files for users to choose.
-
-With FLEX-MATCHING, match any file that contains the base name of current file"
-  (let* ((file-ext-list (projectile-associated-file-name-extensions current-file))
-         (fulldirname (if (file-name-directory current-file)
-                          (file-name-directory current-file) "./"))
-         (dirname (file-name-nondirectory (directory-file-name fulldirname)))
-         (filename (projectile--file-name-sans-extensions current-file))
-         (file-list (mapcar (lambda (ext)
-                              (if flex-matching
-                                  (concat ".*" filename ".*" "\." ext "\\'")
-                                (concat "^" filename
-                                        (unless (equal ext "")
-                                          (concat "\." ext))
-                                        "\\'")))
-                            file-ext-list))
-         (candidates (cl-remove-if-not
-                      (lambda (project-file)
-                        (string-match filename project-file))
-                      project-file-list))
-         (candidates
-          (projectile-flatten (mapcar
-                               (lambda (file)
-                                 (cl-remove-if-not
-                                  (lambda (project-file)
-                                    (string-match file
-                                                  (concat (file-name-base project-file)
-                                                          (unless (equal (file-name-extension project-file) nil)
-                                                            (concat "\." (file-name-extension project-file))))))
-                                  candidates))
-                               file-list)))
-         (candidates
-          (cl-remove-if-not (lambda (file) (not (backup-file-name-p file))) candidates))
-         (candidates
-          (cl-sort (copy-sequence candidates)
-                   (lambda (file _)
-                     (let ((candidate-dirname (file-name-nondirectory (directory-file-name (file-name-directory file)))))
-                       (unless (equal fulldirname (file-name-directory file))
-                         (equal dirname candidate-dirname)))))))
-    candidates))
-
-(defun projectile-select-files (project-files &optional arg)
-  "Select a list of files based on filename at point.
-
-With a prefix ARG invalidates the cache first."
-  (projectile-maybe-invalidate-cache arg)
-  (let* ((file (if (region-active-p)
-                   (buffer-substring (region-beginning) (region-end))
-                 (or (thing-at-point 'filename) "")))
-         (file (if (string-match "\\.?\\./" file)
-                   (file-relative-name (file-truename file) (projectile-project-root))
-                 file))
-         (files (if file
-                    (cl-remove-if-not
-                     (lambda (project-file)
-                       (string-match file project-file))
-                     project-files)
-                  nil)))
-    files))
-
-(defun projectile--find-file-dwim (invalidate-cache &optional ff-variant)
-  "Jump to a project's files using completion based on context.
-
-With a INVALIDATE-CACHE invalidates the cache first.
-
-With FF-VARIANT set to a defun, use that instead of `find-file'.
-A typical example of such a defun would be `find-file-other-window' or
-`find-file-other-frame'
-
-Subroutine for `projectile-find-file-dwim' and
-`projectile-find-file-dwim-other-window'"
-  (let* ((project-files (projectile-current-project-files))
-         (files (projectile-select-files project-files invalidate-cache))
-         (file (cond ((= (length files) 1)
-                      (car files))
-                     ((> (length files) 1)
-                      (projectile-completing-read "Switch to: " files))
-                     (t
-                      (projectile-completing-read "Switch to: " project-files))))
-         (ff (or ff-variant #'find-file)))
-    (funcall ff (expand-file-name file (projectile-project-root)))
-    (run-hooks 'projectile-find-file-hook)))
-
-;;;###autoload
-(defun projectile-find-file-dwim (&optional arg)
-  "Jump to a project's files using completion based on context.
-
-With a prefix ARG invalidates the cache first.
-
-If point is on a filename, Projectile first tries to search for that
-file in project:
-
-- If it finds just a file, it switches to that file instantly.  This works even
-if the filename is incomplete, but there's only a single file in the current project
-that matches the filename at point.  For example, if there's only a single file named
-\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete),
-`projectile-find-file-dwim' still switches to \"projectile/projectile.el\" immediately
- because this is the only filename that matches.
-
-- If it finds a list of files, the list is displayed for selecting.  A list of
-files is displayed when a filename appears more than one in the project or the
-filename at point is a prefix of more than two files in a project.  For example,
-if `projectile-find-file-dwim' is executed on a filepath like \"projectile/\", it lists
-the content of that directory.  If it is executed on a partial filename like
- \"projectile/a\", a list of files with character 'a' in that directory is presented.
-
-- If it finds nothing, display a list of all files in project for selecting."
-  (interactive "P")
-  (projectile--find-file-dwim arg))
-
-;;;###autoload
-(defun projectile-find-file-dwim-other-window (&optional arg)
-  "Jump to a project's files using completion based on context in other window.
-
-With a prefix ARG invalidates the cache first.
-
-If point is on a filename, Projectile first tries to search for that
-file in project:
-
-- If it finds just a file, it switches to that file instantly.  This works even
-if the filename is incomplete, but there's only a single file in the current project
-that matches the filename at point.  For example, if there's only a single file named
-\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete),
-`projectile-find-file-dwim-other-window' still switches to \"projectile/projectile.el\"
-immediately because this is the only filename that matches.
-
-- If it finds a list of files, the list is displayed for selecting.  A list of
-files is displayed when a filename appears more than one in the project or the
-filename at point is a prefix of more than two files in a project.  For example,
-if `projectile-find-file-dwim-other-window' is executed on a filepath like \"projectile/\", it lists
-the content of that directory.  If it is executed on a partial filename
-like \"projectile/a\", a list of files with character 'a' in that directory
-is presented.
-
-- If it finds nothing, display a list of all files in project for selecting."
-  (interactive "P")
-  (projectile--find-file-dwim arg #'find-file-other-window))
-
-;;;###autoload
-(defun projectile-find-file-dwim-other-frame (&optional arg)
-  "Jump to a project's files using completion based on context in other frame.
-
-With a prefix ARG invalidates the cache first.
-
-If point is on a filename, Projectile first tries to search for that
-file in project:
-
-- If it finds just a file, it switches to that file instantly.  This works even
-if the filename is incomplete, but there's only a single file in the current project
-that matches the filename at point.  For example, if there's only a single file named
-\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete),
-`projectile-find-file-dwim-other-frame' still switches to \"projectile/projectile.el\"
-immediately because this is the only filename that matches.
-
-- If it finds a list of files, the list is displayed for selecting.  A list of
-files is displayed when a filename appears more than one in the project or the
-filename at point is a prefix of more than two files in a project.  For example,
-if `projectile-find-file-dwim-other-frame' is executed on a filepath like \"projectile/\", it lists
-the content of that directory.  If it is executed on a partial filename
-like \"projectile/a\", a list of files with character 'a' in that directory
-is presented.
-
-- If it finds nothing, display a list of all files in project for selecting."
-  (interactive "P")
-  (projectile--find-file-dwim arg #'find-file-other-frame))
-
-(defun projectile--find-file (invalidate-cache &optional ff-variant)
-  "Jump to a project's file using completion.
-With INVALIDATE-CACHE invalidates the cache first.  With FF-VARIANT set to a
-defun, use that instead of `find-file'.   A typical example of such a defun
-would be `find-file-other-window' or `find-file-other-frame'"
-  (interactive "P")
-  (projectile-maybe-invalidate-cache invalidate-cache)
-  (let ((file (projectile-completing-read "Find file: "
-                                          (projectile-current-project-files)))
-        (ff (or ff-variant #'find-file)))
-    (funcall ff (expand-file-name file (projectile-project-root)))
-    (run-hooks 'projectile-find-file-hook)))
-
-;;;###autoload
-(defun projectile-find-file (&optional arg)
-  "Jump to a project's file using completion.
-With a prefix ARG invalidates the cache first."
-  (interactive "P")
-  (projectile--find-file arg))
-
-;;;###autoload
-(defun projectile-find-file-other-window (&optional arg)
-  "Jump to a project's file using completion and show it in another window.
-
-With a prefix ARG invalidates the cache first."
-  (interactive "P")
-  (projectile--find-file arg #'find-file-other-window))
-
-;;;###autoload
-(defun projectile-find-file-other-frame (&optional arg)
-  "Jump to a project's file using completion and show it in another frame.
-
-With a prefix ARG invalidates the cache first."
-  (interactive "P")
-  (projectile--find-file arg #'find-file-other-frame))
-
-(defun projectile-sort-files (files)
-  "Sort FILES according to `projectile-sort-order'."
-  (cl-case projectile-sort-order
-    (default files)
-    (recentf (projectile-sort-by-recentf-first files))
-    (recently-active (projectile-sort-by-recently-active-first files))
-    (modification-time (projectile-sort-by-modification-time files))
-    (access-time (projectile-sort-by-access-time files))))
-
-(defun projectile-sort-by-recentf-first (files)
-  "Sort FILES by a recent first scheme."
-  (let ((project-recentf-files (projectile-recentf-files)))
-    (append project-recentf-files
-            (projectile-difference files project-recentf-files))))
-
-(defun projectile-sort-by-recently-active-first (files)
-  "Sort FILES by most recently active buffers or opened files."
-  (let ((project-recently-active-files (projectile-recently-active-files)))
-    (append project-recently-active-files
-            (projectile-difference files project-recently-active-files))))
-
-(defun projectile-sort-by-modification-time (files)
-  "Sort FILES by modification time."
-  (let ((default-directory (projectile-project-root)))
-    (cl-sort
-     (copy-sequence files)
-     (lambda (file1 file2)
-       (let ((file1-mtime (nth 5 (file-attributes file1)))
-             (file2-mtime (nth 5 (file-attributes file2))))
-         (not (time-less-p file1-mtime file2-mtime)))))))
-
-(defun projectile-sort-by-access-time (files)
-  "Sort FILES by access time."
-  (let ((default-directory (projectile-project-root)))
-    (cl-sort
-     (copy-sequence files)
-     (lambda (file1 file2)
-       (let ((file1-atime (nth 4 (file-attributes file1)))
-             (file2-atime (nth 4 (file-attributes file2))))
-         (not (time-less-p file1-atime file2-atime)))))))
-
-(defun projectile--find-dir (invalidate-cache &optional dired-variant)
-  "Jump to a project's directory using completion.
-
-With INVALIDATE-CACHE invalidates the cache first.  With DIRED-VARIANT set to a
-defun, use that instead of `dired'.  A typical example of such a defun would be
-`dired-other-window' or `dired-other-frame'"
-  (projectile-maybe-invalidate-cache invalidate-cache)
-  (let ((dir (projectile-complete-dir))
-        (dired-v (or dired-variant #'dired)))
-    (funcall dired-v (expand-file-name dir (projectile-project-root)))
-    (run-hooks 'projectile-find-dir-hook)))
-
-;;;###autoload
-(defun projectile-find-dir (&optional arg)
-  "Jump to a project's directory using completion.
-
-With a prefix ARG invalidates the cache first."
-  (interactive "P")
-  (projectile--find-dir arg))
-
-;;;###autoload
-(defun projectile-find-dir-other-window (&optional arg)
-  "Jump to a project's directory in other window using completion.
-
-With a prefix ARG invalidates the cache first."
-  (interactive "P")
-  (projectile--find-dir arg #'dired-other-window))
-
-;;;###autoload
-(defun projectile-find-dir-other-frame (&optional arg)
-  "Jump to a project's directory in other window using completion.
-
-With a prefix ARG invalidates the cache first."
-  (interactive "P")
-  (projectile--find-dir arg #'dired-other-frame))
-
-(defun projectile-complete-dir ()
-  (projectile-completing-read
-   "Find dir: "
-   (if projectile-find-dir-includes-top-level
-       (append '("./") (projectile-current-project-dirs))
-     (projectile-current-project-dirs))))
-
-;;;###autoload
-(defun projectile-find-test-file (&optional arg)
-  "Jump to a project's test file using completion.
-
-With a prefix ARG invalidates the cache first."
-  (interactive "P")
-  (projectile-maybe-invalidate-cache arg)
-  (let ((file (projectile-completing-read "Find test file: "
-                                          (projectile-current-project-test-files))))
-    (find-file (expand-file-name file (projectile-project-root)))))
-
-(defun projectile-test-files (files)
-  "Return only the test FILES."
-  (cl-remove-if-not 'projectile-test-file-p files))
-
-(defun projectile-test-file-p (file)
-  "Check if FILE is a test file."
-  (or (cl-some (lambda (pat) (string-prefix-p pat (file-name-nondirectory file)))
-               (delq nil (list (funcall projectile-test-prefix-function (projectile-project-type)))))
-      (cl-some (lambda (pat) (string-suffix-p pat (file-name-sans-extension (file-name-nondirectory file))))
-               (delq nil (list (funcall projectile-test-suffix-function (projectile-project-type)))))))
-
-(defun projectile-current-project-test-files ()
-  "Return a list of test files for the current project."
-  (projectile-test-files (projectile-current-project-files)))
-
-(defvar projectile-project-types (make-hash-table)
-  "A hash table holding all project types that are known to Projectile.")
-
-(cl-defun projectile-register-project-type
-    (project-type marker-files &key compile test run test-suffix test-prefix)
-  "Register a project type with projectile.
-
-A project type is defined by PROJECT-TYPE, a set of MARKER-FILES, and optional keyword arguments
-COMPILE which specifies a command that builds the project,
-TEST which specified a command that tests the project,
-RUN which specifies a command that runs the project,
-TEST-SUFFIX which specifies test file suffix, and
-TEST-PREFIX which specifies test file prefix."
-  (let ((project-plist (list 'marker-files marker-files
-                              'compile-command compile
-                              'test-command test
-                              'run-command run)))
-    ;; There is no way for the function to distinguish between an explicit argument of nil and an omitted argument. However, the body of the function is free to consider nil an abbreviation for some other meaningful value
-    (when test-suffix
-      (plist-put project-plist 'test-suffix test-suffix))
-    (when test-prefix
-      (plist-put project-plist 'test-prefix test-prefix))
-    (puthash project-type project-plist
-             projectile-project-types)))
-
-(defun projectile-cmake-run-target (target)
-  "Run CMake TARGET, generating build dir if needed."
-  (interactive "sTarget: ")
-  (let ((configure-cmd (format "cmake -E chdir %s cmake .."
-                               projectile-build-dir))
-        (build-cmd (format "cmake --build %s --target %s"
-                           projectile-build-dir
-                           target)))
-    (compile (if (file-accessible-directory-p projectile-build-dir)
-                 build-cmd
-               (mkdir projectile-build-dir)
-               (format "%s && %s" configure-cmd build-cmd)))))
-
-(defun projectile-cmake-compile ()
-  "Compile the current cmake project."
-  (interactive)
-  (projectile-cmake-run-target ""))
-
-(defun projectile-cmake-test ()
-  "Run the current cmake projects test suite."
-  (interactive)
-  (projectile-cmake-run-target "test"))
-
-(defun projectile-meson-run-target (target)
-  "Run meson TARGET, generating build dir if needed."
-  (interactive "sTarget: ")
-  (let* ((configure-cmd (format "meson %s" projectile-build-dir))
-         (build-cmd (format "ninja -C %s %s" projectile-build-dir target)))
-    (compile (if (file-accessible-directory-p projectile-build-dir)
-                 build-cmd
-               (format "%s && %s" configure-cmd build-cmd)))))
-
-(defun projectile-meson-compile ()
-  "Compile the current meson project."
-  (interactive)
-  (projectile-meson-run-target ""))
-
-(defun projectile-meson-test ()
-  "Run the current meson projects test suite."
-  (interactive)
-  (projectile-meson-run-target "test"))
-
-(defun projectile-cabal ()
-  "Check if a project contains *.cabal files but no stack.yaml file."
-  (and (projectile-verify-file "*.cabal")
-       (not (projectile-verify-file "stack.yaml"))))
-
-(defun projectile-go ()
-  "Check if a project contains Go source files."
-  (cl-some
-   (lambda (file)
-     (string= (file-name-extension file) "go"))
-   (projectile-current-project-files)))
-
-(defcustom projectile-go-function 'projectile-go
-  "Function to determine if project's type is go."
-  :group 'projectile
-  :type 'function)
-
-(projectile-register-project-type 'emacs-cask '("Cask")
-                                  :compile "cask install")
-(projectile-register-project-type 'rails-rspec '("Gemfile" "app" "lib" "db" "config" "spec")
-                                  :compile "bundle exec rails server"
-                                  :test "bundle exec rspec")
-(projectile-register-project-type 'rails-test '("Gemfile" "app" "lib" "db" "config" "test")
-                                  :compile "bundle exec rails server"
-                                  :test "bundle exec rake test")
-(projectile-register-project-type 'symfony '("composer.json" "app" "src" "vendor")
-                                  :compile "app/console server:run"
-                                  :test "phpunit -c app ")
-(projectile-register-project-type 'ruby-rspec '("Gemfile" "lib" "spec")
-                                  :compile "bundle exec rake"
-                                  :test "bundle exec rspec")
-(projectile-register-project-type 'ruby-test '("Gemfile" "lib" "test")
-                                  :compile"bundle exec rake"
-                                  :test "bundle exec rake test")
-(projectile-register-project-type 'django '("manage.py")
-                                  :compile "python manage.py runserver"
-                                  :test "python manage.py test")
-(projectile-register-project-type 'python-pip '("requirements.txt")
-                                  :compile "python setup.by build"
-                                  :test "python -m unittest discover")
-(projectile-register-project-type 'python-pkg '("setup.py")
-                                  :compile "python setup.py build"
-                                  :test "python -m unittest discover")
-(projectile-register-project-type 'python-tox '("tox.ini")
-                                  :compile "tox -r --notest"
-                                  :test "tox")
-(projectile-register-project-type 'scons '("SConstruct")
-                                  :compile "scons"
-                                  :test "scons test")
-(projectile-register-project-type 'maven '("pom.xml")
-                                  :compile "mvn clean install"
-                                  :test "mvn test")
-(projectile-register-project-type 'gradle '("build.gradle")
-                                  :compile "gradle build"
-                                  :test "gradle test")
-(projectile-register-project-type 'gradlew '("gradlew")
-                                  :compile "./gradlew build"
-                                  :test "./gradlew test")
-(projectile-register-project-type 'grails '("application.properties" "grails-app")
-                                  :compile "grails package"
-                                  :test "grails test-app")
-(projectile-register-project-type 'lein-test '("project.clj")
-                                  :compile "lein compile"
-                                  :test "lein test")
-(projectile-register-project-type 'lein-midje '("project.clj" ".midje.clj")
-                                  :compile "lein compile"
-                                  :test "lein midje")
-(projectile-register-project-type 'boot-clj '("build.boot")
-                                  :compile "boot aot"
-                                  :test "boot test")
-(projectile-register-project-type 'rebar '("rebar.config")
-                                  :compile "rebar"
-                                  :test "rebar eunit")
-(projectile-register-project-type 'sbt '("build.sbt")
-                                  :compile "sbt compile"
-                                  :test "sbt test")
-(projectile-register-project-type 'make '("Makefile")
-                                  :compile "make"
-                                  :test "make test")
-(projectile-register-project-type 'grunt '("Gruntfile.js")
-                                  :compile "grunt"
-                                  :test "grunt test")
-(projectile-register-project-type 'gulp '("gulpfile.js")
-                                  :compile "gulp"
-                                  :test "gulp test")
-(projectile-register-project-type 'haskell-stack '("stack.yaml")
-                                  :compile "stack build"
-                                  :test "stack build --test")
-(projectile-register-project-type 'haskell-cabal #'projectile-cabal
-                                  :compile "cabal build"
-                                  :test "cabal test")
-(projectile-register-project-type 'rust-cargo '("Cargo.toml")
-                                  :compile "cargo build"
-                                  :test "cargo test")
-(projectile-register-project-type 'r '("DESCRIPTION")
-                                  :compile "R CMD INSTALL --with-keep.source ."
-                                  :test (concat "R CMD check -o " temporary-file-directory " ."))
-(projectile-register-project-type 'go projectile-go-function
-                                  :compile "go build ./..."
-                                  :test "go test ./...")
-(projectile-register-project-type 'racket '("info.rkt")
-                                  :test "raco test .")
-(projectile-register-project-type 'elixir '("mix.exs")
-                                  :compile "mix compile"
-                                  :test "mix test")
-(projectile-register-project-type 'npm '("package.json")
-                                  :compile "npm install"
-                                  :test "npm test")
-(projectile-register-project-type 'meson '("meson.build")
-                                  :compile #'projectile-meson-compile
-                                  :test #'projectile-meson-test)
-(projectile-register-project-type 'cmake '("CMakeLists.txt")
-                                  :compile #'projectile-cmake-compile
-                                  :test #'projectile-cmake-test)
-(projectile-register-project-type 'nix '("default.nix")
-                                  :compile "nix-build"
-                                  :test "nix-build")
-
-(defvar-local projectile-project-type nil
-  "Buffer local var for overriding the auto-detected project type.
-Normally you'd set this from .dir-locals.el.")
-(put 'projectile-project-type 'safe-local-variable #'symbolp)
-
-(defun projectile-detect-project-type ()
-  "Detect the type of the current project."
-  (let ((project-type (cl-find-if
-                       (lambda (project-type)
-                         (let ((marker (plist-get (gethash project-type projectile-project-types) 'marker-files)))
-                           (if (listp marker)
-                               (and (projectile-verify-files marker) project-type)
-                             (and (funcall marker) project-type))))
-                       (projectile-hash-keys projectile-project-types))))
-    (when project-type
-      (puthash (projectile-project-root) project-type projectile-project-type-cache))
-    project-type))
-
-(defun projectile-project-type ()
-  "Determine the project's type based on its structure."
-  (if projectile-project-type
-      projectile-project-type
-    (or (gethash (projectile-project-root) projectile-project-type-cache)
-        (projectile-detect-project-type)
-        'generic)))
-
-;;;###autoload
-(defun projectile-project-info ()
-  "Display info for current project."
-  (interactive)
-  (message "Project dir: %s ## Project VCS: %s ## Project type: %s"
-           (projectile-project-root)
-           (projectile-project-vcs)
-           (projectile-project-type)))
-
-(defun projectile-verify-files (files)
-  "Check whether all FILES exist in the current project."
-  (cl-every 'projectile-verify-file files))
-
-(defun projectile-verify-file (file)
-  "Check whether FILE exists in the current project.
-Expands wildcards using `file-expand-wildcards' before checking."
-  (file-expand-wildcards (projectile-expand-root file)))
-
-(defun projectile-project-vcs (&optional project-root)
-  "Determine the VCS used by the project if any.
-PROJECT-ROOT is the targeted directory.  If nil, use
-`projectile-project-root'."
-  (or project-root (setq project-root (projectile-project-root)))
-  (cond
-   ((projectile-file-exists-p (expand-file-name ".git" project-root)) 'git)
-   ((projectile-file-exists-p (expand-file-name ".hg" project-root)) 'hg)
-   ((projectile-file-exists-p (expand-file-name ".fslckout" project-root)) 'fossil)
-   ((projectile-file-exists-p (expand-file-name "_FOSSIL_" project-root)) 'fossil)
-   ((projectile-file-exists-p (expand-file-name ".bzr" project-root)) 'bzr)
-   ((projectile-file-exists-p (expand-file-name "_darcs" project-root)) 'darcs)
-   ((projectile-file-exists-p (expand-file-name ".svn" project-root)) 'svn)
-   ((projectile-locate-dominating-file project-root ".git") 'git)
-   ((projectile-locate-dominating-file project-root ".hg") 'hg)
-   ((projectile-locate-dominating-file project-root ".fslckout") 'fossil)
-   ((projectile-locate-dominating-file project-root "_FOSSIL_") 'fossil)
-   ((projectile-locate-dominating-file project-root ".bzr") 'bzr)
-   ((projectile-locate-dominating-file project-root "_darcs") 'darcs)
-   ((projectile-locate-dominating-file project-root ".svn") 'svn)
-   (t 'none)))
-
-(defun projectile--test-name-for-impl-name (impl-file-path)
-  (let* ((project-type (projectile-project-type))
-         (impl-file-name (file-name-sans-extension (file-name-nondirectory impl-file-path)))
-         (impl-file-ext (file-name-extension impl-file-path))
-         (test-prefix (funcall projectile-test-prefix-function project-type))
-         (test-suffix (funcall projectile-test-suffix-function project-type)))
-    (cond
-     (test-prefix (concat test-prefix impl-file-name "." impl-file-ext))
-     (test-suffix (concat impl-file-name test-suffix "." impl-file-ext))
-     (t (error "Project type not supported!")))))
-
-(defun projectile-create-test-file-for (impl-file-path)
-  (let* ((test-file (projectile--test-name-for-impl-name impl-file-path))
-         (project-root (projectile-project-root))
-         (relative-dir (file-name-directory (file-relative-name impl-file-path project-root)))
-         (test-dir (expand-file-name (replace-regexp-in-string "src/" "test/" relative-dir) project-root))
-         (test-path (expand-file-name test-file test-dir)))
-    (unless (file-exists-p test-path)
-      (progn (unless (file-exists-p test-dir)
-               (make-directory test-dir :create-parents))
-             test-path))))
-
-(defcustom projectile-create-missing-test-files nil
-  "During toggling, if non-nil enables creating test files if not found.
-
-When not-nil, every call to projectile-find-implementation-or-test-*
-creates test files if not found on the file system. Defaults to nil.
-It assumes the test/ folder is at the same level as src/."
-  :group 'projectile
-  :type 'boolean)
-
-(defun projectile-find-implementation-or-test (file-name)
-  "Given a FILE-NAME return the matching implementation or test filename."
-  (unless file-name (error "The current buffer is not visiting a file"))
-  (if (projectile-test-file-p file-name)
-      ;; find the matching impl file
-      (let ((impl-file (projectile-find-matching-file file-name)))
-        (if impl-file
-            (projectile-expand-root impl-file)
-          (error "No matching source file found")))
-    ;; find the matching test file
-    (let ((test-file (projectile-find-matching-test file-name)))
-      (if test-file
-          (projectile-expand-root test-file)
-        (if projectile-create-missing-test-files
-            (projectile-create-test-file-for file-name)
-          (error "No matching test file found"))))))
-
-;;;###autoload
-(defun projectile-find-implementation-or-test-other-window ()
-  "Open matching implementation or test file in other window."
-  (interactive)
-  (find-file-other-window
-   (projectile-find-implementation-or-test (buffer-file-name))))
-
-;;;###autoload
-(defun projectile-find-implementation-or-test-other-frame ()
-  "Open matching implementation or test file in other frame."
-  (interactive)
-  (find-file-other-frame
-   (projectile-find-implementation-or-test (buffer-file-name))))
-
-;;;###autoload
-(defun projectile-toggle-between-implementation-and-test ()
-  "Toggle between an implementation file and its test file."
-  (interactive)
-  (find-file
-   (projectile-find-implementation-or-test (buffer-file-name))))
-
-
-(defun projectile--registration-value-or-default (project-type key &optional default-value)
-  "Returs project registration value for a KEY for a project PROJECT-TYPE or if nothing DEFAULT-VALUE"
-  (let ((project (gethash project-type projectile-project-types)))
-    (if (and project (plist-member project key))
-        (plist-get project key)
-      default-value)))
-
-(defun projectile-test-prefix (project-type)
-  "Find default test files prefix based on PROJECT-TYPE."
-  (cl-flet ((prefix (&optional pfx)
-                    (projectile--registration-value-or-default project-type 'test-prefix pfx)))
-      (cond
-       ((member project-type '(django python-pip python-pkg python-tox))  (prefix "test_"))
-       ((member project-type '(emacs-cask)) (prefix "test-"))
-       ((member project-type '(lein-midje)) (prefix "t_"))
-       (t (prefix)))))
-
-(defun projectile-test-suffix (project-type)
-  "Find default test files suffix based on PROJECT-TYPE."
-  (cl-flet ((suffix (&optional sfx)
-                    (projectile--registration-value-or-default project-type 'test-suffix sfx)))
-    (cond
-     ((member project-type '(rebar)) (suffix "_SUITE"))
-     ((member project-type '(emacs-cask)) (suffix "-test"))
-     ((member project-type '(rails-rspec ruby-rspec)) (suffix "_spec"))
-     ((member project-type '(rails-test ruby-test lein-test boot-clj go elixir)) (suffix "_test"))
-     ((member project-type '(scons)) (suffix "test"))
-     ((member project-type '(maven symfony)) (suffix "Test"))
-     ((member project-type '(gradle gradlew grails)) (suffix "Spec"))
-     ((member project-type '(sbt)) (suffix "Spec"))
-     (t (suffix)))))
-
-(defun projectile-dirname-matching-count (a b)
-  "Count matching dirnames ascending file paths."
-  (setq a (reverse (split-string (or (file-name-directory a) "") "/" t))
-        b (reverse (split-string (or (file-name-directory b) "") "/" t)))
-  (let ((common 0))
-    (while (and a b (string-equal (pop a) (pop b)))
-      (setq common (1+ common)))
-    common))
-
-(defun projectile-group-file-candidates (file candidates)
-  "Group file candidates by dirname matching count."
-  (cl-sort (copy-sequence
-            (let (value result)
-              (while (setq value (pop candidates))
-                (let* ((key (projectile-dirname-matching-count file value))
-                       (kv (assoc key result)))
-                  (if kv
-                      (setcdr kv (cons value (cdr kv)))
-                    (push (list key value) result))))
-              (mapcar (lambda (x)
-                        (cons (car x) (nreverse (cdr x))))
-                      (nreverse result))))
-           (lambda (a b) (> (car a) (car b)))))
-
-(defun projectile-find-matching-test (file)
-  "Compute the name of the test matching FILE."
-  (let* ((basename (file-name-nondirectory (file-name-sans-extension file)))
-         (test-prefix (funcall projectile-test-prefix-function (projectile-project-type)))
-         (test-suffix (funcall projectile-test-suffix-function (projectile-project-type)))
-         (candidates
-          (cl-remove-if-not
-           (lambda (current-file)
-             (let ((name (file-name-nondirectory
-                          (file-name-sans-extension current-file))))
-               (or (when test-prefix
-                     (string-equal name (concat test-prefix basename)))
-                   (when test-suffix
-                     (string-equal name (concat basename test-suffix))))))
-           (projectile-current-project-files))))
-    (cond
-     ((null candidates) nil)
-     ((= (length candidates) 1) (car candidates))
-     (t (let ((grouped-candidates (projectile-group-file-candidates file candidates)))
-          (if (= (length (car grouped-candidates)) 2)
-              (car (last (car grouped-candidates)))
-            (projectile-completing-read
-             "Switch to: "
-             (apply 'append (mapcar 'cdr grouped-candidates)))))))))
-
-(defun projectile-find-matching-file (test-file)
-  "Compute the name of a file matching TEST-FILE."
-  (let* ((basename (file-name-nondirectory (file-name-sans-extension test-file)))
-         (test-prefix (funcall projectile-test-prefix-function (projectile-project-type)))
-         (test-suffix (funcall projectile-test-suffix-function (projectile-project-type)))
-         (candidates
-          (cl-remove-if-not
-           (lambda (current-file)
-             (let ((name (file-name-nondirectory
-                          (file-name-sans-extension current-file))))
-               (or (when test-prefix
-                     (string-equal (concat test-prefix name) basename))
-                   (when test-suffix
-                     (string-equal (concat name test-suffix) basename)))))
-           (projectile-current-project-files))))
-    (cond
-     ((null candidates) nil)
-     ((= (length candidates) 1) (car candidates))
-     (t (let ((grouped-candidates (projectile-group-file-candidates test-file candidates)))
-          (if (= (length (car grouped-candidates)) 2)
-              (car (last (car grouped-candidates)))
-            (projectile-completing-read
-             "Switch to: "
-             (apply 'append (mapcar 'cdr grouped-candidates)))))))))
-
-(defun projectile-grep-default-files ()
-  "Try to find a default pattern for `projectile-grep'.
-This is a subset of `grep-read-files', where either a matching entry from
-`grep-files-aliases' or file name extension pattern is returned."
-  (when buffer-file-name
-    (let* ((fn (file-name-nondirectory buffer-file-name))
-           (default-alias
-             (let ((aliases (remove (assoc "all" grep-files-aliases)
-                                    grep-files-aliases))
-                   alias)
-               (while aliases
-                 (setq alias (car aliases)
-                       aliases (cdr aliases))
-                 (if (string-match (mapconcat
-                                    #'wildcard-to-regexp
-                                    (split-string (cdr alias) nil t)
-                                    "\\|")
-                                   fn)
-                     (setq aliases nil)
-                   (setq alias nil)))
-               (cdr alias)))
-           (default-extension
-             (let ((ext (file-name-extension fn)))
-               (and ext (concat "*." ext)))))
-      (or default-alias default-extension))))
-
-(defun projectile--globally-ignored-file-suffixes-glob ()
-  "Return ignored file suffixes as a list of glob patterns."
-  (mapcar (lambda (pat) (concat "*" pat)) projectile-globally-ignored-file-suffixes))
-
-(defun projectile--read-search-string-with-default (prefix-label)
-  (let* ((prefix-label (projectile-prepend-project-name prefix-label))
-         (default-value (projectile-symbol-or-selection-at-point))
-         (default-label (if (or (not default-value)
-                                (string= default-value ""))
-                            ""
-                          (format " (default %s)" default-value))))
-    (read-string (format "%s%s: " prefix-label default-label) nil nil default-value)))
-
-;;;###autoload
-(defun projectile-grep (&optional regexp arg)
-  "Perform rgrep in the project.
-
-With a prefix ARG asks for files (globbing-aware) which to grep in.
-With prefix ARG of `-' (such as `M--'), default the files (without prompt),
-to `projectile-grep-default-files'.
-
-With REGEXP given, don't query the user for a regexp."
-  (interactive "i\nP")
-  (require 'grep) ;; for `rgrep'
-  (let* ((roots (projectile-get-project-directories))
-         (search-regexp (or regexp
-                            (projectile--read-search-string-with-default "Grep for")))
-         (files (and arg (or (and (equal current-prefix-arg '-)
-                                  (projectile-grep-default-files))
-                             (read-string (projectile-prepend-project-name "Grep in: ")
-                                          (projectile-grep-default-files))))))
-    (dolist (root-dir roots)
-      (require 'vc-git) ;; for `vc-git-grep'
-      ;; in git projects users have the option to use `vc-git-grep' instead of `rgrep'
-      (if (and (eq (projectile-project-vcs) 'git)
-               projectile-use-git-grep
-               (fboundp 'vc-git-grep))
-          (vc-git-grep search-regexp (or files "") root-dir)
-        ;; paths for find-grep should relative and without trailing /
-        (let ((grep-find-ignored-directories
-               (cl-union (mapcar (lambda (f) (directory-file-name (file-relative-name f root-dir)))
-                                 (projectile-ignored-directories))
-                         grep-find-ignored-directories))
-              (grep-find-ignored-files
-               (cl-union (append (mapcar (lambda (file)
-                                           (file-relative-name file root-dir))
-                                         (projectile-ignored-files))
-                                 (projectile--globally-ignored-file-suffixes-glob))
-                         grep-find-ignored-files)))
-          (grep-compute-defaults)
-          (rgrep search-regexp (or files "* .*") root-dir))))
-    (run-hooks 'projectile-grep-finished-hook)))
-
-;;;###autoload
-(defun projectile-ag (search-term &optional arg)
-  "Run an ag search with SEARCH-TERM in the project.
-
-With an optional prefix argument ARG SEARCH-TERM is interpreted as a
-regular expression."
-  (interactive
-   (list (projectile--read-search-string-with-default
-          (format "Ag %ssearch for" (if current-prefix-arg "regexp " "")))
-         current-prefix-arg))
-  (if (require 'ag nil 'noerror)
-      (let ((ag-command (if arg 'ag-regexp 'ag))
-            (ag-ignore-list (delq nil
-                                  (delete-dups
-                                   (append
-                                    ag-ignore-list
-                                    (projectile--globally-ignored-file-suffixes-glob)
-                                    ;; ag supports git ignore files directly
-                                    (unless (eq (projectile-project-vcs) 'git)
-                                      (append (projectile-ignored-files-rel)
-                                              (projectile-ignored-directories-rel)
-                                              grep-find-ignored-files
-                                              grep-find-ignored-directories))))))
-            ;; reset the prefix arg, otherwise it will affect the ag-command
-            (current-prefix-arg nil))
-        (funcall ag-command search-term (projectile-project-root)))
-    (error "Package 'ag' is not available")))
-
-(defun projectile-tags-exclude-patterns ()
-  "Return a string with exclude patterns for ctags."
-  (mapconcat (lambda (pattern) (format "--exclude=\"%s\""
-                                       (directory-file-name pattern)))
-             (projectile-ignored-directories-rel) " "))
-
-;;;###autoload
-(defun projectile-regenerate-tags ()
-  "Regenerate the project's [e|g]tags."
-  (interactive)
-  (if (and (boundp 'ggtags-mode)
-           (memq projectile-tags-backend '(auto ggtags)))
-      (progn
-        (let* ((ggtags-project-root (projectile-project-root))
-               (default-directory ggtags-project-root))
-          (ggtags-ensure-project)
-          (ggtags-update-tags t)))
-    (let* ((project-root (projectile-project-root))
-           (tags-exclude (projectile-tags-exclude-patterns))
-           (default-directory project-root)
-           (tags-file (expand-file-name projectile-tags-file-name))
-           (command (format projectile-tags-command tags-file tags-exclude))
-           shell-output exit-code)
-      (with-temp-buffer
-        (setq exit-code
-              (call-process-shell-command command nil (current-buffer))
-              shell-output (projectile-trim-string
-                            (buffer-substring (point-min) (point-max)))))
-      (unless (zerop exit-code)
-        (error shell-output))
-      (visit-tags-table tags-file)
-      (message "Regenerated %s" tags-file))))
-
-(defun projectile-visit-project-tags-table ()
-  "Visit the current project's tags table."
-  (when (projectile-project-p)
-    (let ((tags-file (projectile-expand-root projectile-tags-file-name)))
-      (when (file-exists-p tags-file)
-        (with-demoted-errors "Error loading tags-file: %s"
-          (visit-tags-table tags-file t))))))
-
-(defun projectile-determine-find-tag-fn ()
-  "Determine which function to use for a call to `projectile-find-tag'."
-  (or
-   (cond
-    ((eq projectile-tags-backend 'auto)
-     (cond
-      ((fboundp 'ggtags-find-tag-dwim)
-       'ggtags-find-tag-dwim)
-      ((fboundp 'xref-find-definitions)
-       'xref-find-definitions)
-      ((fboundp 'etags-select-find-tag)
-       'etags-select-find-tag)))
-    ((eq projectile-tags-backend 'xref)
-     (when (fboundp 'xref-find-definitions)
-       'xref-find-definitions))
-    ((eq projectile-tags-backend 'ggtags)
-     (when (fboundp 'ggtags-find-tag-dwim)
-       'ggtags-find-tag-dwim))
-    ((eq projectile-tags-backend 'etags-select)
-     (when (fboundp 'etags-select-find-tag)
-       'etags-select-find-tag)))
-   'find-tag))
-
-;;;###autoload
-(defun projectile-find-tag ()
-  "Find tag in project."
-  (interactive)
-  (projectile-visit-project-tags-table)
-  ;; Auto-discover the user's preference for tags
-  (let ((find-tag-fn (projectile-determine-find-tag-fn)))
-    (call-interactively find-tag-fn)))
-
-(defmacro projectile-with-default-dir (dir &rest body)
-  "Invoke in DIR the BODY."
-  (declare (debug t) (indent 1))
-  `(let ((default-directory ,dir))
-     ,@body))
-
-;;;###autoload
-(defun projectile-run-command-in-root ()
-  "Invoke `execute-extended-command' in the project's root."
-  (interactive)
-  (projectile-with-default-dir (projectile-project-root)
-    (call-interactively 'execute-extended-command)))
-
-;;;###autoload
-(defun projectile-run-shell-command-in-root ()
-  "Invoke `shell-command' in the project's root."
-  (interactive)
-  (projectile-with-default-dir (projectile-project-root)
-    (call-interactively 'shell-command)))
-
-;;;###autoload
-(defun projectile-run-async-shell-command-in-root ()
-  "Invoke `async-shell-command' in the project's root."
-  (interactive)
-  (projectile-with-default-dir (projectile-project-root)
-    (call-interactively 'async-shell-command)))
-
-;;;###autoload
-(defun projectile-run-shell ()
-  "Invoke `shell' in the project's root."
-  (interactive)
-  (projectile-with-default-dir (projectile-project-root)
-    (shell (concat "*shell " (projectile-project-name) "*"))))
-
-;;;###autoload
-(defun projectile-run-eshell ()
-  "Invoke `eshell' in the project's root."
-  (interactive)
-  (let ((eshell-buffer-name (concat "*eshell " (projectile-project-name) "*")))
-    (projectile-with-default-dir (projectile-project-root)
-      (eshell))))
-
-;;;###autoload
-(defun projectile-run-term (program)
-  "Invoke `term' in the project's root."
-  (interactive (list nil))
-  (let* ((term (concat "term " (projectile-project-name)))
-         (buffer (concat "*" term "*")))
-    (unless (get-buffer buffer)
-      (require 'term)
-      (let ((program (or program
-                         (read-from-minibuffer "Run program: "
-                                               (or explicit-shell-file-name
-                                                   (getenv "ESHELL")
-                                                   (getenv "SHELL")
-                                                   "/bin/sh")))))
-        (projectile-with-default-dir (projectile-project-root)
-          (set-buffer (make-term term program))
-          (term-mode)
-          (term-char-mode))))
-    (switch-to-buffer buffer)))
-
-(defun projectile-files-in-project-directory (directory)
-  "Return a list of files in DIRECTORY."
-  (let ((dir (file-relative-name (expand-file-name directory)
-                                 (projectile-project-root))))
-    (cl-remove-if-not
-     (lambda (f) (string-prefix-p dir f))
-     (projectile-current-project-files))))
-
-(defun projectile-unixy-system-p ()
-  "Check to see if unixy text utilities are installed."
-  (cl-every
-   (lambda (x) (executable-find x))
-   '("grep" "cut" "uniq")))
-
-(defun projectile-files-from-cmd (cmd directory)
-  "Use a grep-like CMD to search for files within DIRECTORY.
-
-CMD should include the necessary search params and should output
-equivalently to grep -HlI (only unique matching filenames).
-Returns a list of expanded filenames."
-  (let ((default-directory directory))
-    (mapcar (lambda (str)
-              (concat directory
-                      (if (string-prefix-p "./" str)
-                          (substring str 2)
-                        str)))
-            (split-string
-             (projectile-trim-string
-              (shell-command-to-string cmd))
-             "\n+"
-             t))))
-
-(defun projectile-files-with-string (string directory)
-  "Return a list of all files containing STRING in DIRECTORY.
-
-Tries to use ag, ack, git-grep, and grep in that order.  If those
-are impossible (for instance on Windows), returns a list of all
-files in the project."
-  (if (projectile-unixy-system-p)
-      (let* ((search-term (shell-quote-argument string))
-             (cmd (cond ((executable-find "ag")
-                         (concat "ag --literal --nocolor --noheading -l -- "
-                                 search-term))
-                        ((executable-find "ack")
-                         (concat "ack --literal --noheading --nocolor -l -- "
-                                 search-term))
-                        ((and (executable-find "git")
-                              (eq (projectile-project-vcs) 'git))
-                         (concat "git grep -HlI " search-term))
-                        (t
-                         ;; -r: recursive
-                         ;; -H: show filename for each match
-                         ;; -l: show only file names with matches
-                         ;; -I: no binary files
-                         (format "grep -rHlI %s ." search-term)))))
-        (projectile-files-from-cmd cmd directory))
-    ;; we have to reject directories as a workaround to work with git submodules
-    (cl-remove-if
-     #'file-directory-p
-     (mapcar #'projectile-expand-root (projectile-dir-files directory)))))
-
-;;;###autoload
-(defun projectile-replace (&optional arg)
-  "Replace literal string in project using non-regexp `tags-query-replace'.
-
-With a prefix argument ARG prompts you for a directory on which
-to run the replacement."
-  (interactive "P")
-  (let* ((old-text (read-string
-                    (projectile-prepend-project-name "Replace: ")
-                    (projectile-symbol-or-selection-at-point)))
-         (new-text (read-string
-                    (projectile-prepend-project-name
-                     (format "Replace %s with: " old-text))))
-         (directory (if arg
-                        (file-name-as-directory
-                         (read-directory-name "Replace in directory: "))
-                      (projectile-project-root)))
-         (files (projectile-files-with-string old-text directory)))
-    ;; Adapted from `tags-query-replace' for literal strings (not regexp)
-    (setq tags-loop-scan `(let ,(unless (equal old-text (downcase old-text))
-                                  '((case-fold-search nil)))
-                            (if (search-forward ',old-text nil t)
-                                ;; When we find a match, move back to
-                                ;; the beginning of it so
-                                ;; perform-replace will see it.
-                                (goto-char (match-beginning 0))))
-          tags-loop-operate `(perform-replace ',old-text ',new-text t nil nil
-                                              nil multi-query-replace-map))
-    (tags-loop-continue (or (cons 'list files) t))))
-
-;;;###autoload
-(defun projectile-replace-regexp (&optional arg)
-  "Replace a regexp in the project using `tags-query-replace'.
-
-With a prefix argument ARG prompts you for a directory on which
-to run the replacement."
-  (interactive "P")
-  (let* ((old-text (read-string
-                    (projectile-prepend-project-name "Replace regexp: ")
-                    (projectile-symbol-or-selection-at-point)))
-         (new-text (read-string
-                    (projectile-prepend-project-name
-                     (format "Replace regexp %s with: " old-text))))
-         (directory (if arg
-                        (file-name-as-directory
-                         (read-directory-name "Replace regexp in directory: "))
-                      (projectile-project-root)))
-         (files
-          ;; We have to reject directories as a workaround to work with git submodules.
-          ;;
-          ;; We can't narrow the list of files with
-          ;; `projectile-files-with-string' because those regexp tools
-          ;; don't support Emacs regular expressions.
-          (cl-remove-if
-           #'file-directory-p
-           (mapcar #'projectile-expand-root (projectile-dir-files directory)))))
-    (tags-query-replace old-text new-text nil (cons 'list files))))
-
-(defun projectile-symbol-or-selection-at-point ()
-  "Get the symbol or selected text at point."
-  (if (use-region-p)
-      (buffer-substring-no-properties (region-beginning) (region-end))
-    (projectile-symbol-at-point)))
-
-(defun projectile-symbol-at-point ()
-  "Get the symbol at point and strip its properties."
-  (substring-no-properties (or (thing-at-point 'symbol) "")))
-
-;;;###autoload
-(defun projectile-kill-buffers ()
-  "Kill all project buffers."
-  (interactive)
-  (let ((name (projectile-project-name))
-        (buffers (projectile-project-buffers)))
-    (if (yes-or-no-p
-         (format "Are you sure you want to kill %d buffer(s) for '%s'? "
-                 (length buffers) name))
-        ;; we take care not to kill indirect buffers directly
-        ;; as we might encounter them after their base buffers are killed
-        (mapc #'kill-buffer (cl-remove-if 'buffer-base-buffer buffers)))))
-
-;;;###autoload
-(defun projectile-save-project-buffers ()
-  "Save all project buffers."
-  (interactive)
-  (dolist (buf (projectile-project-buffers))
-    (with-current-buffer buf
-      (when buffer-file-name
-        (save-buffer)))))
-
-;;;###autoload
-(defun projectile-dired ()
-  "Open `dired' at the root of the project."
-  (interactive)
-  (dired (projectile-project-root)))
-
-;;;###autoload
-(defun projectile-dired-other-window ()
-  "Open `dired'  at the root of the project in another window."
-  (interactive)
-  (dired-other-window (projectile-project-root)))
-
-;;;###autoload
-(defun projectile-dired-other-frame ()
-  "Open `dired' at the root of the project in another frame."
-  (interactive)
-  (dired-other-frame (projectile-project-root)))
-
-;;;###autoload
-(defun projectile-vc (&optional project-root)
-  "Open `vc-dir' at the root of the project.
-
-For git projects `magit-status-internal' is used if available.
-For hg projects `monky-status' is used if available."
-  (interactive)
-  (or project-root (setq project-root (projectile-project-root)))
-  (let ((vcs (projectile-project-vcs project-root)))
-    (cl-case vcs
-      (git
-       (cond ((fboundp 'magit-status-internal)
-              (magit-status-internal project-root))
-             ((fboundp 'magit-status)
-              (with-no-warnings (magit-status project-root)))
-             (t
-              (vc-dir project-root))))
-      (hg
-       (if (fboundp 'monky-status)
-           (monky-status project-root)
-         (vc-dir project-root)))
-      (t (vc-dir project-root)))))
-
-;;;###autoload
-(defun projectile-recentf ()
-  "Show a list of recently visited files in a project."
-  (interactive)
-  (if (boundp 'recentf-list)
-      (find-file (projectile-expand-root
-                  (projectile-completing-read
-                   "Recently visited files: "
-                   (projectile-recentf-files))))
-    (message "recentf is not enabled")))
-
-(defun projectile-recentf-files ()
-  "Return a list of recently visited files in a project."
-  (and (boundp 'recentf-list)
-       (let ((project-root (projectile-project-root)))
-         (mapcar
-          (lambda (f) (file-relative-name f project-root))
-          (cl-remove-if-not
-           (lambda (f) (string-prefix-p project-root f))
-           recentf-list)))))
-
-(defun projectile-serialize-cache ()
-  "Serializes the memory cache to the hard drive."
-  (projectile-serialize projectile-projects-cache projectile-cache-file))
-
-(defvar projectile-compilation-cmd-map
-  (make-hash-table :test 'equal)
-  "A mapping between projects and the last compilation command used on them.")
-
-(defvar projectile-test-cmd-map
-  (make-hash-table :test 'equal)
-  "A mapping between projects and the last test command used on them.")
-
-(defvar projectile-run-cmd-map
-  (make-hash-table :test 'equal)
-  "A mapping between projects and the last run command used on them.")
-
-(defvar projectile-project-compilation-cmd nil
-  "The command to use with `projectile-compile-project'.
-It takes precedence over the default command for the project type when set.
-Should be set via .dir-locals.el.")
-
-(defvar projectile-project-compilation-dir nil
-  "The directory to use with `projectile-compile-project'.
-The directory path is relative to the project root.
-Should be set via .dir-locals.el.")
-
-(defvar projectile-project-test-cmd nil
-  "The command to use with `projectile-test-project'.
-It takes precedence over the default command for the project type when set.
-Should be set via .dir-locals.el.")
-
-(defvar projectile-project-run-cmd nil
-  "The command to use with `projectile-run-project'.
-It takes precedence over the default command for the project type when set.
-Should be set via .dir-locals.el.")
-
-(defun projectile-default-compilation-command (project-type)
-  "Retrieve default compilation command for PROJECT-TYPE."
-  (plist-get (gethash project-type projectile-project-types) 'compile-command))
-
-(defun projectile-default-test-command (project-type)
-  "Retrieve default test command for PROJECT-TYPE."
-  (plist-get (gethash project-type projectile-project-types) 'test-command))
-
-(defun projectile-default-run-command (project-type)
-  "Retrieve default run command for PROJECT-TYPE."
-  (plist-get (gethash project-type projectile-project-types) 'run-command))
-
-(defun projectile-compilation-command (compile-dir)
-  "Retrieve the compilation command for COMPILE-DIR."
-  (or (gethash compile-dir projectile-compilation-cmd-map)
-      projectile-project-compilation-cmd
-      (projectile-default-compilation-command (projectile-project-type))))
-
-(defun projectile-test-command (project)
-  "Retrieve the test command for PROJECT."
-  (or (gethash project projectile-test-cmd-map)
-      projectile-project-test-cmd
-      (projectile-default-test-command (projectile-project-type))))
-
-(defun projectile-run-command (project)
-  "Retrieve the run command for PROJECT."
-  (or (gethash project projectile-run-cmd-map)
-      projectile-project-run-cmd
-      (projectile-default-run-command (projectile-project-type))))
-
-(defun projectile-read-command (prompt command)
-  "Adapted from `compilation-read-command'."
-  (read-shell-command prompt command
-                      (if (equal (car compile-history) command)
-                          '(compile-history . 1)
-                        'compile-history)))
-
-(defun projectile-compilation-dir ()
-  "Choose the directory to use for project compilation."
-  (if projectile-project-compilation-dir
-      (file-truename
-       (concat (file-name-as-directory (projectile-project-root))
-               (file-name-as-directory projectile-project-compilation-dir)))
-    (projectile-project-root)))
-
-(defun projectile-maybe-read-command (arg default-cmd prompt)
-  "Prompt user for command unless DEFAULT-CMD is an Elisp function."
-  (if (and (or (stringp default-cmd) (null default-cmd))
-           (or compilation-read-command arg))
-      (projectile-read-command prompt default-cmd)
-    default-cmd))
-
-(defun projectile-run-compilation (cmd)
-  "Run external or Elisp compilation command CMD."
-  (if (functionp cmd)
-      (funcall cmd)
-    (compile cmd)))
-
-;;;###autoload
-(defun projectile-compile-project (arg &optional dir)
-  "Run project compilation command.
-
-Normally you'll be prompted for a compilation command, unless
-variable `compilation-read-command'.  You can force the prompt
-with a prefix ARG."
-  (interactive "P")
-  (let* ((project-root (projectile-project-root))
-         (default-directory (or dir (projectile-compilation-dir)))
-         (default-cmd (projectile-compilation-command default-directory))
-         (compilation-cmd (projectile-maybe-read-command arg default-cmd "Compile command: ")))
-    (puthash default-directory compilation-cmd projectile-compilation-cmd-map)
-    (save-some-buffers (not compilation-ask-about-save)
-                       (lambda ()
-                         (projectile-project-buffer-p (current-buffer)
-                                                      project-root)))
-    (projectile-run-compilation compilation-cmd)))
-
-(defadvice compilation-find-file (around projectile-compilation-find-file)
-  "Try to find a buffer for FILENAME, if we cannot find it,
-fallback to the original function."
-  (let ((filename (ad-get-arg 1))
-        full-filename)
-    (ad-set-arg 1
-                (or
-                 (if (file-exists-p (expand-file-name filename))
-                     filename)
-                 ;; Try to find the filename using projectile
-                 (and (projectile-project-p)
-                      (let ((root (projectile-project-root))
-                            (dirs (cons "" (projectile-current-project-dirs))))
-                        (when (setq full-filename
-                                    (car (cl-remove-if-not
-                                          #'file-exists-p
-                                          (mapcar
-                                           (lambda (f)
-                                             (expand-file-name
-                                              filename
-                                              (expand-file-name f root)))
-                                           dirs))))
-                          full-filename)))
-                 ;; Fall back to the old argument
-                 filename))
-    ad-do-it))
-
-;; TODO - factor this duplication out
-;;;###autoload
-(defun projectile-test-project (arg)
-  "Run project test command.
-
-Normally you'll be prompted for a compilation command, unless
-variable `compilation-read-command'.  You can force the prompt
-with a prefix ARG."
-  (interactive "P")
-  (let* ((project-root (projectile-project-root))
-         (default-cmd (projectile-test-command project-root))
-         (test-cmd (projectile-maybe-read-command arg default-cmd "Test command: "))
-         (default-directory project-root))
-    (puthash project-root test-cmd projectile-test-cmd-map)
-    (save-some-buffers (not compilation-ask-about-save)
-                       (lambda ()
-                         (projectile-project-buffer-p (current-buffer)
-                                                      project-root)))
-    (projectile-run-compilation test-cmd)))
-
-;;;###autoload
-(defun projectile-run-project (arg)
-  "Run project run command.
-
-Normally you'll be prompted for a compilation command, unless
-variable `compilation-read-command'.  You can force the prompt
-with a prefix ARG."
-  (interactive "P")
-  (let* ((project-root (projectile-project-root))
-         (default-cmd (projectile-run-command project-root))
-         (run-cmd (projectile-maybe-read-command arg default-cmd "Run command: "))
-         (default-directory project-root))
-    (puthash project-root run-cmd projectile-run-cmd-map)
-    (projectile-run-compilation run-cmd)))
-
-(defun projectile-open-projects ()
-  "Return a list of all open projects.
-An open project is a project with any open buffers."
-  (delete-dups
-   (delq nil
-         (mapcar (lambda (buffer)
-                   (with-current-buffer buffer
-                     (when (projectile-project-p)
-                       (abbreviate-file-name (projectile-project-root)))))
-                 (buffer-list)))))
-
-(defun projectile--remove-current-project (projects)
-  "Remove the current project (if any) from the list of PROJECTS."
-  (if (projectile-project-p)
-      (projectile-difference projects
-                             (list (abbreviate-file-name (projectile-project-root))))
-    projects))
-
-(defun projectile-relevant-known-projects ()
-  "Return a list of known projects except the current one (if present)."
-  (projectile--remove-current-project projectile-known-projects))
-
-(defun projectile-relevant-open-projects ()
-  "Return a list of open projects except the current one (if present)."
-  (projectile--remove-current-project (projectile-open-projects)))
-
-;;;###autoload
-(defun projectile-switch-project (&optional arg)
-  "Switch to a project we have visited before.
-Invokes the command referenced by `projectile-switch-project-action' on switch.
-With a prefix ARG invokes `projectile-commander' instead of
-`projectile-switch-project-action.'"
-  (interactive "P")
-  (let ((projects (projectile-relevant-known-projects)))
-    (if projects
-        (projectile-completing-read
-         "Switch to project: " projects
-         :action (lambda (project)
-                   (projectile-switch-project-by-name project arg)))
-      (user-error "There are no known projects"))))
-
-;;;###autoload
-(defun projectile-switch-open-project (&optional arg)
-  "Switch to a project we have currently opened.
-Invokes the command referenced by `projectile-switch-project-action' on switch.
-With a prefix ARG invokes `projectile-commander' instead of
-`projectile-switch-project-action.'"
-  (interactive "P")
-  (let ((projects (projectile-relevant-open-projects)))
-    (if projects
-        (projectile-switch-project-by-name
-         (projectile-completing-read "Switch to open project: " projects)
-         arg)
-      (user-error "There are no open projects"))))
-
-(defun projectile-switch-project-by-name (project-to-switch &optional arg)
-  "Switch to project by project name PROJECT-TO-SWITCH.
-Invokes the command referenced by `projectile-switch-project-action' on switch.
-With a prefix ARG invokes `projectile-commander' instead of
-`projectile-switch-project-action.'"
-  (let ((switch-project-action (if arg
-                                   'projectile-commander
-                                 projectile-switch-project-action)))
-    (run-hooks 'projectile-before-switch-project-hook)
-    (let ((default-directory project-to-switch))
-      ;; use a temporary buffer to load PROJECT-TO-SWITCH's dir-locals before calling SWITCH-PROJECT-ACTION
-      (with-temp-buffer
-        (hack-dir-local-variables-non-file-buffer))
-      ;; Normally the project name is determined from the current
-      ;; buffer. However, when we're switching projects, we want to
-      ;; show the name of the project being switched to, rather than
-      ;; the current project, in the minibuffer. This is a simple hack
-      ;; to tell the `projectile-project-name' function to ignore the
-      ;; current buffer and the caching mechanism, and just return the
-      ;; value of the `projectile-project-name' variable.  We also
-      ;; need to ignore the cached project-root value otherwise we end
-      ;; up still showing files from the current project rather than
-      ;; the new project
-      (let ((projectile-cached-project-root nil)
-            (projectile-project-name (funcall projectile-project-name-function
-                                              project-to-switch)))
-        (funcall switch-project-action)))
-    (run-hooks 'projectile-after-switch-project-hook)))
-
-;;;###autoload
-(defun projectile-find-file-in-directory (&optional directory)
-  "Jump to a file in a (maybe regular) DIRECTORY.
-
-This command will first prompt for the directory the file is in."
-  (interactive "DFind file in directory: ")
-  (let ((default-directory directory)
-        (projectile-require-project-root nil))
-    (if (projectile-project-p)
-        ;; target directory is in a project
-        (let ((file (projectile-completing-read "Find file: "
-                                                (projectile-dir-files directory))))
-          (find-file (expand-file-name file (projectile-project-root)))
-          (run-hooks 'projectile-find-file-hook))
-      ;; target directory is not in a project
-      (projectile-find-file))))
-
-(defun projectile-all-project-files ()
-  "Get a list of all files in all projects."
-  (cl-mapcan
-   (lambda (project)
-     (when (file-exists-p project)
-       (let ((default-directory project)
-             (projectile-cached-project-root nil))
-         (mapcar (lambda (file)
-                   (expand-file-name file project))
-                 (projectile-current-project-files)))))
-   projectile-known-projects))
-
-;;;###autoload
-(defun projectile-find-file-in-known-projects ()
-  "Jump to a file in any of the known projects."
-  (interactive)
-  (let ((projectile-require-project-root nil))
-    (find-file (projectile-completing-read "Find file in projects: " (projectile-all-project-files)))))
-
-(defcustom projectile-after-switch-project-hook nil
-  "Hooks run right after project is switched."
-  :group 'projectile
-  :type 'hook)
-
-(defcustom projectile-before-switch-project-hook nil
-  "Hooks run when right before project is switched."
-  :group 'projectile
-  :type 'hook)
-
-(defun projectile-keep-project-p (project)
-  "Determine whether we should cleanup (remove) PROJECT or not.
-
-It handles the case of remote projects as well.
-See `projectile-cleanup-known-projects'."
-  ;; Taken from from `recentf-keep-default-predicate'
-  (cond
-   ((file-remote-p project nil t) (file-readable-p project))
-   ((file-remote-p project))
-   ((file-readable-p project))))
-
-;;;###autoload
-(defun projectile-cleanup-known-projects ()
-  "Remove known projects that don't exist anymore."
-  (interactive)
-  (projectile-merge-known-projects)
-  (let ((projects-kept (cl-remove-if-not #'projectile-keep-project-p projectile-known-projects))
-        (projects-removed (cl-remove-if #'projectile-keep-project-p projectile-known-projects)))
-    (setq projectile-known-projects projects-kept)
-    (projectile-merge-known-projects)
-    (if projects-removed
-        (message "Projects removed: %s"
-                 (mapconcat #'identity projects-removed ", "))
-      (message "No projects needed to be removed."))))
-
-;;;###autoload
-(defun projectile-clear-known-projects ()
-  "Clear both `projectile-known-projects' and `projectile-known-projects-file'."
-  (interactive)
-  (setq projectile-known-projects nil)
-  (projectile-save-known-projects))
-
-;;;###autoload
-(defun projectile-remove-known-project (&optional project)
-  "Remove PROJECT from the list of known projects."
-  (interactive (list (projectile-completing-read
-                      "Remove from known projects: " projectile-known-projects
-                      :action 'projectile-remove-known-project)))
-  (unless (called-interactively-p 'any)
-    (setq projectile-known-projects
-          (cl-remove-if
-           (lambda (proj) (string= project proj))
-           projectile-known-projects))
-    (projectile-merge-known-projects)
-    (when projectile-verbose
-      (message "Project %s removed from the list of known projects." project))))
-
-;;;###autoload
-(defun projectile-remove-current-project-from-known-projects ()
-  "Remove the current project from the list of known projects."
-  (interactive)
-  (projectile-remove-known-project (abbreviate-file-name (projectile-project-root))))
-
-(defun projectile-ignored-projects ()
-  "A list of projects that should not be save in `projectile-known-projects'."
-  (mapcar #'file-truename projectile-ignored-projects))
-
-(defun projectile-ignored-project-p (project-root)
-  "Return t if PROJECT-ROOT should not be added to `projectile-known-projects'."
-  (or (member project-root (projectile-ignored-projects))
-      (and (functionp projectile-ignored-project-function)
-           (funcall projectile-ignored-project-function project-root))))
-
-(defun projectile-add-known-project (project-root)
-  "Add PROJECT-ROOT to the list of known projects."
-  (interactive (list (read-directory-name "Add to known projects: ")))
-  (unless (projectile-ignored-project-p project-root)
-    (setq projectile-known-projects
-          (delete-dups
-           (cons (abbreviate-file-name project-root)
-                 projectile-known-projects)))))
-
-(defun projectile-load-known-projects ()
-  "Load saved projects from `projectile-known-projects-file'.
-Also set `projectile-known-projects'."
-  (setq projectile-known-projects
-        (projectile-unserialize projectile-known-projects-file))
-  (setq projectile-known-projects-on-file
-        (and (sequencep projectile-known-projects)
-             (copy-sequence projectile-known-projects))))
-
-;; load the known projects
-(projectile-load-known-projects)
-
-(defun projectile-save-known-projects ()
-  "Save PROJECTILE-KNOWN-PROJECTS to PROJECTILE-KNOWN-PROJECTS-FILE."
-  (projectile-serialize projectile-known-projects
-                        projectile-known-projects-file)
-  (setq projectile-known-projects-on-file
-        (and (sequencep projectile-known-projects)
-             (copy-sequence projectile-known-projects))))
-
-(defun projectile-merge-known-projects ()
-  "Merge any change from `projectile-known-projects-file' and save to disk.
-
-This enables multiple Emacs processes to make changes without
-overwriting each other's changes."
-  (let* ((known-now projectile-known-projects)
-         (known-on-last-sync projectile-known-projects-on-file)
-         (known-on-file
-          (projectile-unserialize projectile-known-projects-file))
-         (removed-after-sync (projectile-difference known-on-last-sync known-now))
-         (removed-in-other-process
-          (projectile-difference known-on-last-sync known-on-file))
-         (result (delete-dups
-                  (projectile-difference
-                   (append known-now known-on-file)
-                   (append removed-after-sync removed-in-other-process)))))
-    (setq projectile-known-projects result)
-    (projectile-save-known-projects)))
-
-(define-ibuffer-filter projectile-files
-    "Show Ibuffer with all buffers in the current project."
-  (:reader (read-directory-name "Project root: " (ignore-errors (projectile-project-root)))
-           :description nil)
-  (with-current-buffer buf
-    (equal (file-name-as-directory (expand-file-name qualifier))
-           (ignore-errors (projectile-project-root)))))
-
-(defun projectile-ibuffer-by-project (project-root)
-  "Open an IBuffer window showing all buffers in PROJECT-ROOT."
-  (let ((project-name (funcall projectile-project-name-function project-root)))
-    (ibuffer nil (format "*%s Buffers*" project-name)
-             (list (cons 'projectile-files project-root)))))
-
-;;;###autoload
-(defun projectile-ibuffer (prefix)
-  "Open an IBuffer window showing all buffers in the current project.
-
-Let user choose another project when PREFIX is supplied."
-  (interactive "p")
-  (let ((project-root (if (= prefix 4)
-                          (projectile-completing-read
-                           "Project name: "
-                           (projectile-relevant-known-projects))
-                        (projectile-project-root))))
-
-    (projectile-ibuffer-by-project project-root)))
-
-;;;; projectile-commander
-
-(defconst projectile-commander-help-buffer "*Commander Help*")
-
-(defvar projectile-commander-methods nil
-  "List of file-selection methods for the `projectile-commander' command.
-Each element is a list (KEY DESCRIPTION FUNCTION).
-DESCRIPTION is a one-line description of what the key selects.")
-
-;;;###autoload
-(defun projectile-commander ()
-  "Execute a Projectile command with a single letter.
-The user is prompted for a single character indicating the action to invoke.
-The `?' character describes then
-available actions.
-
-See `def-projectile-commander-method' for defining new methods."
-  (interactive)
-  (let* ((choices (mapcar #'car projectile-commander-methods))
-         (prompt (concat "Commander [" choices "]: "))
-         (ch (read-char-choice prompt choices))
-         (fn (nth 2 (assq ch projectile-commander-methods))))
-    (funcall fn)))
-
-(defmacro def-projectile-commander-method (key description &rest body)
-  "Define a new `projectile-commander' method.
-
-KEY is the key the user will enter to choose this method.
-
-DESCRIPTION is a one-line sentence describing how the method.
-
-BODY is a series of forms which are evaluated when the find
-is chosen."
-  (let ((method `(lambda ()
-                   ,@body)))
-    `(setq projectile-commander-methods
-           (cl-sort (copy-sequence
-                     (cons (list ,key ,description ,method)
-                           (assq-delete-all ,key projectile-commander-methods)))
-                    (lambda (a b) (< (car a) (car b)))))))
-
-(def-projectile-commander-method ?? "Commander help buffer."
-  (ignore-errors (kill-buffer projectile-commander-help-buffer))
-  (with-current-buffer (get-buffer-create projectile-commander-help-buffer)
-    (insert "Projectile Commander Methods:\n\n")
-    (dolist (met projectile-commander-methods)
-      (insert (format "%c:\t%s\n" (car met) (cadr met))))
-    (goto-char (point-min))
-    (help-mode)
-    (display-buffer (current-buffer) t))
-  (projectile-commander))
-
-(defun projectile-commander-bindings ()
-  (def-projectile-commander-method ?A
-    "Find ag on project."
-    (call-interactively 'projectile-ag))
-
-  (def-projectile-commander-method ?f
-    "Find file in project."
-    (projectile-find-file))
-
-  (def-projectile-commander-method ?T
-    "Find test file in project."
-    (projectile-find-test-file))
-
-  (def-projectile-commander-method ?b
-    "Switch to project buffer."
-    (projectile-switch-to-buffer))
-
-  (def-projectile-commander-method ?d
-    "Find directory in project."
-    (projectile-find-dir))
-
-  (def-projectile-commander-method ?D
-    "Open project root in dired."
-    (projectile-dired))
-
-  (def-projectile-commander-method ?v
-    "Open project root in vc-dir or magit."
-    (projectile-vc))
-
-  (def-projectile-commander-method ?V
-    "Browse dirty projects"
-    (projectile-browse-dirty-projects))
-
-  (def-projectile-commander-method ?r
-    "Replace a string in the project."
-    (projectile-replace))
-
-  (def-projectile-commander-method ?R
-    "Regenerate the project's [e|g]tags."
-    (projectile-regenerate-tags))
-
-  (def-projectile-commander-method ?g
-    "Run grep on project."
-    (projectile-grep))
-
-  (def-projectile-commander-method ?s
-    "Switch project."
-    (projectile-switch-project))
-
-  (def-projectile-commander-method ?o
-    "Run multi-occur on project buffers."
-    (projectile-multi-occur))
-
-  (def-projectile-commander-method ?j
-    "Find tag in project."
-    (projectile-find-tag))
-
-  (def-projectile-commander-method ?k
-    "Kill all project buffers."
-    (projectile-kill-buffers))
-
-  (def-projectile-commander-method ?e
-    "Find recently visited file in project."
-    (projectile-recentf)))
-
-(projectile-commander-bindings)
-
-(defun projectile-read-variable ()
-  "Prompt for a variable and return its name."
-  (completing-read "Variable: "
-                   obarray
-                   '(lambda (v)
-                      (and (boundp v) (not (keywordp v))))
-                   t))
-
-(define-skeleton projectile-skel-variable-cons
-  "Insert a variable-name and a value in a cons-cell."
-  "Value: "
-  "("
-  (projectile-read-variable)
-  " . "
-  str
-  ")")
-
-(define-skeleton projectile-skel-dir-locals
-  "Insert a .dir-locals.el template."
-  nil
-  "((nil . ("
-  ("" '(projectile-skel-variable-cons) \n)
-  resume:
-  ")))")
-
-;;;###autoload
-(defun projectile-edit-dir-locals ()
-  "Edit or create a .dir-locals.el file of the project."
-  (interactive)
-  (let ((file (expand-file-name ".dir-locals.el" (projectile-project-root))))
-    (find-file file)
-    (when (not (file-exists-p file))
-      (unwind-protect
-          (projectile-skel-dir-locals)
-        (save-buffer)))))
-
-;;; Minor mode
-(defvar projectile-command-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "4 a") #'projectile-find-other-file-other-window)
-    (define-key map (kbd "4 b") #'projectile-switch-to-buffer-other-window)
-    (define-key map (kbd "4 C-o") #'projectile-display-buffer)
-    (define-key map (kbd "4 d") #'projectile-find-dir-other-window)
-    (define-key map (kbd "4 D") #'projectile-dired-other-window)
-    (define-key map (kbd "4 f") #'projectile-find-file-other-window)
-    (define-key map (kbd "4 g") #'projectile-find-file-dwim-other-window)
-    (define-key map (kbd "4 t") #'projectile-find-implementation-or-test-other-window)
-    (define-key map (kbd "5 a") #'projectile-find-other-file-other-frame)
-    (define-key map (kbd "5 b") #'projectile-switch-to-buffer-other-frame)
-    (define-key map (kbd "5 d") #'projectile-find-dir-other-frame)
-    (define-key map (kbd "5 D") #'projectile-dired-other-frame)
-    (define-key map (kbd "5 f") #'projectile-find-file-other-frame)
-    (define-key map (kbd "5 g") #'projectile-find-file-dwim-other-frame)
-    (define-key map (kbd "5 t") #'projectile-find-implementation-or-test-other-frame)
-    (define-key map (kbd "!") #'projectile-run-shell-command-in-root)
-    (define-key map (kbd "&") #'projectile-run-async-shell-command-in-root)
-    (define-key map (kbd "a") #'projectile-find-other-file)
-    (define-key map (kbd "b") #'projectile-switch-to-buffer)
-    (define-key map (kbd "c") #'projectile-compile-project)
-    (define-key map (kbd "d") #'projectile-find-dir)
-    (define-key map (kbd "D") #'projectile-dired)
-    (define-key map (kbd "e") #'projectile-recentf)
-    (define-key map (kbd "E") #'projectile-edit-dir-locals)
-    (define-key map (kbd "f") #'projectile-find-file)
-    (define-key map (kbd "g") #'projectile-find-file-dwim)
-    (define-key map (kbd "F") #'projectile-find-file-in-known-projects)
-    (define-key map (kbd "i") #'projectile-invalidate-cache)
-    (define-key map (kbd "I") #'projectile-ibuffer)
-    (define-key map (kbd "j") #'projectile-find-tag)
-    (define-key map (kbd "k") #'projectile-kill-buffers)
-    (define-key map (kbd "l") #'projectile-find-file-in-directory)
-    (define-key map (kbd "m") #'projectile-commander)
-    (define-key map (kbd "o") #'projectile-multi-occur)
-    (define-key map (kbd "p") #'projectile-switch-project)
-    (define-key map (kbd "q") #'projectile-switch-open-project)
-    (define-key map (kbd "P") #'projectile-test-project)
-    (define-key map (kbd "r") #'projectile-replace)
-    (define-key map (kbd "R") #'projectile-regenerate-tags)
-    (define-key map (kbd "s g") #'projectile-grep)
-    (define-key map (kbd "s s") #'projectile-ag)
-    (define-key map (kbd "S") #'projectile-save-project-buffers)
-    (define-key map (kbd "t") #'projectile-toggle-between-implementation-and-test)
-    (define-key map (kbd "T") #'projectile-find-test-file)
-    (define-key map (kbd "u") #'projectile-run-project)
-    (define-key map (kbd "v") #'projectile-vc)
-    (define-key map (kbd "V") #'projectile-browse-dirty-projects)
-    (define-key map (kbd "x e") #'projectile-run-eshell)
-    (define-key map (kbd "x t") #'projectile-run-term)
-    (define-key map (kbd "x s") #'projectile-run-shell)
-    (define-key map (kbd "z") #'projectile-cache-current-file)
-    (define-key map (kbd "ESC") #'projectile-project-buffers-other-buffer)
-    map)
-  "Keymap for Projectile commands after `projectile-keymap-prefix'.")
-(fset 'projectile-command-map projectile-command-map)
-
-(defvar projectile-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map projectile-keymap-prefix 'projectile-command-map)
-    map)
-  "Keymap for Projectile mode.")
-
-(easy-menu-change
- '("Tools") "Projectile"
- '(["Find file" projectile-find-file]
-   ["Find file in known projects" projectile-find-file-in-known-projects]
-   ["Find test file" projectile-find-test-file]
-   ["Find directory" projectile-find-dir]
-   ["Find file in directory" projectile-find-file-in-directory]
-   ["Find other file" projectile-find-other-file]
-   ["Switch to buffer" projectile-switch-to-buffer]
-   ["Jump between implementation file and test file" projectile-toggle-between-implementation-and-test]
-   ["Kill project buffers" projectile-kill-buffers]
-   ["Recent files" projectile-recentf]
-   ["Edit .dir-locals.el" projectile-edit-dir-locals]
-   "--"
-   ["Open project in dired" projectile-dired]
-   ["Switch to project" projectile-switch-project]
-   ["Switch to open project" projectile-switch-open-project]
-   ["Discover projects in directory" projectile-discover-projects-in-directory]
-   ["Search in project (grep)" projectile-grep]
-   ["Search in project (ag)" projectile-ag]
-   ["Replace in project" projectile-replace]
-   ["Multi-occur in project" projectile-multi-occur]
-   ["Browse dirty projects" projectile-browse-dirty-projects]
-   "--"
-   ["Run shell" projectile-run-shell]
-   ["Run eshell" projectile-run-eshell]
-   ["Run term" projectile-run-term]
-   "--"
-   ["Cache current file" projectile-cache-current-file]
-   ["Invalidate cache" projectile-invalidate-cache]
-   ["Regenerate [e|g]tags" projectile-regenerate-tags]
-   "--"
-   ["Compile project" projectile-compile-project]
-   ["Test project" projectile-test-project]
-   ["Run project" projectile-run-project]
-   "--"
-   ["Project info" projectile-project-info]
-   ["About" projectile-version])
- "Search Files (Grep)...")
-
-(easy-menu-change '("Tools") "--" nil "Search Files (Grep)...")
-
-;;;###autoload
-(defcustom projectile-mode-line
-  '(:eval (format " Projectile[%s]" (projectile-project-name)))
-  "Mode line lighter for Projectile.
-
-The value of this variable is a mode line template as in
-`mode-line-format'.  See Info Node `(elisp)Mode Line Format' for
-details about mode line templates.
-
-Customize this variable to change how Projectile displays its
-status in the mode line.  The default value displays the project
-name.  Set this variable to nil to disable the mode line
-entirely."
-  :group 'projectile
-  :type 'sexp
-  :risky t
-  :package-version '(projectile . "0.12.0"))
-
-(defun projectile-find-file-hook-function ()
-  "Called by `find-file-hook' when `projectile-mode' is on.
-
-The function does pretty much nothing when triggered on remote files
-as all the operations it normally performs are extremely slow over
-tramp."
-  (unless (file-remote-p default-directory)
-    (projectile-cache-files-find-file-hook)
-    (projectile-track-known-projects-find-file-hook)
-    (projectile-visit-project-tags-table)))
-
-;;;###autoload
-(define-minor-mode projectile-mode
-  "Minor mode to assist project management and navigation.
-
-When called interactively, toggle `projectile-mode'.  With prefix
-ARG, enable `projectile-mode' if ARG is positive, otherwise disable
-it.
-
-When called from Lisp, enable `projectile-mode' if ARG is omitted,
-nil or positive.  If ARG is `toggle', toggle `projectile-mode'.
-Otherwise behave as if called interactively.
-
-\\{projectile-mode-map}"
-  :lighter projectile-mode-line
-  :keymap projectile-mode-map
-  :group 'projectile
-  :require 'projectile
-  :global t
-  (cond
-   (projectile-mode
-    ;; initialize the projects cache if needed
-    (unless projectile-projects-cache
-      (setq projectile-projects-cache
-            (or (projectile-unserialize projectile-cache-file)
-                (make-hash-table :test 'equal))))
-    (add-hook 'find-file-hook 'projectile-find-file-hook-function)
-    (add-hook 'projectile-find-dir-hook #'projectile-track-known-projects-find-file-hook t)
-    (add-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook t t)
-    (ad-activate 'compilation-find-file)
-    (ad-activate 'delete-file))
-   (t
-    (remove-hook 'find-file-hook #'projectile-find-file-hook-function)
-    (remove-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook t)
-    (ad-deactivate 'compilation-find-file)
-    (ad-deactivate 'delete-file))))
-
-;;;###autoload
-(define-obsolete-function-alias 'projectile-global-mode 'projectile-mode)
-
-(provide 'projectile)
-
-;; Local Variables:
-;; indent-tabs-mode: nil
-;; End:
-
-;;; projectile.el ends here
.emacs.d/elpa/projectile-20170917.410/projectile.elc
Binary file
.emacs.d/elpa/s-20170906.1304/s-autoloads.el
@@ -1,15 +0,0 @@
-;;; s-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil nil ("s.el") (22970 55043 602679 488000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; s-autoloads.el ends here
.emacs.d/elpa/s-20170906.1304/s-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "s" "20170906.1304" "The long lost Emacs string manipulation library." 'nil :commit "3a95064647d1f39b90e65a56f1fdfceb7c329f75" :keywords '("strings"))
.emacs.d/elpa/s-20170906.1304/s.el
@@ -1,642 +0,0 @@
-;;; s.el --- The long lost Emacs string manipulation library.
-
-;; Copyright (C) 2012-2015 Magnar Sveen
-
-;; Author: Magnar Sveen <magnars@gmail.com>
-;; Version: 1.10.0
-;; Package-Version: 20170906.1304
-;; Keywords: strings
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; The long lost Emacs string manipulation library.
-;;
-;; See documentation on https://github.com/magnars/s.el#functions
-
-;;; Code:
-
-;; Silence byte-compiler
-(defvar ucs-normalize-combining-chars)  ; Defined in `ucs-normalize'
-(autoload 'slot-value "eieio")
-
-(defun s-trim-left (s)
-  "Remove whitespace at the beginning of S."
-  (save-match-data
-    (if (string-match "\\`[ \t\n\r]+" s)
-        (replace-match "" t t s)
-      s)))
-
-(defun s-trim-right (s)
-  "Remove whitespace at the end of S."
-  (save-match-data
-    (if (string-match "[ \t\n\r]+\\'" s)
-        (replace-match "" t t s)
-      s)))
-
-(defun s-trim (s)
-  "Remove whitespace at the beginning and end of S."
-  (s-trim-left (s-trim-right s)))
-
-(defun s-collapse-whitespace (s)
-  "Convert all adjacent whitespace characters to a single space."
-  (replace-regexp-in-string "[ \t\n\r]+" " " s))
-
-(defun s-split (separator s &optional omit-nulls)
-  "Split S into substrings bounded by matches for regexp SEPARATOR.
-If OMIT-NULLS is non-nil, zero-length substrings are omitted.
-
-This is a simple wrapper around the built-in `split-string'."
-  (save-match-data
-    (split-string s separator omit-nulls)))
-
-(defun s-split-up-to (separator s n &optional omit-nulls)
-  "Split S up to N times into substrings bounded by matches for regexp SEPARATOR.
-
-If OMIT-NULLS is non-nil, zero-length substrings are omitted.
-
-See also `s-split'."
-  (save-match-data
-    (let ((op 0)
-          (r nil))
-      (with-temp-buffer
-        (insert s)
-        (setq op (goto-char (point-min)))
-        (while (and (re-search-forward separator nil t)
-                    (< 0 n))
-          (let ((sub (buffer-substring op (match-beginning 0))))
-            (unless (and omit-nulls
-                         (equal sub ""))
-              (push sub r)))
-          (setq op (goto-char (match-end 0)))
-          (setq n (1- n)))
-        (let ((sub (buffer-substring op (point-max))))
-          (unless (and omit-nulls
-                       (equal sub ""))
-            (push sub r))))
-      (nreverse r))))
-
-(defun s-lines (s)
-  "Splits S into a list of strings on newline characters."
-  (s-split "\\(\r\n\\|[\n\r]\\)" s))
-
-(defun s-join (separator strings)
-  "Join all the strings in STRINGS with SEPARATOR in between."
-  (mapconcat 'identity strings separator))
-
-(defun s-concat (&rest strings)
-  "Join all the string arguments into one string."
-  (apply 'concat strings))
-
-(defun s-prepend (prefix s)
-  "Concatenate PREFIX and S."
-  (concat prefix s))
-
-(defun s-append (suffix s)
-  "Concatenate S and SUFFIX."
-  (concat s suffix))
-
-(defun s-repeat (num s)
-  "Make a string of S repeated NUM times."
-  (let (ss)
-    (while (> num 0)
-      (setq ss (cons s ss))
-      (setq num (1- num)))
-    (apply 'concat ss)))
-
-(defun s-chop-suffix (suffix s)
-  "Remove SUFFIX if it is at end of S."
-  (let ((pos (- (length suffix))))
-    (if (and (>= (length s) (length suffix))
-             (string= suffix (substring s pos)))
-        (substring s 0 pos)
-      s)))
-
-(defun s-chop-suffixes (suffixes s)
-  "Remove SUFFIXES one by one in order, if they are at the end of S."
-  (while suffixes
-    (setq s (s-chop-suffix (car suffixes) s))
-    (setq suffixes (cdr suffixes)))
-  s)
-
-(defun s-chop-prefix (prefix s)
-  "Remove PREFIX if it is at the start of S."
-  (let ((pos (length prefix)))
-    (if (and (>= (length s) (length prefix))
-             (string= prefix (substring s 0 pos)))
-        (substring s pos)
-      s)))
-
-(defun s-chop-prefixes (prefixes s)
-  "Remove PREFIXES one by one in order, if they are at the start of S."
-  (while prefixes
-    (setq s (s-chop-prefix (car prefixes) s))
-    (setq prefixes (cdr prefixes)))
-  s)
-
-(defun s-shared-start (s1 s2)
-  "Returns the longest prefix S1 and S2 have in common."
-  (let ((search-length (min (length s1) (length s2)))
-        (i 0))
-    (while (and (< i search-length)
-                (= (aref s1 i) (aref s2 i)))
-      (setq i (1+ i)))
-    (substring s1 0 i)))
-
-(defun s-shared-end (s1 s2)
-  "Returns the longest suffix S1 and S2 have in common."
-  (let* ((l1 (length s1))
-         (l2 (length s2))
-         (search-length (min l1 l2))
-         (i 0))
-    (while (and (< i search-length)
-                (= (aref s1 (- l1 i 1)) (aref s2 (- l2 i 1))))
-      (setq i (1+ i)))
-    ;; If I is 0, then it means that there's no common suffix between
-    ;; S1 and S2.
-    ;;
-    ;; However, since (substring s (- 0)) will return the whole
-    ;; string, `s-shared-end' should simply return the empty string
-    ;; when I is 0.
-    (if (zerop i)
-        ""
-      (substring s1 (- i)))))
-
-(defun s-chomp (s)
-  "Remove one trailing `\\n`, `\\r` or `\\r\\n` from S."
-  (s-chop-suffixes '("\n" "\r") s))
-
-(defun s-truncate (len s)
-  "If S is longer than LEN, cut it down to LEN - 3 and add ... at the end."
-  (if (> (length s) len)
-      (format "%s..." (substring s 0 (- len 3)))
-    s))
-
-(defun s-word-wrap (len s)
-  "If S is longer than LEN, wrap the words with newlines."
-  (save-match-data
-    (with-temp-buffer
-      (insert s)
-      (let ((fill-column len))
-        (fill-region (point-min) (point-max)))
-      (buffer-substring (point-min) (point-max)))))
-
-(defun s-center (len s)
-  "If S is shorter than LEN, pad it with spaces so it is centered."
-  (let ((extra (max 0 (- len (length s)))))
-    (concat
-     (make-string (ceiling extra 2) ? )
-     s
-     (make-string (floor extra 2) ? ))))
-
-(defun s-pad-left (len padding s)
-  "If S is shorter than LEN, pad it with PADDING on the left."
-  (let ((extra (max 0 (- len (length s)))))
-    (concat (make-string extra (string-to-char padding))
-            s)))
-
-(defun s-pad-right (len padding s)
-  "If S is shorter than LEN, pad it with PADDING on the right."
-  (let ((extra (max 0 (- len (length s)))))
-    (concat s
-            (make-string extra (string-to-char padding)))))
-
-(defun s-left (len s)
-  "Returns up to the LEN first chars of S."
-  (if (> (length s) len)
-      (substring s 0 len)
-    s))
-
-(defun s-right (len s)
-  "Returns up to the LEN last chars of S."
-  (let ((l (length s)))
-    (if (> l len)
-        (substring s (- l len) l)
-      s)))
-
-(defun s-ends-with? (suffix s &optional ignore-case)
-  "Does S end with SUFFIX?
-
-If IGNORE-CASE is non-nil, the comparison is done without paying
-attention to case differences.
-
-Alias: `s-suffix?'"
-  (let ((start-pos (- (length s) (length suffix))))
-    (and (>= start-pos 0)
-         (eq t (compare-strings suffix nil nil
-                                s start-pos nil ignore-case)))))
-
-(defun s-starts-with? (prefix s &optional ignore-case)
-  "Does S start with PREFIX?
-
-If IGNORE-CASE is non-nil, the comparison is done without paying
-attention to case differences.
-
-Alias: `s-prefix?'. This is a simple wrapper around the built-in
-`string-prefix-p'."
-  (string-prefix-p prefix s ignore-case))
-
-(defun s--truthy? (val)
-  (not (null val)))
-
-(defun s-contains? (needle s &optional ignore-case)
-  "Does S contain NEEDLE?
-
-If IGNORE-CASE is non-nil, the comparison is done without paying
-attention to case differences."
-  (let ((case-fold-search ignore-case))
-    (s--truthy? (string-match-p (regexp-quote needle) s))))
-
-(defun s-equals? (s1 s2)
-  "Is S1 equal to S2?
-
-This is a simple wrapper around the built-in `string-equal'."
-  (string-equal s1 s2))
-
-(defun s-less? (s1 s2)
-  "Is S1 less than S2?
-
-This is a simple wrapper around the built-in `string-lessp'."
-  (string-lessp s1 s2))
-
-(defun s-matches? (regexp s &optional start)
-  "Does REGEXP match S?
-If START is non-nil the search starts at that index.
-
-This is a simple wrapper around the built-in `string-match-p'."
-  (s--truthy? (string-match-p regexp s start)))
-
-(defun s-blank? (s)
-  "Is S nil or the empty string?"
-  (or (null s) (string= "" s)))
-
-(defun s-blank-str? (s)
-  "Is S nil or the empty string or string only contains whitespace?"
-  (or (s-blank? s) (s-blank? (s-trim s))))
-
-(defun s-present? (s)
-  "Is S anything but nil or the empty string?"
-  (not (s-blank? s)))
-
-(defun s-presence (s)
-  "Return S if it's `s-present?', otherwise return nil."
-  (and (s-present? s) s))
-
-(defun s-lowercase? (s)
-  "Are all the letters in S in lower case?"
-  (let ((case-fold-search nil))
-    (not (string-match-p "[[:upper:]]" s))))
-
-(defun s-uppercase? (s)
-  "Are all the letters in S in upper case?"
-  (let ((case-fold-search nil))
-    (not (string-match-p "[[:lower:]]" s))))
-
-(defun s-mixedcase? (s)
-  "Are there both lower case and upper case letters in S?"
-  (let ((case-fold-search nil))
-    (s--truthy?
-     (and (string-match-p "[[:lower:]]" s)
-          (string-match-p "[[:upper:]]" s)))))
-
-(defun s-capitalized? (s)
-  "In S, is the first letter upper case, and all other letters lower case?"
-  (let ((case-fold-search nil))
-    (s--truthy?
-     (string-match-p "^[[:upper:]][^[:upper:]]*$" s))))
-
-(defun s-numeric? (s)
-  "Is S a number?"
-  (s--truthy?
-   (string-match-p "^[0-9]+$" s)))
-
-(defun s-replace (old new s)
-  "Replaces OLD with NEW in S."
-  (replace-regexp-in-string (regexp-quote old) new s t t))
-
-(defun s--aget (alist key)
-  (cdr (assoc-string key alist)))
-
-(defun s-replace-all (replacements s)
-  "REPLACEMENTS is a list of cons-cells. Each `car` is replaced with `cdr` in S."
-  (replace-regexp-in-string (regexp-opt (mapcar 'car replacements))
-                            (lambda (it) (s--aget replacements it))
-                            s t t))
-
-(defun s-downcase (s)
-  "Convert S to lower case.
-
-This is a simple wrapper around the built-in `downcase'."
-  (downcase s))
-
-(defun s-upcase (s)
-  "Convert S to upper case.
-
-This is a simple wrapper around the built-in `upcase'."
-  (upcase s))
-
-(defun s-capitalize (s)
-  "Convert the first word's first character to upper case and the rest to lower case in S."
-  (concat (upcase (substring s 0 1)) (downcase (substring s 1))))
-
-(defun s-titleize (s)
-  "Convert each word's first character to upper case and the rest to lower case in S.
-
-This is a simple wrapper around the built-in `capitalize'."
-  (capitalize s))
-
-(defmacro s-with (s form &rest more)
-  "Threads S through the forms. Inserts S 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."
-  (declare (debug (form &rest [&or (function &rest form) fboundp])))
-  (if (null more)
-      (if (listp form)
-          `(,(car form) ,@(cdr form) ,s)
-        (list form s))
-    `(s-with (s-with ,s ,form) ,@more)))
-
-(put 's-with 'lisp-indent-function 1)
-
-(defun s-index-of (needle s &optional ignore-case)
-  "Returns first index of NEEDLE in S, or nil.
-
-If IGNORE-CASE is non-nil, the comparison is done without paying
-attention to case differences."
-  (let ((case-fold-search ignore-case))
-    (string-match-p (regexp-quote needle) s)))
-
-(defun s-reverse (s)
-  "Return the reverse of S."
-  (save-match-data
-    (if (multibyte-string-p s)
-        (let ((input (string-to-list s))
-              output)
-          (require 'ucs-normalize)
-          (while input
-            ;; Handle entire grapheme cluster as a single unit
-            (let ((grapheme (list (pop input))))
-              (while (memql (car input) ucs-normalize-combining-chars)
-                (push (pop input) grapheme))
-              (setq output (nconc (nreverse grapheme) output))))
-          (concat output))
-      (concat (nreverse (string-to-list s))))))
-
-(defun s-match-strings-all (regex string)
-  "Return a list of matches for REGEX in STRING.
-
-Each element itself is a list of matches, as per
-`match-string'. Multiple matches at the same position will be
-ignored after the first."
-  (save-match-data
-    (let ((all-strings ())
-          (i 0))
-      (while (and (< i (length string))
-                  (string-match regex string i))
-        (setq i (1+ (match-beginning 0)))
-        (let (strings
-              (num-matches (/ (length (match-data)) 2))
-              (match 0))
-          (while (/= match num-matches)
-            (push (match-string match string) strings)
-            (setq match (1+ match)))
-          (push (nreverse strings) all-strings)))
-      (nreverse all-strings))))
-
-(defun s-matched-positions-all (regexp string &optional subexp-depth)
-  "Return a list of matched positions for REGEXP in STRING.
-SUBEXP-DEPTH is 0 by default."
-  (if (null subexp-depth)
-      (setq subexp-depth 0))
-  (save-match-data
-    (let ((pos 0) result)
-      (while (and (string-match regexp string pos)
-                  (< pos (length string)))
-        (let ((m (match-end subexp-depth)))
-          (push (cons (match-beginning subexp-depth) (match-end subexp-depth)) result)
-          (setq pos (match-end 0))))
-      (nreverse result))))
-
-(defun s-match (regexp s &optional start)
-  "When the given expression matches the string, this function returns a list
-of the whole matching string and a string for each matched subexpressions.
-If it did not match the returned value is an empty list (nil).
-
-When START is non-nil the search will start at that index."
-  (save-match-data
-    (if (string-match regexp s start)
-        (let ((match-data-list (match-data))
-              result)
-          (while match-data-list
-            (let* ((beg (car match-data-list))
-                   (end (cadr match-data-list))
-                   (subs (if (and beg end) (substring s beg end) nil)))
-              (setq result (cons subs result))
-              (setq match-data-list
-                    (cddr match-data-list))))
-          (nreverse result)))))
-
-(defun s-slice-at (regexp s)
-  "Slices S up at every index matching REGEXP."
-  (if (= 0 (length s)) (list "")
-    (save-match-data
-      (let (i)
-        (setq i (string-match regexp s 1))
-        (if i
-            (cons (substring s 0 i)
-                  (s-slice-at regexp (substring s i)))
-          (list s))))))
-
-(defun s-split-words (s)
-  "Split S into list of words."
-  (s-split
-   "[^[:word:]0-9]+"
-   (let ((case-fold-search nil))
-     (replace-regexp-in-string
-      "\\([[:lower:]]\\)\\([[:upper:]]\\)" "\\1 \\2"
-      (replace-regexp-in-string "\\([[:upper:]]\\)\\([[:upper:]][0-9[:lower:]]\\)" "\\1 \\2" s)))
-   t))
-
-(defun s--mapcar-head (fn-head fn-rest list)
-  "Like MAPCAR, but applies a different function to the first element."
-  (if list
-      (cons (funcall fn-head (car list)) (mapcar fn-rest (cdr list)))))
-
-(defun s-lower-camel-case (s)
-  "Convert S to lowerCamelCase."
-  (s-join "" (s--mapcar-head 'downcase 'capitalize (s-split-words s))))
-
-(defun s-upper-camel-case (s)
-  "Convert S to UpperCamelCase."
-  (s-join "" (mapcar 'capitalize (s-split-words s))))
-
-(defun s-snake-case (s)
-  "Convert S to snake_case."
-  (s-join "_" (mapcar 'downcase (s-split-words s))))
-
-(defun s-dashed-words (s)
-  "Convert S to dashed-words."
-  (s-join "-" (mapcar 'downcase (s-split-words s))))
-
-(defun s-capitalized-words (s)
-  "Convert S to Capitalized words."
-  (let ((words (s-split-words s)))
-    (s-join " " (cons (capitalize (car words)) (mapcar 'downcase (cdr words))))))
-
-(defun s-titleized-words (s)
-  "Convert S to Titleized Words."
-  (s-join " " (mapcar 's-titleize (s-split-words s))))
-
-(defun s-word-initials (s)
-  "Convert S to its initials."
-  (s-join "" (mapcar (lambda (ss) (substring ss 0 1))
-                     (s-split-words s))))
-
-;; Errors for s-format
-(progn
-  (put 's-format-resolve
-       'error-conditions
-       '(error s-format s-format-resolve))
-  (put 's-format-resolve
-       'error-message
-       "Cannot resolve a template to values"))
-
-(defun s-format (template replacer &optional extra)
-  "Format TEMPLATE with the function REPLACER.
-
-REPLACER takes an argument of the format variable and optionally
-an extra argument which is the EXTRA value from the call to
-`s-format'.
-
-Several standard `s-format' helper functions are recognized and
-adapted for this:
-
-    (s-format \"${name}\" 'gethash hash-table)
-    (s-format \"${name}\" 'aget alist)
-    (s-format \"$0\" 'elt sequence)
-
-The REPLACER function may be used to do any other kind of
-transformation."
-  (let ((saved-match-data (match-data)))
-    (unwind-protect
-        (replace-regexp-in-string
-         "\\$\\({\\([^}]+\\)}\\|[0-9]+\\)"
-         (lambda (md)
-           (let ((var
-                  (let ((m (match-string 2 md)))
-                    (if m m
-                      (string-to-number (match-string 1 md)))))
-                 (replacer-match-data (match-data)))
-             (unwind-protect
-                 (let ((v
-                        (cond
-                         ((eq replacer 'gethash)
-                          (funcall replacer var extra))
-                         ((eq replacer 'aget)
-                          (funcall 's--aget extra var))
-                         ((eq replacer 'elt)
-                          (funcall replacer extra var))
-                         ((eq replacer 'oref)
-                          (funcall #'slot-value extra (intern var)))
-                         (t
-                          (set-match-data saved-match-data)
-                          (if extra
-                              (funcall replacer var extra)
-                            (funcall replacer var))))))
-                   (if v (format "%s" v) (signal 's-format-resolve md)))
-               (set-match-data replacer-match-data)))) template
-               ;; Need literal to make sure it works
-               t t)
-      (set-match-data saved-match-data))))
-
-(defvar s-lex-value-as-lisp nil
-  "If `t' interpolate lisp values as lisp.
-
-`s-lex-format' inserts values with (format \"%S\").")
-
-(defun s-lex-fmt|expand (fmt)
-  "Expand FMT into lisp."
-  (list 's-format fmt (quote 'aget)
-        (append '(list)
-                (mapcar
-                 (lambda (matches)
-                   (list
-                    'cons
-                    (cadr matches)
-                    `(format
-                      (if s-lex-value-as-lisp "%S" "%s")
-                      ,(intern (cadr matches)))))
-                 (s-match-strings-all "${\\([^}]+\\)}" fmt)))))
-
-(defmacro s-lex-format (format-str)
-  "`s-format` with the current environment.
-
-FORMAT-STR may use the `s-format' variable reference to refer to
-any variable:
-
- (let ((x 1))
-   (s-lex-format \"x is: ${x}\"))
-
-The values of the variables are interpolated with \"%s\" unless
-the variable `s-lex-value-as-lisp' is `t' and then they are
-interpolated with \"%S\"."
-  (declare (debug (form)))
-  (s-lex-fmt|expand format-str))
-
-(defun s-count-matches (regexp s &optional start end)
-  "Count occurrences of `regexp' in `s'.
-
-`start', inclusive, and `end', exclusive, delimit the part of `s'
-to match. "
-  (save-match-data
-    (with-temp-buffer
-      (insert s)
-      (goto-char (point-min))
-      (count-matches regexp (or start 1) (or end (point-max))))))
-
-(defun s-wrap (s prefix &optional suffix)
-  "Wrap string S with PREFIX and optionally SUFFIX.
-
-Return string S with PREFIX prepended.  If SUFFIX is present, it
-is appended, otherwise PREFIX is used as both prefix and
-suffix."
-  (concat prefix s (or suffix prefix)))
-
-
-;;; Aliases
-
-(defalias 's-blank-p 's-blank?)
-(defalias 's-blank-str-p 's-blank-str?)
-(defalias 's-capitalized-p 's-capitalized?)
-(defalias 's-contains-p 's-contains?)
-(defalias 's-ends-with-p 's-ends-with?)
-(defalias 's-equals-p 's-equals?)
-(defalias 's-less-p 's-less?)
-(defalias 's-lowercase-p 's-lowercase?)
-(defalias 's-matches-p 's-matches?)
-(defalias 's-mixedcase-p 's-mixedcase?)
-(defalias 's-numeric-p 's-numeric?)
-(defalias 's-prefix-p 's-starts-with?)
-(defalias 's-prefix? 's-starts-with?)
-(defalias 's-present-p 's-present?)
-(defalias 's-starts-with-p 's-starts-with?)
-(defalias 's-suffix-p 's-ends-with?)
-(defalias 's-suffix? 's-ends-with?)
-(defalias 's-uppercase-p 's-uppercase?)
-
-
-(provide 's)
-;;; s.el ends here
.emacs.d/elpa/s-20170906.1304/s.elc
Binary file
.emacs.d/elpa/solaire-mode-1.0.2/solaire-mode-autoloads.el
@@ -1,51 +0,0 @@
-;;; solaire-mode-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "solaire-mode" "solaire-mode.el" (22964 3868
-;;;;;;  811661 530000))
-;;; Generated autoloads from solaire-mode.el
-
-(autoload 'solaire-mode "solaire-mode" "\
-Make source buffers grossly incandescent by remapping common faces (see
-`solaire-mode-remap-faces') to their solaire-mode variants.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'turn-on-solaire-mode "solaire-mode" "\
-Enable `solaire-mode' in the current buffer.
-
-Does nothing if it doesn't represent a real, file-visiting buffer (see
-`solaire-mode-real-buffer-fn').
-
-\(fn)" nil nil)
-
-(autoload 'turn-off-solaire-mode "solaire-mode" "\
-Disable `solaire-mode' in the current buffer.
-
-\(fn)" nil nil)
-
-(autoload 'solaire-mode-in-minibuffer "solaire-mode" "\
-Highlight the minibuffer whenever it is active.
-
-\(fn)" nil nil)
-
-(autoload 'solaire-mode-reset "solaire-mode" "\
-Reset all buffers with `solaire-mode' enabled.
-
-\(fn)" t nil)
-
-(autoload 'solaire-mode-restore-persp-mode-buffers "solaire-mode" "\
-Restore `solaire-mode' in buffers when `persp-mode' loads a session.
-
-\(fn &rest _)" nil nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; solaire-mode-autoloads.el ends here
.emacs.d/elpa/solaire-mode-1.0.2/solaire-mode-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "solaire-mode" "1.0.2" "make certain buffers grossly incandescent" '((emacs "24.4") (cl-lib "0.5")) :commit "0f467e5f309e5a36280e06b40c0e6bbe90e06358" :url "https://github.com/hlissner/emacs-solaire-mode" :keywords '("dim" "bright" "window" "buffer" "faces"))
.emacs.d/elpa/solaire-mode-1.0.2/solaire-mode.el
@@ -1,201 +0,0 @@
-;;; solaire-mode.el --- make certain buffers grossly incandescent
-;;
-;; Copyright (C) 2017 Henrik Lissner
-;;
-;; Author: Henrik Lissner <http://github/hlissner>
-;; Maintainer: Henrik Lissner <henrik@lissner.net>
-;; Created: Jun 03, 2017
-;; Modified: Jul 18, 2017
-;; Version: 1.0.2
-;; Package-Version: 1.0.2
-;; Keywords: dim bright window buffer faces
-;; Homepage: https://github.com/hlissner/emacs-solaire-mode
-;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
-;;
-;; This file is not part of GNU Emacs.
-;;
-;;; Commentary:
-;;
-;; `soliare-mode' is inspired by editors who visually distinguish code-editing
-;; windows from sidebars, popups, terminals, ecetera. It changes the background
-;; of file-visiting buffers (and certain aspects of the UI) to make them easier
-;; to distinguish from other, not-so-important buffers.
-;;
-;; Praise the sun.
-;;
-;;; Installation
-;;
-;; M-x package-install RET solaire-mode
-;;
-;;   (require 'solaire-mode)
-;;
-;; Brighten buffers that represent real files:
-;;
-;;   (add-hook 'after-change-major-mode-hook #'turn-on-solaire-mode)
-;;
-;; If you use auto-revert-mode:
-;;
-;;   (add-hook 'after-revert-hook #'turn-on-solaire-mode)
-;;
-;; And to unconditionally brighten certain buffers:
-;;
-;;   (add-hook 'ediff-prepare-buffer-hook #'solaire-mode)
-;;
-;; You can do similar with the minibuffer when it is active:
-;;
-;;   (add-hook 'minibuffer-setup-hook #'solaire-mode-in-minibuffer)
-;;
-;;; Code:
-
-(require 'cl-lib)
-
-(defgroup solaire-mode nil
-  "Options for solaire-mode."
-  :group 'faces)
-
-(defface solaire-default-face '((t (:inherit default)))
-  "Alternative version of the `default' face."
-  :group 'solaire-mode)
-
-(defface solaire-minibuffer-face '((t (:inherit solaire-default-face)))
-  "Alternative face for the minibuffer. See `solaire-mode-in-minibuffer'."
-  :group 'solaire-mode)
-
-(defface solaire-linum-face '((t (:inherit linum)))
-  "Alternative face for `linum-mode' (and `nlinum-mode')."
-  :group 'solaire-mode)
-
-(defface solaire-line-number-face '((t (:inherit line-number)))
-  "Alternative face for `line-number', for native line numbers in Emacs 26+."
-  :group 'solaire-mode)
-
-(defface solaire-line-number-current-line-face '((t (:inherit line-number-current-line)))
-  "Alternative face for `line-number-current-line', for native line numbers in
-Emacs 26+."
-  :group 'solaire-mode)
-
-(defface solaire-hl-line-face '((t (:inherit hl-line)))
-  "Alternative face for the current line, highlighted by `hl-line'."
-  :group 'solaire-mode)
-
-(defface solaire-org-hide-face '((t (:inherit org-hide)))
-  "Alternative face for `org-hide', which is used to camoflauge the leading
-asterixes in `org-mode' when `org-hide-leading-stars' is non-nil."
-  :group 'solaire-mode)
-
-(defface solaire-mode-line-face '((t (:inherit mode-line)))
-  "Alternative face for the mode line."
-  :group 'solaire-mode)
-
-(defface solaire-mode-line-inactive-face '((t (:inherit mode-line-inactive)))
-  "Alternative face for the inactive mode line."
-  :group 'solaire-mode)
-
-;;
-(defcustom solaire-mode-real-buffer-fn #'solaire-mode--real-buffer-fn
-  "The function that determines buffer eligability for `solaire-mode'.
-
-Should accept one argument: the buffer."
-  :group 'solaire-mode
-  :type 'function)
-
-(defcustom solaire-mode-remap-modeline t
-  "If non-nil, remap mode-line faces as well.
-
-Solaire-mode can conflict with certain mode-line plugins, like powerline and
-telephone-line, so it's best to simply turn this off for those plugins."
-  :group 'solaire-mode
-  :type 'boolean)
-
-(defcustom solaire-mode-remap-faces
-  '((default solaire-default-face)
-    (hl-line solaire-hl-line-face)
-    (linum solaire-linum-face)
-    (line-number solaire-line-number-face)
-    (line-number-current-line solaire-line-number-current-line-face)
-    (org-hide solaire-org-hide-face)
-    (mode-line solaire-mode-line-face)
-    (mode-line-inactive solaire-mode-line-inactive-face))
-  "An alist of faces to remap when enabling `solaire-mode'."
-  :group 'solaire-mode
-  :type '(list face))
-
-(defun solaire-mode--real-buffer-fn (buf)
-  "Return t if the current buffer BUF represents a real file."
-  buffer-file-name)
-
-;;;###autoload
-(define-minor-mode solaire-mode
-  "Make source buffers grossly incandescent by remapping common faces (see
-`solaire-mode-remap-faces') to their solaire-mode variants."
-  :lighter "" ; should be obvious it's on
-  :init-value nil
-  ;; Don't reset remapped faces on `kill-all-local-variables'
-  (make-variable-buffer-local 'face-remapping-alist)
-  (put 'face-remapping-alist 'permanent-local solaire-mode)
-  (if solaire-mode
-      (progn
-        (set-face-background 'fringe (face-background 'solaire-default-face))
-        (setq face-remapping-alist (append solaire-mode-remap-faces face-remapping-alist))
-        (unless solaire-mode-remap-modeline
-          (dolist (fc '(mode-line mode-line-inactive) solaire-mode-remap-faces)
-            (setq face-remapping-alist
-                  (assq-delete-all fc solaire-mode-remap-faces)))))
-    (dolist (remap solaire-mode-remap-faces)
-      (setq face-remapping-alist (delete remap face-remapping-alist)))
-    (unless (cl-loop for buf in (buffer-list)
-                     when (buffer-local-value 'solaire-mode buf)
-                     return t)
-      (set-face-background 'fringe (face-background 'default)))))
-
-;;;###autoload
-(defun turn-on-solaire-mode ()
-  "Enable `solaire-mode' in the current buffer.
-
-Does nothing if it doesn't represent a real, file-visiting buffer (see
-`solaire-mode-real-buffer-fn')."
-  (when (and (not solaire-mode)
-             (funcall solaire-mode-real-buffer-fn (current-buffer)))
-    (solaire-mode +1)))
-
-;;;###autoload
-(defun turn-off-solaire-mode ()
-  "Disable `solaire-mode' in the current buffer."
-  (when solaire-mode
-    (solaire-mode -1)))
-
-;;;###autoload
-(defun solaire-mode-in-minibuffer ()
-  "Highlight the minibuffer whenever it is active."
-  (with-selected-window (minibuffer-window)
-    (setq-local face-remapping-alist
-                (append face-remapping-alist '((default solaire-minibuffer-face))))))
-
-;;;###autoload
-(defun solaire-mode-reset ()
-  "Reset all buffers with `solaire-mode' enabled."
-  (interactive)
-  (dolist (buf (buffer-list))
-    (with-current-buffer buf
-      (when solaire-mode
-        (solaire-mode -1)
-        (solaire-mode +1)))))
-
-;;;###autoload
-(defun solaire-mode-restore-persp-mode-buffers (&rest _)
-  "Restore `solaire-mode' in buffers when `persp-mode' loads a session."
-  (dolist (buf (persp-buffer-list))
-    (with-current-buffer buf
-      (turn-on-solaire-mode))))
-
-(defun solaire-mode--face-remap-add-relative (orig-fn &rest args)
-  "Minimize interference from other themes, functions and/or packages trying to
-remap their own faces (like `text-scale-set')."
-  (when solaire-mode
-    (let ((remap (assq (nth 0 args) face-remapping-alist)))
-      (when remap (setf (nth 0 args) (cadr remap)))))
-  (apply orig-fn args))
-(advice-add 'face-remap-add-relative :around #'solaire-mode--face-remap-add-relative)
-
-(provide 'solaire-mode)
-;;; solaire-mode.el ends here
.emacs.d/elpa/solaire-mode-1.0.2/solaire-mode.elc
Binary file
.emacs.d/elpa/swiper-20170911.1036/swiper-autoloads.el
@@ -1,32 +0,0 @@
-;;; swiper-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "swiper" "swiper.el" (22977 29293 461916 191000))
-;;; Generated autoloads from swiper.el
-
-(autoload 'swiper-avy "swiper" "\
-Jump to one of the current swiper candidates.
-
-\(fn)" t nil)
-
-(autoload 'swiper "swiper" "\
-`isearch' with an overview.
-When non-nil, INITIAL-INPUT is the initial search pattern.
-
-\(fn &optional INITIAL-INPUT)" t nil)
-
-(autoload 'swiper-all "swiper" "\
-Run `swiper' for all open buffers.
-
-\(fn)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; swiper-autoloads.el ends here
.emacs.d/elpa/swiper-20170911.1036/swiper-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "swiper" "20170911.1036" "Isearch with an overview. Oh, man!" '((emacs "24.1") (ivy "0.9.0")) :commit "0a1d361b926291874124f8c63a653d83ead64a36" :url "https://github.com/abo-abo/swiper" :keywords '("matching"))
.emacs.d/elpa/swiper-20170911.1036/swiper.el
@@ -1,970 +0,0 @@
-;;; swiper.el --- Isearch with an overview. Oh, man! -*- lexical-binding: t -*-
-
-;; Copyright (C) 2015-2017  Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-;; URL: https://github.com/abo-abo/swiper
-;; Package-Version: 20170911.1036
-;; Version: 0.9.1
-;; Package-Requires: ((emacs "24.1") (ivy "0.9.0"))
-;; Keywords: matching
-
-;; This file is part of GNU Emacs.
-
-;; 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 3, 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.
-
-;; For a full copy of the GNU General Public License
-;; see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This package gives an overview of the current regex search
-;; candidates.  The search regex can be split into groups with a
-;; space.  Each group is highlighted with a different face.
-;;
-;; It can double as a quick `regex-builder', although only single
-;; lines will be matched.
-
-;;; Code:
-(require 'ivy)
-
-(defgroup swiper nil
-  "`isearch' with an overview."
-  :group 'matching
-  :prefix "swiper-")
-
-(defface swiper-match-face-1
-  '((t (:inherit isearch-lazy-highlight-face)))
-  "The background face for `swiper' matches.")
-
-(defface swiper-match-face-2
-  '((t (:inherit isearch)))
-  "Face for `swiper' matches modulo 1.")
-
-(defface swiper-match-face-3
-  '((t (:inherit match)))
-  "Face for `swiper' matches modulo 2.")
-
-(defface swiper-match-face-4
-  '((t (:inherit isearch-fail)))
-  "Face for `swiper' matches modulo 3.")
-
-(defface swiper-line-face
-  '((t (:inherit highlight)))
-  "Face for current `swiper' line.")
-
-(defcustom swiper-faces '(swiper-match-face-1
-                          swiper-match-face-2
-                          swiper-match-face-3
-                          swiper-match-face-4)
-  "List of `swiper' faces for group matches."
-  :group 'ivy-faces
-  :type 'list)
-
-(defcustom swiper-min-highlight 2
-  "Only highlight matches for regexps at least this long."
-  :type 'integer)
-
-(defcustom swiper-include-line-number-in-search nil
-  "Include line number in text of search candidates."
-  :type 'boolean
-  :group 'swiper)
-
-(defcustom swiper-goto-start-of-match nil
-  "When non-nil, go to the start of the match, not its end."
-  :type 'boolean
-  :group 'swiper)
-
-(defvar swiper-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "M-q") 'swiper-query-replace)
-    (define-key map (kbd "C-l") 'swiper-recenter-top-bottom)
-    (define-key map (kbd "C-'") 'swiper-avy)
-    (define-key map (kbd "C-7") 'swiper-mc)
-    (define-key map (kbd "C-c C-f") 'swiper-toggle-face-matching)
-    map)
-  "Keymap for swiper.")
-
-(defun swiper-query-replace ()
-  "Start `query-replace' with string to replace from last search string."
-  (interactive)
-  (if (null (window-minibuffer-p))
-      (user-error "Should only be called in the minibuffer through `swiper-map'")
-    (let* ((enable-recursive-minibuffers t)
-           (from (ivy--regex ivy-text))
-           (to (minibuffer-with-setup-hook
-                   (lambda ()
-                     (setq minibuffer-default
-                           (if (string-match "\\`\\\\_<\\(.*\\)\\\\_>\\'" ivy-text)
-                               (match-string 1 ivy-text)
-                             ivy-text)))
-                 (read-from-minibuffer (format "Query replace %s with: " from)))))
-      (swiper--cleanup)
-      (ivy-exit-with-action
-       (lambda (_)
-         (with-ivy-window
-           (move-beginning-of-line 1)
-           (perform-replace from to
-                            t t nil)))))))
-
-(defun swiper-all-query-replace ()
-  "Start `query-replace' with string to replace from last search string."
-  (interactive)
-  (if (null (window-minibuffer-p))
-      (user-error
-       "Should only be called in the minibuffer through `swiper-all-map'")
-    (let* ((enable-recursive-minibuffers t)
-           (from (ivy--regex ivy-text))
-           (to (query-replace-read-to from "Query replace" t)))
-      (swiper--cleanup)
-      (ivy-exit-with-action
-       (lambda (_)
-         (let ((wnd-conf (current-window-configuration))
-               (inhibit-message t))
-           (unwind-protect
-                (dolist (cand ivy--old-cands)
-                  (let ((buffer (get-text-property 0 'buffer cand)))
-                    (switch-to-buffer buffer)
-                    (goto-char (point-min))
-                    (perform-replace from to t t nil)))
-             (set-window-configuration wnd-conf))))))))
-
-(defvar avy-background)
-(defvar avy-all-windows)
-(defvar avy-style)
-(defvar avy-keys)
-(declare-function avy--regex-candidates "ext:avy")
-(declare-function avy--process "ext:avy")
-(declare-function avy--overlay-post "ext:avy")
-(declare-function avy-action-goto "ext:avy")
-(declare-function avy-candidate-beg "ext:avy")
-(declare-function avy--done "ext:avy")
-(declare-function avy--make-backgrounds "ext:avy")
-(declare-function avy-window-list "ext:avy")
-(declare-function avy-read "ext:avy")
-(declare-function avy-read-de-bruijn "ext:avy")
-(declare-function avy-tree "ext:avy")
-(declare-function avy-push-mark "ext:avy")
-(declare-function avy--remove-leading-chars "ext:avy")
-
-;;;###autoload
-(defun swiper-avy ()
-  "Jump to one of the current swiper candidates."
-  (interactive)
-  (unless (require 'avy nil 'noerror)
-    (error "Package avy isn't installed"))
-  (unless (string= ivy-text "")
-    (let* ((avy-all-windows nil)
-           ;; We'll have overlapping overlays, so we sort all the
-           ;; overlays in the visible region by their start, and then
-           ;; throw out non-Swiper overlays or overlapping Swiper
-           ;; overlays.
-           (visible-overlays (cl-sort (with-ivy-window
-                                        (overlays-in (window-start)
-                                                     (window-end)))
-                                      #'< :key #'overlay-start))
-           (min-overlay-start 0)
-           (overlays-for-avy (cl-remove-if-not
-                              (lambda (ov)
-                                (when (and (>= (overlay-start ov)
-                                               min-overlay-start)
-                                           (memq (overlay-get ov 'face)
-                                                 swiper-faces))
-                                  (setq min-overlay-start (overlay-start ov))))
-                              visible-overlays))
-           (candidates (append
-                        (mapcar (lambda (ov)
-                                  (cons (overlay-start ov)
-                                        (overlay-get ov 'window)))
-                                overlays-for-avy)
-                        (save-excursion
-                          (save-restriction
-                            (narrow-to-region (window-start) (window-end))
-                            (goto-char (point-min))
-                            (forward-line)
-                            (let ((cands))
-                              (while (< (point) (point-max))
-                                (push (cons (1+ (point))
-                                            (selected-window))
-                                      cands)
-                                (forward-line))
-                              cands)))))
-           (candidate (unwind-protect
-                           (prog2
-                               (avy--make-backgrounds
-                                (append (avy-window-list)
-                                        (list (ivy-state-window ivy-last))))
-                               (if (eq avy-style 'de-bruijn)
-                                   (avy-read-de-bruijn
-                                    candidates avy-keys)
-                                 (avy-read (avy-tree candidates avy-keys)
-                                           #'avy--overlay-post
-                                           #'avy--remove-leading-chars))
-                             (avy-push-mark))
-                        (avy--done))))
-      (if (window-minibuffer-p (cdr candidate))
-          (progn
-            (ivy-set-index (- (line-number-at-pos (car candidate)) 2))
-            (ivy--exhibit)
-            (ivy-done)
-            (ivy-call))
-        (ivy-quit-and-run
-         (avy-action-goto (avy-candidate-beg candidate)))))))
-
-(declare-function mc/create-fake-cursor-at-point "ext:multiple-cursors-core")
-(declare-function multiple-cursors-mode "ext:multiple-cursors-core")
-
-(defun swiper-mc ()
-  "Create a fake cursor for each `swiper' candidate."
-  (interactive)
-  (unless (require 'multiple-cursors nil t)
-    (error "Multiple-cursors isn't installed"))
-  (unless (window-minibuffer-p)
-    (error "Call me only from `swiper'"))
-  (let ((cands (nreverse ivy--old-cands)))
-    (unless (string= ivy-text "")
-      (ivy-exit-with-action
-       (lambda (_)
-         (let (cand)
-           (while (setq cand (pop cands))
-             (swiper--action cand)
-             (when cands
-               (mc/create-fake-cursor-at-point))))
-         (multiple-cursors-mode 1))))))
-
-(defun swiper-recenter-top-bottom (&optional arg)
-  "Call (`recenter-top-bottom' ARG)."
-  (interactive "P")
-  (with-ivy-window
-    (recenter-top-bottom arg)))
-
-(defvar swiper-font-lock-exclude
-  '(bookmark-bmenu-mode
-    package-menu-mode
-    gnus-summary-mode
-    gnus-article-mode
-    gnus-group-mode
-    emms-playlist-mode
-    emms-stream-mode
-    erc-mode
-    forth-mode
-    forth-block-mode
-    nix-mode
-    org-agenda-mode
-    dired-mode
-    jabber-chat-mode
-    elfeed-search-mode
-    elfeed-show-mode
-    fundamental-mode
-    Man-mode
-    woman-mode
-    mu4e-view-mode
-    mu4e-headers-mode
-    notmuch-tree-mode
-    notmuch-search-mode
-    help-mode
-    debbugs-gnu-mode
-    occur-mode
-    occur-edit-mode
-    bongo-mode
-    bongo-library-mode
-    bongo-playlist-mode
-    eww-mode
-    twittering-mode
-    vc-dir-mode
-    rcirc-mode
-    circe-channel-mode
-    circe-server-mode
-    circe-query-mode
-    sauron-mode
-    w3m-mode)
-  "List of major-modes that are incompatible with `font-lock-ensure'.")
-
-(defun swiper-font-lock-ensure-p ()
-  "Return non-nil if we should `font-lock-ensure'."
-  (or (derived-mode-p 'magit-mode)
-              (bound-and-true-p magit-blame-mode)
-              (memq major-mode swiper-font-lock-exclude)))
-
-(defun swiper-font-lock-ensure ()
-  "Ensure the entired buffer is highlighted."
-  (unless (swiper-font-lock-ensure-p)
-    (unless (or (> (buffer-size) 100000) (null font-lock-mode))
-      (if (fboundp 'font-lock-ensure)
-          (font-lock-ensure)
-        (with-no-warnings (font-lock-fontify-buffer))))))
-
-(defvar swiper--format-spec ""
-  "Store the current candidates format spec.")
-
-(defvar swiper--width nil
-  "Store the number of digits needed for the longest line nubmer.")
-
-(defvar swiper-use-visual-line nil
-  "When non-nil, use `line-move' instead of `forward-line'.")
-
-(declare-function outline-show-all "outline")
-
-(defun swiper--candidates (&optional numbers-width)
-  "Return a list of this buffer lines.
-
-NUMBERS-WIDTH, when specified, is used for width spec of line
-numbers; replaces calculating the width from buffer line count."
-  (if (and visual-line-mode
-           ;; super-slow otherwise
-           (< (buffer-size) 20000))
-      (progn
-        (when (eq major-mode 'org-mode)
-          (require 'outline)
-          (if (fboundp 'outline-show-all)
-              (outline-show-all)
-            (with-no-warnings
-              (show-all))))
-        (setq swiper-use-visual-line t))
-    (setq swiper-use-visual-line nil))
-  (let ((n-lines (count-lines (point-min) (point-max))))
-    (unless (zerop n-lines)
-      (setq swiper--width (or numbers-width
-                              (1+ (floor (log n-lines 10)))))
-      (setq swiper--format-spec
-            (format "%%-%dd " swiper--width))
-      (let ((line-number 0)
-            (advancer (if swiper-use-visual-line
-                          (lambda (arg) (line-move arg t))
-                        #'forward-line))
-            candidates)
-        (save-excursion
-          (goto-char (point-min))
-          (swiper-font-lock-ensure)
-          (while (< (point) (point-max))
-            (let ((str (concat
-                        " "
-                        (replace-regexp-in-string
-                         "\t" "    "
-                         (if swiper-use-visual-line
-                             (buffer-substring
-                              (save-excursion
-                                (beginning-of-visual-line)
-                                (point))
-                              (save-excursion
-                                (end-of-visual-line)
-                                (point)))
-                           (buffer-substring
-                            (point)
-                            (line-end-position)))))))
-              (setq str (ivy-cleanup-string str))
-              (let ((line-number-str
-                     (format swiper--format-spec (cl-incf line-number))))
-                (if swiper-include-line-number-in-search
-                    (setq str (concat line-number-str str))
-                  (put-text-property
-                   0 1 'display line-number-str str))
-                (put-text-property
-                 0 1 'swiper-line-number line-number-str str))
-              (push str candidates))
-            (funcall advancer 1))
-          (nreverse candidates))))))
-
-(defvar swiper--opoint 1
-  "The point when `swiper' starts.")
-
-;;;###autoload
-(defun swiper (&optional initial-input)
-  "`isearch' with an overview.
-When non-nil, INITIAL-INPUT is the initial search pattern."
-  (interactive)
-  (swiper--ivy (swiper--candidates) initial-input))
-
-(declare-function string-trim-right "subr-x")
-(defvar swiper--current-window-start nil)
-
-(defun swiper-occur (&optional revert)
-  "Generate a custom occur buffer for `swiper'.
-When REVERT is non-nil, regenerate the current *ivy-occur* buffer."
-  (require 'subr-x)
-  (let* ((buffer (ivy-state-buffer ivy-last))
-         (fname (propertize
-                 (with-ivy-window
-                   (if (buffer-file-name buffer)
-                       (file-name-nondirectory
-                        (buffer-file-name buffer))
-                     (buffer-name buffer)))
-                 'face
-                 'compilation-info))
-         (cands (mapcar
-                 (lambda (s)
-                   (format "%s:%s:%s"
-                           fname
-                           (propertize
-                            (string-trim-right
-                             (get-text-property 0 'swiper-line-number s))
-                            'face 'compilation-line-number)
-                           (substring s 1)))
-                 (if (null revert)
-                     ivy--old-cands
-                   (setq ivy--old-re nil)
-                   (let ((ivy--regex-function 'swiper--re-builder))
-                     (ivy--filter
-                      (progn (string-match "\"\\(.*\\)\"" (buffer-name))
-                             (match-string 1 (buffer-name)))
-                      (with-current-buffer buffer
-                        (swiper--candidates))))))))
-    (unless (eq major-mode 'ivy-occur-grep-mode)
-      (ivy-occur-grep-mode)
-      (font-lock-mode -1))
-    (setq swiper--current-window-start nil)
-    (insert (format "-*- mode:grep; default-directory: %S -*-\n\n\n"
-                    default-directory))
-    (insert (format "%d candidates:\n" (length cands)))
-    (ivy--occur-insert-lines
-     (mapcar
-      (lambda (cand) (concat "./" cand))
-      cands))
-    (goto-char (point-min))
-    (forward-line 4)))
-
-(ivy-set-occur 'swiper 'swiper-occur)
-
-(declare-function evil-set-jump "ext:evil-jumps")
-
-(defvar swiper--current-line nil)
-(defvar swiper--current-match-start nil)
-(defvar swiper--point-min nil)
-(defvar swiper--point-max nil)
-
-(defun swiper--init ()
-  "Perform initialization common to both completion methods."
-  (setq swiper--current-line nil)
-  (setq swiper--current-match-start nil)
-  (setq swiper--current-window-start nil)
-  (setq swiper--opoint (point))
-  (setq swiper--point-min (point-min))
-  (setq swiper--point-max (point-max))
-  (when (bound-and-true-p evil-mode)
-    (evil-set-jump)))
-
-(declare-function char-fold-to-regexp "char-fold")
-
-(defun swiper--re-builder (str)
-  "Transform STR into a swiper regex.
-This is the regex used in the minibuffer where candidates have
-line numbers.  For the buffer, use `ivy--regex' instead."
-  (let* ((re-builder
-          (or (cdr (assoc 'swiper ivy-re-builders-alist))
-              (cdr (assoc t ivy-re-builders-alist))))
-         (re (cond
-               ((equal str "")
-                "")
-               ((equal str "^")
-                (setq ivy--subexps 0)
-                ".")
-               ((string-match "^\\^" str)
-                (let ((re (funcall re-builder (substring str 1))))
-                  (if (zerop ivy--subexps)
-                      (prog1 (format "^ ?\\(%s\\)" re)
-                        (setq ivy--subexps 1))
-                    (format "^ %s" re))))
-               ((eq (bound-and-true-p search-default-mode) 'char-fold-to-regexp)
-                (mapconcat #'char-fold-to-regexp (ivy--split str) ".*"))
-               (t
-                (funcall re-builder str)))))
-    re))
-
-(defvar swiper-history nil
-  "History for `swiper'.")
-
-(defvar swiper-invocation-face nil
-  "The face at the point of invocation of `swiper'.")
-
-(defun swiper--ivy (candidates &optional initial-input)
-  "Select one of CANDIDATES and move there.
-When non-nil, INITIAL-INPUT is the initial search pattern."
-  (swiper--init)
-  (setq swiper-invocation-face
-        (plist-get (text-properties-at (point)) 'face))
-  (let ((preselect
-         (if swiper-use-visual-line
-             (count-screen-lines
-              (point-min)
-              (save-excursion (beginning-of-visual-line) (point)))
-           (1- (line-number-at-pos))))
-        (minibuffer-allow-text-properties t)
-        res)
-    (unwind-protect
-         (and
-          (setq res
-                (ivy-read
-                 "Swiper: "
-                 candidates
-                 :initial-input initial-input
-                 :keymap swiper-map
-                 :preselect preselect
-                 :require-match t
-                 :update-fn #'swiper--update-input-ivy
-                 :unwind #'swiper--cleanup
-                 :action #'swiper--action
-                 :re-builder #'swiper--re-builder
-                 :history 'swiper-history
-                 :caller 'swiper))
-          (point))
-      (unless res
-        (goto-char swiper--opoint)))))
-
-(defun swiper-toggle-face-matching ()
-  "Toggle matching only the candidates with `swiper-invocation-face'."
-  (interactive)
-  (setf (ivy-state-matcher ivy-last)
-        (if (ivy-state-matcher ivy-last)
-            nil
-          #'swiper--face-matcher))
-  (setq ivy--old-re nil))
-
-(defun swiper--face-matcher (regexp candidates)
-  "Return REGEXP matching CANDIDATES.
-Matched candidates should have `swiper-invocation-face'."
-  (cl-remove-if-not
-   (lambda (x)
-     (and
-      (string-match regexp x)
-      (let ((s (match-string 0 x))
-            (i 0))
-        (while (and (< i (length s))
-                    (text-property-any
-                     i (1+ i)
-                     'face swiper-invocation-face
-                     s))
-          (cl-incf i))
-        (eq i (length s)))))
-   candidates))
-
-(defun swiper--ensure-visible ()
-  "Remove overlays hiding point."
-  (let ((overlays (overlays-at (1- (point))))
-        ov expose)
-    (while (setq ov (pop overlays))
-      (if (and (invisible-p (overlay-get ov 'invisible))
-               (setq expose (overlay-get ov 'isearch-open-invisible)))
-          (funcall expose ov)))))
-
-(defvar swiper--overlays nil
-  "Store overlays.")
-
-(defun swiper--cleanup ()
-  "Clean up the overlays."
-  (while swiper--overlays
-    (delete-overlay (pop swiper--overlays)))
-  (save-excursion
-    (goto-char (point-min))
-    (isearch-clean-overlays)))
-
-(defun swiper--update-input-ivy ()
-  "Called when `ivy' input is updated."
-  (with-ivy-window
-    (swiper--cleanup)
-    (when (> (length (ivy-state-current ivy-last)) 0)
-      (let* ((re (funcall ivy--regex-function ivy-text))
-             (re (if (stringp re) re (caar re)))
-             (re (replace-regexp-in-string
-                  "    " "\t"
-                  re))
-             (str (get-text-property 0 'swiper-line-number (ivy-state-current ivy-last)))
-             (num (if (string-match "^[0-9]+" str)
-                      (string-to-number (match-string 0 str))
-                    0)))
-        (unless (eq this-command 'ivy-yank-word)
-          (when (cl-plusp num)
-            (unless (if swiper--current-line
-                        (eq swiper--current-line num)
-                      (eq (line-number-at-pos) num))
-              (goto-char swiper--point-min)
-              (if swiper-use-visual-line
-                  (line-move (1- num))
-                (forward-line (1- num))))
-            (if (and (equal ivy-text "")
-                     (>= swiper--opoint (line-beginning-position))
-                     (<= swiper--opoint (line-end-position)))
-                (goto-char swiper--opoint)
-              (if (eq swiper--current-line num)
-                  (when swiper--current-match-start
-                    (goto-char swiper--current-match-start))
-                (setq swiper--current-line num))
-              (when (re-search-forward re (line-end-position) t)
-                (setq swiper--current-match-start (match-beginning 0))))
-            (isearch-range-invisible (line-beginning-position)
-                                     (line-end-position))
-            (unless (and (>= (point) (window-start))
-                         (<= (point) (window-end (ivy-state-window ivy-last) t)))
-              (recenter))
-            (setq swiper--current-window-start (window-start))))
-        (swiper--add-overlays
-         re
-         (max (window-start) swiper--point-min)
-         (min (window-end (selected-window) t) swiper--point-max))))))
-
-(defun swiper--add-overlays (re &optional beg end wnd)
-  "Add overlays for RE regexp in visible part of the current buffer.
-BEG and END, when specified, are the point bounds.
-WND, when specified is the window."
-  (setq wnd (or wnd (ivy-state-window ivy-last)))
-  (let ((ov (if visual-line-mode
-                (make-overlay
-                 (save-excursion
-                   (beginning-of-visual-line)
-                   (point))
-                 (save-excursion
-                   (end-of-visual-line)
-                   (point)))
-              (make-overlay
-               (line-beginning-position)
-               (1+ (line-end-position))))))
-    (overlay-put ov 'face 'swiper-line-face)
-    (overlay-put ov 'window wnd)
-    (push ov swiper--overlays)
-    (let* ((wh (window-height))
-           (beg (or beg (save-excursion
-                          (forward-line (- wh))
-                          (point))))
-           (end (or end (save-excursion
-                          (forward-line wh)
-                          (point))))
-           (case-fold-search (and ivy-case-fold-search
-                                  (string= re (downcase re)))))
-      (when (>= (length re) swiper-min-highlight)
-        (save-excursion
-          (goto-char beg)
-          ;; RE can become an invalid regexp
-          (while (and (ignore-errors (re-search-forward re end t))
-                      (> (- (match-end 0) (match-beginning 0)) 0))
-            (let ((mb (match-beginning 0))
-                  (me (match-end 0)))
-              (unless (> (- me mb) 2017)
-                (swiper--add-overlay mb me
-                                     (if (zerop ivy--subexps)
-                                         (cadr swiper-faces)
-                                       (car swiper-faces))
-                                     wnd 0)))
-            (let ((i 1)
-                  (j 0))
-              (while (<= (cl-incf j) ivy--subexps)
-                (let ((bm (match-beginning j))
-                      (em (match-end j)))
-                  (when (and (integerp em)
-                             (integerp bm))
-                    (while (and (< j ivy--subexps)
-                                (integerp (match-beginning (+ j 1)))
-                                (= em (match-beginning (+ j 1))))
-                      (setq em (match-end (cl-incf j))))
-                    (swiper--add-overlay
-                     bm em
-                     (nth (1+ (mod (+ i 2) (1- (length swiper-faces))))
-                          swiper-faces)
-                     wnd i)
-                    (cl-incf i)))))))))))
-
-(defun swiper--add-overlay (beg end face wnd priority)
-  "Add overlay bound by BEG and END to `swiper--overlays'.
-FACE, WND and PRIORITY are properties corresponding to
-the face, window and priority of the overlay."
-  (let ((overlay (make-overlay beg end)))
-    (push overlay swiper--overlays)
-    (overlay-put overlay 'face face)
-    (overlay-put overlay 'window wnd)
-    (overlay-put overlay 'priority priority)))
-
-(defcustom swiper-action-recenter nil
-  "When non-nil, recenter after exiting `swiper'."
-  :type 'boolean)
-(defvar evil-search-module)
-(defvar evil-ex-search-pattern)
-(defvar evil-ex-search-persistent-highlight)
-(defvar evil-ex-search-direction)
-(declare-function evil-ex-search-activate-highlight "evil-ex")
-
-
-(defun swiper--action (x)
-  "Goto line X."
-  (let ((ln (1- (read (or (get-text-property 0 'swiper-line-number x)
-                          (and (string-match ":\\([0-9]+\\):.*\\'" x)
-                               (match-string-no-properties 1 x))))))
-        (re (ivy--regex ivy-text)))
-    (if (null x)
-        (user-error "No candidates")
-      (with-ivy-window
-        (unless (equal (current-buffer)
-                       (ivy-state-buffer ivy-last))
-          (switch-to-buffer (ivy-state-buffer ivy-last)))
-        (goto-char swiper--point-min)
-        (funcall (if swiper-use-visual-line
-                     #'line-move
-                   #'forward-line)
-                 ln)
-        (when (and (re-search-forward re (line-end-position) t) swiper-goto-start-of-match)
-          (goto-char (match-beginning 0)))
-        (swiper--ensure-visible)
-        (cond (swiper-action-recenter
-               (recenter))
-              (swiper--current-window-start
-               (set-window-start (selected-window) swiper--current-window-start)))
-        (when (/= (point) swiper--opoint)
-          (unless (and transient-mark-mode mark-active)
-            (when (eq ivy-exit 'done)
-              (push-mark swiper--opoint t)
-              (message "Mark saved where search started"))))
-        (add-to-history
-         'regexp-search-ring
-         re
-         regexp-search-ring-max)
-        (when (and (bound-and-true-p evil-mode)
-                   (eq evil-search-module 'evil-search))
-          (add-to-history 'evil-ex-search-history re)
-          (setq evil-ex-search-pattern (list re t t))
-          (setq evil-ex-search-direction 'forward)
-          (when evil-ex-search-persistent-highlight
-            (evil-ex-search-activate-highlight evil-ex-search-pattern)))))))
-
-(defun swiper-from-isearch ()
-  "Invoke `swiper' from isearch."
-  (interactive)
-  (let ((query (if isearch-regexp
-                   isearch-string
-                 (regexp-quote isearch-string))))
-    (isearch-exit)
-    (swiper query)))
-
-(defvar swiper-multi-buffers nil
-  "Store the current list of buffers.")
-
-(defvar swiper-multi-candidates nil
-  "Store the list of candidates for `swiper-multi'.")
-
-(defun swiper-multi-prompt ()
-  "Return prompt for `swiper-multi'."
-  (format "Buffers (%s): "
-          (mapconcat #'identity swiper-multi-buffers ", ")))
-
-(defun swiper-multi ()
-  "Select one or more buffers.
-Run `swiper' for those buffers."
-  (interactive)
-  (setq swiper-multi-buffers nil)
-  (let ((ivy-use-virtual-buffers nil))
-    (ivy-read (swiper-multi-prompt)
-              'internal-complete-buffer
-              :action 'swiper-multi-action-1))
-  (ivy-read "Swiper: " swiper-multi-candidates
-            :action 'swiper-multi-action-2
-            :unwind #'swiper--cleanup
-            :caller 'swiper-multi))
-
-(defun swiper-multi-action-1 (x)
-  "Add X to list of selected buffers `swiper-multi-buffers'.
-If X is already part of the list, remove it instead.  Quit the selection if
-X is selected by either `ivy-done', `ivy-alt-done' or `ivy-immediate-done',
-otherwise continue prompting for buffers."
-  (if (member x swiper-multi-buffers)
-      (progn
-        (setq swiper-multi-buffers (delete x swiper-multi-buffers)))
-    (unless (equal x "")
-      (setq swiper-multi-buffers (append swiper-multi-buffers (list x)))))
-  (let ((prompt (swiper-multi-prompt)))
-    (setf (ivy-state-prompt ivy-last) prompt)
-    (setq ivy--prompt (concat "%-4d " prompt)))
-  (cond ((memq this-command '(ivy-done
-                              ivy-alt-done
-                              ivy-immediate-done))
-         (setq swiper-multi-candidates
-               (swiper--multi-candidates
-                (mapcar #'get-buffer swiper-multi-buffers))))
-        ((eq this-command 'ivy-call)
-         (with-selected-window (active-minibuffer-window)
-           (delete-minibuffer-contents)))))
-
-(defun swiper-multi-action-2 (x)
-  "Move to candidate X from `swiper-multi'."
-  (when (> (length x) 0)
-    (let ((buffer-name (get-text-property 0 'buffer x)))
-      (when buffer-name
-        (with-ivy-window
-          (switch-to-buffer buffer-name)
-          (goto-char (point-min))
-          (forward-line (1- (read (get-text-property 0 'swiper-line-number x))))
-          (re-search-forward
-           (ivy--regex ivy-text)
-           (line-end-position) t)
-          (isearch-range-invisible (line-beginning-position)
-                                   (line-end-position))
-          (unless (eq ivy-exit 'done)
-            (swiper--cleanup)
-            (swiper--add-overlays (ivy--regex ivy-text))))))))
-
-(defun swiper-all-buffer-p (buffer)
-  "Return non-nil if BUFFER should be considered by `swiper-all'."
-  (let ((major-mode (with-current-buffer buffer major-mode)))
-    (cond
-      ;; Ignore TAGS buffers, they tend to add duplicate results.
-      ((eq major-mode #'tags-table-mode) nil)
-      ;; Always consider dired buffers, even though they're not backed
-      ;; by a file.
-      ((eq major-mode #'dired-mode) t)
-      ;; Always consider stash buffers too, as they may have
-      ;; interesting content not present in any buffers. We don't #'
-      ;; quote to satisfy the byte-compiler.
-      ((eq major-mode 'magit-stash-mode) t)
-      ;; Email buffers have no file, but are useful to search
-      ((eq major-mode 'gnus-article-mode) t)
-      ;; Otherwise, only consider the file if it's backed by a file.
-      (t (buffer-file-name buffer)))))
-
-;;* `swiper-all'
-(defun swiper-all-function (str)
-  "Search in all open buffers for STR."
-  (if (and (< (length str) 3))
-      (list "" (format "%d chars more" (- 3 (length ivy-text))))
-    (let* ((buffers (cl-remove-if-not #'swiper-all-buffer-p (buffer-list)))
-           (re-full (funcall ivy--regex-function str))
-           re re-tail
-           cands match
-           (case-fold-search
-            (and ivy-case-fold-search
-                 (string= str (downcase str)))))
-      (if (stringp re-full)
-          (setq re re-full)
-        (setq re (caar re-full))
-        (setq re-tail (cdr re-full)))
-      (dolist (buffer buffers)
-        (with-current-buffer buffer
-          (save-excursion
-            (goto-char (point-min))
-            (while (re-search-forward re nil t)
-              (setq match (if (memq major-mode '(org-mode dired-mode))
-                              (buffer-substring-no-properties
-                               (line-beginning-position)
-                               (line-end-position))
-                            (buffer-substring
-                             (line-beginning-position)
-                             (line-end-position))))
-              (put-text-property
-               0 1 'buffer
-               (buffer-name)
-               match)
-              (put-text-property 0 1 'point (point) match)
-              (when (or (null re-tail) (ivy-re-match re-tail match))
-                (push match cands))))))
-      (setq ivy--old-re re-full)
-      (if (null cands)
-          (list "")
-        (setq ivy--old-cands (nreverse cands))))))
-
-(defvar swiper-window-width 80)
-
-(defun swiper--all-format-function (cands)
-  "Format CANDS for `swiper-all'.
-See `ivy-format-function' for further information."
-  (let* ((ww swiper-window-width)
-         (col2 1)
-         (cands-with-buffer
-          (mapcar (lambda (s)
-                    (let ((buffer (get-text-property 0 'buffer s)))
-                      (setq col2 (max col2 (length buffer)))
-                      (cons s buffer))) cands))
-         (col1 (- ww 4 col2)))
-    (setq cands
-          (mapcar (lambda (x)
-                    (if (cdr x)
-                        (let ((s (ivy--truncate-string (car x) col1)))
-                          (concat
-                           s
-                           (make-string
-                            (max 0
-                                 (- ww (string-width s) (length (cdr x))))
-                            ?\ )
-                           (cdr x)))
-                      (car x)))
-                  cands-with-buffer))
-    (ivy--format-function-generic
-     (lambda (str)
-       (ivy--add-face str 'ivy-current-match))
-     (lambda (str)
-       str)
-     cands
-     "\n")))
-
-(defvar swiper-all-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "M-q") 'swiper-all-query-replace)
-    map)
-  "Keymap for `swiper-all'.")
-
-;;;###autoload
-(defun swiper-all ()
-  "Run `swiper' for all open buffers."
-  (interactive)
-  (let* ((swiper-window-width (- (frame-width) (if (display-graphic-p) 0 1)))
-         (ivy-format-function #'swiper--all-format-function))
-    (ivy-read "swiper-all: " 'swiper-all-function
-              :action 'swiper-all-action
-              :unwind #'swiper--cleanup
-              :update-fn (lambda ()
-                           (swiper-all-action (ivy-state-current ivy-last)))
-              :dynamic-collection t
-              :keymap swiper-all-map
-              :caller 'swiper-multi)))
-
-(defun swiper-all-action (x)
-  "Move to candidate X from `swiper-all'."
-  (when (> (length x) 0)
-    (let ((buffer-name (get-text-property 0 'buffer x)))
-      (when buffer-name
-        (with-ivy-window
-          (switch-to-buffer buffer-name)
-          (goto-char (get-text-property 0 'point x))
-          (isearch-range-invisible (line-beginning-position)
-                                   (line-end-position))
-          (unless (eq ivy-exit 'done)
-            (swiper--cleanup)
-            (swiper--add-overlays (ivy--regex ivy-text))))))))
-
-(defun swiper--multi-candidates (buffers)
-  "Extract candidates from BUFFERS."
-  (let* ((ww (window-width))
-         (res nil)
-         (column-2 (apply #'max
-                          (mapcar
-                           (lambda (b)
-                             (length (buffer-name b)))
-                           buffers)))
-         (column-1 (- ww 4 column-2 1)))
-    (dolist (buf buffers)
-      (with-current-buffer buf
-        (setq res
-              (append
-               (mapcar
-                (lambda (s)
-                  (setq s (concat (ivy--truncate-string s column-1) " "))
-                  (let ((len (length s)))
-                    (put-text-property
-                     (1- len) len 'display
-                     (concat
-                      (make-string
-                       (max 0
-                            (- ww (string-width s) (length (buffer-name)) 3))
-                       ?\ )
-                      (buffer-name))
-                     s)
-                    s))
-                (swiper--candidates 4))
-               res))
-        nil))
-    res))
-
-(provide 'swiper)
-
-;;; swiper.el ends here
.emacs.d/elpa/swiper-20170911.1036/swiper.elc
Binary file
.emacs.d/elpa/undo-tree-20170706.246/undo-tree-autoloads.el
@@ -1,59 +0,0 @@
-;;; undo-tree-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "undo-tree" "undo-tree.el" (22968 12682 18450
-;;;;;;  681000))
-;;; Generated autoloads from undo-tree.el
-
-(autoload 'undo-tree-mode "undo-tree" "\
-Toggle undo-tree mode.
-With no argument, this command toggles the mode.
-A positive prefix argument turns the mode on.
-A negative prefix argument turns it off.
-
-Undo-tree-mode replaces Emacs' standard undo feature with a more
-powerful yet easier to use version, that treats the undo history
-as what it is: a tree.
-
-The following keys are available in `undo-tree-mode':
-
-  \\{undo-tree-map}
-
-Within the undo-tree visualizer, the following keys are available:
-
-  \\{undo-tree-visualizer-mode-map}
-
-\(fn &optional ARG)" t nil)
-
-(defvar global-undo-tree-mode nil "\
-Non-nil if Global Undo-Tree mode is enabled.
-See the `global-undo-tree-mode' command
-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-undo-tree-mode'.")
-
-(custom-autoload 'global-undo-tree-mode "undo-tree" nil)
-
-(autoload 'global-undo-tree-mode "undo-tree" "\
-Toggle Undo-Tree mode in all buffers.
-With prefix ARG, enable Global Undo-Tree mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
-
-Undo-Tree mode is enabled in all buffers where
-`turn-on-undo-tree-mode' would do it.
-See `undo-tree-mode' for more information on Undo-Tree mode.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; undo-tree-autoloads.el ends here
.emacs.d/elpa/undo-tree-20170706.246/undo-tree-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "undo-tree" "20170706.246" "Treat undo history as a tree" 'nil :commit "e9a9102f515acd7523158f20e83f300600374989" :url "http://www.dr-qubit.org/emacs.php" :keywords '("convenience" "files" "undo" "redo" "history" "tree"))
.emacs.d/elpa/undo-tree-20170706.246/undo-tree.el
@@ -1,4433 +0,0 @@
-;;; undo-tree.el --- Treat undo history as a tree  -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2009-2014  Free Software Foundation, Inc
-
-;; Author: Toby Cubitt <toby-undo-tree@dr-qubit.org>
-;; Maintainer: Toby Cubitt <toby-undo-tree@dr-qubit.org>
-;; Version: 0.6.6
-;; Package-Version: 20170706.246
-;; Keywords: convenience, files, undo, redo, history, tree
-;; URL: http://www.dr-qubit.org/emacs.php
-;; Repository: http://www.dr-qubit.org/git/undo-tree.git
-
-;; This file is part of Emacs.
-;;
-;; 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 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-;;
-;; Emacs has a powerful undo system. Unlike the standard undo/redo system in
-;; most software, it allows you to recover *any* past state of a buffer
-;; (whereas the standard undo/redo system can lose past states as soon as you
-;; redo). However, this power comes at a price: many people find Emacs' undo
-;; system confusing and difficult to use, spawning a number of packages that
-;; replace it with the less powerful but more intuitive undo/redo system.
-;;
-;; Both the loss of data with standard undo/redo, and the confusion of Emacs'
-;; undo, stem from trying to treat undo history as a linear sequence of
-;; changes. It's not. The `undo-tree-mode' provided by this package replaces
-;; Emacs' undo system with a system that treats undo history as what it is: a
-;; branching tree of changes. This simple idea allows the more intuitive
-;; behaviour of the standard undo/redo system to be combined with the power of
-;; never losing any history. An added side bonus is that undo history can in
-;; some cases be stored more efficiently, allowing more changes to accumulate
-;; before Emacs starts discarding history.
-;;
-;; The only downside to this more advanced yet simpler undo system is that it
-;; was inspired by Vim. But, after all, most successful religions steal the
-;; best ideas from their competitors!
-;;
-;;
-;; Installation
-;; ============
-;;
-;; This package has only been tested with Emacs versions 24 and CVS. It should
-;; work in Emacs versions 22 and 23 too, but will not work without
-;; modifications in earlier versions of Emacs.
-;;
-;; To install `undo-tree-mode', make sure this file is saved in a directory in
-;; your `load-path', and add the line:
-;;
-;;   (require 'undo-tree)
-;;
-;; to your .emacs file. Byte-compiling undo-tree.el is recommended (e.g. using
-;; "M-x byte-compile-file" from within emacs).
-;;
-;; If you want to replace the standard Emacs' undo system with the
-;; `undo-tree-mode' system in all buffers, you can enable it globally by
-;; adding:
-;;
-;;   (global-undo-tree-mode)
-;;
-;; to your .emacs file.
-;;
-;;
-;; Quick-Start
-;; ===========
-;;
-;; If you're the kind of person who likes to jump in the car and drive,
-;; without bothering to first figure out whether the button on the left dips
-;; the headlights or operates the ejector seat (after all, you'll soon figure
-;; it out when you push it), then here's the minimum you need to know:
-;;
-;; `undo-tree-mode' and `global-undo-tree-mode'
-;;   Enable undo-tree mode (either in the current buffer or globally).
-;;
-;; C-_  C-/  (`undo-tree-undo')
-;;   Undo changes.
-;;
-;; M-_  C-?  (`undo-tree-redo')
-;;   Redo changes.
-;;
-;; `undo-tree-switch-branch'
-;;   Switch undo-tree branch.
-;;   (What does this mean? Better press the button and see!)
-;;
-;; C-x u  (`undo-tree-visualize')
-;;   Visualize the undo tree.
-;;   (Better try pressing this button too!)
-;;
-;; C-x r u  (`undo-tree-save-state-to-register')
-;;   Save current buffer state to register.
-;;
-;; C-x r U  (`undo-tree-restore-state-from-register')
-;;   Restore buffer state from register.
-;;
-;;
-;;
-;; In the undo-tree visualizer:
-;;
-;; <up>  p  C-p  (`undo-tree-visualize-undo')
-;;   Undo changes.
-;;
-;; <down>  n  C-n  (`undo-tree-visualize-redo')
-;;   Redo changes.
-;;
-;; <left>  b  C-b  (`undo-tree-visualize-switch-branch-left')
-;;   Switch to previous undo-tree branch.
-;;
-;; <right>  f  C-f  (`undo-tree-visualize-switch-branch-right')
-;;   Switch to next undo-tree branch.
-;;
-;; C-<up>  M-{  (`undo-tree-visualize-undo-to-x')
-;;   Undo changes up to last branch point.
-;;
-;; C-<down>  M-}  (`undo-tree-visualize-redo-to-x')
-;;   Redo changes down to next branch point.
-;;
-;; <down>  n  C-n  (`undo-tree-visualize-redo')
-;;   Redo changes.
-;;
-;; <mouse-1>  (`undo-tree-visualizer-mouse-set')
-;;   Set state to node at mouse click.
-;;
-;; t  (`undo-tree-visualizer-toggle-timestamps')
-;;   Toggle display of time-stamps.
-;;
-;; d  (`undo-tree-visualizer-toggle-diff')
-;;   Toggle diff display.
-;;
-;; s  (`undo-tree-visualizer-selection-mode')
-;;   Toggle keyboard selection mode.
-;;
-;; q  (`undo-tree-visualizer-quit')
-;;   Quit undo-tree-visualizer.
-;;
-;; C-q  (`undo-tree-visualizer-abort')
-;;   Abort undo-tree-visualizer.
-;;
-;; ,  <
-;;   Scroll left.
-;;
-;; .  >
-;;   Scroll right.
-;;
-;; <pgup>  M-v
-;;   Scroll up.
-;;
-;; <pgdown>  C-v
-;;   Scroll down.
-;;
-;;
-;;
-;; In visualizer selection mode:
-;;
-;; <up>  p  C-p  (`undo-tree-visualizer-select-previous')
-;;   Select previous node.
-;;
-;; <down>  n  C-n  (`undo-tree-visualizer-select-next')
-;;   Select next node.
-;;
-;; <left>  b  C-b  (`undo-tree-visualizer-select-left')
-;;   Select left sibling node.
-;;
-;; <right>  f  C-f  (`undo-tree-visualizer-select-right')
-;;   Select right sibling node.
-;;
-;; <pgup>  M-v
-;;   Select node 10 above.
-;;
-;; <pgdown>  C-v
-;;   Select node 10 below.
-;;
-;; <enter>  (`undo-tree-visualizer-set')
-;;   Set state to selected node and exit selection mode.
-;;
-;; s  (`undo-tree-visualizer-mode')
-;;   Exit selection mode.
-;;
-;; t  (`undo-tree-visualizer-toggle-timestamps')
-;;   Toggle display of time-stamps.
-;;
-;; d  (`undo-tree-visualizer-toggle-diff')
-;;   Toggle diff display.
-;;
-;; q  (`undo-tree-visualizer-quit')
-;;   Quit undo-tree-visualizer.
-;;
-;; C-q  (`undo-tree-visualizer-abort')
-;;   Abort undo-tree-visualizer.
-;;
-;; ,  <
-;;   Scroll left.
-;;
-;; .  >
-;;   Scroll right.
-;;
-;;
-;;
-;; Persistent undo history:
-;;
-;; Note: Requires Emacs version 24.3 or higher.
-;;
-;; `undo-tree-auto-save-history' (variable)
-;;    automatically save and restore undo-tree history along with buffer
-;;    (disabled by default)
-;;
-;; `undo-tree-save-history' (command)
-;;    manually save undo history to file
-;;
-;; `undo-tree-load-history' (command)
-;;    manually load undo history from file
-;;
-;;
-;;
-;; Compressing undo history:
-;;
-;;   Undo history files cannot grow beyond the maximum undo tree size, which
-;;   is limited by `undo-limit', `undo-strong-limit' and
-;;   `undo-outer-limit'. Nevertheless, undo history files can grow quite
-;;   large. If you want to automatically compress undo history, add the
-;;   following advice to your .emacs file (replacing ".gz" with the filename
-;;   extension of your favourite compression algorithm):
-;;
-;;   (defadvice undo-tree-make-history-save-file-name
-;;     (after undo-tree activate)
-;;     (setq ad-return-value (concat ad-return-value ".gz")))
-;;
-;;
-;;
-;;
-;; Undo Systems
-;; ============
-;;
-;; To understand the different undo systems, it's easiest to consider an
-;; example. Imagine you make a few edits in a buffer. As you edit, you
-;; accumulate a history of changes, which we might visualize as a string of
-;; past buffer states, growing downwards:
-;;
-;;                                o  (initial buffer state)
-;;                                |
-;;                                |
-;;                                o  (first edit)
-;;                                |
-;;                                |
-;;                                o  (second edit)
-;;                                |
-;;                                |
-;;                                x  (current buffer state)
-;;
-;;
-;; Now imagine that you undo the last two changes. We can visualize this as
-;; rewinding the current state back two steps:
-;;
-;;                                o  (initial buffer state)
-;;                                |
-;;                                |
-;;                                x  (current buffer state)
-;;                                |
-;;                                |
-;;                                o
-;;                                |
-;;                                |
-;;                                o
-;;
-;;
-;; However, this isn't a good representation of what Emacs' undo system
-;; does. Instead, it treats the undos as *new* changes to the buffer, and adds
-;; them to the history:
-;;
-;;                                o  (initial buffer state)
-;;                                |
-;;                                |
-;;                                o  (first edit)
-;;                                |
-;;                                |
-;;                                o  (second edit)
-;;                                |
-;;                                |
-;;                                x  (buffer state before undo)
-;;                                |
-;;                                |
-;;                                o  (first undo)
-;;                                |
-;;                                |
-;;                                x  (second undo)
-;;
-;;
-;; Actually, since the buffer returns to a previous state after an undo,
-;; perhaps a better way to visualize it is to imagine the string of changes
-;; turning back on itself:
-;;
-;;        (initial buffer state)  o
-;;                                |
-;;                                |
-;;                  (first edit)  o  x  (second undo)
-;;                                |  |
-;;                                |  |
-;;                 (second edit)  o  o  (first undo)
-;;                                | /
-;;                                |/
-;;                                o  (buffer state before undo)
-;;
-;; Treating undos as new changes might seem a strange thing to do. But the
-;; advantage becomes clear as soon as we imagine what happens when you edit
-;; the buffer again. Since you've undone a couple of changes, new edits will
-;; branch off from the buffer state that you've rewound to. Conceptually, it
-;; looks like this:
-;;
-;;                                o  (initial buffer state)
-;;                                |
-;;                                |
-;;                                o
-;;                                |\
-;;                                | \
-;;                                o  x  (new edit)
-;;                                |
-;;                                |
-;;                                o
-;;
-;; The standard undo/redo system only lets you go backwards and forwards
-;; linearly. So as soon as you make that new edit, it discards the old
-;; branch. Emacs' undo just keeps adding changes to the end of the string. So
-;; the undo history in the two systems now looks like this:
-;;
-;;            Undo/Redo:                      Emacs' undo
-;;
-;;               o                                o
-;;               |                                |
-;;               |                                |
-;;               o                                o  o
-;;               .\                               |  |\
-;;               . \                              |  | \
-;;               .  x  (new edit)                 o  o  |
-;;   (discarded  .                                | /   |
-;;     branch)   .                                |/    |
-;;               .                                o     |
-;;                                                      |
-;;                                                      |
-;;                                                      x  (new edit)
-;;
-;; Now, what if you change your mind about those undos, and decide you did
-;; like those other changes you'd made after all? With the standard undo/redo
-;; system, you're lost. There's no way to recover them, because that branch
-;; was discarded when you made the new edit.
-;;
-;; However, in Emacs' undo system, those old buffer states are still there in
-;; the undo history. You just have to rewind back through the new edit, and
-;; back through the changes made by the undos, until you reach them. Of
-;; course, since Emacs treats undos (even undos of undos!) as new changes,
-;; you're really weaving backwards and forwards through the history, all the
-;; time adding new changes to the end of the string as you go:
-;;
-;;                       o
-;;                       |
-;;                       |
-;;                       o  o     o  (undo new edit)
-;;                       |  |\    |\
-;;                       |  | \   | \
-;;                       o  o  |  |  o  (undo the undo)
-;;                       | /   |  |  |
-;;                       |/    |  |  |
-;;      (trying to get   o     |  |  x  (undo the undo)
-;;       to this state)        | /
-;;                             |/
-;;                             o
-;;
-;; So far, this is still reasonably intuitive to use. It doesn't behave so
-;; differently to standard undo/redo, except that by going back far enough you
-;; can access changes that would be lost in standard undo/redo.
-;;
-;; However, imagine that after undoing as just described, you decide you
-;; actually want to rewind right back to the initial state. If you're lucky,
-;; and haven't invoked any command since the last undo, you can just keep on
-;; undoing until you get back to the start:
-;;
-;;      (trying to get   o              x  (got there!)
-;;       to this state)  |              |
-;;                       |              |
-;;                       o  o     o     o  (keep undoing)
-;;                       |  |\    |\    |
-;;                       |  | \   | \   |
-;;                       o  o  |  |  o  o  (keep undoing)
-;;                       | /   |  |  | /
-;;                       |/    |  |  |/
-;;      (already undid   o     |  |  o  (got this far)
-;;       to this state)        | /
-;;                             |/
-;;                             o
-;;
-;; But if you're unlucky, and you happen to have moved the point (say) after
-;; getting to the state labelled "got this far", then you've "broken the undo
-;; chain". Hold on to something solid, because things are about to get
-;; hairy. If you try to undo now, Emacs thinks you're trying to undo the
-;; undos! So to get back to the initial state you now have to rewind through
-;; *all* the changes, including the undos you just did:
-;;
-;;      (trying to get   o                          x  (finally got there!)
-;;       to this state)  |                          |
-;;                       |                          |
-;;                       o  o     o     o     o     o
-;;                       |  |\    |\    |\    |\    |
-;;                       |  | \   | \   | \   | \   |
-;;                       o  o  |  |  o  o  |  |  o  o
-;;                       | /   |  |  | /   |  |  | /
-;;                       |/    |  |  |/    |  |  |/
-;;      (already undid   o     |  |  o<.   |  |  o
-;;       to this state)        | /     :   | /
-;;                             |/      :   |/
-;;                             o       :   o
-;;                                     :
-;;                             (got this far, but
-;;                              broke the undo chain)
-;;
-;; Confused?
-;;
-;; In practice you can just hold down the undo key until you reach the buffer
-;; state that you want. But whatever you do, don't move around in the buffer
-;; to *check* that you've got back to where you want! Because you'll break the
-;; undo chain, and then you'll have to traverse the entire string of undos
-;; again, just to get back to the point at which you broke the
-;; chain. Undo-in-region and commands such as `undo-only' help to make using
-;; Emacs' undo a little easier, but nonetheless it remains confusing for many
-;; people.
-;;
-;;
-;; So what does `undo-tree-mode' do? Remember the diagram we drew to represent
-;; the history we've been discussing (make a few edits, undo a couple of them,
-;; and edit again)? The diagram that conceptually represented our undo
-;; history, before we started discussing specific undo systems? It looked like
-;; this:
-;;
-;;                                o  (initial buffer state)
-;;                                |
-;;                                |
-;;                                o
-;;                                |\
-;;                                | \
-;;                                o  x  (current state)
-;;                                |
-;;                                |
-;;                                o
-;;
-;; Well, that's *exactly* what the undo history looks like to
-;; `undo-tree-mode'.  It doesn't discard the old branch (as standard undo/redo
-;; does), nor does it treat undos as new changes to be added to the end of a
-;; linear string of buffer states (as Emacs' undo does). It just keeps track
-;; of the tree of branching changes that make up the entire undo history.
-;;
-;; If you undo from this point, you'll rewind back up the tree to the previous
-;; state:
-;;
-;;                                o
-;;                                |
-;;                                |
-;;                                x  (undo)
-;;                                |\
-;;                                | \
-;;                                o  o
-;;                                |
-;;                                |
-;;                                o
-;;
-;; If you were to undo again, you'd rewind back to the initial state. If on
-;; the other hand you redo the change, you'll end up back at the bottom of the
-;; most recent branch:
-;;
-;;                                o  (undo takes you here)
-;;                                |
-;;                                |
-;;                                o  (start here)
-;;                                |\
-;;                                | \
-;;                                o  x  (redo takes you here)
-;;                                |
-;;                                |
-;;                                o
-;;
-;; So far, this is just like the standard undo/redo system. But what if you
-;; want to return to a buffer state located on a previous branch of the
-;; history? Since `undo-tree-mode' keeps the entire history, you simply need
-;; to tell it to switch to a different branch, and then redo the changes you
-;; want:
-;;
-;;                                o
-;;                                |
-;;                                |
-;;                                o  (start here, but switch
-;;                                |\  to the other branch)
-;;                                | \
-;;                        (redo)  o  o
-;;                                |
-;;                                |
-;;                        (redo)  x
-;;
-;; Now you're on the other branch, if you undo and redo changes you'll stay on
-;; that branch, moving up and down through the buffer states located on that
-;; branch. Until you decide to switch branches again, of course.
-;;
-;; Real undo trees might have multiple branches and sub-branches:
-;;
-;;                                o
-;;                            ____|______
-;;                           /           \
-;;                          o             o
-;;                      ____|__         __|
-;;                     /    |  \       /   \
-;;                    o     o   o     o     x
-;;                    |               |
-;;                   / \             / \
-;;                  o   o           o   o
-;;
-;; Trying to imagine what Emacs' undo would do as you move about such a tree
-;; will likely frazzle your brain circuits! But in `undo-tree-mode', you're
-;; just moving around this undo history tree. Most of the time, you'll
-;; probably only need to stay on the most recent branch, in which case it
-;; behaves like standard undo/redo, and is just as simple to understand. But
-;; if you ever need to recover a buffer state on a different branch, the
-;; possibility of switching between branches and accessing the full undo
-;; history is still there.
-;;
-;;
-;;
-;; The Undo-Tree Visualizer
-;; ========================
-;;
-;; Actually, it gets better. You don't have to imagine all these tree
-;; diagrams, because `undo-tree-mode' includes an undo-tree visualizer which
-;; draws them for you! In fact, it draws even better diagrams: it highlights
-;; the node representing the current buffer state, it highlights the current
-;; branch, and you can toggle the display of time-stamps (by hitting "t") and
-;; a diff of the undo changes (by hitting "d"). (There's one other tiny
-;; difference: the visualizer puts the most recent branch on the left rather
-;; than the right.)
-;;
-;; Bring up the undo tree visualizer whenever you want by hitting "C-x u".
-;;
-;; In the visualizer, the usual keys for moving up and down a buffer instead
-;; move up and down the undo history tree (e.g. the up and down arrow keys, or
-;; "C-n" and "C-p"). The state of the "parent" buffer (the buffer whose undo
-;; history you are visualizing) is updated as you move around the undo tree in
-;; the visualizer. If you reach a branch point in the visualizer, the usual
-;; keys for moving forward and backward in a buffer instead switch branch
-;; (e.g. the left and right arrow keys, or "C-f" and "C-b").
-;;
-;; Clicking with the mouse on any node in the visualizer will take you
-;; directly to that node, resetting the state of the parent buffer to the
-;; state represented by that node.
-;;
-;; You can also select nodes directly using the keyboard, by hitting "s" to
-;; toggle selection mode. The usual motion keys now allow you to move around
-;; the tree without changing the parent buffer. Hitting <enter> will reset the
-;; state of the parent buffer to the state represented by the currently
-;; selected node.
-;;
-;; It can be useful to see how long ago the parent buffer was in the state
-;; represented by a particular node in the visualizer. Hitting "t" in the
-;; visualizer toggles the display of time-stamps for all the nodes. (Note
-;; that, because of the way `undo-tree-mode' works, these time-stamps may be
-;; somewhat later than the true times, especially if it's been a long time
-;; since you last undid any changes.)
-;;
-;; To get some idea of what changes are represented by a given node in the
-;; tree, it can be useful to see a diff of the changes. Hit "d" in the
-;; visualizer to toggle a diff display. This normally displays a diff between
-;; the current state and the previous one, i.e. it shows you the changes that
-;; will be applied if you undo (move up the tree). However, the diff display
-;; really comes into its own in the visualizer's selection mode (see above),
-;; where it instead shows a diff between the current state and the currently
-;; selected state, i.e. it shows you the changes that will be applied if you
-;; reset to the selected state.
-;;
-;; (Note that the diff is generated by the Emacs `diff' command, and is
-;; displayed using `diff-mode'. See the corresponding customization groups if
-;; you want to customize the diff display.)
-;;
-;; Finally, hitting "q" will quit the visualizer, leaving the parent buffer in
-;; whatever state you ended at. Hitting "C-q" will abort the visualizer,
-;; returning the parent buffer to whatever state it was originally in when the
-;; visualizer was invoked.
-;;
-;;
-;;
-;; Undo-in-Region
-;; ==============
-;;
-;; Emacs allows a very useful and powerful method of undoing only selected
-;; changes: when a region is active, only changes that affect the text within
-;; that region will be undone. With the standard Emacs undo system, changes
-;; produced by undoing-in-region naturally get added onto the end of the
-;; linear undo history:
-;;
-;;                       o
-;;                       |
-;;                       |  x  (second undo-in-region)
-;;                       o  |
-;;                       |  |
-;;                       |  o  (first undo-in-region)
-;;                       o  |
-;;                       | /
-;;                       |/
-;;                       o
-;;
-;; You can of course redo these undos-in-region as usual, by undoing the
-;; undos:
-;;
-;;                       o
-;;                       |
-;;                       |  o_
-;;                       o  | \
-;;                       |  |  |
-;;                       |  o  o  (undo the undo-in-region)
-;;                       o  |  |
-;;                       | /   |
-;;                       |/    |
-;;                       o     x  (undo the undo-in-region)
-;;
-;;
-;; In `undo-tree-mode', undo-in-region works much the same way: when there's
-;; an active region, undoing only undoes changes that affect that region. In
-;; `undo-tree-mode', redoing when there's an active region similarly only
-;; redoes changes that affect that region.
-;;
-;; However, the way these undo- and redo-in-region changes are recorded in the
-;; undo history is quite different. The good news is, you don't need to
-;; understand this to use undo- and redo-in-region in `undo-tree-mode' - just
-;; go ahead and use them! They'll probably work as you expect. But if you're
-;; masochistic enough to want to understand conceptually what's happening to
-;; the undo tree as you undo- and redo-in-region, then read on...
-;;
-;;
-;; Undo-in-region creates a new branch in the undo history. The new branch
-;; consists of an undo step that undoes some of the changes that affect the
-;; current region, and another step that undoes the remaining changes needed
-;; to rejoin the previous undo history.
-;;
-;;      Previous undo history                Undo-in-region
-;;
-;;               o                                o
-;;               |                                |
-;;               |                                |
-;;               |                                |
-;;               o                                o
-;;               |                                |
-;;               |                                |
-;;               |                                |
-;;               o                                o_
-;;               |                                | \
-;;               |                                |  x  (undo-in-region)
-;;               |                                |  |
-;;               x                                o  o
-;;
-;; As long as you don't change the active region after undoing-in-region,
-;; continuing to undo-in-region extends the new branch, pulling more changes
-;; that affect the current region into an undo step immediately above your
-;; current location in the undo tree, and pushing the point at which the new
-;; branch is attached further up the tree:
-;;
-;;      First undo-in-region                 Second undo-in-region
-;;
-;;               o                                o
-;;               |                                |
-;;               |                                |
-;;               |                                |
-;;               o                                o_
-;;               |                                | \
-;;               |                                |  x  (undo-in-region)
-;;               |                                |  |
-;;               o_                               o  |
-;;               | \                              |  |
-;;		 |  x                             |  o
-;;		 |  |                             |  |
-;;		 o  o     			  o  o
-;;
-;; Redoing takes you back down the undo tree, as usual (as long as you haven't
-;; changed the active region after undoing-in-region, it doesn't matter if it
-;; is still active):
-;;
-;;                       o
-;;			 |
-;;			 |
-;;			 |
-;;			 o_
-;;			 | \
-;;			 |  o
-;;			 |  |
-;;			 o  |
-;;			 |  |
-;;			 |  o  (redo)
-;;			 |  |
-;;			 o  x  (redo)
-;;
-;;
-;; What about redo-in-region? Obviously, redo-in-region only makes sense if
-;; you have already undone some changes, so that there are some changes to
-;; redo! Redoing-in-region splits off a new branch of the undo history below
-;; your current location in the undo tree. This time, the new branch consists
-;; of a first redo step that redoes some of the redo changes that affect the
-;; current region, followed by *all* the remaining redo changes.
-;;
-;;      Previous undo history                Redo-in-region
-;;
-;;               o                                o
-;;               |                                |
-;;               |                                |
-;;               |                                |
-;;               x                                o_
-;;               |                                | \
-;;               |                                |  x  (redo-in-region)
-;;               |                                |  |
-;;               o                                o  |
-;;               |                                |  |
-;;               |                                |  |
-;;               |                                |  |
-;;               o                                o  o
-;;
-;; As long as you don't change the active region after redoing-in-region,
-;; continuing to redo-in-region extends the new branch, pulling more redo
-;; changes into a redo step immediately below your current location in the
-;; undo tree.
-;;
-;;      First redo-in-region                 Second redo-in-region
-;;
-;;               o                                 o
-;;               |                                 |
-;;               |                                 |
-;;               |                                 |
-;;               o_                                o_
-;;               | \                               | \
-;;               |  x                              |  o
-;;               |  |                              |  |
-;;               o  |                              o  |
-;;               |  |                              |  |
-;;               |  |                              |  x  (redo-in-region)
-;;               |  |                              |  |
-;;               o  o                              o  o
-;;
-;; Note that undo-in-region and redo-in-region only ever add new changes to
-;; the undo tree, they *never* modify existing undo history. So you can always
-;; return to previous buffer states by switching to a previous branch of the
-;; tree.
-
-
-
-;;; Code:
-
-(eval-when-compile (require 'cl))
-(require 'diff)
-
-
-
-;;; =====================================================================
-;;;              Compatibility hacks for older Emacsen
-
-;; `characterp' isn't defined in Emacs versions < 23
-(unless (fboundp 'characterp)
-  (defalias 'characterp 'char-valid-p))
-
-;; `region-active-p' isn't defined in Emacs versions < 23
-(unless (fboundp 'region-active-p)
-  (defun region-active-p () (and transient-mark-mode mark-active)))
-
-
-;; `registerv' defstruct isn't defined in Emacs versions < 24
-(unless (fboundp 'registerv-make)
-  (defmacro registerv-make (data &rest _dummy) data))
-
-(unless (fboundp 'registerv-data)
-  (defmacro registerv-data (data) data))
-
-
-;; `diff-no-select' and `diff-file-local-copy' aren't defined in Emacs
-;; versions < 24 (copied and adapted from Emacs 24)
-(unless (fboundp 'diff-no-select)
-  (defun diff-no-select (old new &optional switches no-async buf)
-    ;; Noninteractive helper for creating and reverting diff buffers
-    (unless (bufferp new) (setq new (expand-file-name new)))
-    (unless (bufferp old) (setq old (expand-file-name old)))
-    (or switches (setq switches diff-switches)) ; If not specified, use default.
-    (unless (listp switches) (setq switches (list switches)))
-    (or buf (setq buf (get-buffer-create "*Diff*")))
-    (let* ((old-alt (diff-file-local-copy old))
-	   (new-alt (diff-file-local-copy new))
-	   (command
-	    (mapconcat 'identity
-		       `(,diff-command
-			 ;; Use explicitly specified switches
-			 ,@switches
-			 ,@(mapcar #'shell-quote-argument
-				   (nconc
-				    (when (or old-alt new-alt)
-				      (list "-L" (if (stringp old)
-						     old (prin1-to-string old))
-					    "-L" (if (stringp new)
-						     new (prin1-to-string new))))
-				    (list (or old-alt old)
-					  (or new-alt new)))))
-		       " "))
-	   (thisdir default-directory))
-      (with-current-buffer buf
-	(setq buffer-read-only t)
-	(buffer-disable-undo (current-buffer))
-	(let ((inhibit-read-only t))
-	  (erase-buffer))
-	(buffer-enable-undo (current-buffer))
-	(diff-mode)
-	(set (make-local-variable 'revert-buffer-function)
-	     (lambda (_ignore-auto _noconfirm)
-	       (diff-no-select old new switches no-async (current-buffer))))
-	(setq default-directory thisdir)
-	(let ((inhibit-read-only t))
-	  (insert command "\n"))
-	(if (and (not no-async) (fboundp 'start-process))
-	    (let ((proc (start-process "Diff" buf shell-file-name
-				       shell-command-switch command)))
-	      (set-process-filter proc 'diff-process-filter)
-	      (set-process-sentinel
-	       proc (lambda (proc _msg)
-		      (with-current-buffer (process-buffer proc)
-			(diff-sentinel (process-exit-status proc))
-			(if old-alt (delete-file old-alt))
-			(if new-alt (delete-file new-alt))))))
-	  ;; Async processes aren't available.
-	  (let ((inhibit-read-only t))
-	    (diff-sentinel
-	     (call-process shell-file-name nil buf nil
-			   shell-command-switch command))
-	    (if old-alt (delete-file old-alt))
-	    (if new-alt (delete-file new-alt)))))
-      buf)))
-
-(unless (fboundp 'diff-file-local-copy)
-  (defun diff-file-local-copy (file-or-buf)
-    (if (bufferp file-or-buf)
-	(with-current-buffer file-or-buf
-	  (let ((tempfile (make-temp-file "buffer-content-")))
-	    (write-region nil nil tempfile nil 'nomessage)
-	    tempfile))
-      (file-local-copy file-or-buf))))
-
-
-;; `user-error' isn't defined in Emacs < 24.3
-(unless (fboundp 'user-error)
-  (defalias 'user-error 'error)
-  ;; prevent debugger being called on user errors
-  (add-to-list 'debug-ignored-errors "^No further undo information")
-  (add-to-list 'debug-ignored-errors "^No further redo information")
-  (add-to-list 'debug-ignored-errors "^No further redo information for region"))
-
-
-
-
-
-;;; =====================================================================
-;;;              Global variables and customization options
-
-(defvar buffer-undo-tree nil
-  "Tree of undo entries in current buffer.")
-(put 'buffer-undo-tree 'permanent-local t)
-(make-variable-buffer-local 'buffer-undo-tree)
-
-
-(defgroup undo-tree nil
-  "Tree undo/redo."
-  :group 'undo)
-
-(defcustom undo-tree-mode-lighter " Undo-Tree"
-  "Lighter displayed in mode line
-when `undo-tree-mode' is enabled."
-  :group 'undo-tree
-  :type 'string)
-
-
-(defcustom undo-tree-incompatible-major-modes '(term-mode)
-  "List of major-modes in which `undo-tree-mode' should not be enabled.
-\(See `turn-on-undo-tree-mode'.\)"
-  :group 'undo-tree
-  :type '(repeat symbol))
-
-
-(defcustom undo-tree-enable-undo-in-region t
-  "When non-nil, enable undo-in-region.
-
-When undo-in-region is enabled, undoing or redoing when the
-region is active (in `transient-mark-mode') or with a prefix
-argument (not in `transient-mark-mode') only undoes changes
-within the current region."
-  :group 'undo-tree
-  :type 'boolean)
-
-
-(defcustom undo-tree-auto-save-history nil
-  "When non-nil, `undo-tree-mode' will save undo history to file
-when a buffer is saved to file.
-
-It will automatically load undo history when a buffer is loaded
-from file, if an undo save file exists.
-
-By default, undo-tree history is saved to a file called
-\".<buffer-file-name>.~undo-tree~\" in the same directory as the
-file itself. To save under a different directory, customize
-`undo-tree-history-directory-alist' (see the documentation for
-that variable for details).
-
-WARNING! `undo-tree-auto-save-history' will not work properly in
-Emacs versions prior to 24.3, so it cannot be enabled via
-the customization interface in versions earlier than that one. To
-ignore this warning and enable it regardless, set
-`undo-tree-auto-save-history' to a non-nil value outside of
-customize."
-  :group 'undo-tree
-  :type (if (version-list-< (version-to-list emacs-version) '(24 3))
-	    '(choice (const :tag "<disabled>" nil))
-	  'boolean))
-
-
-(defcustom undo-tree-history-directory-alist nil
-  "Alist of filename patterns and undo history directory names.
-Each element looks like (REGEXP . DIRECTORY).  Undo history for
-files with names matching REGEXP will be saved in DIRECTORY.
-DIRECTORY may be relative or absolute.  If it is absolute, so
-that all matching files are backed up into the same directory,
-the file names in this directory will be the full name of the
-file backed up with all directory separators changed to `!' to
-prevent clashes.  This will not work correctly if your filesystem
-truncates the resulting name.
-
-For the common case of all backups going into one directory, the
-alist should contain a single element pairing \".\" with the
-appropriate directory name.
-
-If this variable is nil, or it fails to match a filename, the
-backup is made in the original file's directory.
-
-On MS-DOS filesystems without long names this variable is always
-ignored."
-  :group 'undo-tree
-  :type '(repeat (cons (regexp :tag "Regexp matching filename")
-		       (directory :tag "Undo history directory name"))))
-
-
-
-(defcustom undo-tree-visualizer-relative-timestamps t
-  "When non-nil, display times relative to current time
-when displaying time stamps in visualizer.
-
-Otherwise, display absolute times."
-  :group 'undo-tree
-  :type 'boolean)
-
-
-(defcustom undo-tree-visualizer-timestamps nil
-  "When non-nil, display time-stamps by default
-in undo-tree visualizer.
-
-\\<undo-tree-visualizer-mode-map>You can always toggle time-stamps on and off \
-using \\[undo-tree-visualizer-toggle-timestamps], regardless of the
-setting of this variable."
-  :group 'undo-tree
-  :type 'boolean)
-
-
-(defcustom undo-tree-visualizer-diff nil
-  "When non-nil, display diff by default in undo-tree visualizer.
-
-\\<undo-tree-visualizer-mode-map>You can always toggle the diff display \
-using \\[undo-tree-visualizer-toggle-diff], regardless of the
-setting of this variable."
-  :group 'undo-tree
-  :type 'boolean)
-
-
-(defcustom undo-tree-visualizer-lazy-drawing 100
-  "When non-nil, use lazy undo-tree drawing in visualizer.
-
-Setting this to a number causes the visualizer to switch to lazy
-drawing when the number of nodes in the tree is larger than this
-value.
-
-Lazy drawing means that only the visible portion of the tree will
-be drawn initially, and the tree will be extended later as
-needed. For the most part, the only visible effect of this is to
-significantly speed up displaying the visualizer for very large
-trees.
-
-There is one potential negative effect of lazy drawing. Other
-branches of the tree will only be drawn once the node from which
-they branch off becomes visible. So it can happen that certain
-portions of the tree that would be shown with lazy drawing
-disabled, will not be drawn immediately when it is
-enabled. However, this effect is quite rare in practice."
-  :group 'undo-tree
-  :type '(choice (const :tag "never" nil)
-		 (const :tag "always" t)
-		 (integer :tag "> size")))
-
-
-(defface undo-tree-visualizer-default-face
-  '((((class color)) :foreground "gray"))
-  "Face used to draw undo-tree in visualizer."
-  :group 'undo-tree)
-
-(defface undo-tree-visualizer-current-face
-  '((((class color)) :foreground "red"))
-  "Face used to highlight current undo-tree node in visualizer."
-  :group 'undo-tree)
-
-(defface undo-tree-visualizer-active-branch-face
-  '((((class color) (background dark))
-     (:foreground "white" :weight bold))
-    (((class color) (background light))
-     (:foreground "black" :weight bold)))
-  "Face used to highlight active undo-tree branch in visualizer."
-  :group 'undo-tree)
-
-(defface undo-tree-visualizer-register-face
-  '((((class color)) :foreground "yellow"))
-  "Face used to highlight undo-tree nodes saved to a register
-in visualizer."
-  :group 'undo-tree)
-
-(defface undo-tree-visualizer-unmodified-face
-  '((((class color)) :foreground "cyan"))
-  "Face used to highlight nodes corresponding to unmodified buffers
-in visualizer."
-  :group 'undo-tree)
-
-
-(defvar undo-tree-visualizer-parent-buffer nil
-  "Parent buffer in visualizer.")
-(put 'undo-tree-visualizer-parent-buffer 'permanent-local t)
-(make-variable-buffer-local 'undo-tree-visualizer-parent-buffer)
-
-;; stores modification time of parent buffer's file, if any
-(defvar undo-tree-visualizer-parent-mtime nil)
-(put 'undo-tree-visualizer-parent-mtime 'permanent-local t)
-(make-variable-buffer-local 'undo-tree-visualizer-parent-mtime)
-
-;; stores current horizontal spacing needed for drawing undo-tree
-(defvar undo-tree-visualizer-spacing nil)
-(put 'undo-tree-visualizer-spacing 'permanent-local t)
-(make-variable-buffer-local 'undo-tree-visualizer-spacing)
-
-;; calculate horizontal spacing required for drawing tree with current
-;; settings
-(defsubst undo-tree-visualizer-calculate-spacing ()
-  (if undo-tree-visualizer-timestamps
-      (if undo-tree-visualizer-relative-timestamps 9 13)
-    3))
-
-;; holds node that was current when visualizer was invoked
-(defvar undo-tree-visualizer-initial-node nil)
-(put 'undo-tree-visualizer-initial-node 'permanent-local t)
-(make-variable-buffer-local 'undo-tree-visualizer-initial-node)
-
-;; holds currently selected node in visualizer selection mode
-(defvar undo-tree-visualizer-selected-node nil)
-(put 'undo-tree-visualizer-selected-node 'permanent-local t)
-(make-variable-buffer-local 'undo-tree-visualizer-selected)
-
-;; used to store nodes at edge of currently drawn portion of tree
-(defvar undo-tree-visualizer-needs-extending-down nil)
-(put 'undo-tree-visualizer-needs-extending-down 'permanent-local t)
-(make-variable-buffer-local 'undo-tree-visualizer-needs-extending-down)
-(defvar undo-tree-visualizer-needs-extending-up nil)
-(put 'undo-tree-visualizer-needs-extending-up 'permanent-local t)
-(make-variable-buffer-local 'undo-tree-visualizer-needs-extending-up)
-
-;; dynamically bound to t when undoing from visualizer, to inhibit
-;; `undo-tree-kill-visualizer' hook function in parent buffer
-(defvar undo-tree-inhibit-kill-visualizer nil)
-
-;; can be let-bound to a face name, used in drawing functions
-(defvar undo-tree-insert-face nil)
-
-;; visualizer buffer names
-(defconst undo-tree-visualizer-buffer-name " *undo-tree*")
-(defconst undo-tree-diff-buffer-name "*undo-tree Diff*")
-
-;; install history-auto-save hooks
-(add-hook 'write-file-functions 'undo-tree-save-history-hook)
-(add-hook 'find-file-hook 'undo-tree-load-history-hook)
-
-
-
-
-;;; =================================================================
-;;;                          Default keymaps
-
-(defvar undo-tree-map nil
-  "Keymap used in undo-tree-mode.")
-
-(unless undo-tree-map
-  (let ((map (make-sparse-keymap)))
-    ;; remap `undo' and `undo-only' to `undo-tree-undo'
-    (define-key map [remap undo] 'undo-tree-undo)
-    (define-key map [remap undo-only] 'undo-tree-undo)
-    ;; bind standard undo bindings (since these match redo counterparts)
-    (define-key map (kbd "C-/") 'undo-tree-undo)
-    (define-key map "\C-_" 'undo-tree-undo)
-    ;; redo doesn't exist normally, so define our own keybindings
-    (define-key map (kbd "C-?") 'undo-tree-redo)
-    (define-key map (kbd "M-_") 'undo-tree-redo)
-    ;; just in case something has defined `redo'...
-    (define-key map [remap redo] 'undo-tree-redo)
-    ;; we use "C-x u" for the undo-tree visualizer
-    (define-key map (kbd "\C-x u") 'undo-tree-visualize)
-    ;; bind register commands
-    (define-key map (kbd "C-x r u") 'undo-tree-save-state-to-register)
-    (define-key map (kbd "C-x r U") 'undo-tree-restore-state-from-register)
-    ;; set keymap
-    (setq undo-tree-map map)))
-
-
-(defvar undo-tree-visualizer-mode-map nil
-  "Keymap used in undo-tree visualizer.")
-
-(unless undo-tree-visualizer-mode-map
-  (let ((map (make-sparse-keymap)))
-    ;; vertical motion keys undo/redo
-    (define-key map [remap previous-line] 'undo-tree-visualize-undo)
-    (define-key map [remap next-line] 'undo-tree-visualize-redo)
-    (define-key map [up] 'undo-tree-visualize-undo)
-    (define-key map "p" 'undo-tree-visualize-undo)
-    (define-key map "\C-p" 'undo-tree-visualize-undo)
-    (define-key map [down] 'undo-tree-visualize-redo)
-    (define-key map "n" 'undo-tree-visualize-redo)
-    (define-key map "\C-n" 'undo-tree-visualize-redo)
-    ;; horizontal motion keys switch branch
-    (define-key map [remap forward-char]
-      'undo-tree-visualize-switch-branch-right)
-    (define-key map [remap backward-char]
-      'undo-tree-visualize-switch-branch-left)
-    (define-key map [right] 'undo-tree-visualize-switch-branch-right)
-    (define-key map "f" 'undo-tree-visualize-switch-branch-right)
-    (define-key map "\C-f" 'undo-tree-visualize-switch-branch-right)
-    (define-key map [left] 'undo-tree-visualize-switch-branch-left)
-    (define-key map "b" 'undo-tree-visualize-switch-branch-left)
-    (define-key map "\C-b" 'undo-tree-visualize-switch-branch-left)
-    ;; paragraph motion keys undo/redo to significant points in tree
-    (define-key map [remap backward-paragraph] 'undo-tree-visualize-undo-to-x)
-    (define-key map [remap forward-paragraph] 'undo-tree-visualize-redo-to-x)
-    (define-key map "\M-{" 'undo-tree-visualize-undo-to-x)
-    (define-key map "\M-}" 'undo-tree-visualize-redo-to-x)
-    (define-key map [C-up] 'undo-tree-visualize-undo-to-x)
-    (define-key map [C-down] 'undo-tree-visualize-redo-to-x)
-    ;; mouse sets buffer state to node at click
-    (define-key map [mouse-1] 'undo-tree-visualizer-mouse-set)
-    ;; toggle timestamps
-    (define-key map "t" 'undo-tree-visualizer-toggle-timestamps)
-    ;; toggle diff
-    (define-key map "d" 'undo-tree-visualizer-toggle-diff)
-    ;; toggle selection mode
-    (define-key map "s" 'undo-tree-visualizer-selection-mode)
-    ;; horizontal scrolling may be needed if the tree is very wide
-    (define-key map "," 'undo-tree-visualizer-scroll-left)
-    (define-key map "." 'undo-tree-visualizer-scroll-right)
-    (define-key map "<" 'undo-tree-visualizer-scroll-left)
-    (define-key map ">" 'undo-tree-visualizer-scroll-right)
-    ;; vertical scrolling may be needed if the tree is very tall
-    (define-key map [next] 'undo-tree-visualizer-scroll-up)
-    (define-key map [prior] 'undo-tree-visualizer-scroll-down)
-    ;; quit/abort visualizer
-    (define-key map "q" 'undo-tree-visualizer-quit)
-    (define-key map "\C-q" 'undo-tree-visualizer-abort)
-    ;; set keymap
-    (setq undo-tree-visualizer-mode-map map)))
-
-
-(defvar undo-tree-visualizer-selection-mode-map nil
-  "Keymap used in undo-tree visualizer selection mode.")
-
-(unless undo-tree-visualizer-selection-mode-map
-  (let ((map (make-sparse-keymap)))
-    ;; vertical motion keys move up and down tree
-    (define-key map [remap previous-line]
-      'undo-tree-visualizer-select-previous)
-    (define-key map [remap next-line]
-      'undo-tree-visualizer-select-next)
-    (define-key map [up] 'undo-tree-visualizer-select-previous)
-    (define-key map "p" 'undo-tree-visualizer-select-previous)
-    (define-key map "\C-p" 'undo-tree-visualizer-select-previous)
-    (define-key map [down] 'undo-tree-visualizer-select-next)
-    (define-key map "n" 'undo-tree-visualizer-select-next)
-    (define-key map "\C-n" 'undo-tree-visualizer-select-next)
-    ;; vertical scroll keys move up and down quickly
-    (define-key map [next]
-      (lambda () (interactive) (undo-tree-visualizer-select-next 10)))
-    (define-key map [prior]
-      (lambda () (interactive) (undo-tree-visualizer-select-previous 10)))
-    ;; horizontal motion keys move to left and right siblings
-    (define-key map [remap forward-char] 'undo-tree-visualizer-select-right)
-    (define-key map [remap backward-char] 'undo-tree-visualizer-select-left)
-    (define-key map [right] 'undo-tree-visualizer-select-right)
-    (define-key map "f" 'undo-tree-visualizer-select-right)
-    (define-key map "\C-f" 'undo-tree-visualizer-select-right)
-    (define-key map [left] 'undo-tree-visualizer-select-left)
-    (define-key map "b" 'undo-tree-visualizer-select-left)
-    (define-key map "\C-b" 'undo-tree-visualizer-select-left)
-    ;; horizontal scroll keys move left or right quickly
-    (define-key map ","
-      (lambda () (interactive) (undo-tree-visualizer-select-left 10)))
-    (define-key map "."
-      (lambda () (interactive) (undo-tree-visualizer-select-right 10)))
-    (define-key map "<"
-      (lambda () (interactive) (undo-tree-visualizer-select-left 10)))
-    (define-key map ">"
-      (lambda () (interactive) (undo-tree-visualizer-select-right 10)))
-    ;; <enter> sets buffer state to node at point
-    (define-key map "\r" 'undo-tree-visualizer-set)
-    ;; mouse selects node at click
-    (define-key map [mouse-1] 'undo-tree-visualizer-mouse-select)
-    ;; toggle diff
-    (define-key map "d" 'undo-tree-visualizer-selection-toggle-diff)
-    ;; set keymap
-    (setq undo-tree-visualizer-selection-mode-map map)))
-
-
-(defvar undo-tree-old-undo-menu-item nil)
-
-(defun undo-tree-update-menu-bar ()
-  "Update `undo-tree-mode' Edit menu items."
-  (if undo-tree-mode
-      (progn
-	;; save old undo menu item, and install undo/redo menu items
-	(setq undo-tree-old-undo-menu-item
-	      (cdr (assq 'undo (lookup-key global-map [menu-bar edit]))))
-	(define-key (lookup-key global-map [menu-bar edit])
-	  [undo] '(menu-item "Undo" undo-tree-undo
-			     :enable (and undo-tree-mode
-					  (not buffer-read-only)
-					  (not (eq t buffer-undo-list))
-					  (not (eq nil buffer-undo-tree))
-					  (undo-tree-node-previous
-					   (undo-tree-current buffer-undo-tree)))
-			     :help "Undo last operation"))
-	(define-key-after (lookup-key global-map [menu-bar edit])
-	  [redo] '(menu-item "Redo" undo-tree-redo
-			     :enable (and undo-tree-mode
-					  (not buffer-read-only)
-					  (not (eq t buffer-undo-list))
-					  (not (eq nil buffer-undo-tree))
-					  (undo-tree-node-next
-					   (undo-tree-current buffer-undo-tree)))
-			     :help "Redo last operation")
-	  'undo))
-    ;; uninstall undo/redo menu items
-    (define-key (lookup-key global-map [menu-bar edit])
-      [undo] undo-tree-old-undo-menu-item)
-    (define-key (lookup-key global-map [menu-bar edit])
-      [redo] nil)))
-
-(add-hook 'menu-bar-update-hook 'undo-tree-update-menu-bar)
-
-
-
-
-
-;;; =====================================================================
-;;;                     Undo-tree data structure
-
-(defstruct
-  (undo-tree
-   :named
-   (:constructor nil)
-   (:constructor make-undo-tree
-                 (&aux
-                  (root (undo-tree-make-node nil nil))
-                  (current root)
-                  (size 0)
-		  (count 0)
-		  (object-pool (make-hash-table :test 'eq :weakness 'value))))
-   ;;(:copier nil)
-   )
-  root current size count object-pool)
-
-
-
-(defstruct
-  (undo-tree-node
-   (:type vector)   ; create unnamed struct
-   (:constructor nil)
-   (:constructor undo-tree-make-node
-                 (previous undo
-		  &optional redo
-                  &aux
-                  (timestamp (current-time))
-                  (branch 0)))
-   (:constructor undo-tree-make-node-backwards
-                 (next-node undo
-		  &optional redo
-                  &aux
-                  (next (list next-node))
-                  (timestamp (current-time))
-                  (branch 0)))
-   (:copier nil))
-  previous next undo redo timestamp branch meta-data)
-
-
-(defmacro undo-tree-node-p (n)
-  (let ((len (length (undo-tree-make-node nil nil))))
-    `(and (vectorp ,n) (= (length ,n) ,len))))
-
-
-
-(defstruct
-  (undo-tree-region-data
-   (:type vector)   ; create unnamed struct
-   (:constructor nil)
-   (:constructor undo-tree-make-region-data
-		 (&optional undo-beginning undo-end
-			     redo-beginning redo-end))
-   (:constructor undo-tree-make-undo-region-data
-		 (undo-beginning undo-end))
-   (:constructor undo-tree-make-redo-region-data
-		 (redo-beginning redo-end))
-   (:copier nil))
-  undo-beginning undo-end redo-beginning redo-end)
-
-
-(defmacro undo-tree-region-data-p (r)
-  (let ((len (length (undo-tree-make-region-data))))
-    `(and (vectorp ,r) (= (length ,r) ,len))))
-
-(defmacro undo-tree-node-clear-region-data (node)
-  `(setf (undo-tree-node-meta-data ,node)
-	 (delq nil
-	       (delq :region
-		     (plist-put (undo-tree-node-meta-data ,node)
-				:region nil)))))
-
-
-(defmacro undo-tree-node-undo-beginning (node)
-  `(let ((r (plist-get (undo-tree-node-meta-data ,node) :region)))
-     (when (undo-tree-region-data-p r)
-       (undo-tree-region-data-undo-beginning r))))
-
-(defmacro undo-tree-node-undo-end (node)
-  `(let ((r (plist-get (undo-tree-node-meta-data ,node) :region)))
-     (when (undo-tree-region-data-p r)
-       (undo-tree-region-data-undo-end r))))
-
-(defmacro undo-tree-node-redo-beginning (node)
-  `(let ((r (plist-get (undo-tree-node-meta-data ,node) :region)))
-     (when (undo-tree-region-data-p r)
-       (undo-tree-region-data-redo-beginning r))))
-
-(defmacro undo-tree-node-redo-end (node)
-  `(let ((r (plist-get (undo-tree-node-meta-data ,node) :region)))
-     (when (undo-tree-region-data-p r)
-       (undo-tree-region-data-redo-end r))))
-
-
-(defsetf undo-tree-node-undo-beginning (node) (val)
-  `(let ((r (plist-get (undo-tree-node-meta-data ,node) :region)))
-     (unless (undo-tree-region-data-p r)
-       (setf (undo-tree-node-meta-data ,node)
-	     (plist-put (undo-tree-node-meta-data ,node) :region
-			(setq r (undo-tree-make-region-data)))))
-     (setf (undo-tree-region-data-undo-beginning r) ,val)))
-
-(defsetf undo-tree-node-undo-end (node) (val)
-  `(let ((r (plist-get (undo-tree-node-meta-data ,node) :region)))
-     (unless (undo-tree-region-data-p r)
-       (setf (undo-tree-node-meta-data ,node)
-	     (plist-put (undo-tree-node-meta-data ,node) :region
-			(setq r (undo-tree-make-region-data)))))
-     (setf (undo-tree-region-data-undo-end r) ,val)))
-
-(defsetf undo-tree-node-redo-beginning (node) (val)
-  `(let ((r (plist-get (undo-tree-node-meta-data ,node) :region)))
-     (unless (undo-tree-region-data-p r)
-       (setf (undo-tree-node-meta-data ,node)
-	     (plist-put (undo-tree-node-meta-data ,node) :region
-			(setq r (undo-tree-make-region-data)))))
-     (setf (undo-tree-region-data-redo-beginning r) ,val)))
-
-(defsetf undo-tree-node-redo-end (node) (val)
-  `(let ((r (plist-get (undo-tree-node-meta-data ,node) :region)))
-     (unless (undo-tree-region-data-p r)
-       (setf (undo-tree-node-meta-data ,node)
-	     (plist-put (undo-tree-node-meta-data ,node) :region
-			(setq r (undo-tree-make-region-data)))))
-     (setf (undo-tree-region-data-redo-end r) ,val)))
-
-
-
-(defstruct
-  (undo-tree-visualizer-data
-   (:type vector)   ; create unnamed struct
-   (:constructor nil)
-   (:constructor undo-tree-make-visualizer-data
-		 (&optional lwidth cwidth rwidth marker))
-   (:copier nil))
-  lwidth cwidth rwidth marker)
-
-
-(defmacro undo-tree-visualizer-data-p (v)
-  (let ((len (length (undo-tree-make-visualizer-data))))
-    `(and (vectorp ,v) (= (length ,v) ,len))))
-
-(defun undo-tree-node-clear-visualizer-data (node)
-  (let ((plist (undo-tree-node-meta-data node)))
-    (if (eq (car plist) :visualizer)
-	(setf (undo-tree-node-meta-data node) (nthcdr 2 plist))
-      (while (and plist (not (eq (cadr plist) :visualizer)))
-	(setq plist (cdr plist)))
-      (if plist (setcdr plist (nthcdr 3 plist))))))
-
-(defmacro undo-tree-node-lwidth (node)
-  `(let ((v (plist-get (undo-tree-node-meta-data ,node) :visualizer)))
-     (when (undo-tree-visualizer-data-p v)
-       (undo-tree-visualizer-data-lwidth v))))
-
-(defmacro undo-tree-node-cwidth (node)
-  `(let ((v (plist-get (undo-tree-node-meta-data ,node) :visualizer)))
-     (when (undo-tree-visualizer-data-p v)
-       (undo-tree-visualizer-data-cwidth v))))
-
-(defmacro undo-tree-node-rwidth (node)
-  `(let ((v (plist-get (undo-tree-node-meta-data ,node) :visualizer)))
-     (when (undo-tree-visualizer-data-p v)
-       (undo-tree-visualizer-data-rwidth v))))
-
-(defmacro undo-tree-node-marker (node)
-  `(let ((v (plist-get (undo-tree-node-meta-data ,node) :visualizer)))
-     (when (undo-tree-visualizer-data-p v)
-       (undo-tree-visualizer-data-marker v))))
-
-
-(defsetf undo-tree-node-lwidth (node) (val)
-  `(let ((v (plist-get (undo-tree-node-meta-data ,node) :visualizer)))
-     (unless (undo-tree-visualizer-data-p v)
-       (setf (undo-tree-node-meta-data ,node)
-	     (plist-put (undo-tree-node-meta-data ,node) :visualizer
-			(setq v (undo-tree-make-visualizer-data)))))
-     (setf (undo-tree-visualizer-data-lwidth v) ,val)))
-
-(defsetf undo-tree-node-cwidth (node) (val)
-  `(let ((v (plist-get (undo-tree-node-meta-data ,node) :visualizer)))
-     (unless (undo-tree-visualizer-data-p v)
-       (setf (undo-tree-node-meta-data ,node)
-	     (plist-put (undo-tree-node-meta-data ,node) :visualizer
-			(setq v (undo-tree-make-visualizer-data)))))
-     (setf (undo-tree-visualizer-data-cwidth v) ,val)))
-
-(defsetf undo-tree-node-rwidth (node) (val)
-  `(let ((v (plist-get (undo-tree-node-meta-data ,node) :visualizer)))
-     (unless (undo-tree-visualizer-data-p v)
-       (setf (undo-tree-node-meta-data ,node)
-	     (plist-put (undo-tree-node-meta-data ,node) :visualizer
-			(setq v (undo-tree-make-visualizer-data)))))
-     (setf (undo-tree-visualizer-data-rwidth v) ,val)))
-
-(defsetf undo-tree-node-marker (node) (val)
-  `(let ((v (plist-get (undo-tree-node-meta-data ,node) :visualizer)))
-     (unless (undo-tree-visualizer-data-p v)
-       (setf (undo-tree-node-meta-data ,node)
-	     (plist-put (undo-tree-node-meta-data ,node) :visualizer
-			(setq v (undo-tree-make-visualizer-data)))))
-     (setf (undo-tree-visualizer-data-marker v) ,val)))
-
-
-
-(defstruct
-  (undo-tree-register-data
-   (:type vector)
-   (:constructor nil)
-   (:constructor undo-tree-make-register-data (buffer node)))
-  buffer node)
-
-(defun undo-tree-register-data-p (data)
-  (and (vectorp data)
-       (= (length data) 2)
-       (undo-tree-node-p (undo-tree-register-data-node data))))
-
-(defun undo-tree-register-data-print-func (data)
-  (princ (format "an undo-tree state for buffer %s"
-		 (undo-tree-register-data-buffer data))))
-
-(defmacro undo-tree-node-register (node)
-  `(plist-get (undo-tree-node-meta-data ,node) :register))
-
-(defsetf undo-tree-node-register (node) (val)
-  `(setf (undo-tree-node-meta-data ,node)
-	 (plist-put (undo-tree-node-meta-data ,node) :register ,val)))
-
-
-
-
-;;; =====================================================================
-;;;              Basic undo-tree data structure functions
-
-(defun undo-tree-grow (undo)
-  "Add an UNDO node to current branch of `buffer-undo-tree'."
-  (let* ((current (undo-tree-current buffer-undo-tree))
-         (new (undo-tree-make-node current undo)))
-    (push new (undo-tree-node-next current))
-    (setf (undo-tree-current buffer-undo-tree) new)))
-
-
-(defun undo-tree-grow-backwards (node undo &optional redo)
-  "Add new node *above* undo-tree NODE, and return new node.
-Note that this will overwrite NODE's \"previous\" link, so should
-only be used on a detached NODE, never on nodes that are already
-part of `buffer-undo-tree'."
-  (let ((new (undo-tree-make-node-backwards node undo redo)))
-    (setf (undo-tree-node-previous node) new)
-    new))
-
-
-(defun undo-tree-splice-node (node splice)
-  "Splice NODE into undo tree, below node SPLICE.
-Note that this will overwrite NODE's \"next\" and \"previous\"
-links, so should only be used on a detached NODE, never on nodes
-that are already part of `buffer-undo-tree'."
-  (setf (undo-tree-node-next node) (undo-tree-node-next splice)
-	(undo-tree-node-branch node) (undo-tree-node-branch splice)
-	(undo-tree-node-previous node) splice
-	(undo-tree-node-next splice) (list node)
-	(undo-tree-node-branch splice) 0)
-  (dolist (n (undo-tree-node-next node))
-    (setf (undo-tree-node-previous n) node)))
-
-
-(defun undo-tree-snip-node (node)
-  "Snip NODE out of undo tree."
-  (let* ((parent (undo-tree-node-previous node))
-	 position p)
-    ;; if NODE is only child, replace parent's next links with NODE's
-    (if (= (length (undo-tree-node-next parent)) 0)
-	(setf (undo-tree-node-next parent) (undo-tree-node-next node)
-	      (undo-tree-node-branch parent) (undo-tree-node-branch node))
-      ;; otherwise...
-      (setq position (undo-tree-position node (undo-tree-node-next parent)))
-      (cond
-       ;; if active branch used do go via NODE, set parent's branch to active
-       ;; branch of NODE
-       ((= (undo-tree-node-branch parent) position)
-	(setf (undo-tree-node-branch parent)
-	      (+ position (undo-tree-node-branch node))))
-       ;; if active branch didn't go via NODE, update parent's branch to point
-       ;; to same node as before
-       ((> (undo-tree-node-branch parent) position)
-	(incf (undo-tree-node-branch parent)
-	      (1- (length (undo-tree-node-next node))))))
-      ;; replace NODE in parent's next list with NODE's entire next list
-      (if (= position 0)
-	  (setf (undo-tree-node-next parent)
-		(nconc (undo-tree-node-next node)
-		       (cdr (undo-tree-node-next parent))))
-	(setq p (nthcdr (1- position) (undo-tree-node-next parent)))
-	(setcdr p (nconc (undo-tree-node-next node) (cddr p)))))
-    ;; update previous links of NODE's children
-    (dolist (n (undo-tree-node-next node))
-      (setf (undo-tree-node-previous n) parent))))
-
-
-(defun undo-tree-mapc (--undo-tree-mapc-function-- node)
-  ;; Apply FUNCTION to NODE and to each node below it.
-  (let ((stack (list node))
-	n)
-    (while stack
-      (setq n (pop stack))
-      (funcall --undo-tree-mapc-function-- n)
-      (setq stack (append (undo-tree-node-next n) stack)))))
-
-
-(defmacro undo-tree-num-branches ()
-  "Return number of branches at current undo tree node."
-  '(length (undo-tree-node-next (undo-tree-current buffer-undo-tree))))
-
-
-(defun undo-tree-position (node list)
-  "Find the first occurrence of NODE in LIST.
-Return the index of the matching item, or nil of not found.
-Comparison is done with `eq'."
-  (let ((i 0))
-    (catch 'found
-      (while (progn
-               (when (eq node (car list)) (throw 'found i))
-               (incf i)
-               (setq list (cdr list))))
-      nil)))
-
-
-(defvar *undo-tree-id-counter* 0)
-(make-variable-buffer-local '*undo-tree-id-counter*)
-
-(defmacro undo-tree-generate-id ()
-  ;; Generate a new, unique id (uninterned symbol).
-  ;; The name is made by appending a number to "undo-tree-id".
-  ;; (Copied from CL package `gensym'.)
-  `(let ((num (prog1 *undo-tree-id-counter* (incf *undo-tree-id-counter*))))
-     (make-symbol (format "undo-tree-id%d" num))))
-
-
-(defun undo-tree-decircle (undo-tree)
-  ;; Nullify PREVIOUS links of UNDO-TREE nodes, to make UNDO-TREE data
-  ;; structure non-circular.
-  (undo-tree-mapc
-   (lambda (node)
-     (dolist (n (undo-tree-node-next node))
-       (setf (undo-tree-node-previous n) nil)))
-   (undo-tree-root undo-tree)))
-
-
-(defun undo-tree-recircle (undo-tree)
-  ;; Recreate PREVIOUS links of UNDO-TREE nodes, to restore circular UNDO-TREE
-  ;; data structure.
-  (undo-tree-mapc
-   (lambda (node)
-     (dolist (n (undo-tree-node-next node))
-       (setf (undo-tree-node-previous n) node)))
-   (undo-tree-root undo-tree)))
-
-
-
-
-;;; =====================================================================
-;;;             Undo list and undo changeset utility functions
-
-(defmacro undo-list-marker-elt-p (elt)
-  `(markerp (car-safe ,elt)))
-
-(defmacro undo-list-GCd-marker-elt-p (elt)
-  ;; Return t if ELT is a marker element whose marker has been moved to the
-  ;; object-pool, so may potentially have been garbage-collected.
-  ;; Note: Valid marker undo elements should be uniquely identified as cons
-  ;; cells with a symbol in the car (replacing the marker), and a number in
-  ;; the cdr. However, to guard against future changes to undo element
-  ;; formats, we perform an additional redundant check on the symbol name.
-  `(and (car-safe ,elt)
-	(symbolp (car ,elt))
-	(let ((str (symbol-name (car ,elt))))
-	  (and (> (length str) 12)
-	       (string= (substring str 0 12) "undo-tree-id")))
-	(numberp (cdr-safe ,elt))))
-
-
-(defun undo-tree-move-GC-elts-to-pool (elt)
-  ;; Move elements that can be garbage-collected into `buffer-undo-tree'
-  ;; object pool, substituting a unique id that can be used to retrieve them
-  ;; later. (Only markers require this treatment currently.)
-  (when (undo-list-marker-elt-p elt)
-    (let ((id (undo-tree-generate-id)))
-      (puthash id (car elt) (undo-tree-object-pool buffer-undo-tree))
-      (setcar elt id))))
-
-
-(defun undo-tree-restore-GC-elts-from-pool (elt)
-  ;; Replace object id's in ELT with corresponding objects from
-  ;; `buffer-undo-tree' object pool and return modified ELT, or return nil if
-  ;; any object in ELT has been garbage-collected.
-  (if (undo-list-GCd-marker-elt-p elt)
-      (when (setcar elt (gethash (car elt)
-				 (undo-tree-object-pool buffer-undo-tree)))
-	elt)
-    elt))
-
-
-(defun undo-list-clean-GCd-elts (undo-list)
-  ;; Remove object id's from UNDO-LIST that refer to elements that have been
-  ;; garbage-collected. UNDO-LIST is modified by side-effect.
-  (while (undo-list-GCd-marker-elt-p (car undo-list))
-    (unless (gethash (caar undo-list)
-		     (undo-tree-object-pool buffer-undo-tree))
-      (setq undo-list (cdr undo-list))))
-  (let ((p undo-list))
-    (while (cdr p)
-      (when (and (undo-list-GCd-marker-elt-p (cadr p))
-		 (null (gethash (car (cadr p))
-				(undo-tree-object-pool buffer-undo-tree))))
-	(setcdr p (cddr p)))
-      (setq p (cdr p))))
-  undo-list)
-
-
-(defun undo-list-pop-changeset (&optional discard-pos)
-  ;; Pop changeset from `buffer-undo-list'. If DISCARD-POS is non-nil, discard
-  ;; any position entries from changeset.
-
-  ;; discard undo boundaries and (if DISCARD-POS is non-nil) position entries
-  ;; at head of undo list
-  (while (or (null (car buffer-undo-list))
-	     (and discard-pos (integerp (car buffer-undo-list))))
-    (setq buffer-undo-list (cdr buffer-undo-list)))
-  ;; pop elements up to next undo boundary, discarding position entries if
-  ;; DISCARD-POS is non-nil
-  (if (eq (car buffer-undo-list) 'undo-tree-canary)
-      (push nil buffer-undo-list)
-    (let* ((changeset (list (pop buffer-undo-list)))
-           (p changeset))
-      (while (progn
-	       (undo-tree-move-GC-elts-to-pool (car p))
-	       (while (and discard-pos (integerp (car buffer-undo-list)))
-		 (setq buffer-undo-list (cdr buffer-undo-list)))
-	       (and (car buffer-undo-list)
-		    (not (eq (car buffer-undo-list) 'undo-tree-canary))))
-        (setcdr p (list (pop buffer-undo-list)))
-	(setq p (cdr p)))
-      changeset)))
-
-
-(defun undo-tree-copy-list (undo-list)
-  ;; Return a deep copy of first changeset in `undo-list'. Object id's are
-  ;; replaced by corresponding objects from `buffer-undo-tree' object-pool.
-    (let (copy p)
-      ;; if first element contains an object id, replace it with object from
-      ;; pool, discarding element entirely if it's been GC'd
-    (while (and undo-list (null copy))
-	(setq copy
-	      (undo-tree-restore-GC-elts-from-pool (pop undo-list))))
-    (when copy
-      (setq copy (list copy)
-	    p copy)
-      ;; copy remaining elements, replacing object id's with objects from
-      ;; pool, or discarding them entirely if they've been GC'd
-      (while undo-list
-	(when (setcdr p (undo-tree-restore-GC-elts-from-pool
-			 (undo-copy-list-1 (pop undo-list))))
-	  (setcdr p (list (cdr p)))
-	  (setq p (cdr p))))
-      copy)))
-
-
-
-(defun undo-list-transfer-to-tree ()
-  ;; Transfer entries accumulated in `buffer-undo-list' to `buffer-undo-tree'.
-
-  ;; `undo-list-transfer-to-tree' should never be called when undo is disabled
-  ;; (i.e. `buffer-undo-tree' is t)
-  (assert (not (eq buffer-undo-tree t)))
-
-  ;; if `buffer-undo-tree' is empty, create initial undo-tree
-  (when (null buffer-undo-tree) (setq buffer-undo-tree (make-undo-tree)))
-  ;; make sure there's a canary at end of `buffer-undo-list'
-  (when (null buffer-undo-list)
-    (setq buffer-undo-list '(nil undo-tree-canary)))
-
-  (unless (or (eq (cadr buffer-undo-list) 'undo-tree-canary)
-	      (eq (car buffer-undo-list) 'undo-tree-canary))
-    ;; create new node from first changeset in `buffer-undo-list', save old
-    ;; `buffer-undo-tree' current node, and make new node the current node
-    (let* ((node (undo-tree-make-node nil (undo-list-pop-changeset)))
-	   (splice (undo-tree-current buffer-undo-tree))
-	   (size (undo-list-byte-size (undo-tree-node-undo node)))
-	   (count 1))
-      (setf (undo-tree-current buffer-undo-tree) node)
-      ;; grow tree fragment backwards using `buffer-undo-list' changesets
-      (while (and buffer-undo-list
-		  (not (eq (cadr buffer-undo-list) 'undo-tree-canary)))
-	(setq node
-	      (undo-tree-grow-backwards node (undo-list-pop-changeset)))
-	(incf size (undo-list-byte-size (undo-tree-node-undo node)))
-	(incf count))
-      ;; if no undo history has been discarded from `buffer-undo-list' since
-      ;; last transfer, splice new tree fragment onto end of old
-      ;; `buffer-undo-tree' current node
-      (if (or (eq (cadr buffer-undo-list) 'undo-tree-canary)
-	      (eq (car buffer-undo-list) 'undo-tree-canary))
-	  (progn
-	    (setf (undo-tree-node-previous node) splice)
-	    (push node (undo-tree-node-next splice))
-	    (setf (undo-tree-node-branch splice) 0)
-	    (incf (undo-tree-size buffer-undo-tree) size)
-	    (incf (undo-tree-count buffer-undo-tree) count))
-	;; if undo history has been discarded, replace entire
-	;; `buffer-undo-tree' with new tree fragment
-	(setq node (undo-tree-grow-backwards node nil))
-	(setf (undo-tree-root buffer-undo-tree) node)
-	(setq buffer-undo-list '(nil undo-tree-canary))
-	(setf (undo-tree-size buffer-undo-tree) size)
-	(setf (undo-tree-count buffer-undo-tree) count)
-	(setq buffer-undo-list '(nil undo-tree-canary))))
-    ;; discard undo history if necessary
-    (undo-tree-discard-history)))
-
-
-(defun undo-list-byte-size (undo-list)
-  ;; Return size (in bytes) of UNDO-LIST
-  (let ((size 0) (p undo-list))
-    (while p
-      (incf size 8)  ; cons cells use up 8 bytes
-      (when (and (consp (car p)) (stringp (caar p)))
-        (incf size (string-bytes (caar p))))
-      (setq p (cdr p)))
-    size))
-
-
-
-(defun undo-list-rebuild-from-tree ()
-  "Rebuild `buffer-undo-list' from information in `buffer-undo-tree'."
-  (unless (eq buffer-undo-list t)
-    (undo-list-transfer-to-tree)
-    (setq buffer-undo-list nil)
-    (when buffer-undo-tree
-      (let ((stack (list (list (undo-tree-root buffer-undo-tree)))))
-	(push (sort (mapcar 'identity (undo-tree-node-next (caar stack)))
-		    (lambda (a b)
-		      (time-less-p (undo-tree-node-timestamp a)
-				   (undo-tree-node-timestamp b))))
-	      stack)
-	;; Traverse tree in depth-and-oldest-first order, but add undo records
-	;; on the way down, and redo records on the way up.
-	(while (or (car stack)
-		   (not (eq (car (nth 1 stack))
-			    (undo-tree-current buffer-undo-tree))))
-	  (if (car stack)
-	      (progn
-		(setq buffer-undo-list
-		      (append (undo-tree-node-undo (caar stack))
-			      buffer-undo-list))
-		(undo-boundary)
-		(push (sort (mapcar 'identity
-				    (undo-tree-node-next (caar stack)))
-			    (lambda (a b)
-			      (time-less-p (undo-tree-node-timestamp a)
-					   (undo-tree-node-timestamp b))))
-		      stack))
-	    (pop stack)
-	    (setq buffer-undo-list
-		  (append (undo-tree-node-redo (caar stack))
-			  buffer-undo-list))
-	    (undo-boundary)
-	    (pop (car stack))))))))
-
-
-
-
-;;; =====================================================================
-;;;                History discarding utility functions
-
-(defun undo-tree-oldest-leaf (node)
-  ;; Return oldest leaf node below NODE.
-  (while (undo-tree-node-next node)
-    (setq node
-          (car (sort (mapcar 'identity (undo-tree-node-next node))
-                     (lambda (a b)
-                       (time-less-p (undo-tree-node-timestamp a)
-                                    (undo-tree-node-timestamp b)))))))
-  node)
-
-
-(defun undo-tree-discard-node (node)
-  ;; Discard NODE from `buffer-undo-tree', and return next in line for
-  ;; discarding.
-
-  ;; don't discard current node
-  (unless (eq node (undo-tree-current buffer-undo-tree))
-
-    ;; discarding root node...
-    (if (eq node (undo-tree-root buffer-undo-tree))
-        (cond
-         ;; should always discard branches before root
-         ((> (length (undo-tree-node-next node)) 1)
-          (error "Trying to discard undo-tree root which still\
- has multiple branches"))
-         ;; don't discard root if current node is only child
-         ((eq (car (undo-tree-node-next node))
-              (undo-tree-current buffer-undo-tree))
-	  nil)
-	 ;; discard root
-         (t
-	  ;; clear any register referring to root
-	  (let ((r (undo-tree-node-register node)))
-	    (when (and r (eq (get-register r) node))
-	      (set-register r nil)))
-          ;; make child of root into new root
-          (setq node (setf (undo-tree-root buffer-undo-tree)
-                           (car (undo-tree-node-next node))))
-	  ;; update undo-tree size
-	  (decf (undo-tree-size buffer-undo-tree)
-		(+ (undo-list-byte-size (undo-tree-node-undo node))
-		   (undo-list-byte-size (undo-tree-node-redo node))))
-	  (decf (undo-tree-count buffer-undo-tree))
-	  ;; discard new root's undo data and PREVIOUS link
-	  (setf (undo-tree-node-undo node) nil
-		(undo-tree-node-redo node) nil
-		(undo-tree-node-previous node) nil)
-          ;; if new root has branches, or new root is current node, next node
-          ;; to discard is oldest leaf, otherwise it's new root
-          (if (or (> (length (undo-tree-node-next node)) 1)
-                  (eq (car (undo-tree-node-next node))
-                      (undo-tree-current buffer-undo-tree)))
-              (undo-tree-oldest-leaf node)
-            node)))
-
-      ;; discarding leaf node...
-      (let* ((parent (undo-tree-node-previous node))
-             (current (nth (undo-tree-node-branch parent)
-                           (undo-tree-node-next parent))))
-	;; clear any register referring to the discarded node
-	(let ((r (undo-tree-node-register node)))
-	  (when (and r (eq (get-register r) node))
-	    (set-register r nil)))
-	;; update undo-tree size
-	(decf (undo-tree-size buffer-undo-tree)
-	      (+ (undo-list-byte-size (undo-tree-node-undo node))
-		 (undo-list-byte-size (undo-tree-node-redo node))))
-	(decf (undo-tree-count buffer-undo-tree))
-	;; discard leaf
-        (setf (undo-tree-node-next parent)
-                (delq node (undo-tree-node-next parent))
-              (undo-tree-node-branch parent)
-                (undo-tree-position current (undo-tree-node-next parent)))
-        ;; if parent has branches, or parent is current node, next node to
-        ;; discard is oldest leaf, otherwise it's the parent itself
-        (if (or (eq parent (undo-tree-current buffer-undo-tree))
-                (and (undo-tree-node-next parent)
-                     (or (not (eq parent (undo-tree-root buffer-undo-tree)))
-                         (> (length (undo-tree-node-next parent)) 1))))
-            (undo-tree-oldest-leaf parent)
-          parent)))))
-
-
-
-(defun undo-tree-discard-history ()
-  "Discard undo history until we're within memory usage limits
-set by `undo-limit', `undo-strong-limit' and `undo-outer-limit'."
-
-  (when (> (undo-tree-size buffer-undo-tree) undo-limit)
-    ;; if there are no branches off root, first node to discard is root;
-    ;; otherwise it's leaf node at botom of oldest branch
-    (let ((node (if (> (length (undo-tree-node-next
-                                (undo-tree-root buffer-undo-tree))) 1)
-                    (undo-tree-oldest-leaf (undo-tree-root buffer-undo-tree))
-                  (undo-tree-root buffer-undo-tree))))
-
-      ;; discard nodes until memory use is within `undo-strong-limit'
-      (while (and node
-                  (> (undo-tree-size buffer-undo-tree) undo-strong-limit))
-        (setq node (undo-tree-discard-node node)))
-
-      ;; discard nodes until next node to discard would bring memory use
-      ;; within `undo-limit'
-      (while (and node
-		  ;; check first if last discard has brought us within
-		  ;; `undo-limit', in case we can avoid more expensive
-		  ;; `undo-strong-limit' calculation
-		  ;; Note: this assumes undo-strong-limit > undo-limit;
-		  ;;       if not, effectively undo-strong-limit = undo-limit
-		  (> (undo-tree-size buffer-undo-tree) undo-limit)
-                  (> (- (undo-tree-size buffer-undo-tree)
-			;; if next node to discard is root, the memory we
-			;; free-up comes from discarding changesets from its
-			;; only child...
-			(if (eq node (undo-tree-root buffer-undo-tree))
-			    (+ (undo-list-byte-size
-				(undo-tree-node-undo
-				 (car (undo-tree-node-next node))))
-			       (undo-list-byte-size
-				(undo-tree-node-redo
-				 (car (undo-tree-node-next node)))))
-			  ;; ...otherwise, it comes from discarding changesets
-			  ;; from along with the node itself
-			  (+ (undo-list-byte-size (undo-tree-node-undo node))
-			     (undo-list-byte-size (undo-tree-node-redo node)))
-			  ))
-                     undo-limit))
-        (setq node (undo-tree-discard-node node)))
-
-      ;; if we're still over the `undo-outer-limit', discard entire history
-      (when (> (undo-tree-size buffer-undo-tree) undo-outer-limit)
-        ;; query first if `undo-ask-before-discard' is set
-        (if undo-ask-before-discard
-            (when (yes-or-no-p
-                   (format
-                    "Buffer `%s' undo info is %d bytes long;  discard it? "
-                    (buffer-name) (undo-tree-size buffer-undo-tree)))
-              (setq buffer-undo-tree nil))
-          ;; otherwise, discard and display warning
-          (display-warning
-           '(undo discard-info)
-           (concat
-            (format "Buffer `%s' undo info was %d bytes long.\n"
-                    (buffer-name) (undo-tree-size buffer-undo-tree))
-            "The undo info was discarded because it exceeded\
- `undo-outer-limit'.
-
-This is normal if you executed a command that made a huge change
-to the buffer. In that case, to prevent similar problems in the
-future, set `undo-outer-limit' to a value that is large enough to
-cover the maximum size of normal changes you expect a single
-command to make, but not so large that it might exceed the
-maximum memory allotted to Emacs.
-
-If you did not execute any such command, the situation is
-probably due to a bug and you should report it.
-
-You can disable the popping up of this buffer by adding the entry
-\(undo discard-info) to the user option `warning-suppress-types',
-which is defined in the `warnings' library.\n")
-           :warning)
-          (setq buffer-undo-tree nil)))
-      )))
-
-
-
-
-;;; =====================================================================
-;;;                   Visualizer utility functions
-
-(defun undo-tree-compute-widths (node)
-  "Recursively compute widths for nodes below NODE."
-  (let ((stack (list node))
-        res)
-    (while stack
-      ;; try to compute widths for node at top of stack
-      (if (undo-tree-node-p
-           (setq res (undo-tree-node-compute-widths (car stack))))
-          ;; if computation fails, it returns a node whose widths still need
-          ;; computing, which we push onto the stack
-          (push res stack)
-        ;; otherwise, store widths and remove it from stack
-        (setf (undo-tree-node-lwidth (car stack)) (aref res 0)
-              (undo-tree-node-cwidth (car stack)) (aref res 1)
-              (undo-tree-node-rwidth (car stack)) (aref res 2))
-        (pop stack)))))
-
-
-(defun undo-tree-node-compute-widths (node)
-  ;; Compute NODE's left-, centre-, and right-subtree widths. Returns widths
-  ;; (in a vector) if successful. Otherwise, returns a node whose widths need
-  ;; calculating before NODE's can be calculated.
-  (let ((num-children (length (undo-tree-node-next node)))
-        (lwidth 0) (cwidth 0) (rwidth 0) p)
-    (catch 'need-widths
-      (cond
-       ;; leaf nodes have 0 width
-       ((= 0 num-children)
-        (setf cwidth 1
-              (undo-tree-node-lwidth node) 0
-              (undo-tree-node-cwidth node) 1
-              (undo-tree-node-rwidth node) 0))
-
-       ;; odd number of children
-       ((= (mod num-children 2) 1)
-        (setq p (undo-tree-node-next node))
-        ;; compute left-width
-        (dotimes (i (/ num-children 2))
-          (if (undo-tree-node-lwidth (car p))
-              (incf lwidth (+ (undo-tree-node-lwidth (car p))
-                              (undo-tree-node-cwidth (car p))
-                              (undo-tree-node-rwidth (car p))))
-            ;; if child's widths haven't been computed, return that child
-            (throw 'need-widths (car p)))
-          (setq p (cdr p)))
-        (if (undo-tree-node-lwidth (car p))
-            (incf lwidth (undo-tree-node-lwidth (car p)))
-          (throw 'need-widths (car p)))
-        ;; centre-width is inherited from middle child
-        (setf cwidth (undo-tree-node-cwidth (car p)))
-        ;; compute right-width
-        (incf rwidth (undo-tree-node-rwidth (car p)))
-        (setq p (cdr p))
-        (dotimes (i (/ num-children 2))
-          (if (undo-tree-node-lwidth (car p))
-              (incf rwidth (+ (undo-tree-node-lwidth (car p))
-                              (undo-tree-node-cwidth (car p))
-                              (undo-tree-node-rwidth (car p))))
-            (throw 'need-widths (car p)))
-          (setq p (cdr p))))
-
-       ;; even number of children
-       (t
-        (setq p (undo-tree-node-next node))
-        ;; compute left-width
-        (dotimes (i (/ num-children 2))
-          (if (undo-tree-node-lwidth (car p))
-              (incf lwidth (+ (undo-tree-node-lwidth (car p))
-                              (undo-tree-node-cwidth (car p))
-                              (undo-tree-node-rwidth (car p))))
-            (throw 'need-widths (car p)))
-          (setq p (cdr p)))
-        ;; centre-width is 0 when number of children is even
-        (setq cwidth 0)
-        ;; compute right-width
-        (dotimes (i (/ num-children 2))
-          (if (undo-tree-node-lwidth (car p))
-              (incf rwidth (+ (undo-tree-node-lwidth (car p))
-                              (undo-tree-node-cwidth (car p))
-                              (undo-tree-node-rwidth (car p))))
-            (throw 'need-widths (car p)))
-          (setq p (cdr p)))))
-
-      ;; return left-, centre- and right-widths
-      (vector lwidth cwidth rwidth))))
-
-
-(defun undo-tree-clear-visualizer-data (tree)
-  ;; Clear visualizer data below NODE.
-  (undo-tree-mapc
-   (lambda (n) (undo-tree-node-clear-visualizer-data n))
-   (undo-tree-root tree)))
-
-
-(defun undo-tree-node-unmodified-p (node &optional mtime)
-  ;; Return non-nil if NODE corresponds to a buffer state that once upon a
-  ;; time was unmodified. If a file modification time MTIME is specified,
-  ;; return non-nil if the corresponding buffer state really is unmodified.
-  (let (changeset ntime)
-    (setq changeset
-	  (or (undo-tree-node-redo node)
-	      (and (setq changeset (car (undo-tree-node-next node)))
-		   (undo-tree-node-undo changeset)))
-	  ntime
-	  (catch 'found
-	    (dolist (elt changeset)
-	      (when (and (consp elt) (eq (car elt) t) (consp (cdr elt))
-			 (throw 'found (cdr elt)))))))
-    (and ntime
-	 (or (null mtime)
-	     ;; high-precision timestamps
-	     (if (listp (cdr ntime))
-		 (equal ntime mtime)
-	       ;; old-style timestamps
-	       (and (= (car ntime) (car mtime))
-		    (= (cdr ntime) (cadr mtime))))))))
-
-
-
-
-;;; =====================================================================
-;;;                  Undo-in-region utility functions
-
-;; `undo-elt-in-region' uses this as a dynamically-scoped variable
-(defvar undo-adjusted-markers nil)
-
-
-(defun undo-tree-pull-undo-in-region-branch (start end)
-  ;; Pull out entries from undo changesets to create a new undo-in-region
-  ;; branch, which undoes changeset entries lying between START and END first,
-  ;; followed by remaining entries from the changesets, before rejoining the
-  ;; existing undo tree history. Repeated calls will, if appropriate, extend
-  ;; the current undo-in-region branch rather than creating a new one.
-
-  ;; if we're just reverting the last redo-in-region, we don't need to
-  ;; manipulate the undo tree at all
-  (if (undo-tree-reverting-redo-in-region-p start end)
-      t  ; return t to indicate success
-
-    ;; We build the `region-changeset' and `delta-list' lists forwards, using
-    ;; pointers `r' and `d' to the penultimate element of the list. So that we
-    ;; don't have to treat the first element differently, we prepend a dummy
-    ;; leading nil to the lists, and have the pointers point to that
-    ;; initially.
-    ;; Note: using '(nil) instead of (list nil) in the `let*' results in
-    ;;       bizarre errors when the code is byte-compiled, where parts of the
-    ;;       lists appear to survive across different calls to this function.
-    ;;       An obscure byte-compiler bug, perhaps?
-    (let* ((region-changeset (list nil))
-	   (r region-changeset)
-	   (delta-list (list nil))
-	   (d delta-list)
-	   (node (undo-tree-current buffer-undo-tree))
-	   (repeated-undo-in-region
-	    (undo-tree-repeated-undo-in-region-p start end))
-	   undo-adjusted-markers  ; `undo-elt-in-region' expects this
-	   fragment splice original-fragment original-splice original-current
-	   got-visible-elt undo-list elt)
-
-      ;; --- initialisation ---
-      (cond
-       ;; if this is a repeated undo in the same region, start pulling changes
-       ;; from NODE at which undo-in-region branch iss attached, and detatch
-       ;; the branch, using it as initial FRAGMENT of branch being constructed
-       (repeated-undo-in-region
-	(setq original-current node
-	      fragment (car (undo-tree-node-next node))
-	      splice node)
-	;; undo up to node at which undo-in-region branch is attached
-	;; (recognizable as first node with more than one branch)
-	(let ((mark-active nil))
-	  (while (= (length (undo-tree-node-next node)) 1)
-	    (undo-tree-undo-1)
-	    (setq fragment node
-		  node (undo-tree-current buffer-undo-tree))))
-	(when (eq splice node) (setq splice nil))
-	;; detatch undo-in-region branch
-	(setf (undo-tree-node-next node)
-	      (delq fragment (undo-tree-node-next node))
-	      (undo-tree-node-previous fragment) nil
-	      original-fragment fragment
-	      original-splice node))
-
-       ;; if this is a new undo-in-region, initial FRAGMENT is a copy of all
-       ;; nodes below the current one in the active branch
-       ((undo-tree-node-next node)
-	(setq fragment (undo-tree-make-node nil nil)
-	      splice fragment)
-	(while (setq node (nth (undo-tree-node-branch node)
-			       (undo-tree-node-next node)))
-	  (push (undo-tree-make-node
-		 splice
-		 (undo-copy-list (undo-tree-node-undo node))
-		 (undo-copy-list (undo-tree-node-redo node)))
-		(undo-tree-node-next splice))
-	  (setq splice (car (undo-tree-node-next splice))))
-	(setq fragment (car (undo-tree-node-next fragment))
-	      splice nil
-	      node (undo-tree-current buffer-undo-tree))))
-
-
-      ;; --- pull undo-in-region elements into branch ---
-      ;; work backwards up tree, pulling out undo elements within region until
-      ;; we've got one that undoes a visible change (insertion or deletion)
-      (catch 'abort
-	(while (and (not got-visible-elt) node (undo-tree-node-undo node))
-	  ;; we cons a dummy nil element on the front of the changeset so that
-	  ;; we can conveniently remove the first (real) element from the
-	  ;; changeset if we need to; the leading nil is removed once we're
-	  ;; done with this changeset
-	  (setq undo-list (cons nil (undo-copy-list (undo-tree-node-undo node)))
-		elt (cadr undo-list))
-	  (if fragment
-	      (progn
-		(setq fragment (undo-tree-grow-backwards fragment undo-list))
-		(unless splice (setq splice fragment)))
-	    (setq fragment (undo-tree-make-node nil undo-list))
-	    (setq splice fragment))
-
-	  (while elt
-	    (cond
-	     ;; keep elements within region
-	     ((undo-elt-in-region elt start end)
-	      ;; set flag if kept element is visible (insertion or deletion)
-	      (when (and (consp elt)
-			 (or (stringp (car elt)) (integerp (car elt))))
-		(setq got-visible-elt t))
-	      ;; adjust buffer positions in elements previously undone before
-	      ;; kept element, as kept element will now be undone first
-	      (undo-tree-adjust-elements-to-elt splice elt)
-	      ;; move kept element to undo-in-region changeset, adjusting its
-	      ;; buffer position as it will now be undone first
-	      (setcdr r (list (undo-tree-apply-deltas elt (cdr delta-list))))
-	      (setq r (cdr r))
-	      (setcdr undo-list (cddr undo-list)))
-
-	     ;; discard "was unmodified" elements
-	     ;; FIXME: deal properly with these
-	     ((and (consp elt) (eq (car elt) t))
-	      (setcdr undo-list (cddr undo-list)))
-
-	     ;; if element crosses region, we can't pull any more elements
-	     ((undo-elt-crosses-region elt start end)
-	      ;; if we've found a visible element, it must be earlier in
-	      ;; current node's changeset; stop pulling elements (null
-	      ;; `undo-list' and non-nil `got-visible-elt' cause loop to exit)
-	      (if got-visible-elt
-		  (setq undo-list nil)
-		;; if we haven't found a visible element yet, pulling
-		;; undo-in-region branch has failed
-		(setq region-changeset nil)
-		(throw 'abort t)))
-
-	     ;; if rejecting element, add its delta (if any) to the list
-	     (t
-	      (let ((delta (undo-delta elt)))
-		(when (/= 0 (cdr delta))
-		  (setcdr d (list delta))
-		  (setq d (cdr d))))
-	      (setq undo-list (cdr undo-list))))
-
-	    ;; process next element of current changeset
-	    (setq elt (cadr undo-list)))
-
-	  ;; if there are remaining elements in changeset, remove dummy nil
-	  ;; from front
-	  (if (cadr (undo-tree-node-undo fragment))
-	      (pop (undo-tree-node-undo fragment))
-	    ;; otherwise, if we've kept all elements in changeset, discard
-	    ;; empty changeset
-	    (when (eq splice fragment) (setq splice nil))
-	    (setq fragment (car (undo-tree-node-next fragment))))
-	  ;; process changeset from next node up the tree
-	  (setq node (undo-tree-node-previous node))))
-
-      ;; pop dummy nil from front of `region-changeset'
-      (setq region-changeset (cdr region-changeset))
-
-
-      ;; --- integrate branch into tree ---
-      ;; if no undo-in-region elements were found, restore undo tree
-      (if (null region-changeset)
-	  (when original-current
-	    (push original-fragment (undo-tree-node-next original-splice))
-	    (setf (undo-tree-node-branch original-splice) 0
-		  (undo-tree-node-previous original-fragment) original-splice)
-	    (let ((mark-active nil))
-	      (while (not (eq (undo-tree-current buffer-undo-tree)
-			      original-current))
-		(undo-tree-redo-1)))
-	    nil)  ; return nil to indicate failure
-
-	;; otherwise...
-	;; need to undo up to node where new branch will be attached, to
-	;; ensure redo entries are populated, and then redo back to where we
-	;; started
-	(let ((mark-active nil)
-	      (current (undo-tree-current buffer-undo-tree)))
-	  (while (not (eq (undo-tree-current buffer-undo-tree) node))
-	    (undo-tree-undo-1))
-	  (while (not (eq (undo-tree-current buffer-undo-tree) current))
-	    (undo-tree-redo-1)))
-
-	(cond
-	 ;; if there's no remaining fragment, just create undo-in-region node
-	 ;; and attach it to parent of last node from which elements were
-	 ;; pulled
-	 ((null fragment)
-	  (setq fragment (undo-tree-make-node node region-changeset))
-	  (push fragment (undo-tree-node-next node))
-	  (setf (undo-tree-node-branch node) 0)
-	  ;; set current node to undo-in-region node
-	  (setf (undo-tree-current buffer-undo-tree) fragment))
-
-	 ;; if no splice point has been set, add undo-in-region node to top of
-	 ;; fragment and attach it to parent of last node from which elements
-	 ;; were pulled
-	 ((null splice)
-	  (setq fragment (undo-tree-grow-backwards fragment region-changeset))
-	  (push fragment (undo-tree-node-next node))
-	  (setf (undo-tree-node-branch node) 0
-		(undo-tree-node-previous fragment) node)
-	  ;; set current node to undo-in-region node
-	  (setf (undo-tree-current buffer-undo-tree) fragment))
-
-	 ;; if fragment contains nodes, attach fragment to parent of last node
-	 ;; from which elements were pulled, and splice in undo-in-region node
-	 (t
-	  (setf (undo-tree-node-previous fragment) node)
-	  (push fragment (undo-tree-node-next node))
-	  (setf (undo-tree-node-branch node) 0)
-	  ;; if this is a repeated undo-in-region, then we've left the current
-	  ;; node at the original splice-point; we need to set the current
-	  ;; node to the equivalent node on the undo-in-region branch and redo
-	  ;; back to where we started
-	  (when repeated-undo-in-region
-	    (setf (undo-tree-current buffer-undo-tree)
-		  (undo-tree-node-previous original-fragment))
-	    (let ((mark-active nil))
-	      (while (not (eq (undo-tree-current buffer-undo-tree) splice))
-		(undo-tree-redo-1 nil 'preserve-undo))))
-	  ;; splice new undo-in-region node into fragment
-	  (setq node (undo-tree-make-node nil region-changeset))
-	  (undo-tree-splice-node node splice)
-	  ;; set current node to undo-in-region node
-	  (setf (undo-tree-current buffer-undo-tree) node)))
-
-	;; update undo-tree size
-	(setq node (undo-tree-node-previous fragment))
-	(while (progn
-		 (and (setq node (car (undo-tree-node-next node)))
-		      (not (eq node original-fragment))
-		      (incf (undo-tree-count buffer-undo-tree))
-		      (incf (undo-tree-size buffer-undo-tree)
-			    (+ (undo-list-byte-size (undo-tree-node-undo node))
-			       (undo-list-byte-size (undo-tree-node-redo node)))))))
-	t)  ; indicate undo-in-region branch was successfully pulled
-      )))
-
-
-
-(defun undo-tree-pull-redo-in-region-branch (start end)
-  ;; Pull out entries from redo changesets to create a new redo-in-region
-  ;; branch, which redoes changeset entries lying between START and END first,
-  ;; followed by remaining entries from the changesets. Repeated calls will,
-  ;; if appropriate, extend the current redo-in-region branch rather than
-  ;; creating a new one.
-
-  ;; if we're just reverting the last undo-in-region, we don't need to
-  ;; manipulate the undo tree at all
-  (if (undo-tree-reverting-undo-in-region-p start end)
-      t  ; return t to indicate success
-
-    ;; We build the `region-changeset' and `delta-list' lists forwards, using
-    ;; pointers `r' and `d' to the penultimate element of the list. So that we
-    ;; don't have to treat the first element differently, we prepend a dummy
-    ;; leading nil to the lists, and have the pointers point to that
-    ;; initially.
-    ;; Note: using '(nil) instead of (list nil) in the `let*' causes bizarre
-    ;;       errors when the code is byte-compiled, where parts of the lists
-    ;;       appear to survive across different calls to this function.  An
-    ;;       obscure byte-compiler bug, perhaps?
-    (let* ((region-changeset (list nil))
-	   (r region-changeset)
-	   (delta-list (list nil))
-	   (d delta-list)
-	   (node (undo-tree-current buffer-undo-tree))
-	   (repeated-redo-in-region
-	    (undo-tree-repeated-redo-in-region-p start end))
-	   undo-adjusted-markers  ; `undo-elt-in-region' expects this
-	   fragment splice got-visible-elt redo-list elt)
-
-      ;; --- inisitalisation ---
-      (cond
-       ;; if this is a repeated redo-in-region, detach fragment below current
-       ;; node
-       (repeated-redo-in-region
-	(when (setq fragment (car (undo-tree-node-next node)))
-	  (setf (undo-tree-node-previous fragment) nil
-		(undo-tree-node-next node)
-		(delq fragment (undo-tree-node-next node)))))
-       ;; if this is a new redo-in-region, initial fragment is a copy of all
-       ;; nodes below the current one in the active branch
-       ((undo-tree-node-next node)
-	(setq fragment (undo-tree-make-node nil nil)
-	      splice fragment)
-	(while (setq node (nth (undo-tree-node-branch node)
-			       (undo-tree-node-next node)))
-	  (push (undo-tree-make-node
-		 splice nil
-		 (undo-copy-list (undo-tree-node-redo node)))
-		(undo-tree-node-next splice))
-	  (setq splice (car (undo-tree-node-next splice))))
-	(setq fragment (car (undo-tree-node-next fragment)))))
-
-
-      ;; --- pull redo-in-region elements into branch ---
-      ;; work down fragment, pulling out redo elements within region until
-      ;; we've got one that redoes a visible change (insertion or deletion)
-      (setq node fragment)
-      (catch 'abort
-	(while (and (not got-visible-elt) node (undo-tree-node-redo node))
-	  ;; we cons a dummy nil element on the front of the changeset so that
-	  ;; we can conveniently remove the first (real) element from the
-	  ;; changeset if we need to; the leading nil is removed once we're
-	  ;; done with this changeset
-	  (setq redo-list (push nil (undo-tree-node-redo node))
-		elt (cadr redo-list))
-	  (while elt
-	    (cond
-	     ;; keep elements within region
-	     ((undo-elt-in-region elt start end)
-	      ;; set flag if kept element is visible (insertion or deletion)
-	      (when (and (consp elt)
-			 (or (stringp (car elt)) (integerp (car elt))))
-		(setq got-visible-elt t))
-	      ;; adjust buffer positions in elements previously redone before
-	      ;; kept element, as kept element will now be redone first
-	      (undo-tree-adjust-elements-to-elt fragment elt t)
-	      ;; move kept element to redo-in-region changeset, adjusting its
-	      ;; buffer position as it will now be redone first
-	      (setcdr r (list (undo-tree-apply-deltas elt (cdr delta-list) -1)))
-	      (setq r (cdr r))
-	      (setcdr redo-list (cddr redo-list)))
-
-	     ;; discard "was unmodified" elements
-	     ;; FIXME: deal properly with these
-	     ((and (consp elt) (eq (car elt) t))
-	      (setcdr redo-list (cddr redo-list)))
-
-	     ;; if element crosses region, we can't pull any more elements
-	     ((undo-elt-crosses-region elt start end)
-	      ;; if we've found a visible element, it must be earlier in
-	      ;; current node's changeset; stop pulling elements (null
-	      ;; `redo-list' and non-nil `got-visible-elt' cause loop to exit)
-	      (if got-visible-elt
-		  (setq redo-list nil)
-		;; if we haven't found a visible element yet, pulling
-		;; redo-in-region branch has failed
-		(setq region-changeset nil)
-		(throw 'abort t)))
-
-	     ;; if rejecting element, add its delta (if any) to the list
-	     (t
-	      (let ((delta (undo-delta elt)))
-		(when (/= 0 (cdr delta))
-		  (setcdr d (list delta))
-		  (setq d (cdr d))))
-	      (setq redo-list (cdr redo-list))))
-
-	    ;; process next element of current changeset
-	    (setq elt (cadr redo-list)))
-
-	  ;; if there are remaining elements in changeset, remove dummy nil
-	  ;; from front
-	  (if (cadr (undo-tree-node-redo node))
-	      (pop (undo-tree-node-undo node))
-	    ;; otherwise, if we've kept all elements in changeset, discard
-	    ;; empty changeset
-	    (if (eq fragment node)
-		(setq fragment (car (undo-tree-node-next fragment)))
-	      (undo-tree-snip-node node)))
-	  ;; process changeset from next node in fragment
-	  (setq node (car (undo-tree-node-next node)))))
-
-      ;; pop dummy nil from front of `region-changeset'
-      (setq region-changeset (cdr region-changeset))
-
-
-      ;; --- integrate branch into tree ---
-      (setq node (undo-tree-current buffer-undo-tree))
-      ;; if no redo-in-region elements were found, restore undo tree
-      (if (null (car region-changeset))
-	  (when (and repeated-redo-in-region fragment)
-	    (push fragment (undo-tree-node-next node))
-	    (setf (undo-tree-node-branch node) 0
-		  (undo-tree-node-previous fragment) node)
-	    nil)  ; return nil to indicate failure
-
-	;; otherwise, add redo-in-region node to top of fragment, and attach
-	;; it below current node
-	(setq fragment
-	      (if fragment
-		  (undo-tree-grow-backwards fragment nil region-changeset)
-		(undo-tree-make-node nil nil region-changeset)))
-	(push fragment (undo-tree-node-next node))
-	(setf (undo-tree-node-branch node) 0
-	      (undo-tree-node-previous fragment) node)
-	;; update undo-tree size
-	(unless repeated-redo-in-region
-	  (setq node fragment)
-	  (while (and (setq node (car (undo-tree-node-next node)))
-		      (incf (undo-tree-count buffer-undo-tree))
-		      (incf (undo-tree-size buffer-undo-tree)
-			    (undo-list-byte-size
-			     (undo-tree-node-redo node))))))
-	(incf (undo-tree-size buffer-undo-tree)
-	      (undo-list-byte-size (undo-tree-node-redo fragment)))
-	t)  ; indicate redo-in-region branch was successfully pulled
-      )))
-
-
-
-(defun undo-tree-adjust-elements-to-elt (node undo-elt &optional below)
-  "Adjust buffer positions of undo elements, starting at NODE's
-and going up the tree (or down the active branch if BELOW is
-non-nil) and through the nodes' undo elements until we reach
-UNDO-ELT.  UNDO-ELT must appear somewhere in the undo changeset
-of either NODE itself or some node above it in the tree."
-  (let ((delta (list (undo-delta undo-elt)))
-	(undo-list (undo-tree-node-undo node)))
-    ;; adjust elements until we reach UNDO-ELT
-    (while (and (car undo-list)
-		(not (eq (car undo-list) undo-elt)))
-      (setcar undo-list
-	      (undo-tree-apply-deltas (car undo-list) delta -1))
-      ;; move to next undo element in list, or to next node if we've run out
-      ;; of elements
-      (unless (car (setq undo-list (cdr undo-list)))
-	(if below
-	    (setq node (nth (undo-tree-node-branch node)
-			    (undo-tree-node-next node)))
-	  (setq node (undo-tree-node-previous node)))
-	(setq undo-list (undo-tree-node-undo node))))))
-
-
-
-(defun undo-tree-apply-deltas (undo-elt deltas &optional sgn)
-  ;; Apply DELTAS in order to UNDO-ELT, multiplying deltas by SGN
-  ;; (only useful value for SGN is -1).
-  (let (position offset)
-    (dolist (delta deltas)
-      (setq position (car delta)
-	    offset (* (cdr delta) (or sgn 1)))
-      (cond
-       ;; POSITION
-       ((integerp undo-elt)
-	(when (>= undo-elt position)
-	  (setq undo-elt (- undo-elt offset))))
-       ;; nil (or any other atom)
-       ((atom undo-elt))
-       ;; (TEXT . POSITION)
-       ((stringp (car undo-elt))
-	(let ((text-pos (abs (cdr undo-elt)))
-	      (point-at-end (< (cdr undo-elt) 0)))
-	  (if (>= text-pos position)
-	      (setcdr undo-elt (* (if point-at-end -1 1)
-				  (- text-pos offset))))))
-       ;; (BEGIN . END)
-       ((integerp (car undo-elt))
-	(when (>= (car undo-elt) position)
-	  (setcar undo-elt (- (car undo-elt) offset))
-	  (setcdr undo-elt (- (cdr undo-elt) offset))))
-       ;; (nil PROPERTY VALUE BEG . END)
-       ((null (car undo-elt))
-	(let ((tail (nthcdr 3 undo-elt)))
-	  (when (>= (car tail) position)
-	    (setcar tail (- (car tail) offset))
-	    (setcdr tail (- (cdr tail) offset)))))
-       ))
-    undo-elt))
-
-
-
-(defun undo-tree-repeated-undo-in-region-p (start end)
-  ;; Return non-nil if undo-in-region between START and END is a repeated
-  ;; undo-in-region
-  (let ((node (undo-tree-current buffer-undo-tree)))
-    (and (setq node
-	       (nth (undo-tree-node-branch node) (undo-tree-node-next node)))
-	 (eq (undo-tree-node-undo-beginning node) start)
-	 (eq (undo-tree-node-undo-end node) end))))
-
-
-(defun undo-tree-repeated-redo-in-region-p (start end)
-  ;; Return non-nil if undo-in-region between START and END is a repeated
-  ;; undo-in-region
-  (let ((node (undo-tree-current buffer-undo-tree)))
-    (and (eq (undo-tree-node-redo-beginning node) start)
-	 (eq (undo-tree-node-redo-end node) end))))
-
-
-;; Return non-nil if undo-in-region between START and END is simply
-;; reverting the last redo-in-region
-(defalias 'undo-tree-reverting-undo-in-region-p
-  'undo-tree-repeated-undo-in-region-p)
-
-
-;; Return non-nil if redo-in-region between START and END is simply
-;; reverting the last undo-in-region
-(defalias 'undo-tree-reverting-redo-in-region-p
-  'undo-tree-repeated-redo-in-region-p)
-
-
-
-
-;;; =====================================================================
-;;;                        Undo-tree commands
-
-;;;###autoload
-(define-minor-mode undo-tree-mode
-  "Toggle undo-tree mode.
-With no argument, this command toggles the mode.
-A positive prefix argument turns the mode on.
-A negative prefix argument turns it off.
-
-Undo-tree-mode replaces Emacs' standard undo feature with a more
-powerful yet easier to use version, that treats the undo history
-as what it is: a tree.
-
-The following keys are available in `undo-tree-mode':
-
-  \\{undo-tree-map}
-
-Within the undo-tree visualizer, the following keys are available:
-
-  \\{undo-tree-visualizer-mode-map}"
-
-  nil                       ; init value
-  undo-tree-mode-lighter    ; lighter
-  undo-tree-map             ; keymap
-
-  ;; if disabling `undo-tree-mode', rebuild `buffer-undo-list' from tree so
-  ;; Emacs undo can work
-  (when (not undo-tree-mode)
-    (undo-list-rebuild-from-tree)
-    (setq buffer-undo-tree nil)))
-
-
-(defun turn-on-undo-tree-mode (&optional print-message)
-  "Enable `undo-tree-mode' in the current buffer, when appropriate.
-Some major modes implement their own undo system, which should
-not normally be overridden by `undo-tree-mode'. This command does
-not enable `undo-tree-mode' in such buffers. If you want to force
-`undo-tree-mode' to be enabled regardless, use (undo-tree-mode 1)
-instead.
-
-The heuristic used to detect major modes in which
-`undo-tree-mode' should not be used is to check whether either
-the `undo' command has been remapped, or the default undo
-keybindings (C-/ and C-_) have been overridden somewhere other
-than in the global map. In addition, `undo-tree-mode' will not be
-enabled if the buffer's `major-mode' appears in
-`undo-tree-incompatible-major-modes'."
-  (interactive "p")
-  (if (or (key-binding [remap undo])
-	  (undo-tree-overridden-undo-bindings-p)
-	  (memq major-mode undo-tree-incompatible-major-modes))
-      (when print-message
-	(message "Buffer does not support undo-tree-mode;\
- undo-tree-mode NOT enabled"))
-    (undo-tree-mode 1)))
-
-
-(defun undo-tree-overridden-undo-bindings-p ()
-  "Returns t if default undo bindings are overridden, nil otherwise.
-Checks if either of the default undo key bindings (\"C-/\" or
-\"C-_\") are overridden in the current buffer by any keymap other
-than the global one. (So global redefinitions of the default undo
-key bindings do not count.)"
-  (let ((binding1 (lookup-key (current-global-map) [?\C-/]))
-	(binding2 (lookup-key (current-global-map) [?\C-_])))
-    (global-set-key [?\C-/] 'undo)
-    (global-set-key [?\C-_] 'undo)
-    (unwind-protect
-	(or (and (key-binding [?\C-/])
-		 (not (eq (key-binding [?\C-/]) 'undo)))
-	    (and (key-binding [?\C-_])
-		 (not (eq (key-binding [?\C-_]) 'undo))))
-      (global-set-key [?\C-/] binding1)
-      (global-set-key [?\C-_] binding2))))
-
-
-;;;###autoload
-(define-globalized-minor-mode global-undo-tree-mode
-  undo-tree-mode turn-on-undo-tree-mode)
-
-
-
-(defun undo-tree-undo (&optional arg)
-  "Undo changes.
-Repeat this command to undo more changes.
-A numeric ARG serves as a repeat count.
-
-In Transient Mark mode when the mark is active, only undo changes
-within the current region. Similarly, when not in Transient Mark
-mode, just \\[universal-argument] as an argument limits undo to
-changes within the current region."
-  (interactive "*P")
-  (unless undo-tree-mode
-    (user-error "Undo-tree mode not enabled in buffer"))
-  ;; throw error if undo is disabled in buffer
-  (when (eq buffer-undo-list t)
-    (user-error "No undo information in this buffer"))
-  (undo-tree-undo-1 arg)
-  ;; inform user if at branch point
-  (when (> (undo-tree-num-branches) 1) (message "Undo branch point!")))
-
-
-(defun undo-tree-undo-1 (&optional arg preserve-redo preserve-timestamps)
-  ;; Internal undo function. An active mark in `transient-mark-mode', or
-  ;; non-nil ARG otherwise, enables undo-in-region. Non-nil PRESERVE-REDO
-  ;; causes the existing redo record to be preserved, rather than replacing it
-  ;; with the new one generated by undoing. Non-nil PRESERVE-TIMESTAMPS
-  ;; disables updating of timestamps in visited undo-tree nodes. (This latter
-  ;; should *only* be used when temporarily visiting another undo state and
-  ;; immediately returning to the original state afterwards. Otherwise, it
-  ;; could cause history-discarding errors.)
-  (let ((undo-in-progress t)
-	(undo-in-region (and undo-tree-enable-undo-in-region
-			     (or (region-active-p)
-				 (and arg (not (numberp arg))))))
-	pos current)
-    ;; transfer entries accumulated in `buffer-undo-list' to
-    ;; `buffer-undo-tree'
-    (undo-list-transfer-to-tree)
-
-    (dotimes (i (or (and (numberp arg) (prefix-numeric-value arg)) 1))
-      ;; check if at top of undo tree
-      (unless (undo-tree-node-previous (undo-tree-current buffer-undo-tree))
-	(user-error "No further undo information"))
-
-      ;; if region is active, or a non-numeric prefix argument was supplied,
-      ;; try to pull out a new branch of changes affecting the region
-      (when (and undo-in-region
-		 (not (undo-tree-pull-undo-in-region-branch
-		       (region-beginning) (region-end))))
-	(user-error "No further undo information for region"))
-
-      ;; remove any GC'd elements from node's undo list
-      (setq current (undo-tree-current buffer-undo-tree))
-      (decf (undo-tree-size buffer-undo-tree)
-	    (undo-list-byte-size (undo-tree-node-undo current)))
-      (setf (undo-tree-node-undo current)
-	    (undo-list-clean-GCd-elts (undo-tree-node-undo current)))
-      (incf (undo-tree-size buffer-undo-tree)
-	    (undo-list-byte-size (undo-tree-node-undo current)))
-      ;; undo one record from undo tree
-      (when undo-in-region
-	(setq pos (set-marker (make-marker) (point)))
-	(set-marker-insertion-type pos t))
-      (primitive-undo 1 (undo-tree-copy-list (undo-tree-node-undo current)))
-      (undo-boundary)
-
-      ;; if preserving old redo record, discard new redo entries that
-      ;; `primitive-undo' has added to `buffer-undo-list', and remove any GC'd
-      ;; elements from node's redo list
-      (if preserve-redo
-	  (progn
-	    (undo-list-pop-changeset)
-	    (decf (undo-tree-size buffer-undo-tree)
-		  (undo-list-byte-size (undo-tree-node-redo current)))
-	    (setf (undo-tree-node-redo current)
-		  (undo-list-clean-GCd-elts (undo-tree-node-redo current)))
-	    (incf (undo-tree-size buffer-undo-tree)
-		  (undo-list-byte-size (undo-tree-node-redo current))))
-	;; otherwise, record redo entries that `primitive-undo' has added to
-	;; `buffer-undo-list' in current node's redo record, replacing
-	;; existing entry if one already exists
-	(decf (undo-tree-size buffer-undo-tree)
-	      (undo-list-byte-size (undo-tree-node-redo current)))
-	(setf (undo-tree-node-redo current)
-	      (undo-list-pop-changeset 'discard-pos))
-	(incf (undo-tree-size buffer-undo-tree)
-	      (undo-list-byte-size (undo-tree-node-redo current))))
-
-      ;; rewind current node and update timestamp
-      (setf (undo-tree-current buffer-undo-tree)
-	    (undo-tree-node-previous (undo-tree-current buffer-undo-tree)))
-      (unless preserve-timestamps
-	(setf (undo-tree-node-timestamp (undo-tree-current buffer-undo-tree))
-	      (current-time)))
-
-      ;; if undoing-in-region, record current node, region and direction so we
-      ;; can tell if undo-in-region is repeated, and re-activate mark if in
-      ;; `transient-mark-mode'; if not, erase any leftover data
-      (if (not undo-in-region)
-	  (undo-tree-node-clear-region-data current)
-	(goto-char pos)
-	;; note: we deliberately want to store the region information in the
-	;; node *below* the now current one
-	(setf (undo-tree-node-undo-beginning current) (region-beginning)
-	      (undo-tree-node-undo-end current) (region-end))
-	(set-marker pos nil)))
-
-    ;; undo deactivates mark unless undoing-in-region
-    (setq deactivate-mark (not undo-in-region))))
-
-
-
-(defun undo-tree-redo (&optional arg)
-  "Redo changes. A numeric ARG serves as a repeat count.
-
-In Transient Mark mode when the mark is active, only redo changes
-within the current region. Similarly, when not in Transient Mark
-mode, just \\[universal-argument] as an argument limits redo to
-changes within the current region."
-  (interactive "*P")
-  (unless undo-tree-mode
-    (user-error "Undo-tree mode not enabled in buffer"))
-  ;; throw error if undo is disabled in buffer
-  (when (eq buffer-undo-list t)
-    (user-error "No undo information in this buffer"))
-  (undo-tree-redo-1 arg)
-  ;; inform user if at branch point
-  (when (> (undo-tree-num-branches) 1) (message "Undo branch point!")))
-
-
-(defun undo-tree-redo-1 (&optional arg preserve-undo preserve-timestamps)
-  ;; Internal redo function. An active mark in `transient-mark-mode', or
-  ;; non-nil ARG otherwise, enables undo-in-region. Non-nil PRESERVE-UNDO
-  ;; causes the existing redo record to be preserved, rather than replacing it
-  ;; with the new one generated by undoing. Non-nil PRESERVE-TIMESTAMPS
-  ;; disables updating of timestamps in visited undo-tree nodes. (This latter
-  ;; should *only* be used when temporarily visiting another undo state and
-  ;; immediately returning to the original state afterwards. Otherwise, it
-  ;; could cause history-discarding errors.)
-  (let ((undo-in-progress t)
-	(redo-in-region (and undo-tree-enable-undo-in-region
-			     (or (region-active-p)
-				 (and arg (not (numberp arg))))))
-	pos current)
-    ;; transfer entries accumulated in `buffer-undo-list' to
-    ;; `buffer-undo-tree'
-    (undo-list-transfer-to-tree)
-
-    (dotimes (i (or (and (numberp arg) (prefix-numeric-value arg)) 1))
-      ;; check if at bottom of undo tree
-      (when (null (undo-tree-node-next (undo-tree-current buffer-undo-tree)))
-	(user-error "No further redo information"))
-
-      ;; if region is active, or a non-numeric prefix argument was supplied,
-      ;; try to pull out a new branch of changes affecting the region
-      (when (and redo-in-region
-		 (not (undo-tree-pull-redo-in-region-branch
-		       (region-beginning) (region-end))))
-	(user-error "No further redo information for region"))
-
-      ;; get next node (but DON'T advance current node in tree yet, in case
-      ;; redoing fails)
-      (setq current (undo-tree-current buffer-undo-tree)
-	    current (nth (undo-tree-node-branch current)
-			 (undo-tree-node-next current)))
-      ;; remove any GC'd elements from node's redo list
-      (decf (undo-tree-size buffer-undo-tree)
-	    (undo-list-byte-size (undo-tree-node-redo current)))
-      (setf (undo-tree-node-redo current)
-	    (undo-list-clean-GCd-elts (undo-tree-node-redo current)))
-      (incf (undo-tree-size buffer-undo-tree)
-	    (undo-list-byte-size (undo-tree-node-redo current)))
-      ;; redo one record from undo tree
-      (when redo-in-region
-	(setq pos (set-marker (make-marker) (point)))
-	(set-marker-insertion-type pos t))
-      (primitive-undo 1 (undo-tree-copy-list (undo-tree-node-redo current)))
-      (undo-boundary)
-      ;; advance current node in tree
-      (setf (undo-tree-current buffer-undo-tree) current)
-
-      ;; if preserving old undo record, discard new undo entries that
-      ;; `primitive-undo' has added to `buffer-undo-list', and remove any GC'd
-      ;; elements from node's redo list
-      (if preserve-undo
-	  (progn
-	    (undo-list-pop-changeset)
-	    (decf (undo-tree-size buffer-undo-tree)
-		  (undo-list-byte-size (undo-tree-node-undo current)))
-	    (setf (undo-tree-node-undo current)
-		  (undo-list-clean-GCd-elts (undo-tree-node-undo current)))
-	    (incf (undo-tree-size buffer-undo-tree)
-		  (undo-list-byte-size (undo-tree-node-undo current))))
-	;; otherwise, record undo entries that `primitive-undo' has added to
-	;; `buffer-undo-list' in current node's undo record, replacing
-	;; existing entry if one already exists
-	(decf (undo-tree-size buffer-undo-tree)
-	      (undo-list-byte-size (undo-tree-node-undo current)))
-	(setf (undo-tree-node-undo current)
-	      (undo-list-pop-changeset 'discard-pos))
-	(incf (undo-tree-size buffer-undo-tree)
-	      (undo-list-byte-size (undo-tree-node-undo current))))
-
-      ;; update timestamp
-      (unless preserve-timestamps
-	(setf (undo-tree-node-timestamp current) (current-time)))
-
-      ;; if redoing-in-region, record current node, region and direction so we
-      ;; can tell if redo-in-region is repeated, and re-activate mark if in
-      ;; `transient-mark-mode'
-      (if (not redo-in-region)
-	  (undo-tree-node-clear-region-data current)
-	(goto-char pos)
-	(setf (undo-tree-node-redo-beginning current) (region-beginning)
-	      (undo-tree-node-redo-end current) (region-end))
-	(set-marker pos nil)))
-
-    ;; redo deactivates the mark unless redoing-in-region
-    (setq deactivate-mark (not redo-in-region))))
-
-
-
-(defun undo-tree-switch-branch (branch)
-  "Switch to a different BRANCH of the undo tree.
-This will affect which branch to descend when *redoing* changes
-using `undo-tree-redo'."
-  (interactive (list (or (and prefix-arg (prefix-numeric-value prefix-arg))
-                         (and (not (eq buffer-undo-list t))
-			      (or (undo-list-transfer-to-tree) t)
-			      (let ((b (undo-tree-node-branch
-					(undo-tree-current
-					 buffer-undo-tree))))
-				(cond
-				 ;; switch to other branch if only 2
-				 ((= (undo-tree-num-branches) 2) (- 1 b))
-				 ;; prompt if more than 2
-				 ((> (undo-tree-num-branches) 2)
-				  (read-number
-				   (format "Branch (0-%d, on %d): "
-					   (1- (undo-tree-num-branches)) b)))
-				 ))))))
-  (unless undo-tree-mode
-    (user-error "Undo-tree mode not enabled in buffer"))
-  ;; throw error if undo is disabled in buffer
-  (when (eq buffer-undo-list t)
-    (user-error "No undo information in this buffer"))
-  ;; sanity check branch number
-  (when (<= (undo-tree-num-branches) 1)
-    (user-error "Not at undo branch point"))
-  (when (or (< branch 0) (> branch (1- (undo-tree-num-branches))))
-    (user-error "Invalid branch number"))
-  ;; transfer entries accumulated in `buffer-undo-list' to `buffer-undo-tree'
-  (undo-list-transfer-to-tree)
-  ;; switch branch
-  (setf (undo-tree-node-branch (undo-tree-current buffer-undo-tree))
-	branch)
-  (message "Switched to branch %d" branch))
-
-
-(defun undo-tree-set (node &optional preserve-timestamps)
-  ;; Set buffer to state corresponding to NODE. Returns intersection point
-  ;; between path back from current node and path back from selected NODE.
-  ;; Non-nil PRESERVE-TIMESTAMPS disables updating of timestamps in visited
-  ;; undo-tree nodes. (This should *only* be used when temporarily visiting
-  ;; another undo state and immediately returning to the original state
-  ;; afterwards. Otherwise, it could cause history-discarding errors.)
-  (let ((path (make-hash-table :test 'eq))
-        (n node))
-    (puthash (undo-tree-root buffer-undo-tree) t path)
-    ;; build list of nodes leading back from selected node to root, updating
-    ;; branches as we go to point down to selected node
-    (while (progn
-             (puthash n t path)
-             (when (undo-tree-node-previous n)
-               (setf (undo-tree-node-branch (undo-tree-node-previous n))
-                     (undo-tree-position
-                      n (undo-tree-node-next (undo-tree-node-previous n))))
-               (setq n (undo-tree-node-previous n)))))
-    ;; work backwards from current node until we intersect path back from
-    ;; selected node
-    (setq n (undo-tree-current buffer-undo-tree))
-    (while (not (gethash n path))
-      (setq n (undo-tree-node-previous n)))
-    ;; ascend tree until intersection node
-    (while (not (eq (undo-tree-current buffer-undo-tree) n))
-      (undo-tree-undo-1 nil nil preserve-timestamps))
-    ;; descend tree until selected node
-    (while (not (eq (undo-tree-current buffer-undo-tree) node))
-      (undo-tree-redo-1 nil nil preserve-timestamps))
-    n))  ; return intersection node
-
-
-
-(defun undo-tree-save-state-to-register (register)
-  "Store current undo-tree state to REGISTER.
-The saved state can be restored using
-`undo-tree-restore-state-from-register'.
-Argument is a character, naming the register."
-  (interactive "cUndo-tree state to register: ")
-  (unless undo-tree-mode
-    (user-error "Undo-tree mode not enabled in buffer"))
-  ;; throw error if undo is disabled in buffer
-  (when (eq buffer-undo-list t)
-    (user-error "No undo information in this buffer"))
-  ;; transfer entries accumulated in `buffer-undo-list' to `buffer-undo-tree'
-  (undo-list-transfer-to-tree)
-  ;; save current node to REGISTER
-  (set-register
-   register (registerv-make
-	     (undo-tree-make-register-data
-	      (current-buffer) (undo-tree-current buffer-undo-tree))
-	     :print-func 'undo-tree-register-data-print-func))
-  ;; record REGISTER in current node, for visualizer
-  (setf (undo-tree-node-register (undo-tree-current buffer-undo-tree))
-	register))
-
-
-
-(defun undo-tree-restore-state-from-register (register)
-  "Restore undo-tree state from REGISTER.
-The state must be saved using `undo-tree-save-state-to-register'.
-Argument is a character, naming the register."
-  (interactive "*cRestore undo-tree state from register: ")
-  (unless undo-tree-mode
-    (user-error "Undo-tree mode not enabled in buffer"))
-  ;; throw error if undo is disabled in buffer, or if register doesn't contain
-  ;; an undo-tree node
-  (let ((data (registerv-data (get-register register))))
-    (cond
-     ((eq buffer-undo-list t)
-      (user-error "No undo information in this buffer"))
-     ((not (undo-tree-register-data-p data))
-      (user-error "Register doesn't contain undo-tree state"))
-     ((not (eq (current-buffer) (undo-tree-register-data-buffer data)))
-      (user-error "Register contains undo-tree state for a different buffer")))
-    ;; transfer entries accumulated in `buffer-undo-list' to `buffer-undo-tree'
-    (undo-list-transfer-to-tree)
-    ;; restore buffer state corresponding to saved node
-    (undo-tree-set (undo-tree-register-data-node data))))
-
-
-
-
-;;; =====================================================================
-;;;                    Persistent storage commands
-
-(defun undo-tree-make-history-save-file-name (file)
-  "Create the undo history file name for FILE.
-Normally this is the file's name with \".\" prepended and
-\".~undo-tree~\" appended.
-
-A match for FILE is sought in `undo-tree-history-directory-alist'
-\(see the documentation of that variable for details\). If the
-directory for the backup doesn't exist, it is created."
-  (let* ((backup-directory-alist undo-tree-history-directory-alist)
-	 (name (make-backup-file-name-1 file)))
-    (concat (file-name-directory name) "." (file-name-nondirectory name)
-	    ".~undo-tree~")))
-
-
-(defun undo-tree-save-history (&optional filename overwrite)
-  "Store undo-tree history to file.
-
-If optional argument FILENAME is omitted, default save file is
-\".<buffer-file-name>.~undo-tree\" if buffer is visiting a file.
-Otherwise, prompt for one.
-
-If OVERWRITE is non-nil, any existing file will be overwritten
-without asking for confirmation."
-  (interactive)
-  (unless undo-tree-mode
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (when (eq buffer-undo-list t)
-    (user-error "No undo information in this buffer"))
-  (undo-list-transfer-to-tree)
-  (when (and buffer-undo-tree (not (eq buffer-undo-tree t)))
-    (condition-case nil
-	(undo-tree-kill-visualizer)
-      (error (undo-tree-clear-visualizer-data buffer-undo-tree)))
-    (let ((buff (current-buffer))
-	  tree)
-      ;; get filename
-      (unless filename
-	(setq filename
-	      (if buffer-file-name
-		  (undo-tree-make-history-save-file-name buffer-file-name)
-		(expand-file-name (read-file-name "File to save in: ") nil))))
-      (when (or (not (file-exists-p filename))
-		overwrite
-		(yes-or-no-p (format "Overwrite \"%s\"? " filename)))
-	(unwind-protect
-	    (progn
-	      ;; transform undo-tree into non-circular structure, and make
-	      ;; temporary copy
-	      (undo-tree-decircle buffer-undo-tree)
-	      (setq tree (copy-undo-tree buffer-undo-tree))
-	      ;; discard undo-tree object pool before saving
-	      (setf (undo-tree-object-pool tree) nil)
-	      ;; print undo-tree to file
-	      ;; NOTE: We use `with-temp-buffer' instead of `with-temp-file'
-	      ;;       to allow `auto-compression-mode' to take effect, in
-	      ;;       case user has overridden or advised the default
-	      ;;       `undo-tree-make-history-save-file-name' to add a
-	      ;;       compressed file extension.
-	      (with-auto-compression-mode
-		(with-temp-buffer
-		  (prin1 (sha1 buff) (current-buffer))
-		  (terpri (current-buffer))
-		  (let ((print-circle t)) (prin1 tree (current-buffer)))
-		  (write-region nil nil filename))))
-	  ;; restore circular undo-tree data structure
-	  (undo-tree-recircle buffer-undo-tree))
-	))))
-
-
-
-(defun undo-tree-load-history (&optional filename noerror)
-  "Load undo-tree history from file.
-
-If optional argument FILENAME is null, default load file is
-\".<buffer-file-name>.~undo-tree\" if buffer is visiting a file.
-Otherwise, prompt for one.
-
-If optional argument NOERROR is non-nil, return nil instead of
-signaling an error if file is not found."
-  (interactive)
-  (unless undo-tree-mode
-    (user-error "Undo-tree mode not enabled in buffer"))
-  ;; get filename
-  (unless filename
-    (setq filename
-	  (if buffer-file-name
-	      (undo-tree-make-history-save-file-name buffer-file-name)
-	    (expand-file-name (read-file-name "File to load from: ") nil))))
-
-  ;; attempt to read undo-tree from FILENAME
-  (catch 'load-error
-    (unless (file-exists-p filename)
-      (if noerror
-	  (throw 'load-error nil)
-	(error "File \"%s\" does not exist; could not load undo-tree history"
-	       filename)))
-    (let (buff hash tree)
-      (setq buff (current-buffer))
-      (with-auto-compression-mode
-	(with-temp-buffer
-	  (insert-file-contents filename)
-	  (goto-char (point-min))
-	  (condition-case nil
-	      (setq hash (read (current-buffer)))
-	    (error
-	     (kill-buffer nil)
-	     (funcall (if noerror 'message 'user-error)
-		      "Error reading undo-tree history from \"%s\"" filename)
-	     (throw 'load-error nil)))
-	  (unless (string= (sha1 buff) hash)
-	    (kill-buffer nil)
-	    (funcall (if noerror 'message 'user-error)
-		     "Buffer has been modified; could not load undo-tree history")
-	    (throw 'load-error nil))
-	  (condition-case nil
-	      (setq tree (read (current-buffer)))
-	    (error
-	     (kill-buffer nil)
-	     (funcall (if noerror 'message 'error)
-		      "Error reading undo-tree history from \"%s\"" filename)
-	     (throw 'load-error nil)))
-	  (kill-buffer nil)))
-      ;; initialise empty undo-tree object pool
-      (setf (undo-tree-object-pool tree)
-	    (make-hash-table :test 'eq :weakness 'value))
-      ;; restore circular undo-tree data structure
-      (undo-tree-recircle tree)
-      (setq buffer-undo-tree tree))))
-
-
-
-;; Versions of save/load functions for use in hooks
-(defun undo-tree-save-history-hook ()
-  (when (and undo-tree-mode undo-tree-auto-save-history
-	     (not (eq buffer-undo-list t)))
-    (undo-tree-save-history nil t) nil))
-
-(defun undo-tree-load-history-hook ()
-  (when (and undo-tree-mode undo-tree-auto-save-history
-	     (not (eq buffer-undo-list t))
-	     (not revert-buffer-in-progress-p))
-    (undo-tree-load-history nil t)))
-
-
-
-
-;;; =====================================================================
-;;;                    Visualizer drawing functions
-
-(defun undo-tree-visualize ()
-  "Visualize the current buffer's undo tree."
-  (interactive "*")
-  (unless undo-tree-mode
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (deactivate-mark)
-  ;; throw error if undo is disabled in buffer
-  (when (eq buffer-undo-list t)
-    (user-error "No undo information in this buffer"))
-  ;; transfer entries accumulated in `buffer-undo-list' to `buffer-undo-tree'
-  (undo-list-transfer-to-tree)
-  ;; add hook to kill visualizer buffer if original buffer is changed
-  (add-hook 'before-change-functions 'undo-tree-kill-visualizer nil t)
-  ;; prepare *undo-tree* buffer, then draw tree in it
-  (let ((undo-tree buffer-undo-tree)
-        (buff (current-buffer))
-	(display-buffer-mark-dedicated 'soft))
-    (switch-to-buffer-other-window
-     (get-buffer-create undo-tree-visualizer-buffer-name))
-    (setq undo-tree-visualizer-parent-buffer buff)
-    (setq undo-tree-visualizer-parent-mtime
-	  (and (buffer-file-name buff)
-	       (nth 5 (file-attributes (buffer-file-name buff)))))
-    (setq undo-tree-visualizer-initial-node (undo-tree-current undo-tree))
-    (setq undo-tree-visualizer-spacing
-	  (undo-tree-visualizer-calculate-spacing))
-    (make-local-variable 'undo-tree-visualizer-timestamps)
-    (make-local-variable 'undo-tree-visualizer-diff)
-    (setq buffer-undo-tree undo-tree)
-    (undo-tree-visualizer-mode)
-    ;; FIXME; don't know why `undo-tree-visualizer-mode' clears this
-    (setq buffer-undo-tree undo-tree)
-    (set (make-local-variable 'undo-tree-visualizer-lazy-drawing)
-	 (or (eq undo-tree-visualizer-lazy-drawing t)
-	     (and (numberp undo-tree-visualizer-lazy-drawing)
-		  (>= (undo-tree-count undo-tree)
-		      undo-tree-visualizer-lazy-drawing))))
-    (when undo-tree-visualizer-diff (undo-tree-visualizer-show-diff))
-    (let ((inhibit-read-only t)) (undo-tree-draw-tree undo-tree))))
-
-
-(defun undo-tree-kill-visualizer (&rest _dummy)
-  ;; Kill visualizer. Added to `before-change-functions' hook of original
-  ;; buffer when visualizer is invoked.
-  (unless (or undo-tree-inhibit-kill-visualizer
-	      (null (get-buffer undo-tree-visualizer-buffer-name)))
-    (with-current-buffer undo-tree-visualizer-buffer-name
-      (undo-tree-visualizer-quit))))
-
-
-
-(defun undo-tree-draw-tree (undo-tree)
-  ;; Draw undo-tree in current buffer starting from NODE (or root if nil).
-  (let ((node (if undo-tree-visualizer-lazy-drawing
-		  (undo-tree-current undo-tree)
-		(undo-tree-root undo-tree))))
-    (erase-buffer)
-    (setq undo-tree-visualizer-needs-extending-down nil
-	  undo-tree-visualizer-needs-extending-up nil)
-    (undo-tree-clear-visualizer-data undo-tree)
-    (undo-tree-compute-widths node)
-    ;; lazy drawing starts vertically centred and displaced horizontally to
-    ;; the left (window-width/4), since trees will typically grow right
-    (if undo-tree-visualizer-lazy-drawing
-	(progn
-	  (undo-tree-move-down (/ (window-height) 2))
-	  (undo-tree-move-forward (max 2 (/ (window-width) 4)))) ; left margin
-      ;; non-lazy drawing starts in centre at top of buffer
-      (undo-tree-move-down 1)  ; top margin
-      (undo-tree-move-forward
-       (max (/ (window-width) 2)
-	    (+ (undo-tree-node-char-lwidth node)
-	       ;; add space for left part of left-most time-stamp
-	       (if undo-tree-visualizer-timestamps
-		   (/ (- undo-tree-visualizer-spacing 4) 2)
-		 0)
-	       2))))  ; left margin
-    ;; link starting node to its representation in visualizer
-    (setf (undo-tree-node-marker node) (make-marker))
-    (set-marker-insertion-type (undo-tree-node-marker node) nil)
-    (move-marker (undo-tree-node-marker node) (point))
-    ;; draw undo-tree
-    (let ((undo-tree-insert-face 'undo-tree-visualizer-default-face)
-	  node-list)
-      (if (not undo-tree-visualizer-lazy-drawing)
-	  (undo-tree-extend-down node t)
-	(undo-tree-extend-down node)
-	(undo-tree-extend-up node)
-	(setq node-list undo-tree-visualizer-needs-extending-down
-	      undo-tree-visualizer-needs-extending-down nil)
-	(while node-list (undo-tree-extend-down (pop node-list)))))
-    ;; highlight active branch
-    (let ((undo-tree-insert-face 'undo-tree-visualizer-active-branch-face))
-      (undo-tree-highlight-active-branch
-       (or undo-tree-visualizer-needs-extending-up
-	   (undo-tree-root undo-tree))))
-    ;; highlight current node
-    (undo-tree-draw-node (undo-tree-current undo-tree) 'current)))
-
-
-(defun undo-tree-extend-down (node &optional bottom)
-  ;; Extend tree downwards starting from NODE and point. If BOTTOM is t,
-  ;; extend all the way down to the leaves. If BOTTOM is a node, extend down
-  ;; as far as that node. If BOTTOM is an integer, extend down as far as that
-  ;; line. Otherwise, only extend visible portion of tree. NODE is assumed to
-  ;; already have a node marker. Returns non-nil if anything was actually
-  ;; extended.
-  (let ((extended nil)
-	(cur-stack (list node))
-	next-stack)
-    ;; don't bother extending if BOTTOM specifies an already-drawn node
-    (unless (and (undo-tree-node-p bottom) (undo-tree-node-marker bottom))
-      ;; draw nodes layer by layer
-      (while (or cur-stack
-		 (prog1 (setq cur-stack next-stack)
-		   (setq next-stack nil)))
-	(setq node (pop cur-stack))
-	;; if node is within range being drawn...
-	(if (or (eq bottom t)
-		(and (undo-tree-node-p bottom)
-		     (not (eq (undo-tree-node-previous node) bottom)))
-		(and (integerp bottom)
-		     (>= bottom (line-number-at-pos
-				 (undo-tree-node-marker node))))
-		(and (null bottom)
-		     (pos-visible-in-window-p (undo-tree-node-marker node)
-					      nil t)))
-	    ;; ...draw one layer of node's subtree (if not already drawn)
-	    (progn
-	      (unless (and (undo-tree-node-next node)
-			   (undo-tree-node-marker
-			    (nth (undo-tree-node-branch node)
-				 (undo-tree-node-next node))))
-		(goto-char (undo-tree-node-marker node))
-		(undo-tree-draw-subtree node)
-		(setq extended t))
-	      (setq next-stack
-		    (append (undo-tree-node-next node) next-stack)))
-	  ;; ...otherwise, postpone drawing until later
-	  (push node undo-tree-visualizer-needs-extending-down))))
-    extended))
-
-
-(defun undo-tree-extend-up (node &optional top)
-  ;; Extend tree upwards starting from NODE. If TOP is t, extend all the way
-  ;; to root. If TOP is a node, extend up as far as that node. If TOP is an
-  ;; integer, extend up as far as that line. Otherwise, only extend visible
-  ;; portion of tree. NODE is assumed to already have a node marker. Returns
-  ;; non-nil if anything was actually extended.
-  (let ((extended nil) parent)
-    ;; don't bother extending if TOP specifies an already-drawn node
-    (unless (and (undo-tree-node-p top) (undo-tree-node-marker top))
-      (while node
-	(setq parent (undo-tree-node-previous node))
-	;; if we haven't reached root...
-	(if parent
-	    ;; ...and node is within range being drawn...
-	    (if (or (eq top t)
-		    (and (undo-tree-node-p top) (not (eq node top)))
-		    (and (integerp top)
-			 (< top (line-number-at-pos
-				 (undo-tree-node-marker node))))
-		    (and (null top)
-			 ;; NOTE: we check point in case window-start is outdated
-			 (< (min (line-number-at-pos (point))
-				 (line-number-at-pos (window-start)))
-			    (line-number-at-pos
-			     (undo-tree-node-marker node)))))
-		;; ...and it hasn't already been drawn
-		(when (not (undo-tree-node-marker parent))
-		  ;; link parent node to its representation in visualizer
-		  (undo-tree-compute-widths parent)
-		  (undo-tree-move-to-parent node)
-		  (setf (undo-tree-node-marker parent) (make-marker))
-		  (set-marker-insertion-type
-		   (undo-tree-node-marker parent) nil)
-		  (move-marker (undo-tree-node-marker parent) (point))
-		  ;; draw subtree beneath parent
-		  (setq undo-tree-visualizer-needs-extending-down
-			(nconc (delq node (undo-tree-draw-subtree parent))
-			       undo-tree-visualizer-needs-extending-down))
-		  (setq extended t))
-	      ;; ...otherwise, postpone drawing for later and exit
-	      (setq undo-tree-visualizer-needs-extending-up (when parent node)
-		    parent nil))
-
-	  ;; if we've reached root, stop extending and add top margin
-	  (setq undo-tree-visualizer-needs-extending-up nil)
-	  (goto-char (undo-tree-node-marker node))
-	  (undo-tree-move-up 1)  ; top margin
-	  (delete-region (point-min) (line-beginning-position)))
-	;; next iteration
-	(setq node parent)))
-    extended))
-
-
-(defun undo-tree-expand-down (from &optional to)
-  ;; Expand tree downwards. FROM is the node to start expanding from. Stop
-  ;; expanding at TO if specified. Otherwise, just expand visible portion of
-  ;; tree and highlight active branch from FROM.
-  (when undo-tree-visualizer-needs-extending-down
-    (let ((inhibit-read-only t)
-	  node-list extended)
-      ;; extend down as far as TO node
-      (when to
-	(setq extended (undo-tree-extend-down from to))
-	(goto-char (undo-tree-node-marker to))
-	(redisplay t))  ; force redisplay to scroll buffer if necessary
-      ;; extend visible portion of tree downwards
-      (setq node-list undo-tree-visualizer-needs-extending-down
-	    undo-tree-visualizer-needs-extending-down nil)
-      (when node-list
-	(dolist (n node-list)
-	  (when (undo-tree-extend-down n) (setq extended t)))
-	;; highlight active branch in newly-extended-down portion, if any
-	(when extended
-	  (let ((undo-tree-insert-face
-		 'undo-tree-visualizer-active-branch-face))
-	    (undo-tree-highlight-active-branch from)))))))
-
-
-(defun undo-tree-expand-up (from &optional to)
-  ;; Expand tree upwards. FROM is the node to start expanding from, TO is the
-  ;; node to stop expanding at. If TO node isn't specified, just expand visible
-  ;; portion of tree and highlight active branch down to FROM.
-  (when undo-tree-visualizer-needs-extending-up
-    (let ((inhibit-read-only t)
-	  extended node-list)
-      ;; extend up as far as TO node
-      (when to
-	(setq extended (undo-tree-extend-up from to))
-	(goto-char (undo-tree-node-marker to))
-	;; simulate auto-scrolling if close to top of buffer
-	(when (<= (line-number-at-pos (point)) scroll-margin)
-	  (undo-tree-move-up (if (= scroll-conservatively 0)
-				 (/ (window-height) 2) 3))
-	  (when (undo-tree-extend-up to) (setq extended t))
-	  (goto-char (undo-tree-node-marker to))
-	  (unless (= scroll-conservatively 0) (recenter scroll-margin))))
-      ;; extend visible portion of tree upwards
-      (and undo-tree-visualizer-needs-extending-up
-	   (undo-tree-extend-up undo-tree-visualizer-needs-extending-up)
-	   (setq extended t))
-      ;; extend visible portion of tree downwards
-      (setq node-list undo-tree-visualizer-needs-extending-down
-	    undo-tree-visualizer-needs-extending-down nil)
-      (dolist (n node-list) (undo-tree-extend-down n))
-      ;; highlight active branch in newly-extended-up portion, if any
-      (when extended
-	(let ((undo-tree-insert-face
-	       'undo-tree-visualizer-active-branch-face))
-	  (undo-tree-highlight-active-branch
-	   (or undo-tree-visualizer-needs-extending-up
-	       (undo-tree-root buffer-undo-tree))
-	   from))))))
-
-
-
-(defun undo-tree-highlight-active-branch (node &optional end)
-  ;; Draw highlighted active branch below NODE in current buffer. Stop
-  ;; highlighting at END node if specified.
-  (let ((stack (list node)))
-    ;; draw active branch
-    (while stack
-      (setq node (pop stack))
-      (unless (or (eq node end)
-		  (memq node undo-tree-visualizer-needs-extending-down))
-	(goto-char (undo-tree-node-marker node))
-	(setq node (undo-tree-draw-subtree node 'active)
-	      stack (nconc stack node))))))
-
-
-(defun undo-tree-draw-node (node &optional current)
-  ;; Draw symbol representing NODE in visualizer. If CURRENT is non-nil, node
-  ;; is current node.
-  (goto-char (undo-tree-node-marker node))
-  (when undo-tree-visualizer-timestamps
-    (undo-tree-move-backward (/ undo-tree-visualizer-spacing 2)))
-
-  (let* ((undo-tree-insert-face (and undo-tree-insert-face
-				     (or (and (consp undo-tree-insert-face)
-					      undo-tree-insert-face)
-					 (list undo-tree-insert-face))))
-	 (register (undo-tree-node-register node))
-	 (unmodified (if undo-tree-visualizer-parent-mtime
-			 (undo-tree-node-unmodified-p
-			  node undo-tree-visualizer-parent-mtime)
-		       (undo-tree-node-unmodified-p node)))
-	node-string)
-    ;; check node's register (if any) still stores appropriate undo-tree state
-    (unless (and register
-		 (undo-tree-register-data-p
-		  (registerv-data (get-register register)))
-		 (eq node (undo-tree-register-data-node
-			   (registerv-data (get-register register)))))
-      (setq register nil))
-    ;; represent node by different symbols, depending on whether it's the
-    ;; current node, is saved in a register, or corresponds to an unmodified
-    ;; buffer
-    (setq node-string
-	    (cond
-	     (undo-tree-visualizer-timestamps
-	        (undo-tree-timestamp-to-string
-	         (undo-tree-node-timestamp node)
-		 undo-tree-visualizer-relative-timestamps
-		 current register))
-	     (register (char-to-string register))
-	     (unmodified "s")
-	     (current "x")
-	     (t "o"))
-	  undo-tree-insert-face
-	    (nconc
-	     (cond
-	      (current    '(undo-tree-visualizer-current-face))
-	      (unmodified '(undo-tree-visualizer-unmodified-face))
-	      (register   '(undo-tree-visualizer-register-face)))
-	     undo-tree-insert-face))
-    ;; draw node and link it to its representation in visualizer
-    (undo-tree-insert node-string)
-    (undo-tree-move-backward (if undo-tree-visualizer-timestamps
-				 (1+ (/ undo-tree-visualizer-spacing 2))
-			       1))
-    (move-marker (undo-tree-node-marker node) (point))
-    (put-text-property (point) (1+ (point)) 'undo-tree-node node)))
-
-
-(defun undo-tree-draw-subtree (node &optional active-branch)
-  ;; Draw subtree rooted at NODE. The subtree will start from point.
-  ;; If ACTIVE-BRANCH is non-nil, just draw active branch below NODE. Returns
-  ;; list of nodes below NODE.
-  (let ((num-children (length (undo-tree-node-next node)))
-        node-list pos trunk-pos n)
-    ;; draw node itself
-    (undo-tree-draw-node node)
-
-    (cond
-     ;; if we're at a leaf node, we're done
-     ((= num-children 0))
-
-     ;; if node has only one child, draw it (not strictly necessary to deal
-     ;; with this case separately, but as it's by far the most common case
-     ;; this makes the code clearer and more efficient)
-     ((= num-children 1)
-      (undo-tree-move-down 1)
-      (undo-tree-insert ?|)
-      (undo-tree-move-backward 1)
-      (undo-tree-move-down 1)
-      (undo-tree-insert ?|)
-      (undo-tree-move-backward 1)
-      (undo-tree-move-down 1)
-      (setq n (car (undo-tree-node-next node)))
-      ;; link next node to its representation in visualizer
-      (unless (markerp (undo-tree-node-marker n))
-        (setf (undo-tree-node-marker n) (make-marker))
-        (set-marker-insertion-type (undo-tree-node-marker n) nil))
-      (move-marker (undo-tree-node-marker n) (point))
-      ;; add next node to list of nodes to draw next
-      (push n node-list))
-
-     ;; if node has multiple children, draw branches
-     (t
-      (undo-tree-move-down 1)
-      (undo-tree-insert ?|)
-      (undo-tree-move-backward 1)
-      (move-marker (setq trunk-pos (make-marker)) (point))
-      ;; left subtrees
-      (undo-tree-move-backward
-       (- (undo-tree-node-char-lwidth node)
-          (undo-tree-node-char-lwidth
-           (car (undo-tree-node-next node)))))
-      (move-marker (setq pos (make-marker)) (point))
-      (setq n (cons nil (undo-tree-node-next node)))
-      (dotimes (i (/ num-children 2))
-        (setq n (cdr n))
-        (when (or (null active-branch)
-                  (eq (car n)
-                      (nth (undo-tree-node-branch node)
-                           (undo-tree-node-next node))))
-          (undo-tree-move-forward 2)
-          (undo-tree-insert ?_ (- trunk-pos pos 2))
-          (goto-char pos)
-          (undo-tree-move-forward 1)
-          (undo-tree-move-down 1)
-          (undo-tree-insert ?/)
-          (undo-tree-move-backward 2)
-          (undo-tree-move-down 1)
-          ;; link node to its representation in visualizer
-          (unless (markerp (undo-tree-node-marker (car n)))
-            (setf (undo-tree-node-marker (car n)) (make-marker))
-            (set-marker-insertion-type (undo-tree-node-marker (car n)) nil))
-          (move-marker (undo-tree-node-marker (car n)) (point))
-          ;; add node to list of nodes to draw next
-          (push (car n) node-list))
-        (goto-char pos)
-        (undo-tree-move-forward
-         (+ (undo-tree-node-char-rwidth (car n))
-            (undo-tree-node-char-lwidth (cadr n))
-            undo-tree-visualizer-spacing 1))
-        (move-marker pos (point)))
-      ;; middle subtree (only when number of children is odd)
-      (when (= (mod num-children 2) 1)
-        (setq n (cdr n))
-        (when (or (null active-branch)
-                  (eq (car n)
-                      (nth (undo-tree-node-branch node)
-                           (undo-tree-node-next node))))
-          (undo-tree-move-down 1)
-          (undo-tree-insert ?|)
-          (undo-tree-move-backward 1)
-          (undo-tree-move-down 1)
-          ;; link node to its representation in visualizer
-          (unless (markerp (undo-tree-node-marker (car n)))
-            (setf (undo-tree-node-marker (car n)) (make-marker))
-            (set-marker-insertion-type (undo-tree-node-marker (car n)) nil))
-          (move-marker (undo-tree-node-marker (car n)) (point))
-          ;; add node to list of nodes to draw next
-          (push (car n) node-list))
-        (goto-char pos)
-        (undo-tree-move-forward
-         (+ (undo-tree-node-char-rwidth (car n))
-            (if (cadr n) (undo-tree-node-char-lwidth (cadr n)) 0)
-            undo-tree-visualizer-spacing 1))
-        (move-marker pos (point)))
-      ;; right subtrees
-      (move-marker trunk-pos (1+ trunk-pos))
-      (dotimes (i (/ num-children 2))
-        (setq n (cdr n))
-        (when (or (null active-branch)
-                  (eq (car n)
-                      (nth (undo-tree-node-branch node)
-                           (undo-tree-node-next node))))
-          (goto-char trunk-pos)
-          (undo-tree-insert ?_ (- pos trunk-pos 1))
-          (goto-char pos)
-          (undo-tree-move-backward 1)
-          (undo-tree-move-down 1)
-          (undo-tree-insert ?\\)
-          (undo-tree-move-down 1)
-          ;; link node to its representation in visualizer
-          (unless (markerp (undo-tree-node-marker (car n)))
-            (setf (undo-tree-node-marker (car n)) (make-marker))
-            (set-marker-insertion-type (undo-tree-node-marker (car n)) nil))
-          (move-marker (undo-tree-node-marker (car n)) (point))
-          ;; add node to list of nodes to draw next
-          (push (car n) node-list))
-        (when (cdr n)
-          (goto-char pos)
-          (undo-tree-move-forward
-           (+ (undo-tree-node-char-rwidth (car n))
-              (if (cadr n) (undo-tree-node-char-lwidth (cadr n)) 0)
-              undo-tree-visualizer-spacing 1))
-          (move-marker pos (point))))
-      ))
-    ;; return list of nodes to draw next
-    (nreverse node-list)))
-
-
-(defun undo-tree-node-char-lwidth (node)
-  ;; Return left-width of NODE measured in characters.
-  (if (= (length (undo-tree-node-next node)) 0) 0
-    (- (* (+ undo-tree-visualizer-spacing 1) (undo-tree-node-lwidth node))
-       (if (= (undo-tree-node-cwidth node) 0)
-           (1+ (/ undo-tree-visualizer-spacing 2)) 0))))
-
-
-(defun undo-tree-node-char-rwidth (node)
-  ;; Return right-width of NODE measured in characters.
-  (if (= (length (undo-tree-node-next node)) 0) 0
-    (- (* (+ undo-tree-visualizer-spacing 1) (undo-tree-node-rwidth node))
-       (if (= (undo-tree-node-cwidth node) 0)
-           (1+ (/ undo-tree-visualizer-spacing 2)) 0))))
-
-
-(defun undo-tree-insert (str &optional arg)
-  ;; Insert character or string STR ARG times, overwriting, and using
-  ;; `undo-tree-insert-face'.
-  (unless arg (setq arg 1))
-  (when (characterp str)
-    (setq str (make-string arg str))
-    (setq arg 1))
-  (dotimes (i arg) (insert str))
-  (setq arg (* arg (length str)))
-  (undo-tree-move-forward arg)
-  ;; make sure mark isn't active, otherwise `backward-delete-char' might
-  ;; delete region instead of single char if transient-mark-mode is enabled
-  (setq mark-active nil)
-  (backward-delete-char arg)
-  (when undo-tree-insert-face
-    (put-text-property (- (point) arg) (point) 'face undo-tree-insert-face)))
-
-
-(defun undo-tree-move-down (&optional arg)
-  ;; Move down, extending buffer if necessary.
-  (let ((row (line-number-at-pos))
-        (col (current-column))
-        line)
-    (unless arg (setq arg 1))
-    (forward-line arg)
-    (setq line (line-number-at-pos))
-    ;; if buffer doesn't have enough lines, add some
-    (when (/= line (+ row arg))
-      (cond
-       ((< arg 0)
-	(insert (make-string (- line row arg) ?\n))
-	(forward-line (+ arg (- row line))))
-       (t (insert (make-string (- arg (- line row)) ?\n)))))
-    (undo-tree-move-forward col)))
-
-
-(defun undo-tree-move-up (&optional arg)
-  ;; Move up, extending buffer if necessary.
-  (unless arg (setq arg 1))
-  (undo-tree-move-down (- arg)))
-
-
-(defun undo-tree-move-forward (&optional arg)
-  ;; Move forward, extending buffer if necessary.
-  (unless arg (setq arg 1))
-  (let (n)
-    (cond
-     ((>= arg 0)
-      (setq n (- (line-end-position) (point)))
-      (if (> n arg)
-	  (forward-char arg)
-	(end-of-line)
-	(insert (make-string (- arg n) ? ))))
-     ((< arg 0)
-      (setq arg (- arg))
-      (setq n (- (point) (line-beginning-position)))
-      (when (< (- n 2) arg)  ; -2 to create left-margin
-	;; no space left - shift entire buffer contents right!
-	(let ((pos (move-marker (make-marker) (point))))
-	  (set-marker-insertion-type pos t)
-	  (goto-char (point-min))
-	  (while (not (eobp))
-	    (insert-before-markers (make-string (- arg -2 n) ? ))
-	    (forward-line 1))
-	  (goto-char pos)))
-      (backward-char arg)))))
-
-
-(defun undo-tree-move-backward (&optional arg)
-  ;; Move backward, extending buffer if necessary.
-  (unless arg (setq arg 1))
-  (undo-tree-move-forward (- arg)))
-
-
-(defun undo-tree-move-to-parent (node)
-  ;; Move to position of parent of NODE, extending buffer if necessary.
-  (let* ((parent (undo-tree-node-previous node))
-	 (n (undo-tree-node-next parent))
-	 (l (length n)) p)
-    (goto-char (undo-tree-node-marker node))
-    (unless (= l 1)
-      ;; move horizontally
-      (setq p (undo-tree-position node n))
-      (cond
-       ;; node in centre subtree: no horizontal movement
-       ((and (= (mod l 2) 1) (= p (/ l 2))))
-       ;; node in left subtree: move right
-       ((< p (/ l 2))
-	(setq n (nthcdr p n))
-	(undo-tree-move-forward
-	 (+ (undo-tree-node-char-rwidth (car n))
-	    (/ undo-tree-visualizer-spacing 2) 1))
-	(dotimes (i (- (/ l 2) p 1))
-	  (setq n (cdr n))
-	  (undo-tree-move-forward
-	   (+ (undo-tree-node-char-lwidth (car n))
-	      (undo-tree-node-char-rwidth (car n))
-	      undo-tree-visualizer-spacing 1)))
-	(when (= (mod l 2) 1)
-	  (setq n (cdr n))
-	  (undo-tree-move-forward
-	   (+ (undo-tree-node-char-lwidth (car n))
-	      (/ undo-tree-visualizer-spacing 2) 1))))
-       (t ;; node in right subtree: move left
-	(setq n (nthcdr (/ l 2) n))
-	(when (= (mod l 2) 1)
-	  (undo-tree-move-backward
-	   (+ (undo-tree-node-char-rwidth (car n))
-	      (/ undo-tree-visualizer-spacing 2) 1))
-	  (setq n (cdr n)))
-	(dotimes (i (- p (/ l 2) (mod l 2)))
-	  (undo-tree-move-backward
-	   (+ (undo-tree-node-char-lwidth (car n))
-	      (undo-tree-node-char-rwidth (car n))
-	      undo-tree-visualizer-spacing 1))
-	  (setq n (cdr n)))
-	(undo-tree-move-backward
-	 (+ (undo-tree-node-char-lwidth (car n))
-	    (/ undo-tree-visualizer-spacing 2) 1)))))
-    ;; move vertically
-    (undo-tree-move-up 3)))
-
-
-(defun undo-tree-timestamp-to-string
-  (timestamp &optional relative current register)
-  ;; Convert TIMESTAMP to string (either absolute or RELATVE time), indicating
-  ;; if it's the CURRENT node and/or has an associated REGISTER.
-  (if relative
-      ;; relative time
-      (let ((time (floor (float-time
-			  (subtract-time (current-time) timestamp))))
-	    n)
-	(setq time
-	      ;; years
-	      (if (> (setq n (/ time 315360000)) 0)
-		  (if (> n 999) "-ages" (format "-%dy" n))
-		(setq time (% time 315360000))
-		;; days
-		(if (> (setq n (/ time 86400)) 0)
-		    (format "-%dd" n)
-		  (setq time (% time 86400))
-		  ;; hours
-		  (if (> (setq n (/ time 3600)) 0)
-		      (format "-%dh" n)
-		    (setq time (% time 3600))
-		    ;; mins
-		    (if (> (setq n (/ time 60)) 0)
-			(format "-%dm" n)
-		      ;; secs
-		      (format "-%ds" (% time 60)))))))
-	(setq time (concat
-		    (if current "*" " ")
-		    time
-		    (if register (concat "[" (char-to-string register) "]")
-		      "   ")))
-	(setq n (length time))
-	(if (< n 9)
-	    (concat (make-string (- 9 n) ? ) time)
-	  time))
-    ;; absolute time
-    (concat (if current " *" "  ")
-	    (format-time-string "%H:%M:%S" timestamp)
-	    (if register
-		(concat "[" (char-to-string register) "]")
-	      "   "))))
-
-
-
-
-;;; =====================================================================
-;;;                        Visualizer commands
-
-(define-derived-mode
-  undo-tree-visualizer-mode special-mode "undo-tree-visualizer"
-  "Major mode used in undo-tree visualizer.
-
-The undo-tree visualizer can only be invoked from a buffer in
-which `undo-tree-mode' is enabled. The visualizer displays the
-undo history tree graphically, and allows you to browse around
-the undo history, undoing or redoing the corresponding changes in
-the parent buffer.
-
-Within the undo-tree visualizer, the following keys are available:
-
-  \\{undo-tree-visualizer-mode-map}"
-  :syntax-table nil
-  :abbrev-table nil
-  (setq truncate-lines t)
-  (setq cursor-type nil)
-  (setq undo-tree-visualizer-selected-node nil))
-
-
-
-(defun undo-tree-visualize-undo (&optional arg)
-  "Undo changes. A numeric ARG serves as a repeat count."
-  (interactive "p")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (let ((old (undo-tree-current buffer-undo-tree))
-	current)
-    ;; unhighlight old current node
-    (let ((undo-tree-insert-face 'undo-tree-visualizer-active-branch-face)
-	  (inhibit-read-only t))
-      (undo-tree-draw-node old))
-    ;; undo in parent buffer
-    (switch-to-buffer-other-window undo-tree-visualizer-parent-buffer)
-    (deactivate-mark)
-    (unwind-protect
-	(let ((undo-tree-inhibit-kill-visualizer t)) (undo-tree-undo-1 arg))
-      (setq current (undo-tree-current buffer-undo-tree))
-      (switch-to-buffer-other-window undo-tree-visualizer-buffer-name)
-      ;; when using lazy drawing, extend tree upwards as required
-      (when undo-tree-visualizer-lazy-drawing
-	(undo-tree-expand-up old current))
-      ;; highlight new current node
-      (let ((inhibit-read-only t)) (undo-tree-draw-node current 'current))
-      ;; update diff display, if any
-      (when undo-tree-visualizer-diff (undo-tree-visualizer-update-diff)))))
-
-
-(defun undo-tree-visualize-redo (&optional arg)
-  "Redo changes. A numeric ARG serves as a repeat count."
-  (interactive "p")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (let ((old (undo-tree-current buffer-undo-tree))
-	current)
-    ;; unhighlight old current node
-    (let ((undo-tree-insert-face 'undo-tree-visualizer-active-branch-face)
-	  (inhibit-read-only t))
-      (undo-tree-draw-node (undo-tree-current buffer-undo-tree)))
-    ;; redo in parent buffer
-    (switch-to-buffer-other-window undo-tree-visualizer-parent-buffer)
-    (deactivate-mark)
-    (unwind-protect
-	(let ((undo-tree-inhibit-kill-visualizer t)) (undo-tree-redo-1 arg))
-      (setq current (undo-tree-current buffer-undo-tree))
-      (switch-to-buffer-other-window undo-tree-visualizer-buffer-name)
-      ;; when using lazy drawing, extend tree downwards as required
-      (when undo-tree-visualizer-lazy-drawing
-	(undo-tree-expand-down old current))
-      ;; highlight new current node
-      (let ((inhibit-read-only t)) (undo-tree-draw-node current 'current))
-      ;; update diff display, if any
-      (when undo-tree-visualizer-diff (undo-tree-visualizer-update-diff)))))
-
-
-(defun undo-tree-visualize-switch-branch-right (arg)
-  "Switch to next branch of the undo tree.
-This will affect which branch to descend when *redoing* changes
-using `undo-tree-redo' or `undo-tree-visualizer-redo'."
-  (interactive "p")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  ;; un-highlight old active branch below current node
-  (goto-char (undo-tree-node-marker (undo-tree-current buffer-undo-tree)))
-  (let ((undo-tree-insert-face 'undo-tree-visualizer-default-face)
-	(inhibit-read-only t))
-    (undo-tree-highlight-active-branch (undo-tree-current buffer-undo-tree)))
-  ;; increment branch
-  (let ((branch (undo-tree-node-branch (undo-tree-current buffer-undo-tree))))
-  (setf (undo-tree-node-branch (undo-tree-current buffer-undo-tree))
-        (cond
-         ((>= (+ branch arg) (undo-tree-num-branches))
-          (1- (undo-tree-num-branches)))
-         ((<= (+ branch arg) 0) 0)
-         (t (+ branch arg))))
-  (let ((inhibit-read-only t))
-    ;; highlight new active branch below current node
-    (goto-char (undo-tree-node-marker (undo-tree-current buffer-undo-tree)))
-    (let ((undo-tree-insert-face 'undo-tree-visualizer-active-branch-face))
-      (undo-tree-highlight-active-branch (undo-tree-current buffer-undo-tree)))
-    ;; re-highlight current node
-    (undo-tree-draw-node (undo-tree-current buffer-undo-tree) 'current))))
-
-
-(defun undo-tree-visualize-switch-branch-left (arg)
-  "Switch to previous branch of the undo tree.
-This will affect which branch to descend when *redoing* changes
-using `undo-tree-redo' or `undo-tree-visualizer-redo'."
-  (interactive "p")
-  (undo-tree-visualize-switch-branch-right (- arg)))
-
-
-(defun undo-tree-visualizer-quit ()
-  "Quit the undo-tree visualizer."
-  (interactive)
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (undo-tree-clear-visualizer-data buffer-undo-tree)
-  ;; remove kill visualizer hook from parent buffer
-  (unwind-protect
-      (with-current-buffer undo-tree-visualizer-parent-buffer
-	(remove-hook 'before-change-functions 'undo-tree-kill-visualizer t))
-    ;; kill diff buffer, if any
-    (when undo-tree-visualizer-diff (undo-tree-visualizer-hide-diff))
-    (let ((parent undo-tree-visualizer-parent-buffer)
-	  window)
-      ;; kill visualizer buffer
-      (kill-buffer nil)
-      ;; switch back to parent buffer
-      (unwind-protect
-	  (if (setq window (get-buffer-window parent))
-	      (select-window window)
-	    (switch-to-buffer parent))))))
-
-
-(defun undo-tree-visualizer-abort ()
-  "Quit the undo-tree visualizer and return buffer to original state."
-  (interactive)
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (let ((node undo-tree-visualizer-initial-node))
-    (undo-tree-visualizer-quit)
-    (undo-tree-set node)))
-
-
-(defun undo-tree-visualizer-set (&optional pos)
-  "Set buffer to state corresponding to undo tree node
-at POS, or point if POS is nil."
-  (interactive)
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (unless pos (setq pos (point)))
-  (let ((node (get-text-property pos 'undo-tree-node)))
-    (when node
-      ;; set parent buffer to state corresponding to node at POS
-      (switch-to-buffer-other-window undo-tree-visualizer-parent-buffer)
-      (let ((undo-tree-inhibit-kill-visualizer t)) (undo-tree-set node))
-      (switch-to-buffer-other-window undo-tree-visualizer-buffer-name)
-      ;; re-draw undo tree
-      (let ((inhibit-read-only t)) (undo-tree-draw-tree buffer-undo-tree))
-      (when undo-tree-visualizer-diff (undo-tree-visualizer-update-diff)))))
-
-
-(defun undo-tree-visualizer-mouse-set (pos)
-  "Set buffer to state corresponding to undo tree node
-at mouse event POS."
-  (interactive "@e")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (undo-tree-visualizer-set (event-start (nth 1 pos))))
-
-
-(defun undo-tree-visualize-undo-to-x (&optional x)
-  "Undo to last branch point, register, or saved state.
-If X is the symbol `branch', undo to last branch point. If X is
-the symbol `register', undo to last register. If X is the sumbol
-`saved', undo to last saved state. If X is null, undo to first of
-these that's encountered.
-
-Interactively, a single \\[universal-argument] specifies
-`branch', a double \\[universal-argument] \\[universal-argument]
-specifies `saved', and a negative prefix argument specifies
-`register'."
-  (interactive "P")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (when (and (called-interactively-p 'any) x)
-    (setq x (prefix-numeric-value x)
-	  x (cond
-	     ((< x 0)  'register)
-	     ((<= x 4) 'branch)
-	     (t        'saved))))
-  (let ((current (if undo-tree-visualizer-selection-mode
-		     undo-tree-visualizer-selected-node
-		   (undo-tree-current buffer-undo-tree)))
-	(diff undo-tree-visualizer-diff)
-	r)
-    (undo-tree-visualizer-hide-diff)
-    (while (and (undo-tree-node-previous current)
-		(or (if undo-tree-visualizer-selection-mode
-			(progn
-			  (undo-tree-visualizer-select-previous)
-			  (setq current undo-tree-visualizer-selected-node))
-		      (undo-tree-visualize-undo)
-		      (setq current (undo-tree-current buffer-undo-tree)))
-		    t)
-		         ;; branch point
-		(not (or (and (or (null x) (eq x 'branch))
-			      (> (undo-tree-num-branches) 1))
-			 ;; register
-			 (and (or (null x) (eq x 'register))
-			      (setq r (undo-tree-node-register current))
-			      (undo-tree-register-data-p
-			       (setq r (registerv-data (get-register r))))
-			      (eq current (undo-tree-register-data-node r)))
-			 ;; saved state
-			 (and (or (null x) (eq x 'saved))
-			      (undo-tree-node-unmodified-p current))
-			 ))))
-    ;; update diff display, if any
-    (when diff
-      (undo-tree-visualizer-show-diff
-       (when undo-tree-visualizer-selection-mode
-	 undo-tree-visualizer-selected-node)))))
-
-
-(defun undo-tree-visualize-redo-to-x (&optional x)
-  "Redo to last branch point, register, or saved state.
-If X is the symbol `branch', redo to last branch point. If X is
-the symbol `register', redo to last register. If X is the sumbol
-`saved', redo to last saved state. If X is null, redo to first of
-these that's encountered.
-
-Interactively, a single \\[universal-argument] specifies
-`branch', a double \\[universal-argument] \\[universal-argument]
-specifies `saved', and a negative prefix argument specifies
-`register'."
-  (interactive "P")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (when (and (called-interactively-p 'any) x)
-    (setq x (prefix-numeric-value x)
-	  x (cond
-	     ((< x 0)  'register)
-	     ((<= x 4) 'branch)
-	     (t        'saved))))
-  (let ((current (if undo-tree-visualizer-selection-mode
-		     undo-tree-visualizer-selected-node
-		   (undo-tree-current buffer-undo-tree)))
-	(diff undo-tree-visualizer-diff)
-	r)
-    (undo-tree-visualizer-hide-diff)
-    (while (and (undo-tree-node-next current)
-		(or (if undo-tree-visualizer-selection-mode
-			(progn
-			  (undo-tree-visualizer-select-next)
-			  (setq current undo-tree-visualizer-selected-node))
-		      (undo-tree-visualize-redo)
-		      (setq current (undo-tree-current buffer-undo-tree)))
-		    t)
-		         ;; branch point
-		(not (or (and (or (null x) (eq x 'branch))
-			      (> (undo-tree-num-branches) 1))
-			 ;; register
-			 (and (or (null x) (eq x 'register))
-			      (setq r (undo-tree-node-register current))
-			      (undo-tree-register-data-p
-			       (setq r (registerv-data (get-register r))))
-			      (eq current (undo-tree-register-data-node r)))
-			 ;; saved state
-			 (and (or (null x) (eq x 'saved))
-			      (undo-tree-node-unmodified-p current))
-			 ))))
-    ;; update diff display, if any
-    (when diff
-      (undo-tree-visualizer-show-diff
-       (when undo-tree-visualizer-selection-mode
-	 undo-tree-visualizer-selected-node)))))
-
-
-(defun undo-tree-visualizer-toggle-timestamps ()
-  "Toggle display of time-stamps."
-  (interactive)
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (setq undo-tree-visualizer-timestamps (not undo-tree-visualizer-timestamps))
-  (setq undo-tree-visualizer-spacing (undo-tree-visualizer-calculate-spacing))
-  ;; redraw tree
-  (let ((inhibit-read-only t)) (undo-tree-draw-tree buffer-undo-tree)))
-
-
-(defun undo-tree-visualizer-scroll-left (&optional arg)
-  (interactive "p")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (scroll-left (or arg 1) t))
-
-
-(defun undo-tree-visualizer-scroll-right (&optional arg)
-  (interactive "p")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (scroll-right (or arg 1) t))
-
-
-(defun undo-tree-visualizer-scroll-up (&optional arg)
-  (interactive "P")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (if (or (and (numberp arg) (< arg 0)) (eq arg '-))
-      (undo-tree-visualizer-scroll-down arg)
-    ;; scroll up and expand newly-visible portion of tree
-    (unwind-protect
-	(scroll-up-command arg)
-      (undo-tree-expand-down
-       (nth (undo-tree-node-branch (undo-tree-current buffer-undo-tree))
-	    (undo-tree-node-next (undo-tree-current buffer-undo-tree)))))
-    ;; signal error if at eob
-    (when (and (not undo-tree-visualizer-needs-extending-down) (eobp))
-      (scroll-up))))
-
-
-(defun undo-tree-visualizer-scroll-down (&optional arg)
-  (interactive "P")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (if (or (and (numberp arg) (< arg 0)) (eq arg '-))
-      (undo-tree-visualizer-scroll-up arg)
-    ;; ensure there's enough room at top of buffer to scroll
-    (let ((scroll-lines
-	   (or arg (- (window-height) next-screen-context-lines)))
-	  (window-line (1- (line-number-at-pos (window-start)))))
-      (when (and undo-tree-visualizer-needs-extending-up
-		 (< window-line scroll-lines))
-	(let ((inhibit-read-only t))
-	  (goto-char (point-min))
-	  (undo-tree-move-up (- scroll-lines window-line)))))
-    ;; scroll down and expand newly-visible portion of tree
-    (unwind-protect
-	(scroll-down-command arg)
-      (undo-tree-expand-up
-       (undo-tree-node-previous (undo-tree-current buffer-undo-tree))))
-    ;; signal error if at bob
-    (when (and (not undo-tree-visualizer-needs-extending-down) (bobp))
-      (scroll-down))))
-
-
-
-
-;;; =====================================================================
-;;;                    Visualizer selection mode
-
-(define-minor-mode undo-tree-visualizer-selection-mode
-  "Toggle mode to select nodes in undo-tree visualizer."
-  :lighter "Select"
-  :keymap undo-tree-visualizer-selection-mode-map
-  :group undo-tree
-  (cond
-   ;; enable selection mode
-   (undo-tree-visualizer-selection-mode
-    (setq cursor-type 'box)
-    (setq undo-tree-visualizer-selected-node
-	  (undo-tree-current buffer-undo-tree))
-    ;; erase diff (if any), as initially selected node is identical to current
-    (when undo-tree-visualizer-diff
-      (let ((buff (get-buffer undo-tree-diff-buffer-name))
-	    (inhibit-read-only t))
-	(when buff (with-current-buffer buff (erase-buffer))))))
-   (t ;; disable selection mode
-    (setq cursor-type nil)
-    (setq undo-tree-visualizer-selected-node nil)
-    (goto-char (undo-tree-node-marker (undo-tree-current buffer-undo-tree)))
-    (when undo-tree-visualizer-diff (undo-tree-visualizer-update-diff)))
-   ))
-
-
-(defun undo-tree-visualizer-select-previous (&optional arg)
-  "Move to previous node."
-  (interactive "p")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (let ((node undo-tree-visualizer-selected-node))
-    (catch 'top
-      (dotimes (i (or arg 1))
-	(unless (undo-tree-node-previous node) (throw 'top t))
-	(setq node (undo-tree-node-previous node))))
-    ;; when using lazy drawing, extend tree upwards as required
-    (when undo-tree-visualizer-lazy-drawing
-      (undo-tree-expand-up undo-tree-visualizer-selected-node node))
-    ;; update diff display, if any
-    (when (and undo-tree-visualizer-diff
-	       (not (eq node undo-tree-visualizer-selected-node)))
-      (undo-tree-visualizer-update-diff node))
-    ;; move to selected node
-    (goto-char (undo-tree-node-marker node))
-    (setq undo-tree-visualizer-selected-node node)))
-
-
-(defun undo-tree-visualizer-select-next (&optional arg)
-  "Move to next node."
-  (interactive "p")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (let ((node undo-tree-visualizer-selected-node))
-    (catch 'bottom
-      (dotimes (i (or arg 1))
-	(unless (nth (undo-tree-node-branch node) (undo-tree-node-next node))
-	  (throw 'bottom t))
-	(setq node
-	      (nth (undo-tree-node-branch node) (undo-tree-node-next node)))))
-    ;; when using lazy drawing, extend tree downwards as required
-    (when undo-tree-visualizer-lazy-drawing
-      (undo-tree-expand-down undo-tree-visualizer-selected-node node))
-    ;; update diff display, if any
-    (when (and undo-tree-visualizer-diff
-	       (not (eq node undo-tree-visualizer-selected-node)))
-      (undo-tree-visualizer-update-diff node))
-    ;; move to selected node
-    (goto-char (undo-tree-node-marker node))
-    (setq undo-tree-visualizer-selected-node node)))
-
-
-(defun undo-tree-visualizer-select-right (&optional arg)
-  "Move right to a sibling node."
-  (interactive "p")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (let ((node undo-tree-visualizer-selected-node)
-	end)
-    (goto-char (undo-tree-node-marker undo-tree-visualizer-selected-node))
-    (setq end (line-end-position))
-    (catch 'end
-      (dotimes (i arg)
-	(while (or (null node) (eq node undo-tree-visualizer-selected-node))
-	  (forward-char)
-	  (setq node (get-text-property (point) 'undo-tree-node))
-	  (when (= (point) end) (throw 'end t)))))
-    (goto-char (undo-tree-node-marker
-		(or node undo-tree-visualizer-selected-node)))
-    (when (and undo-tree-visualizer-diff node
-	       (not (eq node undo-tree-visualizer-selected-node)))
-      (undo-tree-visualizer-update-diff node))
-    (when node (setq undo-tree-visualizer-selected-node node))))
-
-
-(defun undo-tree-visualizer-select-left (&optional arg)
-  "Move left to a sibling node."
-  (interactive "p")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (let ((node (get-text-property (point) 'undo-tree-node))
-	beg)
-    (goto-char (undo-tree-node-marker undo-tree-visualizer-selected-node))
-    (setq beg (line-beginning-position))
-    (catch 'beg
-      (dotimes (i arg)
-	(while (or (null node) (eq node undo-tree-visualizer-selected-node))
-	  (backward-char)
-	  (setq node (get-text-property (point) 'undo-tree-node))
-	  (when (= (point) beg) (throw 'beg t)))))
-    (goto-char (undo-tree-node-marker
-		(or node undo-tree-visualizer-selected-node)))
-    (when (and undo-tree-visualizer-diff node
-	       (not (eq node undo-tree-visualizer-selected-node)))
-      (undo-tree-visualizer-update-diff node))
-    (when node (setq undo-tree-visualizer-selected-node node))))
-
-
-(defun undo-tree-visualizer-select (pos)
-  (let ((node (get-text-property pos 'undo-tree-node)))
-    (when node
-      ;; select node at POS
-      (goto-char (undo-tree-node-marker node))
-      ;; when using lazy drawing, extend tree up and down as required
-      (when undo-tree-visualizer-lazy-drawing
-	(undo-tree-expand-up undo-tree-visualizer-selected-node node)
-	(undo-tree-expand-down undo-tree-visualizer-selected-node node))
-      ;; update diff display, if any
-      (when (and undo-tree-visualizer-diff
-		 (not (eq node undo-tree-visualizer-selected-node)))
-	(undo-tree-visualizer-update-diff node))
-      ;; update selected node
-      (setq undo-tree-visualizer-selected-node node)
-      )))
-
-
-(defun undo-tree-visualizer-mouse-select (pos)
-  "Select undo tree node at mouse event POS."
-  (interactive "@e")
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (undo-tree-visualizer-select (event-start (nth 1 pos))))
-
-
-
-
-;;; =====================================================================
-;;;                      Visualizer diff display
-
-(defun undo-tree-visualizer-toggle-diff ()
-  "Toggle diff display in undo-tree visualizer."
-  (interactive)
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (if undo-tree-visualizer-diff
-      (undo-tree-visualizer-hide-diff)
-    (undo-tree-visualizer-show-diff)))
-
-
-(defun undo-tree-visualizer-selection-toggle-diff ()
-  "Toggle diff display in undo-tree visualizer selection mode."
-  (interactive)
-  (unless (eq major-mode 'undo-tree-visualizer-mode)
-    (user-error "Undo-tree mode not enabled in buffer"))
-  (if undo-tree-visualizer-diff
-      (undo-tree-visualizer-hide-diff)
-    (let ((node (get-text-property (point) 'undo-tree-node)))
-      (when node (undo-tree-visualizer-show-diff node)))))
-
-
-(defun undo-tree-visualizer-show-diff (&optional node)
-  ;; show visualizer diff display
-  (setq undo-tree-visualizer-diff t)
-  (let ((buff (with-current-buffer undo-tree-visualizer-parent-buffer
-		(undo-tree-diff node)))
-	(display-buffer-mark-dedicated 'soft)
-	win)
-    (setq win (split-window))
-    (set-window-buffer win buff)
-    (shrink-window-if-larger-than-buffer win)))
-
-
-(defun undo-tree-visualizer-hide-diff ()
-  ;; hide visualizer diff display
-  (setq undo-tree-visualizer-diff nil)
-  (let ((win (get-buffer-window undo-tree-diff-buffer-name)))
-    (when win (with-selected-window win (kill-buffer-and-window)))))
-
-
-(defun undo-tree-diff (&optional node)
-  ;; Create diff between NODE and current state (or previous state and current
-  ;; state, if NODE is null). Returns buffer containing diff.
-  (let (tmpfile buff)
-    ;; generate diff
-    (let ((undo-tree-inhibit-kill-visualizer t)
-	  (current (undo-tree-current buffer-undo-tree)))
-      (undo-tree-set (or node (undo-tree-node-previous current) current)
-		     'preserve-timestamps)
-      (setq tmpfile (diff-file-local-copy (current-buffer)))
-      (undo-tree-set current 'preserve-timestamps))
-    (setq buff (diff-no-select
-		tmpfile (current-buffer) nil 'noasync
-		(get-buffer-create undo-tree-diff-buffer-name)))
-    ;; delete process messages and useless headers from diff buffer
-    (let ((inhibit-read-only t))
-      (with-current-buffer buff
-	(goto-char (point-min))
-	(delete-region (point) (1+ (line-end-position 3)))
-	(goto-char (point-max))
-	(forward-line -2)
-	(delete-region (point) (point-max))
-	(setq cursor-type nil)
-	(setq buffer-read-only t)))
-    buff))
-
-
-(defun undo-tree-visualizer-update-diff (&optional node)
-  ;; update visualizer diff display to show diff between current state and
-  ;; NODE (or previous state, if NODE is null)
-  (with-current-buffer undo-tree-visualizer-parent-buffer
-    (undo-tree-diff node))
-  (let ((win (get-buffer-window undo-tree-diff-buffer-name)))
-    (when win
-      (balance-windows)
-      (shrink-window-if-larger-than-buffer win))))
-
-
-
-(provide 'undo-tree)
-
-;;; undo-tree.el ends here
.emacs.d/elpa/undo-tree-20170706.246/undo-tree.elc
Binary file
.emacs.d/elpa/which-key-20170817.1107/which-key-autoloads.el
@@ -1,141 +0,0 @@
-;;; which-key-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil "which-key" "which-key.el" (22968 11435 249641
-;;;;;;  77000))
-;;; Generated autoloads from which-key.el
-
-(defvar which-key-mode nil "\
-Non-nil if Which-Key mode is enabled.
-See the `which-key-mode' command
-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 `which-key-mode'.")
-
-(custom-autoload 'which-key-mode "which-key" nil)
-
-(autoload 'which-key-mode "which-key" "\
-Toggle which-key-mode.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'which-key-setup-side-window-right "which-key" "\
-Apply suggested settings for side-window that opens on right.
-
-\(fn)" t nil)
-
-(autoload 'which-key-setup-side-window-right-bottom "which-key" "\
-Apply suggested settings for side-window that opens on right
-if there is space and the bottom otherwise.
-
-\(fn)" t nil)
-
-(autoload 'which-key-setup-side-window-bottom "which-key" "\
-Apply suggested settings for side-window that opens on
-bottom.
-
-\(fn)" t nil)
-
-(autoload 'which-key-setup-minibuffer "which-key" "\
-Apply suggested settings for minibuffer.
-
-\(fn)" t nil)
-
-(autoload 'which-key-add-key-based-replacements "which-key" "\
-Replace the description of KEY-SEQUENCE with REPLACEMENT.
-KEY-SEQUENCE is a string suitable for use in `kbd'. REPLACEMENT
-may either be a string, as in
-
-\(which-key-add-key-based-replacements \"C-x 1\" \"maximize\")
-
-a cons of two strings as in
-
-\(which-key-add-key-based-replacements \"C-x 8\"
-                                        '(\"unicode\" . \"Unicode keys\"))
-
-or a function that takes a (KEY . BINDING) cons and returns a
-replacement.
-
-In the second case, the second string is used to provide a longer
-name for the keys under a prefix.
-
-MORE allows you to specifcy additional KEY REPLACEMENT pairs.  All
-replacements are added to
-`which-key-key-based-description-replacement-alist'.
-
-\(fn KEY-SEQUENCE REPLACEMENT &rest MORE)" nil nil)
-
-(autoload 'which-key-add-major-mode-key-based-replacements "which-key" "\
-Functions like `which-key-add-key-based-replacements'.
-The difference is that MODE specifies the `major-mode' that must
-be active for KEY-SEQUENCE and REPLACEMENT (MORE contains
-addition KEY-SEQUENCE REPLACEMENT pairs) to apply.
-
-\(fn MODE KEY-SEQUENCE REPLACEMENT &rest MORE)" nil nil)
-
-(autoload 'which-key-reload-key-sequence "which-key" "\
-Simulate entering the key sequence KEY-SEQ.
-KEY-SEQ should be a list of events as produced by
-`listify-key-sequence'. Any prefix arguments that were used are
-reapplied to the new key sequence.
-
-\(fn KEY-SEQ)" nil nil)
-
-(autoload 'which-key-show-standard-help "which-key" "\
-Call the command in `which-key--prefix-help-cmd-backup'.
-Usually this is `describe-prefix-bindings'.
-
-\(fn)" t nil)
-
-(autoload 'which-key-show-next-page-no-cycle "which-key" "\
-Show next page of keys unless on the last page, in which case
-call `which-key-show-standard-help'.
-
-\(fn)" t nil)
-
-(autoload 'which-key-show-previous-page-no-cycle "which-key" "\
-Show previous page of keys unless on the first page, in which
-case do nothing.
-
-\(fn)" t nil)
-
-(autoload 'which-key-show-next-page-cycle "which-key" "\
-Show the next page of keys, cycling from end to beginning
-after last page.
-
-\(fn)" t nil)
-
-(autoload 'which-key-show-previous-page-cycle "which-key" "\
-Show the previous page of keys, cycling from beginning to end
-after first page.
-
-\(fn)" t nil)
-
-(autoload 'which-key-show-top-level "which-key" "\
-Show top-level bindings.
-
-\(fn)" t nil)
-
-(autoload 'which-key-undo-key "which-key" "\
-Undo last keypress and force which-key update.
-
-\(fn)" t nil)
-
-(autoload 'which-key-C-h-dispatch "which-key" "\
-Dispatch C-h commands by looking up key in
-`which-key-C-h-map'. This command is always accessible (from any
-prefix) if `which-key-use-C-h-commands' is non nil.
-
-\(fn)" t nil)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; which-key-autoloads.el ends here
.emacs.d/elpa/which-key-20170817.1107/which-key-pkg.el
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "which-key" "20170817.1107" "Display available keybindings in popup" '((emacs "24.4")) :commit "6d2e17c949ff7bfebfe0b0878a93d94b31585031" :url "https://github.com/justbur/emacs-which-key")
.emacs.d/elpa/which-key-20170817.1107/which-key.el
@@ -1,2356 +0,0 @@
-;;; which-key.el --- Display available keybindings in popup  -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2017  Free Software Foundation, Inc.
-
-;; Author: Justin Burkett <justin@burkett.cc>
-;; Maintainer: Justin Burkett <justin@burkett.cc>
-;; URL: https://github.com/justbur/emacs-which-key
-;; Package-Version: 20170817.1107
-;; Version: 3.0.2
-;; Keywords:
-;; Package-Requires: ((emacs "24.4"))
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; which-key provides the minor mode which-key-mode for Emacs. The mode displays
-;; the key bindings following your currently entered incomplete command (a
-;; prefix) in a popup. For example, after enabling the minor mode if you enter
-;; C-x and wait for the default of 1 second the minibuffer will expand with all
-;; of the available key bindings that follow C-x (or as many as space allows
-;; given your settings). This includes prefixes like C-x 8 which are shown in a
-;; different face. Screenshots of what the popup will look like along with
-;; information about additional features can be found at
-;; https://github.com/justbur/emacs-which-key.
-;;
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'button)
-(require 'regexp-opt)
-
-;; For compiler
-(defvar evil-operator-shortcut-map)
-(defvar evil-operator-state-map)
-(defvar evil-motion-state-map)
-(defvar golden-ratio-mode)
-(declare-function evil-get-command-property "ext:evil-common.el")
-
-;;; Options
-
-(defgroup which-key nil
-  "Customization options for which-key-mode"
-  :group 'help
-  :prefix "which-key-")
-
-(defcustom which-key-idle-delay 1.0
-  "Delay (in seconds) for which-key buffer to popup. A value of zero
-might lead to issues, so a non-zero value is recommended
-(see https://github.com/justbur/emacs-which-key/issues/134)."
-  :group 'which-key
-  :type 'float)
-
-(defcustom which-key-idle-secondary-delay nil
-  "Once the which-key buffer shows once for a key sequence reduce
-the idle time to this amount (in seconds). This makes it possible
-to shorten the delay for subsequent popups in the same key
-sequence. The default is for this value to be nil, which disables
-this behavior."
-  :group 'which-key
-  :type 'float)
-
-(defcustom which-key-echo-keystrokes (if (and echo-keystrokes
-                                              (> (+ echo-keystrokes 0.01)
-                                                 which-key-idle-delay))
-                                         (/ (float which-key-idle-delay) 4)
-                                       echo-keystrokes)
-  "Value to use for `echo-keystrokes'.
-This only applies if `which-key-popup-type' is minibuffer or
-`which-key-show-prefix' is echo. It needs to be less than
-`which-key-idle-delay' or else the keystroke echo will erase the
-which-key popup."
-  :group 'which-key
-  :type 'float)
-
-(defcustom which-key-max-description-length 27
-  "Truncate the description of keys to this length.
-Also adds \"..\". If nil, disable any truncation."
-  :group 'which-key
-  :type 'integer)
-
-(defcustom which-key-add-column-padding 0
-  "Additional padding (number of spaces) to add to the left of
-each key column."
-  :group 'which-key
-  :type 'integer)
-
-(defcustom which-key-unicode-correction 3
-  "Correction for wide unicode characters.
-Since we measure width in terms of the number of characters,
-Unicode characters that are wider than ASCII characters throw off
-the calculation for available width in the which-key buffer.  This
-variable allows you to adjust for the wide unicode characters by
-artificially reducing the available width in the buffer.
-
-The default of 3 means allow for the total extra width
-contributed by any wide unicode characters to be up to one
-additional ASCII character in the which-key buffer.  Increase this
-number if you are seeing charaters get cutoff on the right side
-of the which-key popup."
-  :group 'which-key
-  :type 'integer)
-
-(defcustom which-key-dont-use-unicode nil
-  "If non-nil, don't use any unicode characters in default setup."
-  :group 'which-key
-  :type 'integer)
-
-(defcustom which-key-separator
-  (if which-key-dont-use-unicode " : " " → ")
-  "Separator to use between key and description. Default is \" →
-\", unless `which-key-dont-use-unicode' is non nil, in which case
-the default is \" : \"."
-  :group 'which-key
-  :type 'string)
-
-(defcustom which-key-prefix-prefix "+"
-  "String to insert in front of prefix commands (i.e., commands
-that represent a sub-map). Default is \"+\"."
-  :group 'which-key
-  :type 'string)
-
-(defcustom which-key-compute-remaps nil
-  "If non-nil, show remapped command if a command has been
-remapped given the currently active keymaps."
-  :group 'which-key
-  :type 'boolean)
-
-(defvar which-key-key-replacement-alist nil)
-(make-obsolete-variable 'which-key-key-replacement-alist
-                        'which-key-replacement-alist "2016-11-21")
-(defvar which-key-description-replacement-alist nil)
-(make-obsolete-variable 'which-key-description-replacement-alist
-                        'which-key-replacement-alist "2016-11-21")
-(defvar which-key-key-based-description-replacement-alist nil)
-(make-obsolete-variable 'which-key-key-based-description-replacement-alist
-                        'which-key-replacement-alist "2016-11-21")
-
-(defcustom which-key-replacement-alist
-  (delq nil
-        `(((nil . "Prefix Command") . (nil . "prefix"))
-          ((nil . "\\`\\?\\?\\'") . (nil . "lambda"))
-          ((nil . "which-key-show-next-page-no-cycle") . (nil . "wk next pg"))
-          (("<\\([[:alnum:]-]+\\)>") . ("\\1"))
-          ,@(unless which-key-dont-use-unicode
-              '((("left") . ("←"))
-                (("right") . ("→"))))))
-  "Association list to determine how to manipulate descriptions
-of key bindings in the which-key popup. Each element of the list
-is a nested cons cell with the format
-
-\(MATCH CONS . REPLACEMENT\).
-
-The MATCH CONS determines when a replacement should occur and
-REPLACEMENT determines how the replacement should occur. Each may
-have the format \(KEY REGEXP . BINDING REGEXP\). For the
-replacement to apply the key binding must match both the KEY
-REGEXP and the BINDING REGEXP. A value of nil in either position
-can be used to match every possibility. The replacement is
-performed by using `replace-regexp-in-string' on the KEY REGEXP
-from the MATCH CONS and REPLACEMENT when it is a cons cell, and
-then similarly for the BINDING REGEXP. A nil value in the BINDING
-REGEXP position cancels the replacement. For example, the entry
-
-\(\(nil . \"Prefix Command\"\) . \(nil . \"prefix\"\)\)
-
-matches any binding with the descriptions \"Prefix Command\" and
-replaces the description with \"prefix\", ignoring the
-corresponding key.
-
-REPLACEMENT may also be a function taking a cons cell
-\(KEY . BINDING\) and producing a new corresponding cons cell.
-
-If REPLACEMENT is anything other than a cons cell \(and non nil\)
-the key binding is ignored by which-key.
-
-Finally, you can multiple replacements to occur for a given key
-binding by setting `which-key-allow-multiple-replacements' to a
-non-nil value."
-  :group 'which-key
-  :type '(alist :key-type (cons (choice regexp nil)
-                                (choice regexp nil))
-                :value-type (cons (choice string nil)
-                                  (choice string nil))))
-
-(when (bound-and-true-p which-key-key-replacement-alist)
-  (mapc
-   (lambda (repl)
-     (push (cons (cons (car repl) nil) (cons (cdr repl) nil))
-           which-key-replacement-alist))
-   which-key-key-replacement-alist))
-(when (bound-and-true-p which-key-description-replacement-alist)
-  (mapc
-   (lambda (repl)
-     (push (cons (cons nil (car repl)) (cons nil (cdr repl)))
-           which-key-replacement-alist))
-   which-key-description-replacement-alist))
-
-(defcustom which-key-allow-multiple-replacements nil
-  "Allow a key binding to match and be modified by multiple
-elements in `which-key-replacement-alist' if non-nil. When nil,
-only the first match is used to perform replacements from
-`which-key-replacement-alist'."
-  :group 'which-key
-  :type 'boolean)
-
-(defcustom which-key-highlighted-command-list '()
-  "A list of strings and/or cons cells used to highlight certain
-commands. If the element is a string, assume it is a regexp
-pattern for matching command names and use
-`which-key-highlighted-command-face' for any matching names. If
-the element is a cons cell, it should take the form (regexp .
-face to apply)."
-  :group 'which-key
-  :type  '(repeat (choice string (cons regexp face))))
-
-(defcustom which-key-special-keys '()
-  "These keys will automatically be truncated to one character
-and have `which-key-special-key-face' applied to them. This is
-disabled by default. Try this to see the effect.
-
-\(setq which-key-special-keys '(\"SPC\" \"TAB\" \"RET\" \"ESC\" \"DEL\")\)"
-  :group 'which-key
-  :type '(repeat string))
-
-(defcustom which-key-buffer-name " *which-key*"
-  "Name of which-key buffer."
-  :group 'which-key
-  :type 'string)
-
-(defcustom which-key-show-prefix 'echo
-  "Whether to and where to display the current prefix sequence.
-Possible choices are echo for echo area (the default), left, top
-and nil. Nil turns the feature off."
-  :group 'which-key
-  :type '(radio (const :tag "Left of the keys" left)
-                (const :tag "In the first line" top)
-                (const :tag "In the last line" bottom)
-                (const :tag "In the echo area" echo)
-                (const :tag "In the mode-line" mode-line)
-                (const :tag "Hide" nil)))
-
-(defcustom which-key-popup-type 'side-window
-  "Supported types are minibuffer, side-window, frame, and custom."
-  :group 'which-key
-  :type '(radio (const :tag "Show in minibuffer" minibuffer)
-                (const :tag "Show in side window" side-window)
-                (const :tag "Show in popup frame" frame)
-                (const :tag "Use your custom display functions" custom)))
-
-(defcustom which-key-min-display-lines 1
-  "The minimum number of horizontal lines to display in the
-  which-key buffer."
-  :group 'which-key
-  :type 'integer)
-
-(defcustom which-key-max-display-columns nil
-  "The maximum number of columns to display in the which-key
-buffer. nil means don't impose a maximum."
-  :group 'which-key
-  :type 'integer)
-
-(defcustom which-key-side-window-location 'bottom
-  "Location of which-key popup when `which-key-popup-type' is side-window.
-Should be one of top, bottom, left or right. You can also specify
-a list of two locations, like (right bottom). In this case, the
-first location is tried. If there is not enough room, the second
-location is tried."
-  :group 'which-key
-  :type '(radio (const right)
-                (const bottom)
-                (const left)
-                (const top)
-                (const (right bottom))
-                (const (bottom right))))
-
-(defcustom which-key-side-window-slot 0
-  "The `slot' to use for `display-buffer-in-side-window' when
-`which-key-popup-type' is 'side-window. Quoting from the
-docstring of `display-buffer-in-side-window',
-
-‘slot’ if non-nil, specifies the window slot where to display
-  BUFFER.  A value of zero or nil means use the middle slot on
-  the specified side.  A negative value means use a slot
-  preceding (that is, above or on the left of) the middle slot.
-  A positive value means use a slot following (that is, below or
-  on the right of) the middle slot.  The default is zero."
-  :group 'which-key
-  :type 'integer)
-
-(defcustom which-key-side-window-max-width 0.333
-  "Maximum width of which-key popup when type is side-window and
-location is left or right.
-This variable can also be a number between 0 and 1. In that case, it denotes
-a percentage out of the frame's width."
-  :group 'which-key
-  :type 'float)
-
-(defcustom which-key-side-window-max-height 0.25
-  "Maximum height of which-key popup when type is side-window and
-location is top or bottom.
-This variable can also be a number between 0 and 1. In that case, it denotes
-a percentage out of the frame's height."
-  :group 'which-key
-  :type 'float)
-
-(defcustom which-key-frame-max-width 60
-  "Maximum width of which-key popup when type is frame."
-  :group 'which-key
-  :type 'integer)
-
-(defcustom which-key-frame-max-height 20
-  "Maximum height of which-key popup when type is frame."
-  :group 'which-key
-  :type 'integer)
-
-(defcustom which-key-allow-imprecise-window-fit nil
-  "If non-nil allow which-key to use a less intensive method of
-fitting the popup window to the buffer. If you are noticing lag
-when the which-key popup displays turning this on may help.
-
-See https://github.com/justbur/emacs-which-key/issues/130"
-  :group 'which-key
-  :type 'boolean)
-
-(defcustom which-key-show-remaining-keys nil
-  "Show remaining keys in last slot, when keys are hidden."
-  :group 'which-key
-  :type '(radio (const :tag "Yes" t)
-                (const :tag "No" nil)))
-
-(defcustom which-key-sort-order 'which-key-key-order
-  "If nil, do not resort the output from
-`describe-buffer-bindings' which groups by mode. Ordering options
-are
-
-1. `which-key-key-order': by key (default)
-2. `which-key-key-order-alpha': by key using alphabetical order
-3. `which-key-description-order': by description
-4. `which-key-prefix-then-key-order': prefix (no prefix first) then key
-5. `which-key-local-then-key-order': local binding then key
-
-See the README and the docstrings for those functions for more
-information."
-  :group 'which-key
-  :type '(choice (function-item which-key-key-order)
-                 (function-item which-key-key-order-alpha)
-                 (function-item which-key-description-order)
-                 (function-item which-key-prefix-then-key-order)
-                 (function-item which-key-local-then-key-order)))
-
-(defcustom which-key-sort-uppercase-first t
-  "If non-nil, uppercase comes before lowercase in sorting
-function chosen in `which-key-sort-order'. Otherwise, the order
-is reversed."
-  :group 'which-key
-  :type 'boolean)
-
-(defcustom which-key-paging-prefixes '()
-  "Enable paging for these prefixes."
-  :group 'which-key
-  :type '(repeat string))
-
-(defcustom which-key-paging-key "<f5>"
-  "Key to use for changing pages. Bound after each of the
-prefixes in `which-key-paging-prefixes'"
-  :group 'which-key
-  :type 'string)
-
-;; (defcustom which-key-undo-key nil
-;;   "Key (string) to use for undoing keypresses. Bound recursively
-;; in each of the maps in `which-key-undo-keymaps'."
-;;   :group 'which-key
-;;   :type 'string)
-
-;; (defcustom which-key-undo-keymaps '()
-;;   "Keymaps in which to bind `which-key-undo-key'"
-;;   :group 'which-key
-;;   :type '(repeat symbol))
-
-(defcustom which-key-use-C-h-commands t
-  "Use C-h for paging if non-nil. Normally C-h after a prefix
-  calls `describe-prefix-bindings'. This changes that command to
-  a which-key paging command when which-key-mode is active."
-  :group 'which-key
-  :type 'boolean)
-
-(defcustom which-key-is-verbose nil
-  "Whether to warn about potential mistakes in configuration."
-  :group 'which-key
-  :type 'boolean)
-
-(defvar which-key-C-h-map
-  (let ((map (make-sparse-keymap)))
-    (dolist (bind '(("\C-a" . which-key-abort)
-                    ("a" . which-key-abort)
-                    ("\C-h" . which-key-show-standard-help)
-                    ("h" . which-key-show-standard-help)
-                    ("\C-n" . which-key-show-next-page-cycle)
-                    ("n" . which-key-show-next-page-cycle)
-                    ("\C-p" . which-key-show-previous-page-cycle)
-                    ("p" . which-key-show-previous-page-cycle)
-                    ("\C-u" . which-key-undo-key)
-                    ("u" . which-key-undo-key)))
-      (define-key map (car bind) (cdr bind)))
-    map)
-  "Keymap for C-h commands.")
-
-(defvar which-key--paging-functions '(which-key-C-h-dispatch
-                                      which-key-turn-page
-                                      which-key-show-next-page-cycle
-                                      which-key-show-next-page-no-cycle
-                                      which-key-show-previous-page-cycle
-                                      which-key-show-previous-page-no-cycle
-                                      which-key-undo-key
-                                      which-key-undo))
-
-(defcustom which-key-hide-alt-key-translations t
-  "Hide key translations using Alt key if non nil.
-These translations are not relevant most of the times since a lot
-of terminals issue META modifier for the Alt key.
-
-See http://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html"
-  :group 'which-key
-  :type 'boolean)
-
-(defcustom which-key-delay-functions nil
-  "A list of functions that may decide whether to delay the
-which-key popup based on the current incomplete key
-sequence. Each function in the list is run with two arguments,
-the current key sequence as produced by `key-description' and the
-length of the key sequence. If the popup should be delayed based
-on that key sequence, the function should return the delay time
-in seconds. Returning nil means no delay. The first function in
-this list to return a value is the value that is used.
-
-The delay time is effectively added to the normal
-`which-key-idle-delay'."
-  :group 'which-key
-  :type '(repeat function))
-
-(defcustom which-key-allow-regexps nil
-  "A list of regexp strings to use to filter key sequences. When
-non-nil, for a key sequence to trigger the which-key popup it
-must match one of the regexps in this list. The format of the key
-sequences is what is produced by `key-description'."
-  :group 'which-key
-  :type '(repeat regexp))
-
-(defcustom which-key-inhibit-regexps nil
-  "Similar to `which-key-allow-regexps', a list of regexp strings
-to use to filter key sequences. When non-nil, for a key sequence
-to trigger the which-key popup it cannot match one of the regexps
-in this list. The format of the key sequences is what is produced
-by `key-description'."
-  :group 'which-key
-  :type '(repeat regexp))
-
-(defcustom which-key-show-transient-maps nil
-  "Show keymaps created by `set-transient-map' when applicable.
-
-More specifically, detect when `overriding-terminal-local-map' is
-set (this is the keymap used by `set-transient-map') and display
-it."
-  :group 'which-key
-  :type 'boolean)
-
-;; Hooks
-(defcustom which-key-init-buffer-hook '()
-  "Hook run when which-key buffer is initialized."
-  :group 'which-key
-  :type 'hook)
-
-;;;; Faces
-
-(defgroup which-key-faces nil
-  "Faces for which-key-mode"
-  :group 'which-key
-  :prefix "which-key-")
-
-(defface which-key-key-face
-  '((t . (:inherit font-lock-constant-face)))
-  "Face for which-key keys"
-  :group 'which-key-faces)
-
-(defface which-key-separator-face
-  '((t . (:inherit font-lock-comment-face)))
-  "Face for the separator (default separator is an arrow)"
-  :group 'which-key-faces)
-
-(defface which-key-note-face
-  '((t . (:inherit which-key-separator-face)))
-  "Face for notes or hints occasionally provided"
-  :group 'which-key-faces)
-
-(defface which-key-command-description-face
-  '((t . (:inherit font-lock-function-name-face)))
-  "Face for the key description when it is a command"
-  :group 'which-key-faces)
-
-(defface which-key-local-map-description-face
-  '((t . (:inherit which-key-command-description-face)))
-  "Face for the key description when it is found in `current-local-map'"
-  :group 'which-key-faces)
-
-(defface which-key-highlighted-command-face
-  '((t . (:inherit which-key-command-description-face :underline t)))
-  "Default face for the command description when it is a command
-and it matches a string in `which-key-highlighted-command-list'."
-  :group 'which-key-faces)
-
-(defface which-key-group-description-face
-  '((t . (:inherit font-lock-keyword-face)))
-  "Face for the key description when it is a group or prefix"
-  :group 'which-key-faces)
-
-(defface which-key-special-key-face
-  '((t . (:inherit which-key-key-face :inverse-video t :weight bold)))
-  "Face for special keys (SPC, TAB, RET)"
-  :group 'which-key-faces)
-
-;;;; Custom popup
-
-(defcustom which-key-custom-popup-max-dimensions-function nil
-  "Variable to hold a custom max-dimensions function.
-Will be passed the width of the active window and is expected to
-return the maximum height in lines and width in characters of the
-which-key popup in the form a cons cell (height . width)."
-  :group 'which-key
-  :type 'function)
-
-(defcustom which-key-custom-hide-popup-function nil
-  "Variable to hold a custom hide-popup function.
-It takes no arguments and the return value is ignored."
-  :group 'which-key
-  :type 'function)
-
-(defcustom which-key-custom-show-popup-function nil
-  "Variable to hold a custom show-popup function.
-Will be passed the required dimensions in the form (height .
-width) in lines and characters respectively.  The return value is
-ignored."
-  :group 'which-key
-  :type 'function)
-
-(defcustom which-key-lighter " WK"
-  "Minor mode lighter to use in the mode-line."
-  :group 'which-key
-  :type 'string)
-
-(defvar which-key-inhibit nil
-  "Prevent which-key from popping up momentarily by setting this
-to a non-nil value for the execution of a command. Like this
-
-\(let \(\(which-key-inhibit t\)\)
-...\)")
-
-(defvar which-key-keymap-history nil
-  "History of keymap selections in functions like
-`which-key-show-keymap'.")
-
-;;; Internal Vars
-
-(defvar which-key--buffer nil
-  "Internal: Holds reference to which-key buffer.")
-(defvar which-key--timer nil
-  "Internal: Holds reference to open window timer.")
-(defvar which-key--secondary-timer-active nil
-  "Internal: Non-nil if the secondary timer is active.")
-(defvar which-key--paging-timer nil
-  "Internal: Holds reference to timer for paging.")
-(defvar which-key--frame nil
-  "Internal: Holds reference to which-key frame.
-Used when `which-key-popup-type' is frame.")
-(defvar which-key--echo-keystrokes-backup nil
-  "Internal: Backup the initial value of `echo-keystrokes'.")
-(defvar which-key--prefix-help-cmd-backup nil
-  "Internal: Backup the value of `prefix-help-command'.")
-(defvar which-key--pages-plist nil
-  "Internal: Holds page objects")
-(defvar which-key--current-prefix nil
-  "Internal: Holds current prefix")
-(defvar which-key--current-page-n nil
-  "Internal: Current pages of showing buffer. Nil means no buffer
-showing.")
-(defvar which-key--on-last-page nil
-  "Internal: Non-nil if showing last page.")
-(defvar which-key--last-try-2-loc nil
-  "Internal: Last location of side-window when two locations
-used.")
-(defvar which-key--multiple-locations nil)
-(defvar which-key--using-top-level nil)
-(defvar which-key--using-show-keymap nil)
-(defvar which-key--using-show-operator-keymap nil)
-(defvar which-key--inhibit-next-operator-popup nil)
-(defvar which-key--current-show-keymap-name nil)
-(defvar which-key--prior-show-keymap-args nil)
-(defvar which-key--previous-frame-size nil)
-(defvar which-key--prefix-title-alist nil)
-(defvar which-key--debug nil)
-
-(make-obsolete-variable 'which-key-prefix-name-alist nil "2016-10-05")
-(make-obsolete-variable 'which-key-prefix-title-alist nil "2016-10-05")
-
-;;; Third-party library support
-;;;; Evil
-
-(defcustom which-key-allow-evil-operators (boundp 'evil-this-operator)
-  "Allow popup to show for evil operators. The popup is normally
-  inhibited in the middle of commands, but setting this to
-  non-nil will override this behavior for evil operators."
-  :group 'which-key
-  :type 'boolean)
-
-(defcustom which-key-show-operator-state-maps nil
-  "Experimental: Try to show the right keys following an evil
-command that reads a motion, such as \"y\", \"d\" and \"c\" from
-normal state. This is experimental, because there might be some
-valid keys missing and it might be showing some invalid keys."
-  :group 'which-key
-  :type 'boolean)
-
-;;;;; God-mode
-
-(defvar which-key--god-mode-support-enabled nil
-  "Support god-mode if non-nil. This is experimental,
-so you need to explicitly opt-in for now. Please report any
-problems at github.")
-
-(defvar which-key--god-mode-key-string nil
-  "Holds key string to use for god-mode support.")
-
-(defadvice god-mode-lookup-command
-    (around which-key--god-mode-lookup-command-advice disable)
-  (setq which-key--god-mode-key-string (ad-get-arg 0))
-  (unwind-protect
-      ad-do-it
-    (when (bound-and-true-p which-key-mode)
-      (which-key--hide-popup))))
-
-(defun which-key-enable-god-mode-support (&optional disable)
-  "Enable support for god-mode if non-nil. This is experimental,
-so you need to explicitly opt-in for now. Please report any
-problems at github. If DISABLE is non-nil disable support."
-  (interactive "P")
-  (setq which-key--god-mode-support-enabled (null disable))
-  (if disable
-      (ad-disable-advice
-       'god-mode-lookup-command
-       'around 'which-key--god-mode-lookup-command-advice)
-    (ad-enable-advice
-     'god-mode-lookup-command
-     'around 'which-key--god-mode-lookup-command-advice))
-  (ad-activate 'god-mode-lookup-command))
-
-;;; Mode
-
-;;;###autoload
-(define-minor-mode which-key-mode
-  "Toggle which-key-mode."
-  :global t
-  :lighter which-key-lighter
-  :keymap (let ((map (make-sparse-keymap)))
-            (mapc
-             (lambda (prefix)
-               (define-key map
-                 (kbd (concat prefix " " which-key-paging-key))
-                 #'which-key-C-h-dispatch))
-             which-key-paging-prefixes)
-            map)
-  (if which-key-mode
-      (progn
-        (setq which-key--echo-keystrokes-backup echo-keystrokes)
-        (when (or (eq which-key-show-prefix 'echo)
-                  (eq which-key-popup-type 'minibuffer))
-          (which-key--setup-echo-keystrokes))
-        (unless (member prefix-help-command which-key--paging-functions)
-          (setq which-key--prefix-help-cmd-backup prefix-help-command))
-        (when which-key-use-C-h-commands
-          (setq prefix-help-command #'which-key-C-h-dispatch))
-        (when which-key-show-remaining-keys
-          (add-hook 'pre-command-hook #'which-key--lighter-restore))
-        (add-hook 'pre-command-hook #'which-key--hide-popup)
-        (add-hook 'focus-out-hook #'which-key--stop-timer)
-        (add-hook 'focus-in-hook #'which-key--start-timer)
-        (add-hook 'window-configuration-change-hook
-                  'which-key--hide-popup-on-frame-size-change)
-        (which-key--start-timer))
-    (setq echo-keystrokes which-key--echo-keystrokes-backup)
-    (when which-key--prefix-help-cmd-backup
-      (setq prefix-help-command which-key--prefix-help-cmd-backup))
-    (when which-key-show-remaining-keys
-      (remove-hook 'pre-command-hook #'which-key--lighter-restore))
-    (remove-hook 'pre-command-hook #'which-key--hide-popup)
-    (remove-hook 'focus-out-hook #'which-key--stop-timer)
-    (remove-hook 'focus-in-hook #'which-key--start-timer)
-    (remove-hook 'window-configuration-change-hook
-                 'which-key--hide-popup-on-frame-size-change)
-    (which-key--stop-timer)))
-
-(defun which-key--init-buffer ()
-  "Initialize which-key buffer"
-  (unless (buffer-live-p which-key--buffer)
-    (setq which-key--buffer (get-buffer-create which-key-buffer-name))
-    (with-current-buffer which-key--buffer
-      ;; suppress confusing minibuffer message
-      (let (message-log-max)
-        (toggle-truncate-lines 1)
-        (message ""))
-      (setq-local cursor-type nil)
-      (setq-local cursor-in-non-selected-windows nil)
-      (setq-local mode-line-format nil)
-      (setq-local word-wrap nil)
-      (setq-local show-trailing-whitespace nil)
-      (run-hooks 'which-key-init-buffer-hook))))
-
-(defun which-key--setup-echo-keystrokes ()
-  "Reduce `echo-keystrokes' if necessary (it will interfere if
-it's set too high)."
-  (when (and echo-keystrokes
-             (> (abs (- echo-keystrokes which-key-echo-keystrokes)) 0.000001))
-    (if (> which-key-idle-delay which-key-echo-keystrokes)
-        (setq echo-keystrokes which-key-echo-keystrokes)
-      (setq which-key-echo-keystrokes (/ (float which-key-idle-delay) 4)
-            echo-keystrokes which-key-echo-keystrokes))))
-
-(defun which-key-remove-default-unicode-chars ()
-  "Use of `which-key-dont-use-unicode' is preferred to this
-function, but it's included here in case someone cannot set that
-variable early enough in their configuration, if they are using a
-starter kit for example."
-  (when (string-equal which-key-separator " → ")
-    (setq which-key-separator " : "))
-  (setq which-key-key-replacement-alist
-        (delete '("left" . "←") which-key-key-replacement-alist))
-  (setq which-key-key-replacement-alist
-        (delete '("right" . "→") which-key-key-replacement-alist)))
-
-;;; Default configuration functions for use by users.
-
-;;;###autoload
-(defun which-key-setup-side-window-right ()
-  "Apply suggested settings for side-window that opens on right."
-  (interactive)
-  (setq which-key-popup-type 'side-window
-        which-key-side-window-location 'right
-        which-key-show-prefix 'top))
-
-;;;###autoload
-(defun which-key-setup-side-window-right-bottom ()
-  "Apply suggested settings for side-window that opens on right
-if there is space and the bottom otherwise."
-  (interactive)
-  (setq which-key-popup-type 'side-window
-        which-key-side-window-location '(right bottom)
-        which-key-show-prefix 'top))
-
-;;;###autoload
-(defun which-key-setup-side-window-bottom ()
-  "Apply suggested settings for side-window that opens on
-bottom."
-  (interactive)
-  (which-key--setup-echo-keystrokes)
-  (setq which-key-popup-type 'side-window
-        which-key-side-window-location 'bottom
-        which-key-show-prefix 'echo))
-
-;;;###autoload
-(defun which-key-setup-minibuffer ()
-  "Apply suggested settings for minibuffer."
-  (interactive)
-  (which-key--setup-echo-keystrokes)
-  (setq which-key-popup-type 'minibuffer
-        which-key-show-prefix 'left))
-
-;;; Helper functions to modify replacement lists.
-
-;;;###autoload
-(defun which-key-add-key-based-replacements
-    (key-sequence replacement &rest more)
-  "Replace the description of KEY-SEQUENCE with REPLACEMENT.
-KEY-SEQUENCE is a string suitable for use in `kbd'. REPLACEMENT
-may either be a string, as in
-
-\(which-key-add-key-based-replacements \"C-x 1\" \"maximize\"\)
-
-a cons of two strings as in
-
-\(which-key-add-key-based-replacements \"C-x 8\"
-                                        '(\"unicode\" . \"Unicode keys\")\)
-
-or a function that takes a \(KEY . BINDING\) cons and returns a
-replacement.
-
-In the second case, the second string is used to provide a longer
-name for the keys under a prefix.
-
-MORE allows you to specifcy additional KEY REPLACEMENT pairs.  All
-replacements are added to
-`which-key-key-based-description-replacement-alist'."
-  ;; TODO: Make interactive
-  (while key-sequence
-    ;; normalize key sequences before adding
-    (let ((key-seq (key-description (kbd key-sequence)))
-          (replace (or (and (functionp replacement) replacement)
-                       (car-safe replacement)
-                       replacement)))
-      (push (cons (cons (concat "\\`" (regexp-quote key-seq) "\\'") nil)
-                  (if (functionp replace) replace (cons nil replace)))
-            which-key-replacement-alist)
-      (when (and (not (functionp replacement)) (consp replacement))
-        (push (cons key-seq (cdr-safe replacement))
-              which-key--prefix-title-alist)))
-    (setq key-sequence (pop more) replacement (pop more))))
-(put 'which-key-add-key-based-replacements 'lisp-indent-function 'defun)
-
-;;;###autoload
-(defun which-key-add-major-mode-key-based-replacements
-    (mode key-sequence replacement &rest more)
-  "Functions like `which-key-add-key-based-replacements'.
-The difference is that MODE specifies the `major-mode' that must
-be active for KEY-SEQUENCE and REPLACEMENT (MORE contains
-addition KEY-SEQUENCE REPLACEMENT pairs) to apply."
-  ;; TODO: Make interactive
-  (when (not (symbolp mode))
-    (error "MODE should be a symbol corresponding to a value of major-mode"))
-  (let ((mode-alist
-         (or (cdr-safe (assq mode which-key-replacement-alist)) (list)))
-        (title-mode-alist
-         (or (cdr-safe (assq mode which-key--prefix-title-alist)) (list))))
-    (while key-sequence
-    ;; normalize key sequences before adding
-      (let ((key-seq (key-description (kbd key-sequence)))
-            (replace (or (and (functionp replacement) replacement)
-                         (car-safe replacement)
-                         replacement)))
-        (push (cons (cons (concat "\\`" (regexp-quote key-seq) "\\'") nil)
-                    (if (functionp replace) replace (cons nil replace)))
-              mode-alist)
-        (when (and (not (functionp replacement)) (consp replacement))
-          (push (cons key-seq (cdr-safe replacement))
-                title-mode-alist)))
-      (setq key-sequence (pop more) replacement (pop more)))
-    (if (assq mode which-key-replacement-alist)
-        (setcdr (assq mode which-key-replacement-alist) mode-alist)
-      (push (cons mode mode-alist) which-key-replacement-alist))
-    (if (assq mode which-key--prefix-title-alist)
-        (setcdr (assq mode which-key--prefix-title-alist) title-mode-alist)
-      (push (cons mode title-mode-alist) which-key--prefix-title-alist))))
-(put 'which-key-add-major-mode-key-based-replacements
-     'lisp-indent-function 'defun)
-
-(defalias 'which-key-add-prefix-title 'which-key-add-key-based-replacements)
-(make-obsolete 'which-key-add-prefix-title
-               'which-key-add-key-based-replacements
-               "2016-10-05")
-
-(defalias 'which-key-declare-prefixes 'which-key-add-key-based-replacements)
-(make-obsolete 'which-key-declare-prefixes
-               'which-key-add-key-based-replacements
-               "2016-10-05")
-
-(defalias 'which-key-declare-prefixes-for-mode
-  'which-key-add-major-mode-key-based-replacements)
-(make-obsolete 'which-key-declare-prefixes-for-mode
-               'which-key-add-major-mode-key-based-replacements
-               "2016-10-05")
-
-(defun which-key-define-key-recursively (map key def &optional at-root)
-  "Recursively bind KEY in MAP to DEF on every level of MAP except the first.
-If AT-ROOT is non-nil the binding is also placed at the root of MAP."
-  (when at-root (define-key map key def))
-  (map-keymap
-   (lambda (_ev df)
-     (when (keymapp df)
-       (which-key-define-key-recursively df key def t)))
-   map))
-
-;;; Functions for computing window sizes
-
-(defun which-key--text-width-to-total (text-width)
-  "Convert window text-width to window total-width.
-TEXT-WIDTH is the desired text width of the window.  The function
-calculates what total width is required for a window in the
-selected to have a text-width of TEXT-WIDTH columns.  The
-calculation considers possible fringes and scroll bars.  This
-function assumes that the desired window has the same character
-width as the frame."
-  (let ((char-width (frame-char-width)))
-    (+ text-width
-       (/ (frame-fringe-width) char-width)
-       (/ (frame-scroll-bar-width) char-width)
-       (if (which-key--char-enlarged-p) 1 0)
-       ;; add padding to account for possible wide (unicode) characters
-       3)))
-
-(defun which-key--total-width-to-text (total-width)
-  "Convert window total-width to window text-width.
-TOTAL-WIDTH is the desired total width of the window.  The function calculates
-what text width fits such a window.  The calculation considers possible fringes
-and scroll bars.  This function assumes that the desired window has the same
-character width as the frame."
-  (let ((char-width (frame-char-width)))
-    (- total-width
-       (/ (frame-fringe-width) char-width)
-       (/ (frame-scroll-bar-width) char-width)
-       (if (which-key--char-enlarged-p) 1 0)
-       ;; add padding to account for possible wide (unicode) characters
-       3)))
-
-(defun which-key--char-enlarged-p (&optional _frame)
-  (> (frame-char-width)
-     (/ (float (frame-pixel-width)) (window-total-width (frame-root-window)))))
-
-(defun which-key--char-reduced-p (&optional _frame)
-  (< (frame-char-width)
-     (/ (float (frame-pixel-width)) (window-total-width (frame-root-window)))))
-
-(defun which-key--char-exact-p (&optional _frame)
-  (= (frame-char-width)
-     (/ (float (frame-pixel-width)) (window-total-width (frame-root-window)))))
-
-(defun which-key--width-or-percentage-to-width (width-or-percentage)
-  "Return window total width.
-If WIDTH-OR-PERCENTAGE is a whole number, return it unchanged.  Otherwise, it
-should be a percentage (a number between 0 and 1) out of the frame's width.
-More precisely, it should be a percentage out of the frame's root window's
-total width."
-  (if (wholenump width-or-percentage)
-      width-or-percentage
-    (round (* width-or-percentage (window-total-width (frame-root-window))))))
-
-(defun which-key--height-or-percentage-to-height (height-or-percentage)
-  "Return window total height.
-If HEIGHT-OR-PERCENTAGE is a whole number, return it unchanged.  Otherwise, it
-should be a percentage (a number between 0 and 1) out of the frame's height.
-More precisely, it should be a percentage out of the frame's root window's
-total height."
-  (if (wholenump height-or-percentage)
-      height-or-percentage
-    (round (* height-or-percentage (window-total-height (frame-root-window))))))
-
-(defun which-key--frame-size-changed-p ()
-  "Non-nil if a change in frame size is detected."
-  (let ((new-size (cons (frame-width) (frame-height))))
-    (cond ((null which-key--previous-frame-size)
-           (setq which-key--previous-frame-size new-size)
-           nil)
-          ((not (equal which-key--previous-frame-size new-size))
-           (setq which-key--previous-frame-size new-size)))))
-
-;;; Show/hide which-key buffer
-
-(defun which-key--hide-popup ()
-  "This function is called to hide the which-key buffer."
-  (unless (member real-this-command which-key--paging-functions)
-    (setq which-key--current-page-n nil
-          which-key--current-prefix nil
-          which-key--using-top-level nil
-          which-key--using-show-keymap nil
-          which-key--using-show-operator-keymap nil
-          which-key--current-show-keymap-name nil
-          which-key--prior-show-keymap-args nil
-          which-key--on-last-page nil)
-    (when (and which-key-idle-secondary-delay
-               which-key--secondary-timer-active)
-      (which-key--start-timer))
-    (which-key--lighter-restore)
-    (cl-case which-key-popup-type
-      ;; Not necessary to hide minibuffer
-      ;; (minibuffer (which-key--hide-buffer-minibuffer))
-      (side-window (which-key--hide-buffer-side-window))
-      (frame (which-key--hide-buffer-frame))
-      (custom (funcall which-key-custom-hide-popup-function)))))
-
-(defun which-key--hide-popup-ignore-command ()
-  "Version of `which-key--hide-popup' without the check of
-`real-this-command'."
-  (cl-case which-key-popup-type
-    (side-window (which-key--hide-buffer-side-window))
-    (frame (which-key--hide-buffer-frame))
-    (custom (funcall which-key-custom-hide-popup-function))))
-
-(defun which-key--hide-popup-on-frame-size-change ()
-  "Hide which-key popup if the frame is resized (to trigger a new
-popup)."
-  (when (which-key--frame-size-changed-p)
-    (which-key--hide-popup)))
-
-(defun which-key--hide-buffer-side-window ()
-  "Hide which-key buffer when side-window popup is used."
-  (when (buffer-live-p which-key--buffer)
-    ;; in case which-key buffer was shown in an existing window, `quit-window'
-    ;; will re-show the previous buffer, instead of closing the window
-    (quit-windows-on which-key--buffer)))
-
-(defun which-key--hide-buffer-frame ()
-  "Hide which-key buffer when frame popup is used."
-  (when (frame-live-p which-key--frame)
-    (delete-frame which-key--frame)))
-
-(defun which-key--popup-showing-p ()
-  (window-live-p (get-buffer-window which-key--buffer)))
-
-(defun which-key--show-popup (act-popup-dim)
-  "Show the which-key buffer.
-ACT-POPUP-DIM includes the dimensions, (height . width) of the
-buffer text to be displayed in the popup.  Return nil if no window
-is shown, or if there is no need to start the closing timer."
-  (when (and (> (car act-popup-dim) 0) (> (cdr act-popup-dim) 0))
-    (cl-case which-key-popup-type
-      ;; Not called for minibuffer
-      ;; (minibuffer (which-key--show-buffer-minibuffer act-popup-dim))
-      (side-window (which-key--show-buffer-side-window act-popup-dim))
-      (frame (which-key--show-buffer-frame act-popup-dim))
-      (custom (funcall which-key-custom-show-popup-function act-popup-dim)))))
-
-(defun which-key--fit-buffer-to-window-horizontally
-    (&optional window &rest params)
-  "Slightly modified version of `fit-buffer-to-window'.
-Use &rest params because `fit-buffer-to-window' has a different
-call signature in different emacs versions"
-  (let ((fit-window-to-buffer-horizontally t))
-    (apply #'fit-window-to-buffer window params)))
-
-(defun which-key--show-buffer-side-window (act-popup-dim)
-  "Show which-key buffer when popup type is side-window."
-  (let* ((height (car act-popup-dim))
-         (width (cdr act-popup-dim))
-         (alist
-          (if which-key-allow-imprecise-window-fit
-              `((window-width .  ,(which-key--text-width-to-total width))
-                (window-height . ,height)
-                (side . ,which-key-side-window-location)
-                (slot . ,which-key-side-window-slot))
-            `((window-width . which-key--fit-buffer-to-window-horizontally)
-              (window-height . (lambda (w) (fit-window-to-buffer w nil 1)))
-              (side . ,which-key-side-window-location)
-              (slot . ,which-key-side-window-slot)))))
-    ;; Previously used `display-buffer-in-major-side-window' here, but
-    ;; apparently that is meant to be an internal function. See emacs bug #24828
-    ;; and advice given there.
-    (cond
-     ((eq which-key--multiple-locations t)
-      ;; possibly want to switch sides in this case so we can't reuse the window
-      (delete-windows-on which-key--buffer)
-      (display-buffer-in-side-window which-key--buffer alist))
-     ((get-buffer-window which-key--buffer)
-      (display-buffer-reuse-window which-key--buffer alist))
-     (t
-      (display-buffer-in-side-window which-key--buffer alist)))))
-
-(defun which-key--show-buffer-frame (act-popup-dim)
-  "Show which-key buffer when popup type is frame."
-  (let* (;(orig-window (selected-window))
-         (frame-height (+ (car act-popup-dim)
-                          (if (with-current-buffer which-key--buffer
-                                mode-line-format)
-                              1
-                            0)))
-         ;; without adding 2, frame sometimes isn't wide enough for the buffer.
-         ;; this is probably because of the fringes. however, setting fringes
-         ;; sizes to 0 (instead of adding 2) didn't always make the frame wide
-         ;; enough. don't know why it is so.
-         (frame-width (+ (cdr act-popup-dim) 2))
-         (new-window (if (and (frame-live-p which-key--frame)
-                              (eq which-key--buffer
-                                  (window-buffer
-                                   (frame-root-window which-key--frame))))
-                         (which-key--show-buffer-reuse-frame
-                          frame-height frame-width)
-                       (which-key--show-buffer-new-frame
-                        frame-height frame-width))))
-    (when new-window
-      ;; display successful
-      (setq which-key--frame (window-frame new-window))
-      new-window)))
-
-(defun which-key--show-buffer-new-frame (frame-height frame-width)
-  "Helper for `which-key--show-buffer-frame'."
-  (let* ((frame-params `((height . ,frame-height)
-                         (width . ,frame-width)
-                         ;; tell the window manager to respect the given sizes
-                         (user-size . t)
-                         ;; which-key frame doesn't need a minibuffer
-                         (minibuffer . nil)
-                         (name . "which-key")
-                         ;; no need for scroll bars in which-key frame
-                         (vertical-scroll-bars . nil)
-                         ;; (left-fringe . 0)
-                         ;; (right-fringe . 0)
-                         ;; (right-divider-width . 0)
-                         ;; make sure frame is visible
-                         (visibility . t)))
-         (alist `((pop-up-frame-parameters . ,frame-params)))
-         (orig-frame (selected-frame))
-         (new-window (display-buffer-pop-up-frame which-key--buffer alist)))
-    (when new-window
-      ;; display successful
-      (redirect-frame-focus (window-frame new-window) orig-frame)
-      new-window)))
-
-(defun which-key--show-buffer-reuse-frame (frame-height frame-width)
-  "Helper for `which-key--show-buffer-frame'."
-  (let ((window
-         (display-buffer-reuse-window
-          which-key--buffer `((reusable-frames . ,which-key--frame)))))
-    (when window
-      ;; display successful
-      (set-frame-size (window-frame window) frame-width frame-height)
-      window)))
-
-;;; Max dimension of available window functions
-
-(defun which-key--popup-max-dimensions ()
-  "Dimesion functions should return the maximum possible (height
-. width) of the intended popup. SELECTED-WINDOW-WIDTH is the
-width of currently active window, not the which-key buffer
-window."
-  (cl-case which-key-popup-type
-    (minibuffer (which-key--minibuffer-max-dimensions))
-    (side-window (which-key--side-window-max-dimensions))
-    (frame (which-key--frame-max-dimensions))
-    (custom (funcall which-key-custom-popup-max-dimensions-function
-                     (window-width)))))
-
-(defun which-key--minibuffer-max-dimensions ()
-  "Return max-dimensions of minibuffer (height . width).
-Measured in lines and characters respectively."
-  (cons
-   ;; height
-   (if (floatp max-mini-window-height)
-       (floor (* (frame-text-lines)
-                 max-mini-window-height))
-     max-mini-window-height)
-   ;; width
-   (max 0 (- (frame-text-cols) which-key-unicode-correction))))
-
-(defun which-key--side-window-max-dimensions ()
-  "Return max-dimensions of the side-window popup (height .
-width) in lines and characters respectively."
-  (cons
-   ;; height
-   (if (member which-key-side-window-location '(left right))
-       ;; 1 is a kludge to make sure there is no overlap
-       (- (frame-height) (window-text-height (minibuffer-window)) 1)
-     ;; (window-mode-line-height which-key--window))
-     ;; FIXME: change to something like
-     ;; (min which-*-height (calculate-max-height))
-     (which-key--height-or-percentage-to-height
-      which-key-side-window-max-height))
-   ;; width
-   (max 0
-        (- (if (member which-key-side-window-location '(left right))
-               (which-key--total-width-to-text
-                (which-key--width-or-percentage-to-width
-                 which-key-side-window-max-width))
-             (which-key--total-width-to-text
-              (which-key--width-or-percentage-to-width
-               1.0)))
-           which-key-unicode-correction))))
-
-(defun which-key--frame-max-dimensions ()
-  "Return max-dimensions of the frame popup (height .
-width) in lines and characters respectively."
-  (cons which-key-frame-max-height which-key-frame-max-width))
-
-;;; Sorting functions
-
-(defun which-key--string< (a b &optional alpha)
-  (let* ((da (downcase a))
-         (db (downcase b)))
-    (cond ((string-equal da db)
-           (if which-key-sort-uppercase-first
-               (string-lessp a b)
-             (not (string-lessp a b))))
-          (alpha (string-lessp da db))
-          (t (string-lessp a b)))))
-
-(defun which-key--key-description< (a b &optional alpha)
-  "Sorting function used for `which-key-key-order' and
-`which-key-key-order-alpha'."
-  (save-match-data
-    (let* ((rngrgxp "^\\([^ ]+\\) \\.\\. [^ ]+")
-           (a (if (string-match rngrgxp a) (match-string 1 a) a))
-           (b (if (string-match rngrgxp b) (match-string 1 b) b))
-           (aem? (string-equal a ""))
-           (bem? (string-equal b ""))
-           (a1? (= 1 (length a)))
-           (b1? (= 1 (length b)))
-           (srgxp "^\\(RET\\|SPC\\|TAB\\|DEL\\|LFD\\|ESC\\|NUL\\)")
-           (asp? (string-match-p srgxp a))
-           (bsp? (string-match-p srgxp b))
-           (prrgxp "^\\(M\\|C\\|S\\|A\\|H\\|s\\)-")
-           (apr? (string-match-p prrgxp a))
-           (bpr? (string-match-p prrgxp b))
-           (afn? (string-match-p "<f[0-9]+>" a))
-           (bfn? (string-match-p "<f[0-9]+>" b)))
-      (cond ((or aem? bem?) (and aem? (not bem?)))
-            ((and asp? bsp?)
-             (if (string-equal (substring a 0 3) (substring b 0 3))
-                 (which-key--key-description<
-                  (substring a 3) (substring b 3) alpha)
-               (which-key--string< a b alpha)))
-            ((or asp? bsp?) asp?)
-            ((and a1? b1?) (which-key--string< a b alpha))
-            ((or a1? b1?) a1?)
-            ((and afn? bfn?)
-             (< (string-to-number
-                 (replace-regexp-in-string "<f\\([0-9]+\\)>" "\\1" a))
-                (string-to-number
-                 (replace-regexp-in-string "<f\\([0-9]+\\)>" "\\1" b))))
-            ((or afn? bfn?) afn?)
-            ((and apr? bpr?)
-             (if (string-equal (substring a 0 2) (substring b 0 2))
-                 (which-key--key-description<
-                  (substring a 2) (substring b 2) alpha)
-               (which-key--string< a b alpha)))
-            ((or apr? bpr?) apr?)
-            (t (which-key--string< a b alpha))))))
-
-(defsubst which-key-key-order-alpha (acons bcons)
-  "Order key descriptions A and B.
-Order is lexicographic within a \"class\", where the classes and
-the ordering of classes are listed below.
-
-special (SPC,TAB,...) < single char < mod (C-,M-,...) < other.
-Sorts single characters alphabetically with lowercase coming
-before upper."
-  (which-key--key-description< (car acons) (car bcons) t))
-
-(defsubst which-key-key-order (acons bcons)
-  "Order key descriptions A and B.
-Order is lexicographic within a \"class\", where the classes and
-the ordering of classes are listed below.
-
-special (SPC,TAB,...) < single char < mod (C-,M-,...) < other."
-  (which-key--key-description< (car acons) (car bcons)))
-
-(defsubst which-key-description-order (acons bcons)
-  "Order descriptions of A and B.
-Uses `string-lessp' after applying lowercase."
-  (string-lessp (downcase (cdr acons)) (downcase (cdr bcons))))
-
-(defsubst which-key--group-p (description)
-  (or (string-match-p "^\\(group:\\|Prefix\\)" description)
-      (keymapp (intern description))))
-
-(defun which-key-prefix-then-key-order (acons bcons)
-  "Order first by whether A and/or B is a prefix with no prefix
-coming before a prefix. Within these categories order using
-`which-key-key-order'."
-  (let ((apref? (which-key--group-p (cdr acons)))
-        (bpref? (which-key--group-p (cdr bcons))))
-    (if (not (eq apref? bpref?))
-        (and (not apref?) bpref?)
-      (which-key-key-order acons bcons))))
-
-(defun which-key-prefix-then-key-order-reverse (acons bcons)
-  "Order first by whether A and/or B is a prefix with prefix
-coming before a prefix. Within these categories order using
-`which-key-key-order'."
-  (let ((apref? (which-key--group-p (cdr acons)))
-        (bpref? (which-key--group-p (cdr bcons))))
-    (if (not (eq apref? bpref?))
-        (and apref? (not bpref?))
-      (which-key-key-order acons bcons))))
-
-(defun which-key-local-then-key-order (acons bcons)
-  "Order first by whether A and/or B is a local binding with
-local bindings coming first. Within these categories order using
-`which-key-key-order'."
-  (let ((aloc? (which-key--local-binding-p acons))
-        (bloc? (which-key--local-binding-p bcons)))
-    (if (not (eq aloc? bloc?))
-        (and aloc? (not bloc?))
-      (which-key-key-order acons bcons))))
-
-;;; Functions for retrieving and formatting keys
-
-(defsubst which-key--string-width (maybe-string)
-  "If MAYBE-STRING is a string use `which-key--string-width' o/w return 0."
-  (if (stringp maybe-string) (string-width maybe-string) 0))
-
-(defsubst which-key--safe-lookup-key (keymap key)
-  "Version of `lookup-key' that allows KEYMAP to be nil. KEY is not checked."
-  (when (keymapp keymap) (lookup-key keymap key)))
-
-(defsubst which-key--butlast-string (str)
-  (mapconcat #'identity (butlast (split-string str)) " "))
-
-(defun which-key--get-replacements (key-binding &optional use-major-mode)
-  (let ((alist (or (and use-major-mode
-                        (cdr-safe
-                         (assq major-mode which-key-replacement-alist)))
-                   which-key-replacement-alist))
-        res case-fold-search)
-    (catch 'res
-      (dolist (replacement alist)
-        ;; these are mode specific ones to ignore. The mode specific case is
-        ;; handled in the selection of alist
-        (unless (symbolp (car replacement))
-          (let ((key-regexp (caar replacement))
-                (binding-regexp (cdar replacement)))
-            (when (and (or (null key-regexp)
-                           (string-match-p key-regexp
-                                           (car key-binding)))
-                       (or (null binding-regexp)
-                           (string-match-p binding-regexp
-                                           (cdr key-binding))))
-              (push replacement res)
-              (when (not which-key-allow-multiple-replacements)
-                (throw 'res res)))))))
-    (nreverse res)))
-
-(defun which-key--maybe-replace (key-binding)
-  "Use `which-key--replacement-alist' to maybe replace KEY-BINDING.
-KEY-BINDING is a cons cell of the form \(KEY . BINDING\) each of
-which are strings. KEY is of the form produced by `key-binding'."
-  (let* ((mode-res (which-key--get-replacements key-binding t))
-         (all-repls (or mode-res
-                      (which-key--get-replacements key-binding))))
-    (dolist (repl all-repls key-binding)
-      (setq key-binding
-            (cond ((or (not (consp repl)) (null (cdr repl)))
-                   key-binding)
-                  ((functionp (cdr repl))
-                   (funcall (cdr repl) key-binding))
-                  ((consp (cdr repl))
-                   (cons
-                    (cond ((and (caar repl) (cadr repl))
-                           (replace-regexp-in-string
-                            (caar repl) (cadr repl) (car key-binding) t))
-                          ((cadr repl) (cadr repl))
-                          (t (car key-binding)))
-                    (cond ((and (cdar repl) (cddr repl))
-                           (replace-regexp-in-string
-                            (cdar repl) (cddr repl) (cdr key-binding) t))
-                          ((cddr repl) (cddr repl))
-                          (t (cdr key-binding))))))))))
-
-(defsubst which-key--current-key-list (&optional key-str)
-  (append (listify-key-sequence which-key--current-prefix)
-          (when key-str
-            (listify-key-sequence (kbd key-str)))))
-
-(defsubst which-key--current-key-string (&optional key-str)
-  (key-description (which-key--current-key-list key-str)))
-
-(defun which-key--local-binding-p (keydesc)
-  (eq (which-key--safe-lookup-key
-       (current-local-map) (kbd (which-key--current-key-string (car keydesc))))
-      (intern (cdr keydesc))))
-
-(defun which-key--maybe-get-prefix-title (keys)
-  "KEYS is a string produced by `key-description'.
-A title is possibly returned using
-`which-key--prefix-title-alist'.  An empty stiring is returned if
-no title exists."
-  (cond
-   ((not (string-equal keys ""))
-    (let* ((title-res
-            (cdr-safe (assoc-string keys which-key--prefix-title-alist)))
-           (repl-res
-            (cdr-safe (which-key--maybe-replace (cons keys ""))))
-           (binding (key-binding (kbd keys)))
-           (alternate (when (and binding (symbolp binding))
-                        (symbol-name binding))))
-      (cond (title-res title-res)
-            ((not (string-equal repl-res "")) repl-res)
-            ((and (eq which-key-show-prefix 'echo) alternate)
-             alternate)
-            ((and (member which-key-show-prefix '(bottom top))
-                  (eq which-key-side-window-location 'bottom)
-                  echo-keystrokes)
-             (if alternate alternate
-               (concat "Following " keys)))
-            (t ""))))
-    (which-key--using-top-level "Top-level bindings")
-    (which-key--current-show-keymap-name
-     which-key--current-show-keymap-name)
-    (t "")))
-
-(defun which-key--propertize-key (key)
-  "Add a face to KEY.
-If KEY contains any \"special keys\" defined in
-`which-key-special-keys' then truncate and add the corresponding
-`which-key-special-key-face'."
-  (let ((key-w-face (propertize key 'face 'which-key-key-face))
-        (regexp (concat "\\("
-                        (mapconcat 'identity which-key-special-keys
-                                   "\\|") "\\)"))
-        case-fold-search)
-    (save-match-data
-      (if (and which-key-special-keys
-               (string-match regexp key))
-          (let ((beg (match-beginning 0)) (end (match-end 0)))
-            (concat (substring key-w-face 0 beg)
-                    (propertize (substring key-w-face beg (1+ beg))
-                                'face 'which-key-special-key-face)
-                    (substring key-w-face end
-                               (which-key--string-width key-w-face))))
-        key-w-face))))
-
-(defsubst which-key--truncate-description (desc)
-  "Truncate DESC description to `which-key-max-description-length'."
-  (if (and which-key-max-description-length
-           (> (length desc) which-key-max-description-length))
-      (concat (substring desc 0 which-key-max-description-length) "..")
-    desc))
-
-(defun which-key--highlight-face (description)
-  "Return the highlight face for DESCRIPTION if it has one."
-  (let (face)
-    (dolist (el which-key-highlighted-command-list)
-      (unless face
-        (cond ((consp el)
-               (when (string-match-p (car el) description)
-                 (setq face (cdr el))))
-              ((stringp el)
-               (when (string-match-p el description)
-                 (setq face 'which-key-highlighted-command-face)))
-              (t
-               (message "which-key: warning: element %s of \
-which-key-highlighted-command-list is not a string or a cons
-cell" el)))))
-    face))
-
-(defun which-key--propertize-description
-    (description group local hl-face &optional original-description)
-  "Add face to DESCRIPTION where the face chosen depends on
-whether the description represents a group or a command. Also
-make some minor adjustments to the description string, like
-removing a \"group:\" prefix.
-
-ORIGINAL-DESCRIPTION is the description given by
-`describe-buffer-bindings'."
-  (let* ((desc description)
-         (desc (if (string-match-p "^group:" desc)
-                   (substring desc 6) desc))
-         (desc (if group (concat which-key-prefix-prefix desc) desc))
-         (desc (which-key--truncate-description desc)))
-    (make-text-button desc nil
-      'face (cond (hl-face hl-face)
-                  (group 'which-key-group-description-face)
-                  (local 'which-key-local-map-description-face)
-                  (t 'which-key-command-description-face))
-      'help-echo (cond
-                  ((and original-description
-                        (fboundp (intern original-description))
-                        (documentation (intern original-description))
-                        ;; tooltip-mode doesn't exist in emacs-nox
-                        (boundp 'tooltip-mode) tooltip-mode)
-                   (documentation (intern original-description)))
-                  ((and original-description
-                        (fboundp (intern original-description))
-                        (documentation (intern original-description))
-                        (let* ((doc (documentation
-                                     (intern original-description)))
-                               (str (replace-regexp-in-string "\n" " " doc))
-                               (max (floor (* (frame-width) 0.8))))
-                          (if (> (length str) max)
-                              (concat (substring str 0 max) "...")
-                            str))))))
-    desc))
-
-(defun which-key--extract-key (key-str)
-  "Pull the last key (or key range) out of KEY-STR."
-  (save-match-data
-    (let ((key-range-regexp "\\`.*\\([^ \t]+ \\.\\. [^ \t]+\\)\\'"))
-      (if (string-match key-range-regexp key-str)
-          (match-string 1 key-str)
-        (car (last (split-string key-str " ")))))))
-
-(defun which-key--format-and-replace (unformatted)
-  "Take a list of (key . desc) cons cells in UNFORMATTED, add
-faces and perform replacements according to the three replacement
-alists. Returns a list (key separator description)."
-  (let ((sep-w-face
-         (propertize which-key-separator 'face 'which-key-separator-face))
-        (local-map (current-local-map))
-        new-list)
-    (dolist (key-binding unformatted)
-      (let* ((key (car key-binding))
-             (orig-desc (cdr key-binding))
-             (group (which-key--group-p orig-desc))
-             ;; At top-level prefix is nil
-             (keys (if which-key--current-prefix
-                       (concat (which-key--current-key-string) " " key)
-                     key))
-             (local (eq (which-key--safe-lookup-key local-map (kbd keys))
-                        (intern orig-desc)))
-             (hl-face (which-key--highlight-face orig-desc))
-             (key-binding (which-key--maybe-replace (cons keys orig-desc))))
-        (when (consp key-binding)
-          (push
-           (list (which-key--propertize-key
-                  (which-key--extract-key (car key-binding)))
-                 sep-w-face
-                 (which-key--propertize-description
-                  (cdr key-binding) group local hl-face orig-desc))
-           new-list))))
-    (nreverse new-list)))
-
-(defun which-key--get-keymap-bindings (keymap &optional filter)
-  "Retrieve top-level bindings from KEYMAP."
-  (let (bindings)
-    (map-keymap
-     (lambda (ev def)
-       (unless (and (functionp filter) (funcall filter ev def))
-         (cl-pushnew
-          (cons (key-description (list ev))
-                (cond ((keymapp def) "Prefix Command")
-                      ((symbolp def) (copy-sequence (symbol-name def)))
-                      ((eq 'lambda (car-safe def)) "lambda")
-                      (t (format "%s" def))))
-          bindings :test (lambda (a b) (string= (car a) (car b))))))
-     keymap)
-    bindings))
-
-(defun which-key--compute-binding (binding)
-  "Replace BINDING with remapped binding if it exists.
-
-Requires `which-key-compute-remaps' to be non-nil"
-  (let (remap)
-    (if (and which-key-compute-remaps
-             (setq remap (command-remapping (intern binding))))
-        (copy-sequence (symbol-name remap))
-      binding)))
-
-(defun which-key--get-current-bindings ()
-  "Generate a list of current active bindings."
-  (let ((key-str-qt (regexp-quote (key-description which-key--current-prefix)))
-        (buffer (current-buffer))
-        (ignore-bindings '("self-insert-command" "ignore"
-                           "ignore-event" "company-ignore"))
-        (ignore-keys-regexp
-         (eval-when-compile
-           (regexp-opt '("mouse-" "wheel-" "remap" "drag-" "scroll-bar"
-                         "select-window" "switch-frame" "-state"))))
-        (ignore-sections-regexp
-         (eval-when-compile
-           (regexp-opt '("Key translations" "Function key map translations"
-                         "Input decoding map translations")))))
-    (with-temp-buffer
-      (setq-local indent-tabs-mode t)
-      (setq-local tab-width 8)
-      (describe-buffer-bindings buffer which-key--current-prefix)
-      (goto-char (point-min))
-      (let ((header-p (not (= (char-after) ?\f)))
-            bindings header)
-        (while (not (eobp))
-          (cond
-           (header-p
-            (setq header (buffer-substring-no-properties
-                          (point)
-                          (line-end-position)))
-            (setq header-p nil)
-            (forward-line 3))
-           ((= (char-after) ?\f)
-            (setq header-p t))
-           ((looking-at "^[ \t]*$"))
-           ((or (not (string-match-p ignore-sections-regexp header))
-                which-key--current-prefix)
-            (let ((binding-start (save-excursion
-                                   (and (re-search-forward "\t+" nil t)
-                                        (match-end 0))))
-                  key binding)
-              (when binding-start
-                (setq key (buffer-substring-no-properties
-                           (point) binding-start))
-                (setq binding (buffer-substring-no-properties
-                               binding-start
-                               (line-end-position)))
-                (save-match-data
-                  (cond
-                   ((member binding ignore-bindings))
-                   ((string-match-p ignore-keys-regexp key))
-                   ((and which-key--current-prefix
-                         (string-match (format "^%s[ \t]\\([^ \t]+\\)[ \t]+$"
-                                               key-str-qt) key))
-                    (unless (assoc-string (match-string 1 key) bindings)
-                      (push (cons (match-string 1 key)
-                                  (which-key--compute-binding binding))
-                            bindings)))
-                   ((and which-key--current-prefix
-                         (string-match
-                          (format
-                           "^%s[ \t]\\([^ \t]+\\) \\.\\. %s[ \t]\\([^ \t]+\\)[ \t]+$"
-                           key-str-qt key-str-qt) key))
-                    (let ((stripped-key (concat (match-string 1 key)
-                                                " \.\. "
-                                                (match-string 2 key))))
-                      (unless (assoc-string stripped-key bindings)
-                        (push (cons stripped-key
-                                    (which-key--compute-binding binding))
-                              bindings))))
-                   ((string-match
-                     "^\\([^ \t]+\\|[^ \t]+ \\.\\. [^ \t]+\\)[ \t]+$" key)
-                    (unless (assoc-string (match-string 1 key) bindings)
-                      (push (cons (match-string 1 key)
-                                  (which-key--compute-binding binding))
-                            bindings)))))))))
-          (forward-line))
-        (nreverse bindings)))))
-
-(defun which-key--get-formatted-key-bindings (&optional bindings)
-  "Uses `describe-buffer-bindings' to collect the key bindings in
-BUFFER that follow the key sequence KEY-SEQ."
-  (let* ((unformatted (if bindings bindings (which-key--get-current-bindings))))
-    (when which-key-sort-order
-      (setq unformatted
-            (sort unformatted which-key-sort-order)))
-    (which-key--format-and-replace unformatted)))
-
-;;; Functions for laying out which-key buffer pages
-
-(defun which-key--normalize-columns (columns)
-  "Pad COLUMNS to the same length using empty strings."
-  (let ((max-len (cl-reduce (lambda (a x) (max a (length x))) columns
-                            :initial-value 0)))
-    (mapcar
-     (lambda (c)
-       (if (< (length c) max-len)
-           (append c (make-list (- max-len (length c)) ""))
-         c))
-     columns)))
-
-(defsubst which-key--join-columns (columns)
-  "Transpose columns into rows, concat rows into lines and rows into page."
-  (let* ((padded (which-key--normalize-columns (nreverse columns)))
-         (rows (apply #'cl-mapcar #'list padded)))
-    (mapconcat (lambda (row) (mapconcat #'identity row " ")) rows "\n")))
-
-(defsubst which-key--max-len (keys index)
-  "Internal function for finding the max length of the INDEX
-element in each list element of KEYS."
-  (cl-reduce
-   (lambda (x y) (max x (which-key--string-width (nth index y))))
-   keys :initial-value 0))
-
-(defun which-key--pad-column (col-keys)
-  "Take a column of (key separator description) COL-KEYS,
-calculate the max width in the column and pad all cells out to
-that width."
-  (let* ((col-key-width  (+ which-key-add-column-padding
-                            (which-key--max-len col-keys 0)))
-         (col-sep-width  (which-key--max-len col-keys 1))
-         (col-desc-width (which-key--max-len col-keys 2))
-         (col-width      (+ 1 col-key-width col-sep-width col-desc-width)))
-    (cons col-width
-          (mapcar (lambda (k)
-                    (format (concat "%" (int-to-string col-key-width)
-                                    "s%s%-" (int-to-string col-desc-width) "s")
-                            (nth 0 k) (nth 1 k) (nth 2 k)))
-                  col-keys))))
-
-(defun which-key--partition-list (n list)
-  "Partition LIST into N-sized sublists."
-  (let (res)
-    (while list
-      (setq res (cons (cl-subseq list 0 (min n (length list))) res)
-            list (nthcdr n list)))
-    (nreverse res)))
-
-(defun which-key--list-to-pages (keys avl-lines avl-width)
-  "Convert list of KEYS to columns based on dimensions AVL-LINES and AVL-WIDTH.
-Returns a plist that holds the page strings, as well as
-metadata."
-  (let ((cols-w-widths (mapcar #'which-key--pad-column
-                               (which-key--partition-list avl-lines keys)))
-        (page-width 0) (n-pages 0) (n-keys 0) (n-columns 0)
-        page-cols pages page-widths keys/page col)
-    (if (> (apply #'max (mapcar #'car cols-w-widths)) avl-width)
-        ;; give up if no columns fit
-        (list :pages nil :page-height 0 :page-widths '(0)
-              :keys/page '(0) :n-pages 0 :tot-keys 0)
-      (while cols-w-widths
-        ;; start new page
-        (cl-incf n-pages)
-        (setq col (pop cols-w-widths))
-        (setq page-cols (list (cdr col)))
-        (setq page-width (car col))
-        (setq n-keys (length (cdr col)))
-        (setq n-columns 1)
-        ;; add additional columns as long as they fit
-        (while (and cols-w-widths
-                    (or (null which-key-max-display-columns)
-                        (< n-columns which-key-max-display-columns))
-                    (<= (+ (caar cols-w-widths) page-width) avl-width))
-          (setq col (pop cols-w-widths))
-          (push (cdr col) page-cols)
-          (cl-incf page-width (car col))
-          (cl-incf n-keys (length (cdr col)))
-          (cl-incf n-columns))
-        (push (which-key--join-columns page-cols) pages)
-        (push n-keys keys/page)
-        (push page-width page-widths))
-      (list :pages (nreverse pages) :page-height avl-lines
-            :page-widths (nreverse page-widths)
-            :keys/page (reverse keys/page) :n-pages n-pages
-            :tot-keys (apply #'+ keys/page)))))
-
-(defun which-key--create-pages-1
-    (keys available-lines available-width &optional min-lines vertical)
-  "Create page strings using `which-key--list-to-pages'.
-Will try to find the best number of rows and columns using the
-given dimensions and the length and widths of ITEMS. Use VERTICAL
-if the ITEMS are laid out vertically and the number of columns
-should be minimized."
-  (let ((result (which-key--list-to-pages
-                 keys available-lines available-width))
-        (min-lines (or min-lines 0))
-        found prev-result)
-    (if (or vertical
-            (> (plist-get result :n-pages) 1)
-            (= 1 available-lines))
-        result
-      ;; simple search for a fitting page
-      (while (and (> available-lines min-lines)
-                  (not found))
-        (setq available-lines (- available-lines 1)
-              prev-result result
-              result (which-key--list-to-pages
-                      keys available-lines available-width)
-              found (> (plist-get result :n-pages) 1)))
-      (if found prev-result result))))
-
-(defun which-key--create-pages (keys)
-  "Create page strings using `which-key--list-to-pages'.
-Will try to find the best number of rows and columns using the
-given dimensions and the length and wdiths of KEYS. SEL-WIN-WIDTH
-is the width of the live window."
-  (let* ((max-dims (which-key--popup-max-dimensions))
-         (max-lines (car max-dims))
-         (max-width (cdr max-dims))
-         (prefix-keys-desc (key-description which-key--current-prefix))
-         (full-prefix (which-key--full-prefix prefix-keys-desc))
-         (prefix (when (eq which-key-show-prefix 'left)
-                   (+ 2 (which-key--string-width full-prefix))))
-         (prefix-top-bottom (member which-key-show-prefix '(bottom top)))
-         (avl-lines (if prefix-top-bottom (- max-lines 1) max-lines))
-         (min-lines (min avl-lines which-key-min-display-lines))
-         (avl-width (if prefix (- max-width prefix) max-width))
-         (vertical (and (eq which-key-popup-type 'side-window)
-                        (member which-key-side-window-location '(left right)))))
-    (which-key--create-pages-1 keys avl-lines avl-width min-lines vertical)))
-
-(defun which-key--lighter-status (page-n)
-  "Possibly show number of keys and total in the mode line."
-  (when which-key-show-remaining-keys
-    (let ((n-shown (nth page-n (plist-get which-key--pages-plist :keys/page)))
-          (n-tot (plist-get which-key--pages-plist :tot-keys)))
-      (setcar (cdr (assq 'which-key-mode minor-mode-alist))
-              (format " WK: %s/%s keys" n-shown n-tot)))))
-
-(defun which-key--lighter-restore ()
-  "Restore the lighter for which-key."
-  (when which-key-show-remaining-keys
-    (setcar (cdr (assq 'which-key-mode minor-mode-alist))
-            which-key-lighter)))
-
-(defun which-key--echo (text)
-  "Echo TEXT to minibuffer without logging."
-  (let (message-log-max)
-    (message "%s" text)))
-
-(defun which-key--next-page-hint (prefix-keys)
-  "Return string for next page hint."
-  (let* ((paging-key (concat prefix-keys " " which-key-paging-key))
-         (paging-key-bound (eq 'which-key-C-h-dispatch
-                               (key-binding (kbd paging-key))))
-         (key (if paging-key-bound which-key-paging-key "C-h")))
-    (when (and which-key-use-C-h-commands
-               (or which-key--using-show-operator-keymap
-                   (not (and which-key-allow-evil-operators
-                             (bound-and-true-p evil-this-operator)))))
-      (propertize (format "[%s paging/help]" key)
-                  'face 'which-key-note-face))))
-
-(eval-and-compile
-  (if (fboundp 'universal-argument--description)
-      (defalias 'which-key--universal-argument--description
-        'universal-argument--description)
-    (defun which-key--universal-argument--description ()
-      ;; Backport of the definition of universal-argument--description in
-      ;; emacs25 on 2015-12-04
-      (when prefix-arg
-        (concat "C-u"
-                (pcase prefix-arg
-                  (`(-) " -")
-                  (`(,(and (pred integerp) n))
-                   (let ((str ""))
-                     (while (and (> n 4) (= (mod n 4) 0))
-                       (setq str (concat str " C-u"))
-                       (setq n (/ n 4)))
-                     (if (= n 4) str (format " %s" prefix-arg))))
-                  (_ (format " %s" prefix-arg))))))))
-
-(defun which-key--full-prefix (prefix-keys &optional -prefix-arg dont-prop-keys)
-  "Return a description of the full key sequence up to now,
-including prefix arguments."
-  (let* ((left (eq which-key-show-prefix 'left))
-         (prefix-arg (if -prefix-arg -prefix-arg prefix-arg))
-         (str (concat
-               (which-key--universal-argument--description)
-               (when prefix-arg " ")
-               prefix-keys))
-         (dash (if (and which-key--current-prefix
-                        (null left)) "-" "")))
-    (if (or (eq which-key-show-prefix 'echo) dont-prop-keys)
-        (concat str dash)
-      (concat (which-key--propertize-key str)
-              (propertize dash 'face 'which-key-key-face)))))
-
-(defun which-key--get-popup-map ()
-  "Generate transient-map for use in the top level binding display."
-  (unless which-key--current-prefix
-    (let ((map (make-sparse-keymap)))
-      (define-key map (kbd which-key-paging-key) #'which-key-C-h-dispatch)
-      (when which-key-use-C-h-commands
-        ;; Show next page even when C-h is pressed
-        (define-key map (kbd "C-h") #'which-key-C-h-dispatch))
-      map)))
-
-(defun which-key--process-page (page-n pages-plist)
-  "Add information to the basic list of key bindings, including
-if applicable the current prefix, the name of the current prefix,
-and a page count."
-  (let* ((page (nth page-n (plist-get pages-plist :pages)))
-         (height (plist-get pages-plist :page-height))
-         (n-pages (plist-get pages-plist :n-pages))
-         (prefix-keys (key-description which-key--current-prefix))
-         (full-prefix (which-key--full-prefix prefix-keys))
-         (nxt-pg-hint (which-key--next-page-hint prefix-keys))
-         ;; not used in left case
-         (status-line
-          (concat (propertize (which-key--maybe-get-prefix-title
-                               (which-key--current-key-string))
-                              'face 'which-key-note-face)
-                  (when (< 1 n-pages)
-                    (propertize (format " (%s of %s)"
-                                        (1+ page-n) n-pages)
-                                'face 'which-key-note-face)))))
-    (pcase which-key-show-prefix
-      (`left
-       (let* ((page-cnt (propertize (format "%s/%s" (1+ page-n) n-pages)
-                                    'face 'which-key-separator-face))
-              (first-col-width (+ 2 (max (which-key--string-width full-prefix)
-                                         (which-key--string-width page-cnt))))
-              (prefix (format (concat "%-" (int-to-string first-col-width) "s")
-                              full-prefix))
-              (page-cnt (if (> n-pages 1)
-                            (format
-                             (concat "%-" (int-to-string first-col-width) "s")
-                             page-cnt)
-                          (make-string first-col-width 32)))
-              lines first-line new-end)
-         (if (= 1 height)
-             (cons (concat prefix page) nil)
-           (setq lines (split-string page "\n")
-                 first-line (concat prefix (car lines) "\n" page-cnt)
-                 new-end (concat "\n" (make-string first-col-width 32)))
-           (cons
-            (concat first-line (mapconcat #'identity (cdr lines) new-end))
-            nil))))
-      (`top
-       (cons
-        (concat (when (or (= 0 echo-keystrokes)
-                          (not (eq which-key-side-window-location 'bottom)))
-                  (concat full-prefix " "))
-                status-line " " nxt-pg-hint "\n" page)
-        nil))
-      (`bottom
-       (cons
-        (concat page "\n"
-                (when (or (= 0 echo-keystrokes)
-                          (not (eq which-key-side-window-location 'bottom)))
-                  (concat full-prefix " "))
-                status-line " " nxt-pg-hint)
-        nil))
-      (`echo
-       (cons page
-             (lambda ()
-               (which-key--echo
-                (concat full-prefix (when prefix-keys " ")
-                        status-line (when status-line " ")
-                        nxt-pg-hint)))))
-      (`mode-line
-       (cons page
-             (lambda ()
-               (with-current-buffer which-key--buffer
-                 (setq-local mode-line-format
-                             (concat " " full-prefix
-                                     " " status-line
-                                     " " nxt-pg-hint))))))
-      (_ (cons page nil)))))
-
-(defun which-key--show-page (n)
-  "Show page N, starting from 0."
-  (which-key--init-buffer) ;; in case it was killed
-  (let ((n-pages (plist-get which-key--pages-plist :n-pages))
-        (prefix-keys (key-description which-key--current-prefix))
-        page-n golden-ratio-mode)
-    (if (= 0 n-pages)
-        (message "%s- which-key can't show keys: There is not \
-enough space based on your settings and frame size." prefix-keys)
-      (setq page-n (mod n n-pages))
-      (setq which-key--current-page-n page-n)
-      (when (= n-pages (1+ n)) (setq which-key--on-last-page t))
-      (let ((page-echo (which-key--process-page page-n which-key--pages-plist))
-            (height (plist-get which-key--pages-plist :page-height))
-            (width
-             (nth page-n (plist-get which-key--pages-plist :page-widths))))
-        (which-key--lighter-status page-n)
-        (if (eq which-key-popup-type 'minibuffer)
-            (which-key--echo (car page-echo))
-          (with-current-buffer which-key--buffer
-            (erase-buffer)
-            (insert (car page-echo))
-            (goto-char (point-min)))
-          (when (cdr page-echo) (funcall (cdr page-echo)))
-          (which-key--show-popup (cons height width)))))
-    ;; used for paging at top-level
-    (if (fboundp 'set-transient-map)
-        (set-transient-map (which-key--get-popup-map))
-      (with-no-warnings
-        (set-temporary-overlay-map (which-key--get-popup-map))))))
-
-;;; Paging functions
-
-;;;###autoload
-(defun which-key-reload-key-sequence (key-seq)
-  "Simulate entering the key sequence KEY-SEQ.
-KEY-SEQ should be a list of events as produced by
-`listify-key-sequence'. Any prefix arguments that were used are
-reapplied to the new key sequence."
-  (let ((next-event (mapcar (lambda (ev) (cons t ev)) key-seq)))
-    (setq prefix-arg current-prefix-arg
-          unread-command-events next-event)))
-
-(defun which-key-turn-page (delta)
-  "Show the next page of keys."
-  (let ((next-page (if which-key--current-page-n
-                       (+ which-key--current-page-n delta) 0)))
-    (which-key-reload-key-sequence (which-key--current-key-list))
-    (if which-key--last-try-2-loc
-        (let ((which-key-side-window-location which-key--last-try-2-loc)
-              (which-key--multiple-locations t))
-          (which-key--show-page next-page))
-      (which-key--show-page next-page))
-    (which-key--start-paging-timer)))
-
-;;;###autoload
-(defun which-key-show-standard-help ()
-  "Call the command in `which-key--prefix-help-cmd-backup'.
-Usually this is `describe-prefix-bindings'."
-  (interactive)
-  (let ((which-key-inhibit t))
-    (which-key--hide-popup-ignore-command)
-    (cond ((eq which-key--prefix-help-cmd-backup
-               'describe-prefix-bindings)
-           ;; This is essentially what `describe-prefix-bindings' does
-           (describe-bindings
-            (kbd (which-key--current-key-string))))
-          ((functionp which-key--prefix-help-cmd-backup)
-           (funcall which-key--prefix-help-cmd-backup)))))
-
-;;;###autoload
-(defun which-key-show-next-page-no-cycle ()
-  "Show next page of keys unless on the last page, in which case
-call `which-key-show-standard-help'."
-  (interactive)
-  (let ((which-key-inhibit t))
-    (if (and which-key--current-page-n
-             which-key--on-last-page)
-        (which-key-show-standard-help)
-      (which-key-turn-page 1))))
-
-;;;###autoload
-(defun which-key-show-previous-page-no-cycle ()
-  "Show previous page of keys unless on the first page, in which
-case do nothing."
-  (interactive)
-  (let ((which-key-inhibit t))
-    (if (and which-key--current-page-n
-             (eq which-key--current-page-n 0))
-        (which-key-turn-page 0)
-      (which-key-turn-page -1))))
-
-;;;###autoload
-(defun which-key-show-next-page-cycle ()
-  "Show the next page of keys, cycling from end to beginning
-after last page."
-  (interactive)
-  (let ((which-key-inhibit t))
-    (which-key-turn-page 1)))
-
-;;;###autoload
-(defun which-key-show-previous-page-cycle ()
-  "Show the previous page of keys, cycling from beginning to end
-after first page."
-  (interactive)
-  (let ((which-key-inhibit t))
-    (which-key-turn-page -1)))
-
-;;;###autoload
-(defun which-key-show-top-level ()
-  "Show top-level bindings."
-  (interactive)
-  (setq which-key--using-top-level t)
-  (which-key--create-buffer-and-show nil))
-
-;;;###autoload
-(defun which-key-undo-key ()
-  "Undo last keypress and force which-key update."
-  (interactive)
-  (let* ((key-lst (butlast (which-key--current-key-list)))
-         (which-key-inhibit t))
-    (cond ((stringp which-key--current-show-keymap-name)
-           (if (keymapp (cdr (car-safe which-key--prior-show-keymap-args)))
-               (let ((args (pop which-key--prior-show-keymap-args)))
-                 (which-key--show-keymap (car args) (cdr args)))
-             (which-key--hide-popup)))
-          (key-lst
-           (which-key-reload-key-sequence key-lst)
-           (which-key--create-buffer-and-show (apply #'vector key-lst)))
-          (t (which-key-show-top-level)))))
-(defalias 'which-key-undo 'which-key-undo-key)
-
-(defun which-key-abort ()
-  "Abort key sequence."
-  (interactive)
-  (let ((which-key-inhibit t))
-    (which-key--hide-popup-ignore-command)
-    (keyboard-quit)))
-
-;;;###autoload
-(defun which-key-C-h-dispatch ()
-  "Dispatch C-h commands by looking up key in
-`which-key-C-h-map'. This command is always accessible (from any
-prefix) if `which-key-use-C-h-commands' is non nil."
-  (interactive)
-  (if (not (which-key--popup-showing-p))
-      (which-key-show-standard-help)
-    (let* ((prefix-keys (key-description which-key--current-prefix))
-           (full-prefix (which-key--full-prefix prefix-keys current-prefix-arg t))
-           (prompt (concat (when (string-equal prefix-keys "")
-                             (propertize
-                              (concat " "
-                                      (or which-key--current-show-keymap-name
-                                          "Top-level bindings"))
-                              'face 'which-key-note-face))
-                           full-prefix
-                           (propertize
-                            (substitute-command-keys
-                             (concat
-                              " \\<which-key-C-h-map>"
-                              " \\[which-key-show-next-page-cycle]"
-                              which-key-separator "next-page,"
-                              " \\[which-key-show-previous-page-cycle]"
-                              which-key-separator "previous-page,"
-                              " \\[which-key-undo-key]"
-                              which-key-separator "undo-key,"
-                              " \\[which-key-show-standard-help]"
-                              which-key-separator "help,"
-                              " \\[which-key-abort]"
-                              which-key-separator "abort"))
-                            'face 'which-key-note-face)))
-           (key (string (read-key prompt)))
-           (cmd (lookup-key which-key-C-h-map key))
-           (which-key-inhibit t))
-      (if cmd (funcall cmd) (which-key-turn-page 0)))))
-
-;;; Update
-
-(defun which-key--any-match-p (regexps string)
-  "Non-nil if any of REGEXPS match STRING."
-  (catch 'match
-    (dolist (regexp regexps)
-      (when (string-match-p regexp string)
-        (throw 'match t)))))
-
-(defun which-key--try-2-side-windows (keys page-n loc1 loc2 &rest _ignore)
-  "Try to show KEYS (PAGE-N) in LOC1 first.
-
-Only if no keys fit fallback to LOC2."
-  (let (pages1)
-    (let ((which-key-side-window-location loc1)
-          (which-key--multiple-locations t))
-      (setq pages1 (which-key--create-pages keys)))
-    (if (< 0 (plist-get pages1 :n-pages))
-        (progn
-          (setq which-key--pages-plist pages1)
-          (let ((which-key-side-window-location loc1)
-                (which-key--multiple-locations t))
-            (which-key--show-page page-n))
-          loc1)
-      (let ((which-key-side-window-location loc2)
-            (which-key--multiple-locations t))
-        (setq which-key--pages-plist
-              (which-key--create-pages keys))
-        (which-key--show-page page-n)
-        loc2))))
-
-(defun which-key-show-keymap ()
-  "Show the top-level bindings in KEYMAP using which-key. KEYMAP
-is selected interactively from all available keymaps."
-  (interactive)
-  (let ((keymap-sym (intern
-                     (completing-read
-                      "Keymap: " obarray
-                      (lambda (m)
-                        (and (boundp m)
-                             (keymapp (symbol-value m))
-                             (not (equal (symbol-value m)
-                                         (make-sparse-keymap)))))
-                      t nil 'which-key-keymap-history))))
-    (which-key--show-keymap (symbol-name keymap-sym)
-                            (symbol-value keymap-sym))))
-
-(defun which-key-show-minor-mode-keymap ()
-  "Show the top-level bindings in KEYMAP using which-key. KEYMAP
-is selected interactively by mode in `minor-mode-map-alist'."
-  (interactive)
-  (let ((mode-sym
-         (intern
-          (completing-read
-           "Minor Mode: "
-           (mapcar 'car
-                   (cl-remove-if-not
-                    (lambda (entry)
-                      (and (symbol-value (car entry))
-                           (not (equal (cdr entry) (make-sparse-keymap)))))
-                    minor-mode-map-alist))
-           nil t nil 'which-key-keymap-history))))
-    (which-key--show-keymap (symbol-name mode-sym)
-                            (cdr (assq mode-sym minor-mode-map-alist)))))
-
-(defun which-key--show-keymap (keymap-name keymap &optional prior-args)
-  (setq which-key--current-prefix nil
-        which-key--current-show-keymap-name keymap-name
-        which-key--using-show-keymap t)
-  (when prior-args (push prior-args which-key--prior-show-keymap-args))
-  (when (keymapp keymap)
-    (let ((formatted-keys (which-key--get-formatted-key-bindings
-                           (which-key--get-keymap-bindings keymap))))
-      (cond ((= (length formatted-keys) 0)
-             (message "which-key: Keymap empty"))
-            ((listp which-key-side-window-location)
-             (setq which-key--last-try-2-loc
-                   (apply #'which-key--try-2-side-windows
-                          formatted-keys 0 which-key-side-window-location)))
-            (t (setq which-key--pages-plist
-                     (which-key--create-pages formatted-keys))
-               (which-key--show-page 0)))))
-  (let* ((key (key-description (list (read-key))))
-         (next-def (lookup-key keymap (kbd key))))
-    (cond ((and which-key-use-C-h-commands (string= "C-h" key))
-           (which-key-C-h-dispatch))
-          ((keymapp next-def)
-           (which-key--hide-popup-ignore-command)
-           (which-key--show-keymap (concat keymap-name " " key) next-def
-                                   (cons keymap-name keymap)))
-          (t (which-key--hide-popup)))))
-
-(defun which-key--evil-operator-filter (_ev def)
-  (and (functionp def)
-       (evil-get-command-property def :suppress-operator)))
-
-(defun which-key--show-evil-operator-keymap ()
-  (if which-key--inhibit-next-operator-popup
-      (setq which-key--inhibit-next-operator-popup nil)
-    (let ((keymap
-           (make-composed-keymap (list evil-operator-shortcut-map
-                                       evil-operator-state-map
-                                       evil-motion-state-map))))
-      (setq which-key--current-prefix nil
-            which-key--current-show-keymap-name "evil operator/motion keys"
-            which-key--using-show-operator-keymap t)
-      (when (keymapp keymap)
-        (let ((formatted-keys (which-key--get-formatted-key-bindings
-                               (which-key--get-keymap-bindings
-                                keymap 'which-key--evil-operator-filter))))
-          (cond ((= (length formatted-keys) 0)
-                 (message "which-key: Keymap empty"))
-                ((listp which-key-side-window-location)
-                 (setq which-key--last-try-2-loc
-                       (apply #'which-key--try-2-side-windows
-                              formatted-keys 0 which-key-side-window-location)))
-                (t (setq which-key--pages-plist
-                         (which-key--create-pages formatted-keys))
-                   (which-key--show-page 0)))))
-      (let* ((key (key-description (list (read-key)))))
-        (when (string= key "`")
-          ;; evil-goto-mark reads the next char manually
-          (setq which-key--inhibit-next-operator-popup t))
-        (cond ((and which-key-use-C-h-commands (string= "C-h" key))
-               (which-key-C-h-dispatch))
-              ((string= key "ESC")
-               (which-key--hide-popup)
-               (keyboard-quit))
-              (t
-               (which-key--hide-popup)
-               (setq unread-command-events (listify-key-sequence key))))))))
-
-(defun which-key--create-buffer-and-show (&optional prefix-keys from-keymap)
-  "Fill `which-key--buffer' with key descriptions and reformat.
-Finally, show the buffer."
-  (setq which-key--current-prefix prefix-keys
-        which-key--last-try-2-loc nil)
-  (let ((start-time (when which-key--debug (current-time)))
-        (formatted-keys (which-key--get-formatted-key-bindings
-                         (when from-keymap
-                           (which-key--get-keymap-bindings from-keymap))))
-        (prefix-keys (key-description which-key--current-prefix)))
-    (cond ((= (length formatted-keys) 0)
-           (message "%s-  which-key: There are no keys to show" prefix-keys))
-          ((listp which-key-side-window-location)
-           (setq which-key--last-try-2-loc
-                 (apply #'which-key--try-2-side-windows
-                        formatted-keys 0 which-key-side-window-location)))
-          (t (setq which-key--pages-plist
-                   (which-key--create-pages formatted-keys))
-             (which-key--show-page 0)))
-    (when which-key--debug
-      (message "On prefix \"%s\" which-key took %.0f ms." prefix-keys
-               (* 1000 (float-time (time-since start-time)))))))
-
-(defun which-key--update ()
-  "Function run by timer to possibly trigger
-`which-key--create-buffer-and-show'."
-  (let ((prefix-keys (this-single-command-keys))
-        delay-time)
-    (when (and (equal prefix-keys [key-chord])
-               (bound-and-true-p key-chord-mode))
-      (setq prefix-keys
-            (condition-case nil
-                (let ((rkeys (recent-keys)))
-                  (vector 'key-chord
-                          ;; Take the two preceding the last one, because the
-                          ;; read-event call in key-chord seems to add a
-                          ;; spurious key press to this list. Note this is
-                          ;; different from guide-key's method which didn't work
-                          ;; for me.
-                          (aref rkeys (- (length rkeys) 3))
-                          (aref rkeys (- (length rkeys) 2))))
-              (error (progn
-                       (message "which-key error in key-chord handling")
-                       [key-chord])))))
-    (when (and which-key--god-mode-support-enabled
-               (bound-and-true-p god-local-mode)
-               (eq this-command 'god-mode-self-insert))
-      (setq prefix-keys (when which-key--god-mode-key-string
-                          (kbd which-key--god-mode-key-string))))
-    (cond ((and (> (length prefix-keys) 0)
-                (or (keymapp (key-binding prefix-keys))
-                    ;; Some keymaps are stored here like iso-transl-ctl-x-8-map
-                    (keymapp (which-key--safe-lookup-key
-                              key-translation-map prefix-keys))
-                    ;; just in case someone uses one of these
-                    (keymapp (which-key--safe-lookup-key
-                              function-key-map prefix-keys)))
-                (not which-key-inhibit)
-                (or (null which-key-allow-regexps)
-                    (which-key--any-match-p
-                     which-key-allow-regexps (key-description prefix-keys)))
-                (or (null which-key-inhibit-regexps)
-                    (not
-                     (which-key--any-match-p
-                      which-key-inhibit-regexps (key-description prefix-keys))))
-                ;; Do not display the popup if a command is currently being
-                ;; executed
-                (or (and which-key-allow-evil-operators
-                         (bound-and-true-p evil-this-operator))
-                    (and which-key--god-mode-support-enabled
-                         (bound-and-true-p god-local-mode)
-                         (eq this-command 'god-mode-self-insert))
-                    (null this-command)))
-           (when (and (not (equal prefix-keys which-key--current-prefix))
-                      (or (null which-key-delay-functions)
-                          (null (setq delay-time
-                                      (run-hook-with-args-until-success
-                                       'which-key-delay-functions
-                                       (key-description prefix-keys)
-                                       (length prefix-keys))))
-                          (sit-for delay-time)))
-             (which-key--create-buffer-and-show prefix-keys)
-             (when (and which-key-idle-secondary-delay
-                        (not which-key--secondary-timer-active))
-               (which-key--start-timer which-key-idle-secondary-delay t))))
-          ((and which-key-show-transient-maps
-                (keymapp overriding-terminal-local-map)
-                ;; basic test for it being a hydra
-                (not (eq (lookup-key overriding-terminal-local-map "\C-u")
-                         'hydra--universal-argument)))
-           (which-key--create-buffer-and-show
-            nil overriding-terminal-local-map))
-          ((and which-key-show-operator-state-maps
-                (bound-and-true-p evil-state)
-                (eq evil-state 'operator)
-                (not which-key--using-show-operator-keymap))
-           (which-key--show-evil-operator-keymap))
-          ((and which-key--current-page-n
-                (not which-key--using-top-level)
-                (not which-key--using-show-operator-keymap)
-                (not which-key--using-show-keymap))
-           (which-key--hide-popup)))))
-
-;;; Timers
-
-(defun which-key--start-timer (&optional delay secondary)
-  "Activate idle timer to trigger `which-key--update'."
-  (which-key--stop-timer)
-  (setq which-key--secondary-timer-active secondary)
-  (setq which-key--timer
-        (run-with-idle-timer
-         (if delay
-             delay
-           which-key-idle-delay) t #'which-key--update)))
-
-(defun which-key--stop-timer ()
-  "Deactivate idle timer for `which-key--update'."
-  (when which-key--timer (cancel-timer which-key--timer)))
-
-(defun which-key--start-paging-timer ()
-  "Activate timer to restart which-key after paging."
-  (when which-key--paging-timer (cancel-timer which-key--paging-timer))
-  (which-key--stop-timer)
-  (setq which-key--paging-timer
-        (run-with-idle-timer
-         0.2 t (lambda ()
-                 (when (or (not (member real-last-command
-                                        which-key--paging-functions))
-                           (and (< 0 (length (this-single-command-keys)))
-                                (not (equal which-key--current-prefix
-                                            (this-single-command-keys)))))
-                   (setq which-key--current-page-n nil
-                         which-key--on-last-page nil)
-                   (cancel-timer which-key--paging-timer)
-                   (which-key--start-timer))))))
-
-(provide 'which-key)
-;;; which-key.el ends here
.emacs.d/elpa/which-key-20170817.1107/which-key.elc
Binary file
.emacs.d/elpa/with-editor-20170817.1240/dir
@@ -1,18 +0,0 @@
-This is the file .../info/dir, which contains the
-topmost node of the Info hierarchy, called (dir)Top.
-The first time you invoke Info you start off looking at this node.
-
-File: dir,	Node: Top	This is the top of the INFO tree
-
-  This (the Directory node) gives a menu of major topics.
-  Typing "q" exits, "?" lists all Info commands, "d" returns here,
-  "h" gives a primer for first-timers,
-  "mEmacs<Return>" visits the Emacs manual, etc.
-
-  In Emacs, you can click mouse button 2 on a menu item or cross reference
-  to select it.
-
-* Menu:
-
-Emacs
-* With-Editor: (with-editor).   Using the Emacsclient as $EDITOR.
.emacs.d/elpa/with-editor-20170817.1240/with-editor-autoloads.el
@@ -1,16 +0,0 @@
-;;; with-editor-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-
-;;;### (autoloads nil nil ("with-editor-pkg.el" "with-editor.el")
-;;;;;;  (22977 26778 168080 201000))
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; with-editor-autoloads.el ends here
.emacs.d/elpa/with-editor-20170817.1240/with-editor-pkg.el
@@ -1,8 +0,0 @@
-(define-package "with-editor" "20170817.1240" "Use the Emacsclient as $EDITOR"
-  '((emacs "24.4")
-    (async "1.9"))
-  :url "https://github.com/magit/with-editor" :keywords
-  '("tools"))
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
.emacs.d/elpa/with-editor-20170817.1240/with-editor.el
@@ -1,782 +0,0 @@
-;;; with-editor.el --- Use the Emacsclient as $EDITOR -*- lexical-binding: t -*-
-
-;; Copyright (C) 2014-2017  The Magit Project Contributors
-;;
-;; You should have received a copy of the AUTHORS.md file.  If not,
-;; see https://github.com/magit/with-editor/blob/master/AUTHORS.md.
-
-;; Author: Jonas Bernoulli <jonas@bernoul.li>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Package-Requires: ((emacs "24.4") (async "1.9"))
-;; Keywords: tools
-;; Homepage: https://github.com/magit/with-editor
-
-;; This file is not part of GNU Emacs.
-
-;; 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 3, 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 Magit.  If not, see http://www.gnu.org/licenses.
-
-;;; Commentary:
-
-;; This library makes it possible to reliably use the Emacsclient as
-;; the `$EDITOR' of child processes.  It makes sure that they know how
-;; to call home.  For remote processes a substitute is provided, which
-;; communicates with Emacs on standard output/input instead of using a
-;; socket as the Emacsclient does.
-
-;; It provides the commands `with-editor-async-shell-command' and
-;; `with-editor-shell-command', which are intended as replacements
-;; for `async-shell-command' and `shell-command'.  They automatically
-;; export `$EDITOR' making sure the executed command uses the current
-;; Emacs instance as "the editor".  With a prefix argument these
-;; commands prompt for an alternative environment variable such as
-;; `$GIT_EDITOR'.  To always use these variants add this to your init
-;; file:
-;;
-;;   (define-key (current-global-map)
-;;     [remap async-shell-command] 'with-editor-async-shell-command)
-;;   (define-key (current-global-map)
-;;     [remap shell-command] 'with-editor-shell-command)
-
-;; Alternatively use the global `shell-command-with-editor-mode',
-;; which always sets `$EDITOR' for all Emacs commands which ultimately
-;; use `shell-command' to asynchronously run some shell command.
-
-;; The command `with-editor-export-editor' exports `$EDITOR' or
-;; another such environment variable in `shell-mode', `term-mode' and
-;; `eshell-mode' buffers.  Use this Emacs command before executing a
-;; shell command which needs the editor set, or always arrange for the
-;; current Emacs instance to be used as editor by adding it to the
-;; appropriate mode hooks:
-;;
-;;   (add-hook 'shell-mode-hook  'with-editor-export-editor)
-;;   (add-hook 'term-exec-hook   'with-editor-export-editor)
-;;   (add-hook 'eshell-mode-hook 'with-editor-export-editor)
-
-;; Some variants of this function exist, these two forms are
-;; equivalent:
-;;
-;;   (add-hook 'shell-mode-hook
-;;             (apply-partially 'with-editor-export-editor "GIT_EDITOR"))
-;;   (add-hook 'shell-mode-hook 'with-editor-export-git-editor)
-
-;; This library can also be used by other packages which need to use
-;; the current Emacs instance as editor.  In fact this library was
-;; written for Magit and its `git-commit-mode' and `git-rebase-mode'.
-;; Consult `git-rebase.el' and the related code in `magit-sequence.el'
-;; for a simple example.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'server)
-(require 'shell)
-
-(and (require 'async-bytecomp nil t)
-     (memq 'magit (bound-and-true-p async-bytecomp-allowed-packages))
-     (fboundp 'async-bytecomp-package-mode)
-     (async-bytecomp-package-mode 1))
-
-(eval-when-compile
-  (progn (require 'dired nil t)
-         (require 'eshell nil t)
-         (require 'term nil t)
-         (require 'warnings nil t)))
-(declare-function dired-get-filename 'dired)
-(declare-function term-emulate-terminal 'term)
-(defvar eshell-preoutput-filter-functions)
-
-;;; Options
-
-(defgroup with-editor nil
-  "Use the Emacsclient as $EDITOR."
-  :group 'external
-  :group 'server)
-
-(defun with-editor-locate-emacsclient ()
-  "Search for a suitable Emacsclient executable."
-  (or (with-editor-locate-emacsclient-1
-       (with-editor-emacsclient-path)
-       (length (split-string emacs-version "\\.")))
-      (prog1 nil (display-warning 'with-editor "\
-Cannot determine a suitable Emacsclient
-
-Determining an Emacsclient executable suitable for the
-current Emacs instance failed.  For more information
-please see https://github.com/magit/magit/wiki/Emacsclient."))))
-
-(defun with-editor-locate-emacsclient-1 (path depth)
-  (let* ((version-lst (cl-subseq (split-string emacs-version "\\.") 0 depth))
-         (version-reg (concat "^" (mapconcat #'identity version-lst "\\."))))
-    (or (locate-file-internal
-         (if (equal invocation-name "remacs") "remacsclient" "emacsclient")
-         path
-         (cl-mapcan
-          (lambda (v) (cl-mapcar (lambda (e) (concat v e)) exec-suffixes))
-          (nconc (and (boundp 'debian-emacs-flavor)
-                      (list (format ".%s" debian-emacs-flavor)))
-                 (cl-mapcon (lambda (v)
-                              (setq v (mapconcat #'identity (reverse v) "."))
-                              (list v (concat "-" v) (concat ".emacs" v)))
-                            (reverse version-lst))
-                 (list "" "-snapshot" ".emacs-snapshot")))
-         (lambda (exec)
-           (ignore-errors
-             (string-match-p version-reg
-                             (with-editor-emacsclient-version exec)))))
-        (and (> depth 1)
-             (with-editor-locate-emacsclient-1 path (1- depth))))))
-
-(defun with-editor-emacsclient-version (exec)
-  (let ((default-directory (file-name-directory exec)))
-    (ignore-errors
-      (cadr (split-string (car (process-lines exec "--version")))))))
-
-(defun with-editor-emacsclient-path ()
-  (let ((path exec-path))
-    (when invocation-directory
-      (push (directory-file-name invocation-directory) path)
-      (let* ((linkname (expand-file-name invocation-name invocation-directory))
-             (truename (file-chase-links linkname)))
-        (unless (equal truename linkname)
-          (push (directory-file-name (file-name-directory truename)) path)))
-      (when (eq system-type 'darwin)
-        (let ((dir (expand-file-name "bin" invocation-directory)))
-          (when (file-directory-p dir)
-            (push dir path)))
-        (when (string-match-p "Cellar" invocation-directory)
-          (let ((dir (expand-file-name "../../../bin" invocation-directory)))
-            (when (file-directory-p dir)
-              (push dir path))))))
-    (cl-remove-duplicates path :test 'equal)))
-
-(defcustom with-editor-emacsclient-executable (with-editor-locate-emacsclient)
-  "The Emacsclient executable used by the `with-editor' macro."
-  :group 'with-editor
-  :type '(choice (string :tag "Executable")
-                 (const  :tag "Don't use Emacsclient" nil)))
-
-(defcustom with-editor-sleeping-editor "\
-sh -c '\
-echo \"WITH-EDITOR: $$ OPEN $0\"; \
-sleep 604800 & sleep=$!; \
-trap \"kill $sleep; exit 0\" USR1; \
-trap \"kill $sleep; exit 1\" USR2; \
-wait $sleep'"
-  "The sleeping editor, used when the Emacsclient cannot be used.
-
-This fallback is used for asynchronous processes started inside
-the macro `with-editor', when the process runs on a remote machine
-or for local processes when `with-editor-emacsclient-executable'
-is nil (i.e. when no suitable Emacsclient was found, or the user
-decided not to use it).
-
-Where the latter uses a socket to communicate with Emacs' server,
-this substitute prints edit requests to its standard output on
-which a process filter listens for such requests.  As such it is
-not a complete substitute for a proper Emacsclient, it can only
-be used as $EDITOR of child process of the current Emacs instance.
-
-Some shells do not execute traps immediately when waiting for a
-child process, but by default we do use such a blocking child
-process.
-
-If you use such a shell (e.g. `csh' on FreeBSD, but not Debian),
-then you have to edit this option.  You can either replace \"sh\"
-with \"bash\" (and install that), or you can use the older, less
-performant implementation:
-
-  \"sh -c '\\
-  echo \\\"WITH-EDITOR: $$ OPEN $0\\\"; \\
-  trap \\\"exit 0\\\" USR1; \\
-  trap \\\"exit 1\" USR2; \\
-  while true; do sleep 1; done'\"
-
-Note that this leads to a delay of up to a second.  The delay can
-be shortened by replacing \"sleep 1\" with \"sleep 0.01\", or if your
-implementation does not support floats, then by using `nanosleep'
-instead."
-  :group 'with-editor
-  :type 'string)
-
-(defcustom with-editor-finish-query-functions nil
-  "List of functions called to query before finishing session.
-
-The buffer in question is current while the functions are called.
-If any of them returns nil, then the session is not finished and
-the buffer is not killed.  The user should then fix the issue and
-try again.  The functions are called with one argument.  If it is
-non-nil then that indicates that the user used a prefix argument
-to force finishing the session despite issues.  Functions should
-usually honor that and return non-nil."
-  :group 'with-editor
-  :type 'hook)
-(put 'with-editor-finish-query-functions 'permanent-local t)
-
-(defcustom with-editor-cancel-query-functions nil
-  "List of functions called to query before canceling session.
-
-The buffer in question is current while the functions are called.
-If any of them returns nil, then the session is not canceled and
-the buffer is not killed.  The user should then fix the issue and
-try again.  The functions are called with one argument.  If it is
-non-nil then that indicates that the user used a prefix argument
-to force canceling the session despite issues.  Functions should
-usually honor that and return non-nil."
-  :group 'with-editor
-  :type 'hook)
-(put 'with-editor-cancel-query-functions 'permanent-local t)
-
-(defcustom with-editor-mode-lighter " WE"
-  "The mode-line lighter of the With-Editor mode."
-  :group 'with-editor
-  :type '(choice (const :tag "No lighter" "") string))
-
-(defvar with-editor-server-window-alist nil
-  "Alist of filename patterns vs corresponding `server-window'.
-
-Each element looks like (REGEXP . FUNCTION).  Files matching
-REGEXP are selected using FUNCTION instead of the default in
-`server-window'.
-
-Note that when a package adds an entry here then it probably
-has a reason to disrespect `server-window' and it likely is
-not a good idea to change such entries.")
-
-(defvar with-editor-file-name-history-exclude nil
-  "List of regexps for filenames `server-visit' should not remember.
-When a filename matches any of the regexps, then `server-visit'
-does not add it to the variable `file-name-history', which is
-used when reading a filename in the minibuffer.")
-
-;;; Mode Commands
-
-(defvar with-editor-pre-finish-hook nil)
-(defvar with-editor-pre-cancel-hook nil)
-(defvar with-editor-post-finish-hook nil)
-(defvar with-editor-post-finish-hook-1 nil)
-(defvar with-editor-post-cancel-hook nil)
-(defvar with-editor-post-cancel-hook-1 nil)
-(defvar with-editor-cancel-alist nil)
-(put 'with-editor-pre-finish-hook 'permanent-local t)
-(put 'with-editor-pre-cancel-hook 'permanent-local t)
-(put 'with-editor-post-finish-hook 'permanent-local t)
-(put 'with-editor-post-cancel-hook 'permanent-local t)
-
-(defvar with-editor-show-usage t)
-(defvar with-editor-cancel-message nil)
-(defvar with-editor-previous-winconf nil)
-(make-variable-buffer-local 'with-editor-show-usage)
-(make-variable-buffer-local 'with-editor-cancel-message)
-(make-variable-buffer-local 'with-editor-previous-winconf)
-(put 'with-editor-cancel-message 'permanent-local t)
-(put 'with-editor-previous-winconf 'permanent-local t)
-
-(defvar-local with-editor--pid nil "For internal use.")
-(put 'with-editor--pid 'permanent-local t)
-
-(defun with-editor-finish (force)
-  "Finish the current edit session."
-  (interactive "P")
-  (when (run-hook-with-args-until-failure
-         'with-editor-finish-query-functions force)
-    (let ((with-editor-post-finish-hook-1
-           (ignore-errors (delq t with-editor-post-finish-hook))))
-      (run-hooks 'with-editor-pre-finish-hook)
-      (with-editor-return nil)
-      (accept-process-output nil 0.1)
-      (run-hooks 'with-editor-post-finish-hook-1))))
-
-(defun with-editor-cancel (force)
-  "Cancel the current edit session."
-  (interactive "P")
-  (when (run-hook-with-args-until-failure
-         'with-editor-cancel-query-functions force)
-    (let ((message with-editor-cancel-message))
-      (when (functionp message)
-        (setq message (funcall message)))
-      (let ((with-editor-post-cancel-hook-1
-             (ignore-errors (delq t with-editor-post-cancel-hook)))
-            (with-editor-cancel-alist nil))
-        (run-hooks 'with-editor-pre-cancel-hook)
-        (with-editor-return t)
-        (accept-process-output nil 0.1)
-        (run-hooks 'with-editor-post-cancel-hook-1))
-      (message (or message "Canceled by user")))))
-
-(defun with-editor-return (cancel)
-  (let ((winconf with-editor-previous-winconf)
-        (clients server-buffer-clients)
-        (dir default-directory)
-        (pid with-editor--pid))
-    (remove-hook 'kill-buffer-query-functions
-                 'with-editor-kill-buffer-noop t)
-    (cond (cancel
-           (save-buffer)
-           (if clients
-               (dolist (client clients)
-                 (ignore-errors
-                   (server-send-string client "-error Canceled by user"))
-                 (delete-process client))
-             ;; Fallback for when emacs was used as $EDITOR
-             ;; instead of emacsclient or the sleeping editor.
-             ;; See https://github.com/magit/magit/issues/2258.
-             (ignore-errors (delete-file buffer-file-name))
-             (kill-buffer)))
-          (t
-           (save-buffer)
-           (if clients
-               ;; Don't use `server-edit' because we do not want to
-               ;; show another buffer belonging to another client.
-               ;; See https://github.com/magit/magit/issues/2197.
-               (server-done)
-             (kill-buffer))))
-    (when pid
-      (let ((default-directory dir))
-        (process-file "kill" nil nil nil
-                      "-s" (if cancel "USR2" "USR1") pid)))
-    (when (and winconf (eq (window-configuration-frame winconf)
-                           (selected-frame)))
-      (set-window-configuration winconf))))
-
-;;; Mode
-
-(defvar with-editor-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "\C-c\C-c"                           'with-editor-finish)
-    (define-key map [remap server-edit]                  'with-editor-finish)
-    (define-key map [remap evil-save-and-close]          'with-editor-finish)
-    (define-key map [remap evil-save-modified-and-close] 'with-editor-finish)
-    (define-key map "\C-c\C-k"                           'with-editor-cancel)
-    (define-key map [remap kill-buffer]                  'with-editor-cancel)
-    (define-key map [remap ido-kill-buffer]              'with-editor-cancel)
-    (define-key map [remap iswitchb-kill-buffer]         'with-editor-cancel)
-    (define-key map [remap evil-quit]                    'with-editor-cancel)
-    map))
-
-(define-minor-mode with-editor-mode
-  "Edit a file as the $EDITOR of an external process."
-  :lighter with-editor-mode-lighter
-  ;; Protect the user from killing the buffer without using
-  ;; either `with-editor-finish' or `with-editor-cancel',
-  ;; and from removing the key bindings for these commands.
-  (unless with-editor-mode
-    (user-error "With-Editor mode cannot be turned off"))
-  (add-hook 'kill-buffer-query-functions
-            'with-editor-kill-buffer-noop nil t)
-  ;; `server-execute' displays a message which is not
-  ;; correct when using this mode.
-  (when with-editor-show-usage
-    (with-editor-usage-message)))
-
-(put 'with-editor-mode 'permanent-local t)
-
-(defun with-editor-kill-buffer-noop ()
-  (user-error (substitute-command-keys "\
-Don't kill this buffer.  Instead cancel using \\[with-editor-cancel]")))
-
-(defun with-editor-usage-message ()
-  ;; Run after `server-execute', which is run using
-  ;; a timer which starts immediately.
-  (run-with-timer
-   0.01 nil `(lambda ()
-               (with-current-buffer ,(current-buffer)
-                 (message (substitute-command-keys "\
-Type \\[with-editor-finish] to finish, \
-or \\[with-editor-cancel] to cancel"))))))
-
-;;; Wrappers
-
-(defvar with-editor--envvar nil "For internal use.")
-
-(defmacro with-editor (&rest body)
-  "Use the Emacsclient as $EDITOR while evaluating BODY.
-Modify the `process-environment' for processes started in BODY,
-instructing them to use the Emacsclient as $EDITOR.  If optional
-ENVVAR is provided then bind that environment variable instead.
-\n(fn [ENVVAR] BODY...)"
-  (declare (indent defun) (debug (body)))
-  `(let ((with-editor--envvar ,(if (stringp (car body))
-                                   (pop body)
-                                 '(or with-editor--envvar "EDITOR")))
-         (process-environment process-environment))
-     (with-editor--setup)
-     ,@body))
-
-(defun with-editor--setup ()
-  (if (or (not with-editor-emacsclient-executable)
-          (file-remote-p default-directory))
-      (push (concat with-editor--envvar "=" with-editor-sleeping-editor)
-            process-environment)
-    ;; Make sure server-use-tcp's value is valid.
-    (unless (featurep 'make-network-process '(:family local))
-      (setq server-use-tcp t))
-    ;; Make sure the server is running.
-    (unless server-process
-      (when (server-running-p server-name)
-        (setq server-name (format "server%s" (emacs-pid)))
-        (when (server-running-p server-name)
-          (server-force-delete server-name)))
-      (server-start))
-    ;; Tell $EDITOR to use the Emacsclient.
-    (push (concat with-editor--envvar "="
-                  (shell-quote-argument with-editor-emacsclient-executable)
-                  ;; Tell the process where the server file is.
-                  (and (not server-use-tcp)
-                       (concat " --socket-name="
-                               (shell-quote-argument
-                                (expand-file-name server-name
-                                                  server-socket-dir)))))
-          process-environment)
-    (when server-use-tcp
-      (push (concat "EMACS_SERVER_FILE="
-                    (expand-file-name server-name server-auth-dir))
-            process-environment))
-    ;; As last resort fallback to the sleeping editor.
-    (push (concat "ALTERNATE_EDITOR=" with-editor-sleeping-editor)
-          process-environment)))
-  
-(defun with-editor-server-window ()
-  (or (and buffer-file-name
-           (cdr (cl-find-if (lambda (cons)
-                              (string-match-p (car cons) buffer-file-name))
-                            with-editor-server-window-alist)))
-      server-window))
-
-(defun server-switch-buffer--with-editor-server-window-alist
-    (fn &optional next-buffer killed-one filepos)
-  "Honor `with-editor-server-window-alist' (which see)."
-  (let ((server-window (with-current-buffer
-                           (or next-buffer (current-buffer))
-                         (when with-editor-mode
-                           (setq with-editor-previous-winconf
-                                 (current-window-configuration)))
-                         (with-editor-server-window))))
-    (funcall fn next-buffer killed-one filepos)))
-
-(advice-add 'server-switch-buffer :around
-            'server-switch-buffer--with-editor-server-window-alist)
-
-(defun start-file-process--with-editor-process-filter
-    (fn name buffer program &rest program-args)
-  "When called inside a `with-editor' form and the Emacsclient
-cannot be used, then give the process the filter function
-`with-editor-process-filter'.  To avoid overriding the filter
-being added here you should use `with-editor-set-process-filter'
-instead of `set-process-filter' inside `with-editor' forms.
-
-When the `default-directory' is located on a remote machine,
-then also manipulate PROGRAM and PROGRAM-ARGS in order to set
-the appropriate editor environment variable."
-  (if (not with-editor--envvar)
-      (apply fn name buffer program program-args)
-    (when (file-remote-p default-directory)
-      (unless (equal program "env")
-        (push program program-args)
-        (setq program "env"))
-      (push (concat with-editor--envvar "=" with-editor-sleeping-editor)
-            program-args))
-    (let ((process (apply fn name buffer program program-args)))
-      (set-process-filter process 'with-editor-process-filter)
-      (process-put process 'default-dir default-directory)
-      process)))
-
-(advice-add 'start-file-process :around
-            'start-file-process--with-editor-process-filter)
-
-(defun with-editor-set-process-filter (process filter)
-  "Like `set-process-filter' but keep `with-editor-process-filter'.
-Give PROCESS the new FILTER but keep `with-editor-process-filter'
-if that was added earlier by the adviced `start-file-process'.
-
-Do so by wrapping the two filter functions using a lambda, which
-becomes the actual filter.  It calls `with-editor-process-filter'
-first, passing t as NO-STANDARD-FILTER.  Then it calls FILTER,
-which may or may not insert the text into the PROCESS' buffer."
-  (set-process-filter
-   process
-   (if (eq (process-filter process) 'with-editor-process-filter)
-       `(lambda (proc str)
-          (,filter proc str)
-          (with-editor-process-filter proc str t))
-     filter)))
-
-(defvar with-editor-filter-visit-hook nil)
-
-(defun with-editor-output-filter (string)
-  (save-match-data
-    (if (string-match "^WITH-EDITOR: \\([0-9]+\\) OPEN \\(.+?\\)\r?$" string)
-        (let ((pid  (match-string 1 string))
-              (file (match-string 2 string)))
-          (with-current-buffer
-              (find-file-noselect
-               (if (file-name-absolute-p file)
-                   (concat (file-remote-p default-directory) file)
-                 (expand-file-name file)))
-            (with-editor-mode 1)
-            (setq with-editor--pid pid)
-            (run-hooks 'with-editor-filter-visit-hook)
-            (funcall (or (with-editor-server-window) 'switch-to-buffer)
-                     (current-buffer))
-            (kill-local-variable 'server-window))
-          nil)
-      string)))
-
-(defun with-editor-process-filter
-    (process string &optional no-default-filter)
-  "Listen for edit requests by child processes."
-  (let ((default-directory (process-get process 'default-dir)))
-    (with-editor-output-filter string))
-  (unless no-default-filter
-    (internal-default-process-filter process string)))
-
-(advice-add 'server-visit-files :after
-            'server-visit-files--with-editor-file-name-history-exclude)
-
-(defun server-visit-files--with-editor-file-name-history-exclude
-    (files _proc &optional _nowait)
-  (dolist (file files)
-    (setq  file (car file))
-    (when (cl-find-if (lambda (regexp)
-                        (string-match-p regexp file))
-                      with-editor-file-name-history-exclude)
-      (setq file-name-history (delete file file-name-history)))))
-
-;;; Augmentations
-
-(cl-defun with-editor-export-editor (&optional (envvar "EDITOR"))
-  "Teach subsequent commands to use current Emacs instance as editor.
-
-Set and export the environment variable ENVVAR, by default
-\"EDITOR\".  The value is automatically generated to teach
-commands to use the current Emacs instance as \"the editor\".
-
-This works in `shell-mode', `term-mode' and `eshell-mode'."
-  (interactive (list (with-editor-read-envvar)))
-  (cond
-   ((derived-mode-p 'comint-mode 'term-mode)
-    (let* ((process (get-buffer-process (current-buffer)))
-           (filter  (process-filter process)))
-      (goto-char (process-mark process))
-      (process-send-string
-       process (format " export %s=%s\n" envvar
-                       (shell-quote-argument with-editor-sleeping-editor)))
-      (while (accept-process-output process 0.1))
-      (set-process-filter process filter)
-      (if (derived-mode-p 'term-mode)
-          (with-editor-set-process-filter process 'with-editor-emulate-terminal)
-        (add-hook 'comint-output-filter-functions 'with-editor-output-filter
-                  nil t))))
-   ((derived-mode-p 'eshell-mode)
-    (add-to-list 'eshell-preoutput-filter-functions
-                 'with-editor-output-filter)
-    (setenv envvar with-editor-sleeping-editor))
-   (t
-    (error "Cannot export environment variables in this buffer")))
-  (message "Successfully exported %s" envvar))
-
-(defun with-editor-export-git-editor ()
-  "Like `with-editor-export-editor' but always set `$GIT_EDITOR'."
-  (interactive)
-  (with-editor-export-editor "GIT_EDITOR"))
-
-(defun with-editor-export-hg-editor ()
-  "Like `with-editor-export-editor' but always set `$HG_EDITOR'."
-  (interactive)
-  (with-editor-export-editor "HG_EDITOR"))
-
-(defun with-editor-emulate-terminal (process string)
-  "Like `term-emulate-terminal' but also handle edit requests."
-  (when (with-editor-output-filter string)
-    (term-emulate-terminal process string)))
-
-(defvar with-editor-envvars '("EDITOR" "GIT_EDITOR" "HG_EDITOR"))
-
-(cl-defun with-editor-read-envvar
-    (&optional (prompt  "Set environment variable")
-               (default "EDITOR"))
-  (let ((reply (completing-read (if default
-                                    (format "%s (%s): " prompt default)
-                                  (concat prompt ": "))
-                                with-editor-envvars nil nil nil nil default)))
-    (if (string= reply "") (user-error "Nothing selected") reply)))
-
-(define-minor-mode shell-command-with-editor-mode
-  "Teach `shell-command' to use current Emacs instance as editor.
-
-Teach `shell-command', and all commands that ultimately call that
-command, to use the current Emacs instance as editor by executing
-\"EDITOR=CLIENT COMMAND&\" instead of just \"COMMAND&\".
-
-CLIENT is automatically generated; EDITOR=CLIENT instructs
-COMMAND to use to the current Emacs instance as \"the editor\",
-assuming no other variable overrides the effect of \"$EDITOR\".
-CLIENT may be the path to an appropriate emacsclient executable
-with arguments, or a script which also works over Tramp.
-
-Alternatively you can use the `with-editor-async-shell-command',
-which also allows the use of another variable instead of
-\"EDITOR\"."
-  :global t)
-
-(defun with-editor-async-shell-command
-    (command &optional output-buffer error-buffer envvar)
-  "Like `async-shell-command' but with `$EDITOR' set.
-
-Execute string \"ENVVAR=CLIENT COMMAND\" in an inferior shell;
-display output, if any.  With a prefix argument prompt for an
-environment variable, otherwise the default \"EDITOR\" variable
-is used.  With a negative prefix argument additionally insert
-the COMMAND's output at point.
-
-CLIENT is automatically generated; ENVVAR=CLIENT instructs
-COMMAND to use to the current Emacs instance as \"the editor\",
-assuming it respects ENVVAR as an \"EDITOR\"-like variable.
-CLIENT maybe the path to an appropriate emacsclient executable
-with arguments, or a script which also works over Tramp.
-
-Also see `async-shell-command' and `shell-command'."
-  (interactive (with-editor-shell-command-read-args "Async shell command: " t))
-  (let ((with-editor--envvar envvar))
-    (with-editor
-      (async-shell-command command output-buffer error-buffer))))
-
-(defun with-editor-shell-command
-    (command &optional output-buffer error-buffer envvar)
-  "Like `shell-command' or `with-editor-async-shell-command'.
-If COMMAND ends with \"&\" behave like the latter,
-else like the former."
-  (interactive (with-editor-shell-command-read-args "Shell command: "))
-  (if (string-match "&[ \t]*\\'" command)
-      (with-editor-async-shell-command
-       command output-buffer error-buffer envvar)
-    (shell-command command output-buffer error-buffer)))
-
-(defun with-editor-shell-command-read-args (prompt &optional async)
-  (let ((command (read-shell-command
-                  prompt nil nil
-                  (let ((filename (or buffer-file-name
-                                      (and (eq major-mode 'dired-mode)
-                                           (dired-get-filename nil t)))))
-                    (and filename (file-relative-name filename))))))
-    (list command
-          (if (or async (setq async (string-match-p "&[ \t]*\\'" command)))
-              (< (prefix-numeric-value current-prefix-arg) 0)
-            current-prefix-arg)
-          shell-command-default-error-buffer
-          (and async current-prefix-arg (with-editor-read-envvar)))))
-
-(defun shell-command--shell-command-with-editor-mode
-    (fn command &optional output-buffer error-buffer)
-  ;; `shell-mode' and its hook are intended for buffers in which an
-  ;; interactive shell is running, but `shell-command' also turns on
-  ;; that mode, even though it only runs the shell to run a single
-  ;; command.  The `with-editor-export-editor' hook function is only
-  ;; intended to be used in buffers in which an interactive shell is
-  ;; running, so it has to be remove here.
-  (let ((shell-mode-hook (remove 'with-editor-export-editor shell-mode-hook)))
-    (cond ((or (not (or with-editor--envvar shell-command-with-editor-mode))
-               (not (string-match-p "&\\'" command)))
-           (funcall fn command output-buffer error-buffer))
-          ((and with-editor-emacsclient-executable
-                (not (file-remote-p default-directory)))
-           (with-editor (funcall fn command output-buffer error-buffer)))
-          (t
-           (apply fn (format "%s=%s %s"
-                             (or with-editor--envvar "EDITOR")
-                             (shell-quote-argument with-editor-sleeping-editor)
-                             command)
-                  output-buffer error-buffer)
-           (ignore-errors
-             (let ((process (get-buffer-process
-                             (or output-buffer
-                                 (get-buffer "*Async Shell Command*")))))
-               (set-process-filter
-                process (lambda (proc str)
-                          (comint-output-filter proc str)
-                          (with-editor-process-filter proc str t)))
-               process))))))
-
-(advice-add 'shell-command :around
-            'shell-command--shell-command-with-editor-mode)
-
-;;; with-editor.el ends soon
-
-(defun with-editor-debug ()
-  "Debug configuration issues.
-See info node `(with-editor)Debugging' for instructions."
-  (interactive)
-  (with-current-buffer (get-buffer-create "*with-editor-debug*")
-    (pop-to-buffer (current-buffer))
-    (erase-buffer)
-    (ignore-errors (with-editor))
-    (insert
-     (format "with-editor: %s\n" (locate-library "with-editor.el"))
-     (format "emacs: %s (%s)\n"
-             (expand-file-name invocation-name invocation-directory)
-             emacs-version)
-     "system:\n"
-     (format "  system-type: %s\n" system-type)
-     (format "  system-configuration: %s\n" system-configuration)
-     (format "  system-configuration-options: %s\n" system-configuration-options)
-     "server:\n"
-     (format "  server-running-p: %s\n" (server-running-p))
-     (format "  server-process: %S\n" server-process)
-     (format "  server-use-tcp: %s\n" server-use-tcp)
-     (format "  server-name: %s\n" server-name)
-     (format "  server-socket-dir: %s\n" server-socket-dir))
-    (if (and server-socket-dir (file-accessible-directory-p server-socket-dir))
-        (dolist (file (directory-files server-socket-dir nil "^[^.]"))
-          (insert (format "    %s\n" file)))
-      (insert (format "    %s: not an accessible directory\n"
-                      (if server-use-tcp "WARNING" "ERROR"))))
-    (insert (format "  server-auth-dir: %s\n" server-auth-dir))
-    (if (file-accessible-directory-p server-auth-dir)
-        (dolist (file (directory-files server-auth-dir nil "^[^.]"))
-          (insert (format "    %s\n" file)))
-      (insert (format "    %s: not an accessible directory\n"
-                      (if server-use-tcp "ERROR" "WARNING"))))
-    (let ((val with-editor-emacsclient-executable)
-          (def (default-value 'with-editor-emacsclient-executable))
-          (fun (let ((warning-minimum-level :error)
-                     (warning-minimum-log-level :error))
-                 (with-editor-locate-emacsclient))))
-      (insert "with-editor-emacsclient-executable:\n"
-              (format " value:   %s (%s)\n" val
-                      (and val (with-editor-emacsclient-version val)))
-              (format " default: %s (%s)\n" def
-                      (and def (with-editor-emacsclient-version def)))
-              (format " funcall: %s (%s)\n" fun
-                      (and fun (with-editor-emacsclient-version fun)))))
-    (insert "path:\n"
-            (format "  $PATH: %S\n" (getenv "PATH"))
-            (format "  exec-path: %s\n" exec-path))
-    (insert (format "  with-editor-emacsclient-path:\n"))
-    (dolist (dir (with-editor-emacsclient-path))
-      (insert (format "    %s (%s)\n" dir (car (file-attributes dir))))
-      (when (file-directory-p dir)
-        ;; Don't match emacsclientw.exe, it makes popup windows.
-        (dolist (exec (directory-files dir t "emacsclient\\(?:[^w]\\|\\'\\)"))
-          (insert (format "      %s (%s)\n" exec
-                          (with-editor-emacsclient-version exec))))))))
-
-(defconst with-editor-font-lock-keywords
-  '(("(\\(with-\\(?:git-\\)?editor\\)\\_>" (1 'font-lock-keyword-face))))
-(font-lock-add-keywords 'emacs-lisp-mode with-editor-font-lock-keywords)
-
-(provide 'with-editor)
-;; Local Variables:
-;; indent-tabs-mode: nil
-;; End:
-;;; with-editor.el ends here
.emacs.d/elpa/with-editor-20170817.1240/with-editor.elc
Binary file
.emacs.d/elpa/with-editor-20170817.1240/with-editor.info
@@ -1,328 +0,0 @@
-This is with-editor.info, produced by makeinfo version 5.2 from
-with-editor.texi.
-
-     Copyright (C) 2015-2017 Jonas Bernoulli <jonas@bernoul.li>
-
-     You can redistribute this document 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 document 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.
-INFO-DIR-SECTION Emacs
-START-INFO-DIR-ENTRY
-* With-Editor: (with-editor). Using the Emacsclient as $EDITOR.
-END-INFO-DIR-ENTRY
-
-
-File: with-editor.info,  Node: Top,  Next: Using the With-Editor package,  Up: (dir)
-
-With-Editor User Manual
-***********************
-
-The library ‘with-editor’ makes it easy to use the Emacsclient as the
-‘$EDITOR’ of child processes, making sure they know how to call home.
-For remote processes a substitute is provided, which communicates with
-Emacs on standard output instead of using a socket as the Emacsclient
-does.
-
-   This library was written because Magit has to be able to do the above
-to allow the user to edit commit messages gracefully and to edit rebase
-sequences, which wouldn’t be possible at all otherwise.
-
-   Because other packages can benefit from such functionality, this
-library is made available as a separate package.  It also defines some
-additional functionality which makes it useful even for end-users, who
-don’t use Magit or another package which uses it internally.
-
-     Copyright (C) 2015-2017 Jonas Bernoulli <jonas@bernoul.li>
-
-     You can redistribute this document 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 document 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.
-
-* Menu:
-
-* Using the With-Editor package::
-* Using With-Editor as a library::
-* Debugging::
-
-— The Detailed Node Listing —
-
-Using the With-Editor package
-
-* Configuring With-Editor::
-* Using With-Editor commands::
-
-
-File: with-editor.info,  Node: Using the With-Editor package,  Next: Using With-Editor as a library,  Prev: Top,  Up: Top
-
-1 Using the With-Editor package
-*******************************
-
-The ‘With-Editor’ package is used internally by Magit when editing
-commit messages and rebase sequences.  It also provides some commands
-and features which are useful by themselves, even if you don’t use
-Magit.
-
-   For information about using this library in you own package, see
-*note Using With-Editor as a library::.
-
-* Menu:
-
-* Configuring With-Editor::
-* Using With-Editor commands::
-
-
-File: with-editor.info,  Node: Configuring With-Editor,  Next: Using With-Editor commands,  Up: Using the With-Editor package
-
-1.1 Configuring With-Editor
-===========================
-
-With-Editor tries very hard to locate a suitable ‘emacsclient’
-executable, so ideally you should never have to customize the option
-‘with-editor-emacsclient-executable’.  When it fails to do so, then the
-most likely reason is that someone found yet another way to package
-Emacs (most likely on macOS) without putting the executable on ‘$PATH’,
-and we have to add another kludge to find it anyway.
-
- -- User Option: with-editor-emacsclient-executable
-
-     The ‘emacsclient’ executable used as the editor by child process of
-     this Emacs instance.  By using this executable, child processes can
-     call home to their parent process.
-
-     This option is automatically set at startup by looking in
-     ‘exec-path’, and other places where the executable could be
-     installed, to find the ‘emacsclient’ executable most suitable for
-     the current Emacs instance.
-
-     You should *not* customize this option permanently.  If you have to
-     do it, then you should consider that a temporary kludge and inform
-     the Magit maintainer as described in *note Debugging::.
-
-     If With-Editor fails to find a suitable ‘emacsclient’ on you
-     system, then this should be fixed for all users at once, by
-     teaching ‘with-editor-locate-emacsclient’ how to do so on your
-     system and system like yours.  Doing it this way has the advantage,
-     that you won’t have do it again every time you update Emacs, and
-     that other users who have installed Emacs the same way as you have,
-     won’t have to go through the same trouble.
-
-     Note that there also is a nuclear option; setting this variable to
-     ‘nil’ causes the "sleeping editor" described below to be used even
-     for local child processes.  Obviously we don’t recommend that you
-     use this except in "emergencies", i.e.  before we had a change to
-     add a kludge appropriate for you setup.
-
- -- Function: with-editor-locate-emacsclient
-
-     The function used to set the initial value of the option
-     ‘with-editor-emacsclient-executable’.  There’s a lot of voodoo
-     here.
-
-   The ‘emacsclient’ cannot be used when using Tramp to run a process on
-a remote machine.  (Theoretically it could, but that would be hard to
-setup, very fragile, and rather insecure).
-
-   With-Editor provides an alternative "editor" which can be used by
-remote processes in much the same way as local processes use an
-‘emacsclient’ executable.  This alternative is known as the "sleeping
-editor" because it is implemented as a shell script which sleeps until
-it receives a signal.
-
- -- User Option: with-editor-sleeping-editor
-
-     The sleeping editor is a shell script used as the editor of child
-     processes when the ‘emacsclient’ executable cannot be used.
-
-     This fallback is used for asynchronous process started inside the
-     macro ‘with-editor’, when the process runs on a remote machine or
-     for local processes when ‘with-editor-emacsclient-executable’ is
-     ‘nil’.
-
-     Where the latter uses a socket to communicate with Emacs’ server,
-     this substitute prints edit requests to its standard output on
-     which a process filter listens for such requests.  As such it is
-     not a complete substitute for a proper ‘emacsclient’, it can only
-     be used as ‘$EDITOR’ of child process of the current Emacs
-     instance.
-
-     Some shells do not execute traps immediately when waiting for a
-     child process, but by default we do use such a blocking child
-     process.
-
-     If you use such a shell (e.g.  ‘csh’ on FreeBSD, but not Debian),
-     then you have to edit this option.  You can either replace ‘sh’
-     with ‘bash’ (and install that), or you can use the older, less
-     performant implementation:
-
-          "sh -c '\
-          echo \"WITH-EDITOR: $$ OPEN $0\"; \
-          trap \"exit 0\" USR1; \
-          trap \"exit 1\" USR2; \
-          while true; do sleep 1; done'"
-
-     This leads to a delay of up to a second.  The delay can be
-     shortened by replacing ‘sleep 1’ with ‘sleep 0.01’, or if your
-     implementation does not support floats, then by using ‘nanosleep
-     0.01’ instead.
-
-
-File: with-editor.info,  Node: Using With-Editor commands,  Prev: Configuring With-Editor,  Up: Using the With-Editor package
-
-1.2 Using With-Editor commands
-==============================
-
-This section describes how to use the ‘with-editor’ library _outside_ of
-Magit.  You don’t need to know any of this just to create commits using
-Magit.
-
-   The commands ‘with-editor-async-shell-command’ and
-‘with-editor-shell-command’ are intended as drop in replacements for
-‘async-shell-command’ and ‘shell-command’.  They automatically export
-‘$EDITOR’ making sure the executed command uses the current Emacs
-instance as "the editor".  With a prefix argument these commands prompt
-for an alternative environment variable such as ‘$GIT_EDITOR’.
-
- -- Command: with-editor-async-shell-command
-
-     This command is like ‘async-shell-command’, but it runs the shell
-     command with the current Emacs instance exported as ‘$EDITOR’.
-
- -- Command: with-editor-shell-command
-
-     This command is like ‘async-shell-command’, but it runs the shell
-     command with the current Emacs instance exported as ‘$EDITOR’.
-     This only has an effect if the shell command is run asynchronously,
-     i.e.  when the command ends with ‘&’.
-
-   To always use these variants add this to you init file:
-
-     (define-key (current-global-map)
-       [remap async-shell-command] 'with-editor-async-shell-command)
-     (define-key (current-global-map)
-       [remap shell-command] 'with-editor-shell-command)
-
-   Alternatively use the global ‘shell-command-with-editor-mode’.
-
- -- Variable: shell-command-with-editor-mode
-
-     When this mode is active, then ‘$EDITOR’ is exported whenever
-     ultimately ‘shell-command’ is called to asynchronously run some
-     shell command.  This affects most variants of that command, whether
-     they are defined in Emacs or in some third-party package.
-
-   The command ‘with-editor-export-editor’ exports ‘$EDITOR’ or another
-such environment variable in ‘shell-mode’, ‘term-mode’ and ‘eshell-mode’
-buffers.  Use this Emacs command before executing a shell command which
-needs the editor set, or always arrange for the current Emacs instance
-to be used as editor by adding it to the appropriate mode hooks:
-
-     (add-hook 'shell-mode-hook  'with-editor-export-editor)
-     (add-hook 'term-exec-hook   'with-editor-export-editor)
-     (add-hook 'eshell-mode-hook 'with-editor-export-editor)
-
-   Some variants of this function exist; these two forms are equivalent:
-
-     (add-hook 'shell-mode-hook
-               (apply-partially 'with-editor-export-editor "GIT_EDITOR"))
-     (add-hook 'shell-mode-hook 'with-editor-export-git-editor)
-
- -- Command: with-editor-export-editor
-
-     When invoked in a ‘shell-mode’, ‘term-mode’, or ‘eshell-mode’
-     buffer, this command teaches shell commands to use the current
-     Emacs instance as the editor, by exporting ‘$EDITOR’.
-
- -- Command: with-editor-export-git-editor
-
-     This command is like ‘with-editor-export-editor’ but exports
-     ‘$GIT_EDITOR’.
-
- -- Command: with-editor-export-hg-editor
-
-     This command is like ‘with-editor-export-editor’ but exports
-     ‘$HG_EDITOR’.
-
-
-File: with-editor.info,  Node: Using With-Editor as a library,  Next: Debugging,  Prev: Using the With-Editor package,  Up: Top
-
-2 Using With-Editor as a library
-********************************
-
-This section describes how to use the ‘with-editor’ library _outside_ of
-Magit to teach another package how to have its child processes call
-home, just like Magit does.  You don’t need to know any of this just to
-create commits using Magit.  You can also ignore this if you use
-‘with-editor’ outside of Magit, but only as an end-user.
-
-   For information about interactive use and options that affect both
-interactive and non-interactive use, see *note Using the With-Editor
-package::.
-
- -- Macro: with-editor &rest body
-
-     This macro arranges for the ‘emacsclient’ or the sleeping editor to
-     be used as the editor of child processes, effectively teaching them
-     to call home to the current Emacs instance when they require that
-     the user edits a file.
-
-     This is essentially done by establishing a local binding for
-     ‘process-environment’ and changing the value of the ‘$EDITOR’
-     environment variable in that scope.  This affects all asynchronous
-     processes started by forms (dynamically) inside BODY.
-
- -- Function: with-editor-set-process-filter process filter
-
-     This function is like ‘set-process-filter’ but ensures that adding
-     the new FILTER does not remove the ‘with-editor-process-filter’.
-     This is done by wrapping the two filter functions using a lambda,
-     which becomes the actual filter.  It calls
-     ‘with-editor-process-filter’ first, passing ‘t’ as
-     NO-STANDARD-FILTER. Then it calls FILTER.
-
-
-File: with-editor.info,  Node: Debugging,  Prev: Using With-Editor as a library,  Up: Top
-
-3 Debugging
-***********
-
-With-Editor tries very hard to locate a suitable ‘emacsclient’
-executable, and then sets option ‘with-editor-emacsclient-executable’
-accordingly.  In very rare cases this fails.  When it does fail, then
-the most likely reason is that someone found yet another way to package
-Emacs (most likely on macOS) without putting the executable on ‘$PATH’,
-and we have to add another kludge to find it anyway.
-
-   If you are having problems using ‘with-editor’, e.g.  you cannot
-commit in Magit, then please open a new issue at
-<https://github.com/magit/with-editor/issues> and provide information
-about your Emacs installation.  Most importantly how did you install
-Emacs and what is the output of ‘M-x with-editor-debug RET’.
-
-
-
-Tag Table:
-Node: Top771
-Node: Using the With-Editor package2462
-Node: Configuring With-Editor3048
-Node: Using With-Editor commands7445
-Node: Using With-Editor as a library10708
-Node: Debugging12403
-
-End Tag Table
-
-
-Local Variables:
-coding: utf-8
-End:
.emacs.d/images/emacs-config-small.png
Binary file
.emacs.d/images/emacs-config.png
Binary file
.emacs.d/images/lisp-rainbow.png
Binary file
.emacs.d/images/okumura_rin_4_by_naruto_lover16-d4ktg50.png
Binary file
.emacs.d/lisp/use-package/bind-key.el
@@ -1,416 +0,0 @@
-;;; bind-key.el --- A simple way to manage personal keybindings
-
-;; Copyright (c) 2012-2015 john wiegley
-
-;; Author: John Wiegley <jwiegley@gmail.com>
-;; Maintainer: John Wiegley <jwiegley@gmail.com>
-;; Created: 16 Jun 2012
-;; Version: 1.0
-;; Keywords: keys keybinding config dotemacs
-;; URL: https://github.com/jwiegley/use-package
-
-;; 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:
-
-;; If you have lots of keybindings set in your .emacs file, it can be hard to
-;; know which ones you haven't set yet, and which may now be overriding some
-;; new default in a new emacs version.  This module aims to solve that
-;; problem.
-;;
-;; Bind keys as follows in your .emacs:
-;;
-;;   (require 'bind-key)
-;;
-;;   (bind-key "C-c x" 'my-ctrl-c-x-command)
-;;
-;; If you want the keybinding to override all minor modes that may also bind
-;; the same key, use the `bind-key*' form:
-;;
-;;   (bind-key* "<C-return>" 'other-window)
-;;
-;; If you want to rebind a key only in a particular keymap, use:
-;;
-;;   (bind-key "C-c x" 'my-ctrl-c-x-command some-other-mode-map)
-;;
-;; To unbind a key within a keymap (for example, to stop your favorite major
-;; mode from changing a binding that you don't want to override everywhere),
-;; use `unbind-key':
-;;
-;;   (unbind-key "C-c x" some-other-mode-map)
-;;
-;; To bind multiple keys at once, or set up a prefix map, a `bind-keys' macro
-;; is provided.  It accepts keyword arguments, please see its documentation
-;; for a detailed description.
-;;
-;; To add keys into a specific map, use :map argument
-;;
-;;    (bind-keys :map dired-mode-map
-;;               ("o" . dired-omit-mode)
-;;               ("a" . some-custom-dired-function))
-;;
-;; To set up a prefix map, use `:prefix-map' and `:prefix' arguments (both are
-;; required)
-;;
-;;    (bind-keys :prefix-map my-customize-prefix-map
-;;               :prefix "C-c c"
-;;               ("f" . customize-face)
-;;               ("v" . customize-variable))
-;;
-;; You can combine all the keywords together.  Additionally,
-;; `:prefix-docstring' can be specified to set documentation of created
-;; `:prefix-map' variable.
-;;
-;; To bind multiple keys in a `bind-key*' way (to be sure that your bindings
-;; will not be overridden by other modes), you may use `bind-keys*' macro:
-;;
-;;    (bind-keys*
-;;     ("C-o" . other-window)
-;;     ("C-M-n" . forward-page)
-;;     ("C-M-p" . backward-page))
-;;
-;; After Emacs loads, you can see a summary of all your personal keybindings
-;; currently in effect with this command:
-;;
-;;   M-x describe-personal-keybindings
-;;
-;; This display will tell you if you've overriden a default keybinding, and
-;; what the default was.  Also, it will tell you if the key was rebound after
-;; your binding it with `bind-key', and what it was rebound it to.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'easy-mmode)
-
-(defgroup bind-key nil
-  "A simple way to manage personal keybindings"
-  :group 'emacs)
-
-(defcustom bind-key-column-widths '(18 . 40)
-  "Width of columns in `describe-personal-keybindings'."
-  :type '(cons integer integer)
-  :group 'bind-key)
-
-(defcustom bind-key-segregation-regexp
-  "\\`\\(\\(C-[chx] \\|M-[gso] \\)\\([CM]-\\)?\\|.+-\\)"
-  "Regular expression used to divide key sets in the output from
-\\[describe-personal-keybindings]."
-  :type 'regexp
-  :group 'bind-key)
-
-(defcustom bind-key-describe-special-forms nil
-  "If non-nil, extract docstrings from lambdas, closures and keymaps if possible."
-  :type 'boolean
-  :group 'bind-key)
-
-;; Create override-global-mode to force key remappings
-
-(defvar override-global-map (make-keymap)
-  "override-global-mode keymap")
-
-(define-minor-mode override-global-mode
-  "A minor mode so that keymap settings override other modes."
-  t "")
-
-;; the keymaps in `emulation-mode-map-alists' take precedence over
-;; `minor-mode-map-alist'
-(add-to-list 'emulation-mode-map-alists
-             `((override-global-mode . ,override-global-map)))
-
-(defvar personal-keybindings nil
-  "List of bindings performed by `bind-key'.
-
-Elements have the form ((KEY . [MAP]) CMD ORIGINAL-CMD)")
-
-;;;###autoload
-(defmacro bind-key (key-name command &optional keymap predicate)
-  "Bind KEY-NAME to COMMAND in KEYMAP (`global-map' if not passed).
-
-KEY-NAME may be a vector, in which case it is passed straight to
-`define-key'. Or it may be a string to be interpreted as
-spelled-out keystrokes, e.g., \"C-c C-z\". See documentation of
-`edmacro-mode' for details.
-
-If PREDICATE is non-nil, it is a form evaluated to determine when
-a key should be bound. It must return non-nil in such cases.
-Emacs can evaluate this form at any time that it does redisplay
-or operates on menu data structures, so you should write it so it
-can safely be called at any time."
-  (let ((namevar (make-symbol "name"))
-        (keyvar (make-symbol "key"))
-        (kdescvar (make-symbol "kdesc"))
-        (bindingvar (make-symbol "binding")))
-    `(let* ((,namevar ,key-name)
-            (,keyvar (if (vectorp ,namevar) ,namevar
-                       (read-kbd-macro ,namevar)))
-            (,kdescvar (cons (if (stringp ,namevar) ,namevar
-                               (key-description ,namevar))
-                             (quote ,keymap)))
-            (,bindingvar (lookup-key (or ,keymap global-map) ,keyvar)))
-       (add-to-list 'personal-keybindings
-                    (list ,kdescvar ,command
-                          (unless (numberp ,bindingvar) ,bindingvar)))
-       ,(if predicate
-            `(define-key (or ,keymap global-map) ,keyvar
-               '(menu-item "" nil :filter (lambda (&optional _)
-                                            (when ,predicate
-                                              ,command))))
-          `(define-key (or ,keymap global-map) ,keyvar ,command)))))
-
-;;;###autoload
-(defmacro unbind-key (key-name &optional keymap)
-  "Unbind the given KEY-NAME, within the KEYMAP (if specified).
-See `bind-key' for more details."
-  `(progn
-     (bind-key ,key-name nil ,keymap)
-     (setq personal-keybindings
-           (cl-delete-if #'(lambda (k)
-                             ,(if keymap
-                                  `(and (consp (car k))
-                                        (string= (caar k) ,key-name)
-                                        (eq (cdar k) ',keymap))
-                                `(and (stringp (car k))
-                                      (string= (car k) ,key-name))))
-                         personal-keybindings))))
-
-;;;###autoload
-(defmacro bind-key* (key-name command &optional predicate)
-  "Similar to `bind-key', but overrides any mode-specific bindings."
-  `(bind-key ,key-name ,command override-global-map ,predicate))
-
-(defun bind-keys-form (args)
-  "Bind multiple keys at once.
-
-Accepts keyword arguments:
-:map MAP               - a keymap into which the keybindings should be
-                         added
-:prefix KEY            - prefix key for these bindings
-:prefix-map MAP        - name of the prefix map that should be created
-                         for these bindings
-:prefix-docstring STR  - docstring for the prefix-map variable
-:menu-name NAME        - optional menu string for prefix map
-:filter FORM           - optional form to determine when bindings apply
-
-The rest of the arguments are conses of keybinding string and a
-function symbol (unquoted)."
-  ;; jww (2016-02-26): This is a hack; this whole function needs to be
-  ;; rewritten to normalize arguments the way that use-package.el does.
-  (if (and (eq (car args) :package)
-           (not (eq (car (cdr (cdr args))) :map)))
-      (setq args (cons :map (cons 'global-map args))))
-  (let* ((map (plist-get args :map))
-         (doc (plist-get args :prefix-docstring))
-         (prefix-map (plist-get args :prefix-map))
-         (prefix (plist-get args :prefix))
-         (filter (plist-get args :filter))
-         (menu-name (plist-get args :menu-name))
-         (pkg (plist-get args :package))
-         (key-bindings (progn
-                         (while (keywordp (car args))
-                           (pop args)
-                           (pop args))
-                         args)))
-    (when (or (and prefix-map (not prefix))
-              (and prefix (not prefix-map)))
-      (error "Both :prefix-map and :prefix must be supplied"))
-    (when (and menu-name (not prefix))
-      (error "If :menu-name is supplied, :prefix must be too"))
-    (let ((args key-bindings)
-          saw-map first next)
-      (while args
-        (if (keywordp (car args))
-            (progn
-              (setq next args)
-              (setq args nil))
-          (if first
-              (nconc first (list (car args)))
-            (setq first (list (car args))))
-          (setq args (cdr args))))
-      (cl-flet
-          ((wrap (map bindings)
-                 (if (and map pkg (not (eq map 'global-map)))
-                     `((if (boundp ',map)
-                           (progn ,@bindings)
-                         (eval-after-load
-                             ,(if (symbolp pkg) `',pkg pkg)
-                           '(progn ,@bindings))))
-                   bindings)))
-        (append
-         (when prefix-map
-           `((defvar ,prefix-map)
-             ,@(when doc `((put ',prefix-map 'variable-documentation ,doc)))
-             ,@(if menu-name
-                   `((define-prefix-command ',prefix-map nil ,menu-name))
-                 `((define-prefix-command ',prefix-map)))
-             ,@(if (and map (not (eq map 'global-map)))
-                   (wrap map `((bind-key ,prefix ',prefix-map ,map ,filter)))
-                 `((bind-key ,prefix ',prefix-map nil ,filter)))))
-         (wrap map
-               (cl-mapcan
-                (lambda (form)
-                  (if prefix-map
-                      `((bind-key ,(car form) ',(cdr form) ,prefix-map ,filter))
-                    (if (and map (not (eq map 'global-map)))
-                        `((bind-key ,(car form) ',(cdr form) ,map ,filter))
-                      `((bind-key ,(car form) ',(cdr form) nil ,filter)))))
-                first))
-         (when next
-           (bind-keys-form
-            (if pkg
-                (cons :package (cons pkg next))
-              next))))))))
-
-;;;###autoload
-(defmacro bind-keys (&rest args)
-  "Bind multiple keys at once.
-
-Accepts keyword arguments:
-:map MAP               - a keymap into which the keybindings should be
-                         added
-:prefix KEY            - prefix key for these bindings
-:prefix-map MAP        - name of the prefix map that should be created
-                         for these bindings
-:prefix-docstring STR  - docstring for the prefix-map variable
-:menu-name NAME        - optional menu string for prefix map
-:filter FORM           - optional form to determine when bindings apply
-
-The rest of the arguments are conses of keybinding string and a
-function symbol (unquoted)."
-  (macroexp-progn (bind-keys-form args)))
-
-;;;###autoload
-(defmacro bind-keys* (&rest args)
-  (macroexp-progn
-   (bind-keys-form `(:map override-global-map ,@args))))
-
-(defun get-binding-description (elem)
-  (cond
-   ((listp elem)
-    (cond
-     ((eq 'lambda (car elem))
-      (if (and bind-key-describe-special-forms
-               (stringp (nth 2 elem)))
-          (nth 2 elem)
-        "#<lambda>"))
-     ((eq 'closure (car elem))
-      (if (and bind-key-describe-special-forms
-               (stringp (nth 3 elem)))
-          (nth 3 elem)
-        "#<closure>"))
-     ((eq 'keymap (car elem))
-      "#<keymap>")
-     (t
-      elem)))
-   ;; must be a symbol, non-symbol keymap case covered above
-   ((and bind-key-describe-special-forms (keymapp elem))
-    (let ((doc (get elem 'variable-documentation)))
-      (if (stringp doc) doc elem)))
-   ((symbolp elem)
-    elem)
-   (t
-    "#<byte-compiled lambda>")))
-
-(defun compare-keybindings (l r)
-  (let* ((regex bind-key-segregation-regexp)
-         (lgroup (and (string-match regex (caar l))
-                      (match-string 0 (caar l))))
-         (rgroup (and (string-match regex (caar r))
-                      (match-string 0 (caar r))))
-         (lkeymap (cdar l))
-         (rkeymap (cdar r)))
-    (cond
-     ((and (null lkeymap) rkeymap)
-      (cons t t))
-     ((and lkeymap (null rkeymap))
-      (cons nil t))
-     ((and lkeymap rkeymap
-           (not (string= (symbol-name lkeymap) (symbol-name rkeymap))))
-      (cons (string< (symbol-name lkeymap) (symbol-name rkeymap)) t))
-     ((and (null lgroup) rgroup)
-      (cons t t))
-     ((and lgroup (null rgroup))
-      (cons nil t))
-     ((and lgroup rgroup)
-      (if (string= lgroup rgroup)
-          (cons (string< (caar l) (caar r)) nil)
-        (cons (string< lgroup rgroup) t)))
-     (t
-      (cons (string< (caar l) (caar r)) nil)))))
-
-;;;###autoload
-(defun describe-personal-keybindings ()
-  "Display all the personal keybindings defined by `bind-key'."
-  (interactive)
-  (with-output-to-temp-buffer "*Personal Keybindings*"
-    (princ (format (concat "Key name%s Command%s Comments\n%s %s "
-                           "---------------------\n")
-                   (make-string (- (car bind-key-column-widths) 9) ? )
-                   (make-string (- (cdr bind-key-column-widths) 8) ? )
-                   (make-string (1- (car bind-key-column-widths)) ?-)
-                   (make-string (1- (cdr bind-key-column-widths)) ?-)))
-    (let (last-binding)
-      (dolist (binding
-               (setq personal-keybindings
-                     (sort personal-keybindings
-                           (lambda (l r)
-                             (car (compare-keybindings l r))))))
-
-        (if (not (eq (cdar last-binding) (cdar binding)))
-            (princ (format "\n\n%s\n%s\n\n"
-                           (cdar binding)
-                           (make-string (+ 21 (car bind-key-column-widths)
-                                           (cdr bind-key-column-widths)) ?-)))
-          (if (and last-binding
-                   (cdr (compare-keybindings last-binding binding)))
-              (princ "\n")))
-
-        (let* ((key-name (caar binding))
-               (at-present (lookup-key (or (symbol-value (cdar binding))
-                                           (current-global-map))
-                                       (read-kbd-macro key-name)))
-               (command (nth 1 binding))
-               (was-command (nth 2 binding))
-               (command-desc (get-binding-description command))
-               (was-command-desc (and was-command
-                                      (get-binding-description was-command)))
-               (at-present-desc (get-binding-description at-present))
-               )
-          (let ((line
-                 (format
-                  (format "%%-%ds%%-%ds%%s\n" (car bind-key-column-widths)
-                          (cdr bind-key-column-widths))
-                  key-name (format "`%s\'" command-desc)
-                  (if (string= command-desc at-present-desc)
-                      (if (or (null was-command)
-                              (string= command-desc was-command-desc))
-                          ""
-                        (format "was `%s\'" was-command-desc))
-                    (format "[now: `%s\']" at-present)))))
-            (princ (if (string-match "[ \t]+\n" line)
-                       (replace-match "\n" t t line)
-                     line))))
-
-        (setq last-binding binding)))))
-
-(provide 'bind-key)
-
-;; Local Variables:
-;; outline-regexp: ";;;\\(;* [^\s\t\n]\\|###autoload\\)\\|("
-;; indent-tabs-mode: nil
-;; End:
-
-;;; bind-key.el ends here
.emacs.d/lisp/use-package/bind-key.elc
Binary file
.emacs.d/lisp/use-package/LICENSE
@@ -1,339 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                            NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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 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, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
.emacs.d/lisp/use-package/README.md
@@ -1,666 +0,0 @@
-# `use-package`
-
-[![Build Status](https://travis-ci.org/jwiegley/use-package.svg?branch=master)](https://travis-ci.org/jwiegley/use-package)
-
-The `use-package` macro allows you to isolate package configuration in your
-`.emacs` file in a way that is both performance-oriented and, well, tidy.  I
-created it because I have over 80 packages that I use in Emacs, and things
-were getting difficult to manage.  Yet with this utility my total load time is
-around 2 seconds, with no loss of functionality!
-
-Notes for users upgrading to 2.x are located [at the bottom](#upgrading-to-2x).
-
-## The basics
-
-Here is the simplest `use-package` declaration:
-
-``` elisp
-(use-package foo)
-```
-
-This loads in the package `foo`, but only if `foo` is available on your
-system.  If not, a warning is logged to the `*Messages*` buffer.  If it
-succeeds, a message about `"Loading foo"` is logged, along with the time it
-took to load, if it took over 0.1s.
-
-Use the `:init` keyword to execute code before a package is loaded.  It
-accepts one or more forms, up until the next keyword:
-
-``` elisp
-(use-package foo
-  :init
-  (setq foo-variable t))
-```
-
-Similarly, `:config` can be used to execute code after a package is loaded.
-In cases where loading is done lazily (see more about autoloading below), this
-execution is deferred until after the autoload occurs:
-
-``` elisp
-(use-package foo
-  :init
-  (setq foo-variable t)
-  :config
-  (foo-mode 1))
-```
-
-As you might expect, you can use `:init` and `:config` together:
-
-``` elisp
-(use-package color-moccur
-  :commands (isearch-moccur isearch-all)
-  :bind (("M-s O" . moccur)
-         :map isearch-mode-map
-         ("M-o" . isearch-moccur)
-         ("M-O" . isearch-moccur-all))
-  :init
-  (setq isearch-lazy-highlight t)
-  :config
-  (use-package moccur-edit))
-```
-
-In this case, I want to autoload the commands `isearch-moccur` and
-`isearch-all` from `color-moccur.el`, and bind keys both at the global level
-and within the `isearch-mode-map` (see next section).  When the package is
-actually loaded (by using one of these commands), `moccur-edit` is also
-loaded, to allow editing of the `moccur` buffer.
-
-## Key-binding
-
-Another common thing to do when loading a module is to bind a key to primary
-commands within that module:
-
-``` elisp
-(use-package ace-jump-mode
-  :bind ("C-." . ace-jump-mode))
-```
-
-This does two things: first, it creates an autoload for the `ace-jump-mode`
-command and defers loading of `ace-jump-mode` until you actually use it.
-Second, it binds the key `C-.` to that command.  After loading, you can use
-`M-x describe-personal-keybindings` to see all such keybindings you've set
-throughout your `.emacs` file.
-
-A more literal way to do the exact same thing is:
-
-``` elisp
-(use-package ace-jump-mode
-  :commands ace-jump-mode
-  :init
-  (bind-key "C-." 'ace-jump-mode))
-```
-
-When you use the `:commands` keyword, it creates autoloads for those commands
-and defers loading of the module until they are used.  Since the `:init` form
-is always run -- even if `ace-jump-mode` might not be on your system --
-remember to restrict `:init` code to only what would succeed either way.
-
-The `:bind` keyword takes either a cons or a list of conses:
-
-``` elisp
-(use-package hi-lock
-  :bind (("M-o l" . highlight-lines-matching-regexp)
-         ("M-o r" . highlight-regexp)
-         ("M-o w" . highlight-phrase)))
-```
-
-The `:commands` keyword likewise takes either a symbol or a list of symbols.
-
-NOTE: Special keys like `tab` or `F1`-`Fn` can be written in square brackets,
-i.e. `[tab]` instead of `"tab"`. The syntax for the keybindings is similar to
-the "kbd" syntax: see [https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-Rebinding.html](https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-Rebinding.html)
-for more information.
-
-Examples:
-
-``` elisp
-(use-package helm
-  :bind (("M-x" . helm-M-x)
-         ("M-<f5>" . helm-find-files)
-         ([f10] . helm-buffers-list)
-         ([S-f10] . helm-recentf)))
-```
-
-
-### Binding to keymaps
-
-Normally `:bind` expects that commands are functions that will be autoloaded
-from the given package. However, this does not work if one of those commands
-is actually a keymap, since keymaps are not functions, and cannot be
-autoloaded using Emacs' `autoload` mechanism.
-
-To handle this case, `use-package` offers a special, limited variant of
-`:bind` called `:bind-keymap`. The only difference is that the "commands"
-bound to by `:bind-keymap` must be keymaps defined in the package, rather than
-command functions. This is handled behind the scenes by generating custom code
-that loads the package containing the keymap, and then re-executes your
-keypress after the first load, to reinterpret that keypress as a prefix key.
-
-### Binding within local keymaps
-
-Slightly different from binding a key to a keymap, is binding a key *within* a
-local keymap that only exists after the package is loaded.  `use-package`
-supports this with a `:map` modifier, taking the local keymap to bind to:
-
-``` elisp
-(use-package helm
-  :bind (:map helm-command-map
-         ("C-c h" . helm-execute-persistent-action)))
-```
-
-The effect of this statement is to wait until `helm` has loaded, and then to
-bind the key `C-c h` to `helm-execute-persistent-action` within Helm's local
-keymap, `helm-mode-map`.
-
-Multiple uses of `:map` may be specified. Any binding occurring before the
-first use of `:map` are applied to the global keymap:
-
-``` elisp
-(use-package term
-  :bind (("C-c t" . term)
-         :map term-mode-map
-         ("M-p" . term-send-up)
-         ("M-n" . term-send-down)
-         :map term-raw-map
-         ("M-o" . other-window)
-         ("M-p" . term-send-up)
-         ("M-n" . term-send-down)))
-```
-
-## Modes and interpreters
-
-Similar to `:bind`, you can use `:mode` and `:interpreter` to establish a
-deferred binding within the `auto-mode-alist` and `interpreter-mode-alist`
-variables.  The specifier to either keyword can be a cons cell, a list, or
-just a string:
-
-``` elisp
-(use-package ruby-mode
-  :mode "\\.rb\\'"
-  :interpreter "ruby")
-
-;; The package is "python" but the mode is "python-mode":
-(use-package python
-  :mode ("\\.py\\'" . python-mode)
-  :interpreter ("python" . python-mode))
-```
-
-If you aren't using `:commands`, `:bind`, `:bind*`, `:bind-keymap`,
-`:bind-keymap*`, `:mode`, or `:interpreter` (all of which imply `:defer`; see
-the docstring for `use-package` for a brief description of each), you can
-still defer loading with the `:defer` keyword:
-
-``` elisp
-(use-package ace-jump-mode
-  :defer t
-  :init
-  (autoload 'ace-jump-mode "ace-jump-mode" nil t)
-  (bind-key "C-." 'ace-jump-mode))
-```
-
-This does exactly the same thing as the following:
-
-``` elisp
-(use-package ace-jump-mode
-  :bind ("C-." . ace-jump-mode))
-```
-
-## Notes about lazy loading
-
-In almost all cases you don't need to manually specify `:defer t`.  This is
-implied whenever `:bind` or `:mode` or `:interpreter` is used.  Typically, you
-only need to specify `:defer` if you know for a fact that some other package
-will do something to cause your package to load at the appropriate time, and
-thus you would like to defer loading even though use-package isn't creating
-any autoloads for you.
-
-You can override package deferral with the `:demand` keyword.  Thus, even if
-you use `:bind`, using `:demand` will force loading to occur immediately and
-not establish an autoload for the bound key.
-
-## Information about package loads
-
-When a package is loaded, and if you have `use-package-verbose` set to `t`, or
-if the package takes longer than 0.1s to load, you will see a message to
-indicate this loading activity in the `*Messages*` buffer.  The same will
-happen for configuration, or `:config` blocks that take longer than 0.1s to
-execute.  In general, you should keep `:init` forms as simple and quick as
-possible, and put as much as you can get away with into the `:config` block.
-This way, deferred loading can help your Emacs to start as quickly as
-possible.
-
-Additionally, if an error occurs while initializing or configuring a package,
-this will not stop your Emacs from loading.  Rather, the error will be
-captured by `use-package`, and reported to a special `*Warnings*` popup
-buffer, so that you can debug the situation in an otherwise functional Emacs.
-
-## Conditional loading
-
-You can use the `:if` keyword to predicate the loading and initialization of
-modules.
-
-For example, I only want `edit-server` running for my main,
-graphical Emacs, not for other Emacsen I may start at the command line:
-
-``` elisp
-(use-package edit-server
-  :if window-system
-  :init
-  (add-hook 'after-init-hook 'server-start t)
-  (add-hook 'after-init-hook 'edit-server-start t))
-```
-In another example, we can load things conditional on the operating system:
-
-```
-(use-package exec-path-from-shell
-  :if (memq window-system '(mac ns))
-  :ensure t
-  :config
-  (exec-path-from-shell-initialize))
-```
-
-The `:disabled` keyword can turn off a module you're having difficulties with,
-or stop loading something you're not using at the present time:
-
-``` elisp
-(use-package ess-site
-  :disabled
-  :commands R)
-```
-
-When byte-compiling your `.emacs` file, disabled declarations are ommitted
-from the output entirely, to accelerate startup times.
-
-## Byte-compiling your .emacs
-
-Another feature of `use-package` is that it always loads every file that it
-can when `.emacs` is being byte-compiled.  This helps to silence spurious
-warnings about unknown variables and functions.
-
-However, there are times when this is just not enough.  For those times, use
-the `:defines` and `:functions` keywords to introduce dummy variable and
-function declarations solely for the sake of the byte-compiler:
-
-``` elisp
-(use-package texinfo
-  :defines texinfo-section-list
-  :commands texinfo-mode
-  :init
-  (add-to-list 'auto-mode-alist '("\\.texi$" . texinfo-mode)))
-```
-
-If you need to silence a missing function warning, you can use `:functions`:
-
-``` elisp
-(use-package ruby-mode
-  :mode "\\.rb\\'"
-  :interpreter "ruby"
-  :functions inf-ruby-keys
-  :config
-  (defun my-ruby-mode-hook ()
-    (require 'inf-ruby)
-    (inf-ruby-keys))
-
-  (add-hook 'ruby-mode-hook 'my-ruby-mode-hook))
-```
-
-### Prevent a package from loading at compile-time
-
-Normally, `use-package` will load each package at compile time before
-compiling the configuration, to ensure that any necessary symbols are in scope
-to satisfy the byte-compiler.  At times this can cause problems, since a
-package may have special loading requirements, and all that you want to use
-`use-package` for is to add a configuration to the `eval-after-load` hook.  In
-such cases, use the `:no-require` keyword, which implies `:defer`:
-
-``` elisp
-(use-package foo
-  :no-require t
-  :config
-  (message "This is evaluated when `foo' is loaded"))
-```
-
-## Extending the load-path
-
-If your package needs a directory added to the `load-path` in order to load,
-use `:load-path`.  This takes a symbol, a function, a string or a list of
-strings.  If the path is relative, it is expanded within
-`user-emacs-directory`:
-
-``` elisp
-(use-package ess-site
-  :load-path "site-lisp/ess/lisp/"
-  :commands R)
-```
-
-Note that when using a symbol or a function to provide a dynamically generated
-list of paths, you must inform the byte-compiler of this definition so the
-value is available at byte-compilation time.  This is done by using the
-special form `eval-and-compile` (as opposed to `eval-when-compile`).  Further,
-this value is fixed at whatever was determined during compilation, to avoid
-looking up the same information again on each startup:
-
-``` elisp
-(eval-and-compile
-  (defun ess-site-load-path ()
-    (shell-command "find ~ -path ess/lisp")))
-
-(use-package ess-site
-  :load-path (lambda () (list (ess-site-load-path)))
-  :commands R)
-```
-
-## Diminishing and delighting minor modes
-
-`use-package` also provides built-in support for the diminish and
-delight utilities -- if you have them installed. Their purpose is to
-remove or change minor mode strings in your mode-line.
-
-[diminish](https://github.com/myrjola/diminish.el) is invoked with
-the `:diminish` keyword, which is passed either a minor mode symbol, a
-cons of the symbol and its replacement string, or just a replacement
-string, in which case the minor mode symbol is guessed to be the
-package name with "-mode" appended at the end:
-
-``` elisp
-(use-package abbrev
-  :diminish abbrev-mode
-  :config
-  (if (file-exists-p abbrev-file-name)
-      (quietly-read-abbrev-file)))
-```
-
-[delight](https://elpa.gnu.org/packages/delight.html) is invoked with
-the `:delight` keyword, which is passed a minor mode symbol, a
-replacement string or
-quoted
-[mode-line data](https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html) (in
-which case the minor mode symbol is guessed to be the package name
-with "-mode" appended at the end), both of these, or several lists of
-both. If no arguments are provided, the default mode name is hidden
-completely.
-
-``` elisp
-;; Don't show anything for rainbow-mode.
-(use-package rainbow-mode
-  :delight)
-
-;; Don't show anything for auto-revert-mode, which doesn't match
-;; its package name.
-(use-package autorevert
-  :delight auto-revert-mode)
-
-;; Remove the mode name for projectile-mode, but show the project name.
-(use-package projectile
-  :delight '(:eval (concat " " (projectile-project-name))))
-
-;; Completely hide visual-line-mode and change auto-fill-mode to " AF".
-(use-package emacs
-  :delight
-  (auto-fill-function " AF")
-  (visual-line-mode))
-```
-
-## For `package.el` users
-
-You can use `use-package` to load packages from ELPA with `package.el`. This
-is particularly useful if you share your `.emacs` among several machines; the
-relevant packages are downloaded automatically once declared in your `.emacs`.
-The `:ensure` keyword causes the package(s) to be installed automatically if
-not already present on your system (set `(setq use-package-always-ensure t)`
-if you wish this behavior to be global for all packages):
-
-``` elisp
-(use-package magit
-  :ensure t)
-```
-
-If you need to install a different package from the one named by
-`use-package`, you can specify it like this:
-
-``` elisp
-(use-package tex
-  :ensure auctex)
-```
-
-Lastly, when running on Emacs 24.4 or later, use-package can pin a package to
-a specific archive, allowing you to mix and match packages from different
-archives.  The primary use-case for this is preferring packages from the
-`melpa-stable` and `gnu` archives, but using specific packages from `melpa`
-when you need to track newer versions than what is available in the `stable`
-archives is also a valid use-case.
-
-By default `package.el` prefers `melpa` over `melpa-stable` due to the
-versioning `(> evil-20141208.623 evil-1.0.9)`, so even if you are tracking
-only a single package from `melpa`, you will need to tag all the non-`melpa`
-packages with the appropriate archive. If this really annoys you, then you can
-set `use-package-always-pin` to set a default.
-
-If you want to manually keep a package updated and ignore upstream updates,
-you can pin it to `manual`, which as long as there is no repository by that
-name, will Just Work(tm).
-
-`use-package` throws an error if you try to pin a package to an archive that
-has not been configured using `package-archives` (apart from the magic
-`manual` archive mentioned above):
-
-```
-Archive 'foo' requested for package 'bar' is not available.
-```
-
-Example:
-
-``` elisp
-(use-package company
-  :ensure t
-  :pin melpa-stable)
-
-(use-package evil
-  :ensure t)
-  ;; no :pin needed, as package.el will choose the version in melpa
-
-(use-package adaptive-wrap
-  :ensure t
-  ;; as this package is available only in the gnu archive, this is
-  ;; technically not needed, but it helps to highlight where it
-  ;; comes from
-  :pin gnu)
-
-(use-package org
-  :ensure t
-  ;; ignore org-mode from upstream and use a manually installed version
-  :pin manual)
-```
-
-**NOTE**: the `:pin` argument has no effect on emacs versions < 24.4.
-
-## Extending use-package with new or modified keywords
-
-Starting with version 2.0, `use-package` is based on an extensible framework
-that makes it easy for package authors to add new keywords, or modify the
-behavior of existing keywords.
-
-### First step: Add the keyword
-
-The first step is to add your keyword at the right place in
-`use-package-keywords`.  This list determines the order in which things will
-happen in the expanded code.  You should never change this order, but it gives
-you a framework within which to decide when your keyword should fire.
-
-### Second step: Create a normalizer
-
-Define a normalizer for your keyword by defining a function named after the
-keyword, for example:
-
-``` elisp
-(defun use-package-normalize/:pin (name-symbol keyword args)
-  (use-package-only-one (symbol-name keyword) args
-    (lambda (label arg)
-      (cond
-       ((stringp arg) arg)
-       ((symbolp arg) (symbol-name arg))
-       (t
-        (use-package-error
-         ":pin wants an archive name (a string)"))))))
-```
-
-The job of the normalizer is take a list of arguments (possibly nil), and turn
-it into the single argument (which could still be a list) that should appear
-in the final property list used by `use-package`.
-
-### Third step: Create a handler
-
-Once you have a normalizer, you must create a handler for the keyword:
-
-``` elisp
-(defun use-package-handler/:pin (name-symbol keyword archive-name rest state)
-  (let ((body (use-package-process-keywords name-symbol rest state)))
-    ;; This happens at macro expansion time, not when the expanded code is
-    ;; compiled or evaluated.
-    (if (null archive-name)
-        body
-      (use-package-pin-package name-symbol archive-name)
-      (use-package-concat
-       body
-       `((push '(,name-symbol . ,archive-name)
-               package-pinned-packages))))))
-```
-
-Handlers can affect the handling of keywords in two ways.  First, it can
-modify the `state` plist before recursively processing the remaining keywords,
-to influence keywords that pay attention to the state (one example is the
-state keyword `:deferred`, not to be confused with the `use-package` keyword
-`:defer`).  Then, once the remaining keywords have been handled and their
-resulting forms returned, the handler may manipulate, extend, or just ignore
-those forms.
-
-The task of each handler is to return a *list of forms* representing code to
-be inserted.  It does not need to be a `progn` list, as this is handled
-automatically in other places.  Thus it is very common to see the idiom of
-using `use-package-concat` to add new functionality before or after a code
-body, so that only the minimum code necessary is emitted as the result of a
-`use-package` expansion.
-
-### Fourth step: Test it out
-
-After the keyword has been inserted into `use-package-keywords`, and a
-normalizer and a handler defined, you can now test it by seeing how usages of
-the keyword will expand.  For this, temporarily set `use-package-debug` to
-`t`, and just evaluate the `use-package` declaration.  The expansion will be
-shown in a special buffer called `*use-package*`.
-
-## Some timing results
-
-On my Retina iMac, the "Mac port" variant of Emacs 24.4 loads in 0.57s, with
-around 218 packages configured (nearly all of them lazy-loaded).  However, I
-experience no loss of functionality, just a bit of latency when I'm first
-starting to use Emacs (due to the autoloading).  Since I also use idle-loading
-for many packages, perceived latency is typically reduced overall.
-
-On Linux, the same configuration loads in 0.32s.
-
-If I don't use Emacs graphically, I can test the absolute minimum times.  This
-is done by running:
-
-``` bash
-time emacs -l init.elc -batch --eval '(message "Hello, world!")'
-```
-
-On the Mac I see an average of 0.36s for the same configuration, and on Linux
-0.26s.
-
-# Upgrading to 2.x
-
-## Semantics of :init is now consistent
-
-The meaning of `:init` has been changed: It now *always* happens before
-package load, whether `:config` has been deferred or not.  This means that
-some uses of `:init` in your configuration may need to be changed to `:config`
-(in the non-deferred case).  For the deferred case, the behavior is unchanged
-from before.
-
-Also, because `:init` and `:config` now mean "before" and "after", the `:pre-`
-and `:post-` keywords are gone, as they should no longer be necessary.
-
-Lastly, an effort has been made to make your Emacs start even in the presence
-of use-package configuration failures.  So after this change, be sure to check
-your `*Messages*` buffer.  Most likely, you will have several instances where
-you are using `:init`, but should be using `:config` (this was the case for me
-in a number of places).
-
-## :idle has been removed
-
-I am removing this feature for now because it can result in a nasty
-inconsistency.  Consider the following definition:
-
-``` elisp
-(use-package vkill
-  :commands vkill
-  :idle (some-important-configuration-here)
-  :bind ("C-x L" . vkill-and-helm-occur)
-  :init
-  (defun vkill-and-helm-occur ()
-    (interactive)
-    (vkill)
-    (call-interactively #'helm-occur))
-
-  :config
-  (setq vkill-show-all-processes t))
-```
-
-If I load my Emacs and wait until the idle timer fires, then this is the
-sequence of events:
-
-    :init :idle <load> :config
-
-But if I load Emacs and immediately type C-x L without waiting for the idle
-timer to fire, this is the sequence of events:
-
-    :init <load> :config :idle
-
-It's possible that the user could use `featurep` in their idle to test for
-this case, but that's a subtlety I'd rather avoid.
-
-## :defer now accepts an optional integer argument
-
-`:defer [N]` causes the package to be loaded -- if it has not already been --
-after `N` seconds of idle time.
-
-```
-(use-package back-button
-  :commands (back-button-mode)
-  :defer 2
-  :init
-  (setq back-button-show-toolbar-buttons nil)
-  :config
-  (back-button-mode 1))
-```
-
-## Add :preface, occurring before everything except :disabled
-
-`:preface` can be used to establish function and variable definitions that
-will 1) make the byte-compiler happy (it won't complain about functions whose
-definitions are unknown because you have them within a guard block), and 2)
-allow you to define code that can be used in an `:if` test.
-
-Note that whatever is specified within `:preface` is evaluated both at load
-time and at byte-compilation time, in order to ensure that definitions are
-seen by both the Lisp evaluator and the byte-compiler, so you should avoid
-having any side-effects in your preface, and restrict it merely to symbol
-declarations and definitions.
-
-## Add :functions, for declaring functions to the byte-compiler
-
-What `:defines` does for variables, `:functions` does for functions.
-
-## use-package.el is no longer needed at runtime
-
-This means you should put the following at the top of your Emacs, to further
-reduce load time:
-
-``` elisp
-(eval-when-compile
-  (require 'use-package))
-(require 'diminish)                ;; if you use :diminish
-(require 'bind-key)                ;; if you use any :bind variant
-```
.emacs.d/lisp/use-package/use-package.el
@@ -1,1606 +0,0 @@
-;;; use-package.el --- A use-package declaration for simplifying your .emacs
-
-;; Copyright (C) 2012 John Wiegley
-
-;; Author: John Wiegley <jwiegley@gmail.com>
-;; Maintainer: John Wiegley <jwiegley@gmail.com>
-;; Created: 17 Jun 2012
-;; Modified: 17 Oct 2016
-;; Version: 2.3
-;; Package-Requires: ((bind-key "1.0") (diminish "0.44"))
-;; Keywords: dotemacs startup speed config package
-;; URL: https://github.com/jwiegley/use-package
-
-;; 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:
-
-;; The `use-package' declaration macro allows you to isolate package
-;; configuration in your ".emacs" in a way that is performance-oriented and,
-;; well, just tidy.  I created it because I have over 80 packages that I use
-;; in Emacs, and things were getting difficult to manage.  Yet with this
-;; utility my total load time is just under 1 second, with no loss of
-;; functionality!
-;;
-;; Please see README.md from the same repository for documentation.
-
-;;; Code:
-
-(require 'bind-key)
-(require 'bytecomp)
-(require 'diminish nil t)
-(require 'bytecomp)
-(eval-when-compile (require 'cl))
-(eval-when-compile (require 'regexp-opt))
-
-(declare-function package-installed-p "package")
-(declare-function package-read-all-archive-contents "package" ())
-
-(defgroup use-package nil
-  "A use-package declaration for simplifying your `.emacs'."
-  :group 'startup)
-
-(defcustom use-package-verbose nil
-  "Whether to report about loading and configuration details.
-
-If you customize this, then you should require the `use-package'
-feature in files that use `use-package', even if these files only
-contain compiled expansions of the macros.  If you don't do so,
-then the expanded macros do their job silently."
-  :type '(choice (const :tag "Quiet" nil) (const :tag "Verbose" t)
-                 (const :tag "Debug" debug))
-  :group 'use-package)
-
-(defcustom use-package-debug nil
-  "Whether to display use-package expansions in a *use-package* buffer."
-  :type 'boolean
-  :group 'use-package)
-
-(defcustom use-package-check-before-init nil
-  "If non-nil, check that package exists before executing its `:init' block.
-The check is performed by looking for the module using `locate-library'."
-  :type 'boolean
-  :group 'use-package)
-
-(defcustom use-package-always-defer nil
-  "If non-nil, assume `:defer t` unless `:demand t` is given."
-  :type 'boolean
-  :group 'use-package)
-
-(defcustom use-package-always-demand nil
-  "If non-nil, assume `:demand t` unless `:defer t` is given."
-  :type 'boolean
-  :group 'use-package)
-
-(defcustom use-package-always-defer-install nil
-  "If non-nil, assume `:defer-install t` unless `:defer-install nil` is given."
-  :type 'boolean
-  :group 'use-package)
-
-(defcustom use-package-always-ensure nil
-  "Treat every package as though it had specified `:ensure SEXP`."
-  :type 'sexp
-  :group 'use-package)
-
-(defcustom use-package-always-pin nil
-  "Treat every package as though it had specified `:pin SYM`."
-  :type 'symbol
-  :group 'use-package)
-
-(defcustom use-package-minimum-reported-time 0.1
-  "Minimal load time that will be reported.
-
-Note that `use-package-verbose' has to be set to t, for anything
-to be reported at all.
-
-If you customize this, then you should require the `use-package'
-feature in files that use `use-package', even if these files only
-contain compiled expansions of the macros.  If you don't do so,
-then the expanded macros do their job silently."
-  :type 'number
-  :group 'use-package)
-
-(defcustom use-package-inject-hooks nil
-  "If non-nil, add hooks to the `:init' and `:config' sections.
-In particular, for a given package `foo', the following hooks
-become available:
-
-  `use-package--foo--pre-init-hook'
-  `use-package--foo--post-init-hook'
-  `use-package--foo--pre-config-hook'
-  `use-package--foo--post-config-hook'
-
-This way, you can add to these hooks before evalaution of a
-`use-package` declaration, and exercise some control over what
-happens.
-
-Note that if either `pre-init' hooks returns a nil value, that
-block's user-supplied configuration is not evaluated, so be
-certain to return `t' if you only wish to add behavior to what
-the user specified."
-  :type 'boolean
-  :group 'use-package)
-
-(defcustom use-package-keywords
-  '(:disabled
-    :preface
-    :pin
-    :defer-install
-    :ensure
-    :if
-    :when
-    :unless
-    :requires
-    :load-path
-    :no-require
-    :bind
-    :bind*
-    :bind-keymap
-    :bind-keymap*
-    :interpreter
-    :mode
-    :magic
-    :magic-fallback
-    :commands
-    :defines
-    :functions
-    :defer
-    :init
-    :after
-    :demand
-    :config
-    :diminish
-    :delight)
-  "Establish which keywords are valid, and the order they are processed in.
-
-Note that `:disabled' is special, in that it causes nothing at all to happen,
-even if the rest of the use-package declaration is incorrect."
-  :type '(repeat symbol)
-  :group 'use-package)
-
-(defcustom use-package-expand-minimally nil
-  "If non-nil, make the expanded code as minimal as possible.
-This disables:
-  - Printing to the *Messages* buffer of slowly-evaluating forms
-  - Capture of load errors (normally redisplayed as warnings)
-  - Conditional loading of packages (load failures become errors)
-The only advantage is that, if you know your configuration works,
-then your byte-compiled init file is as minimal as possible."
-  :type 'boolean
-  :group 'use-package)
-
-(defcustom use-package-enable-imenu-support nil
-  "If non-nil, adjust `lisp-imenu-generic-expression' to include
-support for finding `use-package' and `require' forms.
-
-Must be set before loading use-package."
-  :type 'boolean
-  :group 'use-package)
-
-(defcustom use-package-ensure-function 'use-package-ensure-elpa
-  "Function that ensures a package is installed.
-This function is called with four arguments: the name of the
-package declared in the `use-package' form; the argument passed
-to `:ensure'; the current `state' plist created by previous
-handlers; and a keyword indicating the context in which the
-installation is occurring.
-
-Note that this function is called whenever `:ensure' is provided,
-even if it is nil. It is up to the function to decide on the
-semantics of the various values for `:ensure'.
-
-This function should return non-nil if the package is installed.
-
-The default value uses package.el to install the package.
-
-Possible values for the context keyword are:
-
-:byte-compile - package installed during byte-compilation
-:ensure - package installed normally by :ensure
-:autoload - deferred installation triggered by an autoloaded
-            function
-:after - deferred installation triggered by the loading of a
-         feature listed in the :after declaration
-:config - deferred installation was specified at the same time
-          as :demand, so the installation was triggered
-          immediately
-:unknown - context not provided
-
-Note that third-party code can provide other values for the
-context keyword by calling `use-package-install-deferred-package'
-with the appropriate value."
-  :type '(choice (const :tag "package.el" use-package-ensure-elpa)
-                 (function :tag "Custom"))
-  :group 'use-package)
-
-(defcustom use-package-pre-ensure-function 'ignore
-  "Function that is called upon installation deferral.
-It is called immediately with the first three arguments that
-would be passed to `use-package-ensure-function' (the context
-keyword is omitted), but only if installation has been deferred.
-It is intended for package managers other than package.el which
-might want to activate the autoloads of a package immediately, if
-it's installed, but otherwise defer installation until later (if
-`:defer-install' is specified). The reason it is set to `ignore'
-by default is that package.el activates the autoloads for all
-known packages at initialization time, rather than one by one
-when the packages are actually requested."
-  :type '(choice (const :tag "None" ignore)
-                 (function :tag "Custom"))
-  :group 'use-package)
-
-(defcustom use-package-defaults
-  '((:config '(t) t)
-    (:ensure use-package-always-ensure use-package-always-ensure)
-    (:defer-install
-     use-package-always-defer-install
-     use-package-always-defer-install)
-    (:pin use-package-always-pin use-package-always-pin))
-  "Alist of default values for `use-package' keywords.
-Each entry in the alist is a list of three elements. The first
-element is the `use-package' keyword and the second is a form
-that can be evaluated to get the default value. The third element
-is a form that can be evaluated to determine whether or not to
-assign a default value; if it evaluates to nil, then the default
-value is not assigned even if the keyword is not present in the
-`use-package' form."
-  :type '(repeat (list symbol sexp sexp)))
-
-(when use-package-enable-imenu-support
-  (eval-after-load 'lisp-mode
-    `(let ((sym-regexp (or (bound-and-true-p lisp-mode-symbol-regexp)
-                           "\\(?:\\sw\\|\\s_\\|\\\\.\\)+")))
-       (add-to-list
-        'lisp-imenu-generic-expression
-        (list "Packages"
-              (concat "^\\s-*("
-                      ,(eval-when-compile
-                         (regexp-opt '("use-package" "require") t))
-                      "\\s-+\\(" sym-regexp "\\)")
-              2)))))
-
-(defvar use-package-form-regexp "^\\s-*(\\s-*use-package\\s-+\\_<%s\\_>"
-  "Regexp used in `use-package-jump-to-package-form' to find use
-package forms in user files.")
-
-(defun use-package--find-require (package)
-  "Find file that required PACKAGE by searching
-`load-history'. Returns an absolute file path or nil if none is
-found."
-  (catch 'suspect
-    (dolist (filespec load-history)
-      (dolist (entry (cdr filespec))
-        (when (equal entry (cons 'require package))
-          (throw 'suspect (car filespec)))))))
-
-(defun use-package-jump-to-package-form (package)
-  "Attempt to find and jump to the `use-package' form that loaded
-PACKAGE. This will only find the form if that form actually
-required PACKAGE. If PACKAGE was previously required then this
-function will jump to the file that orginally required PACKAGE
-instead."
-  (interactive (list (completing-read "Package: " features)))
-  (let* ((package (if (stringp package) (intern package) package))
-         (requiring-file (use-package--find-require package))
-         file location)
-    (if (null requiring-file)
-        (user-error "Can't find file that requires this feature.")
-      (setq file (if (string= (file-name-extension requiring-file) "elc")
-                     (concat (file-name-sans-extension requiring-file) ".el")
-                   requiring-file))
-      (when (file-exists-p file)
-        (find-file-other-window file)
-        (save-excursion
-          (goto-char (point-min))
-          (setq location
-                (re-search-forward
-                 (format use-package-form-regexp package) nil t)))
-        (if (null location)
-            (message "No use-package form found.")
-          (goto-char location)
-          (beginning-of-line))))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Utility functions
-;;
-
-(defun use-package-as-symbol (string-or-symbol)
-  "If STRING-OR-SYMBOL is already a symbol, return it.  Otherwise
-convert it to a symbol and return that."
-  (if (symbolp string-or-symbol) string-or-symbol
-    (intern string-or-symbol)))
-
-(defun use-package-as-string (string-or-symbol)
-  "If STRING-OR-SYMBOL is already a string, return it.  Otherwise
-convert it to a string and return that."
-  (if (stringp string-or-symbol) string-or-symbol
-    (symbol-name string-or-symbol)))
-
-(defun use-package-as-mode (string-or-symbol)
-  "If STRING-OR-SYMBOL ends in `-mode' (or its name does), return
-it as a symbol.  Otherwise, return it as a symbol with `-mode'
-appended."
-  (let ((string (use-package-as-string string-or-symbol)))
-    (intern (if (string-match "-mode\\'" string) string
-              (concat string "-mode")))))
-
-(defun use-package-load-name (name &optional noerror)
-  "Return a form which will load or require NAME depending on
-whether it's a string or symbol."
-  (if (stringp name)
-      `(load ,name ',noerror)
-    `(require ',name nil ',noerror)))
-
-(defun use-package-expand (name label form)
-  "FORM is a list of forms, so `((foo))' if only `foo' is being called."
-  (declare (indent 1))
-  (when form
-    (if use-package-expand-minimally
-        form
-      (let ((err (make-symbol "err")))
-        (list
-         `(condition-case-unless-debug ,err
-              ,(macroexp-progn form)
-            (error
-             (ignore
-              (display-warning 'use-package
-                               (format "%s %s: %s"
-                                       ,name ,label (error-message-string ,err))
-                               :error)))))))))
-
-(put 'use-package-expand 'lisp-indent-function 'defun)
-
-(defun use-package-hook-injector (name-string keyword body)
-  "Wrap pre/post hook injections around a given keyword form.
-ARGS is a list of forms, so `((foo))' if only `foo' is being called."
-  (if (not use-package-inject-hooks)
-      (use-package-expand name-string (format "%s" keyword) body)
-    (let ((keyword-name (substring (format "%s" keyword) 1)))
-      (when body
-        `((when ,(macroexp-progn
-                  (use-package-expand name-string (format "pre-%s hook" keyword)
-                    `((run-hook-with-args-until-failure
-                       ',(intern (concat "use-package--" name-string
-                                         "--pre-" keyword-name "-hook"))))))
-            ,(macroexp-progn
-              (use-package-expand name-string (format "%s" keyword) body))
-            ,(macroexp-progn
-              (use-package-expand name-string (format "post-%s hook" keyword)
-                `((run-hooks
-                   ',(intern (concat "use-package--" name-string
-                                     "--post-" keyword-name "-hook"))))))))))))
-
-(defun use-package--with-elapsed-timer (text body)
-  "BODY is a list of forms, so `((foo))' if only `foo' is being called."
-  (declare (indent 1))
-  (if use-package-expand-minimally
-      body
-    (let ((nowvar (make-symbol "now")))
-      (if (bound-and-true-p use-package-verbose)
-          `((let ((,nowvar (current-time)))
-              (message "%s..." ,text)
-              (prog1
-                  ,(macroexp-progn body)
-                (let ((elapsed
-                       (float-time (time-subtract (current-time) ,nowvar))))
-                  (if (> elapsed ,use-package-minimum-reported-time)
-                      (message "%s...done (%.3fs)" ,text elapsed)
-                    (message "%s...done" ,text))))))
-        body))))
-
-(put 'use-package--with-elapsed-timer 'lisp-indent-function 1)
-
-(defsubst use-package-error (msg)
-  "Report MSG as an error, so the user knows it came from this package."
-  (error "use-package: %s" msg))
-
-(defsubst use-package-plist-maybe-put (plist property value)
-  "Add a VALUE for PROPERTY to PLIST, if it does not already exist."
-  (if (plist-member plist property)
-      plist
-    (plist-put plist property value)))
-
-(defsubst use-package-plist-cons (plist property value)
-  "Cons VALUE onto the head of the list at PROPERTY in PLIST."
-  (plist-put plist property (cons value (plist-get plist property))))
-
-(defsubst use-package-plist-append (plist property value)
-  "Append VALUE onto the front of the list at PROPERTY in PLIST."
-  (plist-put plist property (append value (plist-get plist property))))
-
-(defun use-package-plist-delete (plist property)
-  "Delete PROPERTY from PLIST.
-This is in contrast to merely setting it to 0."
-  (let (p)
-    (while plist
-      (if (not (eq property (car plist)))
-          (setq p (plist-put p (car plist) (nth 1 plist))))
-      (setq plist (cddr plist)))
-    p))
-
-(defun use-package-split-list (pred xs)
-  (let ((ys (list nil)) (zs (list nil)) flip)
-    (dolist (x xs)
-      (if flip
-          (nconc zs (list x))
-        (if (funcall pred x)
-            (progn
-              (setq flip t)
-              (nconc zs (list x)))
-          (nconc ys (list x)))))
-    (cons (cdr ys) (cdr zs))))
-
-(defun use-package-keyword-index (keyword)
-  (loop named outer
-        with index = 0
-        for k in use-package-keywords do
-        (if (eq k keyword)
-            (return-from outer index))
-        (incf index)))
-
-(defun use-package-sort-keywords (plist)
-  (let (plist-grouped)
-    (while plist
-      (push (cons (car plist) (cadr plist))
-            plist-grouped)
-      (setq plist (cddr plist)))
-    (let (result)
-      (dolist (x
-               (nreverse
-                (sort plist-grouped
-                      #'(lambda (l r) (< (use-package-keyword-index (car l))
-                                    (use-package-keyword-index (car r)))))))
-        (setq result (cons (car x) (cons (cdr x) result))))
-      result)))
-
-(defsubst use-package-concat (&rest elems)
-  "Delete all empty lists from ELEMS (nil or (list nil)), and append them."
-  (apply #'nconc (delete nil (delete (list nil) elems))))
-
-(defconst use-package-font-lock-keywords
-  '(("(\\(use-package\\)\\_>[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
-     (1 font-lock-keyword-face)
-     (2 font-lock-constant-face nil t))))
-
-(font-lock-add-keywords 'emacs-lisp-mode use-package-font-lock-keywords)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Keyword processing
-;;
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Normalization functions
-;;
-
-(defun use-package-regex-p (re)
-  "Return t if RE is some regexp-like thing."
-  (cond
-   ((and (listp re)
-         (eq (car re) 'rx))
-    t)
-   ((stringp re)
-    t)
-   (t
-    nil)))
-
-(defun use-package-normalize-regex (re)
-  "Given some regexp-like thing, resolve it down to a regular expression."
-  (cond
-   ((and (listp re)
-         (eq (car re) 'rx))
-    (eval re))
-   ((stringp re)
-    re)
-   (t
-    (error "Not recognized as regular expression: %s" re))))
-
-(defun use-package-normalize-plist (name input)
-  "Given a pseudo-plist, normalize it to a regular plist."
-  (unless (null input)
-    (let* ((keyword (car input))
-           (xs (use-package-split-list #'keywordp (cdr input)))
-           (args (car xs))
-           (tail (cdr xs))
-           (normalizer (intern (concat "use-package-normalize/"
-                                       (symbol-name keyword))))
-           (arg
-            (cond
-             ((eq keyword :disabled)
-              (use-package-normalize-plist name tail))
-             ((functionp normalizer)
-              (funcall normalizer name keyword args))
-             ((= (length args) 1)
-              (car args))
-             (t
-              args))))
-      (if (memq keyword use-package-keywords)
-          (cons keyword
-                (cons arg (use-package-normalize-plist name tail)))
-        (use-package-error (format "Unrecognized keyword: %s" keyword))))))
-
-(defun use-package-process-keywords (name plist &optional state)
-  "Process the next keyword in the free-form property list PLIST.
-The values in the PLIST have each been normalized by the function
-use-package-normalize/KEYWORD (minus the colon).
-
-STATE is a property list that the function may modify and/or
-query.  This is useful if a package defines multiple keywords and
-wishes them to have some kind of stateful interaction.
-
-Unless the KEYWORD being processed intends to ignore remaining
-keywords, it must call this function recursively, passing in the
-plist with its keyword and argument removed, and passing in the
-next value for the STATE."
-  (declare (indent 1))
-  (unless (null plist)
-    (let* ((keyword (car plist))
-           (arg (cadr plist))
-           (rest (cddr plist)))
-      (unless (keywordp keyword)
-        (use-package-error (format "%s is not a keyword" keyword)))
-      (let* ((handler (concat "use-package-handler/" (symbol-name keyword)))
-             (handler-sym (intern handler)))
-        (if (functionp handler-sym)
-            (funcall handler-sym name keyword arg rest state)
-          (use-package-error
-           (format "Keyword handler not defined: %s" handler)))))))
-
-(put 'use-package-process-keywords 'lisp-indent-function 'defun)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :pin
-;;
-
-(defun use-package-only-one (label args f)
-  "Call F on the first member of ARGS if it has exactly one element."
-  (declare (indent 1))
-  (cond
-   ((and (listp args) (listp (cdr args))
-         (= (length args) 1))
-    (funcall f label (car args)))
-   (t
-    (use-package-error
-     (concat label " wants exactly one argument")))))
-
-(put 'use-package-only-one 'lisp-indent-function 'defun)
-
-(defun use-package-normalize/:pin (name keyword args)
-  (use-package-only-one (symbol-name keyword) args
-    (lambda (label arg)
-      (cond
-       ((stringp arg) arg)
-       ((symbolp arg) (symbol-name arg))
-       (t
-        (use-package-error
-         ":pin wants an archive name (a string)"))))))
-
-(eval-when-compile
-  (defvar package-pinned-packages)
-  (defvar package-archives))
-
-(defun use-package--archive-exists-p (archive)
-  "Check if a given ARCHIVE is enabled.
-
-ARCHIVE can be a string or a symbol or 'manual to indicate a
-manually updated package."
-  (if (member archive '(manual "manual"))
-      't
-    (let ((valid nil))
-      (dolist (pa package-archives)
-        (when (member archive (list (car pa) (intern (car pa))))
-          (setq valid 't)))
-      valid)))
-
-(defun use-package-pin-package (package archive)
-  "Pin PACKAGE to ARCHIVE."
-  (unless (boundp 'package-pinned-packages)
-    (setq package-pinned-packages ()))
-  (let ((archive-symbol (if (symbolp archive) archive (intern archive)))
-        (archive-name   (if (stringp archive) archive (symbol-name archive))))
-    (if (use-package--archive-exists-p archive-symbol)
-        (add-to-list 'package-pinned-packages (cons package archive-name))
-      (error "Archive '%s' requested for package '%s' is not available."
-             archive-name package))
-    (unless (bound-and-true-p package--initialized)
-      (package-initialize t))))
-
-(defun use-package-handler/:pin (name keyword archive-name rest state)
-  (let ((body (use-package-process-keywords name rest state))
-        (pin-form (if archive-name
-                      `(use-package-pin-package ',(use-package-as-symbol name)
-                                                ,archive-name))))
-    ;; Pinning should occur just before ensuring
-    ;; See `use-package-handler/:ensure'.
-    (if (bound-and-true-p byte-compile-current-file)
-        (eval pin-form)              ; Eval when byte-compiling,
-      (push pin-form body))          ; or else wait until runtime.
-    body))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :defer-install
-;;
-
-(defvar use-package--deferred-packages (make-hash-table)
-  "Hash mapping packages to data about their installation.
-
-The keys are not actually symbols naming packages, but rather
-symbols naming the features which are the names of \"packages\"
-required by `use-package' forms. Since
-`use-package-ensure-function' could be set to anything, it is
-actually impossible for `use-package' to determine what package
-is supposed to provide the feature being ensured just based on
-the value of `:ensure'.
-
-Each value is a cons, with the car being the the value passed to
-`:ensure' and the cdr being the `state' plist. See
-`use-package-install-deferred-package' for information about how
-these values are used to call `use-package-ensure-function'.")
-
-(defun use-package-install-deferred-package (name &optional context)
-  "Install a package whose installation has been deferred.
-NAME should be a symbol naming a package (actually, a feature).
-This is done by calling `use-package-ensure-function' is called
-with four arguments: the key (NAME) and the two elements of the
-cons in `use-package--deferred-packages' (the value passed to
-`:ensure', and the `state' plist), and a keyword providing
-information about the context in which the installation is
-happening. (This defaults to `:unknown' but can be overridden by
-providing CONTEXT.)
-
-Return t if the package is installed, nil otherwise. (This is
-determined by the return value of `use-package-ensure-function'.)
-If the package is installed, its entry is removed from
-`use-package--deferred-packages'. If the package has no entry in
-`use-package--deferred-packages', do nothing and return t."
-  (interactive
-   (let ((packages nil))
-     (maphash (lambda (package info)
-                (push package packages))
-              use-package--deferred-packages)
-     (if packages
-         (list
-          (intern
-           (completing-read
-            "Select package: "
-            packages
-            nil
-            'require-match))
-          :interactive)
-       (user-error "No packages with deferred installation"))))
-  (let ((spec (gethash name use-package--deferred-packages)))
-    (if spec
-        (when (funcall use-package-ensure-function
-                       name (car spec) (cdr spec)
-                       (or context :unknown))
-          (remhash name use-package--deferred-packages)
-          t)
-      t)))
-
-(defalias 'use-package-normalize/:defer-install 'use-package-normalize-test)
-
-(defun use-package-handler/:defer-install (name keyword defer rest state)
-  (use-package-process-keywords name rest
-    ;; Just specifying `:defer-install' does not do anything; this
-    ;; sets up a marker so that if `:ensure' is specified as well then
-    ;; it knows to set up deferred installation. But then later, when
-    ;; `:config' is processed, it might turn out that `:demand' was
-    ;; specified as well, and the deferred installation needs to be
-    ;; run immediately. For this we need to know if the deferred
-    ;; installation was actually set up or not, so we need to set one
-    ;; marker value in `:defer-install', and then change it to a
-    ;; different value in `:ensure', if the first one is present. (The
-    ;; first marker is `:defer-install', and the second is `:ensure'.)
-    (plist-put state :defer-install (when defer :defer-install))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :ensure
-;;
-(defvar package-archive-contents)
-(defun use-package-normalize/:ensure (name keyword args)
-  (if (null args)
-      t
-    (use-package-only-one (symbol-name keyword) args
-      (lambda (label arg)
-        (if (symbolp arg)
-            arg
-          (use-package-error
-           (concat ":ensure wants an optional package name "
-                   "(an unquoted symbol name)")))))))
-
-(defun use-package-ensure-elpa (name ensure state context &optional no-refresh)
-  (let ((package (or (when (eq ensure t) (use-package-as-symbol name))
-                     ensure)))
-    (when package
-      (require 'package)
-      (or (package-installed-p package)
-          (not (or
-                ;; Contexts in which the confirmation prompt is
-                ;; bypassed.
-                (member context '(:byte-compile :ensure :config))
-                (y-or-n-p (format "Install package %S?" package))))
-          (with-demoted-errors (format "Cannot load %s: %%S" name)
-            (when (assoc package (bound-and-true-p package-pinned-packages))
-              (package-read-all-archive-contents))
-            (if (assoc package package-archive-contents)
-                (progn (package-install package) t)
-              (progn
-                (package-refresh-contents)
-                (when (assoc package (bound-and-true-p
-                                      package-pinned-packages))
-                  (package-read-all-archive-contents))
-                (package-install package))))))))
-
-(defun use-package-handler/:ensure (name keyword ensure rest state)
-  (let* ((body (use-package-process-keywords name rest
-                 ;; Here we are conditionally updating the marker
-                 ;; value for deferred installation; this will be
-                 ;; checked later by `:config'. For more information
-                 ;; see `use-package-handler/:defer-install'.
-                 (if (eq (plist-get state :defer-install)
-                         :defer-install)
-                     (plist-put state :defer-install :ensure)
-                   state))))
-    ;; We want to avoid installing packages when the `use-package'
-    ;; macro is being macro-expanded by elisp completion (see
-    ;; `lisp--local-variables'), but still do install packages when
-    ;; byte-compiling to avoid requiring `package' at runtime.
-    (cond
-     ((plist-get state :defer-install)
-      (push
-       `(puthash ',name '(,ensure . ,state)
-                 use-package--deferred-packages)
-       body)
-      (push `(,use-package-pre-ensure-function
-              ',name ',ensure ',state)
-            body))
-     ((bound-and-true-p byte-compile-current-file)
-      ;; Eval when byte-compiling,
-      (funcall use-package-ensure-function
-               name ensure state :byte-compile))
-     ;;  or else wait until runtime.
-     (t (push `(,use-package-ensure-function
-                ',name ',ensure ',state :ensure)
-              body)))
-    body))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :if, :when and :unless
-;;
-
-(defsubst use-package-normalize-value (label arg)
-  "Normalize a value."
-  (cond ((null arg) nil)
-        ((symbolp arg)
-         `(symbol-value ',arg))
-        ((functionp arg)
-         `(funcall #',arg))
-        (t arg)))
-
-(defun use-package-normalize-test (name keyword args)
-  (use-package-only-one (symbol-name keyword) args
-    #'use-package-normalize-value))
-
-(defalias 'use-package-normalize/:if 'use-package-normalize-test)
-(defalias 'use-package-normalize/:when 'use-package-normalize-test)
-(defalias 'use-package-normalize/:unless 'use-package-normalize-test)
-
-(defun use-package-handler/:if (name keyword pred rest state)
-  (let ((body (use-package-process-keywords name rest state)))
-    `((when ,pred ,@body))))
-
-(defalias 'use-package-handler/:when 'use-package-handler/:if)
-
-(defun use-package-handler/:unless (name keyword pred rest state)
-  (let ((body (use-package-process-keywords name rest state)))
-    `((unless ,pred ,@body))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :requires
-;;
-
-(defun use-package-as-one (label args f)
-  "Call F on the first element of ARGS if it has one element, or all of ARGS."
-  (declare (indent 1))
-  (if (and (listp args) (listp (cdr args)))
-      (if (= (length args) 1)
-          (funcall f label (car args))
-        (funcall f label args))
-    (use-package-error
-     (concat label " wants a list"))))
-
-(put 'use-package-as-one 'lisp-indent-function 'defun)
-
-(defun use-package-normalize-symbols (label arg &optional recursed)
-  "Normalize a list of symbols."
-  (cond
-   ((symbolp arg)
-    (list arg))
-   ((and (not recursed) (listp arg) (listp (cdr arg)))
-    (mapcar #'(lambda (x) (car (use-package-normalize-symbols label x t))) arg))
-   (t
-    (use-package-error
-     (concat label " wants a symbol, or list of symbols")))))
-
-(defun use-package-normalize-symlist (name keyword args)
-  (use-package-as-one (symbol-name keyword) args
-    #'use-package-normalize-symbols))
-
-(defun use-package-normalize-recursive-symbols (label arg)
-  "Normalize a list of symbols."
-  (cond
-   ((symbolp arg)
-    arg)
-   ((and (listp arg) (listp (cdr arg)))
-    (mapcar #'(lambda (x) (use-package-normalize-recursive-symbols label x))
-            arg))
-   (t
-    (use-package-error
-     (concat label " wants a symbol, or nested list of symbols")))))
-
-(defun use-package-normalize-recursive-symlist (name keyword args)
-  (use-package-as-one (symbol-name keyword) args
-    #'use-package-normalize-recursive-symbols))
-
-(defalias 'use-package-normalize/:requires 'use-package-normalize-symlist)
-
-(defun use-package-handler/:requires (name keyword requires rest state)
-  (let ((body (use-package-process-keywords name rest state)))
-    (if (null requires)
-        body
-      `((when ,(if (listp requires)
-                   `(not (member nil (mapcar #'featurep ',requires)))
-                 `(featurep ',requires))
-          ,@body)))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :load-path
-;;
-
-(defun use-package-normalize-paths (label arg &optional recursed)
-  "Normalize a list of filesystem paths."
-  (cond
-   ((and arg (or (symbolp arg) (functionp arg)))
-    (let ((value (use-package-normalize-value label arg)))
-      (use-package-normalize-paths label (eval value))))
-   ((stringp arg)
-    (let ((path (if (file-name-absolute-p arg)
-                    arg
-                  (expand-file-name arg user-emacs-directory))))
-      (list path)))
-   ((and (not recursed) (listp arg) (listp (cdr arg)))
-    (mapcar #'(lambda (x)
-                (car (use-package-normalize-paths label x t))) arg))
-   (t
-    (use-package-error
-     (concat label " wants a directory path, or list of paths")))))
-
-(defun use-package-normalize/:load-path (name keyword args)
-  (use-package-as-one (symbol-name keyword) args
-    #'use-package-normalize-paths))
-
-(defun use-package-handler/:load-path (name keyword arg rest state)
-  (let ((body (use-package-process-keywords name rest state)))
-    (use-package-concat
-     (mapcar #'(lambda (path)
-                 `(eval-and-compile (add-to-list 'load-path ,path))) arg)
-     body)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :no-require
-;;
-
-(defun use-package-normalize-predicate (name keyword args)
-  (if (null args)
-      t
-    (use-package-only-one (symbol-name keyword) args
-      #'use-package-normalize-value)))
-
-(defalias 'use-package-normalize/:no-require 'use-package-normalize-predicate)
-
-(defun use-package-handler/:no-require (name keyword arg rest state)
-  ;; This keyword has no functional meaning.
-  (use-package-process-keywords name rest state))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :preface
-;;
-
-(defun use-package-normalize-form (label args)
-  "Given a list of forms, return it wrapped in `progn'."
-  (unless (listp (car args))
-    (use-package-error (concat label " wants a sexp or list of sexps")))
-  (mapcar #'(lambda (form)
-              (if (and (consp form)
-                       (eq (car form) 'use-package))
-                  (macroexpand form)
-                form)) args))
-
-(defun use-package-normalize-forms (name keyword args)
-  (use-package-normalize-form (symbol-name keyword) args))
-
-(defalias 'use-package-normalize/:preface 'use-package-normalize-forms)
-
-(defun use-package-handler/:preface (name keyword arg rest state)
-  (let ((body (use-package-process-keywords name rest state)))
-    (use-package-concat
-     (unless (null arg)
-       `((eval-and-compile ,@arg)))
-     body)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :bind, :bind*
-;;
-
-(defsubst use-package-is-pair (x car-pred cdr-pred)
-  "Return non-nil if X is a cons satisfying the given predicates.
-CAR-PRED and CDR-PRED are applied to X's `car' and `cdr',
-respectively."
-  (and (consp x)
-       (funcall car-pred (car x))
-       (funcall cdr-pred (cdr x))))
-
-(defun use-package-normalize-pairs
-    (key-pred val-pred name label arg &optional recursed)
-  "Normalize a list of pairs.
-KEY-PRED and VAL-PRED are predicates recognizing valid keys and
-values, respectively.
-If RECURSED is non-nil, recurse into sublists."
-  (cond
-   ((funcall key-pred arg)
-    (list (cons arg (use-package-as-symbol name))))
-   ((use-package-is-pair arg key-pred val-pred)
-    (list arg))
-   ((and (not recursed) (listp arg) (listp (cdr arg)))
-    (let ((last-item nil))
-      (mapcar #'(lambda (x)
-                  (prog1
-                      (let ((ret (use-package-normalize-pairs
-                                  key-pred val-pred name label x t)))
-                        ;; Currently, the handling of keyword
-                        ;; arguments by `use-package' and `bind-key'
-                        ;; is non-uniform and undocumented. As a
-                        ;; result, `use-package-normalize-pairs' (as
-                        ;; it is currently implemented) does not
-                        ;; correctly handle the keyword-argument
-                        ;; syntax of `bind-keys'. A permanent solution
-                        ;; to this problem will require a careful
-                        ;; consideration of the desired
-                        ;; keyword-argument interface for
-                        ;; `use-package' and `bind-key'. However, in
-                        ;; the meantime, we have a quick patch to fix
-                        ;; a serious bug in the handling of keyword
-                        ;; arguments. Namely, the code below would
-                        ;; normally unwrap lists that were passed as
-                        ;; keyword arguments (for example, the
-                        ;; `:filter' argument in `:bind') without
-                        ;; the (not (keywordp last-item)) clause. See
-                        ;; #447 for further discussion.
-                        (if (and (listp ret) (not (keywordp last-item)))
-                            (car ret)
-                          ret))
-                    (setq last-item x))) arg)))
-   (t arg)))
-
-(defun use-package-normalize-binder (name keyword args)
-  (use-package-as-one (symbol-name keyword) args
-    (lambda (label arg)
-      (unless (consp arg)
-        (use-package-error
-         (concat label " a (<string or vector> . <symbol or string>)"
-                 " or list of these")))
-      (use-package-normalize-pairs (lambda (k) (or (stringp k) (vectorp k)))
-                                   (lambda (b) (or (symbolp b) (stringp b)))
-                                   name label arg))))
-
-(defalias 'use-package-normalize/:bind 'use-package-normalize-binder)
-(defalias 'use-package-normalize/:bind* 'use-package-normalize-binder)
-
-(defun use-package-handler/:bind
-    (name keyword arg rest state &optional bind-macro)
-  (let ((commands (remq nil (mapcar #'(lambda (arg)
-                                        (if (listp arg)
-                                            (cdr arg)
-                                          nil)) arg))))
-    (use-package-concat
-     (use-package-process-keywords name
-       (use-package-sort-keywords
-        (use-package-plist-maybe-put rest :defer t))
-       (use-package-plist-append state :commands commands))
-     `((ignore
-        ,(macroexpand
-          `(,(if bind-macro bind-macro 'bind-keys)
-            :package ,name ,@arg)))))))
-
-(defun use-package-handler/:bind* (name keyword arg rest state)
-  (use-package-handler/:bind name keyword arg rest state 'bind-keys*))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :bind-keymap, :bind-keymap*
-;;
-
-(defalias 'use-package-normalize/:bind-keymap 'use-package-normalize-binder)
-(defalias 'use-package-normalize/:bind-keymap* 'use-package-normalize-binder)
-
-;;;###autoload
-(defun use-package-autoload-keymap (keymap-symbol package override)
-  "Loads PACKAGE and then binds the key sequence used to invoke
-this function to KEYMAP-SYMBOL.  It then simulates pressing the
-same key sequence a again, so that the next key pressed is routed
-to the newly loaded keymap.
-
-This function supports use-package's :bind-keymap keyword.  It
-works by binding the given key sequence to an invocation of this
-function for a particular keymap.  The keymap is expected to be
-defined by the package.  In this way, loading the package is
-deferred until the prefix key sequence is pressed."
-  (if (not (require package nil t))
-      (use-package-error (format "Cannot load package.el: %s" package))
-    (if (and (boundp keymap-symbol)
-             (keymapp (symbol-value keymap-symbol)))
-        (let* ((kv (this-command-keys-vector))
-               (key (key-description kv))
-               (keymap (symbol-value keymap-symbol)))
-          (if override
-              (bind-key* key keymap)
-            (bind-key key keymap))
-          (setq unread-command-events
-                (listify-key-sequence kv)))
-      (use-package-error
-       (format "use-package: package.el %s failed to define keymap %s"
-               package keymap-symbol)))))
-
-(defun use-package-handler/:bind-keymap
-    (name keyword arg rest state &optional override)
-  (let ((form (mapcar
-               #'(lambda (binding)
-                   `(,(if override
-                          'bind-key*
-                        'bind-key)
-                     ,(car binding)
-                     #'(lambda ()
-                         (interactive)
-                         (use-package-autoload-keymap
-                          ',(cdr binding) ',(use-package-as-symbol name) ,override)))) arg)))
-    (use-package-concat
-     (use-package-process-keywords name
-       (use-package-sort-keywords
-        (use-package-plist-maybe-put rest :defer t))
-       state)
-     `((ignore ,@form)))))
-
-(defun use-package-handler/:bind-keymap* (name keyword arg rest state)
-  (use-package-handler/:bind-keymap name keyword arg rest state t))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :interpreter
-;;
-
-(defun use-package-normalize-mode (name keyword args)
-  "Normalize arguments for keywords which add regexp/mode pairs to an alist."
-  (use-package-as-one (symbol-name keyword) args
-    (apply-partially #'use-package-normalize-pairs
-                     #'use-package-regex-p
-                     (lambda (m) (and (not (null m)) (symbolp m)))
-                     name)))
-
-(defun use-package-handle-mode (name alist arg rest state)
-  "Handle keywords which add regexp/mode pairs to an alist."
-  (let* (commands
-         (form (mapcar #'(lambda (thing)
-                           (push (cdr thing) commands)
-                           (setcar thing
-                                   (use-package-normalize-regex (car thing)))
-                           `(add-to-list ',alist ',thing)) arg)))
-    (use-package-concat
-     (use-package-process-keywords name
-       (use-package-sort-keywords
-        (use-package-plist-maybe-put rest :defer t))
-       (use-package-plist-append state :commands commands))
-     `((ignore ,@form)))))
-
-(defalias 'use-package-normalize/:interpreter 'use-package-normalize-mode)
-
-(defun use-package-handler/:interpreter (name keyword arg rest state)
-  (use-package-handle-mode name 'interpreter-mode-alist arg rest state))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :mode
-;;
-
-(defalias 'use-package-normalize/:mode 'use-package-normalize-mode)
-
-(defun use-package-handler/:mode (name keyword arg rest state)
-  (use-package-handle-mode name 'auto-mode-alist arg rest state))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :magic
-;;
-
-(defalias 'use-package-normalize/:magic 'use-package-normalize-mode)
-
-(defun use-package-handler/:magic (name keyword arg rest state)
-  (use-package-handle-mode name 'magic-mode-alist arg rest state))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :magic-fallback
-;;
-
-(defalias 'use-package-normalize/:magic-fallback 'use-package-normalize-mode)
-
-(defun use-package-handler/:magic-fallback (name keyword arg rest state)
-  (use-package-handle-mode name 'magic-fallback-mode-alist arg rest state))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :commands
-;;
-
-(defalias 'use-package-normalize/:commands 'use-package-normalize-symlist)
-
-(defun use-package-handler/:commands (name keyword arg rest state)
-  ;; The actual processing for commands is done in :defer
-  (use-package-process-keywords name
-    (use-package-sort-keywords
-     (use-package-plist-maybe-put rest :defer t))
-    (use-package-plist-append state :commands arg)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :defines
-;;
-
-(defalias 'use-package-normalize/:defines 'use-package-normalize-symlist)
-
-(defun use-package-handler/:defines (name keyword arg rest state)
-  (let ((body (use-package-process-keywords name rest state)))
-    body))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :functions
-;;
-
-(defalias 'use-package-normalize/:functions 'use-package-normalize-symlist)
-
-(defun use-package-handler/:functions (name keyword arg rest state)
-  (let ((body (use-package-process-keywords name rest state)))
-    (if (not (bound-and-true-p byte-compile-current-file))
-        body
-      (use-package-concat
-       (unless (null arg)
-         `((eval-when-compile
-             ,@(mapcar
-                #'(lambda (fn)
-                    `(declare-function ,fn ,(use-package-as-string name))) arg))))
-       body))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :defer
-;;
-
-(defalias 'use-package-normalize/:defer 'use-package-normalize-predicate)
-
-(defun use-package--autoload-with-deferred-install
-    (command package-name)
-  "Return a form defining an autoload supporting deferred install."
-  `(let* ((load-list-item '(defun . ,command))
-          (already-loaded (member load-list-item current-load-list)))
-     (defun ,command (&rest args)
-       "[Arg list not available until function definition is loaded.]
-
-\(fn ...)"
-       (interactive)
-       (if (bound-and-true-p use-package--recursive-autoload)
-           (use-package-error
-            (format "Autoloading failed to define function %S"
-                    ',command))
-         (when (use-package-install-deferred-package
-                ',package-name :autoload)
-           (require ',package-name)
-           (let ((use-package--recursive-autoload t))
-             (if (called-interactively-p 'any)
-                 (call-interactively ',command)
-               (apply ',command args))))))
-     ;; This prevents the user's init-file from being recorded as the
-     ;; definition location for the function before it is actually
-     ;; loaded. (Our goal is to leave the `current-load-list'
-     ;; unchanged, so we only remove the entry for this function if it
-     ;; was not already present.)
-     (unless already-loaded
-       (setq current-load-list (remove load-list-item current-load-list)))))
-
-(defun use-package-handler/:defer (name keyword arg rest state)
-  (let ((body (use-package-process-keywords name rest
-                (plist-put state :deferred t)))
-        (name-string (use-package-as-string name)))
-    (use-package-concat
-     ;; Load the package after a set amount of idle time, if the argument to
-     ;; `:defer' was a number.
-     (when (numberp arg)
-       `((run-with-idle-timer ,arg nil #'require ',(use-package-as-symbol name) nil t)))
-
-     ;; Since we deferring load, establish any necessary autoloads, and also
-     ;; keep the byte-compiler happy.
-     (apply
-      #'nconc
-      (mapcar
-       #'(lambda (command)
-           (when (not (stringp command))
-             (append
-              `((unless (fboundp ',command)
-                  ;; Here we are checking the marker value set in
-                  ;; `use-package-handler/:ensure' to see if deferred
-                  ;; installation is actually happening. See
-                  ;; `use-package-handler/:defer-install' for more
-                  ;; information.
-                  ,(if (eq (plist-get state :defer-install) :ensure)
-                       (use-package--autoload-with-deferred-install
-                        command name)
-                     `(autoload #',command ,name-string nil t))))
-              (when (bound-and-true-p byte-compile-current-file)
-                `((eval-when-compile
-                    (declare-function ,command ,name-string)))))))
-       (delete-dups (plist-get state :commands))))
-
-     body)))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :after
-;;
-
-(defalias 'use-package-normalize/:after 'use-package-normalize-recursive-symlist)
-
-(defun use-package-require-after-load
-    (features)
-  "Return form for after any of FEATURES require NAME."
-  (pcase features
-    ((and (pred symbolp) feat)
-     `(lambda (body)
-        (list 'eval-after-load (list 'quote ',feat)
-              (list 'quote body))))
-    (`(,(or :or  :any) . ,rest)
-     `(lambda (body)
-        (append (list 'progn)
-                (mapcar (lambda (form)
-                          (funcall form body))
-                        (list ,@(use-package-require-after-load rest))))))
-    (`(,(or :and :all) . ,rest)
-     `(lambda (body)
-        (let ((result body))
-          (dolist (form (list ,@(use-package-require-after-load rest)))
-            (setq result (funcall form result)))
-          result)))
-    (`(,feat . ,rest)
-     (if rest
-         (cons (use-package-require-after-load feat)
-               (use-package-require-after-load rest))
-       (list (use-package-require-after-load feat))))))
-
-(defun use-package-handler/:after (name keyword arg rest state)
-  (let ((body (use-package-process-keywords name rest
-                (plist-put state :deferred t)))
-        (name-string (use-package-as-string name)))
-    (if (and (consp arg)
-             (not (memq (car arg) '(:or :any :and :all))))
-        (setq arg (cons :all arg)))
-    (use-package-concat
-     (when arg
-       (list (funcall (use-package-require-after-load arg)
-                      (macroexp-progn
-                       ;; Here we are checking the marker value for deferred
-                       ;; installation set in `use-package-handler/:ensure'.
-                       ;; See also `use-package-handler/:defer-install'.
-                       `(,@(when (eq (plist-get state :defer-install) :ensure)
-                             `((use-package-install-deferred-package
-                                'name :after)))
-                         (require (quote ,name) nil t))))))
-     body)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :demand
-;;
-
-(defalias 'use-package-normalize/:demand 'use-package-normalize-predicate)
-
-(defun use-package-handler/:demand (name keyword arg rest state)
-  (use-package-process-keywords name rest
-    (use-package-plist-delete state :deferred)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :init
-;;
-
-(defalias 'use-package-normalize/:init 'use-package-normalize-forms)
-
-(defun use-package-handler/:init (name keyword arg rest state)
-  (let ((body (use-package-process-keywords name rest state)))
-    (use-package-concat
-     ;; The user's initializations
-     (let ((init-body
-            (use-package-hook-injector (use-package-as-string name)
-                                       :init arg)))
-       (if use-package-check-before-init
-           `((if (locate-library ,(use-package-as-string name))
-                 ,(macroexp-progn init-body)))
-         init-body))
-     body)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :config
-;;
-
-(defalias 'use-package-normalize/:config 'use-package-normalize-forms)
-
-(defun use-package-handler/:config (name keyword arg rest state)
-  (let* ((body (use-package-process-keywords name rest state))
-         (name-symbol (use-package-as-symbol name))
-         (config-body
-          (if (equal arg '(t))
-              body
-            (use-package--with-elapsed-timer
-                (format "Configuring package %s" name-symbol)
-              (use-package-concat
-               (use-package-hook-injector (symbol-name name-symbol)
-                                          :config arg)
-               body
-               (list t))))))
-    (if (plist-get state :deferred)
-        (unless (or (null config-body) (equal config-body '(t)))
-          `((eval-after-load ,(if (symbolp name) `',name name)
-              ',(macroexp-progn config-body))))
-      ;; Here we are checking the marker value for deferred
-      ;; installation set in `use-package-handler/:ensure'. See also
-      ;; `use-package-handler/:defer-install'.
-      (when (eq (plist-get state :defer-install) :ensure)
-        (use-package-install-deferred-package name :config))
-      (use-package--with-elapsed-timer
-          (format "Loading package %s" name)
-        (if use-package-expand-minimally
-            (use-package-concat
-             (list (use-package-load-name name))
-             config-body)
-          `((if (not ,(use-package-load-name name t))
-                (ignore
-                 (message (format "Cannot load %s" ',name)))
-              ,@config-body)))))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :diminish
-;;
-
-(defun use-package-normalize-diminish (name label arg &optional recursed)
-  "Normalize the arguments to diminish down to a list of one of two forms:
-     SYMBOL
-     (SYMBOL . STRING)"
-  (cond
-   ((symbolp arg)
-    (list arg))
-   ((stringp arg)
-    (list (cons (intern (concat (use-package-as-string name) "-mode")) arg)))
-   ((and (consp arg) (stringp (cdr arg)))
-    (list arg))
-   ((and (not recursed) (listp arg) (listp (cdr arg)))
-    (mapcar #'(lambda (x) (car (use-package-normalize-diminish
-                                name label x t))) arg))
-   (t
-    (use-package-error
-     (concat label " wants a string, symbol, "
-             "(symbol . string) or list of these")))))
-
-(defun use-package-normalize/:diminish (name keyword args)
-  (use-package-as-one (symbol-name keyword) args
-    (apply-partially #'use-package-normalize-diminish name)))
-
-(defun use-package-handler/:diminish (name keyword arg rest state)
-  (let ((body (use-package-process-keywords name rest state)))
-    (use-package-concat
-     (mapcar #'(lambda (var)
-                 `(if (fboundp 'diminish)
-                      ,(if (consp var)
-                           `(diminish ',(car var) ,(cdr var))
-                         `(diminish ',var))))
-             arg)
-     body)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; :delight
-;;
-
-(defun use-package--normalize-delight-1 (name args)
-  "Normalize ARGS for a single call to `delight'."
-  (when (eq :eval (car args))
-    ;; Handle likely common mistake.
-    (use-package-error ":delight mode line constructs must be quoted"))
-  (cond ((and (= (length args) 1) (symbolp (car args)))
-         `(,(nth 0 args) nil ,name))
-        ((= (length args) 2)
-         `(,(nth 0 args) ,(nth 1 args) ,name))
-        ((= (length args) 3)
-         args)
-        (t
-         (use-package-error
-          ":delight expects `delight' arguments or a list of them"))))
-
-(defun use-package-normalize/:delight (name keyword args)
-  "Normalize arguments to delight."
-  (cond ((null args)
-         `((,(use-package-as-mode name) nil ,name)))
-        ((and (= (length args) 1)
-              (symbolp (car args)))
-         `((,(car args) nil ,name)))
-        ((and (= (length args) 1)
-              (stringp (car args)))
-         `((,(use-package-as-mode name) ,(car args) ,name)))
-        ((and (= (length args) 1)
-              (listp (car args))
-              (eq 'quote (caar args)))
-         `((,(use-package-as-mode name) ,@(cdar args) ,name)))
-        ((and (= (length args) 2)
-              (listp (nth 1 args))
-              (eq 'quote (car (nth 1 args))))
-         `((,(car args) ,@(cdr (nth 1 args)) ,name)))
-        (t (mapcar
-            (apply-partially #'use-package--normalize-delight-1 name)
-            (if (symbolp (car args)) (list args) args)))))
-
-(defun use-package-handler/:delight (name keyword args rest state)
-  (let ((body (use-package-process-keywords name rest state)))
-    (use-package-concat
-     body
-     `((delight '(,@args))))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; The main macro
-;;
-
-;;;###autoload
-(defmacro use-package (name &rest args)
-  "Declare an Emacs package by specifying a group of configuration options.
-
-For full documentation, please see the README file that came with
-this file.  Usage:
-
-  (use-package package-name
-     [:keyword [option]]...)
-
-:init            Code to run before PACKAGE-NAME has been loaded.
-:config          Code to run after PACKAGE-NAME has been loaded.  Note that
-                 if loading is deferred for any reason, this code does not
-                 execute until the lazy load has occurred.
-:preface         Code to be run before everything except `:disabled'; this
-                 can be used to define functions for use in `:if', or that
-                 should be seen by the byte-compiler.
-
-:mode            Form to be added to `auto-mode-alist'.
-:magic           Form to be added to `magic-mode-alist'.
-:magic-fallback  Form to be added to `magic-fallback-mode-alist'.
-:mode            Form to be added to `auto-mode-alist'.
-:interpreter     Form to be added to `interpreter-mode-alist'.
-
-:commands        Define autoloads for commands that will be defined by the
-                 package.  This is useful if the package is being lazily
-                 loaded, and you wish to conditionally call functions in your
-                 `:init' block that are defined in the package.
-
-:bind            Bind keys, and define autoloads for the bound commands.
-:bind*           Bind keys, and define autoloads for the bound commands,
-                 *overriding all minor mode bindings*.
-:bind-keymap     Bind a key prefix to an auto-loaded keymap defined in the
-                 package.  This is like `:bind', but for keymaps.
-:bind-keymap*    Like `:bind-keymap', but overrides all minor mode bindings
-
-:defer           Defer loading of a package -- this is implied when using
-                 `:commands', `:bind', `:bind*', `:mode', `:magic',
-                 `:magic-fallback', or `:interpreter'.  This can be an integer,
-                 to force loading after N seconds of idle time, if the package
-                 has not already been loaded.
-
-:after           Defer loading of a package until after any of the named
-                 features are loaded.
-
-:demand          Prevent deferred loading in all cases.
-
-:if EXPR         Initialize and load only if EXPR evaluates to a non-nil value.
-:disabled        The package is ignored completely if this keyword is present.
-:defines         Declare certain variables to silence the byte-compiler.
-:functions       Declare certain functions to silence the byte-compiler.
-:load-path       Add to the `load-path' before attempting to load the package.
-:diminish        Support for diminish.el (if installed).
-:delight         Support for delight.el (if installed).
-:ensure          Loads the package using package.el if necessary.
-:pin             Pin the package to an archive."
-  (declare (indent 1))
-  (unless (member :disabled args)
-    (let ((name-symbol (if (stringp name) (intern name) name))
-          (args (use-package-normalize-plist name args)))
-      (dolist (spec use-package-defaults)
-        (setq args (use-package-sort-keywords
-                    (if (eval (nth 2 spec))
-                        (use-package-plist-maybe-put
-                         args (nth 0 spec) (eval (nth 1 spec)))
-                      args))))
-
-      ;; When byte-compiling, pre-load the package so all its symbols are in
-      ;; scope.
-      (if (bound-and-true-p byte-compile-current-file)
-          (setq args
-                (use-package-plist-cons
-                 args :preface
-                 `(eval-when-compile
-                    ,@(mapcar #'(lambda (var) `(defvar ,var))
-                              (plist-get args :defines))
-                    (with-demoted-errors
-                        ,(format "Cannot load %s: %%S" name)
-                      ,(if (eq use-package-verbose 'debug)
-                           `(message "Compiling package %s" ',name-symbol))
-                      ,(unless (plist-get args :no-require)
-                         (use-package-load-name name)))))))
-
-      (let ((body
-             (macroexp-progn
-              (use-package-process-keywords name
-                (if use-package-always-demand
-                    (append args '(:demand t))
-                  args)
-                (and use-package-always-defer (list :deferred t))))))
-        (if use-package-debug
-            (display-buffer
-             (save-current-buffer
-               (let ((buf (get-buffer-create "*use-package*")))
-                 (with-current-buffer buf
-                   (delete-region (point-min) (point-max))
-                   (emacs-lisp-mode)
-                   (insert (pp-to-string body)))
-                 buf))))
-        body))))
-
-
-(put 'use-package 'lisp-indent-function 'defun)
-
-(provide 'use-package)
-
-;; Local Variables:
-;; outline-regexp: ";;;\\(;* [^\s\t\n]\\|###autoload\\)\\|("
-;; indent-tabs-mode: nil
-;; End:
-
-;;; use-package.el ends here
.emacs.d/lisp/use-package/use-package.elc
Binary file
.emacs.d/lisp/setup-package.el
@@ -1,54 +0,0 @@
-(require 'package)
-(require 'cl-lib)
-
-;; add melpa and melpa-stable to package repos
-(add-to-list 'package-archives '("mela-stable" . "https://stable.melpa.org/packages/"))
-(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
-
-(setq use-package-always-pin "melpa")
-
-;; elpy
-(add-to-list 'package-archives
-             '("elpy" . "https://jorgenschaefer.github.io/packages/"))
-
-(setq tls-checktrust t)
-(setq gnutls-verify-error t)
-
-(let ((trustfile "/etc/ssl/cert.pem"))
-  (setq tls-program
-        `(,(format  "gnutls-cli --x509cafile %s -p %%p %%h" trustfile)
-          ,(format "openssl s_client -connect %%h:%%p -CAfile %s -no_ssl2 -ign_eof" trustfile)))
-  (setq gnutls-trustfiles (list trustfile)))
-
-(ignore-errors (let ((bad-hosts
-                      (cl-loop for bad
-                               in `("https://wrong.host.badssl.com/"
-                                    "https://self-signed.badssl.com/")
-                               if (condition-case e
-                                      (url-retrieve
-                                       bad (lambda (retrieved) t))
-                                    (error nil))
-                               collect bad)))
-                 (if bad-hosts
-                     (error (format "tls misconfigured; retrieved %s ok"
-                                    bad-hosts))
-                   (url-retrieve "https://badssl.com"
-                                 (lambda (retrieved) t)))))
-
-
-;; If gpg cannot be found, signature checking will fail, so we
-;; conditionnally enable it according wether gpg is availabel.
-;; We re-run this check once $PATH has been configured
-(defun sanityinc/package-maybe-enable-signatures ()
-  (setq package-check-signature (when (executable-find "gpg2") 'allow-unsigned)))
-
-(sanityinc/package-maybe-enable-signatures)
-
-;; Load package contents if not present
-(when (not package-archive-contents)
-  (package-refresh-contents))
-
-;; Load use-package
-(require 'use-package)
-
-(provide 'setup-package)
.emacs.d/lisp/setup-package.elc
Binary file
.emacs.d/lisp/vde-functions.el
@@ -1,39 +0,0 @@
-(defun unload-org-mode ()
-  (interactive)
-  (and (featurep 'org-agenda)(unload-feature 'org-agenda t ))
-  (and (featurep 'org-bbdb)(unload-feature 'org-bbdb t ))
-  (and (featurep 'org-bibtex)(unload-feature 'org-bibtex t ))
-  (and (featurep 'org-compat)(unload-feature 'org-compat t ))
-  (and (featurep 'org-exp)(unload-feature 'org-exp t ))
-  (and (featurep 'org-exp-blocks)(unload-feature 'org-exp-blocks t ))
-  (and (featurep 'org-faces)(unload-feature 'org-faces t ))
-  (and (featurep 'org-footnote)(unload-feature 'org-footnote t ))
-  (and (featurep 'org-gnus)(unload-feature 'org-gnus t ))
-  (and (featurep 'org-html)(unload-feature 'org-html t ))
-  (and (featurep 'org-info)(unload-feature 'org-info t ))
-  (and (featurep 'org-infojs)(unload-feature 'org-infojs t ))
-  (and (featurep 'org-irc)(unload-feature 'org-irc t ))
-  (and (featurep 'org-jsinfo)(unload-feature 'org-jsinfo t ))
-  (and (featurep 'org-list)(unload-feature 'org-list t ))
-  (and (featurep 'org-macs)(unload-feature 'org-macs t ))
-  (and (featurep 'org-mew)(unload-feature 'org-mew t ))
-  (and (featurep 'org-mhe)(unload-feature 'org-mhe t ))
-  (and (featurep 'org-rmail)(unload-feature 'org-rmail t ))
-  (and (featurep 'org-src)(unload-feature 'org-src t ))
-  (and (featurep 'org-vm)(unload-feature 'org-vm t))
-  (and (featurep 'org-w3m)(unload-feature 'org-w3m t))
-  (and (featurep 'org-wl)(unload-feature 'org-wl t ))
-  (and (featurep 'org)(unload-feature 'org t)))
-
-
-(defun vde/unsaved-changes ()
-  (interactive)
-  (diff-buffer-with-file (current-buffer)))
-
-(defun vde/find-file-as-sudo ()
-  (interactive)
-  (let ((file-name (buffer-file-name)))
-    (when file-name
-      (find-alternate-file (concat "/sudo::" file-name)))))
-
-(provide 'vde-functions)
.emacs.d/lisp/vde-functions.elc
Binary file
.emacs.d/emacs.org
@@ -1,311 +0,0 @@
-#+TITLE: Vincent Demeester's emacs configuration
-#+TAGS: emacs configuration
-
-#+BEGIN_SRC
-                                                              ___ __
-    .-----.--------.---.-.----.-----.______.----.-----.-----.'  _|__|.-----.
-    |  -__|        |  _  |  __|__ --|______|  __|  _  |     |   _|  ||  _  |
-    |_____|__|__|__|___._|____|_____|      |____|_____|__|__|__| |__||___  |
-                                                                     |_____|
-#+END_SRC
-
-This is my second attempt to write a litterate configuration for
-emacs. The first one want well but still, there is some part that
-weren't litterate, and it got cluttered really quick.
-
-That time, I am going to try to follow few principles:
-
-- Do no hesitate to separate the configuration into several files. For
-  example, a file for the Go language configuration, one for Org-mode
-  configuration, etc. would make sense I feel. One other aspect of
-  this is, I may want to be able to extract those file to publish them
-  as blogpost /or/ articles.
-- Do *everything* litterate. What this mean is, if I want to create a
-  =Caskfile= or a shell script, this will also be in an org-mode file
-  with the right =tangle= definitions.
-- Adopt vim =modal= editing, thus probably using =evil= mode. And make
-  sure the behaviour I adopt on my bepo layout, would be the same on a
-  =qwerty= layout. What this means is, get the most common modal
-  shortcut that would work on another vim setup and make sure to
-  rebinding it to bepo keys.
-
-Starting from scratch is going to be a little bit tricky, given the
-load of configuration I had, but I really feel it is a good thing 👼.
-
-This configuration is /tangled/ by org-mode (babel) and byte-compiled.
-
-* Early work 🚀
-
-There is a few things we want to do early :
-
-- Setup package management
-- Disable/Enable some built-in features
-- Setup a correct theme (the default one is /ok/ but you know..
-
-This makes it so that the file that is produced from tangling this
-file uses lexical scoping.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  ;;; -*- lexical-binding: t -*-
-  (setq-default lexical-binding t)
-#+END_SRC
-
-Let's also error-out really quick if the Emacs version is too old
-(i.e. below 24 as of today).
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (let ((minver 24))
-    (unless (>= emacs-major-version minver)
-      (error "Your Emacs is too old -- this configuration requrise v%s or higher" minver)))
-#+END_SRC
-
-Let's also add =.emacs.d/lisp= folder(s) to the load-path so that we
-can write our own emacs-lisp /libraries/.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  ;; Add custom lisp files to load-path
-  (add-to-list 'load-path (concat user-emacs-directory "lisp"))
-  (add-to-list 'load-path (concat user-emacs-directory "config"))
-  (add-to-list 'load-path (concat user-emacs-directory "lisp/use-package"))
-#+END_SRC
-
-** Variables and personal information
-
-Let's define a bunch of variable name that will be useful later (like
-where are =org-mode= file stored, etc.)
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (setq
-   desktop-directory (substitute-env-in-file-name "$HOME/desktop")
-   downloads-directory (expand-file-name "downloads" desktop-directory)
-   videos-directory (expand-file-name "videos" desktop-directory)
-   music-directory (expand-file-name "music" desktop-directory)
-   pictures-directory (expand-file-name "pictures" desktop-directory)
-   github-general-folder (substitute-env-in-file-name "$HOME/src/github.com")
-   github-username "vdemeester"
-   github-personal-folder (expand-file-name github-username github-general-folder))
-#+END_SRC
-
-** GUI Disables
-
-Death to any gui elements in emacs! Do this EARLY so that emacs
-doesn't redisplay in a way that is visually unpleasant on startup a
-bunch of times.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
-  (when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
-  (when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
-  (when (fboundp 'blink-cursor-mode) (blink-cursor-mode -1))
-#+END_SRC
-
-Tooltips are annoying:
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-(if (fboundp 'tooltip-mode) (tooltip-mode -1) (setq tooltip-use-echo-area t))'
-#+END_SRC
-
-** Package management
-
-I am going to use [[https://github.com/jwiegley/use-package][use-package]] as my /package-management/ of choice
-with built-in =package.el=. I'm manually updating it in this
-repository from upstream.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (require 'package)
-  (package-initialize)
-
-  (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/"))
-  (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
-
-  (setq use-package-always-pin "melpa-stable")
-
-  (when (not package-archive-contents)
-    (package-refresh-contents))
-
-  (require 'use-package)
-#+END_SRC
-
-To reduce the risk of loading outdated byte code files, we set
-load-prefer-newer and enable auto-compile-on-load-mode as early as
-possible.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-(setq load-prefer-newer t)
-#+END_SRC
-
-Let's also use [[https://github.com/myrjola/diminish.el][diminish.el]]. =use-package= provides built-in support
-for diminish. If it's installed, using =:diminish= will remove/hide
-the mode from the modeline.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (use-package diminish
-    :ensure t)
-#+END_SRC
-
-** Setup auto-compile
-
-Automatically compile emacs-lisp libraries. This guarantee that Emacs never loads outdated byte code files.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (use-package auto-compile
-    :ensure t
-    :config
-    (progn
-      (auto-compile-on-load-mode)
-      (auto-compile-on-save-mode)))
-#+END_SRC
-
-** Backup files
-
-Files suffixed with =~= in the current directory are ugly — this is
-really something I hate. I'm not against using backup files, as it can
-saves some time in case of trouble. But we'll move them elsewhere :
-=~/tmp/emacs-1001= (if the use uid is =1001=). Note that we are not
-using =/tmp= to store them because in most of my setup, =/tmp= is
-/in-memory/. Using it would mean we would loose those temporary files
-between reboots.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (defconst emacs-tmp-dir (format "%s/%s%s/" temporary-file-directory "emacs" (user-uid)))
-  (setq backup-directory-alist
-        `((".*" . ,emacs-tmp-dir))
-        auto-save-file-name-transforms
-        `((".*" ,emacs-tmp-dir t))
-        auto-save-list-file-prefix emacs-tmp-dir)
-#+END_SRC
-
-Now that all the temporary files are out of the way, we can keep more of them.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (setq delete-old-versions t
-        kept-new-versions 6
-        kept-old-versions 2
-        version-control t)
-#+END_SRC
-
-** Encoding system
-
-Make sure we use =utf-8= by default.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (set-terminal-coding-system 'utf-8)
-  (set-keyboard-coding-system 'utf-8)
-  (set-language-environment "UTF-8")
-  (prefer-coding-system 'utf-8)
-  (setq-default buffer-file-coding-system 'utf-8-auto-unix)
-#+END_SRC
-
-** Lazier prompting
-
-Answering yes and no to each question from Emacs can be tedious, a
-single y or n will suffice.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (fset 'yes-or-no-p 'y-or-n-p)
-#+END_SRC
-
-Let Emacs display the unfinished keystroke quickly (by default it's 1
-second).
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (setq echo-keystrokes 0.1)
-#+END_SRC
-
-** Shell environment variables
-
-Let's share most of the shell environment variables with Emacs.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (use-package exec-path-from-shell
-    :ensure t
-    :config
-    (setq exec-path-from-shell-arguments (list "-l"))
-    (setq exec-path-from-shell-check-startup-files nil)
-    (add-to-list 'exec-path-from-shell-variables "SHELL")
-    (add-to-list 'exec-path-from-shell-variables "GOPATH")
-    (add-to-list 'exec-path-from-shell-variables "ENVIRONMENT_SETUP_DONE")
-    (add-to-list 'exec-path-from-shell-variables "PYTHONPATH")
-    (exec-path-from-shell-initialize))
-#+END_SRC
-
-** Fill Setup
-
-Get rid of nags about requiring setences to end with two spaces.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (setq sentence-end-double-space nil)
-#+END_SRC
-
-Set the default fill-column
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (setq-default fill-column 80)
-#+END_SRC
-
-** Server
-
-Let's start /the emacs/ server in order to have almost only one shared
-instance of emacs running "long-time". I'm usually starting it using
-i3 (in the background).
-
-I had an error about /unsafe directory/ for =/tmp/emacs100=, that's
-why there is an advice here to ignore the error (see [[http://stackoverflow.com/a/17069276/89249][stackoverflow]]).
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (defadvice server-ensure-safe-dir (around
-                                     my-around-server-ensure-safe-dir
-                                     activate)
-    "Ignores any errors raised from server-ensure-safe-dir"
-    (ignore-errors ad-do-it))
-  (unless (string= (user-login-name) "root")
-    (require 'server)
-    (when (or (not server-process)
-              (not (eq (process-status server-process)
-                       'listen)))
-      (unless (server-running-p server-name)
-     (server-start))))
-#+END_SRC
-
-** Which-key
-
-Emacs has 100s of bindings and it is impossible to remember them
-all. Sometimes I can remember the start of a key chord but not the
-entire one. [[https://github.com/justbur/emacs-which-key][Which-key]] is a package that gives you key hints on delay
-or if prompted. I really like it and use it extensively to setup the
-modal state.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (use-package which-key
-    :ensure t
-    :defer t
-    :diminish which-key-mode
-    :init
-    (setq which-key-sort-order 'which-key-key-order-alpha)
-    :bind* (("M-m ?" . which-key-show-top-level))
-    :config
-    (which-key-mode)
-    (which-key-add-key-based-replacements
-      "M-m ?" "top level bindings"))
-#+END_SRC
-
-** Adaptative cursor width
-
-Let's make cursor the width of the character it is under.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (setq x-stretch-cursor t)
-#+END_SRC
-
-* Load configurations
-
-It is now time to load other configuration.
-
-#+BEGIN_SRC emacs-lisp :tangle init.el
-  (use-package visual-config)
-  (use-package org-config)
-  (use-package nix-config)
-  (use-package go-config)
-  (use-package vcs-config)
-  (use-package navigation-config)
-#+END_SRC
.emacs.d/init.el
@@ -1,125 +0,0 @@
-
-;;; -*- lexical-binding: t -*-
-(setq-default lexical-binding t)
-
-(let ((minver 24))
-  (unless (>= emacs-major-version minver)
-    (error "Your Emacs is too old -- this configuration requrise v%s or higher" minver)))
-
-;; Add custom lisp files to load-path
-(add-to-list 'load-path (concat user-emacs-directory "lisp"))
-(add-to-list 'load-path (concat user-emacs-directory "config"))
-(add-to-list 'load-path (concat user-emacs-directory "lisp/use-package"))
-
-(setq
- desktop-directory (substitute-env-in-file-name "$HOME/desktop")
- downloads-directory (expand-file-name "downloads" desktop-directory)
- videos-directory (expand-file-name "videos" desktop-directory)
- music-directory (expand-file-name "music" desktop-directory)
- pictures-directory (expand-file-name "pictures" desktop-directory)
- github-general-folder (substitute-env-in-file-name "$HOME/src/github.com")
- github-username "vdemeester"
- github-personal-folder (expand-file-name github-username github-general-folder))
-
-(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
-(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
-(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
-(when (fboundp 'blink-cursor-mode) (blink-cursor-mode -1))
-
-(if (fboundp 'tooltip-mode) (tooltip-mode -1) (setq tooltip-use-echo-area t))'
-
-(require 'package)
-(package-initialize)
-
-(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/"))
-(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
-
-(setq use-package-always-pin "melpa-stable")
-
-(when (not package-archive-contents)
-  (package-refresh-contents))
-
-(require 'use-package)
-
-(setq load-prefer-newer t)
-
-(use-package diminish
-  :ensure t)
-
-(use-package auto-compile
-  :ensure t
-  :config
-  (progn
-    (auto-compile-on-load-mode)
-    (auto-compile-on-save-mode)))
-
-(defconst emacs-tmp-dir (format "%s/%s%s/" temporary-file-directory "emacs" (user-uid)))
-(setq backup-directory-alist
-      `((".*" . ,emacs-tmp-dir))
-      auto-save-file-name-transforms
-      `((".*" ,emacs-tmp-dir t))
-      auto-save-list-file-prefix emacs-tmp-dir)
-
-(setq delete-old-versions t
-      kept-new-versions 6
-      kept-old-versions 2
-      version-control t)
-
-(set-terminal-coding-system 'utf-8)
-(set-keyboard-coding-system 'utf-8)
-(set-language-environment "UTF-8")
-(prefer-coding-system 'utf-8)
-(setq-default buffer-file-coding-system 'utf-8-auto-unix)
-
-(fset 'yes-or-no-p 'y-or-n-p)
-
-(setq echo-keystrokes 0.1)
-
-(use-package exec-path-from-shell
-  :ensure t
-  :config
-  (setq exec-path-from-shell-arguments (list "-l"))
-  (setq exec-path-from-shell-check-startup-files nil)
-  (add-to-list 'exec-path-from-shell-variables "SHELL")
-  (add-to-list 'exec-path-from-shell-variables "GOPATH")
-  (add-to-list 'exec-path-from-shell-variables "ENVIRONMENT_SETUP_DONE")
-  (add-to-list 'exec-path-from-shell-variables "PYTHONPATH")
-  (exec-path-from-shell-initialize))
-
-(setq sentence-end-double-space nil)
-
-(setq-default fill-column 80)
-
-(defadvice server-ensure-safe-dir (around
-                                   my-around-server-ensure-safe-dir
-                                   activate)
-  "Ignores any errors raised from server-ensure-safe-dir"
-  (ignore-errors ad-do-it))
-(unless (string= (user-login-name) "root")
-  (require 'server)
-  (when (or (not server-process)
-            (not (eq (process-status server-process)
-                     'listen)))
-    (unless (server-running-p server-name)
-   (server-start))))
-
-(use-package which-key
-  :ensure t
-  :defer t
-  :diminish which-key-mode
-  :init
-  (setq which-key-sort-order 'which-key-key-order-alpha)
-  :bind* (("M-m ?" . which-key-show-top-level))
-  :config
-  (which-key-mode)
-  (which-key-add-key-based-replacements
-    "M-m ?" "top level bindings"))
-
-(setq x-stretch-cursor t)
-
-(use-package visual-config)
-(use-package org-config)
-(use-package nix-config)
-(use-package go-config)
-(use-package vcs-config)
-(use-package navigation-config)
.emacs.d/init.el9
@@ -1,2 +0,0 @@
-
-(setq sentence-end-double-space nil)
.emacs.d/init.elc
Binary file
.gitignore.d/emacs-config
@@ -1,22 +0,0 @@
-*
-!/bin/emacs
-!/.config/mr/config.d/emacs.vcsh
-!/.config/mr/groups.d/emacs-config
-!/.emacs.d/emacs.org
-!/.emacs.d/images/emacs-config.png
-!/.emacs.d/images/emacs-config-small.png
-!/.emacs.d/images/lisp-rainbow.png
-!/.emacs.d/init.el
-!/.emacs.d/lisp/color-theme-buffer-local.el
-!/.emacs.d/lisp/helm-mu.el
-!/.emacs.d/lisp/load-theme-buffer-local.el
-!/.emacs.d/lisp/setup-package.el
-!/.emacs.d/lisp/use-package
-!/.emacs.d/lisp/use-package/bind-key.el
-!/.emacs.d/lisp/use-package/README.md
-!/.emacs.d/lisp/use-package/use-package.el
-!/.emacs.d/lisp/use-package/use-package-tests.el
-!/.emacs.d/lisp/vde-functions.el
-!/.emacs.d/provided/.placeholder
-!/.gitignore.d/emacs-config
-!/README.org
lisp/vde-style.el
@@ -0,0 +1,18 @@
+
+(setq echo-keystrokes 0.1)     ; Faster echo keystrokes
+
+;; Avoid showing ?? in the mode line when we have long lines.
+(setq line-number-display-limit-width 10000)
+
+;; Turn off mouse interface early in startup to avoid momentary display
+(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
+(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
+(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
+(when (fboundp 'horizontal-scroll-bar-mode) (horizontal-scroll-bar-mode -1))
+
+(provide 'vde-style)
+
+;; Local Variables:
+;; coding: utf-8
+;; indent-tabs-mode: nil
+;; End:
.emacs.d/provided/.placeholder → lisp/vde-style.el~
File renamed without changes
tmp/README.org
@@ -0,0 +1,303 @@
+#+TITLE: shortbrain's emacs configuration
+#+AUTHOR: Vincent Demeester
+#+EMAIL: vincent@sbr.pm
+#+SUBTITLE: Shortbrain's automated Emacs "realm"
+#+DESCRIPTION: My Emacs configuration
+#+Language: en
+#+OPTIONS: c:nil d:t e:t f:t H:3 p:nil ':t *:t -:t ::t <:t \n:nil ^:{} |:t
+#+OPTIONS: arch:nil author:t broken-links:nil
+#+OPTIONS: creator:t date:t email:t inline:nil num:nil pri:t
+#+OPTIONS: prop:nil stat:t tags:nil tasks:nil tex:t timestamp:t title:t toc:nil
+#+PROPERTY: header-args :cache yes :comments link
+#+PROPERTY: header-args:emacs-lisp :results output silent
+#+TAGS: noexport notangle
+#+STARTUP: hideblocks indent align entitiespretty
+#+EXPORT_FILE_NAME: index
+#+KEYWORDS: dotfiles config ide emacs nix sbr
+#+HTML_HEAD: <link rel=stylesheet href=https://emacs.shortbrain.org/style.css />
+#+LINK_HOME: http://shortbrain.org
+#+LINK_UP: http://emacs.shortbrain.org
+
+#+BEGIN_SRC
+                                                              ___ __
+    .-----.--------.---.-.----.-----.______.----.-----.-----.'  _|__|.-----.
+    |  -__|        |  _  |  __|__ --|______|  __|  _  |     |   _|  ||  _  |
+    |_____|__|__|__|___._|____|_____|      |____|_____|__|__|__| |__||___  |
+                                                                     |_____|
+#+END_SRC
+
+This =org-mode= file generates an Emacs configuration. This is a rework of my
+/attempt/ to write a litterate configuration for emacs. The previous versions
+went well but it felt like it didn't go all the way. One thing I still didn't
+manage is to do *everything* litterate — what this mean is, if I want to create
+a =Caskfile= or a shell script, this will also be in an org-mode file with the
+right =tangle= definitions. I'm also a user of [[https://nixos.org][nixos]] and I want to use the power
+of nix in the configuration — while making it work on system that do not have
+=nixpkgs=.
+
+#+TOC: headlines 2
+
+* TODO Usage
+:PROPERTIES:
+:header-args: :tangle no
+:END:
+
+This file aims to be self-standing, i.e. it will generates any file my emacs
+setup needs. And as I'm using =nixos= as my primary default linux system, I want
+to be able to run =nix-build= to update and build my emacs configuration, and
+=nix-env -fi .= to install it.
+
+* Emacs init file
+  :PROPERTIES:
+  :header-args: :tangle init.el :comments link
+  :END:
+** Increase GC
+
+Increasing GC is a common way to speed up Emacs. =gc-cons-threshold= sets at
+what point Emacs should invoke its garbage collector Some people set it to a
+really larger number permanently. This works well until the garbage is actually
+collected (then you have to wait a long time). I’ve decided to just set it
+temporarily to a large number so we only garbage collect once on startup. After
+that we reset it to the standard value. Read [[http://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/][@bling’s post]] for more info on
+this.
+
+#+BEGIN_SRC emacs-lisp
+  (defvar file-name-handler-alist-backup file-name-handler-alist)
+  (setq gc-cons-threshold most-positive-fixnum
+        file-name-handler-alist nil
+        ;; load-path `(,(expand-file-name "site-lisp" user-emacs-directory)
+        ;;             )
+        )
+  (add-hook 'after-init-hook
+            (lambda ()
+              (garbage-collect)
+              (setq gc-cons-threshold
+                    (car (get 'gc-cons-threshold 'standard-value))
+                    file-name-handler-alist (append
+                                             file-name-handler-alist-backup
+                                             file-name-handler-alist))))
+#+END_SRC
+
+** Defaults
+
+*** Some variables
+
+Let's define some variable that will be used later and by our configuration.
+
+#+BEGIN_SRC emacs-lisp
+  (defvar user-home-directory (file-name-as-directory (getenv "HOME")))
+  (setq user-emacs-directory (file-name-as-directory (expand-file-name ".emacs.d" user-home-directory)))
+
+  (setq org-directory (let ((dir (file-name-as-directory (expand-file-name "org" user-home-directory))))
+                        (make-directory dir :parents)
+                        dir))
+
+  (defvar user-personal-directory (let ((dir (file-name-as-directory (expand-file-name "personal" user-emacs-directory))))
+                                    (make-directory dir :parents)
+                                    dir)
+    "User's personal directory to contain non-git-controlled files.")
+  (setq custom-file (expand-file-name "custom-file.el" user-personal-directory))
+
+  (defvar emacs-version-short (format "%s_%s"
+                                      emacs-major-version emacs-minor-version)
+    "A variable to store the current emacs versions as <MAJORVER>_<MINORVER>.
+  So, for emacs version 25.0.50.1, this variable will be 25_0.")
+
+  (defvar sbr/org-version-select 'elpa
+    "Variable to choose the version of Org to be loaded.
+  Valid values are `dev', `elpa' and `emacs'.
+
+  When set to `dev', the development version of Org built locally is loaded.
+  When set to `elpa', Org is installed and loaded from Org Elpa.
+  When set to `emacs', the Org version shipped with Emacs is used.
+
+  The value is defaulted to `elpa' as few things in this config
+  need Org version to be at least 9.x.")
+#+END_SRC
+
+*** Package at launch
+
+There is quite a few package I want to be available at launch. The other ones
+will be automagically get when required.
+
+#+BEGIN_SRC emacs-lisp
+  (defconst my-packages
+    '(ace-window
+      adaptive-wrap ; indented line wrapping
+      rg wgrep wgrep-ag s ; ag > ack > grep
+                                          ; wgrep+wgrep-ag allow editing files
+                                          ; directly in ag buffer
+      avy
+      benchmark-init
+      dired-single dired+ dired-collapse
+      expand-region
+      fill-column-indicator
+      flycheck
+      flyspell-correct-ivy
+      git-timemachine
+      htmlize
+      hydra
+      ibuffer-projectile
+      imenu-list
+      info+
+      ivy swiper counsel
+      magit
+      markdown-mode
+      multiple-cursors
+      projectile
+      undo-tree
+      use-package use-package-chords
+      which-key
+      wrap-region
+      ;; Themes
+      doom-themes
+      gruvbox-theme
+      )
+    "A list of packages to ensure are installed at launch")
+#+END_SRC
+
+Let's now do some magic to load the setup.
+
+#+BEGIN_SRC emacs-lisp
+  ;; Basic requires
+  ;; Place `setup-var-overrides.el' with `(provide 'setup-var-overrides)' in
+  ;; `user-personal-directory'
+  (add-to-list 'load-path user-personal-directory)
+  (require 'setup-var-overrides nil :noerror)
+
+  (load custom-file :noerror :nomessage) ; Load the `M-x customize` generated file
+  (load (locate-user-emacs-file "general.el") nil :nomessage)
+  (load (locate-user-emacs-file "setup-packages.el") nil :nomessage)
+  ;; (package-initialize) ; Do NOT delete this comment
+  ;;   In emacs 25+, the `package-initialize' call is auto-added to the top of
+  ;; init.el unless the user already has a commented or uncommented
+  ;; `(package-initialize)' line present in their init.el.
+  ;;   I call this function in setup-packages.el and so am keeping the
+  ;; commented out version here so that package.el does not add it again.
+
+  ;; Start `benchmark-init' as soon as possible
+  (require 'benchmark-init)
+
+  (eval-when-compile
+    (require 'use-package)                ;Auto-requires `bind-key' too
+    (setq use-package-always-ensure nil))
+  (require 'use-package-chords)
+
+  ;; Enable `modi-mode' unless `disable-pkg-modi-mode' is set to `t' in
+  ;; `setup-var-overrides.el'.
+  (when (not (bound-and-true-p disable-pkg-modi-mode))
+    (require 'modi-mode))
+  (require 'temp-mode)
+
+  ;(require 'setup-paradox)
+  ;(require 'setup-region-bindings-mode)
+  ;(require 'setup-key-chord)
+  ;(require 'setup-hydra)
+  ;(require 'setup-tags)
+  ;; End of basic requires
+
+  ;; Set up the looks of emacs
+  ;(require 'setup-mode-line)
+  ;(require 'setup-visual)
+  ;(require 'setup-shackle)
+#+END_SRC
+
+** Autoloads & Misc.
+
+Setup some initial aliases for Emacs. These give us an easy way to use these
+functions without actually require'ing them. Ideally, Emacs should pick these up
+through the automatic autoloading method, but that sometimes conflicts with the
+compiling phases used later.
+
+#+BEGIN_SRC emacs-lisp
+  (eval-and-compile
+    (autoload 'package-installed-p "package")
+    (autoload 'use-package-autoload-keymap "use-package")
+    (autoload 'pcomplete-arg   "pcomplete")
+    (autoload 'pcomplete--here "pcomplete")
+    (autoload 'term-set-escape-char "term")
+    (autoload 'tramp-tramp-file-p "tramp")
+    (autoload 'tramp-dissect-file-name "tramp"))
+#+END_SRC
+
+Now we are going to setup some basic Emacs GUI elements. Under normal
+circumstances, we want GUI elements hidden from the user so that we only see the
+text buffer. This gives us a minimalist look that works well with the theme. We
+will end up disabling =tool-bar-mode=, =scroll-bar-mode=, =blink-cursor-mode=,
+and =menu-bar-mode= here. The one exception to this is when we are running macOS
+where the system provides a builtin menubar system that Emacs can use.
+
+#+BEGIN_SRC  emacs-lisp
+  (when window-system
+    (tool-bar-mode -1)
+    (scroll-bar-mode -1)
+    (blink-cursor-mode -1))
+
+  (when (not (memq window-system '(mac ns)))
+    (menu-bar-mode -1))
+#+END_SRC
+
+When we are within a terminal we want to be able to use the mouse, so
+=xterm-mouse-mode= is enabled here.
+
+#+BEGIN_SRC  emacs-lisp
+  (when (not window-system)
+    (xterm-mouse-mode 1))
+#+END_SRC
+** TODO Packages
+*** TODO Essentials
+**** TODO Org
+
+[[https://orgmode.org][Website]]
+
+Org mode is an impressive suite of text editing solutions. It gives you an
+outliner but also much much more.
+
+#+BEGIN_SRC emacs-lisp
+  (use-package org
+               :ensure org-plus-contrib
+               :pin melpa
+               :hook ((message-mode . turn-on-orgstruct++)
+                      (org-mode . (lambda ()
+                                    (add-hook 'completion-at-point-functions
+                                              'pcomplete-completions-at-point nil t)))
+                      (org-mode . auto-fill-mode)
+                      (org-mode . (lambda () (setq-local scroll-margin 3)))
+                      (message-mode . turn-on-orgtbl)
+                      (org-mode . (lambda ()
+                                    (autoload 'org-eldoc-documentation-function "esh-help")
+                                    (setq-local eldoc-documentation-function
+                                                'org-eldoc-documentation-function))))
+               :bind* (("C-c c" . org-capture)
+                       ("C-c a" . org-agenda)
+                       ("C-c l" . org-store-link)
+                       ("C-c b" . org-iswitchb))
+               :config
+               (use-package ox-hugo
+                            :ensure t
+                            :pin melpa
+                            :after ox))
+#+END_SRC
+
+**** TODO Magit
+
+**** TODO which-key
+
+**** TODO projectile
+
+**** TODO Smartparens
+
+*** TODO Built-ins
+
+*** TODO Programming languages
+
+*** TODO Other
+* COMMENT Footer
+# Local Variables:
+# mode: org
+# bug-reference-url-format: "https://github.com/vdemeester/emacs-config/issues/%s"
+# compile-command: "nix-build"
+# fill-column: 80
+# sentence-end-double-space: nil
+# tab-width: 8
+# End:
tmp/README.org.1
@@ -0,0 +1,307 @@
+#+TITLE: shortbrain's emacs configuration
+#+AUTHOR: Vincent Demeester
+#+EMAIL: vincent@sbr.pm
+#+SUBTITLE: Shortbrain's automated Emacs "realm"
+#+DESCRIPTION: My Emacs configuration
+#+Language: en
+#+OPTIONS: c:nil d:t e:t f:t H:3 p:nil ':t *:t -:t ::t <:t \n:nil ^:{} |:t
+#+OPTIONS: arch:nil author:t broken-links:nil
+#+OPTIONS: creator:t date:t email:t inline:nil num:nil pri:t
+#+OPTIONS: prop:nil stat:t tags:nil tasks:nil tex:t timestamp:t title:t toc:nil
+#+PROPERTY: header-args :cache yes :comments link
+#+PROPERTY: header-args:emacs-lisp :results output silent
+#+TAGS: noexport notangle
+#+STARTUP: hideblocks indent align entitiespretty
+#+EXPORT_FILE_NAME: index
+#+KEYWORDS: dotfiles config ide emacs nix sbr
+#+HTML_HEAD: <link rel=stylesheet href=https://emacs.shortbrain.org/style.css />
+#+LINK_HOME: http://shortbrain.org
+#+LINK_UP: http://emacs.shortbrain.org
+
+#+BEGIN_SRC
+                                                              ___ __
+    .-----.--------.---.-.----.-----.______.----.-----.-----.'  _|__|.-----.
+    |  -__|        |  _  |  __|__ --|______|  __|  _  |     |   _|  ||  _  |
+    |_____|__|__|__|___._|____|_____|      |____|_____|__|__|__| |__||___  |
+                                                                     |_____|
+#+END_SRC
+
+This =org-mode= file generates an Emacs configuration. This is a rework of my
+/attempt/ to write a litterate configuration for emacs. The previous versions
+went well but it felt like it didn't go all the way. One thing I still didn't
+manage is to do *everything* litterate — what this mean is, if I want to create
+a =Caskfile= or a shell script, this will also be in an org-mode file with the
+right =tangle= definitions. I'm also a user of [[https://nixos.org][nixos]] and I want to use the power
+of nix in the configuration — while making it work on system that do not have
+=nixpkgs=.
+
+#+TOC: headlines 2
+
+* TODO Usage
+:PROPERTIES:
+:header-args: :tangle no
+:END:
+
+This file aims to be self-standing, i.e. it will generates any file my emacs
+setup needs. And as I'm using =nixos= as my primary default linux system, I want
+to be able to run =nix-build= to update and build my emacs configuration, and
+=nix-env -fi .= to install it.
+
+* Emacs init file
+  :PROPERTIES:
+  :header-args: :tangle init.el :comments link
+  :END:
+** Increase GC
+
+Increasing GC is a common way to speed up Emacs. =gc-cons-threshold= sets at
+what point Emacs should invoke its garbage collector Some people set it to a
+really larger number permanently. This works well until the garbage is actually
+collected (then you have to wait a long time). I’ve decided to just set it
+temporarily to a large number so we only garbage collect once on startup. After
+that we reset it to the standard value. Read [[http://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/][@bling’s post]] for more info on
+this.
+
+#+BEGIN_SRC emacs-lisp
+  (defvar file-name-handler-alist-backup file-name-handler-alist)
+  (setq gc-cons-threshold most-positive-fixnum
+        file-name-handler-alist nil
+        ;; load-path `(,(expand-file-name "site-lisp" user-emacs-directory)
+        ;;             )
+        )
+  (add-hook 'after-init-hook
+            (lambda ()
+              (garbage-collect)
+              (setq gc-cons-threshold
+                    (car (get 'gc-cons-threshold 'standard-value))
+                    file-name-handler-alist (append
+                                             file-name-handler-alist-backup
+                                             file-name-handler-alist))))
+#+END_SRC
+
+** Autoloads & Misc.
+
+Setup some initial aliases for Emacs. These give us an easy way to use these
+functions without actually require'ing them. Ideally, Emacs should pick these up
+through the automatic autoloading method, but that sometimes conflicts with the
+compiling phases used later.
+
+#+BEGIN_SRC emacs-lisp
+  (eval-and-compile
+    (autoload 'package-installed-p "package")
+    (autoload 'use-package-autoload-keymap "use-package")
+    (autoload 'pcomplete-arg   "pcomplete")
+    (autoload 'pcomplete--here "pcomplete")
+    (autoload 'term-set-escape-char "term")
+    (autoload 'tramp-tramp-file-p "tramp")
+    (autoload 'tramp-dissect-file-name "tramp"))
+#+END_SRC
+
+Now we are going to setup some basic Emacs GUI elements. Under normal
+circumstances, we want GUI elements hidden from the user so that we only see the
+text buffer. This gives us a minimalist look that works well with the theme. We
+will end up disabling =tool-bar-mode=, =scroll-bar-mode=, =blink-cursor-mode=,
+and =menu-bar-mode= here. The one exception to this is when we are running macOS
+where the system provides a builtin menubar system that Emacs can use.
+
+#+BEGIN_SRC  emacs-lisp
+  (when window-system
+    (tool-bar-mode -1)
+    (scroll-bar-mode -1)
+    (blink-cursor-mode -1))
+
+  (when (not (memq window-system '(mac ns)))
+    (menu-bar-mode -1))
+#+END_SRC
+
+When we are within a terminal we want to be able to use the mouse, so
+=xterm-mouse-mode= is enabled here.
+
+#+BEGIN_SRC  emacs-lisp
+  (when (not window-system)
+    (xterm-mouse-mode 1))
+#+END_SRC
+** Setup use-package
+
+[[https://github.com/jwiegley/use-package][use-package]] is an Emacs package by John Weigley allowing users to easily
+configure other Emacs packages. It’s quite useful and it will be used
+extensively in this project.
+
+Now to get =use-package= we will require =package.el= and initialize it if
+site-paths is not setup (meaning we’re outside the Nix expression). Because
+site-paths should be available (unless you don’t have Nix), we can skip this
+step. All of this is marked ‘eval-and-compile’ to make sure the compiler picks
+it up on build phase.
+
+So, there are basically two modes for using this configuration. One when
+packages are installed externally (through Nix) and another where they are
+installed internally. This is captured in the variable ‘needs-package-init’
+which will be t when we want to use the builtin package.el and will be nli when
+we want to just assume everything is available.
+
+#+BEGIN_SRC emacs-lisp
+  (eval-and-compile
+    (setq needs-package-init (and (not (locate-library "site-paths"))
+                                  (not (and (boundp 'use-package-list--is-running)
+                                            use-package-list--is-running)))))
+#+END_SRC
+
+First handle using =package.el=. We will do all of the work of bootstrapping
+here including running =package-initialize= and ensuring =use-package= and
+=delight= are installed.
+
+#+BEGIN_SRC emacs-lisp
+  ;;(when needs-package-init
+  (require 'package)
+  (package-initialize)
+  (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/"))
+  (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
+  (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
+
+  (setq use-package-always-pin "melpa-stable")
+  (unless (package-installed-p 'use-package)
+    (package-refresh-contents)
+    (package-install 'use-package))
+  (unless (package-installed-p 'delight)
+    (package-refresh-contents)
+    (package-install 'delight))
+  ;;)
+#+END_SRC
+
+Actually require =use-package=,
+
+#+BEGIN_SRC emacs-lisp
+  (eval-and-compile    
+    (require 'delight)
+    (require 'bind-key)
+    (require 'use-package))
+#+END_SRC
+
+Now let’s handle the case where all of the packages are already provided.
+Basically, we’ll prevent use-package from running ‘ensure’ on anything.
+
+#+BEGIN_SRC emacs-lisp
+  (eval-and-compile
+    (setq use-package-always-ensure needs-package-init)
+    ;; (setq use-package-expand-minimally (not needs-package-init))
+    (when (not needs-package-init)
+      (setq use-package-ensure-function 'ignore
+            package-enable-at-startup nil
+            package--init-file-ensured t)))
+#+END_SRC
+
+** TODO Packages
+*** TODO Essentials
+**** TODO Org
+
+[[https://orgmode.org][Website]]
+
+Org mode is an impressive suite of text editing solutions. It gives you an
+outliner but also much much more.
+
+#+BEGIN_SRC emacs-lisp
+  (use-package org
+               :ensure org-plus-contrib
+               :pin melpa
+               :hook ((message-mode . turn-on-orgstruct++)
+                      (org-mode . (lambda ()
+                                    (add-hook 'completion-at-point-functions
+                                              'pcomplete-completions-at-point nil t)))
+                      (org-mode . auto-fill-mode)
+                      (org-mode . (lambda () (setq-local scroll-margin 3)))
+                      (message-mode . turn-on-orgtbl)
+                      (org-mode . (lambda ()
+                                    (autoload 'org-eldoc-documentation-function "esh-help")
+                                    (setq-local eldoc-documentation-function
+                                                'org-eldoc-documentation-function))))
+               :bind* (("C-c c" . org-capture)
+                       ("C-c a" . org-agenda)
+                       ("C-c l" . org-store-link)
+                       ("C-c b" . org-iswitchb))
+               :config
+               (use-package ox-hugo
+                            :ensure t
+                            :pin melpa
+                            :after ox))
+#+END_SRC
+
+**** TODO Magit
+
+**** TODO which-key
+
+**** TODO projectile
+
+**** TODO Smartparens
+
+*** TODO Built-ins
+
+*** TODO Programming languages
+
+*** TODO Other
+* Extra
+** =update.sh=
+:PROPERTIES:
+:header-args: :tangle update.sh :tangle-mode (identity #o755) :shebang "#!/usr/bin/env sh"
+:END:
+
+This is a simple script that I use to make sure I've updated the generated
+files.
+
+#+BEGIN_SRC shell :padline no
+emacs --batch \
+      -l ob-tangle --eval "(org-babel-tangle-file \"README.org\")"
+#+END_SRC
+** =.gitignore=
+:PROPERTIES:
+:header-args: :tangle .gitignore
+:END:
+
+If you end up with generated files, they’re easy to remove with Git. Just run
+=git clean -xdf= and it will remove all of the files that match the .gitignore
+rules (which should never be added to the git tree).
+
+These set up some paths for =.gitignore= that we don’t want getting put in
+the repo. Start with Emacs/org-mode/LaTeX stuff.
+
+#+BEGIN_SRC gitignore :padline no
+flycheck_*.el
+*.elc
+*.pdf
+*.html
+*.log
+*.aux
+*.out
+*.toc
+#+END_SRC
+
+Nix-related stuff.
+
+#+BEGIN_SRC gitignore
+# nix stuff
+result
+result-*
+#+END_SRC
+
+
+** =.gitattributes=
+:PROPERTIES:
+:header-args: :tangle .gitattributes
+:END:
+
+#+BEGIN_SRC gitattributes :padline no
+init.el linguist-generated=true
+config.nix linguist-generated=true
+default.nix linguist-generated=true
+bootstrap.sh linguist-generated=true
+update.sh linguist-generated=true
+.gitattributes linguist-generated=true
+.gitignore linguist-generated=true
+#+END_SRC
+* COMMENT Footer
+# Local Variables:
+# mode: org
+# bug-reference-url-format: "https://github.com/vdemeester/emacs-config/issues/%s"
+# compile-command: "nix-build"
+# fill-column: 80
+# sentence-end-double-space: nil
+# tab-width: 8
+# End:
tmp/update.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env sh
+emacs --batch \
+      -l ob-tangle --eval "(org-babel-tangle-file \"README.org\")"
.gitattributes
@@ -0,0 +1,7 @@
+init.el linguist-generated=true
+config.nix linguist-generated=true
+default.nix linguist-generated=true
+bootstrap.sh linguist-generated=true
+update.sh linguist-generated=true
+.gitattributes linguist-generated=true
+.gitignore linguist-generated=true
.gitignore
@@ -1,8 +1,15 @@
-.cache
-.emacs.d/elpa/archives
-.emacs.d/custom.el
-.emacs.d/recentf
-.emacs.d/undo
-.emacs.d/emacs.elc
-.gnupg
-.org-timestamps
+flycheck_*.el
+*.elc
+*.pdf
+*.html
+*.log
+*.aux
+*.out
+*.toc
+
+# nix stuff
+result
+result-*
+
+# misc
+auto-save-list
early-init.el
@@ -0,0 +1,6 @@
+;;; -*- lexical-binding: t; -*-
+;; This file is loaded before init.el.
+(setq package-enable-at-startup nil)
+
+(provide 'early-init)
+;;; early-init.el ends here
init.el
@@ -0,0 +1,120 @@
+;;; -*- lexical-binding: t; -*-
+(require 'package)
+
+(let ((minver 25))
+  (unless (>= emacs-major-version minver)
+(error "Your Emacs is too old -- this configuration requrise v%s or higher" minver)))
+
+
+;;; package setup
+(require 'package)
+
+(setq package-archives
+      '(("gnu-elpa" . "http://elpa.gnu.org/packages/")
+	("melpa-stable" . "https://stable.melpa.org/packages/")
+	("melpa" . "https://melpa.org/packages/")
+	("org" . "https://orgmode.org/elpa/")))
+
+(package-initialize)
+
+(setq load-prefer-newer t)              ; Always load newer compiled files
+(setq ad-redefinition-action 'accept)   ; Silence advice redefinition warnings
+(setq message-log-max 10000) ; Debugging
+
+;; Allow more than 800Kb cache during init
+(setq gc-cons-threshold 402653184
+      gc-cons-percentage 0.6)
+
+(defun vde-set-gc-threshold ()
+  "Reset `gc-cons-threshold' and `gc-cons-percentage' to their default values."
+  (setq gc-cons-threshold 16777216
+gc-cons-percentage 0.1))
+
+;; Bootstrap `use-package'
+(setq use-package-always-pin "melpa-stable")
+(unless (package-installed-p 'use-package)
+  (package-refresh-contents)
+  (package-install 'use-package))
+
+;; Init `delight'
+(unless (package-installed-p 'delight)
+  (package-refresh-contents)
+  (package-install 'delight))
+
+(eval-when-compile (require 'use-package))
+
+(use-package dash                       ; A modern list library
+  :ensure t)
+
+(require 'subr-x)
+(require 'time-date)
+
+;;; Initialization
+(setq inhibit-default-init t)           ; Disable the site default settings
+
+(use-package exec-path-from-shell       ; Set up environment variables
+  :ensure t
+  :if (display-graphic-p)
+  :config
+  (setq exec-path-from-shell-variables
+                 '("PATH"               ; Full path
+                   "INFOPATH"           ; Info directories
+		   "GOPATH"             ; Golang path
+                   ))
+
+  (exec-path-from-shell-initialize))
+
+;; Set separate custom file for the customize interface
+(defconst vde-custom-file (locate-user-emacs-file "custom.el")
+  "File used to store settings from Customization UI.")
+
+(use-package cus-edit                   ; Set up custom.el
+  :defer t
+  :config
+  (setq
+   custom-file vde-custom-file
+   custom-buffer-done-kill nil          ; Kill when existing
+   custom-buffer-verbose-help nil       ; Remove redundant help text
+   custom-unlispify-tag-names nil       ; Show me the real variable name
+   custom-unlispify-menu-entries nil)
+  :init (load vde-custom-file 'no-error 'no-message))
+
+(use-package no-littering               ; Keep .emacs.d clean
+  :ensure t
+  :config
+  (require 'recentf)
+  (add-to-list 'recentf-exclude no-littering-var-directory)
+  (add-to-list 'recentf-exclude no-littering-etc-directory)
+
+  (setq
+   create-lockfiles nil
+   delete-old-versions t
+   kept-new-versions 6
+   kept-old-versions 2
+   version-control t)
+
+  (setq
+   backup-directory-alist
+   `((".*" . ,(no-littering-expand-var-file-name "backup/")))
+   auto-save-file-name-transforms
+   `((".*" ,(no-littering-expand-var-file-name "auto-save/") t))))
+
+(use-package server                     ; The server of `emacsclient'
+  :config (or (server-running-p) (server-mode)))
+
+;; Confirm before quitting Emacs
+(setq confirm-kill-emacs #'y-or-n-p)
+
+;;; Require files under ~/.emacs.d/lisp
+(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
+(use-package vde-style)
+
+;; Reset default values
+(add-hook 'emacs-startup-hook #'vde-set-gc-threshold)
+
+;; Local Variables:
+;; coding: utf-8
+;; indent-tabs-mode: nil
+;; End:
+
+;;; init.el ends here
README.org
@@ -1,1 +0,0 @@
-.emacs.d/emacs.org
\ No newline at end of file