public static void onCaretChanged(final JTextPane tp, final P1<Integer> p1) {
		tp.addCaretListener(new CaretListener() {public void caretUpdate(CaretEvent e) {
//			System.out.println(
//					"Thread: " + Thread.currentThread() + 
//					", Dot: " + e.getDot() + 
//					", Mark: " + e.getMark() +
//					", Source: " + e.getSource()
//					);
			p1.e(e.getDot());
		}});
	}