From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2152 invoked by alias); 20 Apr 2011 19:22:24 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15977 Received: (qmail 9426 invoked from network); 20 Apr 2011 19:22:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at np.by designates 91.149.189.205 as permitted sender) From: ZyX Reply-To: zyx@np.by To: John Eikenberry , zsh-users@zsh.org Subject: Re: Suffix alias for README files Date: Wed, 20 Apr 2011 23:22:17 +0400 User-Agent: KMail/1.13.5 (Linux/2.6.36-zen1; KDE/4.6.2; x86_64; ; ) References: <20110419135909.GA21897@cosy.cit.nih.gov> <201104202240.22873@-zyx> <20110420185707.GL6935@mollari.zhar.net> In-Reply-To: <20110420185707.GL6935@mollari.zhar.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1815319.x0laezPfEs"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201104202322.18295@-zyx> --nextPart1815319.x0laezPfEs Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Reply to message =C2=ABRe: Suffix alias for README files=C2=BB,=20 sent 22:57:07 20 April 2011, Wednesday by John Eikenberry: > I'll play with this after work but I have a quick question. Do you know > whether this would play nice with the hist_ignore_all_dups setting? My > experiments with using print to manually add entries previously have not > worked as they all failed to respect hist_ignore_all_dups. I have histignorealldups set and everything works normally. But I remember = I had=20 some bad issues when I tried to implement it without using zshaddhistory ho= ok:=20 as far as I remember, `fc -p' call results were significantly different. Original message: > ZyX wrote: > > Reply to message =C2=ABRe: Suffix alias for README files=C2=BB, > > sent 21:25:43 20 April 2011, Wednesday > >=20 > > by John Eikenberry: > > > Is there any way to get either of these to work without changing the > > > command that is stored in history? So the history contains > > > '/some/path/README' and not 'less /some/path/README'? > >=20 > > Yes, of course. I personally use the following code: > > function zshaddhistory() > > { > > =20 > > emulate -L zsh > > if ! [[ -z "${_HISTLINE}" ]] ; then > > =20 > > print -sr -- "${_HISTLINE}" > > unset _HISTLINE > > =20 > > else > > =20 > > print -sr -- "${1%%$'\n'}" > > =20 > > fi > > fc -p > > =20 > > } > >=20 > > With this function if you set variable _HISTLINE somewhere before > > zshaddhistory hook is run then contents of _HISTLINE will be put into t= he > > history. Widget accept-line is called before zshaddhistory. >=20 > I'll play with this after work but I have a quick question. Do you know > whether this would play nice with the hist_ignore_all_dups setting? My > experiments with using print to manually add entries previously have not > worked as they all failed to respect hist_ignore_all_dups. >=20 > Thanks. --nextPart1815319.x0laezPfEs Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iEYEABECAAYFAk2vMmoACgkQTFU0h8DxG4NZiQCeJr+sK/HwFxfIP7JmUWxpGa4x ekIAnA4A3nB6UE2uAPCn1634O0h4sFBI =wRvm -----END PGP SIGNATURE----- --nextPart1815319.x0laezPfEs--