zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>,
	zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: tag aliases
Date: Fri, 24 Mar 2000 17:48:11 +0000	[thread overview]
Message-ID: <1000324174811.ZM25159@candle.brasslantern.com> (raw)
In-Reply-To: <200003221256.NAA16720@beta.informatik.hu-berlin.de>

On Mar 22,  1:56pm, Sven Wischnowsky wrote:
} Subject: PATCH: tag aliases
}
} The idea is to let users invent their own tags. This is done with the
} tag-order style, the syntax is currently:
} 
}   zstyle ':completion:...' tag-order 'foo:bar'
} 
} Here, `foo' is the tag offered by the completion function and `bar' is 
} the alias. Completion will then proceed as if only `foo' were given,
} i.e. the matches for that tag are generated. BUT: instead of using
} `foo' to look up style, the function will use `bar'.

I wish there were a better word for this than "alias".  "Label"?

I don't have any strong opinions on the rest of the stuff that Sven's
already implemented (10230, 10231) except to agree about not wanting
any other nested loops introduced into the process.

} And finally: Bart and I had this bit of discussion about changing the
} completer field to always contain the `-<num>' suffix. And we didn't
} like it. [...] We could make the completer style allow an alias-syntax
} like the one from tag-order, too.
} 
}   zstyle ':completion:*' completer complete ... complete:foo
} 
} The first invocation of _complete would use the usual
} `...:complete:...' in the context name but the second one would use
} `...:foo:...' in the completer field.

This would best be combined with the change you posted in 10231 so
that it became

    zstyle ':completion:*' completer complete ... complete:-foo

so the second call to _complete would use "...:complete-foo:...".

} I would then first change the style
} so that one doesn't need to give the leading underscores

Incidentally,I don't mind having the leading underscores on the
completer function names in those styles.  It makes it easier to see
which arguments are tag names and which ones are function names.  Yes,
there's only really one tag name, but ...

} Anyway... I'd like to hear your comments, suggestions and so
} on. Especially about the configuration stuff, but also about the
} syntax of the tag-order and file-patterns styles, about the names of
} the two new functions (yes, I didn't even try to make them sensible
} because I wasn't sure what I was implementing when I started it), and
} so on...

The only thing I'd suggest about the names of the functions is that they
should be less generic; _loop_tags and _try_aliases (or _try_labels if
that's a better word for the whole concept, since we already have other
things called aliases that it's possible to complete ...).  Naming is
especially important when --enable-function-subdirs is not used.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  parent reply	other threads:[~2000-03-24 17:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-22 12:56 Sven Wischnowsky
2000-03-23  8:49 ` Andrej Borsenkow
2000-03-23  8:55 ` Andrej Borsenkow
2000-03-24 17:48 ` Bart Schaefer [this message]
2000-03-22 14:36 Sven Wischnowsky
2000-03-23  8:13 Sven Wischnowsky
2000-03-23  8:57 Sven Wischnowsky
2000-03-23  9:00 Sven Wischnowsky
2000-03-23 12:55 Sven Wischnowsky
2000-03-24 12:28 Sven Wischnowsky
2000-03-27 11:58 Sven Wischnowsky
2000-03-27 16:54 ` 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=1000324174811.ZM25159@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=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).