1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-25 10:47:12 +00:00

Defcustom controlling the wrapping of inline results

* lisp/ob-core.el (org-babel-inline-result-wrap): Defcustom controlling
  the wrapping of inline results.
  (org-babel-examplize-region): Use new defcustom controlling the
  wrapping of inline results.
This commit is contained in:
Eric Schulte 2013-04-26 09:37:25 -06:00
parent cb62841e06
commit f285b7ed3d

View File

@ -152,6 +152,12 @@ See also `org-babel-noweb-wrap-start'."
:group 'org-babel
:type 'string)
(defcustom org-babel-inline-result-wrap "=%s="
"Format string used to wrap inline results.
This string must include a \"%s\" which will be replaced by the results."
:group 'org-babel
:type 'string)
(defun org-babel-noweb-wrap (&optional regexp)
(concat org-babel-noweb-wrap-start
(or regexp "\\([^ \t\n].+?[^ \t]\\|[^ \t\n]\\)")
@ -2169,8 +2175,9 @@ file's directory then expand relative links."
(funcall chars-between end (save-excursion (goto-char end) (point-at-eol))))
(save-excursion
(goto-char beg)
(insert (format "=%s=" (prog1 (buffer-substring beg end)
(delete-region beg end)))))
(insert (format org-babel-inline-result-wrap
(prog1 (buffer-substring beg end)
(delete-region beg end)))))
(let ((size (count-lines beg end)))
(save-excursion
(cond ((= size 0)) ; do nothing for an empty result