Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why are custom headers sometimes headers and sometimes parameters? #6

Open
matthuszagh opened this issue Sep 3, 2020 · 0 comments
Open

Comments

@matthuszagh
Copy link
Owner

(org-element-at-point) returns a nested list where sometimes a source block's headers are :headers and sometimes they're :parameters. What logic controls this? Is this intentional behavior or a bug?

To accommodate this behavior, I've defined header matching as:

(defun mh//header-match (elem match)
    "Returns `t' if MATCH is explicitly a header of ELEM.
Explicit in this context means that it's literally written in the
file rather than being provided as a default header argument."
    (let* ((elem (org-element-at-point))
           (elem-header (append (list (org-element-property :parameters elem))
                                (org-element-property :header elem)))
           (matchp nil))
      (dolist (elt elem-header)
        (if (string-match match elt)
            (setq matchp t)))
      matchp))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant