feat: tag manipulation

This commit is contained in:
2026-03-12 18:17:03 +01:00
parent 1453fdb3ad
commit 8a0c8bc2d7
5 changed files with 99 additions and 5 deletions

View File

@@ -3,7 +3,8 @@
# Print the message id of the last message within a thread.
# @argument $1: thread id
nm_last_message_in_thread() {
$NOTMUCH search --output=messages --offset=-1 thread:"$1" | sed 's/^...//'
# TODO: We may be smarter here that just incorporating excluded messages
$NOTMUCH search --output=messages --offset=-1 --exclude=false thread:"$1" | sed 's/^...//'
}
# Print the header of a message (with trailing empty line)
@@ -31,3 +32,10 @@ nm_message_part_nr() {
nm_message_get_part() {
$NOTMUCH show --part="$2" id:"$1"
}
# Add/remove a tag
# @argument $1: [+/-]tag
# @argument $2: query
nm_tag() {
$NOTMUCH tag "$1" "$2"
}