zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
Cc: zsh-workers@sunsite.auc.dk
Subject: Parameters, disable, modules (Re: Self-loading auto-functions)
Date: Mon, 25 Oct 1999 15:15:41 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.20.9910251447560.14171-100000@aztec.zanshin.com> (raw)
In-Reply-To: <199910250953.LAA05339@beta.informatik.hu-berlin.de>

On Mon, 25 Oct 1999, Sven Wischnowsky wrote:

> I've fiddled with `parameter.c' a lot over the weekend, adding
> parameters for the `compgen'-replacement. There I made `functions'
> prepend a `<disabled>' prefix to report disabled shell functions (and
> the same string in other parameters).

Waitaminute.  "functions" doesn't output ANYTHING for disabled functions;
it acts as if they don't exist, and you can't get to them via $functions.  
Did you really change that?

Same goes for aliases, etc.

Disable doesn't work very well on functions anyway; all you have to do
is redefine one to re-enable it:

zagzig[27] fnord() { echo foo }
zagzig[28] disable -f fnord
zagzig[29] fnord           
zsh: command not found: fnord
zagzig[30] fnord() { echo foo }
zagzig[31] fnord
foo
zagzig[32] 

Oh, by the way:  autoload +X will happily (re)load the definition for a
disabled function, causing it to become enabled again.  That was not an
intended side-effect, and I rather suspect that both the example above
and this +X side-effect are doing bad things to the hash table internals.

> While I'm at it: does anyone have an idea how we can make the
> parameter module report stuff about zle widgets and keymaps?

Introduce a registry:  A hash table mapping strings with a well-defined
syntax to function pointers with a corresponding call signature.  The zle
module registers its function pointers and the parameters module looks
them up, and vice-versa.  A fallback of some sort is used by each when it
doesn't find the other.

There are some obscure architectures where you can't cast a function
pointer to (void *) and back and so this wouldn't work, but they probably
can't deal with dynamic loading anyway.


      parent reply	other threads:[~1999-10-25 22:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-25  9:53 PATCH: 3.1.6-bart-7: Self-loading auto-functions Sven Wischnowsky
1999-10-25 10:27 ` Zefram
1999-10-25 22:15 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.20.9910251447560.14171-100000@aztec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).