From 07355d6cf8ab2ba58f5f0dc500725234aebdd3de Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Thu, 6 Jun 2019 06:44:27 -0400 Subject: [PATCH] Add option to display point value --- mood-line.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mood-line.el b/mood-line.el index 525ef43..f66e965 100644 --- a/mood-line.el +++ b/mood-line.el @@ -67,6 +67,11 @@ "A minimal mode-line configuration inspired by doom-modeline." :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 '((t (:inherit (font-lock-doc-face)))) "Face used for neutral or inactive status indicators in the mode-line." @@ -220,7 +225,13 @@ (defun mood-line-segment-position () "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) 'mood-line-unimportant 'mode-line-inactive))