Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Colouring diff-part of an email

3 views
Skip to first unread message

Adam Sjøgren

unread,
Mar 6, 2013, 4:58:53 AM3/6/13
to info-gnu...@gnu.org
Hi.

I am on a couple of mailing lists at work that receive an email per
commit in a source code repository.

Each email starts with some information about the commit - author, date,
revision, commit log message, and then the diff follows.

Has anyone written something that will colour an inline diff in an
email?

If I jump to the *Article* buffer and turn on diff-mode, the whole
buffer is coloured - which is a little much, headers become dull grey
etc.

I guess I just need some kind of washing, but I don't know quite where
to start, so I thought I'd ask if anyone already has solved the problem
:-)

I could change the email to be more MIMEish (inlining the diff-part),
but I think those of my colleagues who do not use Gnus would be annoyed
when their mail clients start to show the diff as an attachment.

Best regards,

Adam

--
"Set out on a laughless day Adam Sj�gren
Like a troupe of clowns" as...@koldfront.dk


Tassilo Horn

unread,
Mar 6, 2013, 8:40:31 AM3/6/13
to info-gnu...@gnu.org
as...@koldfront.dk (Adam Sjøgren) writes:

Hi Adam,

> Has anyone written something that will colour an inline diff in an
> email?

Not sure, but I think Gnus can already do highlighting of org-mode style
source code blocks like the following:

#+BEGIN_SRC diff
+Some text added
-Some text deleted
+Some more text added
#+END_SRC

Not sure if that does obey `org-src-fontify-natively' (which should be
set to t), though. Well see when we receive this very mail.

Bye,
Tassilo


Adam Sjøgren

unread,
Mar 6, 2013, 9:53:33 AM3/6/13
to info-gnu...@gnu.org
On Wed, 06 Mar 2013 14:40:31 +0100, Tassilo wrote:

> #+BEGIN_SRC diff
> +Some text added
> -Some text deleted
> +Some more text added
> #+END_SRC

> Not sure if that does obey `org-src-fontify-natively' (which should be
> set to t), though. Well see when we receive this very mail.

After setting it to t, and editing one of the commit emails, it looks
perfect.

Great tip, thanks!

... maybe I can even make a washing function that adds those #+-thingies
automatically for me, so my colleagues don't have to see them in the
emails :-)

Sivaram Neelakantan

unread,
Mar 6, 2013, 12:41:50 PM3/6/13
to info-gnu...@gnu.org
On Wed, Mar 06 2013,Tassilo Horn wrote:


[snipped 7 lines]

> Not sure, but I think Gnus can already do highlighting of org-mode style
> source code blocks like the following:
>
> #+BEGIN_SRC diff
> +Some text added
> -Some text deleted
> +Some more text added
> #+END_SRC
>

Can see the above in colour, if it helps....


[snipped 11 lines]



sivaram
--


Frank Terbeck

unread,
Mar 6, 2013, 12:58:18 PM3/6/13
to
Adam Sjøgren wrote:
[...]
> Has anyone written something that will colour an inline diff in an
> email?

I've written something along those lines:

http://bewatermyfriend.org/p/2011/00a/

The actual code is linked in that blog posting, too, but here it is once
again:

https://dev.0x50.de/projects/ftgnus/repository/revisions/master/entry/private/gnus-article-treat-patch.el

Works well enough for me.

Regards, Frank

Adam Sjøgren

unread,
Mar 13, 2013, 4:08:31 PM3/13/13
to info-gnu...@gnu.org
Frank Terbeck <f...@bewatermyfriend.org> writes:

> I've written something along those lines:

> http://bewatermyfriend.org/p/2011/00a/

That works like a charm - thanks!


Best regards,

Adam

--
"Set out on a laughless day Adam Sjøgren
0 new messages