Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A serious bug in execution – where to debug?
- X-seq: zsh-workers 44615
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: A serious bug in execution – where to debug?
- Date: Tue, 30 Jul 2019 22:18:31 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=mime-version:message-id:in-reply-to :references:date:from:to:subject:content-type :content-transfer-encoding; s=fm3; bh=VIlP+JAEUOcGCzHKr5q9h90yZG Bhb9a4kcpBZfwtti8=; b=X3pnEQtEqAOUwiegCIjpKMvTrAkuT7fZbRb+nfZKqH /6dzhyM5NqUrVm/9DS1uqYSi2v6mtaWYo1aU90JmERlolsCHwP618dwVTsm2GBrz usy2yOfO4V7trR7kemIPJeIHHi2AjtsqgFVFiS5TMVoVzySv11H+GWN/G9qfGn4j ysjRW8FG9xESsRw8pJLA3LS5WYjMwcFYtiFgs0r+Azz9lIHEyzxTIBhHj8t4NwHx cMpDQyXtWr1csRGVoE+ewIxCGdIuqtAQgBrdxwOoeiVEgang9QXTtmCpqD7XanwN Brn2CW50/RaL0eJiR6AdD8O/K5M471Ah2GDBJ2W0JJUw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=VIlP+JAEUOcGCzHKr5q9h90yZGBhb9a4kcpBZfwtt i8=; b=gLFQEw9lZQaF1utgNZCR2EifW23dFLHoTnAoAXkYSbv0h1mWB54ERTGIC kbLUoQGNhKOA3lcj+QKLr99Seu3NfKgpVnjpkYBAextcj49o5CXUfsD9oit7BVgm XEm6Bv47lAI8IBoRCN2AlWnG/QN+PwG6eHP+37prcWPIRO40t7VEWGfppOJ8I1tT aiT3idFwmthCsA088WGa9bnwzz2InvE3khdoQjUkFutn7ZuSGgCaQeKhgBp7ia51 bY09PYuOH6xzRtE7jFHTyNNxSsa6+x6JNDoC1F4rjzSoh9h5JQfgJOxp23lNhs02 m7jnam68RLDoHqCTV/WyDhmCHk6bA==
- In-reply-to: <CAN=4vMo2-w8qEdsgWwZ5C3WE+ZRmBa-c2BxjpZ7NWpvNq_J2tQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCKrg_PnZ6jKLoAwR8XQnswT-Bs2TJA7oefhd_gRtHKUQ@mail.gmail.com> <CAH+w=7ZEukuvaOiBymgJ1nR1TbriEMSxx9L8-=hojxQoKOaRUw@mail.gmail.com> <CAKc7PVCbP5inrfFW3xiphBN5uH3o3ayVRnzzEbybfkp-Y5Fubw@mail.gmail.com> <CAN=4vMqkjK5hPxhhXYwp=4Sj49VfyZgEH06tK0vggnHyddbrsA@mail.gmail.com> <CAKc7PVC6vxkHRvRSQzPGxgOXLOMc-LyJaqA5DmsLXQ5tU8y3Hw@mail.gmail.com> <CAN=4vMo2-w8qEdsgWwZ5C3WE+ZRmBa-c2BxjpZ7NWpvNq_J2tQ@mail.gmail.com>
Roman Perepelitsa wrote on Tue, 30 Jul 2019 21:46 +00:00:
> You should call `emulate -L zsh` from every functions that can be
> called by any code other than yours. It's almost impossible to write
> code that works the same way with all combinations of options. In my
> public code I also unset aliases. These defensive measures reduce the
> number of bug reports by *a lot*. People really seem to like creating
> global aliases with single-letter names.
z-sy-h also does 'emulate -L' and unsets aliases. I wonder if there
should be a built-in way to do this, in order to make it easier to write
plugins? Perhaps a «source -U foo.zsh» syntax, as in autoload?
> I'll probably start calling `disable -f` for all builtins I use.
I wonder if you might be throwing the baby out with the bathwater here.
Aren't there legitimate use-cases for writing shadowing functions? For
example, what if somebody does «zle() { typeset -p funcstack >&2; zle "$@" }»
for debugging purposes?
(And yes, I'm aware compsys and z-sy-h both use 'command' and 'builtin' in places..)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author