: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'.
: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")
(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 "</" face ">"))
(concat "<" face ">"))
(error "Face not configured for %s mode" mode-name)))
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.
(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) "\\(?:<!\\)?--[ \t]*")
(if sgml-name-8bit-mode "ON" "OFF")))
;; When an element of a skeleton is a string "str", it is passed
-;; through skeleton-transformation and inserted. If "str" is to be
-;; inserted literally, one should obtain it as the return value of a
-;; function, e.g. (identity "str").
+;; through `skeleton-transformation-function' and inserted.
+;; If "str" is to be inserted literally, one should obtain it as
+;; the return value of a function, e.g. (identity "str").
(defvar sgml-tag-last nil)
(defvar sgml-tag-history nil)
"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 RET upcase RET, or put this in your `.emacs':
- (setq sgml-transformation 'upcase)"
- (funcall (or skeleton-transformation 'identity)
+`skeleton-transformation-function' RET `upcase' RET, or put this
+in your `.emacs':
+ (setq sgml-transformation-function 'upcase)"
+ (funcall (or skeleton-transformation-function 'identity)
(setq sgml-tag-last
(completing-read
(if (> (length sgml-tag-last) 0)
;; 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 "</" (identity ',str) ?>))
((eq (car v2) t)
(cons '("") (cdr v2)))
(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: "
"\" 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 "<br />" "<br>"))
"")))
\n))
"\" 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 "<br />" "<br>"))
"")))
\n))