From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.help Subject: Re: tutorial on faces ? Date: Thu, 7 Feb 2019 14:47:56 +0900 Message-ID: <29567580-B9BC-4942-AA7A-2183C28304E4@gmail.com> References: <18CB97AD-A448-47CD-97C7-6B4E825D2061@gmail.com> <54912792-0816-47b2-9c24-1f9230c17a59@default> <2A2300D5-9929-4996-B507-FCBC72A778C9@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) 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="156625"; mail-complaints-to="usenet@blaine.gmane.org" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 07 06:50:30 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 1grcZy-000eZT-3Q for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Feb 2019 06:50:30 +0100 Original-Received: from localhost ([127.0.0.1]:34812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grcZx-0004ED-14 for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Feb 2019 00:50:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grcZT-0004Do-CM for help-gnu-emacs@gnu.org; Thu, 07 Feb 2019 00:50:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grcZS-0007P7-8e for help-gnu-emacs@gnu.org; Thu, 07 Feb 2019 00:49:59 -0500 Original-Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:39046) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1grcZS-0007Oa-0Y for help-gnu-emacs@gnu.org; Thu, 07 Feb 2019 00:49:58 -0500 Original-Received: by mail-pf1-x431.google.com with SMTP id f132so2014104pfa.6 for ; Wed, 06 Feb 2019 21:49:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=kx35DUJiChEbiJ1txxGR/C3dZqG/Sh3mgTzWc55nupE=; b=IVmX6CSoQBsprjOhybzGVju5UREsbvvwWUfXW0hiVhcL0wU2a1u4TiGmKJG7LqpfJ1 pjhPRJj9JeCcg2xtJOg8My0TrD49zrGQ3lBXxlL+gwGpTv3ByaN+OYnNBQT1Fan3aD+f oj5Z2zTB4CDP+95eOxmXyZ8bjgzA3KeuQ6tI9O4JI1scEKDJjq6KYhD/zCigzj3/wiQK 6ubNWgd0KUgEBbnSr1fURy74F6CmJ07UdVP/h9rJvidxosFkX1pXzciF6ldw9tbqj11g /sUYPsmSiyeT5F7qPWAiPxwOdwQQOhS/M73ut7qpwVCYVmIqMiJ+JMnpuKP2asrawnu6 q+Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=kx35DUJiChEbiJ1txxGR/C3dZqG/Sh3mgTzWc55nupE=; b=qWqYuOq8Bt0OtLCG8MhSsJoGLfk3ElbBHnUUS1+/IYH8Kd0QjCP8Tah9wPdTlwLgOn Er1FZa5lA1FKznHSsm23SiHmXOMaGLqOLGVLIPkresfxtgUMZR4ROGR8I0PYjMOkI63w 9u1bOvkic1fIFFqEWe3cWuvszTVSjow+ZZk1Z5+Zpbm0Zaua999J2uFqabqF/n6xOfkA 9nJxcL2ZXP1vixrd4M5W7Ae8bnHpbSSQht3iTti+7vOVb1Di5jx+tg/xetHPVuhBgAk/ ToWB+JHFCWKptLeSCbxcmKuSBM42QPOny0oFm1mbjLBEtXte8USjq7GexL8rajoZX9xM KlJQ== X-Gm-Message-State: AHQUAuZgUHDx8W7aTkP5m0ASMHC2Ov00nsJV6M3awb+SZ8pdiotQgE6h ekqddv9kn9GYFfeMa40ds0T16Ty+ X-Google-Smtp-Source: AHgI3IYEALQMMM6sOoSpGFP+EgH7te9VsEcMHWhzFUTIhqZpZe4m1Ey7vhyvCqRt644bInI0jlX/aw== X-Received: by 2002:a62:4e83:: with SMTP id c125mr14605804pfb.101.1549518596040; Wed, 06 Feb 2019 21:49:56 -0800 (PST) Original-Received: from [10.254.2.134] ([210.160.37.45]) by smtp.gmail.com with ESMTPSA id l82sm22108163pfg.127.2019.02.06.21.49.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 21:49:55 -0800 (PST) X-Priority: 3 In-Reply-To: X-Mailer: Apple Mail (2.3445.102.3) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::431 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:119238 Archived-At: > On Feb 7, 2019, at 1:45, Drew Adams wrote: >=20 >> Well, I'm tweaking poker.el at the moment and I'm looking for ways to >> apply style to some parts of the messages. >>=20 >> Honestly, the elisp manual gives me no idea how to do that... >=20 > OK, good. But what do you mean by "style"? > Do you mean that you want to apply a face to some > parts of some messages? That's correct. Coming from a HTML+CSS background, I thought that I could find a way to: 1) define some styles (for ex. "poker-action" as an already defined = emacs standard style) 2) select the strings that need style (for ex = "folds|calls|checks|raises") 3) apply the "poker-action" style to the defined selected strings I was thus looking for a way to define styles, a way to select strings = (or positions) and a way to apply the style to the selected strings. > If so: >=20 > 1. Do you want to apply the face to the buffer > _positions_ of those msg parts, as an _overlay_ > property, or do you want to apply it to the > _characters_ of those msg parts, as a _text_ > property? I don't know which is more appropriate to what I have. > 2. Are those message parts recognizable/definable > in a regular way, i.e., as something that you > can define using one or more regexps? Yes. > 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. 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. There are some echo line (message) strings but I'm fine without having = them styled. > If the answer is yes then look at using > `font-lock-mode' to define and highlight those > parts. If the answer is no then maybe look > at using ad hoc highlighting, such as you get > with library `highlight.el': >=20 > https://www.emacswiki.org/emacs/HighlightLibrary So I guess the answer is Yes. > Knowing the answers to these, and perhaps other, > questions might help you direct your search for > tutorials (e.g. whether to look for tutorials > that involve font-lock highlighting). >=20 > The more you can specify about what you're > interested in, the more helpful people and search > can be. Jean-Christophe Helary ----------------------------------------------- http://mac4translators.blogspot.com @brandelune