# HG changeset patch # User Roland Winkler # Date 1148249999 0 # Node ID ca1b3788f58dc26af706c03b7f9298700422ea9e # Parent 2139854814c13689dbc60a8ee4790ab5579995ff (sgml-transformation): Make this the alias for the following variable. (sgml-transformation-function): Make this the real name. (sgml-tag-alist): Mark as risky. diff -r 2139854814c1 -r ca1b3788f58d lisp/textmodes/sgml-mode.el --- a/lisp/textmodes/sgml-mode.el Sun May 21 22:06:18 2006 +0000 +++ b/lisp/textmodes/sgml-mode.el Sun May 21 22:19:59 2006 +0000 @@ -49,13 +49,14 @@ :type 'integer :group 'sgml) -(defcustom sgml-transformation 'identity - "*Default value for `skeleton-transformation' (which see) in SGML mode." +(defcustom sgml-transformation-function 'identity + "*Default value for `skeleton-transformation-function' in SGML mode." :type 'function :group 'sgml) -(put 'sgml-transformation 'variable-interactive +(put 'sgml-transformation-function 'variable-interactive "aTransformation function: ") +(defvaralias 'sgml-transformation 'sgml-transformation-function) (defcustom sgml-mode-hook nil "Hook run by command `sgml-mode'. @@ -335,6 +336,7 @@ :type '(repeat (cons (string :tag "Tag Name") (repeat :tag "Tag Rule" sexp))) :group 'sgml) +(put 'sgml-tag-alist 'risky-local-variable t) (defcustom sgml-tag-help '(("!" . "Empty declaration for comment") @@ -391,7 +393,7 @@ (defun sgml-mode-facemenu-add-face-function (face end) (if (setq face (cdr (assq face sgml-face-tag-alist))) (progn - (setq face (funcall skeleton-transformation face)) + (setq face (funcall skeleton-transformation-function face)) (setq facemenu-end-add-face (concat "")) (concat "<" face ">")) (error "Face not configured for %s mode" mode-name))) @@ -415,8 +417,8 @@ 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 'upcase) in -your `.emacs' file. +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. @@ -460,7 +462,8 @@ (sgml-xml-guess) (if sgml-xml-mode (setq mode-name "XML") - (set (make-local-variable 'skeleton-transformation) sgml-transformation)) + (set (make-local-variable 'skeleton-transformation-function) + sgml-transformation-function)) ;; This will allow existing comments within declarations to be ;; recognized. (set (make-local-variable 'comment-start-skip) "\\(?: (length sgml-tag-last) 0) @@ -639,7 +643,7 @@ ;; For xhtml's `tr' tag, we should maybe use \n instead. (if (eq v2 t) (setq v2 nil)) ;; We use `identity' to prevent skeleton from passing - ;; `str' through skeleton-transformation a second time. + ;; `str' through `skeleton-transformation-function' a second time. '(("") v2 _ v2 ")) ((eq (car v2) t) (cons '("") (cdr v2))) @@ -670,12 +674,12 @@ (if (stringp (car alist)) (progn (insert (if (eq (preceding-char) ?\s) "" ?\s) - (funcall skeleton-transformation (car alist))) + (funcall skeleton-transformation-function (car alist))) (sgml-value alist)) (setq i (length alist)) (while (> i 0) (insert ?\s) - (insert (funcall skeleton-transformation + (insert (funcall skeleton-transformation-function (setq attribute (skeleton-read '(completing-read "Attribute: " @@ -1981,12 +1985,12 @@ "\" name=\"" (or v1 (setq v1 (skeleton-read "Name: "))) "\" value=\"" str ?\" (when (y-or-n-p "Set \"checked\" attribute? ") - (funcall skeleton-transformation + (funcall skeleton-transformation-function (if sgml-xml-mode " checked=\"checked\"" " checked"))) (if sgml-xml-mode " />" ">") (skeleton-read "Text: " (capitalize str)) (or v2 (setq v2 (if (y-or-n-p "Newline after text? ") - (funcall skeleton-transformation + (funcall skeleton-transformation-function (if sgml-xml-mode "
" "
")) ""))) \n)) @@ -2001,12 +2005,12 @@ "\" name=\"" (or (car v2) (setcar v2 (skeleton-read "Name: "))) "\" value=\"" str ?\" (when (and (not v1) (setq v1 (y-or-n-p "Set \"checked\" attribute? "))) - (funcall skeleton-transformation + (funcall skeleton-transformation-function (if sgml-xml-mode " checked=\"checked\"" " checked"))) (if sgml-xml-mode " />" ">") (skeleton-read "Text: " (capitalize str)) (or (cdr v2) (setcdr v2 (if (y-or-n-p "Newline after text? ") - (funcall skeleton-transformation + (funcall skeleton-transformation-function (if sgml-xml-mode "
" "
")) ""))) \n))