emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: thomas.plass@arcor.de (Thomas Plass)
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] make 'org-at-date-range-p work like org-at-timestamp-p
Date: Tue, 19 Mar 2019 20:46:31 +0100	[thread overview]
Message-ID: <23697.18199.629146.134721@AGAME7.local> (raw)
In-Reply-To: Your message of Monday, March 18 2019 22:43:13 (ID: <87mulrsvta.fsf@nicolasgoaziou.fr>).

Nicolas,

thanks for taking care.  But there's another thing.

I don't know what I've done to my Org buffer, but what look like
timestamps are a mixture of element types 'timestamp and 'planning.

Anyway, 'org-at-timestamp-p returns nil for the 'planning timestamps.
Which causes breakage.

Please take a look at the patch.  It could be that 'org-check-*-date
functions might also be affected by the same problem, I haven't
tested.

Regards

Thomas

From dda6f686e40663b1da3151686145cd125d1f88d1 Mon Sep 17 00:00:00 2001
From: Thomas Plass <thunk2@arcor.de>
Date: Tue, 19 Mar 2019 21:24:19 +0200
Subject: [PATCH] Check timestamp contexts for both element types
 'timestamp and 'planning.

---
 lisp/org.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index ee1082376..3f2e429dd 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15178,10 +15178,10 @@ When matching, the match groups are the following:
 				  (and (bound-and-true-p
 					org-agenda-include-inactive-timestamps)
 				       (org-at-clock-log-p))))
-			 (eq 'timestamp
-			     (save-excursion
-			       (when (= pos (cdr boundaries)) (forward-char -1))
-			       (org-element-type (org-element-context)))))))))))
+			 (memq (save-excursion
+			         (when (= pos (cdr boundaries)) (forward-char -1))
+			         (org-element-type (org-element-context)))
+                               '(timestamp planning)))))))))
     (cond
      ((not match?)                        nil)
      ((= pos (match-beginning 0))         'bracket)
-- 
2.13.1.windows.2

  reply	other threads:[~2019-03-19 19:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-15 21:13 [PATCH] make 'org-at-date-range-p work like org-at-timestamp-p Thomas Plass
2019-03-18 21:43 ` Nicolas Goaziou
2019-03-19 19:46   ` Thomas Plass [this message]
2019-03-19 19:49   ` Thomas Plass
2019-03-19 20:28     ` Nicolas Goaziou

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=23697.18199.629146.134721@AGAME7.local \
    --to=thomas.plass@arcor.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /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).