[R] How to turn off the beep made by locator()?

Stephen Eglen eglen at pcg.wustl.edu
Thu Feb 28 22:58:09 CET 2002


Hi, 

[I'm Using redhat linux 7.1 with R-1.4.1 rpms.]

Last summer, Henrik Bengtsson wrote to R-help:
> Is there a way to turn of the (annoying) beep that occurs when one calls the
> locator() command and clicks the mouse. Try
>
> plot(0)
> locator(n=10)
>
> I am running Rterm on WindowsMe/Cygwin bash and I don't know if this is the
> case on other platforms.

 (from http://maths.newcastle.edu.au/~rking/R/help/01c/0269.html)

to which Brian Ripley replied:
> It's a feature of the windows() device. Windows is fond of beeping, and I
> just mute the sound.

I get the same beep on my Linux machine even when I execute the shell
command "xset b off" (this is enough to silence the beeps from
Emacs).  Does anyone else have this problem of silencing locator() and
identify()?  If "xset b off" silences locator() for other linux users,
then it is probably just my local setup at fault.

If other people can silence the XBell on Unix, I'd be grateful to know
how.  Otherwise, I'll volunteer to submit a patch that allows the bell
to be switched off (perhaps using GetOption("bell")) at least for the
devices (X11, GNOME) that I should be able to test.  Or, perhaps the
easiest things would be to remove the few lines that make R beep in
response to the mouse clicks, unless people think them useful.  (bells
are also used by data.entry() -- see dataentry.c).  I've also made a
pass through the win32 and GNOME drivers, and think I can see where
the beep is generated in those drivers.

/src/modules/X11/devX11.c, line 1726:
  		       /* Make a beep! Was print "\07", but that 
                          messes up some terminals. */
                    XBell(display, X_BELL_VOLUME);
		    XSync(display, 0);


Best wishes, 
Stephen Eglen




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list