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: stardiviner
Subject: Re: refile captured to all opened Org buffer files as targets
Date: Fri, 27 Dec 2019 09:17:41 +0800
User-agent: mu4e 1.3.2; emacs 27.0.50

I improved command to get ride of =f.el= library function:

#+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 ; filter Org buffers
           (lambda (buffer)
             (if-let (file (buffer-file-name buffer))
                 (string-equal (file-name-extension file) "org")
               ;; (f-ext? file "org")
               ))
           (buffer-list))))
#+end_src

Here is the configured option:

#+begin_src emacs-lisp
(setq org-refile-targets '((nil :maxlevel . 3) ; current buffer headlines
                           (org-agenda-files :maxlevel . 2) ; agenda files 
headlines
                           (org-refile-targets-all-files :maxlevel . 3) ; all 
opened Org buffer files headlines
                           ))
#+end_src

I think this can be an option for user who might think this is useful like in my
situation. (I want to refile capture elfeed RSS entry to one of my opened Org
buffer's specific headline.)

-- 
[ 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]