From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: TAB and PS2 and multiline buffers and vared
Date: Mon, 22 May 2000 16:44:01 +0200 (MET DST) [thread overview]
Message-ID: <200005221444.QAA20403@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Mon, 22 May 2000 14:27:41 +0000
Bart Schaefer wrote:
> On May 22, 1:25pm, Sven Wischnowsky wrote:
> } Subject: PATCH: Re: TAB and PS2 and multiline buffers and vared
> }
> } Bart Schaefer wrote:
> }
> } > The situation is different in vared (again with a multiline buffer).
> } > Sometimes it beeps and then asks me whether I want to see all 2200
> } > possiblities, other times it just beeps and refuses to insert anything.
> } > Whether it asks or just beeps seems to depend on whether I started out
> } > on vared of a value containing newlines (e.g. vared functions[foo] vs.
> } > vared foo).
> }
> } Hm. Is that with the current CVS version?
>
> Yes. (Well, current at the time I sent the mail.)
I don't understand why it's completing commands then... Hm.
> } > Sometimes after this happens the completion system gets into a state
> } > where _complete_debug ceases to function properly. I type ^X? and the
> } > debug output goes to the file as expected, but _message doesn't work.
> } > Also, `?' gets inserted because of compstate[insert]=tab, which is a bit
> } > strange though not exactly wrong.
> }
> } The patch also changes it to insert a tab only when TAB was pressed.
>
> Thanks, but as I mentioned in my followup message, compstate[insert]
> seems to have gotten `stuck' somehow, that is, once I'm in this state
> it *always* begins with "tab " so nothing will complete anywhere. Not
> just inside vared, but after I exit vared and go on to the next PS1.
After having a look at zle_tricky.c again... the patch below should
help when the widget wasn't invoked by TAB, but with TAB, it shouldn't
have happened before. Did it contain the `tab' on entry to
_main_complete or only on exit?
> } About the missing _message: you have _oldlist in your completer style,
> } right? Did you try ^X? directly after the TAB?
>
> Yes, I do have _oldlist, and probably I did try right after the tab.
Then ^X? showed you the list from the TAB, of course, the one without
the _message-string. Maybe we should change _oldlist to not do its job
when called from _complete_debug. But then again, maybe we shouldn't.
Brute force patch below, but it'll hopefully make sure that we don't
enter docomplete() with an old value in wouldinstab again.
Bye
Sven
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.10
diff -u -r1.10 zle_tricky.c
--- Src/Zle/zle_tricky.c 2000/05/22 11:28:29 1.10
+++ Src/Zle/zle_tricky.c 2000/05/22 14:42:22
@@ -158,7 +158,6 @@
{
unsigned char *s = line + cs - 1;
- wouldinstab = 0;
if (keybuf[0] != '\t' || keybuf[1])
return 0;
for (; s >= line && *s != '\n'; s--)
@@ -192,6 +191,7 @@
{
usemenu = !!isset(MENUCOMPLETE);
useglob = isset(GLOBCOMPLETE);
+ wouldinstab = 0;
if (c == '\t' && usetab())
return selfinsert(args);
else {
@@ -213,6 +213,7 @@
{
usemenu = 1;
useglob = isset(GLOBCOMPLETE);
+ wouldinstab = 0;
if (c == '\t' && usetab())
return selfinsert(args);
else
@@ -225,6 +226,7 @@
{
usemenu = !!isset(MENUCOMPLETE);
useglob = isset(GLOBCOMPLETE);
+ wouldinstab = 0;
return docomplete(COMP_LIST_COMPLETE);
}
@@ -233,6 +235,7 @@
spellword(char **args)
{
usemenu = useglob = 0;
+ wouldinstab = 0;
return docomplete(COMP_SPELL);
}
@@ -242,6 +245,7 @@
{
usemenu = !!isset(MENUCOMPLETE);
useglob = isset(GLOBCOMPLETE);
+ wouldinstab = 0;
if (cs != ll) {
fixsuffix();
@@ -256,6 +260,7 @@
expandword(char **args)
{
usemenu = useglob = 0;
+ wouldinstab = 0;
if (c == '\t' && usetab())
return selfinsert(args);
else
@@ -268,6 +273,7 @@
{
usemenu = !!isset(MENUCOMPLETE);
useglob = isset(GLOBCOMPLETE);
+ wouldinstab = 0;
if (c == '\t' && usetab())
return selfinsert(args);
else {
@@ -289,6 +295,7 @@
{
usemenu = 1;
useglob = isset(GLOBCOMPLETE);
+ wouldinstab = 0;
if (c == '\t' && usetab())
return selfinsert(args);
else
@@ -301,6 +308,7 @@
{
usemenu = !!isset(MENUCOMPLETE);
useglob = isset(GLOBCOMPLETE);
+ wouldinstab = 0;
return docomplete(COMP_LIST_EXPAND);
}
@@ -308,6 +316,7 @@
mod_export int
reversemenucomplete(char **args)
{
+ wouldinstab = 0;
if (!menucmp)
return menucomplete(args);
@@ -319,6 +328,7 @@
int
acceptandmenucomplete(char **args)
{
+ wouldinstab = 0;
if (!menucmp)
return 1;
runhookdef(ACCEPTCOMPHOOK, NULL);
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-05-22 14:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-22 14:44 Sven Wischnowsky [this message]
2000-05-22 16:52 ` Bart Schaefer
-- strict thread matches above, loose matches on Subject: below --
2000-05-31 9:53 Sven Wischnowsky
2000-05-25 7:57 Sven Wischnowsky
2000-05-25 15:20 ` Bart Schaefer
2000-05-22 11:25 Sven Wischnowsky
2000-05-22 14:27 ` 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=200005221444.QAA20403@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).