From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 qEhgCV9tuGNN4AAAbAwnHQ (envelope-from ) for ; Fri, 06 Jan 2023 19:50:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6MFRCV9tuGN7tgAAauVa8A (envelope-from ) for ; Fri, 06 Jan 2023 19:50:07 +0100 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 C54863C072 for ; Fri, 6 Jan 2023 19:50:06 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDrmE-00062K-Qi; Fri, 06 Jan 2023 13:49:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDrmC-00061R-HH for emacs-orgmode@gnu.org; Fri, 06 Jan 2023 13:49:12 -0500 Received: from sender4-of-o51.zoho.com ([136.143.188.51]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDrmA-0003Bg-PK for emacs-orgmode@gnu.org; Fri, 06 Jan 2023 13:49:12 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1673030943; cv=none; d=zohomail.com; s=zohoarc; b=bCRhJh2y2ql0F2Yhh1TjGJuDobsonQxVZuhJP4izyXyEmT3IpkJUOSNAN0ZWr9vyU6lO6uRxLzMxBDqgEk3CO0hypM9KOE82SSv0XQ5Pm+IhJuvPeTphGQyUbOyhBW3KX1XL2td/j8QQ4+uapVzF/yQIIwnRPj6aY7Zavu51Hdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673030943; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=kpjBBF4AVf5acAS+UF4U8kHUUphmIbVIJCYJrHplY/A=; b=RoEgO9Hi5fFGFmKxJAg4GF6nAARpyaPGMU+h5jvgThUFbFjrePze/7zeJiHlXrf+GWNXLNrNmJYdAugyhvhAmWvAvcGgzpdpM7u0QNFu3OJWysY0zXaE3mVCbKsPrs5cc3r69WqDYsNFesDAp5T8IBqHQ+7VkkAoTzuuF7RXbKY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zellerin.cz; spf=pass smtp.mailfrom=tomas@zellerin.cz; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673030943; s=zoho; d=zellerin.cz; i=tomas@zellerin.cz; h=From:From:To:To:Cc:Cc:Subject:Subject:In-Reply-To:References:Date:Date:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To; bh=kpjBBF4AVf5acAS+UF4U8kHUUphmIbVIJCYJrHplY/A=; b=a51JnVirtRLX8JeIIe8mN5JOSXKDSwS+IgZ4X8KEJ6+G9YoDy/NyJsRBykdym2LU lgAd1j4OW7F0ICm3FCvRi7RPVJwOEwjub3jMzt1GXdZP0j2zoFS3qcNjhO1HywS1n9Y gWRbr1KztpXzbHz8Ty/d1boeUC3LDyESAR4Zmnm0= Received: from fedora (176.114.240.40 [176.114.240.40]) by mx.zohomail.com with SMTPS id 1673030942089426.5835814422089; Fri, 6 Jan 2023 10:49:02 -0800 (PST) From: Tomas Zellerin To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] Org agenda misbehaves in a side window [9.5 (9.5-g0a86ad @ /home/zellerin/.emacs.d/elpa/org-9.5/)] In-Reply-To: <87fscniuhf.fsf@localhost> (Ihor Radchenko's message of "Fri, 06 Jan 2023 14:54:36 +0000") References: <87mt6xrtc0.fsf@zellerin.cz> <87fscniuhf.fsf@localhost> Date: Fri, 06 Jan 2023 19:48:57 +0100 Message-ID: <87cz7rsdly.fsf@zellerin.cz> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.51; envelope-from=tomas@zellerin.cz; helo=sender4-of-o51.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=2; s=key1; d=yhetil.org; t=1673031006; a=rsa-sha256; cv=pass; b=KmMRCmqOm6vOr2g4cYMSPWyB03f7zxAZ39obPv3R6gbZHqf6ew6PZdgKF97kUiOHdLcuA4 PrFafTVDwYT7WRn3VVV2AdOjuKY/z8AlXIJd8Q8wBWYi6E+tLpTmVRmd9D9Zc7ZSYysL1s 15b6+MYD7DyWit+zcZYmcDXf6HxHG3/PWCE60mGgVnEamyQoVD8PJz7yeW9stZpeVB9pWF qbHvS/AsTqR4Y9z6feuOEq3nLAiy6O9HTFbeG+kUJpZlDWWQhtF5w6QzcgAKstctIQuXRs NHcJO/38vD0R/oA5pw3f6xt93qRcMsUYHfMISu0P9ZJ7s0/5/+41Y6+mklqcZQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=zellerin.cz header.s=zoho header.b=a51JnVir; 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"; dmarc=pass (policy=reject) header.from=zellerin.cz; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673031006; 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=kpjBBF4AVf5acAS+UF4U8kHUUphmIbVIJCYJrHplY/A=; b=OZJO9pGZLGYjcSLNxVx3fGrJDRQisUh2gBcwvryO+p+kgNvOyiQowNhpOVV9eUhZrY9XK4 ePTRXg82GiVByPGOxFELAjcwKcb64rKQl+t2BfXzG1ivvC7Dufadl/DBZQAgMVHqKDWabD 630pfzmOBz2vwlqsSHLfhLogezDnkrFoCTgb3Hyb2XMnaIc8JM4vEuDtcMJhnA/LpAWjEC aW37DzyYUmY/LC0qNQEFBND1ZsWNEY4Vbt79qX44/LYqwV5w93mcdeO6u//tKKlIApV3EU bYGSE1thNRmMkDjZ4Yh8TxGOIoZzmt6K/CFEJ0SatCTXlB6mK2eDCOKz9HBbLg== X-Spam-Score: -5.06 X-Migadu-Queue-Id: C54863C072 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=zellerin.cz header.s=zoho header.b=a51JnVir; 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"; dmarc=pass (policy=reject) header.from=zellerin.cz; arc=pass ("zohomail.com:s=zohoarc:i=1") X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -5.06 X-TUID: ZVjPEtkCKen6 Ihor Radchenko writes: >> The reason seems that org-agenda-get-restriction-and-command calls >> delete-other-window; however, this is not something user observes and >> expects as effect of those commands. > > Sure, but what can we do in order to both fix this and also not break > the existing behaviour? The simplest solution seems to bind (ignore-window-parameters t) inside the save-window-excursion in `org-agenda-get-restriction-and-command`, see below. But I do not know what all can be broken, or whether something cleaner is possible. Best regards, Tomas --- /tmp/org-agenda.orig 2023-01-06 19:43:03.528884719 +0100 +++ /tmp/org-agenda.el 2023-01-06 19:41:23.493330904 +0100 @@ -3112,13 +3112,14 @@ c entry key type match prefixes rmheader header-end custom1 desc line lines left right n n1) (save-window-excursion - (delete-other-windows) - (org-switch-to-buffer-other-window " *Agenda Commands*") - (erase-buffer) - (insert (eval-when-compile - (let ((header - (copy-sequence - "Press key for an agenda command: + (let ((ignore-window-parameters t)) + (delete-other-windows) + (org-switch-to-buffer-other-window " *Agenda Commands*") + (erase-buffer) + (insert (eval-when-compile + (let ((header + (copy-sequence + "Press key for an agenda command: -------------------------------- < Buffer, subtree/region restriction a Agenda for current week or day > Remove restriction t List of all TODO entries e Export agenda views @@ -3128,14 +3129,14 @@ ? Find :FLAGGED: entries C Configure custom agenda commands * Toggle sticky agenda views # List stuck projects (!=configure) ")) - (start 0)) - (while (string-match - "\\(^\\| \\|(\\)\\(\\S-\\)\\( \\|=\\)" - header start) - (setq start (match-end 0)) - (add-text-properties (match-beginning 2) (match-end 2) - '(face bold) header)) - header))) + (start 0)) + (while (string-match + "\\(^\\| \\|(\\)\\(\\S-\\)\\( \\|=\\)" + header start) + (setq start (match-end 0)) + (add-text-properties (match-beginning 2) (match-end 2) + '(face bold) header)) + header)))) (setq header-end (point-marker)) (while t (setq custom1 custom)