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

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

[elpa] externals/embark f88314044d 3/3: Avoid long lines


From: ELPA Syncer
Subject: [elpa] externals/embark f88314044d 3/3: Avoid long lines
Date: Sun, 7 May 2023 12:58:07 -0400 (EDT)

branch: externals/embark
commit f88314044d5492efeacb9466122889c6e60c8af4
Author: Omar Antolín <omar.antolin@gmail.com>
Commit: Omar Antolín <omar.antolin@gmail.com>

    Avoid long lines
---
 embark.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/embark.el b/embark.el
index 2123fd72c2..91a6ae2b09 100644
--- a/embark.el
+++ b/embark.el
@@ -2935,7 +2935,8 @@ For non-minibuffers, assume candidates are of given TYPE."
                     (if-let (a (funcall annotator c)) (list c "" a) c))
                   candidates)))))
 
-(defun embark--display-string (str) ;; Note: Keep in sync with 
vertico--display-string
+(defun embark--display-string (str)
+  ;; Note: Keep in sync with vertico--display-string
   "Return display STR without display and invisible properties."
   (let ((end (length str)) (pos 0) chunks)
     (while (< pos end)
@@ -2944,13 +2945,15 @@ For non-minibuffers, assume candidates are of given 
TYPE."
         (if (stringp disp)
             (let ((face (get-text-property pos 'face str)))
               (when face
-                (add-face-text-property 0 (length disp) face t (setq disp 
(concat disp))))
+                (add-face-text-property
+                 0 (length disp) face t (setq disp (concat disp))))
               (setq pos nextd chunks (cons disp chunks)))
           (while (< pos nextd)
-            (let ((nexti (next-single-property-change pos 'invisible str 
nextd)))
+            (let ((nexti
+                   (next-single-property-change pos 'invisible str nextd)))
               (unless (or (get-text-property pos 'invisible str)
-                          (and (= pos 0) (= nexti end))) ;; full string -> no 
allocation
-                  (push (substring str pos nexti) chunks))
+                          (and (= pos 0) (= nexti end))) ;; full=>no allocation
+                (push (substring str pos nexti) chunks))
               (setq pos nexti))))))
     (if chunks (apply #'concat (nreverse chunks)) str)))
 



reply via email to

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