有没有一种方法可以像在跟随模式中那样获得行为,但可以在单独的框架中跨越多个窗口?
我必须处理一些令人讨厌的遗留代码,这些代码有七页砖块,八层深度的嵌套 for 循环,其中有很多 goto,它有助于查看尽可能多的代码(以便充分理解和重写它)而不破坏其他一切)。
我一次能看到的代码越多越好。
此限制由以下明确设置follow-all-followers
在其呼吁中next-window
.
这是一个基本的解决方法。您很快就会注意到一些缺陷(例如,您可能需要手动排列框架),但它促进了利用所有框架的基本要求,并且您应该能够使其工作。
我还建议帧移动 http://www.emacswiki.org/emacs/FrameMoveWindMove 可能对这种安排非常有用。
(defmacro with-temporary-advice (function class name &rest body)
"Enable the specified advice, evaluate BODY, then disable the advice."
`(progn
(ad-enable-advice ,function ,class ,name)
(ad-activate ,function)
,@body
(ad-disable-advice ,function ,class ,name)
(ad-activate ,function)))
(defadvice next-window (before my-next-window-all-frames disable)
"Enforce the ALL-FRAMES argument to `next-window'."
(ad-set-arg 2 'visible))
(defadvice follow-all-followers (around my-follow-all-frames activate)
"Allow `follow-mode' to span frames."
(with-temporary-advice
'next-window 'before 'my-next-window-all-frames
ad-do-it))
相反,您可能更喜欢简单地重新定义follow-all-followers
功能来做你想做的事。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)