all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Define new face for the contents of #+RESULTS drawers
@ 2023-09-16  9:38 Protesilaos Stavrou
  2023-09-16  9:49 ` Ihor Radchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Protesilaos Stavrou @ 2023-09-16  9:38 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

Hello folks!

I propose the attached patch.  It gives users/themes the opportunity to
style the contents of #+RESULTS drawers differently than the face
applied to ~code~ elements.

To preserve the current style, I made the new face inherit 'org-code'.

What do you think?

All the best,
Protesilaos (or simply "Prot")

-- 
Protesilaos Stavrou
https://protesilaos.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Define-new-face-for-the-contents-of-RESULTS-drawers.patch --]
[-- Type: text/x-patch, Size: 1536 bytes --]

From 1ecd64bfe88d06684a9ad97c1ee6df0bdd2c1eb2 Mon Sep 17 00:00:00 2001
Message-ID: <1ecd64bfe88d06684a9ad97c1ee6df0bdd2c1eb2.1694856985.git.info@protesilaos.com>
From: Protesilaos Stavrou <info@protesilaos.com>
Date: Sat, 16 Sep 2023 12:36:18 +0300
Subject: [PATCH] Define new face for the contents of #+RESULTS drawers

* lisp/org-faces.el (org-code-results): Define new face.
* lisp/org.el (org-set-font-lock-defaults): Use it instead of the
generic 'org-code' face.
---
 lisp/org-faces.el | 5 +++++
 lisp/org.el       | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 436552cb2..3d233eaff 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -409,6 +409,11 @@ (defface org-code '((t :inherit shadow))
   :group 'org-faces
   :version "22.1")
 
+(defface org-code-results '((t :inherit org-code))
+  "Face for the contents of #+RESULTS drawers."
+  :group 'org-faces
+  :version "30.1")
+
 (defface org-meta-line '((t :inherit font-lock-comment-face))
   "Face for meta lines starting with \"#+\"."
   :group 'org-faces
diff --git a/lisp/org.el b/lisp/org.el
index 84ac87438..6fb099618 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5905,7 +5905,7 @@ (defun org-set-font-lock-defaults ()
 	  '(org-fontify-entities)
 	  '(org-raise-scripts)
 	  ;; Code
-	  '(org-activate-code (1 'org-code t))
+	  '(org-activate-code (1 'org-code-results t))
 	  ;; COMMENT
 	  (list (format
 		 "^\\*+\\(?: +%s\\)?\\(?: +\\[#[A-Z0-9]\\]\\)? +\\(?9:%s\\)\\(?: \\|$\\)"
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-09-18  8:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-16  9:38 [PATCH] Define new face for the contents of #+RESULTS drawers Protesilaos Stavrou
2023-09-16  9:49 ` Ihor Radchenko
2023-09-16 12:30   ` Protesilaos Stavrou
2023-09-16 12:44     ` Ihor Radchenko
2023-09-16 12:52       ` Protesilaos Stavrou
2023-09-17  9:53         ` Ihor Radchenko
2023-09-17 21:36           ` Samuel Wales
2023-09-18  8:39             ` Ihor Radchenko

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.