瀏覽代碼

org-tempo: Small refactoring

* lisp/org-tempo.el (org-tempo-add-templates): Small refactoring.
Nicolas Goaziou 7 年之前
父節點
當前提交
878f2ae68b
共有 1 個文件被更改,包括 2 次插入6 次删除
  1. 2 6
      lisp/org-tempo.el

+ 2 - 6
lisp/org-tempo.el

@@ -94,12 +94,8 @@ Goes through `org-structure-template-alist' and
        "Duplicated keys in `org-structure-template-alist' and `org-tempo-keywords-alist'"))
 
     ;; Remove any keys already defined in case they have been updated.
-    (mapc (lambda (key)
-	    (if (assoc-string key org-tempo-tags)
-		(setq org-tempo-tags
-		      (delete (assoc-string key org-tempo-tags)
-			      org-tempo-tags))))
-	  keys)
+    (setq org-tempo-tags
+	  (cl-remove-if (lambda (tag) (member (car tag) keys)) org-tempo-tags))
     (mapc #'org-tempo-add-block org-structure-template-alist)
     (mapc #'org-tempo-add-keyword org-tempo-keywords-alist)))