comparison lisp/psgml/psgml-edit.el @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children ec9a17fef872
comparison
equal deleted inserted replaced
1:c0c6a60d29db 2:ac2d302a0011
1 ;;; psgml-edit.el --- Editing commands for SGML-mode with parsing support 1 ;;; psgml-edit.el --- Editing commands for SGML-mode with parsing support
2 ;; $Id: psgml-edit.el,v 1.1.1.1 1996/12/18 03:35:19 steve Exp $ 2 ;;-*-byte-compile-warnings:(free-vars unused-vars unresolved callargs redefine)-*-
3 ;; $Id: psgml-edit.el,v 1.1.1.2 1996/12/18 03:47:14 steve Exp $
3 4
4 ;; Copyright (C) 1994, 1995, 1996 Lennart Staflin 5 ;; Copyright (C) 1994, 1995, 1996 Lennart Staflin
5 6
6 ;; Author: Lennart Staflin <lenst@lysator.liu.se> 7 ;; Author: Lennart Staflin <lenst@lysator.liu.se>
7 8
28 ;;;; Code: 29 ;;;; Code:
29 30
30 (provide 'psgml-edit) 31 (provide 'psgml-edit)
31 (require 'psgml) 32 (require 'psgml)
32 (require 'psgml-parse) 33 (require 'psgml-parse)
34 (require 'tempo)
33 35
34 36
35 ;;;; Variables 37 ;;;; Variables
36 38
37 (defvar sgml-split-level nil 39 (defvar sgml-split-level nil
103 (defun sgml-down-element () 105 (defun sgml-down-element ()
104 "Move forward and down one level in the element structure." 106 "Move forward and down one level in the element structure."
105 (interactive) 107 (interactive)
106 (let ((to 108 (let ((to
107 (sgml-find-element-after (point) (sgml-last-element)))) 109 (sgml-find-element-after (point) (sgml-last-element))))
110 (when (sgml-strict-epos-p (sgml-element-stag-epos to))
111 (error "Sub-element in other entity"))
108 (goto-char (sgml-element-stag-end to)) 112 (goto-char (sgml-element-stag-end to))
109 (sgml-set-last-element (if (sgml-element-empty to) 113 (sgml-set-last-element (if (sgml-element-empty to)
110 (sgml-element-parent to) 114 (sgml-element-parent to)
111 to)))) 115 to))))
112 116
167 (attspec (sgml-element-attribute-specification-list element)) 171 (attspec (sgml-element-attribute-specification-list element))
168 (oldattlist (sgml-element-attlist element))) 172 (oldattlist (sgml-element-attlist element)))
169 (unless (sgml-element-empty element) 173 (unless (sgml-element-empty element)
170 (goto-char (sgml-element-end element)) 174 (goto-char (sgml-element-end element))
171 (delete-char (- (sgml-element-etag-len element))) 175 (delete-char (- (sgml-element-etag-len element)))
172 (insert (sgml-end-tag-of gi))) 176 (tempo-process-and-insert-string (sgml-end-tag-of gi)))
173 (goto-char (sgml-element-start element)) 177 (goto-char (sgml-element-start element))
174 (delete-char (sgml-element-stag-len element)) 178 (delete-char (sgml-element-stag-len element))
175 (insert (sgml-start-tag-of gi)) 179 (tempo-process-and-insert-string (sgml-start-tag-of gi))
176 (forward-char -1) 180 (forward-char -1)
177 (let* ((newel (sgml-find-element-of (point))) 181 (let* ((newel (sgml-find-element-of (point)))
178 (newattlist (sgml-element-attlist newel)) 182 (newattlist (sgml-element-attlist newel))
179 (newasl (sgml-translate-attribute-specification-list 183 (newasl (sgml-translate-attribute-specification-list
180 attspec oldattlist newattlist))) 184 attspec oldattlist newattlist)))
296 (defun sgml-fold-subelement () 300 (defun sgml-fold-subelement ()
297 "Fold all elements current elements content, leaving the first lines visible. 301 "Fold all elements current elements content, leaving the first lines visible.
298 This uses the selective display feature." 302 This uses the selective display feature."
299 (interactive) 303 (interactive)
300 (let* ((el (sgml-find-element-of (point))) 304 (let* ((el (sgml-find-element-of (point)))
301 (start (sgml-element-start el))
302 (end (sgml-element-end el))
303 (c (sgml-element-content el))) 305 (c (sgml-element-content el)))
304 (while c 306 (while c
305 (sgml-fold-region (sgml-element-start c) 307 (sgml-fold-region (sgml-element-start c)
306 (sgml-element-end c)) 308 (sgml-element-end c))
307 (setq c (sgml-element-next c))))) 309 (setq c (sgml-element-next c)))))
361 (goto-char here)) ; insert normal tab insted) 363 (goto-char here)) ; insert normal tab insted)
362 (when element 364 (when element
363 (sgml-with-parser-syntax 365 (sgml-with-parser-syntax
364 (let ((stag (sgml-is-start-tag)) 366 (let ((stag (sgml-is-start-tag))
365 (etag (sgml-is-end-tag))) 367 (etag (sgml-is-end-tag)))
368 ;; Wing change
366 (when (and 369 (when (and
367 (not (member* (sgml-element-gi 370 (not (member* (sgml-element-gi
368 (if (or stag etag) 371 (if (or stag etag)
369 (sgml-element-parent element) 372 (sgml-element-parent element)
370 element)) 373 element))
413 "Move forward to next point where something is amiss with the structure." 416 "Move forward to next point where something is amiss with the structure."
414 (interactive) 417 (interactive)
415 (push-mark) 418 (push-mark)
416 (sgml-note-change-at (point)) ; Prune the parse tree 419 (sgml-note-change-at (point)) ; Prune the parse tree
417 (sgml-parse-to (point)) 420 (sgml-parse-to (point))
418 (let ((sgml-last-trouble-spot (point)) 421 (let ((sgml-throw-on-warning 'trouble))
419 (sgml-throw-on-warning 'trouble))
420 (or (catch sgml-throw-on-warning 422 (or (catch sgml-throw-on-warning
421 (sgml-parse-until-end-of nil t)) 423 (sgml-parse-until-end-of nil t))
422 (message "Ok")))) 424 (message "Ok"))))
423 425
424 426
427 429
428 (defun sgml-list-valid-tags () 430 (defun sgml-list-valid-tags ()
429 "Display a list of the contextually valid tags." 431 "Display a list of the contextually valid tags."
430 (interactive) 432 (interactive)
431 (sgml-parse-to-here) 433 (sgml-parse-to-here)
432 (let ((model (sgml-element-model sgml-current-tree))) 434 (let ((model (sgml-element-model sgml-current-tree))
435 (smap-name (sgml-lookup-shortref-name
436 (sgml-dtd-shortmaps sgml-dtd-info)
437 sgml-current-shortmap)))
433 (with-output-to-temp-buffer "*Tags*" 438 (with-output-to-temp-buffer "*Tags*"
434 (princ (format "Current element: %s %s\n" 439 (princ (format "Current element: %s %s\n"
435 (sgml-element-name sgml-current-tree) 440 (sgml-element-name sgml-current-tree)
436 (if (sgml-eltype-defined 441 (if (sgml-eltype-defined
437 (sgml-element-eltype sgml-current-tree)) 442 (sgml-element-eltype sgml-current-tree))
444 "element") 449 "element")
445 (t 450 (t
446 model)) 451 model))
447 (if (eq model sgml-any) 452 (if (eq model sgml-any)
448 "[ANY]" ""))) 453 "[ANY]" "")))
454
455 (when smap-name
456 (princ (format "Current short reference map: %s\n" smap-name)))
449 457
450 (cond ((sgml-final-p sgml-current-state) 458 (cond ((sgml-final-p sgml-current-state)
451 (princ "Valid end-tags : ") 459 (princ "Valid end-tags : ")
452 (loop for e in (sgml-current-list-of-endable-eltypes) 460 (loop for e in (sgml-current-list-of-endable-eltypes)
453 do (princ (sgml-end-tag-of e)) (princ " ")) 461 do (princ (sgml-end-tag-of e)) (princ " "))
538 (sgml-element-context-string el))))) 546 (sgml-element-context-string el)))))
539 547
540 (defun sgml-what-element () 548 (defun sgml-what-element ()
541 "Display what element is under the cursor." 549 "Display what element is under the cursor."
542 (interactive) 550 (interactive)
543 (let ((el (sgml-find-element-of (point)))) 551 (let* ((pos (point))
552 (nobol (eq (point) sgml-rs-ignore-pos))
553 (sref (sgml-deref-shortmap sgml-current-shortmap nobol))
554 (el nil))
555 (goto-char pos)
556 (setq el (sgml-find-element-of pos))
544 (assert (not (null el))) 557 (assert (not (null el)))
545 (message "%s %s" 558 (message "%s %s"
546 (cond ((eq el sgml-top-tree) 559 (cond ((eq el sgml-top-tree)
547 "outside document element") 560 "outside document element")
548 ((< (point) (sgml-element-stag-end el)) 561 ((< (point) (sgml-element-stag-end el))
549 "start-tag") 562 "start-tag")
550 ((>= (point) (sgml-element-etag-start el)) 563 ((>= (point) (sgml-element-etag-start el))
551 "end-tag") 564 "end-tag")
565 (sref
566 "shortref")
552 (t 567 (t
553 "content")) 568 "content"))
554 (sgml-element-context-string el)))) 569 (sgml-element-context-string el))))
555 570
556 ;;;; SGML mode: keyboard inserting 571 ;;;; SGML mode: keyboard inserting
573 (cond ((bolp) 588 (cond ((bolp)
574 (if (looking-at "^\\s-*$") 589 (if (looking-at "^\\s-*$")
575 (fixup-whitespace))) 590 (fixup-whitespace)))
576 (t 591 (t
577 (insert "\n")))) 592 (insert "\n"))))
578 (insert tag) 593 (tempo-process-and-insert-string tag)
579 (sgml-indent-line) 594 (sgml-indent-line)
580 (unless no-nl-after 595 (unless no-nl-after
581 (save-excursion 596 (save-excursion
582 (unless (sgml-element-data-p (sgml-parse-to-here)) 597 (unless (sgml-element-data-p (sgml-parse-to-here))
583 (unless (eolp) 598 (unless (eolp)
643 (region-beginning) 658 (region-beginning)
644 (region-end))) 659 (region-end)))
645 (save-excursion 660 (save-excursion
646 (when (and element (not (equal element ""))) 661 (when (and element (not (equal element "")))
647 (goto-char end) 662 (goto-char end)
648 (insert (sgml-end-tag-of element)) 663 (tempo-process-and-insert-string (sgml-end-tag-of element))
649 (goto-char start) 664 (goto-char start)
650 (sgml-insert-tag (sgml-start-tag-of element))))) 665 (sgml-insert-tag (sgml-start-tag-of element)))))
651 666
652 (defun sgml-insert-attributes (avl attlist) 667 (defun sgml-insert-attributes (avl attlist)
653 "Insert the attributes with values AVL and declarations ATTLIST. 668 "Insert the attributes with values AVL and declarations ATTLIST.
654 AVL should be a assoc list mapping symbols to strings." 669 AVL should be a assoc list mapping symbols to strings."
655 (let (name val dcl def tem) 670 (let (name val dcl def)
656 (loop for attspec in attlist do 671 (loop for attspec in attlist do
657 (setq name (sgml-attspec-name attspec) 672 (setq name (sgml-attspec-name attspec)
658 val (cdr-safe (sgml-lookup-attspec name avl)) 673 val (cdr-safe (sgml-lookup-attspec name avl))
659 dcl (sgml-attdecl-declared-value attspec) 674 dcl (sgml-attdecl-declared-value attspec)
660 def (sgml-attdecl-default-value attspec)) 675 def (sgml-attdecl-default-value attspec))
674 (equal val (sgml-default-value-attval def)))) 689 (equal val (sgml-default-value-attval def))))
675 ;; No attribute name for token groups 690 ;; No attribute name for token groups
676 ((and sgml-minimize-attributes sgml-shorttag 691 ((and sgml-minimize-attributes sgml-shorttag
677 (member (sgml-general-case val) 692 (member (sgml-general-case val)
678 (sgml-declared-value-token-group dcl))) 693 (sgml-declared-value-token-group dcl)))
679 (insert " " val)) 694 (tempo-process-and-insert-string (concat " " val)))
680 (t 695 (t
681 (insert " " name "=" (sgml-quote-attribute-value val))))) 696 (tempo-process-and-insert-string (concat " " name "="))
697 (insert (sgml-quote-attribute-value val)))))
682 (when auto-fill-function 698 (when auto-fill-function
683 (funcall auto-fill-function)))) 699 (funcall auto-fill-function))))
684 700
685 701
686 (defun sgml-quote-attribute-value (value) 702 (defun sgml-quote-attribute-value (value)
708 (mapcar (function (lambda (x) (cons (sgml-start-tag-of x) x))) 724 (mapcar (function (lambda (x) (cons (sgml-start-tag-of x) x)))
709 (sgml-current-list-of-valid-eltypes)))) 725 (sgml-current-list-of-valid-eltypes))))
710 (t 726 (t
711 (sgml-message "%s" sgml-current-state) 727 (sgml-message "%s" sgml-current-state)
712 nil))) 728 nil)))
729
730 (defun sgml-element-endable-p ()
731 (sgml-parse-to-here)
732 (and (not (eq sgml-current-tree sgml-top-tree))
733 (sgml-final-p sgml-current-state)))
713 734
714 (defun sgml-insert-end-tag () 735 (defun sgml-insert-end-tag ()
715 "Insert end-tag for the current open element." 736 "Insert end-tag for the current open element."
716 (interactive "*") 737 (interactive "*")
717 (sgml-parse-to-here) 738 (sgml-parse-to-here)
725 (not (sgml-element-data-p sgml-current-tree))) 746 (not (sgml-element-data-p sgml-current-tree)))
726 (delete-horizontal-space) 747 (delete-horizontal-space)
727 (unless (bolp) 748 (unless (bolp)
728 (insert "\n"))) 749 (insert "\n")))
729 (when (prog1 (bolp) 750 (when (prog1 (bolp)
730 (insert (if (eq t (sgml-element-net-enabled sgml-current-tree)) 751 (tempo-process-and-insert-string
731 "/" 752 (if (eq t (sgml-element-net-enabled sgml-current-tree))
732 ;; wing change: If there is more than one endable 753 "/"
733 ;; tag, we probably want the outermost one rather 754 ;; wing change: If there is more than one endable
734 ;; than the innermost one. Thus, we end a </ul> 755 ;; tag, we probably want the outermost one rather
735 ;; even when a </li> is possible. 756 ;; than the innermost one. Thus, we end a </ul>
736 (sgml-end-tag-of 757 ;; even when a </li> is possible.
737 (car (last (sgml-current-list-of-endable-eltypes))))))) 758 (sgml-end-tag-of
759 (car (last (sgml-current-list-of-endable-eltypes)))))))
738 (sgml-indent-line))))) 760 (sgml-indent-line)))))
739 761
740 (defun sgml-insert-start-tag (name asl attlist &optional net) 762 (defun sgml-insert-start-tag (name asl attlist &optional net)
741 (insert "<" name) 763 (tempo-process-and-insert-string (concat "<" name))
742 (sgml-insert-attributes asl attlist) 764 (sgml-insert-attributes asl attlist)
743 (insert (if net "/" ">"))) 765 (insert (if net "/" ">")))
744 766
745 (defun sgml-change-start-tag (element asl) 767 (defun sgml-change-start-tag (element asl)
746 (let ((name (sgml-element-gi element)) 768 (let ((name (sgml-element-gi element))
817 (setq sgml-split-level 839 (setq sgml-split-level
818 (if (eq this-command last-command) 840 (if (eq this-command last-command)
819 (1+ sgml-split-level) 841 (1+ sgml-split-level)
820 0)) 842 0))
821 (let ((u (sgml-find-context-of (point))) 843 (let ((u (sgml-find-context-of (point)))
822 (start (point-marker)) 844 (start (point-marker)))
823 before)
824 (loop repeat sgml-split-level do 845 (loop repeat sgml-split-level do
825 (goto-char (sgml-element-start u)) 846 (goto-char (sgml-element-start u))
826 (setq u (sgml-element-parent u))) 847 (setq u (sgml-element-parent u)))
827 ;; Verify that a new element can be started 848 ;; Verify that a new element can be started
828 (unless (and (sgml-element-pstate u) ; in case of top element 849 (unless (and (sgml-element-pstate u) ; in case of top element
962 (insert "&" choice ";")))) 983 (insert "&" choice ";"))))
963 984
964 (defun sgml-doctype-insert (doctype vars) 985 (defun sgml-doctype-insert (doctype vars)
965 "Insert string DOCTYPE (ignored if nil) and set variables in &rest VARS. 986 "Insert string DOCTYPE (ignored if nil) and set variables in &rest VARS.
966 VARS should be a list of variables and values. 987 VARS should be a list of variables and values.
967 For backward compatibility a singel string instead of a variable is 988 For backward compatibility a single string instead of a variable is
968 assigned to sgml-default-dtd-file. 989 assigned to sgml-default-dtd-file.
969 All variables are made buffer local and are also added to the 990 All variables are made buffer local and are also added to the
970 buffers local variables list." 991 buffers local variables list."
971 (when doctype 992 (when doctype
972 (unless (bolp) 993 (unless (bolp)
986 1007
987 (defun sgml-attrib-menu (event) 1008 (defun sgml-attrib-menu (event)
988 "Pop up a menu of the attributes of the current element 1009 "Pop up a menu of the attributes of the current element
989 \(or the element whith start-tag before point)." 1010 \(or the element whith start-tag before point)."
990 (interactive "e") 1011 (interactive "e")
991 (let* ((el (sgml-find-attribute-element)) 1012 (let ((menu (sgml-make-attrib-menu (sgml-find-attribute-element))))
992 (attlist (sgml-non-fixed-attributes (sgml-element-attlist el))) 1013 (sgml-popup-multi-menu event "Attributes" menu)))
993 tokens menu other) 1014
1015 (defun sgml-make-attrib-menu (el)
1016 (let ((attlist (sgml-non-fixed-attributes (sgml-element-attlist el))))
994 (or attlist 1017 (or attlist
995 (error "No non-fixed attributes for element")) 1018 (error "No non-fixed attributes for element"))
996 (setq menu 1019 (loop for attdecl in attlist
997 (loop for attdecl in attlist 1020 for name = (sgml-attdecl-name attdecl)
998 for name = (sgml-attdecl-name attdecl) 1021 for defval = (sgml-attdecl-default-value attdecl)
999 for defval = (sgml-attdecl-default-value attdecl) 1022 for tokens = (or (sgml-declared-value-token-group
1000 for tokens = (or (sgml-declared-value-token-group 1023 (sgml-attdecl-declared-value attdecl))
1001 (sgml-attdecl-declared-value attdecl)) 1024 (sgml-declared-value-notation
1002 (sgml-declared-value-notation 1025 (sgml-attdecl-declared-value attdecl)))
1003 (sgml-attdecl-declared-value attdecl))) 1026 collect
1004 collect 1027 (cons
1005 (cons 1028 (sgml-attdecl-name attdecl)
1006 (sgml-attdecl-name attdecl) 1029 (nconc
1007 (nconc 1030 (if tokens
1008 (if tokens 1031 (loop for val in tokens collect
1009 (loop for val in tokens collect 1032 (list val
1010 (list val 1033 (list 'sgml-insert-attribute name val)))
1011 (list 'sgml-insert-attribute name val))) 1034 (list
1012 (list 1035 (list "Set attribute value"
1013 (list "Set attribute value" 1036 (list 'sgml-insert-attribute
1014 (list 'sgml-insert-attribute 1037 (sgml-attdecl-name attdecl)
1015 (sgml-attdecl-name attdecl) 1038 (list 'sgml-read-attribute-value
1016 (list 'sgml-read-attribute-value 1039 (list 'quote attdecl)
1017 (list 'quote attdecl) 1040 (sgml-element-attval el name))))))
1018 (sgml-element-attval el name)))))) 1041 (if (sgml-default-value-type-p 'required defval)
1019 (if (sgml-default-value-type-p 'required defval) 1042 nil
1020 nil 1043 (list "--"
1021 (list "--" 1044 (list (if (sgml-default-value-type-p nil defval)
1022 (list (if (sgml-default-value-type-p nil defval) 1045 (format "Default: %s"
1023 (format "Default: %s" 1046 (sgml-default-value-attval defval))
1024 (sgml-default-value-attval defval)) 1047 "#IMPLIED")
1025 "#IMPLIED") 1048 (list 'sgml-insert-attribute name nil))))))))
1026 (list 'sgml-insert-attribute name nil)))))))) 1049 )
1027 (sgml-popup-multi-menu event "Attributes" menu)))
1028 1050
1029 ;;;; SGML mode: Fill 1051 ;;;; SGML mode: Fill
1030 1052
1031 (defun sgml-fill-element (element) 1053 (defun sgml-fill-element (element)
1032 "Fill bigest enclosing element with mixed content. 1054 "Fill bigest enclosing element with mixed content.
1249 (sgml-with-parser-syntax 1271 (sgml-with-parser-syntax
1250 (let ((asl nil) 1272 (let ((asl nil)
1251 (al sgml-attlist)) 1273 (al sgml-attlist))
1252 (while (not (eq ?> (following-char))) 1274 (while (not (eq ?> (following-char)))
1253 (sgml-parse-s) 1275 (sgml-parse-s)
1254 (let ((name (sgml-check-nametoken))) 1276 (sgml-check-nametoken) ; attribute name, should match head of al
1255 (forward-char 3) 1277 (forward-char 3)
1256 (unless (memq (get-text-property (point) 'category) 1278 (unless (memq (get-text-property (point) 'category)
1257 '(sgml-default sgml-fixed)) 1279 '(sgml-default sgml-fixed))
1258 (push 1280 (push
1259 (sgml-make-attspec (sgml-attdecl-name (car al)) 1281 (sgml-make-attspec (sgml-attdecl-name (car al))
1260 (sgml-extract-attribute-value 1282 (sgml-extract-attribute-value
1261 (sgml-attdecl-declared-value (car al)))) 1283 (sgml-attdecl-declared-value (car al))))
1262 asl)) 1284 asl))
1263 (while (progn (beginning-of-line 2) 1285 (while (progn (beginning-of-line 2)
1264 (or (eolp) 1286 (or (eolp)
1265 (not (get-text-property (point) 'read-only)))))) 1287 (not (get-text-property (point) 'read-only)))))
1266 ; was (eq t) 1288
1267 (forward-line 1) 1289 (forward-line 1)
1268 (setq al (cdr al))) 1290 (setq al (cdr al)))
1269 asl))) 1291 asl)))
1270 1292
1271 1293
1351 (goto-char (point-min)) 1373 (goto-char (point-min))
1352 (while (re-search-forward sgml-tag-regexp nil t) 1374 (while (re-search-forward sgml-tag-regexp nil t)
1353 (cond 1375 (cond
1354 ((eq action 'hide) 1376 ((eq action 'hide)
1355 (let ((tag (downcase 1377 (let ((tag (downcase
1356 (buffer-substring (1+ (match-beginning 0)) 1378 (buffer-substring-no-properties
1357 (match-beginning 1))))) 1379 (1+ (match-beginning 0))
1380 (match-beginning 2)))))
1358 (if (or attr-p (not (member tag sgml-exposed-tags))) 1381 (if (or attr-p (not (member tag sgml-exposed-tags)))
1359 (add-text-properties 1382 (add-text-properties
1360 (match-beginning markup-index) (match-end markup-index) 1383 (match-beginning markup-index) (match-end markup-index)
1361 (list 'invisible tagcount 1384 (list 'invisible tagcount
1362 'rear-nonsticky '(invisible face)))))) 1385 'rear-nonsticky '(invisible face))))))
1400 (t 1423 (t
1401 (delete-region sgml-markup-start (point)) 1424 (delete-region sgml-markup-start (point))
1402 (sgml-entity-insert-text entity) 1425 (sgml-entity-insert-text entity)
1403 (setq sgml-goal (point-max)) ; May have changed size of buffer 1426 (setq sgml-goal (point-max)) ; May have changed size of buffer
1404 ;; now parse the entity text 1427 ;; now parse the entity text
1405 (goto-char (setq sgml-rs-ignore-pos sgml-markup-start)))))) 1428 (setq sgml-rs-ignore-pos sgml-markup-start)
1429 (goto-char sgml-markup-start)))))
1406 1430
1407 (defun sgml-expand-shortref-to-entity (name) 1431 (defun sgml-expand-shortref-to-entity (name)
1408 (let ((end (point)) 1432 (let ((end (point))
1409 (re-found nil) 1433 (re-found nil)
1410 before-change-function) 1434 before-change-function)
1491 (goto-char (min (point) (sgml-element-etag-start element))) 1515 (goto-char (min (point) (sgml-element-etag-start element)))
1492 (if (and (zerop (sgml-element-etag-len element)) 1516 (if (and (zerop (sgml-element-etag-len element))
1493 sgml-normalize-trims) 1517 sgml-normalize-trims)
1494 (skip-chars-backward " \t\n\r")) 1518 (skip-chars-backward " \t\n\r"))
1495 (delete-char (sgml-tree-etag-len element)) 1519 (delete-char (sgml-tree-etag-len element))
1496 (save-excursion (insert (sgml-end-tag-of element)))))) 1520 (save-excursion (tempo-process-and-insert-string (sgml-end-tag-of element))))))
1497 1521
1498 1522
1499 (defun sgml-make-character-reference (&optional invert) 1523 (defun sgml-make-character-reference (&optional invert)
1500 "Convert character after point into a character reference. 1524 "Convert character after point into a character reference.
1501 If called with a numeric argument, convert a character reference back 1525 If called with a numeric argument, convert a character reference back