all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ken Mankoff <mankoff@gmail.com>
To: 19145@debbugs.gnu.org
Subject: bug#19145: 24.4; prettify-symbols-mode inconsistent behavior
Date: Fri, 21 Nov 2014 12:40:12 -0500	[thread overview]
Message-ID: <m27fyopi4j.fsf@gorgonzola.whoi.edu> (raw)


I'm having issues with the new prettify-symbols-mode. I'm not sure if
this is a bug, or just a fact that the implementation is limited, in
which case this is a feature request for a more complete implementation.

Some symbols are sometimes not being treated correctly depending on what
characters follow. For example, I have the following setup for coding
Python:

    (prettify-symbols-mode t)
    (global-prettify-symbols-mode t)
    (add-hook 'python-mode-hook
              (lambda ()
                (push '("**2" . ?²) prettify-symbols-alist)
                (push '("_x" . ?ᵪ) prettify-symbols-alist)
                (push '("delta" . ?δ) prettify-symbols-alist)))


The issue may be somewhat subjective. For example, should foo_xx appear
with a subscript x and then a normal x? Or should it appear as I assume
you are reading it with no prettification? I would argue for the latter.
What about foo_x+2? Regardless, I've created a matrix of
prettifications, what I'd expect, and what happens.

| Characters | Expected               | Actual                        | Good? |
|------------+------------------------+-------------------------------+-------|
| foo_x      | subscript x            | subscript x                   | Y     |
| foo**2     | superscript 2          | superscript 2                 | Y     |
| delta      | delta symbol           | delta symbol                  | Y     |
| foo_x+     | subscript x            | No subscript                  | N     |
| foo_xi     | no subscript           | subscript                     | N     |
| foo_x[42]  | subscript              | subscript                     | Y     |
| foo_x**2   | subscript, superscript | no subscript, yes superscript | N     |
| foo**200   | no superscript         | superscript 2                 | N     |
| delta(42)  | delta symbol(42)       | symbol                        | Y     |
| delta+42   | symbol                 | symbol                        | Y     |
| delta**2   | symbol, superscript    | symbol, superscritp           | Y     |
| delta_x    | symbol, subscript      | no symbol                     | N     |

There are some inconsistencies, like why _x+ loses prettification, but
delta+ retains it, or why foo_x_x_x works, but delta_x does not.

Thanks,

  -k.






             reply	other threads:[~2014-11-21 17:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 17:40 Ken Mankoff [this message]
2014-11-21 18:15 ` bug#19145: 24.4; prettify-symbols-mode inconsistent behavior Stefan Monnier
2014-11-21 19:22   ` Ken Mankoff
2014-11-22 16:23     ` Stefan Monnier
2014-11-22 23:57       ` Ken Mankoff
2014-11-24 14:53         ` Stefan Monnier
2014-11-25  9:49           ` Ted Zlatanov
2014-11-25 14:51             ` Stefan Monnier
2014-11-25 15:17               ` Ted Zlatanov
2014-11-25 17:36                 ` Stefan Monnier
2014-11-25 18:53                   ` Ted Zlatanov
2014-11-26  2:23                     ` Stefan Monnier
2014-11-25 14:53             ` Ken Mankoff

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

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

  git send-email \
    --in-reply-to=m27fyopi4j.fsf@gorgonzola.whoi.edu \
    --to=mankoff@gmail.com \
    --cc=19145@debbugs.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.