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 sKaxELF/VGE4tQAAgWs5BA (envelope-from ) for ; Wed, 29 Sep 2021 17:01:05 +0200 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 aDVMDLF/VGEHEQAAB5/wlQ (envelope-from ) for ; Wed, 29 Sep 2021 15:01:05 +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 D9C1E34DAD for ; Wed, 29 Sep 2021 17:01:03 +0200 (CEST) Received: from localhost ([::1]:38110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVb4v-00073k-AJ for larch@yhetil.org; Wed, 29 Sep 2021 11:01:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVb3g-00072c-WB for emacs-orgmode@gnu.org; Wed, 29 Sep 2021 10:59:45 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:51719) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVb3e-0003zt-98 for emacs-orgmode@gnu.org; Wed, 29 Sep 2021 10:59:44 -0400 Received: by mail-pj1-x1033.google.com with SMTP id h12so1898839pjj.1 for ; Wed, 29 Sep 2021 07:59:41 -0700 (PDT) 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=Zge0F5kKcYg+ldIHtnzGA+RbzBKuQq1YJppIiZKYbmA=; b=Su+ddVueOV3PAwGY3+nQLYqi39y2lBd87VjDYkGpC18HOqGMQTUt/xwW0geFBy/2/S aXvFHKKmg0aOTsO/0fTth/RvLjKYkjkzRGaKCJTBCMaW9VsOAy/y7c0J2gpJUUYLG+GU 23XIoB2MUi9zS3F5DNyoh7mBwPODK1Ll4tIb7AzHU6M7BYvnm3BQkVpM7fXfd+jN8q/5 cfipyUtHQiAREI1HnHJiAh+tCZDRUi2T43z/HAfRRNJanmxbNqmFI8OCJd7tQI/AFHMu GKuBVrpJVHQo42DzYBoqjT4FdaSYN3V0NmBOayzVlfdrFi+8+tI18iQ7KLwpSq2Eit86 VrkQ== 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=Zge0F5kKcYg+ldIHtnzGA+RbzBKuQq1YJppIiZKYbmA=; b=BX0PoNbf+VK7WGG20jZNOGVh3bGy9VTTVDfbh8T9CWJgRuxXsq+d36xkLu44TDEoXQ q73pmn3JywbG7WBWiirhK7p3nJM+OnDAOXFEbYGh29mwlRYF7kHWCFoBDLCPbwtQSYR1 fZUnsP4LD6fD6saxCBHjutVrQW7oXIOTjol1MAxsf3hYvN5YKajouH7T46MeDV/g0FO9 bgzthvFbHmM6avXt/t3ATUetlhRXq1v0o/6xulMPFGgkRBOpA/O/34wjl9ctz3jAHfEm Wbw22XzULvPwnvApm/aN8HyJI3L8nYhUz/69LjLrkFJnIA4CyBCej+gXWn3vKLjxvX7N ju9g== X-Gm-Message-State: AOAM531rt4D5aGCMoVgRD7084kUmrmxOUc1e6KHMZo8G/HxL11PEvd8b 90i6YRm9qIotogfsdRrnaufv70yOqvE= X-Google-Smtp-Source: ABdhPJzbc/Gzb/zKYQlf51hmLpxUxijzWpwHPfGqJU24DBZaVxXZce3yjJOc9yNtHwQ5/VtI6GmJ7g== X-Received: by 2002:a17:90b:a0a:: with SMTP id gg10mr434817pjb.4.1632927580831; Wed, 29 Sep 2021 07:59:40 -0700 (PDT) Received: from localhost (61-245-128-160.3df580.per.nbn.aussiebb.net. [61.245.128.160]) by smtp.gmail.com with ESMTPSA id q21sm156219pfj.90.2021.09.29.07.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 07:59:40 -0700 (PDT) References: <20210928145448.245883-1-jeremy@cowgar.com> <87a6jvcwdd.fsf@gmail.com> <20210929142659.GD15513@tuxteam.de> User-agent: mu4e 1.6.5; emacs 28.0.50 From: Timothy To: tomas@tuxteam.de Subject: Re: [PATCH] Treat :tangle-mode as an octal value not integer Date: Wed, 29 Sep 2021 22:58:43 +0800 In-reply-to: <20210929142659.GD15513@tuxteam.de> Message-ID: <874ka3ctra.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=tecosaur@gmail.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1632927664; 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=Zge0F5kKcYg+ldIHtnzGA+RbzBKuQq1YJppIiZKYbmA=; b=uJxS3faaa6aUtwjSYMp1DMJN5yQnLFS0Sm0rmrKjml6V0r+Hq9tRI1zQfRkNIHb6oJXcLp 0akpy7b/KYc98i3hsDHVAEyuQ8+w3YZ91hrp7JGV2UaRsAARMnfMTcCYLgg+gQBlizw/o1 ZP6iwSrtft32O1T80TQOsWdQPtBtup3s04FqFmp51GFY3/L237nwrlcD2bjuPArXDbTkWc iUD/8cr3cqUlSJkjgR5VQZ4AEmsBmhIvhZAlnfPqwaZM0DOGnoVW8F9saKNPBblW6nHiPY pb7Bccy/NlWQkKUrh0emRP+WjBjpNKnGhRtHb4VSeqLpLj4aHygPoxIQjiPpkw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632927664; a=rsa-sha256; cv=none; b=B3vNdGGwOzcloJRVbvVJHEuHWqo/xGk4aNF1T/kFgClAAy9iP+/HN4aGARHQMRhdSl13Al w61nAatzFVQaA/5IbBrkpjgD2OSE70vJ6Qt84NbE+W/joJ6jrCT+J03+a+UUZ/fXHWnAoH 5Ejl76wAAXkE30IgSSn+x0CfcCkbgMTnOCLDsSymiqdQdTLx7vlO4bESCV0BKfjaQJ8tze DMY16S6oW7R82KK2NPkVKIyHgBRl626q8IkBJh0uDS00ctKh9vmG2UIbPYAbM0ZujPjmLR Mv8lKBz8rX648yJbxatxUc34GS9MG/rhEHOvxLb9/rB47bolq9FADSpQ+v1tRA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Su+ddVue; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.10 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Su+ddVue; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: D9C1E34DAD X-Spam-Score: -3.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: UcHYrt7Y3Y5l writes: > So you favour going the "full custom special parser". You're much more > involved in Org, so I think your gut feeling counts more than mine here :) Well, I'm not sure that my feeling is representative of experienced Org use= rs, my opinion basically boils down to: >> I think as long as it=E2=80=99s clear what=E2=80=99s intended, and it=E2= =80=99s not some home-baked >> non-standard format, or terribly annoying to support =E2=80=94 why not? Rephrased: I think there are a few arguably "sensible" formats that a user = could reasonably assume, and if we can support most of them without introducing ambiguity in parsing or interpretation (and I think we can), can't we make everyone happy? > `755' is the funniest one, since, strictly speaking it doesn't correspond > to anything "out there" (note that the shell command `chmod' wants the > leading zero, or, well, it will do surprising things if you don't > provide it ;-) Consider my suggestion amended to 0755 etc. :) Anyway, as an example here's a code snippet that implements everything I've mentioned. #+begin_src emacs-lisp (defvar org-tangle-default-mode #o544 "The default mode for tangled files, as an integer.") (defun org-interpret-file-mode (mode) (cond ((integerp mode) mode) ((not (stringp mode)) (user-error "File mode %S not recognised as a valid format." mode)) ((string-match-p "^0[0-7][0-7][0-7]$" mode) (string-to-number mode 8)) ((string-match-p "^#o[0-7][0-7][0-7]$" mode) (string-to-number (substring mode 2) 8)) ((string-match-p "^[ugoa]*\\(?:[+-=3D][rwxXstugo]*\\)+\\(,[ugoa]*\\(?:[+= -=3D][rwxXstugo]*\\)+\\)*$" mode) (file-modes-symbolic-to-number mode 0)) ((string-match-p "^[rwx-]\\{3\\}$" mode) (file-modes-symbolic-to-number (concat "u=3D" mode) org-tangle-default-= mode)) ((string-match-p "^[rwx-]\\{9\\}$" mode) (file-modes-symbolic-to-number (concat "u=3D" (substring mode 0 3) ",g=3D" (substring mode 3 6) ",a=3D" (substring mode 6 9)) org-tangle-default-mode)) (t (user-error "File mode %S not recognised as a valid format." mode)))) #+end_src -- Timothy