emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: refile captured to all opened Org buffer files as targets


From: Adam Porter
Subject: Re: refile captured to all opened Org buffer files as targets
Date: Fri, 27 Dec 2019 00:34:42 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

stardiviner <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]