Skip to content

Cannot specify feeds via inherited tags #99

@heraplem

Description

@heraplem

With org-use-tag-inheritance set to t, I expect elfeed-org to pick up the following feed:

#+title: feeds
#+filetags: :elfeed:

* [[https://www.haskellforall.com/feeds/posts/default][Haskell for all]]

But it does not. The problem is the following in rmh-elfeed-org-import-trees:

(member tree-id (org-element-property :tags h))

In other words, it checks whether tree-id is among the tags explicitly set at that headline, rather than a tag that the headline "semantically" has.

This could be fixed by using org-get-tags; e.g.:

(defun rmh-elfeed-org-import-trees (tree-id)
  "Get trees with \":ID:\" property or tag of value TREE-ID.
Return trees with TREE-ID as the value of the id property or
with a tag of the same value.  Setting an \":ID:\" property is not
recommended but I support it for backward compatibility of
current users."
  (org-element-map
      (org-element-parse-buffer)
      'headline
    (lambda (h)
      (when (or (member tree-id (org-get-tags h))
                (equal tree-id (org-element-property :ID h))) h))))

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