Search code examples
emacstagskeyboard-shortcutsorg-mode

setting new shortcut for tag search on emacs org-mode


This is probably simple, but I've been trying it for a couple days now without success. I have a tag called :urgent:, which I can access through:

C-c / m urgent

Question is, how can I create a shortcut to get it done with, say, f9?


Solution

  • (defun hello-world ()
    "My doc-string."
    (interactive)
      (org-tags-view nil "urgent"))
    
    (global-set-key [f9] 'hello-world)
    ;; or, use the following form instead of the one immediately above:
    ;; (define-key global-map [f9] 'hello-world)