[Rd] patch to add a menu item in Rgui for RSiteSearch

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Apr 12 19:09:01 CEST 2005


On Tue, 12 Apr 2005, Liaw, Andy wrote:

> Please consider adding the following to the next R release (I understand
> that it's too late for R-2.1.0).  It adds the menu item `Search R Site' in
> the `Help' menu in Rgui (which calls RSiteSearch() on the input string).

Can you or someone else think of a better name?  That sounds like it 
searches www.r-project.org.  I think even 'R Sites Search' would be 
better.

Yes, it is too late: we need lead time for the translators these days.
(RGui has Chinese, German, Italian and Japanese menus available.)

>
> Best,
> Andy
>
> --- R-beta/src/gnuwin32/rui.c	2005-03-06 09:41:40.000000000 -0500
> +++ R-beta-new/src/gnuwin32/rui.c	2005-04-12 08:21:55.001824500 -0400
> @@ -65,7 +65,8 @@
> static menuitem msource, mdisplay, mload, msave, mloadhistory,
>     msavehistory, mpaste, mpastecmds, mcopy, mcopypaste, mlazy, mconfig,
>     mls, mrm, msearch, mhelp, mmanintro, mmanref, mmandata,
> -    mmanext, mmanlang, mmanadmin, mman0, mapropos, mhelpstart, mhelpsearch,
>
> +    mmanext, mmanlang, mmanadmin, mman0, mapropos, mhelpstart, mhelpsearch,
> +    msearchRsite,
>     mFAQ, mrwFAQ, mpkgl, mpkgm, mpkgi, mpkgil, mpkgu, /*mpkgb, mpkgbu,*/
>     mde, mCRAN, mrepos;
> static int lmanintro, lmanref, lmandata, lmanlang, lmanext, lmanadmin;
> @@ -485,6 +486,21 @@
>     }
> }
>
> +static void menusearchRsite(control m)
> +{
> +    char *s;
> +    static char olds[256] = "";
> +
> +    if (!ConsoleAcceptCmd) return;
> +    s = askstring(G_("Search R Site"), olds);
> +    if (s && strlen(s)) {
> +	snprintf(cmd, 1024, "RSiteSearch(\"%s\")", s);
> +	if (strlen(s) > 255) s[255] = '\0';
> +	strcpy(olds, s);
> +	consolecmd(RConsole, cmd);
> +    }
> +}
> +
> static void menuapropos(control m)
> {
>     char *s;
> @@ -560,6 +576,7 @@
> 	enable(msearch);
> 	enable(mhelp);
> 	enable(mhelpsearch);
> +	enable(msearchRsite);
> 	enable(mapropos);
> 	enable(mpkgl);
> 	enable(mpkgm);
> @@ -579,6 +596,7 @@
> 	disable(msearch);
> 	disable(mhelp);
> 	disable(mhelpsearch);
> +	disable(msearchRsite);
> 	disable(mapropos);
> 	disable(mpkgl);
> 	disable(mpkgm);
> @@ -985,6 +1003,7 @@
>     MCHECK(mhelpstart = newmenuitem(G_("Html help"), 0, menuhelpstart));
>     if (!check_doc_file("doc\\html\\rwin.html")) disable(mhelpstart);
>     MCHECK(mhelpsearch = newmenuitem(G_("Search help..."), 0,
> menuhelpsearch));
> +    MCHECK(msearchRsite = newmenuitem(G_("Search R Site..."), 0,
> menusearchRsite));
>     MCHECK(newmenuitem("-", 0, NULL));
>     MCHECK(mapropos = newmenuitem(G_("Apropos..."), 0, menuapropos));
>     MCHECK(newmenuitem("-", 0, NULL));
>
> ______________________________________________
> R-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list