zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: Questions/comments on completion code that arise from PWS's zsh guide
Date: Fri, 25 Feb 2000 16:39:40 +0100 (MET)	[thread overview]
Message-ID: <200002251539.QAA21828@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Alexandre Duret-Lutz's message of 25 Feb 2000 16:23:55 +0100


Alexandre Duret-Lutz wrote:

>  Sven> The patch adds _tilde_files which completes files and expands tildes
>  Sven> if there are any. And makes _dd use it. 
> 
> But this will *always* expand tildes.  Since I am using magicequalsubst, 
> I don't want tildes to be expanded 'on the line' in places where
> it would be done by magicequalsubst.
> 
> Shouldn't there be a option to _tilde_files saying that _tilde_files is
> called in a context where magicequalsubst will expand the tilde (in which
> case _tilde_files should care whether the magicequalsubst is set or not) ?
> Or it may be the default.

Yes, I think _tilde_files should do that always.

>  Sven> Does anyone know of other places where this might be useful?
> 
> What happens with _arguments's equal-ended options ?
> Should they use _tilde_files instead of _files ?
> It may be good that `--prefix=~/usr' get expanded to
> `--prefix=/myhomedir/usr' when magicequalsubst is unset, 
> but I would find strange that `--prefix ~/usr' expands 
> to `--prefix /myhomedir/usr' too...

Hm. Maybe, but not unconditionally because currently _tilde_files
always does the expansion, not only if there is a $IPREFIX.
The solution would be an option for _tilde_files that makes it do
expansion only if the is a IPREFIX (or maybe an option with an argument 
which is taken as a pattern and _tilde_files expands only if IPREFIX
matches that) and changing the actions in the calls to _arguments and
_values (unless the commands do tilde-expansion themselves).


Bye
 Sven

diff -ru ../z.old/Completion/User/_tilde_files Completion/User/_tilde_files
--- ../z.old/Completion/User/_tilde_files	Fri Feb 25 14:17:37 2000
+++ Completion/User/_tilde_files	Fri Feb 25 16:37:57 2000
@@ -2,7 +2,7 @@
 
 # Complete files and expand tilde expansions in it.
 
-if (( $argv[(I)-W*] )); then
+if [[ ( -o magicequalsubst && "$IPREFIX" = *\= ) || $argv[(I)-W*] -ne 0 ]]; then
   _files "$@"
   return
 fi

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


             reply	other threads:[~2000-02-25 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-25 15:39 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-02-25  8:32 Sven Wischnowsky
2000-02-25 15:23 ` Alexandre Duret-Lutz

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=200002251539.QAA21828@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.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).