Commits

Anonymous committed 10f70b0

added anything.el

Comments (0)

Files changed (1)

+;;;; anything.el --- open anything / QuickSilver-like candidate-selection framework
+;; $Id: anything.el,v 1.282 2010-04-01 02:22:22 rubikitch Exp $
+
+;; Copyright (C) 2007              Tamas Patrovics
+;;               2008, 2009, 2010  rubikitch <rubikitch@ruby-lang.org>
+
+;; Author: Tamas Patrovics
+;; Maintainer: rubikitch <rubikitch@ruby-lang.org>
+;; Keywords: files, frames, help, matching, outlines, processes, tools, convenience, anything
+;; URL: http://www.emacswiki.org/cgi-bin/wiki/download/anything.el
+;; Site: http://www.emacswiki.org/cgi-bin/emacs/Anything
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;;
+;; Start with M-x anything, narrow the list by typing some pattern,
+;; select with up/down/pgup/pgdown/C-p/C-n/C-v/M-v, choose with enter,
+;; left/right moves between sources. With TAB actions can be selected
+;; if the selected candidate has more than one possible action.
+;;
+;; Note that anything.el provides only the framework and some example
+;; configurations for demonstration purposes. See anything-config.el
+;; for practical, polished, easy to use configurations which can be
+;; used to assemble a custom personalized configuration. And many
+;; other configurations are in the EmacsWiki.
+;; 
+;; http://www.emacswiki.org/cgi-bin/wiki/download/anything-config.el
+;; http://www.emacswiki.org/cgi-bin/emacs/AnythingSources
+;;
+;; Maintainer's configuration is in the EmacsWiki. It would tell you
+;; many tips to write smart sources!
+;;
+;; http://www.emacswiki.org/cgi-bin/emacs/RubikitchAnythingConfiguration
+;;
+;; Here is Japanese translation of `anything-sources' attributes. Thanks.
+;; http://d.hatena.ne.jp/sirocco634/20091012/1255336649
+
+;;; Bug Report:
+;;
+;; If you have problems, send a bug report via C-c C-x C-b in anything session (best)
+;; or M-x anything-send-bug-report outside anything session.
+;; I implemented bug report feature because I want to know your current state.
+;; It helps me to solve problems easily.
+;; The step is:
+;;  0) Setup mail in Emacs, the easiest way is:
+;;       (setq user-mail-address "your@mail.address")
+;;       (setq user-full-name "Your Full Name")
+;;       (setq smtpmail-smtp-server "your.smtp.server.jp")
+;;       (setq mail-user-agent 'message-user-agent)
+;;       (setq message-send-mail-function 'message-smtpmail-send-it)
+;;  1) Be sure to use the LATEST version of anything.el.
+;;  2) Enable debugger. M-x toggle-debug-on-error or (setq debug-on-error t)
+;;  3) Use Lisp version instead of compiled one: (load "anything.el")
+;;  4) Do it!
+;;  5) If you got an error, please do not close *Backtrace* buffer.
+;;  6) Type C-c C-x C-b (anything session, best!) 
+;;     or M-x anything-send-bug-report (outside)
+;;     then M-x insert-buffer *Backtrace* (if you got error)
+;;  7) Describe the bug using a precise recipe.
+;;  8) Type C-c C-c to send.
+;;  # If you are a Japanese, please write in Japanese:-)
+
+
+;;; Commands:
+;;
+;; Below are complete command list:
+;;
+;;  `anything'
+;;    Select anything. In Lisp program, some optional arguments can be used.
+;;  `anything-resume'
+;;    Resurrect previously invoked `anything'.
+;;  `anything-at-point'
+;;    Same as `anything' except when C-u is pressed, the initial input is the symbol at point.
+;;  `anything-force-update'
+;;    Recalculate and update candidates.
+;;  `anything-select-action'
+;;    Select an action for the currently selected candidate.
+;;  `anything-previous-line'
+;;    Move selection to the previous line.
+;;  `anything-next-line'
+;;    Move selection to the next line.
+;;  `anything-previous-page'
+;;    Move selection back with a pageful.
+;;  `anything-next-page'
+;;    Move selection forward with a pageful.
+;;  `anything-beginning-of-buffer'
+;;    Move selection at the top.
+;;  `anything-end-of-buffer'
+;;    Move selection at the bottom.
+;;  `anything-previous-source'
+;;    Move selection to the previous source.
+;;  `anything-next-source'
+;;    Move selection to the next source.
+;;  `anything-exit-minibuffer'
+;;    Select the current candidate by exiting the minibuffer.
+;;  `anything-help'
+;;    Help of `anything'.
+;;  `anything-debug-output'
+;;    Show all anything-related variables at this time.
+;;  `anything-delete-current-selection'
+;;    Delete the currently selected item.
+;;  `anything-delete-minibuffer-content'
+;;    Same as `delete-minibuffer-contents' but this is a command.
+;;  `anything-toggle-resplit-window'
+;;    Toggle resplit anything window, vertically or horizontally.
+;;  `anything-select-2nd-action'
+;;    Select the 2nd action for the currently selected candidate.
+;;  `anything-select-3rd-action'
+;;    Select the 3rd action for the currently selected candidate.
+;;  `anything-select-4th-action'
+;;    Select the 4th action for the currently selected candidate.
+;;  `anything-select-2nd-action-or-end-of-line'
+;;    Select the 2nd action for the currently selected candidate if the point is at the end of minibuffer.
+;;  `anything-execute-persistent-action'
+;;    If a candidate is selected then perform the associated action without quitting anything.
+;;  `anything-scroll-other-window'
+;;    Scroll other window (not *Anything* window) upward.
+;;  `anything-scroll-other-window-down'
+;;    Scroll other window (not *Anything* window) downward.
+;;  `anything-display-all-visible-marks'
+;;    Show all `anything' visible marks strings.
+;;  `anything-quit-and-find-file'
+;;    Drop into `find-file' from `anything' like `iswitchb-find-file'.
+;;  `anything-yank-selection'
+;;    Set minibuffer contents to current selection.
+;;  `anything-kill-selection-and-quit'
+;;    Store current selection to kill ring.
+;;  `anything-follow-mode'
+;;    If this mode is on, persistent action is executed everytime the cursor is moved.
+;;  `anything-migrate-sources'
+;;    Help to migrate to new `anything' way.
+;;  `anything-isearch'
+;;    Start incremental search within results. (UNMAINTAINED)
+;;  `anything-isearch-printing-char'
+;;    Add printing char to the pattern.
+;;  `anything-isearch-again'
+;;    Search again for the current pattern
+;;  `anything-isearch-delete'
+;;    Undo last event.
+;;  `anything-isearch-default-action'
+;;    Execute the default action for the selected candidate.
+;;  `anything-isearch-select-action'
+;;    Choose an action for the selected candidate.
+;;  `anything-isearch-cancel'
+;;    Cancel Anything isearch.
+;;  `anything-iswitchb-setup'
+;;    Integrate anything completion into iswitchb (UNMAINTAINED).
+;;  `anything-iswitchb-cancel-anything'
+;;    Cancel anything completion and return to standard iswitchb.
+;;  `anything-describe-anything-attribute'
+;;    Display the full documentation of ANYTHING-ATTRIBUTE (a symbol).
+;;  `anything-send-bug-report'
+;;    Send a bug report of anything.el.
+;;  `anything-send-bug-report-from-anything'
+;;    Send a bug report of anything.el in anything session.
+;;
+;;; Customizable Options:
+;;
+;; Below are customizable option list:
+;;
+
+;; You can extend `anything' by writing plug-ins. As soon as
+;; `anything' is invoked, `anything-sources' is compiled into basic
+;; attributes, then compiled one is used during invocation.
+;;
+;; The oldest built-in plug-in is `type' attribute: appends
+;; appropriate element of `anything-type-attributes'. Second built-in
+;; plug-in is `candidates-in-buffer': selecting a line from candidates
+;; buffer.
+;;
+;; To write a plug-in:
+;; 1. Define a compiler: anything-compile-source--*
+;; 2. Add compier function to `anything-compile-source-functions'.
+;; 3. (optional) Write helper functions.
+;;
+;; Anything plug-ins are found in the EmacsWiki.
+;;
+;; http://www.emacswiki.org/cgi-bin/emacs/AnythingPlugins
+
+;; Tested on Emacs 22/23.
+;;
+;;
+;; Thanks to Vagn Johansen for ideas.
+;; Thanks to Stefan Kamphausen for fixes and XEmacs support.
+;; Thanks to Tassilo Horn for fixes.
+;; Thanks to Drew Adams for various fixes (frame, isearch, customization, etc.)
+;; Thanks to IMAKADO for candidates-in-buffer idea.
+;; Thanks to Tomohiro MATSUYAMA for multiline patch.
+;;
+
+;;; (@* "Index")
+
+;;  If you have library `linkd.el', load
+;;  `linkd.el' and turn on `linkd-mode' now.  It lets you easily
+;;  navigate around the sections  Linkd mode will
+;;  highlight this Index.  You can get `linkd.el' here:
+;;  http://www.emacswiki.org/cgi-bin/wiki/download/linkd.el
+;;
+
+
+;;; (@* "INCOMPATIBLE CHANGES")
+
+;; v1.277
+;; 
+;;   Default setting of `anything-save-configuration-functions' is changed.
+;;   Anything saves/restores window configuration instead of frame configuration now.
+;;   The default is changed because flickering is occurred in some environment.
+;;   
+;;   If you want to save and restore frame configuration, set this variable to
+;;    '(set-frame-configuration . current-frame-configuration)
+;;
+;; v1.276
+;;
+;;   Fitting frame is disabled by default, because some flickering occurred
+;;   in some environment.  To enable fitting, set both
+;;   `anything-inhibit-fit-frame-flag' and `fit-frame-inhibit-fitting' to
+;;   nil.
+;;
+;; v1.114
+;;
+;;   `anything-attr' returns nil when the source attribute is defined
+;;   but the value of attribute is nil, eg. (volatile) cell. Use
+;;   `anything-attr-defined' when testing whether the attribute is
+;;   defined.
+
+;;; (@* "Tips")
+
+;; 
+;; `anything-enable-shortcuts' enables us to select candidate easily.
+;; If 'prefix then they can be selected using <prefix-key> <alnum>. 
+;; The prefix key is `anything-select-with-prefix-shortcut'.
+;; If the <prefix-key> is a letter, pressing twice inputs the letter itself.
+;; e.g.
+;;  (setq anything-enable-shortcuts 'prefix)
+;;  (define-key anything-map \"@\" 'anything-select-with-prefix-shortcut)
+
+;;
+;; You can edit current selection using `anything-edit-current-selection'.
+;; It is useful after persistent-action.
+
+;;
+;; For `anything' users, setting `anything-sources' directly and
+;; invoke M-x anything is obsolete way for now. Try M-x
+;; `anything-migrate-sources'!
+
+;;
+;; If you want to create anything sources, yasnippet would help you.
+;; http://yasnippet.googlecode.com/
+;;
+;; Then get the snippet from
+;; http://www.emacswiki.org/cgi-bin/wiki/download/anything-source.yasnippet
+;;
+;; Put it in ~/.emacs.d/plugins/yasnippet/snippets/text-mode/emacs-lisp-mode/
+
+
+;;
+;; `anything-interpret-value' is useful function to interpret value
+;; like `candidates' attribute.
+;;
+;; (anything-interpret-value "literal")            ; => "literal"
+;; (anything-interpret-value (lambda () "lambda")) ; => "lambda"
+;; (let ((source '((name . "lambda with source name"))))
+;;   (anything-interpret-value
+;;    (lambda () anything-source-name)
+;;    source))                             ; => "lambda with source name"
+;; (flet ((f () "function symbol"))
+;;   (anything-interpret-value 'f))        ; => "function symbol"
+;; (let ((v "variable symbol"))
+;;   (anything-interpret-value 'v))        ; => "variable symbol"
+;; (anything-interpret-value 'unbounded-1) ; error
+
+;;
+;; Now symbols are acceptable as candidates. So you do not have to use
+;; `symbol-name' function. The source is much simpler. For example,
+;; `apropos-internal' returns a list of symbols.
+;; 
+;;   (anything
+;;    '(((name . "Commands")
+;;       (candidates . (lambda () (apropos-internal anything-pattern 'commandp)))
+;;       (volatile)
+;;       (action . describe-function))))
+
+;;
+;; To mark a candidate, press C-SPC as normal Emacs marking. To go to
+;; marked candidate, press M-[ or M-].
+
+;;
+;; `anything-map' is now Emacs-standard key bindings by default. If
+;; you are using `iswitchb', execute `anything-iswitchb-setup'. Then
+;; some key bindings are adjusted to `iswitchb'. Note that
+;; anything-iswitchb is not maintained.
+
+;;
+;; There are many `anything' applications, using `anything' for
+;; selecting candidate. In this case, if there is one candidate or no
+;; candidate, popping up *anything* buffer is irritating. If one
+;; candidate, you want to select it at once. If no candidate, you want
+;; to quit `anything'. Set `anything-execute-action-at-once-if-one'
+;; and `anything-quit-if-no-candidate' to non-nil to remedy it. Note
+;; that setting these variables GLOBALLY is bad idea because of
+;; delayed sources. These are meant to be let-binded.
+;; See anything-etags.el for example.
+;;
+;; [EVAL IT] (install-elisp "http://www.emacswiki.org/cgi-bin/wiki/download/anything-etags.el")
+;;
+;; ex.
+;; (let ((anything-execute-action-at-once-if-one t)
+;;       (anything-quit-if-no-candidate (lambda () (message "No candidate"))))
+;;    (anything temporary-sources input))
+
+;;
+;; `set-frame-configuration' arises flickering. If you hate
+;; flickering, eval:
+;; (setq anything-save-configuration-functions
+;;    '(set-window-configuration . current-window-configuration))
+;; at the cost of restoring frame configuration (only window configuration).
+
+;;
+;; `anything-delete-current-selection' deletes the current line.
+;; It is useful when deleting a candidate in persistent action.
+;; eg. `kill-buffer'.
+;;
+;; [EVAL IT] (describe-function 'anything-delete-current-selection)
+
+;;
+;; `anything-attr' gets the attribute. `anything-attrset' sets the
+;; attribute. `anything-attr-defined' tests whether the attribute is
+;; defined. They handles source-local variables.
+;;
+;; [EVAL IT] (describe-function 'anything-attr)
+;; [EVAL IT] (describe-function 'anything-attrset)
+;; [EVAL IT] (describe-function 'anything-attr-defined)
+
+;;
+;; `anything-sources' accepts many attributes to make your life easier.
+;; Now `anything-sources' accepts a list of symbols.
+;;
+;; [EVAL IT] (describe-variable 'anything-sources)
+
+;;
+;; `anything' has optional arguments. Now you do not have to let-bind
+;; `anything-sources'.
+;;
+;; [EVAL IT] (describe-function 'anything)
+
+;;
+;; `anything-resume' resumes last `anything' session. Now you do not
+;; have to retype pattern.
+;;
+;; [EVAL IT] (describe-function 'anything-resume)
+
+;;
+;; `anything-execute-persistent-action' executes action without
+;; quitting `anything'. When popping up a buffer in other window by
+;; persistent action, you can scroll with `anything-scroll-other-window' and
+;; `anything-scroll-other-window-down'. See also `anything-sources' docstring.
+;;
+;; [EVAL IT] (describe-function 'anything-execute-persistent-action)
+;; [EVAL IT] (describe-variable 'anything-sources)
+
+;;
+;; `anything-select-2nd-action', `anything-select-3rd-action' and
+;; `anything-select-4th-action' select other than default action
+;; without pressing Tab.
+
+;;
+;; Using `anything-candidate-buffer' and the candidates-in-buffer
+;; attribute is much faster than traditional "candidates and match"
+;; way. And `anything-current-buffer-is-modified' avoids to
+;; recalculate candidates for unmodified buffer. See docstring of
+;; them.
+;;
+;; [EVAL IT] (describe-function 'anything-candidate-buffer)
+;; [EVAL IT] (describe-function 'anything-candidates-in-buffer)
+;; [EVAL IT] (describe-function 'anything-current-buffer-is-modified)
+
+;;
+;; `anything-current-buffer' and `anything-buffer-file-name' stores
+;; `(current-buffer)' and `buffer-file-name' in the buffer `anything'
+;; is invoked. Use them freely.
+;;
+;; [EVAL IT] (describe-variable 'anything-current-buffer)
+;; [EVAL IT] (describe-variable 'anything-buffer-file-name)
+
+;;
+;; `anything-completing-read' and `anything-read-file-name' are
+;; experimental implementation. If you are curious, type M-x
+;; anything-read-string-mode. It is a minor mode and toggles on/off.
+
+;;
+;; Use `anything-test-candidates' to test your handmade anything
+;; sources. It simulates contents of *anything* buffer with pseudo
+;; `anything-sources' and `anything-pattern', without side-effect. So
+;; you can unit-test your anything sources! Let's TDD!
+;;
+;; [EVAL IT] (describe-function 'anything-test-candidates)
+;;
+;; There are many unit-testing framework in Emacs Lisp. See the EmacsWiki.
+;; http://www.emacswiki.org/cgi-bin/emacs/UnitTesting
+;;
+;; There is an unit-test by Emacs Lisp Expectations at the tail of this file.
+;; http://www.emacswiki.org/cgi-bin/wiki/download/el-expectations.el
+;; http://www.emacswiki.org/cgi-bin/wiki/download/el-mock.el
+
+;;
+;; If you want to create anything sources, see anything-config.el.
+;; It is huge collection of sources. You can learn from examples.
+
+
+;; (@* "TODO")
+;;
+;;   - process status indication
+;;
+;;   - async sources doesn't honor digit-shortcut-count
+;;
+;;   - anything-candidate-number-limit can't be nil everywhere
+
+;; (@* "HISTORY")
+;; $Log: anything.el,v $
+;; Revision 1.280  2010-04-01 02:22:22  rubikitch
+;; `anything': new argument ANY-KEYMAP
+;;
+;; Revision 1.279  2010/03/31 09:22:58  rubikitch
+;; Add tips of yasnippet for source creators (no code change)
+;;
+;; Revision 1.278  2010/03/31 09:01:08  rubikitch
+;; Added info to INCOMPATIBLE CHANGES
+;;
+;; Revision 1.277  2010/03/31 08:56:53  rubikitch
+;; Anything saves/restores window configuration instead of frame configuration now.
+;; The default is changed because flickering is occurred in some environment.
+;;
+;; If you want to save and restore frame configuration, set this variable to
+;;  '(set-frame-configuration . current-frame-configuration)
+;;
+;; Revision 1.276  2010/03/31 08:52:50  rubikitch
+;; Fitting frame is disabled by default, because some flickering occurred
+;; in some environment.  To enable fitting, set both
+;; `anything-inhibit-fit-frame-flag' and `fit-frame-inhibit-fitting' to
+;; nil.
+;;
+;; Revision 1.275  2010/03/31 02:46:09  rubikitch
+;; (defvaralias 'anything-attributes 'anything-additional-attributes)
+;;
+;; Revision 1.274  2010/03/31 02:43:35  rubikitch
+;; New command: `anything-describe-anything-attribute'
+;;
+;; Revision 1.273  2010/03/31 02:37:18  rubikitch
+;; Document all attributes by `anything-document-attribute' instead of `anything-sources' docstring
+;;
+;; Revision 1.272  2010/03/29 21:05:47  rubikitch
+;; `anything-mode-line-string': use `make-local-variable' instead
+;;
+;; Revision 1.271  2010/03/29 09:59:17  rubikitch
+;; stupid bug
+;;
+;; Revision 1.270  2010/03/29 09:56:12  rubikitch
+;; Call `filtered-candidate-transformer' functions even if process sources
+;;
+;; Revision 1.269  2010/03/29 08:42:23  rubikitch
+;; * New attribute `resume'
+;; * Fix a bug of `disable-shortcuts' plug-in
+;;
+;; Revision 1.268  2010/03/28 21:42:01  rubikitch
+;; Add some keys in `anything-help'
+;;
+;; Revision 1.267  2010/03/28 20:11:30  rubikitch
+;; Modify `anything-mode-line-string'
+;;
+;; Revision 1.266  2010/03/28 06:12:43  rubikitch
+;; process source and multiline: in the making (not usable)
+;;
+;; Revision 1.265  2010/03/28 05:07:00  rubikitch
+;; Change default `anything-sources'. It is only a sample, no problem.
+;;
+;; Revision 1.264  2010/03/27 19:02:52  rubikitch
+;; New attributes: `mode-line' and `header-line'
+;;
+;; Revision 1.263  2010/03/27 02:34:40  rubikitch
+;; doc
+;;
+;; Revision 1.262  2010/03/27 02:31:55  rubikitch
+;; New command: `anything-force-update' C-c C-u
+;;
+;; Revision 1.261  2010/03/27 02:29:39  rubikitch
+;; New function `anything-goto-source'
+;;
+;; Revision 1.260  2010/03/27 02:01:28  rubikitch
+;; reimplement move selection commands
+;;
+;; Revision 1.259  2010/03/26 22:52:15  rubikitch
+;; `anything-quit-and-find-file':
+;;   If current selection is a buffer or a file, `find-file' from its directory.
+;;   Idea from http://i-yt.info/?date=20090826#p01 with some modification. Thanks.
+;;
+;; Revision 1.258  2010/03/26 12:10:55  rubikitch
+;; * modify `anything-mode-line-string'
+;; * New command `anything-help'
+;;
+;; Revision 1.257  2010/03/24 11:08:19  rubikitch
+;; revert to 1.255
+;;
+;; Revision 1.256  2010/03/24 08:29:43  rubikitch
+;; `anything-check-minibuffer-input' set repeat timer.
+;;
+;; Revision 1.255  2010/03/24 02:35:47  rubikitch
+;; `anything-candidate-number-limit':
+;; When (candidate-number-limit) is specified in SOURCE,
+;; cancel the effect of `anything-candidate-number-limit'.
+;;
+;; Revision 1.254  2010/03/23 00:33:18  rubikitch
+;; New API: `anything-interpret-value'
+;;
+;; Revision 1.253  2010/03/22 07:04:03  rubikitch
+;; `anything-get-current-source': return nil when no candidates rather than error
+;;
+;; Revision 1.252  2010/03/21 06:08:44  rubikitch
+;; Mark bug fix. thx hchbaw!
+;; http://d.hatena.ne.jp/hchbaw/20100226/1267200447
+;;
+;; Revision 1.251  2010/03/21 02:39:34  rubikitch
+;; Fix a wrong usage of `delq'. thx hchbaw.
+;; http://d.hatena.ne.jp/hchbaw/20100226/1267200447
+;;
+;; Revision 1.250  2010/03/21 02:32:29  rubikitch
+;; Fix `select deleted buffer' error message when calling `anything-resume'.
+;;
+;; It was occurred when killing `anything-current-buffer' and calling `anything-resume'.
+;;
+;; Revision 1.249  2010/02/23 20:43:35  rubikitch
+;; `anything-update': Ensure to call `anything-next-line'
+;;
+;; Revision 1.248  2010/02/20 12:34:38  rubikitch
+;; Mode-line help!! `anything-mode-line-string' is help string.
+;;
+;; Revision 1.247  2010/02/20 10:41:39  rubikitch
+;; Automatically update `anything-version' when upgrading
+;;
+;; Revision 1.246  2010/02/20 10:38:58  rubikitch
+;; update copyright
+;;
+;; Revision 1.245  2010/02/20 10:36:01  rubikitch
+;; New API: `anything-require-at-least-version'
+;;
+;; Revision 1.244  2010/02/20 10:06:54  rubikitch
+;; * New plug-in: `disable-shortcuts'
+;; * `dummy' plug-in implies `disable-shortcuts' because it enables us to input capital letters.
+;;
+;; Revision 1.243  2010/02/20 09:54:16  rubikitch
+;; `anything-compile-source--dummy': swap arguments of `append'
+;;
+;; Revision 1.242  2010/02/19 17:37:12  rubikitch
+;; error check in `anything-set-source-filter'
+;;
+;; Revision 1.241  2010/01/29 18:53:17  rubikitch
+;; Fix a bug of `candidate-number-limit' in process sources.
+;;
+;; Revision 1.240  2010/01/23 04:21:31  rubikitch
+;; * `anything': Use `anything-display-buffer' as fallback
+;; * `anything-select-with-digit-shortcut': `self-insert-command' if disabled
+;;
+;; Revision 1.239  2009/12/28 07:33:28  rubikitch
+;; New command: `anything-toggle-resplit-window'  (C-t)
+;;
+;; Revision 1.238  2009/12/28 07:19:37  rubikitch
+;; bugfix
+;;
+;; Revision 1.237  2009/12/28 07:15:30  rubikitch
+;; `anything-window-configuration' stores window configuration only.
+;;
+;; Revision 1.236  2009/12/28 07:07:09  rubikitch
+;; `anything-resume' resumes window configuration now.
+;;
+;; Revision 1.235  2009/12/28 04:12:33  rubikitch
+;; Fix tiny bug
+;;
+;; Revision 1.234  2009/12/28 03:57:33  rubikitch
+;; `anything-resume': New optional argument
+;;
+;; Revision 1.233  2009/12/28 03:43:12  rubikitch
+;; remove warnings
+;;
+;; Revision 1.232  2009/12/28 03:37:25  rubikitch
+;; refactoring
+;;
+;; Revision 1.231  2009/12/28 02:33:41  rubikitch
+;; refactoring
+;;
+;; Revision 1.230  2009/12/27 09:28:06  rubikitch
+;; `anything-window-configuration' save/restore anything window configuration (NOT YET)
+;;
+;; Revision 1.229  2009/12/26 21:41:33  rubikitch
+;; revive `anything-input' when resuming
+;;
+;; Revision 1.228  2009/12/25 01:34:35  rubikitch
+;; * `anything-resume' use anything interface to select anything buffers.
+;; * Its candidates are sorted by most recently used order.
+;; * 4th arg of `anything' accepts 'noresume not to resume this session.
+;;
+;; Revision 1.227  2009/12/19 20:30:12  rubikitch
+;; add `pattern-transformer' doc
+;;
+;; Revision 1.226  2009/12/19 20:15:47  rubikitch
+;; pattern-transformer can have multiple functions now
+;;
+;; Revision 1.225  2009/12/19 20:11:16  rubikitch
+;; add `delayed-init' doc
+;;
+;; Revision 1.224  2009/12/19 12:26:00  rubikitch
+;; New attribute `pattern-transformer'
+;;
+;; Revision 1.223  2009/12/19 11:57:41  rubikitch
+;; New attribute `delayed-init'
+;;
+;; Revision 1.222  2009/12/14 20:55:23  rubikitch
+;; Fix display bug: `anything-enable-digit-shortcuts' / multiline
+;;
+;; Revision 1.221  2009/12/14 20:29:49  rubikitch
+;; fix an error when executing `anything-prev-visible-mark' with no visible marks.
+;;
+;; Revision 1.220  2009/12/14 20:19:05  rubikitch
+;; Bugfix about anything-execute-action-at-once-if-one and multiline
+;;
+;; Revision 1.219  2009/12/14 03:21:11  rubikitch
+;; Extend alphabet shortcuts to A-Z
+;;
+;; Revision 1.218  2009/12/13 01:03:34  rubikitch
+;; Changed data structure of `anything-shortcut-keys-alist'
+;;
+;; Revision 1.217  2009/12/03 23:16:17  rubikitch
+;; silence warning
+;;
+;; Revision 1.216  2009/12/03 20:43:51  rubikitch
+;; Add keybindings for alphabet shortcuts
+;;
+;; Revision 1.215  2009/12/03 20:37:13  rubikitch
+;; `anything-enable-shortcuts' is an alias of `anything-enable-digit-shortcuts'.
+;; Alphabet shortcuts can be used now.
+;;
+;; Revision 1.214  2009/12/03 20:23:40  rubikitch
+;; `anything-enable-digit-shortcuts' also accepts 'alphabet.
+;;
+;; Now alphabet shortcuts are usable.
+;;
+;; Revision 1.213  2009/12/03 09:59:58  rubikitch
+;; refactoring
+;;
+;; Revision 1.212  2009/11/15 09:42:15  rubikitch
+;; refactoring
+;;
+;; Revision 1.211  2009/11/06 21:42:58  rubikitch
+;; New command: `anything-beginning-of-buffer', `anything-end-of-buffer'
+;;
+;; Revision 1.210  2009/10/22 13:30:06  rubikitch
+;; `real-to-display' function is evaluated just after `candidate-transformer' function now.
+;; This enables us to narrow candidates by display string by `real-to-display'.
+;;
+;; Revision 1.209  2009/10/21 20:25:10  rubikitch
+;; Add a document. (no code change)
+;;
+;; Revision 1.208  2009/10/21 11:31:15  rubikitch
+;; `anything': accept one source alist
+;;
+;; Revision 1.207  2009/10/16 19:47:39  rubikitch
+;; Link to Japanese translation of `anything-sources' attributes. (No code change)
+;;
+;; Revision 1.206  2009/10/10 09:28:54  rubikitch
+;; Remove an unnecessary test
+;;
+;; Revision 1.205  2009/10/10 06:21:28  rubikitch
+;; obsolete: `anything-c-marked-candidate-list'
+;; New function: `anything-marked-candidates'
+;;
+;; Revision 1.204  2009/10/06 21:01:12  rubikitch
+;; Call `anything-process-delayed-sources' only if delayed-sources is available.
+;;
+;; Revision 1.203  2009/10/02 10:04:07  rubikitch
+;; Tested on Emacs23 too. (no code change)
+;;
+;; Revision 1.202  2009/10/02 10:03:34  rubikitch
+;; * Display "no candidates" rather than assertion
+;; * Ensure to call `remove-hook' in `anything-current-buffer'
+;;
+;; Revision 1.201  2009/08/08 13:25:30  rubikitch
+;; `anything-toggle-visible-mark': move next line after unmarking
+;;
+;; Revision 1.200  2009/08/08 13:23:46  rubikitch
+;; `anything-toggle-visible-mark': Applied ThierryVolpiatto's patch. thx.
+;;
+;; Revision 1.199  2009/07/19 13:22:29  rubikitch
+;; `anything-follow-execute-persistent-action-maybe': execute persistent action after `anything-input-idle-delay'
+;;
+;; Revision 1.198  2009/07/06 15:22:48  rubikitch
+;; header modified (no code change)
+;;
+;; Revision 1.197  2009/06/29 15:10:13  rubikitch
+;; OOPS! remove debug code
+;;
+;; Revision 1.196  2009/06/29 13:29:25  rubikitch
+;; anything-follow-mode: automatical execution of persistent-action (C-c C-f)
+;;
+;; Revision 1.195  2009/06/19 14:42:57  rubikitch
+;; silence byte compiler
+;;
+;; Revision 1.194  2009/06/14 15:12:34  rubikitch
+;; typo
+;;
+;; Revision 1.193  2009/06/08 19:37:12  rubikitch
+;; typo!
+;;
+;; Revision 1.192  2009/06/08 19:36:39  rubikitch
+;; New keybind: C-e, C-j, C-k
+;;
+;; Revision 1.191  2009/06/08 19:30:27  rubikitch
+;; New command: `anything-select-2nd-action-or-end-of-line'
+;;
+;; Revision 1.190  2009/06/07 17:09:50  rubikitch
+;; add M-<next>, C-M-S-v, M-<prior> to `anything-map'.
+;;
+;; Revision 1.189  2009/06/01 21:36:31  rubikitch
+;; New function: `anything-other-buffer'
+;;
+;; Revision 1.188  2009/05/29 18:33:07  rubikitch
+;; avoid error when executing (anything-mark-current-line) in async process.
+;;
+;; Revision 1.187  2009/05/29 06:49:05  rubikitch
+;; small refactoring
+;;
+;; Revision 1.186  2009/05/29 06:46:34  rubikitch
+;; Prevent `anything-isearch-map' from overwriting `global-map'. With
+;; `copy-keymap', the prefix command "M-s" in `global-map' ends up
+;; getting clobbered by `anything-isearch-again', preventing `occur'
+;; (among other things) from running. This change replaces overwriting a
+;; copied map with writing to a sparse map whose parent is `global-map'.
+;;
+;; patched by DanielHackney. thanks!
+;;
+;; Revision 1.185  2009/05/25 19:07:42  rubikitch
+;; `anything': set `case-fold-search' to t
+;; Because users can assign commands to capital letter keys.
+;;
+;; Revision 1.184  2009/05/25 19:05:04  rubikitch
+;; Added auto-document
+;;
+;; Revision 1.183  2009/05/15 01:50:46  rubikitch
+;; typo
+;;
+;; Revision 1.182  2009/05/08 18:28:18  rubikitch
+;; Bug fix: `anything-attr' is usable in `header-name' function.
+;;
+;; Revision 1.181  2009/05/04 19:05:03  rubikitch
+;; * `anything-yank-selection' and `anything-kill-selection-and-quit' handles display string now.
+;; * `anything-get-selection': Added optional arguments.
+;;
+;; Revision 1.180  2009/05/03 19:03:34  rubikitch
+;; Add `anything-input' to `minibuffer-history' even if `anything' is quit.
+;;
+;; Revision 1.179  2009/04/20 16:35:44  rubikitch
+;; New keybindings in anything-map:
+;;   C-c C-d: `anything-delete-current-selection'
+;;   C-c C-y: `anything-yank-selection'
+;;   C-c C-k: `anything-kill-selection-and-quit'
+;;
+;; Revision 1.178  2009/04/20 16:18:58  rubikitch
+;; New variable: `anything-display-function'
+;;
+;; Revision 1.177  2009/04/20 02:17:16  rubikitch
+;; New commands: `anything-yank-selection', `anything-kill-selection-and-quit'
+;;
+;; Revision 1.176  2009/04/08 14:48:15  rubikitch
+;; bug fix in `anything-candidate-buffer'
+;;
+;; Revision 1.175  2009/03/22 19:10:37  rubikitch
+;; New Variable: `anything-scroll-amount' (thx. ThierryVolpiatto)
+;;
+;; Revision 1.174  2009/03/12 19:12:24  rubikitch
+;; New API: `define-anything-type-attribute'
+;;
+;; Revision 1.173  2009/03/11 08:10:32  rubikitch
+;; Update doc
+;;
+;; Revision 1.172  2009/03/10 17:11:58  rubikitch
+;; `candidate-transformer', `filtered-candidate-transformer',
+;; `action-transformer' attributes: accept a list of functions
+;;
+;; Revision 1.171  2009/03/09 18:49:44  rubikitch
+;; New command: `anything-quit-and-find-file'
+;;
+;; Revision 1.170  2009/03/09 18:46:11  rubikitch
+;; New API: `anything-run-after-quit'
+;;
+;; Revision 1.169  2009/03/09 10:02:49  rubikitch
+;; Set candidate-number-limit attribute for actions.
+;;
+;; Revision 1.168  2009/03/07 21:01:10  rubikitch
+;; Bug workaround
+;;
+;; Revision 1.167  2009/03/06 04:13:42  rubikitch
+;; Fix doc
+;;
+;; Revision 1.166  2009/03/03 10:35:57  rubikitch
+;; Set default `anything-input-idle-delay' to 0.1
+;;
+;; Revision 1.165  2009/03/03 07:14:42  rubikitch
+;; Make sure to run `anything-update-hook' after processing delayed sources.
+;;
+;; Revision 1.164  2009/03/02 01:51:40  rubikitch
+;; better error handling.
+;;
+;; Revision 1.163  2009/03/01 05:15:00  rubikitch
+;; anything-iswitchb and anything-isearch are marked as unmaintained.
+;; (document change only)
+;;
+;; Revision 1.162  2009/02/28 01:24:13  rubikitch
+;; Symbols are now acceptable as candidate.
+;;
+;; Revision 1.161  2009/02/27 07:18:46  rubikitch
+;; Fix bug of `anything-scroll-other-window' and `anything-scroll-other-window-down'.
+;;
+;; Revision 1.160  2009/02/27 01:05:06  rubikitch
+;; * Make sure to restore point after running `anything-update-hook'.
+;; * Make `anything-compute-matches' easy to find error.
+;;
+;; Revision 1.159  2009/02/26 23:45:48  rubikitch
+;; * Check whether candidate is a string, otherwise ignore.
+;;
+;; Revision 1.158  2009/02/24 06:39:20  rubikitch
+;; suppress compile warnings.
+;;
+;; Revision 1.157  2009/02/23 22:51:43  rubikitch
+;; New function: `anything-document-attribute'
+;;
+;; Revision 1.156  2009/02/23 21:36:09  rubikitch
+;; New Variable: `anything-display-source-at-screen-top'
+;;
+;; Revision 1.155  2009/02/23 21:30:52  rubikitch
+;; New command: `anything-at-point'
+;;
+;; Revision 1.154  2009/02/23 08:57:54  rubikitch
+;; Visible Mark
+;;
+;; Revision 1.153  2009/02/23 08:38:57  rubikitch
+;; update doc
+;;
+;; Revision 1.152  2009/02/23 08:32:17  rubikitch
+;; More key bindings.
+;;
+;; Revision 1.151  2009/02/23 08:21:24  rubikitch
+;; `anything-map' is now Emacs-standard key bindings by default.
+;; After evaluating `anything-iswitchb-setup'. some key bindings are adjusted to iswitchb.
+;;
+;; Revision 1.150  2009/02/20 22:58:18  rubikitch
+;; Cancel timer in `anything-cleanup'.
+;;
+;; Revision 1.149  2009/02/20 12:23:44  rubikitch
+;; `anything-header' face now inherits header-line (not a copy).
+;;
+;; Revision 1.148  2009/02/16 23:40:22  rubikitch
+;; `real-to-display' attribute bug fix.
+;;
+;; Revision 1.147  2009/02/02 20:51:41  rubikitch
+;; New `anything-sources' attribute: real-to-display
+;;
+;; Revision 1.146  2009/02/01 20:01:00  rubikitch
+;; Update Tips
+;;
+;; Revision 1.145  2009/02/01 19:45:53  rubikitch
+;; New variable: `anything-quit-if-no-candidate'
+;;
+;; Revision 1.144  2009/02/01 19:31:47  rubikitch
+;; fixed a typo
+;;
+;; Revision 1.143  2009/02/01 19:23:32  rubikitch
+;; New variable: `anything-execute-action-at-once-if-one'
+;;
+;; Revision 1.142  2009/02/01 19:12:34  rubikitch
+;; `anything-persistent-action-display-buffer': bug fix
+;;
+;; Revision 1.141  2009/02/01 18:25:25  rubikitch
+;; * fix docstring
+;; * New variable: `anything-selection-face'
+;;
+;; Revision 1.140  2009/01/16 16:36:25  rubikitch
+;; New variable: `anything-persistent-action-use-special-display'.
+;;
+;; Revision 1.139  2009/01/05 20:15:53  rubikitch
+;; Fixed a bug of anything action buffer.
+;; The action source should not be cached.
+;;
+;; Revision 1.138  2008/12/21 16:56:05  rubikitch
+;; Fixed an error when action attribute is a function symbol and press TAB,
+;;
+;; Revision 1.137  2008/12/20 19:38:47  rubikitch
+;; `anything-check-minibuffer-input-1': proper quit handling
+;; `anything-process-delayed-sources': ditto
+;;
+;; Revision 1.136  2008/10/27 17:41:27  rubikitch
+;; `anything-process-delayed-sources', `anything-check-minibuffer-input-1': quittable
+;;
+;; Revision 1.135  2008/10/27 17:04:25  rubikitch
+;; arranged source, added more linkd tags (no code change)
+;;
+;; Revision 1.134  2008/10/27 15:02:25  rubikitch
+;; New variable: `anything-save-configuration-functions'
+;; Delete variable: `anything-save-configuration-type'
+;;
+;; Revision 1.133  2008/10/27 11:16:13  rubikitch
+;; New variable: `anything-save-configuration-type'
+;;
+;; Revision 1.132  2008/10/26 22:34:59  rubikitch
+;; `anything-delete-current-selection' with multiline
+;;
+;; Revision 1.131  2008/10/26 21:44:43  rubikitch
+;; New command: `anything-delete-current-selection'
+;;
+;; Revision 1.130  2008/10/22 10:41:09  rubikitch
+;; `anything-insert-match': do not override 'anything-realvalue property
+;;
+;; Revision 1.129  2008/10/21 17:01:37  rubikitch
+;; `anything-resume' per buffer.
+;; `anything-last-sources': obsolete
+;;
+;; Revision 1.128  2008/10/20 06:27:54  rubikitch
+;; `anything-quick-update': new user option
+;;
+;; Revision 1.127  2008/10/20 05:47:49  rubikitch
+;; refactoring
+;;
+;; Revision 1.126  2008/10/20 03:47:58  rubikitch
+;; `anything-update': reversed order of delayed sources
+;;
+;; Revision 1.125  2008/10/19 00:29:54  rubikitch
+;; kill buffer-local candidate buffers when creating global candidate buffers.
+;;
+;; Revision 1.124  2008/10/18 13:04:20  rubikitch
+;; Remove tick entry from `anything-tick-hash' when killing a buffer.
+;;
+;; Revision 1.123  2008/10/18 10:23:36  rubikitch
+;; multiline patch by Tomohiro MATSUYAMA.
+;;
+;; Revision 1.122  2008/10/13 03:10:07  rubikitch
+;; `anything': do `anything-mark-current-line' when resuming
+;;
+;; Revision 1.121  2008/10/13 03:08:08  rubikitch
+;; always set `anything-current-position'
+;;
+;; Revision 1.120  2008/10/07 14:12:02  rubikitch
+;; `anything-execute-persistent-action': optional arg
+;;
+;; Revision 1.119  2008/10/06 06:43:29  rubikitch
+;; `anything-candidate-buffer': return nil when the buffer is dead
+;;
+;; Revision 1.118  2008/09/30 22:21:28  rubikitch
+;; New `anything-sources' attribute: accept-empty
+;; dummy: include accept-empty
+;;
+;; Revision 1.117  2008/09/30 21:59:10  rubikitch
+;; New function: `anything-buffer-is-modified'
+;;
+;; Revision 1.116  2008/09/22 11:27:29  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.115  2008/09/20 20:21:11  rubikitch
+;; added linkd index. (no code change)
+;;
+;; Revision 1.114  2008/09/20 20:09:57  rubikitch
+;; INCOMPATIBLE CHANGES: `anything-attr'
+;; New functions: `anything-attrset', `anything-attr-defined'
+;;
+;; Revision 1.113  2008/09/14 15:15:32  rubikitch
+;; bugfix: volatile and match attribute / process and match attribute
+;;
+;; Revision 1.112  2008/09/12 01:57:17  rubikitch
+;; When resuming anything, reinitialize overlays.
+;;
+;; Revision 1.111  2008/09/10 22:53:11  rubikitch
+;; anything: bug fix of `anything-buffer'
+;; New macro: `anything-test-update'
+;;
+;; Revision 1.110  2008/09/10 22:17:11  rubikitch
+;; New `anything-sources' attribute: header-name
+;;
+;; Revision 1.109  2008/09/10 21:12:26  rubikitch
+;; New hook: `anything-after-action-hook'
+;;
+;; Revision 1.108  2008/09/06 06:07:56  rubikitch
+;; Extended `anything-set-sources' optional arguments.
+;;
+;; Revision 1.107  2008/09/05 03:14:35  rubikitch
+;; reimplement `anything-current-buffer-is-modified' in the right way
+;;
+;; Revision 1.106  2008/09/05 00:11:05  rubikitch
+;; Moved `anything-read-string-mode' and read functions to anything-complete.el.
+;;
+;; Revision 1.105  2008/09/04 12:45:06  rubikitch
+;; New hook: `anything-after-persistent-action-hook'
+;;
+;; Revision 1.104  2008/09/04 12:27:05  rubikitch
+;; `anything': prefixed optional arguments
+;;
+;; Revision 1.103  2008/09/04 09:16:28  rubikitch
+;; fixed a bug of `anything-read-file-name'.
+;;
+;; Revision 1.102  2008/09/03 11:25:19  rubikitch
+;; Extended `anything' optional arguments: buffer
+;;
+;; Revision 1.101  2008/09/03 11:15:13  rubikitch
+;; `anything': return nil when keybord-quitted
+;;
+;; Revision 1.100  2008/09/01 23:11:02  rubikitch
+;; bug fix of search-from-end
+;;
+;; Revision 1.99  2008/09/01 13:45:55  rubikitch
+;; bug fix of search-from-end
+;;
+;; Revision 1.98  2008/09/01 11:23:38  rubikitch
+;; New `anything-sources' attribute: search-from-end
+;;
+;; Revision 1.97  2008/09/01 00:44:34  rubikitch
+;; Make sure to display the other window when persistent action.
+;;
+;; Revision 1.96  2008/08/31 20:55:20  rubikitch
+;; define `buffer-modified-tick' for older emacs.
+;;
+;; Revision 1.95  2008/08/30 04:55:51  rubikitch
+;; fixed a bug of `anything-completing-read'
+;;
+;; Revision 1.94  2008/08/28 20:18:03  rubikitch
+;; added some tests
+;;
+;; Revision 1.93  2008/08/25 20:18:46  rubikitch
+;; `anything': set `anything-input' and `anything-pattern' before `anything-update'
+;;
+;; Revision 1.92  2008/08/24 22:38:46  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.91  2008/08/24 21:34:35  rubikitch
+;; rewrite `with-anything-restore-variables'
+;;
+;; Revision 1.90  2008/08/24 20:33:02  rubikitch
+;; prevent the unit test from byte-compiled.
+;; macro bug fix.
+;;
+;; Revision 1.89  2008/08/24 08:35:27  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.88  2008/08/24 08:22:19  rubikitch
+;; Rename `anything-candidates-buffer' -> `anything-candidate-buffer'
+;;
+;; Revision 1.87  2008/08/23 22:27:04  rubikitch
+;; New hook: `anything-cleanup-hook'
+;;
+;; Revision 1.86  2008/08/23 22:05:42  rubikitch
+;; `anything-original-source-filter' is removed.
+;; Now use `anything-restored-variables' and `with-anything-restore-variables'.
+;;
+;; Revision 1.85  2008/08/23 21:23:21  rubikitch
+;; inhibit-read-only = t in anything-buffer
+;;
+;; Revision 1.84  2008/08/23 21:18:33  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.83  2008/08/23 20:44:20  rubikitch
+;; `anything-execute-persistent-action': display-to-real bug fix
+;;
+;; Revision 1.82  2008/08/23 20:19:12  rubikitch
+;; New `anything-sources' attribute: get-line
+;;
+;; Revision 1.81  2008/08/23 19:32:14  rubikitch
+;; `anything-attr': Return t in (attribute-name) case.
+;;
+;; Revision 1.80  2008/08/22 21:25:05  rubikitch
+;; anything-candidates-in-buffer-1:
+;; Open a line at the BOB to make use of `search-forward' for faster exact/prefix match.
+;; Of course, restore the buffer contents after search.
+;;
+;; Revision 1.79  2008/08/22 17:11:00  rubikitch
+;; New hook: `anything-before-initialize-hook', `anything-after-initialize-hook'
+;;
+;; Revision 1.78  2008/08/21 18:37:03  rubikitch
+;; Implemented dummy sources as plug-in.
+;;
+;; Revision 1.77  2008/08/21 17:40:40  rubikitch
+;; New function: `anything-set-sources'
+;;
+;; Revision 1.76  2008/08/21 12:25:02  rubikitch
+;; New variable: `anything-version'
+;;
+;; Revision 1.75  2008/08/21 12:13:46  rubikitch
+;; New variable: `anything-in-persistent-action'
+;;
+;; Revision 1.74  2008/08/21 10:34:22  rubikitch
+;; New function `anything-mklist'
+;;
+;; Revision 1.73  2008/08/21 09:41:38  rubikitch
+;; accept multiple init/cleanup functions so that plug-ins can add new function.
+;;
+;; Revision 1.72  2008/08/20 22:51:53  rubikitch
+;; New `anything-sources' attribute: candidate-number-limit
+;;
+;; Revision 1.71  2008/08/20 21:45:42  rubikitch
+;; added many tests.
+;;
+;; Revision 1.70  2008/08/20 18:51:45  rubikitch
+;; `anything-preselect' bug fix.
+;; refactoring.
+;;
+;; Revision 1.69  2008/08/20 17:57:51  rubikitch
+;; Extended `anything' optional arguments: preselect
+;;
+;; Revision 1.68  2008/08/20 16:39:07  rubikitch
+;; Nested `anything' invocation support, ie. `anything' can be invoked by anything action.
+;;
+;; (anything '(((name . "nested anything invocation test")
+;;              (candidates "anything-c-source-buffers" "anything-c-source-man-pages")
+;;              (display-to-real . intern)
+;;              (action . anything))))
+;;
+;; Revision 1.67  2008/08/20 00:08:28  rubikitch
+;; `anything-candidates-in-buffer-1': add code when pattern == ""
+;;
+;; Revision 1.66  2008/08/19 23:31:52  rubikitch
+;; Removed `anything-show-exact-match-first' because it should be provided as a plug-in.
+;;
+;; Revision 1.65  2008/08/19 23:18:47  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.64  2008/08/19 23:15:43  rubikitch
+;; `anything-compute-matches': short-cut when match == '(identity)
+;;
+;; Revision 1.63  2008/08/19 23:06:42  rubikitch
+;; Use hash table to speed uniquify candidates.
+;;
+;; Revision 1.62  2008/08/19 22:40:57  rubikitch
+;; `anything-test-candidates': additional optonal argument
+;;
+;; Revision 1.61  2008/08/19 18:13:39  rubikitch
+;; search attribute: multiple search functions
+;;
+;; Revision 1.60  2008/08/19 15:07:39  rubikitch
+;; New function: `anything-attr'
+;;
+;; Revision 1.59  2008/08/19 15:01:59  rubikitch
+;; arranged code
+;; added unit tests
+;; update doc
+;;
+;; Revision 1.58  2008/08/19 13:40:52  rubikitch
+;; `anything-get-current-source': This function can be used in
+;;  init/candidates/action/candidate-transformer/filtered-candidate-transformer
+;;  display-to-real/cleanup function.
+;;
+;; Revision 1.57  2008/08/19 03:43:57  rubikitch
+;; `anything-process-delayed-sources': delay = anything-idle-delay - anything-input-idle-delay
+;;
+;; Revision 1.56  2008/08/18 06:37:51  rubikitch
+;; Make `anything-input-idle-delay' ineffective when the action list is shown.
+;;
+;; Revision 1.55  2008/08/18 06:35:00  rubikitch
+;; New variable: `anything-show-exact-match-first'
+;;
+;; Revision 1.54  2008/08/17 23:22:24  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.53  2008/08/17 23:15:38  rubikitch
+;; bind `anything-source-name' when executing action to enable to use `anything-candidate-buffer' in action.
+;;
+;; Revision 1.52  2008/08/17 15:21:27  rubikitch
+;; `anything-test-candidates': accept a symbol for source
+;; New variable: `anything-input-idle-delay'
+;;
+;; Revision 1.51  2008/08/17 12:45:30  rubikitch
+;; (buffer-disable-undo) in anything-buffer
+;;
+;; Revision 1.50  2008/08/16 22:21:37  rubikitch
+;; `anything-saved-sources': removed
+;; `anything-action-buffer': action selection buffer
+;; `anything-select-action': toggle actions <=> candidates
+;;
+;; Revision 1.49  2008/08/16 19:46:11  rubikitch
+;; New function: `anything-action-list-is-shown'
+;;
+;; Revision 1.48  2008/08/16 17:03:02  rubikitch
+;; bugfix: cleanup
+;;
+;; Revision 1.47  2008/08/16 16:35:24  rubikitch
+;; silence byte compiler
+;;
+;; Revision 1.46  2008/08/16 14:51:27  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.45  2008/08/16 11:27:59  rubikitch
+;; refactoring
+;;  `anything-aif': Anaphoric if.
+;;  `anything-compile-source-functions': make `anything-get-sources' customizable.
+;;
+;; Revision 1.44  2008/08/16 09:38:15  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.43  2008/08/15 11:44:28  rubikitch
+;; `anything-read-string-mode': minor mode for `anything' version of read functions. (experimental)
+;;
+;; Revision 1.42  2008/08/15 11:03:20  rubikitch
+;; update docs
+;;
+;; Revision 1.41  2008/08/14 20:51:28  rubikitch
+;; New `anything-sources' attribute: cleanup
+;;
+;; Revision 1.40  2008/08/14 10:34:04  rubikitch
+;; `anything': SOURCES: accept symbols
+;;
+;; Revision 1.39  2008/08/10 22:46:01  rubikitch
+;; `anything-move-selection': avoid infinite loop
+;;
+;; Revision 1.38  2008/08/09 21:38:25  rubikitch
+;; `anything-read-file-name': experimental implementation.
+;;
+;; Revision 1.37  2008/08/09 17:54:25  rubikitch
+;; action test
+;;
+;; Revision 1.36  2008/08/09 17:13:00  rubikitch
+;; fixed test
+;;
+;; Revision 1.35  2008/08/09 10:43:08  rubikitch
+;; New `anything-sources' attribute: display-to-real
+;;
+;; Revision 1.34  2008/08/07 13:15:44  rubikitch
+;; New `anything-sources' attribute: search
+;;
+;; Revision 1.33  2008/08/05 23:14:20  rubikitch
+;; `anything-candidate-buffer': bugfix
+;;
+;; Revision 1.32  2008/08/05 21:42:15  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.31  2008/08/05 21:06:23  rubikitch
+;; `anything-candidate-buffer': candidates buffer registration
+;;
+;; Revision 1.30  2008/08/05 19:46:36  rubikitch
+;; New `anything-sources' attribute: candidates-in-buffer
+;;
+;; Revision 1.29  2008/08/05 17:58:31  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.28  2008/08/05 17:46:04  rubikitch
+;; memoized `anything-get-sources'
+;;
+;; Revision 1.27  2008/08/05 17:29:40  rubikitch
+;; update doc
+;;
+;; Revision 1.26  2008/08/05 08:35:45  rubikitch
+;; `anything-completing-read': accept obarray
+;;
+;; Revision 1.25  2008/08/05 07:26:17  rubikitch
+;; `anything-completing-read': guard from non-string return value
+;;
+;; Revision 1.24  2008/08/04 12:05:41  rubikitch
+;; Wrote Tips and some docstrings.
+;; `anything-candidate-buffer': buffer-local by default
+;;
+;; Revision 1.23  2008/08/04 05:29:46  rubikitch
+;; `anything-buffer-file-name': `buffer-file-name' when `anything' is invoked.
+;;
+;; Revision 1.22  2008/08/04 00:10:13  rubikitch
+;; `anything-candidate-buffer': new API
+;;
+;; Revision 1.21  2008/08/03 22:05:08  rubikitch
+;; `anything-candidate-buffer': Return a buffer containing candidates of current source.
+;;
+;; Revision 1.20  2008/08/03 20:47:56  rubikitch
+;; `anything-current-buffer-is-modified': modify checker
+;;
+;; Revision 1.19  2008/08/03 19:06:18  rubikitch
+;; `anything-candidates-in-buffer': use `with-current-buffer' instead.
+;;
+;; Revision 1.18  2008/08/03 05:55:01  rubikitch
+;; `anything-candidates-in-buffer': extract candidates in a buffer for speed.
+;;
+;; Revision 1.17  2008/08/02 21:31:29  rubikitch
+;; Extended `anything' optional arguments.
+;; `anything-completing-read': experimental implementation.
+;;
+;; Revision 1.16  2008/08/02 20:32:54  rubikitch
+;; Extended `anything' optional arguments.
+;;
+;; Revision 1.15  2008/08/02 16:53:40  rubikitch
+;; Fixed a small bug of `anything-test-candidates'.
+;;
+;; Revision 1.14  2008/08/02 16:48:29  rubikitch
+;; Refactored to testable code.
+;; Added many candidate tests with `anything-test-candidates'.
+;;
+;; Revision 1.13  2008/08/02 15:08:14  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.12  2008/08/02 14:29:31  rubikitch
+;; `anything-sources' accepts symbols. (patched by Sugawara)
+;;
+;; Revision 1.11  2008/08/02 10:20:36  rubikitch
+;; `anything-resume' is usable with other (let-binded) `anything-sources'.
+;;
+;; Revision 1.10  2008/08/01 19:44:01  rubikitch
+;; `anything-resume': resurrect previously invoked `anything'.
+;;
+;; Revision 1.9  2008/07/30 15:44:49  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.8  2008/07/30 15:38:51  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.7  2008/07/30 15:21:48  rubikitch
+;; `anything-scroll-other-window', `anything-scroll-other-window-down':
+;; Scroll other window (for persistent action).
+;;
+;; Revision 1.6  2008/07/30 15:12:36  rubikitch
+;; *** empty log message ***
+;;
+;; Revision 1.5  2008/07/30 15:06:32  rubikitch
+;; `anything-select-2nd-action', `anything-select-3rd-action', `anything-select-4th-action':
+;; Select other than default action without pressing Tab.
+;;
+;; Revision 1.4  2008/07/30 14:58:27  rubikitch
+;; `anything-current-buffer': Store current buffer when `anything' is invoked.
+;; `anything-current-position': Restore position when keyboard-quitted.
+;;
+;; Revision 1.3  2008/07/30 14:38:04  rubikitch
+;; Implemented persistent action.
+;;
+;; Revision 1.2  2008/07/30 13:37:16  rubikitch
+;; Update doc.
+;;
+;; Revision 1.1  2008/07/30 13:22:06  rubikitch
+;; New maintainer.
+;;
+
+;; ugly hack to auto-update version
+(defvar anything-version nil)
+(setq anything-version "$Id: anything.el,v 1.280 2010-04-01 02:22:22 rubikitch Exp $")
+(require 'cl)
+;; (require 'anything-match-plugin nil t)
+
+;; (@* "User Configuration")
+
+;; This is only an example. Customize it to your own taste!
+(defvar anything-sources `(((name . "Buffers")
+                            (candidates
+                             . (lambda ()
+                                 (remove-if (lambda (name)
+                                              (or (equal name anything-buffer)
+                                                  (eq ?\  (aref name 0))))
+                                            (mapcar 'buffer-name (buffer-list)))))
+			    (type . buffer))
+
+                           ((name . "File Name History")
+                            (candidates . file-name-history)
+                            (match (lambda (candidate)
+                                     ;; list basename matches first
+                                     (string-match 
+                                      anything-pattern 
+                                      (file-name-nondirectory candidate)))
+
+                                   (lambda (candidate)                                     
+                                     ;; and then directory part matches
+                                     (let ((dir (file-name-directory candidate)))
+                                       (if dir
+                                           (string-match anything-pattern dir)))))
+                            (type . file))
+
+                           ((name . "Files from Current Directory")
+                            (init . (lambda ()
+                                      (setq anything-default-directory
+                                            default-directory)))
+                            (candidates . (lambda ()
+                                            (directory-files
+                                             anything-default-directory)))
+                            (type . file))
+
+                           ((name . "Complex Command History")
+                            (candidates . (lambda ()
+                                            (mapcar 'prin1-to-string
+                                                    command-history)))
+                            (action . (("Repeat Complex Command" . 
+                                        (lambda (c)
+                                          (eval (read c))))))
+                            (delayed)))
+  "The source of candidates for anything.
+It accepts symbols:
+ (setq anything-sources (list anything-c-foo anything-c-bar))
+can be written as
+ (setq anything-sources '(anything-c-foo anything-c-bar))
+The latter is recommended because if you change anything-c-* variable,
+you do not have to update `anything-sources'.
+
+You are STRONGLY recommended to define a command which calls
+`anything' or `anything-other-buffer' with argument rather than
+to set `anything-sources' externally.
+
+If you want to change `anything-sources' during `anything' invocation,
+use `anything-set-sources', never use `setq'.
+
+Attributes:
+
+")
+
+
+;; This value is only provided as an example. Customize it to your own
+;; taste!
+(defvar anything-type-attributes
+  '((file (action . (("Find File" . find-file)
+                     ("Delete File" . (lambda (file)
+                                        (if (y-or-n-p (format "Really delete file %s? "
+                                                              file))
+                                            (delete-file file)))))))
+    (buffer (action . (("Switch to Buffer" . switch-to-buffer)
+                       ("Pop to Buffer"    . pop-to-buffer)
+                       ("Display Buffer"   . display-buffer)
+                       ("Kill Buffer"      . kill-buffer)))))
+  "It's a list of (TYPE ATTRIBUTES ...). ATTRIBUTES are the same
+  as attributes for `anything-sources'. TYPE connects the value
+  to the appropriate sources in `anything-sources'.
+
+  This allows specifying common attributes for several
+  sources. For example, sources which provide files can specify
+  common attributes with a `file' type.")
+
+
+(defvar anything-enable-shortcuts nil
+  "*Whether to use digit/alphabet shortcut to select the first nine matches.
+If t then they can be selected using Ctrl+<number>.
+
+If 'prefix then they can be selected using <prefix-key> <alnum>. 
+The prefix key is `anything-select-with-prefix-shortcut'.
+If the <prefix-key> is a letter, pressing twice inputs the letter itself.
+e.g.
+ (setq anything-enable-shortcuts 'prefix)
+ (define-key anything-map \"@\" 'anything-select-with-prefix-shortcut)
+ 
+If 'alphabet then they can be selected using Shift+<alphabet> (deprecated).
+It is not recommended because you cannot input capital letters in pattern.
+
+Keys (digit/alphabet) are listed in `anything-shortcut-keys-alist'.")
+
+(defvaralias 'anything-enable-digit-shortcuts 'anything-enable-shortcuts
+  "Alphabet shortcuts are usable now. Then `anything-enable-digit-shortcuts' should be renamed.
+`anything-enable-digit-shortcuts' is retained for compatibility.")
+
+(defvar anything-shortcut-keys-alist
+  '((alphabet . "asdfghjklzxcvbnmqwertyuiop")
+    (prefix   . "asdfghjklzxcvbnmqwertyuiop1234567890")
+    (t        . "123456789")))
+
+(defvar anything-display-source-at-screen-top t
+  "*If t, `anything-next-source' and `anything-previous-source'
+  display candidates at the top of screen.")
+
+(defvar anything-candidate-number-limit 50
+  "*Do not show more candidates than this limit from individual
+  sources. It is usually pointless to show hundreds of matches
+  when the pattern is empty, because it is much simpler to type a
+  few characters to narrow down the list of potential candidates.
+
+  Set it to nil if you don't want this limit.")
+
+
+(defvar anything-idle-delay 0.5
+  "*The user has to be idle for this many seconds, before
+  candidates from delayed sources are collected. This is useful
+  for sources involving heavy operations (like launching external
+  programs), so that candidates from the source are not retrieved
+  unnecessarily if the user keeps typing.
+
+  It also can be used to declutter the results anything displays,
+  so that results from certain sources are not shown with every
+  character typed, only if the user hesitates a bit.")
+
+
+(defvar anything-input-idle-delay 0.1
+  "The user has to be idle for this many seconds, before ALL candidates are collected.
+Unlink `anything-input-idle', it is also effective for non-delayed sources.
+If nil, candidates are collected immediately. ")
+
+
+(defvar anything-samewindow nil
+  "If t then Anything doesn't pop up a new window, it uses the
+current window to show the candidates.")
+
+
+(defvar anything-source-filter nil
+  "A list of source names to be displayed. Other sources won't
+appear in the search results. If nil then there is no filtering.
+See also `anything-set-source-filter'.")
+
+
+(defvar anything-map
+  (let ((map (copy-keymap minibuffer-local-map)))
+    (define-key map (kbd "<down>") 'anything-next-line)
+    (define-key map (kbd "<up>") 'anything-previous-line)
+    (define-key map (kbd "C-n")     'anything-next-line)
+    (define-key map (kbd "C-p")     'anything-previous-line)
+    (define-key map (kbd "<prior>") 'anything-previous-page)
+    (define-key map (kbd "<next>") 'anything-next-page)
+    (define-key map (kbd "M-v")     'anything-previous-page)
+    (define-key map (kbd "C-v")     'anything-next-page)
+    (define-key map (kbd "M-<")     'anything-beginning-of-buffer)
+    (define-key map (kbd "M->")     'anything-end-of-buffer)
+    (define-key map (kbd "<right>") 'anything-next-source)
+    (define-key map (kbd "<left>") 'anything-previous-source)
+    (define-key map (kbd "<RET>") 'anything-exit-minibuffer)
+    (define-key map (kbd "C-1") 'anything-select-with-digit-shortcut)
+    (define-key map (kbd "C-2") 'anything-select-with-digit-shortcut)
+    (define-key map (kbd "C-3") 'anything-select-with-digit-shortcut)
+    (define-key map (kbd "C-4") 'anything-select-with-digit-shortcut)
+    (define-key map (kbd "C-5") 'anything-select-with-digit-shortcut)
+    (define-key map (kbd "C-6") 'anything-select-with-digit-shortcut)
+    (define-key map (kbd "C-7") 'anything-select-with-digit-shortcut)
+    (define-key map (kbd "C-8") 'anything-select-with-digit-shortcut)
+    (define-key map (kbd "C-9") 'anything-select-with-digit-shortcut)
+    (loop for c from ?A to ?Z do
+          (define-key map (make-string 1 c) 'anything-select-with-digit-shortcut))
+    (define-key map (kbd "C-i") 'anything-select-action)
+    (define-key map (kbd "C-z") 'anything-execute-persistent-action)
+    (define-key map (kbd "C-e") 'anything-select-2nd-action-or-end-of-line)
+    (define-key map (kbd "C-j") 'anything-select-3rd-action)
+    (define-key map (kbd "C-o") 'anything-next-source)
+    (define-key map (kbd "C-M-v") 'anything-scroll-other-window)
+    (define-key map (kbd "M-<next>") 'anything-scroll-other-window)
+    (define-key map (kbd "C-M-y") 'anything-scroll-other-window-down)
+    (define-key map (kbd "C-M-S-v") 'anything-scroll-other-window-down)
+    (define-key map (kbd "M-<prior>") 'anything-scroll-other-window-down)
+    (define-key map (kbd "C-SPC") 'anything-toggle-visible-mark)
+    (define-key map (kbd "M-[") 'anything-prev-visible-mark)
+    (define-key map (kbd "M-]") 'anything-next-visible-mark)
+    (define-key map (kbd "C-k") 'anything-delete-minibuffer-content)
+
+    (define-key map (kbd "C-s") 'anything-isearch)
+    (define-key map (kbd "C-r") 'undefined)
+    (define-key map (kbd "C-t") 'anything-toggle-resplit-window)
+    (define-key map (kbd "C-x C-f") 'anything-quit-and-find-file)
+
+    (define-key map (kbd "C-c C-d") 'anything-delete-current-selection)
+    (define-key map (kbd "C-c C-y") 'anything-yank-selection)
+    (define-key map (kbd "C-c C-k") 'anything-kill-selection-and-quit)
+    (define-key map (kbd "C-c C-f") 'anything-follow-mode)
+    (define-key map (kbd "C-c C-u") 'anything-force-update)
+
+    ;; Debugging command
+    (define-key map "\C-c\C-x\C-d" 'anything-debug-output)
+    (define-key map "\C-c\C-x\C-m" 'anything-display-all-visible-marks)
+    (define-key map "\C-c\C-x\C-b" 'anything-send-bug-report-from-anything)
+    ;; Use `describe-mode' key in `global-map'
+    (dolist (k (where-is-internal 'describe-mode global-map))
+      (define-key map k 'anything-help))
+    ;; the defalias is needed because commands are bound by name when
+    ;; using iswitchb, so only commands having the prefix anything-
+    ;; get rebound
+    (defalias 'anything-previous-history-element 'previous-history-element)
+    (defalias 'anything-next-history-element 'next-history-element)
+    (define-key map (kbd "M-p") 'anything-previous-history-element)
+    (define-key map (kbd "M-n") 'anything-next-history-element)
+    map)
+  "Keymap for anything.
+
+If you execute `anything-iswitchb-setup', some keys are modified.
+See `anything-iswitchb-setup-keys'.")
+
+(defvar anything-isearch-map
+  (let ((map (make-sparse-keymap)))
+    (set-keymap-parent map (current-global-map))
+    (define-key map (kbd "<return>") 'anything-isearch-default-action)
+    (define-key map (kbd "<RET>") 'anything-isearch-default-action)
+    (define-key map (kbd "C-i") 'anything-isearch-select-action)
+    (define-key map (kbd "C-g") 'anything-isearch-cancel)
+    (define-key map (kbd "M-s") 'anything-isearch-again)
+    (define-key map (kbd "<backspace>") 'anything-isearch-delete)
+    ;; add printing chars
+    (loop for i from 32 below 256 do
+          (define-key map (vector i) 'anything-isearch-printing-char))
+    map)
+  "Keymap for anything incremental search.")
+
+
+(defgroup anything nil
+  "Open anything." :prefix "anything-" :group 'convenience)
+
+(defface anything-header 
+  '((t (:inherit header-line))) 
+  "Face for header lines in the anything buffer." :group 'anything)
+
+(defvar anything-header-face 'anything-header
+  "Face for header lines in the anything buffer.")
+
+(defface anything-isearch-match '((t (:background "Yellow")))
+  "Face for isearch in the anything buffer." :group 'anything)
+
+(defvar anything-isearch-match-face 'anything-isearch-match
+  "Face for matches during incremental search.")
+
+(defvar anything-selection-face 'highlight
+  "Face for currently selected item.")
+
+(defvar anything-iswitchb-idle-delay 1
+  "Show anything completions if the user is idle that many
+  seconds after typing.")
+
+(defvar anything-iswitchb-dont-touch-iswithcb-keys nil
+  "If t then those commands are not bound from `anything-map'
+  under iswitchb which would override standard iswithcb keys.
+
+This allows an even more seamless integration with iswitchb for
+those who prefer using iswitchb bindings even if the anything
+completions buffer is popped up.
+
+Note that you can bind alternative keys for the same command in
+`anything-map', so that you can use different keys for anything
+under iswitchb. For example, I bind the character \ to
+`anything-exit-minibuffer' which key is just above Enter on my
+keyboard. This way I can switch buffers with Enter and choose
+anything completions with \.")
+
+;;----------------------------------------------------------------------
+
+(defvar anything-buffer "*anything*"
+  "Buffer showing completions.")
+
+(defvar anything-action-buffer "*anything action*"
+  "Buffer showing actions.")
+
+(defvar anything-selection-overlay nil
+  "Overlay used to highlight the currently selected item.")
+
+(defvar anything-isearch-overlay nil
+  "Overlay used to highlight the current match during isearch.")
+
+(defvar anything-digit-overlays nil
+  "Overlays for digit shortcuts. See `anything-enable-shortcuts'.")
+
+(defvar anything-candidate-cache nil
+  "Holds the available candidate withing a single anything invocation.")
+
+(defvar anything-pattern
+  "The input pattern used to update the anything buffer.")
+
+(defvar anything-input
+  "The input typed in the candidates panel.")
+
+(defvar anything-async-processes nil
+  "List of information about asynchronous processes managed by anything.")
+
+(defvar anything-digit-shortcut-count 0
+  "Number of digit shortcuts shown in the anything buffer.")
+
+(defvar anything-before-initialize-hook nil
+  "Run before anything initialization.
+This hook is run before init functions in `anything-sources'.")
+
+(defvar anything-after-initialize-hook nil
+  "Run after anything initialization.
+Global variables are initialized and the anything buffer is created.
+But the anything buffer has no contents. ")
+
+(defvar anything-update-hook nil
+  "Run after the anything buffer was updated according the new input pattern.
+This hook is run at the beginning of buffer.
+The first candidate is selected after running this hook.
+See also `anything-after-update-hook'.")
+
+(defvar anything-after-update-hook nil
+  "Run after the anything buffer was updated according the new input pattern.
+This is very similar to `anything-update-hook' but selection is not moved.
+It is useful to select a particular object instead of the first one. ")
+
+(defvar anything-cleanup-hook nil
+  "Run after anything minibuffer is closed, IOW this hook is executed BEFORE performing action. ")
+
+(defvar anything-after-action-hook nil
+  "Run after executing action.")
+
+(defvar anything-after-persistent-action-hook nil
+  "Run after executing persistent action.")
+
+(defvar anything-restored-variables
+  '( anything-candidate-number-limit
+     anything-source-filter
+     anything-source-in-each-line-flag
+     anything-sources)
+  "Variables which are restored after `anything' invocation.")
+;; `anything-saved-sources' is removed
+
+(defvar anything-saved-selection nil
+  "Saved value of the currently selected object when the action
+  list is shown.")
+
+;; `anything-original-source-filter' is removed
+
+(defvar anything-candidate-separator
+  "--------------------"
+  "Candidates separator of `multiline' source.")
+
+(defvar anything-current-buffer nil
+  "Current buffer when `anything' is invoked.")
+
+(defvar anything-buffer-file-name nil
+  "`buffer-file-name' when `anything' is invoked.")
+
+(defvar anything-saved-action nil
+  "Saved value of the currently selected action by key.")
+
+(defvar anything-last-sources nil
+  "OBSOLETE!! Sources of previously invoked `anything'.")
+
+(defvar anything-saved-current-source nil
+  "Saved value of the original (anything-get-current-source) when the action
+  list is shown.")
+
+(defvar anything-compiled-sources nil
+  "Compiled version of `anything-sources'. ")
+
+(defvar anything-in-persistent-action nil
+  "Flag whether in persistent-action or not.")
+
+(defvar anything-quick-update nil
+  "If non-nil, suppress displaying sources which are out of screen at first.
+They are treated as delayed sources at this input.
+This flag makes `anything' a bit faster with many sources.")
+
+(defvar anything-last-sources-local nil
+  "Buffer local value of `anything-sources'.")
+(defvar anything-last-buffer nil
+  "`anything-buffer' of previously `anything' session.")
+
+(defvar anything-save-configuration-functions
+  '(set-window-configuration . current-window-configuration)
+  "If you want to save and restore frame configuration, set this variable to
+ '(set-frame-configuration . current-frame-configuration)
+
+Older version saves/restores frame configuration, but the default is changed now,
+because flickering is occurred in some environment.
+")
+
+(defvar anything-persistent-action-use-special-display nil
+  "If non-nil, use `special-display-function' in persistent action.")
+
+(defvar anything-execute-action-at-once-if-one nil
+  "If non-nil and there is one candidate, execute the first action without selection.
+It is useful for `anything' applications.")
+
+(defvar anything-quit-if-no-candidate nil
+  "if non-nil and there is no candidate, do not display *anything* buffer and quit.
+This variable accepts a function, which is executed if no candidate.
+
+It is useful for `anything' applications.")
+
+(defvar anything-scroll-amount nil
+  "Scroll amount used by `anything-scroll-other-window' and `anything-scroll-other-window-down'.
+If you prefer scrolling line by line, set this value to 1.")
+
+(defvar anything-display-function 'anything-default-display-buffer
+  "Function to display *anything* buffer.
+It is `anything-default-display-buffer' by default, which affects `anything-samewindow'.")
+
+(defvar anything-delayed-init-executed nil)
+
+(defvar anything-mode-line-string "\\<anything-map>\\[anything-help]:help \\[anything-select-action]:Acts \\[anything-exit-minibuffer]/\\[anything-select-2nd-action-or-end-of-line]/\\[anything-select-3rd-action]:NthAct \\[anything-send-bug-report-from-anything]:BugReport"
+  "Help string displayed in mode-line in `anything'.
+If nil, use default `mode-line-format'.")
+
+(defvar anything-help-message
+  "\\<anything-map>The keys that are defined for `anything' are:
+       \\{anything-map}"
+  "Detailed help message string for `anything'.
+It also accepts function or variable symbol.")
+
+(put 'anything 'timid-completion 'disabled)
+
+(defvar anything-inhibit-fit-frame-flag t
+  "If non-nil, inhibit fitting anything frame to its buffer.
+It is nil by default because some flickering occurred in some environment.
+
+To enable fitting, set both `anything-inhibit-fit-frame-flag' and
+`fit-frame-inhibit-fitting' to nil.")
+
+(defvar anything-source-in-each-line-flag nil
+  "If non-nil, add anything-source text-property in each candidate.
+experimental feature.")
+
+(defvar anything-debug-forms nil
+  "Forms to show in `anything-debug-output'.
+Otherwise all variables started with `anything-' are shown.
+It is useful for debug.")
+(defvaralias 'anything-debug-variables 'anything-debug-forms)
+
+;; (@* "Internal Variables")
+(defvar anything-test-candidate-list nil)
+(defvar anything-test-mode nil)
+(defvar anything-source-name nil)
+(defvar anything-candidate-buffer-alist nil)
+(defvar anything-check-minibuffer-input-timer nil)
+(defvar anything-match-hash (make-hash-table :test 'equal))
+(defvar anything-cib-hash (make-hash-table :test 'equal))
+(defvar anything-tick-hash (make-hash-table :test 'equal))
+(defvar anything-issued-errors nil)
+(defvar anything-shortcut-keys nil)
+(defvar anything-once-called-functions nil)
+(defvar anything-follow-mode nil)
+
+;; (@* "Programming Tools")
+(defmacro anything-aif (test-form then-form &rest else-forms)
+  "Anaphoric if. Temporary variable `it' is the result of test-form."
+  `(let ((it ,test-form))
+     (if it ,then-form ,@else-forms)))  
+(put 'anything-aif 'lisp-indent-function 2)
+
+(defun anything-mklist (obj)
+  "If OBJ is a list (but not lambda), return itself, otherwise make a list with one element."
+  (if (and (listp obj) (not (functionp obj)))
+      obj
+    (list obj)))
+
+;; (@* "Anything API")
+(defun anything-buffer-get ()
+  "If *anything action* buffer is shown, return `anything-action-buffer', otherwise `anything-buffer'."
+  (if (anything-action-window)
+      anything-action-buffer
+    anything-buffer))
+
+(defun anything-window ()
+  "Window of `anything-buffer'."
+  (get-buffer-window (anything-buffer-get) 'visible))
+
+(defun anything-action-window ()
+  "Window of `anything-action-buffer'."
+  (get-buffer-window anything-action-buffer 'visible))
+
+(defmacro with-anything-window (&rest body)
+  `(let ((--tmpfunc-- (lambda () ,@body)))
+     (if anything-test-mode
+         (with-current-buffer (anything-buffer-get)
+           (funcall --tmpfunc--))
+       (with-selected-window (anything-window)
+         (funcall --tmpfunc--)))))
+(put 'with-anything-window 'lisp-indent-function 0)
+
+(defmacro with-anything-restore-variables(&rest body)
+  "Restore variables specified by `anything-restored-variables' after executing BODY .
+`post-command-hook' is handled specially."
+  `(let ((--orig-vars (mapcar (lambda (v) (cons v (symbol-value v))) anything-restored-variables))
+         (--post-command-hook-pair (cons post-command-hook
+                                         (default-value 'post-command-hook))))
+     (setq post-command-hook '(t))
+     (setq-default post-command-hook nil)
+     (unwind-protect (progn ,@body)
+       (loop for (var . value) in --orig-vars
+             do (set var value))
+       (setq post-command-hook (car --post-command-hook-pair))
+       (setq-default post-command-hook (cdr --post-command-hook-pair)))))
+(put 'with-anything-restore-variables 'lisp-indent-function 0)
+
+(defun* anything-attr (attribute-name &optional (src (anything-get-current-source)))
+  "Get the value of ATTRIBUTE-NAME of SRC (source).
+if SRC is omitted, use current source.
+It is useful to write your sources."
+  (anything-aif (assq attribute-name src)
+      (cdr it)))
+
+(defun* anything-attr-defined (attribute-name &optional (src (anything-get-current-source)))
+  "Return non-nil if ATTRIBUTE-NAME of SRC (source)  is defined.
+if SRC is omitted, use current source.
+It is useful to write your sources."
+  (and (assq attribute-name src) t))
+
+(defun* anything-attrset (attribute-name value &optional (src (anything-get-current-source)))
+  "Set the value of ATTRIBUTE-NAME of SRC (source) to VALUE.
+if SRC is omitted, use current source.
+It is useful to write your sources."
+  (anything-aif (assq attribute-name src)
+      (setcdr it value)
+    (setcdr src (cons (cons attribute-name value) (cdr src))))
+  value)
+
+;; anything-set-source-filter
+;;
+;;   This function sets a filter for anything sources and it may be
+;;   called while anything is running. It can be used to toggle
+;;   displaying of sources dinamically. For example, additional keys
+;;   can be bound into `anything-map' to display only the file-related
+;;   results if there are too many matches from other sources and
+;;   you're after files only:
+;;
+;;   Shift+F shows only file results from some sources:
+;;
+;;     (define-key anything-map "F" 'anything-my-show-files-only)
+;;     
+;;     (defun anything-my-show-files-only ()
+;;       (interactive)
+;;       (anything-set-source-filter '("File Name History"
+;;                                     "Files from Current Directory")))
+;;
+;;   Shift+A shows all results:
+;;
+;;     (define-key anything-map "A" 'anything-my-show-all)
+;;     
+;;     (defun anything-my-show-all ()
+;;       (interactive)
+;;       (anything-set-source-filter nil))
+;;  
+;;  
+;;   Note that you have to prefix the functions with anything- prefix,
+;;   otherwise they won't be bound when Anything is used under
+;;   Iswitchb. The -my- part is added to avoid collisions with
+;;   existing Anything function names.
+;;  
+(defun anything-set-source-filter (sources)
+  "Sets the value of `anything-source-filter' and updates the list of results."
+  (unless (and (listp sources)
+               (loop for name in sources always (stringp name)))
+    (error "invalid data in `anything-set-source-filter': %S" sources))
+  (setq anything-source-filter sources)
+  (anything-update))
+
+(defun anything-set-sources (sources &optional no-init no-update)
+  "Set `anything-sources' during `anything' invocation.
+If NO-INIT is non-nil, skip executing init functions of SOURCES.
+If NO-UPDATE is non-nil, skip executing `anything-update'."
+  (setq anything-compiled-sources nil
+        anything-sources sources)
+  (unless no-init (anything-funcall-foreach 'init))
+  (unless no-update (anything-update)))
+
+(defvar anything-compile-source-functions
+  '(anything-compile-source--type
+    anything-compile-source--dummy
+    anything-compile-source--disable-shortcuts
+    anything-compile-source--candidates-in-buffer)
+  "Functions to compile elements of `anything-sources' (plug-in).")
+
+(defun anything-get-sources ()
+  "Return compiled `anything-sources', which is memoized.
+
+Attributes:
+
+- type
+  `anything-type-attributes' are merged in.
+- candidates-buffer
+  candidates, volatile and match attrubute are created.
+"
+  (cond
+   ;; action
+   ((anything-action-window)
+    anything-sources)
+   ;; memoized
+   (anything-compiled-sources)
+   ;; first time
+   (t
+    (setq anything-compiled-sources
+          (anything-compile-sources anything-sources anything-compile-source-functions)))))
+
+(defun* anything-get-selection (&optional (buffer nil buffer-s) (force-display-part))
+  "Return the currently selected item or nil.
+if BUFFER is nil or unspecified, use anything-buffer as default value.
+If FORCE-DISPLAY-PART is non-nil, return the display string."
+  (setq buffer (if (and buffer buffer-s) buffer anything-buffer))
+  (unless (zerop (buffer-size (get-buffer buffer)))
+    (with-current-buffer buffer
+      (let ((selection
+             (or (and (not force-display-part)
+                      (get-text-property (overlay-start
+                                          anything-selection-overlay)
+                                         'anything-realvalue))
+                 (let ((disp (buffer-substring-no-properties
+                              (overlay-start anything-selection-overlay)
+                              (1- (overlay-end anything-selection-overlay))))
+                       (source (anything-get-current-source)))
+                   (anything-aif (and (not force-display-part)
+                                      (assoc-default 'display-to-real source))
+                       (anything-funcall-with-source source it disp)
+                     disp)))))
+        (unless (equal selection "")
+          selection)))))
+
+(defun anything-get-action ()
+  "Return the associated action for the selected candidate."
+  (unless (zerop (buffer-size (get-buffer (anything-buffer-get))))
+    (let* ((source (anything-get-current-source))
+           (actions (assoc-default 'action source)))
+
+      (anything-aif (assoc-default 'action-transformer source)
+          ;; (funcall it actions (anything-get-selection))
+          (anything-composed-funcall-with-source source it actions (anything-get-selection))
+        actions))))
+
+(defun anything-get-current-source ()
+  "Return the source for the current selection / in init/candidates/action/candidate-transformer/filtered-candidate-transformer function."
+  (declare (special source))
+  ;; The name `anything-get-current-source' should be used in init function etc.
+  (if (and (boundp 'anything-source-name) (stringp anything-source-name))
+      source
+    (or 
+     (with-current-buffer (anything-buffer-get)
+       (get-text-property (point) 'anything-source))
+     (block exit
+       (with-current-buffer (anything-buffer-get)
+         ;; This goto-char shouldn't be necessary, but point is moved to
+         ;; point-min somewhere else which shouldn't happen.
+         (goto-char (overlay-start anything-selection-overlay))
+         (let* ((header-pos (or (anything-get-previous-header-pos)
+                                (anything-get-next-header-pos)))
+                (source-name
+                 (save-excursion
+                   (unless header-pos
+                     (message "No candidates")
+                     (return-from exit nil))
+                   (goto-char header-pos)
+                   (buffer-substring-no-properties
+                    (line-beginning-position) (line-end-position)))))
+           (some (lambda (source)
+                   (if (equal (assoc-default 'name source)
+                              source-name)
+                       source))
+                 (anything-get-sources))))))))
+
+(defun anything-buffer-is-modified (buffer)
+  "Return non-nil when BUFFER is modified since `anything' was invoked."
+  (let* ((b (get-buffer buffer))
+         (key (concat (buffer-name b)
+                     "/"
+                     (anything-attr 'name)))
+         (source-tick (or (gethash key anything-tick-hash) 0))
+         (buffer-tick (buffer-chars-modified-tick b)))
+    (prog1 (/= source-tick buffer-tick)
+      (puthash key buffer-tick anything-tick-hash))))
+(defun anything-current-buffer-is-modified ()
+  "Return non-nil when `anything-current-buffer' is modified since `anything' was invoked."
+  (anything-buffer-is-modified anything-current-buffer))
+
+(defvar anything-quit nil)
+(defun anything-run-after-quit (function &rest args)
+  "Perform an action after quitting `anything'.
+The action is to call FUNCTION with arguments ARGS."
+  (setq anything-quit t)
+  (apply 'run-with-idle-timer 0 nil function args)
+  (anything-exit-minibuffer))
+
+(defun define-anything-type-attribute (type definition &optional doc)
+  "Register type attribute of TYPE as DEFINITION with DOC.
+DOC is displayed in `anything-type-attributes' docstring.
+
+Use this function is better than setting `anything-type-attributes' directly."
+  (anything-add-type-attribute type definition)
+  (and doc (anything-document-type-attribute type doc))
+  nil)
+
+(defvar anything-additional-attributes nil
+  "List of all `anything' attributes.")
+(defvaralias 'anything-attributes 'anything-additional-attributes)
+(defun anything-document-attribute (attribute short-doc &optional long-doc)
+  "Register ATTRIBUTE documentation introduced by plug-in.
+SHORT-DOC is displayed beside attribute name.
+LONG-DOC is displayed below attribute name and short documentation."
+  (if long-doc
+      (setq short-doc (concat "(" short-doc ")"))
+    (setq long-doc short-doc
+          short-doc ""))
+  (add-to-list 'anything-additional-attributes attribute t)
+  (put attribute 'anything-attrdoc
+       (concat "- " (symbol-name attribute) " " short-doc "\n\n" long-doc "\n")))
+(put 'anything-document-attribute 'lisp-indent-function 2)
+
+(defun anything-require-at-least-version (version)
+  "Output error message unless anything.el is older than VERSION.
+This is suitable for anything applications."
+  (when (and (string= "1." (substring version 0 2))
+             (string-match "1\.\\([0-9]+\\)" anything-version)
+             (< (string-to-number (match-string 1 anything-version))
+                (string-to-number (substring version 2))))
+    (error "Please update anything.el!!
+
+http://www.emacswiki.org/cgi-bin/wiki/download/anything.el
+
+or  M-x install-elisp-from-emacswiki anything.el")))
+
+(defun anything-interpret-value (value &optional source)
+  "interpret VALUE as variable, function or literal.
+If VALUE is a function, call it with no arguments and return the value.
+If SOURCE is `anything' source, `anything-source-name' is source name.
+
+If VALUE is a variable, return the value.
+
+If VALUE is a symbol, but it is not a function or a variable, cause an error.
+
+Otherwise, return VALUE itself."
+  (cond ((and source (functionp value))
+         (anything-funcall-with-source source value))
+        ((functionp value)
+         (funcall value))
+        ((and (symbolp value) (boundp value))
+         (symbol-value value))
+        ((symbolp value)
+         (error "anything-interpret-value: Symbol must be a function or a variable"))
+        (t
+         value)))
+
+(defun anything-once (function &rest args)
+  "Ensure FUNCTION with ARGS to be called once in `anything' session."
+  (let ((spec (cons function args)))
+    (unless (member spec anything-once-called-functions)
+      (apply function args)
+      (push spec anything-once-called-functions))))
+
+;; (@* "Core: tools")
+(defun anything-funcall-with-source (source func &rest args)
+  "Call FUNC with ARGS with variable `anything-source-name' and `source' is bound.
+FUNC can be function list. Return the result of last function call."
+  (let ((anything-source-name (assoc-default 'name source))
+        result)
+    (dolist (func (if (functionp func) (list func) func) result)
+      (setq result (apply func args)))))
+
+(defun anything-funcall-foreach (sym)
+  "Call the sym function(s) for each source if any."
+  (dolist (source (anything-get-sources))
+    (when (symbolp source)
+      (setq source (symbol-value source)))
+    (anything-aif (assoc-default sym source)
+        (anything-funcall-with-source source it))))
+
+(defun anything-normalize-sources (sources)
+  "If SOURCES is only one source, make a list."
+  (cond ((or (and sources               ; avoid nil
+                  (symbolp sources))
+             (and (listp sources) (assq 'name sources)))
+         (list sources))
+        (sources)
+        (t anything-sources)))  
+
+(defun anything-approximate-candidate-number ()
+  "Approximate Number of candidates.
+It is used to check if candidate number is 0, 1, or 2+."
+  (with-current-buffer anything-buffer
+    (let ((lines (1- (line-number-at-pos (1- (point-max))))))
+      (if (zerop lines)
+          0
+        (save-excursion
+          (goto-char (point-min))
+          (forward-line 1)
+          (if (anything-pos-multiline-p)
+              (if (search-forward anything-candidate-separator nil t) 2 1)
+            lines))))))
+
+(defmacro with-anything-quittable (&rest body)
+  `(let (inhibit-quit)
+     (condition-case v
+         (progn ,@body)
+       (quit (setq anything-quit t)
+             (exit-minibuffer)
+             (keyboard-quit)))))
+(put 'with-anything-quittable 'lisp-indent-function 0)
+
+(defun anything-compose (arg-lst func-lst)
+  "Call each function in FUNC-LST with the arguments specified in ARG-LST.
+The result of each function will be the new `car' of ARG-LST.
+
+This function allows easy sequencing of transformer functions."
+  (dolist (func func-lst)
+    (setcar arg-lst (apply func arg-lst)))
+  (car arg-lst))
+
+(defun anything-composed-funcall-with-source (source funcs &rest args)
+  (if (functionp funcs)
+      (apply 'anything-funcall-with-source source funcs args)
+    (apply 'anything-funcall-with-source
+           source (lambda (&rest args) (anything-compose args funcs)) args)))
+
+;; (@* "Core: entry point")
+(defvar anything-buffers nil
+  "All of `anything-buffer' in most recently used order.")
+
+;;;###autoload
+(defun anything (&optional any-sources any-input any-prompt any-resume any-preselect any-buffer any-keymap)
+  "Select anything. In Lisp program, some optional arguments can be used.
+
+Note that all the optional arguments are prefixed because of
+dynamic scope problem, IOW argument variables may eat
+already-bound variables. Yuck!
+
+- ANY-SOURCES
+
+  Temporary value of `anything-sources'.  It also accepts a
+  symbol, interpreted as a variable of an anything source.  It
+  also accepts an alist representing an anything source, which is
+  detected by (assq 'name ANY-SOURCES)
+
+
+- ANY-INPUT
+
+  Temporary value of `anything-pattern', ie. initial input of minibuffer.
+
+- ANY-PROMPT
+
+  Prompt other than \"pattern: \".
+
+- ANY-RESUME
+
+  If t, Resurrect previously instance of `anything'. Skip the initialization.
+  If 'noresume, this instance of `anything' cannot be resumed.
+
+- ANY-PRESELECT
+
+  Initially selected candidate. Specified by exact candidate or a regexp.
+  Note that it is not working with delayed sources.
+
+- ANY-BUFFER
+
+  `anything-buffer' instead of *anything*.
+
+- ANY-KEYMAP
+
+  `anything-map' for current `anything' session.
+"
+  ;; TODO more document
+  (interactive)
+  (condition-case v
+      (let ( ;; It is needed because `anything-source-name' is non-nil
+            ;; when `anything' is invoked by action. Awful global scope.
+            anything-source-name anything-in-persistent-action
+                                 anything-quit
+                                 (case-fold-search t)
+                                 (anything-buffer (or any-buffer anything-buffer))
+                                 (anything-map (or any-keymap anything-map)))
+        (with-anything-restore-variables
+          (anything-frame/window-configuration 'save)
+          (setq anything-sources (anything-normalize-sources any-sources))