From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id sN1RG5fw0GWThgAAqHPOHw:P1 (envelope-from ) for ; Sat, 17 Feb 2024 18:44:55 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id sN1RG5fw0GWThgAAqHPOHw (envelope-from ) for ; Sat, 17 Feb 2024 18:44:55 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=qcEFpYOb; 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=1708191895; 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=RJz5UkKiQbHgdr1IwRAN6mn5mid2FTdhWIqiif2jNZQ=; b=OdeaZ/EZRzUHMj23R9qEMUfd8lO0jGPDe3f76Fx7LjStacBESpaIwhW8CGbIH7q9RHwlAz +d23v72zjdUH8oKF2iCmp2OeL5/cxa1LlQiqxaszt3+001ftPVWD5vfIjpwg0zmGGKr6cp iHsXZjoCFMXd3y9iQ7rfVmhfnK997HDcWup49m2/rm7tcaGAc8XYO9QV9IILObOUQ/LHDS exTyu+gKDhSc0kndtOKjkc8R84XhdgKMMB/BwcAbt6SiJLQhb+PcbTemeFXwvJG5+vBnYi luxYRryZAnnnFstUZhwx8kQD+gljlJNTzUI5U1+bTD3WGP1ib3HCQ2sqvJfbfw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=qcEFpYOb; 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-Seal: i=1; s=key1; d=yhetil.org; t=1708191895; a=rsa-sha256; cv=none; b=VuKJlmzoPNq7sADfdaKyy2jnHua3KhxPvndDSs115dQMCUGQsa1rfUcMGX9nt/5wm4vqOr rft50I51nJ9bRWt1uzSKtVyygtK0DJimvc4lmnuUexXvSrxyWWxYMyfua2ORQmjyQWIqDK ns3FO9kuXEeQ7yBt2HuD8pp7HB/FwpPBk8EYqa0D5k2+4AESdbkMNVj4IlWL6m7I9FYc+m kGWdenU5mIQOhw1Exesa+xL39RIS7l0xZFQK+U5QR8w3N6eJteL7XgD5C4g041o976HBuo Q+NAX26YgdBUfQ1kCFyfxIDPbFRMiAz5rtwvEic8SEYs7vvHOzV9zqxB7jERKg== 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 2856A430F0 for ; Sat, 17 Feb 2024 18:44:55 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbOjQ-0006Xy-Fg; Sat, 17 Feb 2024 12:44:08 -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 1rbOjO-0006W7-Q0 for emacs-orgmode@gnu.org; Sat, 17 Feb 2024 12:44:06 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbOjM-0003zG-Hy for emacs-orgmode@gnu.org; Sat, 17 Feb 2024 12:44:06 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 7F4F2240028 for ; Sat, 17 Feb 2024 18:44:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1708191841; bh=vpsqsAckNqHtuTSDty2YxYQdCa6/xVQNSY0yjC39WlY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=qcEFpYOb269/u3Gc8LnA9OVohcUPDKPvellUmblh3GHR5EkoQUFHJYcNpCxzvUI9n NXIZzycpjli4DEthiHeAssg1cD/S4vOM8r73inK8TF8oXzECIY/daIZBxNo+3Pv9w4 3CVrUsnZ4adTWlR2iQYRfQ47/c5Og67KwH4LIUNrIbsaAzFkptxKajwOBBlE5Ugndm ueYFmXpQXuohUo3aCe/RaMA7uGLIBmfXb/DInC+x2tcrKkRd7zTO5w7NRGe2GbSR1M UIL+z4dGdOCGdLE2mfQoGlO84ZlXIgRYq4IlW14TeY38YEcOImi8Bs698x2ttbI3hd TN9dWRPIoKaRA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Tcbl44FbXz9rxB; Sat, 17 Feb 2024 18:44:00 +0100 (CET) From: Ihor Radchenko To: mahmood sheikh Cc: emacs-orgmode@gnu.org Subject: Re: nested blocks in org In-Reply-To: References: <87frxrm604.fsf@localhost> Date: Sat, 17 Feb 2024 19:44:16 +0000 Message-ID: <87il2mc1v3.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.71 X-Spam-Score: -6.71 X-Migadu-Queue-Id: 2856A430F0 X-Migadu-Scanner: mx13.migadu.com X-TUID: dewObJV61/85 [ 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 recognize > 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