From d9bafb8ab143142122b149e170f5c508b3c4e642 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 13:23:39 +0200 Subject: Add call for org-src-block lang specific hydras --- emacs-init.org | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 4ed8801..dfb1aec 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3209,11 +3209,19 @@ _q_ quit ("c" org-table-toggle-coordinate-overlays :color blue) ("q" nil :color blue)) +(defun fpi/org-babel-src-mode-hydra () + "Launch a hydra specific to the src language of the current + babel code block if defined." + (interactive) + (let* ((elem (org-element-context)) + (lang (plist-get (cadr elem) :language))) + (pcase lang + ("bibtex" (org-ref-bibtex-hydra/body))))) (defhydra hydra-babel-helper (:color pink :hint nil) " org babel src block helper functions _n_ next _i_ info _I_ insert header -_p_ prev _c_ check +_p_ prev _c_ check _m_ ode hydra _h_ goto head _E_ expand ^ ^ _s_ split _q_ quit _r_ remove result _e_ examplify region @@ -3229,6 +3237,7 @@ _q_ quit _r_ remove result _e_ examplify region ("e" org-babel-examplify-region :color blue) ("r" org-babel-remove-result :color blue) ("h" org-babel-goto-src-block-head) + ("m" fpi/org-babel-src-mode-hydra :color blue) ("q" nil :color blue)) -- cgit v1.2.3