emacs跟踪模式跨帧 [英] emacs follow-mode across frames

查看:249
本文介绍了emacs跟踪模式跨帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法得到像追踪模式一样的行为,但是在不同的框架内跨多个窗口呢?

Is there a way to get behavior like you find in follow-mode but have it across multiple windows in separate frames?

我必须与一些令人讨厌的遗留代码一起工作,这些代码有七个页面砖,具有很多goto的八层深度嵌套循环,它有助于看到许多代码尽可能(以便充分理解和重写它,而不破坏一切)。

I've gotta work with some nasty legacy code that has seven page bricks of eight-level-deep nested for loops with lots'a goto's and it helps to see as much of the code as possible (in order to adequately understand and rewrite it without breaking everything else).

我可以一次看到的代码越多越好。

The more code I can see at once, the better.

推荐答案

此限制由 follow-all-followers 调用 next-window

这是一个基本的解决方法。有一些缺点,你会很快注意到(例如,您可能需要手动安排框架),但它有助于使用所有框架的基本要求,您应该能够使其正常工作。

Here's a rudimentary workaround. There are some deficiencies you'll notice pretty quickly (e.g. you may need to arrange the frames manually), but it facilitates the basic requirement of utilising all frames, and you should be able to get it working.

我还建议使用WindMove FrameMove 可能对于这个安排。

I would also suggest that FrameMove with WindMove might prove very useful for this arrangement.

(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 函数来做你想要的。

You might instead prefer to simply redefine the follow-all-followers function to do what you want.

这篇关于emacs跟踪模式跨帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆