From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3937 invoked by alias); 20 Apr 2011 18:57:11 -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: 15975 Received: (qmail 3917 invoked from network); 20 Apr 2011 18:57:09 -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,SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at zhar.net designates 68.118.117.234 as permitted sender) Date: Wed, 20 Apr 2011 14:57:07 -0400 From: John Eikenberry To: zsh-users@zsh.org Subject: Re: Suffix alias for README files Message-ID: <20110420185707.GL6935@mollari.zhar.net> Mail-Followup-To: John Eikenberry , zsh-users@zsh.org References: <20110419135909.GA21897@cosy.cit.nih.gov> <110420080625.ZM16423@torch.brasslantern.com> <20110420172543.GK6935@mollari.zhar.net> <201104202240.22873@-zyx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XRwESHC7KXlqFpSs" Content-Disposition: inline In-Reply-To: <201104202240.22873@-zyx> User-Agent: Mutt/1.5.21 (2010-09-15) --XRwESHC7KXlqFpSs Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable ZyX wrote: > Reply to message =ABRe: Suffix alias for README files=BB,=20 > sent 21:25:43 20 April 2011, Wednesday > by John Eikenberry: >=20 > > 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'? > Yes, of course. I personally use the following code: > function zshaddhistory() > { > emulate -L zsh > if ! [[ -z "${_HISTLINE}" ]] ; then > print -sr -- "${_HISTLINE}" > unset _HISTLINE > else > print -sr -- "${1%%$'\n'}" > fi > fc -p > } > With this function if you set variable _HISTLINE somewhere before > zshaddhistory hook is run then contents of _HISTLINE will be put into the > history. Widget accept-line is called before zshaddhistory. I'll play with this after work but I have a quick question. Do you know whe= ther 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. Thanks. --=20 John Eikenberry [ jae@zhar.net - http://zhar.net ] [ PGP public key @ http://zhar.net/jae_at_zhar_net.gpg ] ________________________________________________________________________ "Perfection is attained, not when no more can be added, but when no more=20 can be removed." -- Antoine de Saint-Exupery --XRwESHC7KXlqFpSs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEbBAEBCAAGBQJNryyDAAoJED2anlkTqUWixIIH90McrQI+arbrnQdrgjnm49/h MU/gMvxsqSVmG8IARfyJK6W/w2i5LHR9h/OPJb5MegSX2MvPgqZJ57CcfWvXZKio QzckkjqPhtEVtorUupHN+4+bD2eHCqzFtoE15S3amOALEGCIWlo5dDgRsWm60Gn6 7GuHDA6xnk69L5CLmvtNfWV0hcVU9fWbCczBLLpKjZM+gDNRgtzk3DPq1vVaY28g pIBkDap+Noo3MUt8BukrdUYtunhLmSloV9yXQC2DjBvrTv2O06w/6LULMJQjh45z SbOuZqQ8GhGnX+QyE+hsHOB4baGjHTeijgaNCe2/PtM7zH0cCut4iGwRt7RjUA== =BhfZ -----END PGP SIGNATURE----- --XRwESHC7KXlqFpSs--