shows the information specified by @code{global-mode-string}.
@end defvar
+@defvar mode-line-position-line-format
+The format used for display line numbers when @code{line-number-mode}
+(@pxref{Optional Mode Line,,, emacs, The GNU Emacs Manual}) is
+switched on. @samp{%l} in the format will be replaced with the line
+number.
+@end defvar
+
+@defvar mode-line-position-column-format
+The format used for display column numbers when
+@code{column-number-mode} (@pxref{Optional Mode Line,,, emacs, The GNU
+Emacs Manual}) is switched on. @samp{%c} in the format will be
+replaced with the line number, and this is zero-based if
+@code{column-number-indicator-zero-based} is non-@code{nil}, and
+one-based if @code{column-number-indicator-zero-based} is @code{nil}.
+@end defvar
+
@defvar minor-mode-alist
@anchor{Definition of minor-mode-alist}
This variable holds an association list whose elements specify how the
** Miscellaneous
++++
+*** New variables to control the look of line/column numbers in the mode line.
+'mode-line-position-line-format' is the line number format (when
+'line-number-mode') is on, and 'mode-line-position-column-format' is
+the column number format (when 'column-number-mode') is on. These are
+also used if both modes are on, which leads to the default in that
+case going from "(5,9)" to "(L5,C9)".
+
+++
*** New command 'submit-emacs-patch'.
This works along the lines of 'report-emacs-bug', but is more geared
:group 'mode-line)
(put 'mode-line-percent-position 'risky-local-variable t)
+(defcustom mode-line-position-line-format "L%l"
+ "Format used to display line numbers in the mode line.
+This is used when `line-number-mode' is switched on. The \"%l\"
+format spec will be replaced by the line number."
+ :type 'string
+ :version "28.1"
+ :group 'mode-line)
+
+(defcustom mode-line-position-column-format "C%c"
+ "Format used to display column numbers in the mode line.
+This is used when `column-number-mode' is switched on. The
+\"%c\" format spec will be replaced by the column number, which
+is zero-based if `column-number-indicator-zero-based' is non-nil,
+and one-based if `column-number-indicator-zero-based' is nil."
+ :type 'string
+ :version "28.1"
+ :group 'mode-line)
+
(defvar mode-line-position
`((:propertize
mode-line-percent-position
((column-number-mode
(column-number-indicator-zero-based
(10 ,(propertize
- " (%l,%c)"
+ (format " (%s,%s)"
+ mode-line-position-line-format
+ mode-line-position-column-format)
'local-map mode-line-column-line-number-mode-map
'mouse-face 'mode-line-highlight
'help-echo "Line number and Column number\n\
mouse-1: Display Line and Column Mode Menu"))
(10 ,(propertize
- " (%l,%C)"
+ (format " (%s,%s)"
+ mode-line-position-line-format
+ (replace-in-string "%c" "%C"
+ mode-line-position-column-format))
'local-map mode-line-column-line-number-mode-map
'mouse-face 'mode-line-highlight
'help-echo "Line number and Column number\n\
mouse-1: Display Line and Column Mode Menu")))
(6 ,(propertize
- " L%l"
+ (format " %s" mode-line-position-line-format)
'local-map mode-line-column-line-number-mode-map
'mouse-face 'mode-line-highlight
'help-echo "Line Number\n\
((column-number-mode
(column-number-indicator-zero-based
(5 ,(propertize
- " C%c"
+ (format " %s" mode-line-position-column-format)
'local-map mode-line-column-line-number-mode-map
'mouse-face 'mode-line-highlight
'help-echo "Column number\n\
mouse-1: Display Line and Column Mode Menu"))
(5 ,(propertize
- " C%C"
+ (format " %s" (replace-in-string "%c" "%C"
+ mode-line-position-column-format))
'local-map mode-line-column-line-number-mode-map
'mouse-face 'mode-line-highlight
'help-echo "Column number\n\
Line numbers do not appear for very large buffers and buffers
with very long lines; see variables `line-number-display-limit'
-and `line-number-display-limit-width'."
+and `line-number-display-limit-width'.
+
+See `mode-line-position-line-format' for how this number is
+presented."
:init-value t :global t :group 'mode-line)
(define-minor-mode column-number-mode
- "Toggle column number display in the mode line (Column Number mode)."
+ "Toggle column number display in the mode line (Column Number mode).
+
+See `mode-line-position-column-format' for how this number is
+presented."
:global t :group 'mode-line)
(define-minor-mode size-indication-mode