Hi!
 
Yup, that's it exactly!

Great!
 
Now I just need to work out how to turn the values I get into columns
that I can scroll the screen to.

Is there a function that returns the width of the longest visible
line, or the width of the buffer with truncated lines? I can't find
anything like that.

I don't know of any such function either. However, I noticed that the scroll bar change length depending on the content of the window. So, presumably, you get all relevant information when `ns_set_horizontal_scroll_bar' is called.
 
    -- Anders