emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 7e649050c7 05/14: ox: Pass through unparsed #+inclu


From: ELPA Syncer
Subject: [elpa] externals/org 7e649050c7 05/14: ox: Pass through unparsed #+include content
Date: Sun, 22 Jan 2023 10:58:10 -0500 (EST)

branch: externals/org
commit 7e649050c7ad653952b96f86cb172f3b32dc3cc2
Author: TEC <git@tecosaur.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    ox: Pass through unparsed #+include content
    
    * lisp/ox.el (org-export-parse-include-value): Adjust the block matches
    not to match keywords (i.e. ":\S-+"), and both block and env to consume
    their matches in value.  Now value only contains the unmatched content,
    which is given in as the results plist as :unmatched.
---
 lisp/ox.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index b6240cb1fc..3ff7799b40 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -3404,9 +3404,15 @@ not have `buffer-file-name' assigned."
                      (setq value (replace-match "" nil nil value)))
                  (get-text-property (point)
                                     :org-include-induced-level))))
-         (args (and (eq env 'literal) (match-string 1 value)))
-         (block (and (string-match "\\<\\(\\S-+\\)\\>" value)
-                     (match-string 1 value))))
+         (args (and (eq env 'literal)
+                    (prog1 (match-string 1 value)
+                      (setq value (replace-match "" nil nil value 1)))))
+         (block (and (or (string-match "\"\\(\\S-+\\)\"" value)
+                         (string-match "\\<\\(\\S-+\\)\\>" value))
+                     (or (= (match-beginning 0) 0)
+                         (not (= ?: (aref value (1- (match-beginning 0))))))
+                     (prog1 (match-string 1 value)
+                       (setq value (replace-match "" nil nil value))))))
     (list :file file
           :coding-system coding-system
           :location location
@@ -3415,7 +3421,8 @@ not have `buffer-file-name' assigned."
           :env env
           :minlevel minlevel
           :args args
-          :block block)))
+          :block block
+          :unmatched (org-babel-parse-header-arguments value t))))
 
 (cl-defun org-export--blindly-expand-include (parameters &key includer-file 
file-prefix footnotes already-included)
   "Unconditionally include reference defined by PARAMETERS in the buffer.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]