Re: [PATCH] Fix regression in org-get-time-of-day introduced in aba1f2066

2021-07-24 Thread Timothy


Marking as applied for updates.orgmode.org.

Nicolas Goaziou  writes:

> Thanks. I applied a slightly different fix.

--
Timothy



Re: [PATCH] Fix regression in org-get-time-of-day introduced in aba1f2066

2021-06-20 Thread Nicolas Goaziou
Hello,

Ihor Radchenko  writes:

> The new version of org-get-time-of-day errors on empty string argument.
> The attached patch is fixing this.

Thanks. I applied a slightly different fix.

Regards,
-- 
Nicolas Goaziou



[PATCH] Fix regression in org-get-time-of-day introduced in aba1f2066

2021-06-20 Thread Ihor Radchenko

The new version of org-get-time-of-day errors on empty string argument.
The attached patch is fixing this.

Best,
Ihor

>From b615265881bdbb65f9a99d9f076424cb2233b250 Mon Sep 17 00:00:00 2001
Message-Id: 
From: Ihor Radchenko 
Date: Sun, 20 Jun 2021 17:15:34 +0800
Subject: [PATCH] Fix regression in org-get-time-of-day introduced in aba1f2066

* lisp/org-agenda.el (org-get-time-of-day): Do not check 'face
property when S argument is an empty string.  The old version of the
code would throw error on (get-text-property 1 'face s).
---
 lisp/org-agenda.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index a6bc8bcf0..f9077f0c8 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6995,7 +6995,8 @@ (defun org-get-time-of-day (s &optional string)
  (group-n 3 (or "am" "pm")))
  word-end)))
 (save-match-data
-  (when (and (not (eq 'org-link (get-text-property 1 'face s)))
+  (when (and (not (string-empty-p s))
+ (not (eq 'org-link (get-text-property 1 'face s)))
  (string-match time-regexp s))
 (let ((hours
(let* ((ampm (and (match-end 3) (downcase (match-string 3 s
-- 
2.31.1