branch: externals/hydra
commit 82ff12666e08485c6b8f0e346878c4e0b16c992d
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    hydra.el (find-func): Fix advice
    
    In case of *Help* for `seq-contains', the `symbol' arg
    is (seq-contains nil t t), which is not a symbol. So now check for
    that.
    
    Fixes #332
---
 hydra.el | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/hydra.el b/hydra.el
index 2b1a7eeafe..246d3d388d 100644
--- a/hydra.el
+++ b/hydra.el
@@ -333,18 +333,19 @@ Exitable only through a blue head.")
     (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)))))))
+    (prog1 ad-do-it
+      (when (symbolp symbol)
+        ;; 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

Reply via email to