Projects for TeXmacs

1.To do list for improving the current implementation

1.General architecture

1.1.Implementation of better debugging tools

Error recovery

Mechanism to recover all C++ and scheme error messages in a dedicated TeXmacs buffer, together with foldable backtraces.

Locations

Provide correct locations for the texmacs-error primitive. Also provide line numbers in C++ crash reports.

Exception semantics

Provide a clean exception semantics for all routines in the basic APIs.

Throw-catch

Try hard to recover from errors and segmentation faults, except when configuring using –enable-debug.

Test suite

Test-suite of TeXmacs documents for different features and automated checks for certain types of correctness.

Memory leaks

Perform extensive (automated) checks for memory leaks using Valgrind and implement a marking algorithm.

Unit Test

More and more unit tests should be written under the GTest framework.

1.2.Improving the speed

Internal data representation

Encode the system environment variables; this will globally accelerate the program. Also, intermediate data during the typesetting process might be encoded in a more binary way.

Coding style

Systematically use “const ref” style parameter passing should both decrease the size of the binary and accelerate the global efficiency.

Better caching mechanism

Optimize performance as a function of cost of recomputation and storage requirement

Increased laziness

The typesetter should be made lazy in a more fundamental way (see upcoming style rewriting tool).

2.Internal C++ utilities

2.1.Tree manipulation routines

Document correction

Transform a tree into a correct tree for the current style. This routine should in particular be called before or after any conversion to an external format.

Downgrade TeXmacs documents

Downgrade TeXmacs documents to those of a previous version. This should be used in particular in combination with plug-ins: after communication of the version of TeXmacs for which the plug-in was designed, TeXmacs should emulate the behaviour of this, potentially older, version.

2.2.Encodings and fonts

Unicode

Systematically use Unicode.

Agglomerated fonts

Some changes have still to be made in the way font encodings are handled. This should make it easier to maintain fonts with characters from several physical fonts, virtual fonts, special characters, etc.

Determination of logical font

Currently, the current logical font is determined from a fixed set of environment variables only. The current typesetting font should rather be a tree (instead of a string), which is evaluated (so that environment variables are replaced) and then passed to find_font(display,tree). The current font can then be a joined font and future fonts might depend on user environment variables (i.e. colored fonts, using more than one color).

Rubber characters

Implement large brackets and wide delimiters for STIX fonts.

Provide standard implementations using vector graphics, which do not depend on fonts, with many parameters for customizing width, shape, etc.

3.Scheme interface

3.1.General

Scheme plug-in

Internally present Guile as a plug-in, which could later be replaced by another Scheme implementation.

Unified TeXmacs content interface

A clean interface for manipulating TeXmacs content (a unified interface for both internal TeXmacs trees and the associated Scheme representation).

Documentation

Better documentation on how to use the Scheme extensions.

Programming aids

Implement a proper parser and autocompletion mechanism. Add standard IDE code browsing tools and visual aids.

3.2.Coding style

Preservation of locality

Replace dispatch tables by contextual overloading where possible (i.e. LaTeX export).

Closures

Systematic use of closures throughout the code. In particular, we should base our implementation of dialogs on closures instead of continuations.

Naming conventions

Rename drd- logic- for routines from kernel/drd.

Appropriate naming convention for routines which operate on markup: when to use tmconcat-, concat-, concat/, tree-concat-, etc., especially for tags like "tree" which are also used as data types.

4.Typesetter

4.1.General

Eequivalent for TeX \topsep

In TeXmacs, the \topsep always equals 0.75em. It should be possible to modify this. For symmetry, we might also introduce a “bottom sep”.

Resizing macro expansions

When attempting to resize a macro application to become smaller than the “x”, the invisible markers may have undesirable side-effects.

Font parameters

Separate environment variables for “typewriter”, “sans serif”, “small caps”, “slant”, etc.

Find rendering font as a function of selected font and language?

Simplification of page parameters

Should we still reorganize? It should be easy to access to the page width and height and some other parameters.

Origins of boxes

Boxes should not have origins; its children should have positions instead.

Temporarily incorrect markup

Example: when pressing Ctrl+Backspace inside a surround tag, we first remove the two first children of the surround tag (so that it obtains arity 1) and next remove the tag itself. The temporarily incorrect surround tag of arity 1 may cause bridge_surround to crash. Temporary fix: add extra nodes in the bridge. Better fix: implement an elementary modification assign_label, which allows to change the surround tag into another tag like tuple before performing incorrect operations.

In general: the typesetter should not crash in the case of incorrect edit trees.

4.2.Text

Introduction of the paragraph tag

Distinguish between paragraphs and paragraph units.

Page decorations (headers and footers)

Should the corresponding environment variables become macros? Also make the contents editable whenever possible.

Fine-grained baseline skip

Associate baseline skip (or ascent and descent) to each individual box in concatenation. Next compute maximum over each line. Take maximum of maximum after first line and maximum before second line in order to obtain final value. Also for other parameters such as baselineskip?

Precise scope of variables which affect paragraph layout

The scopes of several such variables is currently a bit ill-defined, especially when they are modified several times by macros.

User-defined hyphenations of words

Oriental languages

Cursor movement is extremely slow for oriental languages. Line breaking could also be further improved.

4.3.Mathematics

Fractions

Macro for continued fractions, such that right hand sides of fractions are aligned.

Less vertical spacing in text style between numerator/denominator and bar.

Equations

Left-numbering of equation arrays. Should be possible now using the extern primitive.

Operator decorations

Regard above, below, below and wide* as operator decorations, both for typesetting purposes and for the standard mathematical grammar.

Rubber brackets and wide delimiters

See section on fonts.

Homoglyps

Mode for showing invisible symbols and distinguishing between other homoglyps. Also show alternatives for homoglyphs in the Focus menu.

Missing symbols

Forall and exists as big operators.

Upright and sans serif mathematical symbols.

4.4.Style sheet language

Style options

Introduce a mechanism for style options. For instance, style packages in a given directory might be executed before the actual document style and document packages.

Greyed menu entries

Grey menu entries for parameters which cannot be changed in the style. For instance, a style might provide a limited number of font base sizes.

Cleaner replacement for drd-props

Replace drd-props primitive by a primitive inside the macro, e.g.:

  <macro|a|b|<drd-props|<drd-prop|a|accessible>|…|body>>

and/or no-assign tag for associating drd-properties without actual assignment.

Prevent packages to be loaded twice

Implement a provide-package variant of use-package, which does not (re)load.

Or simply let use-package never reload the same package twice.

Forms

Implement forms by letting field tags link to the main form tag.

Interaction with Scheme

Declaration of key-bindings and more complex scheme code in style packages.

Declaration of style packages and macros from within a Scheme module.

5.Editor

5.1.Structured text

Presentation tags

Should we provide icons for certain presentation tags and other environment variables, such as font type and size?

Titles

The interface for editing document titles is buggy. In particular, we cannot remove authors or transform selections into titles. Also selecting part of the title information is buggy. Finally, the macros for rendering titles are overly complex.

Inline and block content

Automatically turn block content into inline content when appropriate.

Outward selection

Maybe use shift-mouse-click for outward selection (besides pointing inside a hyperlink).

5.2.Editing source trees

Editing macro names

User-defined macros can be turned into a compound using the backspace key, builtin macros can't. Why is that? How do I change the name of the call to a buildin macro? Can I avoid removing it and creating a new one?

If the first argument of a call to a user defined macro contains a document tag, I cannot turn it into a compound any more. Why that?

By the way, there seems to be no way to manually create or remove document tags.

Editing meta-information

Edit the "init" part of a file in source code form.

Customizable presentation

Make the presentation of source code more customizable by user macros. Done for syntactic highlighting, but should also be done for special rendering of certain primitives and the rendering of tags.

Primitive for block arguments

Currently, we may stretch tags. We also need a primitive for stretching tag arguments.

Comments

Tags for short commands inside the program.

Visual hints

Display informative flags at places where tags have been stretched or a modification to the source style has been applied.

5.3.Miscellaneous

“Edit as” facility

A facility Edit as to convert a selection into any other format and put the result in an edit-as tag for manual editing. When pressing return, reconvert back into TeXmacs.

Style file assistants

Assistant for creating your own styles.

Widget for editing simple macros in the preamble without entering preamble mode.

Failing as_double and as_string conversions

When author tags for the history management get large, then the as_double and as_string conversions may fail.

Relaunching TeXmacs

Relaunch TeXmacs after change of look and feel.

6.Converters

Quoting

Implement different routines for quoting and quote/unquote using the appropriate routine.

LaTeX

Avoid name-clashes with built-in commands

Importation of LaTeX macros whose names coincide with built-in commands may lead to incorrect documents (e.g. the point macro in publs/1998/zeta.tex). We should probably post-correct imported documents.

Better parsing of verbatim arguments

Some commands, like documentclass, cite, etc. take verbatim arguments, which should not be parsed in the generic way. The string_arg function is a temporary remedy.

Postscript

Use PdfMark watermarks for Pdf generation with hyperlinks and tables of contents.

7.Graphics editor

7.1.Interface

General interface

  • Explanatory messages on the status bar.

  • Better “mouse button layout”: do as much as possible with left mouse button only and reserve right button for contextual menu.

  • Fine-grained resizing using keyboard (also allow modification of grain?).

  • Resizing using mouse.

  • Automatic detection of simple types of curves when dragging in drawing mode.

  • Automatic detection of simple ornaments (arrows, dots).

  • Cairo plug-in for nicer looking graphics.

  • Graphical macros and constraint-based drawings.

  • Documentation, reference guide (markup specification) and tutorial.

7.2.Reorganization of Scheme code

Clean API for graphical objet and current decorations

  • Remove/restore one object (while preserving -order).

  • Remove/restore a selection of objects (while preserving -order).

  • Specify decorations for current graphical object.

  • Undo and cancel.

Clean API for setting/retrieving graphical attributes

Possible attributes: color, line width, line style, fill color, etc.

  • Selecting the value of a given attribute.

  • Retrieving the value of a given attribute.

  • Apply attributes to one or more objects.

  • Retrieve attributes from one (or more) objects.

Clean API for global attributes of the entire graphics

  • Set an attribute.

  • Retrieve an attribute.

Clean API for simple object construction

  • Different types of arguments: point, length, content, etc.

  • Adding an argument to the current object.

  • Removing an argument from a current object.

  • Event handlers and how to map mouse buttons to different actions.

  • Computation of decorations.

Clean API for groups

  • Adding an object / region.

  • Removing an object / region.

  • Geometric transformations.

  • Changing -order.

  • Group / ungroup.

  • Copy and paste.

  • Computation of decorations.

Documentation of all APIs

8.Semantic editing tools based on packrat parsing

Packrat engine

  • Implement grammar rules with productions.

  • Implement content MathML output.

  • When making semantic selections, don't select ignored markup at the border of selections (or only if explicitly selected). For instance, inside maxima sessions, the (%o) output prefix is current included when selecting a complete output semantically.

Mathematics

  • Automatic correction of formulas editing mode based on “slots”.

  • Explicit prefix-postfix, prefix-infix and symbol-prefix operator types for operators such as , resp. .

  • Better scheme for entering big operators and large delimiters as symbols and not binary/ternary constructs.

  • Above, below, wide and wide* as operator decorations.

  • Upgrade wide spaces (e.g. 1em) as separating spaces.

Universal grammar

  • Overload and as data access operators.

  • Symbols for and with the appropriate precedence.

  • Notations and .

  • Several precedences for separators in .

Programming languages

  • Add facility to automatically close partial environments, e.g. with missing } or missing statement after if x then. Applications: highlighting imcomplete input, automatic indentation.

Editing

  • Generalize use of mathematical focus instead of usual focus. For instance, the focus bar, tooltips on math symbols, using semantic_root instead of innermost, etc.

  • Easy way to switch between semantic and non-semantic selections.

  • Shortcut for circulating among homoglyphs.

9.Universal spreadsheet

Rationale: We started to incorporate a “universal spreadsheet” facility into TeXmacs. The idea is that all dependencies between the cells in the sheet are analyzed by TeXmacs, but all actual computations are delegated to an extern system of your choice, like one of the currently supported computer algebra systems. Also, the data of the spreadsheet will not necessarily be formatted in a rectangular table; one can also imagine dependencies between nodes of a tree, elements of a graph, or anything else.

Implementation and dependencies

  • It would be better to use links for dependencies between cells instead of going through the entire document at each re-evaluation, as well as links to auxiliary cache for storing the last computed values. This can for instance be done by defining an environment variable with the ID of the current cell and adding a link to this ID for any calc-ref or cell-ref inside the cell.

  • Implementation of the possibility to associate an alternative name to a cell.

  • Possibility to send all inputs at once to the plug-in instead of evaluating them one by one, so as to speed up computations.

  • How to deal with errors?

Interface

  • The focus bar should be adapted. Inside a spreadsheet, the facilities for editing tables should still be available and we should be able to edit the input fields for cell-output tags (at least when the input is a string).

  • Possibilitity to apply operations to subtable selections. For instance, when selecting part of a column and applying “sum”, the sum of the column should be computed at the bottom of the selection. Similarly, applying a unary operation such as “sin” might apply the operation to each cell in the selection and put the result right next to it.

10.Upcoming style rewriting tool

Reminders

  • Attention to implicitly changed variables, such as the-tags, the-label, etc., which may cause the entire document to be retypeset.

  • Attention to base-file-name, cur-file-name, current-part. Also put these variables in vars.hpp.

  • Replace arg primitive by quasi-quoting mechanism. This seems to be quite necessary: consider <assign|foo|<macro|body|…>> and a document piece <\foo> … </foo> with a large body. When making changes to the body; the environment for typesetting the body also changes, because we need to store the body in the foo environment argument variable. For this reason, we implemented an alternative mechanism, which is enabled using #define ALTERNATIVE_MACRO_EXPANSION.

  • More systematic usage of symbols instead of strings.

  • Should BibTEX labels really be prefixed by bib-?

  • Links and multiple views: which view should be selected when following a hyperlink. More generally: refine criteria for automatically preferring one locus over another one in presence of ambiguities.

Auxiliary data

There is a problem with auxiliary data in hidden markup (eg. labels, loci, links, indexes).

Analogy: hidden markup loaded file which is not in a buffer. We might want to associate auxiliary data to tree nodes instead of files. Notice that there are different types of hidden structures:

  • Contents should not be evaluated when hidden, but we need to keep track of auxiliary data. Example: a hidden chapter.

  • Contents are evaluated but not typeset: auxiliary data may be kept in macro expander. Example: fold.

  • Contents are not evaluated, not typeset and no auxiliary data are attached to the contents. Example: a comment or any piece of markup which has to be completely ignored.

11.Upcoming markup-based GUI

Remaining issues

  • Attach the action to be applied after popup input to a specific buffer.

  • Cleaner implementation of read-only parts in documents.

  • Cleaner implementation of size computation of widget. Also: notebooks and folding constructs, which may require to update the size later on.

  • Cleaner implementation of widget fields (i.e. the way we associate data to names).

  • Don't require the specification of a body for hidden input fields.

  • Argument history and browsing suggestions using keyboard.

  • Destroy call backs associated to a widget when the corresponding window is closed using another method than dismiss. Idea: potentially associate a dismiss routine to each buffer.

12.Management and administration

Publicity

  • List actions to be undertaken.

Mirror sites

  • CVS mirror at Savannah and automatic update scheme.

  • Also search for other mirror sites (increases availability and visibility on the web).

13.Tutorial or series of introductory articles

General introduction/quick overview

  • Different purposes of TeXmacs.

  • Writing a simple text.

  • Style-sheets and writing a simple macro.

  • Running a computer algebra system.

  • Inserting an action tag which launches an xterm.

Writing simple structured texts

  • Why are structured documents useful?

  • How to enter structure into TeXmacs, redundancy of the interface.

  • Understanding the visual indications, cursor movement.

  • Editing the structure (removing structure, improper nesting, variants, numbering).

  • Exploiting structure: spell checking, searching.

  • Reminders about correct typography.

Writing mathematical texts

  • Entering math mode, equations, equation arrays.

  • Simple mathematical formulas, recall cursor movement.

  • Mathematical symbols, variants.

  • Semantics of multiplication, function application and other implicit semantics.

  • Simple matrices and other tabular environments.

Writing simple macros and style-sheets

  • Rendering of source code, what is source code?

  • A simple macro.

  • A simple style package.

  • Customization of some existing macros.