diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 0ca74ce27..65fa47ab5 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -212,7 +212,7 @@ When matching, reference is stored in match group 1." ;; (4) header arguments "\\([^\n]*\\)\n" ;; (5) body - "\\([^\000]*?\n\\)??[ \t]*#\\+end_src") + "\\(\\(?:.\\|\n\\)*?\n\\)??[ \t]*#\\+end_src") "Regexp used to identify code blocks.") (defun org-babel--get-vars (params) diff --git a/lisp/ob-haskell.el b/lisp/ob-haskell.el index 3e64c1657..909de19ab 100644 --- a/lisp/ob-haskell.el +++ b/lisp/ob-haskell.el @@ -226,7 +226,7 @@ constructs (header arguments, no-web syntax etc...) are ignored." (let* ((contents (buffer-string)) (haskell-regexp (concat "^\\([ \t]*\\)#\\+begin_src[ \t]haskell*\\(.*\\)[\r\n]" - "\\([^\000]*?\\)[\r\n][ \t]*#\\+end_src.*")) + "\\(\\(?:.\\|\n\\)*?\\)[\r\n][ \t]*#\\+end_src.*")) (base-name (file-name-sans-extension (buffer-file-name))) (tmp-file (org-babel-temp-file "haskell-")) (tmp-org-file (concat tmp-file ".org")) @@ -270,7 +270,7 @@ constructs (header arguments, no-web syntax etc...) are ignored." (goto-char (point-min)) (forward-line 2) (insert "%include polycode.fmt\n") ;; ensure all \begin/end{code} statements start at the first column - (while (re-search-forward "^[ \t]+\\\\begin{code}[^\000]+\\\\end{code}" nil t) + (while (re-search-forward "^[ \t]+\\\\begin{code}\\(?:.\\|\n\\)+\\\\end{code}" nil t) (replace-match (save-match-data (org-remove-indentation (match-string 0))) t t)) ;; save org exported latex to a .lhs file diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 5620f038b..34b27546d 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -925,7 +925,7 @@ an error. Return a non-nil value when toggling is successful." (goto-char start) (while (and (< (point) end) (re-search-forward "^[ \t]*#\\+begin_?\ -\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$" end t)) +\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\(\\(?:.\\|\n\\)+?\\)#\\+end_?\\1[ \t]*$" end t)) (save-excursion (save-match-data (goto-char (match-beginning 0)) diff --git a/lisp/org-element.el b/lisp/org-element.el index 5f54d1137..643dc394b 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -3671,7 +3671,7 @@ a plist with `:key', `:args', `:begin', `:end', `:value' and Assume point is at the macro." (save-excursion - (when (looking-at "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\((\\([^\000]*?\\))\\)?}}}") + (when (looking-at "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\((\\(\\(?:.\\|\n\\)*?\\))\\)?}}}") (let ((begin (point)) (key (downcase (match-string-no-properties 1))) (value (match-string-no-properties 0)) diff --git a/lisp/org-feed.el b/lisp/org-feed.el index f0b294b4a..320c6106d 100644 --- a/lisp/org-feed.el +++ b/lisp/org-feed.el @@ -475,7 +475,7 @@ This will find DRAWER and extract the alist." (goto-char pos) (let ((end (save-excursion (org-end-of-subtree t t)))) (if (re-search-forward - (concat "^[ \t]*:" drawer ":[ \t]*\n\\([^\000]*?\\)\n[ \t]*:END:") + (concat "^[ \t]*:" drawer ":[ \t]*\n\\(\\(?:.\\|\n\\)*?\\)\n[ \t]*:END:") end t) (read (match-string 1)) nil)))) @@ -633,7 +633,7 @@ containing the properties `:guid' and `:item-full-text'." end (and (re-search-forward "" nil t) (match-beginning 0))) (setq item (buffer-substring beg end) - guid (if (string-match ".*?>\\([^\000]*?\\)" item) + guid (if (string-match ".*?>\\(\\(?:.\\|\n\\)*?\\)" item) (xml-substitute-special (match-string-no-properties 1 item)))) (setq entry (list :guid guid :item-full-text item)) (push entry entries) @@ -647,7 +647,7 @@ containing the properties `:guid' and `:item-full-text'." (with-temp-buffer (insert (plist-get entry :item-full-text)) (goto-char (point-min)) - (while (re-search-forward "<\\([a-zA-Z]+\\>\\).*?>\\([^\000]*?\\)" + (while (re-search-forward "<\\([a-zA-Z]+\\>\\).*?>\\(\\(?:.\\|\n\\)*?\\)" nil t) (setq entry (plist-put entry (intern (concat ":" (match-string 1))) diff --git a/lisp/org.el b/lisp/org.el index 33471e8d9..78881b27e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -405,7 +405,7 @@ FULL is given." ;;;; Block (defconst org-block-regexp - "^[ \t]*#\\+begin_?\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$" + "^[ \t]*#\\+begin_?\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\(\\(?:.\\|\n\\)+?\\)#\\+end_?\\1[ \t]*$" "Regular expression for hiding blocks.") (defconst org-dblock-start-re @@ -611,7 +611,7 @@ Group 1 contains drawer's name or \"END\".") "Matches an entire property drawer.") (defconst org-clock-drawer-re - (concat "\\(" org-clock-drawer-start-re "\\)[^\000]*?\\(" + (concat "\\(" org-clock-drawer-start-re "\\)\\(?:.\\|\n\\)*?\\(" org-clock-drawer-end-re "\\)\n?") "Matches an entire clock drawer.") @@ -661,14 +661,13 @@ An entry can be toggled between COMMENT and normal with ;;;; LaTeX Environments and Fragments (defconst org-latex-regexps - '(("begin" "^[ \t]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)[^\000]+?\\\\end{\\2}\\)" 1 t) + '(("begin" "^[ \t]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)\\(?:.\\|\n\\)+?\\\\end{\\2}\\)" 1 t) ;; ("$" "\\([ \t(]\\|^\\)\\(\\(\\([$]\\)\\([^ \t\n,.$].*?\\(\n.*?\\)\\{0,5\\}[^ \t\n,.$]\\)\\4\\)\\)\\([ \t.,?;:'\")]\\|$\\)" 2 nil) - ;; \000 in the following regex is needed for org-inside-LaTeX-fragment-p - ("$1" "\\([^$]\\|^\\)\\(\\$[^ \t\r\n,;.$]\\$\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|\000\\|'\\|$\\)" 2 nil) - ("$" "\\([^$]\\|^\\)\\(\\(\\$\\([^ \t\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ \t\n,.$]\\)\\$\\)\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|\000\\|'\\|$\\)" 2 nil) - ("\\(" "\\\\([^\000]*?\\\\)" 0 nil) - ("\\[" "\\\\\\[[^\000]*?\\\\\\]" 0 nil) - ("$$" "\\$\\$[^\000]*?\\$\\$" 0 nil)) + ("$1" "\\([^$]\\|^\\)\\(\\$[^ \t\r\n,;.$]\\$\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|'\\|$\\)" 2 nil) + ("$" "\\([^$]\\|^\\)\\(\\(\\$\\([^ \t\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ \t\n,.$]\\)\\$\\)\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|'\\|$\\)" 2 nil) + ("\\(" "\\\\(\\(?:.\\|\n\\)*?\\\\)" 0 nil) + ("\\[" "\\\\\\[\\(?:.\\|\n\\)*?\\\\\\]" 0 nil) + ("$$" "\\$\\$\\(?:.\\|\n\\)*?\\$\\$" 0 nil)) "Regular expressions for matching embedded LaTeX.") ;;;; Node Property diff --git a/lisp/ox-org.el b/lisp/ox-org.el index f0a71becd..681b95d68 100644 --- a/lisp/ox-org.el +++ b/lisp/ox-org.el @@ -337,7 +337,7 @@ Return output file name." (when org-org-htmlized-css-url (goto-char (point-min)) (and (re-search-forward - ".*" nil t) + ".*" nil t) (replace-match (format "" diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el index 2a6e4b1dd..496f01bb7 100644 --- a/testing/lisp/test-ob-tangle.el +++ b/testing/lisp/test-ob-tangle.el @@ -45,7 +45,7 @@ ;; (flet ((exp-p (arg) ;; (and ;; (string-match -;; (format "noweb-%s-start\\([^\000]*\\)noweb-%s-end" arg arg) +;; (format "noweb-%s-start\\(\\(?:.\\|\n\\)*\\)noweb-%s-end" arg arg) ;; tang) ;; (string-match "expanded" (match-string 1 tang))))) ;; (should (exp-p "yes"))