diff options
| author | Mike Williams | 2002-04-09 12:02:20 +0000 |
|---|---|---|
| committer | Mike Williams | 2002-04-09 12:02:20 +0000 |
| commit | 9d4ce4285dabb9cc1225d09f6be7132f5b5efb41 (patch) | |
| tree | d88560aea98cd8c7844555f3e5518eab66bfb832 | |
| parent | 153a9b8cc05e3112423de96e16d9f9f29666ac04 (diff) | |
| download | emacs-9d4ce4285dabb9cc1225d09f6be7132f5b5efb41.tar.gz emacs-9d4ce4285dabb9cc1225d09f6be7132f5b5efb41.zip | |
(sgml-tag-alist): Doc fix.
| -rw-r--r-- | lisp/textmodes/sgml-mode.el | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 334a1645aeb..a5532146b7c 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -84,7 +84,6 @@ with comments, so we normally turn it off.") | |||
| 84 | "Use <, >, &, /, SPC and `sgml-specials' keys \"electrically\" when non-nil. | 84 | "Use <, >, &, /, SPC and `sgml-specials' keys \"electrically\" when non-nil. |
| 85 | This takes effect when first loading the `sgml-mode' library.") | 85 | This takes effect when first loading the `sgml-mode' library.") |
| 86 | 86 | ||
| 87 | |||
| 88 | (defvar sgml-mode-map | 87 | (defvar sgml-mode-map |
| 89 | (let ((map (make-keymap)) ;`sparse' doesn't allow binding to charsets. | 88 | (let ((map (make-keymap)) ;`sparse' doesn't allow binding to charsets. |
| 90 | (menu-map (make-sparse-keymap "SGML"))) | 89 | (menu-map (make-sparse-keymap "SGML"))) |
| @@ -138,7 +137,6 @@ This takes effect when first loading the `sgml-mode' library.") | |||
| 138 | map) | 137 | map) |
| 139 | "Keymap for SGML mode. See also `sgml-specials'.") | 138 | "Keymap for SGML mode. See also `sgml-specials'.") |
| 140 | 139 | ||
| 141 | |||
| 142 | (defun sgml-make-syntax-table (specials) | 140 | (defun sgml-make-syntax-table (specials) |
| 143 | (let ((table (make-syntax-table text-mode-syntax-table))) | 141 | (let ((table (make-syntax-table text-mode-syntax-table))) |
| 144 | (modify-syntax-entry ?< "(>" table) | 142 | (modify-syntax-entry ?< "(>" table) |
| @@ -164,7 +162,6 @@ This takes effect when first loading the `sgml-mode' library.") | |||
| 164 | table) | 162 | table) |
| 165 | "Syntax table used to parse SGML tags.") | 163 | "Syntax table used to parse SGML tags.") |
| 166 | 164 | ||
| 167 | |||
| 168 | (defcustom sgml-name-8bit-mode nil | 165 | (defcustom sgml-name-8bit-mode nil |
| 169 | "*When non-nil, insert non-ASCII characters as named entities." | 166 | "*When non-nil, insert non-ASCII characters as named entities." |
| 170 | :type 'boolean | 167 | :type 'boolean |
| @@ -219,7 +216,6 @@ This takes effect when first loading the `sgml-mode' library.") | |||
| 219 | "A table for mapping non-ASCII characters into SGML entity names. | 216 | "A table for mapping non-ASCII characters into SGML entity names. |
| 220 | Currently, only Latin-1 characters are supported.") | 217 | Currently, only Latin-1 characters are supported.") |
| 221 | 218 | ||
| 222 | |||
| 223 | ;; nsgmls is a free SGML parser in the SP suite available from | 219 | ;; nsgmls is a free SGML parser in the SP suite available from |
| 224 | ;; ftp.jclark.com and otherwise packaged for GNU systems. | 220 | ;; ftp.jclark.com and otherwise packaged for GNU systems. |
| 225 | ;; Its error messages can be parsed by next-error. | 221 | ;; Its error messages can be parsed by next-error. |
| @@ -236,7 +232,6 @@ separated by a space." | |||
| 236 | (defvar sgml-saved-validate-command nil | 232 | (defvar sgml-saved-validate-command nil |
| 237 | "The command last used to validate in this buffer.") | 233 | "The command last used to validate in this buffer.") |
| 238 | 234 | ||
| 239 | |||
| 240 | ;; I doubt that null end tags are used much for large elements, | 235 | ;; I doubt that null end tags are used much for large elements, |
| 241 | ;; so use a small distance here. | 236 | ;; so use a small distance here. |
| 242 | (defcustom sgml-slash-distance 1000 | 237 | (defcustom sgml-slash-distance 1000 |
| @@ -292,14 +287,12 @@ Any terminating `>' or `/' is not matched.") | |||
| 292 | When `font-lock-maximum-decoration' is 1 this is always used for fontifying. | 287 | When `font-lock-maximum-decoration' is 1 this is always used for fontifying. |
| 293 | When more these are fontified together with `sgml-font-lock-keywords'.") | 288 | When more these are fontified together with `sgml-font-lock-keywords'.") |
| 294 | 289 | ||
| 295 | |||
| 296 | (defvar sgml-display-text () | 290 | (defvar sgml-display-text () |
| 297 | "Tag names as lowercase symbols, and display string when invisible.") | 291 | "Tag names as lowercase symbols, and display string when invisible.") |
| 298 | 292 | ||
| 299 | ;; internal | 293 | ;; internal |
| 300 | (defvar sgml-tags-invisible nil) | 294 | (defvar sgml-tags-invisible nil) |
| 301 | 295 | ||
| 302 | |||
| 303 | (defcustom sgml-tag-alist | 296 | (defcustom sgml-tag-alist |
| 304 | '(("![" ("ignore" t) ("include" t)) | 297 | '(("![" ("ignore" t) ("include" t)) |
| 305 | ("!attlist") | 298 | ("!attlist") |
| @@ -312,8 +305,8 @@ This alist is made up as | |||
| 312 | ((\"tag\" . TAGRULE) | 305 | ((\"tag\" . TAGRULE) |
| 313 | ...) | 306 | ...) |
| 314 | 307 | ||
| 315 | TAGRULE is a list of optionally `t' (no endtag) or `\\n' (separate endtag by | 308 | TAGRULE is a list of optionally t (no endtag) or `\\n' (separate endtag by |
| 316 | newlines) or a skeleton with `nil', `t' or `\\n' in place of the interactor | 309 | newlines) or a skeleton with nil, t or `\\n' in place of the interactor |
| 317 | followed by an ATTRIBUTERULE (for an always present attribute) or an | 310 | followed by an ATTRIBUTERULE (for an always present attribute) or an |
| 318 | attribute alist. | 311 | attribute alist. |
| 319 | 312 | ||
| @@ -322,7 +315,7 @@ The attribute alist is made up as | |||
| 322 | ((\"attribute\" . ATTRIBUTERULE) | 315 | ((\"attribute\" . ATTRIBUTERULE) |
| 323 | ...) | 316 | ...) |
| 324 | 317 | ||
| 325 | ATTRIBUTERULE is a list of optionally `t' (no value when no input) followed by | 318 | ATTRIBUTERULE is a list of optionally t (no value when no input) followed by |
| 326 | an optional alist of possible values." | 319 | an optional alist of possible values." |
| 327 | :type '(repeat (cons (string :tag "Tag Name") | 320 | :type '(repeat (cons (string :tag "Tag Name") |
| 328 | (repeat :tag "Tag Rule" sexp))) | 321 | (repeat :tag "Tag Rule" sexp))) |
| @@ -388,7 +381,6 @@ Otherwise, it is set to be buffer-local when the file has | |||
| 388 | (concat "<" face ">")) | 381 | (concat "<" face ">")) |
| 389 | (error "Face not configured for %s mode" mode-name))) | 382 | (error "Face not configured for %s mode" mode-name))) |
| 390 | 383 | ||
| 391 | |||
| 392 | ;;;###autoload | 384 | ;;;###autoload |
| 393 | (define-derived-mode sgml-mode text-mode "SGML" | 385 | (define-derived-mode sgml-mode text-mode "SGML" |
| 394 | "Major mode for editing SGML documents. | 386 | "Major mode for editing SGML documents. |
| @@ -454,12 +446,9 @@ Do \\[describe-key] on the following bindings to discover what they do. | |||
| 454 | (concat "<!\\(element\\|entity\\)[ \t\n]+%?[ \t\n]*\\(" | 446 | (concat "<!\\(element\\|entity\\)[ \t\n]+%?[ \t\n]*\\(" |
| 455 | sgml-name-re "\\)"))) | 447 | sgml-name-re "\\)"))) |
| 456 | 448 | ||
| 457 | |||
| 458 | (defun sgml-comment-indent () | 449 | (defun sgml-comment-indent () |
| 459 | (if (looking-at "--") comment-column 0)) | 450 | (if (looking-at "--") comment-column 0)) |
| 460 | 451 | ||
| 461 | |||
| 462 | |||
| 463 | (defun sgml-slash (arg) | 452 | (defun sgml-slash (arg) |
| 464 | "Insert ARG slash characters. | 453 | "Insert ARG slash characters. |
| 465 | Behaves electrically if `sgml-quick-keys' is non-nil." | 454 | Behaves electrically if `sgml-quick-keys' is non-nil." |
| @@ -516,7 +505,6 @@ start tag, and the second `/' is the corresponding null end tag." | |||
| 516 | (buffer-substring (line-beginning-position) | 505 | (buffer-substring (line-beginning-position) |
| 517 | (1+ blinkpos))))))))) | 506 | (1+ blinkpos))))))))) |
| 518 | 507 | ||
| 519 | |||
| 520 | ;; Why doesn't this use the iso-cvt table or, preferably, generate the | 508 | ;; Why doesn't this use the iso-cvt table or, preferably, generate the |
| 521 | ;; inverse of the extensive table in the SGML Quail input method? -- fx | 509 | ;; inverse of the extensive table in the SGML Quail input method? -- fx |
| 522 | ;; I guess that's moot since it only works with Latin-1 anyhow. | 510 | ;; I guess that's moot since it only works with Latin-1 anyhow. |
| @@ -666,7 +654,6 @@ With prefix argument, only self insert." | |||
| 666 | (or (> (point) point) | 654 | (or (> (point) point) |
| 667 | (self-insert-command 1))))) | 655 | (self-insert-command 1))))) |
| 668 | 656 | ||
| 669 | |||
| 670 | (defun sgml-tag-help (&optional tag) | 657 | (defun sgml-tag-help (&optional tag) |
| 671 | "Display description of tag TAG. If TAG is omitted, use the tag at point." | 658 | "Display description of tag TAG. If TAG is omitted, use the tag at point." |
| 672 | (interactive) | 659 | (interactive) |
| @@ -684,7 +671,6 @@ With prefix argument, only self insert." | |||
| 684 | (cdr (assoc (downcase (substring tag 1)) sgml-tag-help))) | 671 | (cdr (assoc (downcase (substring tag 1)) sgml-tag-help))) |
| 685 | "No description available"))) | 672 | "No description available"))) |
| 686 | 673 | ||
| 687 | |||
| 688 | (defun sgml-maybe-end-tag (&optional arg) | 674 | (defun sgml-maybe-end-tag (&optional arg) |
| 689 | "Name self unless in position to end a tag or a prefix ARG is given." | 675 | "Name self unless in position to end a tag or a prefix ARG is given." |
| 690 | (interactive "P") | 676 | (interactive "P") |
| @@ -781,6 +767,7 @@ With prefix argument ARG, repeat this ARG times." | |||
| 781 | (goto-char open) | 767 | (goto-char open) |
| 782 | (kill-sexp 1))) | 768 | (kill-sexp 1))) |
| 783 | (setq arg (1- arg)))) | 769 | (setq arg (1- arg)))) |
| 770 | |||
| 784 | 771 | ||
| 785 | ;; Put read-only last to enable setting this even when read-only enabled. | 772 | ;; Put read-only last to enable setting this even when read-only enabled. |
| 786 | (or (get 'sgml-tag 'invisible) | 773 | (or (get 'sgml-tag 'invisible) |
| @@ -849,6 +836,7 @@ With prefix argument ARG, repeat this ARG times." | |||
| 849 | (eq (preceding-char) ?>))) | 836 | (eq (preceding-char) ?>))) |
| 850 | (backward-list) | 837 | (backward-list) |
| 851 | (forward-list))))))) | 838 | (forward-list))))))) |
| 839 | |||
| 852 | 840 | ||
| 853 | (autoload 'compile-internal "compile") | 841 | (autoload 'compile-internal "compile") |
| 854 | 842 | ||
| @@ -870,7 +858,6 @@ and move to the line in the SGML document that caused it." | |||
| 870 | (save-some-buffers (not compilation-ask-about-save) nil) | 858 | (save-some-buffers (not compilation-ask-about-save) nil) |
| 871 | (compile-internal command "No more errors")) | 859 | (compile-internal command "No more errors")) |
| 872 | 860 | ||
| 873 | |||
| 874 | (defun sgml-lexical-context (&optional limit) | 861 | (defun sgml-lexical-context (&optional limit) |
| 875 | "Return the lexical context at point as (TYPE . START). | 862 | "Return the lexical context at point as (TYPE . START). |
| 876 | START is the location of the start of the lexical element. | 863 | START is the location of the start of the lexical element. |
| @@ -960,7 +947,6 @@ With prefix argument, unquote the region." | |||
| 960 | (replace-match (cdr (assq (char-before) '((?& . "&") | 947 | (replace-match (cdr (assq (char-before) '((?& . "&") |
| 961 | (?< . "<") | 948 | (?< . "<") |
| 962 | (?> . ">")))))))) | 949 | (?> . ">")))))))) |
| 963 | |||
| 964 | 950 | ||
| 965 | (defsubst sgml-at-indentation-p () | 951 | (defsubst sgml-at-indentation-p () |
| 966 | "Return true if point is at the first non-whitespace character on the line." | 952 | "Return true if point is at the first non-whitespace character on the line." |
| @@ -1330,7 +1316,6 @@ This takes effect when first loading the library.") | |||
| 1330 | map) | 1316 | map) |
| 1331 | "Keymap for commands for use in HTML mode.") | 1317 | "Keymap for commands for use in HTML mode.") |
| 1332 | 1318 | ||
| 1333 | |||
| 1334 | (defvar html-face-tag-alist | 1319 | (defvar html-face-tag-alist |
| 1335 | '((bold . "b") | 1320 | '((bold . "b") |
| 1336 | (italic . "i") | 1321 | (italic . "i") |
| @@ -1361,14 +1346,13 @@ This takes effect when first loading the library.") | |||
| 1361 | ("var" . italic)) | 1346 | ("var" . italic)) |
| 1362 | "Value of `sgml-tag-face-alist' for HTML mode.") | 1347 | "Value of `sgml-tag-face-alist' for HTML mode.") |
| 1363 | 1348 | ||
| 1364 | |||
| 1365 | (defvar html-display-text | 1349 | (defvar html-display-text |
| 1366 | '((img . "[/]") | 1350 | '((img . "[/]") |
| 1367 | (hr . "----------") | 1351 | (hr . "----------") |
| 1368 | (li . "o ")) | 1352 | (li . "o ")) |
| 1369 | "Value of `sgml-display-text' for HTML mode.") | 1353 | "Value of `sgml-display-text' for HTML mode.") |
| 1370 | |||
| 1371 | 1354 | ||
| 1355 | |||
| 1372 | ;; should code exactly HTML 3 here when that is finished | 1356 | ;; should code exactly HTML 3 here when that is finished |
| 1373 | (defvar html-tag-alist | 1357 | (defvar html-tag-alist |
| 1374 | (let* ((1-7 '(("1") ("2") ("3") ("4") ("5") ("6") ("7"))) | 1358 | (let* ((1-7 '(("1") ("2") ("3") ("4") ("5") ("6") ("7"))) |
| @@ -1607,6 +1591,7 @@ This takes effect when first loading the library.") | |||
| 1607 | ("var" . "Math variable face") | 1591 | ("var" . "Math variable face") |
| 1608 | ("wbr" . "Enable <br> within <nobr>")) | 1592 | ("wbr" . "Enable <br> within <nobr>")) |
| 1609 | "*Value of `sgml-tag-help' for HTML mode.") | 1593 | "*Value of `sgml-tag-help' for HTML mode.") |
| 1594 | |||
| 1610 | 1595 | ||
| 1611 | ;;;###autoload | 1596 | ;;;###autoload |
| 1612 | (define-derived-mode html-mode sgml-mode "HTML" | 1597 | (define-derived-mode html-mode sgml-mode "HTML" |
| @@ -1680,7 +1665,7 @@ To work around that, do: | |||
| 1680 | ;; (make-local-variable 'imenu-sort-function) | 1665 | ;; (make-local-variable 'imenu-sort-function) |
| 1681 | ;; (setq imenu-sort-function nil) ; sorting the menu defeats the purpose | 1666 | ;; (setq imenu-sort-function nil) ; sorting the menu defeats the purpose |
| 1682 | ) | 1667 | ) |
| 1683 | 1668 | ||
| 1684 | (defvar html-imenu-regexp | 1669 | (defvar html-imenu-regexp |
| 1685 | "\\s-*<h\\([1-9]\\)[^\n<>]*>\\(<[^\n<>]*>\\)*\\s-*\\([^\n<>]*\\)" | 1670 | "\\s-*<h\\([1-9]\\)[^\n<>]*>\\(<[^\n<>]*>\\)*\\s-*\\([^\n<>]*\\)" |
| 1686 | "*A regular expression matching a head line to be added to the menu. | 1671 | "*A regular expression matching a head line to be added to the menu. |
| @@ -1716,6 +1701,7 @@ Can be used as a value for `html-mode-hook'." | |||
| 1716 | (add-hook 'after-save-hook 'browse-url-of-buffer nil t)) | 1701 | (add-hook 'after-save-hook 'browse-url-of-buffer nil t)) |
| 1717 | (message "Autoviewing turned %s." | 1702 | (message "Autoviewing turned %s." |
| 1718 | (if arg "off" "on"))) | 1703 | (if arg "off" "on"))) |
| 1704 | |||
| 1719 | 1705 | ||
| 1720 | (define-skeleton html-href-anchor | 1706 | (define-skeleton html-href-anchor |
| 1721 | "HTML anchor tag with href attribute." | 1707 | "HTML anchor tag with href attribute." |