使用Window Explorer或GNOME Nautilus File在emacs中打开文件时,文件在拆分视图中打开,底部窗口包含emacs欢迎屏幕。
是否有任何方式,该文件打开作为一个单一窗口,并保持缓冲区,如*划痕“,消息等保持打开,但隐藏。
发布于 2013-12-09 16:19:33
如果您想永久地保持这种行为,您可以使用:
(add-hook 'find-file-hook 'delete-other-windows)你的emacs-初始化。
发布于 2013-12-09 16:43:46
下面是如何为Ubuntu做这件事:写入文件/usr/local/share/applications/emacsclient.desktop
[Desktop Entry]
Name=Emacsclient
GenericName=Text Editor
Comment=View and edit files
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=/usr/local/bin/emacsclient %F
Icon=emacs
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupWMClass=Emacs只需确保emacsclient确实位于/usr/local/bin/emacsclient中(您可以在bash中使用which emacsclient查看此信息)。然后从bash执行:
sudo update-desktop-database最后,添加到您的~/.emacs
(require 'server)
(or (server-running-p) (server-start))在此之后,一旦Emacs实例运行,单击Nautilus中的文件将在Emacs的当前窗口中打开它,而不会更改窗口配置。
发布于 2013-12-10 05:21:15
通常,如果没有其他设置控制窗口/帧选择,则函数display-buffer (或其相关的函数系列,例如pop-to-buffer)默认为拆分窗口。如果您有进一步的问题,您的初始缓冲区选择之一可能是使用类似的东西--或者您有一个display-buffer-alist设置来导致它。
使用(setq initial-buffer-choice t)将消除欢迎屏幕,只留下一个*scratch*缓冲区。
我在Emacs安装文件中使用这个:
(setq initial-scratch-message nil)
(setq initial-buffer-choice t)取决于您是否具有desktop-save-mode活动,您可能也需要类似的东西。。。我修改了desktop-read函数,以便在after-init-hook (在emacs-startup-hook之前加载)之后使用它。
(add-hook 'emacs-startup-hook (lambda ()
(bury-buffer "*scratch*") ))https://stackoverflow.com/questions/20475086
复制相似问题