From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pietru@caramail.com Newsgroups: gmane.emacs.devel Subject: Re: prettify-symbols-mode to handle "\alpha-\beta" ... Date: Sat, 6 Feb 2021 00:44:43 +0100 Message-ID: References: <5588fb258084b189877d@heytings.org> <5588fb25804d75ad55f8@heytings.org> <5588fb258084c2eaef40@heytings.org> <5588fb2580b5626b4450@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18292"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 06 00:45:27 2021 Return-path: Envelope-to: ged-emacs-devel@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 1l8An1-0004fK-Kn for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Feb 2021 00:45:27 +0100 Original-Received: from localhost ([::1]:50438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8An0-0004Ic-Fy for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Feb 2021 18:45:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8AmN-0003nj-U9 for emacs-devel@gnu.org; Fri, 05 Feb 2021 18:44:47 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:53411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8AmM-0007sz-6F for emacs-devel@gnu.org; Fri, 05 Feb 2021 18:44:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612568683; bh=7LlMGILjeGwwKtGNDcxXofOEa6FKCL2UAtXWz2/sIXc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=h1Vrm/aZN7xiPo7LUAnr1iYhG5NR6hgtZexGvhysX5S8xr+cmU0fQN0KJqETxNsPb IGXVe5riI20kUhcE+bfGdGVImQSoD/HgfFoqY0UfyKn8RzC2KWvYbOIo9j7Y7fpKN4 tAftD4KUdib6IOQEqejbHbP9hR402xV9b39mUhLQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs10.server.lan [172.19.170.178]) (via HTTP); Sat, 6 Feb 2021 00:44:43 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <5588fb2580b5626b4450@heytings.org> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:KsWuIL6wEsNXI+BKRPfrVRz07sADcvSnAlghV87F8SUwo6WoS9Ww/Yl450KMXapHtTnBo tMuQ2OoC89cjzoejNQ7Z5aSPPwnMNcQW6qUUyAWrU9+Kzn2vjaL/xxOPMQWWHrhlUnPOohYk9rLS BQIxycAVVKgN3YXSiNLgTsNLf2dSeGnIhK2qcNAPS3o0hU4lpOKACbF01X5nHsiiZNI5+Ea7T7D7 QCFVaOSP8my84nd3Y7L9R3CWXV+fpT0ZHsuiBaUZoBnvvsuhjq1PMzCZfZEZkrWTujygvjNnjBaS fo= X-UI-Out-Filterresults: notjunk:1;V03:K0:bV/jtyl9h+A=:9g50K68ch8RM3GjCFCbBke cFUryoz8gIYhUg36tPwHQle7BRnQcDUV/QBB+BIE+AHO1qtzXYcBKCJTdQpkk4suDiz5wS3RJ 3Fyj4/AYcvSRoSvkwu8qdmzEUm3CqBZMtBANhl3r+av2iHhXZmywFR+F4LiuBgfx6YgWkJo2J zAuODJdja9G9O1Xv+JQiKbML1E9RgBNFkiGGMj6XfKHAfmNpGYwy/1pSzJ7Qs2UPFaHe54obj xQr6JXmJtKbTdbtcjgK7Ua8juUKDfJmZqxsLH2DM/S3uHjsVxieZqWlAm5InAXVULVURw2VJa nnrYgOPOR0mKy1iFICJecI+PAVaBNaEuEpC93OBQx3bJe02a6y+GH2on5b4XbHFqM92KhJ5xV Rj5QQHcYzhG1fy7HaAaSrE2QXvodApMV3k8p/Zpbn2AXkd3Vmm+babqICvWSELApzSz7KPdxp Y96WfhyJRHlF38T+fE8xsOIBvcqVTV4vSmDXMp85Iab7mrIV1ZQ8thDRGMde43IvMw6mJWzij 81ltM1qvC7J7QcYsQaYQNCHPm1qOdSnz1SXnJPu6l60SJx5YQyLmpcJhONO7GRfll92uYFejm 6kvaIdVlJ0y5M= Received-SPF: pass client-ip=212.227.17.21; envelope-from=pietru@caramail.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:264032 Archived-At: Currently I am trying to see things work for myself, then finally decide wh= at to use and improve texinfo later on=2E > Sent: Saturday, February 06, 2021 at 11:22 AM > From: "Gregory Heytings" > To: pietru@caramail=2Ecom > Cc: emacs-devel@gnu=2Eorg > Subject: Re: prettify-symbols-mode to handle "\alpha-\beta" =2E=2E=2E > >=20 > >> (defun texinfo-prettify-symbols-compose-p (start end _match) > >> ;; We know the matches all start with a backslash and end with > >> ;; a word-element=2E > >> (not (or (memq (char-before start) '(?\\)) > >> (memq (char-syntax (or (char-after end) ?\s)) '(?w)) > >> (nth 8 (syntax-ppss))))) > >> (add-hook 'texinfo-mode-hook > >> (lambda () > >> (push '("\\alpha" =2E ?=CE=B1) prettify-symbols-alist) > >> (push '("\\beta" =2E ?=CE=B2) prettify-symbols-alist) > >> (setq prettify-symbols-compose-predicate 'texinfo-pretti= fy-symbols-compose-p) > >> (prettify-symbols-mode))) > > > > So I have to add the following defun in prog-mode=2Eel? > > > > (defun texinfo-prettify-symbols-compose-p (start end _match) > > >=20 > I don't know what you're trying to do=2E If you're trying to do somethi= ng=20 > just for yourself, just add the above lines in your =2Eemacs file=2E If= you=20 > want to improve texinfo-mode, the defun above should probably go into=20 > texinfo=2Eel, with the "(setq prettify-symbols-compose-predicate=20 > 'texinfo-prettify-symbols-compose-p)" inside the "(define-derived-mode= =20 > texinfo-mode =2E=2E=2E"=2E