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

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

[elpa] externals/beardbolt 42b0ab4239 225/323: Make it clear that we're


From: ELPA Syncer
Subject: [elpa] externals/beardbolt 42b0ab4239 225/323: Make it clear that we're operating on a list of asm regions
Date: Thu, 9 Mar 2023 10:58:33 -0500 (EST)

branch: externals/beardbolt
commit 42b0ab4239518a9752c81eaec78ca92852ff412d
Author: Erik Arvstedt <erik.arvstedt@gmail.com>
Commit: Erik Arvstedt <erik.arvstedt@gmail.com>

    Make it clear that we're operating on a list of asm regions
    
    - Rename hash-table -> line-mappings, asm-lines -> asm-regions
    - Use cl-loop for `(start . end)` cons destructuring
---
 rmsbolt.el | 38 ++++++++++++++++++--------------------
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 30b9a8a6ed..ec2378b58d 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1650,8 +1650,8 @@ Are you running two compilations at the same time?"))
               (if (eq (current-buffer) src-buffer)
                   current-line
                 (get-text-property (point) 'rmsbolt-src-line)))
-             (hash-table (buffer-local-value 'rmsbolt-line-mapping src-buffer))
-             (asm-lines (gethash src-current-line hash-table))
+             (line-mappings (buffer-local-value 'rmsbolt-line-mapping 
src-buffer))
+             (asm-regions (gethash src-current-line line-mappings))
              ;; TODO also consider asm
              (src-pts
               (with-current-buffer src-buffer
@@ -1672,21 +1672,19 @@ Are you running two compilations at the same time?"))
           (with-current-buffer output-buffer
             (let ((saved-pt (point)))
               (save-excursion
-                (dolist (l asm-lines)
-                  (let* ((start (car l))
-                         (end (cdr l))
-                         (start-pt (progn (rmsbolt--goto-line start)
-                                          (c-point 'bol)))
-                         (end-pt (progn (rmsbolt--goto-line end)
-                                        (c-point 'bonl))))
-                    (when (and (not line-visible)
-                               (not scroll-src-buffer-p))
-                      (setq line-visible (or (rmsbolt--point-visible start-pt)
-                                             (rmsbolt--point-visible end-pt)
-                                             (and (> saved-pt start-pt)
-                                                  (< saved-pt end-pt)))))
-                    (push (rmsbolt--setup-overlay start-pt end-pt 
output-buffer)
-                          rmsbolt-overlays)))))
+                (cl-loop for (start . end) in asm-regions
+                         do (let ((start-pt (progn (rmsbolt--goto-line start)
+                                                   (c-point 'bol)))
+                                  (end-pt (progn (rmsbolt--goto-line end)
+                                                 (c-point 'bonl))))
+                              (when (and (not line-visible)
+                                         (not scroll-src-buffer-p))
+                                (setq line-visible (or (rmsbolt--point-visible 
start-pt)
+                                                       (rmsbolt--point-visible 
end-pt)
+                                                       (and (> saved-pt 
start-pt)
+                                                            (< saved-pt 
end-pt)))))
+                              (push (rmsbolt--setup-overlay start-pt end-pt 
output-buffer)
+                                    rmsbolt-overlays)))))
             (when (or (not line-visible) force)
               ;; Scroll buffer to first line
               (when-let ((scroll-buffer (if scroll-src-buffer-p
@@ -1697,10 +1695,10 @@ Are you running two compilations at the same time?"))
                                           src-current-line
                                         (progn
                                           (car-safe
-                                           ;; If forcing, pick the min line 
instead
+                                           ;; If forcing, pick the last region 
instead
                                            (if force
-                                               (car-safe (last asm-lines))
-                                             (cl-first asm-lines)))))))
+                                               (car-safe (last asm-regions))
+                                             (cl-first asm-regions)))))))
                 (with-selected-window window
                   (rmsbolt--goto-line line-scroll)
                   ;; If we scrolled, recenter



reply via email to

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