From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10013 invoked by alias); 18 Apr 2018 12:21:02 -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: List-Unsubscribe: X-Seq: 23344 Received: (qmail 21140 invoked by uid 1010); 18 Apr 2018 12:21:02 -0000 X-Qmail-Scanner-Diagnostics: from bart.luffy.cx by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(78.47.78.131):SA:0(-1.9/5.0):. Processed in 15.146751 secs); 18 Apr 2018 12:21:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: bernat@luffy.cx X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=luffy.cx; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=postfix; bh=yXp7xNhoiMw4Yj+MuQa83QPz+Cg=; b=VyO dy/auhYDQ9OxXgkURP7q2NB2dlIzeu1FfUuNxomTs8pfI8zM6j1KM5ZLQqIeuyxO GoWrZ4NYPlWRAmWpt0yCZHF45elRtb487T7wgvEIe0CJ5Z/OjNNsWMRCvg7VZ/cP f6PkItfA5XbYCCTfsncxl6P0EG1rtlQlal8UcNhc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=luffy.cx; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=postfix; b=ZCivln/mkByPBueO3H8d0dltMmV7e aMW6rHvbXHioqUZJRVK3XqwIaTIIdhc7dk7E7yPFPIIVoxelUdJHpm9Rrn7ivO7v 5fvDzjgtm4VUTS/2GplvPAVDzxvVm77aqRRThzPvUfZf8W7Lz4ixQtaliyBlQSJG NDpH/cJG9XFaRg= From: Vincent Bernat To: Peter Stephenson Cc: zsh-users@zsh.org Subject: Re: make history-complete-older do nothing on empty string References: <20180418094018.54559594@camnpupstephen.cam.scsc.local> <87in8o6fjx.fsf@luffy.cx> <20180418104555.25fef55b@camnpupstephen.cam.scsc.local> Date: Wed, 18 Apr 2018 14:20:42 +0200 In-Reply-To: <20180418104555.25fef55b@camnpupstephen.cam.scsc.local> (Peter Stephenson's message of "Wed, 18 Apr 2018 10:45:55 +0100") Message-ID: <874lk866zp.fsf@luffy.cx> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =E2=9D=A6 18 avril 2018 10:45 +0100, Peter Stephenson =C2=A0: > Sorry, yes, I tried this but copied it out of my history badly. It's > got "zle -C" in front and there's an underscore (you should find > _debug_history is already autoloaded). That's > > > _debug_history() { > _complete_debug _history_complete_word > } > zle -C _debug_history .complete-word _debug_history > bindkey '^[/' _debug_history Thanks! So, the result file is 700k +_history_complete_word:3> local expl direction stop curcontext=3D'' +_history_complete_word:5> [[ -z '' ]] +_history_complete_word:6> curcontext=3Dhistory-words::: +_history_complete_word:11> [[ _debug_history =3D *newer ]] +_history_complete_word:14> direction=3Dolder +_history_complete_word:17> zstyle -t :completion:history-words::::histor= y-words stop +_history_complete_word:19> zstyle -T :completion:history-words::::histor= y-words list +_history_complete_word:21> [[ self-insert =3D _history-complete-* ]] +_history_complete_word:70> _hist_stop=3D'' +_history_complete_word:71> _hist_old_prefix=3D'' +_history_complete_word:72> _history_complete_word_gen_matches +_history_complete_word_gen_matches:2> [[ -n '' ]] +_history_complete_word_gen_matches:4> _main_complete _history +_main_complete:11> local IFS=3D$' \t\n\C-@' +_main_complete:25> eval $'local -A _comp_caller_options;\n = _comp_caller_options=3D(${(kv)options[@]});\n setopt localopti= ons localtraps localpatterns ${_comp_options[@]};\n local IFS= =3D$\' \\t\\r\\n\\0\';\n builtin enable -p \\| \\~ \\( \\? \\* = \\[ \\< \\^ \\# 2>&-;\n exec local -A _comp_caller_options +(eval):2> _comp_caller_options=3D( posixargzero off autolist on print= exitvalue off kshzerosubscript off histreduceblanks off chaselinks off exte= ndedglob on localloops off histnostore off automenu on globcomplete on unse= t on listpacked off promptsubst on shwordsplit off pathdirs off kshtypeset = off listtypes on warncreateglobal off promptbang off dotglob off [...] +_history:19> local opt expl max slice hmax=3D66742 beg=3D2 +_history:21> zstyle -t :completion:history-words:history::: remove-al= l-dups +_history:22> opt=3D- +_history:27> zstyle -t :completion:history-words:history::: sort +_history:30> opt=3D-V +_history:33> zstyle -s :completion:history-words:history::: range max +_history:42> max=3D66742 +_history:43> slice=3D66742 +_history:46> PREFIX=3D'' +_history:47> IPREFIX=3D'' +_history:48> SUFFIX=3D'' +_history:49> ISUFFIX=3D'' +_history:54> local -a hslice +_history:55> [[ 0 -eq 0 && beg -lt max ]] +_history:56> [[ -n '' ]] +_history:58> hslice=3D( [...my whole history] I don't see where it should stop if there is no current word. I test with "echo". Thanks! --=20 Use the fundamental control flow constructs. - The Elements of Programming Style (Kernighan & Plauger)