diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-02-11 12:02:47 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-02-11 12:03:15 +0100 |
commit | 6791fd29d3133c93e55358af1f1cf44814f56688 (patch) | |
tree | c13921b420565d6c9f2c5649e55fd37cdac45c5a | |
parent | 6cb6ddc67155356e56db9fc587625e938d51155a (diff) | |
download | org-mode-6791fd29d3133c93e55358af1f1cf44814f56688.tar.gz |
org-tempo: Fix obnoxious `ding' when expanding templates
* lisp/org-tempo.el (org-tempo-complete-tag): New function.
Reported-by: Brent Goodrick <bgoodr@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-02/msg00080.html>
-rw-r--r-- | lisp/org-tempo.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/org-tempo.el b/lisp/org-tempo.el index 42bf44d..4303ec1 100644 --- a/lisp/org-tempo.el +++ b/lisp/org-tempo.el @@ -121,6 +121,14 @@ Goes through `org-structure-template-alist' and (format "Insert a %s keyword" name) 'org-tempo-tags))) +(defun org-tempo-complete-tag (&rest _) + "Look for a tag and expand it silently. +Unlike to `tempo-complete-tag', do not give a signal if a partial +completion or no match at all is found. Return nil if expansion +didn't succeed." + (cl-letf (((symbol-function 'ding) #'ignore)) + (tempo-complete-tag t))) + ;;; Additional keywords (defun org-tempo--include-file () @@ -153,7 +161,7 @@ Goes through `org-structure-template-alist' and (add-hook 'org-mode-hook 'org-tempo-setup) (add-hook 'org-tab-before-tab-emulation-hook - 'tempo-complete-tag) + 'org-tempo-complete-tag) ;; Enable Org Tempo in all open Org buffers. (dolist (b (org-buffer-list)) |