zsh-workers
 help / color / mirror / code / Atom feed
From: "Fr. Br. George" <george@po.cs.msu.su>
To: zsh-workers@sunsite.auc.dk
Subject: Zsh 3.1.{6,9} patches
Date: Thu, 13 Jul 2000 13:59:44 +0400 (MSD)	[thread overview]
Message-ID: <Pine.BSF.4.21.0007131253420.99431-300000@balrog.po.cs.msu.su> (raw)

[-- 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

             reply	other threads:[~2000-07-13 10:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-13  9:59 Fr. Br. George [this message]
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

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=Pine.BSF.4.21.0007131253420.99431-300000@balrog.po.cs.msu.su \
    --to=george@po.cs.msu.su \
    --cc=zsh-workers@sunsite.auc.dk \
    /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.
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).