]> code.delx.au - gnu-emacs/commitdiff
Tweak for sgml-transformation-function
authorGlenn Morris <rgm@gnu.org>
Fri, 22 Feb 2013 02:01:32 +0000 (21:01 -0500)
committerGlenn Morris <rgm@gnu.org>
Fri, 22 Feb 2013 02:01:32 +0000 (21:01 -0500)
* lisp/textmodes/sgml-mode.el (sgml-xml-mode): Move before use.
(sgml-transformation-function): Give it a :set function.
(sgml-tag): Doc fix.

lisp/ChangeLog
lisp/textmodes/sgml-mode.el

index 09378b0ceef56d8989885d18b2dbec27b07a2147..c6c9d93ed97028d43b50e927d726e5f232d59a0b 100644 (file)
@@ -1,5 +1,9 @@
 2013-02-22  Glenn Morris  <rgm@gnu.org>
 
+       * textmodes/sgml-mode.el (sgml-xml-mode): Move before use.
+       (sgml-transformation-function): Give it a :set function.
+       (sgml-tag): Doc fix.
+
        * cmuscheme.el (scheme-buffer):
        * progmodes/inf-lisp.el (inferior-lisp-buffer):
        * progmodes/tcl.el (inferior-tcl-buffer):
index b72887720342fb98caf3945e534e265126e76bf7..a56a924c78c33737a933c77d6daa6be29a79fada 100644 (file)
   :type 'integer
   :group 'sgml)
 
+(defcustom sgml-xml-mode nil
+  "When non-nil, tag insertion functions will be XML-compliant.
+It is set to be buffer-local when the file has
+a DOCTYPE or an XML declaration."
+  :type 'boolean
+  :version "22.1"
+  :group 'sgml)
+
 (defcustom sgml-transformation-function 'identity
   "Default value for `skeleton-transformation-function' in SGML mode."
   :type 'function
+  :initialize 'custom-initialize-default
+  :set (lambda (sym val)
+         (set-default sym val)
+         (mapc (lambda (buff)
+                 (with-current-buffer buff
+                   (and (eq major-mode 'sgml-mode)
+                        (not sgml-xml-mode)
+                        (setq skeleton-transformation-function val))))
+               (buffer-list)))
   :group 'sgml)
 
 (put 'sgml-transformation-function 'variable-interactive
@@ -364,14 +381,6 @@ an optional alist of possible values."
                       (string :tag "Description")))
   :group 'sgml)
 
-(defcustom sgml-xml-mode nil
-  "When non-nil, tag insertion functions will be XML-compliant.
-It is set to be buffer-local when the file has
-a DOCTYPE or an XML declaration."
-  :type 'boolean
-  :version "22.1"
-  :group 'sgml)
-
 (defvar sgml-empty-tags nil
   "List of tags whose !ELEMENT definition says EMPTY.")
 
@@ -635,10 +644,8 @@ This only works for Latin-1 input."
 (define-skeleton sgml-tag
   "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-function' RET `upcase' RET, or put this
-in your `.emacs':
-  (setq sgml-transformation-function 'upcase)"
+If you like tags and attributes in uppercase, customize
+`sgml-transformation-function' to 'upcase."
   (funcall (or skeleton-transformation-function 'identity)
            (setq sgml-tag-last
                 (completing-read