Function: sgml-guess-indent

sgml-guess-indent is an interactive and byte-compiled function defined in sgml-mode.el.gz.

Signature

(sgml-guess-indent)

Documentation

Guess an appropriate value for sgml-basic-offset.

Base the guessed indentation level on the first indented tag in the buffer. Add this to sgml-mode-hook for convenience.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/sgml-mode.el.gz
(defun sgml-guess-indent ()
  "Guess an appropriate value for `sgml-basic-offset'.
Base the guessed indentation level on the first indented tag in the buffer.
Add this to `sgml-mode-hook' for convenience."
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (if (re-search-forward "^\\([ \t]+\\)<" 500 'noerror)
        (progn
          (setq-local sgml-basic-offset (1- (current-column)))
          (message "Guessed sgml-basic-offset = %d"
                   sgml-basic-offset)
          ))))