Improve comments in source block

This commit is contained in:
Gerard Vermeulen 2021-12-06 08:30:31 +01:00
parent b14dfe3b31
commit ab44d70017
1 changed files with 5 additions and 4 deletions

View File

@ -796,9 +796,9 @@ Stolen from [[https://git.sr.ht/~bzg/org-contrib/tree/master/item/lisp/ox-extra.
(header (org-export-read-attribute :header block :header))) (header (org-export-read-attribute :header block :header)))
(when (and (string= type "LATEX") (string= header "yes")) (when (and (string= type "LATEX") (string= header "yes"))
block)))))) block))))))
;; Set point to where to insert LaTeX header lines after
;; deleting the block.
(mapc (lambda (block) (mapc (lambda (block)
;; Set point to where to insert LaTeX header lines
;; after deleting the block.
(goto-char (org-element-property :post-affiliated block)) (goto-char (org-element-property :post-affiliated block))
(let ((lines (let ((lines
(split-string (org-element-property :value block) "\n"))) (split-string (org-element-property :value block) "\n")))
@ -808,8 +808,9 @@ Stolen from [[https://git.sr.ht/~bzg/org-contrib/tree/master/item/lisp/ox-extra.
(insert (concat "#+latex_header: " (insert (concat "#+latex_header: "
(replace-regexp-in-string "\\` *" "" line) (replace-regexp-in-string "\\` *" "" line)
"\n"))))) "\n")))))
;; Reverse to go upwards to avoid wrecking the numeric ;; Reverse to go upwards to avoid wrecking the list of
;; positions earlier in the file. ;; block positions in the file that would occur in case
;; of going downwards.
(reverse blocks))))) (reverse blocks)))))
(defun my-activate-buffer-local-org-export-filters () (defun my-activate-buffer-local-org-export-filters ()