Pin essential packages to melpa-stable
parent
9671ff68de
commit
42ef36f836
@ -0,0 +1,2 @@
|
||||
;;; -*- no-byte-compile: t -*-
|
||||
(define-package "bind-key" "2.4" "A simple way to manage personal keybindings" 'nil :commit "39a8b8812c2c9f6f0b299e6a04e504ef393694ce" :keywords '("keys" "keybinding" "config" "dotemacs") :authors '(("John Wiegley" . "johnw@newartisans.com")) :maintainer '("John Wiegley" . "johnw@newartisans.com") :url "https://github.com/jwiegley/use-package")
|
@ -1,2 +0,0 @@
|
||||
;;; -*- no-byte-compile: t -*-
|
||||
(define-package "bind-key" "20180513.430" "A simple way to manage personal keybindings" 'nil :commit "3fb8f39f5901a4c0ef7887283e56e60b541675ea" :keywords '("keys" "keybinding" "config" "dotemacs") :authors '(("John Wiegley" . "johnw@newartisans.com")) :maintainer '("John Wiegley" . "johnw@newartisans.com") :url "https://github.com/jwiegley/use-package")
|
@ -0,0 +1,70 @@
|
||||
If you have lots of keybindings set in your .emacs file, it can be hard to
|
||||
know which ones you haven't set yet, and which may now be overriding some
|
||||
new default in a new emacs version. This module aims to solve that
|
||||
problem.
|
||||
|
||||
Bind keys as follows in your .emacs:
|
||||
|
||||
(require 'bind-key)
|
||||
|
||||
(bind-key "C-c x" 'my-ctrl-c-x-command)
|
||||
|
||||
If the keybinding argument is a vector, it is passed straight to
|
||||
`define-key', so remapping a key with `[remap COMMAND]' works as
|
||||
expected:
|
||||
|
||||
(bind-key [remap original-ctrl-c-x-command] 'my-ctrl-c-x-command)
|
||||
|
||||
If you want the keybinding to override all minor modes that may also bind
|
||||
the same key, use the `bind-key*' form:
|
||||
|
||||
(bind-key* "<C-return>" 'other-window)
|
||||
|
||||
If you want to rebind a key only in a particular keymap, use:
|
||||
|
||||
(bind-key "C-c x" 'my-ctrl-c-x-command some-other-mode-map)
|
||||
|
||||
To unbind a key within a keymap (for example, to stop your favorite major
|
||||
mode from changing a binding that you don't want to override everywhere),
|
||||
use `unbind-key':
|
||||
|
||||
(unbind-key "C-c x" some-other-mode-map)
|
||||
|
||||
To bind multiple keys at once, or set up a prefix map, a `bind-keys' macro
|
||||
is provided. It accepts keyword arguments, please see its documentation
|
||||
for a detailed description.
|
||||
|
||||
To add keys into a specific map, use :map argument
|
||||
|
||||
(bind-keys :map dired-mode-map
|
||||
("o" . dired-omit-mode)
|
||||
("a" . some-custom-dired-function))
|
||||
|
||||
To set up a prefix map, use `:prefix-map' and `:prefix' arguments (both are
|
||||
required)
|
||||
|
||||
(bind-keys :prefix-map my-customize-prefix-map
|
||||
:prefix "C-c c"
|
||||
("f" . customize-face)
|
||||
("v" . customize-variable))
|
||||
|
||||
You can combine all the keywords together. Additionally,
|
||||
`:prefix-docstring' can be specified to set documentation of created
|
||||
`:prefix-map' variable.
|
||||
|
||||
To bind multiple keys in a `bind-key*' way (to be sure that your bindings
|
||||
will not be overridden by other modes), you may use `bind-keys*' macro:
|
||||
|
||||
(bind-keys*
|
||||
("C-o" . other-window)
|
||||
("C-M-n" . forward-page)
|
||||
("C-M-p" . backward-page))
|
||||
|
||||
After Emacs loads, you can see a summary of all your personal keybindings
|
||||
currently in effect with this command:
|
||||
|
||||
M-x describe-personal-keybindings
|
||||
|
||||
This display will tell you if you've overriden a default keybinding, and
|
||||
what the default was. Also, it will tell you if the key was rebound after
|
||||
your binding it with `bind-key', and what it was rebound it to.
|
@ -0,0 +1,9 @@
|
||||
(define-package "dash" "2.16.0" "A modern list library for Emacs" 'nil :keywords
|
||||
'("lists")
|
||||
:authors
|
||||
'(("Magnar Sveen" . "magnars@gmail.com"))
|
||||
:maintainer
|
||||
'("Magnar Sveen" . "magnars@gmail.com"))
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
||||
;;; -*- no-byte-compile: t -*-
|
||||
(define-package "dash" "20190920.1035" "A modern list library for Emacs" 'nil :commit "a743ae3da1d5869434c6f262bbe45ef30d87cb9c" :keywords '("lists") :authors '(("Magnar Sveen" . "magnars@gmail.com")) :maintainer '("Magnar Sveen" . "magnars@gmail.com"))
|
@ -0,0 +1,2 @@
|
||||
;;; -*- no-byte-compile: t -*-
|
||||
(define-package "dash-functional" "20180107.1618" "Collection of useful combinators for Emacs Lisp" '((dash "2.0.0") (emacs "24")) :commit "85e8f62b7a8ae0b4da307ddf16e4f1c3559d0d3f" :keywords '("lisp" "functions" "combinators"))
|
@ -0,0 +1,219 @@
|
||||
;;; dash-functional.el --- Collection of useful combinators for Emacs Lisp -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
|
||||
|
||||
;; Authors: Matus Goljer <matus.goljer@gmail.com>
|
||||
;; Magnar Sveen <magnars@gmail.com>
|
||||
;; Version: 1.2.0
|
||||
;; Package-Version: 20180107.1618
|
||||
;; Package-Requires: ((dash "2.0.0") (emacs "24"))
|
||||
;; Keywords: lisp functions combinators
|
||||
|
||||
;; 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:
|
||||
|
||||
;; Collection of useful combinators for Emacs Lisp
|
||||
;;
|
||||
;; See documentation on https://github.com/magnars/dash.el#functions
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'dash)
|
||||
|
||||
(defun -partial (fn &rest args)
|
||||
"Takes a function FN and fewer than the normal arguments to FN,
|
||||
and returns a fn that takes a variable number of additional ARGS.
|
||||
When called, the returned function calls FN with ARGS first and
|
||||
then additional args."
|
||||
(apply 'apply-partially fn args))
|
||||
|
||||
(defun -rpartial (fn &rest args)
|
||||
"Takes a function FN and fewer than the normal arguments to FN,
|
||||
and returns a fn that takes a variable number of additional ARGS.
|
||||
When called, the returned function calls FN with the additional
|
||||
args first and then ARGS."
|
||||
(lambda (&rest args-before) (apply fn (append args-before args))))
|
||||
|
||||
(defun -juxt (&rest fns)
|
||||
"Takes a list of functions and returns a fn that is the
|
||||
juxtaposition of those fns. The returned fn takes a variable
|
||||
number of args, and returns a list containing the result of
|
||||
applying each fn to the args (left-to-right)."
|
||||
(lambda (&rest args) (mapcar (lambda (x) (apply x args)) fns)))
|
||||
|
||||
(defun -compose (&rest fns)
|
||||
"Takes a list of functions and returns a fn that is the
|
||||
composition of those fns. The returned fn takes a variable
|
||||
number of arguments, and returns the result of applying
|
||||
each fn to the result of applying the previous fn to
|
||||
the arguments (right-to-left)."
|
||||
(lambda (&rest args)
|
||||
(car (-reduce-r-from (lambda (fn xs) (list (apply fn xs)))
|
||||
args fns))))
|
||||
|
||||
(defun -applify (fn)
|
||||
"Changes an n-arity function FN to a 1-arity function that
|
||||
expects a list with n items as arguments"
|
||||
(apply-partially 'apply fn))
|
||||
|
||||
(defun -on (operator transformer)
|
||||
"Return a function of two arguments that first applies
|
||||
TRANSFORMER to each of them and then applies OPERATOR on the
|
||||
results (in the same order).
|
||||
|
||||
In types: (b -> b -> c) -> (a -> b) -> a -> a -> c"
|
||||
(lambda (x y) (funcall operator (funcall transformer x) (funcall transformer y))))
|
||||
|
||||
(defun -flip (func)
|
||||
"Swap the order of arguments for binary function FUNC.
|
||||
|
||||
In types: (a -> b -> c) -> b -> a -> c"
|
||||
(lambda (x y) (funcall func y x)))
|
||||
|
||||
(defun -const (c)
|
||||
"Return a function that returns C ignoring any additional arguments.
|
||||
|
||||
In types: a -> b -> a"
|
||||
(lambda (&rest _) c))
|
||||
|
||||
(defmacro -cut (&rest params)
|
||||
"Take n-ary function and n arguments and specialize some of them.
|
||||
Arguments denoted by <> will be left unspecialized.
|
||||
|
||||
See SRFI-26 for detailed description."
|
||||
(let* ((i 0)
|
||||
(args (mapcar (lambda (_) (setq i (1+ i)) (make-symbol (format "D%d" i)))
|
||||
(-filter (-partial 'eq '<>) params))))
|
||||
`(lambda ,args
|
||||
,(let ((body (--map (if (eq it '<>) (pop args) it) params)))
|
||||
(if (eq (car params) '<>)
|
||||
(cons 'funcall body)
|
||||
body)))))
|
||||
|
||||
(defun -not (pred)
|
||||
"Take a unary predicate PRED and return a unary predicate
|
||||
that returns t if PRED returns nil and nil if PRED returns
|
||||
non-nil."
|
||||
(lambda (x) (not (funcall pred x))))
|
||||
|
||||
(defun -orfn (&rest preds)
|
||||
"Take list of unary predicates PREDS and return a unary
|
||||
predicate with argument x that returns non-nil if at least one of
|
||||
the PREDS returns non-nil on x.
|
||||
|
||||
In types: [a -> Bool] -> a -> Bool"
|
||||
(lambda (x) (-any? (-cut funcall <> x) preds)))
|
||||
|
||||
(defun -andfn (&rest preds)
|
||||
"Take list of unary predicates PREDS and return a unary
|
||||
predicate with argument x that returns non-nil if all of the
|
||||
PREDS returns non-nil on x.
|
||||
|
||||
In types: [a -> Bool] -> a -> Bool"
|
||||
(lambda (x) (-all? (-cut funcall <> x) preds)))
|
||||
|
||||
(defun -iteratefn (fn n)
|
||||
"Return a function FN composed N times with itself.
|
||||
|
||||
FN is a unary function. If you need to use a function of higher
|
||||
arity, use `-applify' first to turn it into a unary function.
|
||||
|
||||
With n = 0, this acts as identity function.
|
||||
|
||||
In types: (a -> a) -> Int -> a -> a.
|
||||
|
||||
This function satisfies the following law:
|
||||
|
||||
(funcall (-iteratefn fn n) init) = (-last-item (-iterate fn init (1+ n)))."
|
||||
(lambda (x) (--dotimes n (setq x (funcall fn x))) x))
|
||||
|
||||
(defun -counter (&optional beg end inc)
|
||||
"Return a closure that counts from BEG to END, with increment INC.
|
||||
|
||||
The closure will return the next value in the counting sequence
|
||||
each time it is called, and nil after END is reached. BEG
|
||||
defaults to 0, INC defaults to 1, and if END is nil, the counter
|
||||
will increment indefinitely.
|
||||
|
||||
The closure accepts any number of arguments, which are discarded."
|
||||
(let ((inc (or inc 1))
|
||||
(n (or beg 0)))
|
||||
(lambda (&rest _)
|
||||
(when (or (not end) (< n end))
|
||||
(prog1 n
|
||||
(setq n (+ n inc)))))))
|
||||
|
||||
(defvar -fixfn-max-iterations 1000
|
||||
"The default maximum number of iterations performed by `-fixfn'
|
||||
unless otherwise specified.")
|
||||
|
||||
(defun -fixfn (fn &optional equal-test halt-test)
|
||||
"Return a function that computes the (least) fixpoint of FN.
|
||||
|
||||
FN must be a unary function. The returned lambda takes a single
|
||||
argument, X, the initial value for the fixpoint iteration. The
|
||||
iteration halts when either of the following conditions is satisified:
|
||||
|
||||
1. Iteration converges to the fixpoint, with equality being
|
||||
tested using EQUAL-TEST. If EQUAL-TEST is not specified,
|
||||
`equal' is used. For functions over the floating point
|
||||
numbers, it may be necessary to provide an appropriate
|
||||
appoximate comparsion test.
|
||||
|
||||
2. HALT-TEST returns a non-nil value. HALT-TEST defaults to a
|
||||
simple counter that returns t after `-fixfn-max-iterations',
|
||||
to guard against infinite iteration. Otherwise, HALT-TEST
|
||||
must be a function that accepts a single argument, the
|
||||
current value of X, and returns non-nil as long as iteration
|
||||
should continue. In this way, a more sophisticated
|
||||
convergence test may be supplied by the caller.
|
||||
|
||||
The return value of the lambda is either the fixpoint or, if
|
||||
iteration halted before converging, a cons with car `halted' and
|
||||
cdr the final output from HALT-TEST.
|
||||
|
||||
In types: (a -> a) -> a -> a."
|
||||
(let ((eqfn (or equal-test 'equal))
|
||||
(haltfn (or halt-test
|
||||
(-not
|
||||
(-counter 0 -fixfn-max-iterations)))))
|
||||
(lambda (x)
|
||||
(let ((re (funcall fn x))
|
||||
(halt? (funcall haltfn x)))
|
||||
(while (and (not halt?) (not (funcall eqfn x re)))
|
||||
(setq x re
|
||||
re (funcall fn re)
|
||||
halt? (funcall haltfn re)))
|
||||
(if halt? (cons 'halted halt?)
|
||||
re)))))
|
||||
|
||||
(defun -prodfn (&rest fns)
|
||||
"Take a list of n functions and return a function that takes a
|
||||
list of length n, applying i-th function to i-th element of the
|
||||
input list. Returns a list of length n.
|
||||
|
||||
In types (for n=2): ((a -> b), (c -> d)) -> (a, c) -> (b, d)
|
||||
|
||||
This function satisfies the following laws:
|
||||
|
||||
(-compose (-prodfn f g ...) (-prodfn f\\=' g\\=' ...)) = (-prodfn (-compose f f\\=') (-compose g g\\=') ...)
|
||||
(-prodfn f g ...) = (-juxt (-compose f (-partial \\='nth 0)) (-compose g (-partial \\='nth 1)) ...)
|
||||
(-compose (-prodfn f g ...) (-juxt f\\=' g\\=' ...)) = (-juxt (-compose f f\\=') (-compose g g\\=') ...)
|
||||
(-compose (-partial \\='nth n) (-prod f1 f2 ...)) = (-compose fn (-partial \\='nth n))"
|
||||
(lambda (x) (-zip-with 'funcall fns x)))
|
||||
|
||||
(provide 'dash-functional)
|
||||
|
||||
;;; dash-functional.el ends here
|
@ -0,0 +1,8 @@
|
||||
A modern list api for Emacs.
|
||||
|
||||
See documentation on https://github.com/magnars/dash.el#functions
|
||||
|
||||
**Please note** The lexical binding in this file is not utilised at the
|
||||
moment. We will take full advantage of lexical binding in an upcoming 3.0
|
||||
release of Dash. In the meantime, we've added the pragma to avoid a bug that
|
||||
you can read more about in https://github.com/magnars/dash.el/issues/130.
|
@ -0,0 +1,2 @@
|
||||
;;; -*- no-byte-compile: t -*-
|
||||
(define-package "diminish" "0.45" "Diminished modes are minor modes with no modeline display" 'nil :commit "0211de96b7cfba9c9dc8d2d392dbd4ccdb22bc65" :keywords '("extensions" "diminish" "minor" "codeprose") :authors '(("Will Mengarini" . "seldon@eskimo.com")) :maintainer '("Martin Yrjölä" . "martin.yrjola@gmail.com") :url "https://github.com/myrjola/diminish.el")
|
@ -1,2 +0,0 @@
|
||||
;;; -*- no-byte-compile: t -*-
|
||||
(define-package "diminish" "20170419.1736" "Diminished modes are minor modes with no modeline display" 'nil :commit "565a983a39d2e2cffab5df13b34f3b6116723208" :keywords '("extensions" "diminish" "minor" "codeprose") :authors '(("Will Mengarini" . "seldon@eskimo.com")) :maintainer '("Martin Yrjölä" . "martin.yrjola@gmail.com") :url "https://github.com/myrjola/diminish.el")
|
@ -0,0 +1,70 @@
|
||||
Minor modes each put a word on the mode line to signify that they're
|
||||
active. This can cause other displays, such as % of file that point is
|
||||
at, to run off the right side of the screen. For some minor modes, such
|
||||
as mouse-avoidance-mode, the display is a waste of space, since users
|
||||
typically set the mode in their .emacs & never change it. For other
|
||||
modes, such as my jiggle-mode, it's a waste because there's already a
|
||||
visual indication of whether the mode is in effect.
|
||||
|
||||
A diminished mode is a minor mode that has had its mode line
|
||||
display diminished, usually to nothing, although diminishing to a
|
||||
shorter word or a single letter is also supported. This package
|
||||
implements diminished modes.
|
||||
|
||||
You can use this package either interactively or from your .emacs file.
|
||||
In either case, first you'll need to copy this file to a directory that
|
||||
appears in your load-path. `load-path' is the name of a variable that
|
||||
contains a list of directories Emacs searches for files to load.
|
||||
To prepend another directory to load-path, put a line like
|
||||
(add-to-list 'load-path "c:/My_Directory") in your .emacs file.
|
||||
|
||||
To create diminished modes interactively, type
|
||||
M-x load-library
|
||||
to get a prompt like
|
||||
Load library:
|
||||
and respond `diminish' (unquoted). Then type
|
||||
M-x diminish
|
||||
to get a prompt like
|
||||
Diminish what minor mode:
|
||||
and respond with the name of some minor mode, like mouse-avoidance-mode.
|
||||
You'll then get this prompt:
|
||||
To what mode-line display:
|
||||
Respond by just hitting <Enter> if you want the name of the mode
|
||||
completely removed from the mode line. If you prefer, you can abbreviate
|
||||
the name. If your abbreviation is 2 characters or more, such as "Av",
|
||||
it'll be displayed as a separate word on the mode line, just like minor
|
||||
modes' names. If it's a single character, such as "V", it'll be scrunched
|
||||
up against the previous word, so for example if the undiminished mode line
|
||||
display had been "Abbrev Fill Avoid", it would become "Abbrev FillV".
|
||||
Multiple single-letter diminished modes will all be scrunched together.
|
||||
The display of undiminished modes will not be affected.
|
||||
|
||||
To find out what the mode line would look like if all diminished modes
|
||||
were still minor, type M-x diminished-modes. This displays in the echo
|
||||
area the complete list of minor or diminished modes now active, but
|
||||
displays them all as minor. They remain diminished on the mode line.
|
||||
|
||||
To convert a diminished mode back to a minor mode, type M-x diminish-undo
|
||||
to get a prompt like
|
||||
Restore what diminished mode:
|
||||
Respond with the name of some diminished mode. To convert all
|
||||
diminished modes back to minor modes, respond to that prompt
|
||||
with `diminished-modes' (unquoted, & note the hyphen).
|
||||
|
||||
When you're responding to the prompts for mode names, you can use
|
||||
completion to avoid extra typing; for example, m o u SPC SPC SPC
|
||||
is usually enough to specify mouse-avoidance-mode. Mode names
|
||||
typically end in "-mode", but for historical reasons
|
||||
auto-fill-mode is named by "auto-fill-function".
|
||||
|
||||
To create diminished modes noninteractively in your .emacs file, put
|
||||
code like
|
||||
(require 'diminish)
|
||||
(diminish 'abbrev-mode "Abv")
|
||||
(diminish 'jiggle-mode)
|
||||
(diminish 'mouse-avoidance-mode "M")
|
||||
near the end of your .emacs file. It should be near the end so that any
|
||||
minor modes your .emacs loads will already have been loaded by the time
|
||||
they're to be converted to diminished modes.
|
||||
|
||||
To diminish a major mode, (setq mode-name "whatever") in the mode hook.
|
@ -0,0 +1,2 @@
|
||||
;;; -*- no-byte-compile: t -*-
|
||||
(define-package "exec-path-from-shell" "1.12" "Get environment variables such as $PATH from the shell" 'nil :commit "76cd6e3fa8a7dac937af7e40507843dfae4f9184" :keywords '("unix" "environment") :authors '(("Steve Purcell" . "steve@sanityinc.com")) :maintainer '("Steve Purcell" . "steve@sanityinc.com") :url "https://github.com/purcell/exec-path-from-shell")
|
@ -1,2 +0,0 @@
|
||||
;;; -*- no-byte-compile: t -*-
|
||||
(define-package "exec-path-from-shell" "20190426.2227" "Get environment variables such as $PATH from the shell" 'nil :commit "3cfedb8791397ed50ee66bc0a7cbee5b9d78245c" :keywords '("unix" "environment") :authors '(("Steve Purcell" . "steve@sanityinc.com")) :maintainer '("Steve Purcell" . "steve@sanityinc.com") :url "https://github.com/purcell/exec-path-from-shell")
|
@ -0,0 +1,45 @@
|
||||
On OS X (and perhaps elsewhere) the $PATH environment variable and
|
||||
`exec-path' used by a windowed Emacs instance will usually be the
|
||||
system-wide default path, rather than that seen in a terminal
|
||||
window.
|
||||
|
||||
This library allows the user to set Emacs' `exec-path' and $PATH
|
||||
from the shell path, so that `shell-command', `compile' and the
|
||||
like work as expected.
|
||||
|
||||
It also allows other environment variables to be retrieved from the
|
||||
shell, so that Emacs will see the same values you get in a terminal.
|
||||
|
||||
If you use a non-POSIX-standard shell like "tcsh" or "fish", your
|
||||
shell will be asked to execute "sh" as a subshell in order to print
|
||||
out the variables in a format which can be reliably parsed. "sh"
|
||||
must be a POSIX-compliant shell in this case.
|
||||
|
||||
Note that shell variables which have not been exported as
|
||||
environment variables (e.g. using the "export" keyword) may not be
|
||||
visible to `exec-path-from-shell'.
|
||||
|
||||
Installation:
|
||||
|
||||
ELPA packages are available on Marmalade and MELPA. Alternatively,
|
||||
place this file on a directory in your `load-path', and explicitly
|
||||
require it.
|
||||
|
||||
Usage:
|
||||
|
||||
(require 'exec-path-from-shell) ;; if not using the ELPA package
|
||||
(exec-path-from-shell-initialize)
|
||||
|
||||
Customize `exec-path-from-shell-variables' to modify the list of
|
||||
variables imported.
|
||||
|
||||
If you use your Emacs config on other platforms, you can instead
|
||||
make initialization conditional as follows:
|
||||
|
||||
(when (memq window-system '(mac ns))
|
||||
(exec-path-from-shell-initialize))
|
||||
|
||||
Alternatively, you can use `exec-path-from-shell-copy-envs' or
|
||||
`exec-path-from-shell-copy-env' directly, e.g.
|
||||
|
||||
(exec-path-from-shell-copy-env "PYTHONPATH")
|
@ -1,4 +1,4 @@
|
||||
(define-package "hydra" "20191125.955" "Make bindings that stick around."
|
||||
(define-package "hydra" "0.15.0" "Make bindings that stick around."
|
||||
'((cl-lib "0.5")
|
||||
(lv "0"))
|
||||
:keywords
|
@ -0,0 +1,51 @@
|
||||
This package can be used to tie related commands into a family of
|
||||
short bindings with a common prefix - a Hydra.
|
||||
|
||||
Once you summon the Hydra (through the prefixed binding), all the
|
||||
heads can be called in succession with only a short extension.
|
||||
The Hydra is vanquished once Hercules, any binding that isn't the
|
||||
Hydra's head, arrives. Note that Hercules, besides vanquishing the
|
||||
Hydra, will still serve his orignal purpose, calling his proper
|
||||
command. This makes the Hydra very seamless, it's like a minor
|
||||
mode that disables itself automagically.
|
||||
|
||||
Here's an example Hydra, bound in the global map (you can use any
|
||||
keymap in place of `global-map'):
|
||||
|
||||
(defhydra hydra-zoom (global-map "<f2>")
|
||||
"zoom"
|
||||
("g" text-scale-increase "in")
|
||||
("l" text-scale-decrease "out"))
|
||||
|
||||
It allows to start a command chain either like this:
|
||||
"<f2> gg4ll5g", or "<f2> lgllg".
|
||||
|
||||
Here's another approach, when you just want a "callable keymap":
|
||||
|
||||
(defhydra hydra-toggle (:color blue)
|
||||
"toggle"
|
||||
("a" abbrev-mode "abbrev")
|
||||
("d" toggle-debug-on-error "debug")
|
||||
("f" auto-fill-mode "fill")
|
||||
("t" toggle-truncate-lines "truncate")
|
||||
("w" whitespace-mode "whitespace")
|
||||
("q" nil "cancel"))
|
||||
|
||||
This binds nothing so far, but if you follow up with:
|
||||
|
||||
(global-set-key (kbd "C-c C-v") 'hydra-toggle/body)
|
||||
|
||||
you will have bound "C-c C-v a", "C-c C-v d" etc.
|
||||
|
||||
Knowing that `defhydra' defines e.g. `hydra-toggle/body' command,
|
||||
you can nest Hydras if you wish, with `hydra-toggle/body' possibly
|
||||
becoming a blue head of another Hydra.
|
||||
|
||||
If you want to learn all intricacies of using `defhydra' without
|
||||
having to figure it all out from this source code, check out the
|
||||
wiki: https://github.com/abo-abo/hydra/wiki. There's a wealth of
|
||||
information there. Everyone is welcome to bring the existing pages
|
||||
up to date and add new ones.
|
||||
|
||||
Additionally, the file hydra-examples.el serves to demo most of the
|
||||
functionality.
|
@ -0,0 +1,2 @@
|
||||
;;; -*- no-byte-compile: t -*-
|
||||
(define-package "lv" "0.15.0" "Other echo area" 'nil :commit "f27fce1b2f0a9162e159557bdeb2c0c94defb4d2" :authors '(("Oleh Krehel")) :maintainer '("Oleh Krehel"))
|
@ -1,2 +0,0 @@
|
||||
;;; -*- no-byte-compile: t -*-
|
||||
(define-package "lv" "20191214.1357" "Other echo area" 'nil :commit "9db28034d7d61bfeff89899633b958f22befc53d" :authors '(("Oleh Krehel")) :maintainer '("Oleh Krehel"))
|
@ -1,4 +1,4 @@
|
||||
(define-package "use-package" "20191126.2034" "A configuration macro for simplifying your .emacs"
|
||||
(define-package "use-package" "2.4" "A configuration macro for simplifying your .emacs"
|
||||
'((emacs "24.3")
|
||||
(bind-key "2.4"))
|
||||
:keywords
|
@ -0,0 +1,8 @@
|
||||
The `use-package' declaration macro allows you to isolate package
|
||||
configuration in your ".emacs" in a way that is performance-oriented and,
|
||||
well, just tidy. I created it because I have over 80 packages that I use
|
||||
in Emacs, and things were getting difficult to manage. Yet with this
|
||||
utility my total load time is just under 1 second, with no loss of
|
||||
functionality!
|
||||
|
||||
Please see README.md from the same repository for documentation.
|
Loading…
Reference in New Issue