all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* refile captured to all opened Org buffer files as targets
@ 2019-12-25 13:01 stardiviner
  2019-12-25 15:40 ` Ihor Radchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: stardiviner @ 2019-12-25 13:01 UTC (permalink / raw)
  To: Org Mode, Nicolas Goaziou


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
      

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-12-27 14:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-25 13:01 refile captured to all opened Org buffer files as targets stardiviner
2019-12-25 15:40 ` Ihor Radchenko
2019-12-27  1:32   ` stardiviner
2019-12-27  7:54     ` Ihor Radchenko
2019-12-27  1:17 ` stardiviner
2019-12-27  6:34 ` Adam Porter
2019-12-27 14:10   ` stardiviner

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.