From: Yuval Turgeman <yuvalt@gmail.com>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: sam@ravnborg.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Menuconfig search changes - pt. 3
Date: Wed, 15 Sep 2004 01:19:26 +0300 [thread overview]
Message-ID: <9ae345c004091415197ea06621@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0409141613050.877@scrub.home>
On Tue, 14 Sep 2004 19:53:26 +0200 (CEST), Roman Zippel
<zippel@linux-m68k.org> wrote:
> Hi,
>
> On Tue, 14 Sep 2004, Yuval Turgeman wrote:
>
> > +static int regex_match(const char *string, regex_t *re)
> > +{
> > + int rc;
> > +
> > + rc = regexec(re, string, (size_t) 0, NULL, 0);
> > + if (rc)
> > + return 0;
> > + return 1;
> > +}
>
> I guess, this doesn't has to be a separate function anymore.
Ok.
> > +static void show_expr(struct menu *menu, FILE *fp)
> > +{
> > + bool hit = false;
> > + fprintf(fp, "Depends:\n ");
> > + if (menu->prompt->visible.expr) {
> > + if (!hit)
> > + hit = true;
> > + expr_fprint(menu->prompt->visible.expr, fp);
> > + }
> > + if (!hit)
> > + fprintf(fp, "None");
> > + if (menu->sym) {
> > + struct property *prop;
> > + hit = false;
> > + fprintf(fp, "\nSelects:\n ");
> > + for_all_properties(menu->sym, prop, P_SELECT) {
> > + if (!hit)
> > + hit = true;
> > + expr_fprint(prop->expr, fp);
> > + }
> > + if (!hit)
> > + fprintf(fp, "None");
> > + hit = false;
> > + fprintf(fp, "\nSelected by:\n ");
> > + if (menu->sym->rev_dep.expr) {
> > + hit = true;
> > + expr_fprint(menu->sym->rev_dep.expr, fp);
> > + }
> > + if (!hit)
> > + fprintf(fp, "None");
> > + }
> > +}
>
> This still prints duplicate information, look at how
> ConfigMainWindow::setHelp() in qconf.cc does it. Your function should have
> pretty much the same structure, e.g.
I don't understand - duplicate information of what ?
Can you perhaps give me an example (it seems to me that i am actually
doing what qconf is doing... printing all the P_SELECT of the all the
properties, printing the dependencies and the reverse dependencies) ?
> > + for_all_symbols(i, sym) {
> > + if (!sym->name)
> > + continue;
> > + if (!regex_match(sym->name, &re))
> > + continue;
> > + for_all_prompts(sym, prop) {
>
> here you should iterate over all properties and print the info about it.
The search prints out plenty of info already - what info do you think
is missing ?
>
> > + if (!hit)
> > + fprintf(fp, "No matches found.");
>
> You could print the number of found symbols here.
Ok.
>
> > stat = exec_conf();
> > + if (stat == 26) {
>
> Move this into the switch part a few lines below and simply use the next
> available number. For this you need to print the currently selected
> symbol and the search string from lxdialog, this way you also return to
> the same previously selected symbol after exiting the search.
Ok (although if I remember correctly it does return to selected symbol)
Thanks,
Yuval.
next prev parent reply other threads:[~2004-09-14 22:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-14 12:14 [PATCH] Menuconfig search changes - pt. 3 Yuval Turgeman
2004-09-14 17:53 ` Roman Zippel
2004-09-14 22:19 ` Yuval Turgeman [this message]
2004-09-17 15:59 ` Roman Zippel
-- strict thread matches above, loose matches on Subject: below --
2004-09-03 19:00 Yuval Turgeman
2004-09-04 0:47 ` Roman Zippel
2004-09-04 17:13 ` Yuval Turgeman
2004-09-13 23:16 ` Roman Zippel
2004-09-14 10:53 ` Yuval Turgeman
2004-09-14 11:00 ` Roman Zippel
2004-09-14 11:10 ` Yuval Turgeman
2004-09-14 11:45 ` Roman Zippel
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=9ae345c004091415197ea06621@mail.gmail.com \
--to=yuvalt@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=zippel@linux-m68k.org \
/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