请问,访问存在的每个框架并执行与框架本身不一定相关的功能的最佳方法是什么?
(dolist (unrelated-function (frame-list)
(setq unrelated-function (sound))
(if (frame-parameter (selected-frame) 'name)
unrelated-function)))
我只看到了依赖于框架的示例,例如修改参数等。
编辑:这是一个更新的工作示例:
(defun dolist-test ()
(interactive)
(dolist (frame (frame-list))
(switch-to-frame (frame-parameter frame 'name))
;; insert additional functions -- e.g., update the frame
(message "Frame Visited: %s" (frame-parameter frame 'name)) ))
(defun switch-to-frame (frame-name)
(let ((frames (frame-list)))
(catch 'break
(while frames
(let ((frame (car frames)))
(if (equal (frame-parameter frame 'name) frame-name)
(throw 'break (select-frame-set-input-focus frame))
(setq frames (cdr frames))))))))