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:44:03 -0800 (PST) Message-ID: 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> <2105bb15-c923-4887-935d-c3fc8bc4b290@default> <79C3F1E3-45E2-4A59-8AFF-1134F66EB66C@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="113557"; 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:44:58 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 1grlrF-000TN8-AF for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Feb 2019 16:44:57 +0100 Original-Received: from localhost ([127.0.0.1]:42307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grlrD-0007OJ-Ux for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Feb 2019 10:44:55 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grlqZ-0007Ny-QN for help-gnu-emacs@gnu.org; Thu, 07 Feb 2019 10:44:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grlqZ-0007vO-1o for help-gnu-emacs@gnu.org; Thu, 07 Feb 2019 10:44:15 -0500 Original-Received: from userp2120.oracle.com ([156.151.31.85]:58750) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grlqY-0007up-Oc for help-gnu-emacs@gnu.org; Thu, 07 Feb 2019 10:44:14 -0500 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x17FdYjo051601; Thu, 7 Feb 2019 15:44:12 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=BmCAkWFSXIbJcUr2qiMwWlkEz7HNpClJZfE3S2G45lM=; b=32DXhzDq0A7ZAxjp5YI5ZUQ9numAeP1d0fJBcOFpdAFvaNCKszfrBBJLX0w0oUgeRjYJ H25xUvmGyIi0QhEvswG7ge6SHQpRQ/FzaGYgAPWQd4GhzZN+U/OUgz33pFymTLhMR5ta a6gTBkbMs2dbuGZcGqp7GxiRRCFhcqrZXggVo5iEw6F+dDimkiwN0QwOvZYnJ71iXa6p 1wbS/hTrDeSGN5UQWvsAL2hoQm6oekqPLQID1GMQDh8tcnU3XgaXq+LtzMVrm5F6HY7I KXrzyKH0GpWl6Mvev1KDbSKH7xq8fTxCkjoYOiVwfGMRcK1AV5De5nRPlcaKvhAlm+uD IA== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2qd98nfny7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Feb 2019 15:44:12 +0000 Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x17Fi6og005573 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Feb 2019 15:44:06 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x17Fi6f0000703; Thu, 7 Feb 2019 15:44:06 GMT In-Reply-To: <79C3F1E3-45E2-4A59-8AFF-1134F66EB66C@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=926 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902070120 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 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:119247 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? > >> > >> 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. >=20 > Yes. But I'm not sure I can call (my tweaked) poker.el a "mode". It is > just a program that outputs strings based on inputs in a dedicated buffer= . The buffer is in a (major) mode. You typically define font-lock patterns for a given mode. You can define your own major mode using `define-derived-mode'. I probably should have mentioned this: To highlight parts of a string is one thing - use `propertize' with property `face', for example. To highlight parts of a buffer is something else. You typically use font lock for this. Font lock periodically updates the highlighting, even as you change buffer contents. It applies a set of highlighting rules (regexp patterns, for example), in sequence.