emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [DISCUSSION] Refactoring fontification system
Date: Sat, 04 Jun 2022 07:38:09 +1000	[thread overview]
Message-ID: <87zgit76wz.fsf@gmail.com> (raw)
In-Reply-To: <87k09ycc7n.fsf@localhost>


Ihor Radchenko <yantar92@gmail.com> writes:

> Ihor Radchenko <yantar92@gmail.com> writes:
>
>> Instead of fontifying elements individually via regexps, we can leverage
>> org-element-map, org-element-parse-buffer, org-element-cache, and
>> jit-lock-mode. Each type of Org element/object can be assigned with a
>> fontification function accepting a single argument - the element datum.
>
> I have been working on the new fontification library for the last
> several months and I have noticed several confusing things in the
> current fontification settings.
>

Very pleased your working on this. I suspect this will, once combined
with the other fine work you have done, generate some very rewarding
results. 

> I'd like to hear if anyone has any idea on how to interpret the
> following:
>
> 1. org-protecting-blocks is an internal auxiliary variable used to
>    determine which blocks should be fontified using different major
>    mode.
>    It's value is ("src" "example" "export")
>    So, #+begin_src lang and #+begin_export lang are fontified according
>    to LANG. Makes sense.
>    However, what about #+begin_example?
>    org-element-example-block-parser does not appear to expect language
>    specification in the example blocks. Only switches seems to be
>    allowed. Am I missing something and Org actually allows example
>    blocks to specify language? Or was it the case in the distant past
>    versions of Org?
>

I don't recall ever being able to specify language type with source
blocks. The only benefit I can see for being able to would be to have
blocks which are not 'executed' (tangled), but you can already achieve
that just using source blocks. So, from my perspective, I would want
example blocks (which I view mainly as a type of verbatim block)
fontified in a distinct manner, but no need for language specific
font-locking - if I want that, I would just use a src block. 

> 2. org-script-display is an internal auxiliary variable used to display
>    sub/superscripts. Note that it's default value holds 4 possibilities.
>    Two for each type of script. For example, for superscripts we have
>    two options:
>    ((raise 0.3) (height 0.7)) and ((raise 0.5))
>    The first one looks more compact (does not change the line height)
>    and reduces size of the superscript.
>    The second one makes superscript have the same size with the main
>    text an increases the line height x1.5.
>
>    org-raise-scripts fontifies sub/superscripts differently inside and
>    outside the tables:
>    From org-raise-scripts:
>    (nth (if table-p 3 1) org-script-display)
>
>    However, it currently uses x1.5 line height for tables creating empty
>    space between vertical | separators. It looks like a typo for me. It
>    would make more sense to make table lines compact, not vice versa. Am
>    I missing something?
>

I need superscript/subscript so rarely I really don't have much of a
position. However, I do find it annoying when a superscript/subscript
character alters the line spacing for the line it happens to display in. 

> 3. org-fontify-meta-lines-and-blocks-1 creates a special face for
>    ("+title:" "+subtitle:" "+author:" "+email:" "+date:")
>    The face name is org-document-info.
>    But what about, say, +description: or +language:?
>    Would it make more sense to fontify all the keywords from
>    org-options-keywords instead?
> 

Yes, I think that would be the right approach. I suspect most people
won't really worry too much. Absent font locking is less of an issue
than incorrect font locking. Soemthing too often seen with regexp based
font-locking which I'm hoping will be avoided with a version based more
on parsed elements etc. 
   



  parent reply	other threads:[~2022-06-03 21:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 14:12 [DISCUSSION] Refactoring fontification system Ihor Radchenko
2021-11-19 14:18 ` Bruce D'Arcus
2021-11-19 16:09 ` Tim Cross
2021-11-24 22:03 ` Nicolas Goaziou
2022-06-03  9:45 ` Ihor Radchenko
2022-06-03 20:37   ` Ted Reed via General discussions about Org-mode.
2022-06-04 13:45     ` Ihor Radchenko
2022-06-04 23:28       ` Ted Reed via General discussions about Org-mode.
2022-06-03 21:38   ` Tim Cross [this message]
2022-06-07 16:48   ` Max Nikulin
2022-06-08  2:02     ` Ihor Radchenko
2022-06-08  4:23       ` Tom Gillespie
2022-06-08  6:35         ` Tim Cross
2022-06-09 15:31         ` Max Nikulin
2022-06-10  2:06           ` [PATCH] #+begin_example lang used in manual and worg (was: [DISCUSSION] Refactoring fontification system) Ihor Radchenko
2022-06-15  3:40             ` Max Nikulin
2022-06-16 12:31               ` Ihor Radchenko
2022-06-16 12:33               ` [BUG] Unescaped #+ lines in WORG example blocks (was: [PATCH] #+begin_example lang used in manual and worg (was: [DISCUSSION] Refactoring fontification system)) Ihor Radchenko
2022-06-16 16:33                 ` Tim Cross
2024-04-15 13:44                 ` Ihor Radchenko
2022-06-16 15:08       ` [DISCUSSION] Refactoring fontification system Max Nikulin
2022-06-08  6:52   ` Phil Estival
2023-05-30 11:25   ` [RFC] Refactoring org-element API (was: [DISCUSSION] Refactoring fontification system) Ihor Radchenko
2023-05-30 11:32     ` Ihor Radchenko
2023-05-30 15:00     ` [RFC] Refactoring org-element API Stefan Nobis
2023-05-31  8:57       ` Ihor Radchenko
2023-06-23 12:20         ` Ihor Radchenko
2023-06-30 13:53           ` Ihor Radchenko
2023-07-01 11:44     ` [RFC] Refactoring org-element API (was: [DISCUSSION] Refactoring fontification system) 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=87zgit76wz.fsf@gmail.com \
    --to=theophilusx@gmail.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).