emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111854: Tweak for sgml-transformatio


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111854: Tweak for sgml-transformation-function
Date: Thu, 21 Feb 2013 21:01:32 -0500
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111854
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2013-02-21 21:01:32 -0500
message:
  Tweak for sgml-transformation-function 
  
  * lisp/textmodes/sgml-mode.el (sgml-xml-mode): Move before use.
  (sgml-transformation-function): Give it a :set function.
  (sgml-tag): Doc fix.
modified:
  lisp/ChangeLog
  lisp/textmodes/sgml-mode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-02-22 01:59:28 +0000
+++ b/lisp/ChangeLog    2013-02-22 02:01:32 +0000
@@ -1,5 +1,9 @@
 2013-02-22  Glenn Morris  <address@hidden>
 
+       * 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):

=== modified file 'lisp/textmodes/sgml-mode.el'
--- a/lisp/textmodes/sgml-mode.el       2013-01-11 23:08:55 +0000
+++ b/lisp/textmodes/sgml-mode.el       2013-02-22 02:01:32 +0000
@@ -46,9 +46,26 @@
   :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 @@
                       (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 @@
 (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]