minor code improvement

This commit is contained in:
Thomas de Beauchêne 2018-11-07 01:47:11 +01:00
parent a096da2881
commit 8bafa66f80

View file

@ -426,12 +426,11 @@ POSITION: position in the mode-line."
(defun winum--clear-mode-line ()
"Remove the window number of `winum-mode' from the mode-line."
(let ((mode-line (default-value 'mode-line-format))
(res))
res)
(while mode-line
(let ((item (car mode-line)))
(let ((item (pop mode-line)))
(unless (equal item winum--mode-line-segment)
(push item res)))
(pop mode-line))
(push item res))))
(let ((nres (nreverse res)))
(setq mode-line-format nres)
(setq-default mode-line-format nres)))