Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: cworth@cworth.org (Carl Worth)
Subject: [sup-talk] [PATCH] Be less overzealous in moving text to the left column
Date: Wed, 26 Aug 2009 14:53:32 -0700	[thread overview]
Message-ID: <1251323127-sup-5162@yoom.home.cworth.org> (raw)
In-Reply-To: <1251050007-sup-9740@masanjin.net>

Excerpts from William Morgan's message of Sun Aug 23 10:55:59 -0700 2009:
> Reformatted excerpts from Carl Worth's message of 2009-08-19:
> > Specifically, scroll as little as possible to get the current message
> > to just fit on the right side.
> 
> Is this the same as setting loose_alignment to true, and the
> IDEAL_*_CONTENTs to 0?

I don't think so.

Doing that, (at least as in the below patch, for example), always puts
the current message flush left. And that can result in later messages
in the threads, (not descendants of the current thread though), being
cut off on the left. (And all this with dozens of empty columns on the
right of my terminal.) That's precisely the behavior I was getting
before my patch and which I'm trying to change.

What I want instead is for the message to appear in its "natural"
position (according to the threading), unless that would cause the
message to be cut off on the right. In which case, we jump to the
minimum column such that:

	1. We don't cut any of the current message off on the left

	2. We display all of the message on the right, (if possible
	   without violating point 1).

I believe that what I've coded achieves that. The two open questions I
still have are:

	A. Is there some simpler way to achieve the result I want with
	   some of the existing code?

	B. If not, is some of the existing code rendered obsolete with
	   my code in place?

As for (B), for example, with my code in place I don't think there's
any need for a notion of "ideal context". The ideal context is the
natural position of the thread.

And I still haven't figured out what loose_alignment means and which
actions will cause loose vs. non-loose layout.

-Carl

diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index dfe30ff..b7bbc7c 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -401,9 +401,9 @@ EOS
     end
   end
 
-  IDEAL_TOP_CONTEXT = 3 # try and give 3 rows of top context
-  IDEAL_LEFT_CONTEXT = 4 # try and give 4 columns of left context
-  def jump_to_message m, loose_alignment=false
+  IDEAL_TOP_CONTEXT = 0 # don't bother trying to give any rows of top context
+  IDEAL_LEFT_CONTEXT = 0 # don't bother trying to give any columns of left context
+  def jump_to_message m, loose_alignment=true
     l = @layout[m]
     left = l.depth * INDENT_SPACES
     right = left + l.width
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090826/8c5c013c/attachment.bin>


  reply	other threads:[~2009-08-26 21:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20  6:31 Carl Worth
2009-08-23 17:55 ` William Morgan
2009-08-26 21:53   ` Carl Worth [this message]
2009-09-03 17:12     ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1251323127-sup-5162@yoom.home.cworth.org \
    --to=cworth@cworth.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox