Fix pushing org-projectile-todo-files to org-agenda-files

Using `(push (org-projectile-todo-files) org-agenda-files)' would occur error shown below when entering org-agenda-mode.
--error begin
Wrong type argument: stringp, ("~/.emacs.d/TODOs.org" ...)
--error end
`(org-projectile-todo-files)' returns a list of files.
 `push' function would make the list a new ELT of `org-agenda-files' rather than merging members into it.
But `org-file-menu-entry' only accept file path string as parameter.
This commit is contained in:
AmanYang 2017-09-08 09:50:15 +08:00 committed by Codruț Constantin Gușoi
parent 4ad2f719fa
commit f5701f3ef7
1 changed files with 4 additions and 1 deletions

View File

@ -249,7 +249,10 @@ the following snippet. Note that this may have unintended consequences until
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org-agenda
(require 'org-projectile)
(push (org-projectile-todo-files) org-agenda-files))
(mapcar '(lambda (file)
(when (file-exists-p file)
(push file org-agenda-files)))
(org-projectile-todo-files)))
#+END_SRC
** Org-brain support