From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#35044: 25.2; Description of "disappearing" faces (Emacs Manual) Date: Fri, 19 Apr 2019 17:47:55 -0400 Message-ID: <875zr9vf90.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="237335"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: 35044@debbugs.gnu.org To: Sebastian Urban Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 19 23:52:46 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hHbR8-000zed-4A for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Apr 2019 23:52:46 +0200 Original-Received: from localhost ([127.0.0.1]:33686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHbR7-0006RC-0j for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Apr 2019 17:52:45 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHbQx-0006OV-Dj for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2019 17:52:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHbNX-0005Ip-9K for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2019 17:49:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59522) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHbNX-0005Ij-1B for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2019 17:49:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hHbNW-0001ed-BH for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2019 17:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Apr 2019 21:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35044 X-GNU-PR-Package: emacs Original-Received: via spool by 35044-submit@debbugs.gnu.org id=B35044.15557104866291 (code B ref 35044); Fri, 19 Apr 2019 21:49:02 +0000 Original-Received: (at 35044) by debbugs.gnu.org; 19 Apr 2019 21:48:06 +0000 Original-Received: from localhost ([127.0.0.1]:44833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHbMb-0001dO-V3 for submit@debbugs.gnu.org; Fri, 19 Apr 2019 17:48:06 -0400 Original-Received: from mail-qk1-f175.google.com ([209.85.222.175]:40216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHbMZ-0001cs-L6 for 35044@debbugs.gnu.org; Fri, 19 Apr 2019 17:48:04 -0400 Original-Received: by mail-qk1-f175.google.com with SMTP id w20so3554110qka.7 for <35044@debbugs.gnu.org>; Fri, 19 Apr 2019 14:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=cJeG+jSZpMU9wEN6N4dDt0KGXupgO1p1d3v+dGmryvs=; b=GdZnkSpSMi0XHVyO99Dzayu6Tvm9v7rNSRcB6KfAo0JuM1A0rMImkIdvED+QjKV8RR KsZRp8jy3gXifiPWLGyVpFkuuYxLTbNBCr521Grn1X9bXQkos7BMssk1PL3Ig9X5tJkZ w/CCHNl1V6ROzJ15H0DxIVuTBCn1zEocRUH/JaOKc13FgOtm1KpwedcJ1nTMz14Q0SDB 9LbmWy9wuyCEjbT8Qs2vgYu1Lh2KK/QFMgOEpcRGUP/VDkpNHIOa5Jo4iau/Wp9DYyNH YfcZpeLHER6DD8igarFicEIJcgv62BjEO638pRGVetQ+IzMrmgsMrS9fWk0pud5bgXpq EyRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=cJeG+jSZpMU9wEN6N4dDt0KGXupgO1p1d3v+dGmryvs=; b=COyt71cqwDg1qCj2nW2mzAMCrkcn2EDM8oC4lUDgeS7tr2Zlmix9fJ+6S2RFQ5Skim Kna/UWO6RcVzwmg5GUo3vv/mZZ7sGRLhD2yDmNLjgRC4IF9tTHBbxaZDffEE2cxbS8AT hUVUtQ0nXxPlbgRbQuOXLPZS4Oagzfe5ERUh7KZP73JM/iLvQG5L3WaS5zJJTs7405g4 8aIJzGBBmuYwPBPJn4Cgp1dxDEM3gUujoxa0vospww07eKb6fxZz4HzgKBc16GvNSplo EQs8Xi3VO9Y4jSnBoaTQwC47QL64OCA65h27K5f+JLI45KGzbCEWUpPdHT5QqGOkwuUM UQLA== X-Gm-Message-State: APjAAAUIXdxHoMz1a3DwjJzF/LuhJWY6Gr2oyl+Pvy1h/D+zefSE5+Th q9TglWTk567wp2ADVM/m2aMxJgt8 X-Google-Smtp-Source: APXvYqx61d8m5xs/cdN854PLfq4J4y5fWc6IVTHzurW8rVLKUCRwBpmobADBXHGqjT2Y6zHMO7nG6Q== X-Received: by 2002:a05:620a:1438:: with SMTP id k24mr4714774qkj.165.1555710477938; Fri, 19 Apr 2019 14:47:57 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id f65sm2868235qkb.83.2019.04.19.14.47.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Apr 2019 14:47:56 -0700 (PDT) In-Reply-To: (Sebastian Urban's message of "Fri, 29 Mar 2019 20:43:33 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157873 Archived-At: --=-=-= Content-Type: text/plain Sebastian Urban 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Recommend-using-font-lock-face-over-face-Bug-35044.patch Content-Description: patch >From 12148e9d93f885fd6e4e82f485c319486c1e9652 Mon Sep 17 00:00:00 2001 From: Noam Postavsky 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 --=-=-= Content-Type: text/plain > 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? --=-=-=--