zsh-workers
 help / color / mirror / code / Atom feed
* RE: Completion services + xterm auto-margin revisited
@ 2001-02-22 13:01 Sven Wischnowsky
  0 siblings, 0 replies; 7+ messages in thread
From: Sven Wischnowsky @ 2001-02-22 13:01 UTC (permalink / raw)
  To: zsh-workers


Andrej Borsenkow wrote:

> > We came to the conclusion that this has to be handled `globally', not
> > only for completion lists.  Someone said he would have a look and I
> > promised to merge the things he would come up with with the completion
> > listing code.  Then we never heard about it again.
> 
> Hmm ... do you mean 7030, 7034 and related - (interesting are 7053, 7061)?

Seems like I thought about 7053, then (thanks for looking that up).

> Well, it was a knowhow of Geoff (I still shudder when looking at refresh
> code). May be somebody else will have enough courage to plunge into it.

I've had my fingers in it sometimes, but I don't dare to try to
tackle this.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* Re: Completion services + xterm auto-margin revisited
  2001-02-22 12:43 ` Andrej Borsenkow
@ 2001-02-22 13:41   ` Geoff Wing
  0 siblings, 0 replies; 7+ messages in thread
From: Geoff Wing @ 2001-02-22 13:41 UTC (permalink / raw)
  To: zsh-workers

Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru> typed:
:Well, it was a knowhow of Geoff (I still shudder when looking at refresh
:code).

It's commented.  Well, the variables mostly are.  And it understands
am (automargin) ... mostly.  I've been taking a quick look at the
completion printing stuff.  I presume the bits I should be looking
at are:  Zle/complist.c:compprintfmt() and compprintlist()

Peter Stephenson <pws@csr.com> typed:
:By the way, completion listing for `typeset -' seems to tickle a relative
:of an ancient bug with xterm auto-margin: one of the possible descriptions
:is exactly 80 characters, but doesn't cause wraparound since there's
:nothing to follow, and redisplaying the command line happens one line too
:high.

I have some vague memory of a discussion yonks ago (different to the
one referenced above, I think) about whether a newline should be printed
at the end of any list or such (hereafter I'm just calling them lists
but also refer to other outputs) - one point here is that all lists need
to be considered to have an extra line if the last line extends to the
right margin, especially for any comparisons with ``lines'' (term height)
so the top doesn't unexpectedly scroll off.  It's slightly ugly when the
list hits the bottom of the screen but I thought this happened.  Maybe
a couple of cases were missed.
Point is: if the last output line is term width then you should always
be printing "\n" (*) and presume an extra line in the calculations.

(*) it's safest for 99.9% of used terminals whether or not they're
    correctly reporting ``am'' capability (and if they're incorrectly
    reporting it they'll have other problems anyway)

Regards,
-- 
Geoff Wing : <gcw@pobox.com>
Rxvt Stuff : <gcw@rxvt.org>
Zsh Stuff  : <gcw@zsh.org>


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

* Re: Completion services + xterm auto-margin revisited
@ 2001-02-22 13:02 Sven Wischnowsky
  0 siblings, 0 replies; 7+ messages in thread
From: Sven Wischnowsky @ 2001-02-22 13:02 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> OK, how about this for now?

Yes, looks good.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* RE: Completion services + xterm auto-margin revisited
  2001-02-22 12:02 Sven Wischnowsky
  2001-02-22 12:14 ` Peter Stephenson
@ 2001-02-22 12:43 ` Andrej Borsenkow
  2001-02-22 13:41   ` Geoff Wing
  1 sibling, 1 reply; 7+ messages in thread
From: Andrej Borsenkow @ 2001-02-22 12:43 UTC (permalink / raw)
  To: Sven Wischnowsky, zsh-workers


>
> We came to the conclusion that this has to be handled `globally', not
> only for completion lists.  Someone said he would have a look and I
> promised to merge the things he would come up with with the completion
> listing code.  Then we never heard about it again.
>

Hmm ... do you mean 7030, 7034 and related - (interesting are 7053, 7061)?
Well, it was a knowhow of Geoff (I still shudder when looking at refresh
code). May be somebody else will have enough courage to plunge into it.

-andrej


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

* Re: Completion services + xterm auto-margin revisited
  2001-02-22 12:02 Sven Wischnowsky
@ 2001-02-22 12:14 ` Peter Stephenson
  2001-02-22 12:43 ` Andrej Borsenkow
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Stephenson @ 2001-02-22 12:14 UTC (permalink / raw)
  To: Zsh hackers list

> Maybe for now we should just make the description shorter?

OK, how about this for now?

Index: Completion/Builtins/_vars_eq
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_vars_eq,v
retrieving revision 1.7
diff -u -r1.7 _vars_eq
--- Completion/Builtins/_vars_eq	2000/05/16 09:55:55	1.7
+++ Completion/Builtins/_vars_eq	2001/02/22 12:13:16
@@ -6,8 +6,8 @@
 
 allargs=( \
   A '(-E -F -L -R -T -U -Z -a -f -i -m)-A[specify that arguments refer to associative arrays]' \
-  E '(-A -F -L -R -T -U -Z -a -f -i -m)-E[represent internally as floating point, use engineering notation on output]' \
-  F '(-A -E -L -R -T -U -Z -a -f -i -m)-F[represent internally as floating point, use fixed point decimal on output]' \
+  E '(-A -F -L -R -T -U -Z -a -f -i -m)-E[floating point, use engineering notation on output]' \
+  F '(-A -E -L -R -T -U -Z -a -f -i -m)-F[floating point, use fixed point decimal on output]' \
   L '(-A -E -F -f -i)-L+[left justify and remove leading blanks from value]:width' \
   R '(-A -E -F -f -i)-R+[right justify and fill with leading blanks]:width' \
   T '(-A -E -F -a -f -g -h -i -l -m -t)-T[tie scalar to array]' \
@@ -33,7 +33,7 @@
 
 use="AEFLRTUZafghilmrtux"
 
-case ${words[1]} in
+case ${service} in
   float) use="EFghlrtux";;
   functions)
     use="Umtu"

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


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

* Re: Completion services + xterm auto-margin revisited
@ 2001-02-22 12:02 Sven Wischnowsky
  2001-02-22 12:14 ` Peter Stephenson
  2001-02-22 12:43 ` Andrej Borsenkow
  0 siblings, 2 replies; 7+ messages in thread
From: Sven Wischnowsky @ 2001-02-22 12:02 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> I just updated the zsh guide at http://sunsite.dk/zsh/Guide/ thanks to some
> suggestions from Sven.  One of the new things that went in is some mention
> of `services':
> 
> compdef mycmd=cmd
> 
> where completion for mycmd is supposed to behave as closely as possible to
> that for cmd.
> 
> If I've got this right, this depends on the completion in question
> implementing any command-specific behaviour using the parameter $service.
> That would imply it's a good idea to alter some of the standard completions
> to use $service instead of $words[1].  This was prompted in particular by
> looking at _vars_eq --- if you do `compdef myexport=export', you probably
> want export arguments, not typeset ones.

I changed several of them at that time -- and that means it is quite
possible that I overlooked some (or at that time falsely thought that
those places shouldn't be changed).

> Is this correct?  It seems to work correctly in this case, and it's
> probably an easy set of changes but I thought I'd better ask.

Yes, that looks like one of the places, indeed.  Or maybe it was
changed to use _arguments after I first proposed the services-patch
and then I forgot to change it.

I think I should go through all places still using $words[1] again at
the weekend.  Hooray.

> By the way, completion listing for `typeset -' seems to tickle a relative
> of an ancient bug with xterm auto-margin: one of the possible descriptions
> is exactly 80 characters, but doesn't cause wraparound since there's
> nothing to follow, and redisplaying the command line happens one line too
> high.  There was a sizeable discussion about this once, but I've forgotten
> the punchline.  The new element here is that it only happens if the screen
> needs scrolling --- if the cursor is at the top of the screen, it works
> fine.

We came to the conclusion that this has to be handled `globally', not
only for completion lists.  Someone said he would have a look and I
promised to merge the things he would come up with with the completion 
listing code.  Then we never heard about it again.

Maybe for now we should just make the description shorter?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* Completion services + xterm auto-margin revisited
@ 2001-02-22 11:49 Peter Stephenson
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Stephenson @ 2001-02-22 11:49 UTC (permalink / raw)
  To: Zsh hackers list

I just updated the zsh guide at http://sunsite.dk/zsh/Guide/ thanks to some
suggestions from Sven.  One of the new things that went in is some mention
of `services':

compdef mycmd=cmd

where completion for mycmd is supposed to behave as closely as possible to
that for cmd.

If I've got this right, this depends on the completion in question
implementing any command-specific behaviour using the parameter $service.
That would imply it's a good idea to alter some of the standard completions
to use $service instead of $words[1].  This was prompted in particular by
looking at _vars_eq --- if you do `compdef myexport=export', you probably
want export arguments, not typeset ones.

Is this correct?  It seems to work correctly in this case, and it's
probably an easy set of changes but I thought I'd better ask.

By the way, completion listing for `typeset -' seems to tickle a relative
of an ancient bug with xterm auto-margin: one of the possible descriptions
is exactly 80 characters, but doesn't cause wraparound since there's
nothing to follow, and redisplaying the command line happens one line too
high.  There was a sizeable discussion about this once, but I've forgotten
the punchline.  The new element here is that it only happens if the screen
needs scrolling --- if the cursor is at the top of the screen, it works
fine.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


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

end of thread, other threads:[~2001-02-22 13:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-22 13:01 Completion services + xterm auto-margin revisited Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2001-02-22 13:02 Sven Wischnowsky
2001-02-22 12:02 Sven Wischnowsky
2001-02-22 12:14 ` Peter Stephenson
2001-02-22 12:43 ` Andrej Borsenkow
2001-02-22 13:41   ` Geoff Wing
2001-02-22 11:49 Peter Stephenson

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