mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-07-20 13:56:28 +00:00
Merge branch 'bugfix'
This commit is contained in:
commit
453cb0883a
|
@ -1634,11 +1634,10 @@ setting the ~STYLE~ property for each sub-task.
|
||||||
|
|
||||||
The change is breaking when ~org-use-property-inheritance~ is set to ~t~.
|
The change is breaking when ~org-use-property-inheritance~ is set to ~t~.
|
||||||
|
|
||||||
*** =ox-org= preserves header non-default arguments in src blocks
|
*** =ox-org= preserves header arguments in src blocks
|
||||||
|
|
||||||
Previously, all the header arguments where stripped from src blocks
|
Previously, all the header arguments where stripped from src blocks
|
||||||
during export. Now, header arguments are preserved as long as their
|
during export. Now, header arguments are preserved.
|
||||||
values are not equal to the default header argument values.
|
|
||||||
|
|
||||||
*** =ox-org= now exports special table rows by default
|
*** =ox-org= now exports special table rows by default
|
||||||
|
|
||||||
|
|
|
@ -370,7 +370,7 @@ The function respects the value of the :exports header argument."
|
||||||
nil))))
|
nil))))
|
||||||
|
|
||||||
(defcustom org-babel-exp-code-template
|
(defcustom org-babel-exp-code-template
|
||||||
"#+begin_src %lang%switches%flags%header-args\n%body\n#+end_src"
|
"#+begin_src %lang%switches%header-args\n%body\n#+end_src"
|
||||||
"Template used to export the body of code blocks.
|
"Template used to export the body of code blocks.
|
||||||
This template may be customized to include additional information
|
This template may be customized to include additional information
|
||||||
such as the code block name, or the values of particular header
|
such as the code block name, or the values of particular header
|
||||||
|
@ -381,8 +381,7 @@ and the following %keys may be used.
|
||||||
name ------ the name of the code block
|
name ------ the name of the code block
|
||||||
body ------ the body of the code block
|
body ------ the body of the code block
|
||||||
switches -- the switches associated to the code block
|
switches -- the switches associated to the code block
|
||||||
flags ----- the flags passed to the code block
|
header-args the header arguments of the code block
|
||||||
header-args the non-default header arguments of the code block
|
|
||||||
|
|
||||||
In addition to the keys mentioned above, every header argument
|
In addition to the keys mentioned above, every header argument
|
||||||
defined for the code block may be used as a key and will be
|
defined for the code block may be used as a key and will be
|
||||||
|
@ -392,7 +391,7 @@ replaced with its value."
|
||||||
:package-version '(Org . "9.7"))
|
:package-version '(Org . "9.7"))
|
||||||
|
|
||||||
(defcustom org-babel-exp-inline-code-template
|
(defcustom org-babel-exp-inline-code-template
|
||||||
"src_%lang[%switches%flags%header-args]{%body}"
|
"src_%lang[%switches%header-args]{%body}"
|
||||||
"Template used to export the body of inline code blocks.
|
"Template used to export the body of inline code blocks.
|
||||||
This template may be customized to include additional information
|
This template may be customized to include additional information
|
||||||
such as the code block name, or the values of particular header
|
such as the code block name, or the values of particular header
|
||||||
|
@ -403,8 +402,7 @@ and the following %keys may be used.
|
||||||
name ------ the name of the code block
|
name ------ the name of the code block
|
||||||
body ------ the body of the code block
|
body ------ the body of the code block
|
||||||
switches -- the switches associated to the code block
|
switches -- the switches associated to the code block
|
||||||
flags ----- the flags passed to the code block
|
header-args the header arguments of the code block
|
||||||
header-args the non-default header arguments of the code block
|
|
||||||
|
|
||||||
In addition to the keys mentioned above, every header argument
|
In addition to the keys mentioned above, every header argument
|
||||||
defined for the code block may be used as a key and will be
|
defined for the code block may be used as a key and will be
|
||||||
|
@ -438,39 +436,9 @@ replaced with its value."
|
||||||
(and f (concat " " (cdr f)))))
|
(and f (concat " " (cdr f)))))
|
||||||
("header-args"
|
("header-args"
|
||||||
.
|
.
|
||||||
,(let* ((header-args
|
,(org-babel-exp--at-source
|
||||||
(mapcar
|
(when-let ((params (org-element-property :parameters (org-element-context))))
|
||||||
(lambda (pair)
|
(concat " " params))))
|
||||||
;; Do no include special parameters, parameters with
|
|
||||||
;; their values equal to defaults.
|
|
||||||
(unless (or
|
|
||||||
;; Special parameters that are not real header
|
|
||||||
;; arguments.
|
|
||||||
(memq (car pair)
|
|
||||||
'( :result-params :result-type
|
|
||||||
;; This is an obsolete parameter still
|
|
||||||
;; used in some tests.
|
|
||||||
:flags))
|
|
||||||
;; Global defaults.
|
|
||||||
(equal (cdr pair)
|
|
||||||
(alist-get
|
|
||||||
(car pair)
|
|
||||||
(if (eq type 'inline) org-babel-default-inline-header-args
|
|
||||||
org-babel-default-header-args)))
|
|
||||||
;; Per-language defaults.
|
|
||||||
(let ((lang-headers
|
|
||||||
(intern
|
|
||||||
(concat "org-babel-default-header-args:"
|
|
||||||
(nth 0 info)))))
|
|
||||||
(and (boundp lang-headers)
|
|
||||||
(equal (cdr pair)
|
|
||||||
(alist-get (car pair)
|
|
||||||
(eval lang-headers t))))))
|
|
||||||
(format "%s %s" (car pair) (cdr pair))))
|
|
||||||
(nth 2 info)))
|
|
||||||
(header-arg-string
|
|
||||||
(mapconcat #'identity (delq nil header-args) " ")))
|
|
||||||
(unless (seq-empty-p header-arg-string) (concat " " header-arg-string))))
|
|
||||||
,@(mapcar (lambda (pair)
|
,@(mapcar (lambda (pair)
|
||||||
(cons (substring (symbol-name (car pair)) 1)
|
(cons (substring (symbol-name (car pair)) 1)
|
||||||
(format "%S" (cdr pair))))
|
(format "%S" (cdr pair))))
|
||||||
|
|
|
@ -262,9 +262,9 @@ Here is one at the end of a line. {{{results(=2=)}}}
|
||||||
(string-match
|
(string-match
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
"\\\\\\[]{" "\\(?:\\[]\\)?{" ;accept both src_sh[]{...} or src_sh{...}
|
"\\\\\\[]{" "\\(?:\\[]\\)?{" ;accept both src_sh[]{...} or src_sh{...}
|
||||||
(regexp-quote "Here is one in the middle src_sh[ :exports code]{echo 1} of a line.
|
(regexp-quote "Here is one in the middle src_sh[]{echo 1} of a line.
|
||||||
Here is one at the end of a line. src_sh[ :exports code]{echo 2}
|
Here is one at the end of a line. src_sh[]{echo 2}
|
||||||
src_sh[ :exports code]{echo 3} Here is one at the beginning of a line.
|
src_sh[]{echo 3} Here is one at the beginning of a line.
|
||||||
Here is one that is also evaluated: src_sh[ :exports both]{echo 4} {{{results(=4=)}}}")
|
Here is one that is also evaluated: src_sh[ :exports both]{echo 4} {{{results(=4=)}}}")
|
||||||
nil t)
|
nil t)
|
||||||
(org-test-at-id "cd54fc88-1b6b-45b6-8511-4d8fa7fc8076"
|
(org-test-at-id "cd54fc88-1b6b-45b6-8511-4d8fa7fc8076"
|
||||||
|
@ -430,7 +430,7 @@ be evaluated."
|
||||||
"Test exporting a source block with a flag."
|
"Test exporting a source block with a flag."
|
||||||
(should
|
(should
|
||||||
(string-match
|
(string-match
|
||||||
"\\`#\\+BEGIN_SRC emacs-lisp -some-flag$"
|
"\\`#\\+BEGIN_SRC emacs-lisp :flags -some-flag$"
|
||||||
(org-test-with-temp-text
|
(org-test-with-temp-text
|
||||||
"#+BEGIN_SRC emacs-lisp :flags -some-flag\n\(+ 1 1)\n#+END_SRC"
|
"#+BEGIN_SRC emacs-lisp :flags -some-flag\n\(+ 1 1)\n#+END_SRC"
|
||||||
(org-babel-exp-process-buffer)
|
(org-babel-exp-process-buffer)
|
||||||
|
@ -570,7 +570,7 @@ src_emacs-lisp{(+ 1 1)}"
|
||||||
(ert-deftest ob-export/body-with-coderef ()
|
(ert-deftest ob-export/body-with-coderef ()
|
||||||
"Test exporting a code block with coderefs."
|
"Test exporting a code block with coderefs."
|
||||||
(should
|
(should
|
||||||
(equal "#+begin_src emacs-lisp\n0 (ref:foo)\n#+end_src"
|
(equal "#+begin_src emacs-lisp :exports code\n0 (ref:foo)\n#+end_src"
|
||||||
(org-test-with-temp-text
|
(org-test-with-temp-text
|
||||||
"#+BEGIN_SRC emacs-lisp :exports code\n0 (ref:foo)\n#+END_SRC"
|
"#+BEGIN_SRC emacs-lisp :exports code\n0 (ref:foo)\n#+END_SRC"
|
||||||
(let ((org-export-use-babel t)
|
(let ((org-export-use-babel t)
|
||||||
|
@ -579,7 +579,7 @@ src_emacs-lisp{(+ 1 1)}"
|
||||||
(buffer-string))))
|
(buffer-string))))
|
||||||
(should
|
(should
|
||||||
(equal
|
(equal
|
||||||
"#+begin_src emacs-lisp -l \"r:%s\"\n1 r:foo\n#+end_src"
|
"#+begin_src emacs-lisp -l \"r:%s\" -lisp :exports code\n1 r:foo\n#+end_src"
|
||||||
(org-test-with-temp-text
|
(org-test-with-temp-text
|
||||||
"#+BEGIN_SRC emacs-lisp -l \"r:%s\" -lisp :exports code\n1 r:foo\n#+END_SRC"
|
"#+BEGIN_SRC emacs-lisp -l \"r:%s\" -lisp :exports code\n1 r:foo\n#+END_SRC"
|
||||||
(let ((org-export-use-babel t))
|
(let ((org-export-use-babel t))
|
||||||
|
|
Loading…
Reference in a new issue