From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Holst Subject: Re: [patch] capture property table-line-pos can be a function Date: Tue, 18 Mar 2014 19:27:42 +0100 Message-ID: <871txzfjkx@gmx.de> References: <87eh23i5uf@gmx.de> <87zjkpsl3s.fsf@bzg.ath.cx> <87a9co4v9l@gmx.de> <87ha6vfpu2.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=Multipart0o0o0o0o0o0o0o" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPyjw-0002rK-3f for emacs-orgmode@gnu.org; Tue, 18 Mar 2014 14:27:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPyjq-0001GF-CH for emacs-orgmode@gnu.org; Tue, 18 Mar 2014 14:27:52 -0400 In-Reply-To: <87ha6vfpu2.fsf@bzg.ath.cx> (bzg@gnu.org's message of "Tue, 18 Mar 2014 17:12:37 +0100") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: "emacs-orgmode@gnu.org" --=Multipart0o0o0o0o0o0o0o Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi Bastien, · Bastien wrote: > Thomas Holst writes: > >> ok here is the patch for documentation. > > Thanks -- can you read this page? > http://orgmode.org/worg/org-contribute.html#sec-5 > > There are advice on how to format the Changelog entry. > > See in particular this list: > > - Variables and functions names are quoted like `this' (backquote and > single quote). > - Sentences should be separated by two spaces. > - Sentences should start with an uppercase letter. > - Avoid the passive form: i.e., use "change" instead of "changed". > > I know it's boring, but even more boring to fix this when we merge > Org with Emacs :) > > Thanks in advance, I am sorry, I used =git format-patch= for the patches assuming all will go well. Here are both patches with rewritten commit messages. Hopefully I made them well. -- Bis neulich ... Thomas --=Multipart0o0o0o0o0o0o0o Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-capture-property-table-line-pos.patch Content-Description: patch for :table-line-pos >From e5f906f20b796326e50057fa4fc21599368bd347 Mon Sep 17 00:00:00 2001 From: Thomas Holst Date: Sat, 15 Mar 2014 16:22:44 +0100 Subject: [PATCH 1/2] capture: property `:table-line-pos' can be a function name, a string or a variable org-capture.el: Implement new features for capture templates * lisp/org-capture.el (org-capture-place-table-line): If the value of `:table-line-pos' is a function name, its return value is used to determine the position inside the table. Return value must be a string like "II-3". Else `:table-line-pos' is 'eval'ed. TINYCHANGE --- lisp/org-capture.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index e7f5e20..cf6c9e2 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1149,6 +1149,9 @@ may have been stored before." ;; Check if the template is good (if (not (string-match org-table-dataline-regexp txt)) (setq txt "| %?Bad template |\n")) + (if (functionp table-line-pos) + (setq table-line-pos (funcall table-line-pos)) + (setq table-line-pos (eval table-line-pos))) (cond ((and table-line-pos (string-match "\\(I+\\)\\([-+][0-9]\\)" table-line-pos)) -- 1.7.9.5 --=Multipart0o0o0o0o0o0o0o Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-docu-change-for-table-line-pos-new-feature.patch Content-Description: docu patch for :table-line-pos >From 436e5adb0a9d0bc9ac37352bd90018c973dfdabf Mon Sep 17 00:00:00 2001 From: Thomas Holst Date: Mon, 17 Mar 2014 09:01:40 +0100 Subject: [PATCH] docu change for table-line-pos new feature org.texi: Document new features for capture templates * doc/org.texi: Document new features of `:table-line-pos' in capture templates. --- doc/org.texi | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index b53b668..2bebae4 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -7095,9 +7095,10 @@ narrow it so that you only see the new material. @item :table-line-pos Specification of the location in the table where the new line should be -inserted. It should be a string like @code{"II-3"} meaning that the new -line should become the third line before the second horizontal separator -line. +inserted. It can be a string, a variable holding a string or a function +returning a string. The string should look like @code{"II-3"} meaning that +the new line should become the third line before the second horizontal +separator line. @item :kill-buffer If the target file was not yet visited when capture was invoked, kill the -- 1.7.9 --=Multipart0o0o0o0o0o0o0o--