[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using glyphs by default in perl-mode
From: |
Ted Zlatanov |
Subject: |
Re: using glyphs by default in perl-mode |
Date: |
Sun, 02 Jun 2013 22:02:50 -0400 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) |
On Sun, 02 Jun 2013 11:52:51 -0400 Stefan Monnier <address@hidden> wrote:
>> I have the data working and AFAICT the correct data is passed to
>> font-lock but something is going wrong inside the fontification call.
>> That's hard to debug. I'll work on it more (I think you posted a trick
>> for debugging font-lock a while ago) but if anyone can spot the issue, I
>> would appreciate any suggestions.
SM> (setq font-lock-support-mode nil)
SM> and then try again (e.g. turn font-lock off and then on).
OK, please see attached. It works! I was missing a quote in the macro
expansion.
Done:
- `prog-mode' now has the functions to do font-lock symbol composition
- the user's defcustom is `prog-prettify-symbols' which can be 'basic,
'extended, 'all, or an alist. If it's a symbol it's looked up in the
buffer-local `prog-prettify-symbols-alist'.
- every mode simply binds `prog-prettify-symbols-alist' to an alist with
key = 'basic,'extended, and 'all. The value is an alist of `(string .
character)'.
Then the mode can use the output of
`prog-prettify-font-lock-symbols-keywords' in its font-lock keywords.
The attached patch shows it for `perl-mode' but other modes should be
simpler.
Still TODO:
- move all `prog-mode' code to prog.el
- support Haskell, Lisp pretty-lambdas, sml-mode, and cfengine-mode
- maybe support images as well, as a path or inlined? Not sure.
- can the alist mechanism above be made simpler for every mode?
Please review the patch, especially the defcustoms. Once you think it's
OK, I'll move to prog.el and commit (which will turn off the prettified
symbols by default in `perl-mode', the most urgent item). Then I can go
down the TODO list.
Thanks!
Ted
- Re: using glyphs by default in perl-mode, Dan Nicolaescu, 2013/06/01
- Re: using glyphs by default in perl-mode, Ted Zlatanov, 2013/06/01
- Re: using glyphs by default in perl-mode, Stefan Monnier, 2013/06/01
- Re: using glyphs by default in perl-mode, Ted Zlatanov, 2013/06/02
- Re: using glyphs by default in perl-mode, Stefan Monnier, 2013/06/02
- Re: using glyphs by default in perl-mode,
Ted Zlatanov <=
- Re: using glyphs by default in perl-mode, Ted Zlatanov, 2013/06/02
- Re: using glyphs by default in perl-mode, Stefan Monnier, 2013/06/03
- Re: using glyphs by default in perl-mode, Ted Zlatanov, 2013/06/03
- Re: using glyphs by default in perl-mode, Davis Herring, 2013/06/04
- Re: using glyphs by default in perl-mode, Stefan Monnier, 2013/06/04
- Re: using glyphs by default in perl-mode, Ted Zlatanov, 2013/06/04
- Re: using glyphs by default in perl-mode, Stefan Monnier, 2013/06/04
- Re: using glyphs by default in perl-mode, Ted Zlatanov, 2013/06/05
- Re: using glyphs by default in perl-mode, Stefan Monnier, 2013/06/05
- Re: using glyphs by default in perl-mode, Ted Zlatanov, 2013/06/05