[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el
From: |
Mike Williams |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el |
Date: |
Tue, 02 Apr 2002 07:06:26 -0500 |
Index: emacs/lisp/textmodes/sgml-mode.el
diff -c emacs/lisp/textmodes/sgml-mode.el:1.74
emacs/lisp/textmodes/sgml-mode.el:1.75
*** emacs/lisp/textmodes/sgml-mode.el:1.74 Tue Apr 2 06:26:12 2002
--- emacs/lisp/textmodes/sgml-mode.el Tue Apr 2 07:06:26 2002
***************
*** 872,897 ****
;; any string or tag or comment or ...
(save-excursion
(let ((pos (point))
! (state nil)
! textstart)
(if limit (goto-char limit)
;; Hopefully this regexp will match something that's not inside
;; a tag and also hopefully the match is nearby.
(re-search-backward "^[ \t]*<[_:[:alpha:]/%!?#]" nil 'move))
! (setq textstart (point))
(with-syntax-table sgml-tag-syntax-table
(while (< (point) pos)
;; When entering this loop we're inside text.
! (setq textstart (point))
(skip-chars-forward "^<" pos)
! ;; We skipped text and reached a tag. Parse it.
! ;; FIXME: Handle net-enabling start-tags and <![CDATA[ ...]]>.
! (setq state (parse-partial-sexp (point) pos 0)))
(cond
((nth 3 state) (cons 'string (nth 8 state)))
((nth 4 state) (cons 'comment (nth 8 state)))
((and state (> (nth 0 state) 0)) (cons 'tag (nth 1 state)))
! (t (cons 'text textstart)))))))
(defun sgml-beginning-of-tag (&optional top-level)
"Skip to beginning of tag and return its name.
--- 872,900 ----
;; any string or tag or comment or ...
(save-excursion
(let ((pos (point))
! text-start cdata-start state)
(if limit (goto-char limit)
;; Hopefully this regexp will match something that's not inside
;; a tag and also hopefully the match is nearby.
(re-search-backward "^[ \t]*<[_:[:alpha:]/%!?#]" nil 'move))
! ;; (setq text-start (point))
(with-syntax-table sgml-tag-syntax-table
(while (< (point) pos)
;; When entering this loop we're inside text.
! (setq text-start (point))
(skip-chars-forward "^<" pos)
! (setq cdata-start (if (looking-at "<!\\[CDATA\\[") (point)))
! ;; We skipped text and reached a tag. Parse it.
! ;; FIXME: Handle net-enabling start-tags
! (if cdata-start
! (search-forward "]]>" pos 'limit)
! (setq state (parse-partial-sexp (point) pos 0))))
(cond
+ (cdata-start (cons 'cdata cdata-start))
((nth 3 state) (cons 'string (nth 8 state)))
((nth 4 state) (cons 'comment (nth 8 state)))
((and state (> (nth 0 state) 0)) (cons 'tag (nth 1 state)))
! (t (cons 'text text-start)))))))
(defun sgml-beginning-of-tag (&optional top-level)
"Skip to beginning of tag and return its name.
***************
*** 961,968 ****
(point) (progn (skip-syntax-forward "w_") (point))))
(defsubst sgml-looking-back-at (s)
! (let ((limit (max (- (point) (length s)) (point-min))))
! (equal s (buffer-substring-no-properties limit (point)))))
(defun sgml-parse-tag-backward ()
"Parse an SGML tag backward, and return information about the tag.
--- 964,972 ----
(point) (progn (skip-syntax-forward "w_") (point))))
(defsubst sgml-looking-back-at (s)
! (let ((start (- (point) (length s))))
! (and (>= start (point-min))
! (equal s (buffer-substring-no-properties start (point))))))
(defun sgml-parse-tag-backward ()
"Parse an SGML tag backward, and return information about the tag.
***************
*** 1150,1155 ****
--- 1154,1162 ----
(when (and (not mark) (looking-at "--"))
(forward-char 2) (skip-chars-forward " \t"))
(current-column)))
+
+ (cdata
+ (current-column))
(tag
(goto-char (1+ (cdr lcon)))
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Mike Williams, 2002/04/01
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Mike Williams, 2002/04/01
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Stefan Monnier, 2002/04/01
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Mike Williams, 2002/04/02
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el,
Mike Williams <=
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Mike Williams, 2002/04/03
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Mike Williams, 2002/04/03
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Mike Williams, 2002/04/03
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Stefan Monnier, 2002/04/08
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Mike Williams, 2002/04/09
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Mike Williams, 2002/04/09
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Mike Williams, 2002/04/11
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Mike Williams, 2002/04/14
- [Emacs-diffs] Changes to emacs/lisp/textmodes/sgml-mode.el, Mike Williams, 2002/04/16