texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Texmacs-dev] tm-define and other new keywords


From: Joris van der Hoeven
Subject: [Texmacs-dev] tm-define and other new keywords
Date: Thu, 6 Feb 2003 18:48:58 +0100 (MET)

OK, so in the next version, you will have a command 'tm-define'.
This command has the following form:

  (tm-define function-name-and-parameters
    (:key-1 value-list-1)
    ...
    (:key-n value-list-n)
    usual-body)

This declaration will execute the following code

  (define function-name-and-parameters
    usual-body)

and next set the procedure property :key-i for the procedure
to value-list-i for every i. For instance:

  (tm-define (toggle-table-hyphen)
    (:synopsis "Toggle table hyphenation")
    (:check-mark "v" table-hyphen?)
    (table-set-hyphen (if (table-hyphen?) "n" "y")))

>From now on, we thus have a clean way to associate
documentation and other properties to functions.
When David will have time, it would be good to
use this new feature in order to get rid of the present
code for setting checkmarks (I did part of that).

I propose the following standard properties:

  :synopsis     A short explanation
  :help-link    A link to a TeXmacs help file
  :args         A list of arguments with short descriptions (and types)
  :returns      Short description of the returned value (and types)
  :check-mark   For menus

The descriptions for the arguments may for instance be used when the
function is interactive (I am thinking about a 'tm-interactive' construct).

The short explanation should be really short.
Implementation details can be included as usual comments.
Detailed help should usually be provided in dedicated TeXmacs files.
We might provide examples through an ':example' property though.
I am not very sure yet about how to deal with arguments names and
such in the synopsis: as part of the string? a special format?
Of course we want to favorize all possible automatic treatments.
Notice that all help might potentially need to be translated.

I also implemented syntax highlighting and automatic indentation
for the new constructs inside emacs. You will have to load the file
$TEXMACS_PATH/progs/keywords/tm-mode.el in your .emacs file for this.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]