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

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

[nongnu] elpa/page-break-lines 36d3f93a23 34/80: More efficiently update


From: ELPA Syncer
Subject: [nongnu] elpa/page-break-lines 36d3f93a23 34/80: More efficiently update display tables
Date: Tue, 5 Sep 2023 04:03:06 -0400 (EDT)

branch: elpa/page-break-lines
commit 36d3f93a23b767e7558b9c90f3631b03ce9fbdce
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>

    More efficiently update display tables
---
 page-break-lines.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/page-break-lines.el b/page-break-lines.el
index b826bdbf64..becf18a974 100644
--- a/page-break-lines.el
+++ b/page-break-lines.el
@@ -116,14 +116,14 @@ If the buffer inside WINDOW has `page-break-lines-mode' 
enabled,
 its display table will be modified as necessary."
   (with-current-buffer (window-buffer window)
     (if page-break-lines-mode
-        (let ((width (- (window-width window) 1)))
+        (progn
           (unless buffer-display-table
             (setq buffer-display-table (make-display-table)))
-          (aset buffer-display-table ?\^L
-                (vconcat (mapcar (lambda (c)
-                                   (make-glyph-code c 'page-break-lines))
-                                 (make-list width
-                                            page-break-lines-char)))))
+          (let* ((width (- (window-width window) 1))
+                 (glyph (make-glyph-code page-break-lines-char 
'page-break-lines))
+                 (new-display-entry (vconcat (make-list width glyph))))
+            (unless (equal new-display-entry (elt buffer-display-table ?\^L))
+              (aset buffer-display-table ?\^L new-display-entry))))
       (when buffer-display-table
         (aset buffer-display-table ?\^L nil)))))
 



reply via email to

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