なるべく ding/beep させないには

変数 this-command があることを初めて知った。といっても、elisp 使いなら皆知っているのかな。

emacs-pretest-bug ML の「Carbon Emacs で ding/bell がうっとうしいから何とかならないか」という投稿、"Re: ding - too often (OS X and in general)" 経由。

(setq ring-bell-function
      (lambda ()
        (unless (memq this-command
                      '(isearch-abort
			abort-recursive-edit
			exit-minibuffer
			keyboard-quit)) ;; add extra commands here
          (ding))))

last-command なんてのもある。ふだんは Emacs/Carbon ではなく Emacs/X11 を使っているけど、何の気なしに読んだスレッドがためになった。