emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org Agenda Error
@ 2022-06-12 15:48 Michael Powe
  2022-06-12 17:46 ` Bhavin Gandhi
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Powe @ 2022-06-12 15:48 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 927 bytes --]

Hello,

Not sure if this qualifies as a bug.

This occurred when discarding an agenda item that was more than 60 days 
overdue. (The repeater is 6 days.) I imagine most people take better 
care of their agenda. ;-)

TODO state changed to DISCARDED
TODO state changed to TODO
[MP] Error in post-command-hook (org-add-log-note): (error "Can’t expand 
minibuffer to full frame")
[MP] 10 repeater intervals were not enough to shift date past today.  
Continue? (y or n) y
Entry repeats: SCHEDULED: <2022-06-16 Thu ++6d>

The two items I initialed travel together. I got this message several times.

* Org mode version 9.5.4 (release_9.5.4-535-ged6f8d.dirty @ 
c:/Users/micha/AppData/Roaming/.emacs.d/org-new/org-mode/lisp/)

* GNU Emacs 29.0.50 (build 2, x86_64-w64-mingw32) of 2022-06-09

Thanks.

mp

-- 
"Do not neglect to do good, and to share what you have." - Hebrews 13:16a
Michael Powe
Naugatuck CT USA
powem@ctpowe.net

[-- Attachment #2: Type: text/html, Size: 1437 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Org Agenda Error
  2022-06-12 15:48 Org Agenda Error Michael Powe
@ 2022-06-12 17:46 ` Bhavin Gandhi
  2022-06-13  3:29   ` Michael Powe
  2022-06-13 17:31   ` Bhavin Gandhi
  0 siblings, 2 replies; 5+ messages in thread
From: Bhavin Gandhi @ 2022-06-12 17:46 UTC (permalink / raw)
  To: Michael Powe; +Cc: emacs-orgmode

Hello Michael

On Sun, 12 Jun 2022 at 21:20, Michael Powe <powem@ctpowe.net> wrote:
> [MP] Error in post-command-hook (org-add-log-note): (error "Can’t expand minibuffer to full frame")
> [MP] 10 repeater intervals were not enough to shift date past today.  Continue? (y or n) y

I have been seeing these with my repeating tasks recently, and took this
bug report as an opportunity to see if I can reproduce it with emacs -Q.

1. emacs -Q
2. Create test.org with following content

* TODO Repeating entry
SCHEDULED: <2022-05-01 Mon ++2d>

3. C-c C-t on the entry, shows the above error. And shifts the scheduled
   date correctly.

This happens on the Org mode version bundled with Emacs 28.1
i.e. release_9.5.2-25-gaf6f12.
And with latest main: release_9.5.4-544-gae168d

--
Bhavin Gandhi (bhavin192) | https://geeksocket.in


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Org Agenda Error
  2022-06-12 17:46 ` Bhavin Gandhi
@ 2022-06-13  3:29   ` Michael Powe
  2022-06-13 17:31   ` Bhavin Gandhi
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Powe @ 2022-06-13  3:29 UTC (permalink / raw)
  To: Bhavin Gandhi; +Cc: emacs-orgmode

hello,

Thank you for the followup. Yes, I should have mentioned that the date 
is correctly updated following the error. Very odd, considering the text 
of the error message.

Thanks.

mp

On 6/12/2022 13:46, Bhavin Gandhi wrote:
> Hello Michael
>
> On Sun, 12 Jun 2022 at 21:20, Michael Powe <powem@ctpowe.net> wrote:
>> [MP] Error in post-command-hook (org-add-log-note): (error "Can’t expand minibuffer to full frame")
>> [MP] 10 repeater intervals were not enough to shift date past today.  Continue? (y or n) y
> I have been seeing these with my repeating tasks recently, and took this
> bug report as an opportunity to see if I can reproduce it with emacs -Q.
>
> 1. emacs -Q
> 2. Create test.org with following content
>
> * TODO Repeating entry
> SCHEDULED: <2022-05-01 Mon ++2d>
>
> 3. C-c C-t on the entry, shows the above error. And shifts the scheduled
>     date correctly.
>
> This happens on the Org mode version bundled with Emacs 28.1
> i.e. release_9.5.2-25-gaf6f12.
> And with latest main: release_9.5.4-544-gae168d
>
> --
> Bhavin Gandhi (bhavin192) | https://geeksocket.in

-- 
"Do not neglect to do good, and to share what you have." - Hebrews 13:16a
Michael Powe
Naugatuck CT USA
powem@ctpowe.net



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Org Agenda Error
  2022-06-12 17:46 ` Bhavin Gandhi
  2022-06-13  3:29   ` Michael Powe
@ 2022-06-13 17:31   ` Bhavin Gandhi
  2022-06-18 18:00     ` [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note Bhavin Gandhi
  1 sibling, 1 reply; 5+ messages in thread
From: Bhavin Gandhi @ 2022-06-13 17:31 UTC (permalink / raw)
  To: Michael Powe; +Cc: emacs-orgmode

On Sun, 12 Jun 2022 at 23:16, Bhavin Gandhi <bhavin7392@gmail.com> wrote:
> 1. emacs -Q
> 2. Create test.org with following content
>
> * TODO Repeating entry
> SCHEDULED: <2022-05-01 Mon ++2d>
>
> 3. C-c C-t on the entry, shows the above error. And shifts the scheduled
>    date correctly.

When this error appears, the log note entry about state change is not
added. I found this issue for the first time when I saw the state
change log notes were missing.

If I do C-c C-t again on the same entry, we get the note.
- State "DONE"       from "TODO"       [2022-06-13 Mon 22:48]

This is missing when we hit the error mentioned in the first mail.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note
  2022-06-13 17:31   ` Bhavin Gandhi
@ 2022-06-18 18:00     ` Bhavin Gandhi
  0 siblings, 0 replies; 5+ messages in thread
From: Bhavin Gandhi @ 2022-06-18 18:00 UTC (permalink / raw)
  To: Michael Powe; +Cc: emacs-orgmode

On Mon, 13 Jun 2022 at 23:01, Bhavin Gandhi <bhavin7392@gmail.com> wrote:
> > 1. emacs -Q
> > 2. Create test.org with following content
> >
> > * TODO Repeating entry
> > SCHEDULED: <2022-05-01 Mon ++2d>
> >
> > 3. C-c C-t on the entry, shows the above error. And shifts the scheduled
> >    date correctly.
>
> When this error appears, the log note entry about state change is not
> added. I found this issue for the first time when I saw the state
> change log notes were missing.
>
> If I do C-c C-t again on the same entry, we get the note.
> - State "DONE"       from "TODO"       [2022-06-13 Mon 22:48]
>
> This is missing when we hit the error mentioned in the first mail.

Confirmed.
Trying to change the subject for Woof! for the first time, I hope I get
it right.

I remember reading this code around a year back, where we were fixing
two bugs.
1. Bug: Duplicate logbook entry for repeated tasks:
   https://list.orgmode.org/orgmode/CAOn=hbcaW1R6vtun-E2r4LS=j3dp=VjqmjGtzy8UC1SyPArKbA@mail.gmail.com/
2. Bug: org-agenda-undo does not work with repeated tasks [9.4]:
   https://list.orgmode.org/87v98a8mes.fsf@gnu.org/

Currently, when we call `org-auto-repeat-maybe', it adds
`org-add-log-note' to post-command-hook using `org-add-log-setup'. As
soon as we reach the question about 10 repeater intervals (the call to
`y-or-n-p' from `org-auto-repeat-maybe'), the post-command-hook gets
executed.[1]

So, we end up calling `delete-other-windows' while we are waiting for
the user to respond with y/n. And this causes error "Can’t expand
minibuffer to full frame".

I don't know how to fix this issue yet, but I'm planning to add a test
case for completing repeating tasks which need 10+ repeating intervals
to shift the date.

Maybe this is off-topic:
I'm not sure why [1] happens, my assumption was Emacs will wait till all
the functions finish executing, and then run the post-command-hooks.
this-command remains org-todo (C-c C-t) throughout all the other calls
done by org-todo as long as they are not commands
i.e. org-auto-repeat-maybe etc. So, I tried following snippet:

(defun my-test-command ()
  (interactive)
  (message "my-test-command: setting post-command-hook")
  (add-hook 'post-command-hook 'my-own-hook)
  (y-or-n-p "Some question: ")
  (message "my-test-command: message after setting the hook")
)
(defun my-own-hook ()
  (remove-hook 'post-command-hook 'my-own-hook)
  (message "my-own-hook: hopefully executing at the end")
)

In this case as well, as soon as it calls y-or-n-p, I can see
"my-own-hook: hopefully executing at the end" in the minibuffer (while
it is still waiting for user input). Is it expected? I read (info
"(elisp)Command Overview") but couldn't understand this behavior.

-- 
Bhavin Gandhi (bhavin192) | https://geeksocket.in


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-18 18:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-12 15:48 Org Agenda Error Michael Powe
2022-06-12 17:46 ` Bhavin Gandhi
2022-06-13  3:29   ` Michael Powe
2022-06-13 17:31   ` Bhavin Gandhi
2022-06-18 18:00     ` [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note Bhavin Gandhi

Code repositories for project(s) associated with this 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).