zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion
@ 1999-02-21 18:40 Matt Armstrong
  1999-02-21 19:50 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Armstrong @ 1999-02-21 18:40 UTC (permalink / raw)
  To: zsh-workers

>From: "Bart Schaefer" <schaefer@brasslantern.com>
>On Feb 20, 10:47pm, Matt Armstrong wrote:
>} Subject: PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion
>}
>} We probably want to defeat TRAPZERR within the new completion
>} stuff.
>
>Possibly so, but it ought to be done on entry into the 
>main completion function and undone again before returning.


Hmm, I thought Functions/Complete/_main_complete was the main
completion function.  Where is it?

As far as restoring it, Do'h!  I thought I tested that, but obviously 
not.  Is there an easy way to bind a function to a different name and
restore it?  I've tried games with stuff like foo=$(functions TRAPZERR) 
... eval $foo, but that seems suboptimal.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


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

* Re: PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion
  1999-02-21 18:40 PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion Matt Armstrong
@ 1999-02-21 19:50 ` Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 1999-02-21 19:50 UTC (permalink / raw)
  To: Matt Armstrong, zsh-workers

On Feb 21, 10:40am, Matt Armstrong wrote:
} Subject: Re: PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion
}
} As far as restoring it, Do'h!  I thought I tested that, but obviously 
} not.  Is there an easy way to bind a function to a different name and
} restore it?  I've tried games with stuff like foo=$(functions TRAPZERR) 
} ... eval $foo, but that seems suboptimal.

You can do

zsh% eval newname "$(functions oldname)"
zsh% oldname() { ...  }
zsh% eval oldname "$(functions newname)"
zsh% unfunction newname

as long as newname is unique and oldname isn't awaiting autoload.

For traps, if you use the "trap" builtin instead of a TRAPxxx() function,
the trap is automatically removed at the end of the local scope.  That
does not restore any outer-scope traps, though (global-scope TRAPxxx() is
deleted by local-scope "trap ... xxx" commands).

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


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

* Re: PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion
  1999-02-21  6:47 Matt Armstrong
@ 1999-02-21 12:59 ` Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 1999-02-21 12:59 UTC (permalink / raw)
  To: zsh-workers

On Feb 20, 10:47pm, Matt Armstrong wrote:
} Subject: PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion
}
} We probably want to defeat TRAPZERR within the new completion stuff.

Possibly so, but it ought to be done on entry into the main completion
function and undone again before returning.

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


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

* PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion
@ 1999-02-21  7:19 Matt Armstrong
  0 siblings, 0 replies; 5+ messages in thread
From: Matt Armstrong @ 1999-02-21  7:19 UTC (permalink / raw)
  To: zsh-workers

We probably want to defeat TRAPZERR within the new
completion stuff.  Mine just prints "That didn't work",
which isn't desirable during completion.

I'm not sure about the other special functions.



*** Functions/Completion/_main_complete.orig    Sat Feb 20 22:36:32 1999
--- Functions/Completion/_main_complete Sat Feb 20 22:33:20 1999
***************
*** 10,15 ****
--- 10,18 ----
  setopt localoptions nullglob rcexpandparam globdots
  unsetopt markdirs globsubst shwordsplit nounset
  
+ function TRAPZERR () {
+ }
+ 
  # An entry for `-first-' is the replacement for `compctl -T'
  # Completion functions may set `COMPSKIP' to any value to make the 
  # main loops stop calling other completion functions.


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


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

* PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion
@ 1999-02-21  6:47 Matt Armstrong
  1999-02-21 12:59 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Armstrong @ 1999-02-21  6:47 UTC (permalink / raw)
  To: zsh-workers

We probably want to defeat TRAPZERR within the new
completion stuff.  Mine just prints "That didn't work",
which isn't desirable during completion.

I'm not sure about the other special functions.



*** Functions/Completion/_main_complete.orig    Sat Feb 20 22:36:32 1999
--- Functions/Completion/_main_complete Sat Feb 20 22:33:20 1999
***************
*** 10,15 ****
--- 10,18 ----
  setopt localoptions nullglob rcexpandparam globdots
  unsetopt markdirs globsubst shwordsplit nounset
  
+ function TRAPZERR () {
+ }
+ 
  # An entry for `-first-' is the replacement for `compctl -T'
  # Completion functions may set `COMPSKIP' to any value to make the 
  # main loops stop calling other completion functions.


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


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

end of thread, other threads:[~1999-02-21 20:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-21 18:40 PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion Matt Armstrong
1999-02-21 19:50 ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
1999-02-21  7:19 Matt Armstrong
1999-02-21  6:47 Matt Armstrong
1999-02-21 12:59 ` Bart Schaefer

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