我使用 emacs24,我通常在开始时将 emacs 作为守护程序启动,然后使用 emacsclient 框架。
但是我遇到了一个问题:在我创建了第一帧之后,然后每当我创建新帧(第一帧关闭后)都会"emacs24@myusername" is ready弹出一个系统消息,使新帧失去焦点(焦点在消息),这很烦人。似乎是因为即使我关闭所有帧,一些缓冲区仍然打开(如Scratch和Messages)。我只是想知道是否有办法防止系统消息弹出?
谢谢!
编辑:忘了提及我正在使用 Gnome 3。
这是我所做的:
(server-start)
(defun px-raise-frame-and-give-focus ()
(when window-system
(raise-frame)
(x-focus-frame (selected-frame))
(set-mouse-pixel-position (selected-frame) 4 4)
))
(add-hook 'server-switch-hook 'px-raise-frame-and-give-focus)
Run Code Online (Sandbox Code Playgroud)