From: ZyX <zyx@np.by>
To: John Eikenberry <jae@zhar.net>, zsh-users@zsh.org
Subject: Re: Suffix alias for README files
Date: Wed, 20 Apr 2011 23:22:17 +0400 [thread overview]
Message-ID: <201104202322.18295@-zyx> (raw)
In-Reply-To: <20110420185707.GL6935@mollari.zhar.net>
[-- Attachment #1: Type: Text/Plain, Size: 1995 bytes --]
Reply to message «Re: Suffix alias for README files»,
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
some bad issues when I tried to implement it without using zshaddhistory hook:
as far as I remember, `fc -p' call results were significantly different.
Original message:
> ZyX wrote:
> > Reply to message «Re: Suffix alias for README files»,
> > sent 21:25:43 20 April 2011, Wednesday
> >
> > 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'?
> >
> > 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
> 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.
>
> Thanks.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
prev parent reply other threads:[~2011-04-20 19:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-19 13:59 Anthony R Fletcher
2011-04-20 9:23 ` Sebastian Stark
2011-04-20 12:41 ` Anthony R Fletcher
2011-04-20 15:06 ` Bart Schaefer
2011-04-20 16:44 ` Anthony R Fletcher
2011-04-20 17:25 ` John Eikenberry
2011-04-20 18:40 ` ZyX
2011-04-20 18:57 ` John Eikenberry
2011-04-20 19:22 ` ZyX [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=201104202322.18295@-zyx \
--to=zyx@np.by \
--cc=jae@zhar.net \
--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).