From 430d24dd29cf5a96eb31ea4bc6af150e4d530331 Mon Sep 17 00:00:00 2001 From: deb0ch Date: Mon, 26 Dec 2016 19:51:26 +0100 Subject: [PATCH] fix error on mode-line evaluation when a window has no number --- winum.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/winum.el b/winum.el index 4a035bf..986d29b 100644 --- a/winum.el +++ b/winum.el @@ -39,8 +39,6 @@ ;; ;;; Code: ;; -;; FIXME: Error during redisplay: (eval (winum-get-number-string)) signaled -;; (wrong-type-argument numberp nil) when opening a helm buffer. ;; FIXME: when `winum-scope' is changed from frame-local to non-local in ;; customize, the mode-line is messed up until next `winum-update'. ;; FIXME: The mode-line's window number is not always up to date in all frames. @@ -323,7 +321,8 @@ PREFIX must be a key sequence, like the ones returned by `kbd'." WINDOW: if specified, the window of which we want to know the number. If not specified, the number of the currently selected window is returned." - (let ((s (int-to-string (winum-get-number window)))) + (let* ((n (winum-get-number window)) + (s (when (numberp n) (int-to-string n)))) (propertize s 'face 'winum-face))) ;;;###autoload