unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5711: 23.1; Customizing the bell
@ 2010-03-12 15:54 Eli Barzilay
  2010-03-12 17:14 ` Drew Adams
  2010-03-12 18:05 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Eli Barzilay @ 2010-03-12 15:54 UTC (permalink / raw)
  To: 5711

I'd like for my Emacs to sometimes ring the bell as usual, sometimes
flash the screen, and sometimes play a sound.  Currently, I can change
it to do one of these things in the usual way, but I cannot write code
that determines what to do dynamically.  What's missing is a primitive
function to the "real" beep.  Something that would allow me to do
this:

  (setq ring-bell-function
        (lambda ()
          (if (foo)
            (call-process "aplay" nil 0 nil "foo.wav")
            (let ((visible-bell (bar))) (real-ding)))))

(I could do this in a bad way, by installing some hook that will set
`ring-bell-function' and `visible-bell' -- for example in an idle
timer, but the above would be much more convenient.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!







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

* bug#5711: 23.1; Customizing the bell
  2010-03-12 15:54 bug#5711: 23.1; Customizing the bell Eli Barzilay
@ 2010-03-12 17:14 ` Drew Adams
  2010-03-12 18:05 ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2010-03-12 17:14 UTC (permalink / raw)
  To: 'Eli Barzilay', 5711

I'd like it to sing the error message using an encrypted vocabulary, with 4-part
harmony and with steel-drum backup.

Sorry; couldn't resist. No, your request is not a silly one.







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

* bug#5711: 23.1; Customizing the bell
  2010-03-12 15:54 bug#5711: 23.1; Customizing the bell Eli Barzilay
  2010-03-12 17:14 ` Drew Adams
@ 2010-03-12 18:05 ` Stefan Monnier
  2010-03-12 19:20   ` Eli Barzilay
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2010-03-12 18:05 UTC (permalink / raw)
  To: Eli Barzilay; +Cc: 5711

>   (setq ring-bell-function
>         (lambda ()
>           (if (foo)
>             (call-process "aplay" nil 0 nil "foo.wav")
>             (let ((visible-bell (bar))) (real-ding)))))

Doesn't

(setq ring-bell-function
      (lambda ()
        (if (foo)
            (call-process "aplay" nil 0 nil "foo.wav")
          (let ((visible-bell (bar)) (ring-bell-function nil)) (ding)))))

do the trick?


        Stefan






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

* bug#5711: 23.1; Customizing the bell
  2010-03-12 18:05 ` Stefan Monnier
@ 2010-03-12 19:20   ` Eli Barzilay
  2010-03-15 19:39     ` Glenn Morris
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Barzilay @ 2010-03-12 19:20 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 5711

On Mar 12, Stefan Monnier wrote:
> >   (setq ring-bell-function
> >         (lambda ()
> >           (if (foo)
> >             (call-process "aplay" nil 0 nil "foo.wav")
> >             (let ((visible-bell (bar))) (real-ding)))))
> 
> Doesn't
> 
> (setq ring-bell-function
>       (lambda ()
>         (if (foo)
>             (call-process "aplay" nil 0 nil "foo.wav")
>           (let ((visible-bell (bar)) (ring-bell-function nil)) (ding)))))
> 
> do the trick?

Ah, you're right -- sorry.  Fine to close this bug then.  BTW, a
better answer would be:

  (defun real-ding () (let ((ring-bell-function nil)) (ding)))

The only thing that might make sense is to show this in the docs as a
way to do this kind of thing (but I don't have any strong opinion
about that).

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!






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

* bug#5711: 23.1; Customizing the bell
  2010-03-12 19:20   ` Eli Barzilay
@ 2010-03-15 19:39     ` Glenn Morris
  0 siblings, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2010-03-15 19:39 UTC (permalink / raw)
  To: 5711-done

Eli Barzilay wrote:

> Ah, you're right -- sorry.  Fine to close this bug then.






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

end of thread, other threads:[~2010-03-15 19:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-12 15:54 bug#5711: 23.1; Customizing the bell Eli Barzilay
2010-03-12 17:14 ` Drew Adams
2010-03-12 18:05 ` Stefan Monnier
2010-03-12 19:20   ` Eli Barzilay
2010-03-15 19:39     ` Glenn Morris

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).