From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id mM+tIQQs52WFAgAA62LTzQ:P1 (envelope-from ) for ; Tue, 05 Mar 2024 15:28:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id mM+tIQQs52WFAgAA62LTzQ (envelope-from ) for ; Tue, 05 Mar 2024 15:28:20 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fnTFDems; 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=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709648900; 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=UtGqyUqLPE8TlWSSsgGmILNKE7Cjcd4A63i7wHSqk4A=; b=bmyoO/5tKcEf/fXYlLwo3JeBE1EmI5nHFXF5ZaPid85dfggTCEk3K90xnTVCQ+RYlPt9+S 1jlGXExnUYZ9fwxHtDGuGa2kO3PeCo4F0l6jPpeJWFFDLoi3URoiLfQdAy5k7WgNOt+OkP aIvUplgIhK+sY6IPjwNoDnCp8qkTc6I2Zx4e8dKQEYKOoNrs3ILbjgeybN7Ri+j+4Y5vh9 o5xpTj2XAlEqmNt5U3mW2sHzjYQxm5fLStYtFmVSRRlJE5VJjrg+jwB/Lv0fqJemaCZ7Gw LvDIQYZKNncDqGokB32rak80V8349iBqjkwYgTvB/zyXPA38fNcDxZx1K1fR7g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fnTFDems; 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=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709648900; a=rsa-sha256; cv=none; b=mF1hYUej14FpeSaGhZVZqS6iAK+155kLjnlYrzk7Rdw2YwSPRQ93Wo1frCL9JNU5q470kE Efa5WPXlVphsXwZeQLNspSwSHjmGjtMWX/Cxapye4jlIq/KCv020Mt36z7vfqOLKGOAKPb zFbKN9L4Y3PYmSc7S0ksCbfYVWPXvIEv1j5d/l5+1FnF7/0zWCxKmxF/eYy8J3f6lw0QAL O1oNEGAqzCwQPOVxxjfsIPMwNQD1xbHstxAZDPVXFyeKZCmmqH82WfTR7Ll8/UQi3W55Xb 7zUvQOYzn9S0DYGUEnKT48E63Llbz7aMidKUulvWf+kUNGQ0h1ha0565m8oT+Q== 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 51DCFBA42 for ; Tue, 5 Mar 2024 15:28:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhVlT-0001xA-U4; Tue, 05 Mar 2024 09:27:32 -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 1rhVlP-0001uw-R8 for emacs-orgmode@gnu.org; Tue, 05 Mar 2024 09:27:28 -0500 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhVlK-0005GI-G9 for emacs-orgmode@gnu.org; Tue, 05 Mar 2024 09:27:27 -0500 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6e4dec6f672so1204224a34.1 for ; Tue, 05 Mar 2024 06:27:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709648840; x=1710253640; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UtGqyUqLPE8TlWSSsgGmILNKE7Cjcd4A63i7wHSqk4A=; b=fnTFDemsKJ5+h4kqYK2nrGdfhoKapivUDCED8dqshZHOdbBl7NiWf8vR4GVKWrjD36 48dxbPKspdKyY2O/9MkuKJ6rb9hWy6CHVrDIaycffY5GVv5K+03eON+hnbdG0ExmbN9b mgWQx1iHMCsPJxO2oAbbDiNUxVtxkimJ8K9yyK5wWLjfduCr0YTrMrTa8gSEzAK20fGZ qeE+BvCKV/Z6NVRFDuQUt6MYt6WWt+J6VTTBv6Pq9ntCXgKvFFj2J4RTJBHkmKHtsn4F 2U/SjyRdz3dvd6RusbXL5HA2vuBi5+Gavg1B8oufnrc87oBORb64A6k6xU+G+CN9t2CQ Pw1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709648840; x=1710253640; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UtGqyUqLPE8TlWSSsgGmILNKE7Cjcd4A63i7wHSqk4A=; b=jyFbr1/itOWnUnSCG50nIRtsHcE9Kw7Lp84eGcsI4bGtJ1R+np1XffY/ntTrmHOvHD pLy5O0/hXOQqIV8cp1LYpBwVy7n7rXOCnHQZxViBEcdekCbvftCzA7nokhWpauKSkKJ+ Nij4ThkfNzgRaS3KYjdoaeUkfXCaAKKTJyrHdUBpcrCWDvvoKleltU1euLI+tb999Bem Jt8NA6lbnlu1VvEQeyqVbC2SdU38eIvhIh1jogomRCXck8UgTUEC2hxoTGznHMOSesJu KfGgs3FAoJ4joqDWEVSBQ++HSGViAy8nN9/whGsNLTRRipNDLDFl2qXenaCdjt2eoXSU QhBg== X-Gm-Message-State: AOJu0Yy6IzlLh/td9zQscWpTbeOCm3PeHUIPXuI2RUn+drl1VnqcuD2G CJV7CRjQ/p9b4ImEyr7CznHslu9Piw+v4kWzz9tqJMzy7xW6a+iwtI/wxGs8+pTTUn4Z5saVzZX 4rNVr1p+Qy3+JGLNgIh0ZPHANwva+qP6wPkEAKw== X-Google-Smtp-Source: AGHT+IH7PGVQj9sWnxY+3Gq7mggLuTg+uc+UpbTodmORTXj7Y/5ku+A89SZJ7lJK3TCZuEn/Ms+NSO/EU3bmXq2WXTs= X-Received: by 2002:a05:6870:7020:b0:220:44e6:86f3 with SMTP id u32-20020a056870702000b0022044e686f3mr2079090oae.47.1709648839348; Tue, 05 Mar 2024 06:27:19 -0800 (PST) MIME-Version: 1.0 References: <87frxrm604.fsf@localhost> <87il2mc1v3.fsf@localhost> In-Reply-To: <87il2mc1v3.fsf@localhost> From: mahmood sheikh Date: Tue, 5 Mar 2024 16:27:08 +0200 Message-ID: Subject: Re: nested blocks in org To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::331; envelope-from=mahmod.m2015@gmail.com; helo=mail-ot1-x331.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -4.75 X-Spam-Score: -4.75 X-Migadu-Queue-Id: 51DCFBA42 X-TUID: Ch4EmPTer2Vl with the given minimal example: ``` #+begin_parent #+begin_child #+end_child #+end_parent ``` the code ```lisp (org-block-map (lambda () (message "elem: %s" (org-element-at-point)))) ``` goes through only the parent element and doesnt run the lambda on the child block the docstring of org-block-map says it iterates through src blocks but it also goes through special blocks, albeit not nested ones, i might've confused it for org-element-map as im not sure about the later functions behavior. On Sat, Feb 17, 2024 at 7:44=E2=80=AFPM Ihor Radchenko wrote: > > [ Adding Org list back to CC; please use Reply All or wide reply to keep > the discussion public ] > > mahmood sheikh writes: > > > consider the following block > > ``` > > #+begin_solution > > #+begin_src sql > > SELECT > > CONCAT(c.first_name, ' ', c.family_name) AS name, c.customer_id, > > ... > > #+end_solution > > ``` > > the src block isnt fontified by org because it is inside another block > > ... which is just a bug in the Org fontification code. > If you try M-: (org-element-at-point) , you will see that Org does > recognize the code block. > > So ... > > > can you point me in the right direction of getting org mode to recogniz= e > > nested blocks, > > Org already recognizes nested blocks using Org element parser. See > https://orgmode.org/worg/dev/org-element-api.html > > > ... like code highlighting for src blocks that are within > > another special block? > > See https://list.orgmode.org/87ee7c9quk.fsf@localhost/ > This is something we are working in. > To get parser-aware fontification locally, you can use a function > MATCHER (as in font-lock-keywords docstring) and invoke > `org-element-at-point' there to check context. > > > ... and getting org-element-map to iterate through both > > a parent and its child blocks all the same? > > May you elaborate? `org-element-map' iterates through everything, > including nested parent and child blocks. What did you try? > > > could modifying `org-block-regexp` to be a recursive regex be of help? > > Sorry, but it is hard to see how this is related to `org-element-map'. > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at