all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#71469: font-lock does not apply standard faces and their descendants
@ 2024-06-10 11:59 Konstantin Kharlamov
  2024-06-10 12:55 ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Konstantin Kharlamov @ 2024-06-10 11:59 UTC (permalink / raw)
  To: 71469

While trying to add a face to a major mode I found that both standard
faces¹ and inherited ones are ignored completely.

In steps below I create a simple major mode and it uses an inherited
face, but face does not get applied. NOTE: if you replace the inherited
face with, for example, `font-lock-constant-face`, it will get
highlighted. I.e. the problem somehow bound to faces.

# Steps to reproduce

1. Create `test.el` file as follows:

     (defface test-face
       '((t (:inherit bold)))
       "Test face.")

     (define-derived-mode my-mode fundamental-mode "My Mode"
       "A minimal mode that highlights 'hello world' text."
       (font-lock-add-keywords nil '(("hello world" 0 test-face)))
         (font-lock-flush))
     (add-to-list 'auto-mode-alist (cons "test.txt" 'my-mode))
     (provide 'my-mode)

   And `test.txt` as follows:
   
     ==> hello world <==

2. Launch Emacs as `emacs -Q -l test.el test.txt`
3. Put a caret over the word `hello` and evaluate M-x describe-char

## Expected

The description buffer mentions that `face` is `test-face`.

## Actual

There is no `face` property at all.

# Additional information

Versions tested: Emacs built from February master and a stable 29.3

The problem actually doesn't seem to be related to `defface`, because
passing `bold` to the `font-lock-add-keywords` had similarly no effect
for some reason. More likely it's related to the "standard faces".

1: https://www.gnu.org/software/emacs/manual/html_node/emacs/Standard-Faces.html





^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-12-19 16:22 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-10 11:59 bug#71469: font-lock does not apply standard faces and their descendants Konstantin Kharlamov
2024-06-10 12:55 ` Eli Zaretskii
2024-06-10 13:41   ` bug#71469: [PATCH] " Konstantin Kharlamov
2024-06-10 15:17     ` Eli Zaretskii
2024-06-10 17:26       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-05  1:39         ` Stefan Kangas
2024-10-05 13:06           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-08 12:57             ` Robert Pluim
2024-10-08 13:25               ` Konstantin Kharlamov
2024-10-09  8:43                 ` Robert Pluim
2024-10-09  8:58                   ` Konstantin Kharlamov
2024-10-09 12:48                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-09 13:20                     ` Robert Pluim
2024-10-09 14:04                     ` Konstantin Kharlamov
2024-10-09 14:27                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-18  2:51             ` Stefan Kangas
2024-12-18 10:16               ` Arash Esbati
2024-12-19  0:46                 ` Stefan Kangas
2024-12-19 16:22                   ` Arash Esbati

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.