zsh-users
 help / color / mirror / code / Atom feed
* The removal of spaces after a tab-complete
@ 2002-12-22  1:32 David B Harris
       [not found] ` <3E052DBC.7050107@cql.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David B Harris @ 2002-12-22  1:32 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

Hey folks :)

I'm finding some irritating behaviour with zsh that I can't seem to turn
off. Specifically, after I make a completion, then hit "|" (that's a
pipe), zsh deletes the space that was inserted after the tab-complete.

I have tried turning AUTO_PARAM_KEYS off ... and turning it on :) No
help either way.

any suggestions?

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: The removal of spaces after a tab-complete
       [not found]     ` <3E060557.7070207@cql.com>
@ 2002-12-22 22:33       ` David B Harris
  0 siblings, 0 replies; 6+ messages in thread
From: David B Harris @ 2002-12-22 22:33 UTC (permalink / raw)
  To: Seth Kurtzberg; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 217 bytes --]

On Sun, 22 Dec 2002 13:32:55 -0500
Seth Kurtzberg <seth@cql.com> wrote:
> Have you tried AUTO_PARAM_KEYS?

Ugh. Do read the original email. :)

Incidentally, I'm putting the message back on the list. I did subscribe.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: The removal of spaces after a tab-complete
  2002-12-22  1:32 The removal of spaces after a tab-complete David B Harris
       [not found] ` <3E052DBC.7050107@cql.com>
@ 2002-12-23  0:52 ` Geoff Wing
  2002-12-23  1:28 ` Bart Schaefer
  2 siblings, 0 replies; 6+ messages in thread
From: Geoff Wing @ 2002-12-23  0:52 UTC (permalink / raw)
  To: zsh-users

David B Harris <david@eelf.ddts.net> typed:
: I'm finding some irritating behaviour with zsh that I can't seem to turn
: off. Specifically, after I make a completion, then hit "|" (that's a
: pipe), zsh deletes the space that was inserted after the tab-complete.

Why exactly is it a problem?  It's only an aesthetic space and has no
grammatical value.  You can also avoid it by pressing space before pipe.

Regards,
-- 
Geoff Wing


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

* Re: The removal of spaces after a tab-complete
  2002-12-22  1:32 The removal of spaces after a tab-complete David B Harris
       [not found] ` <3E052DBC.7050107@cql.com>
  2002-12-23  0:52 ` Geoff Wing
@ 2002-12-23  1:28 ` Bart Schaefer
  2002-12-23  2:29   ` David B Harris
  2 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2002-12-23  1:28 UTC (permalink / raw)
  To: zsh-users

On Dec 21,  8:32pm, David B Harris wrote:
} 
} I'm finding some irritating behaviour with zsh that I can't seem to turn
} off. Specifically, after I make a completion, then hit "|" (that's a
} pipe), zsh deletes the space that was inserted after the tab-complete.

You can't turn it off.  You can only forcibly defeat it.  You can either
define your own completions with auto-suffix-removal disabled, for every
situation in which you don't want this to happen; or you can re-bind the
specific keys for which, when typed after a completion, it should not
happen.  The latter is probably easier:

    function self-insert-no-autoremove {
      LBUFFER="$LBUFFER$KEYS"
    }
    zle -N self-insert-no-autoremove
    bindkey '|' self-insert-no-autoremove

The reasons why you can't turn it off are varied and in some instances
nearly lost in the mists of time, but it boils down to something like:
(1) it was automatically added, so it's not costing you keystrokes if
it automatically goes away again; (2) the absence of the space doesn't
matter to the syntax; (3) there are more cases where leaving the space
is wrong, than cases where removing it is wrong; so (4) if you really
want a space there, you can just type one yourself.


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

* Re: The removal of spaces after a tab-complete
  2002-12-23  1:28 ` Bart Schaefer
@ 2002-12-23  2:29   ` David B Harris
  2002-12-23  5:34     ` Zefram
  0 siblings, 1 reply; 6+ messages in thread
From: David B Harris @ 2002-12-23  2:29 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]

On Mon, 23 Dec 2002 01:28:21 +0000
"Bart Schaefer" <schaefer@brasslantern.com> wrote:
> You can't turn it off.  You can only forcibly defeat it.  You can
> either define your own completions with auto-suffix-removal disabled,
> for every situation in which you don't want this to happen; or you can
> re-bind the specific keys for which, when typed after a completion, it
> should not happen.  The latter is probably easier:

I suspected as much, at least for the auto-suffx-removal stuff; after I
read largish portions of zshcomp*(1), I got worried ;)

>     function self-insert-no-autoremove {
>       LBUFFER="$LBUFFER$KEYS"
>     }
>     zle -N self-insert-no-autoremove
>     bindkey '|' self-insert-no-autoremove
> 
> The reasons why you can't turn it off are varied and in some instances
> nearly lost in the mists of time, but it boils down to something like:
> (1) it was automatically added, so it's not costing you keystrokes if
> it automatically goes away again; (2) the absence of the space doesn't
> matter to the syntax; (3) there are more cases where leaving the space
> is wrong, than cases where removing it is wrong; so (4) if you really
> want a space there, you can just type one yourself.

Thanks a bunch for the help :) I appreciate it a lot.

P.S.: For the other poster to this tread asking why I needed it off, the
answer is: "I don't". I don't need it off, I want it off. I do a lot of
shell script writing for my work, and I do the prototypes live in an
interactive shell. Once I've poked it enough, I copy and paste it into
the shell script. Spaces around punctuation make things much more
readable. Have you tried to maintain a 50k shell script that wasn't
formatted nicely? :) I've just been having to go through re-editing the
paste, and it proves irritating. That's all. No "need" involved.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: The removal of spaces after a tab-complete
  2002-12-23  2:29   ` David B Harris
@ 2002-12-23  5:34     ` Zefram
  0 siblings, 0 replies; 6+ messages in thread
From: Zefram @ 2002-12-23  5:34 UTC (permalink / raw)
  To: David B Harris; +Cc: zsh-users

David B Harris wrote:
>                                      I do the prototypes live in an
>interactive shell. Once I've poked it enough, I copy and paste it into
>the shell script. Spaces around punctuation make things much more
>readable.

You might find the "functions" builtin useful.  It pretty-prints the
code in functions.

-zefram


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

end of thread, other threads:[~2002-12-23  5:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-22  1:32 The removal of spaces after a tab-complete David B Harris
     [not found] ` <3E052DBC.7050107@cql.com>
     [not found]   ` <20021222054028.282f9ef2.david@eelf.ddts.net>
     [not found]     ` <3E060557.7070207@cql.com>
2002-12-22 22:33       ` David B Harris
2002-12-23  0:52 ` Geoff Wing
2002-12-23  1:28 ` Bart Schaefer
2002-12-23  2:29   ` David B Harris
2002-12-23  5:34     ` Zefram

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