There are so-called strict formats, like pdb - where the meaning of the symbol is defined by the colomn number of the symbol. For example here is a specification of the above mentioned pdb format.
Is there a way I can apply face colour basing on the column range?
One can normally add a regexp to be highlighted, for example for the current session in the following way:
(font-lock-add-keywords nil '(("\\[\\(.+?\\)\\]" . font-lock-keyword-face)))
So is there a way to specify that face at columns, say 7-11 - should be, say - red?
Edit:
So the answer is:
(font-lock-add-keywords nil '(("^.\\{2\\}\\(.\\{2\\}\\)" 1 font-lock-warning-face)))
Define a regexp that will select the appropriate column.
For example to select the 3rd column (assuming the columns contains only letter for the clarity of the example) you can do something like "\(?:[a-z]+ \)\{2\}\([a-z]+\)"
and then match on the first group.
Of course you can create such a string by using format
and passing it some arguments for more flexibility.
(font-lock-add-keywords nil '(("\\(?:[a-z]+ \\)\\{2\\}\\([a-z]+\\)" 1 font-lock-warning-face)))
As an other direction, the following code was found in whitespace-mode which highlights the characters over a certain number:
;; Show "long" lines
(list
(let ((line-column (or whitespace-line-column fill-column)))
(format
"^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$"
whitespace-tab-width
(1- whitespace-tab-width)
(/ line-column whitespace-tab-width)
(let ((rem (% line-column whitespace-tab-width)))
(if (zerop rem)
""
(format ".\\{%d\\}" rem)))))
(if (memq 'lines whitespace-active-style)
0 ; whole line
2) ; line tail
whitespace-line t)