Fix example indentation for export.
Patch from Bernt Hansen.
This commit is contained in:
parent
e16cbbb5e2
commit
e8394dcbcf
|
@ -2,6 +2,10 @@
|
|||
|
||||
* org-exp.el (org-export-as-html): Fixed typo in creator
|
||||
information.
|
||||
(org-export-protect-examples): New parameter indent. Insert extra
|
||||
spaces only when this parameter is specified.
|
||||
(org-export-preprocess-string): Call `org-export-protect-examples'
|
||||
with an indentation parameter when exporting to ASCII.
|
||||
|
||||
* org-remember.el (org-remember-templates)
|
||||
(org-remember-apply-template): Allow the file component to be a
|
||||
|
|
|
@ -1386,7 +1386,7 @@ on this string to produce the exported version."
|
|||
(setq target-alist (org-export-handle-invisible-targets target-alist))
|
||||
|
||||
;; Protect examples
|
||||
(org-export-protect-examples)
|
||||
(org-export-protect-examples (if asciip 'indent nil))
|
||||
|
||||
;; Protect backend specific stuff, throw away the others.
|
||||
(org-export-select-backend-specific-text
|
||||
|
@ -1591,13 +1591,13 @@ from the buffer."
|
|||
'(org-protected t))
|
||||
(goto-char (1+ (match-end 4)))))
|
||||
|
||||
(defun org-export-protect-examples ()
|
||||
(defun org-export-protect-examples (&optional indent)
|
||||
"Protect code that should be exported as monospaced examples."
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^#\\+BEGIN_EXAMPLE[ \t]*\n" nil t)
|
||||
(goto-char (match-end 0))
|
||||
(while (and (not (looking-at "#\\+END_EXAMPLE")) (not (eobp)))
|
||||
(insert ": ")
|
||||
(insert (if indent ": " ":"))
|
||||
(beginning-of-line 2)))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^[ \t]*:.*\\(\n[ \t]*:.*\\)*" nil t)
|
||||
|
|
Loading…
Reference in New Issue