[Adium-devl] Syntax highlighting in adium plugin

Graham Booker gbooker at cod3r.com
Wed May 28 20:03:03 UTC 2008


On May 28, 2008, at 2:50 PM, Evan Schoenberg wrote:

>
> On May 28, 2008, at 3:42 PM, Ngan Pham wrote:
>
>> I use adium for work and my co-workers and I often copy and paste  
>> code and IM it to one another.  I was wondering if anyone knew of  
>> such a plugin that would syntax highlight and properly format it  
>> for adium?  Or if there is any team/movements on this behalf?  I  
>> know there's sites like pastie, but it would be really cool if it  
>> was integrated into adium through a plugin.
>>
>> If there isn't such a thing, then what would it take to write one?   
>> And would anyone else find this useful?
>>
>
> There isn't such a thing or efforts to produce it of which I'm  
> aware, but it would definitely be useful to many folks who use Adium  
> to discuss or work collaboratively on code.
>
> I don't know about the actual syntax highlighting; is there an  
> existing library to accomplish this? If not, that's the hard part of  
> your project.
>
> The Adium part of it should be quite simple.  All you have to do is  
> have an object which implements the AIContentFilter protocol,  
> defined in AIContentControllerProtocol.h.  Your object registers  
> with the content controller (-[[adium contentController]  
> registerContentFilter:ofType:direction:]) - I'd probably use a  
> AIFilterMessageDisplay filter, and register for both incoming and  
> outgoing directions - and then implements the AIContentFilter  
> methods. It's given the opportunity to make changes to an  
> NSAttributedString before it's displayed.
>

An alternative if you are too lazy to code.  If you are using a  
service which allows for markup, such as color, font, etc....  Then  
you can "Paste with Images and Colors" (edit menu, cmd-shft-v).  I  
have personally done this with code from xcode, and it preserves the  
syntax coloring and the like that I use when the message is received  
on the other end.

> Cheers,
> Evan
> _______________________________________________
> Adium-devl mailing list
> Adium-devl at adiumx.com
> http://adiumx.com/mailman/listinfo/adium-devl_adiumx.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20080528/b8bfce32/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3632 bytes
Desc: not available
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20080528/b8bfce32/attachment.p7s>


More information about the devel mailing list