Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

watch formatting fix



This fixes the problem with standout etc. in $WATCHFMT strings.
The termcap routine was sending everything to the shell output file
regardless, which wasn't flushed until the next line, so that all the
rest of the stuff going to stdout wasn't emboldened.

There seems to be quite a lot of duplication between the watch
printing routine and the prompt printing routine.  I don't know
whether the txtchangeset stuff is necessary here or not.  It doesn't
seem to need it.

I've also corrected some indentation and deleted an unnecessary line
which sets the format when it's already been set, because I'm sad.

There weren't any comments so I didn't try adding any.

*** Src/watch.c.bak	Fri Dec 15 13:25:39 1995
--- Src/watch.c	Fri Dec 15 13:55:49 1995
***************
*** 226,258 ****
  		    putchar('%');
  		    break;
  		case 'S':
! 		   txtset(TXTSTANDOUT);
! 		   tsetcap(TCSTANDOUTBEG, 0);
! 		   break;
  		case 's':
! 		   txtset(TXTDIRTY);
! 		   txtunset(TXTSTANDOUT);
! 		   tsetcap(TCSTANDOUTEND, 0);
! 		   break;
  		case 'B':
! 		   txtset(TXTDIRTY);
! 		   txtset(TXTBOLDFACE);
! 		   tsetcap(TCBOLDFACEBEG, 0);
! 		  break;
  		case 'b':
! 		   txtset(TXTDIRTY);
! 		   txtunset(TXTBOLDFACE);
! 		   tsetcap(TCALLATTRSOFF, 0);
! 		   break;
  		case 'U':
! 		   txtset(TXTUNDERLINE);
! 		   tsetcap(TCUNDERLINEBEG, 0);
! 		   break;
  		case 'u':
! 		   txtset(TXTDIRTY);
! 		   txtunset(TXTUNDERLINE);
! 		   tsetcap(TCUNDERLINEEND, 0);
! 		   break;
  		default:
  		    putchar('%');
  		    putchar(*fm2);
--- 226,258 ----
  		    putchar('%');
  		    break;
  		case 'S':
! 		    txtset(TXTSTANDOUT);
! 		    tsetcap(TCSTANDOUTBEG, -1);
! 		    break;
  		case 's':
! 		    txtset(TXTDIRTY);
! 		    txtunset(TXTSTANDOUT);
! 		    tsetcap(TCSTANDOUTEND, -1);
! 		    break;
  		case 'B':
! 		    txtset(TXTDIRTY);
! 		    txtset(TXTBOLDFACE);
! 		    tsetcap(TCBOLDFACEBEG, -1);
! 		    break;
  		case 'b':
! 		    txtset(TXTDIRTY);
! 		    txtunset(TXTBOLDFACE);
! 		    tsetcap(TCALLATTRSOFF, -1);
! 		    break;
  		case 'U':
! 		    txtset(TXTUNDERLINE);
! 		    tsetcap(TCUNDERLINEBEG, -1);
! 		    break;
  		case 'u':
! 		    txtset(TXTDIRTY);
! 		    txtunset(TXTUNDERLINE);
! 		    tsetcap(TCUNDERLINEEND, -1);
! 		    break;
  		default:
  		    putchar('%');
  		    putchar(*fm2);
***************
*** 384,391 ****
      struct stat st;
  
      holdintr();
-     if (!fmt)
- 	fmt = "%n has %a %l from %m.";
      if (!wtab) {
  	readwtab();
  	noholdintr();
--- 384,389 ----
*** Src/zle_misc.c.bak	Fri Dec 15 13:43:46 1995
--- Src/zle_misc.c	Fri Dec 15 13:45:51 1995
***************
*** 696,703 ****
  tsetcap(int cap, int flag)
  {
      if (termok && !isset(SINGLELINEZLE) && tcstr[cap]) {
! 	if (flag == 0) 
! 	    tputs(tcstr[cap], 1, putshout);
  	else {
  	    if (!dontcount) {
  		int  t0;
--- 696,703 ----
  tsetcap(int cap, int flag)
  {
      if (termok && !isset(SINGLELINEZLE) && tcstr[cap]) {
! 	if (flag <= 0) 
! 	    tputs(tcstr[cap], 1, (flag < 0) ? putraw : putshout);
  	else {
  	    if (!dontcount) {
  		int  t0;

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



Messages sorted by: Reverse Date, Date, Thread, Author