-*- org -*-

* TO DO

** TrEdNodeEdit should somehow support direct editing of non-structure objects, e.g. of pml_prolog/epilog

* Ideas
 - Firefox-like extension packages download one package with
   stylesheets, macros, schemas, resources, icons, etc. and install it to
   user's ~/.tred.d. Extensions should be placed anywhere on HTTP and
   should be versioned, TrEd could look on startup for updates
   (or better, look for them on user's demand and also
   when upgraded).
   - prereqs:
      - Stylesheets in separate files (~/.tred.d/stylesheets or so)
      - macros in ~/.tred.d/macros/<package>/
      - icons in ~/.tred.d/icons/<package>/
      - extra resources in ~/.tred.d/resources/<package>/
      - a file managing installed packages
      - a tool for creating packages
      - an API for installing packages and cmd-line and TrEd iface to that API
      - safe extension loading

 - Maybe a set of URLs with package repositories could be specified, a
   content.xml file in each repo would describe packages in that repo
   (URL, version, author, short description of purpose, ... other
   information could be extracted from the package it self).

* TrEd [14/30]
 - [X] create undo for all displayed trees (multi tree mode)
 - [X] display current filelist (or a tree of file-lists) in the side-bar
 - [X] display a filesystem-browser in the side-bar
 - [X] allow the stylesheet to define raise-order of canvas items
       rootstyle:#{stackOrder:line,point,...}
 - [X] allow the nodes to take dimensions of the textbox
       #{Node-surroundtext:1}
       - [X] allow empty text labels to be skipped on each node
       #{NodeLabel-skipempty:1}, #{EdgeLabel-skipempty:1}
 - [X] allow positioning of the tree levels based on actual text
       heights (with possibly skipped labels)
 - [X] create dimensions and position of the textbox according to
       non-empty labels
 - [X] value-line: support for displaying preceding and following
       context (differentiated e.g. by font size or colour)
 - [X] allow additional textlabels, positioned using #{-coords:...} and
       anchoring (float:)
 - [X] undo for tree-related Node-menu items 
 - [ ] document various side-effects (setting $this/$root in GotoFile,
       ...)
 - [ ] fix: undo/redo on add/delete node (e.g. in PML_T) breaks
       id-hashes
 - [ ] make lower-level operations id-hash aware
 - [ ] add an option to TrEd to remember the last context and
       stylesheet used for a postponed file and restore them on resume
 - [X] in TrEd: keep this file (i.e. do not close this particular file
       automatically when opening another)
 - [X] after Save File As it does not appear in the recent files
       fixed: recent-files are updated on every saveFile and closeFile
 - [ ] make use of Tk::QueryDialog
 - [ ] a dynamic keyboard/menu bind-adopter
 - [ ] add macro: ChangeFilename() (take its guts from saveFileAs).
 - [ ] allow patterns use something like ${@V} to get direct access to
       the value attribute, ${@N} for the numbering attribute, etc.
 - [ ] make ${@O} (or similar) in patterns return the actual index of
       the node in left-to-right order of \@nodes returned by the
       hook; ${@L} could be the node-level, ${@X} and ${@Y} for its
       coordinates, etc.
 - [ ] on-line help for default bindigs with HTML output
 - [ ] add a register_context_guesser macro
 - [X] fix <Escape> binding: error is spit if Escape is first used to
       close the stylesheet-editor and then a node-attribute editor.
       Fixed this and possible similar errors by avoiding bind('all',...).
 - [ ] document #{Node-surroundtext:1}, #{NodeLabel-skipempty:1},
       #{EdgeLabel-skipempty:1}, float:..., node:#{-option:value},
       #{Node-xadj},#{Node-yadj}
 - [X] minor contexts
 - [ ] printing should reflect the canvas bounding box even if the
   top-left corner is in positive or negative coordinates
 - [ ] remove obsoleted computation of canvas height/width
 - [ ] document arguments to file_close_hook, new (global) open_file_hook 
 - [ ] fix: loader does not complain about type="..." reference 
   to a non-existing type declaration in the schema (should be 
   done separatelly after simplification?)
   
* PMLTQ

-  SQL: FIXME: do not offer non-existing PMLREF columns in the completion
   for 'a' in a test (e.g. "coref_gram.rf")

- PML to SQL:
  - address the problem of multiple corpora
  - address the problem of absolute filenames in SQL database
  - allow non-corpus-unique (but per-file-unique) IDs
  - attempt to shrink the database

- SQL-backend: optional node on a parent of a diferent node type
  does not work ATM because of the way optional nodes are implemented
  (e.g. v-frame [ ? v-element_alternation [ v-element []]])

  - if not generally solvable, warn if optional=1 for a relation that
    implies a different type
  
- true BTred backend relation plugins (pluggable iterator modules)

- true SQL backend relation plugins (pluggable query translation modules)

- obtain relation source and target types from Treex::PML::Schema (if
  provided), or a dedicated SQL table (in SQL/HTTP search)

- [X] implement correct expression parser

- simplify query editing:

  - [X] edit conditions as text in a text editor
    - [ ] backward parse query and provide node-type, relation,
         and, more importantly, attribute name and value completions

    - [ ] syntax highlighting

  - [X] graphically in TrEd - in that way we could add and/or nodes that we can
    also use for subqueries and conditional extra-relations)

- [X] make Ctrl+insert macros schema aware

- [X] support for multi-line attributes in TreeView

- [X] support for macro-definable toolbars

- [X] support for custom cdata- selections in TredNodeEdit from a combo box

- [X] fully define attribute tests and simplify syntax (n1.gram/sempos instead of n1.'gram/sempos')

- [X] and/or/extra-relation/condition/subquery nodes for combining tests with sub-queries
(displayed as sub-trees).  Maybe conditions should be subtrees anyway,
only hidden. Condition node is a conjunction of tests, and there are
furhter and/or/extra-relation/subquery nodes.

- planner weights based on attribute tests
(favor less specific nodes to become leafs)

- [X] optional nodes
- [X] lengths of ancestor/descendant axes
- [X] plan subqueries
- [X] inequalities for occurrences (implemented using alternatives of min/max)

- definitions: the user draws a named query with zero or one specified
node (e.g. TARGET). The definition can be then used as a user-defined
relation which identifies the root node of the definition with the
query node in which the relation arrow starts and the TARGET node with
the query node in which the relation arrow ends. If no TARGET is used,
the definition can be used as a predicate (meaning: this node also
matches the root of the defined query).

- [X] define text-format (syntax) for tree queries (possibly inspire in
    TigerSearch and TGrep, but use relation names instead of cryptic symbols)
  write serialization/parser

- [X] relational predicates that one can use in boolean
  combinations like (child(ref0) or order-precedes(ref1))

- [X] define exact syntax for a term in the tree-query
  (make a specific list of available functions and predicates)

- query options: one match per tree

- generalize subqueries: aggregating functions: count/min/max/....

- support for long attribute names in SQL (table mapping type-paths to
  table names)

- [X] fix negations of mutli-match comparisons

- [X] make a/foo=1 and a/bar=2 independent searches in the list/alt a/

- implement some form of (exists a (foo=1 and bar=2))
  or (forall a (foo=1 and bar=2))
  to be able to fix a/ and constraint a/foo and a/bar

- _transitive=exclusive (in NG by default, a query node can lay on
  the transitive edge of other query node; if =exclusive, than no query
  node can lay on the transitive edge and also, the transitive edge
  cannot share nodes with any other exclusive transitive edge (but can
  share nodes with some non-exclusive transitive edge)). Thus,
  exclusivity in NG seems equivalent to creating an optional node
  between the transitive query node and its query parent.

- [X] mark the nodes with colours and correspondingly color 
  the nodes in the result tree

- [X] check if we can search for non-projective edges

- allow placeholders literals in tests:
   m/lemma = ??
   Before evaluating the query, the user is asked
   to fill ?? for m/lemma, if empty, the test is ignored
   The placeholder remains in the query, but the value
   filled in by the user is kept somewhere, so that it is
   the value pre-filled next time


* Minor Modes

 - [X] query results displaying
 - diff-gram displaying
 - [X] free node positioning
 - subtree-folding
 - [X] multi tree
 - [X] multi sentence
* NTrEd [0/1]

  - [ ] SSH tunneling in NTrEd


* TreeView

  - an idea:

    introduce stylesheet labels:
    
    tree-order: (aka ord/dord)
    line-order: (aka sentord)

    This 1) eliminates the need to have these in dedicated attributes,
    2) allows for better coustomization.

* Treex::PML::Schema

  - [ ] document Treex::PML::Schema's for_each_decl
  - [ ] setters in Treex::PML::Schema objects

