zsh-workers
 help / color / mirror / code / Atom feed
* History list fix
@ 1996-08-13 16:04 Peter Stephenson
  1996-08-13 23:08 ` Zoltan Hidvegi
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 1996-08-13 16:04 UTC (permalink / raw)
  To: Zsh hackers list

This fixes the off-by-one error when trying to list just the last
history entry (you can't, neither with nor without HISTNOSTORE set).

At least, it seems to fix it: it's a bit confusing when you don't have
HISTNOSTORE set but you do have HISTIGNOREDUPS set, since if the
previous command is the same as the current history command you don't
see it.  However, I suppose that's logical: with my recent
HISTIGNOREDUPS command it's really always the last command which is in
the history list, which is still the current comand, and `history'
never shows the current command.  (People repeating identical history
commands only tend to be testing the history code anyway.)

This error by tradition reappears whenever anybody makes any change to
the fc code.  I've tried to reduce the likelihood of a recrudescence
by removing the two confusing possibilities, i.e. either the current
history entry is already deleted or is about to be.  With this patch
curhist is always still the fc/history command itself.  Otherwise,
there are unpleasant dependencies on HISTNOSTORE.

By the way, there's another fix of mine for a traditional bug, namely
the bogus `permission denied' error when trying to execute a
non-existent programme with an unreadable directory somewhere in the
path, which seems to have gone missing.

*** Src/builtin.c.fc	Mon Aug  5 14:38:39 1996
--- Src/builtin.c	Tue Aug 13 17:53:59 1996
***************
*** 2433,2444 ****
      }
      delayrem = 0;
      if (!(ops['l'] && unset(HISTNOSTORE)) &&
! 	!(ops['R'] || ops['W'] || ops['A'])) {
! 	if (ops['l'])
! 	    remhist();
! 	else
! 	    delayrem = 1;
!     }
      if (ops['R']) {
  	/* read history from a file */
  	readhistfile(*argv ? *argv : getsparam("HISTFILE"), 1);
--- 2433,2440 ----
      }
      delayrem = 0;
      if (!(ops['l'] && unset(HISTNOSTORE)) &&
! 	!(ops['R'] || ops['W'] || ops['A']))
! 	delayrem = 1;
      if (ops['R']) {
  	/* read history from a file */
  	readhistfile(*argv ? *argv : getsparam("HISTFILE"), 1);
***************
*** 2474,2488 ****
      if (*argv) {
  	minflag = **argv == '-';
  	first = fcgetcomm(*argv);
! 	if (first == -1)
  	    return 1;
  	argv++;
      }
      /* interpret and check second history line specifier */
      if (*argv) {
  	last = fcgetcomm(*argv);
! 	if (last == -1)
  	    return 1;
  	argv++;
      }
      /* There is a maximum of two history specifiers.  At least, there *
--- 2470,2490 ----
      if (*argv) {
  	minflag = **argv == '-';
  	first = fcgetcomm(*argv);
! 	if (first == -1) {
! 	    if (delayrem)
! 		remhist();
  	    return 1;
+ 	}
  	argv++;
      }
      /* interpret and check second history line specifier */
      if (*argv) {
  	last = fcgetcomm(*argv);
! 	if (last == -1) {
! 	    if (delayrem)
! 		remhist();
  	    return 1;
+ 	}
  	argv++;
      }
      /* There is a maximum of two history specifiers.  At least, there *
***************
*** 2489,2494 ****
--- 2491,2498 ----
       * will be as long as the history list is one-dimensional.        */
      if (*argv) {
  	zwarnnam("fc", "too many arguments", NULL, 0);
+ 	if (delayrem)
+ 	    remhist();
  	return 1;
      }
      /* default values of first and last, and range checking */
***************
*** 2495,2501 ****
      if (first == -1)
  	first = (ops['l']) ? curhist - 16 : curhist - 1;
      if (last == -1)
! 	last = (ops['l']) ? curhist : first;
      if (first < firsthist())
  	first = firsthist();
      if (last == -1)
--- 2499,2505 ----
      if (first == -1)
  	first = (ops['l']) ? curhist - 16 : curhist - 1;
      if (last == -1)
! 	last = (ops['l']) ? curhist - 1 : first;
      if (first < firsthist())
  	first = firsthist();
      if (last == -1)

-- 
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] 7+ messages in thread

* Re: History list fix
  1996-08-13 16:04 History list fix Peter Stephenson
@ 1996-08-13 23:08 ` Zoltan Hidvegi
  1996-08-14  7:31   ` Old messages Geoff Wing
  0 siblings, 1 reply; 7+ messages in thread
From: Zoltan Hidvegi @ 1996-08-13 23:08 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hacking and development

> By the way, there's another fix of mine for a traditional bug, namely
> the bogus `permission denied' error when trying to execute a
> non-existent programme with an unreadable directory somewhere in the
> path, which seems to have gone missing.

I did not find it.  I think I accidently deleted it because I thought that
I already merged it.  Cound you send it again to me?

An other question, is your fc fix work without the previous HISTIGNOREDUPS
patch?  I'd like to release 3.0.0 today or at least tomorrow (it's
Wednesday 1 am) and I'd like to add bugfixes only and perhaps some POSIX
compatibility patches.  3.0-pre6 seems to be quite bug-free (but it's just
because everyone is on holiday :-)).  The slow refresh on NeXT may be a
problem but I have absolutely no idea what can cause that.  It seems to be
an OS problem since the whole prompt is printed with one fwrite command.
Other than that I've found only one serious problem that zsh did not save
the history correctly on timeout, and dumped core when all memory debugging
was enabled but it was easy to fix (that bug was there befere 2.5 I think).

There is an other refresh bug which I reported a few months ago that in an
xterm when I type a multiline command like

% for i in *
do
done

and later bring it back from the history using up-line-or-history and
copy/paste the do/done lines, the result is do<spaces>done instead of
do<newline>done.

On Friday I'll go for an other one-week holiday :-).

Zoltan


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

* Re: Old messages
  1996-08-13 23:08 ` Zoltan Hidvegi
@ 1996-08-14  7:31   ` Geoff Wing
  1996-08-14 13:03     ` Zoltan Hidvegi
  0 siblings, 1 reply; 7+ messages in thread
From: Geoff Wing @ 1996-08-14  7:31 UTC (permalink / raw)
  To: zsh-workers

Zoltan Hidvegi wrote:
:> By the way, there's another fix of mine for a traditional bug, namely
:> the bogus `permission denied' error when trying to execute a
:> non-existent programme with an unreadable directory somewhere in the
:> path, which seems to have gone missing.
:I did not find it.  I think I accidently deleted it because I thought that
:I already merged it.  Cound you send it again to me?

People who *need* older zsh messages (from the math.gatech.edu lists) can get
them from	 http://www.primenet.com.au/zsh/

They are in gzip'ed tar files grouped by message number.
eg.  01xx.tgz   contains messages 100-199
The more recent ones (which don't complete a set) are as individual files.

There are a few missing.  For whatever odd reasons I never received them.

Please don't go too heavy on this site unless you need the articles as I
only have a 64k link (which is why I haven't set it up as an easily browsible
site).  Maybe someone else wants to do it on theirs?

I haven't bothered with the stuff from sterling.com list since it's probably
past its used-by date and gone old and moldy (and probably still on sterling).
-- 
Geoff Wing [mason@primenet.com.au]   PrimeNet - Internet Consultancy


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

* Re: Old messages
  1996-08-14  7:31   ` Old messages Geoff Wing
@ 1996-08-14 13:03     ` Zoltan Hidvegi
  1996-08-14 19:05       ` Zefram
  0 siblings, 1 reply; 7+ messages in thread
From: Zoltan Hidvegi @ 1996-08-14 13:03 UTC (permalink / raw)
  To: Geoff Wing; +Cc: zsh-workers, sam

> Please don't go too heavy on this site unless you need the articles as I
> only have a 64k link (which is why I haven't set it up as an easily browsible
> site).  Maybe someone else wants to do it on theirs?

If someone have a program which does threading and html conversion, works
without any user interaction and simple to install, I can install it here to
create an easily browsible www archive.  The Hungarian academic network has
a 1 Mbit link to Amsterdam and a 256 kbit link to Viena, which is usually
quite usable from Europe (I think that the outgoing badwich is not filled
completely).  The relyability of the US connection depends on the
Amsterdam-New York like.  Recently there has been some router problems in
New York which caused a lot of trouble.

There used to be a nice www archive wich is also mentioned in the FAQ on
http://www-stud.enst.fr/~tardieu/mailarchive/zsh-list/index.html but it
does not work recently.

Zoltan


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

* Re: Old messages
  1996-08-14 13:03     ` Zoltan Hidvegi
@ 1996-08-14 19:05       ` Zefram
  1996-08-14 20:24         ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Zefram @ 1996-08-14 19:05 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: mason, zsh-workers, sam

>If someone have a program which does threading and html conversion, works
>without any user interaction and simple to install, I can install it here to
>create an easily browsible www archive.

I'd like to recommend against HTMLification of mail archives.  The only
thing worse that broken-printable patches is HTML patches.  (Didn't I
learn from yesterday's QP thread?  Apparently not.)  The mail messages
are plain text, and now really only useful in an archived format (so
browsing is not much of a consideration).

It would be nice to have them available for ftp over a reasonably fast
link.

-zefram


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

* Re: Old messages
  1996-08-14 19:05       ` Zefram
@ 1996-08-14 20:24         ` Bart Schaefer
  0 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 1996-08-14 20:24 UTC (permalink / raw)
  To: Zefram, zsh-workers

On Aug 14,  8:05pm, Zefram wrote:
} Subject: Re: Old messages
}
} I'd like to recommend against HTMLification of mail archives.  The only
} thing worse that broken-printable patches is HTML patches.

Having the archives HTMLified doesn't necessarily mean you can't get to
them as raw data.  Have a look at

	http://www.hpc.uh.edu/fvwm/archive/

as an example.

-- 
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] 7+ messages in thread

* Re: Old messages
@ 1996-08-14 15:55 whukriede
  0 siblings, 0 replies; 7+ messages in thread
From: whukriede @ 1996-08-14 15:55 UTC (permalink / raw)
  To: zsh-workers


> There used to be a nice www archive wich is also mentioned in the FAQ on
> http://www-stud.enst.fr/~tardieu/mailarchive/zsh-list/index.html but it
> does not work recently.

I mailed him on August, 3, until now, there was no reply. I'd suggest to
remove this pointer from the Faq.

Greetings, Wolfgang.


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

end of thread, other threads:[~1996-08-14 20:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-13 16:04 History list fix Peter Stephenson
1996-08-13 23:08 ` Zoltan Hidvegi
1996-08-14  7:31   ` Old messages Geoff Wing
1996-08-14 13:03     ` Zoltan Hidvegi
1996-08-14 19:05       ` Zefram
1996-08-14 20:24         ` Bart Schaefer
1996-08-14 15:55 whukriede

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