[英]How to automatically jump into the *compilation* buffer after the compilation ending in emacs?
Emacs 有一個編譯命令,打開一個所謂的 *compilation* 緩沖區,顯示編譯結果。 我想將 emacs 配置為在編譯結束后自動跳轉到此緩沖區(無論是否有警告或錯誤)。
這樣做的目的是,如果沒有錯誤,我想繼續編碼關閉 *compilation* 緩沖區需要跳轉到它( Cx o
)並關閉它( q
)或關閉其他 window ( Cx 1
)敲擊鍵盤 3 或 4 下。 如果自動選擇 *compilation* 緩沖區,則只需要一個( q
)(或者我可以 go 使用RET
出現錯誤)。
我看到了其他相關的帖子,但沒有人專門解決這個問題。
將此添加到您的初始化文件中: ~/.emacs
(或~/.emacs.d/init.el
)
(add-hook 'compilation-finish-functions 'switch-to-buffer-other-window 'compilation)
add-hook
在compilation-finish
后添加一個 function 調用。 function 明確地switch-to-buffer-other-window
並采用參數compilation
,再次明確地,*編譯*緩沖區的名稱。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.