From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id oIDiLiejBWWhBAEAG6o9tA:P1 (envelope-from ) for ; Sat, 16 Sep 2023 14:44:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oIDiLiejBWWhBAEAG6o9tA (envelope-from ) for ; Sat, 16 Sep 2023 14:44:23 +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 18EF45A5B7 for ; Sat, 16 Sep 2023 14:44:22 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=KJ5xno28; 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=1694868263; 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=dZmWHw6sI+wV+3Zr0pH/FcMiUEFmucCIikHLU3Qisp8=; b=fTuePxPHBp0FqkR7sqbFh9Dyr3aEwqKCHnitKAFVBTXz1uGEW5Ikdk179SFOEiXNSrJMAv /I262ozO+2dlGyfrL5z7AwO2Fs2EhiMIPQk4ZaBsCg05FMyEmEwqTdQmCqDGNgjetSe24U XFvmDZ2NHS8XM+wWb1AzfPj7DdeP8J6bQrymXsYYoaMi7HZNr7/FK4CXFxj/PZsXfIykzg FILOvd76UDX/hFj3IF831voJQcZhqUXlyXwKOpzOFahWJEz7LoHbkDAgnqOTcaeTLb81Wi F5EF+La8rFRlV3vboRS3Y7ptFRK0NjJ3OkVJGuHSUJY+29KC7LMhn7PCergWUA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694868263; a=rsa-sha256; cv=none; b=qY6CMk+eqPdBQ64jaEOyhtFblXaY7Ic7q8B/tdPaJfnkGzjCEtV2lJV49x7MmqIVU/zpIq AAWZnZD/pYpDwz+Y3SNf5XwppnBHpSOf7BHur43lTFoO7Mlp0snEHWcTDEABQvi+UOBRNJ /ktJR2G+kvxJDMQBUVT6vzEq4woMdlK0CZHS4HD2vshYeNs6+FLv8I7LKXHBUC7W+BYMe2 ZhhPRqzAYNjNNDq0yUONhPgH9eckJuGsTAXsxxLJGqM1WyKMTJaAEp2rJlsqsdDZkSe1tu GI0Q3dvqNVZolX461e9iUiRoyjpKZsQuLAAqHtGRjNLHsVcZs6S516cYv1zM9g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=KJ5xno28; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhUe0-0007U6-J6; Sat, 16 Sep 2023 08:43:28 -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 1qhUdx-0007TJ-So for emacs-orgmode@gnu.org; Sat, 16 Sep 2023 08:43:26 -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 1qhUdv-000209-Mr for emacs-orgmode@gnu.org; Sat, 16 Sep 2023 08:43:25 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1800F240101 for ; Sat, 16 Sep 2023 14:43:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1694868201; bh=TaFuixH6JPi1MFPNAuQBjNhaJawUuQVkOLVRc9Y0L/s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=KJ5xno28L0fgp0ii+06LO11r+0m+RGGya5qH7r4qQjAAW9eaVjiuNOq6tREHAz5GG km72/ALXowc5Rnt3Ybd0LiocAIJydJ63J9Xrx8o2R8K/BqVf+tLawFX2Al2jRd9HNe MJ7NAZ+o1L4h2g1dLnlzEzZozHbVyJw4fE+L0LPQ1dV/kkNloaqRzrWOeEX7Kgdwx2 fasw9dOrubFHvUAB6nC233cVOH/p+J5f2udBJfYxHKVWssxlbjuPyziuKv42ohCU6+ e3IBN8ZYYBULeMQ98YxloPc2I1m8OfPiyBmhWdtIW0zr9EVU5ua1ywuOY2R5LYTtWs KJYNbLIbFwcOA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RnrMD2RRMz6tvy; Sat, 16 Sep 2023 14:43:20 +0200 (CEST) From: Ihor Radchenko To: Protesilaos Stavrou Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Define new face for the contents of #+RESULTS drawers In-Reply-To: <87msxm5mh7.fsf@protesilaos.com> References: <878r96tq30.fsf@protesilaos.com> <878r96phvl.fsf@localhost> <87msxm5mh7.fsf@protesilaos.com> Date: Sat, 16 Sep 2023 12:44:37 +0000 Message-ID: <87wmwqnv7u.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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: -7.17 X-Spam-Score: -7.17 X-Migadu-Queue-Id: 18EF45A5B7 X-Migadu-Scanner: mx0.migadu.com X-TUID: U9Tznh6iVF9l Protesilaos Stavrou writes: >> I think there is some misunderstanding here. >> #+RESULTS is not a drawer. A drawer would be >> >> :results: >> ... >> :end: > > Oh, I see. How do we describe it? A keyword, perhaps? Affiliated keyword. Org allows attaching arbitrary metadata to syntax elements. For example, we can assign name and header via affiliated keywords: #+name: src-block-name #+header: :var x=1 #+begin_src elisp (+ 1 x) #+end_src #+results is a special affiliated keyword that marks syntax elements generated by evaluating code blocks: #+results: I am generated paragraph #+results: :drawer: I am generated drawer :end: #+results: : I am generated fixed-width #+results: #+begin_latex I am generated latex snippet #+end_latex etc. >> `org-activate-code' only affects fixed-width text >> >> : like >> : this >> : >> : one > ... > Thank you for the explanation! The case I had in mind was indeed the > one where the 'org-code' face now applies. I am a bit confused. Now, `org-code' applies to all fixed-width constructs, not just the ones generated by code blocks. : I can just manually write this, and it will have ~code-block~ face. #+begin_src ... ... #+end_src #+results: : And this is generated src block result. : It is also using ~code-block~ face (as all fixed-width blocks do). > I am interested in making the results display as distinct elements. The > reason is that it can sometimes be hard to tell what was there before > and what was generated by 'org-babel-execute-buffer' and related. > > You are right to point out that adding font-lock rules for all the > possible #+results is not trivial. Better leave it as-is. Not very hard. Basically, we can write a custom activate function that will search for "^#\\+results:" lines and prepend/append an extra custom face to whatever that #+results is a part of (affiliated keyword is never standalone - it is attached to whatever is a result of evaluation). I am still not 100% sure what exactly you want to achieve - just highlight evaluation results that are _also_ fixed-width or all kinds of evaluation results. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at