No longer storing elpa stuff in repository.

This commit is contained in:
Ivan Malison 2014-04-14 00:39:33 -07:00
parent bbdc7a5436
commit 9888ee7a21
90 changed files with 49 additions and 70382 deletions
.gitignore
elpa
color-theme-20080305.34
color-theme-6.5.5
color-theme-tango-0.0.2
ctags-20110911.304
ctags-readme.txt
ctags-update-20131125.743
ctags-update-readme.txt
elisp-slime-nav-0.3
evil-1.0.1
find-file-in-project-3.2
flymake-0.4.12
idle-highlight-mode-1.1.2
ido-ubiquitous-1.6
inf-ruby-2.2.4
magit-1.1.1
mo-git-blame-0.1.0
multiple-cursors-20140105.259
multiple-cursors-readme.txt
no-easy-keys-1.0.2
nzenburn-theme-20130513
paredit-22
smex-2.0
starter-kit-2.0.3
starter-kit-bindings-2.0.2
starter-kit-ruby-2.0.3
undo-tree-0.6.3
init.el

1
.gitignore vendored

@ -10,3 +10,4 @@ url
bookmarks
elpa/archives/
elpa

@ -1,156 +0,0 @@
;;; color-theme-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (color-theme-initialize color-theme-submit color-theme-install
;;;;;; color-theme-compare color-theme-make-snapshot color-theme-analyze-defun
;;;;;; color-theme-print color-theme-install-at-point-for-current-frame
;;;;;; color-theme-install-at-mouse color-theme-describe color-theme-select)
;;;;;; "color-theme" "color-theme.el" (21316 30298))
;;; Generated autoloads from color-theme.el
(autoload 'color-theme-select "color-theme" "\
Displays a special buffer for selecting and installing a color theme.
With optional prefix ARG, this buffer will include color theme libraries
as well. A color theme library is in itself not complete, it must be
used as part of another color theme to be useful. Thus, color theme
libraries are mainly useful for color theme authors.
\(fn &optional ARG)" t nil)
(autoload 'color-theme-describe "color-theme" "\
Describe color theme listed at point.
This shows the documentation of the value of text-property color-theme
at point. The text-property color-theme should be a color theme
function. See `color-themes'.
\(fn)" t nil)
(autoload 'color-theme-install-at-mouse "color-theme" "\
Install color theme clicked upon using the mouse.
First argument EVENT is used to set point. Then
`color-theme-install-at-point' is called.
\(fn EVENT)" t nil)
(autoload 'color-theme-install-at-point-for-current-frame "color-theme" "\
Install color theme at point for current frame only.
Binds `color-theme-is-global' to nil and calls
`color-theme-install-at-point'.
\(fn)" t nil)
(autoload 'color-theme-print "color-theme" "\
Print the current color theme function.
You can contribute this function to <URL:news:gnu.emacs.sources> or
paste it into your .emacs file and call it. That should recreate all
the settings necessary for your color theme.
Example:
(require 'color-theme)
(defun my-color-theme ()
\"Color theme by Alex Schroeder, created 2000-05-17.\"
(interactive)
(color-theme-install
'(...
...
...)))
(my-color-theme)
If you want to use a specific color theme function, you can call the
color theme function in your .emacs directly.
Example:
(require 'color-theme)
(color-theme-gnome2)
\(fn &optional BUF)" t nil)
(autoload 'color-theme-analyze-defun "color-theme" "\
Once you have a color-theme printed, check for missing faces.
This is used by maintainers who receive a color-theme submission
and want to make sure it follows the guidelines by the color-theme
author.
\(fn)" t nil)
(autoload 'color-theme-make-snapshot "color-theme" "\
Return the definition of the current color-theme.
The function returned will recreate the color-theme in use at the moment.
\(fn)" nil nil)
(autoload 'color-theme-compare "color-theme" "\
Compare two color themes.
This will print the differences between installing THEME-A and
installing THEME-B. Note that the order is important: If a face is
defined in THEME-A and not in THEME-B, then this will not show up as a
difference, because there is no reset before installing THEME-B. If a
face is defined in THEME-B and not in THEME-A, then this will show up as
a difference.
\(fn THEME-A THEME-B)" t nil)
(autoload 'color-theme-install "color-theme" "\
Install a color theme defined by frame parameters, variables and faces.
The theme is installed for all present and future frames; any missing
faces are created. See `color-theme-install-faces'.
THEME is a color theme definition. See below for more information.
If you want to install a color theme from your .emacs, use the output
generated by `color-theme-print'. This produces color theme function
which you can copy to your .emacs.
A color theme definition is a list:
\([FUNCTION] FRAME-PARAMETERS VARIABLE-SETTINGS FACE-DEFINITIONS)
FUNCTION is the color theme function which called `color-theme-install'.
This is no longer used. There was a time when this package supported
automatic factoring of color themes. This has been abandoned.
FRAME-PARAMETERS is an alist of frame parameters. These are installed
with `color-theme-install-frame-params'. These are installed last such
that any changes to the default face can be changed by the frame
parameters.
VARIABLE-DEFINITIONS is an alist of variable settings. These are
installed with `color-theme-install-variables'.
FACE-DEFINITIONS is an alist of face definitions. These are installed
with `color-theme-install-faces'.
If `color-theme-is-cumulative' is nil, a color theme will undo face and
frame-parameter settings of previous color themes.
\(fn THEME)" nil nil)
(autoload 'color-theme-submit "color-theme" "\
Submit your color-theme to the maintainer.
\(fn)" t nil)
(autoload 'color-theme-initialize "color-theme" "\
Initialize the color theme package by loading color-theme-libraries.
\(fn)" t nil)
;;;***
;;;### (autoloads nil nil ("color-theme-pkg.el") (21316 30298 651142))
;;;***
(provide 'color-theme-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; color-theme-autoloads.el ends here

@ -1,2 +0,0 @@
(define-package "color-theme" "20080305.34" "install color themes" 'nil :url "http://www.emacswiki.org/cgi-bin/wiki.pl?ColorTheme" :keywords
'("faces"))

File diff suppressed because it is too large Load Diff

@ -1,22 +0,0 @@
(eval-when-compile
(require 'color-theme))
(defun color-theme-example ()
"Example theme. Carbon copy of color-theme-gnome contributed by Jonadab."
(interactive)
(color-theme-install
'(color-theme-example
((foreground-color . "wheat")
(background-color . "darkslategrey")
(background-mode . dark))
(default ((t (nil))))
(region ((t (:foreground "cyan" :background "dark cyan"))))
(underline ((t (:foreground "yellow" :underline t))))
(modeline ((t (:foreground "dark cyan" :background "wheat"))))
(modeline-buffer-id ((t (:foreground "dark cyan" :background "wheat"))))
(modeline-mousable ((t (:foreground "dark cyan" :background "wheat"))))
(modeline-mousable-minor-mode ((t (:foreground "dark cyan" :background "wheat"))))
(italic ((t (:foreground "dark red" :italic t))))
(bold-italic ((t (:foreground "dark red" :bold t :italic t))))
(font-lock-comment-face ((t (:foreground "Firebrick"))))
(bold ((t (:bold)))))))

File diff suppressed because it is too large Load Diff

@ -1,18 +0,0 @@
;;; color-theme-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads nil nil ("color-theme-pkg.el" "color-theme.el")
;;;;;; (20805 11467 185491))
;;;***
(provide 'color-theme-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; color-theme-autoloads.el ends here

@ -1 +0,0 @@
(define-package "color-theme" "6.5.5" "install color themes" (quote nil))

File diff suppressed because it is too large Load Diff

@ -1,18 +0,0 @@
;;; color-theme-tango-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads nil nil ("color-theme-tango-pkg.el" "color-theme-tango.el")
;;;;;; (21316 30300 288324))
;;;***
(provide 'color-theme-tango-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; color-theme-tango-autoloads.el ends here

@ -1 +0,0 @@
(define-package "color-theme-tango" "0.0.2" "Tango palette color theme for GNU Emacs." (quote ((color-theme "6.6.1"))))

@ -1,85 +0,0 @@
;;; color-theme-tango.el --- Tango palette color theme for GNU Emacs.
;; Taken from http://www.emacswiki.org/emacs/color-theme-tango.el
;; Copyright (C) 2010 danranx@gmail.com
;; Author: danranx@gmail.com
;; Keywords: tango color theme
;; URL: http://github.com/gorakhargosh/color-themes-collection
;; Version: 0.0.2
;; Package-Requires: ((color-theme "6.6.1"))
;; This file is NOT a part of GNU Emacs.
;;; License:
;; This 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 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.
;;; Code:
(require 'color-theme)
(defun color-theme-tango ()
"A color theme based on Tango Palette."
(interactive)
(color-theme-install
'(color-theme-tango
((background-color . "#2e3436")
(background-mode . dark)
(border-color . "#888a85")
(cursor-color . "#fce94f")
(foreground-color . "#eeeeec")
(mouse-color . "#8ae234"))
((help-highlight-face . underline)
(ibuffer-dired-buffer-face . font-lock-function-name-face)
(ibuffer-help-buffer-face . font-lock-comment-face)
(ibuffer-hidden-buffer-face . font-lock-warning-face)
(ibuffer-occur-match-face . font-lock-warning-face)
(ibuffer-read-only-buffer-face . font-lock-type-face)
(ibuffer-special-buffer-face . font-lock-keyword-face)
(ibuffer-title-face . font-lock-type-face))
(border ((t (:background "#888a85"))))
(fringe ((t (:background "grey10"))))
(mode-line ((t (:foreground "#eeeeec" :background "#555753"))))
(region ((t (:background "#555753"))))
(font-lock-builtin-face ((t (:foreground "#729fcf"))))
(font-lock-comment-face ((t (:foreground "#888a85"))))
(font-lock-constant-face ((t (:foreground "#8ae234"))))
(font-lock-doc-face ((t (:foreground "#888a85"))))
(font-lock-keyword-face ((t (:foreground "#729fcf" :bold t))))
(font-lock-string-face ((t (:foreground "#ad7fa8" :italic t))))
(font-lock-type-face ((t (:foreground "#8ae234" :bold t))))
(font-lock-variable-name-face ((t (:foreground "#eeeeec"))))
(font-lock-warning-face ((t (:bold t :foreground "#f57900"))))
(font-lock-function-name-face ((t (:foreground "#edd400" :bold t :italic t))))
(comint-highlight-input ((t (:italic t :bold t))))
(comint-highlight-prompt ((t (:foreground "#8ae234"))))
(isearch ((t (:background "#f57900" :foreground "#2e3436"))))
(isearch-lazy-highlight-face ((t (:foreground "#2e3436" :background "#e9b96e"))))
(show-paren-match-face ((t (:foreground "#2e3436" :background "#73d216"))))
(show-paren-mismatch-face ((t (:background "#ad7fa8" :foreground "#2e3436"))))
(minibuffer-prompt ((t (:foreground "#729fcf" :bold t))))
(info-xref ((t (:foreground "#729fcf"))))
(info-xref-visited ((t (:foreground "#ad7fa8"))))
)))
(color-theme-tango)
(provide 'color-theme-tango)
;;; color-theme-tango.el ends here

@ -3,8 +3,8 @@
;;; Code:
;;;### (autoloads nil nil ("ctags-pkg.el" "ctags.el") (21317 48750
;;;;;; 589620))
;;;### (autoloads nil nil ("ctags-pkg.el" "ctags.el") (21323 36296
;;;;;; 915014 0))
;;;***

@ -1,26 +0,0 @@
Configuration example:
(setq tags-revert-without-query t)
(global-set-key (kbd "<f7>") 'ctags-create-or-update-tags-table)
Then just press <f7> to update or create your TAGS file. That function look
for a file TAGS in the current and its parent directories, if a TAG file is
not found it ask you where create a new one.
Optionally you can use the function `ctags-search', a little wrapper for
`tags-search' that provides a default input like in `find-tag', to search
through all files listed in tags table.
Also, if you prefer, you can override the key binding M-. for `find-tag' to
use `ctags-search':
(global-set-key (kbd "M-.") 'ctags-search)
Installation:
Add this to your Emacs configuration:
(add-to-list 'load-path "/folder/containing/file")
(require 'ctags)
Alternatively, you can install it using the Marmalade ELPA repository.

@ -4,7 +4,8 @@
;;;### (autoloads (turn-on-ctags-auto-update-mode ctags-auto-update-mode
;;;;;; ctags-update) "ctags-update" "ctags-update.el" (21317 48806))
;;;;;; ctags-update) "ctags-update" "ctags-update.el" (21323 36299
;;;;;; 0 0))
;;; Generated autoloads from ctags-update.el
(autoload 'ctags-update "ctags-update" "\
@ -28,7 +29,8 @@ turn on `ctags-auto-update-mode'.
;;;***
;;;### (autoloads nil nil ("ctags-update-pkg.el") (21317 48806 455939))
;;;### (autoloads nil nil ("ctags-update-pkg.el") (21323 36299 510842
;;;;;; 0))
;;;***

@ -1,35 +0,0 @@
Just put ctags-update.el to your load-path.
The load-path is usually ~/elisp/.
It's set in your ~/.emacs like this:
(add-to-list 'load-path (expand-file-name "~/elisp"))
And the following to your ~/.emacs startup file.
(autoload 'turn-on-ctags-auto-update-mode "ctags-update" "turn on `ctags-auto-update-mode'." t)
(add-hook 'c-mode-common-hook 'turn-on-ctags-auto-update-mode)
...
(add-hook 'emacs-lisp-mode-hook 'turn-on-ctags-auto-update-mode)
then when you save a file ,`ctags-auto-update-mode' will recursively searches each
parent directory for a file named 'TAGS'. if found ,it will use
`exuberant-ctags' update TAGS,
it would not be updated if last time calling `ctags-update' is not 5 minute age(default).
if no 'TAGS' found ,it will check `tags-table-list' and `tags-file-name'
if current buffer shares the same parent directory with `tags-file-name' or one element of
`tags-table-list' , it will auto create 'TAGS' file
eq:
(setq tags-file-name "/tmp/TAGS")
or
(setq tags-table-list '("/tmp/TAGS"))
if you want to update (create) TAGS manually
you can
(autoload 'ctags-update "ctags-update" "update TAGS using ctags" t)
(global-set-key "\C-cE" 'ctags-update)
with prefix `C-u' ,then you can generate a new TAGS file in your selected directory,
with prefix `C-uC-u' same to prefix `C-u',but save it to kill-ring instead of execute it."
on windows ,you can custom `ctags-update-command' like this:
(when (equal system-type 'windows-nt)
(setq ctags-update-command (expand-file-name "~/.emacs.d/bin/ctags.exe")))

@ -1,38 +0,0 @@
;;; elisp-slime-nav-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (elisp-slime-nav-find-elisp-thing-at-point elisp-slime-nav-mode)
;;;;;; "elisp-slime-nav" "elisp-slime-nav.el" (20815 22617 0 0))
;;; Generated autoloads from elisp-slime-nav.el
(autoload 'elisp-slime-nav-mode "elisp-slime-nav" "\
Enable Slime-style navigation of elisp symbols using M-. and M-,
\(fn &optional ARG)" t nil)
(autoload 'elisp-slime-nav-find-elisp-thing-at-point "elisp-slime-nav" "\
Jump to the elisp thing at point, be it a function,variable, library or face.
With a prefix arg, prompt for the symbol to jump to.
Argument SYM-NAME thing to find.
\(fn SYM-NAME)" t nil)
;;;***
;;;### (autoloads nil nil ("elisp-slime-nav-pkg.el") (20815 22617
;;;;;; 967506 0))
;;;***
(provide 'elisp-slime-nav-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; elisp-slime-nav-autoloads.el ends here

@ -1 +0,0 @@
(define-package "elisp-slime-nav" "0.3" "Make M-. and M-, work in elisp like they do in slime" (quote nil))

@ -1,82 +0,0 @@
;;; elisp-slime-nav.el --- Make M-. and M-, work in elisp like they do in slime
;;
;; Author: Steve Purcell <steve@sanityinc.com>
;; Keywords: navigation slime elisp emacs-lisp
;; URL: https://github.com/purcell/elisp-slime-nav
;; Version: 0.3
;;
;;; Commentary
;;
;; This package provides Slime's convenient "M-." and "M-," navigation
;; in `emacs-lisp-mode'.
;;
;; Additionally, C-u M-. will prompt for the symbol to which to jump.
;;
;; Usage:
;;
;; (require 'elisp-slime-nav)
;; (add-hook 'emacs-lisp-mode-hook (lambda () (elisp-slime-nav-mode t)))
;;
;; Known issues:
;;
;; When navigating into Emacs' C source, "M-," will not be bound to
;; the same command, but "M-*" will typically do the trick.
;;
;;; Code
(defvar elisp-slime-nav-mode-map (make-keymap))
;;;###autoload
(define-minor-mode elisp-slime-nav-mode
"Enable Slime-style navigation of elisp symbols using M-. and M-,"
nil " SliNav" elisp-slime-nav-mode-map)
(eval-when-compile (require 'cl))
(require 'etags)
(defun elisp-slime-nav--all-navigable-symbol-names ()
"Return a list of strings for the symbols to which navigation is possible."
(loop for x being the symbols
if (or (fboundp x) (boundp x) (symbol-plist x) (facep x))
collect (symbol-name x)))
;;;###autoload
(defun elisp-slime-nav-find-elisp-thing-at-point (sym-name)
"Jump to the elisp thing at point, be it a function,variable, library or face.
With a prefix arg, prompt for the symbol to jump to.
Argument SYM-NAME thing to find."
(interactive
(list
(let* ((sym-at-point (symbol-at-point))
(at-point (and sym-at-point (symbol-name sym-at-point))))
(if current-prefix-arg
(completing-read "Symbol: "
(elisp-slime-nav--all-navigable-symbol-names)
nil t at-point)
at-point))))
(when sym-name
(let ((sym (intern sym-name)))
(message "search for %s" (pp-to-string sym))
(ring-insert find-tag-marker-ring (point-marker))
(cond
((fboundp sym) (find-function sym))
((boundp sym) (find-variable sym))
((or (featurep sym) (locate-library sym-name))
(find-library sym-name))
((facep sym)
(find-face-definition sym))
(:else
(progn
(pop-tag-mark)
(error "Don't know how to find '%s'" sym)))))))
(define-key elisp-slime-nav-mode-map (kbd "M-.") 'elisp-slime-nav-find-elisp-thing-at-point)
(define-key elisp-slime-nav-mode-map (kbd "M-,") 'pop-tag-mark)
(provide 'elisp-slime-nav)
;;; elisp-slime-nav.el ends here

@ -1,674 +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>.

@ -1,26 +0,0 @@
;;; evil-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads nil "evil-core" "evil-core.el" (20836 47458))
;;; Generated autoloads from evil-core.el
(autoload 'evil-mode "evil" "Toggle evil in all buffers" t)
;;;***
;;;### (autoloads nil nil ("evil-commands.el" "evil-common.el" "evil-digraphs.el"
;;;;;; "evil-ex.el" "evil-integration.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") (20836 47458 860825))
;;;***
(provide 'evil-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; evil-autoloads.el ends here

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,288 +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.0.1
;;
;; 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)
;;; Code:
;;; Evilize some commands
(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))
(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
save-buffer
split-window
split-window-horizontally
split-window-vertically))
(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
;; disable evil-esc-mode during a call to key-binding
(defadvice key-binding (around evil activate)
(let (evil-esc-mode)
ad-do-it))
;; disable evil-esc-mode during the read of a key-sequence
;; TODO: should we handle the special ESC-delay, too?
(defadvice read-key-sequence (around evil activate)
(let (evil-esc-mode)
ad-do-it))
;; disable evil-esc-mode during the read of a key-sequence
;; TODO: should we handle the special ESC-delay, too?
(defadvice read-key-sequence-vector (around evil activate)
(let (evil-esc-mode)
ad-do-it))
;; 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
(evil-make-overriding-map dired-mode-map 'normal t)
(evil-add-hjkl-bindings dired-mode-map 'normal
"J" 'dired-goto-file ; "j"
"K" 'dired-do-kill-lines ; "k"
"r" 'dired-do-redisplay ; "l"
";" (lookup-key dired-mode-map ":")))) ; ":d", ":v", ":s", ":e"
(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)
"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
(when (overlayp show-paren-overlay)
(delete-overlay show-paren-overlay))
(when (overlayp show-paren-overlay-1)
(delete-overlay show-paren-overlay-1))))))
;;; 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
(evil-make-overriding-map ibuffer-mode-map 'normal t)
(evil-define-key 'normal ibuffer-mode-map
"j" 'evil-next-line
"k" 'evil-previous-line
"RET" 'ibuffer-visit-buffer)))
;;; Undo tree visualizer
(defadvice undo-tree-visualize (after evil activate)
"Initialize Evil in the visualization buffer."
(when evil-local-mode
(evil-initialize-state)))
(when (boundp 'undo-tree-visualizer-map)
(define-key undo-tree-visualizer-map [remap evil-backward-char]
'undo-tree-visualize-switch-branch-left)
(define-key undo-tree-visualizer-map [remap evil-forward-char]
'undo-tree-visualize-switch-branch-right)
(define-key undo-tree-visualizer-map [remap evil-next-line]
'undo-tree-visualize-redo)
(define-key undo-tree-visualizer-map [remap evil-previous-line]
'undo-tree-visualize-undo))
;;; Auto-complete
(eval-after-load 'auto-complete
'(progn
(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.")
(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))))))
;; Eval last sexp
(defadvice preceding-sexp (around evil activate)
"In normal-state, last sexp ends at point."
(if (evil-normal-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, last sexp ends at point."
(if (evil-normal-state-p)
(save-excursion
(unless (or (eobp) (eolp)) (forward-char))
ad-do-it)
ad-do-it))
;; 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))
(provide 'evil-integration)
;;; evil-integration.el ends here

@ -1,751 +0,0 @@
;;; evil-macros.el --- Macros
;; Author: Vegard Øye <vegard_oye at hotmail.com>
;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
;; Version: 1.0.1
;;
;; 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")
(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)
(setq evil-this-type 'exclusive
evil-write-echo-area t)
(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
'(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-define-union-move (name args &rest moves)
"Create a movement function named NAME.
The function moves to the nearest object boundary defined by one
of the movement function in MOVES, which is a list where each
element has the form \(FUNC PARAMS... COUNT).
COUNT is a variable which is bound to 1 or -1, depending on the
direction. In each iteration, the function calls each move in
isolation and settles for the nearest position. If unable to move
further, the return value is the number of iterations that could
not be performed.
\(fn NAME (COUNT) MOVES...)"
(declare (indent defun)
(debug (&define name lambda-list
[&optional stringp]
def-body)))
(let* ((var (or (car-safe args) 'var))
(doc (when (stringp (car-safe moves))
(pop moves)))
(moves (mapcar #'(lambda (move)
`(save-excursion
;; don't include failing moves
(when (zerop ,move)
(point))))
moves)))
`(evil-define-motion ,name (count)
,@(when doc `(,doc))
(evil-motion-loop (,var (or count 1))
(if (> ,var 0)
(evil-goto-min ,@moves)
(evil-goto-max ,@moves))))))
(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-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))
(error "Beginning of line")))
(end-of-buffer
(if (= end max)
(signal (car err) (cdr err))
(error "End of line"))))))))
;; 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))))
(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 (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)
(evil-called-interactively-p))
;; 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 range))
(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)))
;; ensure the range is properly expanded
(evil-contract-range range)
(evil-expand-range 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
(evil-called-interactively-p))
,@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)
(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+\\)?"
(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

@ -1,464 +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.0.1
;;
;; 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)
;;; 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 "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 "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 "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 "\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)
(when (fboundp 'undo-tree-undo)
(define-key evil-normal-state-map "u" 'undo-tree-undo)
(define-key evil-normal-state-map "\C-r" 'undo-tree-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" 'delete-window)
(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 "r" 'evil-window-rotate-downwards)
(define-key evil-window-map "R" 'evil-window-rotate-upwards)
(define-key evil-window-map "s" 'split-window-vertically)
(define-key evil-window-map "S" 'split-window-vertically)
(define-key evil-window-map "t" 'evil-window-top-left)
(define-key evil-window-map "v" 'split-window-horizontally)
(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" 'delete-window)
(define-key evil-window-map "\C-H" 'evil-window-move-far-left)
(define-key evil-window-map "\C-h" 'evil-window-left)
(define-key evil-window-map "\C-J" 'evil-window-move-very-bottom)
(define-key evil-window-map "\C-j" 'evil-window-down)
(define-key evil-window-map "\C-K" 'evil-window-move-very-top)
(define-key evil-window-map "\C-k" 'evil-window-up)
(define-key evil-window-map "\C-L" 'evil-window-move-far-right)
(define-key evil-window-map "\C-l" 'evil-window-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 "\C-R" 'evil-window-rotate-upwards)
(define-key evil-window-map "\C-s" 'split-window-vertically)
(define-key evil-window-map "\C-S" 'split-window-vertically)
(define-key evil-window-map "\C-t" 'evil-window-top-left)
(define-key evil-window-map "\C-v" 'split-window-horizontally)
(define-key evil-window-map "\C-w" 'evil-window-next)
(define-key evil-window-map "\C-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 "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 "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-symbol-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)
(define-key evil-motion-state-map ")" 'evil-forward-sentence)
(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 "*" 'evil-search-symbol-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 "\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
(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)
(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 "a" evil-outer-text-objects-map)
(define-key evil-visual-state-map "i" evil-inner-text-objects-map)
(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
(define-key evil-insert-state-map "\C-k" 'evil-insert-digraph)
(define-key evil-insert-state-map "\C-o" 'evil-execute-in-normal-state)
(define-key evil-insert-state-map "\C-r" 'evil-paste-from-register)
(define-key evil-insert-state-map "\C-y" 'evil-copy-from-above)
(define-key evil-insert-state-map "\C-e" 'evil-copy-from-below)
(define-key evil-insert-state-map "\C-n" 'evil-complete-next)
(define-key evil-insert-state-map "\C-p" 'evil-complete-previous)
(define-key evil-insert-state-map "\C-x\C-n" 'evil-complete-next-line)
(define-key evil-insert-state-map "\C-x\C-p" 'evil-complete-previous-line)
(define-key evil-insert-state-map [remap newline] 'evil-ret)
(define-key evil-insert-state-map [remap newline-and-indent] 'evil-ret)
(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)
(if evil-want-C-w-delete
(define-key evil-insert-state-map "\C-w" 'evil-delete-backward-word)
(define-key evil-insert-state-map "\C-w" 'evil-window-map))
;;; 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))
;;; Minibuffer
(define-key minibuffer-local-map "\C-p" 'evil-complete-next)
(define-key minibuffer-local-map "\C-n" 'evil-complete-previous)
(define-key minibuffer-local-map "\C-x\C-p" 'evil-complete-next-line)
(define-key minibuffer-local-map "\C-x\C-n" 'evil-complete-previous-line)
;;; 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)
(define-key evil-insert-state-map [mouse-2] 'mouse-yank-primary)
;; Ex
(define-key evil-motion-state-map ":" 'evil-ex)
(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" 'evil-show-buffers)
(evil-ex-define-cmd "files" "buffers")
(evil-ex-define-cmd "ls" "buffers")
(evil-ex-define-cmd "c[hange]" 'evil-change)
(evil-ex-define-cmd "d[elete]" 'evil-delete)
(evil-ex-define-cmd "go[to]" 'evil-goto-char)
(evil-ex-define-cmd "j[oin]" 'evil-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 "vne[w]" 'evil-window-vnew)
(evil-ex-define-cmd "clo[se]" 'delete-window)
(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 "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 "g[lobal]" 'evil-ex-global)
(evil-ex-define-cmd "v[global]" 'evil-ex-global-inverted)
(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 "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 "set-initial-state" 'evil-ex-set-initial-state)
(when (fboundp 'undo-tree-visualize)
(evil-ex-define-cmd "undol[ist]" 'undo-tree-visualize)
(evil-ex-define-cmd "ul" 'undo-tree-visualize))
;; completion
(define-key evil-ex-search-keymap "\d" #'evil-ex-delete-backward-char)
(define-key evil-ex-completion-map "\d" #'evil-ex-delete-backward-char)
(define-key evil-ex-completion-map "\t" #'evil-ex-run-completion-at-point)
(define-key evil-ex-completion-map [tab] #'evil-ex-run-completion-at-point)
(define-key evil-ex-completion-map "\C-p" #'evil-ex-run-completion-at-point)
(define-key evil-ex-completion-map "\C-n" #'evil-ex-run-completion-at-point)
(define-key evil-ex-completion-map "?" nil)
;; 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 "\r" "\n")
(provide 'evil-maps)
;;; evil-maps.el ends here

@ -1,5 +0,0 @@
(define-package
"evil"
"1.0.1"
"Extensible Vi layer for Emacs."
'((undo-tree "0.5.1")))

@ -1,607 +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.0.1
;;
;; 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 recored. 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")
(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 (- (line-number-at-pos end)
(line-number-at-pos beg))))
(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-repeat-keystrokes (flag)
"Repeation recording function for commands that are repeated by keystrokes."
(cond
((eq flag 'pre)
(setq evil-repeat-keys (this-command-keys)))
((eq flag 'post)
(evil-repeat-record (if (zerop (length (this-command-keys)))
evil-repeat-keys
(this-command-keys)))
;; 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))
(execute-kbd-macro rep))
((consp 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 ()
(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))
(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

File diff suppressed because it is too large Load Diff

@ -1,865 +0,0 @@
;;; evil-states.el --- States
;; Author: Vegard Øye <vegard_oye at hotmail.com>
;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
;; Version: 1.0.1
;;
;; 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)
(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 (evil-initializing-p)
(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
(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 'pre-command-hook #'evil-insert-repeat-hook)
(unless evil-want-fine-undo
(evil-start-undo-step t)))
(t
(remove-hook 'pre-command-hook #'evil-insert-repeat-hook)
(setq evil-insert-repeat-info evil-repeat-info)
(evil-set-marker ?^ nil t)
(unless evil-want-fine-undo
(evil-end-undo-step t))
(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 (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))
(unless (evil-get-command-property command :keep-visual)
(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))
(when evil-visual-x-select-timer
(cancel-timer evil-visual-x-select-timer))
(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."
(with-current-buffer (or buffer (current-buffer))
(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)
(evil-visual-update-x-selection)
(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)
;; make `window-line-height' reliable
(redisplay)
(setq height (window-line-height))
(setq height (+ (nth 0 height) (nth 3 height)))
;; cut cursor height in half
(setq height (/ height 2))
(setq cursor-type (cons 'hbar height))
;; ensure the cursor is redisplayed
(force-window-update (selected-window))
(redisplay)))
;;; Replace state
(evil-define-state replace
"Replace state."
:tag " <R> "
:cursor hbar
:message "-- REPLACE --"
(cond
((evil-replace-state-p)
(overwrite-mode 1)
(add-hook 'pre-command-hook #'evil-replace-pre-command nil t))
(t
(overwrite-mode -1)
(remove-hook 'pre-command-hook #'evil-replace-pre-command t)
(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

@ -1,361 +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.0.1
;;
;; 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 (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 "<!>"
"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)))
(provide 'evil-types)
;;; evil-types.el ends here

File diff suppressed because it is too large Load Diff

@ -1,114 +0,0 @@
;;; evil.el --- extensible vi layer
;; Author: Vegard Øye <vegard_oye at hotmail.com>
;; Antono Vasiljev <antono.vasiljev at gmail.com>
;; Barry O'Reilly <gundaetiapo at gmail.com>
;; Christoph Lange <langec at web.de>
;; Frank Fischer <frank.fischer at mathematik.tu-chemnitz.de>
;; Frank Terbeck <ft at bewatermyfriend.org>
;; Jonathan Claggett <jclaggett at lonocloud.com>
;; Marian Schubert <maio@netsafe.cz>
;; Michael Markert <markert.michael at googlemail.com>
;; Nikolai Weibull <now at bitwi.se>
;; Sanel Zukan <sanelz at gmail.com>
;; Simon Hafner <hafnersimon at gmail.com>
;; Sune Simonsen <sune.simonsen at jayway.com>
;; Thomas Hisch <thomas at opentech.at>
;; Ulrich Müller <ulm at gentoo.org>
;; Winfred Lu <winfred.lu@gmail.com>
;; Wolfgang Jenkner <wjenkner at inode.at>
;; York Zhao <yzhao at telecor.com>
;; Lintaro Ina <tarao.gnn at gmail.com>
;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
;; To get in touch, please use the bug tracker or the
;; mailing list (see below).
;; Created: 2011-03-01
;; Version: 1.0.1
;; Keywords: emulation, vim
;; URL: http://gitorious.org/evil
;; Repository: git://gitorious.org/evil/evil.git
;; EmacsWiki: http://www.emacswiki.org/emacs/Evil
;; Bug tracker: https://bitbucket.org/lyro/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://gitorious.org/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-maps)
(require 'evil-integration)
(run-hooks 'evil-after-load-hook)
(provide 'evil)
;;; evil.el ends here

@ -1,47 +0,0 @@
;;; find-file-in-project-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (find-file-in-project) "find-file-in-project" "find-file-in-project.el"
;;;;;; (20815 21543 0 0))
;;; Generated autoloads from find-file-in-project.el
(autoload 'find-file-in-project "find-file-in-project" "\
Prompt with a completing list of all files in the project to find one.
The project's scope is defined as the first directory containing
an `.emacs-project' file. You can override this by locally
setting the variable `ffip-project-root'.
\(fn)" t nil)
(defalias 'ffip 'find-file-in-project)
(put 'ffip-patterns 'safe-local-variable 'listp)
(put 'ffip-find-options 'safe-local-variable 'stringp)
(put 'ffip-project-file 'safe-local-variable 'stringp)
(put 'ffip-project-root 'safe-local-variable 'stringp)
(put 'ffip-project-root-function 'safe-local-variable 'functionp)
(put 'ffip-limit 'safe-local-variable 'integerp)
;;;***
;;;### (autoloads nil nil ("find-file-in-project-pkg.el") (20815
;;;;;; 21543 166996 0))
;;;***
(provide 'find-file-in-project-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; find-file-in-project-autoloads.el ends here

@ -1 +0,0 @@
(define-package "find-file-in-project" "3.2" "Find files in a project quickly." (quote nil))

@ -1,183 +0,0 @@
;;; find-file-in-project.el --- Find files in a project quickly.
;; Copyright (C) 2006-2009, 2011-2012
;; Phil Hagelberg, Doug Alcorn, and Will Farrington
;; Author: Phil Hagelberg, Doug Alcorn, and Will Farrington
;; URL: http://www.emacswiki.org/cgi-bin/wiki/FindFileInProject
;; Git: git://github.com/technomancy/find-file-in-project.git
;; Version: 3.2
;; Created: 2008-03-18
;; Keywords: project, convenience
;; EmacsWiki: FindFileInProject
;; 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 provides a couple methods for quickly finding any file
;; in a given project. It depends on GNU find.
;; A project is found by searching up the directory tree until a file
;; is found that matches `ffip-project-file'. (".git" by default.)
;; You can set `ffip-project-root-function' to provide an alternate
;; function to search for the project root. By default, it looks only
;; for files whose names match `ffip-patterns',
;; If you have so many files that it becomes unwieldy, you can set
;; `ffip-find-options' to a string which will be passed to the `find'
;; invocation in order to exclude irrelevant subdirectories. For
;; instance, in a Ruby on Rails project, you may be interested in all
;; .rb files that don't exist in the "vendor" directory. In that case
;; you could set `ffip-find-options' to "-not -regex \".*vendor.*\"".
;; All these variables may be overridden on a per-directory basis in
;; your .dir-locals.el. See (info "(Emacs) Directory Variables") for
;; details.
;; Recommended binding: (global-set-key (kbd "C-x f") 'find-file-in-project)
;;; TODO:
;; Add compatibility with BSD find (PDI; I can't virtualize OS X)
;;; Code:
(defvar ffip-project-file ".git"
"The file that should be used to define a project root.
May be set using .dir-locals.el. Checks each entry if set to a list.")
(defvar ffip-patterns
'("*.html" "*.el" "*.clj" "*.py" "*.rb" "*.js"
"*.sh" "*.erl" "*.hs" "*.ml" "*.sql" "*.c" "*.erb")
"List of patterns to look for with `find-file-in-project'.")
(defvar ffip-find-options ""
"Extra options to pass to `find' when using `find-file-in-project'.
Use this to exclude portions of your project: \"-not -regex \\\".*svn.*\\\"\".")
(defvar ffip-project-root nil
"If non-nil, overrides the project root directory location.")
(defvar ffip-project-root-function nil
"If non-nil, this function is called to determine the project root.
This overrides variable `ffip-project-root' when set.")
(defvar ffip-limit 512
"Limit results to this many files.")
(defvar ffip-full-paths nil
"If non-nil, show fully project-relative paths.")
(defun ffip-project-root ()
"Return the root of the project."
(let ((project-root (or ffip-project-root
(if (functionp ffip-project-root-function)
(funcall ffip-project-root-function)
(if (listp ffip-project-file)
(some (apply-partially 'locate-dominating-file
default-directory)
ffip-project-file)
(locate-dominating-file default-directory
ffip-project-file))))))
(or project-root
(progn (message "No project was defined for the current file.")
nil))))
(defun ffip-uniqueify (file-cons)
"Set the car of FILE-CONS to include the directory name plus the file name."
(setcar file-cons
(concat (cadr (reverse (split-string (cdr file-cons) "/"))) "/"
(car file-cons))))
(defun ffip-join-patterns ()
"Turn `ffip-paterns' into a string that `find' can use."
(mapconcat (lambda (pat) (format "-name \"%s\"" pat))
ffip-patterns " -or "))
(defun ffip-project-files ()
"Return an alist of all filenames in the project and their path.
Files with duplicate filenames are suffixed with the name of the
directory they are found in so that they are unique."
(let ((file-alist nil)
(root (expand-file-name (or ffip-project-root (ffip-project-root)
(error "No project root found")))))
(mapcar (lambda (file)
(if ffip-full-paths
(cons (substring (expand-file-name file) (length root))
(expand-file-name file))
(let ((file-cons (cons (file-name-nondirectory file)
(expand-file-name file))))
(when (assoc (car file-cons) file-alist)
(ffip-uniqueify (assoc (car file-cons) file-alist))
(ffip-uniqueify file-cons))
(add-to-list 'file-alist file-cons)
file-cons)))
(split-string (shell-command-to-string
(format "find %s -type f \\( %s \\) %s | head -n %s"
root (ffip-join-patterns)
ffip-find-options ffip-limit))))))
(defvar ffip-project-files-cache '())
(defun ffip-bust-cache ()
(interactive)
(setq ffip-project-files-cache '()))
(defun ffip-get-project-files ()
(when (equal (assoc (ffip-project-root) ffip-project-files-cache) nil)
(add-to-list 'ffip-project-files-cache `(,(ffip-project-root) ,(ffip-project-files))))
(car (cdr (assoc (ffip-project-root) ffip-project-files-cache))))
;;;###autoload
(defun find-file-in-project ()
"Prompt with a completing list of all files in the project to find one.
The project's scope is defined as the first directory containing
an `.emacs-project' file. You can override this by locally
setting the variable `ffip-project-root'."
(interactive)
(let* ((project-files (ffip-get-project-files))
(files (mapcar 'car project-files))
(file (if (and (boundp 'ido-mode) ido-mode)
(ido-completing-read "Find file in project: " files)
(completing-read "Find file in project: " files))))
(find-file (cdr (assoc file project-files)))))
;;;###autoload
(defalias 'ffip 'find-file-in-project)
;; safe locals
;;;###autoload
(progn
(put 'ffip-patterns 'safe-local-variable 'listp)
(put 'ffip-find-options 'safe-local-variable 'stringp)
(put 'ffip-project-file 'safe-local-variable 'stringp)
(put 'ffip-project-root 'safe-local-variable 'stringp)
(put 'ffip-project-root-function 'safe-local-variable 'functionp)
(put 'ffip-limit 'safe-local-variable 'integerp))
(provide 'find-file-in-project)
;;; find-file-in-project.el ends here

@ -1,46 +0,0 @@
;;; flymake-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (flymake-find-file-hook flymake-mode-off flymake-mode-on
;;;;;; flymake-mode) "flymake" "flymake.el" (20685 13733))
;;; Generated autoloads from flymake.el
(autoload 'flymake-mode "flymake" "\
Toggle on-the-fly syntax checking.
With a prefix argument ARG, enable the mode if ARG is positive,
and disable it otherwise. If called from Lisp, enable the mode
if ARG is omitted or nil.
\(fn &optional ARG)" t nil)
(autoload 'flymake-mode-on "flymake" "\
Turn flymake mode on.
\(fn)" nil nil)
(autoload 'flymake-mode-off "flymake" "\
Turn flymake mode off.
\(fn)" nil nil)
(autoload 'flymake-find-file-hook "flymake" "\
\(fn)" nil nil)
;;;***
;;;### (autoloads nil nil ("flymake-pkg.el") (20685 13733 601582))
;;;***
(provide 'flymake-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; flymake-autoloads.el ends here

@ -1 +0,0 @@
(define-package "flymake" "0.4.12" "a universal on-the-fly syntax checker" (quote nil))

File diff suppressed because it is too large Load Diff

@ -1,29 +0,0 @@
;;; idle-highlight-mode-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (idle-highlight-mode) "idle-highlight-mode" "idle-highlight-mode.el"
;;;;;; (20815 21543 0 0))
;;; Generated autoloads from idle-highlight-mode.el
(autoload 'idle-highlight-mode "idle-highlight-mode" "\
Idle-Highlight Minor Mode
\(fn &optional ARG)" t nil)
;;;***
;;;### (autoloads nil nil ("idle-highlight-mode-pkg.el") (20815 21543
;;;;;; 721828 0))
;;;***
(provide 'idle-highlight-mode-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; idle-highlight-mode-autoloads.el ends here

@ -1 +0,0 @@
(define-package "idle-highlight-mode" "1.1.2" "highlight the word the point is on" (quote nil))

@ -1,104 +0,0 @@
;;; idle-highlight-mode.el --- highlight the word the point is on
;; Copyright (C) 2008-2011 Phil Hagelberg, Cornelius Mika
;; Author: Phil Hagelberg, Cornelius Mika
;; URL: http://www.emacswiki.org/cgi-bin/wiki/IdleHighlight
;; Version: 1.1.2
;; Created: 2008-05-13
;; Keywords: convenience
;; EmacsWiki: IdleHighlight
;; 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:
;; Based on some snippets by fledermaus from the #emacs channel.
;; M-x idle-highlight-mode sets an idle timer that highlights all
;; occurences in the buffer of the word under the point.
;; Enabling it in a hook is recommended. But you don't want it enabled
;; for all buffers, just programming ones.
;;
;; Example:
;;
;; (defun my-coding-hook ()
;; (make-local-variable 'column-number-mode)
;; (column-number-mode t)
;; (if window-system (hl-line-mode t))
;; (idle-highlight t))
;;
;; (add-hook 'emacs-lisp-mode-hook 'my-coding-hook)
;; (add-hook 'ruby-mode-hook 'my-coding-hook)
;; (add-hook 'js2-mode-hook 'my-coding-hook)
;;; Code:
(require 'thingatpt)
(defgroup idle-highlight nil
"Highlight other occurrences of the word at point."
:group 'faces)
(defface idle-highlight
'((t (:inherit region)))
"Face used to highlight other occurrences of the word at point."
:group 'idle-highlight)
(defvar idle-highlight-regexp nil
"Buffer-local regexp to be idle-highlighted.")
(defvar idle-highlight-global-timer nil
"Timer to trigger highlighting.")
(defun idle-highlight-word-at-point ()
"Highlight the word under the point."
(if idle-highlight-mode
(let* ((target-symbol (symbol-at-point))
(target (symbol-name target-symbol)))
(if (and target-symbol
(not (in-string-p))
(looking-at-p "\\s_\\|\\sw") ;; Symbol characters
;; TODO: no need to highlight keywords like if
(not (equal target "end")))
(progn (idle-highlight-unhighlight)
(setq idle-highlight-regexp (concat "\\<" (regexp-quote target) "\\>"))
(highlight-regexp idle-highlight-regexp 'idle-highlight))
(idle-highlight-unhighlight)
(setq idle-highlight-regexp nil)))))
(defsubst idle-highlight-unhighlight ()
(if idle-highlight-regexp (unhighlight-regexp idle-highlight-regexp)))
;;;###autoload
(define-minor-mode idle-highlight-mode
"Idle-Highlight Minor Mode"
:group 'idle-highlight
(if idle-highlight-mode
(progn (unless idle-highlight-global-timer
(setq idle-highlight-global-timer
(run-with-idle-timer 0.5 :repeat 'idle-highlight-word-at-point)))
(set (make-local-variable 'idle-highlight-regexp) nil))
(idle-highlight-unhighlight)))
(provide 'idle-highlight-mode)
;;; idle-highlight-mode.el ends here

@ -1,118 +0,0 @@
;;; ido-ubiquitous-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (ido-ubiquitous-function-compatibility-exceptions
;;;;;; ido-ubiquitous-command-compatibility-exceptions ido-ubiquitous-function-exceptions
;;;;;; ido-ubiquitous-command-exceptions ido-ubiquitous-mode ido-ubiquitous)
;;;;;; "ido-ubiquitous" "ido-ubiquitous.el" (20815 21541 0 0))
;;; Generated autoloads from ido-ubiquitous.el
(let ((loads (get 'ido-ubiquitous 'custom-loads))) (if (member '"ido-ubiquitous" loads) nil (put 'ido-ubiquitous 'custom-loads (cons '"ido-ubiquitous" loads))))
(defvar ido-ubiquitous-mode nil "\
Non-nil if Ido-Ubiquitous mode is enabled.
See the command `ido-ubiquitous-mode' for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `ido-ubiquitous-mode'.")
(custom-autoload 'ido-ubiquitous-mode "ido-ubiquitous" nil)
(autoload 'ido-ubiquitous-mode "ido-ubiquitous" "\
Use `ido-completing-read' instead of `completing-read' almost everywhere.
This mode has no effect unles `ido-mode' is also enabled.
If this mode causes problems for a function, you can force the
function to use the original completing read by using the macro
`ido-ubiquitous-disable-in'. For example, if a
function `foo' cannot work with ido-style completion, evaluate
the following (for example by putting it in your .emacs file):
(ido-ubiquitous-disable-in foo)
\(fn &optional ARG)" t nil)
(define-obsolete-variable-alias 'ido-ubiquitous 'ido-ubiquitous-mode "0.8")
(define-obsolete-function-alias 'ido-ubiquitous 'ido-ubiquitous-mode "0.8")
(defvar ido-ubiquitous-command-exceptions 'nil "\
List of commands that should not be affected by `ido-ubiquitous'.
Even when `ido-ubiquitous' mode is enabled, these commands will
continue to use `completing-read' instead of
`ido-completing-read'.
Only *interactive* commands should go here. To disable
ido-ubiquitous in non-interactive functions, customize
`ido-ubiquitous-function-exceptions'.
Note: this feature depends on the variable `this-command' being
properly set to the name of the currently executing command.
Depending on how the command is onvoked, this may or may not
happen, so this feature may simply not work in some cases.")
(custom-autoload 'ido-ubiquitous-command-exceptions "ido-ubiquitous" t)
(define-obsolete-variable-alias 'ido-ubiquitous-exceptions 'ido-ubiquitous-command-exceptions "0.4")
(defvar ido-ubiquitous-function-exceptions '(grep-read-files) "\
List of functions in which to disable ido-ubiquitous.
If you need to add a function to this list, please also file a
bug report at
https://github.com/DarwinAwardWinner/ido-ubiquitous/issues
Note that certain functions, such as `read-file-name', must
always have ido-ubiquitous disabled, and cannot be added
here. (They are effectively a permanent part of this list
already.)")
(custom-autoload 'ido-ubiquitous-function-exceptions "ido-ubiquitous" nil)
(defvar ido-ubiquitous-command-compatibility-exceptions 'nil "\
List of commands in which to disable compatibility.
See `ido-ubiquitous-enable-compatibility' for a description of
the compatibility behavior. If this behavior causes a command to
break, add that command to this list to disable compatibility
mode for just that command.
Only *interactive* commands should go here. To disable
compatibility mode in non-interactive functions, customize
`ido-ubiquitous-function-compatibility-exceptions'.")
(custom-autoload 'ido-ubiquitous-command-compatibility-exceptions "ido-ubiquitous" t)
(defvar ido-ubiquitous-function-compatibility-exceptions 'nil "\
List of functions in which to disable ido-ubiquitous compatibility mode.
See `ido-ubiquitous-enable-compatibility' for a description of
the compatibility behavior. If this behavior causes a function to
break, add that function to this list to disable compatibility
mode for just that command.
If you need to add a function to this list, please also file a
bug report at
https://github.com/DarwinAwardWinner/ido-ubiquitous/issues")
(custom-autoload 'ido-ubiquitous-function-compatibility-exceptions "ido-ubiquitous" nil)
;;;***
;;;### (autoloads nil nil ("ido-ubiquitous-pkg.el") (20815 21541
;;;;;; 802909 0))
;;;***
(provide 'ido-ubiquitous-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; ido-ubiquitous-autoloads.el ends here

@ -1 +0,0 @@
(define-package "ido-ubiquitous" "1.6" "Use ido (nearly) everywhere." (quote nil))

@ -1,466 +0,0 @@
;;; ido-ubiquitous.el --- Use ido (nearly) everywhere.
;; Author: Ryan C. Thompson
;; URL: https://github.com/DarwinAwardWinner/ido-ubiquitous
;; Version: 1.6
;; Created: 2011-09-01
;; Keywords: convenience
;; EmacsWiki: InteractivelyDoThings
;; This file is NOT part of GNU Emacs.
;;; Commentary:
;; You may have seen the `ido-everywhere' variable in ido.el and got
;; excited that you could use ido completion for everything. Then you
;; were probably disappointed when you realized that it only applied
;; to *file names* and nothing else. Well, ido-ubiquitous is here to
;; fulfill the original promise and let you use ido completion for
;; (almost) any command that uses `completing-read' to offer you a
;; choice of several alternatives.
;; This even works in M-x, but for that, you might prefer the "smex"
;; package instead.
;; As of version 0.7, this package also makes a small modification to
;; ido's behavior so as to support a strange corner case of
;; `completing-read' that some functions rely on. Since the goal of
;; this package is to replace `completing-read' everywhere instead of
;; just selectively (as ido itself does), compatibility with all the
;; quriks of `completing-read' is important here.
;; If you find a case where enabling ido-ubiquitous causes a command
;; not to work correctly, please report it by creating an issue on
;; GitHub: https://github.com/DarwinAwardWinner/ido-ubiquitous/issues
;;; 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.
;;; Code:
(require 'ido)
(require 'advice)
(defvar ido-ubiquitous-orig-completing-read-function
(bound-and-true-p completing-read-function)
"The value of `completing-read-function' before ido-ubiquitous-mode was enabled.
This value will be restored when `ido-ubiquitous-mode' is
deactivated. It will also be used as a fallback if ido-ubiquitous
detects something that ido cannot handle.")
;;;###autoload
(defgroup ido-ubiquitous nil
"Use ido for (almost) all completion."
:group 'ido)
;;;###autoload
(define-minor-mode ido-ubiquitous-mode
"Use `ido-completing-read' instead of `completing-read' almost everywhere.
This mode has no effect unles `ido-mode' is also enabled.
If this mode causes problems for a function, you can force the
function to use the original completing read by using the macro
`ido-ubiquitous-disable-in'. For example, if a
function `foo' cannot work with ido-style completion, evaluate
the following (for example by putting it in your .emacs file):
(ido-ubiquitous-disable-in foo)"
nil
:global t
:group 'ido-ubiquitous
(when ido-ubiquitous-mode
(unless (bound-and-true-p ido-mode)
(warn "Ido-ubiquitous-mode enabled without ido mode.")))
(if (and (boundp 'completing-read-function)
ido-ubiquitous-orig-completing-read-function)
;; Emacs 24 and later
(progn
;; Ensure emacs 23 code disabled
(ad-disable-advice 'completing-read 'around 'ido-ubiquitous-legacy)
(ad-activate 'completing-read)
(setq completing-read-function
(if ido-ubiquitous-mode
'completing-read-ido
ido-ubiquitous-orig-completing-read-function)))
;; Emacs 23 and earlier
(funcall (if ido-ubiquitous-mode 'ad-enable-advice 'ad-disable-advice)
'completing-read 'around 'ido-ubiquitous-legacy)
(ad-activate 'completing-read)))
;;;###autoload
(define-obsolete-variable-alias 'ido-ubiquitous
'ido-ubiquitous-mode "0.8")
;;;###autoload
(define-obsolete-function-alias 'ido-ubiquitous
'ido-ubiquitous-mode "0.8")
;;;###autoload
(defcustom ido-ubiquitous-command-exceptions '()
"List of commands that should not be affected by `ido-ubiquitous'.
Even when `ido-ubiquitous' mode is enabled, these commands will
continue to use `completing-read' instead of
`ido-completing-read'.
Only *interactive* commands should go here. To disable
ido-ubiquitous in non-interactive functions, customize
`ido-ubiquitous-function-exceptions'.
Note: this feature depends on the variable `this-command' being
properly set to the name of the currently executing command.
Depending on how the command is onvoked, this may or may not
happen, so this feature may simply not work in some cases."
:type '(repeat (symbol :tag "Command"))
:group 'ido-ubiquitous)
;;;###autoload
(define-obsolete-variable-alias 'ido-ubiquitous-exceptions
'ido-ubiquitous-command-exceptions "0.4")
(defvar ido-next-call-replaces-completing-read nil)
(defvar ido-this-call-replaces-completing-read nil)
;; Emacs 23-
(defadvice completing-read (around ido-ubiquitous-legacy activate)
"Ido-based method for reading from the minibuffer with completion.
See `completing-read' for the meaning of the arguments."
(if (or inherit-input-method ; Can't handle this arg
(not ido-mode)
(not ido-ubiquitous-mode)
;; Avoid infinite recursion from ido calling completing-read
(boundp 'ido-cur-item)
(memq this-command ido-ubiquitous-command-exceptions))
ad-do-it
(let ((allcomp (all-completions "" collection predicate)))
;; Only use ido completion if there are actually any completions
;; to offer.
(if allcomp
(let ((ido-next-call-replaces-completing-read t))
(setq ad-return-value
(ido-completing-read prompt allcomp
nil require-match initial-input hist def)))
ad-do-it))))
(ad-disable-advice 'completing-read 'around 'ido-ubiquitous-legacy)
(ad-activate 'completing-read)
;; Emacs 24+
(defun completing-read-ido (prompt collection &optional predicate
require-match initial-input
hist def inherit-input-method)
"Ido-based method for reading from the minibuffer with completion.
See `completing-read' for the meaning of the arguments.
This function is a wrapper for `ido-completing-read' designed to
be used as the value of `completing-read-function'."
(if (or inherit-input-method ; Can't handle this arg
(not ido-mode)
(not ido-ubiquitous-mode)
(memq this-command ido-ubiquitous-command-exceptions))
(funcall ido-ubiquitous-orig-completing-read-function
prompt collection predicate
require-match initial-input
hist def inherit-input-method)
(let ((allcomp (all-completions "" collection predicate)))
;; Only use ido completion if there are actually any completions
;; to offer.
(if allcomp
(let ((ido-next-call-replaces-completing-read t))
(ido-completing-read prompt allcomp
nil require-match initial-input hist def))
(funcall ido-ubiquitous-orig-completing-read-function
prompt collection predicate
require-match initial-input
hist def inherit-input-method)))))
(defadvice ido-completing-read (around detect-replacing-cr activate)
"Detect whether this call was done through `completing-read-ido'."
(let* ((ido-this-call-replaces-completing-read ido-next-call-replaces-completing-read)
(ido-next-call-replaces-completing-read nil))
(when ido-this-call-replaces-completing-read
;; If DEF is a list, prepend it to CHOICES and set DEF to just the
;; car of the default list.
(when (and def (listp def))
(setq choices (delete-dups (append def choices))
def (car def))) ;; Work around a bug in ido when both INITIAL-INPUT and DEF are provided
;; More info: https://github.com/technomancy/ido-ubiquitous/issues/18
(let ((initial (cond ((null initial-input) "")
((stringp initial-input) initial-input)
((consp initial-input) (car initial-input))
(t initial-input)))
(deflist (if (listp def)
def
(list def))))
(when (and deflist initial
(stringp initial)
(not (string= initial "")))
;; Both default and initial input were provided. So keep the
;; initial input and preprocess the choices list to put the
;; default at the head, then proceed with default = nil.
(setq choices (delete-dups (append deflist (remove def choices)))
def nil))))
ad-do-it))
(defmacro ido-ubiquitous-disable-in (func)
"Disable ido-ubiquitous in FUNC."
(let ((docstring
(format "Disable ido-ubiquitous in %s" func)))
`(defadvice ,func (around disable-ido-ubiquitous activate)
,docstring
(let (ido-ubiquitous-mode) ad-do-it))))
(define-obsolete-function-alias
'disable-ido-ubiquitous-in
'ido-ubiquitous-disable-in
"0.4")
(defmacro ido-ubiquitous-enable-in (func)
"Re-enable ido-ubiquitous in FUNC.
This reverses the effect of a previous call to
`ido-ubiquitous-disable-in'."
`(when (ad-find-advice ',func 'around 'disable-ido-ubiquitous)
(ad-disable-advice ',func 'around 'disable-ido-ubiquitous)
(ad-activate ',func)))
(define-obsolete-function-alias
'enable-ido-ubiquitous-in
'ido-ubiquitous-enable-in
"0.4")
;; Always disable ido-ubiquitous in `find-file' and similar functions,
;; because they are not supposed to use ido.
(defvar ido-ubiquitous-permanent-function-exceptions
'(read-file-name
read-file-name-internal
read-buffer
gnus-emacs-completing-read
gnus-iswitchb-completing-read
man)
"Functions in which ido-ubiquitous should always be disabled.
If you want to disable ido in a specific function or command, do
not modify this variable. Instead, try `M-x customize-group
ido-ubiquitous.")
(dolist (func ido-ubiquitous-permanent-function-exceptions)
(eval `(ido-ubiquitous-disable-in ,func)))
(defun ido-ubiquitous--set-difference (list1 list2)
"Replacement for `set-difference' from `cl'."
(apply #'nconc
(mapcar (lambda (elt) (unless (memq elt list2) (list elt)))
list1)))
(defun ido-ubiquitous-set-function-exceptions (sym newval)
(let* ((oldval (when (boundp sym) (eval sym))))
;; Filter out the permanent exceptions so we never act on them.
(setq oldval (ido-ubiquitous--set-difference oldval ido-ubiquitous-permanent-function-exceptions))
(setq newval (ido-ubiquitous--set-difference newval ido-ubiquitous-permanent-function-exceptions))
;; Re-enable ido-ubiquitous on all old functions, in case they
;; were removed from the list.
(dolist (oldfun oldval)
(eval `(ido-ubiquitous-enable-in ,oldfun)))
;; Set the new value
(set-default sym newval)
;; Disable ido-ubiquitous on all new functions
(dolist (newfun newval)
(eval `(ido-ubiquitous-disable-in ,newfun)))))
;;;###autoload
(defcustom ido-ubiquitous-function-exceptions
'(grep-read-files)
"List of functions in which to disable ido-ubiquitous.
If you need to add a function to this list, please also file a
bug report at
https://github.com/DarwinAwardWinner/ido-ubiquitous/issues
Note that certain functions, such as `read-file-name', must
always have ido-ubiquitous disabled, and cannot be added
here. (They are effectively a permanent part of this list
already.)"
:group 'ido-ubiquitous
:type '(repeat :tag "Functions"
(symbol :tag "Function"))
:set 'ido-ubiquitous-set-function-exceptions)
(defcustom ido-ubiquitous-enable-compatibility t
"Allow ido to emulate a quirk of `completing-read'.
From the `completing-read' docstring:
> If the input is null, `completing-read' returns DEF, or the
> first element of the list of default values, or an empty string
> if DEF is nil, regardless of the value of REQUIRE-MATCH.
If this variable is non-nil, then ido-ubiquitous will attempt to
emulate this behavior. Specifically, if RET is pressed
immediately upon entering completion, an empty string will be
returned instead of the first element in the list. This behavior
is only enabled when ido is being used as a substitute for
`completing-read', and not when it is used directly.
This odd behavior is required for compatibility with an old-style
usage pattern whereby the default was requested by returning an
empty string. In this mode, the caller receives the empty string
and handles the default case manually, while `completing-read'
never has any knowledge of the default. This is a problem for
ido, which always returns the first element in the list when the
input is empty. Without knowledge of the default, it cannot
ensure that the default is first on the list, so returning the
first item is not the correct behavior. Instead, it must return
an empty string like `completing-read'.
When this mode is enabled, you can still select the first item on
the list by prefixing \"RET\" with \"C-u\"."
:type 'boolean
:group 'ido-ubiquitous)
;;;###autoload
(defcustom ido-ubiquitous-command-compatibility-exceptions '()
"List of commands in which to disable compatibility.
See `ido-ubiquitous-enable-compatibility' for a description of
the compatibility behavior. If this behavior causes a command to
break, add that command to this list to disable compatibility
mode for just that command.
Only *interactive* commands should go here. To disable
compatibility mode in non-interactive functions, customize
`ido-ubiquitous-function-compatibility-exceptions'."
:type '(repeat (symbol :tag "Command"))
:group 'ido-ubiquitous)
(defvar ido-ubiquitous-initial-item nil
"The first item selected when ido starts.")
(defadvice ido-read-internal (before clear-initial-item activate)
(setq ido-ubiquitous-initial-item nil))
(defadvice ido-make-choice-list (after set-initial-item activate)
(when (and ad-return-value (listp ad-return-value))
(setq ido-ubiquitous-initial-item (car ad-return-value))))
(defadvice ido-next-match (after clear-initial-item activate)
(setq ido-ubiquitous-initial-item nil))
(defadvice ido-prev-match (after clear-initial-item activate)
(setq ido-ubiquitous-initial-item nil))
(defadvice ido-exit-minibuffer (around compatibility activate)
"Emulate a quirk of `completing-read'.
> If the input is null, `completing-read' returns DEF, or the
> first element of the list of default values, or an empty string
> if DEF is nil, regardless of the value of REQUIRE-MATCH.
See `ido-ubiquitous-enable-compatibility', which controls whether
this advice has any effect."
(if (and (eq ido-cur-item 'list)
ido-ubiquitous-enable-compatibility
;; Only enable if we are replacing `completing-read'
ido-this-call-replaces-completing-read
;; Disable in command exceptions
(not (memq this-command ido-ubiquitous-command-compatibility-exceptions))
;; Input is empty
(string= ido-text "")
;; Default is nil
(null ido-default-item)
;; Prefix disables compatibility
(not current-prefix-arg)
(string= (car ido-cur-list)
ido-ubiquitous-initial-item))
(ido-select-text)
ad-do-it)
(setq ido-ubiquitous-initial-item nil))
(defmacro ido-ubiquitous-disable-compatibility-in (func)
"Disable ido-ubiquitous compatibility mode in FUNC."
(let ((docstring
(format "Disable ido-ubiquitous in %s" func)))
`(defadvice ,func (around disable-ido-ubiquitous-compatibility activate)
,docstring
(let (ido-ubiquitous-enable-compatibility) ad-do-it))))
(defmacro ido-ubiquitous-enable-compatibility-in (func)
"Re-enable ido-ubiquitous comaptibility mode in FUNC.
This reverses the effect of a previous call to
`ido-ubiquitous-disable-compatibility-in'."
`(when (ad-find-advice ',func 'around 'disable-ido-ubiquitous-compatibility)
(ad-disable-advice ',func 'around 'disable-ido-ubiquitous-compatibility)
(ad-activate ',func)))
(defun ido-ubiquitous-set-function-compatibility-exceptions (sym newval)
(let* ((oldval (when (boundp sym) (eval sym))))
;; Re-enable compatibility on all old functions, in case they
;; were removed from the list.
(dolist (oldfun oldval)
(eval `(ido-ubiquitous-enable-compatibility-in ,oldfun)))
;; Set the new value
(set-default sym newval)
;; Disable compatibility on all new functions
(dolist (newfun newval)
(eval `(ido-ubiquitous-disable-compatibility-in ,newfun)))))
;;;###autoload
(defcustom ido-ubiquitous-function-compatibility-exceptions
'()
"List of functions in which to disable ido-ubiquitous compatibility mode.
See `ido-ubiquitous-enable-compatibility' for a description of
the compatibility behavior. If this behavior causes a function to
break, add that function to this list to disable compatibility
mode for just that command.
If you need to add a function to this list, please also file a
bug report at
https://github.com/DarwinAwardWinner/ido-ubiquitous/issues"
:group 'ido-ubiquitous
:type '(repeat :tag "Functions"
(symbol :tag "Function"))
:set 'ido-ubiquitous-set-function-exceptions)
(defun ido-ubiquitous-initialize ()
"Do initial setup for ido-ubiquitous.
This only needs to be called once when the file is first loaded."
;; Clean up old versions of ido-ubiquitous (1.3 and earlier) that
;; defined advice on `completing-read' instead of modifying
;; `completing-read-function'.
(when (ad-find-advice 'completing-read 'around 'ido-ubiquitous)
(ad-remove-advice 'completing-read 'around 'ido-ubiquitous)
(ad-activate 'completing-read))
;; Make sure all exceptions are activated
(ido-ubiquitous-set-function-exceptions
'ido-ubiquitous-function-exceptions
ido-ubiquitous-function-exceptions)
(ido-ubiquitous-set-function-compatibility-exceptions
'ido-ubiquitous-function-compatibility-exceptions
ido-ubiquitous-function-compatibility-exceptions)
;; Make sure the mode is turned on/off as specified by the value of
;; the mode variable
(ido-ubiquitous-mode (if ido-ubiquitous-mode 1 0)))
(ido-ubiquitous-initialize)
(provide 'ido-ubiquitous) ;;; ido-ubiquitous.el ends here

@ -1,50 +0,0 @@
;;; inf-ruby-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (run-ruby inf-ruby inf-ruby-setup-keybindings)
;;;;;; "inf-ruby" "inf-ruby.el" (20815 21577 0 0))
;;; Generated autoloads from inf-ruby.el
(autoload 'inf-ruby-setup-keybindings "inf-ruby" "\
Set local key defs to invoke inf-ruby from ruby-mode.
\(fn)" nil nil)
(autoload 'inf-ruby "inf-ruby" "\
Run an inferior Ruby process in a buffer.
With prefix argument, prompts for which Ruby implementation
\(from the list `inf-ruby-implementations') to use. Runs the
hooks `inf-ruby-mode-hook' (after the `comint-mode-hook' is
run).
\(fn &optional IMPL)" t nil)
(autoload 'run-ruby "inf-ruby" "\
Run an inferior Ruby process, input and output via buffer *ruby*.
If there is a process already running in `*ruby*', switch to that buffer.
With argument, allows you to edit the command line (default is value
of `ruby-program-name'). Runs the hooks `inferior-ruby-mode-hook'
\(after the `comint-mode-hook' is run).
\(Type \\[describe-mode] in the process buffer for a list of commands.)
\(fn &optional COMMAND NAME)" t nil)
(eval-after-load 'ruby-mode '(inf-ruby-setup-keybindings))
;;;***
;;;### (autoloads nil nil ("inf-ruby-pkg.el") (20815 21577 72596
;;;;;; 0))
;;;***
(provide 'inf-ruby-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; inf-ruby-autoloads.el ends here

@ -1 +0,0 @@
(define-package "inf-ruby" "2.2.4" "Run a ruby process in a buffer" (quote nil))

@ -1,387 +0,0 @@
;;; inf-ruby.el --- Run a ruby process in a buffer
;; Copyright (C) 1999-2008 Yukihiro Matsumoto, Nobuyoshi Nakada
;; Author: Yukihiro Matsumoto, Nobuyoshi Nakada
;; URL: http://github.com/nonsequitur/inf-ruby
;; Created: 8 April 1998
;; Keywords: languages ruby
;; Version: 2.2.4
;;; Commentary:
;;
;; inf-ruby.el provides a REPL buffer connected to an IRB subprocess.
;;
;; If you're installing manually, you'll need to:
;; * drop the file somewhere on your load path (perhaps ~/.emacs.d)
;; * Add the following lines to your .emacs file:
;; (autoload 'inf-ruby "inf-ruby" "Run an inferior Ruby process" t)
;; (autoload 'inf-ruby-setup-keybindings "inf-ruby" "" t)
;; (eval-after-load 'ruby-mode
;; '(add-hook 'ruby-mode-hook 'inf-ruby-setup-keybindings))
;;; TODO:
;;
;; inferior-ruby-error-regexp-alist doesn't match this example
;; SyntaxError: /home/eschulte/united/org/work/arf/arf/lib/cluster.rb:35: syntax error, unexpected '~', expecting kEND
;; similarity = comparison_cache[m][n] ||= clusters[m] ~ clusters[n]
;;
;; M-p skips the first entry in the input ring.
;;
(require 'comint)
(require 'compile)
(require 'ruby-mode)
(defvar inf-ruby-default-implementation "ruby"
"Which ruby implementation to use if none is specified.")
(defvar inf-ruby-first-prompt-pattern "^irb(.*)[0-9:]+0> *"
"First prompt regex pattern of ruby interpreter.")
(defvar inf-ruby-prompt-pattern "^\\(irb(.*)[0-9:]+[>*\"'] *\\)+"
"Prompt regex pattern of ruby interpreter.")
(defvar inf-ruby-mode-hook nil
"*Hook for customising inf-ruby mode.")
(defvar inf-ruby-mode-map
(let ((map (copy-keymap comint-mode-map)))
(define-key map (kbd "C-c C-l") 'inf-ruby-load-file)
(define-key map (kbd "C-x C-e") 'ruby-send-last-sexp)
(define-key map (kbd "TAB") 'inf-ruby-complete)
map)
"*Mode map for inf-ruby-mode")
(defvar inf-ruby-implementations
'(("ruby" . "irb --inf-ruby-mode -r irb/completion")
("jruby" . "jruby -S irb -r irb/completion")
("rubinius" . "rbx -r irb/completion")
("yarv" . "irb1.9 --inf-ruby-mode -r irb/completion")) ;; TODO: ironruby?
"An alist of ruby implementations to irb executable names.")
;; TODO: do we need these two defvars?
(defvar ruby-source-modes '(ruby-mode)
"*Used to determine if a buffer contains Ruby source code.
If it's loaded into a buffer that is in one of these major modes, it's
considered a ruby source file by ruby-load-file.
Used by these commands to determine defaults.")
(defvar ruby-prev-l/c-dir/file nil
"Caches the last (directory . file) pair.
Caches the last pair used in the last ruby-load-file command.
Used for determining the default in the
next one.")
(defvar inf-ruby-at-top-level-prompt-p t)
(defconst inf-ruby-error-regexp-alist
'(("SyntaxError: compile error\n^\\([^\(].*\\):\\([1-9][0-9]*\\):" 1 2)
("^\tfrom \\([^\(].*\\):\\([1-9][0-9]*\\)\\(:in `.*'\\)?$" 1 2)))
;;;###autoload
(defun inf-ruby-setup-keybindings ()
"Set local key defs to invoke inf-ruby from ruby-mode."
(define-key ruby-mode-map "\M-\C-x" 'ruby-send-definition)
(define-key ruby-mode-map "\C-x\C-e" 'ruby-send-last-sexp)
(define-key ruby-mode-map "\C-c\C-b" 'ruby-send-block)
(define-key ruby-mode-map "\C-c\M-b" 'ruby-send-block-and-go)
(define-key ruby-mode-map "\C-c\C-x" 'ruby-send-definition)
(define-key ruby-mode-map "\C-c\M-x" 'ruby-send-definition-and-go)
(define-key ruby-mode-map "\C-c\C-r" 'ruby-send-region)
(define-key ruby-mode-map "\C-c\M-r" 'ruby-send-region-and-go)
(define-key ruby-mode-map "\C-c\C-z" 'ruby-switch-to-inf)
(define-key ruby-mode-map "\C-c\C-l" 'ruby-load-file)
(define-key ruby-mode-map "\C-c\C-s" 'inf-ruby))
(defvar inf-ruby-buffer nil "Current irb process buffer.")
(defun inf-ruby-mode ()
"Major mode for interacting with an inferior ruby (irb) process.
The following commands are available:
\\{inf-ruby-mode-map}
A ruby process can be fired up with M-x inf-ruby.
Customisation: Entry to this mode runs the hooks on comint-mode-hook and
inf-ruby-mode-hook (in that order).
You can send text to the inferior ruby process from other buffers containing
Ruby source.
ruby-switch-to-inf switches the current buffer to the ruby process buffer.
ruby-send-definition sends the current definition to the ruby process.
ruby-send-region sends the current region to the ruby process.
ruby-send-definition-and-go, ruby-send-region-and-go,
switch to the ruby process buffer after sending their text.
Commands:
Return after the end of the process' output sends the text from the
end of process to point.
Return before the end of the process' output copies the sexp ending at point
to the end of the process' output, and sends it.
Delete converts tabs to spaces as it moves back.
Tab indents for ruby; with arugment, shifts rest
of expression rigidly with the current line.
C-M-q does Tab on each line starting within following expression.
Paragraphs are separated only by blank lines. # start comments.
If you accidentally suspend your process, use \\[comint-continue-subjob]
to continue it."
(interactive)
(comint-mode)
(setq comint-prompt-regexp inf-ruby-prompt-pattern)
(ruby-mode-variables)
(setq major-mode 'inf-ruby-mode)
(setq mode-name "Inf-Ruby")
(setq mode-line-process '(":%s"))
(use-local-map inf-ruby-mode-map)
(setq comint-input-filter (function inf-ruby-input-filter))
(add-to-list 'comint-output-filter-functions 'inf-ruby-output-filter)
(setq comint-get-old-input (function inf-ruby-get-old-input))
(make-local-variable 'compilation-error-regexp-alist)
(setq compilation-error-regexp-alist inf-ruby-error-regexp-alist)
(compilation-shell-minor-mode t)
(run-hooks 'inf-ruby-mode-hook))
(defvar inf-ruby-filter-regexp "\\`\\s *\\S ?\\S ?\\s *\\'"
"*Input matching this regexp are not saved on the history list.
Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters.")
(defun inf-ruby-input-filter (str)
"Don't save anything matching inf-ruby-filter-regexp"
(not (string-match inf-ruby-filter-regexp str)))
(defun inf-ruby-output-filter (output)
"Check if the current prompt is a top-level prompt"
(setq inf-ruby-at-top-level-prompt-p
(string-match inf-ruby-prompt-pattern
(car (last (split-string output "\n"))))))
;; adapted from replace-in-string in XEmacs (subr.el)
(defun inf-ruby-remove-in-string (str regexp)
"Remove all matches in STR for REGEXP and returns the new string."
(let ((rtn-str "") (start 0) match prev-start)
(while (setq match (string-match regexp str start))
(setq prev-start start
start (match-end 0)
rtn-str (concat rtn-str (substring str prev-start match))))
(concat rtn-str (substring str start))))
(defun inf-ruby-get-old-input ()
"Snarf the sexp ending at point"
(save-excursion
(let ((end (point)))
(re-search-backward inf-ruby-first-prompt-pattern)
(inf-ruby-remove-in-string (buffer-substring (point) end)
inf-ruby-prompt-pattern))))
;;;###autoload
(defun inf-ruby (&optional impl)
"Run an inferior Ruby process in a buffer.
With prefix argument, prompts for which Ruby implementation
\(from the list `inf-ruby-implementations') to use. Runs the
hooks `inf-ruby-mode-hook' \(after the `comint-mode-hook' is
run)."
(interactive (list (if current-prefix-arg
(completing-read "Ruby Implementation: "
(mapc #'car inf-ruby-implementations))
inf-ruby-default-implementation)))
(setq impl (or impl "ruby"))
(let ((command (cdr (assoc impl inf-ruby-implementations))))
(run-ruby command impl)))
;;;###autoload
(defun run-ruby (&optional command name)
"Run an inferior Ruby process, input and output via buffer *ruby*.
If there is a process already running in `*ruby*', switch to that buffer.
With argument, allows you to edit the command line (default is value
of `ruby-program-name'). Runs the hooks `inferior-ruby-mode-hook'
\(after the `comint-mode-hook' is run).
\(Type \\[describe-mode] in the process buffer for a list of commands.)"
(interactive)
(setq command (or command (cdr (assoc inf-ruby-default-implementation
inf-ruby-implementations))))
(setq name (or name "ruby"))
(if (not (comint-check-proc inf-ruby-buffer))
(let ((commandlist (split-string-and-unquote command)))
(set-buffer (apply 'make-comint name (car commandlist)
nil (cdr commandlist)))
(inf-ruby-mode)))
(pop-to-buffer (setq inf-ruby-buffer (format "*%s*" name))))
(defun inf-ruby-proc ()
"Returns the current IRB process. See variable inf-ruby-buffer."
(or (get-buffer-process (if (eq major-mode 'inf-ruby-mode)
(current-buffer)
inf-ruby-buffer))
(error "No current process. See variable inf-ruby-buffer")))
;; These commands are added to the ruby-mode keymap:
(defconst ruby-send-terminator "--inf-ruby-%x-%d-%d-%d--"
"Template for irb here document terminator.
Must not contain ruby meta characters.")
(defconst inf-ruby-eval-binding "IRB.conf[:MAIN_CONTEXT].workspace.binding")
(defconst ruby-eval-separator "")
(defun ruby-send-region (start end)
"Send the current region to the inferior Ruby process."
(interactive "r")
(let (term (file (or buffer-file-name (buffer-name))) line)
(save-excursion
(save-restriction
(widen)
(goto-char start)
(setq line (+ start (forward-line (- start)) 1))
(goto-char start)
(while (progn
(setq term (apply 'format ruby-send-terminator (random) (current-time)))
(re-search-forward (concat "^" (regexp-quote term) "$") end t)))))
;; compilation-parse-errors parses from second line.
(save-excursion
(let ((m (process-mark (inf-ruby-proc))))
(set-buffer (marker-buffer m))
(goto-char m)
(insert ruby-eval-separator "\n")
(set-marker m (point))))
(comint-send-string (inf-ruby-proc) (format "eval <<'%s', %s, %S, %d\n"
term inf-ruby-eval-binding
file line))
(comint-send-region (inf-ruby-proc) start end)
(comint-send-string (inf-ruby-proc) (concat "\n" term "\n"))))
(defun ruby-send-definition ()
"Send the current definition to the inferior Ruby process."
(interactive)
(save-excursion
(ruby-end-of-defun)
(let ((end (point)))
(ruby-beginning-of-defun)
(ruby-send-region (point) end))))
(defun ruby-send-last-sexp ()
"Send the previous sexp to the inferior Ruby process."
(interactive)
(ruby-send-region (save-excursion (backward-sexp) (point)) (point)))
(defun ruby-send-block ()
"Send the current block to the inferior Ruby process."
(interactive)
(save-excursion
(ruby-end-of-block)
(end-of-line)
(let ((end (point)))
(ruby-beginning-of-block)
(ruby-send-region (point) end))))
(defun ruby-switch-to-inf (eob-p)
"Switch to the ruby process buffer.
With argument, positions cursor at end of buffer."
(interactive "P")
(if (get-buffer inf-ruby-buffer)
(pop-to-buffer inf-ruby-buffer)
(error "No current process buffer. See variable inf-ruby-buffer."))
(cond (eob-p
(push-mark)
(goto-char (point-max)))))
(defun ruby-send-region-and-go (start end)
"Send the current region to the inferior Ruby process.
Then switch to the process buffer."
(interactive "r")
(ruby-send-region start end)
(ruby-switch-to-inf t))
(defun ruby-send-definition-and-go ()
"Send the current definition to the inferior Ruby.
Then switch to the process buffer."
(interactive)
(ruby-send-definition)
(ruby-switch-to-inf t))
(defun ruby-send-block-and-go ()
"Send the current block to the inferior Ruby.
Then switch to the process buffer."
(interactive)
(ruby-send-block)
(ruby-switch-to-inf t))
(defun ruby-load-file (file-name)
"Load a Ruby file into the inferior Ruby process."
(interactive (comint-get-source "Load Ruby file: " ruby-prev-l/c-dir/file
ruby-source-modes t)) ;; T because LOAD needs an exact name
(comint-check-source file-name) ; Check to see if buffer needs saved.
(setq ruby-prev-l/c-dir/file (cons (file-name-directory file-name)
(file-name-nondirectory file-name)))
(comint-send-string (inf-ruby-proc) (concat "(load \""
file-name
"\"\)\n")))
(defun ruby-escape-single-quoted (str)
(replace-regexp-in-string "'" "\\\\'"
(replace-regexp-in-string "\n" "\\\\n"
(replace-regexp-in-string "\\\\" "\\\\\\\\" str))))
(defun inf-ruby-fix-completions-on-windows ()
"On Windows, the string received by `accept-process-output'
starts with the last line that was sent to the Ruby process.
The reason for this is unknown. Remove this line from `completions'."
(if (eq system-type 'windows-nt)
(setq completions (cdr completions))))
(defun inf-ruby-completions (seed)
"Return a list of completions for the line of ruby code starting with SEED."
(let* ((proc (get-buffer-process inf-ruby-buffer))
(comint-filt (process-filter proc))
(kept "") completions)
(set-process-filter proc (lambda (proc string) (setq kept (concat kept string))))
(process-send-string proc (format "puts IRB::InputCompletor::CompletionProc.call('%s').compact\n"
(ruby-escape-single-quoted seed)))
(while (and (not (string-match inf-ruby-prompt-pattern kept))
(accept-process-output proc 2)))
(setq completions (butlast (split-string kept "\r?\n") 2))
(inf-ruby-fix-completions-on-windows)
(set-process-filter proc comint-filt)
completions))
(defun inf-ruby-completion-at-point ()
(if inf-ruby-at-top-level-prompt-p
(let* ((curr (replace-regexp-in-string "\n$" "" (thing-at-point 'line)))
(completions (inf-ruby-completions curr)))
(if completions
(if (= (length completions) 1)
(car completions)
(completing-read "possible completions: "
completions nil t curr))))
(message "Completion aborted: Not at a top-level prompt")
nil))
(defun inf-ruby-complete (command)
"Complete the ruby code at point. Relies on the irb/completion
Module used by readline when running irb through a terminal"
(interactive (list (inf-ruby-completion-at-point)))
(when command
(kill-whole-line 0)
(insert command)))
(defun inf-ruby-complete-or-tab (&optional command)
"Either complete the ruby code at point or call
`indent-for-tab-command' if no completion is available."
(interactive (list (inf-ruby-completion-at-point)))
(if (not command)
(call-interactively 'indent-for-tab-command)
(inf-ruby-complete command)))
;;;###autoload
(eval-after-load 'ruby-mode
'(inf-ruby-setup-keybindings))
(provide 'inf-ruby)
;;; inf-ruby.el ends here

@ -1,83 +0,0 @@
;;; magit-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (magit-status) "magit" "magit.el" (20540 8920))
;;; Generated autoloads from magit.el
(autoload 'magit-status "magit" "\
Open a Magit status buffer for the Git repository containing
DIR. If DIR is not within a Git repository, offer to create a
Git repository in DIR.
Interactively, a prefix argument means to ask the user which Git
repository to use even if `default-directory' is under Git control.
Two prefix arguments means to ignore `magit-repo-dirs' when asking for
user input.
\(fn DIR)" t nil)
;;;***
;;;### (autoloads (turn-on-magit-stgit magit-stgit-mode) "magit-stgit"
;;;;;; "magit-stgit.el" (20540 8920))
;;; Generated autoloads from magit-stgit.el
(autoload 'magit-stgit-mode "magit-stgit" "\
StGit support for Magit
\(fn &optional ARG)" t nil)
(autoload 'turn-on-magit-stgit "magit-stgit" "\
Unconditionally turn on `magit-stgit-mode'.
\(fn)" nil nil)
;;;***
;;;### (autoloads (turn-on-magit-svn magit-svn-mode) "magit-svn"
;;;;;; "magit-svn.el" (20540 8920))
;;; Generated autoloads from magit-svn.el
(autoload 'magit-svn-mode "magit-svn" "\
SVN support for Magit
\(fn &optional ARG)" t nil)
(autoload 'turn-on-magit-svn "magit-svn" "\
Unconditionally turn on `magit-svn-mode'.
\(fn)" nil nil)
;;;***
;;;### (autoloads (turn-on-magit-topgit magit-topgit-mode) "magit-topgit"
;;;;;; "magit-topgit.el" (20540 8920))
;;; Generated autoloads from magit-topgit.el
(autoload 'magit-topgit-mode "magit-topgit" "\
Topgit support for Magit
\(fn &optional ARG)" t nil)
(autoload 'turn-on-magit-topgit "magit-topgit" "\
Unconditionally turn on `magit-topgit-mode'.
\(fn)" nil nil)
;;;***
;;;### (autoloads nil nil ("magit-bisect.el" "magit-key-mode.el"
;;;;;; "magit-pkg.el") (20540 8920 881666))
;;;***
(provide 'magit-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; magit-autoloads.el ends here

@ -1,196 +0,0 @@
(require 'magit)
(defvar magit--bisect-last-pos)
(defvar magit--bisect-tmp-file)
(defvar magit--bisect-info nil)
(make-variable-buffer-local 'magit--bisect-info)
(put 'magit--bisect-info 'permanent-local t)
(defun magit--bisecting-p (&optional required-status)
"Return t if a bisect session is running.
If REQUIRED-STATUS is not nil then the current status must also
match REQUIRED-STATUS."
(and (file-exists-p (concat (magit-get-top-dir default-directory)
".git/BISECT_LOG"))
(or (not required-status)
(eq (plist-get (magit--bisect-info) :status)
required-status))))
(defun magit--bisect-info ()
(with-current-buffer (magit-find-status-buffer)
(or (if (local-variable-p 'magit--bisect-info) magit--bisect-info)
(list :status (if (magit--bisecting-p) 'running 'not-running)))))
(defun magit--bisect-cmd (&rest args)
"Run `git bisect ...' and update the status buffer"
(with-current-buffer (magit-find-status-buffer)
(let* ((output (apply 'magit-git-lines (append '("bisect") args)))
(cmd (car args))
(first-line (car output)))
(save-match-data
(setq magit--bisect-info
(cond ((string= cmd "reset")
(list :status 'not-running))
;; Bisecting: 78 revisions left to test after this (roughly 6 steps)
((string-match "^Bisecting:\\s-+\\([0-9]+\\).+roughly\\s-+\\([0-9]+\\)" first-line)
(list :status 'running
:revs (match-string 1 first-line)
:steps (match-string 2 first-line)))
;; e2596955d9253a80aec9071c18079705597fa102 is the first bad commit
((string-match "^\\([a-f0-9]+\\)\\s-.*first bad commit" first-line)
(list :status 'finished
:bad (match-string 1 first-line)))
(t
(list :status 'error)))))))
(magit-refresh))
(defun magit--bisect-info-for-status (branch)
"Return bisect info suitable for display in the status buffer"
(let* ((info (magit--bisect-info))
(status (plist-get info :status)))
(cond ((eq status 'not-running)
(or branch "(detached)"))
((eq status 'running)
(format "(bisecting; %s revisions & %s steps left)"
(or (plist-get info :revs) "unknown number of")
(or (plist-get info :steps) "unknown number of")))
((eq status 'finished)
(format "(bisected: first bad revision is %s)" (plist-get info :bad)))
(t
"(bisecting; unknown error occured)"))))
(defun magit-bisect-start ()
"Start a bisect session"
(interactive)
(if (magit--bisecting-p)
(error "Already bisecting"))
(let ((bad (magit-read-rev "Start bisect with known bad revision" "HEAD"))
(good (magit-read-rev "Good revision" (magit-default-rev))))
(magit--bisect-cmd "start" bad good)))
(defun magit-bisect-reset ()
"Quit a bisect session"
(interactive)
(unless (magit--bisecting-p)
(error "Not bisecting"))
(magit--bisect-cmd "reset"))
(defun magit-bisect-good ()
"Tell git that the current revision is good during a bisect session"
(interactive)
(unless (magit--bisecting-p 'running)
(error "Not bisecting"))
(magit--bisect-cmd "good"))
(defun magit-bisect-bad ()
"Tell git that the current revision is bad during a bisect session"
(interactive)
(unless (magit--bisecting-p 'running)
(error "Not bisecting"))
(magit--bisect-cmd "bad"))
(defun magit-bisect-skip ()
"Tell git to skip the current revision during a bisect session."
(interactive)
(unless (magit--bisecting-p 'running)
(error "Not bisecting"))
(magit--bisect-cmd "skip"))
(defun magit-bisect-log ()
"Show the bisect log"
(interactive)
(unless (magit--bisecting-p)
(error "Not bisecting"))
(magit-run-git "bisect" "log")
(magit-display-process))
(defun magit-bisect-visualize ()
"Show the remaining suspects with gitk"
(interactive)
(unless (magit--bisecting-p)
(error "Not bisecting"))
(magit-run-git "bisect" "visualize")
(unless (getenv "DISPLAY")
(magit-display-process)))
(easy-mmode-defmap magit-bisect-minibuffer-local-map
'(("\C-i" . comint-dynamic-complete-filename))
"Keymap for minibuffer prompting of rebase command."
:inherit minibuffer-local-map)
(defvar magit-bisect-mode-history nil
"Previously run bisect commands.")
(defun magit-bisect-run (command)
"Bisect automatically by running commands after each step"
(interactive
(list
(read-from-minibuffer "Run command (like this): "
""
magit-bisect-minibuffer-local-map
nil
'magit-bisect-mode-history)))
(unless (magit--bisecting-p)
(error "Not bisecting"))
(let ((file (make-temp-file "magit-bisect-run"))
buffer)
(with-temp-buffer
(insert "#!/bin/sh\n" command "\n")
(write-region (point-min) (point-max) file))
(chmod file #o755)
(magit-run-git-async "bisect" "run" file)
(magit-display-process)
(setq buffer (get-buffer magit-process-buffer-name))
(with-current-buffer buffer
(set (make-local-variable 'magit--bisect-last-pos) 0)
(set (make-local-variable 'magit--bisect-tmp-file) file))
(set-process-filter (get-buffer-process buffer) 'magit--bisect-run-filter)
(set-process-sentinel (get-buffer-process buffer) 'magit--bisect-run-sentinel)))
(defun magit--bisect-run-filter (process output)
(with-current-buffer (process-buffer process)
(save-match-data
(let ((inhibit-read-only t)
line new-info)
(insert output)
(goto-char magit--bisect-last-pos)
(beginning-of-line)
(while (< (point) (point-max))
(cond ( ;; Bisecting: 78 revisions left to test after this (roughly 6 steps)
(looking-at "^Bisecting:\\s-+\\([0-9]+\\).+roughly\\s-+\\([0-9]+\\)")
(setq new-info (list :status 'running
:revs (match-string 1)
:steps (match-string 2))))
( ;; e2596955d9253a80aec9071c18079705597fa102 is the first bad commit
(looking-at "^\\([a-f0-9]+\\)\\s-.*first bad commit")
(setq new-info (list :status 'finished
:bad (match-string 1)))))
(forward-line 1))
(goto-char (point-max))
(setq magit--bisect-last-pos (point))
(if new-info
(with-current-buffer (magit-find-status-buffer)
(setq magit--bisect-info new-info)
(magit--bisect-update-status-buffer)))))))
(defun magit--bisect-run-sentinel (process event)
(if (string-match-p "^finish" event)
(with-current-buffer (process-buffer process)
(delete-file magit--bisect-tmp-file)))
(magit-process-sentinel process event))
(defun magit--bisect-update-status-buffer ()
(with-current-buffer (magit-find-status-buffer)
(save-excursion
(save-match-data
(let ((inhibit-read-only t))
(goto-char (point-min))
(when (search-forward-regexp "Local:" nil t)
(beginning-of-line)
(kill-line)
(insert (format "Local: %s %s"
(propertize (magit--bisect-info-for-status (magit-get-current-branch))
'face 'magit-branch)
(abbreviate-file-name default-directory)))))))))
(provide 'magit-bisect)

@ -1,508 +0,0 @@
(require 'magit)
(require 'assoc)
(eval-when-compile (require 'cl))
(defvar magit-key-mode-key-maps '()
"This will be filled lazily with proper `define-key' built
keymaps as they're requested.")
(defvar magit-key-mode-buf-name "*magit-key*"
"Name of the buffer.")
(defvar magit-key-mode-current-args '()
"Will contain the arguments to be passed to git.")
(defvar magit-key-mode-current-options '()
"Will contain the arguments to be passed to git.")
(defvar magit-log-mode-window-conf nil
"Will hold the pre-menu configuration of magit.")
(defvar magit-key-mode-groups
'((logging
(man-page "git-log")
(actions
("l" "Short" magit-log)
("L" "Long" magit-log-long)
("h" "Reflog" magit-reflog)
("rl" "Ranged short" magit-log-ranged)
("rL" "Ranged long" magit-log-long-ranged)
("rh" "Ranged reflog" magit-reflog-ranged))
(switches
("-m" "Only merge commits" "--merges")
("-f" "First parent" "--first-parent")
("-i" "Case insensitive patterns" "-i")
("-pr" "Pickaxe regex" "--pickaxe-regex")
("-n" "Name only" "--name-only")
("-am" "All match" "--all-match")
("-al" "All" "--all"))
(arguments
("=r" "Relative" "--relative=" read-directory-name)
("=c" "Committer" "--committer=" read-from-minibuffer)
("=>" "Since" "--since=" read-from-minibuffer)
("=<" "Before" "--before=" read-from-minibuffer)
("=s" "Pickaxe search" "-S" read-from-minibuffer)
("=a" "Author" "--author=" read-from-minibuffer)
("=g" "Grep" "--grep=" read-from-minibuffer)))
(running
(actions
("!" "Command from root" magit-shell-command)
(":" "Git command" magit-git-command)
("g" "git gui" magit-run-git-gui)
("k" "gitk" magit-run-gitk)))
(fetching
(man-page "git-fetch")
(actions
("f" "Current" magit-fetch-current)
("a" "All" magit-remote-update)
("o" "Other" magit-fetch))
(switches
("-p" "Prune" "--prune")))
(pushing
(man-page "git-push")
(actions
("P" "Push" magit-push)
("t" "Push tags" magit-push-tags))
(switches
("-f" "Force" "--force")
("-d" "Dry run" "-n")
("-u" "Set upstream" "-u")))
(pulling
(man-page "git-pull")
(actions
("F" "Pull" magit-pull))
(switches
("-r" "Rebase" "--rebase")))
(branching
(man-page "git-branch")
(actions
("v" "Branch manager" magit-show-branches)
("n" "New" magit-create-branch)
("m" "Move" magit-move-branch)
("d" "Delete" magit-delete-branch)
("D" "Force Delete" magit-delete-branch-forced)
("b" "Checkout" magit-checkout)))
(tagging
(man-page "git-tag")
(actions
("t" "Lightweight" magit-tag)
("a" "Annotated" magit-annotated-tag))
(switches
("-f" "Force" "-f")))
(stashing
(man-page "git-stash")
(actions
("z" "Save" magit-stash)
("s" "Snapshot" magit-stash-snapshot))
(switches
("-k" "Keep index" "--keep-index")))
(merging
(man-page "git-merge")
(actions
("m" "Merge" magit-merge))
(switches
("-ff" "Fast-forward only" "--ff-only")
("-nf" "No fast-forward" "--no-ff")
("-nc" "No commit" "--no-commit")
("-sq" "Squash" "--squash"))
(arguments
("-st" "Strategy" "--strategy=" read-from-minibuffer)))
(rewriting
(actions
("b" "Begin" magit-rewrite-start)
("s" "Stop" magit-rewrite-stop)
("a" "Abort" magit-rewrite-abort)
("f" "Finish" magit-rewrite-finish)
("*" "Set unused" magit-rewrite-set-unused)
("." "Set used" magit-rewrite-set-used)))
(submodule
(man-page "git-submodule")
(actions
("u" "Update" magit-submodule-update)
("b" "Both update and init" magit-submodule-update-init)
("i" "Init" magit-submodule-init)
("s" "Sync" magit-submodule-sync)))
(bisecting
(man-page "git-bisect")
(actions
("b" "Bad" magit-bisect-bad)
("g" "Good" magit-bisect-good)
("k" "Skip" magit-bisect-skip)
("l" "Log" magit-bisect-log)
("r" "Reset" magit-bisect-reset)
("s" "Start" magit-bisect-start)
("u" "Run" magit-bisect-run)
("v" "Visualize" magit-bisect-visualize))))
"Holds the key, help, function mapping for the log-mode. If you
modify this make sure you reset `magit-key-mode-key-maps' to
nil.")
(defun magit-key-mode-delete-group (group)
"Delete a group from `magit-key-mode-key-maps'."
(let ((items (assoc group magit-key-mode-groups)))
(when items
;; reset the cache
(setq magit-key-mode-key-maps nil)
;; delete the whole group
(setq magit-key-mode-groups
(delq items magit-key-mode-groups))
;; unbind the defun
(magit-key-mode-de-generate group))
magit-key-mode-groups))
(defun magit-key-mode-add-group (group)
"Add a new group to `magit-key-mode-key-maps'. If there's
already a group of that name then this will completely remove it
and put in its place an empty one of the same name."
(when (assoc group magit-key-mode-groups)
(magit-key-mode-delete-group group))
(setq magit-key-mode-groups
(cons (list group '(actions)) magit-key-mode-groups)))
(defun magit-key-mode-key-defined-p (for-group key)
"If KEY is defined as any of switch, argument or action within
FOR-GROUP then return t"
(catch 'result
(let ((options (magit-key-mode-options-for-group for-group)))
(dolist (type '(actions switches arguments))
(when (assoc key (assoc type options))
(throw 'result t))))))
(defun magit-key-mode-update-group (for-group thing &rest args)
"Abstraction for setting values in `magit-key-mode-key-maps'."
(let* ((options (magit-key-mode-options-for-group for-group))
(things (assoc thing options))
(key (car args)))
(if (cdr things)
(if (magit-key-mode-key-defined-p for-group key)
(error "%s is already defined in the %s group." key for-group)
(setcdr (cdr things) (cons args (cddr things))))
(setcdr things (list args)))
(setq magit-key-mode-key-maps nil)
things))
(defun magit-key-mode-insert-argument (for-group key desc arg read-func)
"Add a new binding (KEY) in FOR-GROUP which will use READ-FUNC
to receive input to apply to argument ARG git is run. DESC should
be a brief description of the binding."
(magit-key-mode-update-group for-group 'arguments key desc arg read-func))
(defun magit-key-mode-insert-switch (for-group key desc switch)
"Add a new binding (KEY) in FOR-GROUP which will add SWITCH to git's
command line when it runs. DESC should be a brief description of
the binding."
(magit-key-mode-update-group for-group 'switches key desc switch))
(defun magit-key-mode-insert-action (for-group key desc func)
"Add a new binding (KEY) in FOR-GROUP which will run command
FUNC. DESC should be a brief description of the binding."
(magit-key-mode-update-group for-group 'actions key desc func))
(defun magit-key-mode-options-for-group (for-group)
"Retrieve the options (switches, commands and arguments) for
the group FOR-GROUP."
(or (cdr (assoc for-group magit-key-mode-groups))
(error "Unknown group '%s'" for-group)))
(defun magit-key-mode-help (for-group)
"Provide help for a key (which the user is prompted for) within
FOR-GROUP."
(let* ((opts (magit-key-mode-options-for-group for-group))
(man-page (cadr (assoc 'man-page opts)))
(seq (read-key-sequence
(format "Enter command prefix%s: "
(if man-page
(format ", `?' for man `%s'" man-page)
""))))
(actions (cdr (assoc 'actions opts))))
(cond
;; if it is an action popup the help for the to-be-run function
((assoc seq actions) (describe-function (nth 2 (assoc seq actions))))
;; if there is "?" show a man page if there is one
((equal seq "?")
(if man-page
(man man-page)
(error "No man page associated with `%s'" for-group)))
(t (error "No help associated with `%s'" seq)))))
(defun magit-key-mode-exec-at-point ()
"Run action/args/option at point."
(interactive)
(let* ((key (or (get-text-property (point) 'key-group-executor)
(error "Nothing at point to do.")))
(def (lookup-key (current-local-map) key)))
(call-interactively def)))
(defun magit-key-mode-build-keymap (for-group)
"Construct a normal looking keymap for the key mode to use and
put it in magit-key-mode-key-maps for fast lookup."
(let* ((options (magit-key-mode-options-for-group for-group))
(actions (cdr (assoc 'actions options)))
(switches (cdr (assoc 'switches options)))
(arguments (cdr (assoc 'arguments options)))
(map (make-sparse-keymap)))
(suppress-keymap map 'nodigits)
;; ret dwim
(define-key map (kbd "RET") 'magit-key-mode-exec-at-point)
;; all maps should `quit' with `C-g' or `q'
(define-key map (kbd "C-g") `(lambda ()
(interactive)
(magit-key-mode-command nil)))
(define-key map (kbd "q") `(lambda ()
(interactive)
(magit-key-mode-command nil)))
;; run help
(define-key map (kbd "?") `(lambda ()
(interactive)
(magit-key-mode-help ',for-group)))
(flet ((defkey (k action)
(when (and (lookup-key map (car k))
(not (numberp (lookup-key map (car k)))))
(message "Warning: overriding binding for `%s' in %S"
(car k) for-group)
(ding)
(sit-for 2))
(define-key map (car k)
`(lambda () (interactive) ,action))))
(when actions
(dolist (k actions)
(defkey k `(magit-key-mode-command ',(nth 2 k)))))
(when switches
(dolist (k switches)
(defkey k `(magit-key-mode-add-option ',for-group ,(nth 2 k)))))
(when arguments
(dolist (k arguments)
(defkey k `(magit-key-mode-add-argument
',for-group ,(nth 2 k) ',(nth 3 k))))))
(aput 'magit-key-mode-key-maps for-group map)
map))
(defvar magit-key-mode-prefix nil
"For internal use. Holds the prefix argument to the command
that brought up the key-mode window, so it can be used by the
command that's eventually invoked.")
(defun magit-key-mode-command (func)
(let ((args '()))
;; why can't maphash return a list?!
(maphash (lambda (k v)
(push (concat k (shell-quote-argument v)) args))
magit-key-mode-current-args)
(let ((magit-custom-options (append args magit-key-mode-current-options))
(current-prefix-arg (or current-prefix-arg magit-key-mode-prefix)))
(set-window-configuration magit-log-mode-window-conf)
(when func
(call-interactively func))
(magit-key-mode-kill-buffer))))
(defvar magit-key-mode-current-args nil
"A hash-table of current argument set (which will eventually
make it to the git command-line).")
(defun magit-key-mode-add-argument (for-group arg-name input-func)
(let ((input (funcall input-func (concat arg-name ": "))))
(puthash arg-name input magit-key-mode-current-args)
(magit-key-mode-redraw for-group)))
(defvar magit-key-mode-current-options '()
"Current option set (which will eventually make it to the git
command-line).")
(defun magit-key-mode-add-option (for-group option-name)
"Toggles the appearance of OPTION-NAME in
`magit-key-mode-current-options'."
(if (not (member option-name magit-key-mode-current-options))
(add-to-list 'magit-key-mode-current-options option-name)
(setq magit-key-mode-current-options
(delete option-name magit-key-mode-current-options)))
(magit-key-mode-redraw for-group))
(defun magit-key-mode-kill-buffer ()
(interactive)
(kill-buffer magit-key-mode-buf-name))
(defvar magit-log-mode-window-conf nil
"Pre-popup window configuration.")
(defun magit-key-mode (for-group &optional original-opts)
"Mode for magit key selection. All commands, switches and
options can be toggled/actioned with the key combination
highlighted before the description."
(interactive)
;; save the window config to restore it as was (no need to make this
;; buffer local)
(setq magit-log-mode-window-conf
(current-window-configuration))
;; setup the mode, draw the buffer
(let ((buf (get-buffer-create magit-key-mode-buf-name)))
(delete-other-windows)
(split-window-vertically)
(other-window 1)
(switch-to-buffer buf)
(kill-all-local-variables)
(set (make-local-variable
'magit-key-mode-current-options)
original-opts)
(set (make-local-variable
'magit-key-mode-current-args)
(make-hash-table))
(set (make-local-variable 'magit-key-mode-prefix) current-prefix-arg)
(magit-key-mode-redraw for-group))
(message
(concat
"Type a prefix key to toggle it. Run 'actions' with their prefixes. "
"'?' for more help.")))
(defun magit-key-mode-get-key-map (for-group)
"Get or build the keymap for FOR-GROUP."
(or (cdr (assoc for-group magit-key-mode-key-maps))
(magit-key-mode-build-keymap for-group)))
(defun magit-key-mode-redraw (for-group)
"(re)draw the magit key buffer."
(let ((buffer-read-only nil)
(old-point (point)))
(erase-buffer)
(make-local-variable 'font-lock-defaults)
(use-local-map (magit-key-mode-get-key-map for-group))
(magit-key-mode-draw for-group)
(delete-trailing-whitespace)
(setq mode-name "magit-key-mode" major-mode 'magit-key-mode)
(goto-char old-point))
(setq buffer-read-only t)
(fit-window-to-buffer))
(defun magit-key-mode-draw-header (header)
"Draw a header with the correct face."
(insert (propertize header 'face 'font-lock-keyword-face)))
(defvar magit-key-mode-args-in-cols nil
"When true, draw arguments in columns as with switches and
options.")
(defun magit-key-mode-draw-args (args)
"Draw the args part of the menu."
(when args
(let ((strs (mapcar
(lambda (argument)
(propertize
(format " %s: %s (%s) %s"
(propertize
(car argument)
'face 'font-lock-builtin-face)
(nth 1 argument)
(nth 2 argument)
(propertize
(gethash (nth 2 argument)
magit-key-mode-current-args
"")
'face 'widget-field))
'key-group-executor (car argument)))
args)))
(magit-key-mode-draw-header "Args\n")
(magit-key-mode-draw-in-cols strs (not magit-key-mode-args-in-cols)))))
(defun magit-key-mode-draw-switches (switches)
"Draw the switches part of the menu."
(when switches
(let ((switch-strs (mapcar
(lambda (s)
(let ((option (nth 2 s)))
(propertize
(format " %s: %s (%s)"
(propertize (car s)
'face 'font-lock-builtin-face)
(nth 1 s)
(if (member option magit-key-mode-current-options)
(propertize
option
'face 'font-lock-warning-face)
option))
'key-group-executor (car s))))
switches)))
(magit-key-mode-draw-header "Switches\n")
(magit-key-mode-draw-in-cols switch-strs))))
(defun magit-key-mode-draw-actions (actions)
"Draw the actions part of the menu."
(when actions
(let ((action-strs (mapcar
(lambda (a)
(propertize
(format
" %s: %s"
(propertize (car a)
'face 'font-lock-builtin-face)
(nth 1 a))
'key-group-executor (car a)))
actions)))
(magit-key-mode-draw-header "Actions\n")
(magit-key-mode-draw-in-cols action-strs))))
(defun magit-key-mode-draw-in-cols (strings &optional one-col-each)
"Given a list of strings, print in columns (using `insert'). If
ONE-COL-EACH is true then don't columify, but rather, draw each
item on one line."
(let ((longest-act (apply 'max (mapcar 'length strings))))
(while strings
(let ((str (car strings)))
(let ((padding (make-string (- (+ longest-act 3) (length str)) ? )))
(insert str)
(if (or one-col-each
(and (> (+ (length padding) ;
(current-column)
longest-act)
(window-width))
(cdr strings)))
(insert "\n")
(insert padding))))
(setq strings (cdr strings))))
(insert "\n"))
(defun magit-key-mode-draw (for-group)
"Function used to draw actions, switches and parameters."
(let* ((options (magit-key-mode-options-for-group for-group))
(switches (cdr (assoc 'switches options)))
(arguments (cdr (assoc 'arguments options)))
(actions (cdr (assoc 'actions options))))
(magit-key-mode-draw-switches switches)
(magit-key-mode-draw-args arguments)
(magit-key-mode-draw-actions actions)
(insert "\n")))
(defun magit-key-mode-de-generate (group)
"Unbind the function for GROUP."
(fmakunbound
(intern (concat "magit-key-mode-popup-" (symbol-name group)))))
(defun magit-key-mode-generate (group)
"Generate the key-group menu for GROUP"
(let ((opts (magit-key-mode-options-for-group group)))
(eval
`(defun ,(intern (concat "magit-key-mode-popup-" (symbol-name group))) nil
,(concat "Key menu for " (symbol-name group))
(interactive)
(magit-key-mode (quote ,group))))))
;; create the interactive functions for the key mode popups (which are
;; applied in the top-level key maps)
(mapc (lambda (g)
(magit-key-mode-generate (car g)))
magit-key-mode-groups)
(provide 'magit-key-mode)

@ -1 +0,0 @@
(define-package "magit" "1.1.1" "Control Git from Emacs.")

@ -1,288 +0,0 @@
;;; magit-stgit.el --- StGit plug-in for Magit
;; Copyright (C) 2011 Lluis Vilanova
;;
;; 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 plug-in provides StGit functionality as a separate component of Magit.
;; Available actions:
;; - visit: Shows the patch at point in the series (stg show)
;; - apply: Goes to the patch at point in the series (stg goto)
;; - discard: Deletes the marked/at point patch in the series (stg delete)
;; Available commands:
;; - `magit-stgit-refresh': Refresh the marked/at point patch in the series
;; (stg refresh)
;; - `magit-stgit-repair': Repair the StGit metadata (stg repair)
;; - `magit-stgit-rebase': Rebase the whole series (stg rebase)
;; TODO:
;; - Let the user select which files must be included in a refresh.
;; - Missing actions for `magit-show-item-or-scroll-up' and
;; `magit-show-item-or-scroll-down'.
;; - Marking a patch is slow and refreshes all buffers, which resets their
;; position (i.e., the buffer is shown from its first line).
;;; Code:
(require 'magit)
(eval-when-compile
(require 'cl))
;;; Customizables:
(defcustom magit-stgit-executable "stg"
"The name of the StGit executable."
:group 'magit
:type 'string)
(defface magit-stgit-applied
'((t :inherit magit-diff-add))
"Face for an applied stgit patch."
:group 'magit-faces)
(defface magit-stgit-current
'((t :inherit magit-item-highlight))
"Face for the current stgit patch."
:group 'magit-faces)
(defface magit-stgit-other
'((t :inherit magit-diff-del))
"Face for a non-applied stgit patch."
:group 'magit-faces)
(defface magit-stgit-marked
'((t :inherit magit-item-mark))
"Face for a marked stgit patch."
:group 'magit-faces)
(defface magit-stgit-empty
'((t :inherit magit-item-mark))
"Face for an empty stgit patch."
:group 'magit-faces)
;;; Common code:
(defvar magit-stgit--enabled nil
"Whether this buffer has StGit support.")
(make-variable-buffer-local 'magit-stgit--enabled)
(defvar magit-stgit-mode)
(defun magit-stgit--enabled ()
"Whether this buffer has StGit support enabled."
(if (assoc 'magit-stgit--enabled (buffer-local-variables))
magit-stgit--enabled
(setq magit-stgit--enabled
(and magit-stgit-mode
(not (null
(member (concat (magit-get-current-branch) ".stgit")
(mapcar #'(lambda (line)
(string-match "^\\*?\s*\\([^\s]*\\)"
line)
(match-string 1 line))
(magit-git-lines "branch")))))))))
(defun magit-stgit--enabled-reset ()
"Reset the StGit enabled state."
(kill-local-variable 'magit-stgit--enabled))
(defvar magit-stgit--marked-patch nil
"The (per-buffer) currently marked patch in an StGit series.")
(make-variable-buffer-local 'magit-stgit--marked-patch)
;;; Menu:
(easy-menu-define magit-stgit-extension-menu
nil
"StGit extension menu"
'("StGit"
:active (magit-stgit--enabled)
["Refresh patch" magit-stgit-refresh
:help "Refresh the contents of a patch in an StGit series"]
["Repair" magit-stgit-repair
:help "Repair StGit metadata if branch was modified with git commands"]
["Rebase series" magit-stgit-rebase
:help "Rebase an StGit patch series"]
))
(easy-menu-add-item 'magit-mode-menu
'("Extensions")
magit-stgit-extension-menu)
;;; Series section:
(defun magit-stgit--wash-patch ()
(if (search-forward-regexp "^\\(.\\)\\(.\\) \\([^\s]*\\)\\(\s*# ?\\)\\(.*\\)"
(line-end-position) t)
(let* ((empty-str "[empty] ")
(indent-str (make-string (string-bytes empty-str) ?\ ))
(empty (match-string 1))
(state (match-string 2))
(patch (match-string 3))
(descr (match-string 5)))
(delete-region (line-beginning-position) (line-end-position))
(insert
(cond ((string= empty "0")
(propertize (concat empty-str " " state " " descr) 'face 'magit-stgit-empty))
((string= magit-stgit--marked-patch patch)
(propertize (concat indent-str " " state " " descr) 'face 'magit-stgit-marked))
((string= state "+")
(concat indent-str " " (propertize state 'face 'magit-stgit-applied) " " descr))
((string= state ">")
(propertize (concat indent-str " " state " " descr) 'face 'magit-stgit-current))
((string= state "-")
(concat indent-str " " (propertize state 'face 'magit-stgit-other) " " descr))))
(goto-char (line-beginning-position))
(magit-with-section patch 'series
(magit-set-section-info patch)
(goto-char (line-end-position)))
(forward-line))
(delete-region (line-beginning-position) (1+ (line-end-position))))
t)
(defun magit-stgit--wash-series ()
(let ((magit-old-top-section nil))
(magit-wash-sequence #'magit-stgit--wash-patch)))
(magit-define-inserter series ()
(when (executable-find magit-stgit-executable)
(magit-insert-section 'series
"Series:" 'magit-stgit--wash-series
magit-stgit-executable "series" "-a" "-d" "-e")))
;;; Actions:
;; Copy of `magit-refresh-commit-buffer' (version 1.0.0)
(defun magit-stgit--refresh-patch-buffer (patch)
(magit-create-buffer-sections
(magit-insert-section nil nil
'magit-wash-commit
magit-stgit-executable
"show"
patch)))
;; Copy of `magit-show-commit' (version 1.0.0)
(defun magit-stgit--show-patch (patch &optional scroll)
(when (magit-section-p patch)
(setq patch (magit-section-info patch)))
(let ((dir default-directory)
(buf (get-buffer-create magit-commit-buffer-name)))
(cond ((and (equal magit-currently-shown-commit patch)
;; if it's empty then the buffer was killed
(with-current-buffer buf
(> (length (buffer-string)) 1)))
(let ((win (get-buffer-window buf)))
(cond ((not win)
(display-buffer buf))
(scroll
(with-selected-window win
(funcall scroll))))))
(t
(setq magit-currently-shown-commit patch)
(display-buffer buf)
(with-current-buffer buf
(set-buffer buf)
(goto-char (point-min))
(magit-mode-init dir 'magit-commit-mode
#'magit-stgit--refresh-patch-buffer patch))))))
(magit-add-action (item info "visit")
((series)
(magit-stgit--show-patch info)
(pop-to-buffer magit-commit-buffer-name)))
(magit-add-action (item info "apply")
((series)
(magit-run magit-stgit-executable "goto" info)))
(magit-add-action (item info "discard")
((series)
(let ((patch (or magit-stgit--marked-patch info)))
(if (yes-or-no-p (format "Delete patch '%s' in series? " patch))
(progn
(if (string= magit-stgit--marked-patch patch)
(setq magit-stgit--marked-patch nil))
(magit-run magit-stgit-executable "delete" patch))))))
(defun magit-stgit--set-marked-patch (patch)
(setq magit-stgit--marked-patch
(if (string= magit-stgit--marked-patch patch)
nil
patch)))
(magit-add-action (item info "mark")
((series)
(magit-stgit--set-marked-patch info)
(magit-refresh-all)))
;;; Commands:
(defun magit-stgit-refresh ()
"Refresh the contents of a patch in an StGit series.
If there is no marked patch in the series, refreshes the current
patch.
Otherwise, refreshes the marked patch."
(interactive)
(if magit-stgit--marked-patch
(magit-run magit-stgit-executable "refresh" "-p" magit-stgit--marked-patch)
(magit-run magit-stgit-executable "refresh")))
(defun magit-stgit-repair ()
"Repair StGit metadata if branch was modified with git commands.
In the case of Git commits these will be imported as new patches
into the series."
(interactive)
(message "Repairing series...")
(magit-run magit-stgit-executable "repair")
(message ""))
(defun magit-stgit-rebase ()
"Rebase an StGit patch series."
(interactive)
(if (magit-get-current-remote)
(progn
(if (yes-or-no-p "Update remotes? ")
(progn
(message "Updating remotes...")
(magit-run-git-async "remote" "update")))
(magit-run magit-stgit-executable "rebase"
(format "remotes/%s/%s"
(magit-get-current-remote)
(magit-get-current-branch))))))
;;;###autoload
(define-minor-mode magit-stgit-mode "StGit support for Magit"
:lighter " Stg" :require 'magit-stgit
(or (derived-mode-p 'magit-mode)
(error "This mode only makes sense with magit"))
(if magit-stgit-mode
(progn
(add-hook 'magit-after-insert-stashes-hook 'magit-insert-series nil t))
(progn
(remove-hook 'magit-after-insert-stashes-hook 'magit-insert-series t)))
(when (called-interactively-p 'any)
(magit-refresh)))
;;;###autoload
(defun turn-on-magit-stgit ()
"Unconditionally turn on `magit-stgit-mode'."
(magit-stgit-mode 1))
(provide 'magit-stgit)
;;; magit-stgit.el ends here

@ -1,240 +0,0 @@
;;; magit-svn.el --- git-svn plug-in for Magit
;; Copyright (C) 2008 Alex Ott
;; Copyright (C) 2009 Alexey Voinov
;; Copyright (C) 2009 John Wiegley
;; Copyright (C) 2008 Linh Dang
;; Copyright (C) 2008 Marcin Bachry
;; Copyright (C) 2008, 2009 Marius Vollmer
;; Copyright (C) 2010 Yann Hodique
;;
;; 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 plug-in provides git-svn functionality as a separate component of Magit
;;; Code:
(require 'magit)
(eval-when-compile
(require 'cl))
;; git svn commands
(defun magit-svn-find-rev (rev &optional branch)
(interactive
(list (read-string "SVN revision: ")
(if current-prefix-arg
(read-string "In branch: "))))
(let* ((sha (apply 'magit-git-string
`("svn"
"find-rev"
,(concat "r" rev)
,@(when branch (list branch))))))
(if sha
(magit-show-commit
(magit-with-section sha 'commit
(magit-set-section-info sha)
sha))
(error "Revision %s could not be mapped to a commit" rev))))
(defun magit-svn-create-branch (name)
(interactive "sBranch name: ")
(magit-run-git "svn" "branch" name))
(defun magit-svn-rebase ()
(interactive)
(magit-run-git-async "svn" "rebase"))
(defun magit-svn-dcommit ()
(interactive)
(magit-run-git-async "svn" "dcommit"))
(defun magit-svn-enabled ()
(not (null (magit-svn-get-ref-info t))))
(defun magit-svn-expand-braces-in-branches (branch)
(if (not (string-match "\\(.+\\){\\(.+,.+\\)}\\(.*\\):\\(.*\\)\\\*" branch))
(list branch)
(let ((prefix (match-string 1 branch))
(suffix (match-string 3 branch))
(rhs (match-string 4 branch))
(pieces (split-string (match-string 2 branch) ",")))
(mapcar (lambda (p) (concat prefix p suffix ":" rhs p)) pieces))))
(defun magit-svn-get-local-ref (url)
(let* ((branches (cons (magit-get "svn-remote" "svn" "fetch")
(magit-get-all "svn-remote" "svn" "branches")))
(branches (apply 'nconc
(mapcar 'magit-svn-expand-braces-in-branches
branches)))
(base-url (magit-get "svn-remote" "svn" "url"))
(result nil))
(while branches
(let* ((pats (split-string (pop branches) ":"))
(src (replace-regexp-in-string "\\*" "\\\\(.*\\\\)" (car pats)))
(dst (replace-regexp-in-string "\\*" "\\\\1" (cadr pats)))
(base-url (replace-regexp-in-string "\\+" "\\\\+" base-url))
(base-url (replace-regexp-in-string "//.+@" "//" base-url))
(pat1 (concat "^" src "$"))
(pat2 (cond ((equal src "") (concat "^" base-url "$"))
(t (concat "^" base-url "/" src "$")))))
(cond ((string-match pat1 url)
(setq result (replace-match dst nil nil url))
(setq branches nil))
((string-match pat2 url)
(setq result (replace-match dst nil nil url))
(setq branches nil)))))
result))
(defvar magit-svn-get-ref-info-cache nil
"A cache for svn-ref-info.
As `magit-get-svn-ref-info' might be considered a quite
expensive operation a cache is taken so that `magit-status'
doesn't repeatedly call it.")
(defun magit-svn-get-ref-info (&optional use-cache)
"Gather details about the current git-svn repository.
Return nil if there isn't one. Keys of the alist are ref-path,
trunk-ref-name and local-ref-name.
If USE-CACHE is non-nil then return the value of `magit-get-svn-ref-info-cache'."
(if (and use-cache magit-svn-get-ref-info-cache)
magit-svn-get-ref-info-cache
(let* ((fetch (magit-get "svn-remote" "svn" "fetch"))
(url)
(revision))
(when fetch
(let* ((ref (cadr (split-string fetch ":")))
(ref-path (file-name-directory ref))
(trunk-ref-name (file-name-nondirectory ref)))
(set (make-local-variable
'magit-svn-get-ref-info-cache)
(list
(cons 'ref-path ref-path)
(cons 'trunk-ref-name trunk-ref-name)
;; get the local ref from the log. This is actually
;; the way that git-svn does it.
(cons 'local-ref
(with-temp-buffer
(insert (or (magit-git-string "log" "--first-parent"
"--grep" "git-svn" "-1")
""))
(goto-char (point-min))
(cond ((re-search-forward "git-svn-id: \\(.+/.+?\\)@\\([0-9]+\\)" nil t)
(setq url (match-string 1)
revision (match-string 2))
(magit-svn-get-local-ref url))
(t
(setq url (magit-get "svn-remote" "svn" "url"))
nil))))
(cons 'revision revision)
(cons 'url url))))))))
(defun magit-svn-get-ref (&optional use-cache)
"Get the best guess remote ref for the current git-svn based branch.
If USE-CACHE is non nil, use the cached information."
(let ((info (magit-svn-get-ref-info use-cache)))
(cdr (assoc 'local-ref info))))
(magit-define-inserter svn-unpulled (&optional use-cache)
(when (magit-svn-enabled)
(apply #'magit-git-section
'svn-unpulled "Unpulled commits (SVN):" 'magit-wash-log "log"
(append magit-git-log-options
(list
(format "HEAD..%s" (magit-svn-get-ref use-cache)))))))
(magit-define-inserter svn-unpushed (&optional use-cache)
(when (magit-svn-enabled)
(apply #'magit-git-section
'svn-unpushed "Unpushed commits (SVN):" 'magit-wash-log "log"
(append magit-git-log-options
(list
(format "%s..HEAD" (magit-svn-get-ref use-cache)))))))
(magit-define-section-jumper svn-unpushed "Unpushed commits (SVN)")
(defun magit-svn-remote-string ()
(let ((svn-info (magit-svn-get-ref-info)))
(when svn-info
(concat (cdr (assoc 'url svn-info))
" @ "
(cdr (assoc 'revision svn-info))))))
(defun magit-svn-remote-update ()
(interactive)
(when (magit-svn-enabled)
(magit-run-git-async "svn" "fetch")))
(easy-menu-define magit-svn-extension-menu
nil
"Git SVN extension menu"
'("Git SVN"
:visible magit-svn-mode
["Create branch" magit-svn-create-branch (magit-svn-enabled)]
["Rebase" magit-svn-rebase (magit-svn-enabled)]
["Fetch" magit-svn-remote-update (magit-svn-enabled)]
["Commit" magit-svn-dcommit (magit-svn-enabled)]))
(easy-menu-add-item 'magit-mode-menu
'("Extensions")
magit-svn-extension-menu)
;; add the group and its keys
(progn
;; (re-)create the group
(magit-key-mode-add-group 'svn)
(magit-key-mode-insert-action 'svn "r" "Rebase" 'magit-svn-rebase)
(magit-key-mode-insert-action 'svn "c" "DCommit" 'magit-svn-dcommit)
(magit-key-mode-insert-action 'svn "f" "Fetch" 'magit-svn-remote-update)
(magit-key-mode-insert-action 'svn "s" "Find rev" 'magit-svn-find-rev)
(magit-key-mode-insert-action 'svn "B" "Create branch" 'magit-svn-create-branch)
;; generate and bind the menu popup function
(magit-key-mode-generate 'svn))
(defvar magit-svn-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "N") 'magit-key-mode-popup-svn)
map))
;;;###autoload
(define-minor-mode magit-svn-mode "SVN support for Magit"
:lighter " SVN" :require 'magit-svn :keymap 'magit-svn-mode-map
(or (derived-mode-p 'magit-mode)
(error "This mode only makes sense with magit"))
(let ((unpulled-hook (lambda () (magit-insert-svn-unpulled t)))
(unpushed-hook (lambda () (magit-insert-svn-unpushed t)))
(remote-hook 'magit-svn-remote-string))
(if magit-svn-mode
(progn
(add-hook 'magit-after-insert-unpulled-commits-hook unpulled-hook nil t)
(add-hook 'magit-after-insert-unpushed-commits-hook unpushed-hook nil t)
(add-hook 'magit-remote-string-hook remote-hook nil t))
(progn
(remove-hook 'magit-after-insert-unpulled-commits-hook unpulled-hook t)
(remove-hook 'magit-after-insert-unpushed-commits-hook unpushed-hook t)
(remove-hook 'magit-remote-string-hook remote-hook t)))
(when (called-interactively-p 'any)
(magit-refresh))))
;;;###autoload
(defun turn-on-magit-svn ()
"Unconditionally turn on `magit-svn-mode'."
(magit-svn-mode 1))
(provide 'magit-svn)
;;; magit-svn.el ends here

@ -1,191 +0,0 @@
;;; magit-topgit.el --- topgit plug-in for Magit
;; Copyright (C) 2010 Nathan Weizenbaum
;; Copyright (C) 2010 Yann Hodique
;;
;; 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 plug-in provides topgit functionality as a separate component of Magit
;;; Code:
(require 'magit)
(eval-when-compile
(require 'cl))
(defcustom magit-topgit-executable "tg"
"The name of the TopGit executable."
:group 'magit
:type 'string)
(defcustom magit-topgit-branch-prefix "t/"
"Convention prefix for topic branch creation."
:group 'magit
:type 'string)
(defface magit-topgit-current
'((t :weight bold :inherit magit-branch))
"Face for section titles."
:group 'magit-faces)
;;; Topic branches (using topgit)
(defun magit-topgit-in-topic-p ()
(and (file-exists-p ".topdeps")
(executable-find magit-topgit-executable)))
(defun magit-topgit-create-branch (branch parent)
(when (zerop (or (string-match magit-topgit-branch-prefix branch) -1))
(magit-run* (list magit-topgit-executable "create"
branch (magit-rev-to-git parent))
nil nil nil t)
t))
(defun magit-topgit-pull ()
(when (magit-topgit-in-topic-p)
(magit-run* (list magit-topgit-executable "update")
nil nil nil t)
t))
(defun magit-topgit-push ()
(when (magit-topgit-in-topic-p)
(let* ((branch (or (magit-get-current-branch)
(error "Don't push a detached head. That's gross")))
(remote (magit-get "topgit" "remote"))
(push-remote (if (or current-prefix-arg (not remote))
(magit-read-remote (format "Push %s to" branch))
remote)))
(when (and (not remote)
(not current-prefix-arg))
(magit-set push-remote "topgit" "remote"))
(magit-run magit-topgit-executable "push" "-r" push-remote))
t))
(defun magit-topgit-remote-update (&optional remote)
(when (magit-topgit-in-topic-p)
(let* ((remote (magit-get "topgit" "remote"))
(remote-update (if (or current-prefix-arg (not remote))
(magit-read-remote)
remote)))
(if (and (not remote)
(not current-prefix-arg))
(progn
(magit-set remote-update "topgit" "remote")
(magit-run magit-topgit-executable "remote"
"--populate" remote-update)))
(magit-run magit-topgit-executable "remote" remote-update))
;; We return nil anyway, as we also want regular "git remote update" to
;; happen
nil))
(defun magit-topgit-parse-flags (flags-string)
(let ((flags (string-to-list flags-string))
(void-flag ?\ ))
(list :current (not (eq (nth 0 flags) void-flag))
:empty (not (eq (nth 1 flags) void-flag)))))
(defun magit-topgit-wash-topic ()
(let ((fmt "^\\(.\\{7\\}\\)\\s-\\(\\S-+\\)\\s-+\\(.*\\)"))
(if (search-forward-regexp fmt (line-end-position) t)
(let ((flags (magit-topgit-parse-flags (match-string 1)))
(topic (match-string 2)))
(goto-char (line-beginning-position))
(delete-char 8)
(insert "\t")
(goto-char (line-beginning-position))
(magit-with-section topic 'topic
(magit-set-section-info topic)
(let ((beg (1+ (line-beginning-position)))
(end (line-end-position)))
(when (plist-get flags :current)
(put-text-property beg end 'face 'magit-topgit-current))
(when (plist-get flags :empty)
(put-text-property beg end 'face `(:strike-through t :inherit ,(get-text-property beg 'face)))))
(forward-line)))
(delete-region (line-beginning-position) (1+ (line-end-position))))
t))
(defun magit-topgit-wash-topics ()
(let ((magit-old-top-section nil))
(magit-wash-sequence #'magit-topgit-wash-topic)))
(defun magit-topgit-section (section title washer &rest args)
(when (executable-find magit-topgit-executable)
(let ((magit-git-executable magit-topgit-executable)
(magit-git-standard-options nil))
(apply 'magit-git-section section title washer args))))
(magit-define-inserter topics ()
(magit-topgit-section 'topics
"Topics:" 'magit-topgit-wash-topics
"summary"))
(magit-add-action (item info "discard")
((topic)
(when (yes-or-no-p "Discard topic? ")
(magit-run* (list magit-topgit-executable "delete" "-f" info)
nil nil nil t))))
(magit-add-action (item info "visit")
((topic)
(magit-checkout info)))
(defun magit-topgit-get-top-bases-color (suffix)
(list nil nil))
(defun magit-topgit-get-remote-top-bases-color (suffix)
(when (string-match "^\\(?:[^/]+\\)/top-bases" suffix)
(list nil nil)))
(defconst magit-topgit-ignored-namespace
'("top-bases" magit-topgit-get-top-bases-color))
;;;###autoload
(define-minor-mode magit-topgit-mode "Topgit support for Magit"
:lighter " Topgit" :require 'magit-topgit
(or (derived-mode-p 'magit-mode)
(error "This mode only makes sense with magit"))
(if magit-topgit-mode
(progn
(add-hook 'magit-after-insert-stashes-hook 'magit-insert-topics nil t)
(add-hook 'magit-create-branch-command-hook 'magit-topgit-create-branch nil t)
(add-hook 'magit-pull-command-hook 'magit-topgit-pull nil t)
(add-hook 'magit-remote-update-command-hook 'magit-topgit-remote-update nil t)
(add-hook 'magit-push-command-hook 'magit-topgit-push nil t)
;; hide refs for top-bases namespace in any remote
(add-hook 'magit-log-remotes-color-hook
'magit-topgit-get-remote-top-bases-color)
;; hide refs in the top-bases namespace, as they're not meant for the user
(add-to-list 'magit-refs-namespaces magit-topgit-ignored-namespace))
(progn
(remove-hook 'magit-after-insert-stashes-hook 'magit-insert-topics t)
(remove-hook 'magit-create-branch-command-hook 'magit-topgit-create-branch t)
(remove-hook 'magit-pull-command-hook 'magit-topgit-pull t)
(remove-hook 'magit-remote-update-command-hook 'magit-topgit-remote-update t)
(remove-hook 'magit-push-command-hook 'magit-topgit-push t)
(remove-hook 'magit-log-remotes-color-hook
'magit-topgit-get-remote-top-bases-color)
(delete magit-topgit-ignored-namespace magit-refs-namespaces)))
(when (called-interactively-p 'any)
(magit-refresh)))
;;;###autoload
(defun turn-on-magit-topgit ()
"Unconditionally turn on `magit-topgit-mode'."
(magit-topgit-mode 1))
(provide 'magit-topgit)
;;; magit-topgit.el ends here

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,47 +0,0 @@
;;; mo-git-blame-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (mo-git-blame-current mo-git-blame-file) "mo-git-blame"
;;;;;; "mo-git-blame.el" (20540 9020))
;;; Generated autoloads from mo-git-blame.el
(autoload 'mo-git-blame-file "mo-git-blame" "\
Calls `git blame' for REVISION of FILE-NAME or `HEAD' if
REVISION is not given. Initializes the two windows that will show
the output of 'git blame' and the content.
If FILE-NAME is missing it will be read with `find-file' in
interactive mode.
ORIGINAL-FILE-NAME defaults to FILE-NAME if not given. This is
used for tracking renaming and moving of files during iterative
re-blaming.
With a numeric prefix argument or with NUM-LINES-TO-BLAME only
the NUM-LINES-TO-BLAME lines before and after point are blamed by
using git blame's `-L' option. Otherwise the whole file is
blamed.
\(fn &optional FILE-NAME REVISION ORIGINAL-FILE-NAME NUM-LINES-TO-BLAME)" t nil)
(autoload 'mo-git-blame-current "mo-git-blame" "\
Calls `mo-git-blame-file' for HEAD for the current buffer.
\(fn)" t nil)
;;;***
;;;### (autoloads nil nil ("mo-git-blame-pkg.el") (20540 9020 314042))
;;;***
(provide 'mo-git-blame-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; mo-git-blame-autoloads.el ends here

@ -1 +0,0 @@
(define-package "mo-git-blame" "0.1.0" "An interactive, iterative 'git blame' mode for Emacs" (quote nil))

@ -1,762 +0,0 @@
;;; mo-git-blame.el --- An interactive, iterative 'git blame' mode for Emacs
;; Copyright (C) 2009, 2010 Moritz Bunkus <moritz@bunkus.org>
;; Copyright (C) 2010 `tpán Nmec <stepnem@gmail.com>
;; Author: Moritz Bunkus <moritz@bunkus.org>
;; Maintainer: Moritz Bunkus <moritz@bunkus.org>
;; Version: 0.1.0
;; Keywords: tools
;; URL: https://github.com/mbunkus/mo-git-blame
;; mo-git-blame 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.
;;
;; mo-git-blame 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.
;;; Installation:
;;;
;;; Put this file somewhere in your load-path or add the directory it
;;; is in to it, e.g.:
;;;
;;; (add-to-list 'load-path "~/.emacs.d/mo-git-blame")
;;;
;;; Then add two autoload definitions:
;;;
;;; (autoload 'mo-git-blame-file "mo-git-blame" nil t)
;;; (autoload 'mo-git-blame-current "mo-git-blame" nil t)
(require 'cl)
(require 'easymenu)
(defvar mo-git-blame-vars nil
"Buffer-local plist that stores various variables needed for
interactive use, e.g. the file name, current revision etc.")
(defvar mo-git-blame--wincfg nil)
(defvar mo-git-blame-mode-map
(let ((map (make-keymap)))
(suppress-keymap map t)
(define-key map (kbd "a") 'mo-git-blame-reblame-for-ancestor-of-revision-at)
(define-key map (kbd "A") 'mo-git-blame-reblame-for-ancestor-of-current-revision)
(define-key map (kbd "b") 'mo-git-blame-reblame-for-revision-at)
(define-key map (kbd "B") 'mo-git-blame-reblame-for-specific-revision)
(define-key map (kbd "c") 'mo-git-blame-content-for-revision-at)
(define-key map (kbd "i") 'mo-git-blame-display-info)
(define-key map (kbd "l") 'mo-git-blame-log-for-revision-at)
(define-key map (kbd "L") 'mo-git-blame-log-for-current-revision)
(define-key map (kbd "o") 'mo-git-blame-overwrite-file-with-revision-at)
(define-key map (kbd "O") 'mo-git-blame-overwrite-file-with-current-revision)
(define-key map (kbd "p") 'mo-git-blame-reblame-for-prior-revision)
(define-key map (kbd "q") 'mo-git-blame-quit)
(define-key map (kbd "s") 'mo-git-blame-show-revision-at)
(define-key map (kbd "S") 'mo-git-blame-show-current-revision)
(define-key map (kbd "RET") 'mo-git-blame-show-revision-at)
(define-key map (kbd "TAB") 'mo-git-blame-display-content-buffer)
(define-key map [?\C-x ?k] 'mo-git-blame-quit)
(define-key map [?\C-x ?\C-l] 'mo-git-blame-goto-line)
map)
"The mode map for the blame output window of mo-git-blame-mode.")
(defvar mo-git-blame-content-mode-map
(let ((map (make-keymap)))
(suppress-keymap map t)
(define-key map (kbd "A") 'mo-git-blame-reblame-for-ancestor-of-current-revision)
(define-key map (kbd "B") 'mo-git-blame-reblame-for-specific-revision)
(define-key map (kbd "i") 'mo-git-blame-display-info)
(define-key map (kbd "L") 'mo-git-blame-log-for-current-revision)
(define-key map (kbd "O") 'mo-git-blame-overwrite-file-with-current-revision)
(define-key map (kbd "q") 'mo-git-blame-quit)
(define-key map (kbd "S") 'mo-git-blame-show-current-revision)
(define-key map [?\C-x ?k] 'mo-git-blame-quit)
(define-key map [?\C-x ?\C-l] 'mo-git-blame-goto-line)
map)
"The mode map for the content window of mo-git-blame-mode.")
(easy-menu-define mo-git-blame-mode-menu mo-git-blame-mode-map
"MoGitBlame menu"
'("MoGitBlame"
["Re-blame for revision at point" mo-git-blame-reblame-for-revision-at t]
["Re-blame for ancestor of revision at point" mo-git-blame-reblame-for-ancestor-of-revision-at-point t]
["Raw content for revision at point" mo-git-blame-content-for-revision-at t]
["Log for revision at point" mo-git-blame-log-for-revision-at t]
["Overwrite file with revision at point" mo-git-blame-overwrite-file-with-revision-at t]
["'git show' for revision at point" mo-git-blame-show-revision-at t]
"---"
["Re-blame for ancestor of current revision" mo-git-blame-reblame-for-ancestor-of-current-revision t]
["Log for current revision" mo-git-blame-log-for-current-revision t]
["Overwrite file with current revision" mo-git-blame-overwrite-file-with-current-revision t]
["'git show' for current revision" mo-git-blame-show-current-revision t]
"---"
["Re-blame for prior revision" mo-git-blame-reblame-for-prior-revision t]
["Re-blame for a specific revision" mo-git-blame-reblame-for-specific-revision t]
"---"
["Display status information" mo-git-blame-display-info t]
["Display content buffer" mo-git-blame-display-content-buffer t]
"---"
["Exit MoGitBlame" mo-git-blame-quit t]))
(defgroup mo-git-blame nil
"Interactively use Git's 'blame' from Emacs."
:prefix "mo-git-blame-"
:group 'tools)
(defcustom mo-git-blame-git-executable "git"
"The name of the Git executable."
:group 'mo-git-blame
:type 'string)
(defcustom mo-git-blame-incremental t
"Runs `git blame' in the background with the --incremental
option if this variable is non-nil."
:group 'mo-git-blame
:type '(choice (const :tag "Use --incremental" t)
(const :tag "Don't use --incremental" nil)))
(defcustom mo-git-blame-blame-window-width 45
"The width of the 'blame' window leaving the rest for the
'content' window."
:group 'mo-git-blame
:type 'integer)
(defcustom mo-git-blame-use-ido 'if-available
"Controls whether or not ido will be used. Possible choices:
`never' -- do not use ido even if it is loaded
`if-available' -- use ido if it has been loaded before
`always' -- automatically load ido and use it"
:group 'mo-git-blame
:type '(choice (const :tag "Always" always)
(const :tag "If available" if-available)
(const :tag "Never" never)))
;; This function was taken from magit (called 'magit-trim-line' there).
(defun mo-git-blame-trim-line (str)
(cond ((string= str "")
nil)
((equal (elt str (- (length str) 1)) ?\n)
(substring str 0 (- (length str) 1)))
(t str)))
;; This function was taken from magit (called 'magit-git-output' there).
(defun mo-git-blame-git-output (args)
(with-output-to-string
(with-current-buffer standard-output
(apply #'process-file
mo-git-blame-git-executable
nil (list t nil) nil
args))))
;; This function was taken from magit (called 'magit-git-string' there).
(defun mo-git-blame-git-string (&rest args)
(mo-git-blame-trim-line (mo-git-blame-git-output args)))
(defun mo-git-blame-get-top-dir (cwd)
(let ((cwd (expand-file-name cwd))
git-dir)
(setq git-dir
(or (getenv "GIT_WORK_TREE")
(if (file-directory-p cwd)
(let* ((default-directory cwd)
(dir (mo-git-blame-git-string "rev-parse" "--git-dir"))
(dir (if dir (file-name-directory (expand-file-name dir)) "")))
(if (and dir (file-directory-p dir))
(file-name-as-directory dir))))))
(or git-dir
(error "No Git repository found"))))
(defun mo-git-blame-run (&rest args)
(message "Running 'git %s'..." (car args))
(apply 'call-process mo-git-blame-git-executable nil (current-buffer) nil args)
(message "Running 'git %s'... done" (car args)))
(defvar mo-git-blame-process nil)
(defvar mo-git-blame-client-buffer nil)
(defun mo-git-blame-assert-not-running ()
"Exits with an error if `mo-git-blame-incremental' is true and
git is already/still running."
(if (and mo-git-blame-incremental
mo-git-blame-process
(get-buffer "*mo-git-blame-process*"))
(error "Git is already running")))
(defun mo-git-blame-process-sentinel (process event)
(let ((msg (format "Git %s." (substring event 0 -1)))
(successp (string-match "^finished" event)))
(with-current-buffer (process-buffer process)
(let ((inhibit-read-only t))
(goto-char (point-max))
(insert msg "\n")
(message msg)))
(setq mo-git-blame-process nil)
(message "Running 'git blame'... done")))
(defun mo-git-blame-commit-info-to-time (entry)
(let* ((tz (plist-get entry :author-tz))
(mult (if (string= "+" (substring tz 0 1)) 1 -1))
(hours (string-to-number (substring tz 1 3)))
(minutes (string-to-number (substring tz 3 5))))
(seconds-to-time (+ (string-to-number (plist-get entry :author-time))
(* mult
(+ (* minutes 60)
(* hours 3600)))))))
(defun mo-git-blame-process-filter-process-entry (entry)
(with-current-buffer (plist-get mo-git-blame-vars :blame-buffer)
(save-excursion
(let ((inhibit-read-only t)
(info (format "%s (%s %s %s) %s"
(substring (symbol-name (plist-get entry :hash)) 0 8)
(plist-get entry :author)
(format-time-string "%Y-%m-%d %T" (mo-git-blame-commit-info-to-time entry) t)
(plist-get entry :author-tz)
(plist-get entry :filename)))
i)
(mo-git-blame-goto-line-markless (plist-get entry :result-line))
(dotimes (i (plist-get entry :num-lines))
(insert info)
(goto-char (line-beginning-position 2)))))))
(defun mo-git-blame-set-entry (key value)
(let ((plist (or (plist-get mo-git-blame-data mo-git-blame-curr-entry)
(list :hash mo-git-blame-curr-entry))))
(setq mo-git-blame-data
(plist-put mo-git-blame-data
mo-git-blame-curr-entry
(plist-put plist key value)))))
(defun mo-git-blame-process-filter (process string)
(with-current-buffer (process-buffer process)
(let ((inhibit-read-only t)
done matched)
(save-excursion
(goto-char (process-mark process))
(insert string)
(set-marker (process-mark process) (point)))
(while (not done)
(goto-char (line-end-position))
(setq done (= (point) (point-max)))
(goto-char (line-beginning-position))
(unless done
(setq matched t)
(cond ((and (not mo-git-blame-curr-entry)
(looking-at "^\\([a-fA-F0-9]\\{40\\}\\) +\\([0-9]+\\) +\\([0-9]+\\) +\\([0-9]+\\)$"))
;; SHA line, beginning of entry
(setq mo-git-blame-curr-entry (intern (buffer-substring-no-properties (match-beginning 1) (match-end 1))))
(mo-git-blame-set-entry :source-line (string-to-number (buffer-substring-no-properties (match-beginning 2) (match-end 2))))
(mo-git-blame-set-entry :result-line (string-to-number (buffer-substring-no-properties (match-beginning 3) (match-end 3))))
(mo-git-blame-set-entry :num-lines (string-to-number (buffer-substring-no-properties (match-beginning 4) (match-end 4))))
)
((and mo-git-blame-curr-entry
(looking-at "^filename +\\(.+\\)$"))
;; filename line, end of entry
(mo-git-blame-set-entry :filename (buffer-substring-no-properties (match-beginning 1) (match-end 1)))
(mo-git-blame-process-filter-process-entry (plist-get mo-git-blame-data mo-git-blame-curr-entry))
(setq mo-git-blame-curr-entry nil)
)
((and mo-git-blame-curr-entry
(looking-at "^\\([a-zA-Z0-9-]+\\) +\\(.+\\)$"))
;; property line
(mo-git-blame-set-entry (intern (concat ":" (buffer-substring-no-properties (match-beginning 1) (match-end 1))))
(buffer-substring-no-properties (match-beginning 2) (match-end 2)))
)
(t (setq matched nil)))
(forward-line 1))))))
(defun mo-git-blame-run* (&rest args)
(message "Running 'git blame'...")
(let ((buf (get-buffer-create "*mo-git-blame-process*"))
(cmd (car args))
(dir default-directory)
(vars mo-git-blame-vars))
(save-excursion
(set-buffer buf)
(setq buffer-read-only t)
(let ((inhibit-read-only t))
(set (make-local-variable 'mo-git-blame-data) nil)
(set (make-local-variable 'mo-git-blame-curr-entry) nil)
(set (make-local-variable 'mo-git-blame-vars) vars)
(setq default-directory dir
mo-git-blame-process (apply 'start-file-process cmd buf mo-git-blame-git-executable args))
(set-process-sentinel mo-git-blame-process 'mo-git-blame-process-sentinel)
(set-process-filter mo-git-blame-process 'mo-git-blame-process-filter)))))
(defun mo-git-blame-get-output-buffer ()
(let* ((name "*mo-git-blame-output*")
(buffer (get-buffer name)))
(if (null buffer)
(progn
(setq buffer (get-buffer-create name))
(with-current-buffer buffer
(use-local-map mo-git-blame-mode-map))))
buffer))
(defun mo-git-blame-parse-rev (revision)
(let ((result (mo-git-blame-git-string "rev-parse" "--short" revision)))
(unless result
(error "Unparseable revision %s" revision))
result))
(defun mo-git-blame-parse-blame-line ()
(save-excursion
(save-match-data
(beginning-of-line)
(cond ((looking-at "^\\([a-f0-9]+\\) +\\(([^)]+)\\) *$")
(list :hash (buffer-substring (match-beginning 1) (match-end 1))
:file-name (plist-get mo-git-blame-vars :file-name)
:timestamp (buffer-substring (match-beginning 2) (match-end 2))))
((looking-at "^\\([a-f0-9]+\\) +\\(([^)]+)\\) +\\(.+\\)")
(list :hash (buffer-substring (match-beginning 1) (match-end 1))
:file-name (buffer-substring (match-beginning 3) (match-end 3))
:timestamp (buffer-substring (match-beginning 2) (match-end 2))))
(t (error "Not a 'git blame' line"))))))
(defun mo-git-blame-revision-at-point ()
(plist-get (mo-git-blame-parse-blame-line) :hash))
(defun mo-git-blame-log-for-revision (revision)
(let ((file-name (plist-get mo-git-blame-vars :file-name))
(buffer (mo-git-blame-get-output-buffer)))
(with-current-buffer buffer
(erase-buffer)
(mo-git-blame-run "log" revision "--" file-name)
(goto-char (point-min)))
(display-buffer buffer)))
(defun mo-git-blame-log-for-revision-at ()
"Calls 'git log' for revision in the current line."
(interactive)
(mo-git-blame-log-for-revision (mo-git-blame-revision-at-point)))
(defun mo-git-blame-log-for-current-revision ()
"Calls 'git log' for the buffer's current revision and file."
(interactive)
(mo-git-blame-log-for-revision (plist-get mo-git-blame-vars :current-revision)))
(defun mo-git-blame-show-revision (revision)
(let ((buffer (mo-git-blame-get-output-buffer)))
(with-current-buffer buffer
(erase-buffer)
(mo-git-blame-run "show" revision)
(goto-char (point-min))
(diff-mode))
(display-buffer buffer)))
(defun mo-git-blame-show-revision-at ()
"Calls 'git show' for the revision in the current line."
(interactive)
(mo-git-blame-show-revision (mo-git-blame-revision-at-point)))
(defun mo-git-blame-show-current-revision ()
"Calls 'git show' for the current revision."
(interactive)
(mo-git-blame-show-revision (plist-get mo-git-blame-vars :current-revision)))
(defun mo-git-blame-content-for-revision-at ()
"Calls 'git cat-file' for the revision in the current line."
(interactive)
(let ((info (mo-git-blame-parse-blame-line))
(buffer (mo-git-blame-get-output-buffer)))
(with-current-buffer buffer
(erase-buffer)
(mo-git-blame-run "cat-file" "blob" (concat (plist-get info :hash) ":" (plist-get info :file-name)))
(goto-char (point-min)))
(display-buffer buffer)))
(defun mo-git-blame-overwrite-file-with-revision (revision)
(let ((file-name (plist-get mo-git-blame-vars :original-file-name)))
(if (yes-or-no-p (format "Do you really want to overwrite %s with revision %s " file-name revision))
(progn
(find-file (concat (plist-get mo-git-blame-vars :top-dir) file-name))
(erase-buffer)
(mo-git-blame-run "cat-file" "blob" (concat revision ":" file-name))
(goto-char (point-min))))))
(defun mo-git-blame-overwrite-file-with-revision-at ()
"Calls 'git cat-file' for the revision in the current line and overwrites
the original file's content. The file is not saved but left modified in an
open buffer."
(interactive)
(mo-git-blame-overwrite-file-with-revision (mo-git-blame-revision-at-point)))
(defun mo-git-blame-overwrite-file-with-current-revision ()
"Calls 'git cat-file' for the current revision and overwrites
the original file's content. The file is not saved but left modified in an
open buffer."
(interactive)
(mo-git-blame-overwrite-file-with-revision (plist-get mo-git-blame-vars :current-revision)))
(defun mo-git-blame-reblame-for-ancestor-of-revision-at (&optional arg)
"Calls 'git blame' for the ancestor of the revision in the current line.
With a numeric prefix argument ARG only the ARG lines before and
after point are blamed by using git blame's `-L'
option. Otherwise the whole file is blamed."
(interactive "P")
(mo-git-blame-reblame-for-specific-revision (mo-git-blame-parse-rev (concat (plist-get (mo-git-blame-parse-blame-line) :hash) "~")) arg))
(defun mo-git-blame-reblame-for-ancestor-of-current-revision (&optional arg)
"Calls 'git blame' for the ancestor of the current revision.
With a numeric prefix argument ARG only the ARG lines before and
after point are blamed by using git blame's `-L'
option. Otherwise the whole file is blamed."
(interactive "P")
(mo-git-blame-reblame-for-specific-revision (mo-git-blame-parse-rev (concat (plist-get mo-git-blame-vars :current-revision) "~")) arg))
(defun mo-git-blame-reblame-for-revision-at (&optional arg)
"Calls 'git blame' for the revision in the current line.
With a numeric prefix argument ARG only the ARG lines before and
after point are blamed by using git blame's `-L'
option. Otherwise the whole file is blamed."
(interactive "P")
(let* ((info (mo-git-blame-parse-blame-line))
(revision (plist-get info :hash)))
(if (string= revision (plist-get mo-git-blame-vars :current-revision))
(error "Already showing this revision"))
(mo-git-blame-file (concat (plist-get mo-git-blame-vars :top-dir) (plist-get info :file-name)) revision (plist-get mo-git-blame-vars :original-file-name) arg)))
(defun mo-git-blame-reblame-for-specific-revision (&optional revision arg)
"Calls 'git blame' for a specific REVISION.
With a numeric prefix argument ARG only the ARG lines before and
after point are blamed by using git blame's `-L'
option. Otherwise the whole file is blamed."
(interactive "sRevision: \nP")
(setq revision (mo-git-blame-parse-rev revision))
(if (string= revision (plist-get mo-git-blame-vars :current-revision))
(error "Already showing this revision"))
(mo-git-blame-file (concat (plist-get mo-git-blame-vars :top-dir) (plist-get mo-git-blame-vars :file-name)) revision (plist-get mo-git-blame-vars :original-file-name) arg))
(defun mo-git-blame-reblame-for-prior-revision (&optional arg)
"Calls 'git blame' for the revision shown before the current
one (see `prior revisions' in the info output of
`mo-git-blame-display-info').
With a numeric prefix argument ARG only the ARG lines before and
after point are blamed by using git blame's `-L'
option. Otherwise the whole file is blamed."
(interactive "P")
(let ((rev-list (plist-get mo-git-blame-vars :prior-revisions))
revision-plist)
(unless rev-list
(error "No revision shown prior to the current one"))
(setq revision-plist (car rev-list))
(mo-git-blame-file (plist-get revision-plist :full-file-name)
(plist-get revision-plist :revision)
(plist-get mo-git-blame-vars :original-file-name)
arg)))
(defun mo-git-blame-display-info ()
"Displays short information about the current revision."
(interactive)
(let* ((buffer (mo-git-blame-get-output-buffer))
(vars mo-git-blame-vars)
(prior-revs (plist-get vars :prior-revisions))
(prior-revs-str (if prior-revs
(reduce (lambda (joined element) (concat (or joined "") (if joined " " "") element))
(mapcar (lambda (element) (plist-get element :revision))
prior-revs))
"none")))
(with-current-buffer buffer
(erase-buffer)
(insert (format "Current revision: %s\n" (plist-get vars :current-revision))
(format "Prior revisions: %s\n" prior-revs-str)
(format "Git repository: %s\n" (plist-get vars :top-dir))
(format "Original file name: %s\n" (file-relative-name (plist-get vars :original-file-name)
(plist-get vars :top-dir)))
(format "Current file name: %s\n" (plist-get vars :file-name)))
(goto-char (point-min)))
(display-buffer buffer)))
(defun mo-git-blame-number-of-content-lines ()
(with-current-buffer (plist-get mo-git-blame-vars :content-buffer)
(save-excursion
(goto-char (point-max))
(line-number-at-pos))))
(defun mo-git-blame-mode ()
"Show the output of 'git blame' and the content of the file in
two frames side-by-side. Allows iterative re-blaming for specific
revisions. Can show the output of 'git log' and 'git show'. Can
overwrite the file with the content of specific revisions by
calling 'git cat-file blob ...'.
Use 'mo-git-blame-current' interactively or 'mo-git-blame-file'
from elisp.
\\{mo-git-blame-mode-map}"
(setq major-mode 'mo-git-blame-mode
mode-name "MoGitBlame"
mode-line-process ""
truncate-lines t)
(use-local-map mo-git-blame-mode-map))
(defun mo-git-blame-run-blame-normally (start-line lines-to-blame)
(let* ((num-content-lines (mo-git-blame-number-of-content-lines))
(num-lines-to-append (if (and start-line
(< (+ start-line lines-to-blame)
num-content-lines))
(- num-content-lines start-line lines-to-blame)))
args i)
(if (and start-line (> start-line 1))
(dotimes (i (1- start-line))
(insert "\n")))
(setq args (list (plist-get mo-git-blame-vars :current-revision) "--" (plist-get mo-git-blame-vars :file-name)))
(if start-line
(setq args (append (list "-L" (format "%d,+%d" start-line lines-to-blame))
args)))
(apply 'mo-git-blame-run "blame" args)
(if num-lines-to-append
(dotimes (i num-lines-to-append)
(insert "\n")))))
(defun mo-git-blame-run-blame-incrementally (start-line lines-to-blame)
(let* ((num-content-lines (mo-git-blame-number-of-content-lines))
i)
(dotimes (i (1- num-content-lines))
(insert "\n"))
(setq args (list "--incremental" (plist-get mo-git-blame-vars :current-revision) "--" (plist-get mo-git-blame-vars :file-name)))
(if start-line
(setq args (append (list "-L" (format "%d,+%d" start-line lines-to-blame))
args)))
(mo-git-blame-assert-not-running)
(apply 'mo-git-blame-run* "blame" args)))
(defun mo-git-blame-init-blame-buffer (start-line lines-to-blame)
(if mo-git-blame-incremental
(mo-git-blame-run-blame-incrementally start-line lines-to-blame)
(mo-git-blame-run-blame-normally start-line lines-to-blame))
(goto-char (point-min))
(save-match-data
(while (re-search-forward "^\\([a-f0-9]+\\) +\\(([^)]+)\\) \\(.*\\)" nil t)
(replace-match "\\1 \\2" nil nil))
(goto-char (point-min))
(while (re-search-forward "^\\([a-f0-9]+\\) +\\([^ ]+\\) +\\(([^)]+)\\) \\(.*\\)" nil t)
(replace-match "\\1 \\3 \\2" nil nil))
(goto-char (point-min))
(while (re-search-forward " +[0-9]+)" nil t)
(replace-match ")" nil nil)))
(toggle-read-only t)
(goto-char (point-min))
(set (make-local-variable 'line-move-visual) nil))
(defun mo-git-blame-init-content-buffer ()
(let ((vars mo-git-blame-vars))
(rename-buffer (concat "*mo-git-blame:" (file-name-nondirectory (plist-get vars :full-file-name)) ":" (plist-get vars :current-revision) "*"))
(setq buffer-file-name (file-name-nondirectory (plist-get vars :full-file-name))
default-directory (plist-get vars :top-dir))
(mo-git-blame-run "cat-file" "blob" (concat (plist-get vars :current-revision) ":" (plist-get vars :file-name)))
(normal-mode)
(use-local-map mo-git-blame-content-mode-map)
(font-lock-fontify-buffer)
(toggle-read-only t)
(set-buffer-modified-p nil)
(setq truncate-lines t)
(set (make-local-variable 'mo-git-blame-vars) vars)
(set (make-local-variable 'line-move-visual) nil)))
(defun mo-git-blame-read-file-name ()
"Calls `read-file-name' or `ido-read-file-name' depending on
the value of `mo-git-blame-use-ido'."
(let ((the-func (cond ((eq mo-git-blame-use-ido 'always)
(require 'ido)
'ido-read-file-name)
((and (eq mo-git-blame-use-ido 'if-available)
(functionp 'ido-read-file-name))
'ido-read-file-name)
(t 'read-file-name))))
(funcall the-func "File for 'git blame': " nil nil t)))
;;;###autoload
(defun mo-git-blame-file (&optional file-name revision original-file-name num-lines-to-blame)
"Calls `git blame' for REVISION of FILE-NAME or `HEAD' if
REVISION is not given. Initializes the two windows that will show
the output of 'git blame' and the content.
If FILE-NAME is missing it will be read with `find-file' in
interactive mode.
ORIGINAL-FILE-NAME defaults to FILE-NAME if not given. This is
used for tracking renaming and moving of files during iterative
re-blaming.
With a numeric prefix argument or with NUM-LINES-TO-BLAME only
the NUM-LINES-TO-BLAME lines before and after point are blamed by
using git blame's `-L' option. Otherwise the whole file is
blamed."
(interactive)
(mo-git-blame-assert-not-running)
(unless mo-git-blame--wincfg
(setq mo-git-blame--wincfg (current-window-configuration)))
(let* ((file-name (or file-name (mo-git-blame-read-file-name)))
(has-blame-vars (local-variable-p 'mo-git-blame-vars))
(the-raw-revision (or revision "HEAD"))
(the-revision (if (string= the-raw-revision "HEAD")
(mo-git-blame-parse-rev "HEAD")
the-raw-revision))
(base-name (concat (file-name-nondirectory file-name) "@" the-revision))
(blame-buffer (get-buffer-create "*mo-git-blame*"))
(content-buffer-name (concat "*mo-git-blame:" (file-name-nondirectory file-name) ":" the-revision "*"))
(content-buffer (if has-blame-vars
(plist-get mo-git-blame-vars :content-buffer)
(get-buffer-create content-buffer-name)))
(top-dir (mo-git-blame-get-top-dir (file-name-directory file-name)))
(relative-file-name (file-relative-name file-name top-dir))
(blame-window (selected-window))
(prior-vars (if has-blame-vars mo-git-blame-vars))
(line-to-go-to (line-number-at-pos))
(lines-to-blame (or num-lines-to-blame
(if (and current-prefix-arg (> (prefix-numeric-value current-prefix-arg) 0))
(prefix-numeric-value current-prefix-arg))))
content-window the-buffer prior-revisions start-line)
(switch-to-buffer blame-buffer)
(setq prior-revisions (if prior-vars (plist-get prior-vars :prior-revisions)))
(setq prior-revisions
(if (and prior-revisions (string= the-revision (plist-get (car prior-revisions) :revision)))
(cdr prior-revisions)
(if prior-vars
(cons (list :full-file-name (plist-get prior-vars :full-file-name)
:revision (plist-get prior-vars :current-revision))
prior-revisions))))
(if (window-full-width-p)
(split-window-horizontally mo-git-blame-blame-window-width))
(select-window (setq content-window (next-window)))
(switch-to-buffer content-buffer)
(select-window blame-window)
(dolist (the-buffer (list blame-buffer content-buffer))
(with-current-buffer the-buffer
(toggle-read-only 0)
(kill-all-local-variables)
(buffer-disable-undo)
(erase-buffer)
(setq default-directory top-dir)
(set (make-local-variable 'mo-git-blame-vars)
(list :top-dir top-dir
:file-name relative-file-name
:full-file-name file-name
:original-file-name (or original-file-name file-name)
:current-revision the-revision
:prior-revisions prior-revisions
:blame-buffer blame-buffer
:blame-window blame-window
:content-buffer content-buffer
:content-window content-window))))
(with-current-buffer content-buffer
(mo-git-blame-init-content-buffer))
(when lines-to-blame
(setq start-line (max 1 (- line-to-go-to lines-to-blame))
lines-to-blame (1+ (- (+ line-to-go-to lines-to-blame)
start-line))))
(with-current-buffer blame-buffer
(mo-git-blame-mode)
(mo-git-blame-init-blame-buffer start-line lines-to-blame))
(mo-git-blame-goto-line line-to-go-to)
(add-to-list 'window-scroll-functions 'mo-git-blame-window-scrolled)))
(defvar mo-git-blame-scroll-info
nil
"Information which window to scroll and where to scroll to.")
(defun mo-git-blame-window-scrolled (window new-start-pos)
(if (and window
(eq window (selected-window))
(local-variable-p 'mo-git-blame-vars))
(let* ((vars (with-current-buffer (window-buffer window) mo-git-blame-vars))
(start-line (line-number-at-pos new-start-pos))
(point-line (line-number-at-pos (window-point window)))
(window-to-scroll (if (eq window (plist-get vars :blame-window))
(plist-get vars :content-window)
(plist-get vars :blame-window))))
(setq mo-git-blame-scroll-info (list :window-to-scroll window-to-scroll
:start-line start-line
:point-line point-line))
(run-at-time "0 sec" nil 'mo-git-blame-update-other-window-after-scrolling))))
(defun mo-git-blame-update-other-window-after-scrolling ()
(if mo-git-blame-scroll-info
(let ((window (plist-get mo-git-blame-scroll-info :window-to-scroll))
new-start-pos)
(with-selected-window window
(with-current-buffer (window-buffer window)
(goto-char (point-min))
(setq new-start-pos (line-beginning-position (plist-get mo-git-blame-scroll-info :start-line)))
(goto-char (point-min))
(goto-char (line-beginning-position (plist-get mo-git-blame-scroll-info :point-line)))
(set-window-start window new-start-pos)))
(setq mo-git-blame-scroll-info nil))))
(defun mo-git-blame-quit ()
"Kill the mo-git-blame buffers."
(interactive)
(setq window-scroll-functions (remq 'mo-git-blame-window-scrolled window-scroll-functions))
(let ((buffer))
(dolist (buffer (buffer-list))
(if (string-match-p "^\\*mo-git-blame" (buffer-name buffer))
(kill-buffer buffer))))
(set-window-configuration mo-git-blame--wincfg)
(setq mo-git-blame--wincfg nil))
(defun mo-git-blame-display-content-buffer ()
"Show the content buffer in the content window."
(interactive)
; Declare buffer here because mo-git-blame-vars might not be available in the other buffer.
(let ((buffer (plist-get mo-git-blame-vars :content-buffer))
(line-num (line-number-at-pos)))
(mo-git-blame-goto-line-markless line-num)
(recenter)
(with-selected-window (plist-get mo-git-blame-vars :content-window)
(switch-to-buffer buffer)
(mo-git-blame-goto-line-markless line-num)
(recenter))))
(defun mo-git-blame-other-buffer ()
(plist-get mo-git-blame-vars
(if (eq (current-buffer) (plist-get mo-git-blame-vars :blame-buffer))
:content-buffer
:blame-buffer)))
(defun mo-git-blame-goto-line-markless (line)
(goto-char (point-min))
(goto-char (line-beginning-position line)))
(defun mo-git-blame-goto-line (line)
"Goto a line in both the blame and the content buffer."
(interactive "nGoto line: ")
(with-selected-window (plist-get mo-git-blame-vars :blame-window)
(mo-git-blame-goto-line-markless line))
(with-selected-window (plist-get mo-git-blame-vars :content-window)
(mo-git-blame-goto-line-markless line)))
;;;###autoload
(defun mo-git-blame-current ()
"Calls `mo-git-blame-file' for HEAD for the current buffer."
(interactive)
(if (null (buffer-file-name))
(error "The current buffer is not associated with a file."))
(mo-git-blame-file (buffer-file-name)))
(provide 'mo-git-blame)
;; Leave this in for debugging purposes:
;; (global-set-key [?\C-c ?i ?b] (lambda () (interactive) (let ((mo-git-blame-incremental t)) (mo-git-blame-current))))
;; (global-set-key [?\C-c ?i ?B] (lambda () (interactive) (let ((mo-git-blame-incremental nil)) (mo-git-blame-current))))
;;; mo-git-blame.el ends here

@ -4,8 +4,8 @@
;;;### (autoloads (mc/edit-beginnings-of-lines mc/edit-ends-of-lines
;;;;;; mc/edit-lines) "mc-edit-lines" "mc-edit-lines.el" (21317
;;;;;; 60626))
;;;;;; mc/edit-lines) "mc-edit-lines" "mc-edit-lines.el" (21323
;;;;;; 36304 0 0))
;;; Generated autoloads from mc-edit-lines.el
(autoload 'mc/edit-lines "mc-edit-lines" "\
@ -43,7 +43,7 @@ Add one cursor to the beginning of each line in the active region.
;;;;;; mc/mark-next-lines mc/mark-previous-symbol-like-this mc/mark-previous-word-like-this
;;;;;; mc/mark-previous-like-this mc/mark-next-symbol-like-this
;;;;;; mc/mark-next-word-like-this mc/mark-next-like-this) "mc-mark-more"
;;;;;; "mc-mark-more.el" (21317 60626))
;;;;;; "mc-mark-more.el" (21323 36304 0 0))
;;; Generated autoloads from mc-mark-more.el
(autoload 'mc/mark-next-like-this "mc-mark-more" "\
@ -198,8 +198,8 @@ Mark the tag we're in and its pair for renaming.
;;;***
;;;### (autoloads (mc/mark-pop) "mc-mark-pop" "mc-mark-pop.el" (21317
;;;;;; 60626))
;;;### (autoloads (mc/mark-pop) "mc-mark-pop" "mc-mark-pop.el" (21323
;;;;;; 36304 0 0))
;;; Generated autoloads from mc-mark-pop.el
(autoload 'mc/mark-pop "mc-mark-pop" "\
@ -211,8 +211,8 @@ to the popped mark.
;;;***
;;;### (autoloads (mc/sort-regions mc/reverse-regions mc/insert-numbers)
;;;;;; "mc-separate-operations" "mc-separate-operations.el" (21317
;;;;;; 60626))
;;;;;; "mc-separate-operations" "mc-separate-operations.el" (21323
;;;;;; 36304 0 0))
;;; Generated autoloads from mc-separate-operations.el
(autoload 'mc/insert-numbers "mc-separate-operations" "\
@ -233,7 +233,7 @@ Insert increasing numbers for each cursor, starting at 0 or ARG.
;;;***
;;;### (autoloads (set-rectangular-region-anchor) "rectangular-region-mode"
;;;;;; "rectangular-region-mode.el" (21317 60626))
;;;;;; "rectangular-region-mode.el" (21323 36304 0 0))
;;; Generated autoloads from rectangular-region-mode.el
(autoload 'set-rectangular-region-anchor "rectangular-region-mode" "\
@ -247,8 +247,8 @@ an exceedingly quick way of adding multiple cursors to multiple lines.
;;;***
;;;### (autoloads nil nil ("mc-cycle-cursors.el" "multiple-cursors-core.el"
;;;;;; "multiple-cursors-pkg.el" "multiple-cursors.el") (21317 60626
;;;;;; 359650))
;;;;;; "multiple-cursors-pkg.el" "multiple-cursors.el") (21323 36304
;;;;;; 790848 0))
;;;***

@ -1,155 +0,0 @@
Multiple cursors for Emacs. This is some pretty crazy functionality, so yes,
there are kinks. Don't be afraid tho, I've been using it since 2011 with
great success and much merriment.
## Basic usage
Start out with:
(require 'multiple-cursors)
Then you have to set up your keybindings - multiple-cursors doesn't presume to
know how you'd like them laid out. Here are some examples:
When you have an active region that spans multiple lines, the following will
add a cursor to each line:
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
When you want to add multiple cursors not based on continuous lines, but based on
keywords in the buffer, use:
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
First mark the word, then add more cursors.
To get out of multiple-cursors-mode, press `<return>` or `C-g`. The latter will
first disable multiple regions before disabling multiple cursors. If you want to
insert a newline in multiple-cursors-mode, use `C-j`.
## Video
You can [watch an intro to multiple-cursors at Emacs Rocks](http://emacsrocks.com/e13.html).
## Command overview
### Mark one more occurrence
- `mc/mark-next-like-this`: Adds a cursor and region at the next part of the buffer forwards that matches the current region.
- `mc/mark-next-word-like-this`: Like `mc/mark-next-like-this` but only for whole words.
- `mc/mark-next-symbol-like-this`: Like `mc/mark-next-like-this` but only for whole symbols.
- `mc/mark-previous-like-this`: Adds a cursor and region at the next part of the buffer backwards that matches the current region.
- `mc/mark-previous-word-like-this`: Like `mc/mark-previous-like-this` but only for whole words.
- `mc/mark-previous-symbol-like-this`: Like `mc/mark-previous-like-this` but only for whole symbols.
- `mc/mark-more-like-this-extended`: Use arrow keys to quickly mark/skip next/previous occurances.
- `mc/add-cursor-on-click`: Bind to a mouse event to add cursors by clicking. See tips-section.
### Mark many occurrences
- `mc/mark-all-like-this`: Marks all parts of the buffer that matches the current region.
- `mc/mark-all-words-like-this`: Like `mc/mark-all-like-this` but only for whole words.
- `mc/mark-all-symbols-like-this`: Like `mc/mark-all-like-this` but only for whole symbols.
- `mc/mark-all-in-region`: Prompts for a string to match in the region, adding cursors to all of them.
- `mc/mark-all-like-this-in-defun`: Marks all parts of the current defun that matches the current region.
- `mc/mark-all-words-like-this-in-defun`: Like `mc/mark-all-like-this-in-defun` but only for whole words.
- `mc/mark-all-symbols-like-this-in-defun`: Like `mc/mark-all-like-this-in-defun` but only for whole symbols.
- `mc/mark-all-like-this-dwim`: Tries to be smart about marking everything you want. Can be pressed multiple times.
### Special
- `set-rectangular-region-anchor`: Think of this one as `set-mark` except you're marking a rectangular region.
- `mc/mark-sgml-tag-pair`: Mark the current opening and closing tag.
- `mc/insert-numbers`: Insert increasing numbers for each cursor, top to bottom.
- `mc/sort-regions`: Sort the marked regions alphabetically.
- `mc/reverse-regions`: Reverse the order of the marked regions.
## Tips and tricks
- To get out of multiple-cursors-mode, press `<return>` or `C-g`. The latter will
first disable multiple regions before disabling multiple cursors. If you want to
insert a newline in multiple-cursors-mode, use `C-j`.
- Sometimes you end up with cursors outside of your view. You can
scroll the screen to center on each cursor with `C-v` and `M-v`.
- Try pressing `mc/mark-next-like-this` with no region selected. It will just add a cursor
on the next line.
- Try pressing `mc/mark-all-like-this-dwim` on a tagname in html-mode.
- Notice that the number of cursors active can be seen in the modeline.
- If you get out of multiple-cursors-mode and yank - it will yank only
from the kill-ring of main cursor. To yank from the kill-rings of
every cursor use yank-rectangle, normally found at C-x r y.
- You can use `mc/reverse-regions` with nothing selected and just one cursor.
It will then flip the sexp at point and the one below it.
- If you would like to keep the global bindings clean, and get custom keybindings
when the region is active, you can try [region-bindings-mode](https://github.com/fgallina/region-bindings-mode).
BTW, I highly recommend adding `mc/mark-next-like-this` to a key binding that's
right next to the key for `er/expand-region`.
### Binding mouse events
To override a mouse event, you will likely have to also unbind the
`down-mouse` part of the event. Like this:
(global-unset-key (kbd "M-<down-mouse-1>"))
(global-set-key (kbd "M-<mouse-1>") 'mc/add-cursor-on-click)
Or you can do like me and find an unused, but less convenient, binding:
(global-set-key (kbd "C-S-<mouse-1>") 'mc/add-cursor-on-click)
## Unknown commands
Multiple-cursors uses two lists of commands to know what to do: the run-once list
and the run-for-all list. It comes with a set of defaults, but it would be beyond silly
to try and include all the known Emacs commands.
So that's why multiple-cursors occasionally asks what to do about a command. It will
then remember your choice by saving it in `~/.emacs.d/.mc-lists.el`. You can change
the location with:
(setq mc/list-file "/my/preferred/file")
## Known limitations
* isearch-forward and isearch-backward aren't supported with multiple cursors.
You should feel free to add a simplified version that can work with it.
* Commands run with `M-x` won't be repeated for all cursors.
* All key bindings that refer to lambdas are always run for all cursors. If you
need to limit it, you will have to give it a name.
* Redo might screw with your cursors. Undo works very well.
## Contribute
Yes, please do. There's a suite of tests, so remember to add tests for your
specific feature, or I might break it later.
You'll find the repo at:
https://github.com/magnars/multiple-cursors.el
To fetch the test dependencies:
$ cd /path/to/multiple-cursors
$ git submodule update --init
Run the tests with:
$ ./util/ecukes/ecukes --graphical
## Contributors
* [Takafumi Arakaki](https://github.com/tkf) made .mc-lists.el diff friendly
* [Marco Baringer](https://github.com/segv) contributed looping to mc/cycle and adding cursors without region for mark-more.
* [Ivan Andrus](https://github.com/gvol) added showing number of cursors in mode-line
* [Fuco](https://github.com/Fuco1) added the first version of `mc/mark-all-like-this-dwim`
Thanks!

@ -4,7 +4,7 @@
;;;### (autoloads nil nil ("no-easy-keys-pkg.el" "no-easy-keys.el")
;;;;;; (21059 16366 939830))
;;;;;; (21323 36306 758575 0))
;;;***

@ -1,26 +0,0 @@
;;; nzenburn-theme-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads nil "nzenburn-theme" "nzenburn-theme.el" (21316
;;;;;; 30333))
;;; Generated autoloads from nzenburn-theme.el
(and load-file-name (boundp 'custom-theme-load-path) (add-to-list 'custom-theme-load-path (file-name-as-directory (file-name-directory load-file-name))))
;;;***
;;;### (autoloads nil nil ("nzenburn-theme-pkg.el") (21316 30333
;;;;;; 575020))
;;;***
(provide 'nzenburn-theme-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; nzenburn-theme-autoloads.el ends here

@ -1 +0,0 @@
(define-package "nzenburn-theme" "20130513" "A low contrast color theme for Emacs." (quote nil))

@ -1,852 +0,0 @@
;;; nzenburn-theme.el --- A low contrast color theme for Emacs.
;; Copyright (C) 2011-2013 Bozhidar Batsov
;; Author: nopcall <nopcall@gmail.com>
;; URL: http://github.com/nopcall/nopcall-nzenburn
;; Version: 20130513
;; X-Original-Version: 2.0
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; A port of the popular Vim theme Nzenburn for Emacs 24, built on top
;; of the new built-in theme support in Emacs 24.
;;
;;; Credits:
;;
;; Jani Nurminen created the original theme for vim on such this port
;; is based.
;;; Code:
(deftheme nzenburn "The Nzenburn color theme")
(let ((class '((class color) (min-colors 89)))
;; nzenburn palette
;; colors with +x are lighter, colors with -x are darker
(nzenburn-fg "#dcdccc")
(nzenburn-fg-1 "#656555")
(nzenburn-bg-1 "#2b2b2b")
(nzenburn-bg-05 "#383838")
(nzenburn-bg "#3f3f3f")
(nzenburn-bg+1 "#4f4f4f")
(nzenburn-bg+2 "#5f5f5f")
(nzenburn-bg+3 "#6f6f6f")
(nzenburn-red+1 "#dca3a3")
(nzenburn-red "#cc9393")
(nzenburn-red-1 "#bc8383")
(nzenburn-red-2 "#ac7373")
(nzenburn-red-3 "#9c6363")
(nzenburn-red-4 "#8c5353")
(nzenburn-orange "#dfaf8f")
(nzenburn-yellow "#f0dfaf")
(nzenburn-yellow-1 "#e0cf9f")
(nzenburn-yellow-2 "#d0bf8f")
(nzenburn-green-1 "#5f7f5f")
(nzenburn-green "#7f9f7f")
(nzenburn-green+1 "#8fb28f")
(nzenburn-green+2 "#9fc59f")
(nzenburn-green+3 "#afd8af")
(nzenburn-green+4 "#bfebbf")
(nzenburn-cyan "#93e0e3")
(nzenburn-blue+1 "#94bff3")
(nzenburn-blue "#8cd0d3")
(nzenburn-blue-1 "#7cb8bb")
(nzenburn-blue-2 "#6ca0a3")
(nzenburn-blue-3 "#5c888b")
(nzenburn-blue-4 "#4c7073")
(nzenburn-blue-5 "#366060")
(nzenburn-magenta "#dc8cc3")
(nzenburn-violet "#6c71c4")
(nzenburn-region "#7f073f")
)
(custom-theme-set-faces
'nzenburn
'(button ((t (:underline t))))
`(link ((t (:foreground ,nzenburn-yellow :underline t :weight bold))))
`(link-visited ((t (:foreground ,nzenburn-yellow-2 :underline t :weight normal))))
;;; basic coloring
`(default ((t (:foreground ,nzenburn-fg :background ,nzenburn-bg))))
`(cursor ((t (:foreground ,nzenburn-fg :background "white"))))
`(escape-glyph ((t (:foreground ,nzenburn-yellow :bold t))))
`(fringe ((t (:foreground ,nzenburn-fg :background ,nzenburn-bg+1))))
`(header-line ((t (:foreground ,nzenburn-yellow
:background ,nzenburn-bg-1
:box (:line-width -1 :style released-button)))))
`(highlight ((t (:background ,nzenburn-bg-05))))
`(success ((t (:foreground ,nzenburn-green :weight bold))))
`(warning ((t (:foreground ,nzenburn-orange :weight bold))))
;;; compilation
`(compilation-column-face ((t (:foreground ,nzenburn-yellow))))
`(compilation-enter-directory-face ((t (:foreground ,nzenburn-green))))
`(compilation-error-face ((t (:foreground ,nzenburn-red-1 :weight bold :underline t))))
`(compilation-face ((t (:foreground ,nzenburn-fg))))
`(compilation-info-face ((t (:foreground ,nzenburn-blue))))
`(compilation-info ((t (:foreground ,nzenburn-green+4 :underline t))))
`(compilation-leave-directory-face ((t (:foreground ,nzenburn-green))))
`(compilation-line-face ((t (:foreground ,nzenburn-yellow))))
`(compilation-line-number ((t (:foreground ,nzenburn-yellow))))
`(compilation-message-face ((t (:foreground ,nzenburn-blue))))
`(compilation-warning-face ((t (:foreground ,nzenburn-orange :weight bold :underline t))))
`(compilation-mode-line-exit ((t (:foreground ,nzenburn-green+2 :weight bold))))
`(compilation-mode-line-fail ((t (:foreground ,nzenburn-red :weight bold))))
`(compilation-mode-line-run ((t (:foreground ,nzenburn-yellow :weight bold))))
;;; grep
`(grep-context-face ((t (:foreground ,nzenburn-fg))))
`(grep-error-face ((t (:foreground ,nzenburn-red-1 :weight bold :underline t))))
`(grep-hit-face ((t (:foreground ,nzenburn-blue))))
`(grep-match-face ((t (:foreground ,nzenburn-orange :weight bold))))
`(match ((t (:background ,nzenburn-bg-1 :foreground ,nzenburn-orange :weight bold))))
;; faces used by isearch
`(isearch ((t (:foreground ,nzenburn-yellow-2 :weight bold :background ,nzenburn-bg-1))))
`(isearch-fail ((t (:foreground ,nzenburn-fg :background ,nzenburn-red-4))))
`(lazy-highlight ((t (:foreground ,nzenburn-yellow-2 :weight bold :background ,nzenburn-bg-05))))
`(menu ((t (:foreground ,nzenburn-fg :background ,nzenburn-bg))))
`(minibuffer-prompt ((t (:foreground ,nzenburn-yellow))))
`(mode-line
((,class (:foreground ,nzenburn-green+1
:background ,nzenburn-bg-1
:box (:line-width -1 :style released-button)))
(t :inverse-video t)))
`(mode-line-buffer-id ((t (:foreground ,nzenburn-yellow :weight bold))))
`(mode-line-inactive
((t (:foreground ,nzenburn-green-1
:background ,nzenburn-bg-05
:box (:line-width -1 :style released-button)))))
`(region ((,class (:background ,nzenburn-region))
(t :inverse-video t)))
`(secondary-selection ((t (:background ,nzenburn-orange))))
`(trailing-whitespace ((t (:background ,nzenburn-red))))
`(vertical-border ((t (:foreground ,nzenburn-fg))))
;;; font lock
`(font-lock-builtin-face ((t (:foreground ,nzenburn-cyan))))
`(font-lock-comment-face ((t (:foreground ,nzenburn-green))))
`(font-lock-comment-delimiter-face ((t (:foreground ,nzenburn-green))))
`(font-lock-constant-face ((t (:foreground ,nzenburn-green+4))))
`(font-lock-doc-face ((t (:foreground ,nzenburn-green+1))))
`(font-lock-doc-string-face ((t (:foreground ,nzenburn-blue-2))))
`(font-lock-function-name-face ((t (:foreground ,nzenburn-blue))))
`(font-lock-keyword-face ((t (:foreground ,nzenburn-yellow :weight bold))))
`(font-lock-negation-char-face ((t (:foreground ,nzenburn-fg))))
`(font-lock-preprocessor-face ((t (:foreground ,nzenburn-blue+1))))
`(font-lock-string-face ((t (:foreground ,nzenburn-red))))
`(font-lock-type-face ((t (:foreground ,nzenburn-blue-1))))
`(font-lock-variable-name-face ((t (:foreground ,nzenburn-orange))))
`(font-lock-warning-face ((t (:foreground ,nzenburn-yellow-2 :weight bold))))
`(c-annotation-face ((t (:inherit font-lock-constant-face))))
;;; newsticker
`(newsticker-date-face ((t (:foreground ,nzenburn-fg))))
`(newsticker-default-face ((t (:foreground ,nzenburn-fg))))
`(newsticker-enclosure-face ((t (:foreground ,nzenburn-green+3))))
`(newsticker-extra-face ((t (:foreground ,nzenburn-bg+2 :height 0.8))))
`(newsticker-feed-face ((t (:foreground ,nzenburn-fg))))
`(newsticker-immortal-item-face ((t (:foreground ,nzenburn-green))))
`(newsticker-new-item-face ((t (:foreground ,nzenburn-blue))))
`(newsticker-obsolete-item-face ((t (:foreground ,nzenburn-red))))
`(newsticker-old-item-face ((t (:foreground ,nzenburn-bg+3))))
`(newsticker-statistics-face ((t (:foreground ,nzenburn-fg))))
`(newsticker-treeview-face ((t (:foreground ,nzenburn-fg))))
`(newsticker-treeview-immortal-face ((t (:foreground ,nzenburn-green))))
`(newsticker-treeview-listwindow-face ((t (:foreground ,nzenburn-fg))))
`(newsticker-treeview-new-face ((t (:foreground ,nzenburn-blue :weight bold))))
`(newsticker-treeview-obsolete-face ((t (:foreground ,nzenburn-red))))
`(newsticker-treeview-old-face ((t (:foreground ,nzenburn-bg+3))))
`(newsticker-treeview-selection-face ((t (:foreground ,nzenburn-yellow))))
;;; external
`(ace-jump-face-background
((t (:foreground ,nzenburn-fg-1 :background ,nzenburn-bg :inverse-video nil))))
`(ace-jump-face-foreground
((t (:foreground ,nzenburn-green+2 :background ,nzenburn-bg :inverse-video nil))))
;; full-ack
`(ack-separator ((t (:foreground ,nzenburn-fg))))
`(ack-file ((t (:foreground ,nzenburn-blue))))
`(ack-line ((t (:foreground ,nzenburn-yellow))))
`(ack-match ((t (:foreground ,nzenburn-orange :background ,nzenburn-bg-1 :weight bold))))
;; auctex
`(font-latex-bold ((t (:inherit bold))))
`(font-latex-warning ((t (:inherit font-lock-warning))))
`(font-latex-sedate ((t (:foreground ,nzenburn-yellow :weight bold ))))
`(font-latex-title-4 ((t (:inherit variable-pitch :weight bold))))
;; auto-complete
`(ac-candidate-face ((t (:background ,nzenburn-bg+3 :foreground "black"))))
`(ac-selection-face ((t (:background ,nzenburn-blue-4 :foreground ,nzenburn-fg))))
`(popup-tip-face ((t (:background ,nzenburn-yellow-2 :foreground "black"))))
`(popup-scroll-bar-foreground-face ((t (:background ,nzenburn-blue-5))))
`(popup-scroll-bar-background-face ((t (:background ,nzenburn-bg-1))))
`(popup-isearch-match ((t (:background ,nzenburn-bg :foreground ,nzenburn-fg))))
;; android mode
`(android-mode-debug-face ((t (:foreground ,nzenburn-green+1))))
`(android-mode-error-face ((t (:foreground ,nzenburn-orange :weight bold))))
`(android-mode-info-face ((t (:foreground ,nzenburn-fg))))
`(android-mode-verbose-face ((t (:foreground ,nzenburn-green))))
`(android-mode-warning-face ((t (:foreground ,nzenburn-yellow))))
;; bm
`(bm-face ((t (:background ,nzenburn-yellow-1 :foreground ,nzenburn-bg))))
`(bm-fringe-face ((t (:background ,nzenburn-yellow-1 :foreground ,nzenburn-bg))))
`(bm-fringe-persistent-face ((t (:background ,nzenburn-green-1 :foreground ,nzenburn-bg))))
`(bm-persistent-face ((t (:background ,nzenburn-green-1 :foreground ,nzenburn-bg))))
;; clojure-test-mode
`(clojure-test-failure-face ((t (:foreground ,nzenburn-orange :weight bold :underline t))))
`(clojure-test-error-face ((t (:foreground ,nzenburn-red :weight bold :underline t))))
`(clojure-test-success-face ((t (:foreground ,nzenburn-green+1 :weight bold :underline t))))
;; ctable
`(ctbl:face-cell-select ((t (:background ,nzenburn-blue :foreground ,nzenburn-bg))))
`(ctbl:face-continue-bar ((t (:background ,nzenburn-bg-05 :foreground ,nzenburn-bg))))
`(ctbl:face-row-select ((t (:background ,nzenburn-cyan :foreground ,nzenburn-bg))))
;; diff
`(diff-added ((,class (:foreground ,nzenburn-green+4 :background nil))
(t (:foreground ,nzenburn-green-1 :background nil))))
`(diff-changed ((t (:foreground ,nzenburn-yellow))))
`(diff-removed ((,class (:foreground ,nzenburn-red :background nil))
(t (:foreground ,nzenburn-red-3 :background nil))))
`(diff-refine-added ((t :inherit diff-added :weight bold)))
`(diff-refine-change ((t :inherit diff-changed :weight bold)))
`(diff-refine-removed ((t :inherit diff-removed :weight bold)))
`(diff-header ((,class (:background ,nzenburn-bg+2))
(t (:background ,nzenburn-fg :foreground ,nzenburn-bg))))
`(diff-file-header
((,class (:background ,nzenburn-bg+2 :foreground ,nzenburn-fg :bold t))
(t (:background ,nzenburn-fg :foreground ,nzenburn-bg :bold t))))
;; dired+
`(diredp-display-msg ((t (:foreground ,nzenburn-blue))))
`(diredp-compressed-file-suffix ((t (:foreground ,nzenburn-orange))))
`(diredp-date-time ((t (:foreground ,nzenburn-magenta))))
`(diredp-deletion ((t (:foreground ,nzenburn-yellow))))
`(diredp-deletion-file-name ((t (:foreground ,nzenburn-red))))
`(diredp-dir-heading ((t (:foreground ,nzenburn-blue :background ,nzenburn-bg-1))))
`(diredp-dir-priv ((t (:foreground ,nzenburn-cyan))))
`(diredp-exec-priv ((t (:foreground ,nzenburn-red))))
`(diredp-executable-tag ((t (:foreground ,nzenburn-green+1))))
`(diredp-file-name ((t (:foreground ,nzenburn-blue))))
`(diredp-file-suffix ((t (:foreground ,nzenburn-green))))
`(diredp-flag-mark ((t (:foreground ,nzenburn-yellow))))
`(diredp-flag-mark-line ((t (:foreground ,nzenburn-orange))))
`(diredp-ignored-file-name ((t (:foreground ,nzenburn-red))))
`(diredp-link-priv ((t (:foreground ,nzenburn-yellow))))
`(diredp-mode-line-flagged ((t (:foreground ,nzenburn-yellow))))
`(diredp-mode-line-marked ((t (:foreground ,nzenburn-orange))))
`(diredp-no-priv ((t (:foreground ,nzenburn-fg))))
`(diredp-number ((t (:foreground ,nzenburn-green+1))))
`(diredp-other-priv ((t (:foreground ,nzenburn-yellow-1))))
`(diredp-rare-priv ((t (:foreground ,nzenburn-red-1))))
`(diredp-read-priv ((t (:foreground ,nzenburn-green-1))))
`(diredp-symlink ((t (:foreground ,nzenburn-yellow))))
`(diredp-write-priv ((t (:foreground ,nzenburn-magenta))))
;; ert
`(ert-test-result-expected ((t (:foreground ,nzenburn-green+4 :background ,nzenburn-bg))))
`(ert-test-result-unexpected ((t (:foreground ,nzenburn-red :background ,nzenburn-bg))))
;; eshell
`(eshell-prompt ((t (:foreground ,nzenburn-yellow :weight bold))))
`(eshell-ls-archive ((t (:foreground ,nzenburn-red-1 :weight bold))))
`(eshell-ls-backup ((t (:inherit font-lock-comment))))
`(eshell-ls-clutter ((t (:inherit font-lock-comment))))
`(eshell-ls-directory ((t (:foreground ,nzenburn-blue+1 :weight bold))))
`(eshell-ls-executable ((t (:foreground ,nzenburn-red+1 :weight bold))))
`(eshell-ls-unreadable ((t (:foreground ,nzenburn-fg))))
`(eshell-ls-missing ((t (:inherit font-lock-warning))))
`(eshell-ls-product ((t (:inherit font-lock-doc))))
`(eshell-ls-special ((t (:foreground ,nzenburn-yellow :weight bold))))
`(eshell-ls-symlink ((t (:foreground ,nzenburn-cyan :weight bold))))
;; flycheck
`(flycheck-error-face ((t (:foreground ,nzenburn-red-1 :weight bold :underline t))))
`(flycheck-warning-face ((t (:foreground ,nzenburn-orange :weight bold :underline t))))
;; flymake
`(flymake-errline ((t (:foreground ,nzenburn-red-1 :weight bold :underline t))))
`(flymake-warnline ((t (:foreground ,nzenburn-orange :weight bold :underline t))))
;; flyspell
`(flyspell-duplicate ((t (:foreground ,nzenburn-orange :weight bold :underline t))))
`(flyspell-incorrect ((t (:foreground ,nzenburn-red-1 :weight bold :underline t))))
;; erc
`(erc-action-face ((t (:inherit erc-default-face))))
`(erc-bold-face ((t (:weight bold))))
`(erc-current-nick-face ((t (:foreground ,nzenburn-blue :weight bold))))
`(erc-dangerous-host-face ((t (:inherit font-lock-warning))))
`(erc-default-face ((t (:foreground ,nzenburn-fg))))
`(erc-direct-msg-face ((t (:inherit erc-default))))
`(erc-error-face ((t (:inherit font-lock-warning))))
`(erc-fool-face ((t (:inherit erc-default))))
`(erc-highlight-face ((t (:inherit hover-highlight))))
`(erc-input-face ((t (:foreground ,nzenburn-yellow))))
`(erc-keyword-face ((t (:foreground ,nzenburn-blue :weight bold))))
`(erc-nick-default-face ((t (:foreground ,nzenburn-yellow :weight bold))))
`(erc-my-nick-face ((t (:foreground ,nzenburn-red :weight bold))))
`(erc-nick-msg-face ((t (:inherit erc-default))))
`(erc-notice-face ((t (:foreground ,nzenburn-green))))
`(erc-pal-face ((t (:foreground ,nzenburn-orange :weight bold))))
`(erc-prompt-face ((t (:foreground ,nzenburn-orange :background ,nzenburn-bg :weight bold))))
`(erc-timestamp-face ((t (:foreground ,nzenburn-green+1))))
`(erc-underline-face ((t (:underline t))))
;; git-gutter
`(git-gutter:added ((t (:foreground ,nzenburn-green :weight bold :inverse-video t))))
`(git-gutter:deleted ((t (:foreground ,nzenburn-red :weight bold :inverse-video t))))
`(git-gutter:modified ((t (:foreground ,nzenburn-magenta :weight bold :inverse-video t))))
`(git-gutter:unchanged ((t (:foreground ,nzenburn-fg :weight bold :inverse-video t))))
;; git-gutter-fr
`(git-gutter-fr:added ((t (:foreground ,nzenburn-green :weight bold))))
`(git-gutter-fr:deleted ((t (:foreground ,nzenburn-red :weight bold))))
`(git-gutter-fr:modified ((t (:foreground ,nzenburn-magenta :weight bold))))
;; gnus
`(gnus-group-mail-1 ((t (:bold t :inherit gnus-group-mail-1-empty))))
`(gnus-group-mail-1-empty ((t (:inherit gnus-group-news-1-empty))))
`(gnus-group-mail-2 ((t (:bold t :inherit gnus-group-mail-2-empty))))
`(gnus-group-mail-2-empty ((t (:inherit gnus-group-news-2-empty))))
`(gnus-group-mail-3 ((t (:bold t :inherit gnus-group-mail-3-empty))))
`(gnus-group-mail-3-empty ((t (:inherit gnus-group-news-3-empty))))
`(gnus-group-mail-4 ((t (:bold t :inherit gnus-group-mail-4-empty))))
`(gnus-group-mail-4-empty ((t (:inherit gnus-group-news-4-empty))))
`(gnus-group-mail-5 ((t (:bold t :inherit gnus-group-mail-5-empty))))
`(gnus-group-mail-5-empty ((t (:inherit gnus-group-news-5-empty))))
`(gnus-group-mail-6 ((t (:bold t :inherit gnus-group-mail-6-empty))))
`(gnus-group-mail-6-empty ((t (:inherit gnus-group-news-6-empty))))
`(gnus-group-mail-low ((t (:bold t :inherit gnus-group-mail-low-empty))))
`(gnus-group-mail-low-empty ((t (:inherit gnus-group-news-low-empty))))
`(gnus-group-news-1 ((t (:bold t :inherit gnus-group-news-1-empty))))
`(gnus-group-news-2 ((t (:bold t :inherit gnus-group-news-2-empty))))
`(gnus-group-news-3 ((t (:bold t :inherit gnus-group-news-3-empty))))
`(gnus-group-news-4 ((t (:bold t :inherit gnus-group-news-4-empty))))
`(gnus-group-news-5 ((t (:bold t :inherit gnus-group-news-5-empty))))
`(gnus-group-news-6 ((t (:bold t :inherit gnus-group-news-6-empty))))
`(gnus-group-news-low ((t (:bold t :inherit gnus-group-news-low-empty))))
`(gnus-header-content ((t (:inherit message-header-other))))
`(gnus-header-from ((t (:inherit message-header-from))))
`(gnus-header-name ((t (:inherit message-header-name))))
`(gnus-header-newsgroups ((t (:inherit message-header-other))))
`(gnus-header-subject ((t (:inherit message-header-subject))))
`(gnus-summary-cancelled ((t (:foreground ,nzenburn-orange))))
`(gnus-summary-high-ancient ((t (:foreground ,nzenburn-blue))))
`(gnus-summary-high-read ((t (:foreground ,nzenburn-green :weight bold))))
`(gnus-summary-high-ticked ((t (:foreground ,nzenburn-orange :weight bold))))
`(gnus-summary-high-unread ((t (:foreground ,nzenburn-fg :weight bold))))
`(gnus-summary-low-ancient ((t (:foreground ,nzenburn-blue))))
`(gnus-summary-low-read ((t (:foreground ,nzenburn-green))))
`(gnus-summary-low-ticked ((t (:foreground ,nzenburn-orange :weight bold))))
`(gnus-summary-low-unread ((t (:foreground ,nzenburn-fg))))
`(gnus-summary-normal-ancient ((t (:foreground ,nzenburn-blue))))
`(gnus-summary-normal-read ((t (:foreground ,nzenburn-green))))
`(gnus-summary-normal-ticked ((t (:foreground ,nzenburn-orange :weight bold))))
`(gnus-summary-normal-unread ((t (:foreground ,nzenburn-fg))))
`(gnus-summary-selected ((t (:foreground ,nzenburn-yellow :weight bold))))
`(gnus-cite-1 ((t (:foreground ,nzenburn-blue))))
`(gnus-cite-10 ((t (:foreground ,nzenburn-yellow-1))))
`(gnus-cite-11 ((t (:foreground ,nzenburn-yellow))))
`(gnus-cite-2 ((t (:foreground ,nzenburn-blue-1))))
`(gnus-cite-3 ((t (:foreground ,nzenburn-blue-2))))
`(gnus-cite-4 ((t (:foreground ,nzenburn-green+2))))
`(gnus-cite-5 ((t (:foreground ,nzenburn-green+1))))
`(gnus-cite-6 ((t (:foreground ,nzenburn-green))))
`(gnus-cite-7 ((t (:foreground ,nzenburn-red))))
`(gnus-cite-8 ((t (:foreground ,nzenburn-red-1))))
`(gnus-cite-9 ((t (:foreground ,nzenburn-red-2))))
`(gnus-group-news-1-empty ((t (:foreground ,nzenburn-yellow))))
`(gnus-group-news-2-empty ((t (:foreground ,nzenburn-green+3))))
`(gnus-group-news-3-empty ((t (:foreground ,nzenburn-green+1))))
`(gnus-group-news-4-empty ((t (:foreground ,nzenburn-blue-2))))
`(gnus-group-news-5-empty ((t (:foreground ,nzenburn-blue-3))))
`(gnus-group-news-6-empty ((t (:foreground ,nzenburn-bg+2))))
`(gnus-group-news-low-empty ((t (:foreground ,nzenburn-bg+2))))
`(gnus-signature ((t (:foreground ,nzenburn-yellow))))
`(gnus-x ((t (:background ,nzenburn-fg :foreground ,nzenburn-bg))))
;; guide-key
`(guide-key/highlight-command-face ((t (:foreground ,nzenburn-blue))))
`(guide-key/key-face ((t (:foreground ,nzenburn-green))))
`(guide-key/prefix-command-face ((t (:foreground ,nzenburn-green+1))))
;; helm
`(helm-header
((t (:foreground ,nzenburn-green
:background ,nzenburn-bg
:underline nil
:box nil))))
`(helm-source-header
((t (:foreground ,nzenburn-yellow
:background ,nzenburn-bg-1
:underline nil
:weight bold
:box (:line-width -1 :style released-button)))))
`(helm-selection ((t (:background ,nzenburn-bg+1 :underline nil))))
`(helm-selection-line ((t (:background ,nzenburn-bg+1))))
`(helm-visible-mark ((t (:foreground ,nzenburn-bg :background ,nzenburn-yellow-2))))
`(helm-candidate-number ((t (:foreground ,nzenburn-green+4 :background ,nzenburn-bg-1))))
`(helm-ff-directory ((t (:foreground ,nzenburn-magenta))))
;; hl-line-mode
`(hl-line-face ((,class (:background ,nzenburn-bg-05))
(t :weight bold)))
`(hl-line ((,class (:background ,nzenburn-bg-05)) ; old emacsen
(t :weight bold)))
;; hl-sexp
`(hl-sexp-face ((,class (:background ,nzenburn-bg+1))
(t :weight bold)))
;; ido-mode
`(ido-first-match ((t (:foreground ,nzenburn-red :weight bold))))
`(ido-only-match ((t (:foreground ,nzenburn-orange :weight bold))))
`(ido-subdir ((t (:foreground ,nzenburn-yellow))))
`(ido-indicator ((t (:foreground ,nzenburn-red :background ,nzenburn-bg))))
;; j2-mode
`(js2-warning-face ((t (:underline ,nzenburn-orange))))
`(js2-error-face ((t (:foreground ,nzenburn-red :weight bold))))
`(js2-jsdoc-tag-face ((t (:foreground ,nzenburn-green-1))))
`(js2-jsdoc-type-face ((t (:foreground ,nzenburn-green+2))))
`(js2-jsdoc-value-face ((t (:foreground ,nzenburn-green+3))))
`(js2-function-param-face ((t (:foreground, nzenburn-green+3))))
`(js2-external-variable-face ((t (:foreground ,nzenburn-orange))))
;; js3-mode
`(js3-warning-face ((t (:underline ,nzenburn-yellow))))
`(js3-error-face ((t (:foreground nil :underline ,nzenburn-red))))
`(js3-external-variable-face ((t (:foreground ,nzenburn-magenta))))
`(js3-function-param-face ((t (:foreground ,nzenburn-blue))))
`(js3-jsdoc-tag-face ((t (:foreground ,nzenburn-magenta))))
`(js3-jsdoc-type-face ((t (:foreground ,nzenburn-cyan))))
`(js3-jsdoc-value-face ((t (:foreground ,nzenburn-violet))))
`(js3-jsdoc-html-tag-name-face ((t (:foreground ,nzenburn-blue))))
`(js3-jsdoc-html-tag-delimiter-face ((t (:foreground ,nzenburn-green))))
`(js3-instance-member-face ((t (:foreground ,nzenburn-blue))))
`(js3-private-function-call-face ((t (:foreground ,nzenburn-red))))
;; nxml
`(nxml-name-face ((,class (:foreground unspecified :inherit font-lock-constant-face))))
`(nxml-attribute-local-name-face ((,class (:foreground unspecified :inherit font-lock-variable-name-face))))
`(nxml-ref-face ((,class (:foreground unspecified :inherit font-lock-preprocessor-face))))
`(nxml-delimiter-face ((,class (:foreground unspecified :inherit font-lock-keyword-face))))
`(nxml-delimited-data-face ((,class (:foreground unspecified :inherit font-lock-string-face))))
`(rng-error-face ((,class (:underline ,nzenburn-red))))
;; RHTML
`(erb-delim-face ((,class (:background ,nzenburn-bg+2))))
`(erb-exec-face ((,class (:background ,nzenburn-bg+2 :weight bold))))
`(erb-exec-delim-face ((,class (:background ,nzenburn-bg+2))))
`(erb-out-face ((,class (:background ,nzenburn-bg+2 :weight bold))))
`(erb-out-delim-face ((,class (:background ,nzenburn-bg+2))))
`(erb-comment-face ((,class (:background ,nzenburn-bg+2 :weight bold :slant italic))))
`(erb-comment-delim-face ((,class (:background ,nzenburn-bg+2))))
;; jabber-mode
`(jabber-roster-user-away ((t (:foreground ,nzenburn-green+2))))
`(jabber-roster-user-online ((t (:foreground ,nzenburn-blue-1))))
`(jabbee-roster-user-dnd ((t (:foreground ,nzenburn-red+1))))
`(jabber-rare-time-face ((t (:foreground ,nzenburn-green+1))))
`(jabber-chat-prompt-local ((t (:foreground ,nzenburn-blue-1))))
`(jabber-chat-prompt-foreign ((t (:foreground ,nzenburn-red+1))))
`(jabber-activity-face((t (:foreground ,nzenburn-red+1))))
`(jabber-activity-personal-face ((t (:foreground ,nzenburn-blue+1))))
`(jabber-title-small ((t (:height 1.1 :weight bold))))
`(jabber-title-medium ((t (:height 1.2 :weight bold))))
`(jabber-title-large ((t (:height 1.3 :weight bold))))
;; linum-mode
`(linum ((t (:foreground ,nzenburn-green+2 :background ,nzenburn-bg))))
;; macrostep
`(macrostep-gensym-1
((t (:foreground ,nzenburn-green+2 :background ,nzenburn-bg-1))))
`(macrostep-gensym-2
((t (:foreground ,nzenburn-red+1 :background ,nzenburn-bg-1))))
`(macrostep-gensym-3
((t (:foreground ,nzenburn-blue+1 :background ,nzenburn-bg-1))))
`(macrostep-gensym-4
((t (:foreground ,nzenburn-magenta :background ,nzenburn-bg-1))))
`(macrostep-gensym-5
((t (:foreground ,nzenburn-yellow :background ,nzenburn-bg-1))))
`(macrostep-expansion-highlight-face
((t (:inherit highlight))))
`(macrostep-macro-face
((t (:underline t))))
;; magit
`(magit-section-title ((t (:foreground ,nzenburn-yellow :weight bold))))
`(magit-branch ((t (:foreground ,nzenburn-orange :weight bold))))
`(magit-item-highlight ((t (:background ,nzenburn-bg+1))))
;; egg
`(egg-text-base ((t (:foreground ,nzenburn-fg))))
`(egg-help-header-1 ((t (:foreground ,nzenburn-yellow))))
`(egg-help-header-2 ((t (:foreground ,nzenburn-green+3))))
`(egg-branch ((t (:foreground ,nzenburn-yellow))))
`(egg-branch-mono ((t (:foreground ,nzenburn-yellow))))
`(egg-term ((t (:foreground ,nzenburn-yellow))))
`(egg-diff-add ((t (:foreground ,nzenburn-green+4))))
`(egg-diff-del ((t (:foreground ,nzenburn-red+1))))
`(egg-diff-file-header ((t (:foreground ,nzenburn-yellow-2))))
`(egg-section-title ((t (:foreground ,nzenburn-yellow))))
`(egg-stash-mono ((t (:foreground ,nzenburn-green+4))))
;; message-mode
`(message-cited-text ((t (:inherit font-lock-comment))))
`(message-header-name ((t (:foreground ,nzenburn-green+1))))
`(message-header-other ((t (:foreground ,nzenburn-green))))
`(message-header-to ((t (:foreground ,nzenburn-yellow :weight bold))))
`(message-header-from ((t (:foreground ,nzenburn-yellow :weight bold))))
`(message-header-cc ((t (:foreground ,nzenburn-yellow :weight bold))))
`(message-header-newsgroups ((t (:foreground ,nzenburn-yellow :weight bold))))
`(message-header-subject ((t (:foreground ,nzenburn-orange :weight bold))))
`(message-header-xheader ((t (:foreground ,nzenburn-green))))
`(message-mml ((t (:foreground ,nzenburn-yellow :weight bold))))
`(message-separator ((t (:inherit font-lock-comment))))
;; mew
`(mew-face-header-subject ((t (:foreground ,nzenburn-orange))))
`(mew-face-header-from ((t (:foreground ,nzenburn-yellow))))
`(mew-face-header-date ((t (:foreground ,nzenburn-green))))
`(mew-face-header-to ((t (:foreground ,nzenburn-red))))
`(mew-face-header-key ((t (:foreground ,nzenburn-green))))
`(mew-face-header-private ((t (:foreground ,nzenburn-green))))
`(mew-face-header-important ((t (:foreground ,nzenburn-blue))))
`(mew-face-header-marginal ((t (:foreground ,nzenburn-fg :weight bold))))
`(mew-face-header-warning ((t (:foreground ,nzenburn-red))))
`(mew-face-header-xmew ((t (:foreground ,nzenburn-green))))
`(mew-face-header-xmew-bad ((t (:foreground ,nzenburn-red))))
`(mew-face-body-url ((t (:foreground ,nzenburn-orange))))
`(mew-face-body-comment ((t (:foreground ,nzenburn-fg :slant italic))))
`(mew-face-body-cite1 ((t (:foreground ,nzenburn-green))))
`(mew-face-body-cite2 ((t (:foreground ,nzenburn-blue))))
`(mew-face-body-cite3 ((t (:foreground ,nzenburn-orange))))
`(mew-face-body-cite4 ((t (:foreground ,nzenburn-yellow))))
`(mew-face-body-cite5 ((t (:foreground ,nzenburn-red))))
`(mew-face-mark-review ((t (:foreground ,nzenburn-blue))))
`(mew-face-mark-escape ((t (:foreground ,nzenburn-green))))
`(mew-face-mark-delete ((t (:foreground ,nzenburn-red))))
`(mew-face-mark-unlink ((t (:foreground ,nzenburn-yellow))))
`(mew-face-mark-refile ((t (:foreground ,nzenburn-green))))
`(mew-face-mark-unread ((t (:foreground ,nzenburn-red-2))))
`(mew-face-eof-message ((t (:foreground ,nzenburn-green))))
`(mew-face-eof-part ((t (:foreground ,nzenburn-yellow))))
;; mic-paren
`(paren-face-match ((t (:foreground ,nzenburn-cyan :background ,nzenburn-bg :weight bold))))
`(paren-face-mismatch ((t (:foreground ,nzenburn-bg :background ,nzenburn-magenta :weight bold))))
`(paren-face-no-match ((t (:foreground ,nzenburn-bg :background ,nzenburn-red :weight bold))))
;; mingus
`(mingus-directory-face ((t (:foreground ,nzenburn-blue))))
`(mingus-pausing-face ((t (:foreground ,nzenburn-magenta))))
`(mingus-playing-face ((t (:foreground ,nzenburn-cyan))))
`(mingus-playlist-face ((t (:foreground ,nzenburn-cyan ))))
`(mingus-song-file-face ((t (:foreground ,nzenburn-yellow))))
`(mingus-stopped-face ((t (:foreground ,nzenburn-red))))
;; nav
`(nav-face-heading ((t (:foreground ,nzenburn-yellow))))
`(nav-face-button-num ((t (:foreground ,nzenburn-cyan))))
`(nav-face-dir ((t (:foreground ,nzenburn-green))))
`(nav-face-hdir ((t (:foreground ,nzenburn-red))))
`(nav-face-file ((t (:foreground ,nzenburn-fg))))
`(nav-face-hfile ((t (:foreground ,nzenburn-red-4))))
;; mu4e
`(mu4e-cited-1-face ((t (:foreground ,nzenburn-blue :slant italic))))
`(mu4e-cited-2-face ((t (:foreground ,nzenburn-green+2 :slant italic))))
`(mu4e-cited-3-face ((t (:foreground ,nzenburn-blue-2 :slant italic))))
`(mu4e-cited-4-face ((t (:foreground ,nzenburn-green :slant italic))))
`(mu4e-cited-5-face ((t (:foreground ,nzenburn-blue-4 :slant italic))))
`(mu4e-cited-6-face ((t (:foreground ,nzenburn-green-1 :slant italic))))
`(mu4e-cited-7-face ((t (:foreground ,nzenburn-blue :slant italic))))
`(mu4e-replied-face ((t (:foreground ,nzenburn-bg+3))))
`(mu4e-trashed-face ((t (:foreground ,nzenburn-bg+3 :strike-through t))))
;; mumamo
`(mumamo-background-chunk-major ((t (:background nil))))
`(mumamo-background-chunk-submode1 ((t (:background ,nzenburn-bg-1))))
`(mumamo-background-chunk-submode2 ((t (:background ,nzenburn-bg+2))))
`(mumamo-background-chunk-submode3 ((t (:background ,nzenburn-bg+3))))
`(mumamo-background-chunk-submode4 ((t (:background ,nzenburn-bg+1))))
;; org-mode
`(org-agenda-date-today
((t (:foreground "white" :slant italic :weight bold))) t)
`(org-agenda-structure
((t (:inherit font-lock-comment-face))))
`(org-archived ((t (:foreground ,nzenburn-fg :weight bold))))
`(org-checkbox ((t (:background ,nzenburn-bg+2 :foreground "white"
:box (:line-width 1 :style released-button)))))
`(org-date ((t (:foreground ,nzenburn-blue :underline t))))
`(org-deadline-announce ((t (:foreground ,nzenburn-red-1))))
`(org-done ((t (:bold t :weight bold :foreground ,nzenburn-green+3))))
`(org-formula ((t (:foreground ,nzenburn-yellow-2))))
`(org-headline-done ((t (:foreground ,nzenburn-green+3))))
`(org-hide ((t (:foreground ,nzenburn-bg-1))))
`(org-level-1 ((t (:foreground ,nzenburn-orange))))
`(org-level-2 ((t (:foreground ,nzenburn-green+4))))
`(org-level-3 ((t (:foreground ,nzenburn-blue-1))))
`(org-level-4 ((t (:foreground ,nzenburn-yellow-2))))
`(org-level-5 ((t (:foreground ,nzenburn-cyan))))
`(org-level-6 ((t (:foreground ,nzenburn-green+2))))
`(org-level-7 ((t (:foreground ,nzenburn-red-4))))
`(org-level-8 ((t (:foreground ,nzenburn-blue-4))))
`(org-link ((t (:foreground ,nzenburn-yellow-2 :underline t))))
`(org-scheduled ((t (:foreground ,nzenburn-green+4))))
`(org-scheduled-previously ((t (:foreground ,nzenburn-red-4))))
`(org-scheduled-today ((t (:foreground ,nzenburn-blue+1))))
`(org-special-keyword ((t (:foreground ,nzenburn-fg-1 :weight normal))))
`(org-table ((t (:foreground ,nzenburn-green+2))))
`(org-tag ((t (:bold t :weight bold))))
`(org-time-grid ((t (:foreground ,nzenburn-orange))))
`(org-todo ((t (:bold t :foreground ,nzenburn-red :weight bold))))
`(org-upcoming-deadline ((t (:inherit font-lock-keyword-face))))
`(org-warning ((t (:bold t :foreground ,nzenburn-red :weight bold :underline nil))))
`(org-column ((t (:background ,nzenburn-bg-1))))
`(org-column-title ((t (:background ,nzenburn-bg-1 :underline t :weight bold))))
;; outline
`(outline-1 ((t (:foreground ,nzenburn-orange))))
`(outline-2 ((t (:foreground ,nzenburn-green+4))))
`(outline-3 ((t (:foreground ,nzenburn-blue-1))))
`(outline-4 ((t (:foreground ,nzenburn-yellow-2))))
`(outline-5 ((t (:foreground ,nzenburn-cyan))))
`(outline-6 ((t (:foreground ,nzenburn-green+2))))
`(outline-7 ((t (:foreground ,nzenburn-red-4))))
`(outline-8 ((t (:foreground ,nzenburn-blue-4))))
;; rainbow-delimiters
`(rainbow-delimiters-depth-1-face ((t (:foreground ,nzenburn-fg))))
`(rainbow-delimiters-depth-2-face ((t (:foreground ,nzenburn-green+2))))
`(rainbow-delimiters-depth-3-face ((t (:foreground ,nzenburn-yellow-2))))
`(rainbow-delimiters-depth-4-face ((t (:foreground ,nzenburn-cyan))))
`(rainbow-delimiters-depth-5-face ((t (:foreground ,nzenburn-green-1))))
`(rainbow-delimiters-depth-6-face ((t (:foreground ,nzenburn-blue+1))))
`(rainbow-delimiters-depth-7-face ((t (:foreground ,nzenburn-yellow-1))))
`(rainbow-delimiters-depth-8-face ((t (:foreground ,nzenburn-green+1))))
`(rainbow-delimiters-depth-9-face ((t (:foreground ,nzenburn-blue-2))))
`(rainbow-delimiters-depth-10-face ((t (:foreground ,nzenburn-orange))))
`(rainbow-delimiters-depth-11-face ((t (:foreground ,nzenburn-green))))
`( rainbow-delimiters-depth-12-face ((t (:foreground ,nzenburn-blue-5))))
;; MMM-mode
`(mmm-code-submode-face ((t (:background ,nzenburn-bg+1))))
`(mmm-comment-submode-face ((t (:inherit font-lock-comment-face))))
`(mmm-output-submode-face ((t (:background ,nzenburn-bg+1))))
;;rcirc
`(rcirc-my-nick ((t (:foreground ,nzenburn-blue))))
`(rcirc-other-nick ((t (:foreground ,nzenburn-orange))))
`(rcirc-bright-nick ((t (:foreground ,nzenburn-blue+1))))
`(rcirc-dim-nick ((t (:foreground ,nzenburn-blue-2))))
`(rcirc-server ((t (:foreground ,nzenburn-green))))
`(rcirc-server-prefix ((t (:foreground ,nzenburn-green+1))))
`(rcirc-timestamp ((t (:foreground ,nzenburn-green+2))))
`(rcirc-nick-in-message ((t (:foreground ,nzenburn-yellow))))
`(rcirc-nick-in-message-full-line ((t (:bold t))))
`(rcirc-prompt ((t (:foreground ,nzenburn-yellow :bold t))))
`(rcirc-track-nick ((t (:inverse-video t))))
`(rcirc-track-keyword ((t (:bold t))))
`(rcirc-url ((t (:bold t))))
`(rcirc-keyword ((t (:foreground ,nzenburn-yellow :bold t))))
;; rpm-mode
`(rpm-spec-dir-face ((t (:foreground ,nzenburn-green))))
`(rpm-spec-doc-face ((t (:foreground ,nzenburn-green))))
`(rpm-spec-ghost-face ((t (:foreground ,nzenburn-red))))
`(rpm-spec-macro-face ((t (:foreground ,nzenburn-yellow))))
`(rpm-spec-obsolete-tag-face ((t (:foreground ,nzenburn-red))))
`(rpm-spec-package-face ((t (:foreground ,nzenburn-red))))
`(rpm-spec-section-face ((t (:foreground ,nzenburn-yellow))))
`(rpm-spec-tag-face ((t (:foreground ,nzenburn-blue))))
`(rpm-spec-var-face ((t (:foreground ,nzenburn-red))))
;; rst-mode
`(rst-level-1-face ((t (:foreground ,nzenburn-orange))))
`(rst-level-2-face ((t (:foreground ,nzenburn-green+1))))
`(rst-level-3-face ((t (:foreground ,nzenburn-blue-1))))
`(rst-level-4-face ((t (:foreground ,nzenburn-yellow-2))))
`(rst-level-5-face ((t (:foreground ,nzenburn-cyan))))
`(rst-level-6-face ((t (:foreground ,nzenburn-green-1))))
;; show-paren
`(show-paren-mismatch ((t (:foreground ,nzenburn-red-3 :background ,nzenburn-bg :weight bold))))
`(show-paren-match ((t (:foreground ,nzenburn-blue-1 :background ,nzenburn-bg :weight bold))))
;; sml-mode-line
'(sml-modeline-end-face ((t :inherit default :width condensed)))
;; SLIME
`(slime-repl-inputed-output-face ((t (:foreground ,nzenburn-red))))
;; tabbar
`(tabbar-button ((t (:foreground ,nzenburn-fg
:background ,nzenburn-bg))))
`(tabbar-selected ((t (:foreground ,nzenburn-fg
:background ,nzenburn-bg
:box (:line-width -1 :style pressed-button)))))
`(tabbar-unselected ((t (:foreground ,nzenburn-fg
:background ,nzenburn-bg+1
:box (:line-width -1 :style released-button)))))
;; term
`(term-color-black ((t (:foreground ,nzenburn-bg
:background ,nzenburn-bg-1))))
`(term-color-red ((t (:foreground ,nzenburn-red-2
:background ,nzenburn-red-4))))
`(term-color-green ((t (:foreground ,nzenburn-green
:background ,nzenburn-green+2))))
`(term-color-yellow ((t (:foreground ,nzenburn-orange
:background ,nzenburn-yellow))))
`(term-color-blue ((t (:foreground ,nzenburn-blue-1
:background ,nzenburn-blue-4))))
`(term-color-magenta ((t (:foreground ,nzenburn-magenta
:background ,nzenburn-red))))
`(term-color-cyan ((t (:foreground ,nzenburn-cyan
:background ,nzenburn-blue))))
`(term-color-white ((t (:foreground ,nzenburn-fg
:background ,nzenburn-fg-1))))
'(term-default-fg-color ((t (:inherit term-color-white))))
'(term-default-bg-color ((t (:inherit term-color-black))))
;; volatile-highlights
`(vhl/default-face ((t (:background ,nzenburn-bg-05))))
;; emacs-w3m
`(w3m-anchor ((t (:foreground ,nzenburn-yellow :underline t
:weight bold))))
`(w3m-arrived-anchor ((t (:foreground ,nzenburn-yellow-2
:underline t :weight normal))))
`(w3m-form ((t (:foreground ,nzenburn-red-1 :underline t))))
`(w3m-header-line-location-title ((t (:foreground ,nzenburn-yellow
:underline t :weight bold))))
'(w3m-history-current-url ((t (:inherit match))))
`(w3m-lnum ((t (:foreground ,nzenburn-green+2 :background ,nzenburn-bg))))
`(w3m-lnum-match ((t (:background ,nzenburn-bg-1
:foreground ,nzenburn-orange
:weight bold))))
`(w3m-lnum-minibuffer-prompt ((t (:foreground ,nzenburn-yellow))))
;; whitespace-mode
`(whitespace-space ((t (:background ,nzenburn-bg+1 :foreground ,nzenburn-bg+1))))
`(whitespace-hspace ((t (:background ,nzenburn-bg+1 :foreground ,nzenburn-bg+1))))
`(whitespace-tab ((t (:background ,nzenburn-red-1))))
`(whitespace-newline ((t (:foreground ,nzenburn-bg+1))))
`(whitespace-trailing ((t (:background ,nzenburn-red))))
`(whitespace-line ((t (:background ,nzenburn-bg :foreground ,nzenburn-magenta))))
`(whitespace-space-before-tab ((t (:background ,nzenburn-orange :foreground ,nzenburn-orange))))
`(whitespace-indentation ((t (:background ,nzenburn-yellow :foreground ,nzenburn-red))))
`(whitespace-empty ((t (:background ,nzenburn-yellow))))
`(whitespace-space-after-tab ((t (:background ,nzenburn-yellow :foreground ,nzenburn-red))))
;; wanderlust
`(wl-highlight-folder-few-face ((t (:foreground ,nzenburn-red-2))))
`(wl-highlight-folder-many-face ((t (:foreground ,nzenburn-red-1))))
`(wl-highlight-folder-path-face ((t (:foreground ,nzenburn-orange))))
`(wl-highlight-folder-unread-face ((t (:foreground ,nzenburn-blue))))
`(wl-highlight-folder-zero-face ((t (:foreground ,nzenburn-fg))))
`(wl-highlight-folder-unknown-face ((t (:foreground ,nzenburn-blue))))
`(wl-highlight-message-citation-header ((t (:foreground ,nzenburn-red-1))))
`(wl-highlight-message-cited-text-1 ((t (:foreground ,nzenburn-red))))
`(wl-highlight-message-cited-text-2 ((t (:foreground ,nzenburn-green+2))))
`(wl-highlight-message-cited-text-3 ((t (:foreground ,nzenburn-blue))))
`(wl-highlight-message-cited-text-4 ((t (:foreground ,nzenburn-blue+1))))
`(wl-highlight-message-header-contents-face ((t (:foreground ,nzenburn-green))))
`(wl-highlight-message-headers-face ((t (:foreground ,nzenburn-red+1))))
`(wl-highlight-message-important-header-contents ((t (:foreground ,nzenburn-green+2))))
`(wl-highlight-message-header-contents ((t (:foreground ,nzenburn-green+1))))
`(wl-highlight-message-important-header-contents2 ((t (:foreground ,nzenburn-green+2))))
`(wl-highlight-message-signature ((t (:foreground ,nzenburn-green))))
`(wl-highlight-message-unimportant-header-contents ((t (:foreground ,nzenburn-fg))))
`(wl-highlight-summary-answered-face ((t (:foreground ,nzenburn-blue))))
`(wl-highlight-summary-disposed-face ((t (:foreground ,nzenburn-fg
:slant italic))))
`(wl-highlight-summary-new-face ((t (:foreground ,nzenburn-blue))))
`(wl-highlight-summary-normal-face ((t (:foreground ,nzenburn-fg))))
`(wl-highlight-summary-thread-top-face ((t (:foreground ,nzenburn-yellow))))
`(wl-highlight-thread-indent-face ((t (:foreground ,nzenburn-magenta))))
`(wl-highlight-summary-refiled-face ((t (:foreground ,nzenburn-fg))))
`(wl-highlight-summary-displaying-face ((t (:underline t :weight bold))))
;; which-func-mode
`(which-func ((t (:foreground ,nzenburn-green+4))))
;; yascroll
`(yascroll:thumb-text-area ((t (:background ,nzenburn-bg-1))))
`(yascroll:thumb-fringe ((t (:background ,nzenburn-bg-1 :foreground ,nzenburn-bg-1)))))
;;; custom theme variables
(custom-theme-set-variables
'nzenburn
`(ansi-color-names-vector [,nzenburn-bg ,nzenburn-red ,nzenburn-green ,nzenburn-yellow
,nzenburn-blue ,nzenburn-magenta ,nzenburn-cyan ,nzenburn-fg])
;; fill-column-indicator
`(fci-rule-color ,nzenburn-bg-05)
;; vc-annotate
`(vc-annotate-color-map
'(( 20. . ,nzenburn-red-1)
( 40. . ,nzenburn-red)
( 60. . ,nzenburn-orange)
( 80. . ,nzenburn-yellow-2)
(100. . ,nzenburn-yellow-1)
(120. . ,nzenburn-yellow)
(140. . ,nzenburn-green-1)
(160. . ,nzenburn-green)
(180. . ,nzenburn-green+1)
(200. . ,nzenburn-green+2)
(220. . ,nzenburn-green+3)
(240. . ,nzenburn-green+4)
(260. . ,nzenburn-cyan)
(280. . ,nzenburn-blue-2)
(300. . ,nzenburn-blue-1)
(320. . ,nzenburn-blue)
(340. . ,nzenburn-blue+1)
(360. . ,nzenburn-magenta)))
`(vc-annotate-very-old-color ,nzenburn-magenta)
`(vc-annotate-background ,nzenburn-bg-1)
))
;;;###autoload
(and load-file-name
(boundp 'custom-theme-load-path)
(add-to-list 'custom-theme-load-path
(file-name-as-directory
(file-name-directory load-file-name))))
(provide-theme 'nzenburn)
;; Local Variables:
;; no-byte-compile: t
;; indent-tabs-mode: nil
;; eval: (when (fboundp 'rainbow-mode) (rainbow-mode +1))
;; End:
;;; nzenburn-theme.el ends here

@ -1,35 +0,0 @@
;;; paredit-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (paredit-mode) "paredit" "paredit.el" (20815 21545
;;;;;; 0 0))
;;; Generated autoloads from paredit.el
(autoload 'paredit-mode "paredit" "\
Minor mode for pseudo-structurally editing Lisp code.
With a prefix argument, enable Paredit Mode even if there are
imbalanced parentheses in the buffer.
Paredit behaves badly if parentheses are imbalanced, so exercise
caution when forcing Paredit Mode to be enabled, and consider
fixing imbalanced parentheses instead.
\\<paredit-mode-map>
\(fn &optional ARG)" t nil)
;;;***
;;;### (autoloads nil nil ("paredit-pkg.el") (20815 21545 400291
;;;;;; 0))
;;;***
(provide 'paredit-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; paredit-autoloads.el ends here

@ -1 +0,0 @@
(define-package "paredit" "22" "minor mode for editing parentheses -*- Mode: Emacs-Lisp -*-" (quote nil))

File diff suppressed because it is too large Load Diff

@ -1,33 +0,0 @@
;;; smex-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (smex-initialize smex) "smex" "smex.el" (20815
;;;;;; 21542 0 0))
;;; Generated autoloads from smex.el
(autoload 'smex "smex" "\
\(fn)" t nil)
(autoload 'smex-initialize "smex" "\
\(fn)" t nil)
;;;***
;;;### (autoloads nil nil ("smex-pkg.el") (20815 21542 636315 0))
;;;***
(provide 'smex-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; smex-autoloads.el ends here

@ -1 +0,0 @@
(define-package "smex" "2.0" "M-x interface with Ido-style fuzzy matching." (quote nil))

@ -1,493 +0,0 @@
;;; smex.el --- M-x interface with Ido-style fuzzy matching.
;; Copyright (C) 2009-2012 Cornelius Mika
;;
;; Author: Cornelius Mika <cornelius.mika@gmail.com>
;; URL: http://github.com/nonsequitur/smex/
;; Version: 2.0
;; Keywords: convenience, usability
;; This file is not part of GNU Emacs.
;;; License:
;; Licensed under the same terms as Emacs.
;;; Commentary:
;; Quick start:
;; run (smex-initialize)
;;
;; Bind the following commands:
;; smex, smex-major-mode-commands
;;
;; For a detailed introduction see:
;; http://github.com/nonsequitur/smex/blob/master/README.markdown
;;; Code:
(require 'ido)
(defgroup smex nil
"M-x interface with Ido-style fuzzy matching and ranking heuristics."
:group 'extensions
:group 'convenience
:link '(emacs-library-link :tag "Lisp File" "smex.el"))
(defcustom smex-auto-update t
"If non-nil, `Smex' checks for new commands each time it is run.
Turn it off for minor speed improvements on older systems."
:type 'boolean
:group 'smex)
(defcustom smex-save-file "~/.smex-items"
"File in which the smex state is saved between Emacs sessions.
Variables stored are: `smex-data', `smex-history'.
Must be set before initializing Smex."
:type 'string
:group 'smex)
(defcustom smex-history-length 7
"Determines on how many recently executed commands
Smex should keep a record.
Must be set before initializing Smex."
:type 'integer
:group 'smex)
(defcustom smex-prompt-string "M-x "
"String to display in the Smex prompt."
:type 'string
:group 'smex)
(defcustom smex-key-advice-ignore-menu-bar nil
"If non-nil, `smex-key-advice' ignores `menu-bar' bindings"
:type 'boolean
:group 'smex)
(defcustom smex-flex-matching t
"Enables Ido flex matching. On by default.
Set this to nil to disable fuzzy matching."
:type 'boolean
:group 'smex)
(defvar smex-initialized-p nil)
(defvar smex-cache)
(defvar smex-ido-cache)
(defvar smex-data)
(defvar smex-history)
(defvar smex-command-count 0)
(defvar smex-custom-action nil)
;;--------------------------------------------------------------------------------
;; Smex Interface
;;;###autoload
(defun smex ()
(interactive)
(unless smex-initialized-p
(smex-initialize))
(if (smex-already-running)
(smex-update-and-rerun)
(and smex-auto-update
(smex-detect-new-commands)
(smex-update))
(smex-read-and-run smex-ido-cache)))
(defsubst smex-already-running ()
(and (boundp 'ido-choice-list) (eql ido-choice-list smex-ido-cache)))
(defsubst smex-update-and-rerun ()
(smex-do-with-selected-item
(lambda (ignore) (smex-update) (smex-read-and-run smex-ido-cache ido-text))))
(defun smex-read-and-run (commands &optional initial-input)
(let ((chosen-item (intern (smex-completing-read commands initial-input))))
(if smex-custom-action
(let ((action smex-custom-action))
(setq smex-custom-action nil)
(funcall action chosen-item))
(unwind-protect
(progn (setq prefix-arg current-prefix-arg)
(setq this-command chosen-item)
(command-execute chosen-item 'record))
(smex-rank chosen-item)
(smex-show-key-advice chosen-item)
;; Todo: Is there a better way to manipulate 'last-repeatable-command'
;; from the inside of an interactively called function?
(run-at-time 0.01 nil (lambda (cmd) (setq last-repeatable-command cmd))
chosen-item)))))
(defun smex-major-mode-commands ()
"Like `smex', but limited to commands that are relevant to the active major mode."
(interactive)
(let ((commands (delete-dups (append (extract-commands-from-keymap (current-local-map))
(extract-commands-from-features major-mode)))))
(setq commands (smex-sort-according-to-cache commands))
(setq commands (mapcar #'symbol-name commands))
(smex-read-and-run commands)))
(defun smex-completing-read (choices initial-input)
(let ((ido-completion-map ido-completion-map)
(ido-setup-hook (cons 'smex-prepare-ido-bindings ido-setup-hook))
(ido-enable-prefix nil)
(ido-enable-flex-matching smex-flex-matching)
(ido-max-prospects 10))
(ido-completing-read (smex-prompt-with-prefix-arg) choices nil nil
initial-input nil (car choices))))
(defun smex-prompt-with-prefix-arg ()
(if (not current-prefix-arg)
smex-prompt-string
(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)))))
smex-prompt-string)))
(defun smex-prepare-ido-bindings ()
(define-key ido-completion-map (kbd "C-h f") 'smex-describe-function)
(define-key ido-completion-map (kbd "C-h w") 'smex-where-is)
(define-key ido-completion-map (kbd "M-.") 'smex-find-function)
(define-key ido-completion-map (kbd "C-a") 'move-beginning-of-line))
;;--------------------------------------------------------------------------------
;; Cache and Maintenance
(defun smex-rebuild-cache ()
(interactive)
(setq smex-cache nil)
;; Build up list 'new-commands' and later put it at the end of 'smex-cache'.
;; This speeds up sorting.
(let (new-commands)
(mapatoms (lambda (symbol)
(when (commandp symbol)
(let ((known-command (assq symbol smex-data)))
(if known-command
(setq smex-cache (cons known-command smex-cache))
(setq new-commands (cons (list symbol) new-commands)))))))
(if (eq (length smex-cache) 0)
(setq smex-cache new-commands)
(setcdr (last smex-cache) new-commands)))
(setq smex-cache (sort smex-cache 'smex-sorting-rules))
(smex-restore-history)
(setq smex-ido-cache (smex-convert-for-ido smex-cache)))
(defun smex-convert-for-ido (command-items)
(mapcar (lambda (command-item) (symbol-name (car command-item))) command-items))
(defun smex-restore-history ()
"Rearranges `smex-cache' according to `smex-history'"
(if (> (length smex-history) smex-history-length)
(setcdr (nthcdr (- smex-history-length 1) smex-history) nil))
(mapc (lambda (command)
(unless (eq command (caar smex-cache))
(let ((command-cell-position (smex-detect-position smex-cache (lambda (cell)
(eq command (caar cell))))))
(if command-cell-position
(let ((command-cell (smex-remove-nth-cell command-cell-position smex-cache)))
(setcdr command-cell smex-cache)
(setq smex-cache command-cell))))))
(reverse smex-history)))
(defun smex-sort-according-to-cache (list)
"Sorts a list of commands by their order in `smex-cache'"
(let (sorted)
(dolist (command-item smex-cache)
(let ((command (car command-item)))
(when (memq command list)
(setq sorted (cons command sorted))
(setq list (delq command list)))))
(nreverse (append list sorted))))
(defun smex-update ()
(interactive)
(smex-save-history)
(smex-rebuild-cache))
(defun smex-detect-new-commands ()
(let ((i 0))
(mapatoms (lambda (symbol) (if (commandp symbol) (setq i (1+ i)))))
(unless (= i smex-command-count)
(setq smex-command-count i))))
(defun smex-auto-update (&optional idle-time)
"Update Smex when Emacs has been idle for IDLE-TIME."
(unless idle-time (setq idle-time 60))
(run-with-idle-timer idle-time t
'(lambda () (if (smex-detect-new-commands) (smex-update)))))
;;;###autoload
(defun smex-initialize ()
(interactive)
(unless ido-mode (smex-initialize-ido))
(smex-load-save-file)
(smex-detect-new-commands)
(smex-rebuild-cache)
(add-hook 'kill-emacs-hook 'smex-save-to-file)
(setq smex-initialized-p t))
(defun smex-initialize-ido ()
"Sets up a minimal Ido environment for `ido-completing-read'."
(ido-init-completion-maps)
(add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup))
(defun smex-load-save-file ()
"Loads `smex-history' and `smex-data' from `smex-save-file'"
(let ((save-file (expand-file-name smex-save-file)))
(if (file-readable-p save-file)
(with-temp-buffer
(insert-file-contents save-file)
(condition-case nil
(setq smex-history (read (current-buffer))
smex-data (read (current-buffer)))
(error (if (save-file-not-empty-p)
(error "Invalid data in smex-save-file (%s). Can't restore history."
smex-save-file)
(if (not (boundp 'smex-history)) (setq smex-history))
(if (not (boundp 'smex-data)) (setq smex-data))))))
(setq smex-history nil smex-data nil))))
(defsubst save-file-not-empty-p ()
(string-match-p "\[^[:space:]\]" (buffer-string)))
(defun smex-save-history ()
"Updates `smex-history'"
(setq smex-history nil)
(let ((cell smex-cache))
(dotimes (i smex-history-length)
(setq smex-history (cons (caar cell) smex-history))
(setq cell (cdr cell))))
(setq smex-history (nreverse smex-history)))
(defun smex-save-to-file ()
(interactive)
(smex-save-history)
(with-temp-file (expand-file-name smex-save-file)
(ido-pp 'smex-history)
(ido-pp 'smex-data)))
;;--------------------------------------------------------------------------------
;; Ranking
(defun smex-sorting-rules (command-item other-command-item)
"Returns true if COMMAND-ITEM should sort before OTHER-COMMAND-ITEM."
(let* ((count (or (cdr command-item ) 0))
(other-count (or (cdr other-command-item) 0))
(name (car command-item))
(other-name (car other-command-item))
(length (length (symbol-name name)))
(other-length (length (symbol-name other-name))))
(or (> count other-count) ; 1. Frequency of use
(and (= count other-count)
(or (< length other-length) ; 2. Command length
(and (= length other-length)
(string< name other-name))))))) ; 3. Alphabetical order
(defun smex-rank (command)
(let ((command-item (or (assq command smex-cache)
;; Update caches and try again if not found.
(progn (smex-update)
(assq command smex-cache)))))
(when command-item
(smex-update-counter command-item)
;; Don't touch the cache order if the chosen command
;; has just been execucted previously.
(unless (eq command-item (car smex-cache))
(let (command-cell
(pos (smex-detect-position smex-cache (lambda (cell)
(eq command-item (car cell))))))
;; Remove the just executed command.
(setq command-cell (smex-remove-nth-cell pos smex-cache))
;; And put it on top of the cache.
(setcdr command-cell smex-cache)
(setq smex-cache command-cell)
;; Repeat the same for the ido cache. Should this be DRYed?
(setq command-cell (smex-remove-nth-cell pos smex-ido-cache))
(setcdr command-cell smex-ido-cache)
(setq smex-ido-cache command-cell)
;; Now put the last history item back to its normal place.
(smex-sort-item-at smex-history-length))))))
(defun smex-update-counter (command-item)
(let ((count (cdr command-item)))
(setcdr command-item
(if count
(1+ count)
;; Else: Command has just been executed for the first time.
;; Add it to `smex-data'.
(if smex-data
(setcdr (last smex-data) (list command-item))
(setq smex-data (list command-item)))
1))))
(defun smex-sort-item-at (n)
"Sorts item at position N in `smex-cache'."
(let* ((command-cell (nthcdr n smex-cache))
(command-item (car command-cell))
(command-count (cdr command-item)))
(let ((insert-at (smex-detect-position command-cell (lambda (cell)
(smex-sorting-rules command-item (car cell))))))
;; TODO: Should we handle the case of 'insert-at' being nil?
;; This will never happen in practice.
(when (> insert-at 1)
(setq command-cell (smex-remove-nth-cell n smex-cache))
;; smex-cache just got shorter by one element, so subtract '1' from insert-at.
(setq insert-at (+ n (- insert-at 1)))
(smex-insert-cell command-cell insert-at smex-cache)
;; Repeat the same for the ido cache. DRY?
(setq command-cell (smex-remove-nth-cell n smex-ido-cache))
(smex-insert-cell command-cell insert-at smex-ido-cache)))))
(defun smex-detect-position (cell function)
"Detects, relatively to CELL, the position of the cell
on which FUNCTION returns true.
Only checks cells after CELL, starting with the cell right after CELL.
Returns nil when reaching the end of the list."
(let ((pos 1))
(catch 'break
(while t
(setq cell (cdr cell))
(if (not cell)
(throw 'break nil)
(if (funcall function cell) (throw 'break pos))
(setq pos (1+ pos)))))))
(defun smex-remove-nth-cell (n list)
"Removes and returns the Nth cell in LIST."
(let* ((previous-cell (nthcdr (- n 1) list))
(result (cdr previous-cell)))
(setcdr previous-cell (cdr result))
result))
(defun smex-insert-cell (new-cell n list)
"Inserts cell at position N in LIST."
(let* ((cell (nthcdr (- n 1) list))
(next-cell (cdr cell)))
(setcdr (setcdr cell new-cell) next-cell)))
;;--------------------------------------------------------------------------------
;; Help and Reference
(defun smex-do-with-selected-item (fn)
(setq smex-custom-action fn)
(ido-exit-minibuffer))
(defun smex-describe-function ()
(interactive)
(smex-do-with-selected-item (lambda (chosen)
(describe-function chosen)
(pop-to-buffer "*Help*"))))
(defun smex-where-is ()
(interactive)
(smex-do-with-selected-item 'where-is))
(defun smex-find-function ()
(interactive)
(smex-do-with-selected-item 'find-function))
(defvar smex-old-message nil
"A temporary storage used by `smex-show-key-advice'")
(defun smex-show-key-advice (command)
"Shows the keybinding for command, if available. Like `execute-extended-command'."
(let ((advice (smex-key-advice command)))
(when advice
(if (current-message)
(progn
(run-at-time 2 nil (lambda (advice)
(setq smex-old-message (current-message))
(smex-unlogged-message advice)) advice)
(run-at-time 4.5 nil (lambda (advice)
(if (equal (current-message) advice)
(smex-unlogged-message smex-old-message))) advice))
(smex-unlogged-message advice)))))
(defun smex-key-advice (command)
(let ((keys (where-is-internal command)))
(if smex-key-advice-ignore-menu-bar
(setq keys (smex-filter-out-menu-bar-bindings keys)))
(if keys
(format "You can run the command `%s' with %s"
command
(mapconcat 'key-description keys ", ")))))
(defsubst smex-filter-out-menu-bar-bindings (keys)
(delq nil (mapcar (lambda (key-vec)
(unless (equal (aref key-vec 0) 'menu-bar)
key-vec))
keys)))
(defun smex-unlogged-message (string)
"Bypasses logging in *Messages*"
(let (message-log-max)
(message "%s" string)))
(defun extract-commands-from-keymap (map)
(let (commands)
(parse-keymap map)
commands))
(defun parse-keymap (map)
(map-keymap (lambda (binding element)
(if (and (listp element) (eq 'keymap (car element)))
(parse-keymap element)
; Strings are commands, too. Reject them.
(if (and (symbolp element) (commandp element))
(setq commands (cons element commands)))))
map))
(defun extract-commands-from-features (mode)
(let ((library-path (symbol-file mode))
(mode-name (symbol-name mode))
commands)
(string-match "\\(.+?\\)\\(-mode\\)?$" mode-name)
;; 'lisp-mode' -> 'lisp'
(setq mode-name (match-string 1 mode-name))
(if (string= mode-name "c") (setq mode-name "cc"))
(setq mode-name (regexp-quote mode-name))
(dolist (feature load-history)
(let ((feature-path (car feature)))
(when (and feature-path (or (equal feature-path library-path)
(string-match mode-name (file-name-nondirectory
feature-path))))
(dolist (item (cdr feature))
(if (and (listp item) (eq 'defun (car item)))
(let ((function (cdr item)))
(when (commandp function)
(setq commands (append commands (list function))))))))))
commands))
(defun smex-show-unbound-commands ()
"Shows unbound commands in a new buffer,
sorted by frequency of use."
(interactive)
(setq smex-data (sort smex-data 'smex-sorting-rules))
(let ((unbound-commands (delq nil
(mapcar (lambda (command-item)
(unless (where-is-internal (car command-item))
command-item))
smex-data))))
(view-buffer-other-window "*Smex: Unbound Commands*")
(setq buffer-read-only t)
(let ((inhibit-read-only t))
(erase-buffer)
(ido-pp 'unbound-commands))
(set-buffer-modified-p nil)
(goto-char (point-min))))
(provide 'smex)
;;; smex.el ends here

@ -1,44 +0,0 @@
;;; starter-kit-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads nil "starter-kit" "starter-kit.el" (20815 21546
;;;;;; 0 0))
;;; Generated autoloads from starter-kit.el
(dolist (mode '(menu-bar-mode tool-bar-mode scroll-bar-mode)) (when (fboundp mode) (funcall mode -1)))
(mapc 'require '(uniquify starter-kit-defuns starter-kit-misc))
(setq esk-system-config (concat user-emacs-directory system-name ".el") esk-user-config (concat user-emacs-directory user-login-name ".el") esk-user-dir (concat user-emacs-directory user-login-name))
(add-to-list 'load-path esk-user-dir)
(setq smex-save-file (concat user-emacs-directory ".smex-items"))
(smex-initialize)
(global-set-key (kbd "M-x") 'smex)
(when (file-exists-p esk-system-config) (load esk-system-config))
(when (file-exists-p esk-user-config) (load esk-user-config))
(when (file-exists-p esk-user-dir) (mapc 'load (directory-files esk-user-dir nil "^[^#].*el$")))
;;;***
;;;### (autoloads nil nil ("starter-kit-defuns.el" "starter-kit-misc.el"
;;;;;; "starter-kit-pkg.el") (20815 21546 307327 0))
;;;***
(provide 'starter-kit-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; starter-kit-autoloads.el ends here

@ -1,175 +0,0 @@
;;; starter-kit-defuns.el --- Saner defaults and goodies: function defs.
;;
;; Copyright (c) 2008-2010 Phil Hagelberg and contributors
;;
;; Author: Phil Hagelberg <technomancy@gmail.com>
;; URL: http://www.emacswiki.org/cgi-bin/wiki/StarterKit
;; Version: 2.0.2
;; Keywords: convenience
;; This file is not part of GNU Emacs.
;;; Commentary:
;; "Emacs outshines all other editing software in approximately the
;; same way that the noonday sun does the stars. It is not just bigger
;; and brighter; it simply makes everything else vanish."
;; -Neal Stephenson, "In the Beginning was the Command Line"
;; This file contains all the function definitions for the starter kit.
;;; 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
;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
;;; These belong in prog-mode-hook:
;; We have a number of turn-on-* functions since it's advised that lambda
;; functions not go in hooks. Repeatedly evaling an add-to-list with a
;; hook value will repeatedly add it since there's no way to ensure
;; that a byte-compiled lambda doesn't already exist in the list.
(defun esk-local-column-number-mode ()
(make-local-variable 'column-number-mode)
(column-number-mode t))
(defun esk-local-comment-auto-fill ()
(set (make-local-variable 'comment-auto-fill-only-comments) t)
(auto-fill-mode t))
(defun esk-turn-on-hl-line-mode ()
(when (> (display-color-cells) 8)
(hl-line-mode t)))
(defun esk-turn-on-save-place-mode ()
(require 'saveplace)
(setq save-place t))
(defun esk-turn-on-whitespace ()
(whitespace-mode t))
(defun esk-turn-on-paredit ()
(paredit-mode t))
(defun esk-turn-on-idle-highlight-mode ()
(idle-highlight-mode t))
(defun esk-pretty-lambdas ()
(font-lock-add-keywords
nil `(("(?\\(lambda\\>\\)"
(0 (progn (compose-region (match-beginning 1) (match-end 1)
,(make-char 'greek-iso8859-7 107))
nil))))))
(defun esk-add-watchwords ()
(font-lock-add-keywords
nil '(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\|NOCOMMIT\\)"
1 font-lock-warning-face t))))
(add-hook 'prog-mode-hook 'esk-local-column-number-mode)
(add-hook 'prog-mode-hook 'esk-local-comment-auto-fill)
(add-hook 'prog-mode-hook 'esk-turn-on-hl-line-mode)
(add-hook 'prog-mode-hook 'esk-turn-on-save-place-mode)
(add-hook 'prog-mode-hook 'esk-pretty-lambdas)
(add-hook 'prog-mode-hook 'esk-add-watchwords)
(add-hook 'prog-mode-hook 'esk-turn-on-idle-highlight-mode)
(defun esk-prog-mode-hook ()
(run-hooks 'prog-mode-hook))
(defun esk-turn-off-tool-bar ()
(tool-bar-mode -1))
(defun esk-untabify-buffer ()
(interactive)
(untabify (point-min) (point-max)))
(defun esk-indent-buffer ()
(interactive)
(indent-region (point-min) (point-max)))
(defun esk-cleanup-buffer ()
"Perform a bunch of operations on the whitespace content of a buffer."
(interactive)
(esk-indent-buffer)
(esk-untabify-buffer)
(delete-trailing-whitespace))
;; Commands
(defun esk-eval-and-replace ()
"Replace the preceding sexp with its value."
(interactive)
(backward-kill-sexp)
(condition-case nil
(prin1 (eval (read (current-kill 0)))
(current-buffer))
(error (message "Invalid expression")
(insert (current-kill 0)))))
(defun esk-sudo-edit (&optional arg)
(interactive "p")
(if (or arg (not buffer-file-name))
(find-file (concat "/sudo:root@localhost:" (ido-read-file-name "File: ")))
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
(defun esk-lorem ()
"Insert a lorem ipsum."
(interactive)
(insert "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do "
"eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim"
"ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut "
"aliquip ex ea commodo consequat. Duis aute irure dolor in "
"reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla "
"pariatur. Excepteur sint occaecat cupidatat non proident, sunt in "
"culpa qui officia deserunt mollit anim id est laborum."))
(defun esk-suck-it (suckee)
"Insert a comment of appropriate length about what can suck it."
(interactive "MWhat can suck it? ")
(let ((prefix (concat ";; " suckee " can s"))
(postfix "ck it!")
(col (current-column)))
(insert prefix)
(dotimes (_ (- 80 col (length prefix) (length postfix))) (insert "u"))
(insert postfix)))
(defun esk-insert-date ()
"Insert a time-stamp according to locale's date and time format."
(interactive)
(insert (format-time-string "%c" (current-time))))
(defun esk-pairing-bot ()
"If you can't pair program with a human, use this instead."
(interactive)
(message (if (y-or-n-p "Do you have a test for that? ") "Good." "Bad!")))
(defun esk-paredit-nonlisp ()
"Turn on paredit mode for non-lisps."
(interactive)
(set (make-local-variable 'paredit-space-for-delimiter-predicates)
'((lambda (endp delimiter) nil)))
(paredit-mode 1))
;; A monkeypatch to cause annotate to ignore whitespace
(defun vc-git-annotate-command (file buf &optional rev)
(let ((name (file-relative-name file)))
(vc-git-command buf 0 name "blame" "-w" rev)))
(provide 'starter-kit-defuns)
;;; starter-kit-defuns.el ends here

@ -1,135 +0,0 @@
;;; starter-kit-misc.el --- Saner defaults and goodies: miscellany
;;
;; Copyright (c) 2008-2010 Phil Hagelberg and contributors
;;
;; Author: Phil Hagelberg <technomancy@gmail.com>
;; URL: http://www.emacswiki.org/cgi-bin/wiki/StarterKit
;; Version: 2.0.2
;; Keywords: convenience
;; This file is not part of GNU Emacs.
;;; Commentary:
;; "Emacs outshines all other editing software in approximately the
;; same way that the noonday sun does the stars. It is not just bigger
;; and brighter; it simply makes everything else vanish."
;; -Neal Stephenson, "In the Beginning was the Command Line"
;; This file contains setqs and things that aren't bindings or defuns.
;;; 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
;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
(when window-system
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
(tooltip-mode -1)
(mouse-wheel-mode t)
(blink-cursor-mode -1))
;; can't do it at launch or emacsclient won't always honor it
(add-hook 'before-make-frame-hook 'esk-turn-off-tool-bar)
(setq visible-bell t
inhibit-startup-message t
color-theme-is-global t
sentence-end-double-space nil
shift-select-mode nil
mouse-yank-at-point t
uniquify-buffer-name-style 'forward
whitespace-style '(face trailing lines-tail tabs)
whitespace-line-column 80
ediff-window-setup-function 'ediff-setup-windows-plain
oddmuse-directory "~/.emacs.d/oddmuse"
save-place-file "~/.emacs.d/places"
backup-directory-alist `(("." . ,(expand-file-name "~/.emacs.d/backups")))
diff-switches "-u")
(add-to-list 'safe-local-variable-values '(lexical-binding . t))
(add-to-list 'safe-local-variable-values '(whitespace-line-column . 80))
;; Set this to whatever browser you use
;; (setq browse-url-browser-function 'browse-url-firefox)
;; (setq browse-url-browser-function 'browse-default-macosx-browser)
;; (setq browse-url-browser-function 'browse-default-windows-browser)
;; (setq browse-url-browser-function 'browse-default-kde)
;; (setq browse-url-browser-function 'browse-default-epiphany)
;; (setq browse-url-browser-function 'browse-default-w3m)
;; (setq browse-url-browser-function 'browse-url-generic
;; browse-url-generic-program "~/src/conkeror/conkeror")
;; Highlight matching parentheses when the point is on them.
(show-paren-mode 1)
;; ido-mode is like magic pixie dust!
(ido-mode t)
(ido-ubiquitous t)
(setq ido-enable-prefix nil
ido-enable-flex-matching t
ido-auto-merge-work-directories-length nil
ido-create-new-buffer 'always
ido-use-filename-at-point 'guess
ido-use-virtual-buffers t
ido-handle-duplicate-virtual-buffers 2
ido-max-prospects 10)
(set-default 'indent-tabs-mode nil)
(set-default 'indicate-empty-lines t)
(set-default 'imenu-auto-rescan t)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(add-hook 'text-mode-hook 'turn-on-flyspell)
(defalias 'yes-or-no-p 'y-or-n-p)
(defalias 'auto-tail-revert-mode 'tail-mode)
(random t) ;; Seed the random-number generator
;; Hippie expand: at times perhaps too hip
(dolist (f '(try-expand-line try-expand-list try-complete-file-name-partially))
(delete f hippie-expand-try-functions-list))
;; Add this back in at the end of the list.
(add-to-list 'hippie-expand-try-functions-list 'try-complete-file-name-partially t)
(eval-after-load 'grep
'(when (boundp 'grep-find-ignored-files)
(add-to-list 'grep-find-ignored-files "*.class")))
;; Cosmetics
(eval-after-load 'diff-mode
'(progn
(set-face-foreground 'diff-added "green4")
(set-face-foreground 'diff-removed "red3")))
(eval-after-load 'magit
'(progn
(set-face-foreground 'magit-diff-add "green4")
(set-face-foreground 'magit-diff-del "red3")))
;; Get around the emacswiki spam protection
(eval-after-load 'oddmuse
(add-hook 'oddmuse-mode-hook
(lambda ()
(unless (string-match "question" oddmuse-post)
(setq oddmuse-post (concat "uihnscuskc=1;" oddmuse-post))))))
(provide 'starter-kit-misc)
;;; starter-kit-misc.el ends here

@ -1,4 +0,0 @@
(define-package "starter-kit" "2.0.3"
"Saner defaults and goodies."
'((paredit "22") (idle-highlight-mode "1.1.1") (find-file-in-project "3.0")
(smex "1.1.1") (ido-ubiquitous "0.3") (magit "0.8.1")))

@ -1,66 +0,0 @@
;;; starter-kit.el --- Saner defaults and goodies.
;;
;; Copyright (c) 2008-2011 Phil Hagelberg and contributors
;;
;; Author: Phil Hagelberg <technomancy@gmail.com>
;; URL: http://www.emacswiki.org/cgi-bin/wiki/StarterKit
;; Version: 2.0.2
;; Keywords: convenience
;; This file is not part of GNU Emacs.
;;; Commentary:
;; "Emacs outshines all other editing software in approximately the
;; same way that the noonday sun does the stars. It is not just bigger
;; and brighter; it simply makes everything else vanish."
;; -Neal Stephenson, "In the Beginning was the Command Line"
;; This file just brings together other pieces of the starter kit plus
;; user- and host-specific configs.
;;; 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
;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
;;;###autoload
(progn
;; Turn off mouse interface early in startup to avoid momentary display
(dolist (mode '(menu-bar-mode tool-bar-mode scroll-bar-mode))
(when (fboundp mode) (funcall mode -1)))
(mapc 'require '(uniquify starter-kit-defuns starter-kit-misc))
;; You can keep system- or user-specific customizations here
(setq esk-system-config (concat user-emacs-directory system-name ".el")
esk-user-config (concat user-emacs-directory user-login-name ".el")
esk-user-dir (concat user-emacs-directory user-login-name))
(add-to-list 'load-path esk-user-dir)
(setq smex-save-file (concat user-emacs-directory ".smex-items"))
(smex-initialize)
(global-set-key (kbd "M-x") 'smex)
(when (file-exists-p esk-system-config) (load esk-system-config))
(when (file-exists-p esk-user-config) (load esk-user-config))
(when (file-exists-p esk-user-dir)
(mapc 'load (directory-files esk-user-dir nil "^[^#].*el$"))))
(provide 'starter-kit)
;;; starter-kit.el ends here

@ -1,80 +0,0 @@
;;; starter-kit-bindings-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads nil "starter-kit-bindings" "starter-kit-bindings.el"
;;;;;; (20815 22619 0 0))
;;; Generated autoloads from starter-kit-bindings.el
(global-set-key (kbd "C-c f") 'find-file-in-project)
(global-set-key (kbd "C-M-h") 'backward-kill-word)
(global-set-key (kbd "M-/") 'hippie-expand)
(global-set-key (kbd "C-c n") 'esk-cleanup-buffer)
(global-set-key (kbd "C-<f10>") 'menu-bar-mode)
(define-key global-map (kbd "C-+") 'text-scale-increase)
(define-key global-map (kbd "C--") 'text-scale-decrease)
(global-set-key (kbd "C-s") 'isearch-forward-regexp)
(global-set-key (kbd "") 'isearch-backward-regexp)
(global-set-key (kbd "C-M-s") 'isearch-forward)
(global-set-key (kbd "C-M-r") 'isearch-backward)
(global-set-key (kbd "C-x C-i") 'imenu)
(global-set-key (kbd "C-x M-f") 'ido-find-file-other-window)
(global-set-key (kbd "C-c y") 'bury-buffer)
(global-set-key (kbd "C-c r") 'revert-buffer)
(windmove-default-keybindings)
(global-set-key (kbd "C-x O") (lambda nil (interactive) (other-window -1)))
(global-set-key (kbd "C-x C-o") (lambda nil (interactive) (other-window 2)))
(global-set-key (kbd "C-x m") 'eshell)
(global-set-key (kbd "C-x M") (lambda nil (interactive) (eshell t)))
(global-set-key (kbd "C-x C-m") 'shell)
(global-set-key (kbd "C-c x") 'execute-extended-command)
(global-set-key (kbd "C-h a") 'apropos)
(global-set-key (kbd "C-c e") 'esk-eval-and-replace)
(global-set-key (kbd "C-c q") 'join-line)
(global-set-key (kbd "C-c g") 'magit-status)
(eval-after-load 'vc (define-key vc-prefix-map "i" '(lambda nil (interactive) (if (not (eq 'Git (vc-backend buffer-file-name))) (vc-register) (shell-command (format "git add %s" buffer-file-name)) (message "Staged changes.")))))
(define-key isearch-mode-map (kbd "C-o") (lambda nil (interactive) (let ((case-fold-search isearch-case-fold-search)) (occur (if isearch-regexp isearch-string (regexp-quote isearch-string))))))
;;;***
;;;### (autoloads nil nil ("starter-kit-bindings-pkg.el") (20815
;;;;;; 22619 431347 0))
;;;***
(provide 'starter-kit-bindings-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; starter-kit-bindings-autoloads.el ends here

@ -1 +0,0 @@
(define-package "starter-kit-bindings" "2.0.2" "Saner defaults and goodies: bindings" (quote ((starter-kit "2.0.2"))))

@ -1,121 +0,0 @@
;;; starter-kit-bindings.el --- Saner defaults and goodies: bindings
;;
;; Copyright (c) 2008-2010 Phil Hagelberg and contributors
;;
;; Author: Phil Hagelberg <technomancy@gmail.com>
;; URL: http://www.emacswiki.org/cgi-bin/wiki/StarterKit
;; Version: 2.0.2
;; Keywords: convenience
;; Package-Requires: ((starter-kit "2.0.2"))
;; This file is not part of GNU Emacs.
;;; Commentary:
;; "Emacs outshines all other editing software in approximately the
;; same way that the noonday sun does the stars. It is not just bigger
;; and brighter; it simply makes everything else vanish."
;; -Neal Stephenson, "In the Beginning was the Command Line"
;; This file just contains key bindings.
;;; 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
;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
;;;###autoload
(progn
;; It's all about the project.
(global-set-key (kbd "C-c f") 'find-file-in-project)
;; You know, like Readline.
(global-set-key (kbd "C-M-h") 'backward-kill-word)
;; Completion that uses many different methods to find options.
(global-set-key (kbd "M-/") 'hippie-expand)
;; Perform general cleanup.
(global-set-key (kbd "C-c n") 'esk-cleanup-buffer)
;; Turn on the menu bar for exploring new modes
(global-set-key (kbd "C-<f10>") 'menu-bar-mode)
;; Font size
(define-key global-map (kbd "C-+") 'text-scale-increase)
(define-key global-map (kbd "C--") 'text-scale-decrease)
;; Use regex searches by default.
(global-set-key (kbd "C-s") 'isearch-forward-regexp)
(global-set-key (kbd "\C-r") 'isearch-backward-regexp)
(global-set-key (kbd "C-M-s") 'isearch-forward)
(global-set-key (kbd "C-M-r") 'isearch-backward)
;; Jump to a definition in the current file. (Protip: this is awesome.)
(global-set-key (kbd "C-x C-i") 'imenu)
;; File finding
(global-set-key (kbd "C-x M-f") 'ido-find-file-other-window)
(global-set-key (kbd "C-c y") 'bury-buffer)
(global-set-key (kbd "C-c r") 'revert-buffer)
;; Window switching. (C-x o goes to the next window)
(windmove-default-keybindings) ;; Shift+direction
(global-set-key (kbd "C-x O") (lambda () (interactive) (other-window -1))) ;; back one
(global-set-key (kbd "C-x C-o") (lambda () (interactive) (other-window 2))) ;; forward two
;; Start eshell or switch to it if it's active.
(global-set-key (kbd "C-x m") 'eshell)
;; Start a new eshell even if one is active.
(global-set-key (kbd "C-x M") (lambda () (interactive) (eshell t)))
;; Start a regular shell if you prefer that.
(global-set-key (kbd "C-x C-m") 'shell)
;; If you want to be able to M-x without meta (phones, etc)
(global-set-key (kbd "C-c x") 'execute-extended-command)
;; Help should search more than just commands
(global-set-key (kbd "C-h a") 'apropos)
;; Should be able to eval-and-replace anywhere.
(global-set-key (kbd "C-c e") 'esk-eval-and-replace)
;; M-S-6 is awkward
(global-set-key (kbd "C-c q") 'join-line)
;; So good!
(global-set-key (kbd "C-c g") 'magit-status)
;; This is a little hacky since VC doesn't support git add internally
(eval-after-load 'vc
(define-key vc-prefix-map "i"
'(lambda () (interactive)
(if (not (eq 'Git (vc-backend buffer-file-name)))
(vc-register)
(shell-command (format "git add %s" buffer-file-name))
(message "Staged changes.")))))
;; Activate occur easily inside isearch
(define-key isearch-mode-map (kbd "C-o")
(lambda () (interactive)
(let ((case-fold-search isearch-case-fold-search))
(occur (if isearch-regexp isearch-string (regexp-quote isearch-string)))))))
(provide 'starter-kit-bindings)
;;; starter-kit-bindings.el ends here

@ -1,65 +0,0 @@
;;; starter-kit-ruby-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads nil "starter-kit-ruby" "starter-kit-ruby.el" (20815
;;;;;; 21578 0 0))
;;; Generated autoloads from starter-kit-ruby.el
(eval-after-load 'ruby-mode '(progn (ignore-errors (require 'ruby-compilation)) (setq ruby-use-encoding-map nil) (add-hook 'ruby-mode-hook 'inf-ruby-keys) (define-key ruby-mode-map (kbd "RET") 'reindent-then-newline-and-indent) (define-key ruby-mode-map (kbd "C-M-h") 'backward-kill-word)))
(global-set-key (kbd "C-h S-r") 'ri)
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.thor$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.gemspec$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.ru$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Thorfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Capfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Vagrantfile$" . ruby-mode))
(add-to-list 'completion-ignored-extensions ".rbc")
(add-to-list 'completion-ignored-extensions ".rbo")
(defun pcomplete/rake nil "\
Completion rules for the `ssh' command." (pcomplete-here (pcmpl-rake-tasks)))
(defun pcmpl-rake-tasks nil "\
Return a list of all the rake tasks defined in the current
projects. I know this is a hack to put all the logic in the
exec-to-string command, but it works and seems fast" (delq nil (mapcar (quote (lambda (line) (if (string-match "rake \\([^ ]+\\)" line) (match-string 1 line)))) (split-string (shell-command-to-string "rake -T") "[
]"))))
(defun rake (task) (interactive (list (completing-read "Rake (default: default): " (pcmpl-rake-tasks)))) (shell-command-to-string (concat "rake " (if (= 0 (length task)) "default" task))))
(eval-after-load 'ruby-compilation '(progn (defadvice ruby-do-run-w/compilation (before kill-buffer (name cmdlist)) (let ((comp-buffer-name (format "*%s*" name))) (when (get-buffer comp-buffer-name) (with-current-buffer comp-buffer-name (delete-region (point-min) (point-max)))))) (ad-activate 'ruby-do-run-w/compilation)))
(setq rinari-major-modes (list 'mumamo-after-change-major-mode-hook 'dired-mode-hook 'ruby-mode-hook 'css-mode-hook 'yaml-mode-hook 'javascript-mode-hook))
;;;***
;;;### (autoloads nil nil ("starter-kit-ruby-pkg.el") (20815 21578
;;;;;; 150254 0))
;;;***
(provide 'starter-kit-ruby-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; starter-kit-ruby-autoloads.el ends here

@ -1 +0,0 @@
(define-package "starter-kit-ruby" "2.0.3" "Saner defaults and goodies for Ruby" (quote ((inf-ruby "2.2.3") (starter-kit "2.0.1"))))

@ -1,106 +0,0 @@
;;; starter-kit-ruby.el --- Saner defaults and goodies for Ruby
;;
;; Copyright (c) 2008-2010 Phil Hagelberg and contributors
;;
;; Author: Phil Hagelberg <technomancy@gmail.com>
;; URL: http://www.emacswiki.org/cgi-bin/wiki/StarterKit
;; Version: 2.0.3
;; Keywords: convenience
;; Package-Requires: ((inf-ruby "2.2.3") (starter-kit "2.0.1"))
;; This file is not part of GNU Emacs.
;;; Commentary:
;; "Emacs outshines all other editing software in approximately the
;; same way that the noonday sun does the stars. It is not just bigger
;; and brighter; it simply makes everything else vanish."
;; -Neal Stephenson, "In the Beginning was the Command Line"
;; This file contains tweaks specific to Ruby.
;; This file is in need of a maintainer.
;;; 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
;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
;;;###autoload
(progn
(eval-after-load 'ruby-mode
'(progn
;; work around possible elpa bug
(ignore-errors (require 'ruby-compilation))
(setq ruby-use-encoding-map nil)
(add-hook 'ruby-mode-hook 'inf-ruby-keys)
(define-key ruby-mode-map (kbd "RET") 'reindent-then-newline-and-indent)
(define-key ruby-mode-map (kbd "C-M-h") 'backward-kill-word)))
(global-set-key (kbd "C-h S-r") 'ri)
;; Rake files are ruby, too, as are gemspecs, rackup files, etc.
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.thor$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.gemspec$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.ru$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Thorfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Capfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Vagrantfile$" . ruby-mode))
;; We never want to edit Rubinius bytecode or MacRuby binaries
(add-to-list 'completion-ignored-extensions ".rbc")
(add-to-list 'completion-ignored-extensions ".rbo")
;;; Rake
(defun pcomplete/rake ()
"Completion rules for the `ssh' command."
(pcomplete-here (pcmpl-rake-tasks)))
(defun pcmpl-rake-tasks ()
"Return a list of all the rake tasks defined in the current
projects. I know this is a hack to put all the logic in the
exec-to-string command, but it works and seems fast"
(delq nil (mapcar '(lambda(line)
(if (string-match "rake \\([^ ]+\\)" line) (match-string 1 line)))
(split-string (shell-command-to-string "rake -T") "[\n]"))))
(defun rake (task)
(interactive (list (completing-read "Rake (default: default): "
(pcmpl-rake-tasks))))
(shell-command-to-string (concat "rake " (if (= 0 (length task)) "default" task))))
;; Clear the compilation buffer between test runs.
(eval-after-load 'ruby-compilation
'(progn
(defadvice ruby-do-run-w/compilation (before kill-buffer (name cmdlist))
(let ((comp-buffer-name (format "*%s*" name)))
(when (get-buffer comp-buffer-name)
(with-current-buffer comp-buffer-name
(delete-region (point-min) (point-max))))))
(ad-activate 'ruby-do-run-w/compilation)))
;; Rinari (Minor Mode for Ruby On Rails)
(setq rinari-major-modes
(list 'mumamo-after-change-major-mode-hook 'dired-mode-hook 'ruby-mode-hook
'css-mode-hook 'yaml-mode-hook 'javascript-mode-hook)))
(provide 'starter-kit-ruby)
;;; starter-kit-ruby.el ends here

@ -1,64 +0,0 @@
;;; undo-tree-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads (global-undo-tree-mode undo-tree-mode) "undo-tree"
;;;;;; "undo-tree.el" (20836 47447))
;;; 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-map}
\(fn &optional ARG)" t nil)
(defvar global-undo-tree-mode nil "\
Non-nil if Global-Undo-Tree mode is enabled.
See the command `global-undo-tree-mode' for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `global-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)
;;;***
;;;### (autoloads nil nil ("undo-tree-pkg.el") (20836 47447 427512))
;;;***
(provide 'undo-tree-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; undo-tree-autoloads.el ends here

@ -1 +0,0 @@
(define-package "undo-tree" "0.6.3" "Treat undo history as a tree" (quote nil))

File diff suppressed because it is too large Load Diff

60
init.el

@ -24,6 +24,37 @@
(add-to-list 'custom-theme-load-path "~/.emacs.d/elpa/")
(load-theme 'zenburn t)
;; =============================================================================
;; ELPA
;; =============================================================================
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(defvar my-packages '(ctags ctags-update evil flymake mo-git-blame multiple-cursors no-easy-keys starter-kit-bindings starter-kit-ruby starter-kit magit ido-ubiquitous smex find-file-in-project idle-highlight-mode paredit inf-ruby undo-tree rainbow-delimiters)
"A list of packages to ensure are installed at launch.")
(defun ensure-package-installed (packages)
"Assure every package is installed, ask for installation if its not.
Return a list of installed packages or nil for every package not installed."
(mapcar
(lambda (package)
(if (package-installed-p package)
package
(progn (message (format "Installing package %s." package))
(package-install package))))
packages))
;; fetch the list of packages available
(unless package-archive-contents
(package-refresh-contents))
(ensure-package-installed my-packages)
;; =============================================================================
;; General Emacs Options
;; =============================================================================
@ -204,35 +235,6 @@
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c <") 'mc/mark-all-like-this)
;; =============================================================================
;; ELPA
;; =============================================================================
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
;; (when (not package-archive-contents)
;; (package-refresh-contents))
;; Add in your own as you wish:
;; (defvar my-packages '(starter-kit starter-kit-bindings)
;; "A list of packages to ensure are installed at launch.")
;; (when (not package-archive-contents)
;; (package-refresh-contents))
;; ;; Add in your own as you wish:
;; (defvar my-packages '(starter-kit starter-kit-lisp starter-kit-bindings)
;; "A list of packages to ensure are installed at launch.")
;; (dolist (p my-packages)
;; (when (not (package-installed-p p))
;; (package-install p)))
;; =============================================================================
;; elisp Helpers
;; =============================================================================