emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Grégoire Jadi" <gregoire.jadi@univ-nantes.fr>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] Fix `org-capture-templates' type declaration
Date: Sat, 24 Oct 2015 19:43:50 +0200	[thread overview]
Message-ID: <87h9lg88mh.fsf@univ-nantes.fr> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 440 bytes --]

Hi,

The attached patch fix the type declaration of org-capture-templates by
allowing the user to use file, variable, function and sexp as target's
file to match the documentation

(org) Template elements
> Most target specifications contain a file name. If that file name is the
> empty string, it defaults to ‘org-default-notes-file’. A file can also
> be given as a variable, function, or Emacs Lisp form.

OK to push?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-lisp-org-capture.el-Fix-org-capture-templates-type-d.patch --]
[-- Type: text/x-diff, Size: 2398 bytes --]

From 00aa68469d51420c71f77801514c17a8464c8e2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= <gregoire.jadi@univ-nantes.fr>
Date: Sat, 24 Oct 2015 19:27:58 +0200
Subject: [PATCH] lisp/org-capture.el: Fix `org-capture-templates' type
 declaration

* lisp/org-capture.el(org-capture-templates): Fix `org-capture-templates' type
declaration to match its documentation.

Allow the use of file, variable, function or Emacs Lisp form as target file as
specified by the docstring.
---
 lisp/org-capture.el | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 58b578b..9d24a6f 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -298,32 +298,39 @@ calendar                |  %:type %:date"
 		  (choice :tag "Target location"
 			  (list :tag "File"
 				(const :format "" file)
-				(file :tag "  File"))
+				(choice :tag "  File"
+					file variable function sexp))
 			  (list :tag "ID"
 				(const :format "" id)
 				(string :tag "  ID"))
 			  (list :tag "File & Headline"
 				(const :format "" file+headline)
-				(file   :tag "  File    ")
+				(choice :tag "  File    "
+					file variable function sexp)
 				(string :tag "  Headline"))
 			  (list :tag "File & Outline path"
 				(const :format "" file+olp)
-				(file   :tag "  File    ")
+				(choice :tag "  File    "
+					file variable function sexp)
 				(repeat :tag "Outline path" :inline t
 					(string :tag "Headline")))
 			  (list :tag "File & Regexp"
 				(const :format "" file+regexp)
-				(file   :tag "  File  ")
+				(choice :tag "  File  "
+					file variable function sexp)
 				(regexp :tag "  Regexp"))
 			  (list :tag "File & Date tree"
 				(const :format "" file+datetree)
-				(file :tag "  File"))
+				(choice :tag "  File"
+					file variable function sexp))
 			  (list :tag "File & Date tree, prompt for date"
 				(const :format "" file+datetree+prompt)
-				(file :tag "  File"))
+				(choice :tag "  File"
+					file variable function sexp))
 			  (list :tag "File & function"
 				(const :format "" file+function)
-				(file :tag "  File    ")
+				(choice :tag "  File    "
+					file variable function sexp)
 				(sexp :tag "  Function"))
 			  (list :tag "Current clocking task"
 				(const :format "" clock))
-- 
1.9.1


[-- Attachment #1.3: Type: text/plain, Size: 23 bytes --]


-- 
Grégoire Jadi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

             reply	other threads:[~2015-10-24 17:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-24 17:43 Grégoire Jadi [this message]
2015-10-25  8:40 ` [PATCH] Fix `org-capture-templates' type declaration Nicolas Goaziou
2015-10-25 13:34   ` Grégoire Jadi
2015-10-25 15:44     ` Nicolas Goaziou
2015-10-25 16:47       ` Grégoire Jadi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h9lg88mh.fsf@univ-nantes.fr \
    --to=gregoire.jadi@univ-nantes.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).