Show
Ignore:
Timestamp:
05/27/06 09:57:08 (3 years ago)
Author:
miyoshi
Message:

Load emacs-to-svn into vendor/emacs-CVS_HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • vendor/emacs-CVS_HEAD/lisp/textmodes/sgml-mode.el

    r4035 r4089  
    5050  :group 'sgml) 
    5151 
    52 (defcustom sgml-transformation 'identity 
    53   "*Default value for `skeleton-transformation' (which see) in SGML mode." 
     52(defcustom sgml-transformation-function 'identity 
     53  "*Default value for `skeleton-transformation-function' in SGML mode." 
    5454  :type 'function 
    5555  :group 'sgml) 
    5656 
    57 (put 'sgml-transformation 'variable-interactive 
     57(put 'sgml-transformation-function 'variable-interactive 
    5858     "aTransformation function: ") 
     59(defvaralias 'sgml-transformation 'sgml-transformation-function) 
    5960 
    6061(defcustom sgml-mode-hook nil 
     
    336337                       (repeat :tag "Tag Rule" sexp))) 
    337338  :group 'sgml) 
     339(put 'sgml-tag-alist 'risky-local-variable t) 
    338340 
    339341(defcustom sgml-tag-help 
     
    392394  (if (setq face (cdr (assq face sgml-face-tag-alist))) 
    393395      (progn 
    394         (setq face (funcall skeleton-transformation face)) 
     396        (setq face (funcall skeleton-transformation-function face)) 
    395397        (setq facemenu-end-add-face (concat "</" face ">")) 
    396398        (concat "<" face ">")) 
     
    416418N defaults to -1, which means to wrap it around the current region. 
    417419 
    418 If you like upcased tags, put (setq sgml-transformation 'upcase) in 
    419 your `.emacs' file. 
     420If you like upcased tags, put (setq sgml-transformation-function 'upcase) 
     421in your `.emacs' file. 
    420422 
    421423Use \\[sgml-validate] to validate your document with an SGML parser. 
     
    461463  (if sgml-xml-mode 
    462464      (setq mode-name "XML") 
    463     (set (make-local-variable 'skeleton-transformation) sgml-transformation)) 
     465    (set (make-local-variable 'skeleton-transformation-function) 
     466         sgml-transformation-function)) 
    464467  ;; This will allow existing comments within declarations to be 
    465468  ;; recognized. 
     
    605608 
    606609;; When an element of a skeleton is a string "str", it is passed 
    607 ;; through skeleton-transformation and inserted.  If "str" is to be 
    608 ;; inserted literally, one should obtain it as the return value of a 
    609 ;; function, e.g. (identity "str"). 
     610;; through `skeleton-transformation-function' and inserted. 
     611;; If "str" is to be inserted literally, one should obtain it as 
     612;; the return value of a function, e.g. (identity "str"). 
    610613 
    611614(defvar sgml-tag-last nil) 
     
    615618Completion and configuration are done according to `sgml-tag-alist'. 
    616619If you like tags and attributes in uppercase do \\[set-variable] 
    617 skeleton-transformation RET upcase RET, or put this in your `.emacs': 
    618   (setq sgml-transformation 'upcase)" 
    619   (funcall (or skeleton-transformation 'identity) 
     620`skeleton-transformation-function' RET `upcase' RET, or put this 
     621in your `.emacs': 
     622  (setq sgml-transformation-function 'upcase)" 
     623  (funcall (or skeleton-transformation-function 'identity) 
    620624           (setq sgml-tag-last 
    621625                 (completing-read 
     
    640644      (if (eq v2 t) (setq v2 nil)) 
    641645      ;; We use `identity' to prevent skeleton from passing 
    642       ;; `str' through skeleton-transformation a second time. 
     646      ;; `str' through `skeleton-transformation-function' a second time. 
    643647      '(("") v2 _ v2 "</" (identity ',str) ?>)) 
    644648     ((eq (car v2) t) 
     
    671675            (progn 
    672676              (insert (if (eq (preceding-char) ?\s) "" ?\s) 
    673                       (funcall skeleton-transformation (car alist))) 
     677                      (funcall skeleton-transformation-function (car alist))) 
    674678              (sgml-value alist)) 
    675679          (setq i (length alist)) 
    676680          (while (> i 0) 
    677681            (insert ?\s) 
    678             (insert (funcall skeleton-transformation 
     682            (insert (funcall skeleton-transformation-function 
    679683                             (setq attribute 
    680684                                   (skeleton-read '(completing-read 
     
    19821986   "\" value=\"" str ?\" 
    19831987   (when (y-or-n-p "Set \"checked\" attribute? ") 
    1984      (funcall skeleton-transformation 
     1988     (funcall skeleton-transformation-function 
    19851989              (if sgml-xml-mode " checked=\"checked\"" " checked"))) 
    19861990   (if sgml-xml-mode " />" ">") 
    19871991   (skeleton-read "Text: " (capitalize str)) 
    19881992   (or v2 (setq v2 (if (y-or-n-p "Newline after text? ") 
    1989                        (funcall skeleton-transformation 
     1993                       (funcall skeleton-transformation-function 
    19901994                                (if sgml-xml-mode "<br />" "<br>")) 
    19911995                     ""))) 
     
    20022006   "\" value=\"" str ?\" 
    20032007   (when (and (not v1) (setq v1 (y-or-n-p "Set \"checked\" attribute? "))) 
    2004      (funcall skeleton-transformation 
     2008     (funcall skeleton-transformation-function 
    20052009              (if sgml-xml-mode " checked=\"checked\"" " checked"))) 
    20062010   (if sgml-xml-mode " />" ">") 
    20072011   (skeleton-read "Text: " (capitalize str)) 
    20082012   (or (cdr v2) (setcdr v2 (if (y-or-n-p "Newline after text? ") 
    2009                                (funcall skeleton-transformation 
     2013                               (funcall skeleton-transformation-function 
    20102014                                        (if sgml-xml-mode "<br />" "<br>")) 
    20112015                             "")))