From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25444 invoked from network); 23 Jun 1999 16:18:23 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 Jun 1999 16:18:23 -0000 Received: (qmail 2151 invoked by alias); 23 Jun 1999 16:18:14 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6816 Received: (qmail 2144 invoked from network); 23 Jun 1999 16:18:12 -0000 Message-Id: <9906231549.AA14967@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: PATCH: pws-N: more useful sort of beep Date: Wed, 23 Jun 1999 17:49:34 +0200 From: Peter Stephenson I hope some of you are going to like these extra three lines of code as much as I already do... I got the idea from emacs' visible-bell, when doing all the beep stuff, which like many people I never use because it's so annoying. Now the parameter ZBEEP (does anyone have a name they prefer) can contain a string to output instead of beeping. With many terminals, it's possible to emulate emacs' visible bell rather grossly simply by flashing inverse video on and off; the vt100/xterm sequences are given in the new manual entry. I find it quick enough not to be annoying, but no doubt the diehards won't be convinced. --- Doc/Zsh/params.yo.vb Thu Jun 17 14:03:03 1999 +++ Doc/Zsh/params.yo Wed Jun 23 17:38:34 1999 @@ -858,6 +858,19 @@ A list of non-alphanumeric characters considered part of a word by the line editor. ) +vindex(ZBEEP) +item(tt(ZBEEP))( +If set, this gives a string of characters, which can use all the same codes +as the tt(bindkey) command as described in +ifzman(zmanref(zshzle))\ +ifnzman(noderef(Zsh Line Editor))\ +, that will be output to the terminal +instead of beeping. This may have a visible instead of an audible effect; +for example, the string `tt(\e[?5h\e[?5l)' on a vt100 or xterm will have +the effect of flashing reverse video on and off (if you usually use reverse +video, you should use the string `tt(\e[?5l\e[?5h)' instead). This takes +precedence over the tt(NOBEEP) option. +) vindex(ZDOTDIR) item(tt(ZDOTDIR))( The directory to search for shell startup files (.zshrc, etc), --- Src/utils.c.vb Sun Jun 20 14:57:26 1999 +++ Src/utils.c Wed Jun 23 17:35:29 1999 @@ -2133,7 +2133,12 @@ void zbeep(void) { - if (isset(BEEP)) + char *vb; + if ((vb = getsparam("ZBEEP"))) { + int len; + vb = getkeystring(vb, &len, 2, NULL); + write(SHTTY, vb, len); + } else if (isset(BEEP)) write(SHTTY, "\07", 1); } -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy