1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2025-01-05 11:45:52 +00:00

Fix regexp match issue when exporting large source code snippets

This commit is contained in:
Carsten Dominik 2009-08-31 12:17:58 +02:00
parent 522ef218db
commit e20a6e44b8
2 changed files with 15 additions and 11 deletions

View File

@ -1,5 +1,8 @@
2009-08-31 Carsten Dominik <carsten.dominik@gmail.com>
* org-exp.el (org-export-select-backend-specific-text): Match in 2
steps, to avoid regexp problems.
* org.el (org-offer-links-in-entry): Improve working with many and
duplicate links.

View File

@ -1701,7 +1701,7 @@ from the buffer."
(ascii "ASCII" "BEGIN_ASCII" "END_ASCII")
(latex "LaTeX" "BEGIN_LaTeX" "END_LaTeX")))
(case-fold-search t)
fmt)
fmt beg beg-content end end-content)
(while formatters
(setq fmt (pop formatters))
@ -1715,16 +1715,17 @@ from the buffer."
(point-at-bol) (min (1+ (point-at-eol)) (point-max))
'(org-protected t))))
(goto-char (point-min))
(while (re-search-forward
(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))
'(org-protected t))
;; No, this is for a different backend, kill it
(delete-region (match-beginning 0) (match-end 0)))))))
(while (re-search-forward (concat "^[ \t]*#\\+" (caddr fmt) "\\>.*\n?")
nil t)
(setq beg (match-beginning 0) beg-content (match-end 0))
(when (re-search-forward (concat "^[ \t]*#\\+" (cadddr fmt) "\\>.*\n?")
nil t)
(setq end (match-end 0) end-content (match-beginning 0))
(if (eq (car fmt) backend)
;; yes, keep this
(add-text-properties beg-content end-content '(org-protected t))
;; No, this is for a different backend, kill it
(delete-region beg end)))))))
(defun org-export-mark-blockquote-verse-center ()
"Mark block quote and verse environments with special cookies.