Hi Marc,

Thanks for the follow-up. I will try to reply to both your emails.

On 15 November 2006 at 17:30, Marc Glisse wrote:
| > Your environment variable clashes with the config file, and the config file
| > does not respect / listen to the env var. So the env var is a null-op.
| 
| Here is the behavior I expect from R: by default it should use the global 
| paperconf setting, but this should be overridable by the user (I don't 

Anything is overridable by the user in ~/.Renviron, see   help(Startup)  in R.

| care how, whether it is locale or some other environment variable). This 
| was achieved (before the LC_PAPER introduction) with:
| R_PAPERSIZE_USER=${R_PAPERSIZE}
| R_PAPERSIZE=${R_PAPERSIZE-'a4'}
| which uses a4 by default unless the user specified a R_PAPERSIZE setting 
| (seems to me that PAPERSIZE would be more standard, but never mind)

That is not desirable as many users would object to having a default of a4.
Thanks to Debian's paperconfig package, they will get e.g. letter if that is
what their system has.

That is the correct behaviour: respect the locale and user setting
automatically and do not require environment variables to function.

[ As an aside, all R variables are prefixed R_ to avoid clashes with other
vars using the same name. Have a look at /usr/bin/R for examples ]
 
| I am using your line:
| echo 'print(options("papersize"))' | R --slave
| to check what papersize is used.
| 
| With the config file as you are providing it, I (simple user) cannot 
| override the default setting of a4, because setting R_PAPERSIZE or 
| R_PAPERSIZE_USER is ignored, and so is setting LC_PAPER (because 
| R_PAPERSIZE_USER is not empty after reading the config file).

I am not sure what behaviour we are talking about here. It is may
understanding that __by default__ every user in Europe should get a4, and
every North American user should get letter.

The Debian package provides this default. No bug here.

Are you requesting an easily overridable switch on top of the sane defaults?
Or do you want letter (even though you answered my questions about your paper
preferences with a4 ...).  

If you just want a one-off fix, why not set

        options("papersize"="letter")

in your script?
 
| It does not confuse R at all to have an empty R_PAPERSIZE_USER, and what I 
| proposed behaves as documented in the NEWS file. But then that does not 
| use paperconf. 

And hence does not improve over the compile-time default of "a4 everywhere"
which is clearly suboptimal.

| The only way to use paperconf would be to remove the use of 
| the locale in src/library/profile/Rprofile.unix:
| 
|      lcpaper <- Sys.getlocale("LC_PAPER") # might be null: OK as nchar is 0
|      papersize <- if(nchar(lcpaper))
|          if(length(grep("(_US|_CA)", lcpaper)) > 0) "letter" else "a4"
|      else Sys.getenv("R_PAPERSIZE")
| ==>
|      papersize <- Sys.getenv("R_PAPERSIZE")

No, I do not want to modify core R files.
 
| 
| So there are basically 2 choices:
| 1) act as documented in the R NEWS file (R_PAPERSIZE then LC_PAPER)

and have broken default behaviour (a4 everywhere) ?

| 2) act as we used to (R_PAPERSIZE then paperconf)

but that broke with R 2.4.0, didn't it?

| As maintainer I guess it is your choice to decide between the 2 (I don't 
| care), but both are better than just using paperconf.

I find neither very appealing, but maybe I still misunderstand exactly where
yuo want to go with this.


On 15 November 2006 at 17:49, Marc Glisse wrote:
| On Wed, 15 Nov 2006, Marc Glisse wrote:
| 
| > So there are basically 2 choices:
| 
| I should have said how one might implement those:
| 
| > 1) act as documented in the R NEWS file (R_PAPERSIZE then LC_PAPER)
| 
| R_PAPERSIZE_USER=${R_PAPERSIZE}

But R_PAPERSIZE is unset, so what does this achieve ?
 
| > 2) act as we used to (R_PAPERSIZE then paperconf)
| 
| R_PAPERSIZE_USER=${R_PAPERSIZE-'a4'}
| where a4 is the output ofpaperconf.

Yes, I could rewrite the postinst write
 
        R_PAPERSIZE_USER=${R_PAPERSIZE-'

followed by what paperconf says, followed by '} to close.

| In both cases, there should be no need for the additional R_PAPERSIZE= 
| line but it does not hurt if it stays there (the code reading it should 
| never be reached since we have LC_PAPER, but you never know if someone 
| might set it to ''). I have not tested.

I use a US keyboard and no locale settings, so I have no LC_PAPER by default.

Regards, Dirk

-- 
Hell, there are no rules here - we're trying to accomplish something. 
                                                  -- Thomas A. Edison


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to