zsh-workers
 help / color / mirror / code / Atom feed
* setopt localoptions noautoremoveslash
@ 1999-10-14 17:09 Tanaka Akira
  1999-10-14 17:15 ` Zefram
  0 siblings, 1 reply; 12+ messages in thread
From: Tanaka Akira @ 1999-10-14 17:09 UTC (permalink / raw)
  To: zsh-workers

Why is `setopt localoptions noautoremoveslash' not effective?
Is this intended behaviour?

Z(2):akr@is27e1u11% Src/zsh -f
is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% _tst () { setopt localoptions noautoremoveslash; compgen -/ }
is27e1u11% tst Do<TAB>
->
is27e1u11% tst Doc/<SPACE>
->
is27e1u11% tst Doc 

I noticed this with _urls. In URL context, trailing slash should not
autoremoved.
-- 
Tanaka Akira


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: PATCH: _urls again (Re: setopt localoptions noautoremoveslash)
@ 1999-10-15 12:10 Sven Wischnowsky
  1999-10-15 15:30 ` Oliver Kiddle
  0 siblings, 1 reply; 12+ messages in thread
From: Sven Wischnowsky @ 1999-10-15 12:10 UTC (permalink / raw)
  To: zsh-workers


Oliver Kiddle wrote:

> One strange behaviour I find with completing urls is that with
> urls_localhttpd set, when I complete user directories, menu
> selection is entered imediately rather than waiting for a second tab:
> e.g: netscape http://risc10/~<tab> will insert 'ada' and give me the
> list with 'ada' selected rather than just giving me the list. This
> behaviour continues when completing files and directories after the
> username. 
> 
> I've also noticed that with this dual file/directory completion and
> description_format set, I get 'file' aswell as 'directory' at the top
> of the list even if there were no files to complete. 

Do you mean to say that you still get this or that you fixed it? At
least I don't get either of these after your patch. If you still get
them, I need more information about your configuration and the
possible matches that triggered it.

Bye
 Sven


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


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: PATCH: _urls again (Re: setopt localoptions noautoremoveslash)
@ 1999-10-18  9:41 Sven Wischnowsky
  0 siblings, 0 replies; 12+ messages in thread
From: Sven Wischnowsky @ 1999-10-18  9:41 UTC (permalink / raw)
  To: zsh-workers


Oliver Kiddle wrote:

> I tracked down the first problem to setopt glob_complete. i.e, the
> following is sufficient to cause the problem:

Ah, that helped. The problem was the `-f' business: it first tried to
match files. That found the `~' and with extendedglob set that made
the string look like a pattern, so the C-code set a flag
(`haspattern') which triggered menu-completion. The fix is to reset
that flag if no matches could be generated.

I also found out that `_tilde' wans't using `_users' yet.

> With respect to the second problem, I think I was just confused by the
> fact that I got a listing which looks like:
> file
> directory
> fred/    joe
> when I expected the file to appear before 'directory' so sorry for not
> checking it before I sent the mail.

A more verbose `description_format' might help here...

Bye
 Sven

diff -u oldsrc/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- oldsrc/Zle/zle_tricky.c	Mon Oct 18 11:17:17 1999
+++ Src/Zle/zle_tricky.c	Mon Oct 18 11:37:21 1999
@@ -4026,7 +4026,7 @@
     char **aign = NULL, **dparr = NULL, oaq = autoq, *oppre = dat->ppre;
     char *oqp = qipre, *oqs = qisuf, qc, **disp = NULL;
     int lpl, lsl, pl, sl, bpl, bsl, bppl = -1, bssl = -1;
-    int llpl = 0, llsl = 0, nm = mnum, gflags = 0;
+    int llpl = 0, llsl = 0, nm = mnum, gflags = 0, ohp = haspattern;
     int oisalt = 0, isalt, isexact, doadd, ois = instring, oib = inbackt;
     Cline lc = NULL;
     Cmatch cm;
@@ -4333,6 +4333,9 @@
     qipre = oqp;
     qisuf = oqs;
 
+    if (mnum == nm)
+	haspattern = ohp;
+
     return (mnum == nm);
 }
 
@@ -6258,6 +6261,7 @@
 makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 {
     int t, sf1, sf2, ooffs, um = usemenu, delit, oaw, gflags;
+    int mn = mnum, ohp = haspattern;
     char *p, *sd = NULL, *tt, *s1, *s2, *os =  dupstring(s);
     struct cmlist ms;
 
@@ -7173,6 +7177,9 @@
     uremnode(ccstack, firstnode(ccstack));
     if (cc->matcher)
 	mstack = mstack->next;
+
+    if (mn == mnum)
+	haspattern = ohp;
 }
 
 /* Invalidate the completion list. */
diff -u -r oldcompletion/Base/_tilde Completion/Base/_tilde
--- oldcompletion/Base/_tilde	Mon Oct 18 11:17:45 1999
+++ Completion/Base/_tilde	Mon Oct 18 11:26:30 1999
@@ -39,12 +39,12 @@
   _description d 'directory stack'
   compadd "$d[@]" -V dirs -S/ -ld lines -Q - "$list[@]" 
 else
+  _users "$@"
   if (( $# )); then
     d=( "$@" )
   else
-    _description d 'user or named directory'
+    _description d 'named directory'
   fi
-
-  compgen "$d[@]" -nu "$s[@]"
+  compgen "$d[@]" -n "$s[@]"
 fi
 

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


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

end of thread, other threads:[~1999-10-18  9:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-14 17:09 setopt localoptions noautoremoveslash Tanaka Akira
1999-10-14 17:15 ` Zefram
1999-10-14 18:08   ` Tanaka Akira
1999-10-15 11:24     ` PATCH: _urls again (Re: setopt localoptions noautoremoveslash) Oliver Kiddle
1999-10-15 14:36       ` Tanaka Akira
1999-10-15  3:15   ` setopt localoptions noautoremoveslash Wayne Davison
1999-10-15 12:10 PATCH: _urls again (Re: setopt localoptions noautoremoveslash) Sven Wischnowsky
1999-10-15 15:30 ` Oliver Kiddle
     [not found]   ` <991015155008.ZM24081@candle.brasslantern.com>
1999-10-15 16:05     ` Oliver Kiddle
1999-10-15 16:40       ` Bart Schaefer
1999-10-16 13:56   ` Tanaka Akira
1999-10-18  9:41 Sven Wischnowsky

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