[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH] ox-extra.el: Fix filtering of latex header blocks
From: |
Kyle Meyer |
Subject: |
Re: [O] [PATCH] ox-extra.el: Fix filtering of latex header blocks |
Date: |
Mon, 09 Nov 2015 01:30:23 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Hello,
Sebastian Christ <address@hidden> 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
- Re: [O] [PATCH] ox-extra.el: Fix filtering of latex header blocks,
Kyle Meyer <=