zsh-workers
 help / color / mirror / code / Atom feed
* Re: _complete_help vs. the matcher-list style
@ 2000-05-02  9:09 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2000-05-02  9:09 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> If you have a matcher-list style, using _complete_help causes any completion
> function that uses that style to be called once for each match-spec in the
> style.  (I noticed this while working on a variant of _complete_debug.)
> 
> I believe this is because _complete_help redefines compadd to always fail.

Which we need to be sure that all completers are used, of course.

> Nevertheless it's a bit of a pain, as no additional context information is
> obtained by trying the other matchers.

Hm, the easy way is to make the zstyle() function defined by
_complete_help return the empty string when used for the matcher-list
style.

But that also reminds me that I've been dreaming about support to
save/set/restore styles, for use by wrapper functions such as
_complete_help. If anyone has any ideas or suggestions for something
like that, I'd like to hear them.


Bye
 Sven

Index: Completion/Commands/_complete_help
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_complete_help,v
retrieving revision 1.4
diff -u -r1.4 _complete_help
--- Completion/Commands/_complete_help	2000/04/12 03:32:51	1.4
+++ Completion/Commands/_complete_help	2000/05/02 09:07:18
@@ -27,7 +27,14 @@
       esac
       help_styles[${2}${_f}]="${help_styles[${2}${_f}]},${_t} ${3}:${_f}"
     fi
-    builtin zstyle "$@"
+
+    # No need to call the completers more than once with different match specs.
+
+    if [[ "$3" = matcher-list ]]; then
+      eval "${4}=( '' )"
+    else
+      builtin zstyle "$@"
+    fi
   }
 
   _main_complete

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

* _complete_help vs. the matcher-list style
@ 2000-04-30  9:50 Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2000-04-30  9:50 UTC (permalink / raw)
  To: zsh-workers

If you have a matcher-list style, using _complete_help causes any completion
function that uses that style to be called once for each match-spec in the
style.  (I noticed this while working on a variant of _complete_debug.)

I believe this is because _complete_help redefines compadd to always fail.
Nevertheless it's a bit of a pain, as no additional context information is
obtained by trying the other matchers.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-05-02  9:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-02  9:09 _complete_help vs. the matcher-list style Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-04-30  9:50 Bart Schaefer

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).