diff --git a/whomp/whomp-orgmode.el b/whomp/whomp-orgmode.el index ba0959e..b3c8ad6 100644 --- a/whomp/whomp-orgmode.el +++ b/whomp/whomp-orgmode.el @@ -72,6 +72,25 @@ (shell . t))) (add-hook 'org-mode-hook 'whomp/org-agenda-files-update) (add-hook 'org-mode-hook 'visual-line-mode) + (defun generate-new-file-name () "Ask for a title and generate a file name based on it" + (let* ((file-name (read-string "Title: ")) + (my-path (concat + "~/org/" ; Or whatever path you want + (format-time-string "%Y%m%d%H%M%S") "-" + (replace-regexp-in-string "[^a-zA-Z0-9-]+" "-" file-name) ".org"))) ; Replace invalid path characters + (setq mc/org-capture-filename file-name) ; Save variable to be used later in the template + my-path)) + +(setq org-capture-templates + '( + ; .... + + ("n" "Note" entry (file (lambda () (generate-new-file-name))) + "* %(format mc/org-capture-filename) \n:PROPERTIES:\n:ID: %(org-id-new)\n:CREATED: %U\n:END:\n%?") + + ; .... + )) + ;; Org mode stuff (whomp/add-key-binding "o l" 'org-store-link "Store a link to the current location in the kill ring.") (whomp/add-key-binding "o C-l" 'org-toggle-link-display "Toggle the display of links.")