zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Cc: "Stefan Reichör" <stefan@xsteve.at>
Subject: Re: dabbrev like feature for zsh
Date: Wed, 23 Mar 2005 12:05:18 +0000	[thread overview]
Message-ID: <1050323120519.ZM15277@candle.brasslantern.com> (raw)
In-Reply-To: =?iso-8859-1?Q?=3Cm03bumzufa=2Efsf=40PCHAGSREI=2Emsc-ge=2Ecom?= =?iso-8859-1?Q?=3E?= =?iso-8859-1?Q?Comments=3A_In_reply_to_Stefan_Reich=F6r_=3Cstefan=40xstev?= =?iso-8859-1?Q?e=2Eat=3E?= =?iso-8859-1?Q?________=22dabbrev_like_feature_for_zsh=22_=28Mar_23=2C__8?= =?iso-8859-1?Q?=3A35am=29?=

On Mar 23,  8:35am, Stefan Reichör wrote:
} Subject: dabbrev like feature for zsh
}
} By googling I found the following settings:

Don't believe everything you Google.

} zstyle ':completion:*:history-words' stop yes
} zstyle ':completion:*:history-words' list false

Those two are OK (though probably for the wrong reason), but ...

} zstyle ':completion:*:history-words' remove-all-dups yes
} zstyle ':completion:*:history-words' menu yes

... those two are wrong.

} The remove-all-dups should remove the duplicated entries - shouldn't it?

It does, if you use the right context.


The reason this is so odd is because the first two styles are for the
_history_complete_word widget itself; if written out more fully, they
would be:

zstyle ':completion:history-words:*:history-words' stop yes
zstyle ':completion:history-words:*:history-words' list false

Thus, "when completing history words using the special widget that only
completes history words, don't cycle the history and don't list."

However, you have to read the style right-to-left and the sentence left-
to-right.  "When completing history words" is the :history-words on the
end of the style, and "using the special widget" is in the middle.  I'm
not sure why the _history_complete_word widget bothers to append that
extra qualifier to the end of the context -- what else might it be
completing, if not history words? -- but it does.

The other two styles are not defined by the widget, they're defined by
the _history completer which can be used in other places in completion
Those styles don't have the extra :history-words on the end, which is
perhaps something that should be changed in _history, but thus it is.

zstyle ':completion:history-words:*' remove-all-dups yes
zstyle ':completion:history-words:*' menu yes

"When completing anything using the using the special widget that only
completes history words, remove all duplicate history words and use
menu completion."

There, the "duplicate history words" (rather than duplicates in general)
is implicit, because the only completer that recognizes remove-all-dups
is the one that generates history words as possible matches.

This is contrasted with:

zstyle ':completion:*' remove-all-dups yes

"When completing anything for any reason, remove all duplicate history
words."

By using ":completion:history-words:*" you would choose to have duplicate
history words removed when using M-/ but NOT removed when using TAB, if
you ever added _history to your completer zstyle.

Confused enough yet?


  reply	other threads:[~2005-03-23 12:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-23  7:35 Stefan Reichör
2005-03-23 12:05 ` Bart Schaefer [this message]
2005-03-24  6:49   ` Stefan Reichör

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=1050323120519.ZM15277@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=stefan@xsteve.at \
    --cc=zsh-workers@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).