emacs-orgmode
[Top][All Lists]
Advanced

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

refile captured to all opened Org buffer files as targets


From: stardiviner
Subject: refile captured to all opened Org buffer files as targets
Date: Wed, 25 Dec 2019 21:01:26 +0800
User-agent: mu4e 1.3.2; emacs 27.0.50

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
      



reply via email to

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