emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Org-capture creates file after cancel


From: Adam Sneller
Subject: [O] Org-capture creates file after cancel
Date: Tue, 4 Sep 2018 22:58:51 +0100

I use a custom function (originally from this post on StackExchange) to create files from org-capture (one file per entry). For some reason, if I cancel the entry with C-c C-k Emacs still creates the file.

(defun my/generate-org-note-name ()
  (setq my-org-note--name (read-string "Name: "))
  (setq my-org-note--date (format-time-string "%Y-%m-%d"))
  (expand-file-name (format "%s.org" my-org-note--name) "~/org/wiki"))

(setq org-capture-templates
  '(("q" "Quote" entry (file "~/org/capture/quotes.org")
     "* %^{Attribution}\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n%?")
    ("w" "Wiki Entry" plain (file my/generate-org-note-name)
     "%(format \"* %s\n:PROPERTIES:\n:CREATED:  %s\n:END:\n\n%%?\" my-org-note--name my-org-note--date)")))

My other template in this example captures a quote to quotes.org (notice that this is basically the same code). But cancelling this in org-capture does not auto-create the entry...

Anyone know what am I doing wrong?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]