* ask_* functions from buffer.rb @ 2014-09-21 15:34 Ruthard Baudach 2014-09-21 17:14 ` [sup] " Gaute Hope 0 siblings, 1 reply; 4+ messages in thread From: Ruthard Baudach @ 2014-09-21 15:34 UTC (permalink / raw) To: supmua [-- Attachment #1: Type: text/plain, Size: 429 bytes --] The ask* functions in buffer.rb are not commented. As far as I found out, the arguments are: domain: token used as key for @textfields, which seems to be a dictionary of input field objects question: string used as prompt completions: array of possible answers, that can be completed by using the tab key default: default value to return Is this correct? Greetings, Ruthard [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [sup] ask_* functions from buffer.rb 2014-09-21 15:34 ask_* functions from buffer.rb Ruthard Baudach @ 2014-09-21 17:14 ` Gaute Hope 2014-09-23 12:20 ` Ruthard Baudach 0 siblings, 1 reply; 4+ messages in thread From: Gaute Hope @ 2014-09-21 17:14 UTC (permalink / raw) To: supmua Excerpts from Ruthard Baudach's message of September 21, 2014 17:34: > The ask* functions in buffer.rb are not commented. As far as I found > out, the arguments are: > > domain: token used as key for @textfields, which seems to be a > dictionary of input field objects > question: string used as prompt > completions: array of possible answers, that can be completed by using > the tab key > default: default value to return > > Is this correct? Most likely. Correct me if I am wrong, but I don't think any of the active sup devs were involved in writing those functions :) I would happily accept a patch with some comments. Cheers, Gaute ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [sup] ask_* functions from buffer.rb 2014-09-21 17:14 ` [sup] " Gaute Hope @ 2014-09-23 12:20 ` Ruthard Baudach 2014-09-29 11:10 ` Gaute Hope 0 siblings, 1 reply; 4+ messages in thread From: Ruthard Baudach @ 2014-09-23 12:20 UTC (permalink / raw) To: supmua [-- Attachment #1.1: Type: text/plain, Size: 1055 bytes --] Dear Gaute, Warning! I never made patches before, so have a close look on this one before messing anything up. Attached is my first attempt at creating a patch for sup/lib/sup/buffer.rb adding a comment for the dialog functions >== Auszüge aus der Nachricht von Gaute Hope vom 2014-09-21 19:14: > Excerpts from Ruthard Baudach's message of September 21, 2014 17:34: > > The ask* functions in buffer.rb are not commented. As far as I found > > out, the arguments are: > > > > domain: token used as key for @textfields, which seems to be a > > dictionary of input field objects > > question: string used as prompt > > completions: array of possible answers, that can be completed by using > > the tab key > > default: default value to return > > > > Is this correct? > > Most likely. > > Correct me if I am wrong, but I don't think any of the active sup devs > were involved in writing those functions :) I would happily accept a > patch with some comments. > > Cheers, Gaute > [-- Attachment #1.2: buffer.rb-comment.diff --] [-- Type: application/octet-stream, Size: 890 bytes --] diff -Naur sup/lib/sup/buffer.rb my-sup/lib/sup/buffer.rb --- sup/lib/sup/buffer.rb 2014-09-23 13:53:16.723382665 +0200 +++ my-sup/lib/sup/buffer.rb 2014-09-23 14:14:58.190131982 +0200 @@ -396,6 +396,20 @@ end end + ## ask* functions. these functions display a one-line text field with + ## a prompt at the bottom of the screen. answers typed or choosen by + ## tab-completion + ## + ## common arguments are: + ## + ## domain: token used as key for @textfields, which seems to be a + ## dictionary of input field objects + ## question: string used as prompt + ## completions: array of possible answers, that can be completed by using + ## the tab key + ## default: default value to return + + def ask_with_completions domain, question, completions, default=nil ask domain, question, default do |s| s.fix_encoding! [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [sup] ask_* functions from buffer.rb 2014-09-23 12:20 ` Ruthard Baudach @ 2014-09-29 11:10 ` Gaute Hope 0 siblings, 0 replies; 4+ messages in thread From: Gaute Hope @ 2014-09-29 11:10 UTC (permalink / raw) To: supmua, Ruthard Baudach Excerpts from Ruthard Baudach's message of September 23, 2014 14:20: > Dear Gaute, > > Warning! I never made patches before, so have a close look on this one > before messing anything up. > > Attached is my first attempt at creating a patch for > sup/lib/sup/buffer.rb adding a comment for the dialog functions Thanks, I've applied the changes in commit 9cb10ec [0]. It is best if you send the patches using either git format-patch or as a pull request on github. That way you get all the information into the commit and it is easy to apply for me. Check out the wiki under Contributing [1] and look for format-patch in git docs [2]. Also, make sure you don't add any stray whitspaces at the end of lines. Cheers, Gaute [0] https://github.com/sup-heliotrope/sup/commit/9cb10eccda93cd36389bd5cc6515e3766d2f1bc0 [1] https://github.com/sup-heliotrope/sup/wiki/Contributing [2] http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-09-29 11:09 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-09-21 15:34 ask_* functions from buffer.rb Ruthard Baudach 2014-09-21 17:14 ` [sup] " Gaute Hope 2014-09-23 12:20 ` Ruthard Baudach 2014-09-29 11:10 ` Gaute Hope
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox