Mercurial > emacs
comparison lisp/textmodes/sgml-mode.el @ 47933:b5ddbda34d8e
(sgml-close-tag, html-imenu-index): Fix typo.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 18 Oct 2002 08:30:49 +0000 |
parents | 96093793b6b4 |
children | 2c2ce75616ef |
comparison
equal
deleted
inserted
replaced
47932:9545a9f6a23e | 47933:b5ddbda34d8e |
---|---|
1072 (not (sgml-at-indentation-p)) | 1072 (not (sgml-at-indentation-p)) |
1073 (and context | 1073 (and context |
1074 (/= (point) (sgml-tag-start (car context))) | 1074 (/= (point) (sgml-tag-start (car context))) |
1075 (sgml-unclosed-tag-p (sgml-tag-name (car context))))) | 1075 (sgml-unclosed-tag-p (sgml-tag-name (car context))))) |
1076 (setq tag-info (ignore-errors (sgml-parse-tag-backward)))) | 1076 (setq tag-info (ignore-errors (sgml-parse-tag-backward)))) |
1077 | 1077 |
1078 ;; This tag may enclose things we thought were tags. If so, | 1078 ;; This tag may enclose things we thought were tags. If so, |
1079 ;; discard them. | 1079 ;; discard them. |
1080 (while (and context | 1080 (while (and context |
1081 (> (sgml-tag-end tag-info) | 1081 (> (sgml-tag-end tag-info) |
1082 (sgml-tag-end (car context)))) | 1082 (sgml-tag-end (car context)))) |
1083 (setq context (cdr context))) | 1083 (setq context (cdr context))) |
1084 | 1084 |
1085 (cond | 1085 (cond |
1086 | 1086 |
1087 ;; start-tag | 1087 ;; start-tag |
1088 ((eq (sgml-tag-type tag-info) 'open) | 1088 ((eq (sgml-tag-type tag-info) 'open) |
1089 (cond | 1089 (cond |
1142 | 1142 |
1143 | 1143 |
1144 ;; Editing shortcuts | 1144 ;; Editing shortcuts |
1145 | 1145 |
1146 (defun sgml-close-tag () | 1146 (defun sgml-close-tag () |
1147 "Insert an close-tag for the current element." | 1147 "Insert a close-tag for the current element." |
1148 (interactive) | 1148 (interactive) |
1149 (case (car (sgml-lexical-context)) | 1149 (case (car (sgml-lexical-context)) |
1150 (comment (insert " -->")) | 1150 (comment (insert " -->")) |
1151 (cdata (insert "]]>")) | 1151 (cdata (insert "]]>")) |
1152 (pi (insert " ?>")) | 1152 (pi (insert " ?>")) |
1257 (< (point) here) (sgml-at-indentation-p)) | 1257 (< (point) here) (sgml-at-indentation-p)) |
1258 (current-column) | 1258 (current-column) |
1259 (goto-char there) | 1259 (goto-char there) |
1260 (+ (current-column) | 1260 (+ (current-column) |
1261 (* sgml-basic-offset (length context)))))) | 1261 (* sgml-basic-offset (length context)))))) |
1262 | 1262 |
1263 (otherwise | 1263 (otherwise |
1264 (error "Unrecognised context %s" (car lcon))) | 1264 (error "Unrecognised context %s" (car lcon))) |
1265 | 1265 |
1266 ))) | 1266 ))) |
1267 | 1267 |
1738 The first `match-string' should be a number from 1-9. | 1738 The first `match-string' should be a number from 1-9. |
1739 The second `match-string' matches extra tags and is ignored. | 1739 The second `match-string' matches extra tags and is ignored. |
1740 The third `match-string' will be the used in the menu.") | 1740 The third `match-string' will be the used in the menu.") |
1741 | 1741 |
1742 (defun html-imenu-index () | 1742 (defun html-imenu-index () |
1743 "Return an table of contents for an HTML buffer for use with Imenu." | 1743 "Return a table of contents for an HTML buffer for use with Imenu." |
1744 (let (toc-index) | 1744 (let (toc-index) |
1745 (save-excursion | 1745 (save-excursion |
1746 (goto-char (point-min)) | 1746 (goto-char (point-min)) |
1747 (while (re-search-forward html-imenu-regexp nil t) | 1747 (while (re-search-forward html-imenu-regexp nil t) |
1748 (setq toc-index | 1748 (setq toc-index |