From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: `font-lock-add-keywords' works... sometimes Date: Tue, 19 Mar 2019 23:09:41 +0100 Message-ID: <871s32sehm.fsf@web.de> References: <86sgvjjpeu.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="44034"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 19 23:13:54 2019 Return-path: Envelope-to: geh-help-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 1h6MzZ-000BIe-Ut for geh-help-gnu-emacs@m.gmane.org; Tue, 19 Mar 2019 23:13:54 +0100 Original-Received: from localhost ([127.0.0.1]:38258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6MzY-0005S3-U2 for geh-help-gnu-emacs@m.gmane.org; Tue, 19 Mar 2019 18:13:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6MxI-0004Hv-CI for help-gnu-emacs@gnu.org; Tue, 19 Mar 2019 18:11:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6MxD-0006L8-Lg for help-gnu-emacs@gnu.org; Tue, 19 Mar 2019 18:11:30 -0400 Original-Received: from mout.web.de ([212.227.17.12]:43569) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h6Mvl-0004uY-NN for help-gnu-emacs@gnu.org; Tue, 19 Mar 2019 18:11:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1553033384; bh=Q5mnZVYNWOlfvadVaQyiMFcAtG3C9XhwvEfBtixQHC0=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=gP2cfY3tQvR8DdlO0fdN8Sc7e3HQGqv8cXHSmiZwYwAviZL3CL9hN0Luuu8okuYK5 880Gm7adntKAu0VdqItn6r2i9hQkdhBSg/FhZVkeIybH5MrgMBegQISpa5IL0kY6RL L0Ehul25fNUGwvmXGpdxzC04L6NkLoNFFf1mwKLg= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([88.67.111.211]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M2uao-1gqUjm0tao-00sgVl; Tue, 19 Mar 2019 23:09:44 +0100 In-Reply-To: (Stefan Monnier's message of "Tue, 19 Mar 2019 12:44:48 -0400") X-Provags-ID: V03:K1:qDMMLMRea9GQpjeTCkRzcIsglDXWcrl+W4X4nyPQ+2WNKNDmSfU W/xG6ExKwugPN1X/LSuLNGuNAnyn1aLi99GUT8S4yG0wT3fYc/G4kCkOw2rY35ofzOWh4qR bAXV2SSTKqi01we4LGxU1QFqw5MxqYZg4EJshpszSbuAKear5TDbd/a2M/yVQZ6lOB521zM ZHHZ4noPzFafreU8BQaTg== X-UI-Out-Filterresults: notjunk:1;V03:K0:tx6kiJ4QfXQ=:NtpGCvBM9Nf7p/zXie1q+v /rZRNLm5Wfe7Yrt316DTzF4UWdZSGTEf5LEaYrrHTNEp0NNyZKL3ZClEkNI3Ld90jtnJkkC9L 6oYicyw3vSX+PqfMCGwLqklvLLs7YOgfM/YSHPc794Dn8gWC9H6ZSF7afbJxbOVPbf9pNjE8Z POe9xWZltNKYn2pvfod6nAKJ6BfT1HuCMo6UPEhvJEQRnnc5BzPAP8tF25IAmqouldX2ZeFDG LqHaML2XLcHrjZ6M1gHT78c0gzMKhRXeYDJm2TZKRa/+Bt9HSWq40G+xYia+52ypObSMnp0zZ KRd5vfYIgaq30Jo0JYejsDYu29f8KdknnjThcXkStpJZF7uFKYmxe2ZlTtnwyaJXXKuWLywE4 rUoPqqgR4ETmUAqRdBa8YDdawLrTo3HTJ3YeYFBVz4ZrQ7Wsuj0PBXKK1dS8VdASFtxydhdGO lsXwg5R2+lQlVyu8Y9XnK2Ew6fmmAZIc7d3xr05zU52bCQdOqg0VSNQNSdHMV+514wvSzk5kX DmEp1OF23/ODXxXHmpbWcksrjvUvO9HcqSrbZyKrR173inf1zQokDCVdzPY2p9TLRyqwK+I+w 9U3n4DPvHpYFLtHRD76Q+ItjNjgKRqgFrmLcpESH307qhbz8I7T/0dX3/tpsyMtf04R7YCjHh B62JV/+2Mm0MEpWWtbNsyWZ3MTgmaBLsChFZfB3gDurtuYP3hWy//rpWbiBLoT/f3R+9JD3TT JQDWfDlkiiHrk+wTosdHB/ctR74xftGmBXuXTfueba3jazNxhncf8VbeG5fJr2QBjnjhKdmU X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:119688 Archived-At: Stefan Monnier writes: > > but not this > > > > (font-lock-add-keywords 'text-mode > > '( > > ("yellow" . font-lock-function-name-face) > > ) > > t) ; append [3] > > You'd first have to clarify what you mean by "work", but my crystal ball > suggests that text-m,ode does not enable font-lock by default, contrary > to message-mode. But it should be covered by global-font-lock-mode by default. I see that font-lock-mode is indeed enabled but `font-lock-specified-p' fails for a text-mode buffer, so you get a buffer with font-lock-mode on but no fontification. Maybe using font-lock-add-keywords without setting any other font-lock variables confuses font-lock? An explicit `font-lock-set-defaults' call helps btw. Michael.