From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: blah*[TAB] (difference between 3.1.6 and 3.1.9)
Date: Thu, 8 Jun 2000 09:18:59 +0200 (MET DST) [thread overview]
Message-ID: <200006080718.JAA18080@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Wed, 7 Jun 2000 14:42:08 +0000
Bart Schaefer wrote:
> On Jun 7, 8:49am, Sven Wischnowsky wrote:
> } Subject: Re: blah*[TAB] (difference between 3.1.6 and 3.1.9)
> }
> } I wrote:
> }
> } > Bart Schaefer wrote:
> } >
> } > > Something's definitely gone wrong with expand-or-complete. This was not
> } > > intentional.
> } >
> } > Ahem. Changed in 9777 in reply to 9756 (guess the author).
> } >
> } > 9777 commented out some stuff in doexpansion(). Change it back?
> }
> } I want to get that from my todo-list. Should we change it back? Bart
> } (9765 was from you)?
>
> Sorry, I couldn't make up my mind yesterday.
>
> In 9777 you wrote:
> > About the space: this was obviously intentional, too. I've just
> > changed the test in doexpansion() so we can go back easily if suddenly
> > we decide the old behaviour was better. But what I would really like
> > to have is a better test: when do we want the space and when not.
>
> I think it should add the space only when the expansion results in more
> than one word being inserted. The reasoning is that it probably doesn't
> make sense to continue completing only the last of several words that
> were generated from the same pattern, but if only one word resulted then
> it might reasonably be a prefix of a longer completion.
Sounds sensible.
> The potential issue I see with this is that what a lot of people want is
> really expand-AND-complete (not "or"), which makes them think a space
> should be appended if the result is an existing plain file, or something
> like that. In fact, I used to be one of them; for a long time I had
> "setopt recexact" just so that two tabs would expand and then insert a
> space rather than expand and then produce a listing (when one file name
> is a prefix of another). I've since come to the conclusion that recexact
> is almost always more trouble than it is worth. However, that doesn't
> help resolve this ... perhaps another style?
I don't want to make old completion code use styles, I think (and
somehow I seem to want to avoid using styles in C-code, in the hope
that one day we'll find a way to more-or-less automatically find used
styles).
Bye
Sven
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.13
diff -u -r1.13 zle_tricky.c
--- Src/Zle/zle_tricky.c 2000/06/07 08:39:57 1.13
+++ Src/Zle/zle_tricky.c 2000/06/08 07:15:54
@@ -1627,7 +1627,7 @@
static int
doexpansion(char *s, int lst, int olst, int explincmd)
{
- int ret = 1;
+ int ret = 1, first = 1;
LinkList vl;
char *ss;
@@ -1678,10 +1678,11 @@
if (olst != COMP_EXPAND_COMPLETE || nonempty(vl) ||
(cs && line[cs-1] != '/')) {
#endif
- if (nonempty(vl)) {
+ if (nonempty(vl) || !first) {
spaceinline(1);
line[cs++] = ' ';
}
+ first = 0;
}
end:
popheap();
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-06-08 7:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-08 7:18 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-06-06 12:58 Sven Wischnowsky
2000-06-06 15:57 ` Bart Schaefer
2000-06-06 16:44 ` Bart Schaefer
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=200006080718.JAA18080@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).