emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Protesilaos Stavrou <info@protesilaos.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Define new face for the contents of #+RESULTS drawers
Date: Sat, 16 Sep 2023 15:30:44 +0300	[thread overview]
Message-ID: <87msxm5mh7.fsf@protesilaos.com> (raw)
In-Reply-To: <878r96phvl.fsf@localhost>

> From: Ihor Radchenko <yantar92@posteo.net>
> Date: Sat, 16 Sep 2023 09:49:50 +0000

> [... 9 lines elided]

>> +(defface org-code-results '((t :inherit org-code))
>> +  "Face for the contents of #+RESULTS drawers."
>> +  :group 'org-faces
>> +  :version "30.1")
>
> 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?

> As for code evaluation results, it can be anything with #+results
> keyword. Like
>
> #+results:
> : fixed width
> : text
>
> or
>
> #+results:
> #+begin_example
> ...
> #+end_example
>
> or
>
> #+results:
> Simple paragraph of text.
>
>>  	  ;; Code
>> -	  '(org-activate-code (1 'org-code t))
>> +	  '(org-activate-code (1 'org-code-results t))
>
> `org-activate-code' only affects fixed-width text
>
> : like
> : this
> :
> : one
>
> It has no relation to code results, except that fixed width is often
> (but not always) used as the default markup for results of evaluation.
>
> If what you are looking for is different formatting for code markup and
> fixed-width markup, `org-fixed-width' would be a better face name.
>
> If you are looking for formatting of results of evaluation, it would
> need to be a completely new, non-trivial, font-lock-keyword.

Thank you for the explanation!  The case I had in mind was indeed the
one where the 'org-code' face now applies.

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.

-- 
Protesilaos Stavrou
https://protesilaos.com


  reply	other threads:[~2023-09-16 12:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=87msxm5mh7.fsf@protesilaos.com \
    --to=info@protesilaos.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).