From 444eedc799e8ed98603e17d7ea2c67b72bb1e3fb Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Thu, 6 Aug 2020 10:51:24 +0800 Subject: [PATCH] (internal): remove with-template-error wrapper (#1004) This has caused more confusion than it has helped. --- org-roam-dailies.el | 3 +-- org-roam-macs.el | 13 ------------- org-roam-protocol.el | 3 +-- org-roam.el | 6 ++---- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/org-roam-dailies.el b/org-roam-dailies.el index 3a83f5d..26c9dba 100644 --- a/org-roam-dailies.el +++ b/org-roam-dailies.el @@ -104,8 +104,7 @@ Template string :\n%v") (org-roam-capture--info (list (cons 'time time))) (org-roam-capture--context 'dailies)) (setq org-roam-capture-additional-template-props (list :finalize 'find-file)) - (org-roam--with-template-error 'org-roam-dailies-capture-templates - (org-roam-capture--capture)))) + (org-roam-capture--capture))) (defun org-roam-dailies-today () "Create and find the daily note for today." diff --git a/org-roam-macs.el b/org-roam-macs.el index 1777c2a..e2e2384 100644 --- a/org-roam-macs.el +++ b/org-roam-macs.el @@ -53,19 +53,6 @@ If FILE, set `org-roam-temp-file-name' to file and insert its contents." (setq-local org-roam-file-name ,file)) ,@body))))) -(defmacro org-roam--with-template-error (templates &rest body) - "Eval BODY, and point to TEMPLATES on error. -Provides more informative error messages so that users know where -to look. - -\(fn TEMPLATES BODY...)" - (declare (debug (form body)) (indent 1)) - `(condition-case err - ,@body - (error (user-error "%s. Please adjust `%s'" - (error-message-string err) - ,templates)))) - (defun org-roam-message (format-string &rest args) "Pass FORMAT-STRING and ARGS to `message' when `org-roam-verbose' is t." (when org-roam-verbose diff --git a/org-roam-protocol.el b/org-roam-protocol.el index d2f917b..eb077fe 100644 --- a/org-roam-protocol.el +++ b/org-roam-protocol.el @@ -62,8 +62,7 @@ It opens or creates a note with the given ref. (org-roam-capture--info decoded-alist) (template (cdr (assoc 'template decoded-alist)))) (raise-frame) - (org-roam--with-template-error 'org-roam-capture-ref-templates - (org-roam-capture--capture nil template)) + (org-roam-capture--capture nil template) (org-roam-message "Item captured."))) nil) diff --git a/org-roam.el b/org-roam.el index 8bf57c8..6d4f162 100644 --- a/org-roam.el +++ b/org-roam.el @@ -1588,8 +1588,7 @@ If NO-CONFIRM, assume that the user does not want to modify the initial prompt." (slug . ,(funcall org-roam-title-to-slug-function title-with-tags)))) (org-roam-capture--context 'title)) (setq org-roam-capture-additional-template-props (list :finalize 'find-file)) - (org-roam--with-template-error 'org-roam-capture-templates - (org-roam-capture--capture)))))) + (org-roam-capture--capture))))) ;;;###autoload (defun org-roam-find-directory () @@ -1678,8 +1677,7 @@ If DESCRIPTION is provided, use this as the link label. See :insert-at (point-marker) :link-description link-description :finalize 'insert-link)) - (org-roam--with-template-error 'org-roam-capture-templates - (org-roam-capture--capture))))) + (org-roam-capture--capture)))) res)) (deactivate-mark)))