
emacs 有一個名為「auto-revert-mode」的次要模式,它每 5 秒自動恢復一次檔案緩衝區。
在我的 .emacs 檔案中,我只有一行(auto-revert-mode 1)
,沒有其他內容,但每當我啟動 emacs 會話時,我仍然必須手動開啟它。
這裡發生了什麼事?為什麼我無法在啟動時開啟自動恢復模式?
答案1
來自該函數的文檔:
This is a minor mode that affects only the current buffer.
Use `global-auto-revert-mode' to automatically revert all buffers.
Use `auto-revert-tail-mode' if you know that the file will only grow
without being changed in the part that is already in the buffer.
所以你應該global-auto-revert-mode
根據你的目的使用。