Commit Graph

5 Commits

Author SHA1 Message Date
Eric Nielsen ae133abca9 Compile functions.zwc for each functions directory
instead of a big single `functions.zwc` file containing functions from
all the `functions` subdirectories.

This solution here better suits the functions autoloading mechanism in
zsh, as documented in
http://zsh.sourceforge.net/Doc/Release/Functions.html#index-autoloading-functions

Given `~/.zim/modules/foo/functions` is in the `fpath`, autoload looks
for functions in the following files, picking the **newest one** in this
order:
* `~/.zim/modules/foo/functions.zwc`, which should contain all
  functions in the directory named `functions`
* `~/.zim/modules/foo/functions/function.zwc`
* `~/.zim/modules/foo/functions/function`

With this approach, we're also having individual entries back in `fpath`
for the `functions` subdirectory of each enabled module (as was the case
before commit 55df5a4).

This is also probably closest to the original plan at #86. The current
code was not compiling "*all* files in a folder into a single digest",
but instead compiling *all* files in *all* the functions folders into a
single digest, which was a bad idea. This commit fixes this.

Fixes #231. Fixes #232. Closes #234.

Closes #239
2018-01-08 11:56:18 -05:00
Eric Nielsen 3c96d0b8e1 Revert "Also zrecompile functions starting with _"
This reverts commit 07d32caaae.

Now I get the intention of not zcompiling or autoloading functions whose
names start with `_` or `.`: these are indented to be used by the com-
pletion system and dumped into the `.zcompdump ` file.

See
http://zsh.sourceforge.net/Doc/Release/Completion-System.html#index-compinit
2018-01-03 11:48:52 -05:00
Eric Nielsen 07d32caaae Also zrecompile functions starting with _
This was causing issues with https://github.com/jocelynmallon/zshmarks,
that has a `functions/_jump_showmarks_deletemarks` file.

Fixes #231
2018-01-02 12:27:05 -05:00
Eric Nielsen e4e0c55ef3 Ignore *.zwc.old files when compiling functions
These files are generated by `zrecompile`.

Also update the .gitignore file.

Closes #218
2017-11-24 19:08:39 -05:00
Eric Nielsen fc84b645e9 [template] Move templates/zlogin to login_init.zsh
so it's not a template anymore and can be under version control, instead
of being manually updated by the user, as currently is the case with
`~/.zlogin` and `${ZIM_HOME}/templates/zlogin`.

Closes #218
2017-11-24 19:08:25 -05:00
Renamed from templates/zlogin (Browse further)