]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/sgml-mode.el
(reftex-with-special-syntax): Bind `case-fold-search' to nil.
[gnu-emacs] / lisp / textmodes / sgml-mode.el
index 5e7e7d95f9b4aadd3dba817037b543fca480cd95..cecd4a3da47bb53f50adda60f23118593c74a6f9 100644 (file)
@@ -32,7 +32,9 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'skeleton))
+(eval-when-compile
+  (require 'skeleton)
+  (require 'outline))
 
 (defgroup sgml nil
   "SGML editing mode"
 (put 'sgml-transformation 'variable-interactive
      "aTransformation function: ")
 
+(defcustom sgml-mode-hook nil
+  "Hook run by command `sgml-mode'.
+`text-mode-hook' is run first."
+  :group 'sgml
+  :type 'hook)
+
 ;; As long as Emacs' syntax can't be complemented with predicates to context
 ;; sensitively confirm the syntax of characters, we have to live with this
 ;; kludgy kind of tradeoff.
@@ -166,7 +174,7 @@ This takes effect when first loading the sgml-mode library.")
    "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"
+   "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
@@ -178,16 +186,17 @@ This takes effect when first loading the sgml-mode library.")
   "Vector of symbolic character names without `&' and `;'.")
 
 
-;; sgmls is a free SGML parser available from
-;; ftp.uu.net:pub/text-processing/sgml
+;; nsgmls is a free SGML parser in the SP suite available from
+;; ftp.jclark.com and otherwise packaged for GNU systems.
 ;; Its error messages can be parsed by next-error.
 ;; The -s option suppresses output.
 
-(defcustom sgml-validate-command "sgmls -s"
+(defcustom sgml-validate-command "nsgmls -s" ; replaced old `sgmls'
   "*The command to validate an SGML document.
 The file name of current buffer file name will be appended to this,
 separated by a space."
   :type 'string
+  :version "21.1"
   :group 'sgml)
 
 (defvar sgml-saved-validate-command nil
@@ -821,6 +830,13 @@ See `sgml-tag-alist' for info about attributerules.."
 
 (provide 'sgml-mode)
 \f
+(defcustom html-mode-hook nil
+  "Hook run by command `html-mode'.
+`text-mode-hook' and `sgml-mode-hook' are run first."
+  :group 'sgml
+  :type 'hook
+  :options '(html-autoview-mode))
+
 (defvar html-quick-keys sgml-quick-keys
   "Use C-c X combinations for quick insertion of frequent tags when non-nil.
 This defaults to `sgml-quick-keys'.
@@ -1020,10 +1036,13 @@ This takes effect when first loading the library.")
       ("html" (\n
               "<head>\n"
               "<title>" (setq str (read-input "Title: ")) "</title>\n"
+              "</head>\n"
               "<body>\n<h1>" str "</h1>\n" _
               "\n<address>\n<a href=\"mailto:"
               user-mail-address
-              "\">" (user-full-name) "</a>\n</address>"))
+              "\">" (user-full-name) "</a>\n</address>\n"
+              "</body>"
+               ))
       ("i")
       ("ins")
       ("isindex" t ("action") ("prompt"))
@@ -1194,7 +1213,10 @@ To work around that, do:
   (make-local-variable 'outline-level)
   (make-local-variable 'sentence-end)
   (setq sentence-end
-       "[.?!][]\"')}]*\\(<[^>]*>\\)*\\($\\| $\\|\t\\|  \\)[ \t\n]*")
+       (if sentence-end-double-space
+           "[.?!][]\"')}]*\\(<[^>]*>\\)*\\($\\| $\\|\t\\|  \\)[ \t\n]*"
+           
+         "[.?!][]\"')}]*\\(<[^>]*>\\)*\\($\\| \\|\t\\)[ \t\n]*"))
   (setq sgml-tag-alist html-tag-alist
        sgml-face-tag-alist html-face-tag-alist
        sgml-tag-help html-tag-help
@@ -1230,7 +1252,7 @@ The third `match-string' will be the used in the menu.")
     (nreverse toc-index)))
 
 (defun html-autoview-mode (&optional arg)
-  "Toggle automatic viewing via `html-viewer' upon saving buffer.
+  "Toggle automatic viewing via `browse-url-of-buffer' upon saving buffer.
 With positive prefix ARG always turns viewing on, with negative ARG always off.
 Can be used as a value for `html-mode-hook'."
   (interactive "P")