From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Seeger Subject: [PATCH] org.el: Fix custom timestamps for date ranges Date: Thu, 6 Jul 2017 17:19:10 +0200 Message-ID: <20170706151910.8236-1-jan.seeger@thenybble.de> References: Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dT8Z6-00042z-I0 for emacs-orgmode@gnu.org; Thu, 06 Jul 2017 11:19:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dT8Z0-00036x-Jb for emacs-orgmode@gnu.org; Thu, 06 Jul 2017 11:19:36 -0400 Received: from [2a01:488:66:1000:5bfa:71f8:0:1] (port=37114 helo=mail.thenybble.de) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dT8Z0-000365-9d for emacs-orgmode@gnu.org; Thu, 06 Jul 2017 11:19:30 -0400 In-Reply-To: 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 * org.el (org-activate-dates): Change `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'. Also added doc comments. TINYCHANGE --- 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