tags:

views:

401

answers:

2

I am hacking up a tagging application for emacs. I have got a tag cloud/weighted list successfully displaying on a buffer, but i am running into a snag. I need to be able to properly word-wrap the buffer, but I haven't a clue where to start.

The font I am using is a variable width font. On top of that, each tag is going to be in a different size, depending on how many times it shows up on the buffer. Finally, the window that displays the tagcloud could be in a window that is 200 pixels wide, or the full screen width.

I really have no idea where to start. I tried longlines mode on the tagcloud buffer, but that didn't work.

Source code is at: http://emacswiki.org/cgi-bin/emacs/free-tagging.el

+3  A: 

You probably want to track posn-at-point and posn-at-x-y as you put the tags in the buffer.

fivebells
A: 

Can you use (fill-paragraph) or (fill-region) or similar? They wrap at a column, so don't have variable width font smarts, but if the fill column is low they might work for next to no effort. At least until you get a pixel-perfect solution sorted out :-) (maybe YAGNI...)

Matt Curtis
That didn't seem to work at all actually. Thanks for the suggestion though.
Jonathan Arkell