zsh-users
 help / color / mirror / code / Atom feed
* Re: Two Questions
       [not found] <20040302104703.GC1981@puritan.pcp.ath.cx>
@ 2004-03-02 10:58 ` Peter Stephenson
  2004-03-02 11:07   ` Nikolai Weibull
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2004-03-02 10:58 UTC (permalink / raw)
  To: Zsh users list

Nikolai Weibull wrote:
> Question 1
> ----------
> 
> How do I post to zsh-users as I am only subscribed to this list and thus
> need to confirm my emails to zsh-users?  Is the only way to work with it
> to confirm?  Since the lists are nested, subscribing to both is not very
> good.

You only need to confirm once.  It just happens to be separately for
each list.

> Question 2
> ----------
> 
> This should have gone to zsh-users but still.  Is there any way to
> disable equals completion (the -equals- context)?  Since I have noequals
> set it's rather silly to have the completion system trying to expand it.
> I tried figuring out a way to check for '-o equals' somewhere but didn't
> come up with anything decent.

compdef -d -- -equal-

If you have magicequalsubst set it will still try to perform default
completion after an `='.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Two Questions
  2004-03-02 10:58 ` Two Questions Peter Stephenson
@ 2004-03-02 11:07   ` Nikolai Weibull
  2004-03-02 11:14     ` Nikolai Weibull
  0 siblings, 1 reply; 6+ messages in thread
From: Nikolai Weibull @ 2004-03-02 11:07 UTC (permalink / raw)
  To: Zsh users list

* Peter Stephenson <pws@csr.com> [Mar 02, 2004 12:00]:

> > [question about posting to both lists]

> You only need to confirm once.  It just happens to be separately for
> each list.

Aha, thanks.  That is reasonable enough.

> > [disabling -equal- context]

> compdef -d -- -equal-

Great, thanks!
	nikolai

--
::: name: Nikolai Weibull    :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Two Questions
  2004-03-02 11:07   ` Nikolai Weibull
@ 2004-03-02 11:14     ` Nikolai Weibull
  2004-03-02 11:33       ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Nikolai Weibull @ 2004-03-02 11:14 UTC (permalink / raw)
  To: Zsh users list

* Nikolai Weibull <zsh-users-list@pcppopper.org> [Mar 02, 2004 12:09]:
> > > [disabling -equal- context]
>
> > compdef -d -- -equal-
>
> Great, thanks!

Sorry for responding before actually testing, but after testing it
proves to be insufficient.  It simply ignores the = on the command line
now, restarting all completion instead of taking the = into account.
Say I have a directory with the file
	=README
in it (yes this is an Arch managed source tree) that I want to read with
vim. I thus type
	% vim =<tab>
which simply lists
	\=README
under 'files'.
Is there any way to solve this?  I mean, I'm glad my =<tab> doesn't
expand to thousands of commands, but it's still not that great.
	nikolai

--
::: name: Nikolai Weibull    :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Two Questions
  2004-03-02 11:14     ` Nikolai Weibull
@ 2004-03-02 11:33       ` Peter Stephenson
  2004-03-02 11:48         ` Nikolai Weibull
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2004-03-02 11:33 UTC (permalink / raw)
  To: Zsh users list

Nikolai Weibull wrote:
> Sorry for responding before actually testing, but after testing it
> proves to be insufficient.  It simply ignores the = on the command line
> now, restarting all completion instead of taking the = into account.
> Say I have a directory with the file
> 	=README
> in it (yes this is an Arch managed source tree) that I want to read with
> vim. I thus type
> 	% vim =<tab>
> which simply lists
> 	\=README
> under 'files'.

This seems to be a fully paid up bug...  I think it's simply that
this chunk in _main_complete isn't testing for the option before
trying to make `=' special.  (Leading `=' should now work regardless
of magicequalsubst --- it seems that's already smart enough to match
a non-leading `='.)

Index: Completion/Base/Core/_main_complete
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Core/_main_complete,v
retrieving revision 1.8
diff -u -r1.8 _main_complete
--- Completion/Base/Core/_main_complete	1 Aug 2003 16:29:21 -0000	1.8
+++ Completion/Base/Core/_main_complete	2 Mar 2004 11:24:04 -0000
@@ -57,7 +57,7 @@
 # Special completion contexts after `~' and `='.
 
 if [[ -z "$compstate[quote]" ]]; then
-  if compset -P 1 '='; then
+  if [[ -o equals ]] && compset -P 1 '='; then
     compstate[context]=equal
   elif [[ "$PREFIX" != */* && "$PREFIX[1]" = '~' ]]; then
     compset -p 1

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Two Questions
  2004-03-02 11:33       ` Peter Stephenson
@ 2004-03-02 11:48         ` Nikolai Weibull
  0 siblings, 0 replies; 6+ messages in thread
From: Nikolai Weibull @ 2004-03-02 11:48 UTC (permalink / raw)
  To: Zsh users list

* Peter Stephenson <pws@csr.com> [Mar 02, 2004 12:40]:
> > [= not being taken into account]
>
> This seems to be a fully paid up bug...  I think it's simply that
> this chunk in _main_complete isn't testing for the option before
> trying to make `=' special.  (Leading `=' should now work regardless
> of magicequalsubst --- it seems that's already smart enough to match
> a non-leading `='.)
>
> Index: Completion/Base/Core/_main_complete
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Completion/Base/Core/_main_complete,v
> retrieving revision 1.8
> diff -u -r1.8 _main_complete
> --- Completion/Base/Core/_main_complete	1 Aug 2003 16:29:21 -0000	1.8
> +++ Completion/Base/Core/_main_complete	2 Mar 2004 11:24:04 -0000
> @@ -57,7 +57,7 @@
>  # Special completion contexts after `~' and `='.
>
>  if [[ -z "$compstate[quote]" ]]; then
> -  if compset -P 1 '='; then
> +  if [[ -o equals ]] && compset -P 1 '='; then
>      compstate[context]=equal
>    elif [[ "$PREFIX" != */* && "$PREFIX[1]" = '~' ]]; then
>      compset -p 1

Aw nice.  This was what I tried doing, but I did
  if compset -P 1 '=' && [[ -o equals ]]; then
instead (and I hadn't done the compdef from the previous mail either).

Works like a charm, thanks!
	nikolai

--
::: name: Nikolai Weibull    :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Two questions
@ 1998-01-27 15:06 Bernd Eggink
  0 siblings, 0 replies; 6+ messages in thread
From: Bernd Eggink @ 1998-01-27 15:06 UTC (permalink / raw)
  To: zsh mailing list

1. The manual says that array elements are numbered beginning with 1
unless the KSH_ARRAYS option is set. But actually array[0] works fine
and seems to be a synonym for array[1]. Bug or feature? This has the
great disadvantage that you cannot rely on "$array[i,j]" always being
empty if j < i.

2. There is an inconsistency in the behavior of the expression

   ${a:h}

which is said to give the "head" of $a. If a=x/y/z, the result is x/y;
but if a=x, the result is x. My understanding of "head" is that the
result in the latter case should be empty. Again: Bug or feature?

Regards,
	Bernd

-- 
Bernd Eggink
Regionales Rechenzentrum der Universitaet Hamburg
eggink@rrz.uni-hamburg.de
http://www.rrz.uni-hamburg.de/eggink/BEggink.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-03-02 11:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20040302104703.GC1981@puritan.pcp.ath.cx>
2004-03-02 10:58 ` Two Questions Peter Stephenson
2004-03-02 11:07   ` Nikolai Weibull
2004-03-02 11:14     ` Nikolai Weibull
2004-03-02 11:33       ` Peter Stephenson
2004-03-02 11:48         ` Nikolai Weibull
1998-01-27 15:06 Two questions Bernd Eggink

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).