* [sup-talk] [PATCH] Add 'A' archive and mark read command to inbox-mode.
@ 2008-04-17 20:43 Marc Hartstein
0 siblings, 0 replies; 2+ messages in thread
From: Marc Hartstein @ 2008-04-17 20:43 UTC (permalink / raw)
For some email, the only meaningful content is in the subject line. It is thus
useful to be able to dispatch this email with a single command after glancing
at it.
As 'N' moves the cursor, and 'a' doesn't clear the "unread" flag, it is
currently necessary to press "Nka" to do this on a single thread.
The 'A' command does this simple task with a single, easy-to-remember,
keystroke, but makes it harder to hit accidentally than 'a'. A multi_ mode is
supplied.
---
lib/sup/modes/inbox-mode.rb | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/inbox-mode.rb b/lib/sup/modes/inbox-mode.rb
index a2de13f..c623f4a 100644
--- a/lib/sup/modes/inbox-mode.rb
+++ b/lib/sup/modes/inbox-mode.rb
@@ -6,6 +6,7 @@ class InboxMode < ThreadIndexMode
register_keymap do |k|
## overwrite toggle_archived with archive
k.add :archive, "Archive thread (remove from inbox)", 'a'
+ k.add :read_and_archive, "Archive thread (remove from inbox) and mark read", 'A'
end
def initialize
@@ -38,6 +39,23 @@ class InboxMode < ThreadIndexMode
regen_text
end
+ def read_and_archive
+ return unless cursor_thread
+ cursor_thread.remove_label :unread
+ cursor_thread.remove_label :inbox
+ hide_thread cursor_thread
+ regen_text
+ end
+
+ def multi_read_and_archive threads
+ threads.each do |t|
+ t.remove_label :unread
+ t.remove_label :inbox
+ hide_thread t
+ end
+ regen_text
+ end
+
def handle_unarchived_update sender, m
add_or_unhide m
end
--
1.5.3.7
^ permalink raw reply [flat|nested] 2+ messages in thread
* [sup-talk] [PATCH] Add 'A' archive and mark read command to inbox-mode.
@ 2008-04-27 6:50 William Morgan
0 siblings, 0 replies; 2+ messages in thread
From: William Morgan @ 2008-04-27 6:50 UTC (permalink / raw)
Reformatted excerpts from Marc Hartstein's message of 2008-04-17:
> The 'A' command does this simple task with a single, easy-to-remember,
> keystroke, but makes it harder to hit accidentally than 'a'. A multi_
> mode is supplied.
Very nice idea. Merged into next. Thanks!
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-27 6:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-17 20:43 [sup-talk] [PATCH] Add 'A' archive and mark read command to inbox-mode Marc Hartstein
2008-04-27 6:50 William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox