zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: trivial problem with histverify
Date: Tue, 02 Dec 2014 19:53:57 -0800	[thread overview]
Message-ID: <547E8955.1030906@eastlink.ca> (raw)
In-Reply-To: <141201184701.ZM30368@torch.brasslantern.com>

On 12/01/2014 06:47 PM, Bart Schaefer wrote:
> It is not intended to verify that "a history command is actually being
> executed."  It is intended to verify that in the text of any command in
> which history was referenced, the correct history reference was made.
>
> For example, suppose you typed
...

I see.  I had the wrong notion. (What a surprise ;-)

> Honestly, how did it ever get that complicated?  Why print -s the words
> into the history and then pull them back out again with "!!" rather
> than just:
>
> bindkey -s '\e[5~' '\C-a history 1 | grep "[[:digit:]]  \C-e"\C-m'
I don't know how it got like that.  It seemed necessary at the time, but 
yours
works just as well, and makes more sense too.  At the time I just wanted it
to work and I haven't  thought about it since.  Looking back, I may have
built it up from this:

# Ctrl+H: put existing command line into history w.o. executing it first.
bindkey -s "^H" '\C-a print -s \C-e\C-m'

... which seems to need the 'print -s' action, so I got it into my head that
that was the only way to get a line into history without ENTER.

Oh, and of course it no longer trips over 'histverify' :-)


     grep-history() {
       (( HISTNO > 1 )) || return
       zle -I
       history 1 | grep --color=auto "[[:digit:]]  $BUFFER"
     }
     zle -N grep-history
     bindkey '\e[5~' grep-history



I haven't done a widget yet, this looks like a good place to start.

Thanks again sir.


      reply	other threads:[~2014-12-03  3:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 20:20 Ray Andrews
2014-12-01 23:26 ` Mikael Magnusson
2014-12-02  0:10   ` Ray Andrews
2014-12-02  2:47     ` Bart Schaefer
2014-12-03  3:53       ` Ray Andrews [this message]

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=547E8955.1030906@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /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).