* [sup-devel] [PATCH] Make automatic jumping to first/next open message configurable
@ 2010-02-21 9:09 Tero Tilus
2010-02-27 8:29 ` Rich Lane
0 siblings, 1 reply; 2+ messages in thread
From: Tero Tilus @ 2010-02-21 9:09 UTC (permalink / raw)
To: Sup developers
[-- Attachment #1: Type: text/plain, Size: 532 bytes --]
Automatic jumping to first/next open message when opening/collapsing
messages on thread view more got annoying. I made it configurable.
Patch attached and feature branch also available on github.
http://github.com/terotil/sup/tree/feature-configurable-auto-jump-to-msg
I first had the configuration key other way round so missing it from
conf file would not have changed sup behavior, but it looked pretty
convoluted that way so I just dropped "backwards compatibility".
--
Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
[-- Attachment #2: 0001-Make-automatic-jumping-to-first-next-open-message-co.patch --]
[-- Type: application/octet-stream, Size: 1931 bytes --]
From 230e8befb34bac38055599728923bc2999bc5e94 Mon Sep 17 00:00:00 2001
From: Tero Tilus <tero@tilus.net>
Date: Sun, 21 Feb 2010 09:35:59 +0200
Subject: [PATCH] Make automatic jumping to first/next open message configurable
---
lib/sup.rb | 1 +
lib/sup/modes/thread-index-mode.rb | 2 +-
lib/sup/modes/thread-view-mode.rb | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/sup.rb b/lib/sup.rb
index b9dc749..5114715 100644
--- a/lib/sup.rb
+++ b/lib/sup.rb
@@ -260,6 +260,7 @@ else
:ask_for_subject => true,
:confirm_no_attachments => true,
:confirm_top_posting => true,
+ :jump_to_open_message => true,
:discard_snippets_from_encrypted_messages => false,
:default_attachment_save_dir => "",
:sent_source => "sup://sent",
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
index a6bb2b9..7be5a1b 100644
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -111,7 +111,7 @@ EOS
mode = ThreadViewMode.new t, @hidden_labels, self
BufferManager.spawn t.subj, mode
BufferManager.draw_screen
- mode.jump_to_first_open
+ mode.jump_to_first_open if $config[:jump_to_open_message]
BufferManager.draw_screen # lame TODO: make this unnecessary
## the first draw_screen is needed before topline and botline
## are set, and the second to show the cursor having moved
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index 0e935a4..001a55b 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -330,7 +330,7 @@ EOS
elsif chunk.viewable?
view chunk
end
- if chunk.is_a?(Message)
+ if chunk.is_a?(Message) && $config[:jump_to_open_message]
jump_to_message chunk
jump_to_next_open if layout.state == :closed
end
--
1.5.6.5
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [sup-devel] [PATCH] Make automatic jumping to first/next open message configurable
2010-02-21 9:09 [sup-devel] [PATCH] Make automatic jumping to first/next open message configurable Tero Tilus
@ 2010-02-27 8:29 ` Rich Lane
0 siblings, 0 replies; 2+ messages in thread
From: Rich Lane @ 2010-02-27 8:29 UTC (permalink / raw)
To: Tero Tilus; +Cc: Sup developers
Applied to master.
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-27 8:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-21 9:09 [sup-devel] [PATCH] Make automatic jumping to first/next open message configurable Tero Tilus
2010-02-27 8:29 ` Rich Lane
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox