From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: New implementation of the Org remember process ready for comments and testing Date: Wed, 23 Jun 2010 06:18:18 +0200 Message-ID: <45FE3E7A-B568-4CC2-B827-7ED747E95DB9@gmail.com> References: <87aaqm8y5n.fsf@gmx.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=43676 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORHPv-00031j-UU for emacs-orgmode@gnu.org; Wed, 23 Jun 2010 00:18:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORHPr-0000EU-3V for emacs-orgmode@gnu.org; Wed, 23 Jun 2010 00:18:26 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:53928) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORHPq-0000E6-R5 for emacs-orgmode@gnu.org; Wed, 23 Jun 2010 00:18:23 -0400 Received: by wyf23 with SMTP id 23so172749wyf.0 for ; Tue, 22 Jun 2010 21:18:22 -0700 (PDT) In-Reply-To: <87aaqm8y5n.fsf@gmx.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastian Rose Cc: Org Mode On Jun 23, 2010, at 1:07 AM, Sebastian Rose wrote: > Carsten Dominik writes: >> None of what I describe is set in stone yet - let me know if you have >> comments, change requests or other ideas. >> >> My feeling right now is that this should become the default capture >> system, and that we will keep the current org-remember in the >> distribution for quite some time, for compatibility. > > > * "C" as template key > > C-h v org-catpure-templates > > states: > > Do not use "C" as a key, it is reserved for customizing the > template variable. > > I guess this is for the testing phase only? No, this is for easy access to the customize buffer of this variable. org-remember does the same with org-remember-templates, and org-agenda =20= with org-agenda-custom-command. I think right now, for org-capture-templates, the customization =20 binding of ?C takes precedent. I guess it would be more consistent to =20= have your own binding to do so.... OK, now you can use "C" if you want. > * Reuse input > > I would like to prompt for a value and use the input in several > places. E.g. part of the last entry in my training diary looks like > this: > > > =3D> --->8----------------------------->8-----------------------------=20= > >8--- > ***** DONE [2010-06-21 Mo] (run) 22761 5:52 > :PROPERTIES: > :date: [2010-06-21 Mo] > :meters: 22761 > :time: 02:13:32 > :pace: 5:52 > :start: 16:00 > :type: lgDL > :kcal: 1525 > :rpuls: 42 > :END: > > ******* Weather > ... > > ******* Track > ... where ... > > ******* Training > ... splits, training contents ... > > ******* Comment > ... feeling, health etc... > <=3D =20 > ---8<-----------------------------8<-----------------------------8<--- > > > As you can see, I use the "distance" and the "pace" in two > places. One in the title for better overview, one as property for > column view. But I'd like to enter it only once. Maybe James has a solution for this one? > > > > > > > * Separate template files > > I'd like to use Org-mode to edit templates. > > I'm trying this: > > (setq org-capture-templates > ( > `( > ("l" "Lauf" entry (file+headline "notes/Laufen/Training.org" =20= > "Training") > ,(org-file-contents "~/emacs/org/capture-templates/=20 > training.org") > :empty-lines 1)))) You need to put ` on the outside of the outermost list: (setq org-capture-templates `( ( ("l" "Lauf" entry (file+headline "notes/Laufen/Training.org" =20 "Training") ,(org-file-contents "~/emacs/org/capture-templates/=20 training.org") :empty-lines 1)))) > > But I get an error when calling `org-capture': > > Debugger entered--Lisp error: (wrong-type-argument listp "* DONE %u =20= > (%^{Type:}) %^{Distance:} x:xx > :PROPERTIES: > :date: %u > :meters: > :time: > :pace: x:xx > :start: > :type: > :kcal: xxx > :rpuls: > :END: %^{meters}p %^{start}p %^{time}p %^{type}p %x^{rpuls}p > *** Wetter > %? > > *** Strecke > > *** Trainingsinhalt > > *** Kommentar > ") > length(("l" "Lauf" entry (file+headline "notes/Laufen/Training.org" =20= > "Training") . "* DONE %u (%^{Type:}) %^{Distance:} x:xx=20 > \n :PROPERTIES:\n :date: %u\n :meters:\n :time:=20 > \n :pace: x:xx\n :start:\n :type:\n :kcal: xxx\n :rpuls:=20= > \n :END: %^{meters}p %^{start}p %^{time}p %^{type}p %x^{rpuls}p=20 > \n*** Wetter\n %?\n\n*** Strecke\n\n*** Trainingsinhalt\n\n*** =20 > Kommentar\n")) > (=3D 2 (length (car tbl))) > (and (=3D 2 (length ...)) (=3D (length ...) 1)) > (cond ((and ... ...) (setq dkey ... ddesc ...) (pop tbl) (push dkey =20= > des-keys) (push dkey allowed-keys) (insert prefix "[" dkey "]" "..." =20= > " " ddesc "..." "\n") (setq re ...) (while ... ...)) ((=3D 2 ...)) (t = =20 > (insert prefix "[" ... "]" " " ... "\n") (push ... allowed-keys) =20= > (pop tbl))) > (while tbl (cond (... ... ... ... ... ... ... ...) (...) =20 > (t ... ... ...))) > (while t (erase-buffer) (insert title "\n\n") (setq tbl table des-=20 > keys nil allowed-keys nil) (setq prefix (if current ... "")) (while =20= > tbl (cond ... ... ...)) (when specials (insert =20 > = "-------------------------------------------------------------------------= ------\n=20 > ") (let ... ...)) (push "=07" allowed-keys) (goto-char (point-min)) =20= > (if (not ...) (org-fit-window-to-buffer)) (message prompt) (setq =20 > pressed (char-to-string ...)) (while (not ...) (message "Invalid key =20= > `%s'" pressed) (sit-for 1) (message prompt) (setq pressed ...)) (if =20= > (equal pressed "=07") (error "Abort")) (if (assoc pressed specials) =20= > (throw ... ...)) (unless (member pressed des-keys) (throw ... ...)) =20= > (setq current (concat current pressed)) (setq table (mapcar ... =20 > table)) (setq table (remove nil table))) > (catch (quote exit) (while t (erase-buffer) (insert title "\n\n") =20 > (setq tbl table des-keys nil allowed-keys nil) (setq prefix ...) =20 > (while tbl ...) (when specials ... ...) (push "=07" allowed-keys) =20 > (goto-char ...) (if ... ...) (message prompt) (setq pressed ...) =20 > (while ... ... ... ... ...) (if ... ...) (if ... ...) =20 > (unless ... ...) (setq current ...) (setq table ...) (setq =20 > table ...))) > (save-window-excursion (org-switch-to-buffer-other-window "*Org =20 > Select*") (setq orig-table table) (catch (quote exit) (while =20 > t=20 > ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... = ...))) > (let (tbl orig-table dkey ddesc des-keys allowed-keys current =20 > prefix rtn) (save-window-excursion (org-switch-to-buffer-other-=20 > window "*Org Select*") (setq orig-table table) (catch ... ...)) =20 > (kill-buffer "*Org Select*") rtn) > org-mks((("t" "Todo" entry (file+headline "organizer.org" "Eingang") > "* TODO %^{Title} %^g\n Eingang: %U\n %a\n %i" :empty-lines 1) =20 > ("T" > "Termin" entry (file+headline "organizer.org" "Eingang") "* TODO %^T > %^{Title} %^g\n Eingang: %U\n %a\n %i" :empty-lines 1) ("l" "Lauf" > entry (file+headline "notes/Laufen/Training.org" "Training") . "* =20 > DONE > %u (%^{Type:}) %^{Distance:} x:xx\n :PROPERTIES:\n :date: > %u\n :meters:\n :time:\n :pace: x:xx\n :start:\n :type:\n > :kcal: xxx\n :rpuls:\n :END: %^{meters}p %^{start}p %^{time}p > %^{type}p %x^{rpuls}p\n*** Wetter\n %?\n\n*** Strecke\n\n*** > Trainingsinhalt\n\n*** Kommentar\n") > > ... > > > > Sebastian