From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8GGeD2CRXWFpEAAAgWs5BA (envelope-from ) for ; Wed, 06 Oct 2021 14:06:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id mMojC2CRXWETPgAAbx9fmQ (envelope-from ) for ; Wed, 06 Oct 2021 12:06:56 +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 737641734C for ; Wed, 6 Oct 2021 14:06:55 +0200 (CEST) Received: from localhost ([::1]:52662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY5hF-00022f-JS for larch@yhetil.org; Wed, 06 Oct 2021 08:06:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY5gV-00021t-R1 for emacs-orgmode@gnu.org; Wed, 06 Oct 2021 08:06:07 -0400 Received: from ciao.gmane.io ([116.202.254.214]:46914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY5gU-0005se-Hb for emacs-orgmode@gnu.org; Wed, 06 Oct 2021 08:06:07 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mY5ac-000AZq-JU for emacs-orgmode@gnu.org; Wed, 06 Oct 2021 14:00:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [PATCH] Accept more :tangle-mode specification forms Date: Wed, 6 Oct 2021 18:59:55 +0700 Message-ID: References: <875yuh9b3t.fsf@gmail.com> <87czojh6m4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: <87czojh6m4.fsf@gmail.com> Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-1.964, NML_ADSP_CUSTOM_MED=0.9, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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=1633522015; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=GhfMKxGfdv/ha8DdRKKBUAIIuSkl2on7pc/Or5VMVg8=; b=UfV26it4PNzRiisk8kCjD6OVZjAhOBr5/+no0hs7BpLLVKHEsLbFoPpTaLUJkTnIIlG78O 4RSJUWxf3SrQoGboscIQN8vFPguJwAYoCH585UOPzQkjecdp/UFdTz64WqlWCdXRQR1flY ZID3RxGusoCr+v86pFa409/7yZpzk5Oc/TNcM0pYLrOSQme1f5UghUFtzh11on0Eg8S7Vc ddkZss2ynkDL1Ylio3qvQmhB9DSlG6Tv+sArKRi/R0Nxw39uAvfvaBgrrayJ3LxrMTAsV/ fo1JeRtSEy3MzQa/sTot3Aznj72ADQRTpONSIWR39EU27Tn67LgQ+o/SOSitBw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633522015; a=rsa-sha256; cv=none; b=ELQUnTjNCTbN8o2bZ/MujDAx/bmYTfkZzH2sibZk5HhAq1RWpU3q80mb1NZSDqHdH8Q6Aj NDWK0pLJpOwidZ5h07St7nyWSa1Bdh4lyPhoYT3xZpxYw+w/SHK5AU+VErVoKoqkTNJBEo VeZxcTz1DoruKTt7lGC98RVQsNHGdx5Z2sPOnlItEbNhpfF/eKn99AGEWqdYlUWdgrVdf5 IDcZW5MC5VBAWi60OeOP8jlz+0QcMZBb/jcV1Ue87OGnIQ1sjCCf2UDdSodccY7+UQP+Ii ChzyxxJ4DF5Sv7gRiOommMqwjFy3uu3rZ/2OVNR8ryPBi2SUr0rZSYTxerqffA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: -2.46 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 737641734C X-Spam-Score: -2.46 X-Migadu-Scanner: scn0.migadu.com X-TUID: olgKefcFZrJZ On 05/10/2021 21:45, Timothy wrote: >> >> Indeed, I’ve basically supported every form I could think of. I’m currently >> inclined to cut it down to: >> • 755 >> • “rwxrw-r–” (`ls -l’ style) >> • chmod style with `org-babel-tangle-default-mode’ and `file-modes-symbolic-to-number’ >> >> Maybe with (if anybody says they would like this) >> • #o755 (elisp octal) >> • 0755 (C octal) >> • “rwx” = user perm, bit-or’d with `org-babel-tangle-default-mode’ for the rest >> (i.e. `org-babel-tangle-default-mode’, but not exceeding the user perm) My opinion (discussion should not mean that I insist) is that since the following is currently working #+begin_src bash :tangle yes :tangle-mode 755 echo "Hello" #+end_src naked numbers (strings looking like numbers) should be forbidden. `org-lint' should report such lines and it should be at least warning for `org-babel-tagle'. It is safer to define macros (namely macros, not just functions) that check argument type, e.g. (filemode-octal "755") ; OK (filemode-octal #o755) ; OK (filemode-octal 755) ; Error Maybe they should return not just raw number but e.g. tagged pair (#o755 . 'filemode) The point is that it should be hard to pass decimal or hex number (though it might be possible through a function generating tagged cons). It is better to be a bit more verbose and explicit than to allow weird hard to notice later errors. Problem cases are too close to valid ones with current behavior.