git clone 'git://github.com/cmpitg/wand.git'
Wand is an extension that allows users to select a piece of text and perform actions based on predefined patterns. Wand is inspired by Xiki and Acme editor.
Wand depends of
cl library (bundled with Emacs 23+) and
Thanks to @yasuyk Wand is available in Melpa.
Installation process is now as simple as
M-x package-install RET wand RET.
It's probably the best to have a look at an example.
wand:execute is a command (an
interactive function) that takes the current
selection (if selection is active) or a string and performs an action based on
current rules residing in
wand:*rules*. I use this command so frequently
that I bind it to
(require 'wand) (global-set-key (kbd "<C-return>") 'wand:execute) (global-set-key (kbd "<C-mouse-1>") 'wand:execute) (global-set-key (kbd "<C-down-mouse-1>") nil)
Then, I want whenever
wand:execute is called upon a selection of a string
commandis executed as a shell command, and its output is taken back to Emacs as a popup buffer (using Popwin library),
(wand:add-rule-by-pattern :match "\\$ "
a-urlis opened in Firefox with HTTP or HTTPS as its protocol respectively:
(wand:add-rule-by-pattern :match "https?://"
file:path-to-a-file, that corresponding file is open with Emacs. This is particularly useful when using with
(wand:add-rule-by-pattern :match "file:"
#> an-emacs-lisp-expression, brackets are added to that expression if necessary and it's then evaluated:
(wand:add-rule-by-pattern :match "#> "
Comments are skipped when the pattern-matching process is performed. The code is pretty self-explanatory.
Special thanks to:
@yasuyk for making Wand available in Melpa.
@MatthewDarling for correcting code example in README.
@syl20bnr for the issue report.
This project along with its source code and all materials are released under the terms of the GNU General Public License 3.0 (GPLv3). See COPYING for more details.
Copyright (C) 2014 Duong Nguyen