comparison lisp/psgml/psgml.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents ee648375d8d6
children c7528f8e288d
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
1 ;;; psgml.el --- SGML-editing mode with parsing support 1 ;;; psgml.el --- SGML-editing mode with parsing support
2 ;; $Id: psgml.el,v 1.5 1997/08/30 02:40:00 steve Exp $ 2 ;; $Id: psgml.el,v 1.1.1.1 1996/12/18 22:43:37 steve Exp $
3 3
4 ;; Copyright (C) 1993, 1994, 1995, 1996 Lennart Staflin 4 ;; Copyright (C) 1993, 1994, 1995, 1996 Lennart Staflin
5 ;; Copyright (C) 1992 Free Software Foundation, Inc. 5 ;; Copyright (C) 1992 Free Software Foundation, Inc.
6 6
7 ;; Author: Lennart Staflin <lenst@lysator.liu.se> 7 ;; Author: Lennart Staflin <lenst@lysator.liu.se>
8 ;; James Clark <jjc@clark.com> 8 ;; James Clark <jjc@clark.com>
9 ;; Maintainer: Lennart Staflin <lenst@lysator.liu.se>
10 ;; Keywords: languages
11 9
12 ;; 10 ;;
13 ;; This program is free software; you can redistribute it and/or 11 ;; This program is free software; you can redistribute it and/or
14 ;; modify it under the terms of the GNU General Public License 12 ;; modify it under the terms of the GNU General Public License
15 ;; as published by the Free Software Foundation; either version 2 13 ;; as published by the Free Software Foundation; either version 2
50 ;; unlimited lengths on names 48 ;; unlimited lengths on names
51 49
52 50
53 ;;; Code: 51 ;;; Code:
54 52
55 (defconst psgml-version "1.0.1" 53 (defconst psgml-version "1.0a12"
56 "Version of psgml package.") 54 "Version of psgml package.")
57 55
58 (defconst psgml-maintainer-address "lenst@lysator.liu.se") 56 (defconst psgml-maintainer-address "lenst@lysator.liu.se")
59 57
60 (require 'cl) 58 (require 'cl)
69 ;;;; Variables 67 ;;;; Variables
70 68
71 (defvar sgml-mode-abbrev-table nil 69 (defvar sgml-mode-abbrev-table nil
72 "Abbrev table in use in sgml-mode.") 70 "Abbrev table in use in sgml-mode.")
73 (define-abbrev-table 'sgml-mode-abbrev-table ()) 71 (define-abbrev-table 'sgml-mode-abbrev-table ())
72
73 ;;; Wing addition
74 (defvar sgml-mode-syntax-table nil
75 "Syntax table used in sgml mode.")
76
77 (if sgml-mode-syntax-table
78 ()
79 (setq sgml-mode-syntax-table (make-syntax-table))
80 (modify-syntax-entry ?< "(>" sgml-mode-syntax-table)
81 (modify-syntax-entry ?> ")<" sgml-mode-syntax-table)
82 (modify-syntax-entry ?\" ". " sgml-mode-syntax-table)
83 (modify-syntax-entry ?\\ ". " sgml-mode-syntax-table)
84 (modify-syntax-entry ?' "w " sgml-mode-syntax-table))
74 85
75 (defvar sgml-running-xemacs 86 (defvar sgml-running-xemacs
76 (not (not (string-match "Lucid\\|XEmacs" emacs-version)))) 87 (not (not (string-match "Lucid\\|XEmacs" emacs-version))))
77 88
78 ;;; User settable options: 89 ;;; User settable options:
315 (defvar sgml-public-map (sgml-parse-colon-path 326 (defvar sgml-public-map (sgml-parse-colon-path
316 (or (getenv "SGML_PATH") 327 (or (getenv "SGML_PATH")
317 ;; Wing change 328 ;; Wing change
318 (concat "%S:" (directory-file-name 329 (concat "%S:" (directory-file-name
319 sgml-data-directory) 330 sgml-data-directory)
320 "/%o/%c/%d"))) 331 "%o/%c/%d")))
321 332
322 "*Mapping from public identifiers to file names. 333 "*Mapping from public identifiers to file names.
323 This is a list of possible file names. To find the file for a public 334 This is a list of possible file names. To find the file for a public
324 identifier the elements of the list are used one at the time from the 335 identifier the elements of the list are used one at the time from the
325 beginning. If the element is a string a file name is constructed from 336 beginning. If the element is a string a file name is constructed from
408 (\"New page\" \"<?NewPage>\")) 419 (\"New page\" \"<?NewPage>\"))
409 ") 420 ")
410 421
411 (defvar sgml-custom-dtd nil 422 (defvar sgml-custom-dtd nil
412 "Menu entries to be added to the DTD menu. 423 "Menu entries to be added to the DTD menu.
413 The value should be a list of entries to be added to the DTD menu. 424 The value should be a list of entrys to be added to the DTD menu.
414 Every entry should be a list. The first element of the entry is a string 425 Every entry should be a list. The first element of the entry is a string
415 used as the menu entry. The second element is a string containing a 426 used as the menu entry. The second element is a string containing a
416 doctype declaration (this can be nil if no doctype). The rest of the 427 doctype declaration (this can be nil if no doctype). The rest of the
417 list should be a list of variables and values. For backward 428 list should be a list of variables and values. For backward
418 compatibility a singel string instead of a variable is assigned to 429 compatibility a singel string instead of a variable is assigned to
440 ;;; sgmls is a free SGML parser available from 451 ;;; sgmls is a free SGML parser available from
441 ;;; ftp.uu.net:pub/text-processing/sgml 452 ;;; ftp.uu.net:pub/text-processing/sgml
442 ;;; Its error messages can be parsed by next-error. 453 ;;; Its error messages can be parsed by next-error.
443 ;;; The -s option suppresses output. 454 ;;; The -s option suppresses output.
444 455
445 (defvar sgml-validate-command (concat "nsgmls -s -m " 456 (defvar sgml-validate-command "nsgmls -s %s %s"
446 sgml-data-directory
447 "/CATALOG %s %s")
448 "*The shell command to validate an SGML document. 457 "*The shell command to validate an SGML document.
449 458
450 This is a `format' control string that by default should contain two 459 This is a `format' control string that by default should contain two
451 `%s' conversion specifications: the first will be replaced by the 460 `%s' conversion specifications: the first will be replaced by the
452 value of `sgml-declaration' \(or the empty string, if nil\); the 461 value of `sgml-declaration' \(or the empty string, if nil\); the
989 998
990 To tag a region with the mouse, use transient mark mode or secondary selection. 999 To tag a region with the mouse, use transient mark mode or secondary selection.
991 1000
992 Structure editing: 1001 Structure editing:
993 \\[sgml-backward-element] Moves backwards over the previous element. 1002 \\[sgml-backward-element] Moves backwards over the previous element.
994 \\[sgml-forward-element] Moves forward over the next element. 1003 \\[sgml-forward-element] Moves forward over the nex element.
995 \\[sgml-down-element] Move forward and down one level in the element structure. 1004 \\[sgml-down-element] Move forward and down one level in the element structure.
996 \\[sgml-backward-up-element] Move backward out of this element level. 1005 \\[sgml-backward-up-element] Move backward out of this element level.
997 \\[sgml-beginning-of-element] Move to after the start tag of the current element. 1006 \\[sgml-beginning-of-element] Move to after the start tag of the current element.
998 \\[sgml-end-of-element] Move to before the end tag of the current element. 1007 \\[sgml-end-of-element] Move to before the end tag of the current element.
999 \\[sgml-kill-element] Kill the element following the cursor. 1008 \\[sgml-kill-element] Kill the element following the cursor.
1033 from end of element when adding end tag. 1042 from end of element when adding end tag.
1034 sgml-indent-step How much to increament indent for every element level. 1043 sgml-indent-step How much to increament indent for every element level.
1035 sgml-indent-data If non-nil, indent in data/mixed context also. 1044 sgml-indent-data If non-nil, indent in data/mixed context also.
1036 sgml-set-face If non-nil, psgml will set the face of parsed markup. 1045 sgml-set-face If non-nil, psgml will set the face of parsed markup.
1037 sgml-markup-faces The faces used when the above variable is non-nil. 1046 sgml-markup-faces The faces used when the above variable is non-nil.
1038 sgml-system-path List of directories used to look for system identifiers. 1047 sgml-system-path List of directorys used to look for system identifiers.
1039 sgml-public-map Mapping from public identifiers to file names. 1048 sgml-public-map Mapping from public identifiers to file names.
1040 sgml-offer-save If non-nil, ask about saving modified buffers before 1049 sgml-offer-save If non-nil, ask about saving modified buffers before
1041 \\[sgml-validate] is run. 1050 \\[sgml-validate] is run.
1042 1051
1043 All bindings: 1052 All bindings:
1075 (setq comment-start-skip "<!--[ \t]*") 1084 (setq comment-start-skip "<!--[ \t]*")
1076 ;; Added for psgml: 1085 ;; Added for psgml:
1077 (make-local-variable 'indent-line-function) 1086 (make-local-variable 'indent-line-function)
1078 (setq indent-line-function 'sgml-indent-line) 1087 (setq indent-line-function 'sgml-indent-line)
1079 (make-local-variable 'mode-line-format) 1088 (make-local-variable 'mode-line-format)
1080 ;; Modify mode-line-format with susbt (sugested by wing) 1089 ;; wing change: use `subst' rather than duplicating the whole
1090 ;; mode-line-format. XEmacs 19.14 changes the default mode-line-format.
1081 (setq mode-line-format 1091 (setq mode-line-format
1082 (subst '("" mode-name sgml-active-dtd-indicator) 'mode-name 1092 (subst '("" mode-name sgml-active-dtd-indicator) 'mode-name
1083 mode-line-format)) 1093 mode-line-format))
1084 (make-local-variable 'sgml-default-dtd-file) 1094 (make-local-variable 'sgml-default-dtd-file)
1085 (when (setq sgml-default-dtd-file (sgml-default-dtd-file)) 1095 (when (setq sgml-default-dtd-file (sgml-default-dtd-file))
1437 (sgml-running-xemacs 1447 (sgml-running-xemacs
1438 (require 'psgml-xemacs)) 1448 (require 'psgml-xemacs))
1439 (t 1449 (t
1440 (require 'psgml-other))) 1450 (require 'psgml-other)))
1441 1451
1442 ;;; psgml.el ends here 1452 ;;; psgml.el ends HERE