From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uMnGNKv8yGLGKAEAbAwnHQ (envelope-from ) for ; Sat, 09 Jul 2022 05:57:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0EuHNKv8yGIgrAAAauVa8A (envelope-from ) for ; Sat, 09 Jul 2022 05:57:31 +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 82D8DABE5 for ; Sat, 9 Jul 2022 05:57:31 +0200 (CEST) Received: from localhost ([::1]:41814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oA1b0-0000p5-NM for larch@yhetil.org; Fri, 08 Jul 2022 23:57:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oA1aD-0000of-Eg for emacs-orgmode@gnu.org; Fri, 08 Jul 2022 23:56:41 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:36622) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oA1aC-00088u-0N for emacs-orgmode@gnu.org; Fri, 08 Jul 2022 23:56:41 -0400 Received: by mail-pj1-x1036.google.com with SMTP id z12-20020a17090a7b8c00b001ef84000b8bso3669678pjc.1 for ; Fri, 08 Jul 2022 20:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=iIH2e6FuXkk6g7FHFEYolexLZCPYjY3DjapshNT72Y4=; b=lTkAMWc9c/oIWhh5BxmLoO1dJn6QBmjRp+K1jVtr/19I7Y4Fm1FFrNCNfOg5zFadjO 0EYrTJO6v89LJkOnL0GiHRaChlv6mTzm6C19IvSApx7jV7ADm1oqrYQLHjGUci2fS5db 1YSEZkR+fc5Fx9TTEH0A+zeNN3bbx71/2wXFAA/WWNb0wJDtKF6fqhZ9QqvgPD41tlPK jutxRvj068Q+zoNKtiGltUwr0+9VhcbeUrmAmXq8bWUISiOGECwQCpvWjieP6tXEKLt2 MDV7UBqhHR1r2XeJ7fsaWgZ8SdcOD0ivSqQlx0eJ18Kn2MRUmFoCJekgKA+Ux7OhlEa0 1SoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=iIH2e6FuXkk6g7FHFEYolexLZCPYjY3DjapshNT72Y4=; b=goMU17082v5CHcVPFHd+cLujv6vVUj0Zq0+b/Gtvfpt24zSPNiyzpzVfvhkWIaTF+F ra5lSRGpZu+0d9ngqKhvvhiI8CnozsOgDQwlHAuZlQLmtVt40jHqYBvU6Vhz+Pvgqlm4 nzmIFef5R77CjFZxnnLqVWqoVqA0KPEPIckXoDufxT4BjjHSaHL9TkD9e92q9JFgOHMB MFuvMNLAqnKvsaLDssEuCxl4h/CgcZMqOjFqtK/0sD7TmZepm1wG65yC32MaKxewgRES 6FXUT4gRRfvyH7qfod6K1qU2hpslCYdUMCk0vK24slwBneB+5J9WmZRzb9ExPcXlTkfL XKNQ== X-Gm-Message-State: AJIora/FLfvlF7W4QRI7qKVRLa3v449s9G3OCQZuc4edpk6dFSd8FZqM GjLfIJ1OJ/RPdbtkJyCl83M= X-Google-Smtp-Source: AGRyM1tNJxgOvqSX+nQKtgOfscKp1ER15CYz7qE9HRbM9tG6qZPz933UhhMm+VgzkznmXTjzoESB9Q== X-Received: by 2002:a17:90a:930b:b0:1ed:5441:1fff with SMTP id p11-20020a17090a930b00b001ed54411fffmr3698373pjo.238.1657338998732; Fri, 08 Jul 2022 20:56:38 -0700 (PDT) Received: from localhost ([23.228.121.194]) by smtp.gmail.com with ESMTPSA id y64-20020a626443000000b005289e190956sm369224pfb.177.2022.07.08.20.56.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 20:56:38 -0700 (PDT) From: Ihor Radchenko To: Al Haji-Ali Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] org-agenda-prepare-buffers does not save restrictions In-Reply-To: References: <87y1x588rs.fsf@thinkpad.mail-host-address-is-not-set> <87a69k44kr.fsf@localhost> Date: Sat, 09 Jul 2022 11:57:43 +0800 Message-ID: <874jzr9buw.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1036.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=1657339051; 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=iIH2e6FuXkk6g7FHFEYolexLZCPYjY3DjapshNT72Y4=; b=e32Q5iIAoUXLbNxVw00o7PYjtRGbzV5PAL7SnqouKYQHG5V7320ZGS6igofwdQEzVQugAh XgHgR9zx1iLRuWXggjaSarh851+unjP+p4pbK8oETU56tki9De00kSW6KyZJTCFry2MU3v 8q+CZPQXaAw4yF+xNhkinMDm5Z8w8W2UlVFK9PS1X/7ScJ1kZNuDLgVT9WARw5h/zTvjP4 cjRXGXC+wOO8F1FP5KLMANUrhkgyfQOKOEW4pQQeytfA044lPFUEfyKHjSCmEf/2VScKPl xj05EAq3BXBPNsRTirl8hL09j5mBiGmIlUlRFtFHJuZW1mpbd2gPjTxbv1xx/g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657339051; a=rsa-sha256; cv=none; b=XrnlyXVkNWZNi1KYVILke7IUOfYY1E1lmbPZJeq/zl7xLMJlNsOk3aEsD8P4sAbbjwCCmw c3bzIZgDcCqqbugR+BmRmGrHYqTztbUttFn7LVkUYcH+ke6WzHcXYiz/CYsa+G+kJYt0C5 Zf0XnRj4cvtxTwtW9mtVkCtlLK7ShX2LW8WRufRUSPdIAUS7Wzkf92PmdlgzGH447AH2nK 6vBAuQlDIbnZWRw4s0uQUZe+0Ls8uT6mbFhuRYnoPEol06iCvoAPDMlsS+6RjaAYdLXPfq XVaJ/Oti1s1pXsatK8dGoIJYhhmr7W4QKkJfysAtSWKRTpgh5oN7VteLQnIU/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lTkAMWc9; 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.45 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lTkAMWc9; 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: 82D8DABE5 X-Spam-Score: -3.45 X-Migadu-Scanner: scn1.migadu.com X-TUID: AylNdYNxPepa Al Haji-Ali writes: > On 08/07/2022, Ihor Radchenko wrote: >> Could you please create a proper patch > > See attached. I made a further change to use `with-current-buffer` instead of > `set-buffer+save-excursion`. Thanks! Two more comments. > * lisp/org.el (org-agenda-prepare-buffers): Call > `save-restriction'/`save-excursion' for every buffer in the agenda > instead of just once for the current buffer. Use `with-current-buffer' > instead of `set-buffer'/`save-excursion'. Please use double space between sentences. > + (save-excursion > + (save-restriction > + (widen) A more concise way is (org-with-wide-buffer ...) Best, Ihor