unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-devel@gnu.org
Subject: Re: sub and superscripts: without «_» and «^»
Date: Thu, 03 Sep 2015 09:41:32 +0000	[thread overview]
Message-ID: <87vbbrx2k3.fsf@mat.ucm.es> (raw)
In-Reply-To: 87613sc7dx.fsf@gnu.org

>>>>> "Tassilo" == Tassilo Horn <tsdh@gnu.org> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> 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:

> (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))

> Uwe, if you want you could do something like that:

> (add-hook 'prettify-symbols-mode-hook
> 	  (lambda ()
> 	    (when (eq major-mode 'latex-mode)
> 	      (th/invisible-super-sub-scripts))))

Cool!! Precisely what I wanted thanks very much!




      reply	other threads:[~2015-09-03  9:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 16:38 sub and superscripts: without «_» and «^» Uwe Brauer
2015-09-02 18:58 ` Eli Zaretskii
2015-09-02 20:20 ` Stefan Monnier
2015-09-03  7:02   ` Tassilo Horn
2015-09-03  9:41     ` Uwe Brauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbbrx2k3.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).