On 15 November 2006 at 19:52, Marc Glisse wrote:
| 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.

Well, still gives me letter here in Chicago which I consider a bug. I like my
solution better...
 
| > | 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?

I did some tests between your bug report and the first package upload with
the fix, and I could not get this to work.
 
| > | > 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 

Sure wrong. All printers on this continent use letter.

| you should set LANG to en_US if you expect american defaults).

I didn't need it so far and everything just works.

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

I appreciate your effort, but I still do not think we have improved
things manifestedly. 

One choice I see is to change /etc/R/Renviron to 

        [EMAIL PROTECTED]:~> grep PAPERSIZE /etc/R/Renviron
        ## Default printer paper size: first record if user set R_PAPERSIZE
        R_PAPERSIZE_USER=${R_PAPERSIZE_USER-'letter'}
        R_PAPERSIZE=${R_PAPERSIZE-'letter'}

where the first 'letter' is filled in at configuration time. That way it is
still overrideable:

        [EMAIL PROTECTED]:~> r -e 'print(options("papersize"))'
        $papersize
        [1] "letter"
        
        [EMAIL PROTECTED]:~> R_PAPERSIZE_USER=a4 r -e 
'print(options("papersize"))'
        $papersize
        [1] "a4"

Is that ok by you?

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