Skip to content

Inconsistent org-ml-match behavior between org-ml-match and org-ml-match-map when matching headlines #57

Description

@eagerchatterjee

Thanks for a great package!
I have a question about the org-ml-match syntax and an apparent inconsistency between how it works in org-ml-match as opposed to how it works when org-ml-update-this-buffer
is called using org-ml-match-map.

In the example below the pattern '(:any * headline) matches both headlines in -match but only the second one in -match-map.

Is this the expected behavior?

* headline 1
** headline 2
#+begin_src elisp
(->>  (org-ml-parse-this-buffer)
  (org-ml-match '(:any * headline))
  length)
#+end_src

#+results:
: 2

- this changes only the second headline
#+begin_src elisp
(org-ml-update-this-buffer*
  (org-ml-match-map* '(:any * headline) (org-ml-set-property :level 8 it) it))
#+end_src

- this changes only the first headline
#+begin_src elisp
(org-ml-update-this-buffer*
  (org-ml-match-map* '(headline) (org-ml-set-property :level 8 it) it))
#+end_src

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions