From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: port x-symbol to GNU emacs 24. Date: Wed, 19 Aug 2015 09:33:29 +0200 Message-ID: <87r3mz91h2.fsf@gnu.org> References: <87oaia6ict.fsf@mat.ucm.es> <837foxor1t.fsf@gnu.org> <878u9d7vdg.fsf@mat.ucm.es> <87pp2pq2ht.fsf@gnu.org> <87wpwx68cn.fsf@mat.ucm.es> <87mvxqxtif.fsf@gnu.org> <838u9alzly.fsf@gnu.org> <874mjyaqm8.fsf@fencepost.gnu.org> <87d1yl2dq9.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1439969649 4032 80.91.229.3 (19 Aug 2015 07:34:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Aug 2015 07:34:09 +0000 (UTC) Cc: Eli Zaretskii , David Kastrup , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 19 09:33:59 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZRxsj-0006uv-9W for ged-emacs-devel@m.gmane.org; Wed, 19 Aug 2015 09:33:57 +0200 Original-Received: from localhost ([::1]:60831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRxsi-00052t-Fb for ged-emacs-devel@m.gmane.org; Wed, 19 Aug 2015 03:33:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRxsP-00051c-B2 for emacs-devel@gnu.org; Wed, 19 Aug 2015 03:33:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRxsN-000225-FJ for emacs-devel@gnu.org; Wed, 19 Aug 2015 03:33:37 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:46289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRxsN-00021w-Bd for emacs-devel@gnu.org; Wed, 19 Aug 2015 03:33:35 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B2524202E6 for ; Wed, 19 Aug 2015 03:33:33 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Wed, 19 Aug 2015 03:33:33 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=BlkpFTgSiq26S+U ouWUpVOr1RNk=; b=QXyo+BSEipaisjQ52jyA2ltIOPIzk6TwRGnx2wBILR/FB5g MKhF2pZ4si048Uv4EY7kCeENAMQUwUKwQSystfaOJr0LSEUCoePhVtBf4HewGppL xV9tpLFevLtBDeQdo1cNt1IqXvsppJIp0eWJu1MJV/WsKgSF2zVVEzShveek= X-Sasl-enc: dYhTm8i4LdPBowewtmbrr8mVCRmwhmsEtRGY43ZVWJy9 1439969613 Original-Received: from thinkpad-t440p (unknown [2.160.238.117]) by mail.messagingengine.com (Postfix) with ESMTPA id 6CA04C00018; Wed, 19 Aug 2015 03:33:32 -0400 (EDT) Mail-Followup-To: Stefan Monnier , David Kastrup , Eli Zaretskii , emacs-devel@gnu.org In-Reply-To: (Stefan Monnier's message of "Tue, 18 Aug 2015 11:52:10 -0400") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.27 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188936 Archived-At: Stefan Monnier writes: >> I just started to define a `prettify-symbols-alist--TeX' by checking >> what Quail provides. > > Hmm... the name sounds suspect. It should have "tex" in the prefix, > not in the suffix. No problem, I can change that. I guess it should then go into tex-mode.el? >> However, there is a problem in that (la)tex-mode and their AUCTeX >> counterparts don't give \ symbol syntax. Therefore, an entry like >> ("\\alpha" . ?=CE=B1) will never match. And omitting the backslash isn't >> possible because then we'd have many false positives for entries like >> ("in" . ?=E2=88=88). > > prettify-symbols-alist does currently handle non-symbol chars. > Whether it handles this specific case, I'm not completely sure (tho > I'm pretty sure it'll mishandle "\alpha2", in any case). But we > should make prettify-symbols-alist handle the needs of TeX, so feel > free to suggest extensions to prettify-symbols-alist if that's needed. Well, it's actually not as simple as I've thought before. It does in fact handle some non-symbol things but it depends on the syntax before and after the matched thing. With `prettify-symbols-alist' set to just (("\\alpha" . ?=CE=B1) ("\\beta" . ?=CE=B2)), that's what I get when using AUCTeX (yes means that the greek letter is displayed, no means the literal tex macro is displayed): \alpha %% yes \[\alpha\] %% yes $\alpha$ %% no $ \alpha$ %% no $ \alpha $ %% no \(\alpha\) %% no \( \alpha\) %% yes \( \alpha \) %% yes \(\alpha\cdot\beta\) %% alpha: no, beta: yes \( \alpha\cdot\beta\) %% alpha: yes, beta: yes With Emacs' built-in (la)tex-mode, all occurrences are displayed with the greek letters, so it seems to be more or less an AUCTeX problem. The only syntax differences I could find between the standard (la)tex-mode and AUCTeX's modes is that in the former, ?\\ has charquote syntax whereas it has escape syntax in the latter. And $ has "math syntax, matches $" in the former and only math syntax in the latter. However, even after (modify-syntax-entry ?\\ "/") (modify-syntax-entry ?$ "$$") in the AUCTeX buffer and disabling and re-enabling `prettify-symbols-mode', the results stay the same as above... Bye, Tassilo