From: Eric Hodel Date: 2011-05-19T05:42:35+09:00 Subject: [ruby-core:36321] Re: [Ruby 1.9 - Bug #3167] RDoc issues in interactive mode On May 18, 2011, at 7:56 AM, Benoit Daloze wrote: >> I don't think I can fix 2) as it's performed by Readline > > I believed it is not related to Readline, I probably did not make myself clear. I thought you meant the method list shown when you attempt to complete a method definition by hitting at the Readline prompt. >>> 2) methods should be a comma separated list in interactive mode >>> because the current output is very long and verbose and make you scroll a lot to see the class description >>> The separation of the methods depending from which 'gem' it comes is really useful and should be kept. > > When you type 'String' in `ri -i`, you get the class description, then a very long list of methods, because they are displayed one by line. I remember they were displayed as a comma separated list. > > I did begin to write about this, here is the idea of it: > > diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb > @@ -456,9 +456,7 @@ > out << RDoc::Markup::Heading.new(1, "#{name}:") > out << RDoc::Markup::BlankLine.new > > - out.push(*methods.map do |method| > - RDoc::Markup::Verbatim.new method > - end) > + out << RDoc::Markup::Paragraph.new(methods.join(', ')) Ah, ok! How about a comma-separated output when given to a user ($stdout is a TTY or rdoc is sending output to a pager) and a newline-separated list when output is not given to a user (rdoc blah | grep)?