/[emacs]/emacs/lisp/textmodes/sgml-mode.el
ViewVC logotype

Diff of /emacs/lisp/textmodes/sgml-mode.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.81 by mdub, Tue Apr 9 12:26:44 2002 UTC revision 1.82 by mdub, Thu Apr 11 21:58:23 2002 UTC
# Line 889  If nil, start from a preceding tag at in Line 889  If nil, start from a preceding tag at in
889                      (unless (search-forward "]]>" pos 'move)                      (unless (search-forward "]]>" pos 'move)
890                        (list 0 nil nil 'cdata nil nil nil nil cdata-start))))                        (list 0 nil nil 'cdata nil nil nil nil cdata-start))))
891                   (t                   (t
892                    ;; We've reached a tag.  Parse it.                    ;; We've reached a tag.  Parse it.
893                    ;; FIXME: Handle net-enabling start-tags                    ;; FIXME: Handle net-enabling start-tags
894                    (parse-partial-sexp (point) pos 0))))))                    (parse-partial-sexp (point) pos 0))))))
895        (cond        (cond
# Line 1031  immediately enclosing the current positi Line 1031  immediately enclosing the current positi
1031      ;;   enclosing start-tags we'll have to ignore.      ;;   enclosing start-tags we'll have to ignore.
1032      (skip-chars-backward " \t\n")      ; Make sure we're not at indentation.      (skip-chars-backward " \t\n")      ; Make sure we're not at indentation.
1033      (while      (while
1034          (and (or ignore          (and (or ignore
1035                   (not (if full (eq full 'empty) context))                   (not (if full (eq full 'empty) context))
1036                   (not (sgml-at-indentation-p))                   (not (sgml-at-indentation-p))
1037                   (and context                   (and context
# Line 1104  If FULL is non-nil, parse back to the be Line 1104  If FULL is non-nil, parse back to the be
1104      (text      (text
1105       (let ((context (save-excursion (sgml-get-context))))       (let ((context (save-excursion (sgml-get-context))))
1106         (if context         (if context
1107             (progn             (progn
1108               (insert "</" (sgml-tag-name (car (last context))) ">")               (insert "</" (sgml-tag-name (car (last context))) ">")
1109               (indent-according-to-mode)))))               (indent-according-to-mode)))))
1110      (otherwise      (otherwise
# Line 1227  If FULL is non-nil, parse back to the be Line 1227  If FULL is non-nil, parse back to the be
1227          (save-excursion (indent-line-to indent-col))          (save-excursion (indent-line-to indent-col))
1228        (indent-line-to indent-col))))        (indent-line-to indent-col))))
1229    
1230    (defun sgml-guess-indent ()
1231      "Guess an appropriate value for `sgml-basic-offset'.
1232    Base the guessed identation level on the first indented tag in the buffer.
1233    Add this to `sgml-mode-hook' for convenience."
1234      (interactive)
1235      (save-excursion
1236        (goto-char (point-min))
1237        (if (re-search-forward "^\\([ \t]+\\)<" 100 'noerror)
1238            (progn
1239              (set (make-local-variable 'sgml-basic-offset)
1240                   (length (match-string 1)))
1241              (message "Guessed sgml-basic-offset = %d"
1242                       sgml-basic-offset)
1243              ))))
1244    
1245  (defun sgml-parse-dtd ()  (defun sgml-parse-dtd ()
1246    "Simplistic parse of the current buffer as a DTD.    "Simplistic parse of the current buffer as a DTD.
1247  Currently just returns (EMPTY-TAGS UNCLOSED-TAGS)."  Currently just returns (EMPTY-TAGS UNCLOSED-TAGS)."

Legend:
Removed from v.1.81  
changed lines
  Added in v.1.82

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26