From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8GBNIH4Ly2IOFQEAbAwnHQ (envelope-from ) for ; Sun, 10 Jul 2022 19:25:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kDwyH34Ly2JfHgEAG6o9tA (envelope-from ) for ; Sun, 10 Jul 2022 19:25:18 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0AE9330680 for ; Sun, 10 Jul 2022 19:25:18 +0200 (CEST) Received: from localhost ([::1]:40866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAagH-0006mp-2c for larch@yhetil.org; Sun, 10 Jul 2022 13:25:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAafg-0006mf-7O for emacs-orgmode@gnu.org; Sun, 10 Jul 2022 13:24:40 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:37887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oAafe-0006f3-HM for emacs-orgmode@gnu.org; Sun, 10 Jul 2022 13:24:39 -0400 Received: by mail-ej1-x62b.google.com with SMTP id os14so5310687ejb.4 for ; Sun, 10 Jul 2022 10:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HA5DV5cTU09oS5iExDvVEk6xS3BHTKJOe+95abqtTVA=; b=OIWTaBONc+RCiPu+Kr7FZI6cweiWHdI5eV5PU5HkzxHuEcGLWdbto7YboWrByLXiXr dm6ZufT+671kL/FzaQ6TfzT5cySITKDBzYIYbu1X2CerIolUFvqZziPisNBQ+exJKVvP h7QGhhIR8qbLNe97YecIzj7XWQcclgr1wxtOEzlGUCcBxr/2sq2nkLG9iC2FXjwBHYOC 1bG8Q0tgiMLV+HbFgsatjtS9pURs9KXFRl0X9NR/BafGZnzONngopsVBJ/4rQ8wWuy9N 71F7GX9a/VSQdIVW/koCMOuf5DyGqfkmTIyepstZBYuSs97NkDaXcKkdSbfLawhg6VXG Ys5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HA5DV5cTU09oS5iExDvVEk6xS3BHTKJOe+95abqtTVA=; b=5h4hCdgjwTZcBqJkbHH4FNrygfjtuLCr6hZIO32PL3LiElnRHL314smwGgQ0eUn+R/ 5q+h5kzBf6GFz0VeRxvJAifLOa2iqKuh/nV/8LRZgF2fdW243Msj0KYP5kXcjPBNnMcd WbZOD7rA8v7R2o/z1/QYvUrg/TZRs5QqRlzst75TZgpicil6gH7tsEcBaRAUEC9S7oEh 7jK4BtRaDoHXebOeyvZen6cRBeFqgDqqMWXiycic76NPFcQM5oel3qziETrpA3HU2YM8 swHrml+Gi8lo3pv/c3FQu3n86ER8M2TevUgGTASwNhYT8x/1OUsv3pEWZtMshb7Z6rsk TlDQ== X-Gm-Message-State: AJIora/PUjt7+M8RRFZUOIyOUWoZlvmlHlrsf7fZ/hRrURocE1jj9yUb QhNGIJj3n15Db0ZrwdPK+X88ajVm/9r9naz7vHY= X-Google-Smtp-Source: AGRyM1vm/ioHG4ZdBKByCusr2Tvi3+u9xUGOoRQ0iSlM2nnk3hJcpUwJkPfnliUe5S0EADKIF78Kg4575TVMKfGAle0= X-Received: by 2002:a17:907:c1d:b0:726:3239:fe83 with SMTP id ga29-20020a1709070c1d00b007263239fe83mr14582780ejc.51.1657473876366; Sun, 10 Jul 2022 10:24:36 -0700 (PDT) MIME-Version: 1.0 References: <413e82eb-db3b-8fac-7edb-35aded973dfd@ctpowe.net> <87y1xdk2a7.fsf@localhost> <87bku5nkz2.fsf@localhost> In-Reply-To: <87bku5nkz2.fsf@localhost> From: Bhavin Gandhi Date: Sun, 10 Jul 2022 22:53:59 +0530 Message-ID: Subject: =?UTF-8?Q?Re=3A_=5BBUG=5D_org=2Dauto=2Drepeat=2Dmaybe=3A_error_=22Can=E2=80=99t_expa?= =?UTF-8?Q?nd_minibuffer_to_full_frame=22_and_missing_log_note?= To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=bhavin7392@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657473918; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=HA5DV5cTU09oS5iExDvVEk6xS3BHTKJOe+95abqtTVA=; b=nI18jRMqeXPvv4JusvhCZlTrNXbXc86gL9M2sqGoa8LRxREX0q/WDWePjsi6eQ4+nkJlXI 1RRkp8XVlCIEk+wNW4hyJ38pohF3xKHN7gs4nkTu1VeujC3odYeuliHI3DuDq/SzyVdjm6 PnguZaYPP1uLVCFWCBJMJMw177MdWsPli6JLF5S6fPQQeqgV8WtINTkKcBW2ymcr2MHHRE V/Z7emS4YicQnoAExx8juTBRgX0kcDl9JHsub3dmsbbTqxlRMScsZvLD/+saX5F0Ld1jcD k2sRyEYhdQBQf8wZeDUoAvf6o3qJBr0AkBtQVRUEwZbEBM3m+AgV13JOyXdL0w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657473918; a=rsa-sha256; cv=none; b=kIBBpTTDsGLvkEsLcKJ7OAsJhnv/eYWKh7F+O0GWXnAiRtt2wR29osipYS04M9UadcPccG tPfDG35tRhvzGtBtUgU2yE1xd3xV3ddj2EVnIqG1oVwBfYZOyeVuCbx4LceHIwN3S7ZPvm HGF0RV2h+YijS9IZ9c76EYoS1wb9TqHaHqCiohDzbItJVEg3/tgl66n6xcIT96znVPzvRH q3vjkWrXgDNAhhnChvf4yGXYd/qscaBGVazZGMQFFmoqW+3z3Wn+1p07JHQQHXiIaKo2yL uzIkr8XTnl1NKPvGTMdoalBwVHQrxdBJd4arbFgOQLIMk7AEtFB+qN3d7N2zBg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OIWTaBON; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.95 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OIWTaBON; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0AE9330680 X-Spam-Score: -3.95 X-Migadu-Scanner: scn1.migadu.com X-TUID: QwXrPnC5V/Ip On Mon, 4 Jul 2022 at 17:32, Ihor Radchenko 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