Subject: Re: bug#19203: visible-bell not acting like a special variable?

From: martin rudalics <[email-masked]>
Date: Fri, 28 Nov 2014 19:38:28 +0100

> (setq visible-bell t) ; no bell
 > (let ((visible-bell nil)) ; but ring bell for this one
 >    (next-line)) ; when at end of buffer, C-x C-e should ring the bell. it
 > doesn't.
 >
 > why doesn't this work?

Because the bell doesn't ring within the scope of the `let'.  Try

(setq visible-bell t)

(defun set-visible-bell ()
   (setq visible-bell t))

(defun ding-ding ()
   (add-hook 'post-command-hook 'set-visible-bell)
   (setq visible-bell nil)
   (ding))

(ding-ding)

instead.

martin