(if (eq lazy-lock-walk-windows t)
- ;; Do all visible non-minibuffer-only frames on the selected device.
+ ;; Visit all visible non-minibuffer-only frames on the selected device.
+ ;; This is harder than it looks, since the `next-frame'
+ ;; interface is error-prone - finding the starting frame is hard.
- (let* ((old-frame (selected-frame))
+ (let* ((starting-frame (selected-frame))
+ (frame starting-frame))
+ (when (or (not (frame-visible-p frame))
+ (frame-minibuffer-only-p frame))
+ ;; starting-frame not suitable.
+ (setq starting-frame (next-frame starting-frame 'visible-nomini))
+ (when (eq starting-frame frame)
+ (throw 'lazy-lock-frame-loop-done t))
+ (setq frame starting-frame))
(setq frame (next-frame frame 'visible-nomini))
- (when (eq frame
+ (when (eq frame -frame)
(throw 'lazy-lock-frame-loop-done t)))))))))
(defun lazy-lock-maybe-fontify-frame (frame)
;; trip frame-modified-tick, until we've verified that we need to
;; proceed to lazy-lock-fontify-window.
(when (symbol-value-in-buffer 'lazy-lock-mode (window-buffer window))
- (with-selected-window window
(defun lazy-lock-fontify-window ()