sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
From: arnold@skeeve.atl.ga.us (Arnold D. Robbins)
To: sam-fans@hawkwind.utcs.toronto.edu
Subject: ring my bell
Date: Mon, 11 Oct 1993 04:18:00 -0400	[thread overview]
Message-ID: <m0omISn-00013pC@skeeve.atl.ga.us> (raw)

Matty has the bell code in 9term disabled - you have to define BEEP and you
only get a bell if in Unix mode.

Me, I like to start a long running job and then echo '^G' when I'm done to
tell me I can come back to my system.  So, here's a patch for 9term.c that
makes beeping a button 3 item, independent of the unix/plan 9 keyboard mode.
Not beeping is the default behaviour, so this won't affect you if you don't
want bells anyway.

And hey, if you consider this a trivial patch, don't apply it, but don't
bother to flame me about it. It makes my life easier. :-)

Arnold Robbins -- The Basement Computer		| Laundry increases
Internet: arnold@skeeve.ATL.GA.US		| exponentially in the
UUCP:	{ gatech, emory }!skeeve!arnold		| number of children.
Bitnet:	Forget it. Get on a real network.	|    -- Miriam Robbins
---------
*** 9term.h.orig	Sat Sep 11 00:37:27 1993
--- 9term.h	Mon Oct 11 04:05:03 1993
***************
*** 17,22 ****
--- 17,23 ----
  extern int		comm_fd;
  extern int		slave_fd;
  extern int		kbdmode;
+ extern int		dobeep;
  extern int		utmpentry;
  
  extern Rune		intrchar;
*** 9term.c.orig	Sat Sep 11 00:38:34 1993
--- 9term.c	Mon Oct 11 04:11:09 1993
***************
*** 30,36 ****
  	mSCROLL
  };
  
! static	char	*modenames[] = {"fwd","bkwd","suspend","view","review",0,0};
  static	Menu	kmode = {modenames} ;
  enum {	mFWD,
  	mBKWD,
--- 30,36 ----
  	mSCROLL
  };
  
! static	char	*modenames[] = {"fwd","bkwd","suspend","view","review",0,0,0};
  static	Menu	kmode = {modenames} ;
  enum {	mFWD,
  	mBKWD,
***************
*** 37,46 ****
--- 37,48 ----
  	mSUSP,
  	mVIEW,
  	mREVIEW,
+ 	mBEEP,
  	mMODE
  };
  
  int	kbdmode = PLAN9;
+ int	dobeep = 0;
  
  static	Cursor	whitearrow = {
  	{0, 0},
***************
*** 283,291 ****
  				FLUSHBUF();
  				*q++ = *p;
  				break;
- #ifdef BEEP
  			case 0x07:
! 				if (kbdmode == UNIX)
  					beep();
  				else {
  					if (q >= &buf[EMAXMSG])	/* buffer full? */
--- 285,292 ----
  				FLUSHBUF();
  				*q++ = *p;
  				break;
  			case 0x07:
! 				if (dobeep)
  					beep();
  				else {
  					if (q >= &buf[EMAXMSG])	/* buffer full? */
***************
*** 293,299 ****
  					*q++ = *p;
  				}
  				break;
- #endif
  			case '\b':		/* backspace at output point */
  				if (q > buf)
  					q--;
--- 294,299 ----
***************
*** 432,437 ****
--- 432,438 ----
  {
  	kmode.item[mMODE] = (kbdmode == PLAN9) ?"unix":"plan 9";
  	kmode.item[mSUSP] = suspended ? "resume" : "suspend";
+ 	kmode.item[mBEEP] = dobeep ? "nobeep" : "beep";
  	switch (menuhit(3, m, &kmode))
  	{
  	case mFWD:
***************
*** 451,456 ****
--- 452,460 ----
  		break;
  	case mREVIEW:
  		textset(text, _backnl(text, text->base, text->f.maxlines/2));
+ 		break;
+ 	case mBEEP:
+ 		dobeep = ! dobeep;
  		break;
  	case mMODE:
  		if (kbdmode == UNIX)


                 reply	other threads:[~1993-10-11  8:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m0omISn-00013pC@skeeve.atl.ga.us \
    --to=arnold@skeeve.atl.ga.us \
    --cc=sam-fans@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).