"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "TeXmacs/doc/devel/scheme/overview/overview-meta.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-meta.en.tm  (TeXmacs-1.99.8-src):overview-meta.en.tm  (TeXmacs-1.99.9-src)
<TeXmacs|1.0.7.16> <TeXmacs|1.99.8>
<style|tmdoc> <style|<tuple|tmdoc|old-spacing>>
<\body> <\body>
<tmdoc-title|Meta information and logical programming> <tmdoc-title|Meta information and logical programming>
Small software projects usually consist of a collection of routines and Small software projects usually consist of a collection of routines and
data. In a large software project, where a typical contributor has no data. In a large software project, where a typical contributor has no
complete overview of the program, it is a good practive to associate complete overview of the program, it is a good practice to associate
additional <em|meta-information> to the individual routines and data. This additional <em|meta-information> to the individual routines and data. This
meta-information typically serves documentation purposes, but becomes even meta-information typically serves documentation purposes, but becomes even
more interesting if it can be used in an automated fashion to implement more interesting if it can be used in an automated fashion to implement
more general additional functionality. more general additional functionality.
The <scm|tm-define> macro supports several options for associating The <scm|tm-define> macro supports several options for associating
meta-information to <scheme> functions and symbols. For instance, the meta-information to <scheme> functions and symbols. For instance, the
<scm|:synopsis>, <scm|:argument> and <scm|:returns> options allow you to <scm|:synopsis>, <scm|:argument> and <scm|:returns> options allow you to
associate short documentation strings to the function, its arguments and associate short documentation strings to the function, its arguments and
its return value: its return value:
skipping to change at line 39 skipping to change at line 39
\ \ (:returns "The square of @x") \ \ (:returns "The square of @x")
\ \ (* x x)) \ \ (* x x))
</scm-code> </scm-code>
This information is exploited by <TeXmacs> in several ways. For instance, This information is exploited by <TeXmacs> in several ways. For instance,
the synopsis of the function can be retrieved by executing <scm|(help the synopsis of the function can be retrieved by executing <scm|(help
square)>. More interestingly, assuming that we defined <scm|square> as square)>. More interestingly, assuming that we defined <scm|square> as
above, typing <shortcut|(interactive exec-interactive-command)> followed by above, typing <shortcut|(interactive exec-interactive-command)> followed by
<scm|square> and <shortcut|(kbd-return)> allows you to execute <scm|square> <scm|square> and <shortcut|(kbd-return)> allows you to execute <scm|square>
in an interactive way: you will be prompted for ``A number'' on the footer. in an interactive way: you will be prompted for \PA number\Q on the footer.
Moreover, after typing <shortcut|(interactive exec-interactive-command)>, Moreover, after typing <shortcut|(interactive exec-interactive-command)>,
you will be able to use ``tab-completion'' in order to enter <scm|square>: you will be able to use \Ptab-completion\Q in order to enter <scm|square>:
typing <key|s q u tab> will usually complete into<nbsp><scm|square>. typing <key|s q u tab> will usually complete into<nbsp><scm|square>.
In a similar vein, the <scm|:interactive> and <scm|:check-mark> options In a similar vein, the <scm|:interactive> and <scm|:check-mark> options
allow you to specify that a given routine requires interactive user input allow you to specify that a given routine requires interactive user input
or when it should give rise to a check-mark when used in a menu. For or when it should give rise to a check-mark when used in a menu. For
instance, the statement instance, the statement
<\scm-code> <\scm-code>
(tm-property (choose-file fun text type) (tm-property (choose-file fun text type)
\ \ (:interactive #t)) \ \ (:interactive #t))
</scm-code> </scm-code>
in the source code of <TeXmacs> states that <scm|choose-file> is an in the source code of <TeXmacs> states that <scm|choose-file> is an
interactive command. As a consquence, the <menu|File|Load> entry, which is interactive command. As a consequence, the <menu|File|Load> entry, which is
defined by defined by
<\scm-code> <\scm-code>
("Load" (choose-file load-buffer "Load file" "")) ("Load" (choose-file load-buffer "Load file" ""))
</scm-code> </scm-code>
will be followed by dots <scm|...> in the <menu|File> menu. The interesting will be followed by dots <scm|...> in the <menu|File> menu. The interesting
point here is that, although the command <scm|choose-file> may be reused point here is that, although the command <scm|choose-file> may be reused
several times in different menu entries, we only have to specify once that several times in different menu entries, we only have to specify once that
it is an interactive command. Similarly, consider the definition it is an interactive command. Similarly, consider the definition
skipping to change at line 85 skipping to change at line 85
Given a menu item with <scm|(toggle-session-math-input)> as its associated Given a menu item with <scm|(toggle-session-math-input)> as its associated
action, this definition specifies in particular that a check-mark should be action, this definition specifies in particular that a check-mark should be
displayed before the menu item whenever the <scm|session-math-input?> displayed before the menu item whenever the <scm|session-math-input?>
predicate holds. predicate holds.
Another frequently used option is <scm|:secure>, which specifies that a Another frequently used option is <scm|:secure>, which specifies that a
given routine can be used inside <TeXmacs> documents, in particular inside given routine can be used inside <TeXmacs> documents, in particular inside
<markup|extern> and <markup|action> macros. For instance, the default <markup|extern> and <markup|action> macros. For instance, the default
implementation of the <markup|fold> tag allows the user to click on the implementation of the <markup|fold> tag allows the user to click on the
``<math|<op|\<circ\>>>'' before the folded text so as to unfold the tag. \P<math|<op|\<circ\>>>\Q before the folded text so as to unfold the tag.
When doing this, the scheme script <scm|mouse-unfold> is launched. When doing this, the scheme script <scm|mouse-unfold> is launched. However,
However, for this to work, the <scm|mouse-unfold> function needs to be for this to work, the <scm|mouse-unfold> function needs to be secure:
secure:
<\scm-code> <\scm-code>
(tm-define mouse-unfold (tm-define mouse-unfold
\ \ (:secure #t) \ \ (:secure #t)
\ \ (with-action t \ \ (with-action t
\ \ \ \ (tree-go-to t :start) \ \ \ \ (tree-go-to t :start)
\ \ \ \ (fold))) \ \ \ \ (fold)))
</scm-code> </scm-code>
You can read more about the tags which depend on <scheme> scripts in You can read more about the tags which depend on <scheme> scripts in
``<hlink|Invoking <scheme> scripts from <TeXmacs> \P<hlink|Invoking <scheme> scripts from <TeXmacs>
markup|overview-start.en.tm#markup-scripts>''.\ markup|overview-start.en.tm#markup-scripts>\Q.\
In the future, the number of options for entering meta-information is In the future, the number of options for entering meta-information is
likely to increase. <TeXmacs> also supports an additional mechanism for the likely to increase. <TeXmacs> also supports an additional mechanism for the
automatic deduction of new meta-properties from existing meta-properties. automatic deduction of new meta-properties from existing meta-properties.
This mechanism is based on a less general, but more efficient form of This mechanism is based on a less general, but more efficient form of
<em|logical programming>. However, since it is not fully stable yet, it <em|logical programming>. However, since it is not fully stable yet, it
will be documented only later. will be documented only later.
<tmdoc-copyright|2005|Joris van der Hoeven> <tmdoc-copyright|2005|Joris van der Hoeven>
<tmdoc-license|Permission is granted to copy, distribute and/or modify this <tmdoc-license|Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.1 document under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation; with no or any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled "GNU Free Texts. A copy of the license is included in the section entitled "GNU Free
Documentation License".> Documentation License".>
</body> </body>
<initial|<\collection>
</collection>>
 End of changes. 9 change blocks. 
12 lines changed or deleted 11 lines changed or added

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