<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div></div><div><br></div><div><br></div><div><div>1) We chopped the input into only one word so the script can handle it better and not throw to the tooltip a big error. I put this stripping / to the query string, however it really should move to the search_docs(query) command, where we are executing the search. Sorry but I did add to there and break the ruby code.</div><div><br></div><div><div>Ctrl-H --> documentation_for_word() --> search_docs_all(query) --> search_docs(query)** --> docsetutil </div><div><div>Ctrl-H --> documentation_for_word() --> search_docs_all(query) --> man_page(query)** --> man </div><div><br></div><div><br></div><div><br></div></div></div><div>2) If we keep the full string in query variable, then when we print the tooltip, we can show the full text back to the user.</div><div>As it stands we show back the doctored text, i.e. the first word or line of the selected text. </div><div><br></div><div><br></div><div>3) With the latest (above) the command it still may not execute right for conditions where there are spaces, tabs, or newline characters etc before the text point. So cleaning up the input should be tested and tweaked some more.</div><div><br></div><div>4) If the word is wrapped in square brackets. e.g. [NSArray] - then TM_SELECTED_TEXT will not work but TM_CURRENT_WORD will.</div><div>Again, a better place to sanitize this input may be either search_docs(query) or search_docs_all(query)</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div>5) If we have just run the command (Ctrl-H) then we have opened a Web-window and not a text window.</div><div>Can we press Ctrl-H here (in the html window) to bring up the dialog again to perform another search? </div><div><br></div><div>This would be much more convenient when we are engaged in the activity only for searching, and reading documentation.</div><div>Not to need to switch back to the working document, to run this command ? </div><div><br></div><div><br></div><div><br></div><div>6) As Allan wants we will show the search box only conditionally, when there isnt a current word on the caret. However it would be a nice option to have for those who always want to show it. This may sound like a personal request, however i would be very grateful because pressing Ctrl-W is very much more difficult with RSI than to press enter key with the dialog. So to check on TM_DOC_SEARCH_BOX_ALWAYS or a defaulted argument will allow the user to customise :)</div><div><br></div><div>def documentation_for_word( show_always = FALSE ) ?</div><div><br></div><div><br></div><div><br></div><div><br></div><div>dreamcat7</div><a href="mailto:dreamcat7@googlemail.com">dreamcat7@googlemail.com</a><div><br></div><div><br><div><div>On 7 Jan 2009, at 21:15, dreamcat7 wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Done - patch available.</div><div>Hope they're in the right format, etc.</div><div><br></div><div><span style="color: #1a4dcc"><a href="irc://irc.freenode.net/dreamcat4,isuser"><b>dreamcat4: </b></a></span>patch-1 (trunk/support) <span style="text-decoration: underline ; color: #0000ff"><a href="http://pastie.org/354995">http://pastie.org/354995</a></span></div><div><font class="Apple-style-span" color="#0000FF"><span class="Apple-style-span" style="text-decoration: underline;"><br></span></font></div><div><font class="Apple-style-span" color="#0000FF"><span class="Apple-style-span" style="text-decoration: underline;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); "></span></span></font></div><span><dreamcat7-searchbox.patch></span></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><font class="Apple-style-span" color="#0000FF"><span class="Apple-style-span" style="text-decoration: underline;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); "> </span></span></font></div><span><SearchBox.nib></span></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><font class="Apple-style-span" color="#0000FF"><span class="Apple-style-span" style="text-decoration: underline;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); "></span></span></font></div><div><span class="Apple-style-span" style="text-decoration: underline;"><br></span></div><p style="margin: 0.0px 0.0px 2.0px 10.0px; text-indent: -10.0px; font: 12.0px Helvetica"><span style="color: #ec0003"><a href="irc://irc.freenode.net/dreamcat4,isuser"><b>dreamcat4: </b></a></span>patch-2 (trunk/Bundles/Objective-C.tmbundle) <a href="http://pastie.org/355007"><span style="text-decoration: underline ; color: #0000ff">http://pastie.org/355007</span></a></p><p style="margin: 0.0px 0.0px 2.0px 0.0px; text-align: center; font: 12.0px Helvetica; color: #808080"><br></p> <span><dreamcat7-objc_docset_query.patch></span></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div> </div><div><br><div><br><div><div>On 6 Jan 2009, at 03:15, Allan Odgaard wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 1 Jan 2009, at 14:56, dreamcat7 wrote:<br><br><blockquote type="cite">[...] searches on Apple Docset [...]<br></blockquote><blockquote type="cite">To access this feature you must type in and select the word into your<br></blockquote><blockquote type="cite">document before proceeding.<br></blockquote><br>You needn’t select it, just have the caret “on it”.<br><br><blockquote type="cite">However it strikes me that adding an alternative method to use the <br></blockquote><blockquote type="cite">script (probably a Search box) could be useful.<br></blockquote><br>Great idea. I often type in keywords followed by ⌃H, but we could <br>make ⌃H popup a dialog when there is no current word (or word is not <br>found), we do that for ⌃H in HTML mode (and maybe a few others).<br><br>We can’t really do a list of terms (to filter) though since there are <br>thousands of terms and we don’t really know them beforehand.<br><br><blockquote type="cite">Or perhaps we will need some kind of re-write because there another <br></blockquote><blockquote type="cite">place at the beginning of the file where "the selected word" is used <br></blockquote><blockquote type="cite">for input?<br></blockquote><br>Yeah, I don’t think it is an easy change, also because we have <br>different doc commands depending on context in Objective-C. The stuff <br>is long overdue for refactoring though.<br><br><br>_______________________________________________<br>textmate mailing list<br><a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>http://lists.macromates.com/listinfo/textmate<br></div></blockquote></div><br></div></div></div></blockquote></div><br></div></body></html>