[Rd] tk + browser() can leave R unresponsive

2013-08-03 Thread Scott Kostyshak
I don't know if this is a bug. I can reproduce the following on Ubuntu
12.04.2 and 13.04 64-bit with R version 3.0.1 and with r63479. There
is no difference if R is patched with the fix for PR#15407 or not,
although without the fix there are more ways to trigger this.

I can reproduce with the following:

1. Open R in gnome-terminal or xterm

2. Run 'library(tcltk)'

3. Run 'trace(tk_select.list, edit = TRUE)'
and put "browser()" at the beginning of the onOK body (e.g. in Vim run
<<:g/onOK/put ='browser()'>>). That is, transform

onOK <- function() {
res <- 1L + as.integer(tkcurselection(box))
cat("res is: ", res)
ans.select_list <<- choices[res]
tkgrab.release(dlg)
tkdestroy(dlg)
}

to:

onOK <- function() {
browser()
res <- 1L + as.integer(tkcurselection(box))
cat("res is: ", res)
ans.select_list <<- choices[res]
tkgrab.release(dlg)
tkdestroy(dlg)
}

4. Run 'install.packages()'

5. Double-click on a package

R becomes unresponsive and I have to kill it.

> sessionInfo()
R Under development (unstable) (2013-08-02 r63479)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

Scott


--
Scott Kostyshak
Economics PhD Candidate
Princeton University

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] tk + browser() can leave R unresponsive

2013-08-03 Thread Scott Kostyshak
On Sat, Aug 3, 2013 at 5:56 AM, Scott Kostyshak  wrote:
> I don't know if this is a bug. I can reproduce the following on Ubuntu
> 12.04.2 and 13.04 64-bit with R version 3.0.1 and with r63479. There
> is no difference if R is patched with the fix for PR#15407 or not,
> although without the fix there are more ways to trigger this.
>
> I can reproduce with the following:
>
> 1. Open R in gnome-terminal or xterm
>
> 2. Run 'library(tcltk)'
>
> 3. Run 'trace(tk_select.list, edit = TRUE)'
> and put "browser()" at the beginning of the onOK body (e.g. in Vim run
> <<:g/onOK/put ='browser()'>>). That is, transform
>
> onOK <- function() {
> res <- 1L + as.integer(tkcurselection(box))
> cat("res is: ", res)
> ans.select_list <<- choices[res]
> tkgrab.release(dlg)
> tkdestroy(dlg)
> }
>
> to:
>
> onOK <- function() {
> browser()
> res <- 1L + as.integer(tkcurselection(box))
> cat("res is: ", res)
> ans.select_list <<- choices[res]
> tkgrab.release(dlg)
> tkdestroy(dlg)
> }
>
> 4. Run 'install.packages()'
>
> 5. Double-click on a package
>
> R becomes unresponsive and I have to kill it.
>
>> sessionInfo()
> R Under development (unstable) (2013-08-02 r63479)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
>  [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
>  [9] LC_ADDRESS=C   LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> Scott
>
>
> --
> Scott Kostyshak
> Economics PhD Candidate
> Princeton University

This might be related to PR#14730. I will add this info there unless
someone suggests otherwise.

Scott


--
Scott Kostyshak
Economics PhD Candidate
Princeton University

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [R] Internalization of help pages

2013-08-03 Thread Prof Brian Ripley
This was an R-devel topic, and I have moved it where it belongs.  See 
the posting guide.


On 03/08/2013 08:34, Tomáš Greif wrote:

Bert,

thank you for your response.

I understand this would be huge task. My idea is:

1. Translation of help files is optional, driven by demand. This way (as I
believe) core packages will get translated first, followed by some other
CRAN packages. I don't expect that every page is translated.


It is not just a question of translating, but keeping translations up to 
date.  Even for messages, the latter is an issue.




2. Use collaborative open-source tools for translation. For example crowdin
is online translation tool free for open-source projects. Alternatively,
wiki can be used for translation (it would be however necessary to program
link to upload original translation and download translations back)

3. When browsing help, file based on user's locale will be displayed (if
exists) with failover to default (English).


You had better check the version that was translated, and that is not 
currently recorded in the file.



I agree with you that translation has to be exact. However, I believe that
users can benefit more from slightly inexact documentation written in their
first language than from exact documentation in language they do not
understand well.


That is a matter of opinion: many people have the opposite opinion.


Any idea how to create proof of concept for this? I guess this would
require attention from someone from r-core team.


Not so.  R is Open Source: just go ahead and do it.  You can contribute 
patches via bugs.r-project.org.   But note that this would not get 
released under R 3.1.0 ca Mar 2014, so there is plenty of time to iron 
this out and submit a fully working solution.


Another small issue is size.  For R itself the 'English' (mostly 
American) help pages are about 10MB installed.  Adding help pages for, 
say, the 15 languages for which we have translated messages would 
increase the size of R about 2.5x.




Regards,

Tomas


On 3 August 2013 01:39, Bert Gunter  wrote:


Tomáš

1.  Your concern is valid, especially now that R has become so widely
used throughout the world. But language translation is hard.

2. Warning and error messages are short, and relatively trivial to
translate.

3. There are tens of thousands of Help pages in thousands of packages,
most separately maintained.

I would guess that the best option would be to try to run the files
through a mature, open source translator, if such exists. However, I'm
ignorant of such matters. And my understanding is that at present,
even the best may not be adequate (Help files have to accurate in
exact detail).



Best,
Bert

On Fri, Aug 2, 2013 at 2:54 PM, Tomáš Greif
 wrote:

Is it possible to translate help files? I see there are some localization
options for GUI, but not for help. I think this would be really helpful

for

users who don't have English as their primary language.

Because all the online help is created from text files, it should be not
that difficult to maintain different language versions (e.g. to mark them
as not valid when primary documentation in English changes).

Regards,

Tomas Greif

 [[alternative HTML version deleted]]

__
r-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide

http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.




--

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:

http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

__
r-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



[[alternative HTML version deleted]]



__
r-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




--
Brian D. Ripley,  rip...@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, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel