texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] Patch: Guile-1.8.1 problem solved!


From: Norbert Nemec
Subject: Re: [Texmacs-dev] Patch: Guile-1.8.1 problem solved!
Date: Fri, 08 Dec 2006 18:39:30 +0100
User-agent: Thunderbird 1.5.0.8 (X11/20061115)

Joris van der Hoeven schrieb:
> Hi Norbert,
>
> On Fri, Dec 08, 2006 at 01:05:54PM +0100, Norbert Nemec wrote:
>   
>> I solved the problem with linking to the latest versions of guile:
>>     
>
> Congratulations; this takes a nail out of my feet ;^)
>   
Nice that I could help. Took me several hours... :-)
>> With this patch applied, the CVS version of TeXmacs starts up without
>> the former crashes, but causes a bunch of other errors that I did not
>> want to get into.
>>     
>
> Yes, I noticed the other messages for the TeXmacs server too.
> They don't seem to be very harmful, but I will try to find a solution
> one of these days.
>   
Seems, there is quite a number of incompatibilities that have to be solved.

Find a number of patches attached that solve some of the issues.
(careful, the "runtime" patch files are relative to the TeXmacs
subdirectory)

The biggest part are the "symbols" patches. These originate from the
problem that :0 or :1 are not legal keywords any more in guile 1.8 (see
NEWS file in guile). An additional problem is that number->keyword
produces an ugly keyword of the form #:#{0}

IMPORTANT: These patches makes TeXmacs incompatible with pre-1.8
guile!!! Considering the number of incompatibilities between 1.6.7 and
1.8, I fear that keeping compatibility with both versions will be an
very tricky task. I don't know whether it is worth it or whether 1.8
should simply be required for future versions of TeXmacs.

Index: texmacs/src/Guile/Glue/glue.cpp
===================================================================
--- texmacs.orig/src/Guile/Glue/glue.cpp        2006-12-08 14:04:16.000000000 
+0100
+++ texmacs/src/Guile/Glue/glue.cpp     2006-12-08 14:07:26.000000000 +0100
@@ -134,10 +134,12 @@
   return scm_long2scm ((long) i);
 }
 
+#ifndef GUILE_C
 int
 scm_to_int (SCM i) {
   return (int) scm_scm2long (i);
 }
+#endif
 
 /******************************************************************************
 * Floating point numbers
Index: texmacs/src/Guile/Glue/glue.hpp
===================================================================
--- texmacs.orig/src/Guile/Glue/glue.hpp        2006-12-08 14:04:16.000000000 
+0100
+++ texmacs/src/Guile/Glue/glue.hpp     2006-12-08 14:07:26.000000000 +0100
@@ -36,8 +36,12 @@
 SCM path_to_scm (path p);
 SCM url_to_scm (url u);
 SCM scheme_tree_to_scm (scheme_tree t);
+
+#ifndef GUILE_C
 int scm_to_bool (SCM obj);
 int scm_to_int (SCM obj);
+#endif
+
 string scm_to_string (SCM obj);
 string scm_to_symbol (SCM obj);
 tree scm_to_tree (SCM obj);
Index: texmacs/src/Texmacs/Texmacs/texmacs.cpp
===================================================================
--- texmacs.orig/src/Texmacs/Texmacs/texmacs.cpp        2006-12-08 
14:04:16.000000000 +0100
+++ texmacs/src/Texmacs/Texmacs/texmacs.cpp     2006-12-08 14:07:26.000000000 
+0100
@@ -266,12 +266,6 @@
 
 int
 main (int argc, char** argv) {
-#ifdef GUILE_C
-  cout << "Guile 1.8.0 is uncompatible with earlier versions.\n";
-  cout << "Please recompile TeXmacs with an older version of Guile,\n";
-  cout << "since TeXmacs is likely to crash with Guile 1.8.0.\n";
-  cout << "Any help for fixing this problem would be appreciated.\n";
-#endif
   //cout << "Bench  ] Started TeXmacs\n";
   the_et     = tuple ();
   the_et->obs= ip_observer (path ());
Index: texmacs/plugins/maxima/progs/maxima-menus.scm
===================================================================
--- texmacs.orig/plugins/maxima/progs/maxima-menus.scm  2006-12-08 
18:16:34.000000000 +0100
+++ texmacs/plugins/maxima/progs/maxima-menus.scm       2006-12-08 
18:16:59.000000000 +0100
@@ -29,7 +29,7 @@
   ;;(display* "Simplify " t "\n")
   (cond ((and (func? t 'concat) (> (length t) 2) (maxima-prompt? (cadr t)))
         (plugin-output-std-simplify "maxima" (cons 'concat (cddr t))))
-       ((match? t '(with "mode" "math" "math-display" "true" :1))
+       ((match? t '(with "mode" "math" "math-display" "true" :#{1}#))
         `(math ,(maxima-output-simplify (cAr t))))
        ((func? t 'with 1)
         (maxima-output-simplify (cAr t)))
Index: texmacs/plugins/pari/progs/pari-menus.scm
===================================================================
--- texmacs.orig/plugins/pari/progs/pari-menus.scm      2005-10-09 
19:52:21.000000000 +0200
+++ texmacs/plugins/pari/progs/pari-menus.scm   2006-12-08 18:17:51.000000000 
+0100
@@ -24,7 +24,7 @@
 (tm-define (plugin-output-simplify name t)
   (:require (== name "pari"))
   (cond ((match? t '(with "color" "magenta"
-                     (concat :1 (with "mode" "math" "color" "blue" :1))))
+                     (concat :#{1}# (with "mode" "math" "color" "blue" 
:#{1}#))))
         `(math ,(plugin-output-simplify name (tm-ref t 2 1 4))))
        (else (plugin-output-std-simplify name t))))
 
Index: texmacs/plugins/mupad/progs/mupad-menus.scm
===================================================================
--- texmacs.orig/plugins/mupad/progs/mupad-menus.scm    2006-12-08 
18:18:14.000000000 +0100
+++ texmacs/plugins/mupad/progs/mupad-menus.scm 2006-12-08 18:18:25.000000000 
+0100
@@ -22,7 +22,7 @@
 
 (tm-define (plugin-output-simplify name t)
   (:require (== name "mupad"))
-  (cond ((match? t '(concat (with "mode" "math" "math-display" "true" :1) :*))
+  (cond ((match? t '(concat (with "mode" "math" "math-display" "true" :#{1}#) 
:*))
         `(math ,(plugin-output-simplify name (tm-ref t 0 4))))
        (else (plugin-output-std-simplify name t))))
 
Index: TeXmacs/progs/kernel/boot/abbrevs.scm
===================================================================
--- TeXmacs.orig/progs/kernel/boot/abbrevs.scm  2006-12-08 14:04:02.000000000 
+0100
+++ TeXmacs/progs/kernel/boot/abbrevs.scm       2006-12-08 14:07:33.000000000 
+0100
@@ -53,8 +53,6 @@
 (define-public (true? . l) #t)
 (define-public (false? . l) #f)
 
-(define-public (identity x) x)
-
 (define-public (keyword->number x)
   (string->number (symbol->string (keyword->symbol x))))
 (define-public (number->keyword x)
@@ -71,7 +69,6 @@
 ;; Common programming constructs
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(define-public call/cc call-with-current-continuation)
 (define-public-macro (with-cc cont . body)
   `(call/cc (lambda (,cont) ,@body)))
 
Index: TeXmacs/progs/kernel/library/list.scm
===================================================================
--- TeXmacs.orig/progs/kernel/library/list.scm  2006-12-08 14:06:55.000000000 
+0100
+++ TeXmacs/progs/kernel/library/list.scm       2006-12-08 14:09:00.000000000 
+0100
@@ -18,12 +18,6 @@
 ;; Constructors
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(define-public (cons* . l)
-  "Construct a list from head of several elements and a tail."
-  ;; This function is in the kernel since GUILE-1.4.0
-  (let ((r (reverse l)))
-    (append (reverse (cdr r)) (car r))))
-
 (define-public (rcons l x)
   "Append @x to @l at the end."
   (append l (list x)))
Index: TeXmacs/progs/kernel/library/base.scm
===================================================================
--- TeXmacs.orig/progs/kernel/library/base.scm  2006-06-25 17:03:10.000000000 
+0200
+++ TeXmacs/progs/kernel/library/base.scm       2006-12-08 14:13:05.000000000 
+0100
@@ -31,8 +31,6 @@
 ;; Strings
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-;; NOTE: guile-1.6.0 implements SRFI-13 (string library) in C.
-
 (define-public (char->string c)
   "Convert @c to a string"
   (list->string (list c)))
@@ -65,61 +63,9 @@
   "Return @s if @s is a string and the empty string otherwise"
   (if (string? s) s ""))
 
-(define-public (reverse-list->string cs)       ; srfi-13
-  "Efficient implementation of (compose list->string reverse)."
-  ;; Not yet any more efficient, but this may be fixed in the future.
-  (list->string (reverse cs)))
-
-(define-public (string-join    ss . opt)       ; srfi-13 (subset)
-  "Concatenate elements of @ss inserting separators."
-  (if (null? opt) (string-join ss " ")
-      (string-concatenate (list-intersperse ss (car opt)))))
-
-(define-public (string-drop-right s n) ; srfi-13
-  "Return all but the last @n chars of @s."
-  (substring s 0 (- (string-length s) n)))
-
-(define-public string-drop string-tail)        ; srfi-13
-
-(define-public (string-take s n)               ; srfi-13
-  "Return the first @n chars of @s."
-  (substring s 0 n))
-
-(define-public (string-trim s)         ; srfi-13 (subset)
-  "Remove whitespace at start of @s."
-  (list->string (list-drop-while (string->list s) char-whitespace?)))
-
 (define-public (list-drop-right-while l pred)
   (reverse! (list-drop-while (reverse l) pred)))
 
-(define-public (string-trim-right s)   ; srfi-13 (subset)
-  "Remove whitespace at end of @s."
-  (list->string (list-drop-right-while (string->list s) char-whitespace?)))
-
-(define-public (string-trim-both s)            ; srfi-13 (subset)
-  "Remove whitespace at start and end of @s."
-  (list->string
-   (list-drop-right-while
-    (list-drop-while (string->list s) char-whitespace?)
-    char-whitespace?)))
-
-(define-public (string-concatenate ss) ; srfi-13
-  "Append the elements of @ss toghether."
-  ;; WARNING: not portable for long lists
-  (apply string-append ss))
-
-(define-public (string-map proc s)             ; srfi-13 (subset)
-  "Map @proc on every char of @s."
-  (list->string (map proc (string->list s))))
-
-(define-public (string-fold kons knil s)       ; srfi-13 (subset))
-  "Fundamental string iterator."
-  (list-fold kons knil (string->list s)))
-
-(define-public (string-fold-right kons knil s) ; srfi-13 (subset)
-  "Right to left fundamental string iterator."
-  (list-fold-right kons knil (string->list s)))
-
 (define (string-split-lines/kons c cs+lines)
   (if (== c #\newline)
       (cons '() cs+lines)
@@ -136,14 +82,6 @@
       (with pos (string-search-forwards sep 0 s)
        (and (>= pos 0) pos))))
 
-(define-public (string-tokenize s sep)
-  "Cut string @s into pieces using @sep as a separator."
-  (with d (string-search-separator s sep)
-    (if d
-       (cons (substring s 0 d)
-             (string-tokenize (substring s (+ 1 d) (string-length s)) sep))
-       (list s))))
-
 (define-public (string-tokenize-n s sep n)
   "As @string-tokenize, but only cut first @n pieces"
   (with d (string-search-separator s sep)
@@ -199,9 +137,6 @@
 (define-public (symbol-ends? s1 s2)
   (string-ends? (symbol->string s1) (symbol->string s2)))
 
-(define-public (symbol-drop-right s n)
-  (string->symbol (string-drop-right (symbol->string s) n)))
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Functions
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Index: TeXmacs/progs/convert/latex/latex-tools.scm
===================================================================
--- TeXmacs.orig/progs/convert/latex/latex-tools.scm    2005-11-24 
15:19:14.000000000 +0100
+++ TeXmacs/progs/convert/latex/latex-tools.scm 2006-12-08 18:05:17.000000000 
+0100
@@ -236,7 +236,7 @@
       (if (symbol? x) (latex-command-uses x))
       (if (and (list? x) (>= (length l) 2) (== (car x) '!begin))
          (latex-command-uses (string->symbol (cadr x))))
-      (if (match? x '(!begin "enumerate" (!option :1)))
+      (if (match? x '(!begin "enumerate" (!option :#{1}#)))
          (ahash-set! latex-uses-table "enumerate" #t))
       (for-each latex-use-which-package (cdr l)))))
 
Index: TeXmacs/progs/convert/latex/texout.scm
===================================================================
--- TeXmacs.orig/progs/convert/latex/texout.scm 2006-05-31 16:36:44.000000000 
+0200
+++ TeXmacs/progs/convert/latex/texout.scm      2006-12-08 18:05:48.000000000 
+0100
@@ -187,15 +187,15 @@
        (else #f)))
 
 (define (texout-double-math? x)
-  (or (and (match? x '((:or !document !concat) :1))
+  (or (and (match? x '((:or !document !concat) :#{1}#))
           (texout-double-math? (cadr x)))
-      (and (match? x '((!begin :1) :1))
+      (and (match? x '((!begin :#{1}#) :#{1}#))
           (in? (cadar x) '("eqnarray" "eqnarray*" "leqnarray*")))))
 
 (define (texout-math x)
   (cond ((texout-empty? x) (noop))
        ((texout-double-math? x) (texout x))
-       ((match? x '((!begin "center") :1))
+       ((match? x '((!begin "center") :#{1}#))
         (texout `((!begin "equation") ,(cadr x))))
        ((and (output-test-end? "$") (not (output-test-end? "\\$")))
         (output-remove 1)
Index: TeXmacs/progs/convert/latex/tmtex.scm
===================================================================
--- TeXmacs.orig/progs/convert/latex/tmtex.scm  2006-12-08 16:04:44.000000000 
+0100
+++ TeXmacs/progs/convert/latex/tmtex.scm       2006-12-08 18:06:05.000000000 
+0100
@@ -1176,7 +1176,7 @@
 
 (define (tmtex-bib-sub doc)
   (cond ((nlist? doc) doc)
-       ((match? doc '(concat (bibitem* :1) (label :string?) :*))
+       ((match? doc '(concat (bibitem* :#{1}#) (label :string?) :*))
         (let* ((l (cadr (caddr doc)))
                (s (if (string-starts? l "bib-") (string-drop l 4) l)))
           (cons* 'concat (list 'bibitem* (cadadr doc) s) (cdddr doc))))
@@ -1185,7 +1185,7 @@
 
 (define (tmtex-bib-max l)
   (cond ((npair? l) "")
-       ((match? l '(bibitem* :string? :1)) (cadr l))
+       ((match? l '(bibitem* :string? :#{1}#)) (cadr l))
        (else (let* ((s1 (tmtex-bib-max (car l)))
                     (s2 (tmtex-bib-max (cdr l))))
                (if (< (string-length s1) (string-length s2)) s2 s1)))))
Index: TeXmacs/progs/convert/tools/tmconcat.scm
===================================================================
--- TeXmacs.orig/progs/convert/tools/tmconcat.scm       2005-09-20 
16:10:08.000000000 +0200
+++ TeXmacs/progs/convert/tools/tmconcat.scm    2006-12-08 18:06:27.000000000 
+0100
@@ -152,16 +152,16 @@
        ((func? (car l) 'rsup)
         (cons (list 'rsup! "" (cadar l))
               (tmconcat-structure-scripts-sub (cdr l))))
-       ((match? l '(:1 (rsub :1) (rsup :1) :*))
+       ((match? l '(:#{1}# (rsub :#{1}#) (rsup :#{1}#) :*))
         (cons (list 'rsubsup! (car l) (cadadr l) (cadr (caddr l)))
               (tmconcat-structure-scripts-sub (cdddr l))))
-       ((match? l '(:1 (rsup :1) (rsub :1) :*))
+       ((match? l '(:#{1}# (rsup :#{1}#) (rsub :#{1}#) :*))
         (cons (list 'rsubsup! (car l) (cadr (caddr l)) (cadadr l))
               (tmconcat-structure-scripts-sub (cdddr l))))
-       ((match? l '(:1 (rsub :1) :*))
+       ((match? l '(:#{1}# (rsub :#{1}#) :*))
         (cons (list 'rsub! (car l) (cadadr l))
               (tmconcat-structure-scripts-sub (cddr l))))
-       ((match? l '(:1 (rsup :1) :*))
+       ((match? l '(:#{1}# (rsup :#{1}#) :*))
         (cons (list 'rsup! (car l) (cadadr l))
               (tmconcat-structure-scripts-sub (cddr l))))
        ((or (func? (car l) 'lsub) (func? (car l) 'lsup))
Index: TeXmacs/progs/doc/tmdoc.scm
===================================================================
--- TeXmacs.orig/progs/doc/tmdoc.scm    2005-05-21 17:10:40.000000000 +0200
+++ TeXmacs/progs/doc/tmdoc.scm 2006-12-08 18:11:51.000000000 +0100
@@ -45,7 +45,7 @@
            (tmdoc-substitute-sub (cdr l) base-name))))
 
 (define (tmdoc-substitute x base-name)
-  (cond ((match? x '(hyper-link :1))
+  (cond ((match? x '(hyper-link :#{1}#))
         (list 'hyper-link (cadr x)
               (url->string (url-relative base-name (caddr x)))))
        ((list? x) (cons (car x) (tmdoc-substitute-sub (cdr x) base-name)))
@@ -60,11 +60,11 @@
           '(document))
          ((func? x 'traverse)
           (cons 'document (tmdoc-rewrite (cdadr x) base-name level done)))
-         ((match? x '(branch :2))
+         ((match? x '(branch :#{2}#))
           (tmdoc-branch x base-name (tmdoc-down level) done))
-         ((match? x '(continue :2))
+         ((match? x '(continue :#{2}#))
           (tmdoc-branch x base-name (list level) done))
-         ((match? x '(extra-branch :2))
+         ((match? x '(extra-branch :#{2}#))
           (tmdoc-branch x base-name 'appendix done))
          ((match? x '(tmdoc-copyright :*))
           '(document))
@@ -99,7 +99,7 @@
 (define (tmdoc-search-env-var t which)
   (cond ((nlist? t) #f)
        ((null? t) #f)
-       ((match? t '(associate "language" :1)) (caddr t))
+       ((match? t '(associate "language" :#{1}#)) (caddr t))
        (else (let ((val (tmdoc-search-env-var (car t) which)))
                (if val val (tmdoc-search-env-var (cdr t) which))))))
 
@@ -170,7 +170,7 @@
 
 (define (tmdoc-remove-hyper-links l)
   (cond ((npair? l) l)
-       ((match? l '(hyper-link :1)) (cadr l))
+       ((match? l '(hyper-link :#{1}#)) (cadr l))
        (else (cons (tmdoc-remove-hyper-links (car l))
                    (tmdoc-remove-hyper-links (cdr l))))))
 
Index: TeXmacs/progs/generic/document-part.scm
===================================================================
--- TeXmacs.orig/progs/generic/document-part.scm        2005-07-26 
18:17:54.000000000 +0200
+++ TeXmacs/progs/generic/document-part.scm     2006-12-08 18:07:01.000000000 
+0100
@@ -74,7 +74,7 @@
 
 (define (buffer-hide-preamble)
   (with t (buffer-tree)
-    (when (match? t '(document (show-preamble :1) (ignore (document :*))))
+    (when (match? t '(document (show-preamble :#{1}#) (ignore (document :*))))
       (tree-assign t `(document (hide-preamble ,(tree-ref t 0 0))
                                ,@(tree-children (tree-ref t 1 0)))))))
 
Index: TeXmacs/progs/graphics/graphics-menu-functions.scm
===================================================================
--- TeXmacs.orig/progs/graphics/graphics-menu-functions.scm     2006-06-27 
13:23:21.000000000 +0200
+++ TeXmacs/progs/graphics/graphics-menu-functions.scm  2006-12-08 
18:13:08.000000000 +0100
@@ -29,9 +29,9 @@
 
 (tm-define (graphics-geometry)
   (with geo (tree->stree (get-env-tree "gr-geometry"))
-    (if (match? geo '(tuple "geometry" :2))
+    (if (match? geo '(tuple "geometry" :#{2}#))
        (append geo '("center"))
-       (if (match? geo '(tuple "geometry" :3))
+       (if (match? geo '(tuple "geometry" :#{3}#))
            geo
            '(tuple "geometry" "1par" "0.6par" "center")))))
 
@@ -76,7 +76,7 @@
 
 (tm-define (graphics-cartesian-frame)
   (with frame (tree->stree (get-env-tree "gr-frame"))
-    (if (match? frame '(tuple "scale" :2))
+    (if (match? frame '(tuple "scale" :#{2}#))
        frame
        '(tuple "scale" "1cm" (tuple "0.5par" "0cm")))))
 
@@ -160,11 +160,11 @@
          ((match? grid '(tuple "cartesian"))
           (set! graphics-current-type "cartesian")
          )
-         ((match? grid '(tuple "cartesian" :1))
+         ((match? grid '(tuple "cartesian" :#{1}#))
           (set! graphics-current-type "cartesian")
           (set! graphics-current-step (list-ref grid 2))
          )
-         ((match? grid '(tuple "cartesian" :2))
+         ((match? grid '(tuple "cartesian" :#{2}#))
           (set! graphics-current-type "cartesian")
           (set! graphics-current-center (list-ref grid 2))
           (set! graphics-current-step (list-ref grid 3))
@@ -172,16 +172,16 @@
          ((match? grid '(tuple "polar"))
           (set! graphics-current-type "polar")
          )
-         ((match? grid '(tuple "polar" :1))
+         ((match? grid '(tuple "polar" :#{1}#))
           (set! graphics-current-type "polar")
           (set! graphics-current-step (list-ref grid 2))
          )
-         ((match? grid '(tuple "polar" :2))
+         ((match? grid '(tuple "polar" :#{2}#))
           (set! graphics-current-type "polar")
           (set! graphics-current-step (list-ref grid 2))
           (set! graphics-current-astep (list-ref grid 3))
          )
-         ((match? grid '(tuple "polar" :3))
+         ((match? grid '(tuple "polar" :#{3}#))
           (set! graphics-current-type "polar")
           (set! graphics-current-center (list-ref grid 2))
           (set! graphics-current-step (list-ref grid 3))
@@ -190,16 +190,16 @@
          ((match? grid '(tuple "logarithmic"))
           (set! graphics-current-type "logarithmic")
          )
-         ((match? grid '(tuple "logarithmic" :1))
+         ((match? grid '(tuple "logarithmic" :#{1}#))
           (set! graphics-current-type "logarithmic")
           (set! graphics-current-step (list-ref grid 2))
          )
-         ((match? grid '(tuple "logarithmic" :2))
+         ((match? grid '(tuple "logarithmic" :#{2}#))
           (set! graphics-current-type "logarithmic")
           (set! graphics-current-step (list-ref grid 2))
           (set! graphics-current-base (list-ref grid 3))
          )
-         ((match? grid '(tuple "logarithmic" :3))
+         ((match? grid '(tuple "logarithmic" :#{3}#))
           (set! graphics-current-type "logarithmic")
           (set! graphics-current-center (list-ref grid 2))
           (set! graphics-current-step (list-ref grid 3))
@@ -439,12 +439,12 @@
       ;;  else (depends on if (get-env-tree) is gonna be fixed or not.
       ;;  If not, then we should avoid using it, and rely on the way
       ;;  above (if it doesn't raises other problems...)).
-    (if (match? aspect '(tuple (tuple :2) (tuple :2) :*))
+    (if (match? aspect '(tuple (tuple :#{2}#) (tuple :#{2}#) :*))
        (set! res aspect)
        (begin
          (set! aspect (graphics-path-property
                          (graphics-graphics-path) "gr-grid-aspect"))
-         (if (match? aspect '(tuple (tuple :2) (tuple :2) :*))
+         (if (match? aspect '(tuple (tuple :#{2}#) (tuple :#{2}#) :*))
              (set! res aspect)
              (set! res (get-default-val "gr-grid-aspect")))))
   )
@@ -453,7 +453,7 @@
 (define (graphics-grid-aspect visual?)
   (with gr (if visual? "gr-grid-aspect" "gr-edit-grid-aspect")
   (with aspect (tree->stree (get-env-tree gr))
-     (if (not (match? aspect '(tuple (tuple :2) (tuple :2) :*)))
+     (if (not (match? aspect '(tuple (tuple :#{2}#) (tuple :#{2}#) :*)))
         (set! res (get-default-val gr)))
      (cons 'tuple (sort (cdr aspect) cmp-aspect-items)))))
 
Index: TeXmacs/progs/kernel/gui/menu-define.scm
===================================================================
--- TeXmacs.orig/progs/kernel/gui/menu-define.scm       2005-05-19 
11:23:44.000000000 +0200
+++ TeXmacs/progs/kernel/gui/menu-define.scm    2006-12-08 18:12:37.000000000 
+0100
@@ -20,7 +20,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; ATTENTION: in menu-pre-entry, we also perform some convenience
 ;; rewritings in order to let menus match the grammar below.
-;; The convience rewritings allow the use of ..., (check :string? :1),
+;; The convience rewritings allow the use of ..., (check :string? :#{1}#),
 ;; (shortcut :string?) and multiple actions in menu entries.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
@@ -32,23 +32,23 @@
     (balloon :menu-label :string?)))
   (:menu-wide-label (:or
     :menu-label
-    (check :menu-wide-label :string? :1)
+    (check :menu-wide-label :string? :#{1}#)
     (shortcut :menu-wide-label :string?)))
   (:menu-item (:or
     ---
     |
     (group :string?)
-    (:menu-wide-label :1)
+    (:menu-wide-label :#{1}#)
     (symbol :string? :*)
     (horizontal :menu-item-list)
     (vertical :menu-item-list)
     (-> :menu-label :menu-item-list)
     (=> :menu-label :menu-item-list)
     (tile :integer? :menu-item-list)
-    (if :1 :menu-item-list)
-    (when :1 :menu-item-list)
-    (link :1)
-    (promise :1)
+    (if :#{1}# :menu-item-list)
+    (when :#{1}# :menu-item-list)
+    (link :#{1}#)
+    (promise :#{1}#)
     (:menu-item-list)))
   (:menu-item-list (:repeat :menu-item)))
 
@@ -97,11 +97,11 @@
       (list (menu-pre-wide-label (car p)) (make-promise (cadr p)))
       (cond ((null? (cdr p)) (menu-format-error "menu-pre-entry" p))
            ;; convenience rewritings
-           ((match? (cdr p) '(... :1 :*))
+           ((match? (cdr p) '(... :#{1}# :*))
             (menu-pre-entry `(,(menu-label-add-dots (car p)) ,@(cddr p))))
-           ((match? (cdr p) '(:string? :1 :*))
+           ((match? (cdr p) '(:string? :#{1}# :*))
             (menu-pre-entry `((shortcut ,(car p) ,(cadr p)) ,@(cddr p))))
-           ((match? (cdr p) '((check :2) :1 :*))
+           ((match? (cdr p) '((check :#{2}#) :#{1}# :*))
             (menu-pre-entry `((check ,(car p) ,@(cdadr p)) ,@(cddr p))))
            (else (menu-pre-entry `(,(car p) (begin ,@(cdr p))))))))
 
@@ -131,7 +131,7 @@
 (define-table menu-pre-table
   (group (:string?) ,(lambda (p) p))
   (symbol (:string? :*) ,(lambda (p) p))
-  (link (:1) ,(lambda (p) p))
+  (link (:#{1}#) ,(lambda (p) p))
   (horizontal (:*)
     ,(lambda (p) `(horizontal ,@(menu-pre-list (cdr p)))))
   (vertical (:*)
@@ -142,15 +142,15 @@
     ,(lambda (p) `(=> ,(cadr p) ,@(menu-pre-list (cddr p)))))
   (tile (:integer? :*)
     ,(lambda (p) `(tile ,(cadr p) ,@(menu-pre-list (cddr p)))))
-  (if (:1 :*)
+  (if (:#{1}# :*)
     ,(lambda (p) `(if ,(make-promise (cadr p)) ,@(menu-pre-list (cddr p)))))
-  (when (:1 :*)
+  (when (:#{1}# :*)
     ,(lambda (p) `(when ,(make-promise (cadr p)) ,@(menu-pre-list (cddr p)))))
-  (promise (:1)
+  (promise (:#{1}#)
     ,(lambda (p) `(promise ,(make-promise (cadr p))))))
 
-(ahash-set! menu-pre-table 'unquote `((:1) ,(lambda (p) p)))
-(ahash-set! menu-pre-table 'unquote-splicing `((:1) ,(lambda (p) p)))
+(ahash-set! menu-pre-table 'unquote `((:#{1}#) ,(lambda (p) p)))
+(ahash-set! menu-pre-table 'unquote-splicing `((:#{1}#) ,(lambda (p) p)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Definition of menus
Index: TeXmacs/progs/kernel/gui/menu-widget.scm
===================================================================
--- TeXmacs.orig/progs/kernel/gui/menu-widget.scm       2006-06-13 
12:59:11.000000000 +0200
+++ TeXmacs/progs/kernel/gui/menu-widget.scm    2006-12-08 18:08:04.000000000 
+0100
@@ -154,9 +154,9 @@
        label)))
 
 (define (make-menu-entry-attrs label action opt-key opt-check)
-  (cond ((match? label '(shortcut :1 :string?))
+  (cond ((match? label '(shortcut :#{1}# :string?))
         (make-menu-entry-attrs (cadr label) action (caddr label) opt-check))
-       ((match? label '(check :1 :string? :1))
+       ((match? label '(check :#{1}# :string? :#{1}#))
         (make-menu-entry-attrs (cadr label) action opt-key (cddr label)))
        (else (values label action opt-key opt-check))))
 
@@ -255,23 +255,23 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define (make-menu-if p e? bar?)
-  "Make @(if :1 :menu-item-list) menu items."
+  "Make @(if :#{1}# :menu-item-list) menu items."
   (with (tag pred? . items) p
     (if (pred?) (make-menu-items-list items e? bar?) '())))
 
 (define (make-menu-when p e? bar?)
-  "Make @(when :1 :menu-item-list) menu items."
+  "Make @(when :#{1}# :menu-item-list) menu items."
   (with (tag pred? . items) p
     (make-menu-items-list items (and e? (pred?)) bar?)))
 
 (define (make-menu-link p e? bar?)
-  "Make @(link :1) menu items."
+  "Make @(link :#{1}#) menu items."
   (with linked ((eval (cadr p)))
     (if linked (make-menu-items linked e? bar?)
        (make-menu-error "bad link: " (object->string (cadr p))))))
 
 (define (make-menu-promise p e? bar?)
-  "Make @(promise :1) menu items."
+  "Make @(promise :#{1}#) menu items."
   (with value ((cadr p))
     (if (match? value ':menu-item) (make-menu-items value e? bar?)
        (make-menu-error "promise did not yield a menu: " value))))
@@ -304,15 +304,15 @@
 (define-table make-menu-items-table
   (group (:string?) ,(lambda (p e? bar?) (list (make-menu-group (cadr p)))))
   (symbol (:string? :*) ,(lambda (p e? bar?) (list (make-menu-symbol p e?))))
-  (link (:1) ,(lambda (p e? bar?) (make-menu-link p e? bar?)))
+  (link (:#{1}#) ,(lambda (p e? bar?) (make-menu-link p e? bar?)))
   (horizontal (:*) ,(lambda (p e? bar?) (list (make-menu-horizontal p e?))))
   (vertical (:*) ,(lambda (p e? bar?) (list (make-menu-vertical p e?))))
   (-> (:menu-label :*) ,(lambda (p e? bar?) (list (make-menu-submenu p e?))))
   (=> (:menu-label :*) ,(lambda (p e? bar?) (list (make-menu-submenu p e?))))
   (tile (:integer? :*) ,(lambda (p e? bar?) (list (make-menu-tile p e?))))
-  (if (:1 :*) ,(lambda (p e? bar?) (make-menu-if p e? bar?)))
-  (when (:1 :*) ,(lambda (p e? bar?) (make-menu-when p e? bar?)))
-  (promise (:1) ,(lambda (p e? bar?) (make-menu-promise p e? bar?))))
+  (if (:#{1}# :*) ,(lambda (p e? bar?) (make-menu-if p e? bar?)))
+  (when (:#{1}# :*) ,(lambda (p e? bar?) (make-menu-when p e? bar?)))
+  (promise (:#{1}#) ,(lambda (p e? bar?) (make-menu-promise p e? bar?))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Menu expansion
Index: TeXmacs/progs/kernel/regexp/regexp-select.scm
===================================================================
--- TeXmacs.orig/progs/kernel/regexp/regexp-select.scm  2006-12-08 
17:17:53.000000000 +0100
+++ TeXmacs/progs/kernel/regexp/regexp-select.scm       2006-12-08 
18:09:42.000000000 +0100
@@ -191,11 +191,11 @@
                (with new-bl (bindings-add bl (cadr pat) x)
                  (if new-bl (list (cons* (list) x new-bl)) '())))
               (else '()))))
-      ((and (keyword? pat) (!= pat :1)) (select-list x (list pat) bl))
+      ((and (keyword? pat) (!= pat :#{1}#)) (select-list x (list pat) bl))
       ((not (tm-compound? x)) '())
       ((symbol? pat) (select-symbol (cdr (tm->list x)) 0 pat bl))
       ((integer? pat) (select-range (cdr (tm->list x)) 0 pat (+ pat 1) bl))
-      ((== pat :1) (select-range (cdr (tm->list x)) 0 0 (tm-arity x) bl))
+      ((== pat :#{1}#) (select-range (cdr (tm->list x)) 0 0 (tm-arity x) bl))
       (else '())))
 
 (define (select-continue-sub x pat)
@@ -214,15 +214,15 @@
      ((npair? pat) '())
      ((keyword? (car pat))
       (with fpat (car pat)
-        (cond ((== fpat :0)
+        (cond ((== fpat :#{0}#)
                (select-list x (cdr pat) bl))
               ((== fpat :*)
                (let* ((r (select-list x (cdr pat) bl))
-                      (l (select-one x :1 bl)))
+                      (l (select-one x :#{1}# bl)))
                  (append r (select-continue l pat))))
               ((integer? (keyword->number fpat))
                (let* ((h (number->keyword (- (keyword->number fpat) 1)))
-                      (l (select-one x :1 bl)))
+                      (l (select-one x :#{1}# bl)))
                  (select-continue l (cons h (cdr pat)))))
               ((ahash-ref navigate-table fpat)
                ((ahash-ref navigate-table fpat)
Index: TeXmacs/progs/math/math-edit.scm
===================================================================
--- TeXmacs.orig/progs/math/math-edit.scm       2005-06-19 18:25:42.000000000 
+0200
+++ TeXmacs/progs/math/math-edit.scm    2006-12-08 18:08:38.000000000 +0100
@@ -144,7 +144,7 @@
                  (insert " "))))))))
 
 (define (with-math-context? t)
-  (match? t '(with "mode" "math" :1)))
+  (match? t '(with "mode" "math" :#{1}#)))
 
 (tm-define (variant-circulate forward?)
   (:context with-math-context?)
Index: TeXmacs/progs/utils/misc/markup-funcs.scm
===================================================================
--- TeXmacs.orig/progs/utils/misc/markup-funcs.scm      2006-06-16 
11:59:22.000000000 +0200
+++ TeXmacs/progs/utils/misc/markup-funcs.scm   2006-12-08 18:08:51.000000000 
+0100
@@ -53,7 +53,7 @@
            (string->object s)
            s))
       (with (op . r) (tree->list pat)
-       (cond ((== op 'pat-any) :1)
+       (cond ((== op 'pat-any) :#{1}#)
              ((== op 'pat-any-repeat) :*)
              ((== op 'pat-or) (cons :or (map rewrite-select r)))
              ((== op 'pat-and) (cons :and (map rewrite-select r)))
Index: TeXmacs/progs/utils/plugins/plugin-cmd.scm
===================================================================
--- TeXmacs.orig/progs/utils/plugins/plugin-cmd.scm     2006-07-30 
17:09:59.000000000 +0200
+++ TeXmacs/progs/utils/plugins/plugin-cmd.scm  2006-12-08 18:09:15.000000000 
+0100
@@ -183,7 +183,7 @@
 (tm-define (formula-context? t)
   (with u (tree-up t)
     (and u (or (tree-in? u '(math equation equation*))
-              (match? u '(with "mode" "math" :1))
+              (match? u '(with "mode" "math" :#{1}#))
               (cell-context-inside? u '(eqnarray eqnarray*))))))
 
 (tm-define (in-var-math?)
@@ -205,7 +205,7 @@
        ((and (or (func? t 'document) (func? t 'concat))
              (in? (cAr t) '("" " " "  ")))
         (plugin-output-simplify name (cDr t)))
-       ((match? t '(with "mode" "math" :1))
+       ((match? t '(with "mode" "math" :#{1}#))
         `(math ,(plugin-output-simplify name (cAr t))))
        ((func? t 'with)
         (rcons (cDr t) (plugin-output-simplify name (cAr t))))
Index: TeXmacs/examples/plugins/mutator/progs/init-mutator.scm
===================================================================
--- TeXmacs.orig/examples/plugins/mutator/progs/init-mutator.scm        
2005-06-19 18:25:42.000000000 +0200
+++ TeXmacs/examples/plugins/mutator/progs/init-mutator.scm     2006-12-08 
18:19:33.000000000 +0100
@@ -25,9 +25,9 @@
     (let* ((mod (lambda (x y) (* y (- (/ x y) (floor (/ x y))))))
           (s (string->number (var-eval-system "date +\"%S\"")))
           (e (mod s 4)))
-      (if (and (<= e 1) (not (match? t '(strong :1))))
+      (if (and (<= e 1) (not (match? t '(strong :#{1}#))))
          (tree-set t `(strong ,t)))
-      (if (and (>= e 2) (match? t '(strong :1)))
+      (if (and (>= e 2) (match? t '(strong :#{1}#)))
          (tree-set t (tree-ref t 0))))))
 
 (kbd-map

reply via email to

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