Default modeline segments to :init

Fixes buffer-id in non-file-visiting buffers.
This commit is contained in:
Henrik Lissner 2018-08-01 01:47:32 +02:00
parent 65f0dcef54
commit 0cdb736670
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 2 additions and 1 deletions

View file

@ -79,7 +79,7 @@ keep them left and right aligned respectively."
(if (eq realvar name)
`((defvar-local ,name nil ,docstring)
(setq-default ,name ,init))
`((defvar-local ,realvar nil)
`((defvar-local ,realvar ,init)
(defvar-local ,name nil ,docstring)
(setq-default
,name '(:eval (cond ((active) ,realvar)

View file

@ -291,6 +291,7 @@ buffers.")
(def-modeline-segment! +modeline-buffer-id
:on-hooks (find-file-hook after-save-hook after-revert-hook)
:init "%b"
:faces t
(if buffer-file-name
(funcall +modeline-buffer-path-function buffer-file-name)