[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: off-topic. fyi: emacs email view does syntax highlighting of org-mod
Re: off-topic. fyi: emacs email view does syntax highlighting of org-mode code blocks
Tue, 08 Feb 2022 01:54:41 -0800
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Corwin Brust <email@example.com> writes:
> It would be pretty fun to hack something up that allows code snipets
> in chat to be font-locked.
> I think I'd do it by
> 1. detecting source and extracting it
> 2. finding the source type (if possible)
> 3. creating temp buffer and sett its major mode
> 4. flow the snippet (grabbed code) into the temp buffer
Does this accommodate languages for which line breaks are mandatory? If
so, I guess some encoding scheme would be necessary to convey line
endings (basically the inverse of what flow-fill.el provides) so that
<pre>-flowed formatting can be reconstituted on the recipient's end.
Perhaps some un-spoken-for control char in the lower ASCII range could
be borrowed for this purpose in a tr(1) style 1:1 swap.
Also, what about snippets spanning multiple messages?
> If it this did use overlays for additional fun we could buttonized the
> result. For example using mouse-1 to pop the snippet that was clicked
> (back) into a temp buffer or M-<mouse-1> to get back what was
> originally typed.
I've heard folks in the know speak of folding (in the outline/hs sense)
with regard to multi-line messages:
In fact, I think this extension may be worth checking out and even
shooting for as a reference implementation for showing off whatever v3
lib we end up settling on.