From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SIYhLqgp9WFafwEAgWs5BA (envelope-from ) for ; Sat, 29 Jan 2022 12:48:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cKhIK6gp9WGYeAEA9RJhRA (envelope-from ) for ; Sat, 29 Jan 2022 12:48:56 +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 3A282379F4 for ; Sat, 29 Jan 2022 12:48:56 +0100 (CET) Received: from localhost ([::1]:55762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDmDv-0008Ra-D8 for larch@yhetil.org; Sat, 29 Jan 2022 06:48:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDm1j-00039p-FU for emacs-orgmode@gnu.org; Sat, 29 Jan 2022 06:36:19 -0500 Received: from [2607:f8b0:4864:20::432] (port=37666 helo=mail-pf1-x432.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDm1K-0000Z5-4A; Sat, 29 Jan 2022 06:36:17 -0500 Received: by mail-pf1-x432.google.com with SMTP id a19so2579984pfx.4; Sat, 29 Jan 2022 03:35:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4bmEnsjTsFRgaCvKHFOXYOVgJT0+0FnnwcuXBwoqtew=; b=c26z4Q/YwLWr/xtmA4Bic4JQ4ih8i3d5ha74q0u10O3Hx79e8LHT3MTLMg6w5OHRuw 9hvD2+938Aq+4z7EB1kBtmZl1mIi5J4aHErcVXyMbnSyZhAad0TSEN03CC06vQA9Ff32 +uAxSF86lvZOILAkop0m4e8ysjmSAcN+nFvyDvKXmVWMHVdXnEvNannAqHyeCT8TM/W2 XwsOkv2mir8F8WrJqETBiw6vLY46xBVwpZmBCFAsBluBWj1W8NrxDTuoXwbFfQxnemI3 lOp4zVuy0D1+owXFOysiiTadxo1EXpydJH3BybzKWox78BHzqYW61PdtXMIfdw1lV/hi CWBg== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4bmEnsjTsFRgaCvKHFOXYOVgJT0+0FnnwcuXBwoqtew=; b=zHFPBw/iN6ep5NdNO7XyL67XlJhQZ2KGNryGHQf3EKRWgqUC7qT7PRq8g/p9++xCe7 PlzmDR4JK3G184p/u4abJPvNRxFDcwjbD/yeDYipk4f0go1/YVoSdvDMe9aC9YLweJU4 OssFtS7J/bOIJveeXuYFIXesYoOpsABpmqr/PVMDWlusgXEwjYZC691Q1CjaGmg/ccmz xPSOJc9tSmFeXYKpUz/P7QpGnESEhgmbGotc52wPgJJv67/racA17gCHvWbFe5V91mIX NtvSDy919rdQ4JODMeD+SM/9gWxSit6SCxzXTnYVRy3aTNt7w0H7eNlV607j0wB3QwEp j7Wg== X-Gm-Message-State: AOAM532LcjPr9p2xmi5RKNCeiOfR5nG6EOqj4sbYPtOFF6plV4m4cS0t vn4qQck7hKxojzl3N4jvpjui5hkk/A97lsw0 X-Google-Smtp-Source: ABdhPJwD9rZusX/mDIGUBGxOaYoPaSsj1aiGnsMKnDW9TszY/9GKgapm6spHSbSOze8JM9deZUS7iQ== X-Received: by 2002:a05:6a00:cc6:: with SMTP id b6mr12542516pfv.21.1643456151630; Sat, 29 Jan 2022 03:35:51 -0800 (PST) Received: from localhost ([209.95.60.92]) by smtp.gmail.com with ESMTPSA id y20sm13061146pfi.78.2022.01.29.03.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jan 2022 03:35:51 -0800 (PST) From: Ihor Radchenko To: Bastien , Kyle Meyer , Nicolas Goaziou , Karl Voit , Christian Heinrich , emacs-orgmode@gnu.org Subject: [PATCH 12/35] org-fold: Handle indirect buffer visibility Date: Sat, 29 Jan 2022 19:38:04 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: <87y2cvloay.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.34.1" Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::432 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=yantar92@gmail.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Ihor Radchenko Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643456936; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=4bmEnsjTsFRgaCvKHFOXYOVgJT0+0FnnwcuXBwoqtew=; b=Eq+kKd0+U/7YeG/DoVp9XhgJIWg7AvYV91jAepXHBYiRedRm4qzbBKpfN0KbR2c1D0chlw CZkRqPk7fC690/mLZntSUi/P2Ru8tRAZKVQtpeljlXThyu5xLZRdc2cM5+I86PBZl0Byxo Sx2p7Ea+HioyND9gy9hf3vo7WO5CXjWp9HFzTqWzdrCW6ZzA7+PtIRNW+KQKgv4FBOP3CA TZut4aG850f9AtTisKNBIJxDSN5GJrmnIH+r6CatJQcWuA5LxmLpSwNZ6kEX9TWLLRuKQa cNWg8Go5HMcSMWmOY8JmB3gcgbrB4htWJu+2Meiybm9r+SMNQx6P9A3MSrQgQA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643456936; a=rsa-sha256; cv=none; b=EuYgcm4No2lqfZJzohLYNyR60ReIogGWPtN6XqcbNicdZ9BdPDM+65giGEWdvCvRYVYqD/ 2KVAqie8DJuGysbBKB/2xsTu0lkH9MeYNCQ5tRfWiX8qju+FKnRm51c48UgmpC1nTVFxFl qQDNP2IyZLo9E/Vc/nZeGsNj2upIllj8PEaV6sUAotA+mWi3xnlO+VG94TgGMb8PQPh87e BpoVVHDa1PLWXSgAS0JfOtPRz+/GRvYxqukPc9c05grnfUGw8dN2wPcjguzSL5PvyPMOYb z5/IAMsW7eRTmnA/l2ENqGrzoFpGLStPgl0GHaA5YVyH06VTZL3kh54mIbQLnw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="c26z4Q/Y"; 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.33 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="c26z4Q/Y"; 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: 3A282379F4 X-Spam-Score: -3.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: +e14TykS+Xr0 This is a multi-part message in MIME format. --------------2.34.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- lisp/org-capture.el | 5 ++++- lisp/org.el | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) --------------2.34.1 Content-Type: text/x-patch; name="0012-org-fold-Handle-indirect-buffer-visibility.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0012-org-fold-Handle-indirect-buffer-visibility.patch" diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 1d4d6e877..08b35dd99 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1171,7 +1171,10 @@ (defun org-capture-place-entry () (goto-char (point-min)) (unless (org-at-heading-p) (outline-next-heading))) ;; Otherwise, insert as a top-level entry at the end of the file. - (t (goto-char (point-max)))) + (t (goto-char (point-max)) + ;; Make sure that last point is not folded. + (org-fold-core-cycle-over-indirect-buffers + (org-fold-region (max 1 (1- (point-max))) (point-max) nil)))) (let ((origin (point))) (unless (bolp) (insert "\n")) (org-capture-empty-lines-before) diff --git a/lisp/org.el b/lisp/org.el index 0967cbf1c..575a327da 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5983,7 +5983,13 @@ (defun org-get-indirect-buffer (&optional buffer heading) (number-to-string n)))))) (setq n (1+ n))) (condition-case nil - (make-indirect-buffer buffer bname 'clone) + (let ((indirect-buffer (make-indirect-buffer buffer bname 'clone))) + ;; Decouple folding state. We need to do it manually since + ;; `make-indirect-buffer' does not run + ;; `clone-indirect-buffer-hook'. + (org-fold-core-decouple-indirect-buffer-folds) + ;; Return the buffer. + indirect-buffer) (error (make-indirect-buffer buffer bname))))) (defun org-set-frame-title (title) --------------2.34.1--