In the help there is looking-at
function which should populate match-data
which could be accessed with match-end
function.
So I have the text :
1. hello world
The cursor is on 1
and I issue the command M-:
(looking-at "1\\. ")
, the result is t
.
Now immediately I do M-:
(match-end 0)
and expect to get 3
but I get 7 (#o7, #x7, ?\C-g)
Is this approach incorrect? Should I use smth else to get the column number?
PS
If I use a little bit more fancy regex in looking-at
then I get crazy numbers from match-end
- 653 or even 1432. Which are definitely not a column numbers.
Update if the text is a single line as above I get correct result.
1. hello world
1. hello world
On the first line I get 4
On the second line I get 19
Looks like char count + 1, not the column number.