forked from mirrors/org-mode
ob-tangle: Fix interpretation of rw-r--r-- modes
* lisp/ob-tangle.el (org-babel-interpret-file-mode): When specifying a file mode in the "rw-r--r--" style, this is interpreted by splicing the user, group, and other compenents into a "u=rw,g=r,o=r" style string and applying `file-modes-symbolic-to-number`. For correct interpretation, we need to ensure the dashes are removed in this process.
This commit is contained in:
parent
5ac1ebaa15
commit
81fc8c06ce
|
@ -361,9 +361,9 @@ Did you give the decimal value %1$d by mistake?" mode)))
|
||||||
;; Match regexp taken from `file-modes-symbolic-to-number'.
|
;; Match regexp taken from `file-modes-symbolic-to-number'.
|
||||||
(file-modes-symbolic-to-number mode org-babel-tangle-default-file-mode))
|
(file-modes-symbolic-to-number mode org-babel-tangle-default-file-mode))
|
||||||
((string-match-p "^[r-][w-][xs-][r-][w-][xs-][r-][w-][x-]$" mode)
|
((string-match-p "^[r-][w-][xs-][r-][w-][xs-][r-][w-][x-]$" mode)
|
||||||
(file-modes-symbolic-to-number (concat "u=" (substring mode 0 3)
|
(file-modes-symbolic-to-number (concat "u=" (delete ?- (substring mode 0 3))
|
||||||
",g=" (substring mode 3 6)
|
",g=" (delete ?- (substring mode 3 6))
|
||||||
",o=" (substring mode 6 9))
|
",o=" (delete ?- (substring mode 6 9)))
|
||||||
0))
|
0))
|
||||||
(t (error "File mode %S not recognized as a valid format. See `org-babel-interpret-file-mode'." mode))))
|
(t (error "File mode %S not recognized as a valid format. See `org-babel-interpret-file-mode'." mode))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue