From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: refile captured to all opened Org buffer files as targets Date: Wed, 25 Dec 2019 21:01:26 +0800 Message-ID: <87sgl8v9sp.fsf@gmail.com> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39913) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ik6as-0002eU-Rs for emacs-orgmode@gnu.org; Wed, 25 Dec 2019 08:20:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ik6ar-0000Ov-N8 for emacs-orgmode@gnu.org; Wed, 25 Dec 2019 08:20:54 -0500 Received: from [112.17.238.163] (port=42526 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ik6ap-0000I9-J9 for emacs-orgmode@gnu.org; Wed, 25 Dec 2019 08:20:53 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" 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