Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug with emulation in completion?



On Nov 24,  8:33pm, Peter Stephenson wrote:
}
} It might be more useful to apply the stickiness to any function which
} wasn't part of the normal completion system and needed e.g. ksh
} emulation.

Unfortunately what he wants to do is call zsh-mode functions from the
ksh-mode functions.  Unless we screw with the dynamic inheritence model
[change stickyness rule #2 from the doc] so that the emulation mode is
cleared when calling out to a function that does not have the equivalent
stickyness -- something I'm loathe to advocate, for a number of reasons
-- it's not really an option to make the ksh functions sticky.

I suppose we could add another option or the like to "emulate" that has
the effect of resetting the option state as if the current function had
returned.  E.g.,

  some_function () {
    : do something
  }
  zsh_function () {
    emulate -L zsh
    ksh_function
  }
  ksh_function () {
    emulate -L ksh
    : do some stuff
    emulate -c caller some_function # called as if from zsh_function
  }

Replace "-c caller" with -C or some other flag as you will, the above is
just for example.  But this gets into assorted questions such as whether
"-c caller" has any effect when localoptions is not [yet] set, etc.



Messages sorted by: Reverse Date, Date, Thread, Author