all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Davin Pearson <davin.pearson@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re:
Date: Wed, 29 Dec 2021 12:41:50 +1300	[thread overview]
Message-ID: <CAG9ihEtUqeqwpiQn0XwPuN0_Fnodxa18k42uAJ78DW8XUtBEMA@mail.gmail.com> (raw)
In-Reply-To: <83h7aslit4.fsf@gnu.org>

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

Could you please run my code on your machine to verify that it works on
your machine but not mine.

On Wed, 29 Dec 2021 at 06:51, Eli Zaretskii <eliz@gnu.org> wrote:

> [Please keep the list address on the CC.]
>
> > From: Davin Pearson <davin.pearson@gmail.com>
> > Date: Tue, 28 Dec 2021 16:58:50 +1300
> >
> > In your email to me you said that one of the foreground colours
> > will "win" and the other will be ignored.  What I want is the
> > same thing for the background colour.  As far as I understand the
> > winning foreground colour will be the one that is added last in
> > the fontification spec, and with the symbol 'end added to
> > font-lock-add-keywords.
> >
> > Here is my font-lock-string-face
> >
> > "assdsdasd"
> >
> > Here is the text dmp-asdssd coloured in my choice of colours: red
> > and green:
> >
> > "dmp-asdssd" (*)
> >
> > Here is the code that fontifies the above code.
> >
> > (make-face 'dmp-face--line0--col1-red)
> > (set-face-foreground 'dmp-face--line0--col1-red "#ff0000")
> > (set-face-background 'dmp-face--line0--col1-red nil)
> > (make-face-bold 'dmp-face--line0--col1-red)
> >
> > (make-face 'dmp-face--line0--col2-green)
> > (set-face-foreground 'dmp-face--line0--col2-green "#00ff00")
> > (set-face-background 'dmp-face--line0--col2-green nil)
> > (make-face-bold 'dmp-face--line0--col2-green)
> >
> > (make-face 'dmp-face--line0--col3-blue)
> > (set-face-foreground 'dmp-face--line0--col3-blue "#0000ff")
> > (set-face-background 'dmp-face--line0--col3-blue nil)
> > (make-face-bold 'dmp-face--line0--col3-blue)
> >
> > Here are some useful constant strings:
> >
> > (defvar dmp-defun-inner-regexp-less-dash+star
> "a-zA-Z0-9_.!@$%^&=<>/|+:;?~")
> > (defvar dmp-defun-inner-regexp-less-dash      (concat ""
> dmp-defun-inner-regexp-less-dash+star))
> > (defvar dmp-defun-inner-regexp-less-star      (concat "-"
> dmp-defun-inner-regexp-less-dash+star))
> > (defvar dmp-defun-inner-regexp                (concat "-,"
> dmp-defun-inner-regexp-less-dash+star))
> > (defvar dmp-defun-outer-regexp                (concat "["
> dmp-defun-inner-regexp            "]+"))
> > (defvar dmp-bra                               "\\(^\\|[][
> \t\r\n()'\",.:=]\\)")
> > (defvar dmp-ket                               "\\($\\|[][
> \t\r\n()\",.:=]\\)")
> >
> > Here is the actual font lock code:
> >
> > (defun dmp-getting--syntax-highlighting--online ()
> >   (font-lock-add-keywords
> >    'emacs-lisp-mode
> >    '(
> >      (, (format "\\(dmp[0-9]\\)\\(\\(-[%s]+\\)+\\)%s"
> >                 dmp-defun-inner-regexp-less-dash
> >                 dmp-ket)
> >         (1 'dmp-face--line0--col1-red t)
> >         (2 'dmp-face--line0--col2-green t)
> >         )
> >      (, (format
> "\\(dmp[0-9]\\(-[%s]+\\)\\)\\(\\([-_][-_]\\|:\\)[%s]+\\)%s"
> >                 dmp-defun-inner-regexp-less-dash
> >                 dmp-defun-inner-regexp
> >                 dmp-ket)
> >         (1 'dmp-face--line0--col1-red t)
> >         (3 'dmp-face--line0--col2-green t))
> >      (, (format
> "\\(dmp[0-9]*\\(-[%s]+\\)*\\)\\([_-][_-][%s]+\\)\\([_-][_-][%s]+\\)%s"
> >                 *dmp-defun-inner-regexp-less-dash*
> >                 *dmp-defun-inner-regexp*
> >                 *dmp-defun-inner-regexp*
> >                 *dmp-ket*)
> >         (1 'dmp-face--line0--col1-red t)
> >         (3 'dmp-face--line0--col2-green t)
> >         (4 'dmp-face--line0--col3-blue t))
> >      )
> >    'end)
> >   )
> > (add-hook 'font-lock-mode-hook 'dmp-getting--syntax-highlighting--online
> 'APPEND)
> >
> > Notice that in the text marked with a (*) the background colour
> > of the above text is the same as the background colour of the
> > screen.
> >
> > When dmp-face--line0--col1-red, dmp-face--line0--col2-green and
> > dmp-face--line0--col3-blue 's set-face-foreground set to nil, as it
> > is above, I want the for the string face's background colour to
> > show through as light blue in the fontification of dmp-asdssd.
>
> I think this is something that your code does.  If I just merge two
> faces, one with a background color, the other with a foreground color,
> the result of the merge has the background of the first faces and the
> foreground of the second.
>
> So I conclude that something goes wrong in your
> dmp-getting--syntax-highlighting--on-line function, or in how it
> interacts with font-lock.
>

[-- Attachment #2: Type: text/html, Size: 5772 bytes --]

  reply	other threads:[~2021-12-28 23:41 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20  2:29 (unknown) Davin Pearson
2021-12-20 14:13 ` none Stefan Monnier
2021-12-21 14:29 ` Eli Zaretskii
     [not found]   ` <CAG9ihEvK5VVgP9O+TXYSz+BQF1=YzMgzGBbc5s-fewwT34yytA@mail.gmail.com>
     [not found]     ` <CAG9ihEsdD2Dd=paZatMfnD3HJxKsUM=3etTz7c-tDcs-H80PoA@mail.gmail.com>
     [not found]       ` <CAG9ihEsQFkx+uE+pZ7R42GXUFR_C2PSzVK8M5AQuHdtOsND0cg@mail.gmail.com>
     [not found]         ` <CAG9ihEv_OPaYhTgfh2WnfckC5r21U5Hv0qW7Msnwz4Bbvz6ccg@mail.gmail.com>
2021-12-28 17:51           ` Re: Eli Zaretskii
2021-12-28 23:41             ` Davin Pearson [this message]
2021-12-31 15:23               ` Re: Anders Lindgren
2022-01-02  1:15                 ` Re: Davin Pearson
2022-01-02  5:19                   ` Re: Stefan Monnier
2022-01-03  0:53                     ` Re: Davin Pearson
  -- strict thread matches above, loose matches on Subject: below --
2023-02-15 17:57 Make all tree-sitter modes optional Alan Mackenzie
2023-02-15 18:33 ` Eli Zaretskii
2023-02-17 13:30   ` Alan Mackenzie
2023-02-17 13:37     ` Po Lu
2023-02-17 13:46       ` Stefan Monnier
2023-02-17 14:16         ` Po Lu
2023-02-17 14:40           ` Eli Zaretskii
2023-02-17 14:56             ` Dmitry Gutov
2023-02-17 15:04               ` Eli Zaretskii
     [not found]                 ` <8735741fic.fsf@dick>
2023-02-17 15:41                   ` Alan Mackenzie
2022-01-20 14:13 Roger Mason
2022-01-20 19:57 ` Immanuel Litzroth
2022-01-20 19:58   ` Re: Roger Mason
2021-12-02 14:09 Re: Angelo Graziosi
2021-11-04  6:36 Re: Pedro Andres Aranda Gutierrez
2017-10-24 18:52 wait_reading_process_ouput hangs in certain cases (w/ patches) Matthias Dahl
2017-11-14 16:03 ` Eli Zaretskii
2017-11-14 16:23   ` Eli Zaretskii
2017-11-14 21:54     ` Paul Eggert
2017-11-15 14:03       ` Matthias Dahl
2017-11-16 16:46         ` Paul Eggert
2017-11-18 14:24           ` Matthias Dahl
2017-11-19  7:07             ` Paul Eggert
2017-11-20 15:29               ` Matthias Dahl
2017-11-21 14:44                 ` Matthias Dahl
2017-11-22  8:55                   ` Paul Eggert
2017-12-04  9:40                     ` Matthias Dahl
2018-02-13 14:25                       ` Matthias Dahl
2018-02-16 16:01                         ` Eli Zaretskii
2018-02-16 16:09                           ` Lars Ingebrigtsen
2018-02-22 11:45                             ` andres.ramirez
2018-02-26 14:39                               ` Matthias Dahl
2018-02-26 15:11                                 ` andrés ramírez
2018-02-26 15:17                                   ` Lars Ingebrigtsen
2018-02-26 15:29                                     ` andrés ramírez
2018-02-26 16:52                                       ` Daniel Colascione
2018-02-26 17:19                                         ` andrés ramírez
2018-02-26 17:24                                           ` Daniel Colascione
2018-02-27  1:53                                             ` Re: andrés ramírez
2016-02-08  7:54 (unknown) steve
2016-02-08 12:56 ` Artur Malabarba
2016-02-08 19:05   ` Re: Steve Purcell
2016-02-08 20:16     ` Re: Artur Malabarba
     [not found] <CAFkz2yroLhknptDnWyC9B1fbZKEwTCV-T0VttHQiwZoaAW-j6A@mail.gmail.com>
2012-12-20  8:36 ` Re: Константин Куликов
2008-08-06 15:50 Re:  Michaël Parienti
2008-08-06 16:57 ` Re: Paul R
2007-04-04 19:09 (unknown) Jost Burkardt
2007-04-05  0:26 ` Jason F. McBrayer
2005-12-03 23:03 Re: solenoids
2005-09-27 14:03 Re: avtologistic
2005-09-18 14:11 Re: Art
2005-09-10 14:39 Re: Abdulaim
2005-08-29 20:51 Re: Alifgin
2005-08-11 16:17 Re: от Александр
2005-07-06 17:37 Re: Ishok
2005-07-05 23:11 Re: Maxus
2005-06-30 18:50 Alex Claire
2005-06-14 23:56 Вера
2005-06-13 21:36 Re: Карина
2005-06-06 10:27 Re: Нина
2005-05-10 17:54 Re: Mariorisa
2005-05-04 17:05 Re: info
2005-04-21  7:57 Re: webmaster
2005-03-28 15:10 Re: info
2005-03-20  5:29 Re: info
2005-03-08 14:48 (no subject) Gian Uberto Lauri
2005-03-08 21:02 ` Peter Dyballa
2005-03-08 21:14   ` Re: Gian Uberto Lauri
2005-03-08 21:24   ` Re: Gian Uberto Lauri
2005-03-03  8:38 Re: support
2005-03-02  5:19 Re: PEREEZDI
2005-02-17  3:39 Re: root
2005-01-28 21:22 Re: Budget
2005-01-24 15:54 Re: support
2005-01-20  2:22 Re: Евгения Гордеевна
2005-01-12 15:30 Re: Сабина Елизаровна
2005-01-11 13:47 Re: Info
2005-01-06 13:53 Re: Документ
2005-01-06 12:16 Re: Документ
2004-12-21 16:08 Re: Алина Соломоновна
2004-12-21 11:12 Re: Маргарита Валериановна
2004-12-15 19:39 Re: Эмма Ульяновна
2004-12-15 17:55 Re: Анжела Геннадиевна
2004-12-12 17:13 Re: Зинаида Аверьяновна
2004-12-10 23:05 Re: Розалия Самойловна
2004-11-29  6:09 Re: Эльвира Викентьевна
2004-11-28 18:11 Re: Ева Давидовна
2004-11-26 21:10 Re: Robbie Womack
2004-11-26 18:31 Re: Joel Bradford
2004-11-11 11:56 Re: Майя Исааковна
2004-11-09  3:13 Re: Регина Валериановна
2004-11-02 19:59 Re: Центр тарифной политики  ОАО "РЖД"
2004-11-02  4:00 Re: Центр тарифной политики  ОАО "РЖД"
2004-10-21 16:59 Re: Евгения Елизаровна
2004-10-21 15:36 Re: Елизавета Аверьяновна
2004-10-10 18:55 Re: John Gard
2004-10-10 18:45 Re: John Gard
2004-09-07  7:12 Re: Ярослав Леонидович
2004-08-08 11:28 Re: lefthand
2004-08-08 10:41 Re: lefthand
2004-08-08  6:42 Re: lefthand
2004-07-29  2:53 Re: info
2004-07-29  2:53 Re: info
2004-07-23 22:19 Re: sugih
2004-07-23 16:17 Re: Murray
2004-07-20 13:58 Re: Vhdl-mode
2004-07-20 13:15 Re: Vhdl-mode
2004-06-26  5:49 Re: Востросаблина Карина
2004-06-13  3:14 Re: Язикова Изабелла
2004-06-11 18:58 Re: Валерий Ланшаков
2004-06-10 22:33 Re: Чагинова Снежана
2004-06-10 15:15 Re: Валерий Ланшаков
2004-06-06 16:08 Re: Щербухина Вероника
2004-06-06  7:43 Re: Валерий Ланшаков
2004-05-31  4:05 Re: Будищева Сабина
2004-05-24  1:55 Re: Резенкова Надежда
2004-05-23  5:34 Re: Горемыкина Оксана
2004-05-22 11:30 Re: Боровистова Эльза
2004-05-16  6:16 Re: Липинская Анна
2004-05-15 21:46 juli
2004-05-15 18:05 RE: juliy
2004-05-15  1:06 Лазлова Виктория
2004-05-12 18:20 Re: Аниськина Мария
2004-05-12 16:50 Re: Сеткова Лора
2004-05-12 16:50 Re: Рютина Ева
2004-05-12  0:59 Re: Манякина Наталья
2004-05-11 23:06 Re: Пыжьева Эмилия
2004-04-21 11:56 Re: Роман
2004-03-11 11:22 Re: Romia Fersi
2002-10-18 18:30 Re: Josep Maria
2002-06-10 22:22 Re: Emiliano La Licata
2002-04-10 11:41 ¿¬Áö
2002-04-04 22:49 Re:Àú ¿¹¿ä Áö¿µ
2002-04-01  7:39 re:¿äûÇϽŠÀÚ·áÀÔ´Ï´Ù °í°´Áö¿øÆÀ

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG9ihEtUqeqwpiQn0XwPuN0_Fnodxa18k42uAJ78DW8XUtBEMA@mail.gmail.com \
    --to=davin.pearson@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@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 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.