From mboxrd@z Thu Jan 1 00:00:00 1970 From: thunk2@arcor.de (Thomas Plass) Subject: [PATCH] make 'org-at-date-range-p work like org-at-timestamp-p Date: Fri, 15 Mar 2019 22:13:24 +0100 Message-ID: <23692.5492.62319.323977@AGAME7.local> Reply-To: Thomas Plass Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([209.51.188.92]:57467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4u90-00089l-MF for emacs-orgmode@gnu.org; Fri, 15 Mar 2019 17:13:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4u8z-00017J-1e for emacs-orgmode@gnu.org; Fri, 15 Mar 2019 17:13:34 -0400 Received: from mx009.vodafonemail.xion.oxcs.net ([153.92.174.39]:23650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h4u8y-00015k-JS for emacs-orgmode@gnu.org; Fri, 15 Mar 2019 17:13:32 -0400 Received: from vsmx002.vodafonemail.xion.oxcs.net (unknown [192.168.75.192]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTP id ED349D9B162 for ; Fri, 15 Mar 2019 21:13:28 +0000 (UTC) Received: from agame7.arcor.de (unknown [2.205.23.198]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTPA id BC454199C31 for ; Fri, 15 Mar 2019 21:13:26 +0000 (UTC) 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 Hello maintainers, it's counter-intuitive that 'org-at-date-range-p doesn't work like 'org-at-timestamp-p when point is on the leading bracket of a range. Witness (^ = point) <2019-12-30 Mo 12:00> ^ (org-at-timestamp-p) => t <2019-12-30 Mo 12:00>--<2019-12-31 Di 09:00> ^ (org-at-timestamp-p) => t ^ (org-at-date-range-p) => t ^ (org-at-date-range-p) => nil Is the attached patch OK? Regards, Thomas >From 11424a8a8f975148a6914ba324b7e34218fed30d Mon Sep 17 00:00:00 2001 From: Thomas Plass Date: Fri, 15 Mar 2019 22:56:01 +0200 Subject: [PATCH] * make 'org-at-date-range-p work like org-at-timestamp-p when point is on starting bracket --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 24e1549a2..2053ae6b7 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10651,7 +10651,7 @@ on INACTIVE-OK." (save-excursion (catch 'exit (let ((pos (point))) - (skip-chars-backward "^[<\r\n") + (or (looking-at-p "[<[]") (skip-chars-backward "^[<\r\n")) (skip-chars-backward "<[") (and (looking-at (if inactive-ok org-tr-regexp-both org-tr-regexp)) (>= (match-end 0) pos) -- 2.13.1.windows.2