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

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

[elpa] externals/rich-minority a18097b 05/20: Fix alignment of mode name


From: Stefan Monnier
Subject: [elpa] externals/rich-minority a18097b 05/20: Fix alignment of mode names in tooltip
Date: Mon, 15 Mar 2021 22:22:03 -0400 (EDT)

branch: externals/rich-minority
commit a18097b6a1c04b0c581a312f4ac224e2c5b316e7
Author: Clément Pit--Claudel <clement.pitclaudel@live.com>
Commit: Clément Pit--Claudel <clement.pitclaudel@live.com>

    Fix alignment of mode names in tooltip
    
    This is useful when lighters include wide characters.
---
 rich-minority.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/rich-minority.el b/rich-minority.el
index 43c5eff..fd66334 100644
--- a/rich-minority.el
+++ b/rich-minority.el
@@ -190,11 +190,13 @@ if the mode line string is empty."
 (defun rm--mode-list-as-string-list ()
   "Return `minor-mode-list' as a simple list of strings."
   (let ((full-list (delq nil (mapcar #'rm-format-mode-line-entry
-                                     minor-mode-alist))))
+                                     minor-mode-alist)))
+        (spacer (propertize " " 'display '(space :align-to 15))))
     (setq rm--help-echo
           (format "Full list:\n%s\n\n%s"
                   (mapconcat (lambda (pair)
-                               (format "   %-15s (%S)" (car pair) (cdr pair)))
+                               (format "   %s%s(%S)"
+                                       (car pair) spacer (cdr pair)))
                              full-list "\n")
                   rm--help-echo-bottom))
     (mapcar #'rm--propertize



reply via email to

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