branch: externals/nano-modeline commit f75b90da5d5d428de163d7de5141a4930e6633b6 Author: Nicolas P. Rougier <nicolas.roug...@inria.fr> Commit: Nicolas P. Rougier <nicolas.roug...@inria.fr>
Read status from base buffer in case buffer is indirect --- nano-modeline.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nano-modeline.el b/nano-modeline.el index 706af992ae..184f5ccbbb 100644 --- a/nano-modeline.el +++ b/nano-modeline.el @@ -391,11 +391,12 @@ KEY mode name, for reference only. Easier to do lookups and/or replacements. (defun nano-modeline-status () "Return buffer status, one of 'read-only, 'modified or 'read-write." - (let ((read-only buffer-read-only) - (modified (and buffer-file-name (buffer-modified-p)))) - (cond (modified 'modified) - (read-only 'read-only) - (t 'read-write)))) + (with-current-buffer (or (buffer-base-buffer) (current-buffer)) + (let ((read-only buffer-read-only) + (modified (and buffer-file-name (buffer-modified-p)))) + (cond (modified 'modified) + (read-only 'read-only) + (t 'read-write))))) (defun nano-modeline-render (icon name primary secondary &optional status) "Compose a string with provided information"