diff options
| author | Glenn Morris | 2013-02-21 21:01:32 -0500 |
|---|---|---|
| committer | Glenn Morris | 2013-02-21 21:01:32 -0500 |
| commit | 5c11fc55ce8c105d8e41eaa94a481542ca4cea20 (patch) | |
| tree | 52cd45fa9b61fd1d4aa61b2d5c222c83c4fb530c /lisp/textmodes | |
| parent | f4146d989613fcd644653c082419b1a60021e0fb (diff) | |
| download | emacs-5c11fc55ce8c105d8e41eaa94a481542ca4cea20.tar.gz emacs-5c11fc55ce8c105d8e41eaa94a481542ca4cea20.zip | |
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.
Diffstat (limited to 'lisp/textmodes')
| -rw-r--r-- | lisp/textmodes/sgml-mode.el | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index b7288772034..a56a924c78c 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -46,9 +46,26 @@ | |||
| 46 | :type 'integer | 46 | :type 'integer |
| 47 | :group 'sgml) | 47 | :group 'sgml) |
| 48 | 48 | ||
| 49 | (defcustom sgml-xml-mode nil | ||
| 50 | "When non-nil, tag insertion functions will be XML-compliant. | ||
| 51 | It is set to be buffer-local when the file has | ||
| 52 | a DOCTYPE or an XML declaration." | ||
| 53 | :type 'boolean | ||
| 54 | :version "22.1" | ||
| 55 | :group 'sgml) | ||
| 56 | |||
| 49 | (defcustom sgml-transformation-function 'identity | 57 | (defcustom sgml-transformation-function 'identity |
| 50 | "Default value for `skeleton-transformation-function' in SGML mode." | 58 | "Default value for `skeleton-transformation-function' in SGML mode." |
| 51 | :type 'function | 59 | :type 'function |
| 60 | :initialize 'custom-initialize-default | ||
| 61 | :set (lambda (sym val) | ||
| 62 | (set-default sym val) | ||
| 63 | (mapc (lambda (buff) | ||
| 64 | (with-current-buffer buff | ||
| 65 | (and (eq major-mode 'sgml-mode) | ||
| 66 | (not sgml-xml-mode) | ||
| 67 | (setq skeleton-transformation-function val)))) | ||
| 68 | (buffer-list))) | ||
| 52 | :group 'sgml) | 69 | :group 'sgml) |
| 53 | 70 | ||
| 54 | (put 'sgml-transformation-function 'variable-interactive | 71 | (put 'sgml-transformation-function 'variable-interactive |
| @@ -364,14 +381,6 @@ an optional alist of possible values." | |||
| 364 | (string :tag "Description"))) | 381 | (string :tag "Description"))) |
| 365 | :group 'sgml) | 382 | :group 'sgml) |
| 366 | 383 | ||
| 367 | (defcustom sgml-xml-mode nil | ||
| 368 | "When non-nil, tag insertion functions will be XML-compliant. | ||
| 369 | It is set to be buffer-local when the file has | ||
| 370 | a DOCTYPE or an XML declaration." | ||
| 371 | :type 'boolean | ||
| 372 | :version "22.1" | ||
| 373 | :group 'sgml) | ||
| 374 | |||
| 375 | (defvar sgml-empty-tags nil | 384 | (defvar sgml-empty-tags nil |
| 376 | "List of tags whose !ELEMENT definition says EMPTY.") | 385 | "List of tags whose !ELEMENT definition says EMPTY.") |
| 377 | 386 | ||
| @@ -635,10 +644,8 @@ This only works for Latin-1 input." | |||
| 635 | (define-skeleton sgml-tag | 644 | (define-skeleton sgml-tag |
| 636 | "Prompt for a tag and insert it, optionally with attributes. | 645 | "Prompt for a tag and insert it, optionally with attributes. |
| 637 | Completion and configuration are done according to `sgml-tag-alist'. | 646 | Completion and configuration are done according to `sgml-tag-alist'. |
| 638 | If you like tags and attributes in uppercase do \\[set-variable] | 647 | If you like tags and attributes in uppercase, customize |
| 639 | `skeleton-transformation-function' RET `upcase' RET, or put this | 648 | `sgml-transformation-function' to 'upcase." |
| 640 | in your `.emacs': | ||
| 641 | (setq sgml-transformation-function 'upcase)" | ||
| 642 | (funcall (or skeleton-transformation-function 'identity) | 649 | (funcall (or skeleton-transformation-function 'identity) |
| 643 | (setq sgml-tag-last | 650 | (setq sgml-tag-last |
| 644 | (completing-read | 651 | (completing-read |