要把警示聲換成視覺警示,可以寫成
(custom-set-variables '(visible-bell t))
在 GNU Emacs,這樣預設是閃爍第一行或最後一行,端看 touch panel 是轉哪一邊,XEmacs 則是閃爍整個螢幕,要讓 XEmacs 僅閃爍一行,則要寫成
(custom-set-variables '(visible-bell 'top-bottom))
。完全關閉警告,可以設成
(custom-set-variables '(ring-bell-function 'ignore))
。ring-bell-function
還可以設定成一個 lambda,指定警示聲去播放某個音效檔案。(setq ring-bell-function (lambda ()
(call-process "audioplay" nil 0 nil
"/this/is/my/errorsound.au")))
或是送出訊息
(setq ring-bell-function (lambda ()
(message "use the message to replace beep")))
Emacs is awesome :D