;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:25:23 2007 ;;; from file /home/cyd/emacs/lisp/textmodes/sgml-mode.el ;;; in Emacs version 22.0.99 ;;; with all optimizations. ;;; This file contains multibyte non-ASCII characters ;;; and therefore cannot be loaded into Emacs 19. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "20"))) (error "`sgml-mode.el' was compiled for Emacs 20 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (custom-declare-group 'sgml nil "SGML editing mode." :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) :group 'languages) #@64 *Specifies the basic indentation level for `sgml-indent-line'. (custom-declare-variable 'sgml-basic-offset '2 '(#$ . -719) :type 'integer :group 'sgml) #@69 *Default value for `skeleton-transformation-function' in SGML mode. (custom-declare-variable 'sgml-transformation-function ''identity '(#$ . -877) :type 'function :group 'sgml) (byte-code "\300\301\302\303#\210\304\305\301\"\207" [put sgml-transformation-function variable-interactive "aTransformation function: " defvaralias sgml-transformation] 4) #@65 Hook run by command `sgml-mode'. `text-mode-hook' is run first. (custom-declare-variable 'sgml-mode-hook 'nil '(#$ . 1233) :group 'sgml :type 'hook) #@627 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 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'. Including ?- has the problem of affecting dashes that have nothing to do with comments, so we normally turn it off. (defvar sgml-specials '(34) (#$ . 1389)) #@137 Use <, >, &, /, SPC and `sgml-specials' keys "electrically" when non-nil. This takes effect when first loading the `sgml-mode' library. (defvar sgml-quick-keys nil (#$ . 2063)) #@50 Keymap for SGML mode. See also `sgml-specials'. (defvar sgml-mode-map (byte-code "\305 \306\307!\310 \311\312#\210\310 \313\314#\210\310 \315\316#\210\310 \317\320#\210\310 \321\322#\210\310 \323\324#\210\310 \325\324#\210\310 \326\327#\210\310 \330\327#\210\310 \331\332#\210\310 \333\332#\210\310 \334\335#\210\310 \336\337#\210\310 \340\341#\210\310 \342\343#\210\n\203\225\310 \344\316#\210\310 \345\320#\210\310 \346\347#\210\310 \350\351#\210\352 >\203\211\310 \353\354#\210\355 >\203\225\310 \356\354#\210\310 \357\360\361!!\362#\210\363 A@\fT\211\364W\203\266 \f\362I\210\202\245*\310 \365\307B#\210\310\366\367#\210\310\370\371#\210\310\372\373#\210\310\374\375#\210\310\376\377#\210\310\201@\201A#\210\310\201B\201C#\210\310\201D\201E#\210\310\201F\201G#\210 *\207" [menu-map map sgml-quick-keys sgml-specials c make-keymap make-sparse-keymap "SGML" define-key " " 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 "/" sgml-close-tag "8" sgml-name-8bit-mode "" sgml-validate "&" "<" " " sgml-auto-attributes ">" sgml-maybe-end-tag 34 "\"" sgml-name-self 39 "'" vector make-char-internal 129 sgml-maybe-name-self 127 256 [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) (#$ . 2246)) (defalias 'sgml-make-syntax-table #[(specials) "\303!\304\305\306 #\210\304\307\310 #\210\304\311\312 #\210\304\313\312 #\210\304\314\312 #\210\315\n>\203.\304\315\316 #\210\317\n>\203:\304\317\320 #\210\321\n>\203F\304\321\322 #\210 )\207" [text-mode-syntax-table table specials make-syntax-table modify-syntax-entry 60 "(>" 62 ")<" 58 "_" 95 46 45 "_ 1234" 34 "\"\"" 39 "\"'"] 4]) #@60 Syntax table used in SGML mode. See also `sgml-specials'. (defvar sgml-mode-syntax-table (sgml-make-syntax-table sgml-specials) (#$ . 4508)) #@39 Syntax table used to parse SGML tags. (defconst sgml-tag-syntax-table (byte-code "\303\304!\305\306\211\203\n@\307 \310#\210\nA\211\204\f*)\207" [table char #1=#:--cl-dolist-temp-- sgml-make-syntax-table (45 34 39) (40 41 123 125 91 93 36 37 38 42 43 47) nil modify-syntax-entry "."] 5) (#$ . 4656)) #@63 *When non-nil, insert non-ASCII characters as named entities. (custom-declare-variable 'sgml-name-8bit-mode 'nil '(#$ . -4972) :type 'boolean :group 'sgml) #@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 "nbsp" "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" "frac12" "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"] (#$ . 5134)) (put 'sgml-table 'char-table-extra-slots 0) #@116 A table for mapping non-ASCII characters into SGML entity names. Currently, only Latin-1 characters are supported. (defvar sgml-char-names-table (byte-code "\304\305!\306\307 \310W\203% H\211\203\n\311\312 \"I\210 T\211\202 \n+\207" [elt i table sgml-char-names make-char-table sgml-table 32 nil 256 make-char-internal 129] 5) (#$ . 6793)) #@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. (custom-declare-variable 'sgml-validate-command '"nsgmls -s" '(#$ . -7151) :type 'string :version "21.1" :group 'sgml) #@51 The command last used to validate in this buffer. (defvar sgml-saved-validate-command nil (#$ . 7409)) #@66 *If non-nil, is the maximum distance to search for matching `/'. (custom-declare-variable 'sgml-slash-distance '1000 '(#$ . -7518) :type '(choice (const nil) integer) :group 'sgml) (byte-code "\302B\303\304!\210\301B\305\306!\210\307B\310\311 \312Q!\210\313B\314\315!\207" [current-load-list sgml-name-re sgml-namespace-re (lambda (#1=#:defconst-tmp-var) (defconst sgml-namespace-re #1#)) "[_[:alpha:]][-_.[:alnum:]]*" (lambda (#2=#:defconst-tmp-var) (defconst sgml-name-re #2#)) "[_:[:alpha:]][-_.:[:alnum:]]*" sgml-tag-name-re (lambda (#3=#:defconst-tmp-var) (defconst sgml-tag-name-re #3#)) "<\\([!/?]?" "\\)" sgml-attrs-re (lambda (#4=#:defconst-tmp-var) (defconst sgml-attrs-re #4#)) "\\(?:[^\"'/><]\\|\"[^\"]*\"\\|'[^']*'\\)*"] 4) #@99 Regular expression that matches a non-empty start tag. Any terminating `>' or `/' is not matched. (defconst sgml-start-tag-regex (concat "<" sgml-name-re sgml-attrs-re) (#$ . 8269)) (byte-code "\304\305\306\307\310\311%\210\312B\313\312!\204\314\312\305\"\210\303B\315\316 \317Q\320B\321\n\322 \323\260\324B\325\n\322 \326\260\327B\330 \331Q\332BF!\210\333B\334\335 \336\"!\207" [current-load-list sgml-name-re sgml-namespace-re sgml-font-lock-keywords-1 custom-declare-face sgml-namespace ((t (:inherit font-lock-builtin-face))) "`sgml-mode' face used to highlight the namespace part of identifiers." :group sgml sgml-namespace-face default-boundp set-default (lambda (#1=#:defconst-tmp-var) (defconst sgml-font-lock-keywords-1 #1#)) "<\\([!?]" "\\)" (1 font-lock-keyword-face) "]*\\)?>\\([^<]+\\)") '(3 (cdr (assoc (downcase (match-string 1)) sgml-tag-face-alist)) prepend)))] 8) #@69 *Rules for highlighting SGML code. See also `sgml-tag-face-alist'. (defvar sgml-font-lock-keywords sgml-font-lock-keywords-1 (#$ . -9702)) #@37 Syntactic keywords for `sgml-mode'. (defvar sgml-font-lock-syntactic-keywords '(("\\(<\\)!--" (1 "< b")) ("--[ \n]*\\(>\\)" (1 "> b"))) (#$ . 9848)) #@42 Alist of face and tag name for facemenu. (defvar sgml-face-tag-alist nil (#$ . 10004)) #@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 (#$ . 10098)) #@68 Tag names as lowercase symbols, and display string when invisible. (defvar sgml-display-text nil (#$ . 10366)) (byte-code "\301B\302\301!\204\303\301\304\"\210\304\207" [current-load-list sgml-tags-invisible default-boundp set-default nil] 3) #@542 *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. (custom-declare-variable 'sgml-tag-alist ''(("![" ("ignore" t) ("include" t)) ("!attlist") ("!doctype") ("!element") ("!entity")) '(#$ . -10620) :type '(repeat (cons (string :tag "Tag Name") (repeat :tag "Tag Rule" sexp))) :group 'sgml) (put 'sgml-tag-alist 'risky-local-variable t) #@43 *Alist of tag name and short description. (custom-declare-variable 'sgml-tag-help ''(("!" . "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")) '(#$ . -11450) :type '(repeat (cons (string :tag "Tag Name") (string :tag "Description"))) :group 'sgml) #@219 *When non-nil, tag insertion functions will be XML-compliant. If this variable is customized, the custom value is used always. Otherwise, it is set to be buffer-local when the file has a DOCTYPE or an XML declaration. (custom-declare-variable 'sgml-xml-mode 'nil '(#$ . -11909) :type 'boolean :version "22.1" :group 'sgml) #@52 List of tags whose !ELEMENT definition says EMPTY. (defvar sgml-empty-tags nil (#$ . 12238)) #@70 List of tags whose !ELEMENT definition says the end-tag is optional. (defvar sgml-unclosed-tags nil (#$ . 12337)) #@42 Guess whether the current buffer is XML. (defalias 'sgml-xml-guess #[nil "\212eb\210\302\206\n\303!\304\230\204'\305\306!\204'\307\310\311\312#\205.\313\314\315\316!\"\205.\317\301!\210\312\211)\207" [buffer-file-name sgml-xml-mode file-name-extension "" "xml" looking-at "\\s-*<\\?xml" re-search-forward "" "<" error "Face not configured for %s mode"] 3]) (defalias 'sgml-fill-nobreak #[nil "\212\300\301x\210\302\303\304!!?\205\305\301x\205`Sf\306=)\207" [" " nil zerop skip-syntax-backward "w_" "/?!" 60] 3]) (byte-code "\302\303N\204\f\304\302\303\305#\210\306\307!\204\304\307\310\311#\210\307B\312\307!\204(\313\307\314 \"\210\306\315!\2044\304\315\310\311#\210\315B\312\315!\204D\313\315\316 \"\210\304\301\310\311#\210\301B\312\301!\204^\313\301\317\301\320\"\210 \"\210\304\311\321\322#\207" [current-load-list sgml-mode-abbrev-table sgml-mode-hook variable-documentation put "Hook run when entering SGML mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp sgml-mode-map definition-name sgml-mode default-boundp set-default make-sparse-keymap sgml-mode-syntax-table make-syntax-table define-abbrev-table nil derived-mode-parent text-mode] 5) #@818 Major mode for editing SGML documents. Makes > match <. Keys <, &, SPC within <>, ", / and ' can be electric depending on `sgml-quick-keys'. An argument of N to a tag-inserting command means to wrap it around the next N words. In Transient Mark mode, when the mark is active, N defaults to -1, which means to wrap it around the current region. If you like upcased tags, put (setq sgml-transformation-function 'upcase) in your `.emacs' file. Use \[sgml-validate] to validate your document with an SGML parser. Do \[describe-variable] sgml- SPC to see available variables. Do \[describe-key] on the following bindings to discover what they do. \{sgml-mode-map} In addition to any hooks its parent mode `text-mode' might have run, this mode runs the hook `sgml-mode-hook', as the final step during initialization. (defalias 'sgml-mode #[nil "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2036 \321 =\203<\322\f\323 \"\210)\324 !\210\325\f!\210@A\306\326!\210\306\327!\210\306\330!\210\331BC\332R\306\333!\210\334P\306\335!\210\336\337\340\341\342\307$\210\306\343!\210\344#\306\345!\210\346%\306\347!\210\350'\306\351!\210\352)\306\353!\210\354+\306\355!\210\356-\306\357!\210\360/\306\361!\210\3621\306\363!\210\3643\365 \210D\203\302\366\202\312\306\367!\210E7\306\370!\210\3718\306\372!\210\373:\342\374B\375Q\376BB\377\201GD\203\360\201H\202\363\201I\201JB\201K\260\201LBB\201M\201ND\203\201H\202\201I\201JB\201K\260\201OBBEF)\201P\201Q!\203;\201Q\201R!\207\201S\201R!\207" [delay-mode-hooks major-mode mode-name sgml-mode-map sgml-mode-syntax-table parent make-local-variable t text-mode sgml-mode "SGML" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table use-local-map set-syntax-table sgml-saved-validate-command facemenu-end-add-face paragraph-start "[ ]*$\\|[ ]*" paragraph-separate "$" adaptive-fill-regexp "[ ]*" add-hook fill-nobreak-predicate sgml-fill-nobreak nil indent-line-function sgml-indent-line comment-start "" comment-indent-function sgml-comment-indent comment-line-break-function sgml-comment-indent-new-line skeleton-further-elements ((completion-ignore-case t)) skeleton-end-hook #[nil "l\206\301=\206\242\301=?\206\302 \207" [v2 n newline-and-indent] 2] font-lock-defaults ((sgml-font-lock-keywords sgml-font-lock-keywords-1 sgml-font-lock-keywords-2) nil t nil nil (font-lock-syntactic-keywords . sgml-font-lock-syntactic-keywords)) facemenu-add-face-function sgml-mode-facemenu-add-face-function sgml-xml-guess "XML" skeleton-transformation-function comment-start-skip "\\(?:\\)?" "]+[ \n]+[Ii][Dd]=\\(['\"]" "" "?" "\\)\\(" "\\)\\1" (2) "Name" "<[^>]+[ \n]+[Nn][Aa][Mm][Ee]=\\(['\"]" (2) fboundp run-mode-hooks sgml-mode-hook run-hooks] 9 (#$ . 14350) nil]) (defalias 'xml-mode 'sgml-mode) (defalias 'sgml-comment-indent #[nil "\301\302!\203\207\303\207" [comment-column looking-at "--" 0] 2]) #@84 Insert ARG slash characters. Behaves electrically if `sgml-quick-keys' is non-nil. (defalias 'sgml-slash #[(arg) "`Sf\302=\203\303U\204\304!\207 \305=\203 \306\307\303\"\210\310 \207 \311=\203-\312\303!\210\313 \207\304!\207" [arg sgml-quick-keys 60 1 sgml-slash-matching indent insert-char 47 indent-according-to-mode close delete-backward-char sgml-close-tag] 3 (#$ . 17718) "p"]) #@186 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-matching #[(arg) "\306\307\"\210\310V\205\207`\311\310\212\214\f\203e`\fZ] }\210\312 e\313#\203/\310\225 S=\204k Sb\210\n\204k\314\315e\313#\203k\212\312 e\313#\205J\310\225)\211`=\203d \310=\203^`\202g S\202g T)\2023)\n\205\206\nb\210\316 \203~\317\320!\202\206\321\322\323 \nT{\",\207" [arg level blinkpos oldpos sgml-slash-distance sgml-start-tag-regex insert-char 47 0 nil re-search-backward t search-backward "/" pos-visible-in-window-p sit-for 1 message "Matches %s" line-beginning-position tagend] 5 (#$ . 18117) "p"]) #@235 Insert a symbolic character name according to `sgml-char-names'. Non-ASCII chars may be inserted either with the meta key, as in M-SPC for no-break space or M-- for a soft hyphen; or via an input method or encoded keyboard operation. (defalias 'sgml-name-char #[(&optional char) "\301c\210\204 \302\303!\304\305!\210c\210\306 \210\307 \207" [char 38 read-quoted-char "Enter char or octal number" delete-backward-char 1 undo-boundary sgml-namify-char] 2 (#$ . 18883) "*"]) #@84 Change the char before point into its `&name;' equivalent. Uses `sgml-char-names'. (defalias 'sgml-namify-char #[nil "`Sf\211\204\304\305!\202(\306W\203 H\206(\202(\nH\206(\307\310\"\211\2044\304\311\"\202F\312\313!\210\314 \247\203B\315\202C\316 \"c*\207" [char sgml-char-names sgml-char-names-table name error "No char before point" 256 encode-char ucs "Don't know the name of `%c'" delete-backward-char 1 format "&#%d;" "&%s;"] 4 (#$ . 19365) nil]) #@66 Insert a symbolic character name according to `sgml-char-names'. (defalias 'sgml-name-self #[nil "\301!\207" [last-command-char sgml-name-char] 2 (#$ . 19843) "*"]) #@66 Insert a symbolic character name according to `sgml-char-names'. (defalias 'sgml-maybe-name-self #[nil "\203 \211\303W\203\304\n!\n\204 \305\n!)\207\306\307!\207" [sgml-name-8bit-mode last-command-char mc 256 unibyte-char-to-multibyte sgml-name-char self-insert-command 1] 3 (#$ . 20015) "*"]) #@109 Toggle whether to insert named entities instead of non-ASCII characters. This only works for Latin-1 input. (defalias 'sgml-name-8bit-mode #[nil "?\301\302\203 \303\202\304\"\207" [sgml-name-8bit-mode message "sgml name entity mode is now %s" "ON" "OFF"] 3 (#$ . 20326) nil]) (byte-code "\301B\302\301!\204\303\301\304\"\210\305B\302\305!\204\303\305\304\"\210\306\307\310\311#\207" [current-load-list sgml-tag-last default-boundp set-default nil sgml-tag-history put sgml-tag no-self-insert t] 4) #@826 Prompt for a tag and insert it, optionally with attributes. Completion and configuration are done according to `sgml-tag-alist'. If you like tags and attributes in uppercase do \[set-variable] `skeleton-transformation-function' RET `upcase' RET, or put this in your `.emacs': (setq sgml-transformation-function '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 -1 says to wrap around region, even if not highlighted. A prefix argument of zero says to wrap around zero words---that is, nothing. This is a way of overriding the use of a highlighted region. (defalias 'sgml-tag #[(&optional str arg) "\302\303 #\207" [str arg skeleton-proxy-new ((funcall (or skeleton-transformation-function 'identity) (setq sgml-tag-last (completing-read (if (> (length sgml-tag-last) 0) (format "Tag (default %s): " sgml-tag-last) "Tag: ") sgml-tag-alist nil nil nil 'sgml-tag-history sgml-tag-last))) 60 str | (("") -1 '(undo-boundary) (identity "<")) | `(("") '(setq v2 (sgml-attributes ,str t)) 62 (cond ((string= "![" ,str) (backward-char) '(("") " [ " _ " ]]")) ((and (eq v2 t) sgml-xml-mode (member ,str sgml-empty-tags)) '(("") -1 " />")) ((or (and (eq v2 t) (not sgml-xml-mode)) (string-match "^[/!?]" ,str)) nil) ((symbolp v2) (if (eq v2 t) (setq v2 nil)) '(("") v2 _ v2 "\312H\313=\203=\311\314\303O\227 \"A\206>\315\"\207" [tag sgml-tag-help 60 nil sgml-beginning-of-tag error "No tag selected" message "%s" assoc 0 47 1 "No description available"] 6 (#$ . 24020) nil]) #@69 Name self unless in position to end a tag or a prefix ARG is given. (defalias 'sgml-maybe-end-tag #[(&optional arg) "\204\f\301 @\302=\203\303\304!!\207\305 \207" [arg sgml-lexical-context tag self-insert-command prefix-numeric-value sgml-name-self] 3 (#$ . 24441) "P"]) #@111 Skip to beginning of tag or matching opening tag if present. With prefix argument ARG, repeat this ARG times. (defalias 'sgml-skip-tag-backward #[(arg) "\303Y\205?\304\305\306\307#\210\310\311!\2038\307\312\313\314\303!!\315Q\316 \306\307#\2037`Tf\317=\2037\303u\210\320\303!\210\202*S\211\202\207" [arg re case-fold-search 1 search-backward "<" nil t looking-at "]+\\)" "]*[^/>]\\)?>" re-search-backward 47 sgml-skip-tag-backward] 6 (#$ . 24724) "p"]) #@139 Skip to end of tag or matching closing tag if present. With prefix argument ARG, repeat this ARG times. Return t iff after a closing tag. (defalias 'sgml-skip-tag-forward #[(arg) "\306\307 p\310\216\311 !\210\f\312Y\203~\313\314w\210g\315=\203!\316\317!\210\320\321!\203s\306\322\323\324\312!!\325Q\314\211\326\312!\210`\327\314\306#\203e\330\224Tf\331=\211\204e\330\224b\203e\332\312!\203e\314\202@ \204ob\210\314,\202w\326\312!\210\fS\211\202,\207" [return #1=#:buffer #2=#:table sgml-tag-syntax-table arg close t syntax-table ((byte-code "rq\210\302 !\210)\302\207" [#1# #2# set-syntax-table] 2)) set-syntax-table 1 "^<>" nil 62 up-list -1 looking-at "<\\([^/ \n >]+\\)\\([^>]*[^/>]\\)?>" "]*[^/>]\\)?>" forward-list re-search-forward 0 47 sgml-skip-tag-forward point re case-fold-search] 6 (#$ . 25247) "p"]) #@118 Delete tag on or after cursor, and matching closing or opening tag. With prefix argument ARG, repeat this ARG times. (defalias 'sgml-delete-tag #[(arg) "\304Y\205\252\212\305\211\306\307!\203\"\310\225f\311=\203W`\310\225b\210\202W\212\312 \211;\2054 \310H\311=\2054`\211)\204W`\313\304!\210g\314=\203R\212\315\304!\210` X)\203V\316\317!\210) \203k\313\304!\210` b\210\320\304!\210\202}`\321\304!\203}\322\323!\204}\320\324!\210\310y\210\306\325!\203\214\310\224\310\225|\210\nb\210\320\304!\210\310y\210\306\325!\203\242\310\224\310\225|\210+S\211\202\207" [arg close open point 1 nil looking-at "[ \n]*<" 0 47 sgml-beginning-of-tag sgml-skip-tag-backward 60 forward-list error "Not on or before tag" kill-sexp sgml-skip-tag-forward looking-back "/>" -1 "\\(?:[ ]*$\\)\n?"] 3 (#$ . 26139) "p"]) (byte-code "\300\301N\204\302\300\303\304\305\300!\"\"\210\300\207" [sgml-tag invisible setplist append (invisible t point-entered sgml-point-entered rear-nonsticky t read-only t) symbol-plist] 6) #@37 Toggle visibility of existing tags. (defalias 'sgml-tags-invisible #[(arg) "\306 \307\211\310\307\310\311\216\212eb\210\312\313!\210#\203%\314#!\315Y\202( ?\211 \203t\316$\310\307#\203\266\317\320\321!\227!%\236A\315\224b\210;\203g\322`!\204g\323`\321\224\"&\324&\325#\210\324&\326\307#\210)\327`\330 \210`\331\326$\210\202.e'\332'!\211'dW\203\257\322'!\310&\211(\203\253(@&\333&\326\"\203\242\334&!\210(A\211(\204\220*\202w)\335ed\336#\210*\337\340!\210\341\342!.\207" [string inhibit-point-motion-hooks buffer-file-name inhibit-modification-hooks inhibit-read-only modified buffer-modified-p t nil ((restore-buffer-modified-p modified)) make-local-variable sgml-tags-invisible prefix-numeric-value 0 re-search-forward intern-soft match-string 1 overlays-at make-overlay overlay-put before-string sgml-tag put-text-property forward-list category next-overlay-change overlay-get delete-overlay remove-text-properties (category nil) run-hooks sgml-tags-invisible-hook message "" arg sgml-tag-name-re sgml-display-text ol pos #1=#:--cl-dolist-temp--] 6 (#$ . 27170) "P"]) (defalias 'sgml-point-entered #[(x y) "\303\212\304\305\306` \nV\203g\307=\203 \nW\203$h\310=\203$\311 \202&\312 \"\"*\207" [inhibit-point-motion-hooks x y t message "Invisible tag: %s" buffer-substring-no-properties 60 62 backward-list forward-list] 6]) #@277 Validate an SGML document. Runs COMMAND, a shell command, in a separate process asynchronously with output going to the buffer `*compilation*'. You can then use the command \[next-error] to find the next error message and move to the line in the SGML document that caused it. (defalias 'sgml-validate #[(command) "\303\n?\304\"\210\305!\207" [command sgml-saved-validate-command compilation-ask-about-save save-some-buffers nil compilation-start] 3 (#$ . 28553) (list (read-string "Validate command: " (or sgml-saved-validate-command (concat sgml-validate-command " " (shell-quote-argument (let ((name (buffer-file-name))) (and name (file-name-nondirectory name))))))))]) #@76 Return true if point is at the first non-whitespace character on the line. (defalias 'sgml-at-indentation-p #[nil "\212\300\301x\210n)\207" [" " nil] 2 (#$ . 29234)]) (put 'sgml-at-indentation-p 'byte-optimizer 'byte-compile-inline-expand) #@293 Return the lexical context at point as (TYPE . START). START is the location of the start of the lexical element. TYPE is one of `string', `comment', `tag', `cdata', or `text'. Optional argument LIMIT is the position to start parsing from. If nil, start from a preceding tag at indentation. (defalias 'sgml-lexical-context #[(&optional limit) "\212`\306\211 \203 b\210\202\"\306\307\310\217\203\"\212\311\306x\210n)\203\312 p\313\216\314!\210`\nW\203o`\315\nw\210`\nU\203D\306\202k\316\317!\203f`\320\321\n\322#?\205b\323\306\211\324\306\211\211\211\257 )\202k\325`\n\323#\202.+\3268\324=\203\200\324\3278B\202\262\3268\203\216\330\3278B\202\262\3318\203\234\332\3278B\202\262\203\257@\323V\203\257\333A@B\202\262\334 B,\207" [state text-start pos limit #1=#:buffer #2=#:table nil (sgml-parse-tag-backward) ((error)) " " syntax-table ((byte-code "rq\210\302 !\210)\302\207" [#1# #2# set-syntax-table] 2)) set-syntax-table "^<" looking-at "" move 0 cdata parse-partial-sexp 3 8 string 4 comment tag text sgml-tag-syntax-table cdata-start] 9 (#$ . 29482)]) #@82 Skip to beginning of tag and return its name. If this can't be done, return nil. (defalias 'sgml-beginning-of-tag #[(&optional top-level) "\303 \211@\304=\203Ab\210\305 !\205.\306\307!\202.\n?\205.@\310=?\205.Ab\210\311\312!)\207" [context sgml-tag-name-re top-level sgml-lexical-context tag looking-at match-string-no-properties 1 text sgml-beginning-of-tag t] 3 (#$ . 30625)]) #@114 Interactively insert value taken from attribute-rule ALIST. See `sgml-tag-alist' for info about attribute rules. (defalias 'sgml-value #[(alist) "A\211@;\203\302@\303\261\207@\304=\2036 \2046A\205D\302c\210\305\306!\307\231\2032\303\261\207\310\311!\207\302c\210\203B\305\312!c\210\303c\207" [alist sgml-xml-mode "=\"" 34 t skeleton-read (completing-read "Value: " (cdr alist)) "" delete-backward-char 2 (completing-read "Value: " alist)] 4 (#$ . 31021)]) #@149 Quote SGML text in region START ... END. Only &, < and > are quoted, the rest is left untouched. With prefix argument UNQUOTEP, unquote the region. (defalias 'sgml-quote #[(start end &optional unquotep) "\214 }\210eb\210\n\203>\303\304\305\306#\205T\307\310\225\203\311\202(\312\225\203'\313\202(\314\306\211\305\315\225Sf\316=\2038\315\2029\317%\210\202\f\303\320\305\306#\205T\307`Sf\321\236A\306\211#\210\202>)\207" [start end unquotep re-search-forward "\\(&\\(amp\\|\\(l\\|\\(g\\)\\)t\\)\\)[][<>&;\n \"%!'(),/=?]" nil t replace-match 4 ">" 3 "<" "&" 0 59 1 "[&<>]" ((38 . "&") (60 . "<") (62 . ">"))] 7 (#$ . 31502) "r\nP"]) #@168 Simple-minded pretty printer for SGML. Re-indents the code and inserts newlines between BEG and END. You might want to turn on `auto-fill-mode' to get better results. (defalias 'sgml-pretty-print #[(beg end) "\212 W\203 b\210\202 b\210`\305 \306\"\307 p\310\216\311\f!\210\312\313 \306#\205B\314\224b\210\315\316x\210n\204;\317 \210\320\321!\210\202$,\207" [beg end #1=#:buffer #2=#:table sgml-tag-syntax-table copy-marker t syntax-table ((byte-code "rq\210\302 !\210)\302\207" [#1# #2# set-syntax-table] 2)) set-syntax-table re-search-forward "<" 0 " " nil reindent-then-newline-and-indent forward-sexp 1] 4 (#$ . 32163) "r"]) (byte-code "\300\301\302\303#\210\301\304N\204\300\301\304\305#\210\300\207" [put sgml-tag-type cl-compiler-macro #[(--cl-whole-arg-- cl-x) "\301\302\303\304\211\211&\207" [cl-x cl-defsubst-expand (cl-x) (block sgml-tag-type (or (and (memq (aref cl-x 0) cl-struct-sgml-tag-tags)) (error "sgml-tag-type accessing a non-sgml-tag")) (aref cl-x 1)) nil] 7] byte-compile cl-byte-compile-compiler-macro] 4) (defalias 'sgml-tag-type #[(cl-x) "\302H >\204\f\303\304!\210\305H\207" [cl-x cl-struct-sgml-tag-tags 0 error "sgml-tag-type accessing a non-sgml-tag" 1] 2]) (byte-code "\300\301\302\303#\210\300\304\305\306#\210\304\307N\204\300\304\307\310#\210\300\207" [put sgml-tag-type setf-method #[(cl-x) "\301\302\303\304\305%\207" [cl-x cl-struct-setf-expander sgml-tag sgml-tag-type #1=(and (memq (aref cl-x 0) cl-struct-sgml-tag-tags)) 1] 6] sgml-tag-start cl-compiler-macro #[(--cl-whole-arg-- cl-x) "\301\302\303\304\211\211&\207" [cl-x cl-defsubst-expand (cl-x) (block sgml-tag-start (or #1# (error "sgml-tag-start accessing a non-sgml-tag")) (aref cl-x 2)) nil] 7] byte-compile cl-byte-compile-compiler-macro] 4) (defalias 'sgml-tag-start #[(cl-x) "\302H >\204\f\303\304!\210\305H\207" [cl-x cl-struct-sgml-tag-tags 0 error "sgml-tag-start accessing a non-sgml-tag" 2] 2]) (byte-code "\300\301\302\303#\210\300\304\305\306#\210\304\307N\204\300\304\307\310#\210\300\207" [put sgml-tag-start setf-method #[(cl-x) "\301\302\303\304\305%\207" [cl-x cl-struct-setf-expander sgml-tag sgml-tag-start #1=(and (memq (aref cl-x 0) cl-struct-sgml-tag-tags)) 2] 6] sgml-tag-end cl-compiler-macro #[(--cl-whole-arg-- cl-x) "\301\302\303\304\211\211&\207" [cl-x cl-defsubst-expand (cl-x) (block sgml-tag-end (or #1# (error "sgml-tag-end accessing a non-sgml-tag")) (aref cl-x 3)) nil] 7] byte-compile cl-byte-compile-compiler-macro] 4) (defalias 'sgml-tag-end #[(cl-x) "\302H >\204\f\303\304!\210\305H\207" [cl-x cl-struct-sgml-tag-tags 0 error "sgml-tag-end accessing a non-sgml-tag" 3] 2]) (byte-code "\300\301\302\303#\210\300\304\305\306#\210\304\307N\204\300\304\307\310#\210\300\207" [put sgml-tag-end setf-method #[(cl-x) "\301\302\303\304\305%\207" [cl-x cl-struct-setf-expander sgml-tag sgml-tag-end #1=(and (memq (aref cl-x 0) cl-struct-sgml-tag-tags)) 3] 6] sgml-tag-name cl-compiler-macro #[(--cl-whole-arg-- cl-x) "\301\302\303\304\211\211&\207" [cl-x cl-defsubst-expand (cl-x) (block sgml-tag-name (or #1# (error "sgml-tag-name accessing a non-sgml-tag")) (aref cl-x 4)) nil] 7] byte-compile cl-byte-compile-compiler-macro] 4) (defalias 'sgml-tag-name #[(cl-x) "\302H >\204\f\303\304!\210\305H\207" [cl-x cl-struct-sgml-tag-tags 0 error "sgml-tag-name accessing a non-sgml-tag" 4] 2]) (byte-code "\300\301\302\303#\210\300\304\305\306#\210\304\307N\204\300\304\307\310#\210\300\207" [put sgml-tag-name setf-method #[(cl-x) "\301\302\303\304\305%\207" [cl-x cl-struct-setf-expander sgml-tag sgml-tag-name (and #1=(memq (aref cl-x 0) cl-struct-sgml-tag-tags)) 4] 6] sgml-tag-p cl-compiler-macro #[(--cl-whole-arg-- cl-x) "\301\302\303\304\211\211&\207" [cl-x cl-defsubst-expand (cl-x) (block sgml-tag-p (and (vectorp cl-x) (>= (length cl-x) 5) #1# t)) nil] 7] byte-compile cl-byte-compile-compiler-macro] 4) (defalias 'sgml-tag-p #[(cl-x) "\302!\205G\303Y\205\304H >\205\305\207" [cl-x cl-struct-sgml-tag-tags vectorp 5 0 t] 2]) (defalias 'copy-sgml-tag #[(x) "\301!\207" [x copy-sequence] 2]) (byte-code "\300\301\302\303#\210\301\304N\204\300\301\304\305#\210\300\207" [put make-sgml-tag cl-compiler-macro #[(cl-whole &rest #1=#:--cl-rest--) "\306>A@\307>A@\310>A@\311>A@ \203D @\312>\203- AA\211\202\313>A@\203;\314\211\202\315\316 @\"\210\202)\317\320\321\322\314 \n \f& ,\207" [#1# type start end name #:--cl-keys-- :type :start :end :name (:type :start :end :name :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:type :start :end :name)" cl-defsubst-expand (type start end name) (block make-sgml-tag (vector 'cl-struct-sgml-tag type start end name)) t cl-whole] 11 "Not documented\n\n(fn CL-WHOLE &cl-quote &key TYPE START END NAME)"] byte-compile cl-byte-compile-compiler-macro] 4) #@47 Not documented (fn &key TYPE START END NAME) (defalias 'make-sgml-tag #[(&rest #1=#:--cl-rest--) "\306>A@\307>A@\310>A@\311>A@ \203D @\312>\203- AA\211\202\313>A@\203;\314\211\202\315\316 @\"\210\202)\317\320 \n \f%,\207" [#1# type start end name #2=#:--cl-keys-- :type :start :end :name (:type :start :end :name :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:type :start :end :name)" vector cl-struct-sgml-tag] 7 (#$ . 37005)]) (byte-code "\300\301\302\303#\210\301\304N\204\300\301\304\305#\210\300\207" [put sgml-make-tag cl-compiler-macro #[(--cl-whole-arg-- type start end name) "\304\305\306\307\310\211 \n & \207" [type start end name cl-defsubst-expand (type start end name) (block sgml-make-tag (vector 'cl-struct-sgml-tag type start end name)) t nil] 10] byte-compile cl-byte-compile-compiler-macro] 4) (defalias 'sgml-make-tag #[(type start end name) "\304\305 \n %\207" [type start end name vector cl-struct-sgml-tag] 6]) (byte-code "\302B\303C\304\305\306\307#\210\304\305\310\311#\210\304\305\312\313#\210\304\305\314\315#\210\304\316\317\315#\210\304\320\317\315#\210\304\321\317\315#\210\304\322\317\323#\210\304\324\317\315#\210\304\325\317\315#\210\304\326\317\315#\210\304\327\317\315#\207" [custom-print-functions cl-struct-sgml-tag-tags #[(cl-x cl-s cl-n) "\303!\205\200G\304Y\205\200\305H >\205\200\306\307\n\"\210\306\310\n\"\210\311\305H >\204,\312\313!\210\314H\n\"\210\306\315\n\"\210\311\305H >\204D\312\316!\210\317H\n\"\210\306\320\n\"\210\311\305H >\204\\\312\321!\210\322H\n\"\210\306\323\n\"\210\311\305H >\204t\312\324!\210\325H\n\"\210\306\326\n\"\210\327\207" [cl-x cl-struct-sgml-tag-tags cl-s vectorp 5 0 princ "#S(sgml-tag" " type" prin1 error "sgml-tag-type accessing a non-sgml-tag" 1 " start" "sgml-tag-start accessing a non-sgml-tag" 2 " end" "sgml-tag-end accessing a non-sgml-tag" 3 " name" "sgml-tag-name accessing a non-sgml-tag" 4 ")" t] 3] cl-struct-sgml-tag put sgml-tag cl-struct-slots ((cl-tag-slot) (type) (start) (end) (name)) cl-struct-type (vector nil) cl-struct-include nil cl-struct-print t sgml-make-tag side-effect-free make-sgml-tag copy-sgml-tag sgml-tag-p error-free sgml-tag-name sgml-tag-end sgml-tag-start sgml-tag-type] 4) #@44 Skip past a tag-name, and return the name. (defalias 'sgml-parse-tag-name #[nil "\300`\301\302!\210`\"\207" [buffer-substring-no-properties skip-syntax-forward "w_"] 4 (#$ . 39282)]) (put 'sgml-parse-tag-name 'byte-optimizer 'byte-compile-inline-expand) #@48 Return t if the test before point matches STR. (defalias 'sgml-looking-back-at #[(str) "`GZ\211eY\205\302 `\"\232)\207" [str start buffer-substring-no-properties] 5 (#$ . 39542)]) (put 'sgml-looking-back-at 'byte-optimizer 'byte-compile-inline-expand) #@210 Return non-nil if text between START and END is a tag. Checks among other things that the tag does not contain spurious unquoted < or > chars inside, which would indicate that it really isn't a tag after all. (defalias 'sgml-tag-text-p #[(start end) "\212\306 p\307\216\310\n!\210\311 \f\312#\211@\313U-\207" [#1=#:buffer #2=#:table sgml-tag-syntax-table start end pps syntax-table ((byte-code "rq\210\302 !\210)\302\207" [#1# #2# set-syntax-table] 2)) set-syntax-table parse-partial-sexp 2 0] 5 (#$ . 39806)]) #@166 Parse an SGML tag backward, and return information about the tag. Assume that parsing starts from within a textual context. Leave point at the beginning of the tag. (defalias 'sgml-parse-tag-backward #[(&optional limit) "\300\301\215\207" [found (byte-code "\306\211\211\211\307\310\f\311#\204\312\313!\210\306f\314=\203G\315 p3\316\216\3174!\210`5\306\320\321\217\210\3225`\"\204C5b\210\323\324\325\f!\"\210\326u\210,`T\3276`6GZ\2117eY\205b6\3307`\"\232*\203q\331\332\333\306\334#\202 \3356`6GZ\2117eY\205\2116\3307`\"\232*\203\230\336\307\337\306\334#\202 \315 p89\340\216\3174!\210 b\210\306\341\342\217\210`+\211Tb\210\306f\343=\203\301\344\202 \306f\345=\203\315\346\202 \306f\347=\203\345\350u\210\351\330`\352\353!\210`\"\202 \306f\354=\203\361\355\202 \356\330`\352\353!\210`\" SSf\347=\204 \357!\203 \360\nb\210\361\362 \n %,\207" [name tag-end tag-start tag-type limit #1=#:buffer nil re-search-backward "[<>]" move error "No tag found" 60 syntax-table ((byte-code "rq\210\302 !\210)\302\207" [#1# #2=#:table set-syntax-table] 2)) set-syntax-table (forward-sexp) ((scan-error (byte-code "b\210\302\303\304 !\"\207" [pos limit throw found sgml-parse-tag-backward] 4))) sgml-tag-text-p throw found sgml-parse-tag-backward -1 "--" buffer-substring-no-properties comment search-backward "" cdata "]]>" pi " ?>" jsp " %>" tag " />" text sgml-get-context "" indent-according-to-mode "Nothing to close"] 4 (#$ . 44775) nil]) #@56 Return non-nil if TAG-NAME is an implicitly empty tag. (defalias 'sgml-empty-tag-p #[(tag-name) "?\205 \303 \n\"\207" [sgml-xml-mode tag-name sgml-empty-tags member-ignore-case] 3 (#$ . 45498)]) #@71 Return non-nil if TAG-NAME is a tag for which an end-tag is optional. (defalias 'sgml-unclosed-tag-p #[(tag-name) "?\205 \303 \n\"\207" [sgml-xml-mode tag-name sgml-unclosed-tags member-ignore-case] 3 (#$ . 45701)]) #@98 Calculate the column to which this line should be indented. LCON is the lexical context, if any. (defalias 'sgml-calculate-indent #[(&optional lcon) "\204\306 @\307=\203'\310\311!\203'\212Ab\210\310\312!)\203'\313A\314\\B@\315=\203S`AV\203B\316\317y!\203B\310\320!\204.`AV\203L\321 \207Ab\210iT\207@\313=\203\252\310\311!`AV\203|\316\317y!\203|\310\320!\204^ \203|\310\322!\203^`AV\203\212\323\324w\210\202\226Ab\210\325\311!\210\326\224b\210 \204\247\310\311!\203\247\314u\210\323\324w\210i)\207@\327=\203\263\324\207@\307=\203\326ATb\210\330\324w\210\323\324w\210l\204\315i\207ATb\210i\n\\\207@\331=\203\310\332!\203\356\333\334!\210\323\324w\210\202\335`\310\f!\205\335\336\334! \"\205\336\334!\211/?\205 \323\324x\205 \337\324x\326W\205 \340 \205 `AV?\2051 b\210\341/?\205/\342!\2370`10\203l/\203l\3430@\326H2>\204P\344\345!\2100@\346H\324\211/\324\211\347&\347=\203l0A\2110\204;0\203\3300@\326H2>\204\200\344\350!\2100@\351H V\203\330 b\210\3520@\326H2>\204\235\344\353!\2100@\334H\354>\203\2760@\326H2>\204\266\344\353!\2100@\334H\202\277\3070@\326H2>\204\316\344\355!\2100@\314HB!\2020\2030@\326H2>\204\354\344\350!\2100@\351Hb\203\337\324w\203` W\203\212\323\324x\210n)\203i\2021b\210i\n0G_\\,\207\344\356@\"\207" [lcon mark sgml-basic-offset here sgml-tag-name-re sgml-unclosed-tags sgml-lexical-context tag looking-at "--" "