From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WLQGGifJmWFbjwAAgWs5BA (envelope-from ) for ; Sun, 21 Nov 2021 05:20:55 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id IG+1FSfJmWFsdQAAB5/wlQ (envelope-from ) for ; Sun, 21 Nov 2021 04:20:55 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C7302155B9 for ; Sun, 21 Nov 2021 05:20:54 +0100 (CET) Received: from localhost ([::1]:41024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moeLU-0008QI-QX for larch@yhetil.org; Sat, 20 Nov 2021 23:20:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moeKx-0008Pj-Mr for emacs-orgmode@gnu.org; Sat, 20 Nov 2021 23:20:19 -0500 Received: from [2607:f8b0:4864:20::633] (port=43541 helo=mail-pl1-x633.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moeKv-0003bK-Kt for emacs-orgmode@gnu.org; Sat, 20 Nov 2021 23:20:19 -0500 Received: by mail-pl1-x633.google.com with SMTP id m24so11233070pls.10 for ; Sat, 20 Nov 2021 20:20:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=dYR+LqYg3Oar0hidxroDaV10nwvEIEC7u2+E7DtH2jU=; b=jZ9d1AgHw+BdovYz0iOLyj9o3UsCC1hWTexHvEVZ2RlH2bjb66TSiLyyhkqAWpA8Lt ZAhBVXIJDDlruz2uEO3/bOCh19zUK4+EZW+SbJHxXvHGce+CM4tw6oEUBaiSUbJI7WJg HAatt6AC8EfZNPV2WRyYHLGQF2HN0wYJfu5f87b77Gnet6FdO4WZWS4NzZHxSAXbkccF +Gs0gQu6x57iT8V3F1JJYATrmrZu6CfgVPUhB+2TlfyRbZdTAO44Bs27l+dNqG2AGLhn nN3M/mme3/6sAA3MKJhuybH+W5bM06gBUQYNnd6sVp2+1vBeBhuz5w+klN8Jz6dhK1g7 56jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=dYR+LqYg3Oar0hidxroDaV10nwvEIEC7u2+E7DtH2jU=; b=tnkHGIVOAqTiS2wAW8V9qd6y4b/VaFMMhCl/p+EK6xUbDtT9FPdb/zX8Lnmxit03Jj XB1QGG6uqd14aR+EDO4NQP8ABzt9xJh4iFdJfyMsWujQ6uN5iW46RDIMoIkcZui/floJ zRryWEonVH4mJOgi5yWGlusIYmWOqpwO75pD5c1iuT8/G0NtSzOCbP+qYj+12d9MlDu4 3zXB1w4Dgmc89m4VYcLa4pDo0IriI/YJ8W9rPgxWpV2Aj0Ydyzk+bUt4xfCUH1yTqOQ4 zrwRTcdOlBkheI1GKBHjZSWQhByci7cV8G02j4T2yI4uIXEVVETkusGtaaYcDbH6LX6f kdoQ== X-Gm-Message-State: AOAM533N8HG9rPcfLvSL57bArGh/Hh4B3Q+IPuBUkv5omMseqA9NR0kJ 0g2kIissxmfsNKxtIR0/Me0= X-Google-Smtp-Source: ABdhPJxkF0/aw80p53ONmxcDcTGS2i4jJGNW6wy9XsFl9n7HF016FmzU0kFy8j91c8SalIrbmBH0hQ== X-Received: by 2002:a17:90b:3e85:: with SMTP id rj5mr17516590pjb.172.1637468416179; Sat, 20 Nov 2021 20:20:16 -0800 (PST) Received: from localhost (61-245-128-160.3df580.per.nbn.aussiebb.net. [61.245.128.160]) by smtp.gmail.com with ESMTPSA id z19sm4277531pfe.181.2021.11.20.20.20.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Nov 2021 20:20:15 -0800 (PST) References: <875yuh9b3t.fsf@gmail.com> <87czojh6m4.fsf@gmail.com> <8735ntg3ve.fsf@gmail.com> <87mtm1e5lt.fsf@gmail.com> <87pmqwt6zi.fsf@gmail.com> <874k87850s.fsf@gmail.com> <87ee7a5xif.fsf@gmail.com> User-agent: mu4e 1.6.9; emacs 28.0.50 From: Timothy To: Tim Cross Subject: Re: [PATCH] Accept more :tangle-mode specification forms Date: Sun, 21 Nov 2021 12:02:07 +0800 In-reply-to: <87ee7a5xif.fsf@gmail.com> Message-ID: <87wnl26sxv.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::633 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=tecosaur@gmail.com; helo=mail-pl1-x633.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637468454; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=dYR+LqYg3Oar0hidxroDaV10nwvEIEC7u2+E7DtH2jU=; b=VSpQmHMfcWLAbBVNzyHmgnqFFSzSAODokIHv4WImG8SvNtIlrZMS7KIngAKUwwzOYGe9gz mex8lxj3YpLuuahl0GY+lAW0r826uS+Nia+nPVWekio8z/qoC9pz4Wem+iQddmFJYoYc4o LHs0yaZsWOKURunZDIfThEd/hQ512mT4ttutpmyXqCwMHsro++WfNQF0zhyCZ7kU/DQZ2m ZE2juKzxa3olOWNTQmxaDKfnIUWPgcVpOB6LedvAVDaZbNohdO5ML/ncJYf23/oLQsb2pL EIC2CkXISlbVLzXsfr2vtUUJNh/0xPuC+zf8834rdLHzdDHTgRR719mEXBr4ew== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637468454; a=rsa-sha256; cv=none; b=O1WiH9MZF7jQnbbUoaF7nhi25Qo9i65OcJ8ukl9o53rtvKiwPv6VrfAQmGon3e/+0yitPb sltvOJ0wc+QDUoHxqR+riQ4OZM8XHafXmF5dPlz9q4I1e4+wUdGYOUbz3zJ57W7jFFhXSE jvC/ATlPhnBoaSdfYzC0eeTxEtyXBjJCUg5umRQFaQSJuqSLwyKf4vWCFp13/UBsCJkvls jaUM11J4aql7g0g8lPYAbonlsVpTmCkLln+Iy3H0yGRb3aLLkC/AQLoGi86QocFuGD2cCH WmqtpVwzMEXMYo1vJxlLHQrf9MeQ6HoIzcSNNZ4UiJ4j0oDlT1wYHkJDIz5xCg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jZ9d1AgH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.08 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jZ9d1AgH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C7302155B9 X-Spam-Score: -4.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: Aj8Hhcz6tV+R Hi Tim, >> The parsing of =E2=80=9C555=E2=80=9D to the integer 555 is done by >> org-babel-parse-header-arguments, and so can=E2=80=99t really be changed. > > I don't understand this. Why can't it be changed? Well, it can't be changed without changing org-babel-parse-header-arguments, which is quite a major change and I suspect may be a breaking change. Maybe it's fine? I just don't feel confident about this. > When I said disable base 10 values, what I meant was generate an error > if the value looks like it is base 10 i.e. does not have a leading o or > #o. This makes it clear it has to be specified as an octal value and > will alert users to this fact. This is all well and good, but the point I'm making is that since due to the current behaviour of org-babel-parse-header-arguments we can't distinguish between :tangle-mode (identity #o555) and :tangle-mode 365 putting this idea /into practice/ doesn't look like it will be easy. It's also worth noting that with regard to the recent changes that have been made, this is not a new issue. >> I think the ls-style is quite valuable for two reasons. It=E2=80=99s >> well-established thanks to ls, and is particularly good for >> understanding permissions at a glance. > > I would agree it is an established way to display the permissions > associated with a filesystem object, but disagree it is a well > established way to set such values - I know of no other tool which uses > this format. The driving motivation here is that while the tools which you mention do not use this for setting permissions (e.g. chmod), they are only used for /setting/ permissions. Since Org files aren't write-only, and occasionally we go back and look at what we've written :P I think allowing a format that is optimised for ease-of-reading instead of ease-of-writing makes some sense. It is in this respect that I think ls -l style is a good idea. > It is also not the same as the ls -l display (no object > type indicator). The ls -l also displays sticky bit, uid and gid. Does > your format also support setting these values (something which can be > done with the octal or symbolic formats) i.e. support s, S, t and T for > the 'executable' bit for user/group? Ah, I'm afraid that I'm not that up-together on sticky bits. I suspect that it's not just the ls -l style that will need tweaking. I'll read up on this in the next few days and update the ML. > Personally, I prefer the symbolic form as it is shorter and clear. I > find the ls -l form too easy to get wrong (especially with getting the > number of '-' correct). Isn't choice a great thing? :D In seriousness, this is exactly why I think it's worth providing these options. At least thinking back to when I started using Linux a few years ago I would have said the same thing about the octal form, and was completely unfamiliar with chmod. I expect different people to have different preferences with these three options, but for one of them to be something most people are happy with. >> Tim suggested that invalid forms should cause tangling to fail, but I fe= el this >> may be a bit much. Personally I=E2=80=99m inclined to either >> =E2=80=A2 warn, and don=E2=80=99t touch the file permissions (this is wh= at currently occurs) >> =E2=80=A2 use a very conservative file permission (e.g. rw=E2=80=94=E2= =80=94-). > > I'm unsure on this. My concern is people may not notice the warning and > then be surprised later. Given the potential security issues, a later > surprise is something to be avoided even if it is inconvenient. With > respect to the default action to take, I would suggest we also need to > look at the default umask setting for the user and if that is more > restrictive, use that rather than some value like rw------- For all we > know, the user has set a specific umask for a valid reason and will be > surprised if emacs just ignores that to do what it wants (another > surprise to be avoided). > The user is not required to specify a mode. However, if they do and if > we cannot interpret what they have specified without ambiguity, we > should throw an error and cease processing. Making a guess as to what > they intended in this situation is IMO a big mistake. I don't see how using the default permissions is a potential security risk? Could it surprise the user, yes, but that seems unavoidable when the user is doing something invalid. > My only preference for "#o" over just "o" prefix is to clearly signal to > the user that it is an octal value and avoid the situation where you > might glance a value and see the leading 'o' as a '0', missing the point > it is an octal value not a decimal one. However, this seems like a low > risk, so I'm happy either way. Well, I've got "o" for now but that's not set in stone. With a lower case "o" I feel the risk for confusion with "0" is quite low (besides which a "0" prefix seems to be the C-style for octal anyway). All the best, Timothy