1 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 ;; 4 ;; MODULE : prog-format.scm 5 ;; COPYRIGHT : (C) 2003-2019 Joris van der Hoeven, Darcy Shen 6 ;; 7 ;; This software falls under the GNU general public license version 3 or later. 8 ;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 ;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>. 10 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 11 12 (texmacs-module (prog prog-format) 13 (:use (convert rewrite init-rewrite))) 14 15 16 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 17 ;; Scheme source files 18 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 19 20 (define-format scheme 21 (:name "Scheme Source Code") 22 (:suffix "scm")) 23 24 (define (texmacs->scheme x . opts) 25 (texmacs->verbatim x (acons "texmacs->verbatim:encoding" "SourceCode" '()))) 26 27 (define (scheme->texmacs x . opts) 28 (verbatim->texmacs x (acons "verbatim->texmacs:encoding" "SourceCode" '()))) 29 30 (define (scheme-snippet->texmacs x . opts) 31 (verbatim-snippet->texmacs x 32 (acons "verbatim->texmacs:encoding" "SourceCode" '()))) 33 34 (converter texmacs-tree scheme-document 35 (:function texmacs->scheme)) 36 37 (converter scheme-document texmacs-tree 38 (:function scheme->texmacs)) 39 40 (converter texmacs-tree scheme-snippet 41 (:function texmacs->scheme)) 42 43 (converter scheme-snippet texmacs-tree 44 (:function scheme-snippet->texmacs))