Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Org-agenda-files replaces directories with explicit filenames

I have a directory tasks/ in org-agenda-files variable. When i add a file to org-agenda-files variable through C-c [ command (org-agenda-file-to-front), the directory path is replaced by paths of the files, that are currently in that directory. It is bad, because when i add some files to tasks/ later on, they will not contribute to my agenda.

Is there some way to avoid this, or i'm stuck with manually adding files and directories to org-agenda-files?

This problem is acknowledged at Org Mode - Organize Your Life In Plain Text!

Emacs version: 24.0.50.1 Org-mode version: 7.8.09

like image 996
Mirzhan Irkegulov Avatar asked May 13 '12 06:05

Mirzhan Irkegulov


1 Answers

You could define a command that just adds a file to org-agenda-files without calling org-agenda-files-to-front, and then rebing that to C-c [. For example:

(defun my-org-agenda-file-to-front ()
  (interactive)
  (setq org-agenda-files (append org-agenda-files (list (buffer-file-name (current-buffer))))))

(define-key org-mode-map (kbd "C-c [") `my-org-agenda-file-to-front)
like image 50
Nathaniel Flath Avatar answered Oct 26 '22 06:10

Nathaniel Flath