如何在 emacs 框架渲染后立即运行命令?
我正在尝试弄清楚如何使用 Emacs 代码浏览器 (ECB),您可以用它做的一件事是设置 ecb-windows-width 来决定 ecb 窗口的宽度。 问题是这个序列:
- 屏幕上弹出框架。
- ecb-activate 被调用,根据 ecb-windows-width 进行缩放。
- default-frame-alist 参数启动,框架被调整大小。
问题是,由于这个顺序,ecb 窗口的宽度是在调整框架大小之前设置的,然后不会缩放。
所以我想运行 ecb-redraw-layout (或者理想情况下只是 ecb-activate ),但它必须在 #3 之后发生。 否则,某种 ecb-dynamic-width-scale 选项也可以工作。
就其价值而言, ecb-auto-activate 不起作用,所以我不知道这是否可以解决问题。
I'm trying to figure out how to use Emacs Code Browser (ECB) and one of the things you can do with it is set ecb-windows-width to decide how wide the ecb windows are. The problem is this sequence:
- Frame pops up on screen.
- ecb-activate gets called, scaled according to ecb-windows-width.
- default-frame-alist parameters kick in, frame gets resized.
The problem is that due to this order the width of the ecb window is set before the frame gets resized, and then doesn't get scaled.
So I'd like to run ecb-redraw-layout (or ideally just ecb-activate), but it has to happen after #3. Otherwise, some sort of ecb-dynamic-width-scale option would also work.
For what it's worth, ecb-auto-activate doesn't work, so I can't find out if that would solve it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来我找到了解决方法。
相当黑客,因为您是根据首先出现的默认框架大小设置宽度,而不是您实际使用的大小。 但是哦,好吧。
It looks like I've found a workaround.
Quite hackish because you're setting the width according to the default frame size that comes up first, not the size you actually use. But oh well.
我不熟悉 ECB,但是 after-make-frame-functions 可能有助于运行您想要的函数(或者运行一些您想要对 ecb 框架执行特殊操作的钩子函数)。
after-make-frame-functions
是带有一个参数(新创建的框架)的函数列表,并在创建框架后运行。 这不适用于初始 emacs 框架(启动时),因为您的 .emacs 在框架创建之后被读取。I'm unfamiliar with ECB, but
after-make-frame-functions
might be helpful in running the functions you want (or running some hook function where you want to do special things with the ecb frame).after-make-frame-functions
is a list of functions that take one argument (the newly created frame), and is run after the frame is created. This doesn't apply to the initial emacs frame (on startup) because your .emacs is read after the frame is already created.