From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: [prettify-symbols-mode] Two consecutive matches don't work? Date: Wed, 18 May 2022 14:56:53 +0300 Message-ID: <83h75nf3zu.fsf@gnu.org> References: <8f817c96-9a19-45a6-9eef-2e598755970d@www.fastmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39742"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 18 14:05:42 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrIQw-000ABg-1r for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 18 May 2022 14:05:42 +0200 Original-Received: from localhost ([::1]:42154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrIQv-00078S-2m for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 18 May 2022 08:05:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrIIW-0000AJ-Ca for help-gnu-emacs@gnu.org; Wed, 18 May 2022 07:57:02 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrIIW-0007uz-3y for help-gnu-emacs@gnu.org; Wed, 18 May 2022 07:57:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ZCA3dObauPu5qutOuneYHqSHRutfmSym8gYsmeLDtjU=; b=jj/HEAeE6K7J k1SHi5maXCB83ATW1IjlvNcXd3pfkuZGxKyEX0fVIbwkxcr0CbSVdEqNBebzK2miQreo1TtJ5Jyn2 4IrJ3uvXdqvN+83sseo5kXcFmF9XF5nyP4Am8+E7dQzG31/mumDakqe/p2oEvaG5r5vDo8bs5E28J FvejWCE75YbTJHlwtLkix/Qab6BOlFy3bI7Ll8Upvad4/RakqBKIi33tFtnd3fkXMDNuDkR0DSJHa JdQP1gGKAoa7id5pZYkt6RfZ7aGTDvMsHLNusbVUKqhlwsp4vHnKMKZUedyUJPgixgjs9pJiH9yCM EPrn1LsUbl9tRh3QeG/PZw==; Original-Received: from [87.69.77.57] (port=4895 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrIIU-0008J3-I3 for help-gnu-emacs@gnu.org; Wed, 18 May 2022 07:56:59 -0400 In-Reply-To: <8f817c96-9a19-45a6-9eef-2e598755970d@www.fastmail.com> (message from Joost on Wed, 18 May 2022 11:32:07 +0200) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:137304 Archived-At: > Feedback-ID: ie15541ac:Fastmail > Date: Wed, 18 May 2022 11:32:07 +0200 > From: Joost > > I'm dealing with some `.xml` files that contain data which uses the sequence `< > So I thought this would be the ideal use case for `prettify-symbols-mode`. I added `("<" . ?<)` to `prettify-symbols-alist` and activated the mode. > > Unfortunately, only the first `<` in each sequence is prettified. This seems to be due to the fact that the second `<` is followed by the exclamation mark: if I insert a space in between, prettification works. > > Is there any way to remedy this? prettify-symbols-mode is not general-purpose enough, its defaults are tailored to prettifying keywords of programming languages, not just any arbitrary strings of characters. I think you will need to tailor prettify-symbols-default-compose-p or roll your own predicate and bind prettify-symbols-compose-predicate to that predicate, if you want to support such sequences.