On Wed, Sep 29, 2021 at 02:55:46AM -0400, Jeremy Cowgar wrote: > On 2021-09-29 02:39, tomas@tuxteam.de wrote: > >On Tue, Sep 28, 2021 at 10:54:48AM -0400, Jeremy Cowgar wrote: > >>As an org user I would expect :tangle-mode 0660 to produce a file that > >>has user rw, group rw, other nothing. Instead, what really happens > >>currently is 0660 is treated as an integer which is actually > >>3140. This produces unexpected file permissions. > >> > > > >Hm. This looks dangerous: interpreting an integer as octal just > >due to the context? > > > >I do understand why, but still... > > > >Why not recommend Elisp's explicit syntax for octal representation, > >i.e. :tangle-mode #o660? And put a prominent note in the docs, > >of course. > > Are you suggesting this currently works or that the patch should be > changed to make that work? A quick try on my local system (pre-patch), > I receive the error: > > Wrong type argument: fixnump, "#o660" Oh. It seems Org converts that to string based on its own rules instead of on Elisp's. Note that I'm not dead set /against/ your proposal. I was pointing out a possible inconsistency and arguing for some reflection, however it may turn out. I'd have a slight preference for the #oXXX variant (and for Org agreeing with Elisp on what a number is ;-) but it's just that, a slight preference. The UNIX shell's convention "leading zero to denote base 8" (coming from C, I don't know where that comes from) is one not very happy hack, IMO. But if that's what is in people's muscle memory, so be it ;-) Cheers - t