如何在 emacs 框架渲染后立即运行命令?

发布于 2024-07-20 00:47:05 字数 452 浏览 3 评论 0原文

我正在尝试弄清楚如何使用 Emacs 代码浏览器 (ECB),您可以用它做的一件事是设置 ecb-windows-width 来决定 ecb 窗口的宽度。 问题是这个序列:

  1. 屏幕上弹出框架。
  2. ecb-activate 被调用,根据 ecb-windows-width 进行缩放。
  3. 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:

  1. Frame pops up on screen.
  2. ecb-activate gets called, scaled according to ecb-windows-width.
  3. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

牵强ㄟ 2024-07-27 00:47:05

看来我找到了解决方法。

  1. 将 ecb-fix-window-size 设置为 true。
  2. 当帧加载时,将调用 ecb-activate,并且 ecb 窗口将根据帧大小按比例缩放。
  3. 然后 default-frame-alist 启动并且框架被调整大小,但是 ecb 窗口具有固定大小并且不会缩放。

相当黑客,因为您是根据首先出现的默认框架大小设置宽度,而不是您实际使用的大小。 但是哦,好吧。

It looks like I've found a workaround.

  1. Set ecb-fix-window-size to true.
  2. When the frame loads, ecb-activate is called and the ecb windows are scaled proportionally to the frame size.
  3. Then default-frame-alist kicks in and frame gets resized, but the ecb windows have a fixed size and don't get scaled.

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.

放血 2024-07-27 00:47:05

我不熟悉 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文