Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Methods of shadowing a builtin call
- X-seq: zsh-users 21202
 
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
 
- To: Zsh Users <zsh-users@xxxxxxx>
 
- Subject: Methods of shadowing a builtin call
 
- Date: Fri, 29 Jan 2016 22:33:39 +0100
 
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20120113;        h=mime-version:from:date:message-id:subject:to:content-type;        bh=tMOD/JX+KuCzwaGLOpIBidq2tHB/iPRXgsM5fPXr85Q=;        b=D+nEGNkwPN51U7VjBgyW0tn9zhQ6bJ6wE2xMywrJdt1xnDCqkQV94mim7spVcoCwIe         rbwiExFAm6EUQZ/Lmc6AYtoiP4X+G2Nd+kvzE8XuOF+GmABWDyeBCSA5RhpfAbQOK06A         o2vFZcfB4bfxvXW28HK4mR4lN5mrw16E4DVGxE09B1IN4yBOfk4EoFCZT8typJ246uWM         kpfqGHj4p+HCujrsbnXRJC0KCU6ci7nLE6zr3Mx8wz2FlNsy0noR0r+0m4lMQcCEum7I         oY5k9vgftplCeHEsUOykoc2r2HbiNS51aJCjo8j7rYKYsVpBXWnEiOcsnvqcMjIZiv4R         qmzA==
 
- List-help: <mailto:zsh-users-help@zsh.org>
 
- List-id: Zsh Users List <zsh-users.zsh.org>
 
- List-post: <mailto:zsh-users@zsh.org>
 
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
 
Hello,
I shadow setopt to gather data of what is being done in sourced
script. I currently use alias setopt=--setopt-shadow and then source a
script. This works fine except for z-sy-h. For that project, when I
source it with the alias being in place, interiors of it then still
use the shadowing function during their later operations. How to
suppress this? Self-insert is in some way catched by z-sy-h, and each
keypress invokes my shadowing function.
When I change:
    alias setopt=--shadow-setopt
to:
    setopt() { --shadow-setopt "$@" }
then Zsh segfaults. I'm not sure if on OS X gdb gives meaningful
output, but this is the backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x00000001000184e4 in execrestore ()
(gdb) bt
#0  0x00000001000184e4 in execrestore ()
#1  0x00000001000135c4 in execlist ()
#2  0x0000000100012c27 in execlist ()
#3  0x0000000100012818 in execode ()
#4  0x0000000100016be2 in runshfunc ()
#5  0x0000000100016540 in doshfunc ()
#6  0x0000000100017ca6 in execrestore ()
#7  0x000000010001c031 in execrestore ()
#8  0x00000001000135c4 in execlist ()
#9  0x0000000100012d84 in execlist ()
#10 0x000000010003efae in execif ()
...
How to explain the segfault?
Is there any third method of attaching to setopt?
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author