Hi Jean Louis,

Thank you for your time and advice - I am trying to spend time
learning Elisp and more of the underpinnings in org-mode - so your
advice was very helpful.

In fact, I found that org-scan-tags is called by org-map-entries -
org-map-entries can specify a SCOPE of 'agenda (not the same
as the 'agenda that's provided to org-scan tags).

So, I got the code down to a one-liner!

;; This searches all agenda-files and returns a bunch of
;; stuff that I can re-use in Helm
(org-map-entries 'agenda "bkm" 'agenda)

As an aside:
When I run this in org-babel, it gives me a table with two cells:
| foo:        Foo.org                                     :bkm: | inbox:      Formatting Strings                    :bkm:emacs: |

Why doesn't this table have two *rows* instead of two *cells*?
If anyone knows the fix for this, I'd appreciate it.  It probably has something to do with the type
of data that's returned by the function, but I'll look into it later.

Thanks,
--Nate



Thanks for your help,
--Nate





On Thu, Aug 8, 2019 at 3:30 PM Jean Louis <bugs@gnu.support> wrote:
* Nathan Neff <nathan.neff@gmail.com> [2019-08-08 22:24]:
> I removed the staff from the beginning of the function call, and changed
> staff to bar  I also removed the (or (and)) conditions :-)
>
> Now, I need to see how to make this function search all agenda files - it
> seems
> to work only on the headlines in Foo.org

I am glad that it works somehow for you.

I would not like that type of abuse on myself...

I would just do this:

M-x helm-occur

:staff

and it would be enough.