zsh-workers
 help / color / mirror / code / Atom feed
* "functions -c" and TRAPxxx
@ 2022-06-07  1:59 Bart Schaefer
  2022-06-07  9:57 ` Peter Stephenson
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2022-06-07  1:59 UTC (permalink / raw)
  To: Zsh hackers list

I'm not feeling quite knowledgeable enough about settrap /
removetrapnode vis-a-vis reference counting to offer a patch for this
yet, so if someone else wants to jump in or educate me, please do.

Creating a TRAPxxx function by "aliasing" to another function with
"functions -c" does not create the expected trap handler.

% TRAPUSR1() { print $0 }
% functions -c TRAPUSR1 TRAPUSR2
% trap
TRAPUSR1 () {
    print $0
}
% functions -m TRAP\*
TRAPUSR1 () {
    print $0
}
TRAPUSR2 () {
    print $0
}
%

Aside:  Local trap handling in _main_complete confuses trap-name completion:

% compinit
% zstyle '*' format %d
% trap
% functions -c TRAP<TAB>
old name
TRAPINT   TRAPQUIT

I don't know that we can do anything about this, I just found it
briefly confusing.


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

end of thread, other threads:[~2022-06-09 20:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-07  1:59 "functions -c" and TRAPxxx Bart Schaefer
2022-06-07  9:57 ` Peter Stephenson
2022-06-07 14:57   ` Bart Schaefer
2022-06-09  3:24     ` Bart Schaefer
2022-06-09  8:55       ` Peter Stephenson
2022-06-09 15:19         ` Bart Schaefer
2022-06-09 20:51           ` Bart Schaefer

Code repositories for project(s) associated with this 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).