(shrink-window arg)
(enlarge-window arg)))
-;;* Obsoletes
-(defvar hydra-example-text-scale
- '(("g" text-scale-increase "zoom in")
- ("l" text-scale-decrease "zoom out"))
- "A two-headed hydra for text scale manipulation.")
-(make-obsolete-variable
- 'hydra-example-text-scale
- "Don't use `hydra-example-text-scale', just write your own
-`defhydra' using hydra-examples.el as a template"
- "0.9.0")
-
-(defvar hydra-example-move-window-splitter
- '(("h" hydra-move-splitter-left)
- ("j" hydra-move-splitter-down)
- ("k" hydra-move-splitter-up)
- ("l" hydra-move-splitter-right))
- "A four-headed hydra for the window splitter manipulation.
-Works best if you have not more than 4 windows.")
-(make-obsolete-variable
- 'hydra-example-move-window-splitter
- "Don't use `hydra-example-move-window-splitter', just write your own
-`defhydra' using hydra-examples.el as a template"
- "0.9.0")
-
-(defvar hydra-example-goto-error
- '(("h" first-error "first")
- ("j" next-error "next")
- ("k" previous-error "prev"))
- "A three-headed hydra for jumping between \"errors\".
-Useful for e.g. `occur', `rgrep' and the like.")
-(make-obsolete-variable
- 'hydra-example-goto-error
- "Don't use `hydra-example-goto-error', just write your own
-`defhydra' using hydra-examples.el as a template"
- "0.9.0")
-
-(defvar hydra-example-windmove
- '(("h" windmove-left)
- ("j" windmove-down)
- ("k" windmove-up)
- ("l" windmove-right))
- "A four-headed hydra for `windmove'.")
-(make-obsolete-variable
- 'hydra-example-windmove
- "Don't use `hydra-example-windmove', just write your own
-`defhydra' using hydra-examples.el as a template"
- "0.9.0")
-
(provide 'hydra-examples)
;;; hydra-examples.el ends here
,other-post))))))
;;* Macros
-;;** hydra-create
-;;;###autoload
-(defmacro hydra-create (body heads &optional method)
- "Create a hydra with a BODY prefix and HEADS with METHOD.
-This will result in `global-set-key' statements with the keys
-being the concatenation of BODY and each head in HEADS. HEADS is
-an list of (KEY FUNCTION &optional HINT).
-
-After one of the HEADS is called via BODY+KEY, it and the other
-HEADS can be called with only KEY (no need for BODY). This state
-is broken once any key binding that is not in HEADS is called.
-
-METHOD is a lambda takes two arguments: a KEY and a COMMAND.
-It defaults to `global-set-key'.
-When `(keymapp METHOD)`, it becomes:
-
- (lambda (key command) (define-key METHOD key command))"
- (declare (indent 1)
- (obsolete defhydra "0.8.0"))
- `(defhydra ,(intern
- (concat
- "hydra-" (replace-regexp-in-string " " "_" body)))
- ,(cond ((hydra--callablep method)
- method)
- ((null method)
- `(global-map ,body))
- (t
- (list method body)))
- "hydra"
- ,@(eval heads)))
-
;;** defhydra
;;;###autoload
(defmacro defhydra (name body &optional docstring &rest heads)