all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Sebastian Urban <mrsebastianurban@gmail.com>
Cc: 35044@debbugs.gnu.org
Subject: bug#35044: 25.2; Description of "disappearing" faces (Emacs Manual)
Date: Fri, 19 Apr 2019 17:47:55 -0400	[thread overview]
Message-ID: <875zr9vf90.fsf@gmail.com> (raw)
In-Reply-To: <e5f360ab-e512-5ad1-2999-004eb6e69634@gmail.com> (Sebastian Urban's message of "Fri, 29 Mar 2019 20:43:33 +0100")

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

Sebastian Urban <mrsebastianurban@gmail.com> writes:

> According to help-gnu-emacs thread
> (lists.gnu.org/archive/html/help-gnu-emacs/2019-03/msg00205.html) this
> is normal behaviour, but from perspective of beginner it looks like
> a bug.  Therefore I suggest a sentence or two, perhaps in chapter
> "11.12 Font lock mode", about how Font lock takes over control of
> faces when user switches to mode with defined font-lock faces leaving
> only those from this mode and turning off others (unless they have
> also property font-lock-face).

So I've been looking at this, and I think maybe the only manual change
needed is in the Elisp manual to more strongly recommend using
font-lock-face for this sort of thing:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1351 bytes --]

From 12148e9d93f885fd6e4e82f485c319486c1e9652 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Fri, 19 Apr 2019 00:55:14 -0400
Subject: [PATCH] Recommend using font-lock-face over face (Bug#35044)

* doc/lispref/modes.texi (Precalculated Fontification): Explain
advantages of using font-lock-face over face.
---
 doc/lispref/modes.texi | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 919816f3de..0ff13d72e2 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -3201,7 +3201,12 @@ is disabled, @code{font-lock-face} has no effect on the display.
   It is ok for a mode to use @code{font-lock-face} for some text and
 also use the normal Font Lock machinery.  But if the mode does not use
 the normal Font Lock machinery, it should not set the variable
-@code{font-lock-defaults}.
+@code{font-lock-defaults}.  In this case the @code{face} property will
+not be overriden, so using the @code{face} property could work too.
+However, using @code{font-lock-face} is generally preferable as it
+allows the user to control the fontification by toggling
+@code{font-lock-mode}, and lets the code work regardless of whether
+the mode uses Font Lock machinery or not.
 
 @node Faces for Font Lock
 @subsection Faces for Font Lock
-- 
2.11.0


[-- Attachment #3: Type: text/plain, Size: 404 bytes --]


> Also the behaviour of reappearing table-cell face after switch back to
> fundamental-mode or text-mode seems to be not quite right, shouldn't it
> reappear in every cell at once (just like it disappears)?

If I understand correctly, this is rather a bug in table.el: it should
use 'font-lock-face instead of 'face, and then all this buggy behaviour
will go away.  Perhaps you'd like to send a patch?


  parent reply	other threads:[~2019-04-19 21:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29 19:43 bug#35044: 25.2; Description of "disappearing" faces (Emacs Manual) Sebastian Urban
2019-04-16 21:33 ` Sebastian Urban
2019-04-17 12:59   ` Basil L. Contovounesios
2019-04-19 20:19     ` Sebastian Urban
2019-04-17 17:03   ` Eli Zaretskii
2019-04-17 22:37     ` Noam Postavsky
2019-04-18  2:34       ` Eli Zaretskii
2019-04-19 20:32     ` Sebastian Urban
2019-04-19 21:47 ` Noam Postavsky [this message]
2019-04-20  6:23   ` Eli Zaretskii
2019-04-22 20:03   ` Sebastian Urban
2019-04-22 20:59     ` Noam Postavsky
2019-04-24 22:01       ` Sebastian Urban
2019-04-26 12:49         ` Noam Postavsky
2019-04-27 15:55           ` Sebastian Urban
2019-04-27 21:20             ` Noam Postavsky
2019-04-28 21:17               ` Sebastian Urban
2019-04-28 21:22                 ` Noam Postavsky

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=875zr9vf90.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=35044@debbugs.gnu.org \
    --cc=mrsebastianurban@gmail.com \
    /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.