emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/nano-modeline f75b90da5d 09/18: Read status from base b


From: ELPA Syncer
Subject: [elpa] externals/nano-modeline f75b90da5d 09/18: Read status from base buffer in case buffer is indirect
Date: Thu, 12 May 2022 07:57:49 -0400 (EDT)

branch: externals/nano-modeline
commit f75b90da5d5d428de163d7de5141a4930e6633b6
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@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"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]