;ELC ;;; compiled by rms@psilocin.gnu.ai.mit.edu on Thu Aug 1 18:17:13 1996 ;;; from file /home/fsf/rms/e19/lisp/sgml-mode.el ;;; emacs version 19.31.97.4. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`sgml-mode.el' was compiled for Emacs 19.29 or later")) #@631 List of characters that have a special meaning for sgml-mode. This list is used when first loading the sgml-mode library. The supported characters and potential disadvantages are: ?\" Makes " in text start a string. ?' Makes ' in text start a string. ?- Makes -- in text start a comment. When only one of ?\" or ?' are included, "'" or '"' as it can be found in DTDs, start a string. To partially avoid this problem this also makes these self insert as named entities depending on `sgml-quick-keys'. must contain an even multiple of two (4, 8, ...) minuses, or Emacs' syntax mechanism won't recognize a comment. (defvar sgml-specials (quote (34 45)) (#$ . 481)) #@124 Use <, >, &, SPC and `sgml-specials' keys ``electrically'' when non-nil. This takes effect when first loading the library. (defvar sgml-quick-keys nil (#$ . 1168)) #@50 Keymap for SGML mode. See also `sgml-specials'. (defvar sgml-mode-map (byte-code "\"D!###############$####,>#,>#A@22T2W2I*B######@#AB#CD#EF#*" [keymap make-vector 256 nil make-sparse-keymap "SGML" menu-map map define-key " " indent-relative-maybe " " sgml-tags-invisible "/" sgml-slash "" sgml-name-char "" sgml-tag "" sgml-attributes "" sgml-skip-tag-backward [3 left] "" sgml-skip-tag-forward [3 right] "" sgml-delete-tag "" "?" sgml-tag-help "8" sgml-name-8bit-mode "" sgml-validate sgml-quick-keys "&" "<" " " sgml-auto-attributes ">" sgml-maybe-end-tag 34 sgml-specials "\"" sgml-name-self 39 "'" 127 c sgml-maybe-name-self [menu-bar sgml] [sgml-validate] ("Validate" . sgml-validate) [sgml-name-8bit-mode] ("Toggle 8 Bit Insertion" . sgml-name-8bit-mode) [sgml-tags-invisible] ("Toggle Tag Visibility" . sgml-tags-invisible) [sgml-tag-help] ("Describe Tag" . sgml-tag-help) [sgml-delete-tag] ("Delete Tag" . sgml-delete-tag) [sgml-skip-tag-forward] ("Forward Tag" . sgml-skip-tag-forward) [sgml-skip-tag-backward] ("Backward Tag" . sgml-skip-tag-backward) [sgml-attributes] ("Insert Attributes" . sgml-attributes) [sgml-tag] ("Insert Tag" . sgml-tag)] 5) (#$ . 1338)) #@60 Syntax table used in SGML mode. See also `sgml-specials'. (defvar sgml-mode-syntax-table (byte-code " !\n#\n# >\n# >*\n# >7\n#\n)" [copy-syntax-table text-mode-syntax-table table modify-syntax-entry 60 "(>" 62 ")<" 45 sgml-specials "_ 1234" 34 "\"\"" 39 "\"'"] 4) (#$ . 2781)) #@59 *When non-`nil' insert 8 bit characters with their names. (defvar sgml-name-8bit-mode nil (#$ . -3101)) #@57 Vector of symbolic character names without `&' and `;'. (defvar sgml-char-names [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil "ensp" "excl" "quot" "num" "dollar" "percnt" "amp" "apos" "lpar" "rpar" "ast" "plus" "comma" "hyphen" "period" "sol" nil nil nil nil nil nil nil nil nil nil "colon" "semi" "lt" "eq" "gt" "quest" "commat" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil "lsqb" nil "rsqb" "uarr" "lowbar" "lsquo" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil "lcub" "verbar" "rcub" "tilde" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil "nbsp" "iexcl" "cent" "pound" "curren" "yen" "brvbar" "sect" "uml" "copy" "ordf" "laquo" "not" "shy" "reg" "macr" "ring" "plusmn" "sup2" "sup3" "acute" "micro" "para" "middot" "cedil" "sup1" "ordm" "raquo" "frac14" "half" "frac34" "iquest" "Agrave" "Aacute" "Acirc" "Atilde" "Auml" "Aring" "AElig" "Ccedil" "Egrave" "Eacute" "Ecirc" "Euml" "Igrave" "Iacute" "Icirc" "Iuml" "ETH" "Ntilde" "Ograve" "Oacute" "Ocirc" "Otilde" "Ouml" nil "Oslash" "Ugrave" "Uacute" "Ucirc" "Uuml" "Yacute" "THORN" "szlig" "agrave" "aacute" "acirc" "atilde" "auml" "aring" "aelig" "ccedil" "egrave" "eacute" "ecirc" "euml" "igrave" "iacute" "icirc" "iuml" "eth" "ntilde" "ograve" "oacute" "ocirc" "otilde" "ouml" "divide" "oslash" "ugrave" "uacute" "ucirc" "uuml" "yacute" "thorn" "yuml"] (#$ . 3211)) #@134 *The command to validate an SGML document. The file name of current buffer file name will be appended to this, separated by a space. (defvar sgml-validate-command "sgmls -s" (#$ . -4824)) #@51 The command last used to validate in this buffer. (defvar sgml-saved-validate-command nil (#$ . 5018)) #@64 *If non-nil, is the maximum distance to search for matching /. (defconst sgml-slash-distance 1000 (#$ . -5127)) #@95 Regular expression that matches a non-empty start tag. Any terminating > or / is not matched. (defconst sgml-start-tag-regex "<[A-Za-z]\\([-.A-Za-z0-9= \n ]\\|\"[^\"]*\"\\|'[^']*'\\)*" (#$ . 5245)) #@69 *Rules for highlighting SGML code. See also `sgml-tag-face-alist'. (defvar sgml-font-lock-keywords (quote (("<\\([!?][a-z0-9]+\\)" 1 font-lock-keyword-face) ("<\\(/?[a-z0-9]+\\)" 1 font-lock-function-name-face) ("[&%][-.A-Za-z0-9]+;?" . font-lock-variable-name-face))) (#$ . -5449)) (byte-code "! B‡" [boundp sgml-font-lock-keywords-1 nil current-load-list] 2) #@42 Alist of face and tag name for facemenu. (defvar sgml-face-tag-alist nil (#$ . 5827)) #@217 Tag names and face or list of faces to fontify with when invisible. When `font-lock-maximum-decoration' is 1 this is always used for fontifying. When more these are fontified together with `sgml-font-lock-keywords'. (defvar sgml-tag-face-alist nil (#$ . 5920)) #@68 Tag names as lowercase symbols, and display string when invisible. (defvar sgml-display-text nil (#$ . 6187)) (byte-code "! B‡" [boundp sgml-tags-invisible nil current-load-list] 2) #@550 *Alist of tag names for completing read and insertion rules. This alist is made up as (("tag" . TAGRULE) ...) TAGRULE is a list of optionally `t' (no endtag) or `\n' (separate endtag by newlines) or a skeleton with `nil', `t' or `\n' in place of the interactor followed by an ATTRIBUTERULE (for an always present attribute) or an attribute alist. The attribute alist is made up as (("attribute" . ATTRIBUTERULE) ...) ATTRIBUTERULE is a list of optionally `t' (no value when no input) followed by an optional alist of possible values. (defvar sgml-tag-alist (quote (("![" ("ignore" t) ("include" t)) ("!attlist") ("!doctype") ("!element") ("!entity"))) (#$ . -6386)) #@43 *Alist of tag name and short description. (defvar sgml-tag-help (quote (("!" . "Empty declaration for comment") ("![" . "Embed declarations with parser directive") ("!attlist" . "Tag attributes declaration") ("!doctype" . "Document type (DTD) declaration") ("!element" . "Tag declaration") ("!entity" . "Entity (macro) declaration"))) (#$ . -7073)) (byte-code "N!\"\"" [sgml-tag invisible setplist append (invisible t rear-nonsticky t point-entered sgml-point-entered read-only t) symbol-plist] 6) #@230 Common code for setting up `sgml-mode' and derived modes. SGML-TAG-FACE-ALIST is used for calculating `sgml-font-lock-keywords-1'. SGML-DISPLAY-TEXT sets up alternate text for when tags are invisible (see varables of same name). (defalias 'sgml-mode-common #[(sgml-tag-face-alist sgml-display-text) " \f!!!!!!!!!!!!!!!!!!tt#QDEDEDC\n \f A..@@.@A#.A.\"" [kill-all-local-variables text-mode-abbrev-table local-abbrev-table set-syntax-table sgml-mode-syntax-table make-local-variable indent-line-function paragraph-start paragraph-separate sgml-saved-validate-command comment-start comment-end comment-indent-function comment-start-skip sgml-tags-invisible skeleton-transformation skeleton-further-elements skeleton-end-hook font-lock-defaults sgml-font-lock-keywords-1 facemenu-add-face-function facemenu-end-add-face sgml-tag-face-alist 1 "<\\(" mapconcat car "\\|" "\\)\\([ ].+\\)?>\\(.+\\)" 3 cdr assoc (match-string 1) quote indent-relative-maybe "^[ \n]\\|\\($\\)" "^[ \n]*$\\|^$" "" sgml-comment-indent "--[ ]*" identity ((completion-ignore-case t)) #[nil "l==? " [v2 n newline-and-indent] 2] ((sgml-font-lock-keywords sgml-font-lock-keywords-1) nil t) #[(face end) " AQQ\"" [face sgml-face-tag-alist "" facemenu-end-add-face "<" error "Face not configured for %s mode." mode-name] 3] sgml-display-text put before-string run-hooks text-mode-hook sgml-mode-hook] 10 (#$ . 7592)]) #@315 Major mode for editing SGML documents. Makes > match <. Makes / blink matching /. Keys <, &, SPC within <>, " and ' can be electric depending on `sgml-quick-keys'. Do \[describe-variable] sgml- SPC to see available variables. Use \[sgml-validate] to validate your document with an SGML parser. \{sgml-mode-map} (defalias 'sgml-mode #[(&optional function) " \n\"\f!lj" [sgml-mode-common sgml-tag-face-alist sgml-display-text use-local-map sgml-mode-map "SGML" mode-name sgml-mode major-mode] 3 (#$ . 9323) nil]) (defalias 'sgml-comment-indent #[nil "!h=`Zf=xiT]ȇ" [looking-at "--" 33 2 60 " " nil comment-column 0] 2]) #@176 Insert / and display any previous matching /. Two /s are treated as matching if the first / ends a net-enabling start tag, and the second / is the corresponding null end tag. (defalias 'sgml-slash #[(arg) "\n\"\nV`$e`Z]}\ne#6ÕS=vSbve#v\ne#TÕ)`=o =i`r Sr T);)b !y`T{\"," [insert-char 47 arg 0 nil level blinkpos oldpos sgml-slash-distance re-search-backward sgml-start-tag-regex t search-backward "/" tagend pos-visible-in-window-p sit-for 1 message "Matches %s"] 5 (#$ . 9983) "p"]) #@170 Insert a symbolic character name according to `sgml-char-names'. 8 bit chars may be inserted with the meta key as in M-SPC for no break space, or M-- for a soft hyphen. (defalias 'sgml-name-char #[(&optional char) "c \n ! c ! H$ \"ɱ" [38 char read-quoted-char delete-backward-char 1 undo-boundary sgml-char-names format "#%d" 59] 4 (#$ . 10569) "*"]) #@66 Insert a symbolic character name according to `sgml-char-names'. (defalias 'sgml-name-self #[nil " !" [sgml-name-char last-command-char] 2 (#$ . 10951) "*"]) #@66 Insert a symbolic character name according to `sgml-char-names'. (defalias 'sgml-maybe-name-self #[nil "\n!!" [sgml-name-8bit-mode sgml-name-char last-command-char self-insert-command 1] 2 (#$ . 11117) "*"]) #@39 Toggle insertion of 8 bit characters. (defalias 'sgml-name-8bit-mode #[nil "?" [sgml-name-8bit-mode] 2 (#$ . 11340) nil]) #@640 Insert a tag you are prompted for, optionally with attributes. Completion and configuration is according to `sgml-tag-alist'. If you like tags and attributes in uppercase set `skeleton-transformation' to `upcase'. This is a skeleton command (see `skeleton-insert'). Normally the skeleton text is inserted at point, with nothing "inside". If there is a highlighted region, the skeleton text is wrapped around the region text. A prefix argument ARG says to wrap the skeleton around the next ARG words. A prefix argument of zero says to wrap around zero words---that is, nothing. This is a way of overiding the use of a highlighted region. (defalias 'sgml-tag #[(&optional str arg) "\n #" [skeleton-proxy-new ((funcall skeleton-transformation (completing-read "Tag: " sgml-tag-alist)) 60 (setq v1 (eval str)) | (("") -1 (quote (undo-boundary)) "<") | (("") (quote (setq v2 (sgml-attributes v1 t))) 62 (if (string= "![" v1) (prog1 (quote (("") " [ " _ " ]]")) (backward-char)) (if (or (eq v2 t) (string-match "^[/!?]" v1)) nil (if (symbolp v2) (quote (("") v2 _ v2 "H==O \"A>\"" [tag 60 nil sgml-beginning-of-tag error "No tag selected" message "%s" assoc sgml-tag-help 0 47 1 "No description available"] 6 (#$ . 13781) nil]) #@44 Name self unless in position to end a tag. (defalias 'sgml-maybe-end-tag #[nil " ď" [nil (byte-code "!)" [up-list -1] 2) ((error (sgml-name-self) t)) (byte-code "!) " [up-list 1 sgml-name-self] 2) ((error (self-insert-command 1)))] 3 (#$ . 14100) nil]) #@103 Skip to beginning of tag or matching opening tag if present. With prefix ARG, repeat that many times. (defalias 'sgml-skip-tag-backward #[(arg) "YA#!:!!P \f #9`Tf=9u!*S" [arg 1 search-backward "<" nil t looking-at "]+\\)" "" nil 62 up-list -1 looking-at "<\\([^/ \n >]+\\)" "" str n)) ("type" ("A") ("a") ("I") ("i") ("1"))) list t "valign" "colspan" "rowspan" (("nowrap" t)) cell "a" "base" "dir" "font" "size" ("-1") ("+1") ("-2") ("+2") "form" (n _ n "") "action" (("method" ("get") ("post"))) "h1" "h2" "h3" "h4" "h5" "h6" "hr" ("width") ("noshade" t) "img" "align" append (("texttop") ("absmiddle") ("absbottom")) (("src") ("alt") ("width" "1") ("height" "1") ("border" "1") ("vspace" "1") ("hspace" "1") ("ismap" t)) "input" "maxlength" ("checked" t) (("type" ("text") ("password") ("checkbox") ("radio") ("submit") ("reset")) ("value")) "link" "menu" "ol" "p" "select" (nil n ("Text: " "