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 01:05:33 +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="28287"; 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 01:06:21 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 1l8B7E-0007DI-S5 for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Feb 2021 01:06:20 +0100 Original-Received: from localhost ([::1]:59036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8B7D-0001Da-Pc for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Feb 2021 19:06:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8B6X-0000me-WF for emacs-devel@gnu.org; Fri, 05 Feb 2021 19:05:38 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:39131) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8B6V-0000eD-AX for emacs-devel@gnu.org; Fri, 05 Feb 2021 19:05:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612569933; bh=T4hFPHF/2JBkkVdBaNHu+OVCsipjE8q5BhscwWej5b4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=TZVAwXiXs1hcYe0aSnUSvQVxh89+haaMbepHE+t7gcIY7RsQuEetaWlauOJURYnqJ PcayKs48nwuREQN39tjj1G9ukX7ywZxMe2LQpIhQAm5S00nkYSBbLAdvjoBpRitAxx PQGp/pJypE0F/stQ2uDRB92NBMod7k6N84JR4WaU= 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 01:05:33 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <5588fb2580b5626b4450@heytings.org> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:9nuwDp+IHPWHReJuP0xxQqhk8xv0ngU2UQfA5bA63YcjFoC6jwiRamu6W2aDzUABlhSO+ /XlDFSpOuVtt3wmXbLq0TDTPdBvUx3FgUzeQG/1nvmWw4BGMqMJTh+h2gqF+DRMnto7AetyezwH6 gktBU0lDMXS+YkpA6KG1Z/vBfCpJcuZdd5q051v8Dw1g1gGMaJFzzYAnPkcARddmPfkoEcdF6nvQ oBpeFGD+DYpBwS+OcrxKzZPHR0ArCV5x1MXE4cEdG7Rf+dQRbi6x1mVbs0qIDVrwZcbcEjDrEBWg CE= X-UI-Out-Filterresults: notjunk:1;V03:K0:p+GWovryQPA=:v8WXxg2MUct4IUaDYxa9CL MPicuf5jlp3e3Y6Vste5126FXrOFq7lwFSCtBTb+ZAfoeVM05jop0Bf2hzEZHnsX+29HvI86i z0tQ1kGWUYWQQfZTXQ9r1IwbwfYnjpF4Hylm/wIvjOvP45vJ9KNPaoRATLmMUi5oCYoM7dHTa 3DhnHwLlUiVhA89RU2naBg/EvWQHvujmqPx/3YJ25vp7mVMhkXM+VzMnN3cieitzR+jhXQ1Hb fXRSj1Z7YUrAr934TRK13L+y3xSJuAAVUHBFUvElWDsnN4+RDTS/x5uBhIIWQ+gaEUeUzU9DM 7J8f1R6MYfdMwrGoWnE1Xm+wiPLZ+V4Ed8p1h0fgeRKdP1XEACpFvoQDpSEf42ZNbojYsCW1b SHq/srgamL/kbZmShxWrm5raCBtReOyWDyQFNr5nI4RJ740Fz24yJOYnkPQBkYHhNJ33TvaX2 zxXap6nXh82ql7wvcj4SaWwBiXRkPolLVyJkWhz+8xokEl8PJ4dYsS6LCqpLXeLBu1zh7rbhH FXPbR/OLq2dhlu1DYrzpyblMN4q+aJcJWy4oup1lDBA9L9rklP2F4FEVOlUCETuWv1lxHhrpP UfCXe+j5/T2OM= 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:264034 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 I found it strange how \alpha+\beta displays \alpha and \beta separately= =20 when using plain-tex-mode, but behaves differently when using texinfo-mode= =2E