zsh-workers
 help / color / mirror / code / Atom feed
* watch formatting fix
@ 1995-12-15 13:03 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1995-12-15 13:03 UTC (permalink / raw)
  To: Zsh hackers list

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@ifh.de>       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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-12-15 13:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-12-15 13:03 watch formatting fix Peter Stephenson

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

	https://git.vuxu.org/mirror/zsh/

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).