From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.devel Subject: Re: prettify-symbols-mode to handle "\alpha-\beta" ... Date: Sat, 6 Feb 2021 00:43:01 +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="11057"; 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:43:50 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 1l8AlR-0002me-IH for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Feb 2021 00:43:49 +0100 Original-Received: from localhost ([::1]:48260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AlQ-0003Ht-JV for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Feb 2021 18:43:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8Akn-0002qT-29 for emacs-devel@gnu.org; Fri, 05 Feb 2021 18:43:09 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:38803) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8Akh-0006xh-C4 for emacs-devel@gnu.org; Fri, 05 Feb 2021 18:43:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612568581; bh=bnpezOar3JOPmes02uBsZGJVh1+7s+XyWB4V/+NXtDk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=cg/v4z1k9ucyXK+0DZhTYMW3qhWe8gJ1e0IbrnjRBQx1TK2zke1eNhVlntP38KZQZ w4rN31STM29xlFDLKPz04IaH65OsWT6pMOuhZd/yDsqaUoJoPJhsONmT+slN7yhgGh qxCPxADokzfzJoy+csPCit9AgCgfDo61NLt7nYqk= 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:43:01 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <5588fb2580b5626b4450@heytings.org> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:zTc5sV2hI0bbP0UMVrX3ioIBEUKtWquP1UJOz2lsyDvUvZP5Xh5/oQlUplX5+hJBALlA1 mBkKT8J6MSeBj0XDNS4YKNhOnQfUQcdKLYBJFNMwzndFrLz6DEbW1Vd8vVmrM5b03VaOrzvSKDT9 u8o4boojKqAjH5CpNWSw4eDOYSDcpEfq+NtTo9a0VNQ7l6VDWZ11jpmTxTBnL9WZQyv7FW98sduo bhuHuL5ZcSmhYg2BkRv1dAZjRUuWUhjFu7zJY1XT+E1OWcbt3LOUyyQhGniIAXU1x9Z7DXrf52D/ 7A= X-UI-Out-Filterresults: notjunk:1;V03:K0:z016rHNTGL8=:B9rlx3eG3wGrj6OEEv2r6B IU34SXOyeCpIBTVdeTtxq8AWlL43SVZLplo+McCWfqrqVGBuETeu7/XrwY2KrpSdxRq90bDxN vPtmNzHZ/Yf3uUbHMImMR6XNEt0AWxocDzDj8tw6lfPOU6/nMFsid6RyGMGzPqzyTbs5vFJ8T LLFpKfVyk+zF31Ej+JZz+8212/fzQ4olZvbNlZWAfLtLKibkcKAUDiJr7ZkqWUBDeNG+Wd+kZ 7x6SAjCFRwdcbVeyTwty2+GooBgAZFMPYlhxtePMXs6Sk6SuqVgoHMtbM2EBu9zZ0ubrO7kSk 3EQg9feKiRkj4xvgUFJgCYVi6N096WxwiQC+bu0F5mI298xNbKK9owKoHUtxv3q/m5qBn7WCV azwgyGeUvxsV1a+e+T0zMrp5Gc7ZZUxgQ411r+OyJv/CqEDWTOsxozWHpY8oLtD7kw2iyRG2l 99qmvTXiaM7PlHzIoBG1lVRB67jxt+NH1VSiV4woj5tCNvIsWVqZ2ckF9eqyrIQxnzISp7tcN bo+l+1EkRwap/tdwOH0lDVEnXKrBTkku/UKJj9HWcE7VTuYKgc1RJnq5uMSBeAENXMhKf9WnW WZXICjmUldAy8= Received-SPF: pass client-ip=212.227.17.22; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:264031 Archived-At: > 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 Have tried the following expressions, which display correctly=2E=20 \alpha-\beta \alpha+\beta \alpha_{i\beta} \alpha/{i\beta} \alpha^{i\beta} = \alpha=2E \beta, \beta?