Index: TeXmacs/progs/kernel/library/tree.scm =================================================================== RCS file: /texmacs/src/TeXmacs/progs/kernel/library/tree.scm,v retrieving revision 1.9 diff -u -r1.9 tree.scm --- TeXmacs/progs/kernel/library/tree.scm 13 Jun 2006 10:59:11 -0000 1.9 +++ TeXmacs/progs/kernel/library/tree.scm 26 Oct 2006 12:12:32 -0000 @@ -38,11 +38,17 @@ (tree->string t) (cons (tree-label t) (tree-children t)))) +(define (ip->path ip) + (and (or (null? ip) (!= (cAr ip) -5)) + (reverse ip))) + +(define-public (decode-self-path t) + (let ((ip (map string->number (string-split (tree->string t) #\.)))) + (ip->path ip))) + (define-public (tree-get-path t) (and (tree? t) - (let ((ip (tree-ip t))) - (and (or (null? ip) (!= (cAr ip) -5)) - (reverse ip))))) + (ip->path (tree-ip t)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Navigation inside trees Index: src/Typeset/Concat/concat_macro.cpp =================================================================== RCS file: /texmacs/src/src/Typeset/Concat/concat_macro.cpp,v retrieving revision 1.21 diff -u -r1.21 concat_macro.cpp --- src/Typeset/Concat/concat_macro.cpp 15 Jun 2006 16:18:45 -0000 1.21 +++ src/Typeset/Concat/concat_macro.cpp 26 Oct 2006 12:12:33 -0000 @@ -179,6 +179,7 @@ return; } string name= r->label; + if (name == "self-path") return typeset_dynamic(tree(as_string(ip)),ip); if (!env->provides (name)) { typeset_error (t, ip); return; Index: src/Typeset/Env/env_exec.cpp =================================================================== RCS file: /texmacs/src/src/Typeset/Env/env_exec.cpp,v retrieving revision 1.92 diff -u -r1.92 env_exec.cpp --- src/Typeset/Env/env_exec.cpp 31 Aug 2006 22:32:46 -0000 1.92 +++ src/Typeset/Env/env_exec.cpp 26 Oct 2006 12:12:33 -0000 @@ -583,6 +583,7 @@ edit_env_rep::exec_value (tree t) { tree r= exec (t[0]); if (is_compound (r)) return tree (ERROR, "bad value"); + if (r->label == "self-path") return tree(as_string(obtain_ip(t))); return exec (read (r->label)); }