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: sub and superscripts: without =?utf-8?B?wqtfwrs=?= and =?utf-8?B?wqtewrs=?= Date: Thu, 03 Sep 2015 09:02:50 +0200 Message-ID: <87613sc7dx.fsf@gnu.org> References: <877fo8dbep.fsf@mat.ucm.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1441263789 28142 80.91.229.3 (3 Sep 2015 07:03:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Sep 2015 07:03:09 +0000 (UTC) Cc: Uwe Brauer , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 03 09:03:00 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 1ZXOXz-00020t-BN for ged-emacs-devel@m.gmane.org; Thu, 03 Sep 2015 09:02:59 +0200 Original-Received: from localhost ([::1]:45354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXOXz-0006SU-2p for ged-emacs-devel@m.gmane.org; Thu, 03 Sep 2015 03:02:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXOXv-0006RM-E3 for emacs-devel@gnu.org; Thu, 03 Sep 2015 03:02:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXOXs-0003Ou-9H for emacs-devel@gnu.org; Thu, 03 Sep 2015 03:02:55 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:37038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXOXs-0003Oa-2p for emacs-devel@gnu.org; Thu, 03 Sep 2015 03:02:52 -0400 Original-Received: from thinkpad-t440p (dhcp224.uni-koblenz.de [141.26.71.224]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id D05943D6006; Thu, 3 Sep 2015 09:02:50 +0200 (CEST) Mail-Followup-To: Stefan Monnier , Uwe Brauer , emacs-devel@gnu.org In-Reply-To: (Stefan Monnier's message of "Wed, 02 Sep 2015 16:20:27 -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.6.x X-Received-From: 141.26.64.15 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:189494 Archived-At: Stefan Monnier writes: >> I asked this on auctex-dev but it might be question concerning core >> functionality of GNU emacs: > > The necessary core functionality has been present for a long time: > just add the proper `invisible' property to the chars you don't want > to see. I guess what Uwe wants is that `prettify-symbols-mode' in a (La)TeX buffer (with stock latex-mode or AUCTeX; doesn't really matter) could have the option to make the ^ and _ invisible, too. I already told him that this is not what p-s-m is meant for. But it's easy enough to write a custom font-lock rule for that: --8<---------------cut here---------------start------------->8--- (defun th/invisible-super-sub-scripts () (interactive) (cl-pushnew 'invisible font-lock-extra-managed-props) (font-lock-add-keywords nil '(("[^\\\\]\\([_^]\\)" (1 '(face nil invisible t) t)))) (font-lock-flush)) --8<---------------cut here---------------end--------------->8--- Uwe, if you want you could do something like that: --8<---------------cut here---------------start------------->8--- (add-hook 'prettify-symbols-mode-hook (lambda () (when (eq major-mode 'latex-mode) (th/invisible-super-sub-scripts)))) --8<---------------cut here---------------end--------------->8--- Bye, Tassilo