瀏覽代碼

org-tempo: Fix TAB behaviour

* lisp/org-tempo.el (org-tempo-complete-tag): Use a different trick to
  handle failed completions.

Reported-by: Brent Goodrick <bgoodr@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-02/msg00164.html>
Nicolas Goaziou 7 年之前
父節點
當前提交
2c93a0b2d7
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lisp/org-tempo.el

+ 3 - 2
lisp/org-tempo.el

@@ -126,8 +126,9 @@ Goes through `org-structure-template-alist' and
 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)))
+  ;; `tempo-complete-tag' returns its SILENT argument when there is no
+  ;; completion available at all.
+  (not (eq 'fail (tempo-complete-tag 'fail))))
 
 ;;; Additional keywords