From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [PATCH 6/9] factor out date-timestamp* calculations to org-store-link-props Date: Wed, 04 Nov 2015 11:26:53 +0000 Message-ID: <87io5ivwci.fsf@gmail.com> References: <1446581747-1960-1-git-send-email-oxij@oxij.org> <1446581747-1960-7-git-send-email-oxij@oxij.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtwDS-0002US-Tu for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 06:26:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtwDP-0003ku-Ob for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 06:26:58 -0500 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:38094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtwDP-0003kq-I5 for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 06:26:55 -0500 Received: by wmeg8 with SMTP id g8so38741038wme.1 for ; Wed, 04 Nov 2015 03:26:55 -0800 (PST) In-Reply-To: <1446581747-1960-7-git-send-email-oxij@oxij.org> 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: emacs-orgmode@gnu.org Cc: Jan Malakhovski 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