zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
To: zsh-workers@sunsite.auc.dk
Subject: Style mechanism discussion
Date: Thu, 09 Dec 1999 23:47:19 +0000	[thread overview]
Message-ID: <E11wDGb-0001NN-00.1999-12-09-23-46-33@mail12.svr.pol.co.uk> (raw)
In-Reply-To: "Sven Wischnowsky"'s message of "Thu, 09 Dec 1999 11:35:41 +0100." <199912091035.LAA18636@beta.informatik.hu-berlin.de>

Sven Wischnowsky wrote:
> Another question is whether we should at least try to group the styles 
> in some sensible way. Probably even using subsections. Opinions?

As long as they've got obvious names, I don't think it matters.  Calling
things e.g. section.foo and section.bar is only better than foo and bar if
section is really adding to the information, and even in that case it's
probably easier just to change the name to section_foo and section_bar ---
I don't think use of different namespaces is really necessary here.  Unless
I've missed the point of this.

> The completion code would use names of the form `:completion:...' and
> stuffing that `:completion' in front would be the main task of
> `compstyle'. If styles are used elsewhere, they would use different
> prefixes (`:prompt'? `:zftp'?)

These sound like good possibilities.  Maybe we could even have our
long-awaited improved interface to shell options via an `:option' set of
styles.  But we would need to keep the current option interface, too: it
would be a very nasty change otherwise and make zsh completely unlike other
shells.  This would limit the behaviour of the new interface just to be a
front-end to option setting.  Even that's probably quite useful.

> and probably their own *style functions 
> unless we decide to only use the builtin (i.e. all styles, independent 
> of the package-prefix) everywhere -- then compstyle would/could/should
> be removed, too.

Perhaps it's easiest just to have zstyle and specify the utility
explicitly, i.e.

  zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}

etc., avoiding proliferating commands of any kind.  As long as the styles
don't overlap between utilities, the `:completion' is redundant with the
`*' already in front; and if styles do overlap between utilities, we should
probably try and make them do consistent things anyway.  For example, the
host/user name styles in completion could probably be re-used in zftp.

Of course, you would need to be careful to make sure things like

  compstyle ':(correct(|-word)|approximate)' accept '2n'

got converted properly, putting :completion in front.  Maybe there's a way
of making the behaviour of the tags hierarchy more transparent, but I don't
see it since it's different in different contexts (which is really exactly
why it's there).

-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>


  reply	other threads:[~1999-12-09 23:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-09 10:35 PATCH: cleanup Sven Wischnowsky
1999-12-09 23:47 ` Peter Stephenson [this message]
1999-12-10  1:06   ` Style mechanism discussion Bart Schaefer
1999-12-10  8:07 Sven Wischnowsky

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=E11wDGb-0001NN-00.1999-12-09-23-46-33@mail12.svr.pol.co.uk \
    --to=pws@pwstephenson.fsnet.co.uk \
    --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).