* Org Agenda Error @ 2022-06-12 15:48 Michael Powe 2022-06-12 17:46 ` Bhavin Gandhi 0 siblings, 1 reply; 19+ 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] 19+ 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; 19+ 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] 19+ 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; 19+ 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] 19+ 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; 19+ 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] 19+ 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 2022-07-01 2:14 ` Ihor Radchenko 0 siblings, 1 reply; 19+ 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] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-06-18 18:00 ` [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note Bhavin Gandhi @ 2022-07-01 2:14 ` Ihor Radchenko 2022-07-03 17:10 ` Bhavin Gandhi 0 siblings, 1 reply; 19+ messages in thread From: Ihor Radchenko @ 2022-07-01 2:14 UTC (permalink / raw) To: Bhavin Gandhi; +Cc: Michael Powe, emacs-orgmode Bhavin Gandhi <bhavin7392@gmail.com> writes: > 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] Bhavin, did you have a chance to send a bug report on this to Emacs devs? Best, Ihor ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-07-01 2:14 ` Ihor Radchenko @ 2022-07-03 17:10 ` Bhavin Gandhi 2022-07-04 12:03 ` Ihor Radchenko 0 siblings, 1 reply; 19+ messages in thread From: Bhavin Gandhi @ 2022-07-03 17:10 UTC (permalink / raw) To: Ihor Radchenko; +Cc: emacs-orgmode On Fri, 1 Jul 2022 at 07:43, Ihor Radchenko <yantar92@gmail.com> wrote: > > 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] > > Bhavin, did you have a chance to send a bug report on this to Emacs > devs? Haven't done that yet. But it seems like we will have to find a fix to make sure `delete-other-windows' is not called for the minibuffer. My modified example: (defvar my-hook-counter) (defun my-test-command () (interactive) (message "my-test-command: setting post-command-hook") (setq my-hook-counter 3) (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 () (print (format "hook: this: %s, real: %s, last: %s" this-command real-this-command last-command)) (message "my-own-hook: hopefully executing at the end") (setq my-hook-counter (- my-hook-counter 1)) (if (eq my-hook-counter 0) (remove-hook 'post-command-hook 'my-own-hook)) ) While looking at the *Messages* buffer, I came across the command y-or-n-p-insert-y. There are commands for n, and other keys. When we press y, M-p etc, these commands get executed. So, even if we manage to fix the initial example in Emacs, the hook will still run while one is in the minibuffer. -- Bhavin Gandhi (bhavin192) | https://geeksocket.in ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-07-03 17:10 ` Bhavin Gandhi @ 2022-07-04 12:03 ` Ihor Radchenko 2022-07-10 17:23 ` Bhavin Gandhi 0 siblings, 1 reply; 19+ messages in thread From: Ihor Radchenko @ 2022-07-04 12:03 UTC (permalink / raw) To: Bhavin Gandhi; +Cc: emacs-orgmode Bhavin Gandhi <bhavin7392@gmail.com> writes: > While looking at the *Messages* buffer, I came across the command > y-or-n-p-insert-y. There are commands for n, and other keys. When we > press y, M-p etc, these commands get executed. So, even if we manage to > fix the initial example in Emacs, the hook will still run while one is > in the minibuffer. This explains the observed behavior. A possible fix could be let-binding post-command-hook to (delq #'org-add-log-note post-command-hook), though we may get a similar issue in other context in future. A better fix may relate to the fact that org-add-log-setup is usually used to run org-add-log-note at the end of current command. y-or-n-p or any other kind of command (e.g. added via advice) will break this assumption we use. So, org-add-log-setup could also store `this-command', say, in `org-log-note-this-command' and `org-add-log-note' can then execute only when `this-command' is the same with `org-log-note-this-command'. WDYT? Best, Ihor ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-07-04 12:03 ` Ihor Radchenko @ 2022-07-10 17:23 ` Bhavin Gandhi 2022-07-11 1:57 ` Ihor Radchenko 0 siblings, 1 reply; 19+ messages in thread From: Bhavin Gandhi @ 2022-07-10 17:23 UTC (permalink / raw) To: Ihor Radchenko; +Cc: emacs-orgmode On Mon, 4 Jul 2022 at 17:32, Ihor Radchenko <yantar92@gmail.com> wrote: > > While looking at the *Messages* buffer, I came across the command > > y-or-n-p-insert-y. There are commands for n, and other keys. When we > > press y, M-p etc, these commands get executed. So, even if we manage to > > fix the initial example in Emacs, the hook will still run while one is > > in the minibuffer. > > This explains the observed behavior. Apart from these commands triggering the post-command-hook, there is one additional time it gets executed. This is the place when y-or-n-p calls read-from-minibuffer. When read-from-minibuffer executes, this-command remains my-test-command. > A possible fix could be let-binding post-command-hook to > (delq #'org-add-log-note post-command-hook), though we may get a similar > issue in other context in future. > > A better fix may relate to the fact that org-add-log-setup is usually > used to run org-add-log-note at the end of current command. y-or-n-p or > any other kind of command (e.g. added via advice) will break this > assumption we use. So, org-add-log-setup could also store > `this-command', say, in `org-log-note-this-command' and > `org-add-log-note' can then execute only when `this-command' is the same > with `org-log-note-this-command'. WDYT? I had something similar in my mind, something like we check if this-command is org-* (not very robust). Your idea makes sense to me. But this won't work when read-from-minibuffer is called as it doesn't seem to change this-command when it runs. I had created an Emacs bug report: https://debbugs.gnu.org/56425 -- Bhavin Gandhi (bhavin192) | https://geeksocket.in ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-07-10 17:23 ` Bhavin Gandhi @ 2022-07-11 1:57 ` Ihor Radchenko 2022-07-14 15:22 ` Bhavin Gandhi 0 siblings, 1 reply; 19+ messages in thread From: Ihor Radchenko @ 2022-07-11 1:57 UTC (permalink / raw) To: Bhavin Gandhi; +Cc: emacs-orgmode Bhavin Gandhi <bhavin7392@gmail.com> writes: >> A better fix may relate to the fact that org-add-log-setup is usually >> used to run org-add-log-note at the end of current command. y-or-n-p or >> any other kind of command (e.g. added via advice) will break this >> assumption we use. So, org-add-log-setup could also store >> `this-command', say, in `org-log-note-this-command' and >> `org-add-log-note' can then execute only when `this-command' is the same >> with `org-log-note-this-command'. WDYT? > > I had something similar in my mind, something like we check if > this-command is org-* (not very robust). Your idea makes sense to > me. But this won't work when read-from-minibuffer is called as it > doesn't seem to change this-command when it runs. Then, we will also need to save (recursion-depth) value and check for it in addition to this-command. Best, Ihor ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-07-11 1:57 ` Ihor Radchenko @ 2022-07-14 15:22 ` Bhavin Gandhi 2022-07-16 9:21 ` Ihor Radchenko 0 siblings, 1 reply; 19+ messages in thread From: Bhavin Gandhi @ 2022-07-14 15:22 UTC (permalink / raw) To: Ihor Radchenko; +Cc: emacs-orgmode On Mon, 11 Jul 2022 at 07:26, Ihor Radchenko <yantar92@gmail.com> wrote: > > Bhavin Gandhi <bhavin7392@gmail.com> writes: > > >> A better fix may relate to the fact that org-add-log-setup is usually > >> used to run org-add-log-note at the end of current command. y-or-n-p or > >> any other kind of command (e.g. added via advice) will break this > >> assumption we use. So, org-add-log-setup could also store > >> `this-command', say, in `org-log-note-this-command' and > >> `org-add-log-note' can then execute only when `this-command' is the same > >> with `org-log-note-this-command'. WDYT? > > > > I had something similar in my mind, something like we check if > > this-command is org-* (not very robust). Your idea makes sense to > > me. But this won't work when read-from-minibuffer is called as it > > doesn't seem to change this-command when it runs. > > Then, we will also need to save (recursion-depth) value and check for it > in addition to this-command. Thanks for the idea, I'm exploring (recursion-depth), (minibuffer-depth). I will come up with a patch to fix this bug. Seems like soon I will cross the TINYCHANGE limit, so I will get the FSF copyright assignment done. -- Bhavin Gandhi (bhavin192) | https://geeksocket.in ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-07-14 15:22 ` Bhavin Gandhi @ 2022-07-16 9:21 ` Ihor Radchenko 2022-07-21 18:03 ` Bhavin Gandhi 0 siblings, 1 reply; 19+ messages in thread From: Ihor Radchenko @ 2022-07-16 9:21 UTC (permalink / raw) To: Bhavin Gandhi; +Cc: emacs-orgmode Bhavin Gandhi <bhavin7392@gmail.com> writes: > Seems like soon I will cross the TINYCHANGE limit, so I will get the > FSF copyright assignment done. Note that FSF should reply within 5 working days. If not, we can help you to push them. Best, Ihor ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-07-16 9:21 ` Ihor Radchenko @ 2022-07-21 18:03 ` Bhavin Gandhi 2022-07-26 11:49 ` Ihor Radchenko 0 siblings, 1 reply; 19+ messages in thread From: Bhavin Gandhi @ 2022-07-21 18:03 UTC (permalink / raw) To: Ihor Radchenko; +Cc: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 1752 bytes --] On Sat, 16 Jul 2022 at 14:50, Ihor Radchenko <yantar92@gmail.com> wrote: > > Seems like soon I will cross the TINYCHANGE limit, so I will get the > > FSF copyright assignment done. > > Note that FSF should reply within 5 working days. If not, we can help > you to push them. Thanks! I received the PDF to sign the next day after my email, this will probably take a couple of days more from my side as I'm talking with my employer. > Thanks for the idea, I'm exploring (recursion-depth), > (minibuffer-depth). I will come up with a patch to fix this bug. So, I saved this-command and (recursion-depth) value, and I'm checking for it in the org-add-log-note (attaching diff of my changes). But this doesn't guarantee that we are not in the minibuffer when the post-command-hook runs. This is what I did, and it failed after answering the question about 10 repeated intervals: 1. M-: (y-or-n-p "Some question") 2. Now I switched to Org mode buffer. 3. Did C-c C-t on the entry. When org-log-add-setup runs, (recursion-depth) is 1, and (minibuffer-depth) is also 1. Now, the question about 10 repeated intervals is asked, once I answer it, post-command-hook runs. And it runs while we are in the minibuffer waiting for 'Some question'. So, I changed the second condition to (= (minibuffer-depth) 0). This has a different effect when org-todo finishes the execution and we are still in minibuffer: this-command won't be org-todo again unless it is invoked again by the user. org-add-log-note post-command-hook is never removed, and it keeps executing as the condition is not fulfilled. I'm going through the code of org-add-log-note to see if we can avoid calling (delete-other-windows) in the minibuffer. Or move out of minibuffer and then proceed. [-- Attachment #2: org-add-log-note-minibuffer.diff --] [-- Type: text/x-patch, Size: 1433 bytes --] diff --git a/lisp/org.el b/lisp/org.el index 3d4de5b4f..978850199 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10146,6 +10146,8 @@ EXTRA is additional text that will be inserted into the notes buffer." org-log-note-how how org-log-note-extra extra org-log-note-effective-time (org-current-effective-time) + org-log-note-this-command this-command + org-log-note-recursion-depth (recursion-depth) org-log-setup t) (add-hook 'post-command-hook 'org-add-log-note 'append)) @@ -10174,6 +10176,8 @@ EXTRA is additional text that will be inserted into the notes buffer." (defun org-add-log-note (&optional _purpose) "Pop up a window for taking a note, and add this note later." + (when (and (equal org-log-note-this-command this-command) + (= org-log-note-recursion-depth (recursion-depth))) (remove-hook 'post-command-hook 'org-add-log-note) (setq org-log-setup nil) (setq org-log-note-window-configuration (current-window-configuration)) @@ -10204,7 +10208,7 @@ EXTRA is additional text that will be inserted into the notes buffer." (t (error "This should not happen"))))) (when org-log-note-extra (insert org-log-note-extra)) (setq-local org-finish-function 'org-store-log-note) - (run-hooks 'org-log-buffer-setup-hook))) + (run-hooks 'org-log-buffer-setup-hook)))) (defvar org-note-abort nil) ; dynamically scoped (defun org-store-log-note () ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-07-21 18:03 ` Bhavin Gandhi @ 2022-07-26 11:49 ` Ihor Radchenko 2022-08-16 18:17 ` Bhavin Gandhi 0 siblings, 1 reply; 19+ messages in thread From: Ihor Radchenko @ 2022-07-26 11:49 UTC (permalink / raw) To: Bhavin Gandhi; +Cc: emacs-orgmode Bhavin Gandhi <bhavin7392@gmail.com> writes: >> Thanks for the idea, I'm exploring (recursion-depth), >> (minibuffer-depth). I will come up with a patch to fix this bug. > > So, I saved this-command and (recursion-depth) value, and I'm checking > for it in the org-add-log-note (attaching diff of my changes). But this > doesn't guarantee that we are not in the minibuffer when the > post-command-hook runs. > > This is what I did, and it failed after answering the question about 10 > repeated intervals: > 1. M-: (y-or-n-p "Some question") > 2. Now I switched to Org mode buffer. > 3. Did C-c C-t on the entry. > > When org-log-add-setup runs, (recursion-depth) is 1, and > (minibuffer-depth) is also 1. > Now, the question about 10 repeated intervals is asked, once I answer > it, post-command-hook runs. And it runs while we are in the minibuffer > waiting for 'Some question'. Yikes! Then, can also check for window-minibuffer-p, but I feel that it will be a fight against all kinds of edge cases. > So, I changed the second condition to (= (minibuffer-depth) 0). > This has a different effect when org-todo finishes the execution and we > are still in minibuffer: > this-command won't be org-todo again unless it is invoked again by the > user. org-add-log-note post-command-hook is never removed, and it keeps > executing as the condition is not fulfilled. > > I'm going through the code of org-add-log-note to see if we can avoid > calling (delete-other-windows) in the minibuffer. Or move out of minibuffer > and then proceed. what about (when (or (and (equal org-log-note-this-command this-command) (= org-log-note-recursion-depth (recursion-depth))) (> org-log-note-recursion-depth (recursion-depth))) Best, Ihor ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-07-26 11:49 ` Ihor Radchenko @ 2022-08-16 18:17 ` Bhavin Gandhi 2022-08-17 9:45 ` Ihor Radchenko 0 siblings, 1 reply; 19+ messages in thread From: Bhavin Gandhi @ 2022-08-16 18:17 UTC (permalink / raw) To: Ihor Radchenko; +Cc: emacs-orgmode On Thu, 21 Jul 2022 at 23:33, Bhavin Gandhi <bhavin7392@gmail.com> wrote: > > On Sat, 16 Jul 2022 at 14:50, Ihor Radchenko <yantar92@gmail.com> wrote: > > > Seems like soon I will cross the TINYCHANGE limit, so I will get the > > > FSF copyright assignment done. > > > > Note that FSF should reply within 5 working days. If not, we can help > > you to push them. > > Thanks! I received the PDF to sign the next day after my email, this > will probably take a couple of days more from my side as I'm talking > with my employer. I finally got this done. I now have a fully executed copy of the copyright assignment (signed by FSF and me). Do I need to send it to someone so that they can check and update the page at https://orgmode.org/worg/contributors.html ? On Tue, 26 Jul 2022 at 17:18, Ihor Radchenko <yantar92@gmail.com> wrote: > > > > So, I saved this-command and (recursion-depth) value, and I'm checking > > for it in the org-add-log-note (attaching diff of my changes). But this > > doesn't guarantee that we are not in the minibuffer when the > > post-command-hook runs. > > > > This is what I did, and it failed after answering the question about 10 > > repeated intervals: > > 1. M-: (y-or-n-p "Some question") > > 2. Now I switched to Org mode buffer. > > 3. Did C-c C-t on the entry. > > > > When org-log-add-setup runs, (recursion-depth) is 1, and > > (minibuffer-depth) is also 1. > > Now, the question about 10 repeated intervals is asked, once I answer > > it, post-command-hook runs. And it runs while we are in the minibuffer > > waiting for 'Some question'. > > Yikes! Then, can also check for window-minibuffer-p, but I feel that it > will be a fight against all kinds of edge cases. I haven't been able to make much progress on this bug in the last two weeks. Will try to send a patch in a few days, as the steps I gave above feels like an edge case which we won't see happening hopefully. -- Bhavin Gandhi (bhavin192) | https://geeksocket.in ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-08-16 18:17 ` Bhavin Gandhi @ 2022-08-17 9:45 ` Ihor Radchenko 2022-09-01 9:48 ` Bastien Guerry 2022-09-25 18:16 ` Bhavin Gandhi 0 siblings, 2 replies; 19+ messages in thread From: Ihor Radchenko @ 2022-08-17 9:45 UTC (permalink / raw) To: Bhavin Gandhi, Bastien; +Cc: emacs-orgmode Bhavin Gandhi <bhavin7392@gmail.com> writes: >> Thanks! I received the PDF to sign the next day after my email, this >> will probably take a couple of days more from my side as I'm talking >> with my employer. > > I finally got this done. I now have a fully executed copy of the copyright > assignment (signed by FSF and me). Do I need to send it to someone so > that they can check and update the page at > https://orgmode.org/worg/contributors.html ? You do not need to share the paperwork with us. FSF has a database available to GNU maintainers with a list of all the people with copyright assignment. I am CCing Bastien. Bastien, can you please confirm that Bhavin's paperwork is registered and add him to the contributor list? >> Yikes! Then, can also check for window-minibuffer-p, but I feel that it >> will be a fight against all kinds of edge cases. > > I haven't been able to make much progress on this bug in the last two > weeks. Will try to send a patch in a few days, as the steps I gave above > feels like an edge case which we won't see happening hopefully. Your patch will be already an improvement. I guess that the proper fix of this type of issues would be rewriting the note system in such a way that it uses recursive editing. Then, we can make the user write the note in the middle of a running command and not worry about post-command-hook quirks. But that will be a much more involved change. -- Ihor Radchenko, 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 ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-08-17 9:45 ` Ihor Radchenko @ 2022-09-01 9:48 ` Bastien Guerry 2022-09-25 18:16 ` Bhavin Gandhi 1 sibling, 0 replies; 19+ messages in thread From: Bastien Guerry @ 2022-09-01 9:48 UTC (permalink / raw) To: Ihor Radchenko; +Cc: Bhavin Gandhi, emacs-orgmode Hi, sorry for the late answer. Ihor Radchenko <yantar92@gmail.com> writes: > You do not need to share the paperwork with us. FSF has a database > available to GNU maintainers with a list of all the people with > copyright assignment. > > I am CCing Bastien. > Bastien, can you please confirm that Bhavin's paperwork is > registered Yes he is. > and add him to the contributor list? Done. Thanks Bhavin for contributing! -- Bastien ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-08-17 9:45 ` Ihor Radchenko 2022-09-01 9:48 ` Bastien Guerry @ 2022-09-25 18:16 ` Bhavin Gandhi 2022-09-26 12:46 ` Ihor Radchenko 1 sibling, 1 reply; 19+ messages in thread From: Bhavin Gandhi @ 2022-09-25 18:16 UTC (permalink / raw) To: Ihor Radchenko; +Cc: emacs-orgmode, powem [-- Attachment #1: Type: text/plain, Size: 905 bytes --] On Wed, 17 Aug 2022 at 15:14, Ihor Radchenko <yantar92@gmail.com> wrote: > >> Yikes! Then, can also check for window-minibuffer-p, but I feel that it > >> will be a fight against all kinds of edge cases. > > > > I haven't been able to make much progress on this bug in the last two > > weeks. Will try to send a patch in a few days, as the steps I gave above > > feels like an edge case which we won't see happening hopefully. > > Your patch will be already an improvement. I'm attaching the patch for the current approach we discussed in this thread. I have tried basic operations like taking note on state change, and have tried with recurring entries which need more than 10 cycles to be marked as done (original bug report). As I was changing the indentation of code from org-add-log-note, I converted some tabs to spaces, is it okay to do so? -- Bhavin Gandhi (bhavin192) | https://geeksocket.in [-- Attachment #2: 0001-org.el-Make-sure-org-add-log-note-runs-at-the-end-of.patch --] [-- Type: text/x-patch, Size: 5136 bytes --] From afb1158d9a360020f093436228cdf4e689474db8 Mon Sep 17 00:00:00 2001 From: Bhavin Gandhi <bhavin192@geeksocket.in> Date: Sun, 25 Sep 2022 22:06:53 +0530 Subject: [PATCH] org.el: Make sure `org-add-log-note' runs at the end of Org command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org.el (org-add-log-setup): Save `this-command' and `recursion-depth' before adding the `org-add-log-note'to post-command-hook. (org-add-log-note): Execute only if the current `(recursion-depth)' and `this-command' are same as the ones we saved during the log-setup. This change tries to make sure that we run the `org-add-log-note' only after the current Org command has finished executing. Previously, the post-command-hook was getting triggered if the Org command in turn runs some other command. Fixes the bug originally reported by Michael Powe. Bhavin Gandhi. [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note. Sat, 18 Jun 2022 23:30:50 +0530. https://list.orgmode.org/CAOn=hbcsOCO++We0XgRHFoxxCEXROCpyGd1nCjzKYy-9LckQZg@mail.gmail.com/ Relevant discussion on bug-gnu-emacs: https://debbugs.gnu.org/56425 --- lisp/org.el | 64 ++++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index b63aaed4f..ba20df59f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10355,6 +10355,8 @@ EXTRA is additional text that will be inserted into the notes buffer." org-log-note-how how org-log-note-extra extra org-log-note-effective-time (org-current-effective-time) + org-log-note-this-command this-command + org-log-note-recursion-depth (recursion-depth) org-log-setup t) (add-hook 'post-command-hook 'org-add-log-note 'append)) @@ -10383,37 +10385,39 @@ EXTRA is additional text that will be inserted into the notes buffer." (defun org-add-log-note (&optional _purpose) "Pop up a window for taking a note, and add this note later." - (remove-hook 'post-command-hook 'org-add-log-note) - (setq org-log-setup nil) - (setq org-log-note-window-configuration (current-window-configuration)) - (delete-other-windows) - (move-marker org-log-note-return-to (point)) - (pop-to-buffer-same-window (marker-buffer org-log-note-marker)) - (goto-char org-log-note-marker) - (org-switch-to-buffer-other-window "*Org Note*") - (erase-buffer) - (if (memq org-log-note-how '(time state)) - (org-store-log-note) - (let ((org-inhibit-startup t)) (org-mode)) - (insert (format "# Insert note for %s. + (when (and (equal org-log-note-this-command this-command) + (= org-log-note-recursion-depth (recursion-depth))) + (remove-hook 'post-command-hook 'org-add-log-note) + (setq org-log-setup nil) + (setq org-log-note-window-configuration (current-window-configuration)) + (delete-other-windows) + (move-marker org-log-note-return-to (point)) + (pop-to-buffer-same-window (marker-buffer org-log-note-marker)) + (goto-char org-log-note-marker) + (org-switch-to-buffer-other-window "*Org Note*") + (erase-buffer) + (if (memq org-log-note-how '(time state)) + (org-store-log-note) + (let ((org-inhibit-startup t)) (org-mode)) + (insert (format "# Insert note for %s. # Finish with C-c C-c, or cancel with C-c C-k.\n\n" - (cl-case org-log-note-purpose - (clock-out "stopped clock") - (done "closed todo item") - (reschedule "rescheduling") - (delschedule "no longer scheduled") - (redeadline "changing deadline") - (deldeadline "removing deadline") - (refile "refiling") - (note "this entry") - (state - (format "state change from \"%s\" to \"%s\"" - (or org-log-note-previous-state "") - (or org-log-note-state ""))) - (t (error "This should not happen"))))) - (when org-log-note-extra (insert org-log-note-extra)) - (setq-local org-finish-function 'org-store-log-note) - (run-hooks 'org-log-buffer-setup-hook))) + (cl-case org-log-note-purpose + (clock-out "stopped clock") + (done "closed todo item") + (reschedule "rescheduling") + (delschedule "no longer scheduled") + (redeadline "changing deadline") + (deldeadline "removing deadline") + (refile "refiling") + (note "this entry") + (state + (format "state change from \"%s\" to \"%s\"" + (or org-log-note-previous-state "") + (or org-log-note-state ""))) + (t (error "This should not happen"))))) + (when org-log-note-extra (insert org-log-note-extra)) + (setq-local org-finish-function 'org-store-log-note) + (run-hooks 'org-log-buffer-setup-hook)))) (defvar org-note-abort nil) ; dynamically scoped (defun org-store-log-note () -- 2.37.3 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note 2022-09-25 18:16 ` Bhavin Gandhi @ 2022-09-26 12:46 ` Ihor Radchenko 0 siblings, 0 replies; 19+ messages in thread From: Ihor Radchenko @ 2022-09-26 12:46 UTC (permalink / raw) To: Bhavin Gandhi; +Cc: emacs-orgmode, powem Bhavin Gandhi <bhavin7392@gmail.com> writes: > I'm attaching the patch for the current approach we discussed in this > thread. I have tried basic operations like taking note on state change, > and have tried with recurring entries which need more than 10 cycles to > be marked as done (original bug report). > > As I was changing the indentation of code from org-add-log-note, I converted > some tabs to spaces, is it okay to do so? Thanks! Should be fine I think. We have a mess with spaces and tabs in some places. Applied onto main with amendments. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2e012db31a8dbae0f859b8fbfc899aeed3e34244 I have changed the commit message to `quote' lisp symbols and have double space " " between sentences. I also added defvars for the new variables to pacify the compiler and changed the commit message accordingly. Applied Fixed -- Ihor Radchenko, 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 ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2022-09-26 12:47 UTC | newest] Thread overview: 19+ 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 2022-07-01 2:14 ` Ihor Radchenko 2022-07-03 17:10 ` Bhavin Gandhi 2022-07-04 12:03 ` Ihor Radchenko 2022-07-10 17:23 ` Bhavin Gandhi 2022-07-11 1:57 ` Ihor Radchenko 2022-07-14 15:22 ` Bhavin Gandhi 2022-07-16 9:21 ` Ihor Radchenko 2022-07-21 18:03 ` Bhavin Gandhi 2022-07-26 11:49 ` Ihor Radchenko 2022-08-16 18:17 ` Bhavin Gandhi 2022-08-17 9:45 ` Ihor Radchenko 2022-09-01 9:48 ` Bastien Guerry 2022-09-25 18:16 ` Bhavin Gandhi 2022-09-26 12:46 ` Ihor Radchenko
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.