Commit e940c6da authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(edebug-window-live-p, edebug-window-list)

(edebug-get-displayed-buffer-points): Use walk-windows/some-window
instead of cycling through windows with next-window.
parent d8aa822b
...@@ -327,22 +327,13 @@ A lambda list keyword is a symbol that starts with `&'." ...@@ -327,22 +327,13 @@ A lambda list keyword is a symbol that starts with `&'."
(defun edebug-window-list () (defun edebug-window-list ()
"Return a list of windows, in order of `next-window'." "Return a list of windows, in order of `next-window'."
;; This doesn't work for epoch. ;; This doesn't work for epoch.
(let* ((first-window (selected-window)) (let (window-list)
(window-list (list first-window)) (walk-windows (lambda (w) (setq window-list (cons w window-list))))
(next (next-window first-window)))
(while (not (eq next first-window))
(setq window-list (cons next window-list))
(setq next (next-window next)))
(nreverse window-list))) (nreverse window-list)))
(defun edebug-window-live-p (window) (defun edebug-window-live-p (window)
"Return non-nil if WINDOW is visible." "Return non-nil if WINDOW is visible."
(let* ((first-window (selected-window)) (some-window (lambda (w) (eq w window))))
(next (next-window first-window t)))
(while (not (or (eq next window)
(eq next first-window)))
(setq next (next-window next t)))
(eq next window)))
;; Not used. ;; Not used.
'(defun edebug-two-window-p () '(defun edebug-two-window-p ()
...@@ -433,17 +424,13 @@ Return the result of the last expression in BODY." ...@@ -433,17 +424,13 @@ Return the result of the last expression in BODY."
(defun edebug-get-displayed-buffer-points () (defun edebug-get-displayed-buffer-points ()
;; Return a list of buffer point pairs, for all displayed buffers. ;; Return a list of buffer point pairs, for all displayed buffers.
(save-excursion (let (list)
(let* ((first-window (selected-window)) (walk-windows (lambda (w)
(next (next-window first-window)) (unless (eq w (selected-window))
(buffer-point-list nil) (setq list (cons (cons (window-buffer w)
buffer) (window-point w))
(while (not (eq next first-window)) list)))))
(set-buffer (setq buffer (window-buffer next))) list))
(setq buffer-point-list
(cons (cons buffer (point)) buffer-point-list))
(setq next (next-window next)))
buffer-point-list)))
(defun edebug-set-buffer-points (buffer-points) (defun edebug-set-buffer-points (buffer-points)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment