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

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

[elpa] externals/rich-minority 5839ee4 15/20: Move a lambda to a global


From: Stefan Monnier
Subject: [elpa] externals/rich-minority 5839ee4 15/20: Move a lambda to a global function to reduce memory usage -- Fix #20
Date: Mon, 15 Mar 2021 22:22:05 -0400 (EDT)

branch: externals/rich-minority
commit 5839ee43b1f91d1d95d5ec4543e978424ce0649b
Author: Artur Malabarba <artur@endlessparentheses.com>
Commit: Artur Malabarba <artur@endlessparentheses.com>

    Move a lambda to a global function to reduce memory usage -- Fix #20
---
 rich-minority.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/rich-minority.el b/rich-minority.el
index 14f9832..2bf8189 100644
--- a/rich-minority.el
+++ b/rich-minority.el
@@ -187,18 +187,20 @@ if the mode line string is empty."
     (unless (string= mode-string "")
       (cons mode-string mode-symbol))))
 
+(defconst rm--help-echo-spacer
+  (propertize " " 'display '(space :align-to 15)))
+
+(defun rm--help-echo-descriptor (pair)
+  (format "   %s%s(%S)" (car pair) rm--help-echo-spacer (cdr pair)))
+
 ;;;###autoload
 (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)))
-        (spacer (propertize " " 'display '(space :align-to 15))))
+                                     minor-mode-alist))))
     (setq rm--help-echo
           (format "Full list:\n%s\n\n%s"
-                  (mapconcat (lambda (pair)
-                               (format "   %s%s(%S)"
-                                       (car pair) spacer (cdr pair)))
-                             full-list "\n")
+                  (mapconcat rm--help-echo-descriptor full-list "\n")
                   rm--help-echo-bottom))
     (mapcar #'rm--propertize
             (rm--remove-hidden-modes



reply via email to

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