From 21637ad56092e4c0c90511524507d72cdcc7eb0e Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Sat, 8 Dec 2018 03:46:12 +0800 Subject: [PATCH] Fix #62: disregards value of column-number-indicator-zero-based. Same as mode-line-percent-position. --- doom-modeline.el | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index a966ad2..77d059b 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -1362,15 +1362,32 @@ Requires `eyebrowse-mode' to be enabled." ;; Be compatible with Emacs 25. (defvar-local doom-modeline-column-zero-based - (or (bound-and-true-p column-number-indicator-zero-based) t) + (if (boundp 'column-number-indicator-zero-based) + column-number-indicator-zero-based + t) "When non-nil, mode line displays column numbers zero-based. See `column-number-indicator-zero-based'.") (defvar-local doom-modeline-percent-position - (or (bound-and-true-p mode-line-percent-position) '(-3 "%p")) + (if (boundp 'mode-line-percent-position) + mode-line-percent-position + '(-3 "%p")) "Specification of \"percentage offset\" of window through buffer. See `mode-line-percent-position'.") +(when (>= emacs-major-version 26) + (add-variable-watcher + 'column-number-indicator-zero-based + (lambda (_sym val op _where) + (when (eq op 'set) + (setq doom-modeline-column-zero-based val)))) + + (add-variable-watcher + 'mode-line-percent-position + (lambda (_sym val op _where) + (when (eq op 'set) + (setq doom-modeline-percent-position val))))) + (setq-default mode-line-position '((line-number-mode (column-number-mode