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: Ihor Radchenko
Subject: Re: refile captured to all opened Org buffer files as targets
Date: Wed, 25 Dec 2019 23:40:37 +0800

[offtopic]

> I recently created an org-capture template for elfeed, it is finished. 

Could you share your capture template?


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?
>
> -- 
> [ stardiviner ]
>        I try to make every word tell the meaning what I want to express.
>
>        Blog: https://stardiviner.github.io/
>        IRC(freenode): stardiviner, Matrix: stardiviner
>        GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
>       
>

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong 
University, Xi'an, China
Email: address@hidden, address@hidden



reply via email to

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