org-manual.org: Clarify that LANGUAGE may be omitted in code blocks

* doc/org-manual.org (Structure of Code Blocks):
(Editing Source Code): Clarify that <language> is optional.  Link to
possible consequences of <language> being omitted.
This commit is contained in:
Ihor Radchenko 2023-01-16 12:59:47 +03:00
parent 59fa35a0b7
commit d98ca046cc
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 18 additions and 5 deletions

View File

@ -17314,9 +17314,16 @@ or
- =<language>= :: - =<language>= ::
#+cindex: language, in code blocks #+cindex: language, in code blocks
Mandatory. It is the identifier of the source code language in the Optional. It is the identifier of the source code language in the
block. See [[*Languages]], for identifiers of supported languages. block. See [[*Languages]], for identifiers of supported languages.
When =<language>= identifier is omitted, the block also cannot
have =<switches>= and =<header arguments>=.
Language identifier is also used to fontify code blocks in Org
buffers, when ~org-src-fontify-natively~ is set to non-~nil~. See
[[*Editing Source Code]].
- =<switches>= :: - =<switches>= ::
#+cindex: switches, in code blocks #+cindex: switches, in code blocks
@ -18952,6 +18959,9 @@ group ~org-edit-structure~.
header line, then the edit buffer uses that major mode. Use this header line, then the edit buffer uses that major mode. Use this
variable to arbitrarily map language identifiers to major modes. variable to arbitrarily map language identifiers to major modes.
When language identifier is omitted in the src block, Org mode's
behavior is undefined.
- ~org-src-window-setup~ :: - ~org-src-window-setup~ ::
#+vindex: org-src-window-setup #+vindex: org-src-window-setup
@ -18977,10 +18987,13 @@ group ~org-edit-structure~.
#+vindex: org-src-fontify-natively #+vindex: org-src-fontify-natively
#+vindex: org-src-block-faces #+vindex: org-src-block-faces
Set ~org-src-fontify-natively~ to non-~nil~ to turn on native code Fontification of code blocks can give visual separation of text and
fontification in the /Org/ buffer. Fontification of code blocks can code on the display page. Set ~org-src-fontify-natively~ to non-~nil~
give visual separation of text and code on the display page. To to turn on native code fontification in the /Org/ buffer. The
further customize the appearance of ~org-block~ for specific fontification follows the major mode used to edit the code block (see
~org-src-lang-modes~ above).
To further customize the appearance of ~org-block~ for specific
languages, customize ~org-src-block-faces~. The following example languages, customize ~org-src-block-faces~. The following example
shades the background of regular blocks, and colors source blocks only shades the background of regular blocks, and colors source blocks only
for Python and Emacs Lisp languages. for Python and Emacs Lisp languages.