From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +F3/HVwUYGJ+DAAAbAwnHQ (envelope-from ) for ; Wed, 20 Apr 2022 16:10:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id aL/JHVwUYGIyOwAAauVa8A (envelope-from ) for ; Wed, 20 Apr 2022 16:10:36 +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 1FF7C2D89C for ; Wed, 20 Apr 2022 16:10:36 +0200 (CEST) Received: from localhost ([::1]:34596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhB2R-00025L-0e for larch@yhetil.org; Wed, 20 Apr 2022 10:10:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhAMO-0005o6-UQ for emacs-orgmode@gnu.org; Wed, 20 Apr 2022 09:27:10 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:45755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhAML-0004Qp-Na for emacs-orgmode@gnu.org; Wed, 20 Apr 2022 09:27:08 -0400 Received: by mail-pg1-x531.google.com with SMTP id k29so1599590pgm.12 for ; Wed, 20 Apr 2022 06:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:in-reply-to:references:message-id:date:mime-version; bh=pUx9utwUjSvpgMA5Q5NfBNCvnjBKnNn3ItElMgs4Z8A=; b=P+kjTpWwSLWZ5oVE7bSq4SkU66zPhpTQR1TBgcl1TsRvjdiISb96U0vHXapv6ILzbP 4UKnyVw7vo9tOAqsamj/aXUug/fQJCjiC55wlUnvj7cDkZID2nolNPwgXYTktc2+/som 9lJUuzzyJLBWTjh0UoUA8DdTK28PIgM8EGp0oB83sJqDW83kLthYKfWjYC0ixXqRwhhc IIqtnLa/XTGIYEDQR3OqQWZf+fE7RM6YxwEGns6DH/1AimA7ptEZkUqsreTiHb7ceSTF lTKZjbvDjp3dpKFxcgslsr/HCYi/pP4BEK6fCwp43IGGoFxvwqe9Je0NRqXK8HwZjW8D R0uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references :message-id:date:mime-version; bh=pUx9utwUjSvpgMA5Q5NfBNCvnjBKnNn3ItElMgs4Z8A=; b=1mgr/roAAu5AQb60jNwxESyQb30rNfZInwUZE+LQ83Jc3018Zv+UtStwjpgynqGA7E ljN5qCPunuzdKogK0vGrdJS4hWyqWY/QEo/ITNzKWRa0i3fYsldGFgjexOsHeXVZuPA7 4zZOkoS2tHERyrUDF5MXdWaiHVIqY38dt+OmBmbqdK12X6YAB2Kwd+lb3fu1WKh8xSlj L6a6XL+1vCoz1YLpIDyhpy/oJmyNSFhazrg0YFWOQFJV4Uo5qqHLVk4wL5AxGyuS2IG6 Iu6Ts6eNrSBV0iKWdZ/WWcGTBBux1lBjolJDtR2NJoNUDSxfEvpMr8pdQYWt7KLSdPLf vE4Q== X-Gm-Message-State: AOAM5334HDZxA57zEDM5iOYymwIeLux3zGtdiZSzUnK2+DO+Ler2OsKR ebrvwd9Qzla+RnBA3vBdUNySx8JIi++gLA== X-Google-Smtp-Source: ABdhPJwVpWWle3TkY592pO6OYHDu8qwxUZu1+DZ0OsaXksiDWmPORXnTuu9S0Vjt3Q1gNDWCICOFqw== X-Received: by 2002:a63:5d1c:0:b0:39c:c5d7:ebbb with SMTP id r28-20020a635d1c000000b0039cc5d7ebbbmr19137580pgb.54.1650461221991; Wed, 20 Apr 2022 06:27:01 -0700 (PDT) Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id e6-20020a056a001a8600b004fac74c8382sm20801073pfv.47.2022.04.20.06.27.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 06:27:01 -0700 (PDT) From: Ihor Radchenko To: emacs-orgmode@gnu.org Subject: [PATCH v2 30/38] org-fold-show-set-visibility: Fix edge case when folded region is at BOB In-Reply-To: References: Message-Id: <89c6b214bcc7076856026ed7cb611044d2994025.1650460489.git.yantar92@gmail.com> Date: Wed, 20 Apr 2022 21:27:55 +0800 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=yantar92@gmail.com; helo=mail-pg1-x531.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=1650463836; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=pUx9utwUjSvpgMA5Q5NfBNCvnjBKnNn3ItElMgs4Z8A=; b=mXQStNAiK/BeqWYzrbLkSK2BzWRNZnSMAohvcrn2xbQooBZgoiDbb6agBZjM9oOYPG71KI E8Fbig3J5/8dPLhlh7nvr88KEM8Wyry+2eQvDRDktYoKFFIWsaVo0e6vXAwPk3ZXXpIV8q AYZatk1ij7fDLaEK7RWERaTwlaus+oJiCfX4/HxPE+r16zvjtMDifbLhwnzpybvaEw2LEJ 9D1Fo3IEJLxl6qc18RwTviS3lrunY92UUdLljLifxBSBYW0lmoVxapEl+wgSm8Mg62CM8j BY4eOoZiLId3+tYhFE1kMe62m9p/eRLcsl0+QO1AgZ/EahD8CTpc6R9p11/pHg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650463836; a=rsa-sha256; cv=none; b=rqOsi1DjNJC4SCQJn3LqBKKCCWquKry9zpCLuA/QJP6zSOip2nOv4L161glnETFs0L2ca7 LJCaOiscHR+U/zccIRyir7W+H10zkDl24pphHsN00ySOAQGix/d1qdu1//UcnqGyR8v2Lq Jb0HvINQB7EeO5blpglR86HUtAUQBuioxrrZmkUVmI/wKoT2ByOecUVSndDgtYLA4pQolP usDX+ETyCq6RFTufzSbN4oi5oGwOGBlVG4lRVwhP4FXe9eDMwjBkY7futk7m5mdZupgZ0t mP7sYyYETFVakN0d48ZZ/tz4c/BdfwZzBjtDa9yliT772hrXPfQ6tQMVnkJ6XQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=P+kjTpWw; 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.04 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=P+kjTpWw; 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: 1FF7C2D89C X-Spam-Score: -3.04 X-Migadu-Scanner: scn1.migadu.com X-TUID: Ilei8PR72Xuo --- lisp/org-fold.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-fold.el b/lisp/org-fold.el index a16ee0f9b..d5a21cbcb 100644 --- a/lisp/org-fold.el +++ b/lisp/org-fold.el @@ -840,7 +840,7 @@ (defun org-fold-show-set-visibility--text-properties (detail) (org-with-point-at (car region) (beginning-of-line) (let (font-lock-extend-region-functions) - (font-lock-fontify-region (1- (car region)) (cdr region)))))) + (font-lock-fontify-region (max (point-min) (1- (car region))) (cdr region)))))) (when region (org-fold-region (car region) (cdr region) nil)))) (unless (org-before-first-heading-p) -- 2.35.1 -- Ihor Radchenko, PhD, Center for Advancing Materials Performance from the Nanoscale (CAMP-nano) State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg