emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix regression in org-get-time-of-day introduced in aba1f2066
@ 2021-06-20  9:17 Ihor Radchenko
  2021-06-20 16:09 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2021-06-20  9:17 UTC (permalink / raw)
  To: Org-mode

[-- Attachment #1: Type: text/plain, Size: 121 bytes --]


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

Best,
Ihor


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-regression-in-org-get-time-of-day-introduced-in-.patch --]
[-- Type: text/x-diff, Size: 1234 bytes --]

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix regression in org-get-time-of-day introduced in aba1f2066
  2021-06-20  9:17 [PATCH] Fix regression in org-get-time-of-day introduced in aba1f2066 Ihor Radchenko
@ 2021-06-20 16:09 ` Nicolas Goaziou
  2021-07-24 19:48   ` Timothy
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2021-06-20 16:09 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org-mode

Hello,

Ihor Radchenko <yantar92@gmail.com> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix regression in org-get-time-of-day introduced in aba1f2066
  2021-06-20 16:09 ` Nicolas Goaziou
@ 2021-07-24 19:48   ` Timothy
  0 siblings, 0 replies; 3+ messages in thread
From: Timothy @ 2021-07-24 19:48 UTC (permalink / raw)
  To: emacs-orgmode


Marking as applied for updates.orgmode.org.

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Thanks. I applied a slightly different fix.

--
Timothy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-24 19:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-20  9:17 [PATCH] Fix regression in org-get-time-of-day introduced in aba1f2066 Ihor Radchenko
2021-06-20 16:09 ` Nicolas Goaziou
2021-07-24 19:48   ` Timothy

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).