zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Peter Stephenson <pws@csr.com>
Cc: zsh-users@sunsite.dk
Subject: Re: !!:$
Date: Tue, 16 Nov 2004 07:37:13 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0411160730180.31018@toltec.zanshin.com> (raw)
In-Reply-To: <200411161422.iAGEMTuv032704@news01.csr.com>

On Tue, 16 Nov 2004, Peter Stephenson wrote:

> [...]  $history is an associative array and you need
> to know the event number, which currently isn't available as a
> parameter: you can get it from a prompt, but not directly.  This strikes
> me as a curious omission.  How about adding it using the same name as
> bash?

Umm.

HISTNO (integer)
     The current history number.  Setting this has the same effect as
     moving up or down in the history to the corresponding history line.
     An attempt to set it is ignored if the line is not stored in the
     history.

Admittedly this is available only in widgets, but it seems odd to have two
variables for the same thing.

> Then you can always get the full previous line as
> $history[$((HISTCMD-1))].

Unfortunately that doesn't always work.  If you setopt HIST_IGNORE_DUPS,
$history[$((HISTNO-1))] may be empty.

The only thing that always works is $history[${${(Onk)history}[1]}] or
some similar convolution that gets keys that are known to be in the hash.


  parent reply	other threads:[~2004-11-16 15:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-16 13:45 !!:$ keef
2004-11-16 14:22 ` !!:$ Peter Stephenson
2004-11-16 14:31   ` !!:$ Stephane Chazelas
2004-11-16 15:37   ` Bart Schaefer [this message]
2004-11-16 16:08     ` !!:$ Peter Stephenson
2004-11-17  0:03 ` !!:$ Bart Schaefer
2004-11-17 19:25   ` !!:$ Danek Duvall
2004-11-18  1:10     ` !!:$ Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2018-02-19 21:12 &&|| Ray Andrews
2018-02-19 21:57 ` &&|| Peter Stephenson
2018-02-19 22:47   ` &&|| Ray Andrews
2018-02-20  9:26     ` &&|| Peter Stephenson
2018-02-20  7:54       ` &&|| Ray Andrews
2018-02-20 17:07         ` &&|| Peter Stephenson
2018-02-20 19:24           ` &&|| Ray Andrews
2018-02-20 20:28             ` &&|| Bart Schaefer
2018-02-20 21:45               ` &&|| Ray Andrews
2003-07-02 15:06 ?????? JEFF BICKLEY
2003-07-02 19:56 ` ?????? Thorsten Haude

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.LNX.4.61.0411160730180.31018@toltec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=pws@csr.com \
    --cc=zsh-users@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).