Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@guidoschmidt
Forked from prathik/todo.el
Created January 19, 2018 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guidoschmidt/8cd94972a530daaf5292b36d4bf7678b to your computer and use it in GitHub Desktop.
Save guidoschmidt/8cd94972a530daaf5292b36d4bf7678b to your computer and use it in GitHub Desktop.
Manage daily todo files on Emacs
(defun create-directory (directory)
"Creates the todo directory."
(if (file-exists-p directory) (message "Director exists")
(make-directory directory)
(message "Directory created")
))
(defun create-todo-file (directory filename)
"Checks if the todo file exists if not creates it."
(create-directory directory)
(if (file-exists-p filename) (message "Todo exists for the day")
(write-region "" nil filename)))
(defun open-todo-file (directory)
"Opens a todo file for the current day."
(let (
(filename
(concat directory "/" (format-time-string "%Y-%m-%d") ".org")))
(create-todo-file directory filename)
(find-file filename)))
(defun open-todo-file-interactive ()
"Creates a daily todo file.
Track what needs to be done for the day.
Plan your day better.
See what you have accomplished at the end of the day."
(interactive)
(open-todo-file "~/todo"))
(global-set-key (kbd "C-c C-t") 'open-todo-file-interactive)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment