emacs-orgmode
[Top][All Lists]
Advanced

[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: Sebastian Christ
Subject: Re: [O] [PATCH] ox-extra.el: Fix filtering of latex header blocks
Date: Tue, 10 Nov 2015 10:54:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin)

>>>>> On Mon, 09 Nov 2015 01:30:23 -0500, Kyle Meyer <address@hidden> said:
  >> * ox-extra.el (org-latex-header-blocks-filter): Use `org-element' API to
  >> find begin and end of latex header blocks.
  Kyle> 
  Kyle> s|ox-extra.el|contrib/lisp/ox-extra.el|
  Kyle> s/begin/beginning/
  Kyle> 

Thanks. I'll change that.

  >> (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))
  Kyle> 
  Kyle> Hmm, the pos items are constructed as
  Kyle> 
  Kyle>     (list (org-element-property :begin block)
  Kyle>           (org-element-property :end block)
  Kyle>           (org-element-property :post-affiliated block)))))))
  Kyle> 
  Kyle> so shouldn't beg be the first element and post-affiliated the third?

I thought it would be better to change as little as
possible. Rearranging the list is obviously the cleaner solution. I'll
change that.

Thanks for the review.

-Sebastian







reply via email to

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