This page describes library modeline-posn.el, which provides extensions to the standard Emacs variable ‘mode-line-position’ for Emacs 22 and later. That variable governs the behavior of minor modes ‘line-number-mode’, ‘column-number-mode’, and ‘size-indication-mode’, which show/hide the current line number, column number, and buffer size, respectively, in the mode line.
The following extensions are provided by library modeline-posn.el:
‘region’. (Option ‘modelinepos-empty-region-flag’ determines whether to also indicate an empty active region.)‘modelinepos-column-limit’, the column-number indication in the mode-line is highlighted in face ‘font-lock-function-name-face’. This lets you know when you’ve gone past a certain number of characters in any line. You can customize user option ‘modelinepos-column-limit’, and you can bind it to different values in different modes. This is really handy. Thanks! One request for enhancement: add a customization variable to allow us to use a face other than ‘font-lock-function-name-face’. My modeline is blue and my ‘font-lock-function-name-face’ is also blue, so that particular face isn’t a good choice for me. --AmitPatel
Thanks! – AmitPatel
Would it be possible to optionally display the absolute value of point even while not in TransientMarkMode? – priyadarshan
Sorry, but I think that if you want something like that it should be as an extension of ‘line-number-mode’ and/or ‘column-number-mode’. Showing point as an option makes sense regardless of whether the region is active.
Of course, as soon as point is shown someone will also want to see mark…
If you want to do this kind of thing, just take a look at the code in modeline-posn.el, in particular the redefinition of ‘mode-line-position’. The parts to tweak are those for ‘line-number-mode’ and ‘column-number-mode’ (one or both, depending on what you want). HTH – DrewAdams
Thank you for the pointers! I shall try and let you know. – priyadarshan
CategoryDisplay CategoryEditing CategoryRegion CategoryWindows CategoryModeLine? CategoryModeLineConfiguration?