"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "TeXmacs/doc/devel/scheme/overview/overview-lazyness.en.tm" between
TeXmacs-1.99.8-src.tar.gz and TeXmacs-1.99.9-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

overview-lazyness.en.tm  (TeXmacs-1.99.8-src):overview-lazyness.en.tm  (TeXmacs-1.99.9-src)
<TeXmacs|1.99.4> <TeXmacs|1.99.8>
<style|tmdoc> <style|<tuple|tmdoc|old-spacing>>
<\body> <\body>
<tmdoc-title|The module system and lazy definitions> <tmdoc-title|The module system and lazy definitions>
As explained above, each <scheme> file inside <TeXmacs> or one of its As explained above, each <scheme> file inside <TeXmacs> or one of its
plug-ins corresponds to a <em|<TeXmacs> module>. The individual <TeXmacs> plug-ins corresponds to a <em|<TeXmacs> module>. The individual <TeXmacs>
modules are usually grouped together into an internal or external module, modules are usually grouped together into an internal or external module,
which corresponds to a directory on your hard disk. which corresponds to a directory on your hard disk.
Any <TeXmacs> module should start with an instruction of the form Any <TeXmacs> module should start with an instruction of the form
skipping to change at line 50 skipping to change at line 50
make the symbol publicly visible you should use <scm|tm-define> or make the symbol publicly visible you should use <scm|tm-define> or
<scm|tm-define-macro>. Currently, because of implementation details for the <scm|tm-define-macro>. Currently, because of implementation details for the
<hlink|contextual overloading system|overview-overloading.en.tm>, as soon <hlink|contextual overloading system|overview-overloading.en.tm>, as soon
as a symbol is declared to be public, it becomes visible inside all other as a symbol is declared to be public, it becomes visible inside all other
modules. However, you should not rely on this: in the future, explicit modules. However, you should not rely on this: in the future, explicit
importation with <scm|:use> might become<nbsp>necessary. importation with <scm|:use> might become<nbsp>necessary.
Because the number of <TeXmacs> modules and plug-ins keeps on growing, it Because the number of <TeXmacs> modules and plug-ins keeps on growing, it
is inefficient to load all modules when booting. Instead, initialization is inefficient to load all modules when booting. Instead, initialization
files are assumed to declare the provided functionality in a <em|lazy> way: files are assumed to declare the provided functionality in a <em|lazy> way:
whenever the functionality is explictly needed, <TeXmacs> is triggered to whenever the functionality is explicitly needed, <TeXmacs> is triggered to
load the corresponding modules (if this was not already done). In addition, load the corresponding modules (if this was not already done). In addition,
<TeXmacs> may load some of these modules during spare time, when the <TeXmacs> may load some of these modules during spare time, when the
computer is waiting for user input. Indeed, this helps increasing the computer is waiting for user input. Indeed, this helps increasing the
reactivity of <TeXmacs> at the first use of the functionality. reactivity of <TeXmacs> at the first use of the functionality.
For instance, assume that you defined a large new editing function For instance, assume that you defined a large new editing function
<scm|foo-action> inside the module <scm|(foo-edit)>. Then your <scm|foo-action> inside the module <scm|(foo-edit)>. Then your
initialization file <verbatim|init-foo.scm> would typically contain a line initialization file <verbatim|init-foo.scm> would typically contain a line
<\scm-code> <\scm-code>
skipping to change at line 87 skipping to change at line 87
has the important consequence that you can no longer make assumptions on has the important consequence that you can no longer make assumptions on
when a particular module is loaded. For instance, when you attempt to when a particular module is loaded. For instance, when you attempt to
redefine a keyboard shortcut in your personal initialization file, it may redefine a keyboard shortcut in your personal initialization file, it may
happen that the standard definition is loaded after your \Predefinition\Q. happen that the standard definition is loaded after your \Predefinition\Q.
In that case, your redefinition remains without consequence. In that case, your redefinition remains without consequence.
For this reason, <TeXmacs> also provides the instruction <scm|import-from> For this reason, <TeXmacs> also provides the instruction <scm|import-from>
to force a particular module to be loaded. Similarly, the commands to force a particular module to be loaded. Similarly, the commands
<scm|lazy-keyboard-force>, <scm|lazy-plugin-force>, <abbr|etc.> may be used <scm|lazy-keyboard-force>, <scm|lazy-plugin-force>, <abbr|etc.> may be used
to force all lazy keyboard definitions <abbr|resp.> plug-ins to be loaded. to force all lazy keyboard definitions <abbr|resp.> plug-ins to be loaded.
In other words, the use of lazyness forces to make implicit dependencies In other words, the use of laziness forces to make implicit dependencies
between modules more explicit. between modules more explicit.
In the case when you want to redefine keyboard shortcuts, the In the case when you want to redefine keyboard shortcuts, the
<hlink|contextual overloading system|overview-overloading.en.tm> gives you <hlink|contextual overloading system|overview-overloading.en.tm> gives you
an even more fine-grained control. For instance, assume that the keyboard an even more fine-grained control. For instance, assume that the keyboard
shortcut <key|x x x> has been defined twice, both in general and in math shortcut <key|x x x> has been defined twice, both in general and in math
mode. After calling <scm|lazy-keyboard-force> and overriding the general mode. After calling <scm|lazy-keyboard-force> and overriding the general
definition of the shortcut, the special definition will still take definition of the shortcut, the special definition will still take
precedence in math mode. Alternatively, you may redefine the keyboard precedence in math mode. Alternatively, you may redefine the keyboard
shortcut using shortcut using
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)