Skip to content

Instantly share code, notes, and snippets.

@sprig
Last active July 2, 2024 11:32
Show Gist options
  • Save sprig/11499090 to your computer and use it in GitHub Desktop.
Save sprig/11499090 to your computer and use it in GitHub Desktop.
Advice for org-set-tags to disable helm completion
(defun kk/run-with-no-helm (orig-func &rest args)
"Run a function without helm completion."
(if (boundp 'helm-mode)
(let ((orig-helm-mode helm-mode))
(unwind-protect
(progn
(helm-mode 0)
(apply orig-func args)
)
(helm-mode (if orig-helm-mode 1 0))))
(apply orig-func args)
))
(advice-add 'org-icompleting-read :around 'kk/run-with-no-helm)
(advice-add 'org-completing-read :around 'kk/run-with-no-helm)
(advice-add 'org-completing-read-no-i :around 'kk/run-with-no-helm)
(defun kk/org-set-tags-no-helm (orig-func &rest args)
"Run org-set-tags without helm."
(if (boundp 'helm-mode)
(let ((orig-helm-mode helm-mode))
(unwind-protect
(progn
(helm-mode 0)
(apply orig-func args)
)
(helm-mode (if orig-helm-mode 1 0))))
(apply orig-func args)
))
(advice-add 'org-set-tags :around 'kk/org-set-tags-no-helm)
@dwla
Copy link

dwla commented Jul 2, 2024

Thank you so much! This is exactly what I need! I am irritated by the Helm for many times as it pops up when I don't need it in org mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment