emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: solodov@gmail.com
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, 04 Aug 2024 18:05:15 +0000	[thread overview]
Message-ID: <87r0b4duzo.fsf@localhost> (raw)
In-Reply-To: <CAMWT7xCnOV+vq2xBhbF7Lc9X1+U0-iE3Y8oUTE-VH-WgHyHY_Q@mail.gmail.com>

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>


  reply	other threads:[~2024-08-04 18:09 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 [this message]
2024-08-04 19:41   ` Peter Solodov
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=87r0b4duzo.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=solodov@gmail.com \
    /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).