From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Sneller Subject: Org-capture creates file after cancel Date: Tue, 4 Sep 2018 22:58:51 +0100 Message-ID: <20E559CF-9E0B-46A4-8DD9-56FF862DF2EC@adamsneller.com> Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_C91EFE6B-66B5-4E17-85DF-4B74F042CE20" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxJLh-0004pz-IU for emacs-orgmode@gnu.org; Tue, 04 Sep 2018 17:59:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxJLd-0000kc-IP for emacs-orgmode@gnu.org; Tue, 04 Sep 2018 17:59:01 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:32952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxJLd-0000iE-5h for emacs-orgmode@gnu.org; Tue, 04 Sep 2018 17:58:57 -0400 Received: by mail-wr1-x42f.google.com with SMTP id v90-v6so5525996wrc.0 for ; Tue, 04 Sep 2018 14:58:53 -0700 (PDT) Received: from adam-mbp.connect (static-87-75-100-188.vodafonexdsl.co.uk. [87.75.100.188]) by smtp.gmail.com with ESMTPSA id l12-v6sm671wrv.29.2018.09.04.14.58.51 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 14:58:51 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --Apple-Mail=_C91EFE6B-66B5-4E17-85DF-4B74F042CE20 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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?= --Apple-Mail=_C91EFE6B-66B5-4E17-85DF-4B74F042CE20 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
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?

= --Apple-Mail=_C91EFE6B-66B5-4E17-85DF-4B74F042CE20--