emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bhavin Gandhi <bhavin7392@gmail.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] org-auto-repeat-maybe: error "Can’t expand minibuffer to full frame" and missing log note
Date: Sun, 10 Jul 2022 22:53:59 +0530	[thread overview]
Message-ID: <CAOn=hbeDKkvpjkkqk2uw-1dm_5+YgY+sdc9=uZnBfxjA0FhW3g@mail.gmail.com> (raw)
In-Reply-To: <87bku5nkz2.fsf@localhost>

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


  reply	other threads:[~2022-07-10 17:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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='CAOn=hbeDKkvpjkkqk2uw-1dm_5+YgY+sdc9=uZnBfxjA0FhW3g@mail.gmail.com' \
    --to=bhavin7392@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@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).