From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: How to add syntax-highlighting to a Help buffer? Date: Sat, 04 Jul 2015 13:54:38 -0400 Organization: A noiseless patient Spider Message-ID: References: <87si94x1vk.fsf@web.de> <878uaw3qpc.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436032518 17148 80.91.229.3 (4 Jul 2015 17:55:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Jul 2015 17:55:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 04 19:55:17 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZBRen-0007Af-3B for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Jul 2015 19:55:17 +0200 Original-Received: from localhost ([::1]:44959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBRem-0006fu-I4 for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Jul 2015 13:55:16 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 Injection-Info: mx02.eternal-september.org; posting-host="77dfc20685d6333c044388a259a97140"; logging-data="20492"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++6XuoCZV7MxZHtRawUJx7" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:KheeP7DSPsCmB22ZKkuVJIZ6mZE= sha1:epm+lGfHVSQImEWMWbYCA6cuL6I= Original-Xref: usenet.stanford.edu gnu.emacs.help:213146 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105433 Archived-At: There are 2 "font-lock"s: - the font-lock-mode minor mode is used to control whether to highlight or not. IOW it's the way the user tells Emacs whether she wants things to be "colorized/highlighted/fontlocked/younameit". - font-lock.el provides a functionality to automatically highlight/colorize/fontlock based on the buffer's content. At some point in time the two were one and the same. But there are cases where it's easier to add the highlighting as part of the creation of the buffer's content rather than separately (where we'd have to re-discover what that buffer's content mean in order to highlight it correctly). So there were modes that highlighted their content without resorting the to font-lock machinery. Since then we've tried to unify the two using the `font-lock-face' property: you can add this property to your buffer while filling it, and if the user enables font-lock-mode then this property will be "displayed" whereas if font-lock-mode is off then this property stays dormant. For some reason (not sure why) help-mode does not use the font-lock machinery, so it could/should use the font-lock-face property, but it has not been updated to that yet. Stefan