How to insert date or other `Template expansion` in org capture when no "*" prompt in file?

65 Views Asked by At

I want to insert the date in the capture template, but I do not want to add a "*" at the beginning of the file. How do I achieve this?

An example as follows, C-c c p p work fine, but C-c c p l display "Template is not a valid Org entry or tree".

(global-set-key "\C-cc" 'org-capture)
(setq org-capture-templates   
      '(

    ("p" "programme")
    ("pl" "perl" entry
     (file (lambda ()  (let ((name (read-string "FileName: " "<perl> ")))
                 (expand-file-name (format "%s.org" name)
                           "~/syncthing/notes/perl"))))
     "Date:%U\nFrom: %?\n\n")
    ("pp" "python" entry
     (file (lambda ()  (let ((name (read-string "FileName: " "<python> ")))
                 (expand-file-name (format "%s.org" name)
                           "~/syncthing/notes/python"))))
     "* \nDate:%U\nFrom: %?\n\n")

    ))
0

There are 0 best solutions below