From f5f787cf51a2e11a3764aba1d0fd085b4d6371c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20A=2E=20Gomes?= Date: Thu, 7 Oct 2021 16:15:20 +0300 Subject: [PATCH 09/76] Deprecate org-agenda-headline-snapshot-before-repeat. --- lisp/org-agenda.el | 10 +++++----- lisp/org-compat.el | 2 ++ lisp/org.el | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 553b2d454..119fd0b7b 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -9423,7 +9423,7 @@ by a remote command from the agenda.") (interactive) (org-agenda-todo 'previousset)) -(defvar org-agenda-headline-snapshot-before-repeat) +(defvar org-agenda-heading-snapshot-before-repeat) (defun org-agenda-todo (&optional arg) "Cycle TODO state of line at point, also in Org file. @@ -9442,7 +9442,7 @@ the same tree node, and the heading of the tree node in the Org file." (todayp (org-agenda-today-p (org-get-at-bol 'day))) (inhibit-read-only t) org-loop-over-headlines-in-active-region - org-agenda-headline-snapshot-before-repeat newhead just-one) + org-agenda-heading-snapshot-before-repeat newhead just-one) (org-with-remote-undo buffer (with-current-buffer buffer (widen) @@ -9456,11 +9456,11 @@ the same tree node, and the heading of the tree node in the Org file." (org-add-log-note))) (and (bolp) (forward-char 1)) (setq newhead (org-get-heading)) - (when (and org-agenda-headline-snapshot-before-repeat - (not (equal org-agenda-headline-snapshot-before-repeat + (when (and org-agenda-heading-snapshot-before-repeat + (not (equal org-agenda-heading-snapshot-before-repeat newhead)) todayp) - (setq newhead org-agenda-headline-snapshot-before-repeat + (setq newhead org-agenda-heading-snapshot-before-repeat just-one t)) (save-excursion (org-back-to-heading) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index c825a187e..77d9a06a7 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -326,6 +326,8 @@ Counting starts at 1." 'org-agenda-filter-top-heading-apply "9.5") (define-obsolete-variable-alias 'org-agenda-filtered-by-top-headline 'org-agenda-filtered-by-top-heading "9.5") +(define-obsolete-variable-alias 'org-agenda-headline-snapshot-before-repeat + 'org-agenda-heading-snapshot-before-repeat "9.5") (defun org-in-fixed-width-region-p () "Non-nil if point in a fixed-width region." diff --git a/lisp/org.el b/lisp/org.el index 197fc7e59..b41986246 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9650,7 +9650,7 @@ transformed into canonical form." ) Each function takes arguments (NEW-MARK OLD-MARK) and returns either nil or a string to be used for the todo mark." ) -(defvar org-agenda-headline-snapshot-before-repeat) +(defvar org-agenda-heading-snapshot-before-repeat) (defun org-current-effective-time () "Return current time adjusted for `org-extend-today-until' variable." @@ -9918,10 +9918,10 @@ When called through ELisp, arg is also interpreted in the following way: (put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head) ;; Do we need to trigger a repeat? (when now-done-p - (when (boundp 'org-agenda-headline-snapshot-before-repeat) + (when (boundp 'org-agenda-heading-snapshot-before-repeat) ;; This is for the agenda, take a snapshot of the heading. (save-match-data - (setq org-agenda-headline-snapshot-before-repeat + (setq org-agenda-heading-snapshot-before-repeat (org-get-heading)))) (org-auto-repeat-maybe org-state)) ;; Fixup cursor location if close to the keyword. -- 2.33.0