bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-11-05 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> Ihor Radchenko  writes:
>
>> Let's not use 00:00 times. This may fail the test in some unusual time
>> zones.
>
> Changed to 06:00.

Thanks!
Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=eefb14f9fa73b07cb14a0429953fa55f9c78e1cf

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 





bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-11-05 Thread General discussions about Org-mode.
Ihor Radchenko  writes:

> Let's not use 00:00 times. This may fail the test in some unusual time
> zones.

Changed to 06:00.

>From e39e3fa3e58963e7ef15258ed267fa9ed0de936b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= 
Date: Thu, 3 Nov 2022 22:47:44 +0100
Subject: [PATCH] test-org-clock: Test DWIM update of days

* testing/listp/test-org-clock (test-org-clock/clock-drawer-dwim): Add
new test for DWIM updates of days for clocks in logbook drawers.

Reported-by: Bruce E. Robertson 
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=53393
---
 testing/lisp/test-org-clock.el | 16 
 1 file changed, 16 insertions(+)

diff --git a/testing/lisp/test-org-clock.el b/testing/lisp/test-org-clock.el
index f992c8d7a..68286b174 100644
--- a/testing/lisp/test-org-clock.el
+++ b/testing/lisp/test-org-clock.el
@@ -273,6 +273,22 @@ the buffer."
   (org-log-into-drawer nil))
   (org-clock-drawer-name))
 
+(ert-deftest test-org-clock/clock-drawer-dwim ()
+  "Test DWIM update of days for clocks in logbook drawers."
+  (should (equal "* Foo
+:LOGBOOK:
+CLOCK: [2022-11-03 Thu 06:00]--[2022-11-03 Thu 06:01] =>  0:01
+:END:
+"
+ (org-test-with-temp-text
+ "* Foo
+:LOGBOOK:
+CLOCK: [2022-11-03 ??? 06:00]--[2022-11-03 ??? 06:01] =>  0:01
+:END:
+"
+   (org-ctrl-c-ctrl-c)
+   (buffer-string)
+
 
 ;;; Clocktable
 
-- 
2.38.1

-- 
"Simplicity is complexity resolved."
-- Constantin Brâncuși, 1876-1957

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia


bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-11-03 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> Ihor Radchenko  writes:
>
>>> recently did update the day of the week but no long does
>
>> Fixed on main.
>
> Please see the attached patch with a regression test.

Thanks!

> +:LOGBOOK:
> +CLOCK: [2022-11-03 Thu 00:00]--[2022-11-03 Thu 00:01] =>  0:01
> +:END:

Let's not use 00:00 times. This may fail the test in some unusual time
zones.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 





bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-11-03 Thread General discussions about Org-mode.
Ihor Radchenko  writes:

>> recently did update the day of the week but no long does

> Fixed on main.

Please see the attached patch with a regression test.

Rudy

>From 51f1ee245a99e30402d7fd2d069d3e223ad5c15d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= 
Date: Thu, 3 Nov 2022 22:47:44 +0100
Subject: [PATCH] test-org-clock: Test DWIM update of days

* testing/listp/test-org-clock (test-org-clock/clock-drawer-dwim): Add
new test for DWIM updates of days for clocks in logbook drawers.

Reported-by: Bruce E. Robertson 
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=53393
---
 testing/lisp/test-org-clock.el | 16 
 1 file changed, 16 insertions(+)

diff --git a/testing/lisp/test-org-clock.el b/testing/lisp/test-org-clock.el
index f992c8d7a..4798c42b7 100644
--- a/testing/lisp/test-org-clock.el
+++ b/testing/lisp/test-org-clock.el
@@ -273,6 +273,22 @@ the buffer."
   (org-log-into-drawer nil))
   (org-clock-drawer-name))
 
+(ert-deftest test-org-clock/clock-drawer-dwim ()
+  "Test DWIM update of days for clocks in logbook drawers."
+  (should (equal "* Foo
+:LOGBOOK:
+CLOCK: [2022-11-03 Thu 00:00]--[2022-11-03 Thu 00:01] =>  0:01
+:END:
+"
+ (org-test-with-temp-text
+ "* Foo
+:LOGBOOK:
+CLOCK: [2022-11-03 ??? 00:00]--[2022-11-03 ??? 00:01] =>  0:01
+:END:
+"
+   (org-ctrl-c-ctrl-c)
+   (buffer-string)
+
 
 ;;; Clocktable
 
-- 
2.38.1

-- 
"Thinking is a momentary dismissal of irrelevancies."
-- Richard Buckminster Fuller, 1969

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia


bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-11-01 Thread bruce robertson
Fabulous! I keep editing these by hand. Thanks!

Emacs!!

On Tue, Nov 1, 2022 at 12:54 AM Ihor Radchenko  wrote:

> "Bruce E. Robertson"  writes:
>
> > emacs -Q test.org
> > cursor to "CLOCK:" line, C-c C-c
> > total time updates but day of week does not change
> > contents of test.org
> > --
> > * heading
> > :LOGBOOK:
> > CLOCK: [2022-01-17 Tue 10:29]--[2022-01-19 Tue 10:29] => 48:00
> > :END:
> > --
> > typing C-c C-c does update total log time for line and recently did
> > update the day of the week but no long does
>
> Fixed on main.
>
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5bc6741a5abd42e8305bb0fcfe78801813309640
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>
-- 
λέγει αὐτῷ Ἰησοῦς Ἐγώ εἰμι ἡ ὁδὸς καὶ ἡ ἀλήθεια καὶ ἡ ζωή· οὐδεὶς ἔρχεται
πρὸς τὸν Πατέρα εἰ μὴ δι' ἐμοῦ. ΚΑΤΑ ΙΩΑΝΝΗΝ


bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-11-01 Thread Ihor Radchenko
"Bruce E. Robertson"  writes:

> emacs -Q test.org
> cursor to "CLOCK:" line, C-c C-c
> total time updates but day of week does not change
> contents of test.org
> --
> * heading
> :LOGBOOK:
> CLOCK: [2022-01-17 Tue 10:29]--[2022-01-19 Tue 10:29] => 48:00
> :END:
> --
> typing C-c C-c does update total log time for line and recently did
> update the day of the week but no long does

Fixed on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5bc6741a5abd42e8305bb0fcfe78801813309640

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 





Re: bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-10-11 Thread Ihor Radchenko
No Wayman  writes:

> Confirmed:
>
> Yodel[1] Report 2022-01-22 00:19:18
> ===
>
> --8<---cut here---start->8---
> (yodel
>   :save "org-bug"
>   :packages* org
>   :post*
>   (yodel-file "org-bug-test"
> :point "|"
> :with*
> "* heading"
> " :LOGBOOK:"
> " CLOCK: | [2022-01-17 Tue 10:29]--[2022-01-19 Tue 10:29]"
> " :END:" :then*
> (require 'org-clock)
> (org-clock-update-time-maybe)
> (print (buffer-string
> --8<---cut here---end--->8---

And finally fixed on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=dd2212395b58f67f776485217da9d6e1d8bb1f8b

Fixed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-01-25 Thread bruce robertson
FWIW, day *does* update in lines like, "SCHEDULED: <2022-01-25 Tue .+1d>".
Interestingly the timestamp is angle-bracketed rather than
square-bracketed. Hmm



On Thu, Jan 20, 2022 at 11:13 PM Eli Zaretskii  wrote:

> > From: "Bruce E. Robertson" 
> > Date: Tue, 18 Jan 2022 10:36:22 -0800
> >
> >
> > emacs -Q test.org
> > cursor to "CLOCK:" line, C-c C-c
> > total time updates but day of week does not change
> > contents of test.org
> > --
> > * heading
> > :LOGBOOK:
> > CLOCK: [2022-01-17 Tue 10:29]--[2022-01-19 Tue 10:29] => 48:00
> > :END:
> > --
> > typing C-c C-c does update total log time for line and recently did
> > update the day of the week but no long does
>
> Isn't this an Org problem that should be reported to the Org
> developers first?
>
> Thanks.
>


-- 
λέγει αὐτῷ Ἰησοῦς Ἐγώ εἰμι ἡ ὁδὸς καὶ ἡ ἀλήθεια καὶ ἡ ζωή· οὐδεὶς ἔρχεται
πρὸς τὸν Πατέρα εἰ μὴ δι' ἐμοῦ. ΚΑΤΑ ΙΩΑΝΝΗΝ


Re: bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-01-22 Thread Ihor Radchenko
"Peter Davis"  writes:

> Please unsubscribe my husband Peter Davis from this list.  He died 3 years 
> ago.
>
> Thanks,
> Donna Cantera-Davis

I am sorry to hear this.

To unsubscribe, feel free to follow the steps described in
https://lists.gnu.org/mailman/listinfo/emacs-orgmode

Look for the following text at the bottom of the page:

"To unsubscribe from Emacs-orgmode, get a password reminder, or change
your subscription options enter your subscription email address:"

Best,
Ihor



Re: bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-01-22 Thread Peter Davis
Hello,

Please unsubscribe my husband Peter Davis from this list.  He died 3 years ago.

Thanks,
Donna Cantera-Davis

On Thu, Jan 20, 2022, at 9:07 PM, bruce robertson wrote:
> Thanks. I’ll do that. Org-submit … that is. 
> 
> On Thu, Jan 20, 2022 at 5:35 PM Kyle Meyer  wrote:
>> [ I've reassigned this bug report so that new messages will be directed
>>   to the Org mailing list, where it's more likely to get a reply.  In
>>   the future, please consider using org-submit-bug-report or sending a
>>   message to emacs-orgmode@gnu.org directly. ]
>> 
>> Bruce E. Robertson writes:
>> 
>> > emacs -Q test.org
>> > cursor to "CLOCK:" line, C-c C-c
>> > total time updates but day of week does not change
>> > contents of test.org
>> > --
>> > * heading
>> > :LOGBOOK:
>> > CLOCK: [2022-01-17 Tue 10:29]--[2022-01-19 Tue 10:29] => 48:00
>> > :END:
>> > --
>> > typing C-c C-c does update total log time for line and recently did
>> > update the day of the week but no long does
>> 
>> I'm having trouble finding an Org version where it will update a
>> timestamp _within_ a clock line.  I tried it out with v9.1 and the day
>> of the week still isn't updated.  Outside of that context it will, as
>> org-ctrl-c-ctrl-c-hook gets through to its timestamp condition rather
>> than taking the clock branch.
>> 
>> If you can provide more details about a version where it did work,
>> showing it's a regression, I think you'll have a higher chance of
>> getting this fixed.
>> 
>> Anyway, at least for now, perhaps you could try something like this to
>> get the behavior you want:
>> 
>>   (defun my/update-clock-and-days ()
>> (when (eq (org-element-type (org-element-context)) 'clock)
>>   (let ((re (org-re-timestamp 'inactive)))
>> (save-excursion
>>   (goto-char (line-beginning-position))
>>   (while (re-search-forward re (line-end-position) t)
>> (backward-char)
>> (org-timestamp-change 0 'day))
>> 
>>   (add-hook 'org-ctrl-c-ctrl-c-hook #'my/update-clock-and-days)
>> 
>> With that, hitting `C-c C-c` on the clock line at
>> 
>> --8<---cut here---start->8---
>> * heading
>> :LOGBOOK:
>> CLOCK: [2022-01-17 Thu 10:29]--[2022-01-19 Sun 10:29] => 40:00
>> :END:
>> --8<---cut here---end--->8---
>> 
>> produces
>> 
>> --8<---cut here---start->8---
>> * heading
>> :LOGBOOK:
>> CLOCK: [2022-01-17 Mon 10:29]--[2022-01-19 Wed 10:29] => 48:00
>> :END:
>> --8<---cut here---end--->8---
> -- 
> λέγει αὐτῷ Ἰησοῦς Ἐγώ εἰμι ἡ ὁδὸς καὶ ἡ ἀλήθεια καὶ ἡ ζωή· οὐδεὶς ἔρχεται 
> πρὸς τὸν Πατέρα εἰ μὴ δι' ἐμοῦ. ΚΑΤΑ ΙΩΑΝΝΗΝ

--
  Peter Davis
  www.techcurmudgeon.com

Re: bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-01-21 Thread No Wayman



It looks like the correction of the day name in timestamps is 
hardcoded in `org-ctrl-c-ctrl-c':


	((or `timestamp (and `planning (guard (org-at-timestamp-p 
'lax

 (org-timestamp-change 0 'day))



`org-clock-update-time-maybe' uses a regexp to match the start and 
end times and hands those off to `org-parse-time-string' which 
does not consider the day name.







Re: bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-01-21 Thread No Wayman




From: "Bruce E. Robertson" 
Date: Tue, 18 Jan 2022 10:36:22 -0800


emacs -Q test.org
cursor to "CLOCK:" line, C-c C-c
total time updates but day of week does not change
contents of test.org
--
* heading
:LOGBOOK:
CLOCK: [2022-01-17 Tue 10:29]--[2022-01-19 Tue 10:29] => 48:00
:END:
--
typing C-c C-c does update total log time for line and recently 
did

update the day of the week but no long does


Confirmed:

Yodel[1] Report 2022-01-22 00:19:18
===

--8<---cut here---start->8---
(yodel
 :save "org-bug"
 :packages* org
 :post*
 (yodel-file "org-bug-test"
   :point "|"
   :with*
   "* heading"
   " :LOGBOOK:"
   " CLOCK: | [2022-01-17 Tue 10:29]--[2022-01-19 Tue 10:29]"
   " :END:" :then*
   (require 'org-clock)
   (org-clock-update-time-maybe)
   (print (buffer-string
--8<---cut here---end--->8---

STDOUT
==


Loading /tmp/org-bug/straight-bootstrap-snippet.el (source)...



"* heading
 :LOGBOOK:
 CLOCK:  [2022-01-17 Tue 10:29]--[2022-01-19 Tue 10:29] => 48:00
 :END:"


Environment
===

- emacs version: GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, 
 GTK+ Version 3.24.31, cairo version 1.17.4)

of 2022-01-13
- system type: gnu/linux

Packages


- org 
 https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=846226a202619866fe80667d13e9d5a105bd1eef


[1] https://www.github.com/progfolio/yodel



bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-01-21 Thread Eli Zaretskii
> From: "Bruce E. Robertson" 
> Date: Tue, 18 Jan 2022 10:36:22 -0800
> 
> 
> emacs -Q test.org
> cursor to "CLOCK:" line, C-c C-c
> total time updates but day of week does not change
> contents of test.org
> --
> * heading
> :LOGBOOK:
> CLOCK: [2022-01-17 Tue 10:29]--[2022-01-19 Tue 10:29] => 48:00
> :END:
> --
> typing C-c C-c does update total log time for line and recently did
> update the day of the week but no long does

Isn't this an Org problem that should be reported to the Org
developers first?

Thanks.





bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-01-20 Thread bruce robertson
Thanks. I’ll do that. Org-submit … that is.

On Thu, Jan 20, 2022 at 5:35 PM Kyle Meyer  wrote:

> [ I've reassigned this bug report so that new messages will be directed
>   to the Org mailing list, where it's more likely to get a reply.  In
>   the future, please consider using org-submit-bug-report or sending a
>   message to emacs-orgmode@gnu.org directly. ]
>
> Bruce E. Robertson writes:
>
> > emacs -Q test.org
> > cursor to "CLOCK:" line, C-c C-c
> > total time updates but day of week does not change
> > contents of test.org
> > --
> > * heading
> > :LOGBOOK:
> > CLOCK: [2022-01-17 Tue 10:29]--[2022-01-19 Tue 10:29] => 48:00
> > :END:
> > --
> > typing C-c C-c does update total log time for line and recently did
> > update the day of the week but no long does
>
> I'm having trouble finding an Org version where it will update a
> timestamp _within_ a clock line.  I tried it out with v9.1 and the day
> of the week still isn't updated.  Outside of that context it will, as
> org-ctrl-c-ctrl-c-hook gets through to its timestamp condition rather
> than taking the clock branch.
>
> If you can provide more details about a version where it did work,
> showing it's a regression, I think you'll have a higher chance of
> getting this fixed.
>
> Anyway, at least for now, perhaps you could try something like this to
> get the behavior you want:
>
>   (defun my/update-clock-and-days ()
> (when (eq (org-element-type (org-element-context)) 'clock)
>   (let ((re (org-re-timestamp 'inactive)))
> (save-excursion
>   (goto-char (line-beginning-position))
>   (while (re-search-forward re (line-end-position) t)
> (backward-char)
> (org-timestamp-change 0 'day))
>
>   (add-hook 'org-ctrl-c-ctrl-c-hook #'my/update-clock-and-days)
>
> With that, hitting `C-c C-c` on the clock line at
>
> --8<---cut here---start->8---
> * heading
> :LOGBOOK:
> CLOCK: [2022-01-17 Thu 10:29]--[2022-01-19 Sun 10:29] => 40:00
> :END:
> --8<---cut here---end--->8---
>
> produces
>
> --8<---cut here---start->8---
> * heading
> :LOGBOOK:
> CLOCK: [2022-01-17 Mon 10:29]--[2022-01-19 Wed 10:29] => 48:00
> :END:
> --8<---cut here---end--->8---
>
-- 
λέγει αὐτῷ Ἰησοῦς Ἐγώ εἰμι ἡ ὁδὸς καὶ ἡ ἀλήθεια καὶ ἡ ζωή· οὐδεὶς ἔρχεται
πρὸς τὸν Πατέρα εἰ μὴ δι' ἐμοῦ. ΚΑΤΑ ΙΩΑΝΝΗΝ


bug#53393: 29.0.50; org mode timestamp C-c C-c not updating day of week

2022-01-20 Thread Kyle Meyer
[ I've reassigned this bug report so that new messages will be directed
  to the Org mailing list, where it's more likely to get a reply.  In
  the future, please consider using org-submit-bug-report or sending a
  message to emacs-orgmode@gnu.org directly. ]

Bruce E. Robertson writes:

> emacs -Q test.org
> cursor to "CLOCK:" line, C-c C-c
> total time updates but day of week does not change
> contents of test.org
> --
> * heading
> :LOGBOOK:
> CLOCK: [2022-01-17 Tue 10:29]--[2022-01-19 Tue 10:29] => 48:00
> :END:
> --
> typing C-c C-c does update total log time for line and recently did
> update the day of the week but no long does

I'm having trouble finding an Org version where it will update a
timestamp _within_ a clock line.  I tried it out with v9.1 and the day
of the week still isn't updated.  Outside of that context it will, as
org-ctrl-c-ctrl-c-hook gets through to its timestamp condition rather
than taking the clock branch.

If you can provide more details about a version where it did work,
showing it's a regression, I think you'll have a higher chance of
getting this fixed.

Anyway, at least for now, perhaps you could try something like this to
get the behavior you want:

  (defun my/update-clock-and-days ()
(when (eq (org-element-type (org-element-context)) 'clock)
  (let ((re (org-re-timestamp 'inactive)))
(save-excursion
  (goto-char (line-beginning-position))
  (while (re-search-forward re (line-end-position) t)
(backward-char)
(org-timestamp-change 0 'day))
  
  (add-hook 'org-ctrl-c-ctrl-c-hook #'my/update-clock-and-days)

With that, hitting `C-c C-c` on the clock line at

--8<---cut here---start->8---
* heading
:LOGBOOK:
CLOCK: [2022-01-17 Thu 10:29]--[2022-01-19 Sun 10:29] => 40:00
:END:
--8<---cut here---end--->8---

produces

--8<---cut here---start->8---
* heading
:LOGBOOK:
CLOCK: [2022-01-17 Mon 10:29]--[2022-01-19 Wed 10:29] => 48:00
:END:
--8<---cut here---end--->8---