emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ihor Radchenko
Subject: [PATCH] Fix regression in org-get-time-of-day introduced in aba1f2066
Date: Sun, 20 Jun 2021 17:17:11 +0800

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: 
<b615265881bdbb65f9a99d9f076424cb2233b250.1624180543.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]