zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: [PATCH 2/2] Use _multi_parts for scp remote file completion and complete abbrevs
Date: Mon, 13 Oct 2008 21:26:33 -0700	[thread overview]
Message-ID: <081013212633.ZM30837@torch.brasslantern.com> (raw)
In-Reply-To: <1223918374-21544-2-git-send-email-joerg@alea.gnuu.de>

On Oct 13,  7:19pm, Joerg wrote:
}
} This patches uses the function _multi_parts to simplify the code.

I'm not convinced that "simpler" here is equivalent to "correct."  At
the very least the user should get to decide whether he prefers to
know the file type and to have the suffix autoremoved, i.e., the old
behavior should be available via a zstyle.

For one thing, the old behavior was intended to minimize the amount
of useless data the remote system had to send.  There are things it
is "fast enough" to do on the local filesystem that it's too costly
to wait for when it has to be shipped across the network as text.

Also, if you're giving up on the file type suffix, you should remove
the "F" option from the "ls" command that's executed on the remote
system.  I think that's the source of the quoting issue for which
you sent a follow-up patch to _multi_parts; I'm also not sure that
the _multi_parts patch is correct when the pattern is NOT going to be
evaluated on the far end of an ssh.

} With _multi_parts it's easier to do completion of abbreviated path like
} /u/s/d/zsh. So do it.

This doesn't quite work, even if it's worth the overhead.  If I try,
for example:

% scp remote:/u/s/d<TAB>

I get as far as

% scp remote:/usr/s/d

(with cursor on the second slash), and at that point it all stops
working; I can only complete more if I first move the cursor to the
end of the word (to the right of "d") every time.  If I merely
insert an "h" to disambiguate /usr/sbin from /usr/share and hit TAB
with the cursor still on the second slash, I end up going from

% scp remote:/usr/sh/d

to

% scp remote:

_complete_debug says (in part):

: _remote_files:6:then; rempat='\*/usr\*/sh\*' 
: _remote_files:7:then; [[ /usr/sh == (.|..|)/* ]]
: _remote_files:7:then cmdand; rempat='/usr\*/sh\*' 
: _remote_files:8:then; remfiles=: _remote_files:8:then; remfiles=( /usr/share/ 
) 

The trailing "/d" has been lost because the of the cursor placement.


      reply	other threads:[~2008-10-14  4:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-13 17:19 [PATCH 1/2] Run ssh in batch mode Jörg Sommer
2008-10-13 17:19 ` [PATCH 2/2] Use _multi_parts for scp remote file completion and complete abbrevs Jörg Sommer
2008-10-14  4:26   ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=081013212633.ZM30837@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).