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:15:46 +0100 Message-ID: References: <87r1lwmrgc.fsf@telefonica.net> <5588fb258084b189877d@heytings.org> <5588fb25804d75ad55f8@heytings.org> <5588fb258084c2eaef40@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="25161"; 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:37:03 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 1l8Aes-0006Ow-N3 for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Feb 2021 00:37:02 +0100 Original-Received: from localhost ([::1]:40488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8Aer-000838-Nc for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Feb 2021 18:37:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8AKS-0001BG-Ul for emacs-devel@gnu.org; Fri, 05 Feb 2021 18:15:57 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:42043) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8AKK-00036Z-UJ for emacs-devel@gnu.org; Fri, 05 Feb 2021 18:15:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612566946; bh=BuxStF3tu2DMMidOuiODm5X2SaSPxQo9kuHzbR5UPLQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=kNrCFybIfpQX1U5A+CMG2nvDj/qf5AxJF36hSVhKBLd9V1jnJRXGMpYuB9QGjDhXl 7C36oDPX5CGe/xpYZ30bbU2KaXLzMAEhgFeKGWnZJEJXh7+kv+DmaAUKyqlkVFv9qe ul+PEZg+D8pGIteBBxJeP7cg/QXvqkDXVkCoYKiY= 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:15:46 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <5588fb258084c2eaef40@heytings.org> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:WSLs913iqyR5SXNBQ5QFSYc2lD4Nc5eje45trHzpav2snhfpU3IbiFy2p8KpoHF1ppnRg Ajkl+vEbR7GwPw/gWQAHcODnBAM3RlQnVKwWG/+fumuvFmFz2cQvBo5YWYnB0hcMRkJfW5FLEsAq STlZ+f1RyH28XV99FRlEaBsuFy09yQSJZ0k+OVt4fbIywduWSvuGHA6suRR9J26+UYnH4VpOCn5J dtIeMqxdtm3lcZKs3zHFz8qZ0Wny1YXfawtf0ADmURD1Anj7tKCY5nIQrZiP40ILo6SXMfasY8eY uA= X-UI-Out-Filterresults: notjunk:1;V03:K0:0nqxJaId1FQ=:1kmSmPZZvXGxcbHtOE9HSl J0WBZkaW5MJPXb8sNxiBKbuN3qV9CV0gyn1S7tjGIUDzFU1PfPpNVtLk4NKG1Q7SPSXMbYWgp eQVMC2tFIBcjVCjzn+V5SW3LzVdqt4nOf/aUc+hLeSFFHk56sOJhPt/cp3HuKtDiatln1Zo3V ovqbRFau+4AreVZHhXoJEYcjwAaZr9dBnX6CyrhxgjgTM70CAz14kZTolOkD7MaStfvMuuwgR UhjdM8MhRsxk0SdqnrvPzmpmhW4seL/659SIAZxs3K2q48beXQBqi91ompFGlv8wIMtEmvUv3 1oKkfe4eao/nKii5YKFEfpr4e4U5uLSLynTFTDfDNwUToWUB6NK4fWleO4paQRXFH0FAknWwz MPVPt2Iw6rfA9gx6dWNxnHyvGnZ0HwXeI6htW5xXabcpCdvaZpaC3hjT06aznkgYOGj+aY2Aw JuU7lv51+87iejgNLdg9ZwciAE6ftUY0Au2bw+dtuW8qRId/W0fQX/Zry/sxhMD4pmK5GqUgK 2ZXBDzW8FvsCHwrUQBlZpi71Wd/QGAq2ihfUPRLiZR7QA4ZbjUlY3alfzWLL1zid5KO71UPqv 4EaTON/nY6Tpw= Received-SPF: pass client-ip=212.227.15.15; 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_H3=0.001, RCVD_IN_MSPIKE_WL=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:264028 Archived-At: > Sent: Saturday, February 06, 2021 at 11:04 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-pret= tify-symbols-compose-p) > >>>> (prettify-symbols-mode))) > >>> > >>> That is not completely correct because for "\alpha-\beta", only \bet= a=20 > >>> is prettified=2E > >> > >> No, \alpha-\beta is prettified correctly=2E Tested with Emacs 25, 26= , 27=20 > >> and 28=2E > > > > Have tried it in a texinfo document using > > > > @tex > > $\alpha -\beta \gamma \alpha - \beta \gamma \alpha, \alpha=2E \alpha- = \alpha() \alpha[]$ > > @end tex > > >=20 > This works correctly with vanilla Emacs, with the "defun" and "add-hook"= =20 > above=2E So I have to add the following defun in prog-mode=2Eel? (defun texinfo-prettify-symbols-compose-p (start end _match)