um-tag-delete warns about tag not found
This commit is contained in:
parent
ec96a2a436
commit
61dee27223
1 changed files with 5 additions and 2 deletions
7
um.el
7
um.el
|
|
@ -307,8 +307,11 @@ Emits message if TAG is already present, but does not error."
|
||||||
(defun um-tag-delete (tag)
|
(defun um-tag-delete (tag)
|
||||||
"Delete TAG from the journal header in current buffer."
|
"Delete TAG from the journal header in current buffer."
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(when (search-forward (concat "+ " tag "\n") (um--header-end-pos) t)
|
(if (search-forward (concat "+ " tag "\n") (um--header-end-pos) t)
|
||||||
(delete-region (match-beginning 0) (match-end 0))))
|
(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)
|
(defun um-tag-do (tag insert)
|
||||||
"Insert or delete TAG from the journal header in current buffer.
|
"Insert or delete TAG from the journal header in current buffer.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue