From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: tutorial on faces ? Date: Thu, 7 Feb 2019 07:04:12 -0800 (PST) Message-ID: <2105bb15-c923-4887-935d-c3fc8bc4b290@default> References: <18CB97AD-A448-47CD-97C7-6B4E825D2061@gmail.com> <54912792-0816-47b2-9c24-1f9230c17a59@default> <2A2300D5-9929-4996-B507-FCBC72A778C9@gmail.com> <29567580-B9BC-4942-AA7A-2183C28304E4@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="176682"; mail-complaints-to="usenet@blaine.gmane.org" To: Jean-Christophe Helary , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 07 16:07:16 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 1grlGk-000jcy-Mu for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Feb 2019 16:07:14 +0100 Original-Received: from localhost ([127.0.0.1]:41710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grlGj-0000i9-IL for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Feb 2019 10:07:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grlF1-0000Hj-8t for help-gnu-emacs@gnu.org; Thu, 07 Feb 2019 10:05:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grlEt-0003f0-OH for help-gnu-emacs@gnu.org; Thu, 07 Feb 2019 10:05:25 -0500 Original-Received: from userp2130.oracle.com ([156.151.31.86]:60048) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grlEs-0003bw-8K for help-gnu-emacs@gnu.org; Thu, 07 Feb 2019 10:05:19 -0500 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x17ExO5O009468; Thu, 7 Feb 2019 15:04:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=ycNIaUNCzUzUqiY7LcK86UuTL3sub4AWJFVaVo97bB4=; b=asXy2mvpD6TyMC3QBNYm1L6mrWcFHx9glAKjB6YkYBobVob2j5nxB7nFW86c0FwYF1Hk cnh9QedBHAM9HWfjeOhxyhkLqMf8kagg57gtg51hOAt7YT0+wCrm8ps9vQ9eT44iGO3T VZ1Q1NgDgo65Z766/c82IM5FpIDLyLHR1Tvwy3GkZ1hTlq1PGZdMLWxyB+k0X9/s9Xqc SuEG4vanm5+M0uwosziCS14FLN0/UhwIoZeMXiCZznQgGD+dv0xUQ7zCF06JMNfogM04 2TJ0T3ZhYv1ss70ANP/EvHthopnh9WdArnDVnYMuQj7d+NdEl+rDaC63Y5njnI6oaeV5 eg== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2qd9arqdn7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Feb 2019 15:04:13 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x17F4DH5003536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Feb 2019 15:04:13 GMT Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x17F4DO8031922; Thu, 7 Feb 2019 15:04:13 GMT In-Reply-To: <29567580-B9BC-4942-AA7A-2183C28304E4@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4795.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9159 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=937 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902070116 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.86 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:119242 Archived-At: > > And do you want the face highlighting to be > > automatically reapplied to those parts when > > the same text is visited anew (in the same > > mode), e.g. in a new Emacs session or after > > reverting the buffer? >=20 > I'm not sure I understand the question. Do you want the highlighting to be inherently associated with particular patterns, so that whenever a buffer with those patterns is visited in a particular mode the patterns get highlighted. As opposed to just wanting to highlight something now, but not have the same highlighting done automatically just because you revisit the same text in the same mode later. =20 > The way I've tweaked poker.el makes it (insert) strings that indicate > player actions and results into a dedicated buffer. I'd like the buffer > to always display the same style while the buffer exists. >=20 > There are some echo line (message) strings but I'm fine without having > them styled. Messages in the echo area are a different story. Instead of using font lock there, you just use `propertize' to apply property `face' to the parts of the message you want to highlight, then call function `message'. > > If the answer is yes then look at using > > `font-lock-mode' to define and highlight those > > parts. >=20 > So I guess the answer is Yes. It sounds like it (except for echo-area messaging). I'm guessing you can find tutorials or videos or blogs that introduce font-lock. If not (or even if so), consult the Elisp manual, starting with node Font Lock Mode (`C-h i g (elisp)font lock mode'). https://www.gnu.org/software/emacs/manual/html_node/elisp/Font-Lock-Mode.ht= ml Admittedly, that can be heavy going - font lock can be complicated. Start with an intro (e.g. blog), if you find a good one.