[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
current-column and display (space :align-to) properties
From: |
Michael Mauger |
Subject: |
current-column and display (space :align-to) properties |
Date: |
Tue, 10 Jan 2006 01:24:22 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
I'm not sure if this is a bug or a feature...
Along the lines of a question that arose a couple of weeks ago re: counting
before and after properties when calculating current-column, should the
space :align-to and :width properties be reflected in current-column?
For example, in *scratch*, try the following:
(progn
(insert "["
(propertize "01"
'display '(space :align-to 10))
"]XX\n")
(insert "["
(propertize "0123456789012"
'display '(space :align-to 5))
"]YY\n")
) `C-j'
You should see something like the following in *scratch*:
[ ]XX
[ ]YY
nil
If you place the cursor on the second of the two XXs (actually point is between
the two XXs), the current-column is 5 (the two square brackets, the two
characters in the propertized string and the first X.)
If you place the cursor on the second of the two YYs, the current-column is 16
(the two square brackets, the twelve characters in the propertized string and
the first Y.)
Even stranger, if you again place the cursor between the two XXs and hit `C-n',
the cursor will go to before the closing bracket on the second line in an
effort to preserve the column position.
Is this desired behavior? Should current-column look at the display property
to determine how to calculate the column position?
-- Michael
- current-column and display (space :align-to) properties,
Michael Mauger <=