Add option to display point value
This commit is contained in:
parent
670f2c0c39
commit
07355d6cf8
13
mood-line.el
13
mood-line.el
@ -67,6 +67,11 @@
|
|||||||
"A minimal mode-line configuration inspired by doom-modeline."
|
"A minimal mode-line configuration inspired by doom-modeline."
|
||||||
:group 'mode-line)
|
:group 'mode-line)
|
||||||
|
|
||||||
|
(defcustom mood-line-show-point nil
|
||||||
|
"If t, the value of `point' will be displayed next to the cursor position in the mode-line."
|
||||||
|
:group 'mood-line
|
||||||
|
:type 'boolean)
|
||||||
|
|
||||||
(defface mood-line-status-grayed-out
|
(defface mood-line-status-grayed-out
|
||||||
'((t (:inherit (font-lock-doc-face))))
|
'((t (:inherit (font-lock-doc-face))))
|
||||||
"Face used for neutral or inactive status indicators in the mode-line."
|
"Face used for neutral or inactive status indicators in the mode-line."
|
||||||
@ -220,7 +225,13 @@
|
|||||||
|
|
||||||
(defun mood-line-segment-position ()
|
(defun mood-line-segment-position ()
|
||||||
"Displays the current cursor position in the mode-line."
|
"Displays the current cursor position in the mode-line."
|
||||||
(concat "%l:%c "
|
(concat "%l:%c"
|
||||||
|
(when mood-line-show-point
|
||||||
|
(concat ":"
|
||||||
|
(propertize (format "%d" (point)) 'face (if (mood-line-is-active)
|
||||||
|
'mood-line-unimportant
|
||||||
|
'mode-line-inactive))))
|
||||||
|
" "
|
||||||
(propertize "%p%%" 'face (if (mood-line-is-active)
|
(propertize "%p%%" 'face (if (mood-line-is-active)
|
||||||
'mood-line-unimportant
|
'mood-line-unimportant
|
||||||
'mode-line-inactive))
|
'mode-line-inactive))
|
||||||
|
Loading…
Reference in New Issue
Block a user