From: Ruthard Baudach <ruthard.baudach@web.de>
To: supmua <supmua@googlegroups.com>
Subject: Re: [sup] ask_* functions from buffer.rb
Date: Tue, 23 Sep 2014 14:20:50 +0200 [thread overview]
Message-ID: <1411474662-sup-1726@ruthard-lappi> (raw)
In-Reply-To: <1411319537-astroid-0-fvayndb6xh-21321@strange>
[-- 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 --]
next prev parent reply other threads:[~2014-09-23 12:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-21 15:34 Ruthard Baudach
2014-09-21 17:14 ` [sup] " Gaute Hope
2014-09-23 12:20 ` Ruthard Baudach [this message]
2014-09-29 11:10 ` Gaute Hope
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=1411474662-sup-1726@ruthard-lappi \
--to=ruthard.baudach@web.de \
--cc=supmua@googlegroups.com \
/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