diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-02-05 13:45:31 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-02-05 14:26:33 +0100 |
commit | e331cc44b672d39e09b5c971c4f3a99d5a3c93cc (patch) | |
tree | 3070b30c1ad593c1e68a3611a967285bd91d44c3 | |
parent | 8fa596d425a563ab018be05e44b82d0ab76a6b31 (diff) |
buffers/thread: drop support for auto-read tagging
It's pointless complexity that I do not need.
-rw-r--r-- | alot/buffers/thread.py | 41 | ||||
-rw-r--r-- | alot/commands/thread.py | 8 | ||||
-rw-r--r-- | alot/defaults/alot.rc.spec | 3 |
3 files changed, 1 insertions, 51 deletions
diff --git a/alot/buffers/thread.py b/alot/buffers/thread.py index 74df6b15..faf3e3c2 100644 --- a/alot/buffers/thread.py +++ b/alot/buffers/thread.py @@ -29,10 +29,6 @@ class ThreadBuffer(Buffer): self.thread = thread self.message_count = thread.get_total_messages() - # two semaphores for auto-removal of unread tag - self._auto_unread_dont_touch_mids = set([]) - self._auto_unread_writing = False - self._indent_width = settings.get('thread_indent_replies') self.rebuild() Buffer.__init__(self, ui, self.body) @@ -97,43 +93,8 @@ class ThreadBuffer(Buffer): self._nested_tree = NestedTree(A, interpret_covered=True) self.body = TreeBox(self._nested_tree) - self.message_count = self.thread.get_total_messages() - def render(self, size, focus=False): - if self.message_count == 0: - return self.body.render(size, focus) - - if settings.get('auto_remove_unread'): - logging.debug('Tbuffer: auto remove unread tag from msg?') - msg = self.get_selected_message() - mid = msg.get_message_id() - focus_pos = self.body.get_focus()[1] - summary_pos = (self.body.get_focus()[1][0], (0,)) - cursor_on_non_summary = (focus_pos != summary_pos) - if cursor_on_non_summary: - if mid not in self._auto_unread_dont_touch_mids: - if 'unread' in msg.get_tags(): - logging.debug('Tbuffer: removing unread') - - def clear(): - self._auto_unread_writing = False - - self._auto_unread_dont_touch_mids.add(mid) - self._auto_unread_writing = True - msg.remove_tags(['unread'], afterwards=clear) - fcmd = commands.globals.FlushCommand(silent=True) - asyncio.get_event_loop().create_task( - self.ui.apply_command(fcmd)) - else: - logging.debug('Tbuffer: No, msg not unread') - else: - logging.debug('Tbuffer: No, mid locked for autorm-unread') - else: - if not self._auto_unread_writing and \ - mid in self._auto_unread_dont_touch_mids: - self._auto_unread_dont_touch_mids.remove(mid) - logging.debug('Tbuffer: No, cursor on summary') - return self.body.render(size, focus) + self.message_count = self.thread.get_total_messages() def get_selected_mid(self): """Return Message ID of focussed message.""" diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 2ac3f335..468ae149 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -1110,14 +1110,6 @@ class TagCommand(Command): def refresh_widgets(): for mt in messagetrees: mt.refresh() - - # put currently selected message id on a block list for the - # auto-remove-unread feature. This makes sure that explicit - # tag-unread commands for the current message are not undone on the - # next keypress (triggering the autorm again)... - mid = tbuffer.get_selected_mid() - tbuffer._auto_unread_dont_touch_mids.add(mid) - tbuffer.refresh() tags = [t for t in self.tagsstring.split(',') if t] diff --git a/alot/defaults/alot.rc.spec b/alot/defaults/alot.rc.spec index f83099af..17d3cc13 100644 --- a/alot/defaults/alot.rc.spec +++ b/alot/defaults/alot.rc.spec @@ -1,9 +1,6 @@ ask_subject = boolean(default=True) # ask for subject when compose -# automatically remove 'unread' tag when focussing messages in thread mode -auto_remove_unread = boolean(default=True) - # prompt for initial tags when compose compose_ask_tags = boolean(default=False) |