zsh-workers
 help / color / mirror / code / Atom feed
* Re: More intellegent suffix removing?
@ 1999-06-11  7:03 Sven Wischnowsky
  0 siblings, 0 replies; 10+ messages in thread
From: Sven Wischnowsky @ 1999-06-11  7:03 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> } I wasn't very happy with the space-removal on redirection operators
> } anyway, though. But to make this right, we would need to leave a space 
> } if that was added and to replace a slash (if one was added) with a
> } space. There is no way to do this easily for now.
> 
> I don't want zsh to replace a slash if one was added.  What if what I
> intend is to complete a directory and then glob files in that directory
> whose names begin with a digit?

Right, that was a thinko.

> I think Andrej's point -- and it's my point, if not his -- is that '<'
> should be left out of the list of characters that do suffix autoremoval.
> (And therefore probably '>' should be too ... and come to think of it,
> even '|' can be part of a glob pattern.)

Ok.

Bye
 Sven

diff -u os/Zle/zle_misc.c Src/Zle/zle_misc.c
--- os/Zle/zle_misc.c	Fri Jun 11 08:57:47 1999
+++ Src/Zle/zle_misc.c	Fri Jun 11 08:59:00 1999
@@ -788,9 +788,8 @@
 void
 makesuffix(int n)
 {
-    suffixlen[256] = suffixlen[' '] = suffixlen['\t'] = suffixlen['\n'] =
-	suffixlen[';'] = suffixlen['|'] = suffixlen['&'] = 
-	suffixlen['<'] = suffixlen['>'] = n;
+    suffixlen[256] = suffixlen[' '] = suffixlen['\t'] = suffixlen['\n'] = 
+	suffixlen[';'] = suffixlen['&'] = n;
 }
 
 /* Set up suffix for parameter names: the last n characters are a suffix *
diff -u od/Zsh/options.yo Doc/Zsh/options.yo
--- od/Zsh/options.yo	Fri Jun 11 09:01:57 1999
+++ Doc/Zsh/options.yo	Fri Jun 11 09:02:02 1999
@@ -120,7 +120,7 @@
 item(tt(AUTO_REMOVE_SLASH))(
 When the last character resulting from a completion is a slash and the next
 character typed is a word delimiter, a slash, or a character that ends 
-a command (such as a semicolon or an ampersand), remove the slash.
+a command (a semicolon or an ampersand), remove the slash.
 )
 pindex(AUTO_RESUME)
 cindex(jobs, resuming automatically)

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


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

* Re: More intellegent suffix removing?
@ 1999-06-11  8:18 Sven Wischnowsky
  0 siblings, 0 replies; 10+ messages in thread
From: Sven Wischnowsky @ 1999-06-11  8:18 UTC (permalink / raw)
  To: zsh-workers


I wrote:

> -    suffixlen[256] = suffixlen[' '] = suffixlen['\t'] = suffixlen['\n'] =
> -	suffixlen[';'] = suffixlen['|'] = suffixlen['&'] = 
> -	suffixlen['<'] = suffixlen['>'] = n;
> +    suffixlen[256] = suffixlen[' '] = suffixlen['\t'] = suffixlen['\n'] = 
> +	suffixlen[';'] = suffixlen['&'] = n;

Damn, damn, damn. That was wrong, wasn't it? A `a|b' is recognized as
a glob pattern only if it is in parentheses, without them this it's a
pipe. And we can't complete `(foo<TAB>' anyway.


Bye
 Sven

diff -u os/Zle/zle_misc.c Src/Zle/zle_misc.c
--- os/Zle/zle_misc.c	Fri Jun 11 10:12:14 1999
+++ Src/Zle/zle_misc.c	Fri Jun 11 10:15:28 1999
@@ -789,7 +789,7 @@
 makesuffix(int n)
 {
     suffixlen[256] = suffixlen[' '] = suffixlen['\t'] = suffixlen['\n'] = 
-	suffixlen[';'] = suffixlen['&'] = n;
+	suffixlen[';'] = suffixlen['&'] = suffixlen['|'] = n;
 }
 
 /* Set up suffix for parameter names: the last n characters are a suffix *
diff -u od/Zsh/options.yo Doc/Zsh/options.yo
--- od/Zsh/options.yo	Fri Jun 11 10:13:28 1999
+++ Doc/Zsh/options.yo	Fri Jun 11 10:16:09 1999
@@ -120,7 +120,7 @@
 item(tt(AUTO_REMOVE_SLASH))(
 When the last character resulting from a completion is a slash and the next
 character typed is a word delimiter, a slash, or a character that ends 
-a command (a semicolon or an ampersand), remove the slash.
+a command (such as a semicolon or an ampersand), remove the slash.
 )
 pindex(AUTO_RESUME)
 cindex(jobs, resuming automatically)

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


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

* RE: More intellegent suffix removing?
  1999-06-10 16:31     ` Bart Schaefer
@ 1999-06-10 16:40       ` Andrej Borsenkow
  0 siblings, 0 replies; 10+ messages in thread
From: Andrej Borsenkow @ 1999-06-10 16:40 UTC (permalink / raw)
  To: Bart Schaefer, zsh-workers

>
> I don't want zsh to replace a slash if one was added.  What if what I
> intend is to complete a directory and then glob files in that directory
> whose names begin with a digit?
>

 That was exactly how I found it :-)

> I think Andrej's point -- and it's my point, if not his -- is that '<'
> should be left out of the list of characters that do suffix autoremoval.
> (And therefore probably '>' should be too ... and come to think of it,
> even '|' can be part of a glob pattern.)
>

Well, at least I have a habit to always separate <, > and | by space from
previous word if used as redirection/pipe, so yes, may be. But in any case `<'
for all-digits name globbing is quite handy once you've started to use it.

/andrej


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

* Re: More intellegent suffix removing?
  1999-06-10 14:02   ` Sven Wischnowsky
@ 1999-06-10 16:31     ` Bart Schaefer
  1999-06-10 16:40       ` Andrej Borsenkow
  0 siblings, 1 reply; 10+ messages in thread
From: Bart Schaefer @ 1999-06-10 16:31 UTC (permalink / raw)
  To: zsh-workers

On Jun 10,  5:55pm, Andrej Borsenkow wrote:
} Subject: RE: More intellegent suffix removing?
}
} > The patch would be the thing below (are there any other characters
} > where this would be the right thing?). It looks a bit ugly when this
} > happens after typing a `<' or `>', though.
} 
} Hmm ... as I found recently, at least `<' can quite legitimately be part of
} word (<m-n> globbing).

On Jun 10,  4:02pm, Sven Wischnowsky wrote:
} Subject: RE: More intellegent suffix removing?
}
} But only if there is also a `>' and the stuff them forms a valid
} number range (and, of course, you must have the right options set).

Yes ... so what?  You can't determine that at the time a suffix is to
be autoremoved.

} I wasn't very happy with the space-removal on redirection operators
} anyway, though. But to make this right, we would need to leave a space 
} if that was added and to replace a slash (if one was added) with a
} space. There is no way to do this easily for now.

I don't want zsh to replace a slash if one was added.  What if what I
intend is to complete a directory and then glob files in that directory
whose names begin with a digit?

I think Andrej's point -- and it's my point, if not his -- is that '<'
should be left out of the list of characters that do suffix autoremoval.
(And therefore probably '>' should be too ... and come to think of it,
even '|' can be part of a glob pattern.)

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


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

* RE: More intellegent suffix removing?
@ 1999-06-10 14:02   ` Sven Wischnowsky
  1999-06-10 16:31     ` Bart Schaefer
  0 siblings, 1 reply; 10+ messages in thread
From: Sven Wischnowsky @ 1999-06-10 14:02 UTC (permalink / raw)
  To: zsh-workers


Andrej Borsenkow wrote:

> > The patch would be the thing below (are there any other characters
> > where this would be the right thing?). It looks a bit ugly when this
> > happens after typing a `<' or `>', though.
> 
> Hmm ... as I found recently, at least `<' can quite legitimately be part of
> word (<m-n> globbing). What a surprise :-) And is interpreted as such by
> zsh; `cat<' is different from `cat <'

But only if there is also a `>' and the stuff them forms a valid
number range (and, of course, you must have the right options set).

I wasn't very happy with the space-removal on redirection operators
anyway, though. But to make this right, we would need to leave a space 
if that was added and to replace a slash (if one was added) with a
space. There is no way to do this easily for now.

Bye
 Sven


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


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

* RE: More intellegent suffix removing?
  1999-06-07 11:41 Sven Wischnowsky
  1999-06-07 12:09 ` Andrej Borsenkow
@ 1999-06-10 13:55 ` Andrej Borsenkow
  1999-06-10 14:02   ` Sven Wischnowsky
  1 sibling, 1 reply; 10+ messages in thread
From: Andrej Borsenkow @ 1999-06-10 13:55 UTC (permalink / raw)
  To: Sven Wischnowsky, zsh-workers

>
> The patch would be the thing below (are there any other characters
> where this would be the right thing?). It looks a bit ugly when this
> happens after typing a `<' or `>', though.
>

Hmm ... as I found recently, at least `<' can quite legitimately be part of
word (<m-n> globbing). What a surprise :-) And is interpreted as such by
zsh; `cat<' is different from `cat <'

/andrej


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

* RE: More intellegent suffix removing?
@ 1999-06-07 12:44 Sven Wischnowsky
  0 siblings, 0 replies; 10+ messages in thread
From: Sven Wischnowsky @ 1999-06-07 12:44 UTC (permalink / raw)
  To: zsh-workers


Andrej Borsenkow wrote:

> > The patch would be the thing below (are there any other characters
> > where this would be the right thing?). It looks a bit ugly when this
> > happens after typing a `<' or `>', though.
> > 
> 
> If Peter decides to keep this patch, it should be of course documented.

Well, for the shell things like `;' are word separators, but maybe, yes...


Bye
 Sven

diff -u od/Zsh/options.yo Doc/Zsh/options.yo
--- od/Zsh/options.yo	Mon Jun  7 13:00:16 1999
+++ Doc/Zsh/options.yo	Mon Jun  7 14:24:06 1999
@@ -119,7 +119,8 @@
 cindex(slash, removing trailing)
 item(tt(AUTO_REMOVE_SLASH))(
 When the last character resulting from a completion is a slash and the next
-character typed is a word delimiter or a slash, remove the slash.
+character typed is a word delimiter, a slash, or a character that ends 
+a command (such as a semicolon or an ampersand), remove the slash.
 )
 pindex(AUTO_RESUME)
 cindex(jobs, resuming automatically)

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


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

* RE: More intellegent suffix removing?
  1999-06-07 11:41 Sven Wischnowsky
@ 1999-06-07 12:09 ` Andrej Borsenkow
  1999-06-10 13:55 ` Andrej Borsenkow
  1 sibling, 0 replies; 10+ messages in thread
From: Andrej Borsenkow @ 1999-06-07 12:09 UTC (permalink / raw)
  To: Sven Wischnowsky, zsh-workers

> 
> The patch would be the thing below (are there any other characters
> where this would be the right thing?). It looks a bit ugly when this
> happens after typing a `<' or `>', though.
> 

If Peter decides to keep this patch, it should be of course documented.

/andrej


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

* Re: More intellegent suffix removing?
@ 1999-06-07 11:41 Sven Wischnowsky
  1999-06-07 12:09 ` Andrej Borsenkow
  1999-06-10 13:55 ` Andrej Borsenkow
  0 siblings, 2 replies; 10+ messages in thread
From: Sven Wischnowsky @ 1999-06-07 11:41 UTC (permalink / raw)
  To: zsh-workers


Andrej Borsenkow wrote:

> Consider:
> 
> bor@itsrm2:~%> l /S<TAB>
> bor@itsrm2:~%> l /SInus/      now I press ``;''
> bor@itsrm2:~%> l /SInus/;
> 
> note, that ``/'' is not removed, but in this case `;' can not be a part of
> current word (but \; or ';' or ";" can). Is it possible (does it make
> sense?) do make suffix removing follow Zsh grammar more closely?

The patch would be the thing below (are there any other characters
where this would be the right thing?). It looks a bit ugly when this
happens after typing a `<' or `>', though.

Bye
 Sven

diff -u os/Zle/zle_misc.c Src/Zle/zle_misc.c
--- os/Zle/zle_misc.c	Mon Jun  7 13:00:07 1999
+++ Src/Zle/zle_misc.c	Mon Jun  7 13:37:55 1999
@@ -787,7 +787,9 @@
 void
 makesuffix(int n)
 {
-    suffixlen[256] = suffixlen[' '] = suffixlen['\t'] = suffixlen['\n'] = n;
+    suffixlen[256] = suffixlen[' '] = suffixlen['\t'] = suffixlen['\n'] =
+	suffixlen[';'] = suffixlen['|'] = suffixlen['&'] = 
+	suffixlen['<'] = suffixlen['>'] = n;
 }
 
 /* Set up suffix for parameter names: the last n characters are a suffix *

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


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

* More intellegent suffix removing?
@ 1999-06-07 11:21 Andrej Borsenkow
  0 siblings, 0 replies; 10+ messages in thread
From: Andrej Borsenkow @ 1999-06-07 11:21 UTC (permalink / raw)
  To: ZSH workers mailing list

Consider:

bor@itsrm2:~%> l /S<TAB>
bor@itsrm2:~%> l /SInus/      now I press ``;''
bor@itsrm2:~%> l /SInus/;

note, that ``/'' is not removed, but in this case `;' can not be a part of
current word (but \; or ';' or ";" can). Is it possible (does it make
sense?) do make suffix removing follow Zsh grammar more closely?

/andrej


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

end of thread, other threads:[~1999-06-11  8:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-11  7:03 More intellegent suffix removing? Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
1999-06-11  8:18 Sven Wischnowsky
1999-06-07 12:44 Sven Wischnowsky
1999-06-07 11:41 Sven Wischnowsky
1999-06-07 12:09 ` Andrej Borsenkow
1999-06-10 13:55 ` Andrej Borsenkow
1999-06-10 14:02   ` Sven Wischnowsky
1999-06-10 16:31     ` Bart Schaefer
1999-06-10 16:40       ` Andrej Borsenkow
1999-06-07 11:21 Andrej Borsenkow

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