zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: zcalc bug
Date: Thu, 13 May 2004 15:57:58 +0100	[thread overview]
Message-ID: <20277.1084460278@csr.com> (raw)
In-Reply-To: "Thomas =?iso-8859-1?Q?K=F6hler?="'s message of "Thu, 13 May 2004 16:04:51 +0200." <20040513140450.GA27267@picard.franken.de>

Thomas =?iso-8859-1?Q?K=F6hler?= wrote:
> print -P %h
> 504
> ~> zcalc
> 1> 1+2+3
> 6
> ~> print -P %h
> 1014

Aha, now I understand.  This much is sufficient to show the problem.
(By pruning it I may have made the numbers inconsistent, though
I think not).  Concise bug reports are a Good Thing.

zcalc switches the history to its own file, then at the end switches
back.  Unfortunately the only way of switching back to the main file at
the end, removing the zcalc stuff, is to read it back in again.  This
overwrites the numbers.

The only obvious alternative is to leave zcalc entries in the main
history, so in the previous example scrolling back from the final prompt
would take you through `print -P %h', `1+2+3', `print -P %h'.  This was
the older (and easier) behaviour.  I decided an attempt to separate the
histories would be better.  This could be configurable, but neither
behaviour is perfect.

There is no direct way of manipulating the history, only reading it and
writing or appending it.  There may be some hack I haven't thought of,
but the history number handling is buried deep inside.

Wayne, have you any idea how easy it would be to implement something to
make switching history files easy?  E.g. could it be just a matter of
resetting history numbers at the right point when reading in?

I have always dreamed of having a way of manipulating the history
directly using variables.  However, given all the features of the
history, this isn't easy to do properly.  I don't have remotely enough
time and there are many higher priority problems.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


  reply	other threads:[~2004-05-13 14:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-11 12:17 Matthias Kopfermann
2004-05-13 14:04 ` Thomas Köhler
2004-05-13 14:57   ` Peter Stephenson [this message]
2004-05-13 15:19     ` Matthias Kopfermann
2004-05-13 15:58       ` Peter Stephenson
2004-05-13 17:29         ` Matthias Kopfermann
2004-05-13 17:47           ` Peter Stephenson
2004-05-13 18:06             ` Matthias Kopfermann
2004-05-13 20:05               ` Peter Stephenson
2004-05-13 20:03     ` Wayne Davison
2004-05-14  9:23       ` Peter Stephenson
2004-05-15  0:22         ` Wayne Davison
2004-05-18 11:28           ` Peter Stephenson
2004-05-18 19:50             ` [PATCH] local history support, take 2 Wayne Davison
2004-05-18 21:32               ` Wayne Davison
2004-05-19  9:40               ` Peter Stephenson
2004-05-19 16:58                 ` Wayne Davison
2004-05-19 21:37                   ` Peter Stephenson
2004-05-21  1:37                     ` Wayne Davison
2004-05-21  1:44                       ` Wayne Davison
2004-05-21  9:15                       ` Peter Stephenson
2004-05-21 20:06                         ` Wayne Davison

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=20277.1084460278@csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.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).