emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Roshan Shariff <roshan.shariff@gmail.com>
To: Timothy <orgmode@tec.tecosaur.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH v2] Fix background color of latex previews
Date: Sun, 7 Jan 2024 02:50:12 -0700	[thread overview]
Message-ID: <CAG8iPGxoAD7qmKzDXQ_SRFbmxD7jdM96piCa-dCSCpzae4rCsw@mail.gmail.com> (raw)
In-Reply-To: <87wmsl38n1.fsf@tec.tecosaur.net>

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

Hi Timothy,

Thanks again for your work on this exciting feature! I tried out your
new code and it does indeed fix the problem on Emacs 29. But then I
remembered that I originally encountered the issue on Emacs 28, and
sure enough the issue persists there.

To summarize, to get it to look right on Emacs 28, you need to append
the face spec '(:inherit default :extend t) to the list of faces,
rather than just 'default. Otherwise, when an equation overlay wraps
to the next line in visual-line-mode, you'll see the background color
of the org-block face leak through after the end-of-line. Emacs 29
appears to behave more sensibly: if the overlay wraps to the next
line, its face is not applied to the end of the current line.

I'm attaching a screenshot of the problem, showing the grey blocks at
the end of the first two lines. The second screenshot is after
applying this patch, which sets the :extend face attribute:
https://github.com/roshanshariff/org-mode/commit/latex-preview-face-extend.

Regards,
Roshan

On Sun, 7 Jan 2024 at 00:28, Timothy <orgmode@tec.tecosaur.net> wrote:
>
> Hi Roshan,
>
> > This change addresses two issues:
> >
> > 1. Latex previews in headings have the background color of the
> > fontified Latex code, rather than the rest of the heading.
> >
> > 2. If Latex code is fontified with a face that has the :extend
> > attribute, and the preview overlay wraps to the next line, then the
> > empty space after the end of the line uses the background color of the
> > Latex code rather than that of the surrounding text.
>
> Sorry for the delay in getting back to you. I ended up being rather busy around
> the middle of last year. I’ve just started another sprint on the LaTeX preview
> rewrite, and have made a few changes to how face guessing heuristics.
>
> If you might be willing to try the new code and see if the issue noticed still
> appears, that would be brilliant!
>
> All the best,
> Timothy
>
> --
> Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/tec>.

[-- Attachment #2: with-bug.png --]
[-- Type: image/png, Size: 167598 bytes --]

[-- Attachment #3: correct-appearance.png --]
[-- Type: image/png, Size: 167538 bytes --]

  reply	other threads:[~2024-01-07  9:51 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12 12:23 [Pre-PATCH] Overhaul of the LaTeX preview system Timothy
2023-03-13 12:26 ` Ihor Radchenko
2023-03-14 16:04   ` Timothy
2023-03-15  9:34     ` Ihor Radchenko
2023-03-15 17:28       ` Rudolf Adamkovič
2023-03-13 12:30 ` Ihor Radchenko
2023-03-13 12:32   ` Ihor Radchenko
2023-03-14 14:46     ` Timothy
2023-03-13 12:36 ` Ihor Radchenko
2023-03-14 16:10   ` Timothy
2023-03-15  9:38     ` Ihor Radchenko
2023-03-13 12:37 ` Ihor Radchenko
2023-03-14 16:13   ` Timothy
2023-03-25 15:29 ` Tony Zorman
2023-05-02 12:15 ` K. Chousos
2023-05-03 10:07 ` K. Chousos
2023-05-05 17:57   ` Karthik Chikmagalur
2023-05-05 18:48     ` Konstantinos Chousos
2023-05-05 18:53     ` Konstantinos Chousos
2023-05-05 20:05       ` Karthik Chikmagalur
2023-05-05 21:06         ` Konstantinos Chousos
2023-05-05 22:58           ` Karthik Chikmagalur
2023-05-06  9:19             ` Konstantinos Chousos
2023-05-06  9:30               ` Ihor Radchenko
2023-05-06 10:08               ` Konstantinos Chousos
2023-05-08 20:04               ` Karthik Chikmagalur
2023-05-08 20:40                 ` Konstantinos Chousos
2023-05-09 11:34                 ` Ihor Radchenko
2023-05-09 12:03                   ` Timothy
2023-05-09 12:10                     ` Ruijie Yu via General discussions about Org-mode.
2023-05-09 12:12                     ` Ihor Radchenko
2023-05-09 12:10                       ` Timothy
2023-05-09 12:49                   ` Max Nikulin
2023-05-09 12:57                     ` Ihor Radchenko
2023-05-10 10:07 ` Jun Inoue
2023-05-10 10:21   ` Timothy
2023-05-10 13:09     ` Jun Inoue
2023-05-26  9:50 ` Rudolf Adamkovič
2023-05-28 17:31   ` Timothy
2023-06-03  9:00     ` Rudolf Adamkovič
2023-08-21  8:59 ` Visuwesh
2023-08-21 16:40   ` Karthik Chikmagalur
2023-08-21 17:19     ` Visuwesh
2023-08-21 21:40       ` Karthik Chikmagalur
2023-08-22  2:57         ` Visuwesh
2023-08-29  6:01 ` Roshan Shariff
2023-08-29  6:01 ` [PATCH 1/1] Fix background color when line-wrapping latex previews Roshan Shariff
2023-08-29 17:14   ` [PATCH v2] Fix background color of " Roshan Shariff
2024-01-07  7:25     ` Timothy
2024-01-07  9:50       ` Roshan Shariff [this message]
2024-01-08 10:24         ` Timothy
2024-01-09 20:12           ` Roshan Shariff
2024-01-07  7:28 ` [Pre-PATCH] Overhaul of the LaTeX preview system Timothy
2024-01-20  5:53 ` Matt Huszagh
2024-01-20  6:02 ` Matt Huszagh
2024-01-20  7:13   ` Matt Huszagh
2024-01-21 17:08     ` Timothy
2024-04-22 11:08 ` Feedback on the new "feature" system in org-export (was: [Pre-PATCH] Overhaul of the LaTeX preview 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=CAG8iPGxoAD7qmKzDXQ_SRFbmxD7jdM96piCa-dCSCpzae4rCsw@mail.gmail.com \
    --to=roshan.shariff@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=orgmode@tec.tecosaur.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).