On Wed, 15 Nov 2006, Dirk Eddelbuettel wrote:

| 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.

of course here a4 meant the value returned by paperconf at install time.

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.

But that is not what you are doing (in your version locale is ignored).

Are you requesting an easily overridable switch on top of the sane defaults?

Yes (that is what the upstream package does, which is documented in NEWS). For multi-user servers it can make sense.

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?

Ok I know there are several other ways to fix that, and the ~/.Renviron solution is good enough for me. But then R contains unused code and does not act as documented.

| 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) ?

Er no, it uses R_PAPERSIZE if set, letter if LC_PAPER contains _US or _CA, and a4 otherwise, which is already better than a4 everywhere.

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

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

Er, I don't think so, and I explain in the other email how to achieve this. Why would this be broken?

| > 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 ?

It achieves what is documented in the NEWS file.

| > 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.

(*)
That would mean going back to the old behavior (and ignoring the locale), which is fine.

| 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.

so locale probably answers "POSIX" or "C" (not "") and you get a4 by default, nothing wrong here (well _you_ would probably prefer letter, but you should set LANG to en_US if you expect american defaults).

In conclusion, I would be fine with either (*) or documenting the fact that one is supposed to define R_PAPERSIZE_USER in ~/.Renviron to override the default papersize (right now, a user trying to override it will read the doc and try setting an environment variable or a locale). Or with actually doing nothing and expecting users can take a look at /etc/R/Renviron and deduce what they are supposed to do.

Ok I wrote a lot of useless things today... Sorry for taking so much of your time...

--
Marc Glisse


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

Reply via email to