From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Subject: Re: Interface of prog-prettification
Date: Sun, 16 Jun 2013 05:24:44 -0400 [thread overview]
Message-ID: <m238sitnkz.fsf@lifelogs.com> (raw)
In-Reply-To: CAAeL0SR4YV0Fw7X9w-HoBapGrRzb=FH_r2tEt8Ki3ijA7FF5Dw@mail.gmail.com
On Sun, 16 Jun 2013 03:56:12 +0200 Juanma Barranquero <lekktu@gmail.com> wrote:
JB> A few questions about the new prog-prettification.
JB> - prog--prettify-font-lock-compose-symbol's docstring says:
JB> "Compose a sequence of ascii chars into a symbol."
JB> It is really true that it must be a sequence of ASCII characters? Why?
The original `perl-mode' implementation of the above said that.
JB> - Docstring of prog-prettify-symbols says:
JB> "When set to an alist in the form `((STRING . CHARACTER)...)'"
JB> But in fact, instead of CHARACTER you can use a string, and its
JB> characters will be "composed" (stacked) together.
Yes. Handa-san explained how composition works in that case and I
intend to document it, but it's neither explained nor supported right
now. I think (as already suggested here) that an arbitrary string
should also be supported.
JB> - I don't fully understand how the user is supposed to extend the
JB> default modes' prog-prettification. What is the expected interface?
The user is not supposed to extend it. I had that originally IIRC but
for simplicity we decided to make it one setting for all prog-modes.
The assumption is that if you like to prettify lambdas as symbols, you
won't mind it everywhere.
JB> Customizing prog-prettify-symbols sets the value for all prog-derived
JB> modes, but what if I want to use different prettifications for
JB> different modes?
JB> I tried adding (set (make-local-variable 'prog-prettify-symbols)
JB> '(("my-symbol" . ?MYCHAR))) to the relevant mode-hook, but that does
JB> not work.
Maybe a mode load hook call to `prog-prettify-install'? I think
complicating the defcustom might be less user-friendly. Suggestions
welcome.
JB> pushing '("my-symbol" . ?MYCHAR) to the corresponding mode-specific
JB> alist (lisp--prettify-symbols-alist,
JB> cfengine3--prettify-symbols-alist, perl--prettify-symbols-alist, etc.)
JB> works, but on one hand, these are internal, non-documented constants;
JB> on the other hand, that does not help to separate lisp-mode from
JB> emacs-lisp-mode, which are initialized from the same alist.
Right. I think these complications, especially the inheritance aspect,
indicate it's better to let the user decide in the load hook than to try
to provide it in a more complicated data structure.
Ted
next prev parent reply other threads:[~2013-06-16 9:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-16 1:56 Interface of prog-prettification Juanma Barranquero
2013-06-16 9:24 ` Ted Zlatanov [this message]
2013-06-16 9:58 ` Juanma Barranquero
2013-06-16 22:58 ` Stefan Monnier
2013-06-16 23:41 ` Juanma Barranquero
2013-06-17 1:00 ` Stefan Monnier
2013-06-17 6:25 ` Ted Zlatanov
2013-06-16 23:46 ` Juanma Barranquero
2013-06-17 6:27 ` Ted Zlatanov
2013-06-17 14:31 ` Stefan Monnier
2013-06-17 16:04 ` Juanma Barranquero
2013-06-17 16:27 ` Stefan Monnier
2013-06-17 23:08 ` Juanma Barranquero
2013-06-18 1:00 ` Stefan Monnier
2013-06-18 1:38 ` Juanma Barranquero
2013-06-18 15:02 ` Ted Zlatanov
2013-06-18 19:17 ` Stefan Monnier
2013-06-18 19:42 ` Juanma Barranquero
2013-06-18 20:26 ` Stefan Monnier
2013-06-17 19:13 ` Ted Zlatanov
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=m238sitnkz.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--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 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.