From 61dee27223712532f7546a93d053ee7f3cc27e34 Mon Sep 17 00:00:00 2001 From: bth Date: Fri, 5 Jun 2026 13:50:19 -0700 Subject: [PATCH] um-tag-delete warns about tag not found --- um.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/um.el b/um.el index cc4192e..34c3386 100644 --- a/um.el +++ b/um.el @@ -307,8 +307,11 @@ Emits message if TAG is already present, but does not error." (defun um-tag-delete (tag) "Delete TAG from the journal header in current buffer." (goto-char (point-min)) - (when (search-forward (concat "+ " tag "\n") (um--header-end-pos) t) - (delete-region (match-beginning 0) (match-end 0)))) + (if (search-forward (concat "+ " tag "\n") (um--header-end-pos) t) + (delete-region (match-beginning 0) (match-end 0)) + ;; NOTE: as long as collection was gathered with um--extract-tags, this + ;; shouldn't happen: + (message "\"%s\" tag not found in %s" tag buffer-file-name))) (defun um-tag-do (tag insert) "Insert or delete TAG from the journal header in current buffer.