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

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

[elpa] externals/nano-modeline a4e72d1486 11/18: Added handling of indir


From: ELPA Syncer
Subject: [elpa] externals/nano-modeline a4e72d1486 11/18: Added handling of indirect buffer
Date: Thu, 12 May 2022 07:57:49 -0400 (EDT)

branch: externals/nano-modeline
commit a4e72d1486307879b10cf6fd78a895ad7fdbcc38
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>

    Added handling of indirect buffer
---
 nano-modeline.el | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/nano-modeline.el b/nano-modeline.el
index cb383c17bc..31f7580687 100644
--- a/nano-modeline.el
+++ b/nano-modeline.el
@@ -1022,7 +1022,22 @@ depending on the version of mu4e."
    (plist-get (cdr (assoc 'text-mode nano-modeline-mode-formats)) :icon)))
 
 (defun nano-modeline-default-mode (&optional icon)
-  (let ((buffer-name (format-mode-line "%b"))
+  (let ((icon (or icon
+                  (plist-get (cdr (assoc 'text-mode 
nano-modeline-mode-formats)) :icon)))
+        ;; We take into account the case of narrowed buffers
+        (buffer-name (cond
+                      ((and (derived-mode-p 'org-mode)
+                            (buffer-narrowed-p)
+                            (buffer-base-buffer))
+                       (format"%s [%s]" (buffer-base-buffer)
+                              (substring-no-properties (or (org-get-heading 
'no-tags)
+                                                       "-"))))
+                      ((and (buffer-narrowed-p)
+                            (buffer-base-buffer))
+                       (format"%s [narrow]" (buffer-base-buffer)))
+                      (t
+                       (format-mode-line "%b"))))
+        
         (mode-name   (nano-modeline-mode-name))
         (branch      (nano-modeline-vc-branch))
         (position    (format-mode-line "%l:%c")))



reply via email to

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