From: Aaron Ecay <aaronecay@gmail.com>
To: emacs-orgmode@gnu.org
Cc: Jan Malakhovski <oxij@oxij.org>
Subject: Re: [PATCH 6/9] factor out date-timestamp* calculations to org-store-link-props
Date: Wed, 04 Nov 2015 11:26:53 +0000 [thread overview]
Message-ID: <87io5ivwci.fsf@gmail.com> (raw)
In-Reply-To: <1446581747-1960-7-git-send-email-oxij@oxij.org>
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
next prev parent reply other threads:[~2015-11-04 11:26 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 20:15 [PATCH v2 0/9] mail, clock and calc changes Jan Malakhovski
2015-11-03 20:15 ` [PATCH 1/9] org-clock: fix a typo Jan Malakhovski
2015-11-03 20:15 ` [PATCH 2/9] org-colview: add a FIXME Jan Malakhovski
2015-11-03 20:15 ` [PATCH 3/9] org-clock: fix `org-clock-time%' Jan Malakhovski
2015-11-04 11:18 ` Aaron Ecay
2015-11-04 11:46 ` Jan Malakhovski
2015-11-03 20:15 ` [PATCH 4/9] org: move `org-duration-string-to-minutes' to a better place Jan Malakhovski
2015-11-03 20:15 ` [PATCH 5/9] rename `org-duration-string-to-minutes' to `org-clocksum-string-to-minutes' everywhere Jan Malakhovski
2015-11-04 11:21 ` Aaron Ecay
2015-11-04 11:47 ` Jan Malakhovski
2015-11-03 20:15 ` [PATCH 6/9] factor out date-timestamp* calculations to org-store-link-props Jan Malakhovski
2015-11-04 11:26 ` Aaron Ecay [this message]
2015-11-04 11:45 ` Jan Malakhovski
2015-11-04 14:39 ` Aaron Ecay
2015-11-04 15:21 ` Jan Malakhovski
2015-11-03 20:15 ` [PATCH 7/9] org-notmuch: add date support to org-notmuch-store-link Jan Malakhovski
2015-11-03 20:15 ` [PATCH 8/9] ob-calc: add more API, documentation and examples so that it can be used in tables Jan Malakhovski
2015-11-03 20:15 ` [PATCH 9/9] ob-calc: don't leave garbage on the stack Jan Malakhovski
2015-11-04 11:31 ` Aaron Ecay
2015-11-04 11:53 ` Jan Malakhovski
2015-11-04 14:41 ` Aaron Ecay
2015-11-04 15:24 ` Jan Malakhovski
2015-11-04 11:36 ` [PATCH v2 0/9] mail, clock and calc changes Aaron Ecay
2015-11-04 11:59 ` Jan Malakhovski
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=87io5ivwci.fsf@gmail.com \
--to=aaronecay@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=oxij@oxij.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).