customizable noweb reference separator
* lisp/ob.el (org-babel-noweb-separator): Custom variable for accumulated noweb references. (org-babel-expand-noweb-references): Allow separator for noweb references. * doc/org.texi (noweb-ref): Documentation of this new custom variable.
This commit is contained in:
parent
978fd46069
commit
269a509615
|
@ -13667,6 +13667,10 @@ inheritance}).}.
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
The @code{org-babel-noweb-separator} variable holds the string used to
|
||||||
|
separate accumulate noweb references like those above. By default this
|
||||||
|
variable holds a newline.
|
||||||
|
|
||||||
@node cache, sep, noweb-ref, Specific header arguments
|
@node cache, sep, noweb-ref, Specific header arguments
|
||||||
@subsubsection @code{:cache}
|
@subsubsection @code{:cache}
|
||||||
|
|
||||||
|
|
12
lisp/ob.el
12
lisp/ob.el
|
@ -120,6 +120,11 @@ be used."
|
||||||
:group 'org-babel
|
:group 'org-babel
|
||||||
:type 'string)
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom org-babel-noweb-separator "\n"
|
||||||
|
"String used to separate accumulated noweb references."
|
||||||
|
:group 'org-babel
|
||||||
|
:type 'string)
|
||||||
|
|
||||||
(defvar org-babel-src-name-regexp
|
(defvar org-babel-src-name-regexp
|
||||||
"^[ \t]*#\\+name:[ \t]*"
|
"^[ \t]*#\\+name:[ \t]*"
|
||||||
"Regular expression used to match a source name line.")
|
"Regular expression used to match a source name line.")
|
||||||
|
@ -2194,7 +2199,7 @@ block but are passed literally to the \"example-block\"."
|
||||||
(c-wrap (cadr cs))))
|
(c-wrap (cadr cs))))
|
||||||
(org-babel-tangle-comment-links i))
|
(org-babel-tangle-comment-links i))
|
||||||
body)))
|
body)))
|
||||||
(setq expansion (concat expansion full))))
|
(setq expansion (cons full expansion))))
|
||||||
(org-babel-map-src-blocks nil
|
(org-babel-map-src-blocks nil
|
||||||
(let ((i (org-babel-get-src-block-info 'light)))
|
(let ((i (org-babel-get-src-block-info 'light)))
|
||||||
(when (equal (or (cdr (assoc :noweb-ref (nth 2 i)))
|
(when (equal (or (cdr (assoc :noweb-ref (nth 2 i)))
|
||||||
|
@ -2208,8 +2213,9 @@ block but are passed literally to the \"example-block\"."
|
||||||
(c-wrap (cadr cs))))
|
(c-wrap (cadr cs))))
|
||||||
(org-babel-tangle-comment-links i))
|
(org-babel-tangle-comment-links i))
|
||||||
body)))
|
body)))
|
||||||
(setq expansion (concat expansion full))))))))
|
(setq expansion (cons full expansion))))))))
|
||||||
expansion)
|
(mapconcat #'identity (nreverse expansion)
|
||||||
|
org-babel-noweb-separator))
|
||||||
;; possibly raise an error if named block doesn't exist
|
;; possibly raise an error if named block doesn't exist
|
||||||
(if (member lang org-babel-noweb-error-langs)
|
(if (member lang org-babel-noweb-error-langs)
|
||||||
(error "%s" (concat
|
(error "%s" (concat
|
||||||
|
|
Loading…
Reference in New Issue