Hello, Sebastian Christ <rudolfo.chr...@gmail.com> writes:
> Hi group, > > I'd like to provide a patch to > ox-extra.el. `org-latex-header-blocks-filter' still calls > `org-edit-src-find-region-and-lang' and raises therefore an undefined > function error. Thanks for the patch. Sorry for the delayed response. > * ox-extra.el (org-latex-header-blocks-filter): Use `org-element' API to > find begin and end of latex header blocks. s|ox-extra.el|contrib/lisp/ox-extra.el| s/begin/beginning/ [...] > (mapc (lambda (pos) > - (goto-char (nth 2 pos)) > - (destructuring-bind > - (beg end &rest ignore) > - (org-edit-src-find-region-and-lang) > - (let ((contents-lines (split-string > - (buffer-substring-no-properties beg end) > - "\n"))) > - (delete-region (nth 0 pos) (nth 1 pos)) > - (dolist (line contents-lines) > - (insert (concat "#+latex_header: " > - (replace-regexp-in-string "\\` *" "" line) > - "\n")))))) > + (let* ((beg (third pos)) > + (end (second pos)) > + (post-affiliated (first pos)) Nitpick: nth is more commonly used in the Org code base. Hmm, the pos items are constructed as (list (org-element-property :begin block) (org-element-property :end block) (org-element-property :post-affiliated block))))))) so shouldn't beg be the first element and post-affiliated the third? Hopefully Aaron will get a chance to have a look. -- Kyle