From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: Org campture recursively expands %-escapes Date: Tue, 12 Jan 2016 08:30:10 +0100 Message-ID: References: <87d1uwpm1a.fsf@nicolasgoaziou.fr> <87610o2wkz.fsf@nicolasgoaziou.fr> <87io4kn6cn.fsf@nicolasgoaziou.fr> <87oad2qw4z.fsf@nicolasgoaziou.fr> <87bn92qsmb.fsf@nicolasgoaziou.fr> <87lh837fzx.fsf@nicolasgoaziou.fr> <87h9ipqrez.fsf@nicolasgoaziou.fr> <8737u7lmhg.fsf@nicolasgoaziou.fr> <87si26kab0.fsf@nicolasgoaziou.fr> <87k2nik594.fsf@nicolasgoaziou.fr> <871t9nra2a.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aItPA-0006cF-JD for emacs-orgmode@gnu.org; Tue, 12 Jan 2016 02:30:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aItP9-0000e5-GX for emacs-orgmode@gnu.org; Tue, 12 Jan 2016 02:30:12 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:37255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aItP9-0000e1-BU for emacs-orgmode@gnu.org; Tue, 12 Jan 2016 02:30:11 -0500 Received: by mail-wm0-x235.google.com with SMTP id f206so304950550wmf.0 for ; Mon, 11 Jan 2016 23:30:11 -0800 (PST) In-Reply-To: <871t9nra2a.fsf@nicolasgoaziou.fr> 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: Org Mode Hi Nicolas On Tue, Jan 12, 2016 at 12:05 AM, Nicolas Goaziou wrote: > > Michael Brand writes: > >> (ert-deftest test-org-capture/fill-template () >> - "Test `org-capture-fill-template' specifications." >> + "Test `org-capture-fill-template' specifications. >> +The tests here are very similar to those in >> +`test-org-feed/fill-template'." > > Not sure the last sentence above is really interesting. Ditto for the > other occurrences. Maybe this and vice versa is better?: (ert-deftest test-org-capture/fill-template () "Test `org-capture-fill-template' specifications." ;; When working on these tests consider to also change ;; `test-org-feed/fill-template'. ;; %(sexp) placeholder. (should [...] >> - (string-match-p >> - (format-time-string (substring (car org-time-stamp-formats) 1 -1)) >> + (equal >> + (concat "[" (format-time-string >> + (substring (car org-time-stamp-formats) 1 -1)) "]\n") >> (org-capture-fill-template "%u"))) >> (should >> - (string-match-p >> - (format-time-string (substring (cdr org-time-stamp-formats) 1 -1)) >> + (equal >> + (concat "[" (format-time-string >> + (substring (cdr org-time-stamp-formats) 1 -1)) "]\n") > > I discovered recently (!) `org-time-stamp-formats' which avoids doing > the substring dance. You may want to use it instead. Ditto for the other > occurrences. I don't understand because the org-time-stamp-formats you mention is already used and does not cover inactive timestamps. Michael