[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hydra: Have hint shown immediately

From: Florian Lindner
Subject: hydra: Have hint shown immediately
Date: Wed, 29 Apr 2015 10:02:33 +0200
User-agent: KNode/4.14.7


I wonder if anyone is familiar with the hydra package:

I have an hydra to call search engines:

(defhydra hydra-google (global-map "C-c /" :color blue)
  "Search Engines"
  ("c" (lambda ()
   "C++ Reference")
  ("g" (lambda ()
         (flo/start-search "";))

flo/start-search looks like that:

(defun flo/start-search (url)
  (browse-url (replace-regexp-in-string
               (regexp-quote "%s")
               (if (region-active-p)
                   (buffer-substring (region-beginning) (region-end))
                 (read-string "Search for: " (thing-at-point 'symbol) 
"searches" nil t)

interactive is just for testing, it will vanish probably. Since this is my 
first elisp "program" please criticise!

My question: How can I make the hydra menu to be shown as soon as I press C-
c /? Becaue I exit the hydra after pressing the key I'll never see the menu 
and forget option when more search engines are aded.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]