[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 3a66860 1/3: ob-tangle: Use oXXX as file mode octal
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 3a66860 1/3: ob-tangle: Use oXXX as file mode octal shorthand |
Date: |
Sat, 20 Nov 2021 10:57:21 -0500 (EST) |
branch: externals/org
commit 3a6686010e6c1b243208af10ee2635a5e3a82908
Author: TEC <tec@tecosaur.com>
Commit: TEC <tec@tecosaur.com>
ob-tangle: Use oXXX as file mode octal shorthand
* lisp/ob-tangle (org-babel-interpret-file-mode): Accept "o755" and
similar as octal shorthand. A non-digit character must be included as
otherwise `org-babel-parse-header-arguments' will convert it to a
base-10 integer.
---
lisp/ob-tangle.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 3168445..90c7ae5 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -310,7 +310,7 @@ matching a regular expression."
"Determine the integer representation of a file MODE specification.
The following forms are currently recognised:
- an integer (returned without modification)
-- \"755\" (chmod style octal)
+- \"o755\" (chmod style octal)
- \"rwxrw-r--\" (ls style specification)
- \"a=rw,u+x\" (chmod style) *
@@ -320,8 +320,8 @@ The following forms are currently recognised:
((integerp mode) mode)
((not (stringp mode))
(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 "^o0?[0-7][0-7][0-7]$" mode)
+ (string-to-number (replace-regexp-in-string "^o" "" mode) 8))
((string-match-p
"^[ugoa]*\\(?:[+-=][rwxXstugo]*\\)+\\(,[ugoa]*\\(?:[+-=][rwxXstugo]*\\)+\\)*$"
mode)
(file-modes-symbolic-to-number mode org-babel-tangle-default-mode))
((string-match-p "^[rwx-]\\{9\\}$" mode)