On 2021-08-16 08:17, David Bremner writes: > That particular function won't work for us because it would introduce a > new dependency on s.el. But if someone wants to make an equivalent using > only core emacs functions and integrate it into notmuch-tag, that seems > likely OK to me. What is the minimal emacs version notmuch requires? Because if it’s above 24.4, we could use string-trim-right: string-trim-right is a compiled function defined in subr-x.el.gz. Signature (string-trim-right STRING &optional REGEXP) Documentation Trim STRING of trailing string matching REGEXP. REGEXP defaults to "[ \\t\\n\\r]+". Demos :PROPERTIES: :added: 24.4 :changes: 26.1 The optional REGEXP argument is added. :END: Best, Alan