From 0fda8eff1e659876b27c4748d979fa4a192e05d8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 4 Mar 2002 02:14:31 +0000 Subject: [PATCH] Change maintainer to FSF. (sgml-start-tag-regex, sgml-font-lock-keywords-1, sgml-mode-common) (sgml-tags-invisible, sgml-beginning-of-tag): Allow _ : and non-ASCII in tag names, as required for XML. (sgml-name-char): Don't assume anything about charsets handled by encode-char. --- lisp/ChangeLog | 23 +++++++++++++++++++++ lisp/textmodes/sgml-mode.el | 41 ++++++++++++++++++++++--------------- 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8e50b4d542f..f228887a0db 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,26 @@ +2002-03-03 Stefan Monnier + + * textmodes/sgml-mode.el: Change maintainer to FSF. + (sgml-start-tag-regex, sgml-font-lock-keywords-1, sgml-mode-common) + (sgml-tags-invisible, sgml-beginning-of-tag): + Allow _ : and non-ASCII in tag names, as required for XML. + (sgml-name-char): Don't assume anything about charsets handled by + encode-char. + + * textmodes/tex-mode.el (tex-guess-main-file): Handle the case + where one of the buffers is narrowed. + + * hexl.el (hexlify-command, dehexlify-command): Remove. + (hexlify-buffer, dehexlify-buffer): Use call-process-region + rather than shell-command-on-region. + + * newcomment.el (comment-forward): Use forward-comment to skip + over whitespace (or comments) even when comment-use-syntax is nil. + + * progmodes/cperl-mode.el (cperl-menu): Add "-emacs" to the version. + + * textmodes/xml-lite.el: New file. + 2002-03-03 Richard M. Stallman * textmodes/artist.el (artist-system): Use make-temp-file. diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index c99bf06a908..a504e3be7f9 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -1,8 +1,9 @@ ;;; sgml-mode.el --- SGML- and HTML-editing modes -;; Copyright (C) 1992,95,96,98,2001 Free Software Foundation, Inc. +;; Copyright (C) 1992,95,96,98,2001,2002 Free Software Foundation, Inc. ;; Author: James Clark +;; Maintainer: FSF ;; Adapted-By: ESR, Daniel Pfeiffer , ;; F.Potorti@cnuce.cnr.it ;; Keywords: wp, hypermedia, comm, languages @@ -225,16 +226,18 @@ separated by a space." :group 'sgml) (defconst sgml-start-tag-regex - "<[A-Za-z]\\([-.A-Za-z0-9= \n\t]\\|\"[^\"]*\"\\|'[^']*'\\)*" + "<[[:alpha:]]\\([-_.:[:alnum:]= \n\t]\\|\"[^\"]*\"\\|'[^']*'\\)*" "Regular expression that matches a non-empty start tag. Any terminating `>' or `/' is not matched.") ;; internal (defconst sgml-font-lock-keywords-1 - '(("<\\([!?][a-z][-.a-z0-9]*\\)" 1 font-lock-keyword-face) - ("<\\(/?[a-z][-.a-z0-9]*\\)" 1 font-lock-function-name-face) - ("[&%][a-z][-.a-z0-9]*;?" . font-lock-variable-name-face))) + '(("<\\([!?][[:alpha:]][-_.:[:alnum:]]*\\)" 1 font-lock-keyword-face) + ("<\\(/?[[:alpha:]][-_.:[:alnum:]]*\\)" 1 font-lock-function-name-face) + ;; FIXME: this doesn't cover the variable using a default value. + ("\\([[:alpha:]][-_.:[:alnum:]]*\\)=[\"']" 1 font-lock-variable-name-face) + ("[&%][[:alpha:]][-_.:[:alnum:]]*;?" . font-lock-variable-name-face))) (defconst sgml-font-lock-keywords-2 (append @@ -364,9 +367,9 @@ Otherwise, it is set to be buffer-local when the file has ;; This is desirable because SGML discards a newline that appears ;; immediately after a start tag or immediately before an end tag. (set (make-local-variable 'paragraph-separate) "[ \t]*$\\|\ -\[ \t]*$") +\[ \t]*$") (set (make-local-variable 'paragraph-start) "[ \t]*$\\|\ -\[ \t]*") +\[ \t]*") (set (make-local-variable 'adaptive-fill-regexp) "[ \t]*") (set (make-local-variable 'comment-start) "") @@ -429,7 +432,7 @@ Do \\[describe-key] on the following bindings to discover what they do. ;; Set `imenu-generic-expression' here, rather than in `sgml-mode-common', ;; because this definition probably is not useful in HTML mode. (set (make-local-variable 'imenu-generic-expression) - "= (prefix-numeric-value arg) 0) (not sgml-tags-invisible))) - (while (re-search-forward "<\\([!/?A-Za-z][-A-Za-z0-9]*\\)" + (while (re-search-forward "<\\([!/?]?[[:alpha:]][-_.:[:alnum:]]*\\)" nil t) (setq string (cdr (assq (intern-soft (downcase (match-string 1))) @@ -850,7 +857,7 @@ If this can't be done, return t." (forward-list) (point)) 0))) - (if (looking-at "<[!?/]?[[A-Za-z][A-Za-z0-9]*") + (if (looking-at "<[!/?]?[[:alpha:]][-_.:[:alnum:]]*") (buffer-substring-no-properties (1+ (point)) (match-end 0)) @@ -1298,7 +1305,7 @@ To work around that, do: outline-regexp "^.*<[Hh][1-6]\\>" outline-heading-end-regexp "" outline-level (lambda () - (char-after (1- (match-end 0))))) + (char-before (match-end 0)))) (setq imenu-create-index-function 'html-imenu-index) (when sgml-xml (setq mode-name "XHTML")) (set (make-local-variable 'sgml-empty-tags) -- 2.39.5