From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Seeger Subject: [PATCH] Fixed bug in custom timestamps for date ranges. Date: Thu, 6 Jul 2017 11:09:00 +0200 Message-ID: <20170706090900.14204-1-jan.seeger@thenybble.de> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT2mv-0005Im-UE for emacs-orgmode@gnu.org; Thu, 06 Jul 2017 05:09:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dT2ms-000119-Og for emacs-orgmode@gnu.org; Thu, 06 Jul 2017 05:09:29 -0400 Received: from thenybble.de ([91.250.113.248]:36832 helo=mail.thenybble.de) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dT2ms-0000wO-EA for emacs-orgmode@gnu.org; Thu, 06 Jul 2017 05:09:26 -0400 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" To: emacs-orgmode@gnu.org Cc: Jan Seeger Changed org-activate-dates to activate custom timestamps for both dates in date ranges. Formerly, only the second date would be activated. The reason was a misplaced "if". Replaced it with "when". --- lisp/org.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ab0bde1ef..f000c8f24 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6105,9 +6105,11 @@ by a #." 'keymap org-mouse-map)) (org-rear-nonsticky-at (match-end 0)) (when org-display-custom-times - (if (match-end 3) - (org-display-custom-time (match-beginning 3) (match-end 3)) - (org-display-custom-time (match-beginning 1) (match-end 1)))) + ;; If it's a date range, activate custom time for second date + (when (match-end 3) + (org-display-custom-time (match-beginning 3) (match-end 3))) + ;; Always activate custom time for first matched date + (org-display-custom-time (match-beginning 1) (match-end 1))) t)) (defvar-local org-target-link-regexp nil -- 2.13.0