Function: dtrt-indent-undo

dtrt-indent-undo is an interactive and natively compiled function defined in dtrt-indent.el.

Signature

(dtrt-indent-undo)

Documentation

Undo any change dtrt-indent made to the indentation offset.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/xl774j723v677bsfsybzln3vi6w0fpm3-emacs-packages-deps/share/emacs/site-lisp/elpa/dtrt-indent-20260709.2011/dtrt-indent.el
(defun dtrt-indent-undo ()
  "Undo any change dtrt-indent made to the indentation offset."
  (interactive)
  (if (null dtrt-indent-original-indent)
      (message "No dtrt-indent override to undo in this buffer")
    (let ((info
           (mapconcat
            (lambda (x)
              ;; x is of the form `(variable value local-variable-p)'
              (if (nth 2 x)
                  ;; variable was originally buffer local
                  (progn
                    (set (nth 0 x)
                         (nth 1 x))
                    (when (>= dtrt-indent-verbosity 1)
                      (format "Note: restored original buffer-local value of %s for %s"
                              (nth 1 x)
                              (nth 0 x))))
                ;; variable was not originally buffer local
                (kill-local-variable (nth 0 x))
                (format "Note: killed buffer-local value for %s, restoring to default %s"
                        (nth 0 x)
                        (eval (nth 1 x)))))
            dtrt-indent-original-indent
            "\n")))
      (when (>= dtrt-indent-verbosity 1)
        (message info))
      (kill-local-variable 'dtrt-indent-original-indent))))