all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#19203: visible-bell not acting like a special variable?
@ 2014-11-27 11:50 Mario Valencia
  2014-11-28 18:38 ` martin rudalics
  0 siblings, 1 reply; 2+ messages in thread
From: Mario Valencia @ 2014-11-27 11:50 UTC (permalink / raw)
  To: 19203

[-- Attachment #1: Type: text/plain, Size: 193 bytes --]

(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?

[-- Attachment #2: Type: text/html, Size: 284 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#19203: visible-bell not acting like a special variable?
  2014-11-27 11:50 bug#19203: visible-bell not acting like a special variable? Mario Valencia
@ 2014-11-28 18:38 ` martin rudalics
  0 siblings, 0 replies; 2+ messages in thread
From: martin rudalics @ 2014-11-28 18:38 UTC (permalink / raw)
  To: Mario Valencia, 19203

 > (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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-28 18:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-27 11:50 bug#19203: visible-bell not acting like a special variable? Mario Valencia
2014-11-28 18:38 ` martin rudalics

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.