Function: snmp-indent-line

snmp-indent-line is a byte-compiled function defined in snmp-mode.el.gz.

Signature

(snmp-indent-line)

Documentation

Indent current line as SNMP MIB code.

Source Code

;; Defined in /usr/src/emacs/lisp/net/snmp-mode.el.gz
(defun snmp-indent-line ()
  "Indent current line as SNMP MIB code."
  (let ((indent (snmp-calculate-indent))
        (pos (- (point-max) (point)))
        shift-amt beg)
    (beginning-of-line)
    (setq beg (point))
    (skip-chars-forward " \t")
    (setq shift-amt (- indent (current-column)))
    (if (zerop shift-amt)
        nil
      (delete-region beg (point))
      (indent-to indent))
    ;; If initial point was within line's indentation,
    ;; position after the indentation.  Else stay at same point in text.
    (if (> (- (point-max) pos) (point))
        (goto-char (- (point-max) pos)))))