emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: spookygostee@gmail.com
To: emacs-orgmode@gnu.org
Subject: [BUG] Bulk scattering breaks when logging rescheduling [9.7 (9.7-??-6eb773053 @ /home/shortcut/.emacs.d/.local/straight/build-28.1/org/)]
Date: Tue, 22 Aug 2023 14:05:10 -0500	[thread overview]
Message-ID: <87a5ui6gkj.fsf@gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2086 bytes --]

Bulk scattering agenda items when the user wants to log reschedules does not work. 

Steps to reproduce: 
1. Set `org-log-reschedule' to the value `"time"'

   Alternatively, customize “Org Log Reschedule” to “Record timestamp with note”.

2. Add an org mode file with the following contents to the agenda file list
   ┌────
   │     Testing scatter 1
   │     SCHEDULED: <2023-08-22 Tue>
   │     Testing scatter 2
   │     SCHEDULED: <2023-08-22 Tue>
   │     Testing scatter 3
   │     SCHEDULED: <2023-08-22 Tue>
   └────
   (As in previous reports, I can’t paste these as actual headings. Their structure is irrelevant.)

3. Mark all of previous headings for bulk action in the agenda

4. Bulk scatter the marked headings (`B S', by default)

5. Fill out the prompted note with anything and hit `C-c C-c' to finish

You will note Emacs reports that only `Testing scatter 1' has been rescheduled, has a note, and all headings remain marked. Emacs will also /not/ prompt you for notes for the other headings or reschedule them- the process terminates here. This issue does not occur when `org-log-reschedule' is set to its default value: “No logging”.

The expected behavior is that either Emacs will prompt me for more notes for the remaining headings, or at the very least will scatter them.

I have written and attached a rudimentary patch which “solves” this problem by storing `org-log-reschedule'’s value, scattering with “No logging” set, and then restoring it. I think it is up for debate whether or not the logging behavior in the case of a bulk scatter should respect the user’s settings, or prompt just once at the beginning for a note (copying it to all subsequent scattered headlines), or if it should be ignored entirely (as in my patch).


Emacs  : GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
 of 2022-05-31
Package: Org mode version 9.7 (9.7-??-6eb773053 @ /home/shortcut/.emacs.d/.local/straight/build-28.1/org/)

-/shortcut/

[-- Attachment #1.2: Type: text/html, Size: 7051 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-On-main-fixing-bulk-scattering.patch --]
[-- Type: text/x-diff, Size: 837 bytes --]

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index bafd8b7f8..609d59a4c 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -11201,8 +11201,12 @@ The prefix arg is passed through to the command if possible."
 		       (let* ((date (calendar-gregorian-from-absolute
 				     (+ (org-today) distance)))
 			      (time (org-encode-time
-                                     0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
-			 (org-agenda-schedule nil time))))))))
+                                     0 0 0 (nth 1 date) (nth 0 date) (nth 2 date)))
+                              (log-state org-log-reschedule))
+                         (setq org-log-reschedule nil)
+			 (org-agenda-schedule nil time)
+                         (setq org-log-reschedule log-state)
+                         )))))))
 
 	(?f
 	 (setq cmd

             reply	other threads:[~2023-08-22 19:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 19:05 spookygostee [this message]
2023-08-23  9:01 ` [BUG] Bulk scattering breaks when logging rescheduling [9.7 (9.7-??-6eb773053 @ /home/shortcut/.emacs.d/.local/straight/build-28.1/org/)] 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=87a5ui6gkj.fsf@gmail.com \
    --to=spookygostee@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).