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 ms9.migadu.com with LMTPS id 0EFBOSNTdGRY0QAASxT56A (envelope-from ) for ; Mon, 29 May 2023 09:24:20 +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 UCBROSNTdGTpfwAAauVa8A (envelope-from ) for ; Mon, 29 May 2023 09:24:19 +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 656A51FA7B for ; Mon, 29 May 2023 09:24:19 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3XDY-0005Bv-8v; Mon, 29 May 2023 03:23:00 -0400 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 1q3XDT-0005Be-VX for emacs-orgmode@gnu.org; Mon, 29 May 2023 03:22:56 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3XDM-0005dr-Aw for emacs-orgmode@gnu.org; Mon, 29 May 2023 03:22:54 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6B34C240101 for ; Mon, 29 May 2023 09:22:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1685344965; bh=R+GyWkYs8qAJ9tuNW7sD5SZ4lXb1rquT6zwRjjIuU8A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=eTi/8Zx/J8dm6bwtWM8oBX4E7xGSNBkGuB6fAa3WhPyxkx113EPjgspNxcSjt/RlN sbIsCOv+YqMYpqwxgy7ZAnD23BBBYUoez11wjKDeH0z+HK+9dPEEGRclcavEtaXWH/ dNhVMzR2Cdo0GBBu+PFrty71ahp6SXDzdKXhMlUAWsrNdBeqyaE7sfvxTt4jmqKE8P Ul98zbXn/BWep90j1zIwy7iIqbmp2f0eH2aA8bcsPZgemDgvnByX7SSMR894FQ2JRX 8Ailmhd5DrUWTvYO90SVmaDZ3/ZgC28xV4PM3lkUssWqGGHHkZXLVFnj4Yg+FUVKwv lCG8XmQVZ8aOg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QV6S46M6nz6twx; Mon, 29 May 2023 09:22:44 +0200 (CEST) From: Ihor Radchenko To: 420actionunits@gmail.com Cc: emacs-orgmode@gnu.org Subject: Re: org-fold-core-region error: missing SPEC In-Reply-To: References: Date: Mon, 29 May 2023 07:22:39 +0000 Message-ID: <87y1l7txds.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1685345059; a=rsa-sha256; cv=none; b=oIGLqgHQOzKo2RFTT+7bZJ91rZOS6qCn8/jS4e7TCuEn6hgTGWD+Yo3GmyNRQ7qzsOUYzc 0QkdxgzBuiMNPUsFOBn/mQk+PoKyHQHbUeJgoz6yk5+yxGyhu3h7hFvQDjHKRKMYuvKDDJ DUu64/R8YjcauHcXCcF/2gNgNywodGqjvNZAyy9C06wv7ZiftXTbW6i1k0iW4vMHo7gpkC nx+0Q0lOzJtP99GGgcZU0DMExGwxBnrqcVxwnAcggD9NKukyIzbuznBALtrIE45BI5Un2E 5OfMCTa6YvAnet9zTiWM08+sKWg8pevgLxekz2omDrdTNqIM2hoi7z0mZxienA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="eTi/8Zx/"; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1685345059; 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=rb2O8mv7qQwFPoLInaRMQXoLC8Zq+XHS2Y5CsPjWo80=; b=hp6mRXHQL34ync5rOfvysuiHeWcEiWCW0A+o0U4+umzR4I3tY5Mp0XOFyPXPCHF6wDvlie TMbmxNmHwGVkdJvj++sZwOCrEaTHLchk1q8GplDqDR0/mSRzQqmsSKD14oJj39OOT6ZewK o9Oy5xnd5VNfnG9AyJjaQ/79L8TWxDPIPwyEOi6BUah8nSOJKiMbZukXAUL6tmIFDz1C+/ fcW/fod/gqFce7Q1fp4b0YCcOELv6anDZYgXWW2TXZO/dggYQd0xM722a6iE/aq5wG1TFN N60Gn3JOvRJWqUycR7x9Ap7BCJAUa2GesY7CCywkmXLtyIcJ1EtM8/809H9I8w== X-Migadu-Spam-Score: -9.37 X-Spam-Score: -9.37 X-Migadu-Queue-Id: 656A51FA7B X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="eTi/8Zx/"; dmarc=pass (policy=none) header.from=posteo.net; 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-TUID: Td9Dek69FcVb 420actionunits@gmail.com writes: > I set a breakpoint at the beginning of function > ORG-FOLD-CORE-GET-FOLDING-SPEC-FROM-ALIAS. It runs quite a few times > successfully. Every time the input argument SPEC-OR-ALIAS has one of > these values: 'ORG-FOLD-VISIBLE or 'ORG-FOLD-HIDDEN. But at some point > the function runs with a value of 'DRAWER, and that's when it returns > NIL and the error is thrown higher up in ORG-FOLD-CORE-REGION when it > explicitly tests for a NIL result. > > ORG-FOLD-CORE--SPEC-SYMBOLS has the value: > > ((HIDDEN . ORG-FOLD-HIDDEN) (:ALIAS . ORG-FOLD-HIDDEN) > (ORG-FOLD-HIDDEN . ORG-FOLD-HIDDEN) (VISIBLE . ORG-FOLD-VISIBLE) > (:ALIAS . ORG-FOLD-VISIBLE) (ORG-FOLD-VISIBLE . ORG-FOLD-VISIBLE)) > > But when a drawer wants to be added we call ORG-FOLD-REGION like this: > > (ORG-FOLD-REGION (LINE-END-POSITION 0) (POINT) T (IF (EQ > ORG-FOLD-CORE-STYLE 'TEXT-PROPERTIES) 'DRAWER 'OUTLINE)) This implies that the buffer where `org-fold-region' is called is not in Org mode or did not have Org property initialized. `org-insert-property-drawer' expects the buffer to be in Org mode. > I'm still unclear on how ORG-FOLD-CORE--SPEC-SYMBOLS gets set with > this alist. Is there is an opportunity for callers to customize it? > What would be appropriate values to add for 'DRAWER and 'OUTLINE? The answer to this question is described in the top commentary of org-fold-core.el. Also, see `org-fold-initialize'. However, the problem is not just with folding. As I said, `org-insert-property-drawer' expect the major mode to be Org mode. Your backtrace implies that either the buffer is not in Org mode or something strange was done when initializing Org. Either way, random failures may happen - Org mode APIS, unless explicitly stated, expect major mode to be Org. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at