zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: compset -q oddities
Date: Wed, 14 Sep 2016 20:08:06 -0700	[thread overview]
Message-ID: <160914200806.ZM32432@torch.brasslantern.com> (raw)
In-Reply-To: <67318.1473882755@hydra.kiddle.eu>

On Sep 14,  9:52pm, Oliver Kiddle wrote:
} Subject: Re: compset -q oddities
}
} Bart wrote:
} > } That's a bit tricky.  I think it should append an escaped space, e.g.,
} > } "sh -c touc<TAB>" should append <h> <Backslash> <Space>.
} >
} > No, that's *exactly* the kind of DWIM-ing that we abandoned.  If the user
} > wants the space quoted, then he should start with "sh -c 'touc<TAB>".
} 
} For this specific case, I don't entirely agree because in theory the
} mechanics are in place for that to work.

Actually I think you *do* agree -- specifically, that the decision of
whether to quote the space is the responsibility of the completer, not
something that compset -q and compadd should always assume?

} compset -q appears to disable the default suffix that completions have:
} I'm not sure why. Any ideas?

Not offhand.

} Adding calls to compquote in every function that needs a suffix is
} not a good idea. With a code refactoring, perhaps the suffix could
} be quoted automatically but we'd need an option that makes it easier
} to indicate that quoting levels should be closed (accumulating them
} as completion functions call each other). And I'm not sure about
} prefixes.

I think you're just rehashing some of the reasons that we punted this.

} One other thing I notice in the code for compset -q is that it is
} a completely different function internally from that which does the
} initial word split when completion starts.

You're referring to set_comp_sep() ?  I think it's different because
it's simultaneously removing quoting and updating various positions
(pointers/indexes into the buffer), but I could easily be wrong.

} It'd be nice if vared could be used without the initial parse:
} variable values aren't necessarily shell syntax.

There are other cases where it would be helpful to be able to change
the notion of what a "word" is; I think it was Sebastian who wanted
to complete entire lines out of the history.  Trouble is, that means
either wrapper widgets to set up state, or a new class of completion
widgets that get the definition of a word from ... where?


  reply	other threads:[~2016-09-15  3:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-11  7:30 Daniel Shahaf
2016-09-12  2:14 ` Bart Schaefer
2016-09-12 23:06   ` Daniel Shahaf
2016-09-13  6:28     ` Bart Schaefer
2016-09-13 10:21       ` Peter Stephenson
2016-09-14 17:56         ` Bart Schaefer
2016-09-15  5:10           ` Daniel Shahaf
2016-09-16  0:40             ` Bart Schaefer
2016-09-16  3:05               ` [PATCH] Etc/BUGS: Remove fixed items, add 'compset -q' item from workers/39306 Daniel Shahaf
2016-09-16  5:00                 ` Bart Schaefer
2016-09-14  3:22       ` compset -q oddities Daniel Shahaf
2016-09-14  5:20         ` Bart Schaefer
2016-09-14  6:12           ` Daniel Shahaf
2016-09-14 14:59             ` Bart Schaefer
2016-09-14 19:52               ` Oliver Kiddle
2016-09-15  3:08                 ` Bart Schaefer [this message]
2016-09-14  8:31           ` Peter Stephenson
2016-09-14 16:04             ` 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=160914200806.ZM32432@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).