diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2025-03-16 22:39:51 -0400 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2025-03-16 22:39:51 -0400 |
| commit | 84a9db01eff1fcc52ad054c5ad3c22316739573f (patch) | |
| tree | 931ec3d131323e1240856ff053214b1b4e0f4a00 | |
| parent | 54e9db2b023e03b6f6b46aeec48ea74fd51d4e11 (diff) | |
| parent | 59a2a45a35027948476d1d7751b0f0215b1e61aa (diff) | |
Merge remote-tracking branch 'upstream/hydra/main' into externals/hydraexternals/hydra
| -rw-r--r-- | hydra.el | 27 |
1 files changed, 1 insertions, 26 deletions
@@ -1,6 +1,6 @@ ;;; hydra.el --- Make bindings that stick around. -*- lexical-binding: t -*- -;; Copyright (C) 2015-2022 Free Software Foundation, Inc. +;; Copyright (C) 2015-2025 Free Software Foundation, Inc. ;; Author: Oleh Krehel <ohwoeowho@gmail.com> ;; Maintainer: Oleh Krehel <ohwoeowho@gmail.com> @@ -322,31 +322,6 @@ Exitable only through a blue head.") "^.*(\\(defhydra\\) \\([[:alpha:]-]+\\)" 2))) -;;* Find Function - -;; FIXME: Maybe we can dispense with this advice if `defhydra' adds appropriate -;; `definition-name' properties to the functions it defines? -(advice-add 'find-function-search-for-symbol :around - #'hydra--around-find-function-search-for-symbol-advice) - -(defun hydra--around-find-function-search-for-symbol-advice - (orig-fun symbol type library) - "Navigate to hydras with `find-function-search-for-symbol'." - (let ((res (apply orig-fun symbol type library))) - (when (symbolp symbol) - ;; The original function returns (cons (current-buffer) (point)) - ;; if it found the point. - (unless (cdr res) - (with-current-buffer (find-file-noselect library) - (let ((sn (symbol-name symbol))) - (when (and (null type) - (string-match "\\`\\(hydra-[[:alnum:]-]+\\)/\\(.*\\)\\'" sn) - (re-search-forward (concat "(defhydra " (match-string 1 sn)) - nil t)) - (goto-char (match-beginning 0))) - (cons (current-buffer) (point)))))) - res)) - ;;* Universal Argument (defvar hydra-base-map (let ((map (make-sparse-keymap))) |
