From: Peter Solodov <solodov@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] org-cancel-repeater fails depending on position of repeater [9.6.15 (release_9.6.15 @ /opt/homebrew/Cellar/emacs-plus@29/29.4/share/emacs/29.4/lisp/org/)]
Date: Sun, 4 Aug 2024 19:41:42 +0000 [thread overview]
Message-ID: <CAMWT7xBNO=58-Q9=gweu7Qq5FqUfHHCJ=pdkBZCQ3esUiKO34A@mail.gmail.com> (raw)
In-Reply-To: <87r0b4duzo.fsf@localhost>
Changing `org-cancel-repeater' to work on all active timestamps makes
the most sense to me. The reason this came up at all is because org
changes order of timestamps, first timestamp is always the timestamp
that was changed last. If entry is a state where current code can handle
it correctly and then timestamp with repeater is shifted through a
normal user action (updating deadline or scheduled), then canceling with
repeater override is unexpectedly broken.
Ihor Radchenko <yantar92@posteo.net> writes:
> solodov@gmail.com writes:
>
>> Minimal test file:
>>
>> * test
>> DEADLINE: <2024-08-02 Fri> SCHEDULED: <2024-07-29 Mon +1d>
>>
>> After M-x org-cancel-repeater, repeater is still there:
>>
>> * test
>> DEADLINE: <2024-08-02 Fri> SCHEDULED: <2024-07-29 Mon +1d>
>
> Confirmed.
>
> That's true, but I am not sure if it is a bug or just an inaccuracy in
> the documentation. The accurate documentation of what
> `org-cancel-repeater' does is:
>
> Cancel a repeater in the first active timestamp in the heading by setting
> its numeric value to zero.
> If there is no repeater in the first timestamp, do nothing.
>
> So, it just removes a repeater in the first timestamp.
>
> On the other hand, looking into git history, I see that the reason why
> this function was originally introduced (in 1eb03c8c87) is to prevent
> `org-todo' from switching an item marked DONE back to TODO when there
> are _any_ (`org-get-repeat') repeaters inside heading. So, it will
> follow the original intention to change the function to nullify _all_
> the repeaters, not just the one in the first timestamp.
>
> What I am leaning to is to change `org-cancel-repeater' to work on all
> the _active_ timestamps inside the heading and introduce an optional
> prefix argument to only change first timestamp with non-zero repeater.
> WDYT?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
next prev parent reply other threads:[~2024-08-04 19:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 2:48 [BUG] org-cancel-repeater fails depending on position of repeater [9.6.15 (release_9.6.15 @ /opt/homebrew/Cellar/emacs-plus@29/29.4/share/emacs/29.4/lisp/org/)] solodov
2024-08-04 18:05 ` Ihor Radchenko
2024-08-04 19:41 ` Peter Solodov [this message]
2024-08-06 8:24 ` Ihor Radchenko
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='CAMWT7xBNO=58-Q9=gweu7Qq5FqUfHHCJ=pdkBZCQ3esUiKO34A@mail.gmail.com' \
--to=solodov@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=yantar92@posteo.net \
/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).