From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ihor Radchenko Subject: Re: refile captured to all opened Org buffer files as targets Date: Wed, 25 Dec 2019 23:40:37 +0800 Message-ID: <878sn0fm6i.fsf@localhost> References: <87sgl8v9sp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:54967) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ik8oB-0001mI-SE for emacs-orgmode@gnu.org; Wed, 25 Dec 2019 10:42:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ik8oA-0003sv-0V for emacs-orgmode@gnu.org; Wed, 25 Dec 2019 10:42:47 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:52164) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ik8o9-0003rz-Qr for emacs-orgmode@gnu.org; Wed, 25 Dec 2019 10:42:45 -0500 Received: by mail-wm1-x32d.google.com with SMTP id d73so4371870wmd.1 for ; Wed, 25 Dec 2019 07:42:45 -0800 (PST) In-Reply-To: <87sgl8v9sp.fsf@gmail.com> 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: numbchild@gmail.com, Org Mode , Nicolas Goaziou [offtopic] > I recently created an org-capture template for elfeed, it is finished. Could you share your capture template? stardiviner 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: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg