zsh-workers
 help / color / mirror / code / Atom feed
* emacs configure broken when invoked as /bin/sh
@ 1996-09-23 21:11 Benjamin Lorenz
  1996-09-23 23:40 ` Zoltan Hidvegi
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Lorenz @ 1996-09-23 21:11 UTC (permalink / raw)
  To: zsh-workers

Huhu,

zsh-3.0.1-test as /bin/sh fails running the configure scripts
of [x]emacs: libXmu is not recognized.

System: Linux-2.0.11

Benni
-- 
Windows 95 kann alles, wegen der 32 Bit.
Wenn ich 32 Bit getrunken habe, meine ich auch immer, ich könnte alles.
                                                             (Koschwitz)


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

* Re: emacs configure broken when invoked as /bin/sh
  1996-09-23 21:11 emacs configure broken when invoked as /bin/sh Benjamin Lorenz
@ 1996-09-23 23:40 ` Zoltan Hidvegi
  1996-09-26 16:42   ` 3.0.1-test2 - patch for Functions/ Bart Schaefer
  1996-09-26 16:56   ` 3.0.1-test2 - sanity for COLUMNS, LINES, FIGNORE, MAILPATH, and PSVAR Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Zoltan Hidvegi @ 1996-09-23 23:40 UTC (permalink / raw)
  To: Benjamin Lorenz; +Cc: zsh-workers

Benjamin Lorenz wrote:
> Huhu,
> 
> zsh-3.0.1-test as /bin/sh fails running the configure scripts
> of [x]emacs: libXmu is not recognized.
> 
> System: Linux-2.0.11

I've put a 3.0.1-test2 patch relative to 3.0.0
ftp://ftp.cs.elte.hu/pub/zsh/testing/zsh-3.0.1-test2.diff.gz

MD5SUM: 71620b59a5ead9fc57ca19218b0404b4

Size/date:

    26423 Sep 24 01:33 zsh-3.0.1-test2.diff.gz

You should touch config-h.in and configure after applying the patch.
Please test emacs configure with that and if it still does not work, try
zsh-3.0.0.  If possible try to find the cause for the failiure.

Zoltan


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

* 3.0.1-test2 - patch for Functions/
  1996-09-23 23:40 ` Zoltan Hidvegi
@ 1996-09-26 16:42   ` Bart Schaefer
  1996-09-26 16:56   ` 3.0.1-test2 - sanity for COLUMNS, LINES, FIGNORE, MAILPATH, and PSVAR Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 1996-09-26 16:42 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: zsh-workers

This adds "emulate -R zsh" to autoload functions from Functions/ whose
behavior may be affected by starting zsh as ksh (they use arrays, mainly).

Index: Functions/cdmatch
*** zsh-3.0.0/Functions/cdmatch	Mon May  6 07:08:56 1996
--- zsh-3.0.0-build/Functions/cdmatch	Sun Aug 18 10:09:24 1996
***************
*** 6,14 ****
  # Completes directories for cd, pushd, ... anything which knows about cdpath.
  # You do not have to include `.' in your cdpath.
  #
! # It works properly only if $ZSH_VERSION > 2.6-beta2. For erarlier versions
  # it still works if RC_EXPAND_PARAM is not set or when cdpath is empty.
! 
  local narg pref cdp
  
  read -nc narg
--- 6,16 ----
  # Completes directories for cd, pushd, ... anything which knows about cdpath.
  # You do not have to include `.' in your cdpath.
  #
! # It works properly only if $ZSH_VERSION > 3.0-pre4.  Remove `emulate -R zsh'
! # for all other values of $ZSH_VERSION > 2.6-beta2. For earlier versions
  # it still works if RC_EXPAND_PARAM is not set or when cdpath is empty.
! emulate -R zsh
! setopt localoptions
  local narg pref cdp
  
  read -nc narg
Index: Functions/cdmatch2
*** zsh-3.0.0/Functions/cdmatch2	Sat May  4 17:39:32 1996
--- zsh-3.0.0-build/Functions/cdmatch2	Sun Aug 18 10:11:14 1996
***************
*** 1,6 ****
--- 1,8 ----
  # This function should be called from compctl to complete the
  # second argument of cd and pushd.
  
+ emulate -R zsh				# Requires zsh 3.0-pre4 and later
+ setopt localoptions
  local from
  
  read -Ac from
Index: Functions/multicomp
*** zsh-3.0.0/Functions/multicomp	Fri Aug  2 10:36:08 1996
--- zsh-3.0.0-build/Functions/multicomp	Sun Aug 18 10:13:38 1996
***************
*** 14,19 ****
--- 14,20 ----
  # Liable to screw up escaped metacharacters royally.
  # $fignore is not used: feel free to add your own bit.
  
+ emulate -R zsh				# Requires zsh 3.0-pre4 or later
  local pref head sofar origtop newtop globdir="(-/)" wild
  setopt localoptions nullglob rcexpandparam globdots
  unsetopt markdirs globsubst shwordsplit nounset


-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern

New male in /home/schaefer:
>N  2 Justin William Schaefer  Sat May 11 03:43  53/4040  "Happy Birthday"


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

* 3.0.1-test2 - sanity for COLUMNS, LINES, FIGNORE, MAILPATH, and PSVAR
  1996-09-23 23:40 ` Zoltan Hidvegi
  1996-09-26 16:42   ` 3.0.1-test2 - patch for Functions/ Bart Schaefer
@ 1996-09-26 16:56   ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 1996-09-26 16:56 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: zsh-workers

I posted this a while back, but it didn't show up in 3.0.1-test2 so here
it is again just in case.

This imposes sanity on zle's internal reflection of the LINES and COLUMNS
environment variables, so that resizing xterm to a ridiculously small size
or otherwise playing with bogus settings of the variables will not result
in strange behavior and crashes.

As a side effect, it backs out the COLUMNS macro introduced a while back
and returns to using the columns global.

Also buried in here, and worth having even if you don't like the rest of
the patch, is a fix for the FIGNORE, MAILPATH, and PSVAR variables so
that they don't develop the value "." (dot) when assigned "" (empty).

Index: Src/builtin.c
*** zsh-3.0.0/Src/builtin.c	Wed Aug 14 08:06:54 1996
--- zsh-3.0.0-build/Src/builtin.c	Thu Aug 22 22:57:18 1996
***************
*** 4314,4320 ****
  		l = t;
  
  	sc = l + 2;
! 	nc = (COLUMNS + 1) / sc;
  	if (!nc)
  	    nc = 1;
  	nr = (n + nc - 1) / nc;
--- 4314,4320 ----
  		l = t;
  
  	sc = l + 2;
! 	nc = (columns + 1) / sc;
  	if (!nc)
  	    nc = 1;
  	nr = (n + nc - 1) / nc;
Index: Src/hashtable.h
*** zsh-3.0.0/Src/hashtable.h	Tue Aug 13 18:13:18 1996
--- zsh-3.0.0-build/Src/hashtable.h	Thu Aug 22 23:08:23 1996
***************
*** 134,144 ****
  IPDEF4("LINENO", &lineno),
  IPDEF4("PPID", &ppid),
  
! #define IPDEF5(A,B) {NULL,A,PM_INTEGER|PM_SPECIAL,NULL,IFN(intvarsetfn),IFN(intvargetfn),10,(void *)B,NULL,NULL,NULL,0}
! IPDEF5("COLUMNS", &columns),
! IPDEF5("LINES", &lines),
! IPDEF5("OPTIND", &zoptind),
! IPDEF5("SHLVL", &shlvl),
  
  #define IPDEF6(A,B) {NULL,A,PM_SCALAR|PM_READONLY|PM_SPECIAL,NULL,IFN(nullsetfn),IFN(strvargetfn),0,(void *)B,NULL,NULL,NULL,0}
  IPDEF6("PWD", &pwd),
--- 134,144 ----
  IPDEF4("LINENO", &lineno),
  IPDEF4("PPID", &ppid),
  
! #define IPDEF5(A,B,F) {NULL,A,PM_INTEGER|PM_SPECIAL,NULL,IFN(F),IFN(intvargetfn),10,(void *)B,NULL,NULL,NULL,0}
! IPDEF5("COLUMNS", &columns, zlevarsetfn),
! IPDEF5("LINES", &lines, zlevarsetfn),
! IPDEF5("OPTIND", &zoptind, intvarsetfn),
! IPDEF5("SHLVL", &shlvl, intvarsetfn),
  
  #define IPDEF6(A,B) {NULL,A,PM_SCALAR|PM_READONLY|PM_SPECIAL,NULL,IFN(nullsetfn),IFN(strvargetfn),0,(void *)B,NULL,NULL,NULL,0}
  IPDEF6("PWD", &pwd),
***************
*** 158,170 ****
  IPDEF7("SPROMPT", &sprompt),
  IPDEF7("0", &argzero),
  
! #define IPDEF8(A,B,C) {NULL,A,PM_SCALAR|PM_SPECIAL,NULL,IFN(colonarrsetfn),IFN(colonarrgetfn),0,(void *)B,NULL,C,NULL,0}
! IPDEF8("CDPATH", &cdpath, "cdpath"),
! IPDEF8("FIGNORE", &fignore, "fignore"),
! IPDEF8("FPATH", &fpath, "fpath"),
! IPDEF8("MAILPATH", &mailpath, "mailpath"),
! IPDEF8("WATCH", &watch, "watch"),
! IPDEF8("PSVAR", &psvar, "psvar"),
  
  {NULL, "PATH", PM_SPECIAL,NULL, IFN(colonpathsetfn), IFN(colonpathgetfn), 0, (void *) NULL, NULL, "path", NULL, 0},
  
--- 158,170 ----
  IPDEF7("SPROMPT", &sprompt),
  IPDEF7("0", &argzero),
  
! #define IPDEF8(A,B,C,F) {NULL,A,PM_SCALAR|PM_SPECIAL,NULL,IFN(F),IFN(colonarrgetfn),0,(void *)B,NULL,C,NULL,0}
! IPDEF8("CDPATH", &cdpath, "cdpath", colonarrsetfn),
! IPDEF8("FIGNORE", &fignore, "fignore", colonarr2setfn),
! IPDEF8("FPATH", &fpath, "fpath", colonarrsetfn),
! IPDEF8("MAILPATH", &mailpath, "mailpath", colonarr2setfn),
! IPDEF8("WATCH", &watch, "watch", colonarrsetfn),
! IPDEF8("PSVAR", &psvar, "psvar", colonarr2setfn),
  
  {NULL, "PATH", PM_SPECIAL,NULL, IFN(colonpathsetfn), IFN(colonpathgetfn), 0, (void *) NULL, NULL, "path", NULL, 0},
  
***************
*** 183,189 ****
  IPDEF7("PROMPT2", &prompt2),
  IPDEF7("PROMPT3", &prompt3),
  IPDEF7("PROMPT4", &prompt4),
! IPDEF8("MANPATH", &manpath, "manpath"),
  IPDEF9("argv", 0, &pparams, NULL),
  IPDEF9("fignore", 0, &fignore, "FIGNORE"),
  IPDEF9("cdpath", 0, &cdpath, "CDPATH"),
--- 183,189 ----
  IPDEF7("PROMPT2", &prompt2),
  IPDEF7("PROMPT3", &prompt3),
  IPDEF7("PROMPT4", &prompt4),
! IPDEF8("MANPATH", &manpath, "manpath", colonarrsetfn),
  IPDEF9("argv", 0, &pparams, NULL),
  IPDEF9("fignore", 0, &fignore, "FIGNORE"),
  IPDEF9("cdpath", 0, &cdpath, "CDPATH"),
Index: Src/init.c
*** zsh-3.0.0/Src/init.c	Thu Aug 15 09:42:16 1996
--- zsh-3.0.0-build/Src/init.c	Thu Aug 22 22:28:59 1996
***************
*** 535,542 ****
--- 535,546 ----
  #ifdef TIOCGWINSZ
      if (!(columns = shttyinfo.winsize.ws_col))
  	columns = 80;
+     if (columns < 2)
+ 	opts[USEZLE] = 0;
      if (!(lines = shttyinfo.winsize.ws_row))
  	lines = 24;
+     if (lines < 2)
+ 	opts[SINGLELINEZLE] = 1;
  #else
      columns = 80;
      lines = 24;
Index: Src/jobs.c
*** zsh-3.0.0/Src/jobs.c	Wed Jul 31 11:13:17 1996
--- zsh-3.0.0-build/Src/jobs.c	Thu Aug 22 22:59:42 1996
***************
*** 221,227 ****
  {
      Process pn;
      int job = jn - jobtab, len = 9, sig, sflag = 0, llen;
!     int conted = 0, lineleng = COLUMNS, skip = 0, doputnl = 0;
      FILE *fout = (synch == 2) ? stdout : shout;
  
      if (jn->stat & STAT_NOPRINT)
--- 221,227 ----
  {
      Process pn;
      int job = jn - jobtab, len = 9, sig, sflag = 0, llen;
!     int conted = 0, lineleng = columns, skip = 0, doputnl = 0;
      FILE *fout = (synch == 2) ? stdout : shout;
  
      if (jn->stat & STAT_NOPRINT)
Index: Src/params.c
*** zsh-3.0.0/Src/params.c	Sun Aug  4 05:52:33 1996
--- zsh-3.0.0-build/Src/params.c	Thu Aug 22 23:13:08 1996
***************
*** 1223,1228 ****
--- 1223,1253 ----
      *((long *)pm->data) = x;
  }
  
+ /* Function to set value of any ZLE-related integer *
+  * parameter.  data is pointer to global variable   *
+  * where the value is to be stored.                 */
+ 
+ /**/
+ void
+ zlevarsetfn(Param pm, long x)
+ {
+     if (x < 2) {
+ 	if ((long *)pm->data == & columns) {
+ 	    if (x <= 0)
+ 		x = 80;		/* Arbitary, but same as init.c */
+ 	    else
+ 		x = 2;
+ 	    opts[USEZLE] = 0;
+ 	} else if ((long *)pm->data == & lines) {
+ 	    if (x <= 0)
+ 		x = 24;		/* Arbitrary, but same as init.c */
+ 	    else
+ 		opts[SINGLELINEZLE] = 1;
+ 	}
+     }
+     *((long *)pm->data) = x;
+ }
+ 
  /* Function to set value of generic special scalar    *
   * parameter.  data is pointer to a character pointer *
   * representing the scalar (string).                  */
***************
*** 1317,1327 ****
      char ***dptr = (char ***)pm->data;
  
      freearray(*dptr);
!     if (pm->data == (void *) & mailpath && x && !*x) {
  	zsfree(x);
  	*dptr = mkarray(NULL);
      } else
! 	*dptr = x ? colonfix(x, pm->ename ? pm->nam : NULL, pm->flags & PM_UNIQUE) : mkarray(NULL);
  }
  
  /* Function to get the value of special (scalar)        *
--- 1342,1362 ----
      char ***dptr = (char ***)pm->data;
  
      freearray(*dptr);
!     *dptr = x ? colonfix(x, pm->ename ? pm->nam : NULL, pm->flags & PM_UNIQUE) : mkarray(NULL);
! }
! 
! /**/
! void
! colonarr2setfn(Param pm, char *x)
! {
!     char ***dptr = (char ***)pm->data;
! 
!     if (x && !*x) {
! 	freearray(*dptr);
  	zsfree(x);
  	*dptr = mkarray(NULL);
      } else
! 	colonarrsetfn(pm, x);
  }
  
  /* Function to get the value of special (scalar)        *
Index: Src/utils.c
*** zsh-3.0.0/Src/utils.c	Wed Aug 14 09:18:34 1996
--- zsh-3.0.0-build/Src/utils.c	Sat Aug 24 14:15:53 1996
***************
*** 844,849 ****
--- 844,853 ----
      if (shttyinfo.winsize.ws_row)
  	lines = shttyinfo.winsize.ws_row;
      if (oldcols != columns) {
+ 	if (columns < 2)
+ 	    opts[USEZLE] = 0;
+ 	if (lines < 2)
+ 	    opts[SINGLELINEZLE] = 1;
  	if (zleactive) {
  	    resetneeded = winchanged = 1;
  	    refresh();
Index: Src/zle_misc.c
*** zsh-3.0.0/Src/zle_misc.c	Tue Aug 13 13:24:14 1996
--- zsh-3.0.0-build/Src/zle_misc.c	Thu Aug 22 22:59:51 1996
***************
*** 835,842 ****
      if (wp) {
  	*wp = bp - bl0 - lensb;
  	if (pmpt != rpmpt) {
! 	    *wp %= COLUMNS;
! 	    if (*wp == COLUMNS - 1) {
  		addbufspc(1);
  		*wp = 0;
  		*bp++ = ' ';
--- 835,842 ----
      if (wp) {
  	*wp = bp - bl0 - lensb;
  	if (pmpt != rpmpt) {
! 	    *wp %= columns;
! 	    if (*wp == columns - 1) {
  		addbufspc(1);
  		*wp = 0;
  		*bp++ = ' ';
Index: Src/zle_refresh.c
*** zsh-3.0.0/Src/zle_refresh.c	Sun Aug 11 18:39:05 1996
--- zsh-3.0.0-build/Src/zle_refresh.c	Fri Aug 30 23:18:27 1996
***************
*** 66,72 ****
      int ln;
      static int lwinw = -1, lwinh = -1;	/* last window width & height */
   
!     winw = COLUMNS;  /* terminal width */
      if (isset(SINGLELINEZLE) || termok != TERM_OK)
  	winh = 1;
      else
--- 66,72 ----
      int ln;
      static int lwinw = -1, lwinh = -1;	/* last window width & height */
   
!     winw = columns;  /* terminal width */
      if (isset(SINGLELINEZLE) || termok != TERM_OK)
  	winh = 1;
      else
***************
*** 247,253 ****
  	    moveto(0, pptw);
  	}
  	clearf = clearflag;
!     } else if (winw != COLUMNS)
  	resetvideo();
  
  /* now winw equals columns; now all width comparisons can be made to winw */
--- 249,255 ----
  	    moveto(0, pptw);
  	}
  	clearf = clearflag;
!     } else if (winw != columns)
  	resetvideo();
  
  /* now winw equals columns; now all width comparisons can be made to winw */
Index: Src/zle_tricky.c
*** zsh-3.0.0/Src/zle_tricky.c	Sun Aug 11 12:15:35 1996
--- zsh-3.0.0-build/Src/zle_tricky.c	Sun Aug 25 17:50:38 1996
***************
*** 3469,3475 ****
  	} else {
  	    cc++;
  	    if (*p == '\n') {
! 		l += 1 + (cc / COLUMNS);
  		cc = 0;
  	    }
  	    if (dopr)
--- 3470,3476 ----
  	} else {
  	    cc++;
  	    if (*p == '\n') {
! 		l += 1 + (cc / columns);
  		cc = 0;
  	    }
  	    if (dopr)
***************
*** 3477,3483 ****
  	}
      }
  
!     return l + (cc / COLUMNS);
  }
  
  /* List the matches.  Note that the list entries are metafied. */
--- 3478,3484 ----
  	}
      }
  
!     return l + (cc / columns);
  }
  
  /* List the matches.  Note that the list entries are metafied. */
***************
*** 3551,3557 ****
  	longest++;
  
      fw = longest + 2;
!     fct = (COLUMNS + 1) / fw;
      if (fct == 0) {
  	fct = 1;
  	colsz = ct;
--- 3552,3558 ----
  	longest++;
  
      fw = longest + 2;
!     fct = (columns + 1) / fw;
      if (fct == 0) {
  	fct = 1;
  	colsz = ct;
***************
*** 3559,3565 ****
  	for (ap = arr; *ap; ap++)
  	    up += (niceztrlen(*ap + off) - nboff + of +
  		(ispattern ? 0 :
! 		(!(haswhat & HAS_MISC) ? nfpl + nfsl : nlpl + nlsl))) / COLUMNS;
      } else {
  	colsz = (ct + fct - 1) / fct;
  	up = colsz + nlnct - clearflag;
--- 3560,3566 ----
  	for (ap = arr; *ap; ap++)
  	    up += (niceztrlen(*ap + off) - nboff + of +
  		(ispattern ? 0 :
! 		(!(haswhat & HAS_MISC) ? nfpl + nfsl : nlpl + nlsl))) / columns;
      } else {
  	colsz = (ct + fct - 1) / fct;
  	up = colsz + nlnct - clearflag;
***************
*** 3739,3749 ****
      while (t0)
  	t0 /= 10, longest++;
      /* to compensate for added ')' */
!     fct = (COLUMNS - 1) / (longest + 3);
      if (fct == 0)
  	fct = 1;
      else
! 	fw = (COLUMNS - 1) / fct;
      colsz = (ct + fct - 1) / fct;
      for (t1 = 0; t1 != colsz; t1++) {
  	ap = arr + t1;
--- 3740,3750 ----
      while (t0)
  	t0 /= 10, longest++;
      /* to compensate for added ')' */
!     fct = (columns - 1) / (longest + 3);
      if (fct == 0)
  	fct = 1;
      else
! 	fw = (columns - 1) / fct;
      colsz = (ct + fct - 1) / fct;
      for (t1 = 0; t1 != colsz; t1++) {
  	ap = arr + t1;
Index: Src/zsh.h
*** zsh-3.0.0/Src/zsh.h	Mon Aug 12 10:57:32 1996
--- zsh-3.0.0-build/Src/zsh.h	Thu Aug 22 22:56:55 1996
***************
*** 1246,1253 ****
  #define txtchangeisset(X)	(txtchange & (X))
  #define txtchangeset(X, Y)	(txtchange |= (X), txtchange &= ~(Y))
  
- #define COLUMNS      (columns < 1 ? 80 : columns)
- 
  /****************************************/
  /* Definitions for the %_ prompt escape */
  /****************************************/
--- 1246,1251 ----

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern

New male in /home/schaefer:
>N  2 Justin William Schaefer  Sat May 11 03:43  53/4040  "Happy Birthday"


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

end of thread, other threads:[~1996-09-26 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-23 21:11 emacs configure broken when invoked as /bin/sh Benjamin Lorenz
1996-09-23 23:40 ` Zoltan Hidvegi
1996-09-26 16:42   ` 3.0.1-test2 - patch for Functions/ Bart Schaefer
1996-09-26 16:56   ` 3.0.1-test2 - sanity for COLUMNS, LINES, FIGNORE, MAILPATH, and PSVAR Bart Schaefer

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