zsh-workers
 help / color / mirror / code / Atom feed
* Zsh 3.1.{6,9} patches
@ 2000-07-13  9:59 Fr. Br. George
  2000-07-13 11:12 ` Peter Stephenson
  0 siblings, 1 reply; 7+ messages in thread
From: Fr. Br. George @ 2000-07-13  9:59 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1180 bytes --]

	Hello!

	This is some upgrades i've made for zsh-3.1.6, but it also
useable for zsh-3.1.9

	The first one is code to meke zsh truncate PS1 string backwards.
Just use zro-started argument with %~ command to drop out the REST of
path instead ofte HEAD. See the example (note %01~ entry):
	user@host:/usr..zsh/3.1.9/zsh> pwd; echo $PS1 
	/usr/local/lib/zsh/3.1.9/zsh
	%U%n%u@%B%m%b:%5(~:%01~..%3~:%~)> 
This is useful for keeping starting part of path, so I'll always be
prompted the root of pwd. Who knows how many */bin's a system may have :)
It also possible to use backward flag with another numeric-argumented
commands in the future.

	The second one is Solaris 2.7+ configure patch to make it compile zsh
with libcurses.so by default instead of termcap, which is unnative. If
this is incorrect, and Solaris curses are bugged, please inform me...
I never got a problem using zsh compiled with libcurses.so from Solaris
2.7 (so it was even possible to copy the library to Solaris 2.6 and 2.5.1!).
This is useful for delicate terminal configuring.

	The patchfiles are all for zsh-3.1.9 sources.

			George V Kouryachy (aka Fr. Br. George)
			email: frbrgeorge@intelligencia.com

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1311 bytes --]

--- zsh-3.1.9/Src/prompt.c	Fri Mar 24 13:43:21 2000
+++ zsh-3.1.9.new/Src/prompt.c	Fri Jul  7 17:36:54 2000
@@ -93,6 +93,10 @@
 
 static int dontcount;
 
+/* Backward truncating flag */
+
+static int bw;
+
 /* Strings to use for %r and %R (for the spelling prompt). */
 
 static char *rstring, *Rstring;
@@ -112,7 +116,8 @@
 	modp = tricat("~", nd->nam, p + strlen(nd->dir));
 
     if (npath) {
-	char *sptr;
+      char *sptr;
+      if (!bw) {
 	for (sptr = modp + strlen(modp); sptr > modp; sptr--) {
 	    if (*sptr == '/' && !--npath) {
 		sptr++;
@@ -122,6 +127,15 @@
 	if (*sptr == '/' && sptr[1] && sptr != modp)
 	    sptr++;
 	stradd(sptr);
+      } else {
+        char cbu;
+        for (sptr = modp+1; *sptr; sptr++ )
+	    if (*sptr == '/' && !--npath) break;
+	cbu=*sptr;
+	*sptr=0;
+	stradd(modp);
+	*sptr=cbu;
+      }
     } else
 	stradd(modp);
 
@@ -197,14 +211,16 @@
     Nameddir nd;
 
     for (; *fm && *fm != endchar; fm++) {
-	arg = 0;
+	arg = bw = 0;
 	if (*fm == '%' && isset(PROMPTPERCENT)) {
+	    if (fm[1]=='0') bw=1;
 	    if (idigit(*++fm)) {
 		arg = zstrtol(fm, &fm, 10);
 	    }
 	    if (*fm == '(') {
 		int tc, otrunclen;
 
+		if (fm[1]=='0') bw=1;
 		if (idigit(*++fm)) {
 		    arg = zstrtol(fm, &fm, 10);
 		}

[-- Attachment #3: Type: TEXT/PLAIN, Size: 1129 bytes --]

--- zsh-3.1.9/configure	Tue May 30 13:15:39 2000
+++ zsh-3.1.9.new/configure	Fri Jul  7 17:37:54 2000
@@ -2967,7 +2967,7 @@
 
 
 case "$host_os" in
-  aix*|hpux10.*|hpux11.*) termcap_curses_order="curses ncurses termcap" ;;
+  solaris*|aix*|hpux10.*|hpux11.*) termcap_curses_order="curses ncurses termcap" ;;
   *)             termcap_curses_order="termcap curses ncurses" ;;
 esac
 
@@ -5969,12 +5969,12 @@
   fi
   case "$host_os" in
     hpux*)        DLLDFLAGS="${DLLDFLAGS=-b}" ;;
-    freebsd*|linux*|irix*|osf*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;;
+    solaris*|freebsd*|linux*|irix*|osf*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;;
     sunos*)       DLLDFLAGS="${DLLDFLAGS=-assert nodefinitions}" ;;
     sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G $ldflags}" ;;
     netbsd*)      DLLDFLAGS="${DLLDFLAGS=${DLLDARG}-x -shared --whole-archive}" ;;
     aix*)         DLLDFLAGS="${DLLDFLAGS=-G -bexpall -lc}" ;;
-    solaris*|sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G}" ;;
+    sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G}" ;;
     openbsd*)     DLLDFLAGS="${DLLDFLAGS=-Bshareable}" ;;
   esac
   case "$host" in

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-07-14 11:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-13  9:59 Zsh 3.1.{6,9} patches Fr. Br. George
2000-07-13 11:12 ` Peter Stephenson
2000-07-13 14:56   ` Clint Adams
2000-07-13 15:16     ` Peter Stephenson
2000-07-13 15:53   ` Bart Schaefer
2000-07-13 16:32     ` Peter Stephenson
2000-07-14 11:32   ` Fr. Br. George

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