zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Completion issues
Date: Mon, 3 Apr 2000 14:56:43 +0200 (MET DST)	[thread overview]
Message-ID: <200004031256.OAA01841@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Sun, 2 Apr 2000 03:16:33 +0000


Bart Schaefer wrote:

> On Apr 1,  9:26pm, Peter Stephenson wrote:
> } Subject: Completion issues
> }
> } First, I hate the new behaviour of _complete_help.  I use it to find out
> } what context I'm in.  Unfortunately I don't get to see that, because a huge
> } list of style has scrolled by.
> 
> I won't say I *hate* the new behavior, but I was certainly alarmed by the
> amount of style output that was generated even for something like "ls" or
> "echo" that doesn't have any special handling.  "cvs <^Xh>" is horrifying.
> That list-colors, list-packed, list-rows-first, last-prompt, accept-exact,
> and menu appear no less than 8 times each seems a tad excessive.

I get them only three times -- it all depends on ones setup...

> } I don't think a style to turn off styles in ^Xh is good enough,
> } there's too much mucking around, and you may want the style information
> } anyway.  A workable alternative is that a numeric argument activates the
> } style list --- this feature could be configurable by a style.
> 
> I like the numeric-argument idea.  If we wanted to get really fancy, a
> number from 1-4 could denote increasingly verbose output, so that using
> universal-argument would produce the full-blown listing.
> 
> I'm not convinced we'd need a style to make that configurable, though.
> It's pretty straightforward to create a zle widget that sets NUMERIC and
> then calls another widget.

Ok. The patch makes the style list be shown only if _complete_help is
given a numeric argument.

I haven't tried to make this support multiple levels of verboseness
yet. The only probelm I have with that is to decide what to show on
the intermediate levels, though. I mean, for example, showing the
styles used without the contexts in which they are used can be both
misleading and useless. In some cases. I think. Hm.

Bye
 Sven

Index: Completion/Commands/_complete_help
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_complete_help,v
retrieving revision 1.2
diff -u -r1.2 _complete_help
--- Completion/Commands/_complete_help	2000/04/01 20:43:43	1.2
+++ Completion/Commands/_complete_help	2000/04/03 12:50:02
@@ -44,21 +44,22 @@
     text="${text}${tmp}"
   done
 
-  text="$text
+  if [[ ${NUMERIC:-1} -ne 1 ]]; then
+    text="$text
 "
-  for i in "${(@ok)help_sfuncs}"; do
-    text="${text}
+    for i in "${(@ok)help_sfuncs}"; do
+      text="${text}
 styles in context ${i}"
-    tmp=()
-    for j in "${(@s.:.)help_sfuncs[$i][2,-1]}"; do
-      tmp=( "$tmp[@]" "${(@s.,.)help_styles[${i}${j}][2,-1]}" )
-    done
-    zformat -a tmp '  (' "$tmp[@]"
-    tmp=( '
+      tmp=()
+      for j in "${(@s.:.)help_sfuncs[$i][2,-1]}"; do
+        tmp=( "$tmp[@]" "${(@s.,.)help_styles[${i}${j}][2,-1]}" )
+      done
+      zformat -a tmp '  (' "$tmp[@]"
+      tmp=( '
     '${^tmp}')' )
-    text="${text}${tmp}"
-  done
-
+      text="${text}${tmp}"
+    done
+  fi
   compstate[list]='list force'
   compstate[insert]=''
 
Index: Doc/Zsh/compsys.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v
retrieving revision 1.2
diff -u -r1.2 compsys.yo
--- Doc/Zsh/compsys.yo	2000/04/01 20:43:44	1.2
+++ Doc/Zsh/compsys.yo	2000/04/03 12:50:05
@@ -355,8 +355,7 @@
 ifnzman(noderef(Bindable Commands))
 can be invoked to find out the context and tag names and styles used at a particular
 point in completion.  It shows a list of context names and the 
-tag names used in those contexts and then a list of context names and
-the styles used in those contexts if completion were tried at the
+tag names used in those contexts if completion were tried at the
 current cursor position.  Hence one can easily find out all the
 information needed to change the behaviour of the tt(tag-order) style
 for a particular context.
@@ -2200,8 +2199,10 @@
 findex(_complete_help (^Xh))
 item(tt(_complete_help (^Xh)))(
 This widget displays information about the context names, 
-the tags, the styles, and the completion functions used 
-when completing at the current cursor position.
+the tags, and the completion functions used 
+when completing at the current cursor position. If given a numeric
+argument other than tt(1) (as in `tt(ESC-2 ^Xh)'), then the styles
+used and the contexts for which they are used will be shown, too.
 
 Note that, depending on the control flow in the completion functions
 called, the information about the styles may be

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


             reply	other threads:[~2000-04-03 12:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-03 12:56 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-04-06  7:31 Sven Wischnowsky
2000-04-04  9:49 Sven Wischnowsky
2000-04-03 15:25 Sven Wischnowsky
2000-04-05 18:30 ` Peter Stephenson
2000-04-03 13:11 Sven Wischnowsky
2000-04-01 20:26 Peter Stephenson
2000-04-02  3:16 ` Bart Schaefer

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=200004031256.OAA01841@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.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).