[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 27b7f40 15/22: Make find-function work with defhydra
From: |
Oleh Krehel |
Subject: |
[elpa] master 27b7f40 15/22: Make find-function work with defhydra |
Date: |
Fri, 16 Oct 2015 10:06:59 +0000 |
branch: master
commit 27b7f40cb21157be0dabc37046b83ed99151a26e
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Make find-function work with defhydra
* hydra.el (find-function-search-for-symbol): New defadvice.
Fixes #153
---
hydra.el | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/hydra.el b/hydra.el
index fa4f641..a9b4587 100644
--- a/hydra.el
+++ b/hydra.el
@@ -250,6 +250,25 @@ Exitable only through a blue head.")
(1 font-lock-keyword-face)
(2 font-lock-type-face)))))
+;;* Find Function
+(eval-after-load 'find-func
+ '(defadvice find-function-search-for-symbol
+ (around hydra-around-find-function-search-for-symbol-advice
+ (symbol type library) activate)
+ "Navigate to hydras with `find-function-search-for-symbol'."
+ ad-do-it
+ ;; The orignial function returns (cons (current-buffer) (point))
+ ;; if it found the point.
+ (unless (cdr ad-return-value)
+ (with-current-buffer (find-file-noselect library)
+ (let ((sn (symbol-name symbol)))
+ (when (and (null type)
+ (string-match "\\`\\(hydra-[a-z-A-Z0-9]+\\)/\\(.*\\)\\'"
sn)
+ (re-search-forward (concat "(defhydra " (match-string 1
sn))
+ nil t))
+ (goto-char (match-beginning 0)))
+ (cons (current-buffer) (point)))))))
+
;;* Universal Argument
(defvar hydra-base-map
(let ((map (make-sparse-keymap)))
- [elpa] master adc2997 08/22: Allow for "_[_" and "_]_" in docs, (continued)
- [elpa] master adc2997 08/22: Allow for "_[_" and "_]_" in docs, Oleh Krehel, 2015/10/16
- [elpa] master 1acd5f6 05/22: hydra.el (hydra-face-blue): Customize for dark themes, Oleh Krehel, 2015/10/16
- [elpa] master c8b4749 09/22: Allow binding heads to "%", Oleh Krehel, 2015/10/16
- [elpa] master 7aa8187 13/22: Allow to specify :face for each head, Oleh Krehel, 2015/10/16
- [elpa] master df7b079 10/22: hydra.el (hydra-head-format): Customize the key formatting, Oleh Krehel, 2015/10/16
- [elpa] master 900ca34 04/22: Allow access to the current hydra body, Oleh Krehel, 2015/10/16
- [elpa] master 1e9276a 12/22: Remove trailing whitespace from :columns docstring, Oleh Krehel, 2015/10/16
- [elpa] master 852ae26 14/22: Use quote instead of function to prevent compiler warnings, Oleh Krehel, 2015/10/16
- [elpa] master ea36afc 19/22: Allow "_", "!", and "&" as keys in docstrings, Oleh Krehel, 2015/10/16
- [elpa] master f58d356 17/22: Allow #'command syntax for heads, just to have it, Oleh Krehel, 2015/10/16
- [elpa] master 27b7f40 15/22: Make find-function work with defhydra,
Oleh Krehel <=
- [elpa] master 3fb3168 18/22: hydra.el (hydra--format): Allow "@" key in the docs, Oleh Krehel, 2015/10/16
- [elpa] master 336602f 11/22: Add :columns option for hydra body, Oleh Krehel, 2015/10/16
- [elpa] master 4bf7f1c 21/22: Bump version, Oleh Krehel, 2015/10/16
- [elpa] master c5327e1 16/22: Declare dired-mark to silence byte-compiler, Oleh Krehel, 2015/10/16
- [elpa] master 39eed63 20/22: hydra.el (hydra-disable): Deactivate key-chord advice more, Oleh Krehel, 2015/10/16
- [elpa] master bfeccce 22/22: Merge commit '4bf7f1c9e46fb819c673e55d8a1891774e139f98' from hydra, Oleh Krehel, 2015/10/16