Document new :tangle-mode forms

* etc/ORG-NEWS: Mention new forms that :tangle-mode accepts.

* doc/org-manual.org (Header arguments): Mention new forms that
:tangle-mode accepts.
This commit is contained in:
TEC 2021-11-21 03:04:47 +08:00
parent e6ae351f96
commit b21d11c614
Signed by: tec
GPG Key ID: 779591AFDB81F06C
2 changed files with 29 additions and 7 deletions

View File

@ -18182,13 +18182,23 @@ the tangled file's executable permission.
#+cindex: @samp{tangle-mode}, header argument
The =tangle-mode= header argument specifies what permissions to set
for tangled files by ~set-file-modes~. For example, to make
a read-only tangled file, use =:tangle-mode (identity #o444)=. To
make it executable, use =:tangle-mode (identity #o755)=. It also
overrides executable permission granted by =shebang=. When multiple
source code blocks tangle to a single file with different and
conflicting =tangle-mode= header arguments, Org's behavior is
undefined.
for tangled files by ~set-file-modes~. Permissions are given by an
octal value, which can be provided calling the ~identity~ function on
an elisp octal value. For instance, to create a read-only file one may
use =:tangle-mode (identity #o444)=. To reduce the verbosity required,
a octal shorthand is defined, =oXXX= (=o= for octal). Using this, our
read-only example is =:tangle-mode o444=. Omitting the =o= prefix will
cause the argument to be interpreted as an integer, which can lead to
unexpected results (=444= is the same as =o674=).
Two other shorthands are recognised, ls-style strings like
=rw-r--r--=, and chmod-style permissions like =g+w=.
Note that chmod-style permissions are based on
~org-babel-tangle-default-file-mode~, which is =#o544= by default.
When =:tangle-mode= and =:shebang= are both specified, the give
=:tangle-mode= will override the permissions from =:shebang=. When
multiple source code blocks tangle to a single file with conflicting
=:tangle-mode= header arguments, Org's behaviour is undefined.
#+cindex: @samp{no-expand}, header argument
By default Org expands code blocks during tangling. The =no-expand=

View File

@ -103,6 +103,18 @@ The =dvipng= option in ~org-preview-latex-process-alist~ has a new
property =transparent-image-converter= which is used instead of
=image-converter= when producing transparent images.
*** =:tangle-mode= now accepts more permissions formats
Previously =:tangle-mode (identity #o755)= was the only reasonable way
to set the file mode. ~org-babel-interpret-file-mode~ has been
introduced which will accept three new formats:
+ Short octals, e.g. =:tangle-mode o755=
+ ls-style, e.g. =:tangle-mode rwxrw-rw-=
+ chmod-style, e.g. =:tangle-mode u+x=
Chmod-style permissions are based on the new variable
~org-babel-tangle-default-file-mode~.
* Version 9.5
** Important announcements and breaking changes