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; 7+ 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] 7+ messages in thread
* Re: setopt localoptions noautoremoveslash
@ 1999-10-15  6:23 Sven Wischnowsky
  0 siblings, 0 replies; 7+ messages in thread
From: Sven Wischnowsky @ 1999-10-15  6:23 UTC (permalink / raw)
  To: zsh-workers


Wayne Davison wrote:

> I would like an auto-added slash to be inserted into the buffer as a
> special meta character (call it meta-/ for now) that has special
> properties.  I imagine this character displaying itself in reverse
> video _only_ if it is going to be removed when I press return (it is
> not removed before that unless you type a '/' right next to it).
> The command-line display routine would check the character to the
> right of the meta-/ to determine how to draw the character.

What would you do with `-qSfoo'? I.e. you would have to allow every
possible character to have an auto-removable counterpart. Also, you
would have to store information about which sequences of characters
have to be removed together. And then there is `compadd -r', so you
would have to store information about the characters that will remove
the suffix. And there is `-R', so you may have to call a function to
find out if something is to be removed (and currently these functions
can be sure to be called after the completion that inserted the
suffix, if called only on a return, this isn't true any more).

So, a complete solution would be hard (or impossible without changing
the definition of the context in which remove-functions are to be
called -- which is probably still possible because we haven't said
that in the docs, although I think its convenient to be able to
access, e.g. `_lastcomp' from within such remove-functions). That
would leave the possibility to do this only for some (simple)
auto-remove things but that might irritate the users if some suffixes
behave this way and other behave differently.

And then there is the (small) problem that the line editor can't just
use, e.g. standout mode, to highlight such auto-removed things because 
users are free to start any terminal mode they want in `PS1' and unset 
it in `POSTEDIT' or whatever (the solution would obviously be to make
this configurable by adding a special parameter (or two of them) whose 
value(s) are printed before/after such a highlighted region).

Hm.

Bye
 Sven


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


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

end of thread, other threads:[~1999-10-15 14:36 UTC | newest]

Thread overview: 7+ 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  6:23 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).