From aff7dfc6d0c7e6bdcac1c737c0bdc06365fb7a9e Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 6 Feb 2006 18:24:52 +0000 Subject: [PATCH] Rename to XML mode. --- v7/src/edwin/htmlmode.scm | 59 ++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/v7/src/edwin/htmlmode.scm b/v7/src/edwin/htmlmode.scm index a22a0bbed..47c3db2e0 100644 --- a/v7/src/edwin/htmlmode.scm +++ b/v7/src/edwin/htmlmode.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: htmlmode.scm,v 1.11 2003/09/23 16:25:39 cph Exp $ +$Id: htmlmode.scm,v 1.12 2006/02/06 18:24:52 cph Exp $ -Copyright 1999,2000,2001,2002,2003 Massachusetts Institute of Technology +Copyright 1999,2000,2001,2002,2003,2006 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -23,24 +23,24 @@ USA. |# -;;;; Major Mode for HTML +;;;; Major Mode for XML (declare (usual-integrations)) -(define-major-mode html text "HTML" - "Major mode for editing HTML. +(define-major-mode xml text "XML" + "Major mode for editing XML. -\\{html}" +\\{xml}" (lambda (buffer) - (local-set-variable! syntax-table html-syntax-table buffer) + (local-set-variable! syntax-table xml-syntax-table buffer) (local-set-variable! indent-line-procedure (ref-command indent-relative) buffer) - (local-set-variable! paragraph-separate html-paragraph-separator buffer) - (local-set-variable! paragraph-start html-paragraph-separator buffer) + (local-set-variable! paragraph-separate xml-paragraph-separator buffer) + (local-set-variable! paragraph-start xml-paragraph-separator buffer) (local-set-variable! syntax-ignore-comments-backwards #f buffer) - (local-set-variable! comment-locator-hook html-comment-locate buffer) - (local-set-variable! comment-indent-hook html-comment-indentation buffer) + (local-set-variable! comment-locator-hook xml-comment-locate buffer) + (local-set-variable! comment-indent-hook xml-comment-indentation buffer) (local-set-variable! comment-start "" buffer) (local-set-variable! @@ -48,11 +48,11 @@ USA. "[.?!][]\"')}]*\\(<[^>]*>\\)*\\($\\| $\\|\t\\| \\)[ \t\n]*" buffer) (local-set-variable! local-abbrev-table - (ref-variable html-mode-abbrev-table buffer) + (ref-variable xml-mode-abbrev-table buffer) buffer) - (event-distributor/invoke! (ref-variable html-mode-hook buffer) buffer))) + (event-distributor/invoke! (ref-variable xml-mode-hook buffer) buffer))) -(define html-paragraph-separator +(define xml-paragraph-separator (let ((lwsp (rexp* (char-set #\space #\tab #\U+A0)))) (rexp->regexp (rexp-sequence @@ -64,20 +64,20 @@ USA. lwsp (rexp-line-end))))) -(define-command html-mode - "Enter HTML mode." +(define-command xml-mode + "Enter XML mode." () - (lambda () (set-current-major-mode! (ref-mode-object html)))) + (lambda () (set-current-major-mode! (ref-mode-object xml)))) -(define-variable html-mode-abbrev-table - "Mode-specific abbrev table for HTML.") -(define-abbrev-table 'html-mode-abbrev-table '()) +(define-variable xml-mode-abbrev-table + "Mode-specific abbrev table for XML.") +(define-abbrev-table 'xml-mode-abbrev-table '()) -(define-variable html-mode-hook - "An event distributor that is invoked when entering HTML mode." +(define-variable xml-mode-hook + "An event distributor that is invoked when entering XML mode." (make-event-distributor)) -(define html-syntax-table +(define xml-syntax-table (let ((syntax-table (make-char-syntax-table text-mode:syntax-table))) (set-char-syntax! syntax-table #\< "(>") (set-char-syntax! syntax-table #\! ". ") @@ -89,10 +89,17 @@ USA. (set-char-syntax! syntax-table #\: "_") syntax-table)) -(define (html-comment-locate mark) +(define (xml-comment-locate mark) (and (re-search-forward "