emacs-diffs
[Top][All Lists]
Advanced

[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: Wed, 03 Apr 2002 16:17:40 -0500

Index: emacs/lisp/textmodes/sgml-mode.el
diff -c emacs/lisp/textmodes/sgml-mode.el:1.76 
emacs/lisp/textmodes/sgml-mode.el:1.77
*** emacs/lisp/textmodes/sgml-mode.el:1.76      Wed Apr  3 07:12:59 2002
--- emacs/lisp/textmodes/sgml-mode.el   Wed Apr  3 16:17:38 2002
***************
*** 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 "<!\\[[A-Z]+\\[") (point)))
!           ;; We skipped text and reached a tag.  Parse it.
!           ;; FIXME: Handle net-enabling start-tags
!           (if cdata-start
!               (search-forward "]]>" pos 'move)
!             (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.
--- 872,907 ----
    ;; any string or tag or comment or ...
    (save-excursion
      (let ((pos (point))
!         text-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))
        (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 state
!                 (cond
!                  ((= (point) pos) 
!                   ;; We got to the end without seeing a tag.
!                   nil)
!                  ((looking-at "<!\\[[A-Z]+\\[")
!                   ;; We've found a CDATA section or similar.
!                   (let ((cdata-start (point)))
!                     (unless (search-forward "]]>" pos 'move)
!                       (list 0 nil nil 'cdata nil nil nil nil cdata-start))))
!                  (t
!                   ;; We've reached a tag.  Parse it. 
!                   ;; FIXME: Handle net-enabling start-tags
!                   (parse-partial-sexp (point) pos 0))))))
!       (cond
!        ((eq (nth 3 state) 'cdata) (cons 'cdata (nth 8 state)))
!        ((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.



reply via email to

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