zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: Re: PATCH: Re: long completion selections and listings
@ 2000-07-12 10:35 Sven Wischnowsky
  2000-07-12 10:44 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 2000-07-12 10:35 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> ...
> 
> It does say that in the manual.  What's confusing me is that (if I've read
> this right), list-prompt uses a default if you don't set it to the empty
> string, and select-prompt is the other way round.  I think I've handled
> that difference in the following.

The manual was wrong.

Bye
 Sven

Index: Doc/Zsh/compsys.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v
retrieving revision 1.83
diff -u -r1.83 compsys.yo
--- Doc/Zsh/compsys.yo	2000/07/05 21:05:58	1.83
+++ Doc/Zsh/compsys.yo	2000/07/12 10:34:23
@@ -1470,7 +1470,8 @@
 ifzman(the description of the tt(zsh/complist) module in zmanref(zshmodules))\
 ifnzman(noderef(The zsh/complist Module))\
 ).  The value, if not the empty string, will be displayed after every
-screenful and the shell will prompt for a key press; if the style is unset,
+screenful and the shell will prompt for a key press; if the style is
+set to the empty string,
 a default prompt will be used.  The value may contain the escape sequences
 `tt(%l)' or `tt(%L)', which will be replaced by the number of the last line
 displayed and the total number of lines; `tt(%m)' or `tt(%M)', which will

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


^ permalink raw reply	[flat|nested] 3+ messages in thread
* PATCH: Re: long completion selections and listings
@ 2000-07-12  9:23 Sven Wischnowsky
  2000-07-12 10:14 ` PATCH: " Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 2000-07-12  9:23 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> According to the manual, select-prompt has a default when you used
> scrolling with menus.  It doesn't show up for me --- I had to set it
> explicitly.  (If I remember right, I didn't put it in compinstall because
> there was already a sensible default.)

You get the default when setting select-prompt to the empty string and 
that works for me.

> Another thing, maybe I misunderstood somewhere, but I have
>   zstyle ':completion:*' menu 'select=long' 'select=5'
> Since I don't have select=long-list, I wouldn't expect long listings to
> switch automatically to menu selection, but at the moment they do.
> Lists which do fit on the screen don't.

I hope you meant this: it shouldn't start menu selection if not
starting menu completion. Right.

Bye
 Sven

Index: Completion/Core/_main_complete
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_main_complete,v
retrieving revision 1.35
diff -u -r1.35 _main_complete
--- Completion/Core/_main_complete	2000/07/03 08:05:27	1.35
+++ Completion/Core/_main_complete	2000/07/12 09:22:39
@@ -175,7 +175,7 @@
           -n "$_menu_style[(r)(yes|true|on|1)=long-list]" ) ]]; then
     compstate[insert]=menu
   elif [[ "$compstate[insert]" = "$_saved_insert" ]]; then
-    if [[ -n "$_menu_style[(r)select=long]" && tmp -gt LINES ]]; then
+    if [[ -n "$_menu_style[(r)(yes|true|1|on)=long]" && tmp -gt LINES ]]; then
         compstate[insert]=menu
     else
       sel=( "${(@M)_menu_style:#(yes|true|1|on)*}" )
@@ -183,11 +183,13 @@
       if (( $#sel )); then
 	min=9999999
         for i in "$sel[@]"; do
-          if [[ "$i" = *\=* ]]; then
+          if [[ "$i" = *\=[0-9]* ]]; then
   	    num="${i#*\=}"
   	    [[ num -lt 0 ]] && num=0
-  	  else
-  	    num=$nm
+  	  elif [[ "$i" != *\=* ]]; then
+  	    num=0
+          else
+	    num=9999999
   	  fi
   	  [[ num -lt min ]] && min="$num"
   
@@ -199,11 +201,13 @@
       if (( $#sel )); then
 	max=9999999
         for i in "$sel[@]"; do
-          if [[ "$i" = *\=* ]]; then
+          if [[ "$i" = *\=[0-9]* ]]; then
   	    num="${i#*\=}"
   	    [[ num -lt 0 ]] && num=0
-  	  else
+          elif [[ "$i" != *\=* ]]; then
   	    num=0
+  	  else
+  	    num=9999999
   	  fi
   	  [[ num -lt max ]] && max="$num"
   
@@ -229,20 +233,22 @@
     elif [[ -n "$_menu_style[(r)select=long*]" ]]; then
       if [[ tmp -gt LINES ]]; then
         zmodload -i zsh/complist
-        MENUSELECT=0
+        MENUSELECT=00
       fi
     fi
-    if [[ "$MENUSELECT" != 0 ]]; then
+    if [[ "$MENUSELECT" != 00 ]]; then
       sel=( "${(@M)_menu_style:#select*}" )
 
       if (( $#sel )); then
 	min=9999999
         for i in "$sel[@]"; do
-          if [[ "$i" = *\=* ]]; then
+          if [[ "$i" = *\=[0-9]* ]]; then
   	    num="${i#*\=}"
   	    [[ num -lt 0 ]] && num=0
-  	  else
+  	  elif [[ "$i" != *\=* ]]; then
   	    num=0
+          else
+	    num=9999999
   	  fi
   	  [[ num -lt min ]] && min="$num"
   

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


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

end of thread, other threads:[~2000-07-12 10:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-12 10:35 PATCH: Re: PATCH: Re: long completion selections and listings Sven Wischnowsky
2000-07-12 10:44 ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
2000-07-12  9:23 Sven Wischnowsky
2000-07-12 10:14 ` PATCH: " Peter Stephenson

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