[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH 6/9] factor out date-timestamp* calculations to org-store
From: |
Aaron Ecay |
Subject: |
Re: [O] [PATCH 6/9] factor out date-timestamp* calculations to org-store-link-props |
Date: |
Wed, 04 Nov 2015 11:26:53 +0000 |
User-agent: |
Notmuch/0.20.2+65~gbd5504e (http://notmuchmail.org) Emacs/25.0.50.2 (x86_64-unknown-linux-gnu) |
Hi Jan,
2015ko azaroak 3an, Jan Malakhovski-ek idatzi zuen:
[...]
> diff --git a/lisp/org.el b/lisp/org.el
> index c466870..cf0ef1f 100755
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -9960,7 +9960,7 @@ active region."
> (car org-stored-links))))))
>
> (defun org-store-link-props (&rest plist)
> - "Store link properties, extract names and addresses."
> + "Store link properties, extract names, addresses and dates."
> (let (x adr)
> (when (setq x (plist-get plist :from))
> (setq adr (mail-extract-address-components x))
> @@ -9969,7 +9969,18 @@ active region."
> (when (setq x (plist-get plist :to))
> (setq adr (mail-extract-address-components x))
> (setq plist (plist-put plist :toname (car adr)))
> - (setq plist (plist-put plist :toaddress (nth 1 adr)))))
> + (setq plist (plist-put plist :toaddress (nth 1 adr))))
> + (when (setq x (plist-get plist :date))
> + (setq plist (plist-put plist :date-timestamp
> + (ignore-errors
> + (format-time-string
> + (org-time-stamp-format t)
> + (date-to-time x)))))
> + (setq plist (plist-put plist :date-timestamp-inactive
> + (ignore-errors
> + (format-time-string
> + (org-time-stamp-format t t)
> + (date-to-time x)))))))
Can you introduce a let binding so that (date-to-time x) is only called
once? Also, what is ignore-errors protecting? The call to date-to-time,
or format-time-string? I think the scope of ignore-errors should be as
narrow as it can be.
--
Aaron Ecay
- [O] [PATCH 1/9] org-clock: fix a typo, (continued)
- [O] [PATCH 1/9] org-clock: fix a typo, Jan Malakhovski, 2015/11/03
- [O] [PATCH 3/9] org-clock: fix `org-clock-time%', Jan Malakhovski, 2015/11/03
- [O] [PATCH 2/9] org-colview: add a FIXME, Jan Malakhovski, 2015/11/03
- [O] [PATCH 4/9] org: move `org-duration-string-to-minutes' to a better place, Jan Malakhovski, 2015/11/03
- [O] [PATCH 5/9] rename `org-duration-string-to-minutes' to `org-clocksum-string-to-minutes' everywhere, Jan Malakhovski, 2015/11/03
- [O] [PATCH 6/9] factor out date-timestamp* calculations to org-store-link-props, Jan Malakhovski, 2015/11/03
- Re: [O] [PATCH 6/9] factor out date-timestamp* calculations to org-store-link-props,
Aaron Ecay <=
[O] [PATCH 7/9] org-notmuch: add date support to org-notmuch-store-link, Jan Malakhovski, 2015/11/03
[O] [PATCH 8/9] ob-calc: add more API, documentation and examples so that it can be used in tables, Jan Malakhovski, 2015/11/03
[O] [PATCH 9/9] ob-calc: don't leave garbage on the stack, Jan Malakhovski, 2015/11/03