Export: Allow backend-specific code to be indented
Things like #+latex: and #+begin_html...#+end_html can now be indented.
This commit is contained in:
parent
aea59ca7a6
commit
2be3df3fd8
|
@ -5,6 +5,8 @@
|
|||
(org-export-format-source-code-or-example): Fix indentation of
|
||||
blocks.
|
||||
(org-export-remove-indentation): New function.
|
||||
(org-export-select-backend-specific-text): Allow backend-specific
|
||||
code to be indented.
|
||||
|
||||
* org.el (org-fontify-meta-lines): New function.
|
||||
(org-set-font-lock-defaults): Call the new fontification
|
||||
|
|
|
@ -1659,17 +1659,17 @@ from the buffer."
|
|||
(when (eq (car fmt) backend)
|
||||
;; This is selected code, put it into the file for real
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward (concat "^#\\+" (cadr fmt)
|
||||
(while (re-search-forward (concat "^\\([ \t]*\\)#\\+" (cadr fmt)
|
||||
":[ \t]*\\(.*\\)") nil t)
|
||||
(replace-match "\\1" t)
|
||||
(replace-match "\\1\\2" t)
|
||||
(add-text-properties
|
||||
(point-at-bol) (min (1+ (point-at-eol)) (point-max))
|
||||
'(org-protected t))))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward
|
||||
(concat "^#\\+"
|
||||
(caddr fmt) "\\>.*\\(\\(\n.*\\)*?\n\\)#\\+"
|
||||
(cadddr fmt) "\\>.*\n?") nil t)
|
||||
(concat "^[ \t]*#\\+" (caddr fmt)
|
||||
"\\>.*\\(\\(\n.*\\)*?\n\\)[ \t]*#\\+" (cadddr fmt)
|
||||
"\\>.*\n?") nil t)
|
||||
(if (eq (car fmt) backend)
|
||||
;; yes, keep this
|
||||
(add-text-properties (match-beginning 1) (1+ (match-end 1))
|
||||
|
|
Loading…
Reference in New Issue