[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Accept more :tangle-mode specification forms
From: |
Timothy |
Subject: |
[PATCH] Accept more :tangle-mode specification forms |
Date: |
Fri, 01 Oct 2021 02:14:55 +0800 |
User-agent: |
mu4e 1.6.5; emacs 28.0.50 |
Hello,
Currently, the only way to set a file mode when tangling seems to be
:tangle-mode (identity #o755)
In a [prior thread], Jeremy proposed that :tangle-mode should convert octal
number strings to the required decimal form. I think we should go further, and
so have prepared the attached patch based on a snippet I shared in the thread.
To quote the docstring of the new function I’m introducing, this patch now
accepts the following :tangle-mode forms:
• an integer (returned without modification)
• “#o755” (elisp-style octal)
• “0755” (c style octal)
• “755” (chmod style octal)
• “rwxrw-r–” (ls style specification)
• “a=rw,u+x” (chmod style)
• “rwx” (interpreted as “u=rwx”)
Why be so permissive? I’d refer you to my reasoning in the prior thread:
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?
All the best,
Timothy
[prior thread]
<20210928145448.245883-1-jeremy@cowgar.com/">https://list.orgmode.org/20210928145448.245883-1-jeremy@cowgar.com/>
0001-ob-tangle-Accept-more-tangle-mode-forms.patch
Description: Text Data
- [PATCH] Accept more :tangle-mode specification forms,
Timothy <=