From 1d8aa3a40f19222eaec04dc9ce28242d00bc86e4 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 23 Aug 2023 20:26:09 +1200 Subject: [PATCH] buildmimetree.py: make kill-line a constant --- .config/neomutt/buildmimetree.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/neomutt/buildmimetree.py b/.config/neomutt/buildmimetree.py index f4ee821..3528b06 100755 --- a/.config/neomutt/buildmimetree.py +++ b/.config/neomutt/buildmimetree.py @@ -476,6 +476,8 @@ def do_massage( depth-first, and responsible for telling NeoMutt how to assemble the tree. """ + KILL_LINE=r'\Ca\Ck' + if isinstance(item, Part): # We've hit a leaf-node, i.e. an alternative or a related part # with actual content. @@ -496,7 +498,7 @@ def do_massage( # information, then we might just as well update the NeoMutt # tree now: if item.cid: - cmds.push(f"\\Ca\\Ck{item.cid}") + cmds.push(f"{KILL_LINE}{item.cid}") elif isinstance(item, Multipart): # This node has children, but we already visited them (see @@ -516,7 +518,7 @@ def do_massage( # If the item has a description, we might just as well add it if item.desc: - cmds.push(f"\\Ca\\Ck{item.desc}") + cmds.push(f"{KILL_LINE}{item.desc}") # Finally, if we're at non-root level, tag the new container, # as it might itself be part of a container, to be processed -- 2.39.5