emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Org campture recursively expands %-escapes


From: Michael Brand
Subject: Re: [O] Org campture recursively expands %-escapes
Date: Tue, 12 Jan 2016 08:30:10 +0100

Hi Nicolas

On Tue, Jan 12, 2016 at 12:05 AM, Nicolas Goaziou
<address@hidden> wrote:
>
> Michael Brand <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]