From: Protesilaos Stavrou <info@protesilaos.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Define new face for the contents of #+RESULTS drawers
Date: Sat, 16 Sep 2023 12:38:59 +0300 [thread overview]
Message-ID: <878r96tq30.fsf@protesilaos.com> (raw)
[-- 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
next reply other threads:[~2023-09-16 9:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-16 9:38 Protesilaos Stavrou [this message]
2023-09-16 9:49 ` [PATCH] Define new face for the contents of #+RESULTS drawers 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878r96tq30.fsf@protesilaos.com \
--to=info@protesilaos.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).