Org-Agenda files replace directories with explicit file names

I have a tasks/ directory in the variable org-agenda-files . When I add a file to the org-agenda-files variable through the Cc [ ( org-agenda-file-to-front ) command, the directory path is replaced with the file paths that are currently in this directory. This is bad because when I add some files to tasks/ later, they will not contribute to my agenda.

Is there a way to avoid this, or am I stuck in manually adding files and directories to org-agenda-files ?

This issue is confirmed in Org Mode - Organize your life in plain text!

Emacs version: 24.0.50.1 Org-mode version: 7.8.09

+6
source share
1 answer

You can define a command that simply adds the file to the org-agenda files without calling the org-agenda files before starting, and then overwriting this on Cc [. For instance:

 (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 "Cc [") `my-org-agenda-file-to-front) 
+1
source

Source: https://habr.com/ru/post/915588/


All Articles