emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using glyphs by default in perl-mode


From: Stefan Monnier
Subject: Re: using glyphs by default in perl-mode
Date: Wed, 05 Jun 2013 12:13:00 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> Done and in trunk.  Thanks for all the help and reviews from you and
> Davis Herring.

Thank you, Ted.

> I also thought about `put-text-property' of an image but that's pretty
> ugly and special-cases all the code, plus it has update issues in some
> cases (deleting characters and reinserting them doesn't trigger the
> image again).  It would be really nice to be able to use
> `compose-region' and use an image to create a glyph.  For now it's a
> TODO but I think it would be a hit with users.  If anyone is interested
> or wants to tell me how it could work, let me know.

I think this is pushing it "too far": I'm not opposed to such a feature
in general, but I'm not sure it would benefit much from sharing some
code with the current prog-prettify code.
BTW, one problematic part with the use of images is when you need to
scale them to fit the text's size.

> The other TODO item is to simplify this support so it doesn't require
> special effort when setting `font-lock-defaults'.  I don't know how that
> would work internally so I'll wait for Stefan or someone else to give me
> hints or implement it.

I think the best way to do that is going to be to provide a function
that uses font-lock-add-keywords internally.  That function might even
take the symbols-alist as argument and do the (setq-local
prog-prettify-alist..) itself, so major modes can just call
(prog-prettify '(("=>" . ?⇒))).


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]