stardiviner <numbch...@gmail.com> writes:

> I recently created an org-capture template for elfeed, it is finished. Now I
> have an idea is to refile it to all currently opened Org buffer files. So I
> created an function for ~org-refile-targets~ variable.
>
> #+begin_src emacs-lisp
> (defun org-refile-targets-all-files ()
>   "Use all currently opened Org buffer files as org-refile targets."
>   (mapcar 'buffer-file-name
>           (seq-filter (lambda (buffer) (if-let (file (buffer-file-name 
> buffer)) (f-ext? file "org"))) ; filter Org buffers
>                       (buffer-list))))
> #+end_src
>
>
> Then set ~org-refile-targets~ to use upper custom function
>
> #+begin_src emacs-lisp :eval no
> (setq org-refile-targets '((nil :maxlevel . 3) ; current buffer headlies
>                            (org-agenda-files :maxlevel . 2) ; agenda files 
> headlines
>                            (org-refile-targets-all-files :maxlevel . 3) ; all 
> opened Org buffer files headlines
>                            ))
> #+end_src
>
> Can I add this as a patch to Org Mode repository?

    org-buffer-list is a compiled Lisp function in ‘org.el’.

    (org-buffer-list &optional PREDICATE EXCLUDE-TMP)

    Return a list of Org buffers.
    PREDICATE can be ‘export’, ‘files’ or ‘agenda’.

    export   restrict the list to Export buffers.
    files    restrict the list to buffers visiting Org files.
    agenda   restrict the list to buffers visiting agenda files.

    If EXCLUDE-TMP is non-nil, ignore temporary buffers.



Reply via email to