emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Org campture recursively expands %-escapes
Date: Tue, 12 Jan 2016 08:30:10 +0100	[thread overview]
Message-ID: <CALn3zoj8AzmajaV14hS6rexs1LMDoSXrFUJQZ33P3BO3CHgc7w@mail.gmail.com> (raw)
In-Reply-To: <871t9nra2a.fsf@nicolasgoaziou.fr>

Hi Nicolas

On Tue, Jan 12, 2016 at 12:05 AM, Nicolas Goaziou
<mail@nicolasgoaziou.fr> wrote:
>
> Michael Brand <michael.ch.brand@gmail.com> 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

  reply	other threads:[~2016-01-12  7:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-21 22:06 Org campture recursively expands %-escapes Thomas Preindl
2015-11-26 12:54 ` Nicolas Goaziou
2015-11-26 18:52   ` Samuel Wales
2015-11-26 22:02     ` Nicolas Goaziou
2015-11-26 22:10       ` Samuel Wales
2015-11-26 23:02         ` Nicolas Goaziou
2015-11-29 16:00           ` Nicolas Goaziou
2016-01-03 11:44             ` Michael Brand
2016-01-03 19:51               ` Nicolas Goaziou
2016-01-03 20:39                 ` Michael Brand
2016-01-03 21:07                   ` Nicolas Goaziou
2016-01-04  1:52                     ` Michael Brand
2016-01-05 23:39                       ` Nicolas Goaziou
2016-01-06  5:45                         ` Michael Brand
2016-01-07 16:35                           ` Nicolas Goaziou
2016-01-08 20:59                             ` Michael Brand
2016-01-08 22:44                               ` Nicolas Goaziou
2016-01-09 15:53                                 ` Michael Brand
2016-01-09 16:05                                   ` Nicolas Goaziou
2016-01-09 16:31                                     ` Michael Brand
2016-01-09 17:54                                       ` Nicolas Goaziou
2016-01-10  8:08                                         ` Michael Brand
2016-01-11 23:05                                           ` Nicolas Goaziou
2016-01-12  7:30                                             ` Michael Brand [this message]
2016-01-12  8:42                                               ` Nicolas Goaziou
2016-01-13  7:21                                                 ` Michael Brand

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=CALn3zoj8AzmajaV14hS6rexs1LMDoSXrFUJQZ33P3BO3CHgc7w@mail.gmail.com \
    --to=michael.ch.brand@gmail.com \
    --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).